Introduction
Deep learning in healthcare is often bottlenecked by the requirement for massive, high-quality labeled datasets, which are expensive and time-consuming for clinicians to produce. While self-supervised contrastive learning methods like SimCLR have shown promise in computer vision, they typically rely on artificial augmentations of a single data instance. This approach fails to capture the unique properties of physiological signals like electrocardiograms (ECGs), which possess inherent temporal, spatial, and patient-specific structures. This paper introduces CLOCS (Contrastive Learning of Cardiac Signals), a framework designed to exploit these natural invariances to learn robust representations without manual labels.
Methodology
CLOCS redefines the "shared context" in contrastive learning by leveraging the multi-dimensional nature of ECG data. Instead of simple signal perturbations, the framework utilizes three primary coding strategies based on natural data invariances:
- Contrastive Multi-segment Coding (CMSC): Exploits temporal invariance by treating non-overlapping segments from the same patient recording as positive pairs, assuming cardiac function remains stable over short intervals.
- Contrastive Multi-lead Coding (CMLC): Exploits spatial invariance by pairing simultaneous recordings from different ECG leads, which represent different physical angles of the heart.
- Contrastive Multi-segment Multi-lead Coding (CMSMLC): A hybrid approach combining both temporal and spatial contexts.
A core innovation is the Patient-Specific Loss, which modifies the standard InfoNCE loss to group representations by Patient ID. By pulling together all transformed instances from the same patient and pushing apart those from different patients in the latent space, the model naturally learns patient-centric features.
Datasets and Evaluation
The framework was pre-trained and evaluated across four diverse ECG datasets: PhysioNet 2020, Chapman, Cardiology, and PhysioNet 2017. These datasets encompass a range of lead configurations (from single-lead to 12-lead) and various cardiac arrhythmia classes, providing a rigorous test for the model's generalizability.
Key Results
CLOCS demonstrates significant improvements over state-of-the-art self-supervised methods across several metrics:
- Superior Linear Evaluation: When freezing the pre-trained network and training a linear classifier, CMSC achieved an AUC of 0.896 on the Chapman dataset, compared to 0.738 for SimCLR—a 15.8% absolute improvement.
- Massive Data Efficiency: Models pre-trained with CMSC and fine-tuned on only 25% of labeled data outperformed models trained from scratch on 100% of the labeled data.
- Robust Transfer Learning: Representations learned on one dataset successfully transferred to others, outperforming SimCLR in the majority of experimental setups regardless of the number of leads used.
Discussion and Future Work
While temporal invariance (CMSC) proved highly effective, spatial invariance (CMLC) was more challenging. The authors noted that certain physiological events might be visible in one lead but hidden in another, making the assumption of identical representations across all leads potentially confusing for the network. Additionally, the patient-specific assumption may weaken if recordings are separated by long time intervals or different clinical states (e.g., resting vs. stress test).
Future work includes extending CLOCS to multi-modal data—such as pairing ECG with photoplethysmogram (PPG) data—and utilizing these learned representations to quantify patient similarity for clinical diagnosis and subgroup discovery.
Summary updated