Related Experiment Video
Updated: Aug 5, 2026

Implementation of a Real-Time Psychosis Risk Detection and Alerting System Based on Electronic Health Records using CogStack
Published on: May 15, 2020
Improving Clinical Validity in Synthetic Electronic Health Record Generation Using Best-of-N Sampling: Comparative
Md Akmol Masud1, Mahmud Hasan2
1Department of Electrical and Computer Engineering, Queen's University, 99 University Ave, Kingston, ON, K7L 3N6, Canada, +880 1304963440.
Background:
Synthetic electronic health record generation is limited not only by statistical fidelity but also by clinical validity. Records that appear statistically plausible may still violate hard structural, physiological, or relational constraints.
Objective:
This study evaluated best-of-N constraint-minimizing selection as an inference-time strategy for improving clinical validity and characterized when such selection succeeds or fails as a function of the generator's valid support mass (pvalid).
Methods:
We evaluated Wasserstein generative adversarial network with gradient penalty (WGAN-GP) and conditional tabular generative adversarial network (CTGAN) on 3 public clinical tabular datasets: stroke prediction (n=5110), diabetes health indicators (n=100,000), and cardiovascular disease (n=68,599). For each generator, we compared random sampling, naive clipping, and best-of-N selection (N ∈ {8, 16, 128}). Validity was assessed via dataset-specific rule violations; fidelity via Kolmogorov-Smirnov (KS) statistics and correlation preservation; utility via TSTR (train-on-synthetic-test-on-real) AUC (area under the receiver operating characteristic curve); and privacy via membership inference attack (MIA) AUC and distance to closest record (DCR).
Results:
Best-of-N effectiveness was governed by the base generator's valid support mass. In stroke, WGAN-GP had pvalid=0, and all selection strategies, including strict rejection across 5000 draws, produced 500/500 (100%) invalid samples. In cardiovascular data, WGAN-GP had pvalid=0.12; best-of-16 reduced violations from 441/500 (88.2%) to 65/500 (13.0%), and best-of-128 eliminated them entirely (0/500), matching theoretical predictions exactly. In diabetes, WGAN-GP random sampling was already fully valid (0/500 violations), and best-of-N primarily shifted utility. Across all 3 datasets, CTGAN+best-of-16 achieved 0/500 violations with strong fidelity (mean KS≤0.12) and utility (TSTR AUC up to 0.81). MIA AUC remained near-random guessing (approximately 0.50) throughout, though DCR-based proximity concentration increased markedly under CTGAN selection (reaching 22.6% on stroke and 100% on cardiovascular data).
Conclusions:
Best-of-N functions as a bounded-budget feasibility filter rather than a universal repair mechanism. Its effectiveness depends critically on the generator's valid support mass. CTGAN+best-of-16 offered the strongest overall trade-off across clinical validity, fidelity, utility, and privacy in our experiments.
Related Concept Videos
Contaminants and Errors
Another key consideration is determining the appropriate number of samples required to...
Sampling Plans
Random sampling is a method where each member of the population has an equal chance of being selected for the sample. It involves selecting individuals randomly, often using random number generators or lottery-type methods. For example, when analyzing the properties of a...
Data Collection by Experiments
An example of the experimental method is a public clinical trial...
Statistical Software for Data Analysis and Clinical Trials
Types of Biopharmaceutical Studies: Controlled and Non-Controlled Approaches
Non-controlled studies, commonly employed for initial exploration, lack a control group, rendering them susceptible to biases and external influences. In contrast, controlled...
Sampling Methods: Overview
In analytical chemistry, the choice of sampling...
