Deep learning model design for ECG-based prediction of sex and ventricular dysfunction: A technical exploration of CNN and transformer architectures

Read full text
Authors: Michal Cohen-Shelly, David Hochstein, Noam Barda, Amit Bleiweiss, Estelle Aflalo, N Bar, Eyal Zimlichman, Eyal Klang, Nisim Rahman, Talia Sela, Robert Klempfner, Elad Maor
+4 more Roy Beinart, Amit Segev, Ehud Raanani, Avi Sabbag
Cited by: 3
References: 30

Abstract

Background and objective Artificial intelligence (AI) based analysis of electrocardiogram (ECG) signals has become a powerful tool for predicting clinically important attributes such as sex and cardiac function. The growing use of wearable ECG technologies has increased interest in optimizing deep learning models for rapid and efficient predictions. Convolutional neural networks (CNNs) are the most established architecture in this field, while Vision Transformers (ViTs), successful in image analysis, remain less studied for ECG time-series data. We aimed to compare the performance of ViTs and CNNs in predicting sex and left ventricular dysfunction (LVD), defined as ejection fraction ≤ 35 %, and to evaluate reduced-input models using short ECG segments and single-lead recordings. Methods This retrospective study analyzed 12-lead ECGs recorded between January 2005 and December 2022 at a tertiary medical center. The dataset included 150,691 patients for sex classification and 29,422 for LVD. Binary classification models were developed using full-length ECGs, truncated segments (1–10 s), and individual leads. CNNs were implemented using PyTorch and ViTs via the HuggingFace framework. Model performance was assessed using area under the receiver operating characteristic curve (AUROC), with statistical comparisons by DeLong's test. Results CNNs outperformed ViTs in both tasks. For sex prediction, AUROC was 0.915 (95 % CI: 0.912–0.918) for CNNs and 0.898 (95 % CI: 0.894–0.901) for ViTs (P < 0.001). For LVD, CNNs achieved an AUROC of 0.895 (95 % CI: 0.884–0.906) versus 0.866 (95 % CI: 0.853–0.879) for ViTs (P = 0.023). Over 98 % of peak performance was retained using 2-s segments, similarly single-lead inputs achieved a relatively high performance. Conclusion CNN-based models demonstrated higher accuracy than ViTs for ECG-based prediction of sex and LVD. Compact input models may enable efficient clinical use. Further studies should explore where ViTs may offer added value.

Fields of Study & Subjects

ECG Monitoring and Analysis Cardiac electrophysiology and arrhythmias Atrial Fibrillation Management and Outcomes

Publication details

Journal / source
Heliyon
Publisher
Elsevier BV
Volume
12
Issue
2
Pages
e44527–e44527
Publication date
16 January 2026
Language
EN