Electrocardiogram heartbeat classification based on a deep convolutional neural network and focal loss

The electrocardiogram (ECG) is an effective tool for cardiovascular disease diagnosis and arrhythmia detection. Most methods proposed in the literature include the following steps: 1) denoizing, 2) segmentation into heartbeats, 3) feature extraction, and 4) classification. In this paper, we present a deep learning method based on a convolutional neural network (CNN) model. CNN models can perform feature extraction automatically and jointly with the classification step. In other words, our proposed method does not require a feature extraction step with hand-crafted techniques. Our proposed method is also based on an algorithm for heartbeat segmentation that is different from most existing methods. In particular, the segmentation algorithm defines each ECG heartbeat to start at an R-peak and end after 1.2 times the median RR time interval in a 10-s window. This method is simple and effective, as it does not use any form of filtering or processing that requires assumptions about the signal morphology or spectrum. Although enhanced ECG heartbeat classification algorithms have been proposed in the literature, they failed to achieve high performance in detecting some heartbeat categories, especially for imbalanced datasets. To overcome this challenge, we propose an optimization step for the deep CNN model using a novel loss function called focal loss. This function focuses on minority heartbeat classes by increasing their importance. We trained and evaluated our proposed model with the MIT-BIH and INCART datasets to identify five arrhythmia categories (N, S, V, Q, and F) based on the Association for Advancement of Medical Instrumentation (AAMI) standard. The evaluation results revealed that the focal loss function improved the classification accuracy for the minority classes as well as the overall metrics. Our proposed method achieved 98.41% overall accuracy, 98.38% overall F1-score, 98.37% overall precision, and 98.41% overall recall. In addition, our method achieved better performance than that of existing state-of-the-art methods.

[1]  R Chitra,et al.  Analysis of myocardial infarction risk factors in heart disease data set , 2017 .

[2]  Jin He,et al.  Multi-information fusion neural networks for arrhythmia automatic detection , 2020, Comput. Methods Programs Biomed..

[3]  Andrew P. Bradley,et al.  The use of the area under the ROC curve in the evaluation of machine learning algorithms , 1997, Pattern Recognit..

[4]  Shoushui Wei,et al.  Performance Analysis of Ten Common QRS Detectors on Different ECG Application Cases , 2018, Journal of healthcare engineering.

[5]  Wendong Xiao,et al.  Electrocardiogram Classification Based on Faster Regions with Convolutional Neural Network , 2019, Sensors.

[6]  Shoushui Wei,et al.  The Accuracy on the Common Pan-Tompkins Based QRS Detection Methods Through Low-Quality Electrocardiogram Database , 2017 .

[7]  William Robson Schwartz,et al.  ECG-based heartbeat classification for arrhythmia detection: A survey , 2016, Comput. Methods Programs Biomed..

[8]  S. Bogdan,et al.  Arrhythmias in Right Heart Disease , 2018 .

[9]  Muttukrishnan Rajarajan,et al.  PIndroid: A novel Android malware detection system using ensemble learning , 2017 .

[10]  Marina Ronzhina,et al.  ECG features and methods for automatic classification of ventricular premature and ischemic heartbeats: A comprehensive experimental study , 2017, Scientific Reports.

[11]  Saroj Kumar Pandey,et al.  Automatic arrhythmia recognition from electrocardiogram signals using different feature methods with long short-term memory network model , 2020, Signal, Image and Video Processing.

[12]  Arturo José Méndez Penín,et al.  A comparison of three QRS detection algorithms over a public database , 2013 .

[13]  Victor Hugo C. de Albuquerque,et al.  A novel electrocardiogram feature extraction approach for cardiac arrhythmia classification , 2019, Future Gener. Comput. Syst..

[14]  Fatemeh Afghah,et al.  Inter- and Intra- Patient ECG Heartbeat Classification for Arrhythmia Detection: A Sequence to Sequence Deep Learning Approach , 2018, ICASSP 2019 - 2019 IEEE International Conference on Acoustics, Speech and Signal Processing (ICASSP).

[15]  Mohamed Hammad,et al.  Detection of abnormal heart conditions based on characteristics of ECG signals , 2018, Measurement.

[16]  David Menotti,et al.  Inter-Patient ECG Heartbeat Classification with Temporal VCG Optimized by PSO , 2017, Scientific Reports.

[17]  Min Zhou,et al.  ECG Classification Using Wavelet Packet Entropy and Random Forests , 2016, Entropy.

[18]  Willis J. Tompkins,et al.  A Real-Time QRS Detection Algorithm , 1985, IEEE Transactions on Biomedical Engineering.

[19]  Willis J. Tompkins,et al.  Quantitative Investigation of QRS Detection Rules Using the MIT/BIH Arrhythmia Database , 1986, IEEE Transactions on Biomedical Engineering.

[20]  Jimeng Sun,et al.  Opportunities and Challenges in Deep Learning Methods on Electrocardiogram Data: A Systematic Review , 2020, ArXiv.

[21]  Ross B. Girshick,et al.  Focal Loss for Dense Object Detection , 2017, IEEE Transactions on Pattern Analysis and Machine Intelligence.

[22]  Yixiang Huang,et al.  A high-precision arrhythmia classification method based on dual fully connected neural network , 2020, Biomed. Signal Process. Control..

[23]  Oscar Castillo,et al.  Hybrid intelligent system for cardiac arrhythmia classification with Fuzzy K-Nearest Neighbors and neural networks combined with a fuzzy system , 2012, Expert Syst. Appl..

[24]  U. Rajendra Acharya,et al.  A deep convolutional neural network model to classify heartbeats , 2017, Comput. Biol. Medicine.

[25]  M. Arthanari,et al.  ECG Feature Extraction Techniques - A Survey Approach , 2010, ArXiv.

[26]  Dr. Jojo Moolayil Learn Keras for Deep Neural Networks , 2018, Apress.

[27]  Li Wan,et al.  Heartbeat classification using deep residual convolutional neural network from 2-lead electrocardiogram. , 2019, Journal of electrocardiology.

[28]  Roger G. Mark,et al.  The MIT-BIH Arrhythmia Database on CD-ROM and software for use with it , 1990, [1990] Proceedings Computers in Cardiology.

[29]  U. Rajendra Acharya,et al.  A new approach for arrhythmia classification using deep coded features and LSTM networks , 2019, Comput. Methods Programs Biomed..

[30]  Maurice Tchuente,et al.  Adaptive ECG beat classification by ordinal pattern based entropies , 2020, Commun. Nonlinear Sci. Numer. Simul..

[31]  Anca L. Ralescu,et al.  Confusion Matrix-based Feature Selection , 2011, MAICS.

[32]  Bin Yan,et al.  Weighted Focal Loss: An Effective Loss Function to Overcome Unbalance Problem of Chest X-ray14 , 2018, IOP Conference Series: Materials Science and Engineering.

[33]  Jeffrey M. Hausdorff,et al.  Physionet: Components of a New Research Resource for Complex Physiologic Signals". Circu-lation Vol , 2000 .

[34]  Selcan Kaplan Berkaya,et al.  A survey on ECG analysis , 2018, Biomed. Signal Process. Control..

[35]  Fevrier Valdez,et al.  A new neural network model based on the LVQ algorithm for multi-class classification of arrhythmias , 2014, Inf. Sci..

[36]  Patricia Melin,et al.  Classification of Arrhythmias Using Modular Architecture of LVQ Neural Network and Type 2 Fuzzy Logic , 2017, Nature-Inspired Design of Hybrid Intelligent Systems.

[37]  Tareq Abed Mohammed,et al.  Understanding of a convolutional neural network , 2017, 2017 International Conference on Engineering and Technology (ICET).

[38]  Chandan Chakraborty,et al.  Application of Higher Order cumulant Features for Cardiac Health Diagnosis using ECG signals , 2013, Int. J. Neural Syst..

[39]  Majid Sarrafzadeh,et al.  ECG Heartbeat Classification: A Deep Transferable Representation , 2018, 2018 IEEE International Conference on Healthcare Informatics (ICHI).

[40]  Patricia Melin,et al.  Hybrid model based on neural networks, type-1 and type-2 fuzzy systems for 2-lead cardiac arrhythmia classification , 2019, Expert Syst. Appl..

[41]  Feng Jiang,et al.  Very deep feature extraction and fusion for arrhythmias detection , 2018, Neural Computing and Applications.

[42]  Giuseppe De Pietro,et al.  A deep learning approach for ECG-based heartbeat classification for arrhythmia detection , 2018, Future Gener. Comput. Syst..

[43]  Kup-Sze Choi,et al.  Heartbeat classification using disease-specific feature selection , 2014, Comput. Biol. Medicine.

[44]  G.B. Moody,et al.  The impact of the MIT-BIH Arrhythmia Database , 2001, IEEE Engineering in Medicine and Biology Magazine.