1D модель CNN для діагностики ЕКГ на кількох класифікаторах

One of the main reasons for human death is diseases caused by the heart. Detecting heart diseases in the early stage can stop heart failure or any damage related to the heart muscle. One of the main signals that can be beneficial in the diagnosis of diseases of the heart is the electrocardiogram (EC...

Ausführliche Beschreibung

Gespeichert in:
Bibliographische Detailangaben
Datum:2022
Hauptverfasser: Bassiouni, Mahmoud, Hegazy, Islam, Rizk, Nouhad, El-Dahshan, El-Sayed, Salem, Abdelbadeeh
Format: Artikel
Sprache:Englisch
Veröffentlicht: The National Technical University of Ukraine "Igor Sikorsky Kyiv Polytechnic Institute" 2022
Schlagworte:
Online Zugang:https://journal.iasa.kpi.ua/article/view/265099
Tags: Tag hinzufügen
Keine Tags, Fügen Sie den ersten Tag hinzu!
Назва журналу:System research and information technologies
Завантажити файл: Pdf

Institution

System research and information technologies
_version_ 1866391923951927296
author Bassiouni, Mahmoud
Hegazy, Islam
Rizk, Nouhad
El-Dahshan, El-Sayed
Salem, Abdelbadeeh
author_facet Bassiouni, Mahmoud
Hegazy, Islam
Rizk, Nouhad
El-Dahshan, El-Sayed
Salem, Abdelbadeeh
author_sort Bassiouni, Mahmoud
baseUrl_str http://journal.iasa.kpi.ua/oai
collection OJS
datestamp_date 2023-05-21T20:04:38Z
description One of the main reasons for human death is diseases caused by the heart. Detecting heart diseases in the early stage can stop heart failure or any damage related to the heart muscle. One of the main signals that can be beneficial in the diagnosis of diseases of the heart is the electrocardiogram (ECG). This paper concentrates on the diagnosis of four types of ECG records such as myocardial infarction (MYC), normal (N), variances in the ST-segment (ST), and supraventricular arrhythmia (SV). The methodology captures the data from six main datasets, and then the ECG records are filtered using a pre-processing chain. Afterward, a proposed 1D CNN model is applied to extract features from the ECG records. Then, two different classifiers are applied to test the extracted features’ performance and obtain a robust diagnosis accuracy. The two classifiers are the softmax and random forest (RF) classifiers. An experiment is applied to diagnose the four types of ECG records. Finally, the highest performance was achieved using the RF classifier, reaching an accuracy of 98.3%. The comparison with other related works showed that the proposed methodology could be applied as a medical application for the early detection of heart diseases.
doi_str_mv 10.20535/SRIT.2308-8893.2022.4.01
first_indexed 2025-07-17T10:27:57Z
format Article
fulltext  Mahmoud M. Bassiouni, Islam Hegazy, Nouhad Rizk, El-Sayed A. El-Dahshan, Abdelbadeeh M. Salem, 2022 Системні дослідження та інформаційні технології, 2022, № 4 7 TIДC ПРОБЛЕМИ ПРИЙНЯТТЯ РІШЕНЬ ТА УПРАВЛІННЯ В ЕКОНОМІЧНИХ, ТЕХНІЧНИХ, ЕКОЛОГІЧНИХ І СОЦІАЛЬНИХ СИСТЕМАХ UDC 62-50 DOI: 10.20535/SRIT.2308-8893.2022.4.01 1D CNN MODEL FOR ECG DIAGNOSIS BASED ON SEVERAL CLASSIFIERS MAHMOUD M. BASSIOUNI, ISLAM HEGAZY, NOUHAD RIZK, EL-SAYED A. EL-DAHSHAN, ABDELBADEEH M. SALEM Abstract. One of the main reasons for human death is diseases caused by the heart. Detecting heart diseases in the early stage can stop heart failure or any damage re- lated to the heart muscle. One of the main signals that can be beneficial in the diag- nosis of diseases of the heart is the electrocardiogram (ECG). This paper concen- trates on the diagnosis of four types of ECG records such as myocardial infarction (MYC), normal (N), variances in the ST-segment (ST), and supraventricular ar- rhythmia (SV). The methodology captures the data from six main datasets, and then the ECG records are filtered using a pre-processing chain. Afterward, a proposed 1D CNN model is applied to extract features from the ECG records. Then, two different classifiers are applied to test the extracted features’ performance and obtain a robust diagnosis accuracy. The two classifiers are the softmax and random forest (RF) clas- sifiers. An experiment is applied to diagnose the four types of ECG records. Finally, the highest performance was achieved using the RF classifier, reaching an accuracy of 98.3%. The comparison with other related works showed that the proposed methodology could be applied as a medical application for the early detection of heart diseases. Keywords: Electrocardiogram (ECG), Continuous wavelet transform (CWT), 1D convolutional neural network (CNN) model. INTRODUCTION Heart diseases are one of the main reasons for death worldwide and they are sometimes called cardiovascular diseases (CVD). Various people suffer and die from heart diseases annually based on recent research and survey studies. In 2022 [1], it is estimated that about 17.9 million people died from CVD, and this repre- sents about 32% of the global death, and about 85% of these people have died from heart attack and stroke. Moreover, CVD was responsible for 38% of all premature deaths (under the age of 70) due to non-communicable diseases. About 3 quarters of the deaths caused by CVD occur in the low-and middle- income countries. Arrhythmia is one of the salient groups of CVDs. They repre- sent the abnormal electrical conduction or impulse origin in the heart. Most of the arrhythmias are non-life-threatening, while some of them can cause many cardio- Mahmoud M. Bassiouni, Islam Hegazy, Nouhad Rizk, El-Sayed A. El-Dahshan, Abdelbadeeh M. Salem ISSN 1681–6048 System Research & Information Technologies, 2022, № 4 8 vascular complications and sudden death. The early diagnosis of arrhythmia can assist in preventing sudden death and help in treating many different cardiovascu- lar diseases. Physicians, experts, and doctors detect arrhythmias based on electro- cardiograms (ECG) signals. The ECG measures the variations in the electrical potential in one cycle of the heartbeat. A single ECG signal consists of a group of peaks defined by , , ,P Q R S and T . Moreover, various types of arrhythmia do not appear in a short time and may require a large amount of ECG heartbeats. As a result, a diagnosis method automated should be investigated for the identification of different ECG records and this is the main focus of the proposed methodology. Several methodologies based on machine learning have been built for ex- tracting features and classifying ECG records. On one hand, extracting features from ECG signals is essential before the classification process because it provides a great impact on the results of the classification. P-QRS-T segment and RR in- terval were used in almost every research [2]. In addition to this, there are other conventional features extracted from the ECG based on morphological features, wavelet transform features, higher-order statistics, random projection, and wave- let packet entropy. These methodologies require providing a hand-crafted feature before applying any conventional classifier. There are several disadvantages in these processes of feature extraction which are depthless, large time-consuming and they lack any implicit knowledge. On the other hand, several numbers of classifiers were applied such as a k-nearest neighbor, artificial neural network, support vector machine, random forest, and Gaussian mixture models. When these conventional features are fit to these conventional classifiers they suffer from overfitting obstacles. The main causes for overfitting are as follows: (i) noise and unclean data used for training (ii) high variance and complexity of the model (iii) size of the training set is not enough (iv) learning from a small dataset. Deep learning (DL) is preserved to be part of machine learning. It is known by the word “deep” because the network structure consists of many hidden layers [3]. The main concept in DL is that the low-level features are integrated to obtain high-level features. In DL no hand-craft features are obtained and implicit knowledge can be learned easily. DL has also been used in some of the ECG studies, and it showed excellent classification results in diagnosis. Several DL structures were used such as recurrent neural network, stacked de-noising auto-encoder, deep neural network, convolutional neural networks, and restricted Boltzmann machine. Finally, based on the advantages of the DL the proposed methodology used the merits of the DL and delivered the following contributions. The contributions stemming from this paper are two-main folds: 1. The proposed DL is used to diagnose four main ECG records based on balanced datasets of records. 2. Development of a proposed 1D CNN model for the diagnosis of several ECG diseases. The manuscript is summarized based on different sections. Related works are presented in section 2, while the proposed methodology in terms of capturing ECG records, filtering the ECG signals, extracting features, and classifying the ECG records is presented in section 3. Moreover, the main results and the discus- sion are illustrated in sections 4 and 5 respectively. Finally, section 6 manifests the conclusion and the future directions. 1D CNN model for ECG diagnosis based on several classifiers Системні дослідження та інформаційні технології, 2022, № 4 9 RELATED WORK Various approaches are applied for the diagnosis of ECG signals. These ap- proaches depend on machine learning and deep learning methodologies and tech- niques. Some methods deal with the ECG signals in the form of 1D signal and other methods convert the 1D ECG signals to 2D images using several techniques such as fast Fourier transform and wavelet transforms. Moreover, numerous stud- ies applied 1D CNN models for extracting feature from the ECG records and heartbeats. A study presented by L.A. Abdullah et al. [4] for the diagnosis of ECG signals. The proposed model is based on a 1D CNN model for learning features, and the results are fed to a long short term memory (LSTM). The 1D CNN model consists of 4 (1D) convolutional and 2 fully connected layers, while the LSTM model consists of 2 LSTM and 2 fully connected layers. Two main datasets were used in their study which are MIT-BIH arrhythmia and PTB diagnostic datasets. The CNN-LSTM model has achieved an accuracy of 98.1% and 98.66% in the diagnosis of myocardial infraction (MYC) and other arrhythmia respectively. Another study presented by E. Butun. et al. [5] for detecting various heart diseases using ECG signals. The methodology is based on 1D version of capsule networks (CapsNet). The 1D CapsNet model consist of several layers based on convolutional and fully connected layers. The model starts with 1 input and 2 (1D) convolutional layers. Then, the model consists of 1D convolutional, 1 re- shape, and 1 squash layers. Afterwards, the output of the squashing is input to an ECG caps. The ECG caps consists of a masking layer and 3 fully connected lay- ers. Finally, the model ends with CapsNet for the ECG diagnosis. The model clas- sifies normal and coronary artery diseases (CAD) using 5-fold cross validation achieving an accuracy of 99.44% and 98.62% for 2s and 5s ECG segments re- spectively. In addition to this, a study presented by X. Hau et al. [6] for the diag- nosis of several ECG diseases. The methodology proposed is based on pre- processing, data augmentation, and data segmentation using R-R-R strategy. The data were selected from the MIT-BIH arrhythmia, and the number of ECG heart- beats selected are normal, left bundle block beat (LBBB), right bundle block beat (RBBB), premature ventricular contraction, and the paced beat. Then, the features are extracted using a proposed 1D CNN model. The model consists of 3 convolu- tional, 3 pooling, 1 fully connected layer, and 1 classification layer. It was tested on 5 classes of ECG heart beats, and the results using accuracy, area under the curve (AUC), sensitivity, and F1-score performance measurements have achieved 0.9924, 0.9994, 0.99, and 0.99 respectively. Moreover, a study provided by G. Petmeza et al. [7] for the diagnosis of ECG diseases. The methodology proposed relies on Butterworth filter for ECG signal de-noising. In addition to that, an improved version of cross-entropy loss to solve the problem of unbalanced data. Then, the R peaks and the beats of the ECG signals are separated before extracting features. Also, the features are extracted from a hybrid model depending on 1D CNN layers and LSTM layers. The model consists of 3 (1D) convolutional, 3 max pooling, 1 LSTM, and 1 dense layers. Ten-fold cross validation is applied to denoise normal, atrial fibrillation (AFID), atrial flutter (AFL), and AV junctional rhythm (J). The data was obtained from the MIT-BIH atrial fibrillation database, and the model achieved a sensitivity and specificity of 97.87% and 99.29% respectively. Finally, it can be seen from the previous works that various types of 1D CNN models were proposed, and the re- sults achieved or resulted from them was robust in performance. Therefore, it was recommended to develop a 1D CNN model for diagnosis of ECG records. Mahmoud M. Bassiouni, Islam Hegazy, Nouhad Rizk, El-Sayed A. El-Dahshan, Abdelbadeeh M. Salem ISSN 1681–6048 System Research & Information Technologies, 2022, № 4 10 METHODOLOGY The methodology consists of four main stages which are obtaining ECG data, fil- tering ECG signals, extracting various ECG features, and classifying ECG re- cords. In the data acquisition phase, six main data sets online are downloaded that consist of four different ECG heartbeats. In the second stage, filtering or de- noising is performed on the ECG heartbeats as the ECG signal consists of three main common noises which are line drifting, power interference, and noise based on a high frequency. These distortions are removed using wavelets and a set of filters. The next stage is to pass the filtered ECG records to a proposed 1D CNN model for feature extraction. Finally, in the classification phase, two different classifiers are em- ployed for ECG diagnosis which are Softmax and Random Forest (RF) as shown in Fig. 1. Data Acquisition This stage is one of the most important stages in the methodology proposed. There exist two concepts for capturing the ECG signals. The first concept is the application of a medical device for capturing the ECG heartbeats at different leads, whereas the second way is to download an available ECG signal online. In this methodology, the second way is employed, and the ECG signals are captured from six datasets which are Normal Sinus Rhythm Database (nsrdb) [8], Normal Sinus Rhythm RR Interval Database (nsr2db) [9], MIT-BIH Supraventricular ar- rhythmia database (svdb) [10], MIT-BIH ST change database (stdb) [11], Long Term ST database (ltsdb) [12] and PTB diagnostic ECG [13], where the number of ECG records in the former datasets are 18, 54, 84, 28, 86, and 549 respectively. Four main different ECG heartbeats were chosen from these datasets. Pre-processing ECG signals are always nested in it some distortions and noises that are produced from variant origins. The main three types of noises concentrated in the ECG sig- nals are the drifting in the baseline of ECG signal, interference in the power line, high noise frequency in the main components of the signal, and in some cases, a combination between these types of noises can be found. As a result, a pre- processing chain of filters and wavelets is developed to eliminate these noises by saving the main information of the signal. The pre-processing chain should be summarized in three main tasks which are correcting the drifting in the ECG signal, reducing the interference, selecting low-frequency components, and en- Feature Extraction • Convolution Neural Network based on a proposed 1D CNN model Classifiers • SoftMax • Random Forest (RF) Raw ECG Signal Types • Nwormal (N) • Supraventricular arrhythmia (SV) • ST-segments changes (ST) • Myocardia Infraction (MYC) Preprocessing • Wevelet Transform • Adaptive band stop filter • low pass Batter worth filter • Smoothing Evaluation metrics • Accuracy • Precision • F-measure • Sensitivity • Specificity Fig. 1. Proposed Overall Methodology 1D CNN model for ECG diagnosis based on several classifiers Системні дослідження та інформаційні технології, 2022, № 4 11 hancing the overall signal [14]. The chain contains four main stages based on wavelet drift correction, adaptive band stop filter, low pass filter, and smoothing. The baseline drift is removed by applying wavelet decomposition with db8 and a decomposition level equal to 9. Then, the powerline interference is removed using an adaptive band stop fil- ter with a stopband frequency corner sW equals to 50Hz. In addition to this, high frequency located in the ECG signals is removed using a low pass Butterworth filter with a passband frequency corner and a stopband frequency corner equal to 40Hz and 60Hz respectively. The values for the passband ripple and stopband ripple attenuation are 0.1dB and 30dB respectively [15]. Finally, a smoothing fil- ter based on Savitzky–Golay (SG) is applied to remove the remaining noise with a smoothing value equal to 5. Feature Extraction Convolutional Neural Networks based on 1D-CNN Model. The datasets faced in this study does not have any previous information or knowledge about the fea- tures that can be extracted from them. Also, it may be very difficult to extract ro- bust features using traditional machine learning or feature engineering techniques. It is recommended to learn information or features automatically using deep learning. Therefore, the CNN model is developed to obtained robust features from the ECG records [16]. The main core of the CNN model is the convolutional layers because these layers work by applying a convolution operation between the local and filter regions of the input. It is also known that CNN models are designed for two- dimensional data that appear in most cases in the form of images. The proposed 1D CNN model depends mainly on convolutional layers at the beginning of the model and at the middle of the model. The convolutional layers at the beginning extracts low level features from the ECG signals that can appear in the form of sudden variances, while the convolutional layers in the middle extracts high level and more abstract features related to the ECG signals. To use the CNN model that relies on the convolutional layers for 1D signals, the convolutional layers must be redesigned to match the input. The proposed CNN model consists of an input layer, 3 convolutional layers, 3 ReLU layers, 3 batch normalization layers, 3 max pooling layers, and ending with 3 fully connected layers [17]. The structure of the proposed 1D CNN is shown in Fig. 2, and the details (Filter size, Stride, Padding) of each layers in the proposed 1D CNN are shown in table 1. T a b l e 1 . The Whole Parameters of the proposed 1D CNN Model Layer No Layers Name Activations Learnables Parameters 1 Input Layer 1  65536  1 – Input Size = [1 65536 1] Normalization = “zero center” 2 Convolutional 1  4  32 W = [1  23  1  32] B = [1  1  32] Filter Size = [1 32] No. Filters = 32 Stride = [3 3] Padding = [0 0 0 0] 3 Activation 1  4  32 – Function = “ReLU” 4 Batch Normalization 1  4  32 Offset = 1  1  16 Scale = 1  1  16 Mahmoud M. Bassiouni, Islam Hegazy, Nouhad Rizk, El-Sayed A. El-Dahshan, Abdelbadeeh M. Salem ISSN 1681–6048 System Research & Information Technologies, 2022, № 4 12 Continued table 1 Layer No Layers Name Activations Learnables Parameters 5 Max Pooling 1  1  32 – Pool Size = [1 2] Stride = [1 1] Padding = [ 0 0 0 0] 6 Convolutional 1  1  32 W = [1 � 23  1 32] B = [1  1  32] Filter Size = [1 32] No. Filters = 32 Stride = [2 2] Padding = [0 0 0 0] 7 Activation 1  4  32 – Function = “ReLU” 8 Batch Normalization 1  4  32 Offset = 1  1  16 Scale = 1  1  16 9 Max Pooling 1  1  32 – Pool Size = [1 2] Stride = [1 1] Padding = [ 0 0 0 0] 10 Convolutional 1  1  16 W = [1  23  1  32] B = [1  1  32] Filter Size = [1 16] No. Filters = 16 Stride = [1 1] Padding = [0 0 0 0] 11 Activation 1  4  16 – Function = “ReLU” 12 Batch Normalization 1  4  16 Offset = 1  1  16 Scale = 1  1  16 13 Max Pooling 1  1  16 – Pool Size = [1 2] Stride = [1 1] Padding = [ 0 0 0 0] 14 Fully Connected 1  1  100 W = [100  16] B = [100  1] Output Size = 100 15 Fully Connected 1  1  4 W = [100  4] B = [100  1] Output Size = 4 Fig. 2. The proposed 1D CNN model for ECG records Diagnosis 1D CNN model for ECG diagnosis based on several classifiers Системні дослідження та інформаційні технології, 2022, № 4 13 Classification This step is the final step of the proposed methodology in which the result of the diagnosis will be determined with average accuracy. Two main classifiers are de- termined to examine the performance of the methodology, and these classifiers are Softmax, Random forest (RF), and XGBoost classifier. Softmax Classifier. Softmax is known as a multinomial logistic regression and it is well accepted in statistical mathematics as it is applied to classify a categorical class placement. Softmax gives a more intuitive classification output and probabilistic interpretation [18]. For instance, let us assume that 4 classes are presented, the Softmax classifier will have 4 main nodes generated and defined by iP , where 1,2,3,4i  . These probabilities depend on a discrete target function, and these probabilities are input to the Softmax classifier in the form of the following equation: i k ki k S Y t , where y is the activation produced from the nodes found in the last layers, and the t is the weight that joins the last layers of nodes to the last layers in the DL model [64]. The probability of the iS will be defined using the following equation: )(exp )(exp 2 i i i S S P   j . The predicated class i will be obtained by the following equation: )(maxarg iPi  . Random Forest (RF) Classifier. Random Forests (RF) are one of the powerful ensemble learning methods. RF was developed to overcome the drawbacks of decision trees (DT). The major disadvantage of the DT is the high variance. In order words, it is not natural that a small variance in the training data can lead to a major change in the structure of a decision tree. This makes the decision trees as a classifier largely unstable in comparison to other decision predictors. Also, if an error happens in a node that is near the root, it propagates to the leaves of the tree. This leads to different and worse classification results. Therefore, the classifier of the random forest is invented by Breiman [19]. RF is built based on the combination of various decision trees. It integrates the output obtained from each separate decision tree to generate the final result. In addition to that, RF relies on uncorrelated decision trees. In other words, if similar decision trees are used in the forest, then the overall result will not vary so much and it will be equivalent to the result of a single decision tree. To achieve the concept of un- correlated decision trees in RF features randomness and bootstrapping are applied. Random forests work considering a learning set known by  ),,(( 11 YXL ,( , ))i iX Y designed with i vector. Where X is a set of features and samples and the Y is the set of labels. In the classification problems, RF maps X to Y and new input features are recognized by each tree of the forest. Then, each tree produces a specific classification result and the decision forest selectsthe classifi- cation based on the most votes obtained over all the trees in the forest. The training of the RF is achieved relying on the result obtained from each decision tree. The training data is distributed randomly based on drawing N examples with a special kind of replacement in which the N is considered the Mahmoud M. Bassiouni, Islam Hegazy, Nouhad Rizk, El-Sayed A. El-Dahshan, Abdelbadeeh M. Salem ISSN 1681–6048 System Research & Information Technologies, 2022, № 4 14 original size of the training data. The learning method produces a classifier obtained from various trials and then the classifiers are gathered together to form the final classifier. In the classification stage, each classifier starts to record a vote for the class to which it belongs and the feature is drawn to the class with the highest votes. EXPERIMENTAL RESULTS The experimental result was reached using the proposed model based on two main classifiers which are SoftMax, and RF. The deep learning model was im- plemented using MATLAB software. An experiment is applied based on the pro- posed methodology for the diagnosis of four different ECG records. The whole experiment is performed on a computer with Intel (R) Core i7-8565U CPU of 1.99 GHz, 12 GB memory, and NVIDIA graphical card with GM 310M. The total number of records selected from 6 datasets for the four types of ECG heartbeats is 294 records. These records are collected as follows: 72 normal records (NSR) from the first two datasets (18 from nsrdb) and (54 from nsr2db), 74 supraven- tricular arrhythmias (SV) records from the third dataset (svdb), 74 records repre- senting ST-segment changes from the fourth and the fifth datasets (28 from stdb) and (46 from ltsdb), and finally 74 myocardial infractions (MYC) records from the sixth dataset. The experiment was based on dividing the whole ECG records into three different parts training, validation, and test. This division made 177 re- cords used for training and 57 records for validation and 60 for the test. The pa- rameters of the training are adjusted properly to achieve the highest training per- formance and the lowest loss error. Training Parameters Setting The parameters of the 1D CNN model applied for the ECG diagnosis are deter- mined in the Table 2. There exist various hyper-parameters that can be set before the training process. The selected parameters are the optimizer, mini-batch size, maximum epochs, and total number of iterations, regularization factor, and the validation frequency. T a b l e 2 . Parameters adjusted for the proposed 1D CNN Model t Optimizer Mini Batch Size Maximum Epochs Number of iterations Validation Ac- curacy (%) 8 100 2100 94.73 16 100 1100 92.98 32 100 500 89.47 Stochastic gradient descent Momentum (Sgdm) 35 100 500 94.73 8 100 2100 92.98 16 100 1100 94.73 32 100 500 94.73 Adaptive Moment estimation (adam) 35 100 500 91.22 8 100 2100 98.24 16 100 1100 89.47 32 100 500 91.22 Root mean square propagation (RMSprop) 35 100 500 89.47 The optimal parameters selected for the 1D CNN model for the diagnosis of the ECG records are determined experimentally. The optimizers used for training 1D CNN model for ECG diagnosis based on several classifiers Системні дослідження та інформаційні технології, 2022, № 4 15 the 1D CNN model are the stochastic gradient descent with momentum (SGDM), adaptive moment estimation (adam), and root mean square propagation (RMSprop). The mini-batch size parameter is applied with different values such as 8, 16, 32, and 35 on the three optimizers. The maximum epochs are 100 and the iterations vary relying on the size of the data and the mini-batch size values. A validation data is input during the training process with a validation fre- quency equal to 30, and an L2 regularization factor is defined with a value equal to 41 10 . It can be seen that when the optimizer is set to rmsprop, and the mini- batch size is 8 the performance of the validation data has the highest accuracy. Therefore, the test data are passed to the model with the highest validation accuracy. In the training stage, the accuracy and the loss curves are obtained for each of the pre-trained models which is the 1D CNN model. Fig. 3 shows the highest performance achieved based on the validation data. The blue curve presents the training curve, whereas, the black dashed curve presents the validation accuracy curve during the training phase. Classification Parameters It is important to determine the hyper-parameters required before training the 1D CNN model. It is also essential to determine the parameters used on each classi- fier after applying 1D CNN model for feature extraction. As mentioned before, two main classifiers are used to determine the diagnosis performance of the 1D CNN features. T a b l e 3 . Classifiers applied in the methodology and its optimal parameters Classifiers Optimal Parameters Softmax Loss function : "Cross Entropy (CE)" Random Forest Number of trees = 100 Max depth of each tree = 0 (zero indicates unlimited) Number of features = (log2(no.of.predictors)+1) The first classifier is the Softmax classifier and its main parameter is the loss function which is defined by the cross-entropy. The next classifier is the random forest and it has a set of parameters such as the number of features extracted, number of trees, and the maximum depth of each tree. Finally, the last classifier Fig. 3. Training and Vcalidation Accuracy curves performance of proposed 1D CNN Model Mahmoud M. Bassiouni, Islam Hegazy, Nouhad Rizk, El-Sayed A. El-Dahshan, Abdelbadeeh M. Salem ISSN 1681–6048 System Research & Information Technologies, 2022, № 4 16 applied is the XGBoost classifier and it also has several parameters. These parameters are chosen depending on the kind of classification that XGBoost will perform. In the case of multi-class classification (as in this study) the booster and the evaluation matrix must be defined by gbtree and mlogloss respectively. The rest of the XGBoost parameters are used based on their default values in the library of XGBoost. Table 3 shows the main parameters’ values for the classifiers used after applying the 1D CNN model. Classification Results The features obtained from the fully connected layer of the 1D CNN model are forward for the two classifiers. The classifiers start to operate on the test data to ensure the performance of the validation accuracy obtained during the training. Table.4 shows various statistical performance measurements such as true positive rate (TPR), precision, false-positive rate (FPR), recall, receiver operating characteristic (ROC), Mathew’s correlation coefficient (MCC), and precision- recall characteristic (PRC) value [22]. T a b l e . 4 . Classifiers performance using 1D CNN model based on different statistical measurements Performance Measurements (%) Classifiers Performance TPR FPR Precision Recall F- Measure Accuracy MCC ROC Value PRC Value Softmax 0.967 0.011 0.971 0.967 0.967 0.967 0.957 0.992 0.980 RF 0.983 0.006 0.984 0.983 0.983 98.33 0.978 0.997 0.993 These measurements are calculated for each classifier on the test data. In addition to this, the confusion matrix is manifested to determine the overall diagnosis performance on the classifiers. The confusion matrix is a figure or a table that is needed to describe the diagnosis performance of the tested data. It is a heat map in which the true value must be known. It gives the chance to visualize the performance of the two applied classifiers on the 1D CNN deep learning mod- el as shown in Fig. 4 (a and b). It can be manifested that the RF classifier has the highest accuracy performance over other classifiers. Confusion Matrix dased on 1D CNN Model using Softmax Classifier Confusion Matrix dased on 1D CNN Model using Random Forest Classifier a b Fig. 4. Confusion matrices of Softmax (a) and RF Classifiers on the features obtained from 1D CNN Model (b) 1D CNN model for ECG diagnosis based on several classifiers Системні дослідження та інформаційні технології, 2022, № 4 17 DISCUSSION The paper proposed a methodology for the diagnosis of four main types of ECG heartbeats. The methodology consists of four main phases, and these phases are obtaining ECG data, filtering ECG signals, extracting various ECG features, and classifying ECG records. In the phase of gathering ECG data, the ECG records are obtained from six various online ECG datasets. In the phase of signal filtra- tion, the records are filtered using wavelets and a set of filters based on band stop, low pass, and smoothing filter to eliminate the main common noises in the ECG signals. In the phase of extracting features, the most discernment feature was ob- tained from a proposed 1D CNN model. Finally, the classification is applied based on two main classifiers and these classifiers are Softmax, and RF classifier. To overcome the chances of overfitting in the proposed model, a regularization factor is defined to shrink the learned estimates to zero. In other words, this regu- larization can tune the loss function by providing a penalty term to the optimizer of the 1D CNN model, and this will encourage smaller weights avoiding exces- sive changes of the coefficient. In addition to this, the number of ECG records in each of the four ECG classes are nearly equal leading to a balanced number of records in each category, dropping the probability of overfitting. Moreover, the ECG records are filtered using a pre-processing chain for reducing common nois- es that can cause overfitting during the training. Finally, the training accuracy ob- tained from the model with the highest accuracy validation is 99.5% and the value of the highest test accuracy is 98.3%, the slight difference between the training and the test accuracies shows that the model appropriately fits. For comparison with others, several algorithms applied different methodolo- gies for ECG diagnosis as shown in Table 5. S. Yu and M. Lee. [23], the authors approached an accuracy of 96.38% with the bispectrum feature set and SVM as the classifier, and when the authors added the genetic feature selector to the bis- pectrum and the SVM was used for classification, the accuracy increased to 98.10%. The number of records used was 54 and 29 from each of the normal si- nus rhythm (NSR) and cognitive heart failure (CHF) data sets, respectively. K.H. Boon et al. [24] applied a diagnosis method to differentiate between normal and abnormal based on PAF. The features were produced from 106 ECG data col- lected from 53 ECG recordings. The SVM classifies based on 5 mins heart rate variability (HRV) segment and its distance from the PAF event. If it is at least 45 min distant from the event, the recording is called normal, but if the HVR seg- ment goes before the event the recording is called abnormal. The accuracy achieved was 87.7%. Based on the improvement in the deep learning models in the diagnosis of the ECG heartbeats. H.B. Bae et al. [25] tried to classify normal NSR and abnormal ECG records such as AF, and ventricular fibrillation (VF) and they also focused on balancing the number of records used. The classification was based on Gamma distribution using probability output networks (CPON), and it proved that the performance was higher than KNN, SVM, aiming at an accuracy of 97.33%. R.R. Janghel et al. [26] aimed at building automated classification of regular and irregular ECG heartbeats. They applied their system on 47 records and the best results were achieved by using the decision tree, obtaining an accu- racy of 88.2%. Mahmoud M. Bassiouni, Islam Hegazy, Nouhad Rizk, El-Sayed A. El-Dahshan, Abdelbadeeh M. Salem ISSN 1681–6048 System Research & Information Technologies, 2022, № 4 18 T a b l e 5 . Proposed DL model compared to other previous work for ECG diagnosis Authors Records Methodology Classes Databases Performance S.N. Yu et al. [23] 2012 54 R from NSR + 29 R from CHF Features: Bisecpectrum + genetic feature set Classifier: SVM- 2 MIT-BIH NSR and CHF Bisecptrum + SVM = 96.38% Bispecturm + ge- netic feature set + SVM = 98.10% K.H. Boon et al. [24] 2018 106 data from 53 R pairs Features: Time domain, spectral, Bispectrum, nonlinear dynamics features Classifiers: SVM 2 Atrial Fibrillation prediction (AFPDB) Database ACC = 87.7% H.B. Bae et al. [25] 2019 NSR: 15 R VF: 15 R AF: 15 R R–R interval + (CPON) 3 MIT-BIH (NSRDB), (VFDB), (AFDB) ACC = 97.33% R.R. Jang- hel et al. [26] 2020 47 R 40% of the 47 R records are pa- tients Naïve Bayes SVM Ada-boost RF, Decision Tree, and KNN 2 MIT-BIH arrhythmia database ACC of the Decision Tree = 88.2% The proposed Method 294 R 177 R for train 117 R for valida- tion and test Proposed 1D CNN Model 4 6 main data- sets Softmax ACC =96.7% RF ACC = 98.3% The proposed methodology worked on 294 recordings obtained from 4 dif- ferent ECG heartbeats. The features are obtained from a 1D CNN model. Two main classifiers were applied to reach 96.7% using Softmax and 98.3% using RF classifier. The advantages of the proposed model are illustrated in three main points. The first point is the removal of the three common noises related to the ECG signals using a well-defined pre-processing chain. The second point is ob- taining robust features from the 1D CNN model. The last point is the superiority of the XB-boost in the classification because it is highly flexible, can be paral- leled, supports generalization, and is faster than gradient boosting. CONCLUSIONS AND FUTURE WORK In this study, a methodology is presented for the diagnosis of the four different types of ECG heartbeats based on a proposed 1D CNN model. The proposed methodology produces better results makes it adaptable for the diagnosis of dif- ferent ECG records. The data were collected from 6 public available datasets. The ECG records were filtered to drifting in the ECG signals, powerline interference, and the high noise frequencies. The filtering chain is based on wavelets and a set of filters. Then, the ECG records are passed to a 1D CNN model for feature ex- traction. Finally, the classification is based on Softmax and RF, classifiers achiev- ing an accuracy of 96.6% and 98.3%, respectively. ECG signals have future direc- tions that can contribute and provide assistance in the field of medical informatics. There is a need for a real-time diagnosis application that can verify various types of heart diseases. In addition to this, it was discovered recently that the ECG signals can diagnose COVID patients based on the ECG image reports. It is recommended to develop diagnosis systems that can identify COVID patients from normal and various abnormal heartbeats. It is also suggested to use stratified k-fold cross-validation in future experiments to provide more information about the methodology performance. It is also advised to select the hyper-parameters 1D CNN model for ECG diagnosis based on several classifiers Системні дослідження та інформаційні технології, 2022, № 4 19 based on various methods such as grid or random search or various metaheuristic techniques to reach the optimal values on the parameters for the proposed model. Finally, the XB-Boost classifier can be replaced with a sparse representation classifier as it is considered a powerful technique for pixel-wise classification of images [27]. REFERENCES 1. World Health Organization, Cardiovascular Diseases (CVDs). 2022. [Online]. Avail- able: http://www.who.int/mediacentre/factsheets/fs317/en/ 2. S.K. Berkaya, A.K. Uysal, E.S. Gunal, S. Ergin, S. Gunal, and M.B. Gulmezoglu, “A survey on ECG analysis,” Biomed Signal Process Control, 43, pp. 216–235, 2018. 3. O. Faust, Y. Hagiwara, T.J. Hong, O.S. Lih, and U.R. Acharya, “Deep learning for healthcare applications based on physiological signals: A review,” Biomed. Comput. Meth. Prog. Bio., 161, pp. 1–13, 2018. 4. L.A. Abdullah and M.S. Al-Ani, “CNN-LSTM based model for ECG arrhythmias and myocardial infarction classification,” Adv. Sci. Technol. Eng. Syst., 5(5), pp. 601–606, 2020. 5. E. Butun, O. Yildirim, M. Talo, R.S. Tan, and U.R. Acharya, “1D-CADCapsNet: One dimensional deep capsule networks for coronary artery disease detection using ECG sig- nals,” Physica Medica, 70, pp. 39–48, 2020. 6. X. Hua et al., “A novel method for ECG signal classification via one-dimensional convo- lutional neural network,” Multimedia Systems, pp. 1–13, 2020. 7. G. Petmezas et al., “Automated atrial fibrillation detection using a hybrid CNN-LSTM network on imbalanced ECG datasets,” Biomedical Signal Processing and Control, 63, 102194, 2021. 8. MIT-BIH Normal Sinus Rhythm. [Online]. Available: https://www.physionet.org/ con- tent/nsrdb/1.0.0/ last accessed 2-10-2021. 9. Normal Sinus Rhythm RR Interval. [Online]. Available: https://physionet.org/ con- tent/nsr2db/1.0.0/ last accessed 2-10-2021. 10. MIT-BIH Supraventricular Arrhythmia. [Online]. Available: https://physionet.org/ con- tent/svdb/1.0.0/ last accessed 2-10-2021. 11. MIT-BIH ST Change Database. [Online]. Available: https://physionet.org/content/ stdb/1.0.0/last accessed 2-10-2021. 12. Long Term ST Database. [Online]. Available: https://physionet.org/content/l tstdb/1.0.0/ last accessed 2-10-2021. 13. PTB Diagnostic ECG Database. [Online]. Available: https://www.physionet.org/ con- tent/ptbdb/1.0.0/ last accessed 2-10-2021. 14. M.M. Bassiouni, E.S.A. El-Dahshan, W. Khalefa, and A.M. Salem, “Intelligent hybrid approaches for human ECG signals identification,” Signal Image Video Process, 12(5), pp. 941–949, 2018. 15. M. Bassiouni, W. Khaleefa, E.A. El-Dahshan, and A.B.M Salem, “A machine learning technique for person identification using ECG signals,” Int. J. Appl. Phys., 1, pp. 37–41, 2016. 16. M.M. Bassiouni, I. Hegazy, N. Rizk, S.A. El-Dahshan, and A.M. Salem, “Combination of ECG and PPG Signals for Healthcare Applications: A Survey”, Advances in Modelling and Analysis, 64(1-4), pp. 63–70, 2021. 17. M.M. Bassiouni, I. Hegazy, N. Rizk, E.S.A. El-Dahshan, and A.M. Salem, “Automated Detection of COVID-19 Using Deep Learning Approaches with Paper-Based ECG Reports,” Circuits, Systems, and Signal Processing, 41, pp. 1–43,2022. 18. A.F. Agarap, “Deep learning using rectified linear units (relu),” arXiv preprint, arXiv:1803.08375, 2018. 19. A.T. Azar, H.I. Elshazly, A.E. Hassanien, and A.M. Elkorany, “A random forest classi- fier for lymph diseases,” Comput. Biol. Med., 113(2), pp. 465–473, 2014. 20. S.Y. El-Bakry, E.S. El-Dahshan, and M.Y. El-Bakry, “Total cross section prediction of the collisions of positrons and electrons with alkali atoms using Gradient Tree Boosting,” Indian J. Phys., 85(9), pp. 1405–1415, 2011. Mahmoud M. Bassiouni, Islam Hegazy, Nouhad Rizk, El-Sayed A. El-Dahshan, Abdelbadeeh M. Salem ISSN 1681–6048 System Research & Information Technologies, 2022, № 4 20 21. H.T. Weldegebriel, H. Liu, A.U. Haq, E. Bugingo, and D. Zhang, “A new hybrid convo- lutional neural network and eXtreme gradient boosting classifier for recognizing hand- written Ethiopian characters,” IEEE Access, 8, pp.17804–17818, 2019. 22. S. García, A. Fernández, J. Luengo, and F. Herrera, “A study of statistical techniques and performance measures for genetics-based machine learning: accuracy and interpretabil- ity,” Soft Comput., 13(10), 959, 2009. 23. S.N. Yu and M.Y. Lee, “Bispectral analysis and genetic algorithm for congestive heart failure recognition based on heart rate variability,” Comput. Biol. Med., 42(8), pp. 816–825, 2012. 24. K.H. Boon, M. Khalil-Hani, and M.B. Malarvili, “Paroxysmal atrial fibrillation predic- tion based on HRV analysis and non-dominated sorting genetic algorithm,” Comput. Biol. Med., 153, pp. 171–184, 2018. 25. H.B. Bae, M.S. Park, R.M. Kil, and H.Y. Youn, “Classifying heart conditions based on class probability output networks,” Neurocomputing, 360, pp. 198–208, 2019. 26. R.R. Janghel and S.K. Pandey, “A Classification of ECG Arrhythmia Analysis Based on Performance Factors Using Machine Learning Approach,” in Computational Network Application Tools for Performance Management. Springer, Singapore, 2020, pp. 65–74. 27. M.M. Bassiouni, I. Hegazy, N. Rizk, E.S.A. El-Dahshan, and A.M. Salem, “Deep learn- ing approach based on transfer learning with different classifiers for ECG diagno- sis,” International Journal of Intelligent Computing and Information Sciences, 22(2), pp.44–62, 2022. Received 23.09.2022 INFORMATION ON THE ARTICLE Mahmoud M. Bassiouni, ORCID: 0000-0002-8617-8867, Egyptian E-Learning Univer- sity (EELU), Egypt, e-mail: mbassiouni@eelu.edu.eg Islam Hegazy, ORCID: 0000-0002-1572-463X, Ain Shams University, Egypt, e-mail: islheg@cis.asu.edu.eg Nouhad Rizk, ORCID: 0000-0001-9277-9741, Houston University, USA, e-mail: njrizk@uh.ed El-Sayed A. El-Dahshan, ORCID: 0000-0002-1221-0262, Ain Shams University, Egypt, e-mail: seldahshan@eelu.edu.eg Abdelbadeeh M. Salem, ORCID: 0000-0003-0268-6539, Ain Shams University, Egypt, e-mail: absalam@cis.asu.edu.eg 1D МОДЕЛЬ CNN ДЛЯ ДІАГНОСТИКИ ЕКГ НА КІЛЬКОХ КЛАСИФІКАТОРАХ / М.М. Басіуні, І. Хегазі, Н. Різк, E.C.A. Ел-Дашан, А.М. Салем Анотація. Однією з основних причин смерті людини є захворювання серця. Виявлення серцевих захворювань на ранній стадії може запобігти серцевій недостатності або будь-якому пошкодженню серцевого м’яза. Одним з основ- них сигналів, які можуть бути корисними в діагностиці захворювань серця, є електрокардіограма (ЕКГ). Розглянуто діагностику чотирьох типів записів ЕКГ, таких як інфаркт міокарда (MYC), норма (N), відхилення сегмента ST (ST) і надшлуночкова аритмія (SV). Методологія збирає дані з шести основних наборів даних, а потім записи ЕКГ фільтруються за допомогою ланцюжка по- переднього оброблення. Після цього запропонована модель 1D CNN використовується для вилучення ознак із записів ЕКГ. Потім застосовуються два різні класифікатори, щоб перевірити ефективність виділених ознак і отри- мати надійну точність діагностики. Два класифікатори – це softmax і класифікатор випадкового лісу (RF). Застосовується експеримент для діагностики чотирьох типів записів ЕКГ. Зрештою найвищої продуктивності досягнуто за допомогою радіочастотного класифікатора з точністю 98,3%. Порівняння з іншими суміжними роботами показало, що запропоновану мето- дику можна застосовувати для раннього виявлення захворювань серця. Ключові слова: електрокардіограма (ECG), безперервне вейвлет-перетворення (CWT), одновимірна модель згорткової нейронної мережі (CNN).
id journaliasakpiua-article-265099
institution System research and information technologies
keywords_txt_mv keywords
language English
last_indexed 2025-07-17T10:27:57Z
publishDate 2022
publisher The National Technical University of Ukraine "Igor Sikorsky Kyiv Polytechnic Institute"
record_format ojs
resource_txt_mv journaliasakpiua/c4/46b4b8491f7ba3ad1681050d8b5b9cc4.pdf
spelling journaliasakpiua-article-2650992023-05-21T20:04:38Z 1D CNN model for ECG diagnosis based on several classifiers 1D модель CNN для діагностики ЕКГ на кількох класифікаторах Bassiouni, Mahmoud Hegazy, Islam Rizk, Nouhad El-Dahshan, El-Sayed Salem, Abdelbadeeh Electrocardiogram (ECG) Continuous wavelet transform (CWT) 1D convolutional neural network (CNN) model електрокардіограма (ECG) безперервне вейвлет-перетворення (CWT) одновимірна модель згорткової нейронної мережі (CNN) One of the main reasons for human death is diseases caused by the heart. Detecting heart diseases in the early stage can stop heart failure or any damage related to the heart muscle. One of the main signals that can be beneficial in the diagnosis of diseases of the heart is the electrocardiogram (ECG). This paper concentrates on the diagnosis of four types of ECG records such as myocardial infarction (MYC), normal (N), variances in the ST-segment (ST), and supraventricular arrhythmia (SV). The methodology captures the data from six main datasets, and then the ECG records are filtered using a pre-processing chain. Afterward, a proposed 1D CNN model is applied to extract features from the ECG records. Then, two different classifiers are applied to test the extracted features’ performance and obtain a robust diagnosis accuracy. The two classifiers are the softmax and random forest (RF) classifiers. An experiment is applied to diagnose the four types of ECG records. Finally, the highest performance was achieved using the RF classifier, reaching an accuracy of 98.3%. The comparison with other related works showed that the proposed methodology could be applied as a medical application for the early detection of heart diseases. Однією з основних причин смерті людини є захворювання серця. Виявлення серцевих захворювань на ранній стадії може запобігти серцевій недостатності або будь-якому пошкодженню серцевого м’яза. Одним з основних сигналів, які можуть бути корисними в діагностиці захворювань серця, є електрокардіограма (ЕКГ). Розглянуто діагностику чотирьох типів записів ЕКГ, таких як інфаркт міокарда (MYC), норма (N), відхилення сегмента ST (ST) і надшлуночкова аритмія (SV). Методологія збирає дані з шести основних наборів даних, а потім записи ЕКГ фільтруються за допомогою ланцюжка попереднього оброблення. Після цього запропонована модель 1D CNN використовується для вилучення ознак із записів ЕКГ. Потім застосовуються два різні класифікатори, щоб перевірити ефективність виділених ознак і отримати надійну точність діагностики. Два класифікатори – це softmax і класифікатор випадкового лісу (RF). Застосовується експеримент для діагностики чотирьох типів записів ЕКГ. Зрештою найвищої продуктивності досягнуто за допомогою радіочастотного класифікатора з точністю 98,3%. Порівняння з іншими суміжними роботами показало, що запропоновану методику можна застосовувати для раннього виявлення захворювань серця. The National Technical University of Ukraine "Igor Sikorsky Kyiv Polytechnic Institute" 2022-12-27 Article Article application/pdf https://journal.iasa.kpi.ua/article/view/265099 10.20535/SRIT.2308-8893.2022.4.01 System research and information technologies; No. 4 (2022); 7-20 Системные исследования и информационные технологии; № 4 (2022); 7-20 Системні дослідження та інформаційні технології; № 4 (2022); 7-20 2308-8893 1681-6048 en https://journal.iasa.kpi.ua/article/view/265099/270160
spellingShingle електрокардіограма (ECG)
безперервне вейвлет-перетворення (CWT)
одновимірна модель згорткової нейронної мережі (CNN)
Bassiouni, Mahmoud
Hegazy, Islam
Rizk, Nouhad
El-Dahshan, El-Sayed
Salem, Abdelbadeeh
1D модель CNN для діагностики ЕКГ на кількох класифікаторах
title 1D модель CNN для діагностики ЕКГ на кількох класифікаторах
title_alt 1D CNN model for ECG diagnosis based on several classifiers
title_full 1D модель CNN для діагностики ЕКГ на кількох класифікаторах
title_fullStr 1D модель CNN для діагностики ЕКГ на кількох класифікаторах
title_full_unstemmed 1D модель CNN для діагностики ЕКГ на кількох класифікаторах
title_short 1D модель CNN для діагностики ЕКГ на кількох класифікаторах
title_sort 1d модель cnn для діагностики екг на кількох класифікаторах
topic електрокардіограма (ECG)
безперервне вейвлет-перетворення (CWT)
одновимірна модель згорткової нейронної мережі (CNN)
topic_facet Electrocardiogram (ECG)
Continuous wavelet transform (CWT)
1D convolutional neural network (CNN) model
електрокардіограма (ECG)
безперервне вейвлет-перетворення (CWT)
одновимірна модель згорткової нейронної мережі (CNN)
url https://journal.iasa.kpi.ua/article/view/265099
work_keys_str_mv AT bassiounimahmoud 1dcnnmodelforecgdiagnosisbasedonseveralclassifiers
AT hegazyislam 1dcnnmodelforecgdiagnosisbasedonseveralclassifiers
AT rizknouhad 1dcnnmodelforecgdiagnosisbasedonseveralclassifiers
AT eldahshanelsayed 1dcnnmodelforecgdiagnosisbasedonseveralclassifiers
AT salemabdelbadeeh 1dcnnmodelforecgdiagnosisbasedonseveralclassifiers
AT bassiounimahmoud 1dmodelʹcnndlâdíagnostikiekgnakílʹkohklasifíkatorah
AT hegazyislam 1dmodelʹcnndlâdíagnostikiekgnakílʹkohklasifíkatorah
AT rizknouhad 1dmodelʹcnndlâdíagnostikiekgnakílʹkohklasifíkatorah
AT eldahshanelsayed 1dmodelʹcnndlâdíagnostikiekgnakílʹkohklasifíkatorah
AT salemabdelbadeeh 1dmodelʹcnndlâdíagnostikiekgnakílʹkohklasifíkatorah