An Open-Source Python Framework and Synthetic ECG Image Datasets for Digitization, Lead and Lead Name Detection, and Overlapping Signal Segmentation

Masoud Rahimi, Reza Karbasi, Abdol-Hossein Vahabie
5/26/2025
eess.SPcs.CVcs.LG

Official code: rezakarbasi/ecg-image-and-signal-dataset (12 stars, last commit 2026-04-21).

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.

View on arXivView PDF

Code Implementations(1)

A public ECG dataset featuring raw ECG images, per-lead segmentations, and digitized signals (PNG, BMP & JSON) for lead detection and separation.

123PythonMay 12, 20256 months ago

Similar Papers

Cite this paper

@article{rahimi2025opensource,
  title  = {An Open-Source Python Framework and Synthetic ECG Image Datasets for Digitization, Lead and Lead Name Detection, and Overlapping Signal Segmentation},
  author = {Masoud Rahimi and Reza Karbasi and Abdol-Hossein Vahabie},
  year   = {2025},
  eprint = {2506.06315},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2506.06315v1}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2506.06315.svg)](https://codeofpaper.com/paper/2506.06315)

Discussion