signal array 2D | active_start int32 0 962 | active_end int32 3.51k 4.1k | is_empty bool 1
class | exam_index int32 0 826 | age int32 17 97 | sex stringclasses 2
values | lead_names listlengths 12 12 | gold_standard dict | cardiologist1 dict | cardiologist2 dict | cardiology_residents dict | emergency_residents dict | medical_students dict | dnn_prediction dict | preview imagewidth (px) 840 840 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
[[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 | 0 | 34 | M | [
"DI",
"DII",
"DIII",
"AVL",
"AVF",
"AVR",
"V1",
"V2",
"V3",
"V4",
"V5",
"V6"
] | {
"1dAVb": 0,
"RBBB": 0,
"LBBB": 0,
"SB": 0,
"AF": 0,
"ST": 0
} | {
"1dAVb": 0,
"RBBB": 0,
"LBBB": 0,
"SB": 0,
"AF": 0,
"ST": 0
} | {
"1dAVb": 0,
"RBBB": 0,
"LBBB": 0,
"SB": 0,
"AF": 0,
"ST": 0
} | {
"1dAVb": 0,
"RBBB": 0,
"LBBB": 0,
"SB": 0,
"AF": 0,
"ST": 0
} | {
"1dAVb": 0,
"RBBB": 0,
"LBBB": 0,
"SB": 0,
"AF": 0,
"ST": 0
} | {
"1dAVb": 0,
"RBBB": 0,
"LBBB": 0,
"SB": 0,
"AF": 0,
"ST": 0
} | {
"1dAVb": 0,
"RBBB": 0,
"LBBB": 0,
"SB": 0,
"AF": 0,
"ST": 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,0.(...TRUNCATED) | 962 | 4,095 | false | 1 | 70 | F | [
"DI",
"DII",
"DIII",
"AVL",
"AVF",
"AVR",
"V1",
"V2",
"V3",
"V4",
"V5",
"V6"
] | {
"1dAVb": 0,
"RBBB": 0,
"LBBB": 1,
"SB": 0,
"AF": 0,
"ST": 0
} | {
"1dAVb": 0,
"RBBB": 0,
"LBBB": 0,
"SB": 0,
"AF": 0,
"ST": 0
} | {
"1dAVb": 0,
"RBBB": 0,
"LBBB": 1,
"SB": 0,
"AF": 0,
"ST": 0
} | {
"1dAVb": 0,
"RBBB": 0,
"LBBB": 1,
"SB": 0,
"AF": 0,
"ST": 0
} | {
"1dAVb": 0,
"RBBB": 0,
"LBBB": 1,
"SB": 0,
"AF": 0,
"ST": 0
} | {
"1dAVb": 0,
"RBBB": 0,
"LBBB": 0,
"SB": 0,
"AF": 0,
"ST": 0
} | {
"1dAVb": 0,
"RBBB": 0,
"LBBB": 1,
"SB": 0,
"AF": 0,
"ST": 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,0.(...TRUNCATED) | 581 | 3,514 | false | 2 | 52 | F | [
"DI",
"DII",
"DIII",
"AVL",
"AVF",
"AVR",
"V1",
"V2",
"V3",
"V4",
"V5",
"V6"
] | {
"1dAVb": 0,
"RBBB": 0,
"LBBB": 0,
"SB": 0,
"AF": 0,
"ST": 0
} | {
"1dAVb": 0,
"RBBB": 0,
"LBBB": 0,
"SB": 0,
"AF": 0,
"ST": 0
} | {
"1dAVb": 0,
"RBBB": 0,
"LBBB": 0,
"SB": 0,
"AF": 0,
"ST": 0
} | {
"1dAVb": 0,
"RBBB": 0,
"LBBB": 0,
"SB": 0,
"AF": 0,
"ST": 0
} | {
"1dAVb": 0,
"RBBB": 0,
"LBBB": 0,
"SB": 0,
"AF": 0,
"ST": 0
} | {
"1dAVb": 0,
"RBBB": 0,
"LBBB": 0,
"SB": 0,
"AF": 0,
"ST": 0
} | {
"1dAVb": 0,
"RBBB": 0,
"LBBB": 0,
"SB": 0,
"AF": 0,
"ST": 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,0.(...TRUNCATED) | 581 | 3,514 | false | 3 | 41 | F | [
"DI",
"DII",
"DIII",
"AVL",
"AVF",
"AVR",
"V1",
"V2",
"V3",
"V4",
"V5",
"V6"
] | {
"1dAVb": 0,
"RBBB": 0,
"LBBB": 0,
"SB": 0,
"AF": 0,
"ST": 0
} | {
"1dAVb": 0,
"RBBB": 0,
"LBBB": 0,
"SB": 0,
"AF": 0,
"ST": 0
} | {
"1dAVb": 0,
"RBBB": 0,
"LBBB": 0,
"SB": 0,
"AF": 0,
"ST": 0
} | {
"1dAVb": 0,
"RBBB": 0,
"LBBB": 0,
"SB": 0,
"AF": 0,
"ST": 0
} | {
"1dAVb": 0,
"RBBB": 0,
"LBBB": 0,
"SB": 0,
"AF": 0,
"ST": 0
} | {
"1dAVb": 0,
"RBBB": 0,
"LBBB": 0,
"SB": 0,
"AF": 0,
"ST": 0
} | {
"1dAVb": 0,
"RBBB": 0,
"LBBB": 0,
"SB": 0,
"AF": 0,
"ST": 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,0.(...TRUNCATED) | 581 | 3,514 | false | 4 | 32 | F | [
"DI",
"DII",
"DIII",
"AVL",
"AVF",
"AVR",
"V1",
"V2",
"V3",
"V4",
"V5",
"V6"
] | {
"1dAVb": 0,
"RBBB": 0,
"LBBB": 0,
"SB": 0,
"AF": 0,
"ST": 0
} | {
"1dAVb": 0,
"RBBB": 0,
"LBBB": 0,
"SB": 0,
"AF": 0,
"ST": 0
} | {
"1dAVb": 0,
"RBBB": 0,
"LBBB": 0,
"SB": 0,
"AF": 0,
"ST": 0
} | {
"1dAVb": 0,
"RBBB": 0,
"LBBB": 0,
"SB": 0,
"AF": 0,
"ST": 0
} | {
"1dAVb": 0,
"RBBB": 0,
"LBBB": 0,
"SB": 0,
"AF": 0,
"ST": 0
} | {
"1dAVb": 0,
"RBBB": 0,
"LBBB": 0,
"SB": 0,
"AF": 0,
"ST": 0
} | {
"1dAVb": 0,
"RBBB": 0,
"LBBB": 0,
"SB": 0,
"AF": 0,
"ST": 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,0.(...TRUNCATED) | 581 | 3,514 | false | 5 | 45 | F | [
"DI",
"DII",
"DIII",
"AVL",
"AVF",
"AVR",
"V1",
"V2",
"V3",
"V4",
"V5",
"V6"
] | {
"1dAVb": 0,
"RBBB": 0,
"LBBB": 0,
"SB": 0,
"AF": 0,
"ST": 0
} | {
"1dAVb": 0,
"RBBB": 0,
"LBBB": 0,
"SB": 0,
"AF": 0,
"ST": 0
} | {
"1dAVb": 0,
"RBBB": 0,
"LBBB": 0,
"SB": 0,
"AF": 0,
"ST": 0
} | {
"1dAVb": 0,
"RBBB": 0,
"LBBB": 0,
"SB": 0,
"AF": 0,
"ST": 0
} | {
"1dAVb": 0,
"RBBB": 0,
"LBBB": 0,
"SB": 0,
"AF": 0,
"ST": 0
} | {
"1dAVb": 0,
"RBBB": 0,
"LBBB": 0,
"SB": 0,
"AF": 0,
"ST": 0
} | {
"1dAVb": 0,
"RBBB": 0,
"LBBB": 0,
"SB": 0,
"AF": 0,
"ST": 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,0.(...TRUNCATED) | 581 | 3,514 | false | 6 | 47 | M | [
"DI",
"DII",
"DIII",
"AVL",
"AVF",
"AVR",
"V1",
"V2",
"V3",
"V4",
"V5",
"V6"
] | {
"1dAVb": 0,
"RBBB": 0,
"LBBB": 0,
"SB": 0,
"AF": 0,
"ST": 0
} | {
"1dAVb": 0,
"RBBB": 0,
"LBBB": 0,
"SB": 0,
"AF": 0,
"ST": 0
} | {
"1dAVb": 0,
"RBBB": 0,
"LBBB": 0,
"SB": 0,
"AF": 0,
"ST": 0
} | {
"1dAVb": 0,
"RBBB": 0,
"LBBB": 0,
"SB": 0,
"AF": 0,
"ST": 0
} | {
"1dAVb": 0,
"RBBB": 0,
"LBBB": 0,
"SB": 0,
"AF": 0,
"ST": 0
} | {
"1dAVb": 0,
"RBBB": 0,
"LBBB": 0,
"SB": 0,
"AF": 0,
"ST": 0
} | {
"1dAVb": 0,
"RBBB": 0,
"LBBB": 0,
"SB": 0,
"AF": 0,
"ST": 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,0.(...TRUNCATED) | 581 | 3,514 | false | 7 | 51 | F | [
"DI",
"DII",
"DIII",
"AVL",
"AVF",
"AVR",
"V1",
"V2",
"V3",
"V4",
"V5",
"V6"
] | {
"1dAVb": 0,
"RBBB": 0,
"LBBB": 0,
"SB": 0,
"AF": 0,
"ST": 0
} | {
"1dAVb": 0,
"RBBB": 0,
"LBBB": 0,
"SB": 0,
"AF": 0,
"ST": 0
} | {
"1dAVb": 0,
"RBBB": 0,
"LBBB": 0,
"SB": 0,
"AF": 0,
"ST": 0
} | {
"1dAVb": 0,
"RBBB": 0,
"LBBB": 0,
"SB": 0,
"AF": 0,
"ST": 0
} | {
"1dAVb": 0,
"RBBB": 0,
"LBBB": 0,
"SB": 0,
"AF": 0,
"ST": 0
} | {
"1dAVb": 0,
"RBBB": 0,
"LBBB": 0,
"SB": 0,
"AF": 0,
"ST": 0
} | {
"1dAVb": 0,
"RBBB": 0,
"LBBB": 0,
"SB": 0,
"AF": 0,
"ST": 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,0.(...TRUNCATED) | 581 | 3,514 | false | 8 | 49 | F | [
"DI",
"DII",
"DIII",
"AVL",
"AVF",
"AVR",
"V1",
"V2",
"V3",
"V4",
"V5",
"V6"
] | {
"1dAVb": 0,
"RBBB": 0,
"LBBB": 0,
"SB": 0,
"AF": 0,
"ST": 0
} | {
"1dAVb": 0,
"RBBB": 0,
"LBBB": 0,
"SB": 0,
"AF": 0,
"ST": 0
} | {
"1dAVb": 0,
"RBBB": 0,
"LBBB": 0,
"SB": 0,
"AF": 0,
"ST": 0
} | {
"1dAVb": 0,
"RBBB": 0,
"LBBB": 0,
"SB": 0,
"AF": 0,
"ST": 0
} | {
"1dAVb": 0,
"RBBB": 0,
"LBBB": 0,
"SB": 0,
"AF": 0,
"ST": 0
} | {
"1dAVb": 0,
"RBBB": 0,
"LBBB": 0,
"SB": 0,
"AF": 0,
"ST": 0
} | {
"1dAVb": 0,
"RBBB": 0,
"LBBB": 0,
"SB": 0,
"AF": 0,
"ST": 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,0.(...TRUNCATED) | 581 | 3,514 | false | 9 | 62 | M | [
"DI",
"DII",
"DIII",
"AVL",
"AVF",
"AVR",
"V1",
"V2",
"V3",
"V4",
"V5",
"V6"
] | {
"1dAVb": 0,
"RBBB": 0,
"LBBB": 0,
"SB": 0,
"AF": 0,
"ST": 0
} | {
"1dAVb": 0,
"RBBB": 0,
"LBBB": 0,
"SB": 0,
"AF": 0,
"ST": 0
} | {
"1dAVb": 0,
"RBBB": 0,
"LBBB": 0,
"SB": 0,
"AF": 0,
"ST": 0
} | {
"1dAVb": 0,
"RBBB": 0,
"LBBB": 0,
"SB": 0,
"AF": 0,
"ST": 0
} | {
"1dAVb": 0,
"RBBB": 0,
"LBBB": 0,
"SB": 0,
"AF": 0,
"ST": 0
} | {
"1dAVb": 0,
"RBBB": 0,
"LBBB": 0,
"SB": 0,
"AF": 0,
"ST": 0
} | {
"1dAVb": 0,
"RBBB": 0,
"LBBB": 0,
"SB": 0,
"AF": 0,
"ST": 0
} |
CODE-test: An Annotated 12-Lead ECG Dataset
Unofficial mirror of CODE-test: 827 12-lead ECGs with labels from cardiologists, residents, medical students and a neural network, in a viewer-ready Parquet layout with exact signal values.
Disclaimer
This repository is not an official release of CODE-test.
CODE-test was created by Antônio H. Ribeiro, Manoel Horta Ribeiro, Gabriela M. M. Paixão, Derick M. Oliveira, Paulo R. Gomes, Jéssica A. Canazart, Milton P. S. Ferreira, Carl R. Andersson, Peter W. Macfarlane, Wagner Meira Jr., Thomas B. Schön and Antonio Luiz P. Ribeiro. 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. 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 3765780 (v1.0.3), with the 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-test is the test set of Automatic diagnosis of the 12-lead ECG using a deep neural network (Nature Communications, 2020). Each of the 827 exams comes from a different patient and is 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).
Changes from the Official Release
- Packed into Parquet, one row per exam, as a
testsplit, matching how the authors use this set. - Joined the tracings, patient attributes and all annotation files into one table.
- Added
lead_names,active_start,active_end,is_emptyand a rendered 12-leadpreview. - The official package is included unchanged at
original/data.zip. - No signal values or labels were changed.
Dataset Structure
| Column | Content |
|---|---|
exam_index |
row position in the official files, 0 to 826 |
age, sex |
from attributes.csv |
lead_names |
verified order of the 12 leads in signal (see below) |
gold_standard |
consensus labels: two cardiologists, with a senior specialist resolving disagreements |
cardiologist1, cardiologist2 |
each cardiologist's labels |
cardiology_residents, emergency_residents, medical_students |
labels from each group |
dnn_prediction |
the paper's neural network output, thresholded to 0 or 1 |
signal |
float64, shape (12, 4096) as (lead, sample), 400 Hz |
active_start, active_end |
first and last sample where any lead is non-zero |
is_empty |
true if every sample is zero (no exam here) |
preview |
PNG plot of the recorded portion |
Read before using the signals
- The documented lead order is wrong for three leads. The official README lists
DI, DII, DIII, AVR, AVL, AVF, V1..V6, but the stored order isDI, DII, DIII, AVL, AVF, AVR, V1..V6. We tested each exam against the standard limb-lead equations: 773 of 827 match this order on all three leads, the remaining 54 are too noisy to classify on at least one lead, and none match the documented order. The signal is unchanged, so uselead_names. The sibling datasets SaMi-Trop and CODE-15% do follow the documented order, so reorder these leads before combining them. - 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, 253 of 827 exams are non-zero across all 4096 samples, so read
active_startandactive_endinstead of assuming a duration. - The amplitude unit is ambiguous. The official README says the scale is
1e-4 Vand also says to multiply by 1000 to obtain volts, and these two statements disagree. Values are kept as published and no unit is asserted here. datasetsNumPy formatting rounds this column.with_format("numpy")returnsfloat32. For exact values, use the default format as shown below.
Usage
# pip install datasets pillow numpy
import numpy as np
from datasets import load_dataset
ds = load_dataset("dronefreak/CODE-test", split="test")
row = ds[0]
signal = np.asarray(row["signal"], dtype=np.float64) # (12, 4096)
recorded = signal[:, row["active_start"]:row["active_end"] + 1]
avr = signal[row["lead_names"].index("AVR")]
labels = row["gold_standard"] # {"1dAVb": 0, "RBBB": 0, ...}
Dataset Sources
Citation
@article{ribeiro_automatic_2020,
title = {Automatic Diagnosis of the 12-Lead {{ECG}} Using a Deep Neural Network},
author = {Ribeiro, Ant{\^o}nio H. and Ribeiro, Manoel Horta and Paix{\~a}o, Gabriela M. M. and Oliveira, Derick M. and Gomes, Paulo R. and Canazart, J{\'e}ssica A. and Ferreira, Milton P. S. and Andersson, Carl R. and Macfarlane, Peter W. and Meira Jr., Wagner and Sch{\"o}n, Thomas B. and Ribeiro, Antonio Luiz P.},
year = {2020},
volume = {11},
number = {1},
pages = {1760},
doi = {10.1038/s41467-020-15432-4},
journal = {Nature Communications}
}
License
CODE-test 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 paper.
- Downloads last month
- 11