Add QT Database v1.0.0 (105 records, Parquet + official zip)

#1
by dronefreak - opened
README.md ADDED
@@ -0,0 +1,205 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ language:
3
+ - en
4
+ license: odc-by
5
+ size_categories:
6
+ - n<1K
7
+ task_categories:
8
+ - other
9
+ pretty_name: QT Database (QTDB)
10
+ tags:
11
+ - ecg
12
+ - electrocardiogram
13
+ - biosignals
14
+ - time-series
15
+ - medical
16
+ - ecg-delineation
17
+ - qt-interval
18
+ - holter
19
+ - physionet
20
+ configs:
21
+ - config_name: default
22
+ data_files:
23
+ - split: train
24
+ path: data/train-*
25
+ - config_name: waves
26
+ data_files:
27
+ - split: train
28
+ path: waves/train-*
29
+ ---
30
+
31
+ <h1 align="center">QT Database (QTDB)</h1>
32
+
33
+ <p align="center"><video controls autoplay loop muted playsinline width="900" poster="https://huggingface.co/datasets/dronefreak/QTDB/resolve/main/assets/demo_banner_poster.jpg" src="https://huggingface.co/datasets/dronefreak/QTDB/resolve/main/assets/demo_banner.mp4"><img src="https://huggingface.co/datasets/dronefreak/QTDB/resolve/main/assets/demo_banner_poster.jpg" alt="Six QTDB ECG traces, one per source database, sweeping across the screen with the cardiologists' P, QRS, T and U marks shaded" width="900"></video></p>
34
+
35
+ ![Task](https://img.shields.io/badge/Task-ECG%20Delineation-blue?style=flat-square)
36
+ ![Dataset](https://img.shields.io/badge/Dataset-QTDB-0aa1a7?style=flat-square)
37
+ ![Format](https://img.shields.io/badge/Format-Parquet-orange?style=flat-square)
38
+ ![Records](https://img.shields.io/badge/Records-105-success?style=flat-square)
39
+ ![Beats](https://img.shields.io/badge/Annotated%20beats-3%2C623-blueviolet?style=flat-square)
40
+ ![License](https://img.shields.io/badge/License-ODC--By%201.0-lightgrey?style=flat-square)
41
+
42
+ > **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.**
43
+
44
+ ## Dataset Description
45
+
46
+ - **Homepage:** https://physionet.org/content/qtdb/1.0.0/
47
+ - **Paper:** Laguna et al., Computers in Cardiology 24, 1997
48
+ - **Dataset DOI:** https://doi.org/10.13026/C24K53
49
+ - **License:** ODC-By 1.0
50
+
51
+ ## Disclaimer
52
+
53
+ This repository is **not** an official release of the QT Database.
54
+
55
+ 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.**
56
+
57
+ 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.
58
+
59
+ **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.
60
+
61
+ ---
62
+
63
+ # Dataset Overview
64
+
65
+ 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`.
66
+
67
+ | Source | Records |
68
+ |---|---|
69
+ | MIT-BIH Arrhythmia Database | 15 |
70
+ | MIT-BIH ST Change Database | 6 |
71
+ | MIT-BIH Supraventricular Arrhythmia Database | 13 |
72
+ | MIT-BIH Normal Sinus Rhythm Database | 10 |
73
+ | MIT-BIH Long-Term ECG Database | 4 |
74
+ | European ST-T Database | 33 |
75
+ | BIH sudden death patients | 24 |
76
+
77
+ ---
78
+
79
+ # Changes from the Official Release
80
+
81
+ - Packed into Parquet, one row per record, so the Dataset Viewer and `datasets` work directly.
82
+ - Decoded the format-212 signal files into `int16` arrays without changing any value.
83
+ - Parsed all nine annotation types into lists. The only change to the text is that trailing NUL padding is stripped from `aux_note`.
84
+ - Added `waves`, a structured table derived from the two cardiologist second-pass files, and `preview`, a rendered plot of the first annotated beats.
85
+ - Added `source_database`, `original_record` and `excerpt_start`, taken from the documentation and the header comments.
86
+ - The official package is included unchanged at `original/qtdb-1.0.0.zip`.
87
+ - No signals or annotations were changed, added or removed.
88
+
89
+ ---
90
+
91
+ # Dataset Structure
92
+
93
+ ### `default`: one row per record (105 rows)
94
+
95
+ | Column | Content |
96
+ |---|---|
97
+ | `record` | official record name, e.g. `sel100`, `sele0104` |
98
+ | `source_database` | the database the excerpt comes from (table above) |
99
+ | `original_record`, `excerpt_start` | source record and start time, from the header's `xform` comment |
100
+ | `sampling_rate` | 250 |
101
+ | `n_samples` | 225,000, 224,999 or 224,993 (see notes) |
102
+ | `lead_names` | as in the header, e.g. `MLII, V5`. Unnamed leads appear as `ECG1, ECG2` |
103
+ | `signal` | raw 12-bit ADC values as `int16`, shape `(2, n_samples)` as (lead, sample) |
104
+ | `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) |
105
+ | `header` | the `.hea` file verbatim, including clinical comments where the source has them |
106
+ | `header_original` | the older `.hea-` header shipped for 57 records, verbatim, otherwise null |
107
+ | `annotated_beats` | number of cardiologist-annotated beats (entries in `man`) |
108
+ | `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 |
109
+ | `waves` | one entry per marked wave in `q1c` and `q2c` (12,017 in all): `annotator`, `wave` (`P`, `QRS`, `T`, `U`), `symbol`, `onset`, `peak`, `offset` |
110
+ | `preview` | PNG of both leads around the first annotated beats with the `q1c` marks shaded |
111
+
112
+ Physical values in mV are `(signal - adc_baseline) / adc_gain`. All positions are 0-based sample indices at 250 Hz.
113
+
114
+ The annotation files, as described in the QTDB documentation:
115
+
116
+ | File | Content | Records |
117
+ |---|---|---|
118
+ | `atr` | reference beat labels from the source database | 82 (none for the 23 records from the BIH sudden-death Holter tapes) |
119
+ | `man` | the beats selected for manual annotation | 105 |
120
+ | `q1c` / `q2c` | cardiologist 1 / 2 waveform boundaries, second pass | 105 / 11 |
121
+ | `qt1` / `qt2` | cardiologist 1 / 2 waveform boundaries, first pass | 105 / 11 |
122
+ | `pu` / `pu0` / `pu1` | automatic `ecgpuwave` boundaries for all beats, from both leads / lead 0 only / lead 1 only | 105 |
123
+
124
+ 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.
125
+
126
+ ### `waves`: the derived waves of all records as one flat table
127
+
128
+ `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.
129
+
130
+ ### How `waves` is derived
131
+
132
+ 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.
133
+
134
+ ### Read before using the labels
135
+
136
+ - **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`.
137
+ - **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.
138
+ - **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.
139
+ - **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.
140
+ - **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.
141
+ - **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.
142
+ - **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`.
143
+
144
+ ## Usage
145
+
146
+ ```python
147
+ # pip install datasets pillow numpy
148
+ import numpy as np
149
+ from datasets import load_dataset
150
+
151
+ ds = load_dataset("dronefreak/QTDB", split="train")
152
+ row = ds[0]
153
+
154
+ signal = np.asarray(row["signal"], dtype=np.int16) # (2, n_samples)
155
+ mv = (signal - np.asarray(row["adc_baseline"])[:, None]) / np.asarray(row["adc_gain"])[:, None]
156
+
157
+ # QT intervals (ms) from cardiologist 1: QRS onset -> following T end
158
+ waves = [w for w in row["waves"] if w["annotator"] == "q1c"]
159
+ qt = []
160
+ for i, w in enumerate(waves):
161
+ if w["wave"] == "QRS" and w["onset"] is not None:
162
+ t = next((x for x in waves[i + 1:] if x["wave"] in ("T", "QRS")), None)
163
+ if t and t["wave"] == "T" and t["offset"] is not None:
164
+ qt.append((t["offset"] - w["onset"]) * 1000 / 250)
165
+
166
+ # flat table of every annotated wave
167
+ flat = load_dataset("dronefreak/QTDB", "waves", split="train")
168
+ ```
169
+
170
+ ---
171
+
172
+ # Dataset Sources
173
+
174
+ ## Citation
175
+
176
+ Please cite the original paper, the dataset and PhysioNet:
177
+
178
+ ```bibtex
179
+ @inproceedings{laguna1997qtdb,
180
+ author = {Laguna, Pablo and Mark, Roger G. and Goldberger, Ary L. and Moody, George B.},
181
+ title = {A Database for Evaluation of Algorithms for Measurement of {QT} and Other Waveform Intervals in the {ECG}},
182
+ booktitle = {Computers in Cardiology},
183
+ volume = {24},
184
+ pages = {673--676},
185
+ year = {1997}
186
+ }
187
+
188
+ @misc{PhysioNet-qtdb-1.0.0,
189
+ author = {Laguna, Pablo and Mark, Roger G. and Goldberger, Ary L. and Moody, George B.},
190
+ title = {{QT Database}},
191
+ year = {1999},
192
+ note = {Version 1.0.0},
193
+ doi = {10.13026/C24K53},
194
+ url = {https://doi.org/10.13026/C24K53},
195
+ publisher = {PhysioNet}
196
+ }
197
+ ```
198
+
199
+ 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
200
+
201
+ ---
202
+
203
+ # License
204
+
205
+ 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.
assets/demo_banner.mp4 ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:76faef80bb1d75160727039518c1572f87b1b7b21ace8374416181397938f780
3
+ size 642107
assets/demo_banner_poster.jpg ADDED

Git LFS Details

  • SHA256: 3e2340e3d60423d4653e54573c0db5460634a00ab20eeac56baec8e949854a4a
  • Pointer size: 131 Bytes
  • Size of remote file: 200 kB
data/train-00000-of-00001.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:8aaa44dd6177d35ed05a243d4f5a7332a6df7797a170d79b9ea4894554c43910
3
+ size 54800878
original/qtdb-1.0.0.zip ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:5bba6543530b4ea9fe010802b6fa789a69e0f3c7ac280e3c668322457661dd3e
3
+ size 87119682
stats.json ADDED
@@ -0,0 +1,46 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "atr_annotations": 87919,
3
+ "atr_files": 82,
4
+ "beats": 3623,
5
+ "beats_q1c_max_shift_samples": 23,
6
+ "beats_q1c_shifted_from_man": 31,
7
+ "man_annotations": 3623,
8
+ "man_files": 105,
9
+ "no_offset_q1c_P": 0,
10
+ "no_offset_q1c_QRS": 0,
11
+ "no_offset_q1c_T": 0,
12
+ "no_offset_q1c_U": 0,
13
+ "no_offset_q2c_QRS": 0,
14
+ "no_offset_q2c_T": 0,
15
+ "no_offset_q2c_U": 0,
16
+ "no_onset_q1c_P": 0,
17
+ "no_onset_q1c_QRS": 0,
18
+ "no_onset_q1c_T": 2130,
19
+ "no_onset_q1c_U": 714,
20
+ "no_onset_q2c_QRS": 0,
21
+ "no_onset_q2c_T": 400,
22
+ "no_onset_q2c_U": 30,
23
+ "pu0_annotations": 967466,
24
+ "pu0_files": 105,
25
+ "pu1_annotations": 957542,
26
+ "pu1_files": 105,
27
+ "pu_annotations": 1925008,
28
+ "pu_files": 105,
29
+ "q1c_annotations": 30696,
30
+ "q1c_files": 105,
31
+ "q2c_annotations": 2081,
32
+ "q2c_files": 11,
33
+ "qt1_annotations": 30698,
34
+ "qt1_files": 105,
35
+ "qt2_annotations": 2166,
36
+ "qt2_files": 11,
37
+ "records": 105,
38
+ "records_gain_0_in_header": 10,
39
+ "waves_q1c_P": 3194,
40
+ "waves_q1c_QRS": 3623,
41
+ "waves_q1c_T": 3542,
42
+ "waves_q1c_U": 821,
43
+ "waves_q2c_QRS": 404,
44
+ "waves_q2c_T": 402,
45
+ "waves_q2c_U": 31
46
+ }
waves/train-00000-of-00001.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:18e1c08465e842c09b0ee561c75ec0bd530cf390850b4a75d32a19d93d680bef
3
+ size 115425