Skip to main page content
U.S. flag

An official website of the United States government

Dot gov

The .gov means it’s official.
Federal government websites often end in .gov or .mil. Before sharing sensitive information, make sure you’re on a federal government site.

Https

The site is secure.
The https:// ensures that you are connecting to the official website and that any information you provide is encrypted and transmitted securely.

Access keys NCBI Homepage MyNCBI Homepage Main Content Main Navigation
. 2022 Dec 5;12(1):20963.
doi: 10.1038/s41598-022-25284-1.

A fully-automated paper ECG digitisation algorithm using deep learning

Affiliations

A fully-automated paper ECG digitisation algorithm using deep learning

Huiyi Wu et al. Sci Rep. .

Abstract

There is increasing focus on applying deep learning methods to electrocardiograms (ECGs), with recent studies showing that neural networks (NNs) can predict future heart failure or atrial fibrillation from the ECG alone. However, large numbers of ECGs are needed to train NNs, and many ECGs are currently only in paper format, which are not suitable for NN training. We developed a fully-automated online ECG digitisation tool to convert scanned paper ECGs into digital signals. Using automated horizontal and vertical anchor point detection, the algorithm automatically segments the ECG image into separate images for the 12 leads and a dynamical morphological algorithm is then applied to extract the signal of interest. We then validated the performance of the algorithm on 515 digital ECGs, of which 45 were printed, scanned and redigitised. The automated digitisation tool achieved 99.0% correlation between the digitised signals and the ground truth ECG (n = 515 standard 3-by-4 ECGs) after excluding ECGs with overlap of lead signals. Without exclusion, the performance of average correlation was from 90 to 97% across the leads on all 3-by-4 ECGs. There was a 97% correlation for 12-by-1 and 3-by-1 ECG formats after excluding ECGs with overlap of lead signals. Without exclusion, the average correlation of some leads in 12-by-1 ECGs was 60-70% and the average correlation of 3-by-1 ECGs achieved 80-90%. ECGs that were printed, scanned, and redigitised, our tool achieved 96% correlation with the original signals. We have developed and validated a fully-automated, user-friendly, online ECG digitisation tool. Unlike other available tools, this does not require any manual segmentation of ECG signals. Our tool can facilitate the rapid and automated digitisation of large repositories of paper ECGs to allow them to be used for deep learning projects.

PubMed Disclaimer

Conflict of interest statement

The authors declare no competing interests.

Figures

Figure 1
Figure 1
Overview of the automated ECG digitisation algorithm: Step I: The 12-lead ECG image is pre-processed to remove redacted portions of the ECG and the ECG grid. The ECG baselines are then determined to obtain the ECG configuration, aided by vertical anchor points. Step II: After determining horizontal and vertical anchor points and lead configuration, the 12-lead signals are cropped. Step III: ECG signal extraction from the single lead ECG images. Step IV: User interface design using dashboard tool.
Figure 2
Figure 2
Cropping of individual ECG signal images for each lead: (A) The original 12-lead ECG scan with patient identifiable information redacted; (B) Baseline detection is used to determine the vertical distance between leads; (C) Lead name detection are used to determine the horizontal distance between leads; (D) Cropping to obtain each lead’s ECG signal. The width of the crop is the distance from end point of the lead name to the starting point of the adjacent lead name, while the height of the crop is 1.4 times of the vertical distance with the detected baseline in the middle.
Figure 3
Figure 3
The cleaning process of a cropped ECG image. Following the cropping of the region of interest, a dilation process connects the possible breaking points horizontally to obtaining the full ECG signal. Thereafter, the labelling process identifies the largest object as the signal of interest. Finally, artefacts within the cropped image are removed to retain the signal of interest.
Figure 4
Figure 4
Validation of ECG digitisation tool. Text in red boxes represents input data. Digitised signals generated by our digitisation tool are indicated in blue dashed boxes (A) Validation 1 and 2: comparison of digitised ECG traces with ground truth digital signals; (B) Validation 3: comparison of digitised ECG traces from digital ECGs that were printed, scanned and re-digitised, with ground truth digital signals.
Figure 5
Figure 5
Digitisation results and ground truth comparison: ground truth original digital ECG signals (left) and digitised signals from images (centre) shown together with the overlay of both traces (right), for multiple ECG configurations. Ground truth signal is shown as red and digitised signal is shown as blue, the overlay of comparison plot shows two coloured signals overlapped. The overlay shows excellent correlation between the ground truth and digitised signals.

Similar articles

Cited by

References

    1. Tuncer T, Dogan S, Plawiak P, Subasi A. A novel discrete wavelet-concatenated mesh tree and ternary chess pattern based ECG signal recognition method. Biomed. Signal Process. Control. 2022;72:103331. doi: 10.1016/j.bspc.2021.103331. - DOI
    1. Tuncer T, Dogan S, Pławiak P, Acharya UR. Automated arrhythmia detection using novel hexadecimal local pattern and multilevel wavelet transform with ECG signals. Knowl. Based Syst. 2019;186:104923. doi: 10.1016/j.knosys.2019.104923. - DOI
    1. Subasi A, Dogan S, Tuncer T. A novel automated tower graph based ECG signal classification method with hexadecimal local adaptive binary pattern and deep learning. J. Ambient Intell. Human. Comput. 2021 doi: 10.1007/s12652-021-03324-4. - DOI
    1. Baygin M, Tuncer T, Dogan S, Tan R-S, Acharya UR. Automated arrhythmia detection with homeomorphically irreducible tree technique using more than 10,000 individual subject ECG records. Inf. Sci. 2021;575:323–337. doi: 10.1016/j.ins.2021.06.022. - DOI
    1. Kobat MA, Karaca O, Barua PD, Dogan S. Prismatoidpatnet54: an accurate ECG signal classification model using prismatoid pattern-based learning architecture. Symmetry. 2021;13:1914. doi: 10.3390/sym13101914. - DOI

Publication types