Abstract
Arrhythmia diseases seriously damage people's life and health, and identifying abnormal points in ECG signals by deep neural networks is an effective method for detecting arrhythmias. However, their accuracy is often limited by the biased data distribution of the training set, and a large number of labeled ECG signals are usually harder to obtain. Therefore, this paper proposes to synthesize virtual heart beat data by denoising diffusion probability model (DDPM) based on the MIT-BIH arrhythmia database to complement the real data. Three different methods for generating heartbeat signals are also used, which are (i) generating heartbeat signals directly, (ii) generating time-frequency maps of heartbeats and transforming them into heartbeat signals, and (iii) generating sub-signals of heartbeats and fusing them into complete heartbeat signals. Regarding the evaluation of the synthesized signals, we compare the advantages and disadvantages of the three heartbeat generation methods by four metrics: DTW, PCC, ED and KLD. The experimental results showed that the optimum values of 4.37, 17.09, 0.972 and 0.0094 were obtained for ED, DTW of method (i) and PCC, KLD of method (iii), respectively.
Introduction
Deep learning has revolutionized arrhythmia detection, but these models are data-hungry. In clinical practice, ECG datasets are often "long-tailed" or highly imbalanced: while there are millions of "normal" heartbeats, there are relatively few examples of specific pathologies like Left Bundle Branch Block (LBBB) or Premature Ventricular Contractions (PVC).
While researchers have previously used Generative Adversarial Networks (GANs) and Variational Autoencoders (VAEs) to synthesize data, these methods have known flaws. GANs are notoriously unstable to train and often suffer from "mode collapse," where they produce a limited variety of samples. This paper investigates whether Denoising Diffusion Probabilistic Models (DDPMs)—the technology behind state-of-the-art image generators—can provide a more stable and diverse alternative for medical time-series data.
Methodology
The authors implemented a DDPM framework using an Attention U-Net as the backbone. The core idea of diffusion is a two-step process: Forward Diffusion, which gradually adds Gaussian noise to a real ECG signal until it becomes pure noise, and Reverse Diffusion, where the model learns to "undo" this noise step-by-step to recover a clean signal.
The study compared three distinct generation pipelines:
- Signal-diffusion: Generating the 1D heartbeat signal directly.
- Spectro-diffusion: Converting signals into 2D time-frequency maps via Short-Time Fourier Transform (STFT), generating new maps, and converting them back to signals via Inverse STFT (ISTFT).
- Wavelet-diffusion: Decomposing the signal into four frequency sub-bands using wavelets, generating each sub-signal individually, and then fusing them.
The researchers used the gold-standard MIT-BIH Arrhythmia Database, focusing on four classes: Normal (N), Left bundle branch block (L), Right bundle branch block (R), and Premature ventricular contractions (V). Signals were filtered (0.5-45 Hz) and segmented into individual heartbeats of 256 samples each.
Results and Discussion
The models were evaluated using four metrics: Euclidean Distance (ED), Dynamic Time Warping (DTW), Pearson Correlation Coefficient (PCC), and KL Divergence (KLD).
- Signal-diffusion was the winner for morphological similarity, achieving the lowest ED (4.37) and DTW (17.09).
- Wavelet-diffusion was the winner for statistical fidelity, achieving the best PCC (0.972) and the lowest KLD (0.0094).
- Spectro-diffusion performed the worst, likely due to information loss during the STFT/ISTFT conversion process.
Visual inspection confirmed that the synthetic heartbeats were highly consistent with real signals in terms of waveform morphology and rhythm location. The paper highlights a trade-off: direct signal generation is best at mimicking the exact "shape" (morphology) of a heartbeat, while wavelet-based generation is superior at capturing underlying statistical distributions.
Conclusion
This study demonstrates that DDPMs can generate high-fidelity synthetic ECG heartbeats, addressing the chronic shortage of labeled data for rare arrhythmias. The diffusion approach avoids the gradient issues common in GAN training, making it a robust tool for data augmentation. Future work will involve using this synthetic data to train classifiers and exploring more advanced reconstruction algorithms to improve time-frequency based generation.
Summary updated