TL;DR
TimEHR is a novel generative framework that creates high-fidelity synthetic Electronic Health Record (EHR) time series by treating them as 2D images. By using a two-stage GAN architecture to separately model "missingness patterns" and clinical values, it outperforms existing state-of-the-art methods in data realism, clinical utility, and patient privacy.
What Problem Does This Paper Address?
Electronic Health Records (EHRs) are a goldmine for clinical research, but they are notoriously difficult to work with. They are governed by strict privacy regulations (like HIPAA and GDPR) and are characterized by "messy" data: irregular sampling, high dimensionality, and informative missingness.
In a hospital, a doctor doesn't order a blood test at random; they order it because they suspect a specific condition. This means the presence or absence of data is often as predictive as the values themselves. Most existing generative models (like those based on RNNs or 1D-CNNs) struggle to capture these non-random patterns or require complex architectures to handle irregular time steps. TimEHR aims to solve this by reframing time series generation as an image-to-image translation task.
Methods
The core innovation of TimEHR is the "Time Series to Image" transformation. Each patient's record is reshaped into a two-channel 2D image:
- Value Channel: A matrix where rows are clinical variables (e.g., heart rate, glucose) and columns are time bins.
- Mask Channel: A binary matrix indicating whether a measurement was taken at a specific time.
The generation process is split into two independent modules:
- Module 1 (CWGAN-GP): A Conditional Wasserstein GAN with Gradient Penalty that generates the Mask Channel (the missingness pattern) based on noise and static patient data (like age or outcome).
- Module 2 (Pix2Pix): An image-to-image translation GAN that takes the generated mask and static data as input to produce the corresponding Value Channel.
By decoupling these steps, the model first learns the "clinical logic" of when tests are ordered before attempting to synthesize the actual physiological values.
Datasets
The authors evaluated TimEHR on three major real-world EHR benchmarks and one simulated dataset:
- MIMIC-III: A massive database of ICU stays (51k patients, 48 variables).
- Physionet Challenge 2012 (P12): Focused on mortality prediction (12k patients, 35 variables).
- Physionet Challenge 2019 (P19): Focused on sepsis detection (38k patients, 32 variables).
- Simulated Sinusoidal Data: Used to test the model's scalability up to 128 variables and 128 time steps.
Key Insights and Ideas
- 2D-CNNs for Time Series: While 1D-CNNs are standard for sequences, 2D-CNNs allow the model to capture correlations across different variables (spatial) and across time (temporal) simultaneously.
- Informative Missingness as a Feature: Instead of trying to "fix" missing data, TimEHR treats the missingness pattern as a primary structure to be generated. This captures the "intent" of the clinicians.
- The "Aha" Moment in Privacy: Through ablation studies, the authors found that if they removed the noise from the first module, the model achieved "perfect" fidelity but failed privacy tests. This proved that the GAN's stochastic nature is essential for preventing the model from simply memorizing and "leaking" real patient data.
- Order Invariance: Interestingly, while the variables are arranged in a specific order in the image, the CNN architecture is robust enough to capture correlations even between variables that are far apart in the matrix.
Key Results
TimEHR consistently outperformed the leading baseline, RTSGAN, across several dimensions:
- Fidelity: In the P12 dataset, TimEHR achieved a "coverage" score of 0.782 compared to RTSGAN's 0.381, indicating the synthetic data much more closely matches the distribution of real patients.
- Utility (TSTR): Using the "Train on Synthetic, Test on Real" protocol, a classifier trained on TimEHR data achieved an AUROC of 0.853 for sepsis prediction (P19), nearly matching the performance of a classifier trained on real data (0.908) and far exceeding RTSGAN (0.677).
- Correlation Preservation: Visualization of correlation matrices showed that TimEHR successfully captures the complex relationships between physiological variables (e.g., the relationship between different blood pressure metrics), which baselines often missed.
Limitations and Future Work
- Fixed Image Dimensions: The current approach uses a fixed image size (e.g., 64x64). While this covers most ICU stays, very long-term records might require clipping or more complex multi-scale architectures.
- Formal Privacy Guarantees: While the model passed empirical privacy attacks (MIA and NNAA), it does not yet incorporate formal Differential Privacy (DP) frameworks, which the authors identify as a key area for future work.
- Regularly Sampled Data: The authors noted that the Pix2Pix module is less useful for data that has no missingness, suggesting the model is specifically optimized for the "messy" reality of hospital records.
Summary updated