signal array 2D | active_start int32 -1 3.68k | active_end int32 -1 4.1k | is_empty bool 2
classes | exam_id int64 14 4.42M | patient_id int64 4 1.77M | age int32 17 91 | is_male bool 2
classes | nn_predicted_age float64 -12.74 101 | normal_ecg bool 2
classes | death bool 2
classes | timey float64 0 7.68 ⌀ | source_file stringclasses 2
values | 1dAVb bool 2
classes | RBBB bool 2
classes | LBBB bool 2
classes | SB bool 2
classes | AF bool 2
classes | ST bool 2
classes |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
[[-0.487810343503952,-0.4810657799243927,-0.4797932207584381,-0.4784466028213501,-0.4725662469863891(...TRUNCATED) | 0 | 4,095 | false | 590,673 | 57,158 | 83 | true | 51.91465 | true | null | null | exams_part0.hdf5 | false | false | false | false | false | false |
[[4.710418701171875,4.706905364990234,4.7019476890563965,4.698709487915039,4.702796459197998,4.69742(...TRUNCATED) | 0 | 4,095 | false | 214,626 | 800,764 | 51 | false | 46.806953 | true | false | 4.16712 | exams_part0.hdf5 | false | false | false | false | false | false |
[[0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.(...TRUNCATED) | 581 | 3,514 | false | 2,936,711 | 94,856 | 67 | false | 64.20702 | false | false | 6.473967 | exams_part0.hdf5 | false | false | false | false | false | false |
[[0.4801883101463318,0.48334160447120667,0.49175354838371277,0.4830177426338196,0.47256624698638916,(...TRUNCATED) | 0 | 4,095 | false | 1,175,521 | 1,366,901 | 58 | false | 59.20399 | true | false | 2.08493 | exams_part0.hdf5 | false | false | false | false | false | false |
[[-1.562517523765564,-1.573972463607788,-1.5801721811294556,-1.587507724761963,-1.6006276607513428,-(...TRUNCATED) | 0 | 4,095 | false | 1,073,151 | 1,114,880 | 59 | true | 71.8051 | false | null | null | exams_part0.hdf5 | false | false | false | false | false | false |
[[0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.(...TRUNCATED) | 581 | 3,514 | false | 223,229 | 444,383 | 78 | false | 77.16487 | false | false | 4.147942 | exams_part0.hdf5 | false | true | false | false | false | false |
[[0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.(...TRUNCATED) | 581 | 3,514 | false | 3,009,086 | 335,855 | 30 | false | 22.714043 | false | false | 6.315063 | exams_part0.hdf5 | false | false | false | false | false | false |
[[0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.(...TRUNCATED) | 581 | 3,514 | false | 625,648 | 585,008 | 17 | false | 31.391525 | true | false | 3.232874 | exams_part0.hdf5 | false | false | false | false | false | false |
[[0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.(...TRUNCATED) | 581 | 3,514 | false | 218,333 | 1,728,450 | 81 | false | 71.68867 | false | false | 4.156161 | exams_part0.hdf5 | false | false | false | false | false | false |
[[0.525920569896698,0.5218385457992554,0.5065467357635498,0.49110129475593567,0.487810343503952,0.48(...TRUNCATED) | 0 | 4,095 | false | 1,281,753 | 590,301 | 19 | false | 31.793686 | true | false | 1.893149 | exams_part0.hdf5 | false | false | false | false | false | false |
CODE-15%: A Large-Scale Annotated 12-Lead ECG Dataset
Unofficial mirror of CODE-15%: 345,779 12-lead ECG exams from 233,770 patients, with abnormality labels and mortality follow-up, in a streamable Parquet layout with exact signal values.
Disclaimer
This repository is not an official release of CODE-15%.
The dataset was published by Antônio H. Ribeiro, Gabriela M. M. Paixão, Emilly M. Lima, Manoel Horta Ribeiro, Marcelo M. Pinto Filho, Paulo R. Gomes, Derick M. Oliveira, Wagner Meira Jr, Thomas B. Schön and Antonio Luiz P. Ribeiro. The data was collected by the Telehealth Network of Minas Gerais. 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 records from real patients and include mortality follow-up. 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 Zenodo record 4916206 (v1.0.0), with every download checked against its MD5. Every stored signal was read back from Parquet and compared with the source HDF5 for exact equality.
Dataset Overview
CODE-15% is a stratified sample of 15% of the patients in the CODE dataset, collected by the Telehealth Network of Minas Gerais, Brazil, between 2010 and 2016. Exams are labeled for six abnormalities: 1st degree AV block (1dAVb), right bundle branch block (RBBB), left bundle branch block (LBBB), sinus bradycardia (SB), atrial fibrillation (AF) and sinus tachycardia (ST).
| Label | Positive exams |
|---|---|
normal_ecg |
134,657 |
RBBB |
9,672 |
ST |
7,584 |
AF |
7,033 |
LBBB |
6,026 |
1dAVb |
5,716 |
SB |
5,605 |
Changes from the Official Release
- Packed the 18 HDF5 parts into 18 Parquet shards, one row per exam, joined to
exams.csvbyexam_id. - Removed the one trailing placeholder row in each HDF5 part (exam id 0, all samples zero). It is not an exam and has no row in
exams.csv. - Added
source_file,active_start,active_endandis_empty. - Added a small
samplesconfig of 196 exams with a rendered 12-leadpreview. - The official
exams.csvis included unchanged inoriginal/. The official HDF5 zips are not duplicated here and remain on Zenodo. - No signal values or labels were changed.
Dataset Structure
| Column | Content |
|---|---|
exam_id, patient_id |
official exam and patient ids |
age, is_male |
patient age at the exam, and sex |
nn_predicted_age |
age predicted by the authors' neural network |
1dAVb, RBBB, LBBB, SB, AF, ST |
abnormality labels |
normal_ecg |
true if the automatic annotation system reports a normal ECG |
death |
true if the patient died during follow-up, only on the patient's first exam |
timey |
time to death, or follow-up time, only on the patient's first exam |
source_file |
official HDF5 part holding this exam |
signal |
float32, shape (12, 4096) as (lead, sample), 400 Hz |
active_start, active_end |
first and last sample where any lead is non-zero, -1 if empty |
is_empty |
true if every sample is zero |
preview |
PNG plot of the recorded portion (samples config only) |
Lead order: DI, DII, DIII, AVR, AVL, AVF, V1, V2, V3, V4, V5, V6. There is one train split because the authors define no official split.
Read before using the signals
- Split by
patient_id, not by row. Many patients have several exams, so a row-level split leaks patients between train and test. - 670 exams are entirely zero. They are kept and flagged with
is_empty, so filter them before training. - Many signals are zero-padded, but not all. The official description says 7 s and 10 s recordings are centered in 4096 samples with zeros. In this file, 130,763 exams have a non-zero value at both the first and last sample, so read
active_startandactive_endinstead of assuming a duration. deathandtimeyare mostly null by design. They are filled on 233,647 rows and null on the other 112,132. 8,341 rows record a death.- Lead order was checked on every exam. Against the standard limb-lead equations, 338,778 exams match the documented order within a 10% residual and none match the CODE-test order. The other 7,001 are the 670 empty exams and 6,331 that do not meet the tolerance, so they are unclassified rather than proven.
- CODE-test uses a different order. The sibling dataset CODE-test stores
AVL, AVF, AVRin these positions, so reorder before combining them. - The amplitude unit is not stated in this record. Values are kept as published.
Usage
The full dataset is about 43 GB, so streaming is the easiest way to start.
# pip install datasets pillow numpy
import numpy as np
from datasets import load_dataset
ds = load_dataset("dronefreak/CODE-15", split="train", streaming=True)
row = next(r for r in ds if not r["is_empty"])
signal = np.asarray(row["signal"], dtype=np.float32) # (12, 4096)
recorded = signal[:, row["active_start"]:row["active_end"] + 1]
# A small subset with rendered previews
samples = load_dataset("dronefreak/CODE-15", "samples", split="train")
Dataset Sources
Citation
Please cite both papers and the dataset (DOI 10.5281/zenodo.4916206):
Ribeiro, A. H., Ribeiro, M. H., Paixão, G. M. M., Oliveira, D. M., Gomes, P. R., Canazart, J. A., Ferreira, M. P. S., et al. Automatic diagnosis of the 12-lead ECG using a deep neural network. Nature Communications, 11(1):1760, 2020. doi: 10.1038/s41467-020-15432-4
Lima, E. M., Ribeiro, A. H., Paixão, G. M. M., Ribeiro, M. H., Pinto Filho, M. M., Gomes, P. R., Oliveira, D. M., Sabino, E. C., Duncan, B. B., Giatti, L., Barreto, S. M., Meira Jr, W., Schön, T. B., Ribeiro, A. L. P. Deep neural network estimated electrocardiographic-age as a mortality predictor. medRxiv, 2021. doi: 10.1101/2021.02.19.21251232
License
CODE-15% is released by its authors under Creative Commons Attribution 4.0 International (CC BY 4.0). This mirror reformats the data as described above. Please credit the authors and cite the papers.
- Downloads last month
- -