Dual Deep Learning System to Digitalize and Classify 12-Lead ECGs from Scanned Images

Chou ChunTi and Sergio González Vázquez
Inventec AIC


Abstract

Aims: Digital ECG has been very beneficial for data integration, ECG interpretation, and detection of cardiac diseases. However, despite its advantages, paper-based ECGs have remained common globally. Digitization and analysis of ECG papers can ensure comprehensive cardiac care across all demographics and regions.

Methods: As part of the PhysioNet/Computing in Cardiology Challenge 2024, our team, Inventec AIC, developed a dual deep-learning system to digitize and classify 12-lead ECGs from scanned images. Our approach comprises a computer vision algorithm and two deep-learning models based on residual Convolutional Neural Networks (CNN). Our preprocessing algorithm uses contour detection to capture the ECG region in the image, cropping out non-relevant information and fixing image rotations. Then, our digitization approach leverages a fine-tuned object detection algorithm (YOLOv7) to detect and crop the different ECG sequences, which are the input for the digitization task. Our digitization model is a residual-based CNN with non-square kernels that match the image proportion and a final pooling layer applied to the ECG voltage to keep the temporal resolution. In addition, we developed a ResNet-based model with three residual blocks to classify mid-high resolution 12-lead ECG images into normal or abnormal. In our cross-validation, we used 137,511 synthetic images with different distortions from 21,799 digital ECGs of the PTB-XL dataset. During training, only one distorted image per unique signal was randomly fed to the model at each epoch to promote model generalization.

Results: Our approach received scores of 0.0 and 0.69 (ranked 2nd and 7th) for digitization and classification tasks of the hidden validation set with the evaluation metrics defined by the challenge (Signal-to-Noise ratio and F-score). In our 5-fold cross-validation, our digitization approach reaches a score of 0.0202 and our classifier achieves a score of 0.8721.