Deep Residual Transfer Learning and Transformer Architectures for ECG Signal–Based Heart Disease Detection
Downloads
The purpose of this research was to create a fully automatic deep-learning method to accurately classify different types of cardiac arrhythmias based on patterns observed in electrocardiograms (ECGs). There are several challenges that arise when manually interpreting cardiac arrhythmias. These include variability in how different observers interpret arrhythmias and variability in the diagnostic results obtained by different clinicians. To address these issues, we propose an architecture that includes both residual transfer learning and transformer encoder blocks. In our proposed architecture, the residual learning block uses Conv1D layers with skip connections to learn hierarchical representations of features in the ECG signal. The transformer block uses multi-head self-attention to identify longer-range dependencies in the ECG sequence. Our proposed model is tested on two publicly available benchmark databases of ECG recordings, namely the MIT-BIH Arrhythmia Database and the PTBDB Diagnostic ECG Database. We evaluate the performance of our model using a stratified 10-fold cross-validation procedure as well as Receiver Operating Characteristic (ROC) analysis. The proposed model achieved a classification accuracy of 99% on both datasets, with precision scores of 0.88 to 0.99 and recall scores of 0.87 to 0.99 for each arrhythmia class. Furthermore, the AUC values of the ROC analysis ranged from 0.98 to 1.0, indicating high levels of discrimination against minority classes, including supraventricular ectopic beats and fusion beats.
Downloads
[1] Lopez-Jimenez, F., Almahmeed, W., Bays, H., Cuevas, A., Di Angelantonio, E., le Roux, C. W., ... & Wilding, J. P. (2022). Obesity and cardiovascular disease: mechanistic insights and management strategies. A joint position paper by the World Heart Federation and World Obesity Federation. European journal of preventive cardiology, 29(17), 2218-2237. doi:10.1093/eurjpc/zwac187.
[2] Gaidai, O., Cao, Y., & Loginov, S. (2023). Global Cardiovascular Diseases Death Rate Prediction. Current Problems in Cardiology, 48(5), 101622. doi:10.1016/j.cpcardiol.2023.101622.
[3] January, C. T., Wann, L. S., Calkins, H., Chen, L. Y., Cigarroa, J. E., Cleveland, J. C., Ellinor, P. T., Ezekowitz, M. D., Field, M. E., Furie, K. L., Heidenreich, P. A., Murray, K. T., Shea, J. B., Tracy, C. M., & Yancy, C. W. (2019). 2019 AHA/ACC/HRS Focused Update of the 2014 AHA/ACC/HRS Guideline for the Management of Patients with Atrial Fibrillation: A Report of the American College of Cardiology/American Heart Association Task Force on Clinical Practice Guidelines and the Heart Rhythm Society in Collaboration with the Society of Thoracic Surgeons. Circulation, 140(2), e125–e151. doi:10.1161/CIR.0000000000000665.
[4] Zheng, J., Zhang, J., Danioko, S., Yao, H., Guo, H., & Rakovski, C. (2020). A 12-lead electrocardiogram database for arrhythmia research covering more than 10,000 patients. Scientific Data, 7(1), 48. doi:10.1038/s41597-020-0386-x.
[5] Kubala, M., de Chillou, C., Bohbot, Y., Lancellotti, P., Enriquez-Sarano, M., & Tribouilloy, C. (2022). Arrhythmias in Patients with Valvular Heart Disease: Gaps in Knowledge and the Way Forward. Frontiers in Cardiovascular Medicine, 9, 792559. doi:10.3389/fcvm.2022.792559.
[6] Al‐Naami, B., Fraihat, H., Owida, H. A., Al‐Hamad, K., De Fazio, R., & Visconti, P. (2022). Automated Detection of Left Bundle Branch Block from ECG Signal Utilizing the Maximal Overlap Discrete Wavelet Transform with ANFIS. Computers, 11(6), 93. doi:10.3390/computers11060093.
[7] Bonny, A., Ngantcha, M., Scholtz, W., Chin, A., Nel, G., Anzouan-Kacou, J. B., Karaye, K. M., Damasceno, A., & Crawford, T. C. (2019). Cardiac Arrhythmias in Africa: Epidemiology, Management Challenges, and Perspectives. Journal of the American College of Cardiology, 73(1), 100–109. doi:10.1016/j.jacc.2018.09.084.
[8] Cheung, C. C., Roston, T. M., Andrade, J. G., Bennett, M. T., & Davis, M. K. (2020). Arrhythmias in Cardiac Amyloidosis: Challenges in Risk Stratification and Treatment. Canadian Journal of Cardiology, 36(3), 416–423. doi:10.1016/j.cjca.2019.11.039.
[9] Petty, B. G. (2020). Basic electrocardiography. Springer Nature, New York, United States. doi:10.1007/978-1-4939-2413-4.
[10] Das, M. K., & Zipes, D. P. (2021). Electrocardiography of Arrhythmias: A Comprehensive Review E-Book: A Companion to Cardiac Electrophysiology. Elsevier, Amsterdam, Netherlands.
[11] Brady, W. J., Lipinski, M. J., Darby, A. E., Bond, M. C., Charlton, N. P., Hudson, K., & Williamson, K. (2020). Electrocardiogram in Clinical Medicine. John Wiley & Sons, New Jersey, United States. doi:10.1002/9781118754511.
[12] Ikeda, T. (2021). Current use and future needs of noninvasive ambulatory electrocardiogram monitoring. Internal Medicine, 60(1), 9–14. doi:10.2169/internalmedicine.5691-20.
[13] Avula, V., Wu, K. C., & Carrick, R. T. (2023). Clinical Applications, Methodology, and Scientific Reporting of Electrocardiogram Deep-Learning Models: A Systematic Review. JACC: Advances, 2(10), 100686. doi:10.1016/j.jacadv.2023.100686.
[14] Ouyang, D., Theurer, J., Stein, N. R., Hughes, J. W., Elias, P., He, B., Yuan, N., Duffy, G., Sandhu, R. K., Ebinger, J., Botting, P., Jujjavarapu, M., Claggett, B., Tooley, J. E., Poterucha, T., Chen, J. H., Nurok, M., Perez, M., Perotte, A., … Albert, C. M. (2024). Electrocardiographic deep learning for predicting post-procedural mortality: a model development and validation study. The Lancet Digital Health, 6(1), e70–e78. doi:10.1016/S2589-7500(23)00220-0.
[15] Hughes, J. W., Tooley, J., Torres Soto, J., Ostropolets, A., Poterucha, T., Christensen, M. K., Yuan, N., Ehlert, B., Kaur, D., Kang, G., Rogers, A., Narayan, S., Elias, P., Ouyang, D., Ashley, E., Zou, J., & Perez, M. V. (2023). A deep learning-based electrocardiogram risk score for long term cardiovascular death and disease. NPJ Digital Medicine, 6(1), 169. doi:10.1038/s41746-023-00916-6.
[16] Aqel, H., Farah, H., & Al-Hunaiti, A. (2024). Ecological versatility and biotechnological promise: Comprehensive characterization of the isolated thermophilic Bacillus strains. Plos One, 19(4 April), 297217. doi:10.1371/journal.pone.0297217.
[17] Abu Sa’aleek, A., Alshishani, A., Shaghlil, L., Aljariri Alhesan, J. S., & Al-Ebini, Y. (2023). Determination of vitamin D3 in pharmaceutical products using salting-out assisted liquid–liquid extraction coupled with reversed phase liquid chromatography. Microchemical Journal, 193, 109077. doi:10.1016/j.microc.2023.109077.
[18] Xiao, Q., Lee, K., Mokhtar, S. A., Ismail, I., Pauzi, A. L. bin M., Zhang, Q., & Lim, P. Y. (2023). Deep Learning-Based ECG Arrhythmia Classification: A Systematic Review. Applied Sciences (Switzerland), 13(8), 4964. doi:10.3390/app13084964.
[19] Aseeri, A. O. (2021). Uncertainty-aware deep learning-based cardiac arrhythmias classification model of electrocardiogram signals. Computers, 10(6), 82. doi:10.3390/COMPUTERS10060082.
[20] Murat, F., Yildirim, O., Talo, M., Baloglu, U. B., Demir, Y., & Acharya, U. R. (2020). Application of deep learning techniques for heartbeats detection using ECG signals-analysis and review. Computers in Biology and Medicine, 120, 103726. doi:10.1016/j.compbiomed.2020.103726.
[21] Sannino, G., & De Pietro, G. (2018). A deep learning approach for ECG-based heartbeat classification for arrhythmia detection. Future Generation Computer Systems, 86, 446–455. doi:10.1016/j.future.2018.03.057.
[22] Siontis, K. C., Noseworthy, P. A., Attia, Z. I., & Friedman, P. A. (2021). Artificial intelligence-enhanced electrocardiography in cardiovascular disease management. Nature Reviews Cardiology, 18(7), 465–478. doi:10.1038/s41569-020-00503-2.
[23] Hassan, S. U., Mohd Zahid, M. S., Abdullah, T. A. A., & Husain, K. (2022). Classification of cardiac arrhythmia using a convolutional neural network and bi-directional long short-term memory. Digital Health, 8, 20552076221102770. doi:10.1177/20552076221102766.
[24] Essa, E., & Xie, X. (2021). An Ensemble of Deep Learning-Based Multi-Model for ECG Heartbeats Arrhythmia Classification. IEEE Access, 9, 103452–103464. doi:10.1109/ACCESS.2021.3098986.
[25] Liu, P., Sun, X., Han, Y., He, Z., Zhang, W., & Wu, C. (2022). Arrhythmia classification of LSTM autoencoder based on time series anomaly detection. Biomedical Signal Processing and Control, 71, 103228. doi:10.1016/j.bspc.2021.103228.
[26] Wang, B., Chen, G., Rong, L., Liu, Y., Yu, A., He, X., Wen, T., Zhang, Y., & Hu, B. (2023). Arrhythmia Disease Diagnosis Based on ECG Time-Frequency Domain Fusion and Convolutional Neural Network. IEEE Journal of Translational Engineering in Health and Medicine, 11, 116–125. doi:10.1109/JTEHM.2022.3232791.
[27] Dong, X., & Si, W. (2023). Heartbeat Dynamics: A Novel Efficient Interpretable Feature for Arrhythmias Classification. IEEE Access, 11, 3305473. doi:10.1109/ACCESS.2023.3305473.
[28] Kaniraja, C. P., M, V. D., & Mishra, D. (2024). A deep learning framework for electrocardiogram (ECG) super resolution and arrhythmia classification. Research on Biomedical Engineering, 40(1), 199-211. doi:10.1007/s42600-024-00343-w.
[29] Chen, M. C., & Chen, C. I. (2024). Atrial Fibrillation Detection in Single-Lead ECG Signals: A Comparative Study of CNN with LSTM and Residual Neural Network Models. ACM International Conference Proceeding Series, 138–142. doi:10.1145/3673971.3673980.
[30] Kachuee, M., Fazeli, S., & Sarrafzadeh, M. (2018). ECG heartbeat classification: A deep transferable representation. In Proceedings - 2018 IEEE International Conference on Healthcare Informatics, ICHI 2018, 443–444. doi:10.1109/ICHI.2018.00092.
[31] Xu, X., Jeong, S., & Li, J. (2020). Interpretation of Electrocardiogram (ECG) Rhythm by Combined CNN and BiLSTM. IEEE Access, 8, 125380–125388. doi:10.1109/ACCESS.2020.3006707.
[32] Peimankar, A., Ebrahimi, A., & Wiil, U. K. (2024). xECG-Beats: an explainable deep transfer learning approach for ECG-based heartbeat classification. Network Modeling Analysis in Health Informatics and Bioinformatics, 13(1), 1–13. doi:10.1007/s13721-024-00481-2.
[33] Guo, L., Sim, G., & Matuszewski, B. (2019). Inter-patient ECG classification with convolutional and recurrent neural networks. Biocybernetics and Biomedical Engineering, 39(3), 868–879. doi:10.1016/j.bbe.2019.06.001.
[34] Hao, S., Xia, Y., & Ye, Y. (2023). Generative Adversarial Network with Transformer for Hyperspectral Image Classification. IEEE Geoscience and Remote Sensing Letters, 20, 104276. doi:10.1109/LGRS.2023.3322139.
[35] Serhani, M. A., Ismail, H., El-Kassabi, H. T., & Breiki, H. Al. (2025). Enhancing arrhythmia prediction through an adaptive deep reinforcement learning framework for ECG signal analysis. Biomedical Signal Processing and Control, 101, 107155. doi:10.1016/j.bspc.2024.107155.
[36] Karthikeyani, S., Sasipriya, S., & Ramkumar, M. (2025). An Evaluation of Dimensionality Reduction and Classification Techniques for Cardiac Disease Diagnosis from ECG Signals with Various Deep Learning Classifiers. Circuits, Systems, and Signal Processing, 44(1), 416–446. doi:10.1007/s00034-024-02845-5.
[37] Zhao, Y., Kang, J., Zhang, T., Han, P., & Chen, T. (2025). ECG-Chat: A Large ECG-Language Model for Cardiac Disease Diagnosis. Proceedings - IEEE International Conference on Multimedia and Expo, 1–6. doi:10.1109/ICME59968.2025.11209476.
[38] Abdullayev, I. N., Jiyanbayev, O. E., & Nasimov, R. K. (2026). Early Detection and Prognostic Assessment of Ischemic Heart Diseases Based on Multimodal Artificial Intelligence Algorithms. Technical Science Integrated Research, 2(1), 33-42.
[39] Meeran, S. B. U., & Munaf, N. A. (2026). Comparative analysis of unidirectional and bidirectional RNNs for ECG arrhythmia detection using augmented MIT-BIH data. Bulletin of Electrical Engineering and Informatics, 15(1), 712–722. doi:10.11591/eei.v15i1.10893.
[40] Akbar, A., & Utami, E. (2026). Systematic Review of the Use of the MIT-BIH Polysomnography Database for the Detection and Classification of Sleep Disorders. Sistemasi: Jurnal Sistem Informasi, 15(1), 308-320.
[41] Wagner, P., Strodthoff, N., Bousseljot, R. D., Kreiseler, D., Lunze, F. I., Samek, W., & Schaeffter, T. (2020). PTB-XL, a large publicly available electrocardiography dataset. Scientific Data, 7(1), 154. doi:10.1038/s41597-020-0495-6.
[42] He, K., Zhang, X., Ren, S., & Sun, J. (2016). Deep residual learning for image recognition. Proceedings of the IEEE Computer Society Conference on Computer Vision and Pattern Recognition, 2016-December, 770–778. doi:10.1109/CVPR.2016.90.
[43] Fawzy, A. M., Rivera-Caravaca, J. M., Underhill, P., Fauchier, L., & Lip, G. Y. H. (2023). Incident heart failure, arrhythmias and cardiovascular outcomes with sodium-glucose cotransporter 2 (SGLT2) inhibitor use in patients with diabetes: Insights from a global federated electronic medical record database. Diabetes, Obesity and Metabolism, 25(2), 602–610. doi:10.1111/dom.14854.
[44] Xu, J., Sun, X., Zhang, Z., Zhao, G., & Lin, J. (2019). Understanding and improving layer normalization. Advances in Neural Information Processing Systems, 32.
[45] Moody, G. B., & Mark, R. G. (2001). The impact of the MIT-BIH arrhythmia database. IEEE Engineering in Medicine and Biology Magazine, 20(3), 45–50. doi:10.1109/51.932724.
[46] Bousseljot, R., Kreiseler, D., & Schnabel, A. (1995). Nutzung der EKG-Signaldatenbank CARDIODAT der PTB über das Internet. Biomedizinische Technik, 40(S1), 317–318. doi:10.1515/bmte.1995.40.s1.317.
- This work (including HTML and PDF Files) is licensed under a Creative Commons Attribution 4.0 International License.





















