MIMIC-IV-ECG Demo

Open Completed

Quick facts

Format12-lead · 10 s · 500 Hz · WFDB
Patients92
Records659
Leads12
LicenseODbL 1.0
OriginBeth Israel Deaconess Medical Center — USA — Boston, MA

Overview

The open demo subset of MIMIC-IV-ECG: 659 twelve-lead diagnostic ECGs from 92 patients at Beth Israel Deaconess Medical Center, in WFDB format at 500 Hz for 10 seconds. Records link to the rest of MIMIC-IV through subject_id and study_id, and each carries an acquisition timestamp.

Two things shape how ECGBench splits it. First, the demo ships no labelsrecord_list.csv holds identifiers and timestamps only, and machine_measurements.csv (the report text and measurements) belongs to the full release, not this one. There is nothing to stratify on, so the split is purely patient-grouped. Second, records per patient are very uneven — 1 to 52, median 5 — so grouping by subject_id is essential, and fold sizes vary as a consequence (60 to 87 records across 10 folds).

For the ~800,000-record credentialed release, see [MIMIC-IV-ECG]({{ ‘/datasets/mimic-iv-ecg.html’ | relative_url }}).

Watch out for

PropertyValue
Lead order in every headerI, II, III, aVR, aVF, aVL, V1-V6 — aVF and aVL are transposed relative to the usual convention
Labelsnone in this subset
Age / sexnot included
Records per patient1 to 52 (median 5)
Timestampsdate-shifted into the future by de-identification

Validation summary (500 Hz)

VersionRecordsNote
original659all records, with is_valid + quality_issues
clean64597.9% pass rate
excluded1412 with NaN samples, 13 with one or more flat leads (overlapping)

Building the splits

ecgbench splits \
  --dataset mimic_iv_ecg_demo \
  --data-path /path/to/mimic-iv-ecg-demo/0.1/

Loading with ECGBench

from ecgbench import ECGDataset, ecg_collate_fn
from torch.utils.data import DataLoader

dataset = ECGDataset(
    "mimic_iv_ecg_demo",
    split="train",
    version="clean",
    data_path="/path/to/mimic-iv-ecg-demo/0.1/",
)

loader = DataLoader(dataset, batch_size=16, collate_fn=ecg_collate_fn)

for batch in loader:
    signals = batch["signal"]        # (B, 12, 5000) at 500 Hz
    record_ids = batch["record_id"]  # study_id values
    break

# This dataset stores aVF BEFORE aVL, so signal[4] is a different physical
# lead here than in every other dataset. Selecting by name fixes that:
ds = ECGDataset("mimic_iv_ecg_demo", split="train",
                data_path="/path/to/mimic-iv-ecg-demo/0.1/",
                leads=["I", "II", "aVL", "V5"])
ds.lead_names   # ('I', 'II', 'aVL', 'V5') — aVL is taken from stored row 5

# labels=True raises LabelsUnavailableError here: the demo ships none.