DeRC_ECG: Joint UNet-Resnet framework for automated reconstruction and classification of noisy paper-based ECGs

Weijie Sun1 and Siqi Cao2
1University of Alberta, 2Johns Hopkins University


Abstract

We present a deep learning framework designed to enhance analysis of paper-based electrocardiograms (ECG) by addressing challenges of signal noise in the images, for improved cardiovascular diagnostics. Our approach consists of three distinct yet interconnected modules namely, denoising, reconstruction and classification - "DeRC" (Figure x). The classification module integrates a UNet algorithm with a ResNet based deep convolutional neural network (He et al. (2015)). First, the UNet algorithm , adapted from Li et al. (2020) trained with dice and focal loss function, segments the ECG traces from noisy images. Subsequently, the ResNet-50 network, pretrained with an augmented set of training images using cross-entropy loss to handle class imbalance, classifies denoised ECGs into normal and abnormal categories. . The reconstruction module utilizes image and signal processing techniques on denoised images to output digitized ECG signals. Edge detection and line intensity scanning is used to detect bounding boxes for ECG leads. Each ECG image is then sliced into four equal length columns, and each column is scanned from bottom to top to detect intensity peak duration for each ECG lead. Digital sequences are then extracted from bounding boxes, concatenated, and repeated to generate a 10-second waveform (Fortune et al, 2022). For evaluation of model performance, a 5-fold cross-validation (CV) strategy was applied on a dataset comprising 5,000 synthetic noisy ECG images. The classification module achieved CV performance of macro F-measure of 0.77 士 0.04 , and the reconstruction module revealed single train-test split Signal-to-Noise Ratio (SNR) of -15.09. The integration of UNet denoising with ResNet classification sets DeRC apart as a state-of-the-art solution for ECG image processing. Future enhancements are planned to refine DeRC's ability to handle rotated images, along with the implementation of other deep learning methods, such as Vision Transformer (ViT), to further improve performance.