Electrocardiogram Heartbeat Classification using Convolutional Neural Network-k Nearest Neighbor

Keywords: Convolutional neural network, Electrocardiogram classification arrhythmia, K-nearest neighbor

Abstract

Electrocardiogram (ECG) analysis is widely used by cardiologists and medical practitioners for monitoring cardiac health. A high-performance automatic ECG classification system is challenging because there is difficulty in detecting and categorizing different waveforms in the signal, especially in manual analysis of ECG signals, which means, a better classification system is needed in terms of performance and accuracy. Hence, in this paper, the authors propose an accurate ECG classification and monitoring system called convolutional neural network-k nearest neighbor (CNN-kNN). The proposed method utilizes 1D-CNN and kNN. Unlike the existing techniques, the examined technique does not need training during classifying the ECG signals. The CNN-kNN is evaluated against the PhysioNet’s MIT-BIH and PTB diagnostics datasets. The CNN is fed using the ECG beat raw signal directly. In addition, the learned features are extracted from the 1D-CNN model and its dimensions are reduced using two fully connected layers and then fed to the k-NN classifier. The CNN-kNN model achieved average accuracies of 98% and 97.4% on arrhythmia and myocardial infarction classifications, respectively. These results are evidence of the great ability of the proposed model compared to the mentioned models in this article.

Downloads

Download data is not yet available.

Author Biographies

Zrar Kh. Abdul, Department of Computer Science, College of Science, Charmo University46023, Chamchamal, Sulaimani, Kurdistan Region – F.R. Iraq

Zrar Kh.Abdul is a Assistant Professor at the Department of computer science, College of science, charmo University. He got the B.Sc. degree in computer engineering, the M.Sc. degree in control system engineering and the Ph.D. degree in information system engineering. His research interests are in machine learning applications and patterns recognition.

Abdulbasit K. Al‑Talabani, Department of Software Engineering, Faculty of Engineering, Koya UniversityKoya KOY45, Kurdistan Region – F.R. Iraq

Abdulbasit Al-Talabani is an Assistant Prof. at the Department of Software Engineering, Faculty of Engineering, Koya University. He has a B.Sc. in mathematics at Salahadin University, Iraq, M.Sc. in Computer Science, Koya University, Iraq, and a PhD degree at applied computing, Buckingham University, UK. His research interest is in machine learning, speech processing and computer vision.

Chnoor M. Rahman, Department of Computer Science, College of Science, Charmo University46023, Chamchamal, Sulaimani, Kurdistan Region – F.R. Iraq

Chnoor M. Rahman is a Lecturer at the Department of Computer, College of science, Charmo University. She got the B.Sc. degree in Computer science/ University of Sulaimani, the M.Sc. degree in Software Systems and internet Technologies/ University of Sheffield, and the Ph.D. degree in information technology. Her research interests are in Metaheuristic algorithms, and optimization.

Safar M. Asaad, Department of Software Engineering, Faculty of Engineering, Koya University, Koya KOY45, Kurdistan Region – F.R. Iraq

Safar M. Asaad is a Lecturer at the Department of Software Engineering, Faculty of Engineering, KoyaUniversity. He got the B.Sc. degree in Software Engineering, the M.Sc. degree in Advanced Software Engineering and the Ph.D. degree in Information Systems Engineering. His research interests are in IoT & Wireless Technologies, Indoors & Outdoors Positioning, Web Development & Smart City Services, and Machine Learning.

References

Acharya, U.R., Fujita, H., Oh, S.L., Hagiwara, Y., Tan, J.H., and Adam, M., 2017a. Application of deep convolutional neural network for automated detection of myocardial infarction using ECG signals. Information Sciences, 415-416, pp.190-198. DOI: https://doi.org/10.1016/j.ins.2017.06.027

Acharya, U.R., Oh, S.L., Hagiwara, Y., Tan, J.H., Adam, M., Gertych, A., and Tan, R.S., 2017b. A deep convolutional neural network model to classify heartbeats. Computers in Biology and Medicine, 89, pp.389-396.

Acharya, U.R., Oh, S.L., Hagiwara, Y., Tan, J.H., Adam, M., Gertych, A., and Tan, R.S., 2017c. A deep convolutional neural network model to classify heartbeats. Computers in Biology and Medicine, 89, pp.389-396. DOI: https://doi.org/10.1016/j.compbiomed.2017.08.022

Aljojo, N., 2022. Network transmission flags data affinity-based classification by K-nearest neighbor. Aro-The Scientific Journal of Koya University, 10(1), pp.35-43. DOI: https://doi.org/10.14500/aro.10880

Association for the Advancement of Medical Instrumentation., 1998. Testing and Reporting Performance Results of Cardiac Rhythm and St Segment Measurement Algorithms. Association for the Advancement of Medical Instrumentation, Arlington.

Bouaziz, F., Boutana, D., and Oulhadj, H., 2019. Diagnostic of ECG Arrhythmia using Wavelet Analysis and K-Nearest Neighbor Algorithm. In: Proceedings of the 2018 International Conference on Applied Smart Systems, ICASS 2018, pp.1-6. DOI: https://doi.org/10.1109/ICASS.2018.8652020

Boussaa, M., Atouf, I., Atibi, M., and Bennis, A., 2016. ECG signals classification using MFCC coefficients and ANN classifier. In: Proceedings of 2016 International Conference on Electrical and Information Technologies, ICEIT 2016, pp.480-484. DOI: https://doi.org/10.1109/EITech.2016.7519646

Foody, G.M., 2023. Challenges in the real world use of classification accuracy metrics: From recall and precision to the Matthews correlation coefficient. PLoS One, 18(10), p.e0291908. DOI: https://doi.org/10.1371/journal.pone.0291908

Goldberger, A.L., Amaral, L.A.N., Glass, L., Hausdorff, J.M., Ivanov, P.C., Mark, R.G., Mietus, J.E., Moody, G.B., Peng, C., and Stanley, H.E., 2000. PhysioBank, PhysioToolkit, and PhysioNet: Components of a new research resource for complex physiologic signals. Circulation, 101(23), pp.E215-E220. DOI: https://doi.org/10.1161/01.CIR.101.23.e215

Homaeinezhad, M.R., Atyabi, S.A., Tavakkoli, E., Toosi, H.N., Ghaffari, A., and Ebrahimpour, R., 2012. ECG arrhythmia recognition via a neuro-SVM-KNN hybrid classifier with virtual QRS image-based geometrical features. Expert Systems with Applications, 39(2), pp.2047-2058. DOI: https://doi.org/10.1016/j.eswa.2011.08.025

Ince, T., Kiranyaz, S., Eren, L., Askar, M., and Gabbouj, M., 2016. Real-time motor fault detection by 1-D convolutional neural networks. IEEE Transactions on Industrial Electronics, 63(11), pp.7067-7075. DOI: https://doi.org/10.1109/TIE.2016.2582729

Jiang, L., Cai, Z., Wang, D., and Jiang, S., 2007. Survey of Improving K-Nearest-Neighbor for Classification. In: Proceedings-Fourth International Conference on Fuzzy Systems and Knowledge Discovery, FSKD 2007. Vol. 1, pp.679-683. DOI: https://doi.org/10.1109/FSKD.2007.552

Kachuee, M., Fazeli, S., and Sarrafzadeh, M., 2018. ECG Heartbeat Classification: A Deep Transferable Representation. In: Proceedings-2018 IEEE International Conference on Healthcare Informatics, ICHI 2018, pp.443-444. DOI: https://doi.org/10.1109/ICHI.2018.00092

Khan, A., Sohail, A., Zahoora, U., and Qureshi, A.S., 2020. A survey of the recent architectures of deep convolutional neural networks. Artificial Intelligence Review, 53, pp.5455-5516. DOI: https://doi.org/10.1007/s10462-020-09825-6

Khatibi, T., and Rabinezhadsadatmahaleh, N., 2019. Proposing feature engineering method based on deep learning and K-NNs for ECG beat classification and arrhythmia detection. Australasian Physical and Engineering Sciences in Medicine, 43, pp.49-68. DOI: https://doi.org/10.1007/s13246-019-00814-w

Kiranyaz, S., Avci, O., Abdeljaber, O., Ince, T., Gabbouj, M., and Inman, D.J., 2021. 1D convolutional neural networks and applications: A survey. Mechanical Systems and Signal Processing, 151, p.107398. DOI: https://doi.org/10.1016/j.ymssp.2020.107398

Kiranyaz, S., Gastli, A., Ben-Brahim, L., Al-Emadi, N., and Gabbouj, M., 2019. Real-time fault detection and identification for MMC using 1-D convolutional neural networks. IEEE Transactions on Industrial Electronics, 66(11), pp.8760-8771. DOI: https://doi.org/10.1109/TIE.2018.2833045

Kiranyaz, S., Ince, T., and Gabbouj, M., 2016a. Real-time patient-specific ECG classification by 1-D convolutional neural networks. IEEE Transactions on Biomedical Engineering, 63(3), pp.664-675.

Kiranyaz, S., Ince, T., and Gabbouj, M., 2016b. Real-time patient-specific ECG classification by 1-D convolutional neural networks. IEEE Transactions on Biomedical Engineering, 63(3), pp.664-675. DOI: https://doi.org/10.1109/TBME.2015.2468589

Kiranyaz, S., Ince, T., Hamila, R., and Gabbouj, M., 2015. Convolutional Neural Networks for Patient-Specific ECG Classification. In: Proceedings of the Annual International Conference of the IEEE Engineering in Medicine and Biology Society, EMBS, 2015, pp.2608-2611. DOI: https://doi.org/10.1109/EMBC.2015.7318926

Labati, R.D., Enrique, M., Piuri, P., Sassi, R., and Scotti, R., 2018. Deep-ECG: Convolutional neural networks for ECG biometric recognition. Pattern Recognition Letters, 126, pp.78-85. DOI: https://doi.org/10.1016/j.patrec.2018.03.028

Li, T., and Zhou, M., 2016. ECG classification using wavelet packet entropy and random forests. Entropy, 18(8), p.285. DOI: https://doi.org/10.3390/e18080285

Litjens, G., Kooi, T., Bejnordi, B.E., Setio, A.A.A., Ciompi, F., Ghafoorian, M., Van der Laak, J.A.W.M., Van Ginneken, B., and Sánchez, C.I., 2017. A survey on deep learning in medical image analysis. Medical Image Analysis, 42, pp.60-88. DOI: https://doi.org/10.1016/j.media.2017.07.005

Luz, E.J.S., Schwartz, W.R., Cámara-Chávez, G., and Menotti, D., 2016. ECG-based heartbeat classification for arrhythmia detection: A survey. Computer Methods and Programs in Biomedicine, 127, pp.144-164. DOI: https://doi.org/10.1016/j.cmpb.2015.12.008

Martis, R.J., Acharya, U.R., Lim, C.M., Mandana, K.M., Ray, A.K., and Chakraborty, C., 2013a. Application of higher order cumulant features for cardiac health diagnosis using ECG signals. International Journal of Neural Systems, 23(4), p.1350014.

Martis, R.J., Acharya, U.R., Lim, C.M., Mandana, K.M., Ray, A.K., and Chakraborty, C., 2013b. Application of higher order cumulant features for cardiac health diagnosis using ECG signals. International Journal of Neural Systems, 23(4), p.1350014. DOI: https://doi.org/10.1142/S0129065713500147

Oh, S.L., Ng, E.Y.K., Tan, R.S., and Acharya, U.R., 2018. Automated diagnosis of arrhythmia using combination of CNN and LSTM techniques with variable length heart beats. Computers in Biology and Medicine, 102, pp.278-287. DOI: https://doi.org/10.1016/j.compbiomed.2018.06.002

Rautela, M., Gopalakrishnan, S., Gopalakrishnan, K., and Deng, Y., 2020. Ultrasonic Guided Waves Based Identification of Elastic Properties Using 1D-Convolutional Neural Networks. In: 2020 IEEE International Conference on Prognostics and Health Management (ICPHM). IEEE, United States, pp.1-7. DOI: https://doi.org/10.1109/ICPHM49022.2020.9187057

Sadhukhan, D., and Mitra, M., 2012. R-peak detection algorithm for Ecg using double difference and RR interval processing. Procedia Technology, 4, pp.873-877. DOI: https://doi.org/10.1016/j.protcy.2012.05.143

Safdarian, N., Dabanloo, N.J., and Attarodi, G., 2014. A new pattern recognition method for detection and localization of myocardial infarction using T-wave integral and total integral as extracted features from one cycle of ECG signal. Journal of Biomedical Science and Engineering, 7, pp.818-824. DOI: https://doi.org/10.4236/jbise.2014.710081

Saini, I., Singh, D., and Khosla, A., 2013. QRS detection using K-Nearest Neighbor algorithm (KNN) and evaluation on standard ECG databases. Journal of Advanced Research, 4(4), pp.331-344. DOI: https://doi.org/10.1016/j.jare.2012.05.007

Shima, Y., Nakashima, Y., and Yasuda, M., 2018. Pattern Augmentation for Handwritten Digit Classification Based on Combination of Pre-Trained CNN and SVM. In: 2017 6th International Conference on Informatics, Electronics and Vision and 2017 7th International Symposium in Computational Medical and Health Technology, ICIEV-ISCMHT 2017, pp.1-6. DOI: https://doi.org/10.1109/ICIEV.2017.8338575

Smíšek, R., Hejč, J., Ronzhina, M., Němcová, A., Maršánová, L., Chmelík, J., Kolářová, J., Provazník, I., Smital, L., and Vítek, M., 2017. SVM Based ECG classification using rhythm and morphology features, cluster analysis and multilevel noise estimation. Computing in Cardiology, 44, pp.1-4. DOI: https://doi.org/10.22489/CinC.2017.172-200

Venkatesan, C., Karthigaikumar, P., Paul, A., Satheeskumaran, S., and Kumar, R., 2018. ECG signal preprocessing and SVM classifier-based abnormality detection in remote healthcare applications. IEEE Access, 6, pp.9767-9773. DOI: https://doi.org/10.1109/ACCESS.2018.2794346

Wang, J., 2020. A deep learning approach for atrial fibrillation signals classification based on convolutional and modified Elman neural network. Future Generation Computer Systems, 102, pp.670-679. DOI: https://doi.org/10.1016/j.future.2019.09.012

Zhai, X., and Tin, C., 2018. Automated ECG classification using dual heartbeat coupling based on convolutional neural network. IEEE Access, 6, pp.27465-27472. DOI: https://doi.org/10.1109/ACCESS.2018.2833841

Zhang, M.Z., and Zhou, Z.H., 2005. AK-Nearest Neighbor Based Algorithm for Multi-Label Classification. Vol. 2. IEEE, United States, pp.718-721.

Zubair, M., Kim, J., and Yoon, C., 2016. An Automated ECG Beat Classification System Using Convolutional Neural Networks. In: 2016 6th International Conference on IT Convergence and Security, ICITCS 2016. DOI: https://doi.org/10.1109/ICITCS.2016.7740310

Published
2024-02-29
How to Cite
Abdul, Z. K., Al‑Talabani, A. K., Rahman, C. M. and Asaad, S. M. (2024) “Electrocardiogram Heartbeat Classification using Convolutional Neural Network-k Nearest Neighbor”, ARO-THE SCIENTIFIC JOURNAL OF KOYA UNIVERSITY, 12(1), pp. 61-67. doi: 10.14500/aro.11444.