SatellaRhythm-Edge
Experimental single-lead ECG rhythm and signal-quality model โ research use only.
NOT FOR CLINICAL USE. Do not use this checkpoint for diagnosis, screening, triage, treatment, medical decisions, or reassurance that a recording is normal. The predefined research acceptance gate was NOT MET. No patient-independent, new-device or prospective clinical validation has been demonstrated. Even a
NORMALprediction cannot rule out a heart problem.
Creator: Zain Asad (EphraimAsad)
GitHub source: https://github.com/EphraimAsad/SatellaRhythm
Hugging Face model: https://huggingface.co/EphAsad/SatellaRhythm-Edge
What the model does
SatellaRhythm-Edge is a small 2,867,109-parameter dual-head 1D residual CNN. It accepts short single-lead ECG voltage waveforms (not optical PPG/pulse data, ECG images, heart-rate numbers or R-peaks) and provides two independent outputs:
- Rhythm head:
NORMAL,ATRIAL_FIBRILLATION,OTHER_RHYTHM. - Quality head:
INTERPRETABLE,UNINTERPRETABLE.
A research-only postprocessing policy may emit REVIEW_UNINTERPRETABLE if quality risk
or confidence fails a validation-selected threshold. This is not an adequate clinical safety mechanism.
Predicted probabilities are uncalibrated model scores, not clinical probabilities.
Architecture and numerical input
| Property | Value |
|---|---|
| Architecture | Dual-head temporal ResNet with mean and max pooling |
| Parameters | 2,867,109 |
| Inference window | 10 seconds, one lead |
| Native sampling | 300 Hz (3,000 float32 samples/window) |
| ONNX input | ecg: [batch, 1, 3000] |
| ONNX outputs | rhythm_logits: [batch, 3]; quality_logits: [batch, 2] |
| Preprocessing | Subtract median; divide by 90th-percentile absolute value; clip to [-6, 6] |
| Inference | Five windows over a recording, averaged probabilities |
| Quality risk | 0.7 ร mean uninterpretable probability + 0.3 ร maximum window probability |
| Output rejection threshold | 0.45 quality risk |
| Rhythm confidence threshold | 0.00 |
| Normal confidence threshold | 0.00 |
In this checkpoint both rhythm and normal confidence thresholds selected as 0.0,
so confidence-based rejection is not active; the final policy relies on the quality-risk threshold.
Quick start: download and run locally (ONNX CPU)
No API service, Hub Space or GPU is required for inference. Python 3.10+ is recommended.
pip install huggingface_hub numpy scipy onnxruntime
from pathlib import Path
import sys
import numpy as np
from huggingface_hub import snapshot_download
folder = snapshot_download(
repo_id="EphAsad/SatellaRhythm-Edge",
repo_type="model",
allow_patterns=["satellarhythm_edge_v03.onnx", "config_research.json", "infer_onnx.py"],
)
sys.path.insert(0, folder)
from infer_onnx import RhythmEdge
model = RhythmEdge(folder)
# Replace with a locally stored, lawfully obtained single-lead ECG waveform.
# Example .npy file contains only 1D float32 sample amplitudes, NOT an ECG image.
ecg = np.load("path/to/your_ecg_waveform.npy", allow_pickle=False)
result = model.predict(ecg, sample_rate_hz=300, n_windows=5)
print(result) # Experimental research output, not diagnostic advice.
sample_rate_hz must describe the input sample rate accurately. The wrapper resamples
supported rates to 300 Hz. It rejects invalid, flatlined, excessively short or overly long inputs;
its validity checks are NOT reliable detection of all real-world artefacts. For 10-second inputs,
window positions may overlap; the validation configuration is not a streaming continuous monitor.
Low-level ONNX Runtime access
import onnxruntime as ort
import numpy as np
session = ort.InferenceSession("satellarhythm_edge_v03.onnx", providers=["CPUExecutionProvider"])
# `x` must already be a correctly preprocessed 3000-sample window.
x = np.zeros((1, 1, 3000), dtype=np.float32) # Shape test ONLY; no clinical interpretation.
rhythm_logits, quality_logits = session.run(None, {"ecg": x})
assert rhythm_logits.shape == (1, 3) and quality_logits.shape == (1, 2)
Do not pass unnormalised raw data directly to ONNX. The high-level RhythmEdge wrapper
implements the training-time preprocessing and aggregation. The zero-input snippet above only
verifies an inference interface and is not a meaningful ECG example.
Training data and process
- PhysioNet/CinC Challenge 2017:
portable AliveCor single-lead recordings with v3 labels
N,A,O,~; rhythm plus quality. The~records are NOT assigned artificial rhythm labels. - PhysioNet/CinC Challenge 2011 Set A: 12-lead recordings; lead I extracted and resampled for auxiliary quality supervision. Labels indicate acceptability of the entire 12-lead recording, not necessarily its lead I.
No synthetic noisy recordings were used for training. AFDB training extension was disabled. Waveforms were deduplicated for exact matches before a stratified recording-disjoint split. Patient-disjoint separation is not verified. The same corpus was analysed in earlier SatellaRhythm experiments, so this held-out split is not a fully untouched independent evaluation. No external wearable manufacturer, population, paediatric cohort or prospective clinical set was tested.
Training stages: (1) rhythm-only warm-up, then (2) joint rhythm/quality refinement using
lower auxiliary quality-loss weights. Two predefined recipes were compared on validation data only;
quality_moderate was selected. Rejection thresholds were chosen on validation data.
Final test scoring was performed after freezing the model within this run.
Measured research performance
All values below are from the completed v0.3 notebook, not externally verified clinical results. The four-class policy test uses 1,279 recordings from the PhysioNet 2017 recording-disjoint test split.
| Metric (policy output) | Value |
|---|---|
| Four-class macro F1 | 0.7027 |
| Four-class weighted F1 | 0.7925 |
| AF precision | 0.7518 |
| AF sensitivity/recall | 0.9115 |
| Other-rhythm sensitivity | 0.6529 |
| Normal sensitivity | 0.8226 |
| Real noisy-signal rejection recall | 0.8333 |
| Interpretable recording coverage | 0.9329 |
| AF or Other incorrectly reported NORMAL | 0.1597 |
| Auxiliary 2011 quality balanced accuracy on lead I | 0.6616 |
Before abstention, the raw three-rhythm classifier had macro F1 0.8116, AF precision 0.7536, AF sensitivity 0.9204, and Other-rhythm sensitivity 0.6970.
Confusion matrix (policy)
True classes are rows and predicted classes are columns, in order
NORMAL, ATRIAL_FIBRILLATION, OTHER_RHYTHM, REVIEW_UNINTERPRETABLE.
626 8 72 55
0 103 7 3
76 25 237 25
4 1 2 35
Research gate (NOT MET)
Predefined target: macro F1 โฅ 0.72; achieved 0.7027.
Predefined target: abnormal rhythms reported NORMAL โค 0.15; achieved 0.1597.
Other research checks passed in the notebook, but these two failed. No research acceptance claim is made.
Passing any experimental gate would still NOT demonstrate clinical safety.
ONNX parity and latency
- PyTorch/ONNX parity (checked logit difference): 7.15e-07.
- ONNX CPU median latency on the Colab L4 runtime's CPU: 3.97 ms for one 10-second window; 16.83 ms for a batch of five windows.
- These timings exclude acquisition and some preprocessing overhead and are not watch/phone benchmarks.
Limitations and intended use
Intended: offline ECG signal-processing research, reproducibility and engineering investigation. Not intended: diagnosis, screening, clinical alerts, remote monitoring, medical device integration, medical decisions or statements reassuring individuals that they do not have a cardiac abnormality.
- Missed AF or other abnormal rhythms and false
NORMALoutputs are possible. OTHER_RHYTHMaggregates heterogeneous conditions; it does not identify specific conditions.- Signal-quality performance may change drastically with device, lead position, wearer motion, electrode contact, sampling format, prevalence and underlying population.
- The 2011 12-lead quality labels are imperfect auxiliary labels for the extracted single lead.
- The small noisy category gives imprecise sensitivity estimates.
- Output values are not calibrated clinical risk probabilities.
- All performance figures are from a within-project dataset, not an external prospective cohort.
- Neither model approval nor regulatory clearance is implied. Independent patient-disjoint, multi-device and clinically reviewed validation would be required for any health application.
Privacy and data protection
This repository contains a model and no training ECG waveforms, personal medical records, identifiers, tokens, Colab execution outputs or individual-patient predictions. Source metadata was regenerated from a whitelist and ONNX optional metadata was cleared before upload. Model weights cannot be proven free of all memorised training information merely by scanning files. Applications must protect any real ECG data provided at inference time.
Datasets, attribution, and redistribution
Both Challenge 2017 and Challenge 2011 dataset pages identify the Open Data Commons Attribution License (ODC-By 1.0) for the source datasets; respect the original attribution and terms. This release does not redistribute the raw datasets and does not claim that training-data terms automatically grant unrestricted commercial or medical-device rights to model weights. A separate model-weight licence has not been asserted pending rights review.
- 2017 Challenge original publication
- PhysioNet standard citation
- 2011 Challenge publication and attribution
Files
model.safetensors: PyTorch neural-network weights (not a Transformers checkpoint).satellarhythm_edge_v03.onnx: two-output CPU-capable ONNX graph.infer_onnx.py: full preprocessing, aggregation and research decision policy.config_research.json: windowing, label order and rejection thresholds.metrics.json: minimal, numeric summary and gate outcome (no raw traces or logs).requirements.txt: runtime libraries.
Do not use this model in any application where predictions can affect a person's health or safety.