ABC-GAN: An Attention-Based Conditional GAN with DTW Loss for ECG Signal Generation to Address Class Imbalance
الموضوعات : Signal Processing
Parmida Behain
1
,
Noushin Riahi
2
1 - Computer Engineering Department, Alzahra University, Tehran, Iran
2 - Computer Engineering Department, Alzahra University, Tehran, Iran
الکلمات المفتاحية: ECG Signal Synthesis, Generative Adversarial Network (GAN), Attention Mechanism, Conditional GAN, Dynamic Time Warping (DTW), Class Imbalance, Data Augmentation,
ملخص المقالة :
The imbalance between normal and pathological cases in Electrocardiogram (ECG) datasets significantly degrades the performance of automated deep learning-based diagnostic systems, particularly for minority classes. This paper introduces ABC-GAN, a novel Attention-Based Conditional Generative Adversarial Network designed to mitigate this critical data imbalance by generating high-fidelity, class-specific synthetic ECG signals. Our proposed model incorporates two key innovations: an attention mechanism within the generator to focus on critical morphological features of the ECG waveform, and the integration of Dynamic Time Warping (DTW) as a distance metric in the generator's loss function to better preserve essential temporal dynamics. Trained and thoroughly evaluated on the MIT-BIH Arrhythmia dataset across seven different heartbeat classes, ABC-GAN successfully generates highly realistic signals that closely match the original data's distribution. When used to augment the training set, these synthetic signals significantly enhance classifier performance and generalization. A downstream classifier achieved an accuracy of 95%, representing a substantial improvement over the baseline trained on the raw imbalanced data and clearly outperforming both standard oversampling techniques and a vanilla Conditional GAN (cGAN). The overall findings demonstrate that ABC-GAN is a powerful and effective tool for data augmentation, fully capable of improving diagnostic accuracy in cardiac research and practical clinical applications.
[1] G. Chen et al., "EmotionalGAN: Generating ECG to Enhance Emotion State Classification," 2019.
[2] E. Adib, F. Afghah, and J. J. Prevost, "Arrhythmia Classification using CGAN-augmented ECG Signals," arXiv preprint arXiv:2201.12345, 2022.
[3] N. P. Singh et al., "Remote Monitoring System of Heart Conditions for Elderly," Journal of Information Systems and Telecommunication (JIST), (accessed online).
[4] A. Sandooghdar and F. Yaghmaee, "Deep Learning Approach for Cardiac MRI Images," Journal of Information Systems and Telecommunication (JIST), vol. 10, no. 37, pp. xx–yy, 2022.
[5] A. Halder Roy, "Integrating Questionnaires and Physiological Signals for Stress Detection," Journal of Information Systems and Telecommunication (JIST), Jul. 2025.
[6] F. Zhu et al., "Electrocardiogram generation with a bidirectional LSTM-CNN generative adversarial network," Scientific Reports, vol. 9, no. 1, p. 107, 2019.
[7] Y.-H. Zhang and S. Babaeizadeh, "Synthesis of standard 12-lead electrocardiograms using two-dimensional generative adversarial networks," Journal of Electrocardiology, vol. 69, pp. 1–9, 2021.
[8] N. Wulana et al., "Generating electrocardiogram signals by deep learning," Neurocomputing, vol. 404, pp. 1–11, 2020.
[9] P. Wang et al., "ECG Arrhythmias Detection Using Auxiliary Classifier Generative Adversarial Network and Residual Network," IEEE Access, vol. 7, pp. 1–10, 2019.
[10] W. Li et al., "SLC-GAN: An automated myocardial infarction detection model based on generative adversarial networks and convolutional neural networks with single-lead electrocardiogram synthesis," Information Sciences, vol. 589, pp. 1–12, 2021.
[11] H. Yang et al., "ProEGAN-MS: A Progressive Growing Generative Adversarial Networks for Electrocardiogram Generation," IEEE Access, vol. 9, pp. 1–10, 2021.
[12] S. Dasgupta, S. Das, and U. Bhattacharya, "CardioGAN: An Attention-based Generative Adversarial Network for Generation of Electrocardiograms," in Proc. 25th ICPR, 2021.
[13] R. Banerjee and A. Ghose, "Synthesis of Realistic ECG Waveforms Using a Composite Generative Adversarial Network for Classification of Atrial Fibrillation," in Proc. 29th EUSIPCO, 2021.
[14] X. Li et al., "TTS-GAN: A Transformer-Based Time-Series Generative Adversarial Network," in Artificial Intelligence in Medicine. AIME 2022. LNCS, vol. 13263, Springer, 2022.
[15] E. Brophy, "Synthesis of Dependent Multichannel ECG using Generative Adversarial Networks," in Proc. 29th ACM CIKM, 2020.
[16] S. Harada, H. Hayashi, and S. Uchida, "Biosignal Data Augmentation Based on Generative Adversarial Networks," in EMBC 2018, 2018.
[17] J. Chen et al., "ME-GAN: Learning Panoptic Electrocardio Representations for Multi-view ECG Synthesis Conditioned on Heart Diseases," in ICML 2022, 2022.
[18] F. Ye et al., "ECG Generation With Sequence Generative Adversarial Nets Optimized by Policy Gradient," IEEE Access, vol. 7, pp. 1–10, 2019.
[19] V. V. Kuznetsov et al., "Interpretable Feature Generation in ECG Using a Variational Autoencoder," Frontiers in Genetics, vol. 12, p. 634, 2021.
[20] T. Golany and K. Radinsky, "PGANs: Personalized Generative Adversarial Networks for ECG Synthesis to Improve Patient-Specific Deep ECG Classification," in AAAI 2019, 2019.
[21] M. S. Munia, M. Nourani, and S. Houari, "Biosignal Oversampling Using Wasserstein Generative Adversarial Network," in ICHI 2020, 2020.
[22] D. Nankani and R. D. Baruah, "Investigating Deep Convolution Conditional GANs," in IJCNN 2020, 2020.
[23] F. N. Hatamian et al., "The Effect of Data Augmentation on Classification of Atrial Fibrillation in Short Single-Lead," in ICASSP 2020, 2020.
[24] T. Agarwal and E. Ertin, "CardiacGen: A Hierarchical Deep Generative Model for ECG Synthesis," 2022.
[25] E. Adib et al., "Synthetic ECG Signal Generation Using Probabilistic Diffusion Models," IEEE Access, vol. 11, pp. 75818–75828, 2023.
[26] M. Mirza and S. Osindero, "Conditional Generative Adversarial Nets," arXiv preprint arXiv:1411.1784, 2014.
[27] I. Goodfellow et al., "Generative Adversarial Nets," in Advances in Neural Information Processing Systems (NIPS), 2014, pp. 2672–2680.
[28] A. Vaswani et al., "Attention Is All You Need," in Advances in Neural Information Processing Systems (NIPS), 2017, pp. 5998–6008.
[29] H. Zhang, I. Goodfellow, D. Metaxas, and A. Odena, "Self-Attention Generative Adversarial Networks," in Proc. ICML, 2019, pp. 7354–7363.
[30] M. Arjovsky, S. Chintala, and L. Bottou, "Wasserstein Generative Adversarial Networks," in Proc. 34th ICML, 2017.
[31] A. Lyashuk, "ECG Classification," [Online]. Available: https://github.com/lxdv/ecgclassification/blob/master/README.md, 2021.
[32] K. He et al., "Deep residual learning for image recognition," in Proc. IEEE Conf. CVPR, 2016, pp. 770–778.
[33] G. B. Moody and R. G. Mark, "The impact of the MIT-BIH Arrhythmia Database," IEEE Engineering in Medicine and Biology Magazine, vol. 20, no. 3, pp. 45–50, 2001.
[34] A. M. Delaney, E. Brophy, and T. E. Ward, "Synthesis of realistic ECG using generative adversarial networks," arXiv preprint arXiv:1903.09633, 2019.
[35] S. Harada, H. Hayashi, and S. Uchida, "Biosignal Generation and Latent Variable Analysis With Recurrent Generative Adversarial Networks," IEEE Access, vol. 7, pp. 1–10, 2019.
[36] K. F. Hossain et al., "ECG-Adv-GAN: Detecting ECG Adversarial Examples with Conditional Generative Adversarial Networks," in Proc. 20th IEEE ICMLA, 2021.
[37] A. M. Shaker et al., "Generalization of Convolutional Neural Networks for ECG Classification Using Generative Adversarial Networks," IEEE Access, vol. 8, pp. 1–10, 2020.
[38] T. Golany et al., "Improving ECG Classification Using Generative Adversarial Networks," in IAAI-20, 2020.
[39] A. Furdui et al., "AC-WGAN-GP: Augmenting ECG and GSR Signals using Conditional Generative Models for Arousal Classification," 2021.
[40] Y.-Y. Jo et al., "ECGT2T: Towards Synthesizing Twelve-Lead Electrocardiograms from Two Asynchronous Leads," in ICASSP 2023, pp. 1–5.
[41] T. Lan et al., "Arrhythmias Classification Using Short-Time Fourier Transform," in EMBC 2020, 2020.
[42] A. Goldberger et al., "Components of a new research resource for complex physiologic signals: PhysioBank, PhysioToolkit, and PhysioNet," Circulation, vol. 101, no. 23, pp. E215–E220, 2000.
