Abstract
Automated heart disease classification using deep learning is often hindered by data-level imbalances. This paper identifies two primary "disequilibrium issues": channel-wise magnitude imbalance, where models overfit to high-power ECG leads, and class frequency imbalance (the long-tail problem). We introduce the Channel-wise Magnitude Equalizer (CME) and Inverted Weight Logarithmic (IWL) Loss to address these issues. Experimental results on the CPSC2018 dataset show that our methods significantly boost the performance of standard architectures like ResNet and EfficientNet, achieving up to a 10% improvement in F1-score over existing imbalance-aware techniques.
Introduction: The Problem of Disequilibrium
Current research in electrocardiogram (ECG) classification often focuses on increasing model complexity. However, this paper argues that fundamental data imbalances must be addressed first. Two major hurdles exist:
- Channel-wise Imbalance: Standard 12-lead ECGs provide different views of the heart, but these signals vary in strength. Greedily-trained Convolutional Neural Networks (CNNs) tend to focus on high-magnitude signals, potentially ignoring subtle but critical diagnostic information in lower-power leads.
- Class Imbalance (The Long-Tail Problem): Clinical datasets are naturally skewed toward common conditions (e.g., Atrial Fibrillation). Models trained on such data often fail to identify rare pathologies because they lack sufficient exposure to these patterns.
Methodology
To combat these issues, we propose a two-pronged strategy integrated into a unified deep learning framework.
Channel-wise Magnitude Equalizer (CME)
Inspired by Squeeze-and-Excitation (SE) blocks, CME serves as a dynamic pre-processing layer. Unlike standard SE blocks that amplify dominant features, CME uses an "inversion" strategy. It quantifies the contribution of each lead and "excites" (boosts) low-power leads while "squeezing" (attenuating) high-power ones. This ensures the model treats every "view" of the heart with appropriate diagnostic weight.
Inverted Weight Logarithmic (IWL) Loss
To address the long-tail distribution, we designed the IWL Loss function. It applies higher weights to "low confidence" predictions—typically associated with rare classes—and lower weights to "well-classified" common classes. This forces the model to prioritize difficult, rare cases without compromising its ability to classify common conditions.
Experimental Setup and Results
We evaluated our methods using the CPSC2018 dataset (6,877 12-lead ECG recordings). We focused on 6,400 single-label samples and simulated real-world scenarios by creating synthetic levels of imbalance (controlled by an $\alpha$ factor).
The results demonstrate that addressing data disequilibrium is more effective than simply increasing model depth:
- IWL Loss Impact: Replacing standard Cross-Entropy with IWL loss increased baseline model accuracy by 0.5% to 5%.
- Combined Performance: Integrating CME and IWL with an EfficientNetB0 backbone yielded an accuracy of 83.2% on the original dataset and 85.2% on highly imbalanced versions.
- Superiority over SOTA: Our method outperformed popular imbalance-aware losses, such as Focal Loss and Class-Balanced Loss, by margins of 5-10% in F1-score.
Discussion and Future Work
While effective, this study focused on single-label samples and fixed 6-second windows. Real-world clinical settings often involve multi-label cases and intermittent arrhythmias in variable-length recordings. Future research will explore the interaction of CME and IWL with newer architectures like Vision Transformers (ViTs) and their application to more complex, multi-label clinical datasets.
Summary updated