Driving ECG digitization - Using Techniques from Autonomous Driving to Detect Regions of Interest in ECG Images

Philip Hempel1 and Nicolai Spicher2
1Department of Medical Informatics, University Medical Center Goettingen, 2Department of Medical Informatics, University Medical Center Goettingen, Germany


Abstract

Digitizing ECG images, i.e. the reconstruction of the signal waveforms from printouts or screens could make AI-based diagnosis a reality, especially in the global south. We, team RoadRuNNers, transfer algorithms borrowed from autonomous driving –originally designed for road lane detection– to detect the region of interest (ROI) in pixel based ECG images and take them as input for a CNN. Initially, we invert the grayscale of the ECG image using the OpenCV2 library, making the ECG lines appear white before a dark background, similar to a road lane. Subsequently, we adopt open source scripts that iteratively spot white lines and their orientation by randomly choosing thresholds for binarization, Gaussian blur kernel size, and Canny edge detection. The detected 4-6 ROIs are assumed to show ECG signals when they are in parallel and equidistant to each other and span at least half of the picture size. The ROIs serve as input for a CNN that processes 4 binary images to reconstruct 4x10 s of ECG signal since the morphological 12 leads of 4x2.5 s are treated as aggregated signal in the first three ROIs whereas the last ROI represent the entire rhythm strip of 10 s length. The CNN is designed to output the original signal of 2.5 s elements together with the time synchronous rhythm strip of 10 s. Our approach reached a score of 0.00 (2/72) for reconstruction and 0.52 (23/66) for classification. Using 5k cross validation, we resulted in 0.00 +/- 0.00 and 0.57 +/- 0.08, respectively. For the reconstruction task, we plan to use transfer learning for non-iterative ROI detection, and predicting the presence of sine rhythm to tackle the classification task.