Related Experiment Video
Updated: Nov 6, 2025

Semi-automated Optical Heartbeat Analysis of Small Hearts
Published on: September 16, 2009
Real-Time Heart Arrhythmia Detection Using Apache Spark Structured Streaming
Sadegh Ilbeigipour1, Amir Albadvi1, Elham Akhondzadeh Noughabi1
1Department of Information Technology Engineering, Industrial and Systems Engineering Faculty, Tarbiat Modares University, Tehran, Iran.
Insights
This study introduces a real-time cardiac arrhythmia detection system using Apache Spark Structured Streaming. The machine learning pipeline significantly reduces detection delays and improves classification performance for critical heart rhythm monitoring.
Area of Science:
- Biomedical Engineering
- Computer Science
- Cardiology
Background:
- Cardiac arrhythmias are a leading cause of mortality worldwide.
- Electrocardiogram (ECG) analysis is crucial for diagnosing arrhythmias, but real-time monitoring is needed due to intermittent symptoms.
- Timely detection of arrhythmias through continuous ECG analysis can prevent life-threatening incidents.
Purpose of the Study:
- To implement a machine learning pipeline for real-time cardiac arrhythmia detection using Apache Spark Structured Streaming.
- To evaluate the impact of Structured Streaming on classification performance and detection delay.
- To compare the performance of different machine learning classifiers for arrhythmia detection.
Main Methods:
- Utilized the Apache Spark Structured Streaming module for real-time ECG data analysis.
- Developed and compared three multiclass classifiers: decision trees, random forest, and logistic regression.
- Trained and evaluated models on ECG data from the MIT/BIH database, focusing on normal beats, RBBB, and atrial fibrillation.
Main Results:
- The random forest classifier demonstrated superior performance compared to decision trees and logistic regression.
- The implemented pipeline achieved significant reductions in runtime, especially with an increased number of class labels.
- The study validated previous findings in classification model performance metrics.
Conclusions:
- Apache Spark Structured Streaming offers a viable and efficient platform for real-time cardiac arrhythmia detection.
- The random forest classifier is effective for classifying arrhythmias in real-time ECG data.
- This approach enhances timely arrhythmia detection, potentially improving patient outcomes and reducing healthcare burdens.
Abstract:
One of the major causes of death in the world is cardiac arrhythmias. In the field of healthcare, physicians use the patient's electrocardiogram (ECG) records to detect arrhythmias, which indicate the electrical activity of the patient's heart. The problem is that the symptoms do not always appear and the physician may be mistaken in the diagnosis. Therefore, patients need continuous monitoring through real-time ECG analysis to detect arrhythmias in a timely manner and prevent an eventual incident that threatens the patient's life. In this research, we used the Structured Streaming module built top on the open-source Apache Spark platform for the first time to implement a machine learning pipeline for real-time cardiac arrhythmias detection and evaluate the impact of using this new module on classification performance metrics and the rate of delay in arrhythmia detection. The ECG data collected from the MIT/BIH database for the detection of three class labels: normal beats, RBBB, and atrial fibrillation arrhythmias. We also developed three decision trees, random forest, and logistic regression multiclass classifiers for data classification where the random forest classifier showed better performance in classification than the other two classifiers. The results show previous results in performance metrics of the classification model and a significant decrease in pipeline runtime by using more class labels compared to previous studies.
Related Concept Videos
Pulse rhythm
Conversely, an irregular pulse pattern is termed dysrhythmia, stemming from disruptions in cardiac...
Disturbances in Heart Rhythm
Arrhythmias are categorized by their speed, rhythm, and origin. A slow heart...
Mechanism of Cardiac Arrhythmias
Electrocardiogram
Three major waveforms are present in a typical ECG recording: the P wave, the QRS complex, and...
Dysrhythmias V: Evaluating Dysrhythmias
Holter Monitor: 24-Hour Monitoring

