Do CNNs outperform ViTs in predicting sex and left ventricular dysfunction from ECGs?
CNN-based models demonstrated higher accuracy than Vision Transformers for ECG-based prediction of sex and left ventricular dysfunction, with high performance retained even using 2-second segments or single-lead inputs.
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.
Cohen-Shelly et al. (Fri,) studied this question.