Arrhythmia Detection Using XGBoost with Recursive Feature Elimination: A Two-Stage Machine Learning Approach
Abstract
Arrhythmia is a cardiac rhythm disorder that can lead to severe complications, including heart failure and sudden cardiac death. Accurate electrocardiogram (ECG)-based arrhythmia detection remains challenging due to high-dimensional features and class imbalance. Therefore, this study aims to develop a two-stage machine learning approach for arrhythmia detection using Recursive Feature Elimination (RFE) and Extreme Gradient Boosting (XGBoost). The proposed approach performs binary classification to distinguish normal and arrhythmia conditions, followed by multi-class classification to identify arrhythmia subtypes. SMOTE is applied to address class imbalance, while Grid Search with cross-validation is used for hyperparameter optimization. Furthermore, the trained model is implemented in a web-based application for interactive prediction and visualization. Experimental results show that the optimized binary classification model achieves an accuracy of 0.89 and an F1-score of 0.87. Meanwhile, the multi-class classification model achieves an accuracy of 0.69 and a weighted F1-score of 0.66. The results indicate that the proposed approach performs effectively for binary arrhythmia detection. However, performance in multi-class classification remains limited due to imbalance and insufficient samples in several arrhythmia subtypes. This study contributes by proposing an integrated framework that combines Recursive Feature Elimination (RFE) for feature selection, SMOTE for imbalance handling, XGBoost with GridSearchCV-based hyperparameter optimization, and a two-stage classification approach for ECG-based arrhythmia detection and subtype classification. In addition, the proposed model is implemented in a web-based application to support interactive prediction and visualization. Overall, this study demonstrates the potential of integrating RFE, XGBoost, and SMOTE for ECG-based arrhythmia detection and practical web-based implementation.
Downloads
References
World Health Organization, “Cardiovascular Diseases (CVDs).” Accessed: May 08, 2026. [Online]. Available: https://www.who.int/news-room/fact-sheets/detail/cardiovascular-diseases-(cvds)
E. P. Silmina and L. Perkasa, “EDA and Tableau Analysis for Identification of Heart Disease Risk Factors,” J. Artif. Intell. Softw. Eng. J-AISE, vol. 5, no. 1, p. 79, Mar. 2025, doi: 10.30811/jaise.v5i1.6389.
S. Liza Munira, D. Puspasari, and Trihono, “Survei Kesehatan Indonesia (SKI) Tahun 2023,” Slideshare. Accessed: May 21, 2026. [Online]. Available: https://www.slideshare.net/slideshow/survei-kesehatan-indonesia-ski-tahun-2023/269424965
Michael Sintong Halomoan and D. Rahmah, “Epidemiologi Aritmia.” Accessed: May 08, 2026. [Online]. Available: https://www.alomedika.com/penyakit/kardiologi/aritmia/epidemiologi
M. Fira, L. Goraș, L. Fira, R. F. Popa, and H.-N. Costin, “Arrhythmia Classification With Single-Channel Features Extracted from ‘A Large-Scale 12-Lead ECG Database for Arrhythmia Study,’” Sensors, vol. 25, no. 18, p. 5621, Sep. 2025, doi: 10.3390/s25185621.
A. Darmawahyuni et al., “An Improved Electrocardiogram Arrhythmia Classification Performance With Feature Optimization,” BMC Med. Inform. Decis. Mak., vol. 24, no. 1, p. 412, Dec. 2024, doi: 10.1186/s12911-024-02822-7.
M. Martínez-Sellés and M. Marina-Breysse, “Current and Future Use of Artificial Intelligence in Electrocardiography,” J. Cardiovasc. Dev. Dis., vol. 10, no. 4, p. 175, Apr. 2023, doi: 10.3390/jcdd10040175.
S. Sattar et al., “Cardiac Arrhythmia Classification Using Advanced Deep Learning Techniques on Digitized ECG Datasets,” Sensors, vol. 24, no. 8, p. 2484, Apr. 2024, doi: 10.3390/s24082484.
R. M. Devadas, “Cardiac Arrhythmia Classification Using SVM, KNN and Naive Bayes Algorithms,” Int. Res. J. Eng. Technol. IRJET, vol. 8, no. 5, 2021.
M. F. Z. Nugraha, H. F. Tsp, and R. Magdalena, “Deteksi Aritmia Menggunakan Algoritma Deep Neural Network (DNN) Pada Sinyal Elektrokardiogram,” E-Proceeding Eng., vol. 10, no. 5, p. 4155, Oct. 2023.
A. Sitorus, P. A. R. Simanjuntak, M. C. Angelina. H., K. A. Situmorang, and A. Z. Putra, “ECG-Based Arrhythmia Classification in Students Using Random Forest: A Case Study with Class Imbalance Analysis,” Sinkron, vol. 9, no. 2, pp. 905–913, Jun. 2025, doi: 10.33395/sinkron.v9i2.14793.
A. A. Pratama and A. M. Abadi, “Classification of Arrhythmia Diseases by the Convolutional Neural Network Method Based on ECG Images,” BAREKENG J. Ilmu Mat. Dan Terap., vol. 17, no. 2, pp. 0625–0634, Jun. 2023, doi: 10.30598/barekengvol17iss2pp0625-0634.
D. Asmawati, L. Arif Sanjani, C. Dimas Renggana, C. Fatichah, and T. Mustaqim, “Arrhythmia Classification With ECG Signal Using Extreme Gradient Boosting (XGBoost) Algorithm,” J. Technol. Inform. JoTI, vol. 6, no. 1, pp. 36–42, Oct. 2024, doi: 10.37802/joti.v6i1.792.
Q. Wang et al., “Machine Learning-Based Risk Prediction of Malignant Arrhythmia in Hospitalized Patients With Heart Failure,” ESC Heart Fail., vol. 8, no. 6, pp. 5363–5371, Dec. 2021, doi: 10.1002/ehf2.13627.
X. Yu, “ECG Signal Classification Based on DWT Denoising and XGBoost,” Appl. Comput. Eng., vol. 95, no. 1, pp. 57–67, Oct. 2024, doi: 10.54254/2755-2721/95/2024BJ0057.
R. Xiao, M. Yang, C. Ma, L. Zhao, J. Li, and C. Liu, “Interpretable XGBoost-SHAP Model for Arrhythmic Heartbeat Classification,” presented at the 2024 Computing in Cardiology Conference, Dec. 2024. doi: 10.22489/CinC.2024.186.
M. Saleem, W. Aslam, M. I. U. Lali, H. T. Rauf, and E. A. Nasr, “Predicting Thalassemia Using Feature Selection Techniques: A Comparative Analysis,” Diagnostics, vol. 13, no. 22, p. 3441, Nov. 2023, doi: 10.3390/diagnostics13223441.
R. Jahangir, M. N. Islam, Md. S. Islam, and Md. M. Islam, “ECG-Based Heart Arrhythmia Classification Using Feature Engineering and a Hybrid Stacked Machine Learning,” BMC Cardiovasc. Disord., vol. 25, no. 1, p. 260, Apr. 2025, doi: 10.1186/s12872-025-04678-9.
S. A. Hadi and T. Hardiani, “Arrhythmia Disease Detection Using SVM With Recursive Feature Elimination,” Int. J. Inform. Comput. IJICOM, vol. 7, no. 2, 2025, doi: 10.35842/ijicom.
A. Mahmoudian Azar Sharabiani and S. M. Mousavi, “A Web-Based Decision Support System for Project Evaluation With Sustainable Development Considerations Based on Two Developed Pythagorean Fuzzy Decision Methods,” Sustainability, vol. 15, no. 23, p. 16477, Dec. 2023, doi: 10.3390/su152316477.
A. M. Priyatno and T. Widiyaningtyas, “A Systematic Literature Review: Recursive Feature Elimination Algorithms,” JITK J. Ilmu Pengetah. Dan Teknol. Komput., vol. 9, no. 2, pp. 196–207, Feb. 2024, doi: 10.33480/jitk.v9i2.5015.
B. Eralp, “Arrhythmia Detection From ECG Data.” Accessed: May 08, 2026. [Online]. Available: https://kaggle.com/code/batuhaneralpofficial/arrythmia-detection-from-ecg-data
J. Reddekopp, “Machine Learning: Feature Selection — Recursive Feature Elimination,” Simplifying Complexity: Feature Selection with Recursive Feature Elimination. Accessed: May 09, 2026. [Online]. Available: https://readmedium.com/machine-learning-feature-selection-recursive-feature-elimination-88750767c05f
M. L. Abdillah and D. Wijayanto, “Perancangan Sistem Informasi Cuti Berbasis Web pada Rumah Sakit Asri Medical Center,” J. Sist. Inf. Dan Bisnis Cerdas, vol. 18, no. 1, Feb. 2025, doi: 10.33005/sibc.v18i1.419.
P. A. D. A. Santi, R. Afwani, Moh. A. Albar, S. E. Anjarwani, and A. Z. Mardiansyah, “Black Box Testing with Equivalence Partitioning and Boundary Value Analysis Methods (Study Case: Academic Information System of Mataram University),” in Proceedings of MIMSE 2022 (Informatics and Computer Science), Dordrecht, 2022, pp. 207–219. doi: 10.2991/978-94-6463-084-8_19.
Bila bermanfaat silahkan share artikel ini
Berikan Komentar Anda terhadap artikel Arrhythmia Detection Using XGBoost with Recursive Feature Elimination: A Two-Stage Machine Learning Approach
Pages: 246-257
Copyright (c) 2026 Suci Mutiarani, Tikaridha Hardiani

This work is licensed under a Creative Commons Attribution 4.0 International License.
Authors who publish with this journal agree to the following terms:
- Authors retain copyright and grant the journal right of first publication with the work simultaneously licensed under Creative Commons Attribution 4.0 International License that allows others to share the work with an acknowledgment of the work's authorship and initial publication in this journal.
- Authors are able to enter into separate, additional contractual arrangements for the non-exclusive distribution of the journal's published version of the work (e.g., post it to an institutional repository or publish it in a book), with an acknowledgment of its initial publication in this journal.
- Authors are permitted and encouraged to post their work online (e.g., in institutional repositories or on their website) prior to and during the submission process, as it can lead to productive exchanges, as well as earlier and greater citation of published work (Refer to The Effect of Open Access).





















