Atrial fibrillation is the most common sustained cardiac arrhythmia in adults and is associated with an increased risk of stroke, heart failure, cognitive decline, hospitalisations, and death. Deep learning applied to electrocardiograms (ECG-AI) is an emerging approach for predicting atrial fibrillation or flutter (AF). We introduce an open-weights ECG-AI model developed at the Montreal Heart Institute (MHI) and externally validated using MIMIC-IV dataset, comparing its performance with clinical and AF polygenic scores (PGS).
ECG in sinus rhythm from the Montreal Heart Institute were analyzed, excluding those from patients with preexisting AF. The primary outcome was incident AF at 5 years. An ECG-AI model was developed by splitting patients into non-overlapping datasets: 70% for training, 10% for validation, and 20% for testing. Performance of ECG-AI, clinical models and PGS was assessed in the test dataset. The ECG-AI model was externally validated in the Medical Information Mart for Intensive Care-IV (MIMIC-IV) hospital dataset.
A total of 669,782 ECGs from 145,323 patients were included. Mean age was 61±15 years, and 58% were male. The primary outcome was observed in 15% of patients and the ECG-AI model showed an area under the receiver operating characteristic curve (AUC) of 0.78. In time-to-event analysis including the first ECG, ECG-AI inference of high risk identified 26% of the population with a 4.3-fold increased risk of incident AF (95% CI: 4.02–4.57)
In a subgroup analysis of 2,301 patients, ECG-AI outperformed CHARGE-AF (AUC=0.62) and PGS (AUC=0.59). Adding PGS and CHARGE-AF to ECG-AI improved goodness-of-fit (Likelihood Ratio Test p<0.001), with minimal changes to the AUC (0.76-0.77).
Highlighted the P-wave area as having the highest influence on the model’s prediction
Model and data availability
The associated code required to run the trained ResNet-50 model used in this study is availableon GitHub. The ECG-AI model is also made publicly available. Please visit our repository: https://github.com/HeartWise-AI/ecg-ai-af-mhi
Model weights: https://huggingface.co/heartwise/ecgAI_AF_MHI