Digitizing Paper ECGs at Scale: An Open-Source Algorithm for Clinical Research

Elias Stenhede, Agnar Martin Bjørnstad, Arian Ranjbar · 2025

Read Digitizing Paper ECGs at Scale: An Open-Source Algorithm for Clinical Research by Elias Stenhede, Agnar Martin Bjørnstad, Arian Ranjbar (2025) in the Tower of Babel, a free online library of public-domain works preserved in clean, searchable text. No sign-up. The full text is served as a plain-text file at a predictable URL, where text is present: https://antarctic-labs.com/tower-of-babel/arxiv-2510-19590.txt.

Introduction

Elias Stenhede, Agnar Martin Bjørnstad, and Arian Ranjbar built an open-source system that converts paper electrocardiograms into digital signals. Millions of clinical ECGs survive only as paper scans or photographs, locked away from modern automated analysis. Their fully automated framework handles the artifacts typical of scanned tracings.

Validation covered more than thirty-seven thousand ECG images, including a hospital collection from Akershus University Hospital in Norway, plus a large public dataset with wrinkled, stained, and distorted pages. The method reached a strong signal-to-noise ratio on scanned papers and beat the previous state of the art in every subcategory of the public set. The team hopes the tool opens old ECG archives to research and AI-based diagnostics.

Catalog record

CREATORElias Stenhede, Agnar Martin Bjørnstad, Arian Ranjbar
YEAR2025
COLLECTIONPAPERS
FORMATTXT
FILE SIZE40 KB
VERSION1.0
LICENSEhttp://creativecommons.org/licenses/by/4.0/
RIGHTSCC BY
SOURCEarXiv

Source: https://arxiv.org/abs/2510-19590

Browse the full library · About the Tower of Babel

Full text

The opening of the work, from the library's hosted text:

Digitizing Paper ECGs at Scale: An Open-Source Algorithm for Clinical Research Elias Stenhede, Agnar Martin Bjørnstad, Arian Ranjbar Abstract Millions of clinical ECGs exist only as paper scans, making them unusable for modern automated diagnostics. We introduce a fully automated, modular framework that converts scanned or photographed ECGs into digital signals, suitable for both clinical and research applications. The framework is validated on 37,191 ECG images with 1,596 collected at Akershus University Hospital, where the algorithm obtains a mean signal-to-noise ratio of 19.65 dB on scanned papers with common artifacts. It is further evaluated on the Emory Paper Digitization ECG Dataset, comprising 35,595 images, including images with perspective distortion, wrinkles, and stains. The model improves on the state-of-the-art in all subcategories. The full software is released as open-source, promoting reproducibility and further development. We hope the software will contribute to unlocking retrospective ECG archives and democratize access to AI-driven diagnostics. Cardiovascular disease remains the leading cause of death globally, underscoring the importance of effective diagnostic tools [ 1 ] . Among these, the ECG is the most widely used, primarily due to its ease of use, non-invasiveness, low operator variability, and cost-effectiveness. Traditionally, ECG recordings have been acquired using analog instruments that produce printed signals on paper strips, subsequently analyzed by clinicians and archived in patient medical records. Despite technological advances, this practice persists today due to the familiarity for clinicians, convenience, and ease of interpretation. With the widespread adoption of electronic health records, these paper ECGs are now often scanned to be stored as images within the patient database. Advancements in AI, particularly with the advent of deep learning during the last decade, have significantly improved computer-assisted analysis of ECGs [ 2 , 3 ] , even surpassing human diagnostic performance [ 4 , 5 ] . State-of-the-art algorithms primarily utilize ECG data in standardized time series formats to perform both diagnostic classification [ 6 , 7 , 8 ] , and risk stratification [ 9 ] . Furthermore, beyond typical cardiovascular assessment, similar ECG-based AI models have shown potential in e.g., identifying demographic characteristics [ 10 ] . While the healthcare sector is gradually adopting digital storage of original ECG signals, many hospitals and healthcare providers continue to rely on scanned paper records. Although AI models can analyze scanned ECG images, their performance and reliability significantly improve when standardized digital time-series data are available, mitigating complications arising from variations in channel configurations and scanning artifacts. Developing a robust and efficient tool to digitize paper ECG records accurately offers two critical advantages. First, it democratizes access to AI-driven ECG interpretation tools, making advanced diagnostic capabilities available regardless of digital infrastructure. Second, digitizing historical ECG archives substantially expands the volume of available data for training AI models, potentially by several orders of magnitude. This enhancement is particularly valuable in studying rare cardiovascular conditions, where extensive historical datasets can significantly increase sample sizes. V1 V2 V3 V4 V5 V6 Figure 1 : Shows the digitization pipeline for a paper ECG captured using a mobile phone. Top left: Mobile phone photo of a printed ECG. Top right: Segmented image showing detected ECG waveform and grid structure. Bottom left: Perspective-corrected and cropped ECG aligned. Bottom right: Final extracted waveforms in standardized format for archiving and downstream processing. Related work Over the past two decades, several semi-automatic methods have been proposed to address the challenge of ECG digitization, including Badilini et al., Ravichandran et al., and Baydoun et al., who in the period between 2005 and 2019 introduced MATLAB-based solutions [ 11 , 12 , 13 ] , all requiring some degree of user input. In 2021, Mishra et al. proposed an algorithm [ 14 ] for crops of single leads. By 2021, Fortune et al. provided an openly available Python implementation of their semi-automatic method [ 15 ] . In the last few years, efforts have been directed towards fully automated methods. In 2022, Wu et al. proposed a method including an accessible API for digitization tasks [ 16 ] . We were, however, not successful in digitizing any images from our database using the API. To accelerate the development of a general automated ECG digitization algorithm, the annual George B. Moody PhysioNet Challenge announced that the 2024 competition would be dedicated to the topic. This resulted in 17 distinct methods from the competing research groups, which were evaluated on a hidden test dataset consisting of scans and photographs of ECGs in varying conditions, including clean, strained, and significantly deteriorated samples. Performance was assessed quantitatively with the ground truth reference [ 17 ] . Among the methods, three demonstrated superior performance compared to a naive baseline of assigning zero values to all signal points [ 18 , 19 , 20 ] . Nevertheless, despite surpassing the baseline, none showed robust results on photos, and the source code is not available at the time of writing. In 2025, Demolder et al. introduced an ECG digitization method and released an evaluation dataset comprising 6,000 ECG images [ 21 ] derived from 100 ECGs. A commendable aspect of their work is the physical realism introduced by printing and photographing ECGs, mimicking real-world digitization scenarios. It does not, however, capture common degradations of handwritten notes by clinicians or variations introduced by printing on thermal paper, and the source code is not shared. In summary, previous methods have been constrained by one or more of: (1) lack of automation or accuracy, (2) insufficient validation across realistic datasets, and (3) the absence of open-source code. To address these issues, we propose a new modular open-source framework for a general-purpose ECG digitization algorithm, capable of digitizing both scans and photos, validated on both publicly available datasets and real-world data. In short, our contributions include: • A fully automated modular framework for general-purpose ECG digitization consisting of five modules: Perspective correction and cropping, Segmentation, Layout identification, Grid size extraction/scaling, and 2D to 1D conversion; publicly released as open source. • Methodological and algorithmic advances, including dewarping, alignment, and signal extraction methods. We also release a training dataset of 8,658 simulated high-resolution ECG images with labels for segmentation and ground-truth signals, enabling reproducibility and further development. • A real-world clinical dataset collected at Akershus University Hospital, containing 1,596 samples of photographed and scanned paper ECGs, provided together with the raw time series data. • Extensive validation of the proposed framework on real-world datasets. iPhone SNR [dB] - 10 0 10 20 30 Scanner SNR [dB] OnePlus SNR [dB] - 10 0 10 20 30 Scanner SNR [dB] - 10 0 10 20 30 OnePlus SNR [dB] - 10 0 10 20 30 iPhone SNR [dB] (a) Pairwise scatter plot of SNR per lead, for images captured with the three different devices. 150 300 450 Scanner Signal-to-Noise Ratio Median 150 300 450 Root Mean Square Error 600 1200 1800 Correlation 150 300 450 OnePlus 150 300 450 150 300 450 - 10 0 10 20 30 SNR [dB] 150 300 450 iPhone 10 100 1000 RMSE [ \mu V ] 150 300 450 0.75 0.80 0.85 0.90 0.95 1.00 Correlation 150 300 450 (b) Distribution of signal quality metrics for ECG recordings captured using three devices (Scanner, iPhone, OnePlus). Using the scanner results

Read the complete text