Skip to content

← Back to Work

Repeated ECGs, unassessed diagnoses and missing patient identifiers in public ECG datasets

The same ECG published two to four times in the 2021 Challenge datasets, often with different diagnoses

November 2026 · 8 min

ECGdatasetsdata quality

Abstract

Background. Most deep learning models for the ECG are trained and tested on public datasets, often several pooled together. The most used pool is the PhysioNet/Computing in Cardiology Challenge 2021, which repackages eight datasets from China, the United States, Germany and Russia under one set of diagnosis codes. Pooling assumes three things: each ECG appears once, a diagnosis absent from an ECG's labels was looked for and not found, and all ECGs of one patient can be kept on the same side of the split between training and testing.

Methods. We loaded 25 public datasets, 1,415,836 ECGs, into one database, each ECG traced to the file and checksum its publisher released. To find an ECG published twice, we compared the signals themselves, not the files. We tested the method against the list of duplicates that the publishers of PTB-XL, a German dataset, removed in later versions. We also recorded which diagnoses each dataset assessed, and which ECGs carry a patient identifier.

Results. In the Challenge copy of PTB-XL, the method found all 40 pairs the publishers listed and no other. In three other Challenge datasets, it found ECGs published two to four times: 505 of the 6,877 ECGs of CPSC 2018, 137 of the 3,453 of its supplement, and 186 of the 10,344 of Georgia. Every pair was identical sample for sample over its full length. The two copies of one ECG carried different diagnoses in 33 of the 70 pairs of the CPSC 2018 supplement and in 17 of the 38 pairs of PTB-XL. None of the 22,431 pairs of the same ECG published in two datasets shared a file checksum. Ningbo, the largest Challenge dataset with 34,905 ECGs, has no atrial fibrillation label at all. Twelve datasets, 77,180 ECGs, publish no patient identifier.

Conclusions. A model trained on the Challenge pool can meet the same ECG in training and in testing, learn two different answers for one tracing, and learn 34,905 ECGs as free of atrial fibrillation when nobody looked for it. Before these datasets are pooled, copies should be found by signal, the diagnoses each dataset assessed should be recorded, and every dataset without patient identifiers should be kept whole on one side of the split.

1. Introduction

A 12-lead ECG is a recording of the heart's electrical activity, usually 10 seconds long, from twelve viewpoints called leads. Public ECG datasets come from hospitals and from research challenges; each pairs every recording with the diagnoses a cardiologist or a machine read on it, such as atrial fibrillation, an irregular rhythm of the upper chambers. Because no single public dataset is large, models are trained on several at once.

The PhysioNet/Computing in Cardiology Challenge 2021 made this easy: it released 88,253 ECGs from eight datasets, every diagnosis translated into one coding system, SNOMED CT [1, 2]. Its organisers warned that some labels are likely wrong and that label quality differs between datasets [2]. A study that pooled the Challenge data noted that it carries no patient identifiers, so the authors could not check for repeated recordings; in a hospital dataset that did carry them, they found 132 ECGs recorded twice [3].

Three properties decide whether a pooled dataset measures what it claims. If one ECG appears twice, it can land in training and in testing, and the test score then measures memory. If a dataset never looked for a diagnosis, its ECGs are not negatives for it, and a model trained to read them as negatives learns that the diagnosis is absent where it was simply not assessed. If a patient's ECGs cannot be grouped, a split meant to separate patients cannot. We measured repeated ECGs within and across 25 public datasets, the diagnoses each dataset assessed, and the share of ECGs without a patient identifier.

2. Methods

2.1 Data

We downloaded 25 public ECG datasets, 1,415,836 ECGs in all, from PhysioNet, Zenodo and Figshare, among them the eight datasets of the Challenge bundle, the original release of PTB-XL, MIMIC-IV-ECG, CODE-15% and SPH. Each file was admitted only when it matched the checksum its publisher lists, a fingerprint that changes if a single byte changes, and every ECG in the database points back to its file.

2.2 Finding the same ECG twice

Two copies of one ECG can sit in different files, under different names, with different checksums. We therefore compared the signals: the first ten seconds of the twelve leads were rounded to 10 µV and fingerprinted, and two ECGs with the same fingerprint were linked. Between datasets, where one may have been resampled or rescaled, ECGs not linked this way were also compared by correlation, a measure of how closely two signals move together. Linked ECGs form a group. For every pair inside a Challenge dataset, we then compared the two recordings over their full length.

To test the method, we used the one list of duplicates a publisher wrote: the PTB-XL changelogs for versions 1.0.2 and 1.0.3 list 40 pairs of records with identical signals, of which the later versions dropped one record each [4]. The Challenge bundle carries the earlier version, so the pairs are still in it.

2.3 Assessed diagnoses and patient identifiers

For each dataset, we recorded which diagnoses it assessed, from its documentation, and for the Challenge datasets from the organisers' table of scored diagnoses, which counts each diagnosis per dataset [5]. A diagnosis with a count of zero in a dataset of thousands of hospital ECGs was taken as not assessed there. For each ECG, we recorded whether its publisher gives a patient identifier. ECGs without one were kept together by dataset, and each such dataset was assigned whole to one of ten folds, the parts into which the data are divided for training and testing.

3. Results

3.1 The method reproduces the publisher's list

In the Challenge copy of PTB-XL, 21,837 ECGs, the method linked 38 pairs. All 38 are among the 40 pairs of the changelogs, and none falls outside them. The two remaining pairs were grouped through the original PTB-XL release, so all 40 were found.

3.2 The same ECG, published more than once in one dataset

DatasetECGsGroups of copiesECGs in a groupLargest group
CPSC 20186,8772505054
CPSC 2018 supplement3,453681373
Georgia10,344921863
PTB-XL (Challenge copy)21,83736743
Chapman-Shaoxing10,24713262
Ningbo34,905362

All 481 pairs inside these datasets are identical sample for sample over their full length, which reaches 118 seconds in CPSC 2018, so none is a different recording that happens to share its first ten seconds.

3.3 Copies with different diagnoses

The two copies of one ECG carried different sets of diagnosis codes in 33 of the 70 pairs of the CPSC 2018 supplement, 17 of the 38 pairs of PTB-XL, 1 of the 261 pairs of CPSC 2018 and 1 of the 3 pairs of Ningbo. The PTB-XL documentation states that its duplicates were annotated as independent records [4]. Outside the Challenge, the copies in CODE-15%, a Brazilian dataset, differed in their labels in 709 of 3,841 pairs.

3.4 Copies across datasets

Across datasets, 22,431 pairs link the same ECG published twice: 21,844 by identical signal and 587 by correlation. All but four are the Challenge copies of PTB-XL (21,837 ECGs), PTB (516) and INCART (74) beside their original releases. None of the 22,431 pairs shares a file checksum, so a check on files finds none of them.

3.5 Unassessed diagnoses and patient identifiers

The organisers' table counts no atrial fibrillation among Ningbo's 34,905 ECGs [5]; a model that reads a missing code as a negative learns 34,905 ECGs as free of atrial fibrillation. Twelve datasets, 77,180 ECGs, publish no patient identifier; six of them are in the Challenge bundle. Assigned whole, they leave one fold with 180,715 ECGs against 132,153 to 144,753 for the other nine.

4. Discussion

4.1 Principal findings

A fingerprint of the signal found every duplicate pair the PTB-XL publishers listed and no other, and found 443 more pairs, all identical over their full length, in five other Challenge datasets. In the CPSC 2018 supplement, nearly half of these copies carry different diagnoses. A split by record can place one copy in training and the other in testing, and training sees the same tracing with two answers.

4.2 Comparison with prior work

The Challenge organisers warned of label errors and of quality that differs between datasets [2], and a study pooling the Challenge data could not check it for repeated recordings for want of patient identifiers [3]. The duplicates PTB-XL removed are documented by its publishers [4]. A search of the Challenge papers and the literature on 17 November 2026 found no report of the repeated ECGs inside CPSC 2018, its supplement or Georgia, nor of the different diagnoses carried by copies of one ECG.

4.3 Strengths and limitations

Every ECG is traced to its publisher's file and checksum, and the method was tested against a list its publisher wrote. The fingerprint covers the first ten seconds; within a dataset, copies that differ by a resampling or a change of gain would be missed, since correlation was run only between datasets. Two recordings of one patient taken minutes apart are different signals, and this method does not find them. Which diagnoses a dataset assessed rests on its documentation and on the organisers' counts.

4.4 Implications

Before these datasets are pooled: link copies by their signal, never by file or name; keep every copy of one ECG on the same side of the split; record, for each dataset, which diagnoses were assessed, and treat the others as unknown rather than negative; and assign each dataset without patient identifiers whole to one fold.

References

  1. Reyna MA, Sadr N, Perez Alday EA, et al. Will two do? Varying dimensions in electrocardiography: the PhysioNet/Computing in Cardiology Challenge 2021. Computing in Cardiology 2021;48:1–4.
  2. PhysioNet/Computing in Cardiology Challenge 2021, data description. moody-challenge.physionet.org/2021
  3. Leinonen T, Wong D, Vasankari A, et al. Empirical investigation of multi-source cross-validation in clinical ECG classification. Computers in Biology and Medicine, 2024. arXiv:2403.15012.
  4. Wagner P, Strodthoff N, Bousseljot RD, et al. PTB-XL, a large publicly available electrocardiography dataset, version 1.0.3, and its changelogs for versions 1.0.2 and 1.0.3. PhysioNet. physionet.org/content/ptb-xl/1.0.3
  5. PhysioNet/Computing in Cardiology Challenge 2021, table of scored diagnoses (dx_mapping_scored.csv). github.com/physionetchallenges/evaluation-2021