QTDB / README.md
dronefreak's picture
Add QT Database v1.0.0 (105 records, Parquet + official zip) (#1)
66ab3c4
|
Raw History Blame Contribute Delete
12.4 kB
metadata
language:
  - en
license: odc-by
size_categories:
  - n<1K
task_categories:
  - other
pretty_name: QT Database (QTDB)
tags:
  - ecg
  - electrocardiogram
  - biosignals
  - time-series
  - medical
  - ecg-delineation
  - qt-interval
  - holter
  - physionet
configs:
  - config_name: default
    data_files:
      - split: train
        path: data/train-*
  - config_name: waves
    data_files:
      - split: train
        path: waves/train-*

QT Database (QTDB)

Task Dataset Format Records Beats License

Unofficial mirror of the PhysioNet QT Database v1.0.0: 105 fifteen-minute two-lead Holter ECGs with cardiologist-marked P, QRS, T and U boundaries, in a viewer-ready Parquet layout with exact signals and every annotation file parsed.

Dataset Description

Disclaimer

This repository is not an official release of the QT Database.

The QT Database was created by Pablo Laguna, Roger G. Mark, Ary L. Goldberger and George B. Moody, and is published by PhysioNet. Most records are excerpts of six older PhysioNet databases: the MIT-BIH Arrhythmia, ST Change, Supraventricular Arrhythmia, Normal Sinus Rhythm and Long-Term ECG databases, and the European ST-T Database. The rest come from Holter recordings of BIH sudden-death patients. This repository does not claim ownership of the data. If you are an author or rights holder and want this repository changed or removed, please open a discussion and it will be addressed promptly.

These are recordings from real patients. Do not attempt to identify anyone in them. This dataset is for research and is not a medical device or a basis for clinical decisions.

Source and verification: built from the official PhysioNet package qtdb-1.0.0.zip. Every file was checked against the official SHA256SUMS.txt. Signals were decoded twice, once by a separate format-212 decoder and once by wfdb. The two agree exactly and match each header's checksum and initial values. Every annotation file was also read twice, by a separate WFDB annotation parser and by wfdb.rdann, with the same result. Every row was read back from Parquet and compared with the source.


Dataset Overview

QTDB is a reference set for ECG waveform delineation and QT interval measurement. Each of the 105 records is a 15-minute two-lead excerpt sampled at 250 Hz. The excerpts were chosen to avoid significant baseline wander and other artifacts. In each record, cardiologists annotated 30 to 100 representative beats in the final 5 minutes, 3,623 beats in all. They marked the onset, peak and end of the P wave, the onset and end of the QRS complex, the peak and end of the T wave (sometimes its onset too), and the peak and end of the U wave where one is present. A second cardiologist annotated 11 records independently. Every beat in every record also carries automatic boundaries from ecgpuwave.

Source Records
MIT-BIH Arrhythmia Database 15
MIT-BIH ST Change Database 6
MIT-BIH Supraventricular Arrhythmia Database 13
MIT-BIH Normal Sinus Rhythm Database 10
MIT-BIH Long-Term ECG Database 4
European ST-T Database 33
BIH sudden death patients 24

Changes from the Official Release

  • Packed into Parquet, one row per record, so the Dataset Viewer and datasets work directly.
  • Decoded the format-212 signal files into int16 arrays without changing any value.
  • Parsed all nine annotation types into lists. The only change to the text is that trailing NUL padding is stripped from aux_note.
  • Added waves, a structured table derived from the two cardiologist second-pass files, and preview, a rendered plot of the first annotated beats.
  • Added source_database, original_record and excerpt_start, taken from the documentation and the header comments.
  • The official package is included unchanged at original/qtdb-1.0.0.zip.
  • No signals or annotations were changed, added or removed.

Dataset Structure

default: one row per record (105 rows)

Column Content
record official record name, e.g. sel100, sele0104
source_database the database the excerpt comes from (table above)
original_record, excerpt_start source record and start time, from the header's xform comment
sampling_rate 250
n_samples 225,000, 224,999 or 224,993 (see notes)
lead_names as in the header, e.g. MLII, V5. Unnamed leads appear as ECG1, ECG2
signal raw 12-bit ADC values as int16, shape (2, n_samples) as (lead, sample)
adc_gain, adc_baseline, adc_resolution per lead, from the header (gain 0 in the header is stored as the WFDB default 200, see notes)
header the .hea file verbatim, including clinical comments where the source has them
header_original the older .hea- header shipped for 57 records, verbatim, otherwise null
annotated_beats number of cardiologist-annotated beats (entries in man)
atr, man, q1c, q2c, qt1, qt2, pu, pu0, pu1 each annotation file as a list of sample, symbol, subtype, chan, num, aux_note, or null if the record has no such file
waves one entry per marked wave in q1c and q2c (12,017 in all): annotator, wave (P, QRS, T, U), symbol, onset, peak, offset
preview PNG of both leads around the first annotated beats with the q1c marks shaded

Physical values in mV are (signal - adc_baseline) / adc_gain. All positions are 0-based sample indices at 250 Hz.

The annotation files, as described in the QTDB documentation:

File Content Records
atr reference beat labels from the source database 82 (none for the 23 records from the BIH sudden-death Holter tapes)
man the beats selected for manual annotation 105
q1c / q2c cardiologist 1 / 2 waveform boundaries, second pass 105 / 11
qt1 / qt2 cardiologist 1 / 2 waveform boundaries, first pass 105 / 11
pu / pu0 / pu1 automatic ecgpuwave boundaries for all beats, from both leads / lead 0 only / lead 1 only 105

In the boundary files, ( and ) mark a wave's onset and end, and their num field gives the wave type: 0 = P, 1 = QRS, 2 = T, 3 = U. In pu* files, the num of a T peak gives the T-wave shape: 0 normal, 1 inverted, 2 upwards only, 3 downwards only, 4 biphasic negative-positive, 5 biphasic positive-negative. In pu, chan tells which lead each mark belongs to.

waves: the derived waves of all records as one flat table

record, source_database, annotator, wave, symbol, onset, peak, offset. This table makes it easy to filter by wave type or compute intervals across the whole database.

How waves is derived

Each non-boundary mark in q1c or q2c becomes one wave. p becomes P, t becomes T, u becomes U, and beat labels such as N, A, B, Q or V become QRS. onset is set only if the mark directly before is ( with the matching num, and offset only if the mark directly after is ) with the matching num. Otherwise the boundary is null. Nothing is inferred.

Read before using the labels

  • T and U onsets are often missing. The protocol asks for the peak and end of T and U, and an onset only sometimes. In q1c, 1,412 of 3,542 T waves and 107 of 821 U waves have an onset. All P and QRS waves have both boundaries. The QT interval is QRS onset to T offset, and every T wave has an offset.
  • Only some beats are annotated. The cardiologist marks cover 30 to 100 beats in the last 5 minutes of each record. The rest of the signal is not background, so don't treat unmarked beats as negatives. The pu* files cover every beat, but they are an algorithm's output, not a reference.
  • The second annotator is partial. q2c exists for 11 records. In some of them, such as sel102, it marks only part of the beats that annotator 1 marked.
  • QRS marks vs man. The QRS marks in q1c and qt1 fall on the same beats as man, and q1c and qt1 agree with each other exactly. For 31 of the 3,623 beats, the mark sits a few samples from the man position, at most 23 samples (92 ms) away. The documentation gives 3,622 beats, while the files hold 3,623.
  • Record lengths differ. 53 records have 225,000 samples and 29 have 224,999. The 23 BIH sudden-death records have 224,993, because their header notes that lead 0 was delayed by 7 samples to align the leads.
  • Ten records are uncalibrated. The headers of the 4 Long-Term ECG records and sel820, sel821, sel847, sel853, sel883 and sel891 give gain 0, which in WFDB means uncalibrated. adc_gain holds 200, the WFDB default that wfdb also uses, so treat their mV values as nominal. header keeps the original 0.
  • Lead names and placements vary. The leads depend on the source database (for example MLII/V5, V4/D3, CM5/CC5), and 57 records have the unnamed leads ECG1/ECG2.

Usage

# pip install datasets pillow numpy
import numpy as np
from datasets import load_dataset

ds = load_dataset("dronefreak/QTDB", split="train")
row = ds[0]

signal = np.asarray(row["signal"], dtype=np.int16)            # (2, n_samples)
mv = (signal - np.asarray(row["adc_baseline"])[:, None]) / np.asarray(row["adc_gain"])[:, None]

# QT intervals (ms) from cardiologist 1: QRS onset -> following T end
waves = [w for w in row["waves"] if w["annotator"] == "q1c"]
qt = []
for i, w in enumerate(waves):
    if w["wave"] == "QRS" and w["onset"] is not None:
        t = next((x for x in waves[i + 1:] if x["wave"] in ("T", "QRS")), None)
        if t and t["wave"] == "T" and t["offset"] is not None:
            qt.append((t["offset"] - w["onset"]) * 1000 / 250)

# flat table of every annotated wave
flat = load_dataset("dronefreak/QTDB", "waves", split="train")

Dataset Sources

Citation

Please cite the original paper, the dataset and PhysioNet:

@inproceedings{laguna1997qtdb,
  author    = {Laguna, Pablo and Mark, Roger G. and Goldberger, Ary L. and Moody, George B.},
  title     = {A Database for Evaluation of Algorithms for Measurement of {QT} and Other Waveform Intervals in the {ECG}},
  booktitle = {Computers in Cardiology},
  volume    = {24},
  pages     = {673--676},
  year      = {1997}
}

@misc{PhysioNet-qtdb-1.0.0,
  author = {Laguna, Pablo and Mark, Roger G. and Goldberger, Ary L. and Moody, George B.},
  title  = {{QT Database}},
  year   = {1999},
  note   = {Version 1.0.0},
  doi    = {10.13026/C24K53},
  url    = {https://doi.org/10.13026/C24K53},
  publisher = {PhysioNet}
}

Pollard, T., Moody, B. E., Lehman, L., Gow, B., Fernandes, C., Xie, C., Johnson, A., Mark, R. G., & Heldt, T. (2026). PhysioNet as a global platform for biomedical research. Nature Health. https://doi.org/10.1038/s44360-026-00096-z


License

The QT Database is made available under the Open Data Commons Attribution License v1.0 (ODC-By): https://physionet.org/content/qtdb/view-license/1.0.0/. This repository contains information from the QT Database, published on PhysioNet. If you publicly use or redistribute this data or a work produced from it, keep this attribution and the license notice.