Detecting COVID-19 from digitized ECG printouts using 1D convolutional neural networks

Thao Nguyen, Hieu H. Pham, Huy-Khiem Le, Anh-Tu Nguyen, Ngoc Tien Thanh, Cuong Do

Introduction

The global response to the COVID-19 pandemic has highlighted the urgent need for rapid, accessible, and cost-effective diagnostic tools. While Polymerase Chain Reaction (PCR) testing remains the clinical gold standard, its implementation is often hindered by high costs, long turnaround times, and the requirement for specialized laboratory infrastructure. Alternative imaging modalities, such as Chest Computed Tomography (CT), have been utilized; however, they demonstrate limited sensitivity in early-stage cases, missing up to 56% of infections.

Recent clinical observations suggest that COVID-19 frequently manifests with cardiovascular implications, leaving distinct "signatures" on electrocardiograms (ECG). This makes ECG a promising, non-invasive biomarker for screening. However, a significant barrier to leveraging artificial intelligence (AI) in this domain is the prevalence of legacy medical records. In many clinical settings worldwide, ECG data is stored as paper printouts or static images rather than digital waveforms. Previous attempts to apply deep learning to these records often utilized 2D Convolutional Neural Networks (2D-CNNs) to classify images directly. This approach is inherently limited, as models must contend with non-physiological noise—such as paper texture, grid lines, and varying templates—while failing to exploit the high temporal resolution of the underlying cardiac signal.

Methodology

This research proposes a novel two-stage pipeline designed to "rescue" high-fidelity 1D signals from paper-based ECG reports for subsequent classification.

1. Digitization Pipeline

The digitization process involves a five-step computer vision sequence to extract raw waveforms from static images:

  • Binarization: Images are converted to a binary (black and white) format using Otsu’s method to distinguish the signal from the background.
  • Isoelectric Line Detection: Histogram analysis is employed to identify the "zero-voltage" baseline for each lead, ensuring accurate vertical alignment.
  • Lead Separation: The standard 12-lead report is segmented into individual lead components for isolated analysis.
  • Noise Removal: A specialized pixel-tracking algorithm is applied to follow the signal path, effectively filtering out grid lines and printing artifacts that typically interfere with 2D analysis.
  • Signal Extraction: Pixel coordinates are mapped back into time-series voltage signals, restoring the temporal integrity of the data.

2. 1D-CNN Classification

Following digitization, the 1D signals are processed using SEResNet18, a Squeeze-and-Excitation Residual Network. Unlike standard image recognition models, this 1D-CNN architecture is optimized for time-series data. By incorporating squeeze-and-excitation blocks, the model can adaptively recalibrate channel-wise feature responses, allowing it to capture long-range dependencies and subtle patterns in heart rhythms more effectively than traditional 2D architectures.

Experimental Setup and Dataset

The study utilized the publicly available COVID-19 ECG images dataset, which contains 1,937 paper-based ECG reports. The dataset is categorized into five distinct classes:

  • COVID-19 (250 images)
  • Normal (859 images)
  • Myocardial Infarction (77 images)
  • Recovered from Myocardial Infarction (203 images)
  • Abnormal Heartbeat (548 images)

Results

The proposed methodology demonstrated significant improvements in both signal fidelity and diagnostic accuracy.

Digitization Precision

The signal extraction algorithm achieved high precision, with a Mean Absolute Error (MAE) of only 28.11 ms when comparing digitized R-peaks to the ground truth. This confirms that the pipeline successfully preserves the critical timing information necessary for cardiac diagnosis.

Classification Performance

The SEResNet18 model outperformed existing benchmarks:

  • Binary Classification (COVID-19 vs. Normal): 98.42% accuracy.
  • Multi-class Classification (COVID-19 vs. All Others): 98.50% accuracy.

Furthermore, the 1D-CNN approach proved computationally efficient, with inference times as low as 18.34 ms per sample. This represents a substantial improvement over 2D-CNN counterparts and marks a 6.72% increase in accuracy compared to previous studies using the same dataset.

Discussion and Future Work

The core finding of this research is that converting ECG images back into 1D signals—rather than processing them as images—is a critical performance driver. By extracting the signal, the model becomes "template-agnostic," focusing on physiological data rather than the specific formatting of different ECG machines or hospital templates. This provides a vital bridge for legacy medical systems to utilize modern AI diagnostics without requiring hardware upgrades.

Despite these successes, limitations remain. The pixel-tracking algorithm can encounter difficulties when signals from adjacent leads overlap, a common occurrence in severe cardiac conditions. Future research will focus on:

  • Mobile Integration: Developing a mobile application to allow clinicians to screen for COVID-19 by photographing ECG printouts.
  • Enhanced Metadata: Incorporating demographic factors such as age and gender to refine diagnostic precision.
  • Generalization: Validating the pipeline across diverse, multi-center datasets to ensure global applicability.

Summary updated

BibTeX
@inproceedings{nguyen2022detecting,
  author = {Thao Nguyen and Hieu H. Pham and Huy-Khiem Le and Anh-Tu Nguyen and Ngoc Tien Thanh and Cuong Do},
  title = {{Detecting COVID-19 from digitized ECG printouts using 1D convolutional neural networks}},
  booktitle = {Plos one},
  year = {2022},
  doi = {10.1371/journal.pone.0277081},
}
Figure