Abstract
High-quality synthetic data is a critical requirement for developing robust medical AI, yet researchers in cardiology often face a double-bind: the need for massive datasets versus the reality of small, poorly labeled, or privacy-restricted clinical records. This paper introduces ECGAN, a novel generative model designed to produce realistic electrocardiography (ECG) signals. Unlike standard generative models that attempt to map noise directly to complex biological signals, ECGAN utilizes a self-supervised "warm-up" phase to learn the underlying physics and morphology of the heart. By combining recurrent autoencoders with Wasserstein GAN (WGAN) principles, ECGAN achieves superior morphological realism and diversity compared to existing state-of-the-art models.
Introduction
Training deep learning models for arrhythmia detection requires vast amounts of labeled data. However, rare heart conditions are inherently difficult to capture in clinical datasets, and sharing existing medical data is often restricted by strict privacy regulations. While Generative Adversarial Networks (GANs) offer a potential solution by creating synthetic data, they frequently struggle with time-series data like ECGs. Standard GAN architectures often suffer from mode collapse—producing repetitive patterns—or fail to capture the precise "morphology" (the timing and shape of P, Q, R, S, and T waves) essential for clinical diagnosis. ECGAN addresses these challenges by providing the generator with a foundational understanding of ECG structures before adversarial competition begins.
Methodology
The core innovation of ECGAN is its two-phase training approach, which bridges the gap between simple reconstruction and complex generation.
1. The Self-Supervised Module (SSL)
Before the adversarial phase, the model functions as a recurrent autoencoder. It processes real, unlabeled ECG signals, compressing them into a latent space and subsequently reconstructing them. This "warm-up" phase teaches the generator the "primitive knowledge" of ECG peaks, durations, and sequential logic.
2. Adversarial Training
Once the generator understands the basic structure of a heartbeat, the learned weights are transferred to the GAN framework. ECGAN employs a Wasserstein GAN (WGAN) architecture with gradient clipping to ensure training stability. The architecture is hybridized to leverage different neural strengths:
- Generator: Uses Long Short-Term Memory (LSTM) networks to capture long-term sequential dependencies and temporal flow.
- Discriminator: Uses 1D Convolutional Neural Networks (CNNs) to focus on local morphological patterns and sharp feature detection.
Experimental Setup
The researchers evaluated ECGAN using two gold-standard open-access datasets from PhysioNet:
- MIT-BIH Arrhythmia Database: 48 half-hour ambulatory ECG recordings featuring diverse cardiac conditions.
- BIDMC Congestive Heart Failure Database: Long-term recordings from 15 subjects with severe heart failure.
The study specifically focused on the model's ability to generate and distinguish between "Normal" rhythms and "Premature Ventricular Contractions" (PVCs).
Results and Discussion
ECGAN significantly outperformed state-of-the-art models, including TimeGAN, WaveGAN, and SpecGAN, across several key dimensions:
Morphological Fidelity
On the MIT-BIH dataset, ECGAN achieved a Frechét Inception Distance (FID) of 45.49, a substantial improvement over TimeGAN (113.81) and WaveGAN (151.22). A lower FID indicates that the synthetic distribution is much closer to the real-world data distribution.
Diversity and Distribution
T-SNE visualizations confirmed that ECGAN’s synthetic samples covered the same spatial distribution as real data. In contrast, competing models often clustered in narrow, repetitive modes, indicating a failure to capture the full variety of human heartbeats.
Downstream Utility
To test the "functionality" of the data, synthetic ECGAN samples were added to the training set of a standard arrhythmia classifier. The resulting model achieved an F1-score of approximately 0.997, demonstrating that the synthetic data contains the necessary diagnostic features to train reliable clinical tools.
The Importance of SSL
An ablation study highlighted the necessity of the self-supervised phase. When the SSL component was removed (ECGAN$_{NO-SSL}$), the FID score plummeted from 45.49 to 1189.46. This confirms that pre-training the generator on the basic structure of a heartbeat is the "secret sauce" that prevents the model from failing during the initial stages of adversarial training.
Conclusion
ECGAN represents a significant step forward in synthetic medical signal generation. By incorporating self-supervised weight sharing, the model overcomes the "rough start" problem common in GANs. While currently optimized for single-lead ECGs, future work will focus on expanding the architecture to 12-lead multi-lead synthesis and adapting the framework for other biological signals, such as Electroencephalography (EEG) or Vectorcardiography (VCG).
Summary updated