Image-Based Electrocardiogram Classification using Pre-trained ConvNext Models with Demographic Data

Felipe Meneguitti Dias1, Estela Ribeiro2, Quenaz Bezerra Soares3, Jose Krieger2, Marco Antonio Gutierrez3
1Instituto do Coração, Hospital das Clínicas HCFMUSP, Faculdade de Medicina, Universidade de São Paulo, 2Heart Institute, 3Heart Institute University of Sao Paulo


Abstract

Aims: Electrocardiogram (ECG) classification remains a critical research focus, particularly in analyzing one-dimensional ECG signals. Despite the technological advances in digital ECG methodologies, which utilize computational algorithms to enhance accuracy and accessibility of ECG-based diagnoses, traditional paper-based ECGs are still prevalent, especially in lower-income settings. This paper explores a hybrid approach that integrates modern digital techniques with conventional practices to classify physical (paper-based) ECG records as normal or abnormal, as part of the George B. Moody PhysioNet Challenge 2024.

Methods: We employed a synthetic image ECG generator to create datasets from the CinC2021, CODE15, PTB-XL datasets, in addition to a local dataset, InCor-DB, which includes 99,746 ECG exams from 64,192 patients. Our methodology utilized the ConvNext architecture, pre-trained on ECG images from CinC2021, CODE15, and InCor-DB datasets, resized to 224x224 pixels. We fine-tuned the model on the PTB-XL dataset, incorporating demographic data (age, sex, weight, height) for classification of abnormalities. The training strategy involved cross-entropy loss minimization, class-weight adjustments, and AdamW optimizer with a learning rate of 1e-3 over 30 epochs, aided by a cosine scheduler and early stopping to prevent overfitting. We also implemented 10-fold cross-validation, with the final model being an ensemble of the models from each fold.

Results: The model achieved an F1-score of 0.82±0.02 across internal 10-fold cross-validation. On the challenge's hidden validation set, our team, AIMED, achieved an F1-score of 0.71, securing second place in team rankings and fifth overall.

Conclusion: This study demonstrates significant advances in integrating digital technologies into clinical settings, potentially enhancing ECG diagnostic processes globally.