Table of Contents
Fetching ...

ECG-FM: An Open Electrocardiogram Foundation Model

Kaden McKeen, Sameer Masood, Augustin Toma, Barry Rubin, Bo Wang

TL;DR

ECG-FM introduces an open-weight ECG foundation approach that leverages a hybrid wav2vec 2.0–CMSC self-supervised objective with Random Lead Masking to learn robust, transferable ECG representations from 1.5 million examples. It demonstrates strong data-efficiency and cross-dataset generalizability, outperforming task-specific baselines in small-to-medium data regimes and enabling reliable downstream tasks such as UHN-ECG interpretation and reduced LVEF prediction. The work provides a practical benchmark and open-source resources, including pretrained weights and code, to accelerate adoption and comparability in ECG foundation-model research. Independent evaluation on external data corroborates discriminative capability for acute coronary syndrome triage, and analyses show meaningful latent structure and interpretable attention patterns.

Abstract

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/.

ECG-FM: An Open Electrocardiogram Foundation Model

TL;DR

ECG-FM introduces an open-weight ECG foundation approach that leverages a hybrid wav2vec 2.0–CMSC self-supervised objective with Random Lead Masking to learn robust, transferable ECG representations from 1.5 million examples. It demonstrates strong data-efficiency and cross-dataset generalizability, outperforming task-specific baselines in small-to-medium data regimes and enabling reliable downstream tasks such as UHN-ECG interpretation and reduced LVEF prediction. The work provides a practical benchmark and open-source resources, including pretrained weights and code, to accelerate adoption and comparability in ECG foundation-model research. Independent evaluation on external data corroborates discriminative capability for acute coronary syndrome triage, and analyses show meaningful latent structure and interpretable attention patterns.

Abstract

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/.
Paper Structure (36 sections, 10 figures, 8 tables)

This paper contains 36 sections, 10 figures, 8 tables.

Figures (10)

  • Figure 1: Cohort and sample selection. This flow diagram shows the data sources and ECG exclusion criteria, as well as the dataset partitioning. The pretraining cohort combines samples from public datasets PhysioNet2021 and MIMIC-IV-ECG. Downstream task cohorts utilize MIMIC-IV-ECG and UHN-ECG datasets, where the reduced LVEF task undergoes filtering according to task-specific label availability.
  • Figure 2: Framework illustration. Raw waveforms are inputted and individual leads are randomly masked. A convolutional feature encoder generates latent representations that feed into a transformer encoder, producing local representations that are then average-pooled to create global representations. Latent representations are randomly masked in spans as $m$, and are quantized to $q$. We then apply a local contrastive loss attracting each $q$ to its corresponding local representation, using a subset of other $q$ as the negative samples, or distractors. A batch of four ECG inputs, making up two positive pairs of temporally-adjacent ECG segments, are shown to visualize the CMSC global contrastive loss acting on the global representations across samples. Positive and negative contrastive learning pair relationships are depicted using blue and red arrows, respectively.
  • Figure 3: Data scaling results. Label-averaged AUPRC across experiment suites and training dataset sizes for all three tasks.
  • Figure 4: Pretrained latent space UMAP. A UMAP visualization of pretrained ECG-FM global representations from ECGs in the UHN-ECG dataset. An additive color scheme employs select labels from the UHN-ECG interpretation task to enable a latent space analysis, wherein some prioritization was performed to prevent label overlap from reducing readability.
  • Figure 5: Saliency maps. Distinct 5 s ECG segments colored using corresponding self-attention weight activations derived from pretrained, full-finetuned ECG-FM models. Red represents a higher relative activation. (a) UHN-ECG interpretation model activations for an ECG labeled with ventricular pacing (lead II); (b) UHN-ECG interpretation model activations for an ECG labeled with LBBB (lead V1); (c) UHN-ECG reduced LVEF model activations for an ECG labeled with LVEF$\leq$30% (lead V3).
  • ...and 5 more figures