Chapman-Shaoxing (Arrhythmia)

Open Completed

Quick facts

Format12-lead · 10 s · 500 Hz · WFDB
Patients45,152
Records45,152
Leads12
LicenseCC BY 4.0
OriginChapman Univ.; Shaoxing People's Hospital & Ningbo First Hospital — China / USA

Overview

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.

Primary rhythm diagnosis breakdown

CodeConditionRecords
SBSinus bradycardia15,807
SRSinus rhythm7,882
AFAtrial flutter5,609
STSinus tachycardia5,383
AFIBAtrial fibrillation1,779
SASinus irregularity1,294
APBAtrial premature beats975
other71 further primary diagnoses6,423

Validation summary (500 Hz)

VersionRecordsNote
original45,152all records, with `is_valid` + `quality_issues`
clean42,90995.0% pass rate
excluded2,243mostly one or more entirely flat leads

Building the splits

# 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

Loading with ECGBench

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")