# RHYTHMI: A Deep Learning-Based Mobile ECG Device for Heart Disease Prediction
## 5 Results and Discussion  
We employed a two-pronged approach to evaluate Rhythmi's effectiveness:  
* _Data-driven training and testing:_ As illustrated in Figure 4, we initially trained and tested the deep learning model using the established MIT-BIH + BIDMC dataset. This dataset provided a foundation for the model's learning process. * _Real-world testing with human participants:_ Following the initial data-driven evaluation, we conducted real-time experiments to assess Rhythmi's performance in practical scenarios. Many live tests were carried out directly on participants at exhibitions and competitions we participated in (see Figure 9). For ethical considerations, consent for data usage from each participant was obtained. The trials conducted during our participation in exhibitions and competitions involved 82 male and 21 female participants aged between 13 and 69. Sixty-four of the tested participants were above the age of 40. This real-world testing provided valuable insights into the model's ability to function effectively with actual users. Real-time monitoring involves the ECG sensor continuously capturing and analyzing changes in the ECG signal as it is acquired. The signal is then immediately uploaded to Rhythmi for prediction, providing results within seconds, eliminating the need for prolonged wait times. The medical report is generated using only the first three heartbeats of the segmented ECG signal due to display limitations. This offers a brief overview of the cardiac activity. Heart rate variability (HRV) is calculated by identifying QRS complexes  
Figure 8: RHYTHMI’s application website ([[https://www.Hythmi.org/](https://www.Hythmi.org/)]([https://www.Hythmi.org/](https://www.Hythmi.org/))). Figure 9: A scene from a real-time testing trial of our developed mobile ECG device at one of the exhibitions we participated in. and measuring the intervals between them. It is crucial to understand that the provided recommendations and explanations based on the predicted heart condition are general in nature and cannot replace personalized medical advice. Recommendations are general guidelines based on real-world physician expertise for similar cases. Figure 10 showcases the ECG diagnosis results obtained using the Rhythmi prototype on various individuals. It demonstrates the system's ability to differentiate between normal and abnormal heart rhythm cases. During real-world testing, 103 individuals participated in using Rhythmi to check their heart health. The analysis categorized 70 of these cases as normal heart rhythms, while the remaining 33 fell into the abnormal category (see Figure 11). To assess Rhythmi's accuracy in real-world scenarios, we compared the model's diagnoses with evaluations by medical professionals. After consulting the generated reports from 103 participants with doctors, the results showed a 97.08% agreement between Rhythmi's analysis and doctor diagnoses. Figure 11: Number of individuals tested at different exhibitions and competitions and their diagnosis. Figure 10: Rhythmi real-time ECG test results for normal (**left**) and abnormal (**right**) cases. To assess Rhythmi's performance using data, we conducted a rigorous testing process on the established MIT-BIH and BIDMC databases. This evaluation employed a 5-fold validation, which ensures a robust and reliable analysis. Figure 12 shows the model's performance during training and validation. It shows both the accuracy and the loss (error) over all the training epochs (iterations). Here, you can see that the training stopped at epoch 12. This was not due to a set limit but because a technique called early stopping was employed. Early stopping is a crucial mechanism that helps prevent overfitting. This occurs when a model becomes too focused on the specific training data it sees and loses its ability to generalize well when presented with unseen data. Here is how early stopping works: We monitor the model's performance on a separate validation set during training.