A subscription to JoVE is required to view this content. Sign in or start your free trial.

Method Article

Automated 12-Lead Electrocardiograms (ECG) Digitization and WaveForm DataBase (WFDB) Standardization: Insights from Vietnamese Clinical Data

614 views

⸱

DOI:

10.3791/70359

⸱

March 13th, 2026

 ,  ,  , 

In This Article

Summary

Here, we present a reproducible protocol for converting 12-lead ECG images from real-world clinical reports into calibrated, WFDB-compliant digital signals for standardized downstream analysis, integrating grid calibration, YOLOv12-based lead localization, waveform extraction (Viterbi or improved centerline), and visual validation checkpoints.

Abstract

Many clinics still archive 12-lead electrocardiograms (ECGs) as printed paper records or raster images embedded in PDF reports, which limits interoperability and downstream computational analysis. Here, we present a reproducible digitization protocol that converts ECG report images into WaveForm DataBase (WFDB)-compliant digital signals for standardized downstream use. The protocol consists of (i) grid detection and pixel-to-physical calibration, (ii) automated localization and labeling of the 12 lead regions using an object detection model, (iii) signal preprocessing and normalization, and (iv) waveform extraction using either a continuity-constrained path method (Viterbi) or an improved centerline-based approach. The workflow is designed to handle heterogeneous clinical layouts, variable grid visibility, and common imaging artifacts, and includes visual checkpoints for quality control at each stage. The protocol outputs time-aligned 12-lead WFDB records suitable for reproducible analysis in signal processing and machine-learning pipelines.

Introduction

The 12-lead electrocardiogram (ECG) is a cornerstone of cardiovascular assessment and remains widely used for screening, monitoring, and clinical decision-making1. Despite ongoing digitization efforts, many institutions still store ECGs as printed paper records or rasterized images embedded in PDF reports, which reduces searchability and complicates longitudinal follow-up2. Importantly, image-based storage prevents direct use of standardized ECG toolkits and machine-learning pipelines that require calibrated time-series signals rather than images3. The overall goal of this protocol is to provide a....

Access restricted. Please log in or start a trial to view this content.

Protocol

Obtain Ethics Committee (Institutional Review Board) approval from Tam Duc Hospital (Protocol ID: 24751791) prior to retrospective data collection. De-identify all ECG reports before analysis by removing direct identifiers (e.g., patient name, medical record number, date of birth, and visit date) and replacing them with a non-identifying study ID. Use only de-identified ECG data for model development and evaluation.

1. Prepare materials, software, and inputs

  1. Clone the project repository and verify the directory structure, including baselines/, core_binary/, data/, evaluation/, outputs/, public/, results/, weight....

Access restricted. Please log in or start a trial to view this content.

Results

Input preparation
ECG reports were successfully converted from PDFs or scans into standardized, axis-aligned images suitable for downstream processing. For paper ECGs, scans were acquired at 300 dpi in grayscale and saved as PNG/TIFF to reduce compression artifacts. The most common input issues were (i) excessive compression from PDF exports, (ii) partial cropping that removed lead regions or labels, and (iii) perspective distortion in smartphone photographs. Records affected by cropping or severe di.......

Access restricted. Please log in or start a trial to view this content.

Discussion

This study presents an automated end-to-end pipeline that converts 12-lead ECG images from PDFs or scanned paper records into WFDB-compliant digital signals through grid calibration, YOLOv12-based lead localization, and waveform extraction using Viterbi path search or an improved centerline method1. The protocol includes validation checkpoints (bounding-box overlays, trace overlays, and WFDB reload plots) to support quality assurance during digitization.

Converting ECG .......

Access restricted. Please log in or start a trial to view this content.

Disclosures

The authors have no competing financial interests or personal relationships that could have appeared to influence the work reported in this article.

Acknowledgements

The authors thank Tam Duc Hospital for providing de-identified ECG reports and for institutional support during data collection.

....

Access restricted. Please log in or start a trial to view this content.

Materials

List of materials used in this article
NameCompanyCatalog NumberComments
GPU (runtime tests)NVIDIAGeForce RTX 3060 12 GBNVIDIA GeForce RTX 3060 12 GB used for runtime tests
NumPyNumPy1.26.4Numeric processing
OpenCVOpenCV4.10.0.84Image preprocessing (deskew, filtering)
Operating system(runtime tests)MicrosoftWindows 11Windows 11 used for runtime tests
PDF-to-image converterThis protocolV1PDF rasterization at 300 DPI; provide repository URL in Data Availability
PythonPython Software Foundation3.12.5Runtime environment
PyTorchPyTorch0.5.0Backend for YOLOv12
ScannerCanonDR-C240300 DPI, grayscale, PNG/TIFF recommended
scikit-imagescikit-image0.25.0Skeletonization and morphology (centerline)
UltralyticsUltralytics8.3.155YOLOv12 training/inference framework
wfdb (Python package)PhysioNet4.1.2WFDB export (.hea/.dat)

References

  1. Muhammet, A., Fani, D., Christos, A., Idris, Z., Gruschen, R. V. Digitization and Linkage of PDF Formatted 12-Lead Electrocardiograms in Adult Congenital Heart Disease. CJC Pediatric and Congenit Heart Dis. 4 (5), 263-273 (2025).
  2. Baydoun, M., et al.

Access restricted. Please log in or start a trial to view this content.

Reprints and Permissions

Explore More Articles

12-Lead ECGWaveform ExtractionSignal PreprocessingObject Detection ModelGrid DetectionSignal NormalizationQuality Control

This article has been published

Video Coming Soon