Source-linked AI summary
ECG-FM: An Open Electrocardiogram Foundation Model
Kaden McKeen, Sameer Masood, Augustin Toma, Barry Rubin, Bo Wang
TL;DR
ECG analysis models often require large labeled datasets, while scarce open-weight ECG foundation models limit comparability and adoption. ECG-FM combines hybrid self-supervised pretraining with downstream evaluation, and outperforms task-specific methods in the small-to-medium data regime while showing cross-dataset generalizability.
Problem
Task-specific ECG models require large annotated datasets, while scarcity of open-weight foundation models hinders adoption and cross-study comparability.
Source: §1 · pp. 1–2Method
ECG-FM is a transformer-based foundation model pretrained with hybrid self-supervision and evaluated on ECG interpretation and reduced-LVEF tasks.
Source: §1 · p. 2, UHN-ECG reduced LVEF · p. 7Results
ECG-FM consistently outperformed task-specific methods in the small-to-medium training-data regime and showed cross-dataset generalizability on UHN-ECG tasks.
Source: §4 · p. 11Takeaways & Limitations
The released model, code, and MIMIC-IV-ECG benchmark task aim to lower adoption barriers and facilitate benchmarking and open-weight practices.
Source: §1 · p. 2, §4 · p. 11, Data availability · p. 12Using 5-second segments with mostly 10-second ECGs mismatches inputs and non-segment-specific labels, potentially underrating performance, though aggregation improves selected labels.
Source: §4 · p. 11, §5.1 · p. 19
Abstract
from arXiv · showhide
Conventional task-specific electrocardiogram (ECG) analysis models require large annotated datasets to train. Foundation models mitigate this burden by leveraging self-supervised pretraining; however, the scarcity of open-weight ECG foundation models hinders adoption and cross-study comparability. We present ECG-FM, an open foundation model for ECG analysis, and conduct a study using a dataset of 1.5 million ECGs. ECG-FM is a transformer-based model pretrained using a hybrid contrastive and generative self-supervised learning approach. Our downstream tasks include predicting reduced left ventricular ejection fraction (LVEF) and ECG interpretation labels, where we release a benchmark task on the MIMIC-IV-ECG dataset. We affirm that ECG-FM is robust, label-efficient, and functionally discriminative by showcasing data scaling experiments, performing a latent space analysis, and generating saliency maps. ECG-FM markedly outperforms task-specific models in the small-to-medium-scale data regime and demonstrates cross-dataset generalizability, achieving high AUROC on many clinically salient labels such as atrial fibrillation (0.996) and LVEF<=40% (0.929). We release our code, model weights, and benchmark task at https://github.com/bowang-lab/ECG-FM/.
1 Introduction
ECG interpretation is clinically important, but human expertise varies and traditional rule-based interpretations may be inaccurate. ECG-FM addresses the need for adaptable, label-efficient analysis and greater openness in a field where unshared code and weights hinder reproducibility and comparison.
1 Introduction
- Human ECG interpretation quality varies with expertise, and rule-based computerized interpretations may lack clinical accuracy, warranting caution in clinical decisions.AI-based ECG methods have outperformed traditional computerized interpretation, and some have matched or exceeded human performance on particular tasks.Source: §1 · p. 1
- Foundation models use self-supervised pretraining on unlabeled data and transfer learning to adapt to downstream tasks, reducing reliance on costly labeled data.The introduction describes rapid adaptability as a defining characteristic of foundation models.Source: §1 · p. 1
- Generative self-supervision emphasizes local structure but may underrepresent broader cardiac patterns, whereas contrastive learning captures semantics but is vulnerable to faulty alignment.Hybrid methods aim to combine local-pattern and semantic learning; prior augmentation-driven hybrid contrastive strategies can remain vulnerable to faulty alignment.Source: §1 · p. 2
- CMSC uses temporally adjacent ECG segments as positive pairs, avoiding augmentation and its alignment risk while promoting temporal invariance and functionally relevant representations.The described hybrid approach combines CMSC with wav2vec 2.0 masking and Random Lead Masking.Source: §1 · p. 2
- Unshared codebases and weights hinder reproducibility, methodological comparability, and collaboration, while large public ECG datasets make open-weight pretrained models feasible.Self-supervised methods can also be prohibitively expensive to train, even when code is released.Source: §1 · p. 2
- ECG-FM is a transformer-based foundation model pretrained with hybrid self-supervision on 1.4 million ECG segments, released with its model and benchmark task.The authors aim to lower adoption barriers, facilitate benchmarking, and encourage open-weight practices.Source: §1 · p. 2
2 Method
ECG-FM is pretrained on a large ECG cohort using a hybrid masked and contrastive approach, then evaluated on interpretation and reduced-LVEF tasks. The methods specify cohort curation, model training, and comparisons with task-specific baselines across training-data scales.
2.1 Data
- The study assembled 1.5 million 12-lead ECGs; public PhysioNet 2021 and MIMIC-IV-ECG data supported pretraining, while private UHN-ECG was reserved for downstream tasks.UHN-ECG contains 622,000 recordings from 211,000 patients seen at two Toronto hospitals.Source: §2.1 · pp. 2–3, UHN-ECG · p. 3
2.2 Cohort curation
- Curation removed ECGs with null values or constant-valued leads, and dataset splits were stratified, with UHN-ECG split by patient and time to avoid overlap.MIMIC-IV-ECG was split by patient; PhysioNet 2021 was split randomly, and its evaluation sets were not used.Source: §2.2 · p. 3
2.3 Model architecture
- ECG-FM has 90.9 million parameters and combines a CNN feature extractor with a BERT-like transformer encoder to produce local contextualized representations.The transformer has 12 blocks, 768-dimensional embeddings, 12 attention heads, and a 3,072-dimensional feed-forward network.Source: §2.3 · pp. 3, 5
2.4 Pretraining method
- WCR combines wav2vec 2.0 masked-latent learning, CMSC contrastive learning on adjacent ECG segments, and random lead masking.The local contrastive objective compares quantized masked targets with contextualized representations and distractors; CMSC uses other segments as negatives and is designed to promote temporal invariance.Source: §2.4 · p. 5, wav2vec 2.0 · p. 5, CMSC · p. 5
2.5 Downstream tasks
- Downstream tasks parse cardiologist over-reads and automated machine-read reports into interpretation labels, and derive reduced-LVEF labels from echocardiography reports within ±7 days of ECG acquisition.Reduced LVEF was labeled at thresholds of ≤50%, ≤40%, ≤35%, and ≤30%.Source: §2.5 · p. 7, UHN-ECG reduced LVEF · p. 7
2.6 Experiments
- Experiments compared pretrained full fine-tuning, random initialization, linear probing, and task-specific ResNet baselines across reduced training-set sizes.Interpretation tasks used 50%, 10%, and 1% of training ECGs; reduced-LVEF tasks used 50% and 10%, with evaluation sets held constant.Source: §2.6 · p. 7
3 Results
Across tasks, ECG-FM outperforms baselines in the small-to-medium data regime, while some tasks approach a similar plateau with larger datasets. Its pretrained representations show functional structure, and downstream evaluations include noisy recordings, saliency examples, and an independent ACS comparison.
3.1 Data scaling
- At the smallest training set sizes, Linear outperforms baselines and performs comparably to Full on two tasks, but plateaus as more downstream data becomes available.The two tasks are MIMIC-IV-ECG machine reads and UHN-ECG reduced LVEF; the reported pretraining benefits are task-dependent and generalize to new datasets.Source: Pretraining benefits · p. 8
- Across tasks, Full outperforms baselines at approximately 100,000 training samples, but some task performances trend toward a similar plateau with larger datasets.The data-scaling figure reports label-averaged AUPRC across experiment suites, training dataset sizes, and all three tasks.Source: Figure 3 · p. 8, Downstream performance · p. 9
3.2 Latent space analysis
- On an unseen UHN-ECG dataset, the unlabeled-pretrained representations organize rhythm, heart rate, and pathology; related rhythms lie near one another in the latent space.Normal sinus rhythm appears within a broader sinus-rhythm region, while bradycardia and tachycardia form its extremities; the label overlay is evaluative.Source: §3.2 · pp. 9–10, Figure 4 · p. 9
3.3 Downstream tasks
- UHN-ECG interpretation performance is strong across labels despite 12.4% of the test set being marked poor-quality; results vary with prevalence, ECG-signature subtlety, and diagnostic complexity.The cohort is described as representative of real in-hospital populations.Source: §3.3 · p. 10
- MIMIC-IV-ECG machine-read performance is lower than UHN-ECG interpretation for most shared labels, but comparable or higher for some, supporting its use as a practical benchmark.The passage attributes much of the disparity as likely due to label quality; Bifascicular block has higher AUPRC on the machine-read task.Source: §3.3 · p. 10
- For UHN-ECG reduced LVEF, Full outperforms both baselines across all data scales and labels; whether that gap would close with more task-specific data is unclear.Full performance trends upward with more data, suggesting pretraining may continue to benefit from a larger dataset.Source: §3.3 · p. 10
3.4 Saliency maps
- Saliency examples show attention on pacing spikes when predicting ventricular pacing, consistent with use of clinically relevant localized features.The maps are heuristic displays of relative input importance, and do not fully explain model decisions.Source: Figure 5 · p. 10, §3.4 · p. 11
3.5 Independent evaluation
- In an independent frozen-embedding evaluation on prehospital ambulance ECGs, ECG-FM achieved AUPRC 0.667 ± 0.024 for ACS, versus ST-MEM’s 0.594 ± 0.013.The private MEDIC dataset contained 5,813 10 s 12-lead ECGs, with 20% ACS prevalence.Source: §3.5 · p. 11
4 Discussion
ECG-FM shows label-efficient performance across clinically relevant ECG tasks, with evaluation suggesting generalizability beyond its pretraining datasets. The discussion also highlights interpretability analyses, a 5-second input limitation, and possible multimodal extensions.
4 Discussion
- UHN-ECG interpretation and reduced-LVEF tasks support cross-dataset generalizability in a simulated prospective setting with representative hospital populations and tracing quality.Independent results from Meng et al. 35 suggest discrimination for early ACS triage in noisier prehospital settings; the authors also release the MIMIC-IV-ECG machine-reads benchmark materials.Source: §4 · p. 11
- ECG-FM consistently outperforms conventional task-specific methods in the small-to-medium data regime, and its pretrained embeddings encode task-relevant information.The authors suggest ECG-FM could serve as a robust feature-set generator for diverse clinical applications.Source: §4 · p. 11
- Saliency maps show preferential attention to recurring cardiac-cycle regions, while latent-space analysis indicates embeddings are functionally discriminative and capture underlying cardiac function.The authors present these analyses as a basis for improving model interpretability.Source: §4 · p. 11
- Using consecutive 5-second segments creates a mismatch with non-segment-specific labels, potentially underrating performance; aggregation raised PVC AUPRC by 16.65%.The effect was label-specific and appeared mitigable with simple techniques.Source: §4 · p. 11
- The authors propose integrating ECG-FM as an encoder in multimodal models pairing ECGs with imaging or clinical notes.They suggest an ECG-focused multimodal language model could support interpretation reports, uncertainty quantification, and question answering.Source: §4 · pp. 11–12
- Pretrained and MIMIC-IV-ECG downstream weights are available, but privacy concerns prevent release of UHN-ECG downstream models and the UHN-ECG dataset.The authors provide code and tutorial notebooks for preprocessing, training, inference, and reproducing experiments.Source: Data availability · p. 12
5 Supplementary Material
The supplementary material documents data splits and label prevalence, segment aggregation, patient demographics, interpretation parsing, and performance-curve reporting. It describes methods and table or figure scope, but the supplied passages do not provide the corresponding numeric test results.
5 Supplementary Material
- UHN-ECG split documentation specifies approximate 80/10/10 partitions with no temporal or patient overlap; supplementary tables cover abbreviations and positive-label prevalence by split and task.Source: Figure 6 · p. 15, Table 1 · p. 15, Table 2 · p. 16
5.1 Segment aggregation
- Validation AUPRC selects per-label aggregation: max suits distinct markers, mean suits sustained patterns, and only normal sinus rhythm uses min.Table 6 reports metric increases over non-aggregated results; the authors describe aggregation as a crude full-sample estimate and omit it from the main method.Source: §5.1 · p. 19, Table 6 · p. 20
5.2 Patient demographics
- Across downstream task manifests, the demographic tables summarize biological age as mean ± STD and biological sex as percentage female.Source: Table 7 · p. 20, Table 8 · p. 20
5.3 Interpretation Text Parsing
- Manually curated pattern matching parses over 99% of UHN-ECG interpretations completely, then clinician-in-the-loop label relationships recursively mark logically entailed diagnoses.The parsing pipeline derives entities, descriptors, and connectives from free text before mapping findings to flexible labels.Source: §5.3 · p. 21
5.4 Performance curves
- Performance curves report ROC and precision-recall curves for each label across Full, Random Init., and Linear suites for UHN interpretation, reduced LVEF, and MIMIC-IV-ECG machine reads.Source: §5.4 · p. 21, Figure 8 · p. 21, Figure 9 · p. 22