An Open-Source Python Framework and Synthetic ECG Image Datasets for Digitization, Lead and Lead Name Detection, and Overlapping Signal Segmentation
Pith reviewed 2026-05-19 12:18 UTC · model grok-4.3
The pith
An open-source Python framework generates synthetic ECG images from PTB-XL signals with annotations for digitization, lead detection, and waveform segmentation.
A machine-rendered reading of the paper's core claim, the machinery that carries it, and where it could break.
Core claim
We introduce an open-source Python framework for generating synthetic ECG image datasets to advance critical deep learning-based tasks in ECG analysis, including ECG digitization, lead region and lead name detection, and pixel-level waveform segmentation. Using the PTB-XL signal dataset, our proposed framework produces four open-access datasets: (1) ECG images in various lead configurations paired with time-series signals for ECG digitization, (2) ECG images annotated with YOLO-format bounding boxes for detection of lead region and lead name, (3)-(4) cropped single-lead images with segmentation masks compatible with U-Net-based models in normal and overlapping versions. In the overlapping 3D
What carries the argument
The Python generation pipeline that renders PTB-XL signals as plotted ECG images and attaches task-specific annotations such as bounding boxes and pixel masks.
Load-bearing premise
The synthetic images generated from PTB-XL signals are sufficiently representative of real-world ECG recordings to train effective deep learning models for the targeted tasks.
What would settle it
Train a digitization or segmentation model on the released synthetic datasets and test it on a held-out collection of real scanned ECG paper records; a large drop in accuracy relative to models trained on real data would show the synthetic images do not transfer.
Figures
read the original abstract
We introduce an open-source Python framework for generating synthetic ECG image datasets to advance critical deep learning-based tasks in ECG analysis, including ECG digitization, lead region and lead name detection, and pixel-level waveform segmentation. Using the PTB-XL signal dataset, our proposed framework produces four open-access datasets: (1) ECG images in various lead configurations paired with time-series signals for ECG digitization, (2) ECG images annotated with YOLO-format bounding boxes for detection of lead region and lead name, (3)-(4) cropped single-lead images with segmentation masks compatible with U-Net-based models in normal and overlapping versions. In the overlapping case, waveforms from neighboring leads are superimposed onto the target lead image, while the segmentation masks remain clean. The open-source Python framework and datasets are publicly available at https://github.com/rezakarbasi/ecg-image-and-signal-dataset and https://doi.org/10.5281/zenodo.15484519, respectively.
Editorial analysis
A structured set of objections, weighed in public.
Referee Report
Summary. The manuscript introduces an open-source Python framework that converts PTB-XL ECG signals into synthetic image datasets. It produces four public datasets: (1) multi-lead ECG images paired with time-series signals for digitization, (2) images annotated with YOLO-format bounding boxes for lead-region and lead-name detection, and (3)–(4) cropped single-lead images supplied with pixel-level segmentation masks in both clean and overlapping-waveform versions. The framework and data are released at the cited GitHub and Zenodo links.
Significance. If the generated images prove sufficiently representative, the work supplies a valuable, openly available resource for training deep-learning models on ECG digitization, lead detection, and waveform segmentation—tasks for which large-scale annotated real-world image data remain scarce. The explicit support for overlapping-lead superposition and the provision of both code and data constitute clear strengths.
major comments (1)
- [Methods / Image Generation] Image-generation pipeline (Methods section): the rendering process does not simulate common real-world printing and scanning artifacts (variable grid-line intensity, paper texture, scanner noise, ink bleed, or geometric distortions). Because the central claim is that the released datasets will advance DL performance on authentic scanned ECGs, the absence of these factors is load-bearing and requires either explicit artifact modeling or a quantitative limitations discussion.
minor comments (2)
- [Abstract] Abstract: the phrase 'various lead configurations' is used without enumeration; a short parenthetical list of the configurations actually generated would improve immediate clarity.
- [Data Availability] Dataset release: confirm that the Zenodo DOI resolves to the exact version described in the text and that the GitHub repository contains a clear README with generation-parameter defaults.
Simulated Author's Rebuttal
We thank the referee for the constructive feedback on our manuscript. We address the single major comment below and outline the revisions we will make.
read point-by-point responses
-
Referee: [Methods / Image Generation] Image-generation pipeline (Methods section): the rendering process does not simulate common real-world printing and scanning artifacts (variable grid-line intensity, paper texture, scanner noise, ink bleed, or geometric distortions). Because the central claim is that the released datasets will advance DL performance on authentic scanned ECGs, the absence of these factors is load-bearing and requires either explicit artifact modeling or a quantitative limitations discussion.
Authors: We agree that the current rendering process generates clean synthetic ECG images from PTB-XL signals and does not incorporate common real-world artifacts such as variable grid-line intensity, paper texture, scanner noise, ink bleed, or geometric distortions. This choice was made to establish a controlled, reproducible baseline for the supported tasks. To directly address the concern, we will revise the manuscript to include a dedicated limitations discussion (in the Methods or a new Limitations subsection) that quantitatively describes the potential impact of these omitted factors on downstream model performance when applied to scanned ECGs. The discussion will also outline concrete extensions to the open-source framework for future artifact modeling. revision: yes
Circularity Check
No circularity: direct engineering contribution with external data
full rationale
The paper introduces a Python framework that renders synthetic ECG images from the external PTB-XL signal dataset using standard signal-to-image conversion and optional superposition. No derivations, equations, predictions, or first-principles results are claimed. The work contains no self-referential fitting, self-citation load-bearing premises, or uniqueness theorems. All outputs are generated from independent input signals and publicly documented rendering steps, rendering the contribution self-contained without any reduction to its own fitted values or prior author results.
Axiom & Free-Parameter Ledger
axioms (1)
- domain assumption PTB-XL provides representative ECG signals suitable for synthetic image generation
Reference graph
Works this paper leans on
-
[1]
Y . Birnbaum, K. Nikus, P. Kligfield, M. Fiol, J. A. Barrab ´es, A. Sionis, O. Pahlm, J. G. Niebla, and A. B. de Luna, “The role of the ecg in diagnosis, risk estimation, and catheterization laboratory activation in patients with acute coronary syndromes: a consensus document,” Annals of Noninvasive Electrocardiology, vol. 19, no. 5, pp. 412–425, 2014
work page 2014
-
[2]
D. A. Adedinsewo, H. Siddiqui, P. W. Johnson, E. J. Douglass, M. Cohen-Shelly, Z. I. Attia, P. Friedman, P. A. Noseworthy, and R. E. Carter, “Digitizing paper based ecg files to foster deep learning based analysis of existing clinical datasets: An exploratory analysis,” Intelligence-Based Medicine, vol. 6, p. 100070, 2022
work page 2022
-
[3]
M. A. Reyna, J. Weigle, Z. Koscova, K. Campbell, K. K. Shivashankara, S. Saghafi, S. Nikookar, M. Motie-Shirazi, Y . Kiarashi, S. Seyedi, et al. , “Ecg-image-database: A dataset of ecg images with real-world imaging and scanning artifacts; a foundation for computerized ecg image digitization and analysis,” arXiv preprint arXiv:2409.16612 , 2024
-
[4]
Automatic digitization of paper electrocardiograms–a systematic re- view,
A. Lence, F. Extramiana, A. Fall, J.-E. Salem, J.-D. Zucker, and E. Prifti, “Automatic digitization of paper electrocardiograms–a systematic re- view,” Journal of Electrocardiology, vol. 80, pp. 125–132, 2023
work page 2023
-
[5]
K. K. Shivashankara, A. M. Shervedani, G. D. Clifford, M. A. Reyna, R. Sameni, et al., “Ecg-image-kit: a synthetic image generation toolbox to facilitate deep learning-based electrocardiogram digitization,” Physi- ological measurement, vol. 45, no. 5, p. 055019, 2024
work page 2024
-
[6]
A. Iring, V . Kre ˇsˇn´akov´a, M. Hojcka, V . Boza, A. Rafajdus, and B. Vavrik, “Pmcardio ecg image database (pm-ecg-id): A diverse ecg database for evaluating digitization solutions,” aug 2024
work page 2024
-
[7]
IA, “Ecg dataset.” https://universe.roboflow.com/ia-q0vuc/ecg-ijg1u, may 2023. visited on 2025-05-19
work page 2023
-
[8]
enetcom, “Ecg lead detection dataset.” https://universe.roboflow.com/ enetcom-sfidt/ecg-lead-detection, aug 2023. visited on 2025-05-18
work page 2023
-
[9]
ECGArtivatic, “Ecg final dataset.” https://universe.roboflow.com/ ecgartivatic/ecg final 2, dec 2021. visited on 2025-05-19
work page 2021
-
[10]
U-net: Convolutional networks for biomedical image segmentation,
O. Ronneberger, P. Fischer, and T. Brox, “U-net: Convolutional networks for biomedical image segmentation,” in Medical image computing and computer-assisted intervention–MICCAI 2015: 18th international con- ference, Munich, Germany, October 5-9, 2015, proceedings, part III 18 , pp. 234–241, Springer, 2015
work page 2015
-
[11]
Deep learning for digitizing highly noisy paper-based ecg records,
Y . Li, Q. Qu, M. Wang, L. Yu, J. Wang, L. Shen, and K. He, “Deep learning for digitizing highly noisy paper-based ecg records,” Computers in biology and medicine , vol. 127, p. 104077, 2020
work page 2020
-
[12]
High precision ecg digitization using artificial intelligence,
A. Demolder, V . Kresnakova, M. Hojcka, V . Boza, A. Iring, A. Rafajdus, S. Rovder, T. Palus, M. Herman, F. Bauer, et al. , “High precision ecg digitization using artificial intelligence,” Journal of Electrocardiology , vol. 90, p. 153900, 2025
work page 2025
-
[13]
A fully-automated paper ecg digitisation algorithm using deep learning,
H. Wu, K. H. K. Patel, X. Li, B. Zhang, C. Galazis, N. Bajaj, A. Sau, X. Shi, L. Sun, Y . Tao, et al., “A fully-automated paper ecg digitisation algorithm using deep learning,” Scientific Reports , vol. 12, no. 1, p. 20963, 2022
work page 2022
-
[14]
P. Laguna, R. G. Mark, A. Goldberg, and G. B. Moody, “A database for evaluation of algorithms for measurement of qt and other waveform intervals in the ecg,” in Computers in cardiology 1997 , pp. 673–676, IEEE, 1997
work page 1997
-
[15]
Ptb-image: A scanned paper ecg dataset for digitization and image-based diagnosis,
C. V . Nguyen, H. X. Nguyen, D. D. P. Minh, and C. D. Do, “Ptb-image: A scanned paper ecg dataset for digitization and image-based diagnosis,” ArXiv, vol. abs/2502.14909, 2025
-
[16]
Nutzung der ekg- signaldatenbank cardiodat der ptb ¨uber das internet,
R. Bousseljot, D. Kreiseler, and A. Schnabel, “Nutzung der ekg- signaldatenbank cardiodat der ptb ¨uber das internet,” Biomedizinische Technik, 1995
work page 1995
-
[17]
R. Karbasi, M. Rahimi, and A. hossein Vahabie, “Multiple synthetic ecg image datasets for digitization, lead region and lead name detection, and signal segmentation,” May 2025
work page 2025
-
[18]
Ptb-xl, a large publicly available electro- cardiography dataset,
P. Wagner, N. Strodthoff, R.-D. Bousseljot, D. Kreiseler, F. I. Lunze, W. Samek, and T. Schaeffter, “Ptb-xl, a large publicly available electro- cardiography dataset,” Scientific data, vol. 7, no. 1, pp. 1–15, 2020
work page 2020
discussion (0)
Sign in with ORCID, Apple, or X to comment. Anyone can read and Pith papers without signing in.