pith. sign in

arxiv: 2506.06315 · v1 · submitted 2025-05-26 · 📡 eess.SP · cs.CV· cs.LG

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

classification 📡 eess.SP cs.CVcs.LG
keywords ECG digitizationsynthetic ECG imageslead detectionwaveform segmentationoverlapping signalsdeep learningPTB-XLopen-source framework
0
0 comments X

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.

The paper introduces a Python framework that converts existing ECG time-series signals into image format while automatically adding the labels needed for three separate computer vision tasks. It releases four ready-to-use datasets: full multi-lead images paired with their original signals, images marked with bounding boxes for lead regions and names, and single-lead crops with clean pixel masks in both standard and overlapping-signal versions. A reader would care because real annotated ECG printouts are hard to obtain at scale, so this method supplies large volumes of training material without manual labeling. The overlapping version keeps the masks accurate even when waveforms from adjacent leads are drawn on top of each other.

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

Figures reproduced from arXiv: 2506.06315 by Abdol-Hossein Vahabie, Masoud Rahimi, Reza Karbasi.

Figure 1
Figure 1. Figure 1: File structure of the ECG dataset release. [PITH_FULL_IMAGE:figures/full_fig_p002_1.png] view at source ↗
Figure 2
Figure 2. Figure 2: Sample of ECG images in various lead layout configurations. [PITH_FULL_IMAGE:figures/full_fig_p003_2.png] view at source ↗
Figure 5
Figure 5. Figure 5: Top—Single-lead ECG image with its corresponding mask shown [PITH_FULL_IMAGE:figures/full_fig_p004_5.png] view at source ↗
Figure 3
Figure 3. Figure 3: Detection dataset samples: ECG images annotated with bounding [PITH_FULL_IMAGE:figures/full_fig_p004_3.png] view at source ↗
Figure 4
Figure 4. Figure 4: Illustration of the YOLO bounding box format, which includes the [PITH_FULL_IMAGE:figures/full_fig_p004_4.png] view at source ↗
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.

Desk editor's note, referee report, simulated authors' rebuttal, and a circularity audit. Tearing a paper down is the easy half of reading it; the pith above is the substance, this is the friction.

Referee Report

1 major / 2 minor

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)
  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)
  1. [Abstract] Abstract: the phrase 'various lead configurations' is used without enumeration; a short parenthetical list of the configurations actually generated would improve immediate clarity.
  2. [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

1 responses · 0 unresolved

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
  1. 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

0 steps flagged

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

0 free parameters · 1 axioms · 0 invented entities

The contribution rests primarily on the existing PTB-XL dataset and standard image synthesis techniques rather than new axioms or fitted parameters.

axioms (1)
  • domain assumption PTB-XL provides representative ECG signals suitable for synthetic image generation
    The framework uses PTB-XL as the sole source for all generated datasets as described in the abstract.

pith-pipeline@v0.9.0 · 5722 in / 1189 out tokens · 39786 ms · 2026-05-19T12:18:18.909395+00:00 · methodology

discussion (0)

Sign in with ORCID, Apple, or X to comment. Anyone can read and Pith papers without signing in.

Reference graph

Works this paper leans on

18 extracted references · 18 canonical work pages

  1. [1]

    The role of the ecg in diagnosis, risk estimation, and catheterization laboratory activation in patients with acute coronary syndromes: a consensus document,

    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

  2. [2]

    Digitizing paper based ecg files to foster deep learning based analysis of existing clinical datasets: An exploratory analysis,

    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

  3. [3]

    Ecg-image-database: A dataset of ecg images with real-world imaging and scanning artifacts; a foundation for computerized ecg image digitization and analysis,

    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. [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

  5. [5]

    Ecg-image-kit: a synthetic image generation toolbox to facilitate deep learning-based electrocardiogram digitization,

    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

  6. [6]

    Pmcardio ecg image database (pm-ecg-id): A diverse ecg database for evaluating digitization solutions,

    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

  7. [7]

    Ecg dataset

    IA, “Ecg dataset.” https://universe.roboflow.com/ia-q0vuc/ecg-ijg1u, may 2023. visited on 2025-05-19

  8. [8]

    Ecg lead detection dataset

    enetcom, “Ecg lead detection dataset.” https://universe.roboflow.com/ enetcom-sfidt/ecg-lead-detection, aug 2023. visited on 2025-05-18

  9. [9]

    Ecg final dataset

    ECGArtivatic, “Ecg final dataset.” https://universe.roboflow.com/ ecgartivatic/ecg final 2, dec 2021. visited on 2025-05-19

  10. [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

  11. [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

  12. [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

  13. [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

  14. [14]

    A database for evaluation of algorithms for measurement of qt and other waveform intervals in the ecg,

    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

  15. [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. [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

  17. [17]

    Multiple synthetic ecg image datasets for digitization, lead region and lead name detection, and signal segmentation,

    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

  18. [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