CoRe-ECG: Advancing Self-Supervised Representation Learning for 12-Lead ECG via Contrastive and Reconstructive Synergy
Authors: Zehao Qin, Xiaojian Lin, Ping Zhang, Hongliang Wu, Xinkang Wang, Guangling Liu, Bo Chen, Wenming Yang, +1 more
Organizations: Department of Electronic Engineering, Shenzhen International Graduate School, Tsinghua University, Shenzhen 518071, PR China · Department of Cardiology, Beijing Tsinghua Changgung Hospital, School of Clinical Medicine, Tsinghua Medicine, Tsinghua University, Beijing, 102218, PR China · Department of Anesthesiology, National Cancer Center/National Clinical Research Center for Cancer/Cancer Hospital, Chinese Academy of Medical Sciences and Peking Union Medical College, Beijing, 100021, PR China · Department of Electrocardiographic Diagnosis, Fuzhou University Affiliated Provincial Hospital, Fuzhou, 350001, PR China · Department of Electronic Engineering, Tsinghua University, Beijing 100084, PR China · Shanghai AI Laboratory, Shanghai, 200232, PR China
Accurate interpretation of electrocardiogram (ECG) remains challenging due to the scarcity of labeled data and the high cost of expert annotation. Self-supervised learning (SSL) offers a promising solution by enabling models to learn expressive representations from unlabeled signals. Existing ECG SSL methods typically rely on either contrastive learning or reconstructive learning. However, each approach in isolation provides limited supervisory signals and suffers from additional limitations, including non-physiological distortions introduced by naive augmentations and trivial correlations across multiple leads that models may exploit as shortcuts. In this work, we propose CoRe-ECG, a unified contrastive and reconstructive pretraining paradigm that establishes a synergistic interaction between global semantic modeling and local structural learning. CoRe-ECG aligns global representations during reconstruction, enabling instance-level discriminative signals to guide local waveform recovery. To further enhance pretraining, we introduce Frequency Dynamic Augmentation (FDA) to adaptively perturb ECG signals based on their frequency-domain importance, and Spatio-Temporal Dual Masking (STDM) to break linear dependencies across leads, increasing the difficulty of reconstructive tasks. Our method achieves state-of-the-art performance across multiple downstream ECG datasets. Ablation studies further demonstrate the necessity and complementarity of each component. This approach provides a robust and physiologically meaningful representation learning framework for ECG analysis.
Figures & tables
Figure 1: Overview of CoRe Learning. Our approach integrates Contrastive Learning and Reconstructive Learning in a unified framework. The model reconstructs the original ECG signal while simultaneously aligning the global representations of the original signal and its augmented view. This design allows the two learning paradigms to remain compatible and to mutually reinforce each other.
Figure 2: Overview of the CoRe-ECG architecture, which consists of two parallel branches: the Contrastive Branch and the Reconstructive Branch. In (a), we utilize frequency dynamic augmentation to generate an augmented view, which is transformed into a global representation via the encoder-projection structure. Simultaneously, the visible representations of the raw signal extracted by the Encoder are passed through the decoder-projection module to yield a corresponding global representation. The contrastive loss is calculated between these two representations. In (b), the input undergoes spatio-temporal dual masking and is processed by the encoder-decoder network to reconstruct the original input signal. The reconstruction loss is computed exclusively on the masked patches.
Figure 3: The structure of Spatio-Temporal Dual Masking (STDM).
Figure 4: Illustration of Frequency Dynamic Augmentation (FDA). By modulating frequency components in the magnitude spectrum based on learnable importance, FDA preserves critical physiological semantics while introducing diverse perturbations.
Figure 5: Schematic illustration of the downstream fine-tuning phase.
Methods
PTB-XL
ICBEB2018
Ningbo
ACC ↑
F1 ↑
AUROC ↑
ACC ↑
F1 ↑
AUROC ↑
ACC ↑
F1 ↑
AUROC ↑
Supervised
71.4
60.2
89.6
75.3
73.7
93.7
83.2
37.6
83.9
MoCo V3 [ 15 ]
79.9
64.4
91.3
85.2
83.8
96.7
95.1
41.7
89.1
CMSC [ 16 ]
72.4
51.0
87.7
73.6
71.7
93.8
90.3
35.6
83.2
MTAE [ 21 ]
78.9
61.3
91.0
79.3
76.9
96.1
94.4
41.1
87.7
MLAE [ 21 ]
80.2
62.5
91.5
83.4
81.6
97.3
95.7
41.3
89.6
Table 1: Performance comparison among our model and baseline methods on three ECG datasets. The best results are highlighted in bold and the second-best results are underlined.
Leads
Models
PTB-XL
ICBEB2018
Ningbo
ACC
F1
AUROC
ACC
F1
AUROC
ACC
F1
AUROC
12
ST-MEM
80.9
63.4
92.9
87.2
82.0
97.7
97.2
42.5
90.8
CoRe-ECG
81.4
69.5
94.2
86.9
84.0
97.9
97.7
43.4
92.2
6
ST-MEM
76.8
57.7
90.2
80.3
77.7
95.2
95.1
36.7
89.4
CoRe-ECG
77.1
60.7
90.3
81.0
78.8
96.3
96.7
38.1
90.9
1
ST-MEM
67.4
42.1
81.5
71.1
68.8
93.7
93.3
23.1
86.5
Table 2: Performance comparison under different numbers of leads across three ECG datasets. The best results for each lead configuration are highlighted in bold.
Data Ratio
Models
PTB-XL
ICBEB2018
Ningbo
ACC
F1
AUROC
ACC
F1
AUROC
ACC
F1
AUROC
100%
ST-MEM
80.9
63.4
92.9
87.2
82.0
97.7
97.2
42.5
90.8
CoRe-ECG
81.4
69.5
94.2
86.9
84.0
97.9
97.7
43.4
92.2
50%
ST-MEM
79.4
61.2
92.7
84.7
81.6
97.3
95.3
36.9
86.7
CoRe-ECG
80.5
64.7
93.3
86.2
83.3
97.6
96.5
37.1
88.3
5%
ST-MEM
74.5
53.4
86.4
81.7
80.9
95.4
93.0
27.1
82.0
Table 3: Performance comparison under different training data ratios (100%, 50%, and 5%) on three ECG datasets. The best results for each data ratio are highlighted in bold.
Method
PTB-XL
ICBEB2018
Ningbo
ACC
F1
AUROC
ACC
F1
AUROC
ACC
F1
AUROC
Contrastive Learning
80.6
68.7
93.6
83.4
82.5
97.0
96.3
41.1
91.3
Reconstructive Learning
81.2
69.1
94.0
84.4
83.0
97.3
96.5
42.4
91.7
CoRe Learning
81.4
69.5
94.2
86.9
84.0
97.9
97.7
43.4
92.2
Table 4: Ablation study of different pre-training paradigms across three datasets. CoRe Learning (Ours) combines contrastive and reconstructive objectives. The best results for each dataset are highlighted in bold.
STDM
FDA
PTB-XL
ICBEB2018
Ningbo
ACC
F1
AUROC
ACC
F1
AUROC
ACC
F1
AUROC
×
×
80.0
66.1
92.3
83.7
81.4
96.4
94.1
41.3
89.7
×
✓
80.1
66.4
92.6
84.1
82.3
96.7
94.8
41.7
90.0
✓
×
80.6
67.8
93.7
84.9
82.8
97.1
96.1
42.3
90.7
✓
✓
81.4
69.5
94.2
86.9
84.0
97.9
97.7
43.4
92.2
Table 5: Ablation study of the proposed STDM and FDA. The checkmark ( ✓ ) indicates the component is included, and ( × ) indicates it is not.
Figure 6: Sensitivity analysis of the Time Full Mask Rate ( Ptime ) and Lead Drop Rate ( Plead ) in STDM strategy.
Figure 7: Visual comparison of reconstruction fidelity between ST-MEM (a) and our method (b). Red lines represent the reconstructed signals, while blue lines denote the original signals.
Figure 8: T-SNE visualization of the learned representations fine-tuned on two datasets. ICBEB2018 with 9 diagnostic categories. PTB-XL with 5 diagnostic categories.
Electrocardiograms (ECGs) are among the most widely used diagnostic tools for cardiovascular diseases, and a large amount of ECG data worldwide appears only in image form. However, most existing automated ECG analysis methods rely on access to raw signal recordings, limiting their applicability in real-world and resource-constrained settings. In this paper, we present ECG-Scan, a self-supervised framework for learning clinically generalized representations from ECG images through dual physiological-aware alignments: 1) Our approach optimizes image representation learning using multimodal contrastive alignment between image and gold-standard signal-text modalities. 2) We further integrate domain knowledge via soft-lead constraints, regularizing the reconstruction process and improving signal lead inter-consistency. Extensive benchmarking across multiple datasets and downstream tasks demonstrates that our image-based model achieves superior performance compared to existing image baselines and notably narrows the gap between ECG image and signal analysis. These results highlight the potential of self-supervised image modeling to unlock large-scale legacy ECG data and broaden access to automated cardiovascular diagnostics.
Hung Manh Pham, Jialu Tang, Aaqib Saeed +3
University of Cambridge · Singapore Management University · Eindhoven University of Technology, Netherlands
Electrocardiogram (ECG) arrhythmia classification remains challenging due to signal variability, noise, limited labeled data, and the difficulty in achieving both accuracy and efficiency in models. While self-supervised learning reduces label dependency, most methods target either global contextual features or local morphological patterns, but rarely implement hierarchical multi-scale feature extraction. ECG signals require architectures that simultaneously capture fine-grained beat-level morphology and broader rhythm-level dependencies with computational efficiency. To overcome this limitation, this paper proposes the Electrocardiogram Neighborhood Attention Transformer (ECG-NAT), a novel self-supervised learning approach tailored for multi-lead ECG classification. Our two-stage approach begins with generative pretraining, using a masked autoencoder to reconstruct partially masked ECG signals across multiple diverse datasets, enabling the model to learn robust, domain-invariant representations from unlabeled data. This is followed by discriminative fine-tuning with a dual-loss function that combines supervised contrastive and cross-entropy losses, aligning representation learning with label prediction. The hierarchical attention mechanism efficiently captures multi-scale temporal features from localized beat morphology to broader rhythm patterns at low computational cost. ECG-NAT achieves robust performance on benchmark datasets, with 88.1% accuracy using only 1% labeled data, demonstrating strong efficacy in low-resource settings. The framework combines superior classification performance with computational efficiency, making it practical for real-time ECG diagnosis. The code will be made available upon acceptance at: https://github.com/Mahsagazeran/ECG-NAT.
Department of Computer Engineering, University of Kurdistan, Sanandaj, Iran · Department of Mathematics and Operational Research, University of Mons, Mons, Belgium
12-lead electrocardiogram (ECG) is a standard, non-invasive examination widely used for diagnosing coronary artery disease, where clinical interpretation relies on comparing waveform patterns across multiple leads. However, most existing ECG analysis methods focus on single-lead signals or treat each lead independently, and typically process ECG signals as one-dimensional time-series data using CNNs or RNNs. While effective in modeling local waveform changes, such approaches have difficulty capturing inter-lead dependency and global waveform patterns essential for clinical diagnosis. To address this limitation, we propose a graph-based pseudo-multimodal contrastive learning framework called Graph-CMMC. ECG waveforms are transformed into Gramian Angular Difference Field (GADF) images to construct complementary representations of the same cardiac activity, enabling a pseudo-multimodal learning setting. Using all 12 leads, Graph-CMMC aligns waveform and GADF representations in a self-supervised manner, while a graph-based relational module is employed to model inter-lead dependency and enforce structural consistency across leads during contrastive learning. Experimental results on a multi-label coronary artery occlusion classification task demonstrate that the proposed framework achieves competitive performance compared to supervised learning methods. These results further suggest the effectiveness of using GADF as a complementary representation and incorporating explicit graph-based modeling of inter-lead dependency for learning robust 12-lead ECG representations.
Mengyu Wang, Kozo Okada, Takafumi Goto +4
Graduate School of Engineering Science Yokohama National University Yokohama, Japan · Division of Cardiology Yokohama City University Medical Center Yokohama, Japan · Technology and Innovation Department Fukuda Denshi Co.,Ltd Tokyo, Japan