Downloads · 30 days
470
66% of all-time downloads
hellothisisaswin/ecg-ptbxl-classification
ecg-ptbxl-classification is a machine learning model from hellothisisaswin. Use it for the machine learning task on the model card, and read the license before you ship it in a product. It is set up for keras. The card lists the license as mit.
Multi-label classification of 5 cardiovascular superclasses (NORM, MI, STTC, CD, HYP) from 12-lead ECG recordings, trained on PTB-XL.
Downloads · 30 days
470
66% of all-time downloads
All-time downloads
714
Public
Repo size
31.2 MB
Likes
0
Public
Click a slice to open those files.
.keras15.7 MB · 100%
From the Hugging Face model README
Multi-label classification of 5 cardiovascular superclasses (NORM, MI, STTC, CD, HYP) from 12-lead ECG recordings, trained on PTB-XL.
Deployed model: CNN (noaug training variant)
ecg_model.keras | trained modelnormalisation_params.npz | per-channel mean and std (z-score, from training fold)thresholds.json | per-class decision thresholds optimised on the validation foldimport keras, numpy as np, json
from huggingface_hub import hf_hub_download
model = keras.saving.load_model(
hf_hub_download("Steenslid/ecg-ptbxl-classification", "ecg_model.keras"))
params = np.load(hf_hub_download("Steenslid/ecg-ptbxl-classification", "normalisation_params.npz"))
with open(hf_hub_download("Steenslid/ecg-ptbxl-classification", "thresholds.json")) as f:
thresholds = json.load(f)
# Input x: (1000, 12) float32 ECG in mV, 100 Hz, standard 12-lead order
x_norm = (x - params["mean"]) / params["std"]
probs = model.predict(x_norm[np.newaxis])[0]
preds = {sc: probs[i] >= thresholds[sc] for i, sc in enumerate(
["NORM","MI","STTC","CD","HYP"])}
Authors: Edvard Vindenes Steenslid & Morten Kvamme