Atrial fibrillation (AF) is the most common type of heart rhythm disorder worldwide. Early recognition of brief episodes of atrial fibrillation can provide important diagnostic information and lead to prompt treatment. AF is mainly characterized by an irregular heartbeat. Today, many personal devices such as smartphones, smartwatches, smart rings, or small wearable medical devices can detect heart rhythm. Sensors can acquire different types of heart-related signals and extract the sequence of inter-beat intervals, i.e., the instantaneous heart rate. Various algorithms, some of which are very complex and require significant computational resources, are used to recognize AF based on inter-beat intervals (RR). This study aims to verify the possibility of using neural networks algorithms directly on a microcontroller connected to sensors for AF detection. Sequences of 25, 50, and 100 RR were extracted from a public database of electrocardiographic signals with annotated episodes of atrial fibrillation. A custom 1D convolutional neural network (1D-CNN) was designed and then validated via a 5-fold subject-wise split cross-validation scheme. In each fold, the model was tested on a set of 3 randomly selected subjects, which had not previously been used for training, to ensure a subject-independent evaluation of model performance. Across all folds, all models achieved high and stable performance, with test accuracies of 0.963 +/- 0.031, 0.976 +/- 0.022, and 0.980 +/- 0.023, respectively, for models using 25 RR, 50 RR, and 100 RR sequences. Precision, recall, F1-score, and AUC-ROC exhibited similarly high performance, confirming robust generalization across unseen subjects. Performance systematically improved with longer RR windows, indicating that richer temporal context enhances discrimination of AF rhythm irregularities. A complete Edge AI prototype integrating a low-power ECG analog front-end, an ARM Cortex M7 microcontroller and an IoT transmitting module was utilized for realistic tests. Inferencing time, peak RAM usage, flash usage and current absorption were measured. The results obtained show the possibility of using neural network algorithms directly on microcontrollers for real-time AF recognition with very low power consumption. The prototype is also capable of sending the suspicious ECG trace to the cloud for final validation by a physician. The proposed methodology can be used for personal screening not only with ECG signals but with any other signal that reproduces the sequence of heartbeats (e.g., photoplethysmographic, pulse oximetric, pressure, accelerometric, etc.).
An Edge AI Approach for Low-Power, Real-Time Atrial Fibrillation Detection on Wearable Devices Based on Heartbeat Intervals
Esposito D.
2025
Abstract
Atrial fibrillation (AF) is the most common type of heart rhythm disorder worldwide. Early recognition of brief episodes of atrial fibrillation can provide important diagnostic information and lead to prompt treatment. AF is mainly characterized by an irregular heartbeat. Today, many personal devices such as smartphones, smartwatches, smart rings, or small wearable medical devices can detect heart rhythm. Sensors can acquire different types of heart-related signals and extract the sequence of inter-beat intervals, i.e., the instantaneous heart rate. Various algorithms, some of which are very complex and require significant computational resources, are used to recognize AF based on inter-beat intervals (RR). This study aims to verify the possibility of using neural networks algorithms directly on a microcontroller connected to sensors for AF detection. Sequences of 25, 50, and 100 RR were extracted from a public database of electrocardiographic signals with annotated episodes of atrial fibrillation. A custom 1D convolutional neural network (1D-CNN) was designed and then validated via a 5-fold subject-wise split cross-validation scheme. In each fold, the model was tested on a set of 3 randomly selected subjects, which had not previously been used for training, to ensure a subject-independent evaluation of model performance. Across all folds, all models achieved high and stable performance, with test accuracies of 0.963 +/- 0.031, 0.976 +/- 0.022, and 0.980 +/- 0.023, respectively, for models using 25 RR, 50 RR, and 100 RR sequences. Precision, recall, F1-score, and AUC-ROC exhibited similarly high performance, confirming robust generalization across unseen subjects. Performance systematically improved with longer RR windows, indicating that richer temporal context enhances discrimination of AF rhythm irregularities. A complete Edge AI prototype integrating a low-power ECG analog front-end, an ARM Cortex M7 microcontroller and an IoT transmitting module was utilized for realistic tests. Inferencing time, peak RAM usage, flash usage and current absorption were measured. The results obtained show the possibility of using neural network algorithms directly on microcontrollers for real-time AF recognition with very low power consumption. The prototype is also capable of sending the suspicious ECG trace to the cloud for final validation by a physician. The proposed methodology can be used for personal screening not only with ECG signals but with any other signal that reproduces the sequence of heartbeats (e.g., photoplethysmographic, pulse oximetric, pressure, accelerometric, etc.).I documenti in IRIS sono protetti da copyright e tutti i diritti sono riservati, salvo diversa indicazione.


