The Accuracy Paradox in Medical AI: Evidence from Subject-Independent ECG Arrhythmia Classification

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.

Authors

Publication Details

Journal
Preprints.org
Published
2026-11-24
DOI
https://doi.org/10.20944/preprints202611.2459.v1
Primary Topic
ECG Monitoring and Analysis
Type
preprint
Controls
|||
ALL TIME
JAN
FEB
MAR
APR
MAY
JUN
JUL
AUG
SEP
OCT
NOV
preprint

The Accuracy Paradox in Medical AI: Evidence from Subject-Independent ECG Arrhythmia Classification

Fatih Özaydin, Maorufa Zaman, Haris Md. Sahed
5 links
Preprints.org
ECG Monitoring and Analysis
preprint

The Accuracy Paradox in Medical AI: Evidence from Subject-Independent ECG Arrhythmia Classification

Fatih Özaydin, Maorufa Zaman, Haris Md. Sahed
preprint en

Abstract

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.

Preprints.org
Good health and well-being
ECG Monitoring and Analysis
AI Navigator

Ask Laika to Summarize, Analyze, and Connect papers live on the map.

Summarize Papers & Methodologies

Extract key findings, datasets, and comparative methods across publications.

Benchmark Rankings & Visual Analytics

Rank top research institutions, authors, funders, topics, and journals by Field-Weighted Citation Impact (FWCI) and paper volume with instant charts.

Connect Distant Disciplines

Bridge topological clusters on the map to find hidden collaborative intersections.

Laika access coming soon