ALADIN is a neuro-symbolic AI model that preprocesses, segments, and diagnoses single- and multi-lead ECG signals. It has been validated extensively on three diverse patient cohorts with a combined size of 13,780 patients. ALADIN can handle any ECG recording from clinical MUSE recordings to ambulatory ZioPatch sessions and handheld KardiaMobile measurements ranging from 6 seconds to 24 hours.
Due to ALADIN's native, memory-level integration of PyTorch and its multithreaded C++ backend, ALADIN can easily process large datasets with up to millions of ECGs, while automatically adapting to hardware configurations that range from consumer laptops to high-performance clusters.
Installation
pip install aladin-ecg
Model weights are downloaded automatically and anonymously from the Hugging Face repo fastlib/ALADIN the first time they're needed, and cached in ~/.cache/huggingface/hub (or HF_HOME/HF_HUB_CACHE if set). To skip the download, point the aladin_models environment variable at a local folder that already contains the weights.
System requirements
- Linux Ubuntu ≥20.04, macOS ≥13.6, or Windows ≥10
- Python 3.11–3.14
- ≥8GB RAM
- A modern GPU with ≥12GB VRAM is recommended for training and inference; CPU-only inference is supported but slower
Installing from source
git clone https://github.com/fastlib/ALADIN.git
cd ALADIN
python -m venv VENV
source VENV/bin/activate
pip install .
Demo
A runnable demo is available via:
python demo.py --case=[recording]
where [recording] is one of STANFORD1, STANFORD2, A01986, A08391.
Usage
import numpy as np
from aladin import ALADIN #import framework
from aladin.core import Record #custom record class
# ecg is a dict keyed by lead name
# 1-12 leads are supported, models are selected based on lead presence, see below
fs = 250 # Hz
ecg = {"II": np.random.rand(fs * 10)}
record = Record(ecg, fs)
# modelpaths="auto" picks the pretrained 1-lead or 3-lead model based on which
# leads are available (lead II is required; the 3-lead model additionally needs
# V1 and V6, otherwise ALADIN falls back to the 1-lead model)
aladin = ALADIN(modelpaths="auto")
# only delineation
aladin.segment(record)
p = record.delineations.p.[binary|logits|uncertainty]
qrs = record.delineations.qrs.[binary|logits|uncertainty]
t = record.delineations.t.[binary|logits|uncertainty]
abnormal_qrs = record.delineations.abnormal_qrs.[binary|logits|uncertainty] #V beats
afib = record.delineations.afib.[binary|logits|uncertainty]
noise = record.delineations.noise.[binary|logits|uncertainty]
# delineation and diagnosis
alading.analyse(record)
results = record.to_dict()
# median beat extraction
aladin.extract_median_beat(record)
median_beat = record.median_beat.ecg
median_beat_delineations = record.median_beat.delineations.[p|qrs|t].[onset|offset|mask]
Benchmark reproduction
See benchmark.md for details on reproducing the published delineation and diagnosis benchmarks on the Stanford, RDB, and CinC datasets.
Model card
For details on training data, intended use, performance, limitations, and responsible use, see the Model Card.
Changelog
1.1.2 — Added PyPI support
1.1.1 — Cross-platform GitHub Actions, unit tests, automatic model weight downloads from Hugging Face
1.1.0 — Support for 1-, 3-, and 12-lead ECG; median beat extraction and beat-median segmentations
Metadata
Release files for aladin-ecg 1.0.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| aladin_ecg-1.0.2.tar.gz | 791.0 kB | Details |
Built distributions (wheels)
Total release size: 11.4 MB
Release files / aladin_ecg-1.0.2.tar.gz
| Download URL | aladin_ecg-1.0.2.tar.gz |
|---|---|
| Size | 791.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
0203d28911aa1e314bb67c5d0244a04e854d4b62bd4a56729a4f447586cfa756
|
|
BLAKE2b-256 checksum How to use checksums |
1fb89584eaa815b8050d4a7e16914c81080a9a8fc3644a9203a8e137426006cb
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Aug 17, 2026.
Transparency logRelease files / aladin_ecg-1.0.2-cp314-cp314-win_amd64.whl
| Download URL | aladin_ecg-1.0.2-cp314-cp314-win_amd64.whl |
|---|---|
| Size | 1.0 MB |
| Tags | CPython 3.14 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
2045e0a5919752c10c6aeefad0d16c30305c7e8c8611b4440526ef02f784399a
|
|
BLAKE2b-256 checksum How to use checksums |
27fc7c190f9fee77eb8f8dec7be476293758177337d69d9fb5ec6544d936e380
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Aug 17, 2026.
Transparency logRelease files / aladin_ecg-1.0.2-cp314-cp314-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
| Download URL | aladin_ecg-1.0.2-cp314-cp314-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl |
|---|---|
| Size | 943.8 kB |
| Tags | CPython 3.14 Linux glibc 2.27+ x86-64 Linux glibc 2.28+ x86-64 |
|
SHA-256 checksum How to use checksums |
876d69d17b66d761a3ddcd84bb04be3272062c8beea5d4c3d0dfb1df54af7125
|
|
BLAKE2b-256 checksum How to use checksums |
7e1704fe3d81e7c537d4fb321ca05d4a286341c10b2c5300cfc6848326b24cd4
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Aug 17, 2026.
Transparency logRelease files / aladin_ecg-1.0.2-cp314-cp314-macosx_14_0_arm64.whl
| Download URL | aladin_ecg-1.0.2-cp314-cp314-macosx_14_0_arm64.whl |
|---|---|
| Size | 728.5 kB |
| Tags | CPython 3.14 macOS 14.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
138924fd73033761137a264b8975d85b96cdd2a047427f1dc054fa6e7995a562
|
|
BLAKE2b-256 checksum How to use checksums |
4b72e56f643b8d2fb63c9cee857de2b634a5aee22641d3d112e82e8ee7e9263c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Aug 17, 2026.
Transparency logRelease files / aladin_ecg-1.0.2-cp313-cp313-win_amd64.whl
| Download URL | aladin_ecg-1.0.2-cp313-cp313-win_amd64.whl |
|---|---|
| Size | 984.4 kB |
| Tags | CPython 3.13 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
237d558931de8ebbcd51a8e485ad584604239930bd3fc225f1c8596abdc8460d
|
|
BLAKE2b-256 checksum How to use checksums |
ca9b46eeac9cfc1f5d86580a98d709de16234de391358548ecabba74aa49b715
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Aug 17, 2026.
Transparency logRelease files / aladin_ecg-1.0.2-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
| Download URL | aladin_ecg-1.0.2-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl |
|---|---|
| Size | 943.8 kB |
| Tags | CPython 3.13 Linux glibc 2.27+ x86-64 Linux glibc 2.28+ x86-64 |
|
SHA-256 checksum How to use checksums |
2e6903d09da26f41f8da2deee6195952fc723f3885b91bbd4251a79806e8b361
|
|
BLAKE2b-256 checksum How to use checksums |
9db6dd5cdd1cb5612b77989dfa4bdfaa7bcdc00122e926fef58ad33e90eeb882
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Aug 17, 2026.
Transparency logRelease files / aladin_ecg-1.0.2-cp313-cp313-macosx_14_0_arm64.whl
| Download URL | aladin_ecg-1.0.2-cp313-cp313-macosx_14_0_arm64.whl |
|---|---|
| Size | 728.5 kB |
| Tags | CPython 3.13 macOS 14.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
8723f5a895cfa5e17a539761b3e50d717c291d08d998e8053e10500fcf461752
|
|
BLAKE2b-256 checksum How to use checksums |
1bc2c86fc1eded81a4ead0b6a5c00c2dbe935b97654806528c84ba0ad6e4631a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Aug 17, 2026.
Transparency logRelease files / aladin_ecg-1.0.2-cp312-cp312-win_amd64.whl
| Download URL | aladin_ecg-1.0.2-cp312-cp312-win_amd64.whl |
|---|---|
| Size | 984.3 kB |
| Tags | CPython 3.12 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
f22fc47194e268e66e5d26fe00e8d8b0646e125fe446783a237d7de9ab956fcd
|
|
BLAKE2b-256 checksum How to use checksums |
95189e1f66e3f4d176168dc05464e154654cfa3508e3b6628e4e2bca8647de36
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Aug 17, 2026.
Transparency logRelease files / aladin_ecg-1.0.2-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
| Download URL | aladin_ecg-1.0.2-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl |
|---|---|
| Size | 943.8 kB |
| Tags | CPython 3.12 Linux glibc 2.27+ x86-64 Linux glibc 2.28+ x86-64 |
|
SHA-256 checksum How to use checksums |
98eeb5aeedb89340e48f94431562ddf87b7b38e2613c6789b82ce3020e8c46fb
|
|
BLAKE2b-256 checksum How to use checksums |
7d47523628f407226cc0ab02b1da939d7e6ca94bcb7f12d6a3026780ddab5dd5
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Aug 17, 2026.
Transparency logRelease files / aladin_ecg-1.0.2-cp312-cp312-macosx_14_0_arm64.whl
| Download URL | aladin_ecg-1.0.2-cp312-cp312-macosx_14_0_arm64.whl |
|---|---|
| Size | 728.4 kB |
| Tags | CPython 3.12 macOS 14.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
a8ea73f4c6ace12b3dc0462a704e8b9777292e0a5dc37bc745530bae8cf4aee5
|
|
BLAKE2b-256 checksum How to use checksums |
e83ef6ed42dc9d3599051290d86458f45a0ca6b90c2905f3408b733610573506
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Aug 17, 2026.
Transparency logRelease files / aladin_ecg-1.0.2-cp311-cp311-win_amd64.whl
| Download URL | aladin_ecg-1.0.2-cp311-cp311-win_amd64.whl |
|---|---|
| Size | 982.9 kB |
| Tags | CPython 3.11 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
16ac12dde2f0913c730b873d451ed414aad6a9d1c02ff3bb794e4b9aea60906c
|
|
BLAKE2b-256 checksum How to use checksums |
66321d55e5752daa3ce9a14e19fc3b59f45cacbc2b310ab297c3aa0397efc345
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Aug 17, 2026.
Transparency logRelease files / aladin_ecg-1.0.2-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
| Download URL | aladin_ecg-1.0.2-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl |
|---|---|
| Size | 939.9 kB |
| Tags | CPython 3.11 Linux glibc 2.27+ x86-64 Linux glibc 2.28+ x86-64 |
|
SHA-256 checksum How to use checksums |
8fcab77c60363a81f7159aab53c52be33a0d6469d35ec230caa3754c98563d4c
|
|
BLAKE2b-256 checksum How to use checksums |
ed42ee5efe75edbb39f82d0ca0e385aa7ca447d89bd2c23c6e8aac802665d28d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Aug 17, 2026.
Transparency logRelease files / aladin_ecg-1.0.2-cp311-cp311-macosx_14_0_arm64.whl
| Download URL | aladin_ecg-1.0.2-cp311-cp311-macosx_14_0_arm64.whl |
|---|---|
| Size | 725.8 kB |
| Tags | CPython 3.11 macOS 14.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
e808724e2b29048a464f51d7db08308215896d230e7d046106115ac72b20a7f5
|
|
BLAKE2b-256 checksum How to use checksums |
263f48bc51da14380e81ec9fb379dd6cbf3c30b494ee4c855f500c575771c4b8
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Aug 17, 2026.
Transparency log