Contrastive Waveform-Image Pretraining for Electrocardiogram Digitization and Classification

Adel M Hassan1 and Muhammad Nuhan Ahnaf2
1Baylor College of Medicine, 2Sam Houston State University College of Osteopathic Medicine


Abstract

Electrocardiograms (ECGs) are an important diagnostic tool for cardiologists around the world, providing insight into diverse pathological processes such as ischemia, inflammation, hypertrophy, and valvular insufficiency. Despite the rich information contained within each 10-second strip, ECGs can be difficult to interpret, requiring a fully trained cardiologist in order to obtain the most accurate results. In certain remote parts of the world, trained physicians may be a limited resource, so it is desirable to have an automated method of ECG interpretation.In resource limited areas, images are more easily shared than a raw ECG waveform. Currently, several algorithms exist that output an interpretation from a raw waveform ; however, no solution exists to generate an interpretation from an image of an ECG. We propose an algorithm to extract a waveform from an image of an ECG. We utilize an algorithm inspired by Contrastive Language-Image Pretraining (CLIP), replacing the text tokens with tokens extracted from a Bag of Symbolic Fourier Approximation Symbols (BOSS). At present, we obtain a reconstruction signal-to-noise ratio of -18.116 and a classification F-measure of 0.520. We expect further fine-tuning to improve these scores and reveal the potential of our approach to ECG digitization.