| Format | 12-lead · 10 s · 500 Hz · WFDB |
|---|---|
| Patients | 45,152 |
| Records | 45,152 |
| Leads | 12 |
| License | CC BY 4.0 |
| Origin | Chapman Univ.; Shaoxing People's Hospital & Ningbo First Hospital — China / USA |
The PhysioNet ecg-arrhythmia release merges the Chapman-Shaoxing
(JS00001–JS10646) and Ningbo First Hospital (JS10647–JS45551) cohorts into
a single WFDB tree of 45,152 twelve-lead recordings — one per patient, each
10 seconds at 500 Hz. Diagnoses are SNOMED-CT codes covering 60+
conditions, and age and sex are recorded alongside them.
Unlike most datasets here, this one ships no metadata CSV: every
record’s demographics and diagnoses live in its own WFDB header
(#Age, #Sex, #Dx). ECGBench’s splitter builds a metadata table by
scanning all 45,152 headers and caches it in the dataset root as
ecgbench_metadata.csv.
ECGBench bundles a deterministic 10-fold split stratified on the primary
(first-listed) #Dx code, which is the rhythm diagnosis. No patient
grouping is needed — the dataset is one record per patient.
This is a different dataset from the
Chapman-Shaoxing 10,646-patient figshare release,
which ECGBench exposes under the separate chapman_shaoxing config.
| Code | Condition | Records |
|---|---|---|
| SB | Sinus bradycardia | 15,807 |
| SR | Sinus rhythm | 7,882 |
| AF | Atrial flutter | 5,609 |
| ST | Sinus tachycardia | 5,383 |
| AFIB | Atrial fibrillation | 1,779 |
| SA | Sinus irregularity | 1,294 |
| APB | Atrial premature beats | 975 |
| other | 71 further primary diagnoses | 6,423 |
| Version | Records | Note |
|---|---|---|
| original | 45,152 | all records, with `is_valid` + `quality_issues` |
| clean | 42,909 | 95.0% pass rate |
| excluded | 2,243 | mostly one or more entirely flat leads |
# PhysioNet serves this project from a credentialed path, so download it
# yourself and point --data-path at the directory holding WFDBRecords/.
ecgbench splits \
--dataset ecg_arrhythmia \
--data-path /path/to/ecg-arrhythmia/1.0.0/ \
--max-workers 32
from ecgbench import ECGDataset, ecg_collate_fn
from torch.utils.data import DataLoader
# Fold CSVs come from the Hub; signals are read from your local copy
dataset = ECGDataset(
"ecg_arrhythmia",
split="train",
version="clean",
data_path="/path/to/ecg-arrhythmia/1.0.0/",
labels=True, # SNOMED-CT #Dx codes, acronyms, age, sex
)
loader = DataLoader(dataset, batch_size=32, collate_fn=ecg_collate_fn)
for batch in loader:
signals = batch["signal"] # (B, 12, 5000) at 500 Hz
record_ids = batch["record_id"] # e.g. "JS00001"
labels = batch["labels"] # list of dicts; dx is multi-label
break
# Labels need ecgbench_metadata.csv, which the splitter generates from the
# WFDB headers — run `ecgbench splits` once before using labels=True.
# Leads are in the standard order; select by name to stay portable:
# ECGDataset("ecg_arrhythmia", ..., leads=["II", "V5"], units="uV")