Improving ECG Classification Using Generative Adversarial Networks

Tomer Golany, Gal Lavee, Shai Tejman Yarden, Kira Radinsky

Abstract

Automated electrocardiogram (ECG) classification is often hindered by the scarcity of data for rare arrhythmias and the high degree of morphological variability between patients. This study proposes a novel approach using Generative Adversarial Networks (GANs) to synthesize structurally valid heartbeat signals for data augmentation. By training a Long Short-Term Memory (LSTM) network on a combination of real and synthetic data, the researchers achieved significant performance gains, particularly in identifying rare cardiac conditions.

The Challenge: Data Scarcity and Variability

Electrocardiogram (ECG) analysis is fundamental to cardiac diagnosis. However, deep learning models for ECG classification face two primary obstacles:

  1. Data Imbalance: While "Normal" heartbeats are abundant, life-threatening arrhythmias are rare, making it difficult for models to learn their specific features.
  2. Inter-patient Variability: Each individual has a unique cardiac electrical signature. A model trained on one patient cohort often fails to generalize to others due to differences in the morphology of the PQRST waves.

Methodology: GAN-Based Augmentation and LSTM Classification

To address these hurdles, the authors developed a two-stage pipeline.

1. Synthetic Data Generation

The researchers adapted the Deep Convolutional GAN (DCGAN) architecture for 1D signals. Five separate GANs were trained, one for each standard heartbeat class. The Generator learns to transform random noise into synthetic ECG signals that mimic the physiological structure of real heartbeats, while the Discriminator learns to differentiate between real and synthetic samples.

Morphology of a standard ECG heartbeat showing the P, Q, R, S, and T waves.

2. Sequence-Based Classification

Instead of using traditional feed-forward networks, the study utilizes Long Short-Term Memory (LSTM) networks. LSTMs are specifically designed to handle sequential data, allowing the model to capture the temporal evolution and dependencies within a single heartbeat.

Experimental Setup

The models were evaluated using the MIT-BIH Arrhythmia Database. Heartbeats were categorized into five AAMI standard classes: Normal (N), Supraventricular (S), Ventricular (V), Fusion (F), and Unknown (Q). To ensure clinical relevance, the authors employed a patient-independent split, testing the model on patients entirely absent from the training set.

Key Results and Insights

The integration of GAN-generated data led to substantial improvements in classification accuracy across all categories.

  • Superiority of GANs over Jittering: Traditional augmentation methods like "jittering" (adding random noise) often degrade performance by making the signal structurally inconsistent. In contrast, GANs generate structurally valid variations that help the model generalize. For Class N, GAN augmentation reached an AUC of 0.91, whereas jittering reduced it to 0.76.
  • Performance Gains in Rare Classes: The most dramatic improvements were seen in rare arrhythmias. For Class S (Supraventricular), the AUC rose from 0.82 to 0.92 with GAN augmentation.
  • LSTM vs. Feed-Forward: The temporal nature of LSTMs proved critical. For "Fusion" beats (Class F), the LSTM achieved an AUC of 0.95, while a standard fully-connected network performed no better than random chance (0.50 AUC).
Impact of synthetic data augmentation on classification performance (AUC) for LSTM vs. Feed-Forward (FF) models.

Conclusion and Future Directions

This research demonstrates that GAN-based data augmentation is a powerful tool for medical AI, particularly when dealing with imbalanced datasets. While the results are promising, future work could explore Conditional GANs (cGANs) to streamline the generation process and investigate model robustness against real-world clinical noise.

Summary updated

Abstract

The Electrocardiogram (ECG) is performed routinely by medical personell to identify structural, functional and electrical cardiac events. Many attempts were made to automate this task using machine learning algorithms. Numerous supervised learning algorithms were proposed, requiring manual feature extraction. Lately, deep neural networks were also proposed for this task for reaching state-of-the-art results. The ECG signal conveys the specific electrical cardiac activity of each subject thus extreme variations are observed between patients. These variations and the low amount of training data available for each arrhythmia are challenging for deep learning algorithms, and impede generalization. In this work, the use of generative adversarial networks is studied for the synthesis of ECG signals, which can then be used as additional training data to improve the classifier performance. Empirical results prove that the generated signals significantly improve ECG classification.
BibTeX
@inproceedings{golany2020improving,
  author = {Tomer Golany and Gal Lavee and Shai Tejman Yarden and Kira Radinsky},
  title = {{Improving ECG Classification Using Generative Adversarial Networks}},
  booktitle = {AAAI Conference on Artificial Intelligence},
  year = {2020},
  doi = {10.1609/aaai.v34i08.7037},
}
Figure