BUT-PDB / README.md
dronefreak's picture
Add BUT PDB 1.0.0 (50 records, Parquet + official zip) (#1)
2ec76aa
|
Raw History Blame Contribute Delete
10.2 kB
---
language:
- en
license: cc-by-4.0
size_categories:
- n<1K
task_categories:
- other
pretty_name: BUT PDB (Brno University of Technology ECG Signal Database with Annotations of P Wave)
tags:
- ecg
- electrocardiogram
- p-wave
- p-wave-detection
- arrhythmia
- biosignals
- time-series
- physionet
- wfdb
configs:
- config_name: default
data_files:
- split: train
path: data/train-*
- config_name: beats
data_files:
- split: train
path: beats/train-*
---
<h1 align="center">BUT PDB: ECG Signals with Annotated P Waves</h1>
<p align="center"><video controls autoplay loop muted playsinline width="900" poster="https://huggingface.co/datasets/dronefreak/BUT-PDB/resolve/main/assets/demo_banner_poster.jpg" src="https://huggingface.co/datasets/dronefreak/BUT-PDB/resolve/main/assets/demo_banner.mp4"><img src="https://huggingface.co/datasets/dronefreak/BUT-PDB/resolve/main/assets/demo_banner_poster.jpg" alt="Five-second ECG excerpts with the expert P-wave annotations and QRS labels, in atrial fibrillation, AV blocks, premature beats and pre-excitation" width="900"></video></p>
![Task](https://img.shields.io/badge/Task-P%20Wave%20Detection-blue?style=flat-square)
![Dataset](https://img.shields.io/badge/Dataset-BUT%20PDB-0aa1a7?style=flat-square)
![Format](https://img.shields.io/badge/Format-Parquet-orange?style=flat-square)
![Records](https://img.shields.io/badge/Records-50-success?style=flat-square)
![P waves](https://img.shields.io/badge/P%20waves-5%2C431-blueviolet?style=flat-square)
![License](https://img.shields.io/badge/License-CC%20BY%204.0-lightgrey?style=flat-square)
> **Unofficial mirror of the PhysioNet BUT PDB database v1.0.0: 50 two-minute two-lead ECG segments with 23 types of pathology, selected from three PhysioNet databases, with P-wave positions annotated by two experts, in a viewer-ready Parquet layout with exact samples.**
## Dataset Description
- **Homepage:** https://physionet.org/content/but-pdb/1.0.0/
- **Dataset DOI:** https://doi.org/10.13026/hwvj-5b53
- **License:** CC BY 4.0
## Disclaimer
This repository is **not** an official release of BUT PDB.
The database was created by Lucie Maršánová, Andrea Nemcova, Radovan Smisek, Lukas Smital and Martin Vitek of the Department of Biomedical Engineering, Brno University of Technology, and is published by PhysioNet. The signals and QRS annotations come from the MIT-BIH Arrhythmia Database (Moody and Mark), the MIT-BIH Supraventricular Arrhythmia Database (Greenwald) and the Long Term AF Database (Petrutiu, Sahakian and Swiryn), all on PhysioNet. 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 people. 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 `but-pdb-1.0.0.zip`. Every file in it matched the published `SHA256SUMS.txt`. My format-16 reader and annotation parser return the same values as `wfdb` for every file. Every record was compared with its source segment in the original database (source files checked against their own checksums): all 50 signals equal the source in mV, and all 50 QRS files equal the source's beat annotations. Every row was read back from Parquet and compared with the source.
---
# Dataset Overview
The experts chose two-minute segments with "interesting" pathologies, so pathologies are more frequent than usual. One expert annotated the P wave of every beat by hand in SignalPlant, the second checked them, and unclear parts were discussed until they agreed. The QRS positions and types come from the original databases.
| Source | Records | Rate | Samples |
|---|---|---|---|
| MIT-BIH Arrhythmia Database | 01-38 | 360 Hz | 43,201 |
| MIT-BIH Supraventricular Arrhythmia Database | 39-43 | 128 Hz | 15,360 |
| Long Term AF Database | 44-50 | 128 Hz | 15,360 |
The pathologies (abbreviations from the README): A atrial premature beat, AFIB atrial fibrillation, AFL atrial flutter, B ventricular bigeminy, BI/BII/BIII AV block of 1st/2nd/3rd degree, E ventricular escape beat, F fusion beat, IVR idioventricular rhythm, J nodal beat, L left bundle branch block beat, NA sinus arrhythmia, NOD nodal rhythm, P paced rhythm, PREX pre-excitation, R right bundle branch block beat, SVTA supraventricular tachyarrhythmia, T ventricular trigeminy, V ventricular premature beat, VFL ventricular flutter, VP ventricular pair, a aberrated atrial premature beat.
---
# Changes from the Official Release
- Packed into Parquet so the Dataset Viewer and `datasets` work directly. The `default` config has one row per record and the `beats` config one row per QRS beat.
- The source record, database and segment from `README.txt` are added to each record, with the source's lead names, the pathologies split into a list with their names, and a `preview`.
- `beats` pairs each beat with the annotated P wave between the previous beat and this one.
- The official zip is included unchanged in `original/`.
- No samples or annotations were changed.
---
# Dataset Structure
## `default`: one row per record (50 rows)
| Column | Content |
|---|---|
| `record` | `01` to `50` |
| `pathologies`, `pathology_names`, `pathology_text` | from `README.txt` (the text verbatim) |
| `source_database`, `source_record`, `source_start`, `source_end`, `source_lead_names` | where the segment comes from (README positions; see notes) |
| `sampling_rate`, `n_samples`, `signal` | 360 or 128 Hz; 2 x `n_samples` stored values (int16) |
| `adc_gain`, `adc_baseline`, `units_header` | physical value = (`signal` - baseline) / gain, in mV (see notes) |
| `p_waves`, `n_p_waves` | P-wave positions (samples) as in `.pwave` |
| `qrs`, `n_qrs` | all `.qrs` annotations (sample, symbol, aux note); `n_qrs` counts beats |
| `header`, `preview` | header verbatim; the first 10 s with P waves and QRS labels |
## `beats`: one row per QRS beat (7,572 rows)
| Column | Content |
|---|---|
| `record`, `beat_index`, `sample`, `symbol` | the beat and its label from the source database |
| `p_wave`, `pr_samples`, `pr_ms` | the last annotated P wave after the previous beat, and the interval to this beat; null if none |
| `rr_prev_samples`, `sampling_rate`, `pathologies` | RR interval to the previous beat, and the record's rate and pathologies |
### Read before using the data
- **The headers say µV, but the values are mV.** The gains are given per `\muV`, but (signal − baseline) / gain equals the source databases' signals in **mV** (to within 7×10⁻⁵ mV).
- **Signals and annotations are offset by one sample.** Each signal starts one sample **before** the `README.txt` start position in its source record, while the QRS annotations equal the source's beats counted from the README start. Relative to the waveform, every QRS mark here is one sample later than in the source (2.8 ms at 360 Hz, 7.8 ms at 128 Hz). The P waves were annotated on these signals.
- **Counts differ from the PhysioNet page.** The page gives 5,437 P waves, 7,638 QRS complexes and 2,201 QRS complexes without a P wave. The files hold 5,431 P-wave annotations; 7,638 is the number of all `.qrs` annotations, of which 7,572 are beats and 66 are other annotations (such as rhythm changes); and 2,201 equals 7,638 − 5,437. Counted per beat, 2,226 beats have no annotated P wave since the previous beat.
- **Two P waves sit at sample −1.** Records 08 and 48 (atrial fibrillation) each have a single P-wave annotation, at −1, outside the record.
- **Several P waves before one beat.** In 80 beats more than one P wave falls since the previous beat (e.g. AV block, flutter); `p_wave` is the last one, and all are in `default.p_waves`.
- **The README and the page table differ for 11 records.** For example, the README gives 37 as `'A, FIB'`, but 37 is in neither the A nor the AFIB list; 31 and 32 list `VT`, which is not in the table; the table puts 3 under P (paced) and 19 is not under F, while the README has 3 as `'BIII'` and 19 as `'P, F, V'`. `pathologies` follows the README.
- **Small dataset.** Several records share a source record (e.g. 01 and 13 from MIT-BIH 231, 31 and 32 from 205), so keep source records on one side of a split.
## Usage
```python
# pip install datasets numpy
import numpy as np
from datasets import load_dataset
ds = load_dataset("dronefreak/BUT-PDB", split="train")
row = ds[0]
mv = (np.asarray(row["signal"]) - np.asarray(row["adc_baseline"])[:, None]) / np.asarray(row["adc_gain"])[:, None]
print(row["record"], row["pathologies"], row["sampling_rate"], mv.shape, len(row["p_waves"]))
beats = load_dataset("dronefreak/BUT-PDB", "beats", split="train")
with_p = beats.filter(lambda b: b["p_wave"] is not None)
```
---
# Dataset Sources
## Citation
Please cite BUT PDB and PhysioNet:
```bibtex
@article{PhysioNet-but-pdb-1.0.0,
author = {Maršánová, Lucie and Nemcova, Andrea and Smisek, Radovan and Smital, Lukas and Vitek, Martin},
title = {{Brno University of Technology ECG Signal Database with Annotations of P Wave (BUT PDB)}},
journal = {{PhysioNet}},
year = {2021},
note = {Version 1.0.0},
doi = {10.13026/hwvj-5b53}
}
```
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
The segments come from the MIT-BIH Arrhythmia Database (https://doi.org/10.13026/C2F305), the MIT-BIH Supraventricular Arrhythmia Database (https://doi.org/10.13026/C2V30W) and the Long Term AF Database (https://doi.org/10.13026/C2QG6Q); please cite those as well where relevant.
---
# License
BUT PDB is made available under the **Creative Commons Attribution 4.0 International Public License (CC BY 4.0)**: https://physionet.org/content/but-pdb/view-license/1.0.0/. This mirror repackages the data (see Changes from the Official Release) and credits the authors as above.