Detection of Atrial Fibrillation in ECG Hand-held Devices Using a Random Forest Classifier

Morteza Zabihi, Ali Bahrami Rad, Aggelos K. Katsaggelos, Serkan Kiranyaz, Susanna Narkilahti, Moncef GabboujCinC 2017

Introduction

Atrial Fibrillation (AF) is a prevalent cardiac arrhythmia characterized by chaotic heart rhythms, significantly elevating the risk of stroke, heart failure, and blood clots. While standard 12-lead clinical electrocardiograms (ECGs) remain the gold standard for diagnosis, they are often unsuitable for long-term or intermittent monitoring outside clinical settings. Portable, single-lead ECG devices, such as those developed by AliveCor, have emerged as a viable alternative for daily "spot-check" monitoring.

However, these hand-held devices introduce significant technical challenges. Portable recordings are highly susceptible to motion artifacts and electrical noise. Furthermore, the variable positioning of the device—whether held between hands or pressed against the chest—leads to inconsistent signal morphology. Distinguishing AF from other irregular rhythms or purely noisy signals requires a robust and sophisticated automated classification system. This paper details a high-accuracy machine learning pipeline designed to address these complexities, which achieved a top-tier ranking in the 2017 PhysioNet/Computing in Cardiology (CinC) Challenge.

Methodology

The proposed system utilizes a hybrid classification architecture comprising three primary stages: preprocessing, feature engineering, and classification.

Preprocessing and Feature Engineering

Initial signal processing involves denoising via sparse derivative decomposition to eliminate baseline wander and high-frequency interference. The core of the methodology lies in the extraction of 491 hand-crafted features spanning five distinct domains:

  1. Time-domain: Statistical analysis of RR intervals and P-wave/T-wave morphology.
  2. Frequency-domain: Power spectral density estimation using Burg’s method.
  3. Time-Frequency: Wavelet-based entropies (Shannon, Tsallis, and Rényi) to capture non-stationary signal dynamics.
  4. Phase Space (Nonlinear): Higher-dimensional reconstruction of the ECG signal to analyze rhythmic geometry via Poincaré plots and parabolic mappings.
  5. Meta-level Features: A "stacking" ensemble approach where predictions from three base-level classifiers—Linear Discriminant Analysis (LDA), Quadratic Discriminant Analysis (QDA), and a preliminary Random Forest (RF1)—serve as additional inputs for the final model.

Classification Pipeline

The classification process employs a Random Forest (RF) model. Feature selection is performed by ranking the 491 features based on entropy reduction, selecting the top 150 for the final stage. The final classification into four categories—Normal (sinus rhythm), AF, Other rhythm, and Noisy—is executed by a 500-tree Random Forest (RF2).

The proposed hybrid classification pipeline, illustrating the stacking approach with base-level and meta-level features.

Dataset

The model was developed and validated using the PhysioNet/CinC Challenge 2017 dataset, which contains 8,528 single-lead ECG recordings sampled at 300 Hz from AliveCor devices.

Results and Discussion

The multi-domain feature approach proved highly effective in capturing the chaotic nature of AF. By focusing on relative wave morphology and RR intervals rather than absolute voltage, the algorithm maintained lead independence, ensuring reliability across different device placements. The inclusion of meta-level features allowed the model to effectively "learn from its own predictions," enhancing overall robustness.

Performance metrics (F1-scores) for the training and testing datasets across four classification categories.

As shown in the results table, the algorithm tied for first place in the global 2017 CinC Challenge, achieving an overall F1-score of 83% on the unseen testing set. Performance was strongest for "Normal" rhythms (90.87% F1-score). Conversely, "Noisy" signals presented the greatest challenge, with an F1-score of 50.42%, reflecting the inherent difficulty in classifying heavily corrupted data.

Conclusion

This research demonstrates that a Random Forest-based pipeline, enriched with multi-domain and meta-level features, can accurately detect AF in single-lead ECG recordings from hand-held devices. While the model excels at snapshot classification, future work will focus on addressing transitional states between rhythms and improving the distinction between AF and similar "Other" arrhythmias. The authors suggest that sequential classification architectures, such as Recurrent Neural Networks (RNNs) or Hidden Markov Models (HMMs), may further enhance performance by capturing the temporal evolution of cardiac rhythms.

Summary updated

BibTeX
@inproceedings{zabihi2017detection,
  author = {Morteza Zabihi and Ali Bahrami Rad and Aggelos K. Katsaggelos and Serkan Kiranyaz and Susanna Narkilahti and Moncef Gabbouj},
  title = {{Detection of Atrial Fibrillation in ECG Hand-held Devices Using a Random Forest Classifier}},
  booktitle = {CinC},
  year = {2017},
  doi = {10.22489/cinc.2017.069-336},
}
Figure