Skip to main content

ALADIN

Cross-platform build

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,000 patients. ALADIN can handle any ECG recording from clinical MUSE recordings to handheld KardiaMobile measurements ranging from 6 seconds to 24 hours.

pip install aladin-ecg

Changelog:

💡Version 1.1.2 08/08/2026:

  • Added PyPi support

💡Version 1.1.1 15/07/2026:

  • Added Github Actions to verify cross-platform compatibality
  • Added unit tests
  • Downloads missing model weights automatically from Hugging Face (access required)

💡Version 1.1.0 16/03/2026:

  • Added ability to handle 1, 3, and 12-lead ECG
  • Added median beat extraction and corresponding beat median segmentations based on segmentation and QRS clusters

System requirements:

  • Linux Ubuntu >= 20.04 or MacOSX 13.6.x or Microsoft Windows >=10
  • Python >3.10
  • 20Gb free diskspace
  • Modern GPU with >12Gb VRAM is recommended for training and inference

Tested on Linux Ubuntu 20.04, MacOSX 13.6.x, and Microsoft Windows 10 and 11 Home. CPU-only support is available, but a modern GPU is required for training and will speed up inference substantially. Tested on NVidia GeForce 3090.

Installation

When on MacOS, a homebrew install of OpenMP is required:

brew install libomp

Next, clone and install ALADIN:

git clone https://github.com/fastlib/ALADIN.git
cd ALADIN
python -m venv VENV #create virtual environment
source VENV/bin/activate #activate environment

pip install scikit-build-core pybind11 ninja cmake #build tooling, must be installed before building aladin
pip install torch #must be installed before building aladin's C++ extension
pip install ./nnUNet
pip install ./aladin --no-build-isolation
mkdir models

Example usage

import numpy as np
from aladin import ALADIN
from aladin.core import Record

#ecg should be a dictionary with the keys being lead names
fs = 250 #hz
ecg = {"II": np.random.rand(fs*10)}

#create record object
record = Record(ecg, fs)

#create ALADIN object
aladin = ALADIN(modelpaths=["ClassificationTrainer__nnUNetWithClassificationPlans__1d_decoding"])

#perform segmentation
aladin.segment(record)

#perform diagnosis
aladin.analyse(record)

#perform median beat extraction
aladin.extract_median_beat(record)
median_beat = record.median_beat.ecg

Example code

python demo.py --case=[recording]

Where [recording] can be one of (STANFORD1, STANFORD2, A01986, A08391).

Reproduce benchmark

See Benchmark.md for details on benchmark reproduction.

macOS build notes

ALADIN's C++ extension (aladin._main) uses OpenMP for native multithreading. On macOS, Apple Clang doesn't ship OpenMP itself, so the extension is built using Homebrew's libomp for headers — but it links against PyTorch's own bundled libomp.dylib at runtime rather than Homebrew's copy. This is necessary because loading two independent OpenMP runtimes into the same Python process (one from Homebrew via this extension, one bundled with PyTorch) causes macOS to crash under concurrent load, with segfaults inside libomp's __kmp_suspend_64. Sharing a single runtime with PyTorch avoids that.

This has two consequences for how you install/rebuild ALADIN on macOS:

  • torch must already be installed before building aladin. The build step needs to import torch to locate its bundled libomp.dylib. If torch isn't importable at build time, the build falls back to Homebrew's libomp with a WARNING, which reintroduces the crash risk above.
  • Always pass --no-build-isolation when installing/rebuilding aladin. By default, pip install builds packages inside a temporary, isolated environment that can't see torch (or anything else) installed in your venv, even though it reuses the same Python interpreter — which defeats the point above. --no-build-isolation builds directly against your venv instead, so make sure scikit-build-core, pybind11, ninja, cmake, and torch are installed in the venv first (as in the install steps above). This applies every time you rebuild the extension, e.g. after pip install -e ./aladin for development.

ALADIN will automatically download the model weights from the private Hugging Face repo AUMC/ALADIN into ~/.cache/aladin/models the first time they're needed. However, this requires Hugging Face account access to the AUMC/ALADIN repo, and being authenticated locally via huggingface-cli login or the HF_TOKEN environment variable.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

aladin_ecg-1.0.0.tar.gz (781.0 kB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

aladin_ecg-1.0.0-cp314-cp314-win_amd64.whl (997.9 kB view details)

Uploaded CPython 3.14Windows x86-64

aladin_ecg-1.0.0-cp314-cp314-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (941.3 kB view details)

Uploaded CPython 3.14manylinux: glibc 2.27+ x86-64manylinux: glibc 2.28+ x86-64

aladin_ecg-1.0.0-cp314-cp314-macosx_14_0_arm64.whl (976.9 kB view details)

Uploaded CPython 3.14macOS 14.0+ ARM64

aladin_ecg-1.0.0-cp313-cp313-win_amd64.whl (981.8 kB view details)

Uploaded CPython 3.13Windows x86-64

aladin_ecg-1.0.0-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (941.2 kB view details)

Uploaded CPython 3.13manylinux: glibc 2.27+ x86-64manylinux: glibc 2.28+ x86-64

aladin_ecg-1.0.0-cp313-cp313-macosx_14_0_arm64.whl (976.8 kB view details)

Uploaded CPython 3.13macOS 14.0+ ARM64

aladin_ecg-1.0.0-cp312-cp312-win_amd64.whl (981.8 kB view details)

Uploaded CPython 3.12Windows x86-64

aladin_ecg-1.0.0-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (941.3 kB view details)

Uploaded CPython 3.12manylinux: glibc 2.27+ x86-64manylinux: glibc 2.28+ x86-64

aladin_ecg-1.0.0-cp312-cp312-macosx_14_0_arm64.whl (976.7 kB view details)

Uploaded CPython 3.12macOS 14.0+ ARM64

aladin_ecg-1.0.0-cp311-cp311-win_amd64.whl (980.4 kB view details)

Uploaded CPython 3.11Windows x86-64

aladin_ecg-1.0.0-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (937.4 kB view details)

Uploaded CPython 3.11manylinux: glibc 2.27+ x86-64manylinux: glibc 2.28+ x86-64

aladin_ecg-1.0.0-cp311-cp311-macosx_14_0_arm64.whl (974.0 kB view details)

Uploaded CPython 3.11macOS 14.0+ ARM64

File details

Details for the file aladin_ecg-1.0.0.tar.gz.

File metadata

  • Download URL: aladin_ecg-1.0.0.tar.gz
  • Upload date:
  • Size: 781.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for aladin_ecg-1.0.0.tar.gz
Algorithm Hash digest
SHA256 9954d005b18138ba849a2e565ffdc7010d2ad8aef52267c3cce7cbe67ea1348b
MD5 e9b3adf6305eb9500400d3eb564eabdf
BLAKE2b-256 2cd998fa902a85e2b72dcfd08f30eb94c9856cb7c12586c464cf08ebd2869ba6

See more details on using hashes here.

Provenance

The following attestation bundles were made for aladin_ecg-1.0.0.tar.gz:

Publisher: release.yml on fastlib/ALADIN

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file aladin_ecg-1.0.0-cp314-cp314-win_amd64.whl.

File metadata

  • Download URL: aladin_ecg-1.0.0-cp314-cp314-win_amd64.whl
  • Upload date:
  • Size: 997.9 kB
  • Tags: CPython 3.14, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for aladin_ecg-1.0.0-cp314-cp314-win_amd64.whl
Algorithm Hash digest
SHA256 8471d720f349c1a036ca142dee56abdb10e27a2a5d15d9e6fb5706a57ef8a4fa
MD5 b72a79db28a1b98e6480ed04f3c7aa19
BLAKE2b-256 1b3512814f792ab2752eeace80b26911a0d84a7c92b88b757c1f71e1644595be

See more details on using hashes here.

Provenance

The following attestation bundles were made for aladin_ecg-1.0.0-cp314-cp314-win_amd64.whl:

Publisher: release.yml on fastlib/ALADIN

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file aladin_ecg-1.0.0-cp314-cp314-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for aladin_ecg-1.0.0-cp314-cp314-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 9d3f242d289c9adf0df28653480a50038332527865b8c21191effa08da1dac61
MD5 0f8a6d07147c562a74feec2f1e0717ff
BLAKE2b-256 34400657e41e06d89032fe044e54a6ae78f7c003ef8649853df55422a58efb28

See more details on using hashes here.

Provenance

The following attestation bundles were made for aladin_ecg-1.0.0-cp314-cp314-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl:

Publisher: release.yml on fastlib/ALADIN

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file aladin_ecg-1.0.0-cp314-cp314-macosx_14_0_arm64.whl.

File metadata

File hashes

Hashes for aladin_ecg-1.0.0-cp314-cp314-macosx_14_0_arm64.whl
Algorithm Hash digest
SHA256 8ba5950857abef1657ef6c9917aaee953bb5e4b3dcf597b8a2c7c0aa5ccac1bf
MD5 fdf3f02f8f063adc6821e9bb60ab24ab
BLAKE2b-256 5aba7053d6d98f5c06df861e7e7483795a3a413959a6df057fb4bb060358a6e5

See more details on using hashes here.

Provenance

The following attestation bundles were made for aladin_ecg-1.0.0-cp314-cp314-macosx_14_0_arm64.whl:

Publisher: release.yml on fastlib/ALADIN

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file aladin_ecg-1.0.0-cp313-cp313-win_amd64.whl.

File metadata

  • Download URL: aladin_ecg-1.0.0-cp313-cp313-win_amd64.whl
  • Upload date:
  • Size: 981.8 kB
  • Tags: CPython 3.13, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for aladin_ecg-1.0.0-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 46f969b9bab9b154a20b6fb6f052ffb5be7d5c74998047256bc875b303e7e808
MD5 4196f5f79fd7b7ead0c269513c922c8a
BLAKE2b-256 3643715fe6435c481c163d5bd4110ddd16a783526dfd9d0693b0facd29549725

See more details on using hashes here.

Provenance

The following attestation bundles were made for aladin_ecg-1.0.0-cp313-cp313-win_amd64.whl:

Publisher: release.yml on fastlib/ALADIN

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file aladin_ecg-1.0.0-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for aladin_ecg-1.0.0-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 11ba6f1697fa43bd76d33db0f728fffd4fd7e4d8ebb299fc727b6d36acfefe0d
MD5 d89a4df27a483292f80b2d5ec0d01793
BLAKE2b-256 24dfc40ed355dff5dfce77e888d4a844d1e1dd320147feda9b24ecaf4032d181

See more details on using hashes here.

Provenance

The following attestation bundles were made for aladin_ecg-1.0.0-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl:

Publisher: release.yml on fastlib/ALADIN

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file aladin_ecg-1.0.0-cp313-cp313-macosx_14_0_arm64.whl.

File metadata

File hashes

Hashes for aladin_ecg-1.0.0-cp313-cp313-macosx_14_0_arm64.whl
Algorithm Hash digest
SHA256 771db97ed1e34ec3c67e826f22e0314127b6fa27f465f4f56ba9b18188e479f4
MD5 a242093a9911a02dc681592a43a66c37
BLAKE2b-256 350c817474f28a3a1a61d2fda3f9a152a0066e6d35fd8a340b918fb656536f21

See more details on using hashes here.

Provenance

The following attestation bundles were made for aladin_ecg-1.0.0-cp313-cp313-macosx_14_0_arm64.whl:

Publisher: release.yml on fastlib/ALADIN

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file aladin_ecg-1.0.0-cp312-cp312-win_amd64.whl.

File metadata

  • Download URL: aladin_ecg-1.0.0-cp312-cp312-win_amd64.whl
  • Upload date:
  • Size: 981.8 kB
  • Tags: CPython 3.12, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for aladin_ecg-1.0.0-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 27e2d199577c98106822de3cf73e343c0de5a47214d5c661b6c6176fc4eaa240
MD5 9469605b808f6b24aba6576f430b2028
BLAKE2b-256 af4a92b99daa6fc1d275005d6653ce25386c0699304adbb2ff5211b2230af461

See more details on using hashes here.

Provenance

The following attestation bundles were made for aladin_ecg-1.0.0-cp312-cp312-win_amd64.whl:

Publisher: release.yml on fastlib/ALADIN

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file aladin_ecg-1.0.0-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for aladin_ecg-1.0.0-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 3e4e303a4bbdd6e4688260a45ba63063f891bf488fbf299e8524e0655152c3fb
MD5 3dd01ce15e5fa38848cea384a63ad57d
BLAKE2b-256 48ebe6a47be88b876156435f86890f5c91768262ccc7d83447efeae1a27b541f

See more details on using hashes here.

Provenance

The following attestation bundles were made for aladin_ecg-1.0.0-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl:

Publisher: release.yml on fastlib/ALADIN

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file aladin_ecg-1.0.0-cp312-cp312-macosx_14_0_arm64.whl.

File metadata

File hashes

Hashes for aladin_ecg-1.0.0-cp312-cp312-macosx_14_0_arm64.whl
Algorithm Hash digest
SHA256 e869f42fb050dc6b476734aeb0ee00356f9f44e7a5744a09b4bd128405dc2d69
MD5 a139c7dbaea66bb974f2a7af4adfcf72
BLAKE2b-256 2f34f0f9081a9dd92e7886e0c03edc0cab19b920a895c533d69be7162618bbad

See more details on using hashes here.

Provenance

The following attestation bundles were made for aladin_ecg-1.0.0-cp312-cp312-macosx_14_0_arm64.whl:

Publisher: release.yml on fastlib/ALADIN

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file aladin_ecg-1.0.0-cp311-cp311-win_amd64.whl.

File metadata

  • Download URL: aladin_ecg-1.0.0-cp311-cp311-win_amd64.whl
  • Upload date:
  • Size: 980.4 kB
  • Tags: CPython 3.11, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for aladin_ecg-1.0.0-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 1293660cb044c177b1eb166dced02381d284c6992a053889e4d3efba13bcaaf0
MD5 f4b94d3035bd8b7ff63586b1fbb727a9
BLAKE2b-256 cfdb18b3cc356ec1050bea030b40dcb36e7117a136f3673bbbff41d7c78e2454

See more details on using hashes here.

Provenance

The following attestation bundles were made for aladin_ecg-1.0.0-cp311-cp311-win_amd64.whl:

Publisher: release.yml on fastlib/ALADIN

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file aladin_ecg-1.0.0-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for aladin_ecg-1.0.0-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 1e5d50f1049259adf21991bbc8ee22a5b6605a7c7cafcce4430c0e44f45aec26
MD5 6bb22eae82ea1e8d797fc0229de895b5
BLAKE2b-256 e872bdcccbe0b6c44681ee0006689440f7d74725de6ddc56d460c404eae82fcb

See more details on using hashes here.

Provenance

The following attestation bundles were made for aladin_ecg-1.0.0-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl:

Publisher: release.yml on fastlib/ALADIN

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file aladin_ecg-1.0.0-cp311-cp311-macosx_14_0_arm64.whl.

File metadata

File hashes

Hashes for aladin_ecg-1.0.0-cp311-cp311-macosx_14_0_arm64.whl
Algorithm Hash digest
SHA256 2099e3e655e4642297cd4da5ca90a8e03afa7c82c84dd2f5c36750c641139d8f
MD5 d860e4891f6db44c5ba8ff837b47bf26
BLAKE2b-256 912b9c9d198d15d8644d137f1681b6dea7f4e62a778863dfa6a89cee2344a506

See more details on using hashes here.

Provenance

The following attestation bundles were made for aladin_ecg-1.0.0-cp311-cp311-macosx_14_0_arm64.whl:

Publisher: release.yml on fastlib/ALADIN

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page