Abstract
In this paper, we focus on a new method of data augmentation to solve the data imbalance problem within imbalanced ECG datasets to improve the robustness and accuracy of heart disease detection. By using Optimal Transport, we augment the ECG disease data from normal ECG beats to balance the data among different categories. We build a Multi-Feature Transformer (MF-Transformer) as our classification model, where different features are extracted from both time and frequency domains to diagnose various heart conditions. Learning from 12-lead ECG signals, our model is able to distinguish five categories of cardiac conditions. Our results demonstrate 1) the classification models' ability to make competitive predictions on five ECG categories; 2) improvements in accuracy and robustness reflecting the effectiveness of our data augmentation method.
Introduction
The "Achilles' heel" of many medical AI applications is data imbalance. In the case of Electrocardiograms (ECG), healthy "Normal" readings are abundant, while specific cardiac conditions (like Hypertrophy or Myocardial Infarction) are relatively rare in datasets. When a machine learning model is trained on such imbalanced data, it develops a bias toward the majority class, often failing to detect the very diseases it was designed to find. Traditional solutions like oversampling or SMOTE often lead to overfitting or generate "noisy" samples that don't respect physiological realities. This research introduces a novel data augmentation strategy using Optimal Transport (OT) to generate diverse and medically plausible synthetic data.
Methodology
The researchers propose a two-pronged approach involving a sophisticated data pipeline and a specialized transformer architecture.
Optimal Transport (OT) Augmentation
Instead of simple duplication, the authors use OT to "push" samples from a majority class (Normal) toward a minority disease class. They treat the data as probability distributions and move them along a geodesic in Wasserstein space. Crucially, the "distance" (ground metric) used for this transport is calculated based on physiological features, ensuring the generated signals stay on a realistic manifold. The Sinkhorn algorithm is employed to solve this transport problem efficiently.
Multi-Feature Transformer (MF-Transformer)
While many models only look at raw temporal ECG data, the researchers developed a Transformer encoder that ingests three distinct inputs: raw ECG waveforms, time-domain features (statistical measures like mean, skewness, and kurtosis), and frequency-domain features (extracted via Fast Fourier Transform).
By combining these, the model gains a more holistic understanding of the heart's electrical activity. The architecture utilizes multi-head attention blocks to process these concatenated features effectively, followed by a linear and softmax layer for final classification.
Experimental Setup and Results
Datasets
The study utilizes the PTB-XL dataset, a clinical 12-lead ECG signal collection containing 10-second recordings from nearly 30,000 patients. The data is categorized into five classes: Normal (NORM), Myocardial Infarction (MI), ST/T Change (STTC), Conduction Disturbance (CD), and Hypertrophy (HYP). The NORM category represents over 36% of the beats, while HYP accounts for only ~10%, illustrating the clear need for augmentation.
Key Results
The proposed method was tested against several baselines, including standard oversampling, SMOTE, and ADASYN.
- Top Performance: The OT-augmented MF-Transformer achieved an AUROC of 0.944 and an F1-score of 0.738, outperforming all other augmentation techniques (the next best, GeoECG, reached 0.931 AUROC).
- Balanced Accuracy: Confusion matrices revealed that without augmentation, the model struggled with Hypertrophy (HYP). With OT augmentation, the accuracy for HYP jumped significantly, and performance became more uniform across all categories.
Discussion and Conclusion
A significant insight from this work is the use of physiology-aware geometry. By using physiological features to define the Wasserstein distance, the model ensures that "warped" signals follow a path that makes sense for human heart signals. Furthermore, explicitly feeding the Transformer statistical "hand-crafted" features alongside raw data improved convergence and nuance identification.
While promising, the computational complexity of Optimal Transport remains higher than simple oversampling. Future work could investigate automatic feature learning for the ground metric and test the model's robustness on noisier data from wearable devices like smartwatches.
Summary updated