Generating Electronic Health Records with Multiple Data Types and Constraints

Chao Yan, Ziqi Zhang, Steve Nyemba, Bradley A. Malin

Introduction

Sharing Electronic Health Record (EHR) data is a cornerstone of modern medical research, yet privacy regulations and the risk of patient re-identification create significant barriers to data accessibility. While Generative Adversarial Networks (GANs) have emerged as a promising solution for creating synthetic, privacy-preserving EHRs, existing models often struggle with two critical issues: data silos and logical inconsistency. Most current methods focus on a single data type (e.g., diagnosis codes) and frequently produce "medical nonsense," such as records where a patient's diastolic blood pressure exceeds their systolic pressure.

To address these challenges, researchers have developed HGAN (Heterogeneous GAN), a generative model designed to synthesize complex EHRs containing binary, categorical, and continuous variables simultaneously while enforcing strict medical logic.

The HGAN Framework

HGAN builds upon the Wasserstein GAN (WGAN) framework, introducing several architectural and functional innovations to handle the heterogeneity of medical data.

Constraint Violation Penalty

A primary innovation of HGAN is the integration of a "constraint violation penalty" directly into the GAN’s loss function. By penalizing the generator when it produces records that violate known medical rules (e.g., $min\_BMI > median\_BMI$), the model is forced to learn the physical and logical boundaries of medical reality. This ensures that synthetic patients remain clinically plausible.

Architectural Refinement

Standard deep learning models typically apply normalization before activation. HGAN reorders these layers into a ReLU → Conditional Normalization → ReLU sequence. This design choice encourages "sparsity" in internal signals, which helps the model more effectively disentangle the complex, non-linear relationships between different data types, such as the correlation between a specific diagnosis and a vital sign range.

The HGAN architecture featuring the constraint violation penalization and refined layer ordering.

Experimental Setup and Datasets

The model was trained and evaluated using data from the Vanderbilt University Medical Center (VUMC) Synthetic Derivative (SD), a de-identified warehouse of over 2.2 million records. The study focused on a refined subset of 770,231 records, incorporating 693 ICD-9 diagnosis codes, 65 CPT-4 procedure codes, demographic data (age, gender), and continuous vital signs (BMI and blood pressure metrics).

Key Results and Utility

HGAN was evaluated against three primary utility measures to ensure the synthetic data remained useful for clinical validation:

  1. Constraint Violation Test (CVT): HGAN successfully eliminated nearly all instances of impossible vital signs, a feat standard GANs failed to achieve.
  2. Frequent Association Rules (FAR): The model demonstrated a superior ability to preserve complex medical relationships (e.g., the co-occurrence of specific diseases and procedures) compared to the previous state-of-the-art, EMR-CWGAN.
  3. Cross-type Conditional Distribution (CCD): HGAN accurately captured how continuous variables, like blood pressure, vary across different demographics and diagnostic categories.
Comparison of real vs. synthetic data distributions across different models. HGAN (d) shows the closest alignment to the real data distribution (a) compared to EMR-CWGAN (b) and the unconstrained HGAN-U (c).

Privacy and Sparsity

One of the most significant findings was the "Privacy Paradox": generating more detailed, heterogeneous data actually lowered the success rate of membership and attribute inference attacks. The increased complexity of the feature space makes it harder for attackers to identify a synthetic record that perfectly matches a real individual. Furthermore, by encouraging sparsity in the network, HGAN proved exceptionally capable of representing the "long tail" of rare medical codes, which are traditionally difficult for generative models to capture accurately.

Conclusion and Future Work

HGAN represents a significant leap forward in generating high-fidelity, multi-type synthetic EHRs. By enforcing medical constraints and optimizing for data sparsity, it provides a robust framework for sharing research-ready data without compromising patient privacy. Future work will focus on incorporating temporal dynamics to model patient trajectories over time and scaling the architecture to handle the tens of thousands of features found in full-scale clinical environments.

Summary updated

BibTeX
@inproceedings{yan2020generating,
  author = {Chao Yan and Ziqi Zhang and Steve Nyemba and Bradley A. Malin},
  title = {{Generating Electronic Health Records with Multiple Data Types and Constraints}},
  booktitle = {AMIA},
  year = {2020},
  url = {https://openreview.net/forum?id=oYbUhAYq04},
}
Figure