Downloads · 30 days
13
31% of all-time downloads
AngusNicolson/ecg-reconstruction-risk
ecg-reconstruction-risk is a machine learning model from AngusNicolson. Use it for the machine learning task on the model card, and read the license before you ship it in a product. The card lists the license as mit.
A self-supervised masked autoencoder (ViT-Tiny) for 12-lead ECGs, pretrained on CODE-85% (~7.2 million ECGs). The model was trained only to reconstruct masked portions of the signal.
Downloads · 30 days
13
31% of all-time downloads
All-time downloads
42
Public
Parameters
7.3M
58.2 MB on disk
Likes
0
Public
Click a slice to open those files.
.safetensors29.1 MB · 100%
From the Hugging Face model README
A self-supervised masked autoencoder (ViT-Tiny) for 12-lead ECGs, pretrained on CODE-85% (~7.2 million ECGs). The model was trained only to reconstruct masked portions of the signal.
Reconstruction error (mean absolute error between input and reconstruction) is associated with all-cause mortality, and can be used as a continuous, label-free risk score. See the paper for validation across six cohorts.
Research use only. This is not a medical device and must not be used to guide clinical decisions.
git clone [email protected]:dlaskalab/ecg-reconstruction-risk.git
cd ecg-reconstruction-risk
uv run run_pretrained_model.py $DATA_DIR $OUTPUT_DIR
$DATA_DIR is a directory of ECGs in WFDB format (.hea and .dat files). Weights are downloaded from this repository automatically on first run. Full instructions, including survival analysis, are in the GitHub repository.
| File | Description |
|---|---|
model.safetensors | Model weights |
config.yaml | Training configuration |
CODE15_mae_values.json | Reference reconstruction-error statistics from CODE-15%, used for normalisation and thresholding |
config.yaml (100 Hz resampling, lead-wise normalisation). Deviate from it and the CODE-15% reference statistics will not transfer.run_pretrained_model.py averages over five repeats by default.Retrospective and observational, so all findings are associational. Only all-cause mortality has been assessed. See the paper for full details.
@article{nicolson2026ecg,
title = {Artificial intelligence-based ECG reconstruction error as a continuous predictor of all-cause mortality: a multi-cohort retrospective validation study},
author = {Nicolson, Angus and Pr{\"o}ll, Samuel and Lunelli, Riccardo and Blankenburg, Hagen and Pramstaller, Peter and Fuchsberger, Christian and Bauer, Axel and Dlaska, Clemens},
journal = {medRxiv},
year = {2026},
doi = {10.64898/2026.07.10.26357749}
}