SAFIAH BINTI AZMI D/A SITI SABARIAH BINTI SALIHIN POLITEKNIK SULTAN SALAHUDDIN ABDUL AZIZ SHAH
Cardiovascular diseases remain the leading cause of mortality worldwide, with arrhythmias representing a major class of cardiac disorders that can lead to severe complications if not detected early. Continuous electrocardiogram (ECG) monitoring is essential for timely diagnosis and treatment. However, conventional ECG monitoring systems are often bulky, expensive, and limited to hospital environments, reducing their suitability for portable and continuous home-based monitoring. Therefore, this project proposes a low-cost and portable real-time ECG-based arrhythmia detection and classification system using Machine Learning (ML) on an embedded ESP32 platform. The proposed system integrates an AD8232 ECG sensor, ESP32 microcontroller, and a web-based ECG monitoring dashboard for real-time ECG signal acquisition, visualization, and remote monitoring. ECG data from the MIT-BIH Arrhythmia Database were used to train and compare three ML models: Logistic Regression, Linear Support Vector Machine (SVM), and Random Forest. Experimental results showed that the Random Forest model achieved the best performance with an accuracy of 98.31% and sensitivity of 86.99%. The trained Random Forest model was serialized using Joblib and embedded into the ESP32 for real-time classification. The captured ECG signals were preprocessed using a lightweight Butterworth filter to reduce noise and improve signal quality before classification. Additionally, a PostgreSQL database was incorporated for long-term ECG data storage and monitoring. The proposed PREDACE-ML system was validated against a conventional ECG machine and achieved an average percentage error of 6.24% and an average accuracy of 93.77%, demonstrating reliable performance comparable to the reference ECG machine. These findings confirm the feasibility of implementing machine learning-based arrhythmia detection on an embedded platform for continuous and accessible cardiac monitoring.