ARRHYTHMIA DETECTION FROM IMBALANCED ECG DATA USING CNN, FOCAL LOSS, AND RR INTERVAL FEATURES WITH INTER-PATIENT EVALUATION
DOI:
https://doi.org/10.34288/jri.v8i4.514Keywords:
CNN, Deep Learning, Arrhythmia Detection, Imbalanced Data, Electrocardiogram, Focal Loss, Inter-PatientAbstract
Detection of arrhythmias from electrocardiogram (ECG) signals is crucial for early diagnosis of heart rhythm disorders. However, the imbalanced distribution of arrhythmia classes poses challenges for classification models. This study proposes a Convolutional Neural Network (CNN) model combined with Focal Loss and RR features to address class imbalance using an inter-patient evaluation approach. The dataset includes three classes: N (Normal), SVEB (Supraventricular Ectopic Beats), and VEB (Ventricular Ectopic Beats), divided into training (DS1), validation (DS1-Val), and testing (DS2) sets. The proposed CNN + Focal Loss + RR model achieved an accuracy of 95.75% and an F1-score of 95.19%. Additionally, Explainable AI (XAI) using LIME is applied to improve model interpretability by identifying important features influencing predictions. The results demonstrate that the proposed approach provides accurate and interpretable arrhythmia detection, supporting reliable medical decision-making. However, the model's performance on the minority SVEB class remains limited, with a recall of only 34.24%, indicating that SVEB beats are frequently misclassified as Normal due to morphological similarities and severe class imbalance. This limitation highlights the need for further improvements in minority-class detection for clinical applicability.
Downloads
References
Barmak, O., Krak, I., Yakovlev, S., Manziuk, E., Radiuk, P., & Kuznetsov, V. (2024). Toward explainable deep learning in healthcare through transition matrix and user-friendly features. Frontiers in Artificial Intelligence, 7(November), 1–13. https://doi.org/10.3389/frai.2024.1482141
Bhatia, S., Pandey, S. K., Kumar, A., & Alshuhail, A. (2022). Classification of Electrocardiogram Signals Based on Hybrid Deep Learning Models. Sustainability (Switzerland), 14(24), 1–15. https://doi.org/10.3390/su142416572
Choi, Y. Y., Choi, J.-I., Kim, Y. G., Min, K., Roh, S.-Y., Shim, J., Choi, J. S., & Kim, Y.-H. (2022). Diagnostic usefulness of implantable loop recorder in patients with unexplained syncope or palpitation. International Journal of Arrhythmia, 23(1). https://doi.org/10.1186/s42444-022-00068-w
El Koshiry, A. M., Eliwa, E. H. I., El-Hafeez, T. A., & Khairy, M. (2024). Detecting cyberbullying using deep learning techniques: a pre-trained glove and focal loss technique. PeerJ Computer Science, 10, 1–33. https://doi.org/10.7717/peerj-cs.1961
Hong, J., Litt, S. J., & Moak, J. P. (2023). Cardiac arrhythmias in postural tachycardia syndrome and orthostatic intolerance. Cardiology in the Young, 33(2), 255–259. https://doi.org/10.1017/S1047951122000580
Janbhasha, S., & Bhavanam, S. N. (2023). Recurrent Ascendancy Feature Subset Training Model using Deep CNN Model for ECG based Arrhythmia Classification. International Journal of Advanced Computer Science and Applications, 14(5), 639–647. https://doi.org/10.14569/IJACSA.2023.0140568
Jiang, J., Deng, H., Liao, H., Fang, X., Zhan, X., Wu, S., & Xue, Y. (2022). Development and Validation of a Deep-Learning Model to Detect CRP Level from the Electrocardiogram. Frontiers in Physiology, 13(May), 1–7. https://doi.org/10.3389/fphys.2022.864747
Kazemi Lichaee, F., Salari, A., Jalili, J., Beikmohammad Dalivand, S., Roshanfekr Rad, M., & Mojarad, M. (2024). Advancements in Artificial Intelligence for ECG Signal Analysis and Arrhythmia Detection: A Review. International Journal of Cardiovascular Practice, 8(2). https://doi.org/10.5812/intjcardiovascpract-143437
Kim, Y. K., Lee, M., Song, H. S., & Lee, S. W. (2022). Automatic Cardiac Arrhythmia Classification Using Residual Network Combined With Long Short-Term Memory. IEEE Transactions on Instrumentation and Measurement, 71, 1–17. https://doi.org/10.1109/TIM.2022.3181276
Li, R., Zhou, Z., Liu, X., Li, D., Yang, W., Li, S., & Liu, Q. (2021). GTF: An Adaptive Network Anomaly Detection Method at the Network Edge. Security and Communication Networks, 2021(Ml). https://doi.org/10.1155/2021/3017797
Mandala, S., Jatmiko, W., Nurmaini, S., Rizal, A., & Adiwijaya. (2025). OCADN: Improving Accuracy in Multi-class Arrhythmia Detection from ECG Signals with a Hyperparameter-Optimized CNN. IEEE Access, 13(February), 34687–34705. https://doi.org/10.1109/ACCESS.2025.3544273
Margarita Kurti. (2022). COVID-19: Associated subacute thyroiditis in Albania. International Journal of Frontiers in Life Science Research, 2(1), 029–031. https://doi.org/10.53294/ijflsr.2022.2.1.0031
Nurriski, Y. J., & Alamsyah, A. (2023). Optimasi Deep Convolutional Neural Network (Deep CNN) untuk Deteksi Aritmia Melalui Sinyal EKG Menggunakan Arsitektur Conv1D. Indonesian Journal of Mathematics and Natural Sciences, 46(1), 10–20. https://doi.org/10.15294/ijmns.v46i1.46176
Ozaltin, O., & Yeniay, O. (2023). A novel proposed CNN–SVM architecture for ECG scalograms classification. Soft Computing, 27(8), 4639–4658. https://doi.org/10.1007/s00500-022-07729-x
Pang, F., Lei, C., & Zeng, J. (2024). Electrical insulator defect detection with incomplete annotations and imbalanced samples. IET Generation, Transmission and Distribution, 18(4), 694–715. https://doi.org/10.1049/gtd2.13107
Pham, H., Egorov, K., Kazakov, A., & Budennyy, S. (2023). Machine learning-based detection of cardiovascular disease using ECG signals: performance vs. complexity. Frontiers in Cardiovascular Medicine, 10(July), 1–11. https://doi.org/10.3389/fcvm.2023.1229743
Ramadhan, Y., & Mandala, S. (2023). Analysis of Electrocardiogram Dynamic Features for Arrhythmia Classification. Jurnal Online Informatika, 8(2), 204–212. https://doi.org/10.15575/join.v8i2.1106
Ryu, J. S., Lee, S., Chu, Y., Koh, S. B., Park, Y. J., Lee, J. Y., & Yang, S. (2023). Deep Learning Algorithms for Estimation of Demographic and Anthropometric Features from Electrocardiograms. Journal of Clinical Medicine, 12(8). https://doi.org/10.3390/jcm12082828
Saclova, L., Nemcova, A., Smisek, R., Smital, L., Vitek, M., & Ronzhina, M. (2022). Reliable P wave detection in pathological ECG signals. Scientific Reports, 12(1), 1–14. https://doi.org/10.1038/s41598-022-10656-4
Sandhya Samant, E. al. (2023). Exploring ECG Signal Analysis Techniques for Arrhythmia Detection: A Review. International Journal on Recent and Innovation Trends in Computing and Communication, 11(9), 4881–4896. https://doi.org/10.17762/ijritcc.v11i9.10084
Zhao, X., Huang, G., Wu, L., Wang, M., He, X., Wang, J. R., Zhou, B., Liu, Y., Lin, Y., Liu, D., Yu, X., Liang, S., Tian, B., Liu, L., Chen, Y., Qiu, S., Xie, X., Han, L., & Qian, X. (2022). Deep learning assessment of left ventricular hypertrophy based on electrocardiogram. Frontiers in Cardiovascular Medicine, 9. https://doi.org/10.3389/fcvm.2022.952089
Zheng, G., Lee, S., Koh, J., Pahwa, K., Li, H., Xu, Z., Sun, H., Su, J., Cho, S. P., Im, S. Il, Jeong, I. cheol, & Braverman, V. (2024). Hierarchical deep learning for autonomous multi-label arrhythmia detection and classification on real-world wearable electrocardiogram data. Digital Health, 10. https://doi.org/10.1177/20552076241278942
Downloads
Published
How to Cite
Issue
Section
License
Copyright (c) 2026 Ilham Maulana, Nita Merlina

This work is licensed under a Creative Commons Attribution-NonCommercial 4.0 International License.
The Jurnal Riset Informatika has legal rules for accessing digital electronic articles uunder a Creative Commons Attribution-NonCommercial 4.0 International License . Articles published in Jurnal Riset Informatika, provide Open Access, for the purpose of scientific development, research, and libraries.










