Key result
XGBoost outperforms Random Forest with ~12% higher macro-F1 for ECG arrhythmia classification.
Why the study?
Reliable ECG heartbeat classification for detecting cardiac arrhythmias remains challenging due to severe class imbalance and inter-individual variations in ECG patterns.
Does XGBoost improve subject-independent ECG arrhythmia heartbeat classification performance compared to Random Forest in the MIT-BIH Arrhythmia Database?
Observational (n=43)
Does XGBoost improve subject-independent ECG arrhythmia heartbeat classification performance compared to Random Forest in the MIT-BIH Arrhythmia Database?
In subject-independent ECG arrhythmia classification, overall accuracy masks poor minority-class detection (the accuracy paradox), highlighting the necessity of using balanced accuracy and macro-F1 metrics in medical AI evaluation.
Answers are grounded in this paper and cite their sources.
Machine learning ECG classifiers need refinement before clinical use; leaves open whether imbalance techniques can improve generalization to unseen patients.
Electrocardiogram (ECG) heartbeat classification is an important task for detecting cardiac arrhythmias. However, reliable classification remains challenging because of severe class imbalance and variations in ECG patterns across individuals. This study investigates the performance of two traditional machine learning models, Random Forest (RF) and XGBoost, for subject-independent ECG heartbeat classification using the MIT-BIH Arrhythmia Database. A total of 100,693 heartbeat segments from 43 subjects were classified into four categories: non-ectopic (N), supraventricular ectopic (S), ventricular ectopic (V), and fusion (F) beats. The dataset exhibited substantial class imbalance, with the fusion class accounting for only 0.80\% of all beats. A feature-based approach was developed using waveform-derived statistical and wavelet features, together with RR-interval features. Both classifiers were evaluated using a 43-fold Leave-One-Subject-Out (LOSO) protocol across three random seeds to assess their generalization to unseen subjects. Performance was measured using accuracy, balanced accuracy, macro-averaged F1-score, and class-wise evaluation metrics. XGBoost achieved a mean macro-F1 score of 0.4950 ± 0.0126 and balanced accuracy of 0.5243 ± 0.0152, outperforming Random Forest, which achieved 0.4413 ± 0.0108 and 0.4623 ± 0.0050, respectively. In contrast, Random Forest achieved higher overall accuracy (0.9212 ± 0.0072) than XGBoost (0.8615 ± 0.0045). Both models showed substantial difficulty identifying fusion beats, with near-zero F1-scores across all evaluated seeds. These findings illustrate the accuracy paradox in a medical AI setting: overall accuracy alone may not adequately represent model performance in highly imbalanced, subject-independent ECG classification. The results also highlight the persistent challenges of minority-class recognition and generalization across individuals.
No takes yet. Share an insight, caveat, or question.
Sahed et al. (2026) conducted an observational in Cardiac arrhythmias (n=43). XGBoost classifier vs. Random Forest (RF) classifier was evaluated on Subject-independent ECG heartbeat classification performance (mean macro-F1 score, balanced accuracy, and overall accuracy). XGBoost outperformed Random Forest in macro-F1 and balanced accuracy for ECG arrhythmia classification, despite lower overall accuracy.
Synapse has enriched 10 related papers. Consider them for comparative context: