IECG: Weakly-Supervised Interpretability-Enhancing Foundation Model for Electrocardiogram
Authors: Huynh Dang Nguyen, Trong-Thang Pham, Anh-Thuan Do, Phuong-Nhi Dinh, Brijesh Patel, Ngan Le, Van Nguyen
Organizations: Quantum AI & Cyber Security Institute (QACI) - FPT Corporation, Vietnam · University of Arkansas, USA · Hospital Haiphong Medical University, Vietnam · Pham Ngoc Thach University of Medicine, Vietnam · Indiana University, USA
Electrocardiography (ECG) is a cornerstone of cardiac diagnosis, yet most machine learning methods for ECG analysis lack interpretability, limiting their clinical adoption. We present IECG, a weakly-supervised ECG foundation model that jointly performs diagnostic classification and abnormality localization without requiring manual abnormal region annotations, overcoming a long-standing bottleneck in interpretable ECG learning. Central to IECG is a weakly-supervised attention strategy that explicitly incorporates clinical priors by deriving abnormality heatmap pseudo-labels from established ECG clinical knowledge. These pseudo-labels guide the model's CLS-token attention through a KL-divergence loss, encouraging it to focus on diagnostically relevant waveform regions. During pretraining, IECG is jointly optimized with clinically guided attention supervision, ECG-text contrastive alignment, and report captioning objectives, enabling it to learn rich multimodal representations while producing localized waveform evidence. By explicitly aggregating features from clinically guided attention regions, IECG grounds its diagnostic predictions in interpretable waveform evidence without sacrificing classification performance. Extensive experiments demonstrate that IECG achieves state-of-the-art abnormal region localization while maintaining strong classification performance, advancing trustworthy foundation models for ECG analysis.
Figures & tables
Figure 1: IECG overview. The ECG Encoder learns representations through ECG-Text Alignment and a self-supervised clinical abnormality localization mechanism with CGAL pipeline.
Figure 2: Each ECG token is enriched with Spatial and Temporal embeddings in addition to Positional embeddings, providing explicit lead identity and time frame information.
Figure 3: The Criteria Feature Retrieval (CFR) module retrieves diagnostic criteria by comparing the input diagnosis embedding with a pre-constructed vector database.
Model
Interpretable
Abnormality localization
Classification
Faithfulness
P@50% ( ↑ )
AUROC loc ( ↑ )
FMax ( ↑ )
AUROC cls ( ↑ )
Insertion ( ↑ )
Deletion ( ↓ )
ST-MEM [ 23 ]
✗
16.56 ± 1.29
50.07 ± 0.65
16.18 ± 0.12
59.07 ± 0.25
23.25 ± 0.38
21.57 ± 0.37
METS [ 13 ]
✗
18.89 ± 1.26
59.25 ± 1.24
40.19 ± 0.33
88.05 ± 0.30
38.42 ± 0.58
21.24 ± 0.48
MERL [ 17 ]
✗
19.73 ± 1.28
61.13 ± 1.23
41.82 ± 0.57
88.80 ± 0.27
35.50 ± 0.28
20.07 ± 0.54
ECG-FM [ 21 ]
✗
16.27 ± 1.21
50.29 ± 0.43
34.37 ± 0.43
83.41 ± 0.52
25.23 ± 0.36
12.09 ± 0.14
HeartLang [ 10 ]
✗
17.08 ± 1.28
50.32 ± 1.12
27.58 ± 0.47
77.07 ± 0.64
23.50 ± 0.31
20.76 ± 0.34
Table 1: Abnormality localization and Classification results on ECGADdata . Bold indicates the best result, and underline denotes the second-best result. For IECG , attention supervision is applied to either the attention scores from the final Transformer layer ( IECG -Last) or the layer-wise aggregated attention obtained via attention rollout ( IECG -Rollout).
Figure 4: Qualitative comparison of abnormality localization across different ECG conditions. For each example, the top panel shows the ECG waveform with ground-truth abnormalities highlighted in blue. The middle and bottom rows present the localization heatmaps produced by ECGAD model and IECG , respectively. Compared to ECGAD model , IECG produces more accurate and temporally consistent activations that better align with clinically relevant abnormalities across diverse conditions.
Model
FMax
AUROC cls
ST-MEM [ 23 ]
11.05 ± 0.03
64.39 ± 0.04
METS [ 13 ]
39.88 ± 0.23
90.82 ± 0.17
MERL [ 17 ]
40.00 ± 0.27
91.66 ± 0.17
ECG-FM [ 21 ]
31.00 ± 0.33
85.10 ± 0.32
HeartLang [ 9 ]
26.03 ± 0.47
80.10 ± 0.34
TolerantECG [ 24 ]
40.76 ± 0.38
92.02 ± 0.12
Table 2: Classification result evaluated on PTB-XL dataset. Bold indicates the best result, and underline indicates the second-best result.
Configuration
AUROC loc
AUROC clsECGAD
AUROC clsPTB-XL
β=1 ( Default )
75.59 ± 1.00
89.09 ± 0.49
92.04 ± 0.29
β=2
75.28 ± 0.95
89.30 ± 0.26
91.36 ± 0.13
Table 3: Effect of captioning loss on localization and classification.
Configuration
AUROC loc
AUROC clsECGAD
AUROC clsPTB-XL
γ=0
61.33 ± 1.27
89.41 ± 0.23
92.14 ± 0.09
γ=0.5 ( Default )
75.55 ± 1.00
89.09 ± 0.49
92.03 ± 0.23
γ=1.0
75.31 ± 0.97
89.38 ± 0.40
92.61 ± 0.12
Table 4: Effect of attention supervision on localization and classification.
Appendix figures & tables13 assets
Supplementary material from the paper’s appendix.
Appendix
Method
P onset
P offset
QRS onset
QRS offset
T onset
T offset
ProMac
84.72
84.91
77.05
78.08
81.70
67.62
NeuroKit
84.78
84.60
79.62
80.92
79.52
63.97
UNet3+
96.68
96.75
99.88
99.89
97.82
96.66
Appendix
Table S1 : Performance comparison of segmentation methods on ECG component boundary localization, evaluated using F1‑score on the Semi‑Seg‑ECG test set.
Dataset
P onset
P offset
QRS onset
QRS offset
T onset
T offset
ISP
97.09
97.16
100.00
100.00
99.50
99.48
Zhejiang
94.56
94.60
99.84
99.85
96.92
95.73
LUDB
96.49
96.57
99.86
99.86
99.60
99.27
QTDB
97.74
97.74
99.43
99.43
95.52
89.14
Appendix
Table S2 : F1 score performance of the UNet3+ across multiple datasets in the SemiSegECG test set.
Component
Abnormal Conditions
P wave
Missing (absent P wave)
Amplitude >0.25 mV in limb leads
Amplitude >0.15 mV in precordial leads
Duration >120 ms
Inverted in leads I, II, III; Upright in lead aVR
QRS complex
Duration >120 ms
Appendix
Table S3 : Abnormal criteria for each ECG waveform component. These thresholds are used in CGAL Stage 2 to flag candidate abnormal regions.
Query
Retrieved diagnosis
Retrieve score
Nonspecific ST changes
Septal hypertrophy
-14.26
Marked ST depression in V lead
Pericarditis
-10.04
Short PR interval
Extreme Axis Deviation
-9.29
ST depression V1-V3
Poor R Wave Progression
-8.83
Prolonged PR interval
R Wave Peak Time
-8.04
ST-T changes
Digitalis Effect
-7.53
Appendix
Table S4 : Examples of lowest‑scoring queries in CFR retrieval.
Configuration
AUROC loc
AUROC clsECGAD
AUROC clsPTB-XL
w/o ST embedding
75.01 ± 0.84
90.31 ± 0.24
92.08 ± 0.30
w/ ST embedding ( Default )
75.55 ± 1.00
89.09 ± 0.49
92.03 ± 0.23
Appendix
Table S5 : Effect of Spatial-Temporal embedding on localization and classification.
Figure S1 : First-degree atrioventricular block with sinus rhythm. IECG consistently highlights prolonged PR intervals across multiple leads, showing stronger alignment with ground truth compared to the baseline, which exhibits more dispersed and less structured localization.
Figure S2 : Anterolateral myocardial infarction with first-degree AV block and intraventricular conduction disturbance. As expected clinically, IECG assigns substantially higher attention weight to the anterolateral leads (I, aVL, and V4–V6) to capture the myocardial infarction, while simultaneously maintaining strong focus on the prolonged PR intervals across the waveform to identify the AV block. This demonstrates the model’s ability to accurately localize both spatially-restricted morphological abnormalities and global temporal conduction delays within the same sample, whereas the baseline exhibits fragmented and less anatomically specific activations.
Figure S3 : Inferior myocardial infarction with first-degree AV block. To accurately diagnose the inferior infarction, IECG distinctly concentrates its attention on the inferior leads (II), precisely matching the expected anatomical region of the ischemic injury. Concurrently, it correctly highlights the prolonged PR intervals to account for the atrioventricular conduction delay. In contrast, the baseline model fails to prioritize the inferior leads and produces activations that lack clear anatomical or temporal justification.
Figure S4 : Complete right bundle branch block (RBBB) with left anterior fascicular block (LAFB). IECG accurately targets the broadened QRS complexes characteristic of RBBB, placing prominent attention on the right precordial leads (V1–V3). Furthermore, to identify LAFB, the model correctly distributes its focus toward the inferior leads (II, III, aVF) and high lateral leads (I, aVL), which are critical for recognizing the associated left axis deviation. This precise, anatomically-grounded localization contrasts with the baseline, which generates uncoordinated activations that fail to clearly reflect the underlying multi-fascicular conduction pathologies.
Figure S5 : Example illustrating annotation incompleteness in ECGADdata using Lead II. The ECG exhibits complete left bundle branch block (LBBB) and first-degree atrioventricular (AV) block, as indicated by prolonged QRS duration (e.g., 172–176 ms) and prolonged PR interval (e.g., 204–224 ms), respectively. The ground-truth (GT) heatmap highlights regions corresponding to widened QRS complexes associated with LBBB but fails to capture the prolonged PR intervals that define first-degree AV block. In contrast, IECG accurately highlights both QRS and PR regions, reflecting clinically relevant abnormalities across both morphological (ventricular depolarization) and temporal (atrioventricular conduction delay) features. This example demonstrates that missing annotations of temporal abnormalities can lead to underestimation of localization performance.
Method
AUROC loc
IECG w/o Attention Supervision ( γ=0 )
61.33%
Just CGAL (Rule-based Pseudo-labels)
70.13%
IECG ( γ=1.0 )
75.31%
IECG ( Default , γ=0.5 )
75.55%
Appendix
Table S6 : Comparison of localization performance between the heuristic-based CGAL pseudo-labels and the trained models.
Configuration
BLEU-4
ROUGE-L
METEOR
BERT-score
w/o CGAL ( γ=0 )
12.57
34.49
33.61
89.25
IECG ( Default )
12.14
34.28
32.56
89.20
Appendix
Table S7 : Report generation performance on the PTB-XL dataset.
Model
CPSC
Chapman
FMax
AUROC
FMax
AUROC
ST-MEM [ 23 ]
26.95 ± 0.09
63.03 ± 0.11
12.47 ± 0.32
62.22 ± 0.80
HeartLang [ 9 ]
36.44 ± 0.61
70.13 ± 0.45
29.52 ± 0.65
84.15 ± 0.64
XAI4ECG [ 32 ]
57.46 ± 0.65
85.74 ± 0.40
29.21 ± 0.78
82.10 ± 0.58
ECG-FM [ 21 ]
64.94 ± 0.38
90.24 ± 0.12
44.03 ± 0.71
90.76 ± 0.12
ECGAD [ 6 ]
68.89 ± 0.90
91.59 ± 0.82
34.41 ± 0.73
87.88 ± 0.38
Appendix
Table S8 : Classification results evaluated on the CPSC and Chapman datasets. Bold indicates the best result, and underline indicates the second-best result.
Electrocardiogram foundation models learn reusable representations from large ECG datasets for diagnosis, risk prediction, and transfer across clinical settings.
Electrocardiography (ECG) records the electrical activity of the heart, aiding diagnosis by detecting abnormalities in cardiac function. ECG foundation models have demonstrated promising results, but are limited by a reliance on ECG interpretation reports as their sole supervision. Because interpretation reports only capture the subset of waveform information routinely recognized by clinicians, this constrains representation learning to overlook the broader diagnostic signals present in ECG. We introduce a new ECG foundation model --- MS-ECG-FM --- that is trained through contrastive alignment to multiple distinct clinical note types, including ECG, echocardiography, radiology, and discharge reports. We evaluate MS-ECG-FM on an extended set of ECG detection benchmarks, showing that it comprehensively outperforms existing methods on the full span of conditions that ECG can detect, including in reduced-lead configurations. Different reports improve representations for different diagnostic domains, while multi-source alignment captures their complementary information and produces consistently strong representations across clinically diverse tasks.
Robert A. Lewis, I-Min Chiu, Kyle Verrier +7
Massachusetts Institute of Technology (work done while at Apple). · Apple, Inc. · Division of Cardiology, Johns Hopkins Medicine. +1
Cardiologists interpret electrocardiograms by localizing waveform components, measuring rhythm and interval patterns, and translating these structured observations into diagnostic evidence. Whether this expert reading process can serve as an effective prior for ECG agents remains unclear. To address this question, we introduce LuminaECG, a clinically structured ECG reasoning framework that reformulates ECG interpretation as measurement-grounded visual reading. ECG signals are rendered on standard electrocardiographic grid paper to preserve the spatial and scale cues used in clinical reading. P-wave, QRS-complex, and T-wave boundaries are explicitly delineated, and color-coded segmentation decomposes the waveform into discrete visual measurement primitives. A general 2B vision-language backbone is then trained with low-rank supervised fine-tuning to associate these primitives with diagnostic reasoning, without architectural modification. Across open, proprietary, and ECG-specialist zero-shot baselines, LuminaECG improves both waveform measurement and diagnostic recovery. It reaches a clinically meaningful reader tier on the CODE-test benchmark, transfers across geographically diverse ECG datasets without retraining, and generates reports whose structure contains an emergent prognostic signal. These findings suggest that effective ECG agents require not only larger models, but supervision that preserves the alignment between measurable waveform evidence and clinical knowledge.
Hongxiang Gao, He-yang Xu, Yuwen Li +6
State Key Laboratory of Digital Medical Engineering, Southeast University · School of Instrument Science and Engineering, Southeast University
Existing benchmarks for electrocardiogram foundation models primarily evaluate downstream predictive performance, providing limited insight into whether their internal representations can be faithfully decomposed, clinically interpreted, or reproduced across independent analyses. We introduce ECG-InterpBench, a benchmark designed to systematically evaluate the interpretability of ECG foundation-model representations. ECG-InterpBench uses sparse autoencoders as standardized measurement instruments and matches their capacity across models to enable controlled comparisons. We evaluate six frozen ECG foundation models across five standardized encoder depths, five matched dictionary widths, and three random seeds, producing a 450-cell interpretability atlas comprising 75 exactly matched six-model comparison blocks. The benchmark evaluates complementary dimensions of representation interpretability, including sparse reconstruction fidelity, single-feature accessibility and coverage of 49 clinically meaningful ECG measurements, and cross-seed feature reproducibility. The evaluation further quantifies patient-sampling uncertainty, depth- and seed-dependent variation, and sensitivity to the sparsity parameterization. The benchmark reveals that ECG foundation models exhibit distinct interpretability profiles. A matched replication on MIMIC-IV-ECG confirms that reconstruction fidelity and clinical accessibility identify different leading models. The benchmark is accompanied by executable evaluation code, standardized manifests, cell-level metrics, and reproducibility audits. ECG-InterpBench complements performance-centered ECG benchmarks by providing a capacity-controlled and reproducible framework for comparing ECG foundation models across distinct dimensions of representation interpretability.
Yixuan Duan, Wei Qiu
Department of Electrical and Computer Engineering Rice University Houston, Texas, USA