Summary
Atrial fibrillation (AF), the most prevalent cardiac rhythm disorder, significantly increases hospitalization and health risks. Reverting from AF to sinus rhythm (SR) often requires intensive interventions. This study presents a deep-learning model capable of predicting the transition from SR to AF on average 30.8 min before the onset appears, with an accuracy of 83% and an F1 score of 85% on the test data. This performance was obtained from R-to-R interval signals, which can be accessible from wearable technology. Our model, entitled Warning of Atrial Fibrillation (WARN), consists of a deep convolutional neural network trained and validated on 24-h Holter electrocardiogram data from 280 patients, with 70 additional patients used for testing and further evaluation on 33 patients from two external centers. The low computational cost of WARN makes it ideal for integration into wearable technology, allowing for continuous heart monitoring and early AF detection, which can potentially reduce emergency interventions and improve patient outcomes.
Keywords: atrial fibrillation, early warning signal, artificial intelligence, neural networks, prediction
Graphical abstract

Highlights
-
•
Predicts AF onset on average 30.8 min in advance on test data
-
•
Achieves 83% accuracy and 85% F1 score on test data
-
•
Uses R-to-R interval signals for monitoring, accessible via smartwatches
-
•
Has the potential to lower interventions and costs by early AF detection
The bigger picture
Atrial fibrillation (AF), the most prevalent heart rhythm disorder, affects millions globally, leading to significant increases in stroke risk, heart failure, and healthcare expenses. These challenges underscore the need for innovative monitoring solutions. Wearable technology, coupled with artificial intelligence, will eventually enable continuous, real-time tracking of heart health and warn users of imminent danger. This paper shows that such a future is not far. Our research introduces a model, WARN, that harnesses R-to-R intervals, the intervals between successive heartbeats, from readily available smartwatches to issue early warnings of AF onset. By leveraging extensive long-term data of individual patients, we expect that WARN can be personalized to significantly improve the prediction horizon, offering a future where many patients might manage AF proactively with as-needed medication rather than routine daily doses, thereby optimizing treatment regimens and improving quality of life.
Unlocking the potential of wearable technology for cardiac health, this paper presents a deep learning model that can predict atrial fibrillation onset on average over 30 min in advance with high accuracy. Leveraging everyday wearable data, this work paves the way for a new era in proactive heart rhythm monitoring and reducing emergency interventions, offering a glimpse into the future of personalized and preemptive healthcare strategies.
Introduction
Atrial fibrillation (AF) is the most common cardiac arrhythmia worldwide; the estimated number of individuals with AF in 2010 was 33.5 million.1 Hand in hand with the growing prevalence of AF,2 healthcare costs continue to increase mainly because of hospitalization and treatment costs.3 AF episodes contribute to emergency department presentations due to high symptom burden and heart failure decompensation from tachycardiomyopathy. Maintaining sinus rhythm (SR) is a priority since AF events can increase the risk of other diseases,4 such as stroke and dementia,5,6 as well as lead to atrial remodeling, which may enhance susceptibility to future episodes.7 The early prediction of AF episodes in patients with paroxysmal AF could prompt patients to take preventive measures to maintain SR (e.g., avoid alcohol consumption or take preventive antiarrhythmic and anticoagulation medication), possibly reducing emergency department presentations and associated healthcare costs. However, the identification of patients with a high likelihood of AF onset and its early warning prediction (on the timescale of minutes or hours) are challenging problems in the clinical setting.8,9 To overcome these challenges, we develop a deep learning model that continuously monitors patients to provide early warnings of imminent AF onsets.
The automated detection of AF regimes from recorded electrocardiogram (ECG) data is a well-studied problem in the literature.10,11 Recent approaches, based on machine learning and neural networks, have achieved over 99% accuracy in the classification task,12,13,14,15 which led to functional applications on wearable devices of Apple, Fitbit, Samsung, and others using photoplethysmography.16,17,18,19 On the other hand, the prediction of the onset of AF is still an open problem.20 Numerous studies have developed models for long-term risk assessments of AF and other cardiovascular diseases, providing estimates typically on the order of weeks, months, or years.21,22,23,24,25 Such machine learning models for AF detection and risk assessment are often trained on short-duration ECG samples obtained from sporadic cardiologist controls. Although these datasets are very extensive (thousands or even millions of recordings), they do not typically contain long-duration ECG recordings (on the order of hours)—a type of data required for the development of models for real-time monitoring and prediction. Long-duration recordings require the inconvenient use of Holter devices or patches and are thus often collected from patients with more severe AF conditions. These factors substantially reduce the amount of data available for model training in forecasting problems for cardiovascular diseases.
Despite these data challenges, recent advances based on machine learning and deep learning models have been proposed for short-term prediction of AF using models trained on features extracted from ECG leads,26,27,28,29,30,31 R-to-R intervals (RRIs),32,33,34,35,36 or a combination of both.37,38,39,40,41,42,43,44 All of these methods have strong limitations. Most have limited data for model training—typically around 50 or fewer patients. More importantly, all methods use data up to, or very close to, the onset of AF to “predict” an AF event. Since little or no warning of AF onset is given in advance, these methods can be categorized as detection/classification tools rather than early warning models. As an example, one study35 uses the entire window from 4 h to 0 h (i.e., at onset) to classify whether an AF event will follow or not; in practice, it does not provide an early warning. In contrast, our work departs from this approach to a more prospective prediction model. Utilizing a sliding window feature, our model is designed to identify precursors of AF that are far away from the onset, thus providing early warnings on a timescale of minutes. Figure 1A illustrates the distinct data windows used by different models in detection, prediction at onset, and early warning prediction.
Figure 1.
Detection versus prediction and early warnings
(A) Diagram of the types of data windows used for early warning AF prediction (left box), AF prediction at onset (middle), and AF detection (right). The predicted time horizon is the time between the early warning and AF onset.
(B) The model employs a sliding window, which sequentially samples the ECG data every 15 s. This window contains a duration of 30 s of ECG data, which are then converted to RRI data. Specifically, the total duration of the n RRI samples within the window is precisely 30 s.
(C) For each sliding window of RRI data, the model computes the “probability of danger” to transition to AF.
(D) Then, a non-anticipative moving average window (considering only past values) smooths this probability of danger. When it crosses a threshold (yellow line), it triggers a warning of an imminent AF onset. For this particular patient, an alert is triggered 24 min in advance of AF onset. The supplemental videos illustrate the probability of danger rising as the AF onset approaches for other patients.
This paper presents a retrospective study that develops a deep learning model for early warning of AF, entitled WARN (Warning of Atrial Fibrillation). The model is trained and tested on 350 individual 24-h Holter recordings. On the test data, WARN gives early warnings, on average, 30.8 min before onset of AF, with an accuracy and F1 score of 83% and 85%, respectively. Our model has a high performance using only RRI signals, which can be acquired from easy-to-wear and affordable pulse signal recorders, such as smartwatches or smart fitness bands. These devices can be used on a daily basis by patients, paving the way for real-time monitoring algorithms that learn and monitor long-term cardiac dynamics.
Results
We used 24-h Holter recordings collected from 350 patients at Tongji Hospital (Wuhan, China) to develop and evaluate WARN for the early warning of AF. Recordings with short-duration AF episodes and/or significant noise artifacts were excluded from the original dataset. The cohort was divided in two groups for the training/cross-validation (280 patients) and testing (70 patients) of WARN, as summarized in Table 1 with variables expressed as mean or interquartile range (IQR). The ECG data had a sampling frequency of 128 Hz and a resolution of 10 bits. We used only the lead II recordings and converted them to RRI data, motivated by our ultimate goal to develop monitoring/prediction methods on easy-to-wear wearable devices. First, the ECG data were pre-processed with a 0.5–40-Hz band-pass filter to reduce noise, followed by the identification of R peaks using the Pan-Tompkins algorithm.45,46 The data were labeled with three classes: AF, pre-AF, and SR. AF was labeled by cardiologists, while pre-AF was defined as the period just before AF onset with high RRI variability (Figure S2). The remaining segments were labeled as SR. Then, the RRI data were used to train a deep convolutional neural network (CNN) with 479 layers that classifies between SR, pre-AF, and AF segments. Finally, for each sliding window of 30 s of RRI data, WARN outputs a “probability of danger” that the patient will have an imminent AF episode. This probability is defined as , which represents the probability that a sliding window is either in the pre-AF or AF class. This is then repeated every 15 s (Figures 1B–1D). Further dataset descriptions and method developments are described in the supplemental information.
Table 1.
Characteristic of the patients
| Characteristic | Tongji Hospital, China |
External centers |
||
|---|---|---|---|---|
| Training cohort | Test cohort | France | Argentina | |
| Total | 280 | 70 | 25 | 8 |
| Age < 65 | 115 (mean age 55) | 31 (mean age 54) | 8 (mean age 57) | 2 (mean age 60) |
| Age ≥ 65 | 165 (mean age 73) | 39 (mean age 73) | 17 (mean age 73) | 6 (mean age 80) |
| Male | 163 | 26 | 15 | 5 |
| Female | 117 | 44 | 10 | 3 |
| Age | ||||
| Mean | 67 | 66 | 65 | 75 |
| Median | 67 | 67 | 64 | 77 |
| Range | [20, 93] | [21, 92] | [49, 86] | [55, 91] |
| IQR | 14 | 15 | 13 | 14 |
We initially evaluated WARN on a test dataset consisting of RRI data. For comparison purposes, WARN was also trained and tested on ECG data, achieving slightly better performance. Finally, to evaluate WARN’s performance on out-of-sample data, we tested the model on 33 patients from external datasets in healthcare centers in Argentina and France. The performance results of WARN for the prediction of AF episodes are summarized in Table 2. Next, we analyze in more detail the performance of WARN in each of these datasets.
Table 2.
Summary of key performance metrics for WARN
| Dataset | Accuracy (%) | AUROC | AUPRC | Predicted time horizon |
|
|---|---|---|---|---|---|
| Mean | Median | ||||
| Test (RRI) | 82.7 | 0.90 | 0.88 | 30.8 min | 38.0 min |
| Test (ECG) | 82.4 | 0.95 | 0.96 | 32.5 min | 43.4 min |
| External centers | 75.0 | 0.80 | 0.73 | 31.8 min | 41.3 min |
RRI data
Figure 2 presents the results for the RRI test dataset. The threshold of 0.57 was selected from the validation data as the optimal value that balances the tradeoff between accuracy and predicted time horizon (see supplemental information, Section S6). Figure 2 also includes results for two other thresholds to contrast tradeoffs between sensitivity and specificity. Figure 2B shows that, for the threshold of 0.57, AF onset is predicted at least 30 min in advance for around 60% of all patients in the test cohort while attaining relatively high performance metrics (Figure 2C). Overall, the performance of WARN is balanced between the “danger” and “normal” classes, attaining high area under the receiver operating characteristic curve (AUROC) and area under the precision-recall curve (AUPRC) scores (Figure 2D). Smaller thresholds tend to increase the average predicted time horizon for an AF onset across patients at the expense of smaller accuracy and a larger number of false positives (Figure 2E). For patients at risk, the threshold could be smaller and more sensitive to reduce false negatives (Figure 2F). Finally, WARN seems to achieve similar performance for patients in different age groups; Figure 2A shows that AF in younger patients (less than 65 years old) can be predicted around 3 min earlier than for older patients.
Figure 2.
Performance of WARN on the RRI test dataset
We chose three probability thresholds (0.57, 0.73, and 0.88) to contrast tradeoffs between sensitivity and specificity.
(A) Boxplots of the predicted time horizon (first early warning until AF onset) for different probability thresholds across all patients. Median and mean values are marked by colored and black lines, respectively. Blue circles and red asterisks represent the means of patients younger and older than 65 years, respectively.
(B) Fraction of patients predicted to be in danger as a function of time before the AF onset for different thresholds.
(C) Performance metrics as a function of the probability threshold. The curves cross at a threshold of 0.74 (with a value of 83.6%).
(D) Receiver operating characteristic curve (ROC) (left) and precision-recall curve (PRC) (right).
(E) Trade-offs between the predicted time horizon and model accuracy as a function of the probability threshold.
(F) Confusion matrices for different thresholds computed on 75 episodes of AF of the 70 patients in the test set.
We analyzed all false predictions with the 0.57 threshold, negative and positive, to gain insight into the algorithm. Table S3 lists the observations on the incorrectly classified patients by WARN. Of the 4 false negatives, one patient had a sudden AF onset with a very stable SR beforehand; the other 3 patients had a combination of tachycardia, bradycardia, unstable base lines, and noisy signals before AF onset. Of the 22 false positives, 13 had premature atrial contractions (PACs), 5 had premature ventricular contractions, 6 had unstable baselines, 4 had sinus tachycardia, and one had atrial flutter. We noticed that the majority of these records (15 of 22) were very noisy, stressing the necessity of treating patients’ skin with saline or disinfectant before wearing ECG devices to ensure the electrodes are well connected to the skin. Besides the noise influence, we speculate that some of these false positive events correspond to moments where the heart was close to switching from SR to AF and, for some reason, it did not. Due to a number of conditions (e.g., stress or stimulants), heart dynamics can be pushed toward the tipping point that leads to a dynamic transition from SR to AF. It is possible that, in some of the false positives, the heart was close to switching to AF, but it did not—especially for those patients with PACs (13 of 22), which are well-known precursors of AF and highly related or causal to the occurrence of AF.47
ECG data
We investigate whether there is a substantial gain in performance when the CNN is trained on the original ECG data instead. Figure S6 summarizes the performance of WARN on the test ECG data. Overall, with ECG data, there was a slight improvement of model performance compared to using RRI data; the AUROC and AUPRC increased, respectively, by 5.5% and 9.1%, albeit the accuracy and the mean predicted time horizons were relatively similar (Table 2). Given the loss of information present in the conversion of ECG to RRI data, it is not surprising that the model trained on ECG data has improved performance compared to the model trained on RRI data. What is surprising is that the improvement was relatively small, considering the richer, highly sampled, continuous-time nature of ECG data compared to the simpler, low-sampled, discrete-time RRI data. The achieved results show that prediction of AF onset can be efficiently performed using only RRI data, which opens possibilities for future development of real-time monitoring and early warnings from comfortable wearable devices.
RRI data from external centers
To further validate the performance of WARN on independent test datasets covering other demographics, we used ECG data collected from patients with AF from healthcare centers in Argentina (8 patients) and France (25 patients). The ECG data were first converted to RRI data. Then, using the same hyperparameters used in the WARN testing set, we obtained an accuracy of 75% and a mean (median) predicted time horizon until AF onset of 31.8 min (41.31 min). Figure S7 summarizes the model performance for this external-center dataset. The performance of WARN applied to this external dataset remains relatively high (close to the accuracy and mean predicted time obtained using the trained datasets), which demonstrates the potential of our method to generalize to “out-of-sample” data.
We also tested WARN’s performance on the open-access data (Paroxysmal AF Prediction Challenge Database, AFPDB) from Physionet,48,49 as summarized in Figure S8. The results are shown for a balanced set of 20 AF patients and 20 healthy patients. Note that WARN was not designed for healthy patients in general since the training/test data consisted only of recordings collected from patients already diagnosed with AF. This may explain the slightly worst results of WARN on the Physionet data (accuracy of 0.7, AUROC = 0.76 and AUPRC = 0.79). Furthermore, the Physionet dataset consists only of ECG records of 30 min, which led to shorter predicted time horizons for AF (mean of 12.9 min). Finally, it should be noted that previous models using Physionet were not always reproducible.50
Discussion
This paper developed WARN, an automated prediction method for early warning of AF onset based on deep CNN and RRI signals. The method takes 30-s RRI samples every 15 s and computes the probability of danger of imminent AF onset. The key feature is the early and continuous rise of the probability of danger when approaching AF, providing an early warning when this probability crosses the specified threshold. On the test data (70 patients) and two external validation sets (33 patients), WARN predicted AF onset on average 31 min and 33 min in advance with an accuracy of 83% and 73%, respectively.
Table 3 compares the performance of WARN to previous work on AF prediction. Among the listed references, WARN is the first method to provide an early warning of AF far from onset. The prediction horizon for all previous studies is near or at AF onset. Notably, the study36 stands out as the only method that predicted AF prior to its onset, with a prediction time horizon of 30 s. It trained a CNN for binary classification from 5 min of RRI data with an accuracy of 66%. Among the other methods with predictions at AF onset, the highest accuracy of 98% was reported39 by combining multilayer perceptron, K-nearest neighbor, and Support Vector Machine (SVM). Except for Guo et al.35 all other studies relied on window lengths between 2 and 30 min. Table 3 also highlights that the dataset collected for our model training is the second larger dataset across all methods. See Section S7 in the supplemental information for further discussion.
Table 3.
Performance comparison between WARN and previous work
| Year | Study | Method | Patients (no.) | Window length | Prediction horizon | Accuracy | Sensitivity | Specificity |
|---|---|---|---|---|---|---|---|---|
| 2012 | Mohebbi et al.33 | RRI, SVM | NR | 30 min | onset | 96 | 96 | 93 |
| 2013 | Costin et al.37 | ECG, QRS complexes | 75 | 5 min | onset | 90 | 89 | 89 |
| 2016 | Boon et al.28 | RRI, SVM | 53 | 30 min | onset | 80 | 81 | 79 |
| 2018 | Li et al.38 | ECG, Markov chain | 5 | 2 min | onset | 82 | 86 | 80 |
| 2018 | Boon et al.29 | RRI, SVM | 53 | 5 min | onset | 87 | 86 | 88 |
| 2018 | Ebrahimzadeh et al.39 | ECG, mixture of experts | 53 | 5 min | onset | 98 | 100 | 96 |
| 2021 | Guo et al.35 | RRI, XGBoost | 554 | 1–4 h | onset | 88 | 82 | 96 |
| 2021 | Tzoul et al.51 | ECG, CNN | 8 | 5 min | onset | 89 | 88 | 89 |
| 2022 | Grégoire et al.36 | RRI, CNN | 140 | 300 RRI (∼5 min) | 30 beats (∼30 s) | 66 | 80 | 53 |
| 2023 | WARN | RRI, CNN | 350 | 30 s | 30.8 min before onset | 83 | 95 | 70 |
| 2023 | ECG, CNN | 350 | 30 s | 32.5 min before onset | 82 | 95 | 69 |
NR, not reported; ECG, electrocardiogram; RRI, R-to-R intervals; CNN, convolutional neural network; SVM, support vector machine.
WARN introduced two parameters that can be tuned by physicians depending on the clinical application: the probability threshold (danger indicator) and the moving average. These two parameters are roughly inverse to each other; lower (higher) moving averages required higher (lower) thresholds (Figure S5). Our choice in this paper was based on a simple tradeoff decision to keep the accuracy, F1 score, and prediction horizon all relatively high. Different situations may require a higher weight on one of these objectives. For example, smaller thresholds yield more sensitive models with reduced false negatives, which could be used for high-risk patients. On the other hand, higher thresholds lead to more specific models and reduced false positives, which may be more suitable to monitor AF patients with a lower incidence.
Compared with ECG data, results using RRI data showed a slight reduction in performance. On the test data, both exhibited similar accuracy of approximately 83%, with average prediction horizons of 32.5 min for ECG and 30.8 min for RRI data. This slight decrease in performance is compensated by the ease of continuously obtaining RRI data from easily accessible and cost-effective wearable devices like smartwatches, making them ideal for long-term monitoring. Hence, ECG signals are not really needed, as the results would be similar to those acquired from smartwatches. On a standard laptop computer, the total computational time spent on each sliding window was around 100 ms. This is considerably less than 15 s, which is the time until the next window, making it feasible to implement WARN in smartphones to process the streamed data from a smartwatch in real time.52 For instance, the deep learning model used in this paper, EfficientNetV2, can be adapted to mobile devices through the TensorFlow Lite framework (see Section S5 in the supplemental information). Since smartwatches can be worn for long-term monitoring and record RRI signals, the early warning provided by WARN could potentially provide sufficient time for patients to take oral antiarrhythmic drugs on demand to prevent the onset of AF or other targeted therapies or lifestyle interventions. Moreover, models could be retrained offline (e.g., once a day using high-performance computing) as new data become available.
Limitations of the study
WARN was trained on 24-h RRI data from 280 patients. Hence, it is an “average” algorithm among those patients. With much longer time horizons on single patients, WARN could be personalized to improve its performance and be converted into a real-time prediction algorithm that updates itself with newer incoming data. With improved performance and an even earlier warning of AF onset, some patients could benefit in the future from taking antiarrhythmic medication on demand (when patients receive warnings) instead of the current approach of taking medication daily. For example, patients with sporadic AF events could benefit from this new therapy. Hence, future work should focus on personalized models by including considerably more data for a single patient (compared to the 24-h datasets used in this paper) to achieve even earlier warnings of AF onset. Eventually, this approach could lead to new clinical trials and changes in therapies. Finally, WARN was trained on 100% Chinese patients. Although it was also tested on patients from France and Argentina with a good performance, the method can potentially be further improved if trained on specific demographics and commodities.
Experimental procedures
Resource availability
Lead contact
Requests for further information, resources, and reagents should be directed to and will be fulfilled by the lead contact, Jorge Goncalves. Training and validation datasets from Tongji Hospital will be accessible pending approval by Xiaoyun Yang.
Materials availability
This study did not generate new unique materials.
Data and code availability
The data were provided by Tongji Hospital from China, the Clínica y Maternidad Suizo Argentina, and the Groupe Hospitalier Privé Ambroise Paré-Hartmann (acquired between 2014 and 2022). To protect patients’ privacy, the data were anonymized. The data collection teams from each center handled sample collection and anonymization. The algorithm development team received anonymized data containing only age and gender information for the subsequent algorithm development. The study design was evaluated and exempted from a full review by the Huazhong University of Science and Technology Institutional Review Board (approval number TJ-IRB20220423) and approved by the Ethics Review Panel of the University of Luxembourg (approval number ERP 22-057 RTMonitor). All data were obtained according to the principles of the declaration of Helsinki.
The testing data are publicly available at Zenodo (https://doi.org/10.5281/zenodo.10815810).53 The Physionet data used as part of the external validation of this study are available from the open-access paroxysmal AF Prediction Challenge Database48,49 (https://physionet.org/content/afpdb/1.0.0/).
Data preprocessing and segmentation were implemented using MATLAB software. The neural network was implemented on the Keras Framework with the Tensorflow backend on Python 3.7. Codes have been deposited on Zenodo (https://doi.org/10.5281/zenodo.10815367).54
Acknowledgments
The authors are thankful for support from the Luxembourg National Research Fund (grant PRIDE15/10907093/CriTiCS) and the National Natural Science Foundation of China (grants 92167201 and 82100531).
Author contributions
J.G. conceptualized the research. H.Z., S.D., P.M.-B., M.M.R., and M.C. collected, curated, and annotated the data. M.G., J.G., A.N.M., Y.J., S.Z., and B.T. developed the AI model. M.G. implemented the code and validated the results. M.G., H.Z., J.G., A.N.M., J.F., Y.Y., R.S., F.B., C.C., and X.H. analyzed the results. J.G., Y.Y., A.N.M., M.M.R., Z.T., H.D., Z.T., H.B., J.F., X.Y., G.W., and H.-T.Z. supervised the work. M.G., A.N.M., J.G., H.Z., J.F., Y.Y., and X.Y. wrote the original draft. All authors revised the manuscript.
Declaration of interests
The authors declare no competing interests.
Published: April 18, 2024
Footnotes
Supplemental information can be found online at https://doi.org/10.1016/j.patter.2024.100970.
Contributor Information
Xiaoyun Yang, Email: yangxiaoyun321@126.com.
Jorge Goncalves, Email: jmg77@cam.ac.uk.
Supplemental information
The movie illustrates, for each consecutive sampled window of ECG data, the corresponding RRI data, recurrence plot, and the probability of danger outputted by the neural network.
References
- 1.Chugh S.S., Havmoeller R., Narayanan K., Singh D., Rienstra M., Benjamin E.J., Gillum R.F., Kim Y.-H., McAnulty J.H., Jr., Zheng Z.-J., et al. Worldwide epidemiology of atrial fibrillation: a global burden of disease 2010 study. Circulation. 2014;129:837–847. doi: 10.1161/CIRCULATIONAHA.113.005119. [DOI] [PMC free article] [PubMed] [Google Scholar]
- 2.January C.T., Wann L.S., Alpert J.S., Calkins H., Cigarroa J.E., Cleveland J.C., Conti J.B., Ellinor P.T., Ezekowitz M.D., Field M.E., et al. 2014 AHA/ACC/HRS guideline for the management of patients with atrial fibrillation: a report of the American College of Cardiology/American Heart Association Task Force on Practice Guidelines and the Heart Rhythm Society. J. Am. Coll. Cardiol. 2014;64:e1–e76. doi: 10.1016/j.jacc.2014.03.022. [DOI] [PubMed] [Google Scholar]
- 3.Benjamin E.J., Muntner P., Alonso A., Bittencourt M.S., Callaway C.W., Carson A.P., Chamberlain A.M., Chang A.R., Cheng S., Das S.R., et al. Heart disease and stroke statistics 2019 update: a report from the American Heart Association. Circulation. 2019;139:e56–e528. doi: 10.1161/CIR.0000000000000659. [DOI] [PubMed] [Google Scholar]
- 4.Kornej J., Börschel C.S., Benjamin E.J., Schnabel R.B. Epidemiology of atrial fibrillation in the 21st century: novel methods and new insights. Circ. Res. 2020;127:4–20. doi: 10.1161/CIRCRESAHA.120.316340. [DOI] [PMC free article] [PubMed] [Google Scholar]
- 5.de Leeuw F.-E., de Groot J.C., Oudkerk M., Kors J.A., Hofman A., van Gijn J., Breteler M.M. Atrial fibrillation and the risk of cerebral white matter lesions. Neurology. 2000;54:1795–1801. doi: 10.1212/wnl.54.9.1795. [DOI] [PubMed] [Google Scholar]
- 6.Aldrugh S., Sardana M., Henninger N., Saczynski J.S., McManus D.D. Atrial fibrillation, cognition and dementia: A review. J. Cardiovasc. Electrophysiol. 2017;28:958–965. doi: 10.1111/jce.13261. [DOI] [PMC free article] [PubMed] [Google Scholar]
- 7.Prystowsky E.N. Management of atrial fibrillation: therapeutic options and clinical decisions. Am. J. Cardiol. 2000;85:3–11. doi: 10.1016/s0002-9149(00)00908-5. [DOI] [PubMed] [Google Scholar]
- 8.Wilson R.E., Rush K.L., Hatt L., Reid R.C., Laberge C.G. The symptom experience of patients with atrial fibrillation before their initial diagnosis. J. Cardiovasc. Nurs. 2020;35:347–357. doi: 10.1097/JCN.0000000000000653. [DOI] [PubMed] [Google Scholar]
- 9.Im S., Kim D., Kim B. P3624 clinical and electrocardiographic characteristics for prediction of new-onset atrial fibrillation in asymptomatic patients with atrial premature complexes. Eur. Heart J. 2017;38 doi: 10.1016/j.ijcha.2018.05.002. [DOI] [PMC free article] [PubMed] [Google Scholar]
- 10.Rizwan A., Zoha A., Mabrouk I.B., Sabbour H.M., Al-Sumaiti A.S., Alomainy A., Imran M.A., Abbasi Q.H. A review on the state of the art in atrial fibrillation detection enabled by machine learning. IEEE Rev. Biomed. Eng. 2021;14:219–239. doi: 10.1109/RBME.2020.2976507. [DOI] [PubMed] [Google Scholar]
- 11.Panindre P., Gandhi V., Kumar S. IEEE 17th International Conference on Smart Communities: Improving Quality of Life Using ICT, IoT and AI. 2020. Comparison of performance of artificial intelligence algorithms for real-time atrial fibrillation detection using instantaneous heart rate; pp. 168–172. [Google Scholar]
- 12.Martis R.J., Acharya U., Prasad H., Chua C.K., Lim C.M. Automated detection of atrial fibrillation using bayesian paradigm. Knowl.-Based Syst. 2013;54:269–275. [Google Scholar]
- 13.Annavarapu A., Kora P. Ecg-based atrial fibrillation detection using different orderings of conjugate symmetric–complex Hadamard transform. Int. J. Cardiovasc. Acad. 2016;2:151–154. [Google Scholar]
- 14.Ribeiro A.H., Ribeiro M.H., Paixão G.M.M., Oliveira D.M., Gomes P.R., Canazart J.A., Ferreira M.P.S., Andersson C.R., Macfarlane P.W., Meira W., Jr., et al. Automatic diagnosis of the 12-lead ECG using a deep neural network. Nat. Commun. 2020;11:1760. doi: 10.1038/s41467-020-15432-4. [DOI] [PMC free article] [PubMed] [Google Scholar]
- 15.Zhu H., Cheng C., Yin H., Li X., Zuo P., Ding J., Lin F., Wang J., Zhou B., Li Y., et al. Automatic multilabel electrocardiogram diagnosis of heart rhythm or conduction abnormalities with deep learning: a cohort study. Lancet. Digit. Health. 2020;2:e348–e357. doi: 10.1016/S2589-7500(20)30107-2. [DOI] [PubMed] [Google Scholar]
- 16.Seshadri D.R., Bittel B., Browsky D., Houghtaling P., Drummond C.K., Desai M.Y., Gillinov A.M. Accuracy of apple watch for detection of atrial fibrillation. Circulation. 2020;141:702–703. doi: 10.1161/CIRCULATIONAHA.119.044126. [DOI] [PubMed] [Google Scholar]
- 17.Lubitz S.A., Faranesh A.Z., Atlas S.J., McManus D.D., Singer D.E., Pagoto S., Pantelopoulos A., Foulkes A.S. Rationale and design of a large population study to validate software for the assessment of atrial fibrillation from data acquired by a consumer tracker or smartwatch: The Fitbit heart study. Am. Heart J. 2021;238:16–26. doi: 10.1016/j.ahj.2021.04.003. [DOI] [PubMed] [Google Scholar]
- 18.Dörr M., Nohturfft V., Brasier N., Bosshard E., Djurdjevic A., Gross S., Raichle C.J., Rhinisperger M., Stöckli R., Eckstein J. The WATCH AF trial: SmartWATCHes for detection of atrial fibrillation. JACC. Clin. Electrophysiol. 2019;5:199–208. doi: 10.1016/j.jacep.2018.10.006. [DOI] [PubMed] [Google Scholar]
- 19.Wang Y.-C., Xu X., Hajra A., Apple S., Kharawala A., Duarte G., Liaqat W., Fu Y., Li W., Chen Y., Faillace R.T. Current advancement in diagnosing atrial fibrillation by utilizing wearable devices and artificial intelligence: A review study. Diagnostics. 2022;12:689. doi: 10.3390/diagnostics12030689. [DOI] [PMC free article] [PubMed] [Google Scholar]
- 20.Aljanabi M., Qutqut H., Hijjawi M. Machine learning classification techniques for heart disease prediction: A review. Int. J. Eng. Technol. 2018;7:5373–5379. [Google Scholar]
- 21.Attia Z.I., Noseworthy P.A., Lopez-Jimenez F., Asirvatham S.J., Deshmukh A.J., Gersh B.J., Carter R.E., Yao X., Rabinstein A.A., Erickson B.J., et al. An artificial intelligence-enabled ECG algorithm for the identification of patients with atrial fibrillation during sinus rhythm: A retrospective analysis of outcome prediction. Lancet. 2019;394:861–867. doi: 10.1016/S0140-6736(19)31721-0. [DOI] [PubMed] [Google Scholar]
- 22.Biton S., Gendelman S., Ribeiro A.H., Miana G., Moreira C., Ribeiro A.L.P., Behar J.A. Atrial fibrillation risk prediction from the 12-lead electrocardiogram using digital biomarkers and deep representation learning. Eur. Heart J. Digit. Health. 2021;2:576–585. doi: 10.1093/ehjdh/ztab071. [DOI] [PMC free article] [PubMed] [Google Scholar]
- 23.Raghunath S., Pfeifer J.M., Ulloa-Cerna A.E., Nemani A., Carbonati T., Jing L., vanMaanen D.P., Hartzel D.N., Ruhl J.A., Lagerman B.F., et al. Deep neural networks can predict new-onset atrial fibrillation from the 12-lead ECG and help identify those at risk of atrial fibrillation-related stroke. Circulation. 2021;143:1287–1298. doi: 10.1161/CIRCULATIONAHA.120.047829. [DOI] [PMC free article] [PubMed] [Google Scholar]
- 24.Diaz-Pinto A., Ravikumar N., Attar R., Suinesiaputra A., Zhao Y., Levelt E., Dall’Armellina E., Lorenzi M., Chen Q., Keenan T.D.L., et al. Predicting myocardial infarction through retinal scans and minimal personal information. Nat. Mach. Intell. 2022;4:55–61. [Google Scholar]
- 25.Singh J.P., Fontanarava J., de Massé G., Carbonati T., Li J., Henry C., Fiorina L. Short-term prediction of atrial fibrillation from ambulatory monitoring ecg using a deep neural network. Eur. Heart J. Digit. Health. 2022;3:208–217. doi: 10.1093/ehjdh/ztac014. [DOI] [PMC free article] [PubMed] [Google Scholar]
- 26.Blanche C., Tran N., Rigamonti F., Burri H., Zimmermann M. Value of p-wave signal averaging to predict atrial fibrillation recurrences after pulmonary vein isolation. Europace. 2013;15:198–204. doi: 10.1093/europace/eus251. [DOI] [PubMed] [Google Scholar]
- 27.Alcaraz R., Martínez A., Rieta J.J. Role of the p-wave high frequency energy and duration as noninvasive cardiovascular predictors of paroxysmal atrial fibrillation. Comput. Methods Programs Biomed. 2015;119:110–119. doi: 10.1016/j.cmpb.2015.01.006. [DOI] [PubMed] [Google Scholar]
- 28.Boon K.H., Khalil-Hani M., Malarvili M.B., Sia C.W. Paroxysmal atrial fibrillation prediction method with shorter HRV sequences. Comput. Methods Programs Biomed. 2016;134:187–196. doi: 10.1016/j.cmpb.2016.07.016. [DOI] [PubMed] [Google Scholar]
- 29.Boon K.H., Khalil-Hani M., Malarvili M.B. Paroxysmal atrial fibrillation prediction based on HRV analysis and non-dominated sorting genetic algorithm III. Comput. Methods Programs Biomed. 2018;153:171–184. doi: 10.1016/j.cmpb.2017.10.012. [DOI] [PubMed] [Google Scholar]
- 30.Khurshid S., Friedman S., Reeder C., Di Achille P., Diamant N., Singh P., Harrington L.X., Wang X., Al-Alusi M.A., Sarma G., et al. ECG-based deep learning and clinical risk factors to predict atrial fibrillation. Circulation. 2022;145:122–133. doi: 10.1161/CIRCULATIONAHA.121.057480. [DOI] [PMC free article] [PubMed] [Google Scholar]
- 31.Yuan N., Duffy G., Dhruva S.S., Oesterle A., Pellegrini C.N., Theurer J., Vali M., Heidenreich P.A., Keyhani S., Ouyang D. Deep learning of electrocardiograms in sinus rhythm from US veterans to predict atrial fibrillation. JAMA Cardiol. 2023;8:1131–1139. doi: 10.1001/jamacardio.2023.3701. [DOI] [PMC free article] [PubMed] [Google Scholar]
- 32.Dash S., Chon K.H., Lu S., Raeder E.A. Automatic real time detection of atrial fibrillation. Ann. Biomed. Eng. 2009;37:1701–1709. doi: 10.1007/s10439-009-9740-z. [DOI] [PubMed] [Google Scholar]
- 33.Mohebbi M., Ghassemian H. Prediction of paroxysmal atrial fibrillation based on non-linear analysis and spectrum and bispectrum features of the heart rate variability signal. Comput. Methods Programs Biomed. 2012;105:40–49. doi: 10.1016/j.cmpb.2010.07.011. [DOI] [PubMed] [Google Scholar]
- 34.Lee J., Nam Y., McManus D.D., Chon K.H. Time-varying coherence function for atrial fibrillation detection. IEEE Trans. Biomed. Eng. 2013;60:2783–2793. doi: 10.1109/TBME.2013.2264721. [DOI] [PubMed] [Google Scholar]
- 35.Guo Y., Wang H., Zhang H., Liu T., Li L., Liu L., Chen M., Chen Y., Lip G.Y.H. Photoplethysmography-based machine learning approaches for atrial fibrillation prediction: a report from the Huawei Heart Study. JACC. Asia. 2021;1:399–408. doi: 10.1016/j.jacasi.2021.09.004. [DOI] [PMC free article] [PubMed] [Google Scholar]
- 36.Grégoire J.M., Gilon C., Carlier S., Bersini H. Role of the autonomic nervous system and premature atrial contractions in short-term paroxysmal atrial fibrillation forecasting: Insights from machine learning models. Arch. Cardiovasc. Dis. 2022;115:377–387. doi: 10.1016/j.acvd.2022.04.006. [DOI] [PubMed] [Google Scholar]
- 37.Costin H., Rotariu C., Păsărică A. 8th International Symposium on Advanced Topics in Electrical Engineering. 2013. Atrial fibrillation onset prediction using variability of ECG signals; pp. 1–4. [Google Scholar]
- 38.Li Z., Derksen H., Gryak J., Ghanbari H., Gunaratne P., Najarian K. 40th Annual International Conference of the IEEE Engineering in Medicine and Biology Society. 2018. A novel atrial fibrillation prediction algorithm applicable to recordings from portable devices; pp. 4034–4037. [DOI] [PubMed] [Google Scholar]
- 39.Ebrahimzadeh E., Kalantari M., Joulani M., Shahraki R.S., Fayaz F., Ahmadi F. Prediction of paroxysmal atrial fibrillation: a machine learning based approach using combined feature vector and mixture of expert classification on hrv signal. Comput. Methods Programs Biomed. 2018;165:53–67. doi: 10.1016/j.cmpb.2018.07.014. [DOI] [PubMed] [Google Scholar]
- 40.Cho J., Kim Y., Lee M. International Workshop on Predictive Intelligence in Medicine. 2018. Prediction to atrial fibrillation using deep convolutional neural networks; pp. 164–171. [Google Scholar]
- 41.Jalali A., Lee M. Atrial fibrillation prediction with residual network using sensitivity and orthogonality constraints. IEEE J. Biomed. Health Inform. 2020;24:407–413. doi: 10.1109/JBHI.2019.2957809. [DOI] [PubMed] [Google Scholar]
- 42.Hannun A.Y., Rajpurkar P., Haghpanahi M., Tison G.H., Bourn C., Turakhia M.P., Ng A.Y. Cardiologist-level arrhythmia detection and classification in ambulatory electrocardiograms using a deep neural network. Nat. Med. 2019;25:65–69. doi: 10.1038/s41591-018-0268-3. [DOI] [PMC free article] [PubMed] [Google Scholar]
- 43.Mahmud T., Fattah S.A., Saquib M. Deeparrnet: An efficient deep CNN architecture for automatic arrhythmia detection and classification from denoised ECG beats. IEEE Access. 2020;8:104788–104800. [Google Scholar]
- 44.Jo Y.-Y., Cho Y., Lee S.Y., Kwon J.-m., Kim K.-H., Jeon K.-H., Cho S., Park J., Oh B.-H. Explainable artificial intelligence to detect atrial fibrillation using electrocardiogram. Int. J. Cardiol. 2021;328:104–110. doi: 10.1016/j.ijcard.2020.11.053. [DOI] [PubMed] [Google Scholar]
- 45.Pan J., Tompkins W.J. A real-time QRS detection algorithm. IEEE Transactions on Biomedical Engineering BME- IEEE Trans. Biomed. Eng. 1985;32:230–236. doi: 10.1109/TBME.1985.325532. [DOI] [PubMed] [Google Scholar]
- 46.Sedghamiz H. MATLAB implementation of Pan Tompkins ECG QRS detector. MathWorks File Exchange. 2014. https://www.mathworks.com/matlabcentral/fileexchange/45840
- 47.Himmelreich J.C.L., Lucassen W.A.M., Heugen M., Bossuyt P.M.M., Tan H.L., Harskamp R.E., van Etten-Jamaludin F.S., van Weert H.C.P.M. Frequent premature atrial contractions are associated with atrial fibrillation, brain ischaemia, and mortality: a systematic review and meta-analysis. Europace. 2019;21:698–707. doi: 10.1093/europace/euy276. [DOI] [PubMed] [Google Scholar]
- 48.Goldberger A.L., Amaral L.A., Glass L., Hausdorff J.M., Ivanov P.C., Mark R.G., Mietus J.E., Moody G.B., Peng C.-K., Stanley H.E. Physiobank, physiotoolkit, and physionet: components of a new research resource for complex physiologic signals. Circulation. 2000;101:e215–e220. doi: 10.1161/01.cir.101.23.e215. [DOI] [PubMed] [Google Scholar]
- 49.Moody G., Goldberger A., McClennen S., Swiryn S. Predicting the onset of paroxysmal atrial fibrillation: The computers in cardiology challenge 2001. Comput. Cardiol. 2001;28:113–116. [Google Scholar]
- 50.Gilon C., Grégoire J.-M., Hellinckx J., Carlier S., Bersini H. Reproducibility of machine learning models for paroxysmal atrial fibrillation onset prediction. Comput. Cardiol. 2022;49:1–4. [Google Scholar]
- 51.Tzou H.-A., Lin S.-F., Chen P.-S. Paroxysmal atrial fibrillation prediction based on morphological variant P-wave analysis with wideband ECG and deep learning. Comput. Methods Programs Biomed. 2021;211 doi: 10.1016/j.cmpb.2021.106396. [DOI] [PubMed] [Google Scholar]
- 52.Luo C., He X., Zhan J., Wang L., Gao W., Dai J. Comparison and benchmarking of ai models and frameworks on mobile devices. arXiv. 2020;2 doi: 10.48550/arXiv.2005.05085. Preprint at. [DOI] [Google Scholar]
- 53.Zhu H., Gavidia M., Montanari A.N., Fuentes J., Goncalves J., Xiaoyun Y. Early Warning of Atrial Fibrillation Using Deep Learning (Test Dataset) 2024 doi: 10.5281/zenodo.10815810. [DOI] [Google Scholar]
- 54.Gavidia M., Zhu H., Montanari A.N., Fuentes J., Xiaoyun Y., Goncalves J. 2024. WARN: Initial Release. [DOI] [Google Scholar]
Associated Data
This section collects any data citations, data availability statements, or supplementary materials included in this article.
Supplementary Materials
The movie illustrates, for each consecutive sampled window of ECG data, the corresponding RRI data, recurrence plot, and the probability of danger outputted by the neural network.
Data Availability Statement
The data were provided by Tongji Hospital from China, the Clínica y Maternidad Suizo Argentina, and the Groupe Hospitalier Privé Ambroise Paré-Hartmann (acquired between 2014 and 2022). To protect patients’ privacy, the data were anonymized. The data collection teams from each center handled sample collection and anonymization. The algorithm development team received anonymized data containing only age and gender information for the subsequent algorithm development. The study design was evaluated and exempted from a full review by the Huazhong University of Science and Technology Institutional Review Board (approval number TJ-IRB20220423) and approved by the Ethics Review Panel of the University of Luxembourg (approval number ERP 22-057 RTMonitor). All data were obtained according to the principles of the declaration of Helsinki.
The testing data are publicly available at Zenodo (https://doi.org/10.5281/zenodo.10815810).53 The Physionet data used as part of the external validation of this study are available from the open-access paroxysmal AF Prediction Challenge Database48,49 (https://physionet.org/content/afpdb/1.0.0/).
Data preprocessing and segmentation were implemented using MATLAB software. The neural network was implemented on the Keras Framework with the Tensorflow backend on Python 3.7. Codes have been deposited on Zenodo (https://doi.org/10.5281/zenodo.10815367).54


