Self-supervised contrastive learning enables robust electrocardiogram-based cardiac classification
Abstract
Background: Self-supervised contrastive learning has emerged as a powerful paradigm for learning generalizable representations from unlabeled data. In the context of electrocardiogram (ECG) analysis, such pre-training can significantly enhance classification performance, especially when labeled data is scarce. Objective: We aimed to investigate and improve contrastive self-supervised learning techniques for ECGs by systematically combining recent methodological advances in augmentation design, contrastive loss formulation, and encoder architectures. Methods: We implemented a contrastive pre-training framework combining vectorcardiography (VCG)-based physiologically-inspired augmentations, interlead, intersegment, contrastive loss, and patient-aware positive sampling. In addition, we developed a dual-stream architecture, extending the TemporalNet model by processing grouped ECG leads independently. Pretraining was conducted on a large corpus of approximately 1 million unlabeled ECGs. We evaluated performance on 2 downstream classification tasks-low left ventricular ejection fraction (LVEF) and high serum potassium chloride-using various levels of labeled supervision (1%, 5%, 10%, 50%, and 100%). The pre-trained models were compared with the randomly initialized models under both frozen and finetuned conditions. Results: Contrastive pre-training consistently improved performance across all supervision levels. In low-label settings (1%-10% supervision), the pre-trained model achieved 3%-4% higher area under the receiver operator curve on the LVEF task and 5%-7% higher area under the receiver operator curve on the potassium chloride task compared with the baseline. The performance gap narrowed with increased supervision but remained favorable toward pre-trained models. Conclusion: Our findings demonstrate that contrastive pre-training can substantially enhance ECG classification, especially when labeled data is limited. By unifying and extending ideas from recent literature into a scalable framework trained on 1 million ECGs, we provide practical guidance and architectural innovations for building strong ECG foundation models applicable to a broad range of clinical prediction tasks.
Fields of Study & Subjects
ECG Monitoring and Analysis
Imbalanced Data Classification Techniques
Neural Networks and Applications
Publication details
- Journal / source
- Heart Rhythm O2
- Publisher
- Elsevier BV
- Volume
- 7
- Issue
- 4
- Pages
- 757–770
- Publication date
- 22 January 2026
- Language
- EN