SynthECG: Python Framework and ECG Image Datasets for Digitization, Lead Detection, and Waveform Segmentation.

IF 1.8 Q4 ENGINEERING, BIOMEDICAL
Journal of Medical Signals & Sensors Pub Date : 2026-03-30 eCollection Date: 2026-01-01 DOI:10.4103/jmss.jmss_58_25
Masoud Rahimi, Reza Karbasi, Abdol-Hossein Vahabie
{"title":"SynthECG: Python Framework and ECG Image Datasets for Digitization, Lead Detection, and Waveform Segmentation.","authors":"Masoud Rahimi, Reza Karbasi, Abdol-Hossein Vahabie","doi":"10.4103/jmss.jmss_58_25","DOIUrl":null,"url":null,"abstract":"<p><strong>Background: </strong>Digitizing electrocardiogram (ECG) images into structured time-series data is critical for clinical analysis, but it remains challenging due to the lack of standardized datasets, especially under realistic scenarios like overlapping waveforms.</p><p><strong>Methods: </strong>We introduce SynthECG, an open-source Python framework to generate four synthetic ECG datasets tailored for deep learning tasks, including ECG digitization, YOLO-based lead and lead name detection, and U-Net-based waveform segmentation. The framework supports customizable parameters (e.g., dataset size, lead layout, and visual style) and allows generating up to 21,799 images for multi-lead datasets and 261,588 for single-lead segmentation. Notably, it introduces a novel mechanism to simulate overlapping waveforms from adjacent leads while preserving clean segmentation masks.</p><p><strong>Results: </strong>Using our framework, we generated four open-access datasets: (1) 2000 ECG images in various lead configurations paired with time-series signals for ECG digitization, (2) 2000 ECG images in various lead configurations with YOLO-format annotations for detecting lead regions and lead names, (3) 20,000 cropped single-lead images with pixel-level segmentation masks (normal variant), and (4) 102 cropped single-lead images with overlapping waveforms from adjacent leads (overlapping variant). We validated these datasets through two case studies: digitization using a non-ML algorithm (mean squared error: 0.002, ρ: 0.93, signal-to-noise ratio [SNR]: 7.36 dB, SNR<sub>med</sub>: 37.86 dB) and lead/name detection using YOLOv8.</p><p><strong>Conclusions: </strong>Our open-source framework enables the generation of large-scale, customizable ECG image datasets to support key deep learning-based tasks, including digitization under normal and overlapping conditions, as well as lead region and lead name detection. The full datasets and code are publicly available at: https://doi.org/10.5281/zenodo.15484519 and https://github.com/rezakarbasi/ecg-image-and-signal-dataset.</p>","PeriodicalId":37680,"journal":{"name":"Journal of Medical Signals & Sensors","volume":"16 ","pages":"8"},"PeriodicalIF":1.8000,"publicationDate":"2026-03-30","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"https://www.ncbi.nlm.nih.gov/pmc/articles/PMC13152245/pdf/","citationCount":"0","resultStr":null,"platform":"Semanticscholar","paperid":null,"PeriodicalName":"Journal of Medical Signals & Sensors","FirstCategoryId":"1085","ListUrlMain":"https://doi.org/10.4103/jmss.jmss_58_25","RegionNum":0,"RegionCategory":null,"ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":null,"EPubDate":"2026/1/1 0:00:00","PubModel":"eCollection","JCR":"Q4","JCRName":"ENGINEERING, BIOMEDICAL","Score":null,"Total":0}
引用次数: 0

Abstract

Background: Digitizing electrocardiogram (ECG) images into structured time-series data is critical for clinical analysis, but it remains challenging due to the lack of standardized datasets, especially under realistic scenarios like overlapping waveforms.

Methods: We introduce SynthECG, an open-source Python framework to generate four synthetic ECG datasets tailored for deep learning tasks, including ECG digitization, YOLO-based lead and lead name detection, and U-Net-based waveform segmentation. The framework supports customizable parameters (e.g., dataset size, lead layout, and visual style) and allows generating up to 21,799 images for multi-lead datasets and 261,588 for single-lead segmentation. Notably, it introduces a novel mechanism to simulate overlapping waveforms from adjacent leads while preserving clean segmentation masks.

Results: Using our framework, we generated four open-access datasets: (1) 2000 ECG images in various lead configurations paired with time-series signals for ECG digitization, (2) 2000 ECG images in various lead configurations with YOLO-format annotations for detecting lead regions and lead names, (3) 20,000 cropped single-lead images with pixel-level segmentation masks (normal variant), and (4) 102 cropped single-lead images with overlapping waveforms from adjacent leads (overlapping variant). We validated these datasets through two case studies: digitization using a non-ML algorithm (mean squared error: 0.002, ρ: 0.93, signal-to-noise ratio [SNR]: 7.36 dB, SNRmed: 37.86 dB) and lead/name detection using YOLOv8.

Conclusions: Our open-source framework enables the generation of large-scale, customizable ECG image datasets to support key deep learning-based tasks, including digitization under normal and overlapping conditions, as well as lead region and lead name detection. The full datasets and code are publicly available at: https://doi.org/10.5281/zenodo.15484519 and https://github.com/rezakarbasi/ecg-image-and-signal-dataset.

SynthECG: Python框架和ECG图像数据集的数字化,引线检测,和波形分割。
背景:将心电图(ECG)图像数字化为结构化时间序列数据对于临床分析至关重要,但由于缺乏标准化的数据集,特别是在波形重叠等现实情况下,这仍然具有挑战性。方法:引入开源Python框架SynthECG,生成四种适合深度学习任务的合成心电数据集,包括心电数字化、基于yolo的导联和导联名称检测以及基于u - net的波形分割。该框架支持可定制的参数(例如,数据集大小,引线布局和视觉风格),并允许为多引线数据集生成多达21,799张图像,为单引线分割生成多达261,588张图像。值得注意的是,它引入了一种新的机制来模拟相邻引线的重叠波形,同时保持干净的分割掩模。结果:利用我们的框架,我们生成了四个开放访问的数据集:(1)2000张不同导联配置的心电图像与时间序列信号配对,用于心电数字化;(2)2000张不同导联配置的心电图像,带有yolo格式的注释,用于检测导联区域和导联名称;(3)20000张裁剪的单导联图像,带有像素级分割掩码(正常变体);(4)102张裁剪的单导联图像,带有相邻导联的重叠波形(重叠变体)。我们通过两个案例研究验证了这些数据集:使用非ml算法进行数字化(均方误差:0.002,ρ: 0.93,信噪比[SNR]: 7.36 dB, SNRmed: 37.86 dB)和使用YOLOv8进行引线/名称检测。结论:我们的开源框架能够生成大规模、可定制的心电图像数据集,以支持关键的基于深度学习的任务,包括正常和重叠条件下的数字化,以及导联区域和导联名称检测。完整的数据集和代码可以在https://doi.org/10.5281/zenodo.15484519和https://github.com/rezakarbasi/ecg-image-and-signal-dataset上公开获得。
本文章由计算机程序翻译,如有差异,请以英文原文为准。
求助全文
约1分钟内获得全文 求助全文
来源期刊
Journal of Medical Signals & Sensors
Journal of Medical Signals & Sensors ENGINEERING, BIOMEDICAL-
CiteScore
2.30
自引率
0.00%
发文量
53
审稿时长
33 weeks
期刊介绍: JMSS is an interdisciplinary journal that incorporates all aspects of the biomedical engineering including bioelectrics, bioinformatics, medical physics, health technology assessment, etc. Subject areas covered by the journal include: - Bioelectric: Bioinstruments Biosensors Modeling Biomedical signal processing Medical image analysis and processing Medical imaging devices Control of biological systems Neuromuscular systems Cognitive sciences Telemedicine Robotic Medical ultrasonography Bioelectromagnetics Electrophysiology Cell tracking - Bioinformatics and medical informatics: Analysis of biological data Data mining Stochastic modeling Computational genomics Artificial intelligence & fuzzy Applications Medical softwares Bioalgorithms Electronic health - Biophysics and medical physics: Computed tomography Radiation therapy Laser therapy - Education in biomedical engineering - Health technology assessment - Standard in biomedical engineering.
×
引用
GB/T 7714-2015
复制
MLA
复制
APA
复制
导出至
BibTeX EndNote RefMan NoteFirst NoteExpress
×
提示
您的信息不完整,为了账户安全,请先补充。
现在去补充
×
提示
您因"违规操作"
具体请查看互助需知
我知道了
×
提示
确定
请完成安全验证×
copy
已复制链接
快去分享给好友吧!
我知道了
右上角分享
点击右上角分享
0
联系我们:info@booksci.cn Book学术提供免费学术资源搜索服务,方便国内外学者检索中英文文献。致力于提供最便捷和优质的服务体验。 Copyright © 2023 布克学术 All rights reserved.
京ICP备2023020795号-1
ghs 京公网安备 11010802042870号
Book学术文献互助
Book学术文献互助群
群 号:604180095
Book学术官方微信
小红书