AI-Powered Silent AFib Detection and Ischemic Stroke Risk Prediction via 3-Lead ECG
CWSF · 2026 Disease & Illness Silver Medal
Overview
Every 40 seconds someone has a stroke and up to 30% are caused by a heart condition called atrial fibrillation that produces zero warning signs until it's too late. We built a portable heart monitor using a $12 Arduino device with three chest electrodes that records 60 seconds of heart activity and feeds it into a deep learning model we trained on over 8,500 real patient recordings. Our model correctly identified 103 out of 111 real atrial fibrillation cases in patients it had never seen before, achieving accuracy that matches cardiologist-level detection. It then calculates a personalized annual stroke risk percentage and shows how much that risk drops if the patient starts treatment. A hospital heart monitor costs $800; ours costs $12, requires no specialist, and could detect this silent condition years before a stroke ever happens.
Video
This video could not be played here. Watch it on the original project page.
Video
[0:00] Maanya Hi, I'm Maanya Shah, and alongside my partner Aarsh Patel, we built a $12 portable ECG system that detects silent atrial fibrillation - the leading cardiac cause of stroke, before it ever happens.
[0:12] Maanya AFib causes 1 in 4 strokes globally. 30% of cases are completely silent. A critical 1 to 5 year window exists where detection and treatment reduces stroke risk by 65%. Most people never get screened.
[0:24] Aarsh We built a 3-electrode ECG device using an Arduino and BioAmp EXG Pill for $12. It records 60 seconds of cardiac activity and feeds it into our AI pipeline.
[0:33] Maanya Our CNN-LSTM hybrid analyzes the raw waveform. A Random Forest analyzes 15 heart rhythm statistics. Together they generate an AFib probability and a personalized annual stroke risk; explainable through SHAP and Grad-CAM.
[0:45] Aarsh AUC 0.9715. 92.8% sensitivity. 103 out of 111 AFib cases correctly identified, matching cardiologist-level detection from Nature Medicine.
[0:53] Maanya Early detection. Accessible screening. For everyone. A silent killer. A $12 solution.
Why?
Our Inspiration
“Aarsh, Maanya, your grandfather is in the hospital.”
Those words changed everything. Our grandfather had suffered a stroke unexpectedly. Watching his recovery, the medication, the long-term effects, made us ask a simple question: what if we had known earlier?
We discovered that atrial fibrillation (AFib), a heart rhythm disorder, causes 1 in 4 strokes globally, yet 30% of cases show no symptoms until a stroke occurs(more data in Kaplan-Meier-Curve - Figure 2). Even more critically, research shows a 1–5 year window exists where early detection and treatment can reduce stroke risk by 65–70%.
Despite this, most people are never screened. Current detection methods, like Holter monitors, cost $800–$2000, require specialists, and are inaccessible in many communities.
Our Goal
To create a system that makes early detection possible for everyone, not just those with access to hospitals. We aimed to create a tool that is low-cost, portable, and simple enough to be used outside hospitals, while still producing clinically meaningful results. By combining ECG signal analysis with artificial intelligence and established clinical risk scoring, we sought to bridge the gap between detection and decision-making.
Research Question
Can a low-cost ($12) ECG system combined with AI detect silent AFib and estimate stroke risk early enough to enable preventative treatment?
Why It Matters
Early detection does not just improve accuracy; it enables intervention before damage occurs. By identifying AFib during this 1–5 year window, patients can begin anticoagulation treatment and significantly reduce their risk of stroke by 65-70 %.
How?
Overview
We developed a complete system that captures heart signals, processes them, and uses artificial intelligence to detect atrial fibrillation (AFib) and estimate stroke risk.
Building the Device
We built a low-cost ECG device using an Arduino microcontroller, BioAmp EXG Pill, and three electrodes. This setup records 30–60 seconds of heart activity as a single-lead ECG signal. It was designed to be simple, portable, and usable outside of hospitals - to reduce the cost of those who use the tool.
Data Collection and Justification
To train our models, we used the PhysioNet CinC 2017 dataset, which contains 8,528 labelled single-lead ECG recordings from real patients. This dataset is widely used in medical research and was chosen because it matches the type of signal produced by our device, ensuring that our model learns from clinically reliable data. Yes, our model is accurate; however, it was much easier to find 9000 samples from a source rather than taking 9000 individual recordings from our ECG.
Signal Processing
Each recording was cleaned using filtering techniques to remove noise and electrical interference. We then standardized the signal so that all recordings could be compared fairly.
Model Development
We trained five machine learning models to detect AFib. Our best model was a CNN-LSTM hybrid:
A CNN (Convolutional Neural Network) learns patterns in the shape of the ECG signal
An LSTM (Long Short-Term Memory network) learns how the heartbeat rhythm changes over time
Model Evaluation
We evaluated performance using AUC (Area Under the Curve), which measures how well the model distinguishes AFib from normal rhythm. Our best model achieved an AUC of 0.9715, meaning it performs with very high accuracy.
Output:
The final system outputs AFib probability and combines it with a clinical scoring system (CHA₂DS₂-VASc) to generate a personalized annual stroke risk.
What?
Model Comparison
We trained and evaluated five machine learning models: Logistic Regression, Support Vector Machine (SVM), Random Forest, XGBoost, and a CNN-LSTM hybrid. The traditional models relied on 15 hand-crafted heart rhythm features (HRV), such as RR interval variability and statistical measures of heartbeat timing.
Logistic Regression established a baseline with an AUC of 0.871. More advanced models improved performance, with SVM achieving 0.937 and Random Forest 0.928. XGBoost reached 0.922 through sequential error correction. However, all four models plateaued below an AUC of 0.94, indicating a limitation in their ability to capture the full complexity of ECG signals. These models analyze summarized statistics, but do not process the raw waveform itself.
CNN-LSTM Performance
The CNN-LSTM hybrid model addressed this limitation by analyzing the full ECG signal, consisting of 9,000 data points per recording. The convolutional layers learned local waveform features such as the absence of P-waves and irregular baseline patterns, while the LSTM layer captured long-term rhythm irregularity across the recording.
This model achieved an AUC-ROC of 0.9715, a sensitivity of 92.79%, and a specificity of 91.9%. Out of 111 AFib cases in the test set, 103 were correctly identified, with only 8 missed cases. These results demonstrate that combining waveform morphology and temporal rhythm analysis significantly improves detection performance compared to feature-based models.
Validation and Reliability
To ensure the model’s performance was not dependent on a single data split, we conducted 5-fold cross-validation. The CNN-LSTM achieved a mean AUC of 0.9715 with a standard deviation of ±0.011, indicating consistent performance across different subsets of the data.
We also performed ablation analysis to test the importance of each component. Removing either the CNN or LSTM reduced performance, confirming that both waveform analysis and rhythm modelling are necessary for accurate AFib detection.
Threshold Optimization
In clinical screening, minimizing missed cases is more important than maximizing overall accuracy. The default classification threshold of 0.5 resulted in 23 missed AFib cases. By analyzing the ROC curve, we selected an optimized threshold of 0.404, reducing missed cases to 8. This represents a 65% reduction in false negatives, significantly increasing the number of patients who could be identified for follow-up care.
Explainability and Clinical Alignment
SHAP analysis identified entropy_rr and pNN50, both measures of heartbeat irregularity, as the most influential features in prediction. This aligns with known clinical markers of AFib, confirming that the model is learning meaningful physiological patterns rather than noise.
Grad-CAM visualizations further showed that the model focused on specific segments of the ECG where irregular rhythms occurred, providing interpretable evidence for each prediction.
Final System Output
The final system combines the CNN-LSTM and Random Forest predictions into a single AFib probability, which is then integrated with the CHA₂DS₂-VASc clinical scoring system. This produces a personalized annual stroke risk estimate, transforming a binary classification into a clinically actionable decision-making tool.
So What?
Our results demonstrate that the system can accurately detect atrial fibrillation, identifying 103 out of 111 AFib cases with high sensitivity. However, accurate detection alone does not imply early detection. To establish clinical impact, it is essential to understand when AFib occurs relative to stroke.
Extensive clinical research shows that AFib typically develops 1–5 years before a stroke occurs, with studies such as the Framingham Heart Study and the ASSERT trial demonstrating that asymptomatic AFib can be detected years before the first neurological event. This means that detecting AFib is not simply identifying a condition; it is identifying a known precursor to stroke within a preventable time window.
Our system does not directly predict when a stroke will happen. Instead, it detects the presence of AFib during this established pre-stroke period and combines it with CHA₂DS₂-VASc clinical risk scoring to estimate a patient’s annual stroke probability. This transforms detection into actionable risk assessment, allowing patients to begin anticoagulation therapy that reduces stroke risk by 65–70%.
Therefore, the significance of detecting 103 out of 111 AFib cases is not just diagnostic accuracy. Each correctly identified case represents a patient who can be flagged during the pre-stroke window, referred for confirmation, and treated before a stroke occurs.
In this way, the system enables early intervention not by predicting the exact timing of a stroke, but by identifying the biological condition that causes it, while it is still preventable.
What's Next?
Clinical Validation
The immediate next step is prospective testing on patients across diverse demographics, validating generalization beyond PhysioNet to real-world recordings from different devices and populations.
Expanding Access
Integrating the system into a mobile application would eliminate the laptop requirement entirely, making accessible-screening on a smartphone in any community worldwide.
Continuous Monitoring
Incorporating wearable ECG technology would enable continuous at-home AFib monitoring rather than single-point screening, catching paroxysmal AFib episodes that a 60-second recording might miss.
Broader Application
The same CNN-LSTM pipeline could extend to detecting other cardiac arrhythmias beyond AFib, expanding the system into a comprehensive portable cardiac screening-platform.
Thanks
We received lots of guidance and support throughout this project. We would like to specifically thank:
Dr.Shivaji Bikram Silwal - Alka Hospital (Sr. Invasive/Non-Invasive Cardiologist)
Dr.Hridayesh - Alka Hospital (Neurosurgeon)
Lead Alzheimer's Researcher at Penn
References
1) Lippi et al. (2021). Global epidemiology of atrial fibrillation. Eur J Intern Med.
2) Freedman et al. (2016). Screening for AF. JACC. 68(25):2799–2819.
3) January et al. (2019). AHA/ACC/HRS AFib Guidelines. JACC.
4) Goldberger et al. (2017). PhysioNet CinC Challenge 2017 — AF Classification from a Short Single Lead ECG Recording. PhysioNet.
5) Teijeiro et al. (2018). Arrhythmia classification from the 12-lead ECG using the CinC 2017 dataset. PMC. 5978770.
6) Thinh Dvo (2023). Atrial fibrillation detection — 99% accuracy. Kaggle.
7) Lip et al. (2019). CHA₂DS₂-VASc stroke risk stratification in atrial fibrillation — validated scoring and annual risk tables. PMC. 6515763.
8) AI or Large Language Model-generated text: OpenAI. (2023). ChatGPT (Mar 14 version) [Large language model]. https://chat.openai.com/chat
9) Image: Comparison of Kaplan–Meier Survival Curves among Different Patient... | Download Scientific Diagram, www.researchgate.net/figure/Comparison-of-Kaplan-Meier-survival-curves-among-different-patient-groups-A-All_fig3_384921945. Accessed 1 May 2026.
Images (22)
Awards (2)
- Silver Medal
- Selected for CWSF 2026
Competition history
- CWSF 2026
Related projects
ISEF · 2025
RhythmTrack AI- A Cost-Effective Stationary Monitoring Device for the Detection of Atrial Fibrillation (AF) Using a Three-Electrodes Configuration on Einthoven's Triangle by CNN-LSTM-Based AI Model
ISEF · 2018
The Development of a Holistic Cardiovascular Disease Screening System Utilizing a Low-Cost Electrocardiogram and a Machine Learning Algorithm
JSHS · 2020
An Active Role for Machine Learning in the Diagnosis of Atrial Fibrillation Quentin Hughes Minnetonka High School
ISEF · 2020
An Active Role for Machine Learning in the Diagnosis of Atrial Fibrillation
ISEF · 2026
GuardianLink: A Personalized Neuro-Cardiological Health-Monitoring System for Real-Time Heart Arrhythmia Detection, Prediction, and Analysis Through an Adaptive Machine Learning Framework With an ECG Necklace and Biometric Smartwatch
ISEF · 2021
An Active Role for Machine Learning in the Diagnosis of Cardiac Arrhythmias, Year Two
ISEF · 2017
An Early Myocardial Infarction Detection System Using Complex Artificial Intelligence
ISEF · 2023
Rapid Cardiac Screening Using Deep Learning: A Novel Interpretable AI Model for Cardiovascular Health Assessment
Closest projects by meaning, across every fair and year in the corpus.