Deep Learning Methods in Classiﬁcation of Myocardial Infarction by employing ECG Signals

Background/Objectives : To automatically classify and detect the Myocardial Infarction using ECG signals. Methods/Statistical analysis : Deep Learning algorithms Convolutional Neural Network(CNN), Long Short Term Memory(LSTM) and Enhanced Deep Neural Network(EDN) were implemented. The proposed model EDN, comprises the techniques CNN and LSTM. Vector operations like matrix multiplication and gradient decent were applied to large matrices of data that are executed in parallel with GPU support. Because of parallelism EDN faster the execution time of process. Findings : Proposed model EDN yields better accuracy (88.89%) than other state-of-art methods for PTB database. Novelty/Applications : The proposed classiﬁcation algorithm for analyzing the ECG signals is obtained by comprising the Convolutional Neural Network(CNN)and Long short-term memory networks(LSTM). Also, it is identi-ﬁed that the novel classiﬁcation technique based on deep learning decreases the misdiagnosis rate of MI.


Introduction
Myocardial infarction (MI) is a life threatening cardiovascular disease caused by inadequate blood supply in myocardial for human beings. According to the survey of American Health Association, each year almost 7,20,000 people suffer from myocardial infarction (1) . Generally, manual elucidation may take time for the physician to recognize the symptoms of MI, and also it varies for time to time and patient to patient. Thus, the rapid growth of wearable computerized devices and their conceivable techniques help to save the lives of millions of people whom are getting affected by MI.
Here, electrocardiogram (ECG) signals are used to identify and examine myocardial infarction in time. Three different wave forms of each cardiac cycle in ECG signals are: P wave, QRS complex, and T wave in normal rate. Nowadays, deep learning methods like convolutional neural network (CNN), recurrent neural network (RNN), auto encoder https://www.indjst.org/ and attention mechanism have accomplished great success in various domains, that include natural language processing, biomedical signal and image processing. Hence, the proposed algorithm based on combined CNN and LSTM (Enhanced Deep Neural Network) is used here to classify and predict whether the patient has MI or healthy.
Myocardial Infarction characteristics include ST-segment elevation, abnormal Q wave appearance, and T-wave inversion. These are commonly used for classification of feature vectors. The ECG signals are varying in ST Elevation interval length, and T waveform. In (2) , a deep CNN model has been proposed to provide an effective framework for an automated detection of MI. PTB diagnostic database has been used in their experiment. In (3) , CNN based multi-class MI classification model has been implemented for detecting MI by applying all 12 lead signals. This model makes the decisions through the features that are extracted from the signals. The classification model proposed in for MI detection (4) is based on Long Short Term Memory. In this system the source 8-lead ECG signals are preprocessed and partitioned into heartbeat sequences. Then these sequences are fed to LSTM network to make it learn. The features are extracted with the help of the deep learning networks in a hasty manner and that substitutes the manual method of fetching features.
Deep neural network presented in (5) can classify the 12 rhythm ECG classes. This network possesses 33 convolutional hidden layers followed by a linear output layer. Input to this network is the unprocessed ECG signal data. With this data, it learns predicts and outputs the classified 12 rhythms of each of the 256 samples. In (6) , a multi-channel automatic classification algorithm has been developed by combining CNN and LSTM. Being a part of signal processing domain, ECG signal feature extraction causes more implementation difficulties and which are reduced by applying deep learning techniques. Thus, it uses CNN and LSTM for training the network. In (7) , an intelligent ECG Arrhythmia Classification system using CNN has been proposed to classify the signals. Input for this network is the time series signals and output is got through its softmax layer. The signals are preprocessed and features fetched for training the network. The system perfectly classifies varying types of arrhythmia by making changes in the activation function epochs count.
RNN and GRU architecture compared with LSTM architecture is presented in (8) to obtain the best sequence model for ECG signal processing. This proposal proved that LSTM architecture has the better performance. In (9) an artificial neural network is used. In that, the parameters are modified based on the changes of ECG signals. Block-based Neural Network has been trained using PSO algorithm. The BBNNs use morphological and temporal features which have been extracted from ECG signals, and create the input vector of the BBNN. MIT-BIH arrhythmia database is used in their experiment. In (10) , a deep convolutional neural network is used for automatic segmentation of psoriasis. Several deep neural architectures are trained for segmentation. A deep CNN model has been proposed (11) to provide an automatic recognition of MI.
A novel framework has been developed (12) for automatic MI detection and location. The experiment provides a new insight into the application of attention mechanism and parallel feature extraction structure based on deep learning. In (13) , a deep learning method is introduced by combining CNN and RNN, and also a multi-channel CNN and LSTM network architecture is established, preprocessed ECG signals are segmented, spatial features in the multi-channel convolution network are extracted, and the temporal characteristics through LSTM are acquired. In recent years, with the development of deep learning, CNN and LSTM have achieved success. Therefore, to classify the Myocardial Infarction, this paper proposed a deep learning method combining CNN and LSTM.

Materials and Methods
The dataset is obtained from PTB diagnostic database. It holds 290 subjects. Each subject is denoted by three records. Each records consists of 15 signals. They are 12 conventional leads and 3 frank leads (14) .

CNN
CNN is a Filtered Back Projection based artificial neural network that shares the weight. It has the connectivity resembling the biological network. CNN has pooling layer, convolutional layer, and fully connected layer (15) . The equation (1) represents the mathematical model for CNN.
From the equation (1), the input feature map is denoted by M j ; total number of layer is denoted by l; k denotes the convolution kernel; and the network bias vectors is denoted by b. During practical application, Max -pooling is frequently used. Its mathematical model is shown in the Equation (2): https://www.indjst.org/ Here, the value of t neuron of i feature map in layer l is denoted by q l i (t); the dimension of the pooling area is represented by W and the responding location of the neuron in layer l +1 is indicated by P l+1 i ( j).

LSTM
The workflow of an LSTM model is shown in Figure 1. The architecture of LSTM consists of 3 gates namely input gate, forget gate and output gate.
where σ indicates sigmoid function; the input gate is represented byi t ; forget gate is denoted by f t ; and output gate is represented byo t ,c t is the cell activation vector ; h t in the hidden layer; and W ci , W c f , and W co represents the weight matrix of opening connections. https://www.indjst.org/

Proposed Model
The LSTM unit has a memory cell to keep its state value for a long while and a gating system consisting of three non-linear gates, to point out, an input gate, a forget gate, and an output gate. The intended role of the gate's, is to regulate the flow of signals into and out of the cell, in order to be effective in regulating long-range dependencies and achieve successful RNN training. Since the inception of the LSTM unit, many modifications have been introduced to improve performance. Adding more components in the LSTM architecture may produce better performance. It is exposed in the architecture of the proposed model in Figure 2. Based on that, this study proposed an algorithm EDN based on the CNN and LSTM algorithm. In the proposed methodology, the Bias of h were added to the Cell state vector to improve the performance. As the output gate was less important than the Input gate and Forget gate. The proposed algorithm modified the Hidden state vector by adding Point wise Hadamard Multiplication among the previous Output gate parameter and previous Cell state vector. The Equation (8 to 13) represents the mathematical model for EDN. https://www.indjst.org/ Where, x i j is the Input vector, which is a m-dimension vector, i t is the Input Gate at time t, f t is the Forget Gate at time t, vector using Sigmoid function of point wise Multiplication vectors. O t is the Output Gate at time t. All these Input Gate, Forget Gate and Output Gate are n-Dimensional vectors. C t is the Cell state Vector, which uses tanh activation for vector concatenation. h t is the hidden state vector, which uses Point-wise Hadamard Multiplication operator, It is the n-Dimension activation unit for Cell State.

Algorithm EDN: Enhanced Deep Neural Network
Input : x l i = (x l 1 + x l 2 + x l 3 + · · · + x l i ) -a Sequence of Independent Variables. D -Represents the No. of memory Blocks. S j -Represents the No. of Cells in Block j. Process: Step 1: Read the data, then find out standard Deviation and separate the data.
Step 2: To obtain Total independent variable numbers.
Evaluate Mapsize = f ix ( log 3(data size)) − 1 Step 3: Set CNN layers with Input Layers and sub sampling layer.
Step 4: Pass the CNN output layers units as Input vectors to the Input gate, Forget Gate and Output Gate of LSTM unit.
Step 5: For each and every block in the Memory, compute the Input, Forget and Output gate for j=1 to D do Evaluate the Input Gate: Finally update the hidden state by computing Evaluate the Hidden State: End for Step 6: Return EDN Layers. The proposed EDN can process the data in a sequential manner, so that each vector in Hidden state can implicitly dependent on previous Cell State unit. EDN uses the convolutional Neural Networks to extend the effective neighborhood identification process.

CNN
By using Convolutional Neural Network the output is shown. Figure 4 (a) represents the framework of CNN. Figure 4(b) details the specific of each layer's parameters. Figure 5 represents Loss and Accuracy for Training and Testing data in CNN Model. Table 1 indicates Confusion Matrix for the generated model based on the testing data in CNN Model.

LSTM
By applying LSTM, the output is shown below. Figure 6 (a) represents the framework of LSTM. Figure 6(b) details the specific of each layer's parameters. Figure 7 shows Loss and Accuracy for Training and Testing data in LSTM Model. Table 2 indicates Confusion Matrix for the generated model based on the testing data in LSTM Model.

Proposed Model (EDN)
In this study, a deep learning model is created to provide high recognition performance on ECG signals based on the combination of CNN and LSTM. The 7-layer EDN model with a block representation is shown in Figure 8 (a). Healthy and MI records are feed into the input layer of this model. They go through hierarchically ordered EDN and Dropout layers and transform into feature maps of different size. In the dense layer, automatic prediction of the classes is provided. Dropout technique is used to avoid overfitting during training of the model. In each epoch, the model examines the whole training dataset. If the choosen epoch number is too large, a model can memorize the training data. Figure 8(b) details the specific of each layer's parameters. Figure 9 shows Loss and Accuracy for Training and Testing data in proposed Model(EDN). Table 3 indicates Confusion Matrix for the generated model based on the testing data in the proposed Model(EDN).  Table 4 shows the comparison of Metrics. When compared to CNN and LSTM algorithms, the performance is very high in the proposed model. Cohen Kappa Coefficient value is 0.2355, so we can conclude the proposed algorithm is working well. ROC curve is used to display the performance of classification algorithm. The precision-recall curve is plotted in Figure 10. Figure 10 shows the performance improvisation given by the proposed EDN model when compared to the performance of existing CNN and LSTM algorithms with the same PTB dataset. https://www.indjst.org/

Conclusion
Going along with the direction of forward progress of the deep learning algorithms, this study proposes the EDN algorithm for classifying the ECG signals of normal and MI affected people. For demonstrating the efficiency of the proposed deep learning EDN algorithm, its performance is compared with the two most prominent algorithms of the deep learning realm namely CNN and LSTM. It is ten times faster than the LSTM due to its speed of convergence in training. Through the confusion matrices of the respective algorithms it is obvious that the EDN model achieved 88.89% accuracy; which is 3.66% and 4.04% superior than the LSTM and CNN algorithms respectively. Same way, the proposed model shows performance improvisation through the other performance metrics such as Precision, Recall, F1 measure, and Cohen Kappa Coefficient. Although the difference is small, in healthcare sectors this difference plays crucial role in saving the life of human being. https://www.indjst.org/