MCPcopy Create free account
hub / github.com/AI4HealthUOL/ecg-fm-benchmarking

github.com/AI4HealthUOL/ecg-fm-benchmarking @main

Chat with this repo
repository ↗ · DeepWiki ↗ · + Follow
1,050 symbols 2,629 edges 75 files 262 documented · 25% updated 2mo ago★ 52

Browse by type

Functions 823 Types & classes 227
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

ECG-FM-Benchmarking

The official repository for the paper Benchmarking ECG FMs: A Reality Check Across Clinical Tasks

arXiv

🎉 Our paper has been accepted at the Fourteenth International Conference on Learning Representations (ICLR 2026). OpenReview: https://openreview.net/forum?id=xXRqWpt3Xr

Here, we benchmark ECG foundation models across 12 public datasets and 26 clinically relevant tasks encompassing 1,650 regression and classification targets. We also proposed ECG-CPC, a new and outperforming ECG foundational model. We provide scripts, configurations, and checkpoints to evaluate models efficiently and reproducibly.

Abstract


📂 Datasets

You can download the datasets from the following sources:

  • PTB-XL
  • PTB
  • SPH
  • EchoNext
  • ZZU pECG
  • CODE-15%
  • Chapman
  • CPSC2018, CPSC-Extra, Georgia, Ningbo (Please include Label mappings 2021.xlsx in the respective dataset folder. The original file is linked on the CinC21 challenge website. )
  • MIMIC-IV-ECG (save under data/ the following files from physionet: records_w_diag_icd10.csv (MIMIC-IV-ECG-ICD), mds_ed.csv (MDS-ED), machine_measurements.csv (MIMIC-IV-ECG), omr.csv.gz (MIMIC-IV), vitalsign.csv.gz (MIMIC-IV), d_labitems.csv.gz (MIMIC-IV), labevents.csv.gz (MIMIC-IV), d_items.csv.gz (MIMIC-IV), chartevents.csv.gz (MIMIC-IV) )

📦 Checkpoints

Download pretrained checkpoints for evaluation:


⚙️ Installation

Set up the Python environment using the provided YAML files:

# General environment
conda env create -f env.yaml

# For ECG-FM evaluation
conda env create -f ecg_fm_env.yaml

🚀 Quick Start

Follow these steps to set up and run the benchmark:

1. Data Preprocessing

First, preprocess all datasets using the provided preprocess_ecg_dataset.ipynb Jupyter notebook.

2. Configuration Setup

Before running the benchmark, configure the necessary paths:

Edit run.sh file

Open run.sh in your preferred text editor and update the following variables with your local paths:

# Set these paths according to your system
BASE_DIR="/path/to/your/fm-benchmarking"
CHECKPOINTS_DIR="/path/to/your/checkpoints"
DATASET_DIR="/path/to/your/datasets"

Update dataset path

Modify the dataset path in the fm-benchmarking/code/clinical_ts/models/conf/data/ecg_ptbxl.yaml

Run run.sh file

sbatch run.sh

Please cite our publication if you found our research to be helpful.

@inproceedings{
      al-masud2026benchmarking,
      title={Benchmarking {ECG} Foundational Models: A Reality Check Across Clinical Tasks},
      author={M A Al-Masud and Juan Lopez Alcaraz and Nils Strodthoff},
      booktitle={The Fourteenth International Conference on Learning Representations},
      year={2026},
      url={https://openreview.net/forum?id=xXRqWpt3Xr}
}

Core symbols most depended-on inside this repo

browse all functions →

Shape

Method 552
Function 271
Class 227

Languages

Python100%
C++1%

Modules by API surface

code/clinical_ts/template_modules.py57 symbols
code/clinical_ts/data/time_series_dataset_transforms.py53 symbols
code/clinical_ts/models/fm_ecg.py51 symbols
code/clinical_ts/ts/s4_modules/s42.py47 symbols
code/clinical_ts/models/s42.py47 symbols
code/clinical_ts/metric/base.py45 symbols
code/clinical_ts/ts/head.py44 symbols
code/clinical_ts/models/ecg_foundation_models/ecg_jepa/ecg_jepa.py44 symbols
code/clinical_ts/template_model.py38 symbols
code/clinical_ts/models/xresnet1d.py33 symbols
code/clinical_ts/models/ecg_foundation_models/ecgfm_ked.py31 symbols
code/main_lite.py30 symbols

For agents

$ claude mcp add ecg-fm-benchmarking \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact

Ask about this repo answers extend the page