Classification of Premature Ventricular Contraction (PVC) based on ECG Signal using Convolutional Neural Network (CNN)

Received Aug 18, 2019 Revised Sep 16, 2020 Accepted Oct 2, 2020 This study observes one of the ECG signal abnormalities, which is the Premature Ventricular Contraction (PVC). Many studies applied a machine learning technique to develop a computer-aided diagnosis to classify normal and PVC conditions of ECG signals. The common process to obtain information from the ECG signal is by performing a feature extraction process. Since the ECG signal is a complex signal, there is a need to reduce the signal dimension to produce an optimal feature set. However, these processes can remove the information contained in the signal. Therefore, this study process the original ECG signal using a Convolutional Neural Network to avoid losing information. The input data were in the form of both one beat of normal ECG signal or PVC with size 1x200. The classification used four layers of convolutional neural network (CNN). There were eight 1x1 filters used in the input. Simultaneously, 16 and 32 of 1x1 filters were used in the second and the fourth convolutional layers, respectively. Thus the system produced a fully connected layer consisted of 512 neurons, while the output layer consisted of 2 neurons. The system is tested using 11361 beats of ECG data and achieved the highest accuracy of 99.59%, with the 10-fold crossvalidation. This study emphasizes an opportunity to develop a wearable device to detect PVC since CNN can be implemented into an embedded system or an IoT based system.


INTRODUCTION
ECG signal is a biology signal resulted from the electrical activities of heart. The heart health in someone can be seen from ECG Signal that can be valued from the rhythm, form and orientation [1]. Any changes in the form, rhythm and orientation of ECG signal specify the abnormalities in heart. One of the forms of abnormality in heart rhythm is arrhythmia that is caused by the irregularities, disturbance in speed or signal transmission problem of electrical signal of heart [2]. Several are type of arrhythmia are premature ventricular contraction (PVC), left bundle block (LBB), ventricular flutter wave, premature atrial contraction, right bundle block (RBB), and ventricular ectopic beat [3]. Premature ventricle contraction (PVC), caused by the initial depolarization of myocardia originated from ventricle area. PVC is also known as ventricular ectopic beat as its beat occur before normal sinus rhythm (NSR) [4]. It is mostly found in adult persons and increase risk of sudden death [5]. In this paper, we focus on classification of PVC based on ECG signal.
A variety of methods have been advanced to detect arrhythmia such as PVC using the digital signal processing method. Mitra  classification [6]. Those methods were rough set theory, correlation-based feature subset selection (CFSS), Association Rules (AR), and principal component analysis (PCA). In another study, the bi-spectral method was used to classify several types of arrhythmia [7]. The paper classified five different types of arrhythmias. ECG signal data reduction using PCA, self-organising Map (SOM), and independent component analysis (ICA) was done by Kaya and Pelivan in their research [8]. Meanwhile, for the classifier, it used K-nearest neighbor (KNN), neural network (NN), decision tree (DT), and support vector machine (SVM). Rizal, et al. used multilevel wavelet entropy for PVC signal classification [9]. Wavelet entropy was calculated on five levels of wavelet packet decomposition and produced the highest accuracy of 94.9% using SVM as classifier.
Another feature extraction method for PVC classification was presented by Rizal and Wijayanto [10]. Several order of Tsallis entropy was utilized for ECG signal' features extaction. Combined with SVM as classified, the proposed method reached the highest accuracy of 95.9%. Along with the development of machine learning, various deep learning methods were used to classify ECG signals, especially in arrhythmia [11]. Hoang et al. used a tensor-based feature extraction method and a convolutional neural network for PVC classification [12]. The highest accuracy reaches 90.84%. Meanwhile, Kim et al. calculated the RR beats parameter for arrhythmia classification using the GoogLeNet Deep Neural Network [13]. The paper reported accuracy of 95.94%, a maximum sensitivity of 96.9%, and a maximum positive predictive value of 95.7%. The whole PVC classification research described above used a feature extraction process or dimension reduction to process the ECG signal before entering the classifier. The feature extraction or signal dimension reduction can sometimes remove the information contained in the signal. For this reason, this study proposes a PVC classification on the ECG signal without using a feature extraction process or dimension reduction to keep the information in the ECG signal intact.
This research used the deep eearning method of convolutional neural network (CNN) as classifier for PVC on ECG signal classification [14]. The excellences of CNN such as in other deep learning methods is that it does not need any preprocessing stages such as normalization, denoising, and feature extraction process [3]. Hence, the input of the system can be in the form of the raw data (ECG signal as the measurement results). Also, in CNN, the amount of the weight to be trained is less compared to the common Multi-Layer Perceptron (MLP) architecture. This is related to the existence of the convolution process between the filter and the data input in CNN replacing the multiplication process of input with the weight in the common MLP. In this paper, we used preprocessing stage to remove DC component of signal and baseline wander. The preprocessing stage hopefully increase the accuracy of PVC classification. Figure 1 displays proposed method in this research. The first step is preprocessing. In preprocessing step, we made a normalization process to remove the DC component of the signal and reduce the noise. To reduce the noise from the baseline wander, median filtering was used. Further, beat parsing process was conducted to breakdown the ECG signal into single cycle ECG signal. The signal later on was classified using CNN. The more detailed explanation is presented in the following sub-sections.

ECG Dataset
The data of ECG signal from the MIT-BIH Arrhythmia Database was used in this research [15]. The data selected were those having the PVC and normal ECG signal from lead II and another added lead. The sampling frequency of the data was 360Hz and had the mark showing the time and the beat marker in the form of R wave's location. The number of each data of PVC and normal ECG shown in Table 1.

Preprocessing
Preprocessing was purposely for noise reduction in the signal. There were two processes conducted in the ECG signal. The first one was the mean removal as in Equation (1) [9].
where x(t) refers to the resulted signal, and y(t) is the signal prior to be filtered. The results of this process was the evener and unfluctuating ECG signals.

Beat-Parsing
To cut the data of ECG signal to be one cycle of ECG signal, we conducted beat parsing process. The marker of one cycle of ECG signal was the existence of one pattern of QRS in each cycle. As there had been the annotation of R signal in the original ECG data, one ECG signal was calculated from R signal. One of ECG signals was 200 samples in length; thus, a single cycle ECG signal was expressed as in Equation (3) = [ ( − 99), … , ( ), … , ( + 100) where refers to the i th ECG signal, x(n) is the ECG signal and refers to the signal sample as the i th R signal.
With this beat-parsing process, we obtained a matrix of 11361x 200. This matrix would be the input data for CNN as a classifier. In one beat only consisted of one R signal, so the classification was not based on the rhythm of the signal as in [13], but used the original signal form of the ECG signal.

Convolutional Neural Network
The deep learning method used was Convolutional Neural Network (CNN) with the architecture of Input, Convolutional Layer 1 (C1), Convolutional Layer 2 (C2), Convolutional Layer 3 (C3), Convolutional Layer 4 (C4), Fully Connected layer and output layer. The input was in the form of ECG signal as a result of beat parsing results. The input was in the size of 1x200. In the input layer, convolution operation was conducted using 8 filters in the size of 1 X1. This process produced 8 feature maps with the size of 1 x 200. C2 Layer was obtained by performing the convolution in the feature map in C1 using 16 filters in the size of 1x1; thus, it obtained 16 feature maps in the size of 1 x 200. Furthermore, convolution process was performed in 16 feature maps in C2 using 16 filters in the size of 1x1 to produce 16 feature maps. Furthermore, convolution was also conducted to C4 by using 32 filters with the size of 1x1. The function of feature maps was to capture features from input or from previous layers. Fully connected layer consisted of 512 neurons, while the output layer consisted of 2 neurons.  Figure 3 (a) ECG signal before median filter (b) ECG signal after median filtering Figure 3 shows the ECG signals at the beginning and after the preprocessing. Having conducted the preprocessing, the amplitude was getting more since the mean values of the initial signal was negative. Meanwhile, the median filtering reduced the noise and the baseline friction from the initial signals. Median filtering used three samples of signal in order as the input. The more signal samples in median filtering could be done to obtain the evener signals.
As the data were in the one-dimension form, the size of filter used in the convolution process in CNN could only be in the size of [Nx1]. In the system developed, the filter size used was [1x1], so the size of the data then was unchanged. This was because if it used more than one N value, there would be more information removed from the input data considering the very small size of the input data (200 attributes). To cope with this problem, various numbers of filter in each layer were used. The function of the number of filters was to determine the number of identified features in one convolution process. The ECG signal classification process was done in the part of fully connected layer receiving 512 inputs as the result of convolution and it used the Softmax method.
We used the 10 fold cross-validation method by 20 times in testing stage. The test was carried out 20 times to ensure that the resulting accuracy was stable and did not experienc high fluctuation.The average of accuracy in each 10 fold cross-validation for each experiment is presented in Table 2. As shown from the Table 2, the average of accuracy was found at the maximum averaged accuracy of 99.59 %, minimum averaged accuracy of 99.29 % and mean accuracy of 99.43 %.
The result of the test showed the accuracy of 99.59% better than the one in the previous research using multilevel wavelet entropy (MWE) [10]. The MWE features extraction process in this research was done and resulted in five features. The highest accuracy resulted was 94.9% using the fewer ECG data and SVM as the classifier. Meanwhile, other research resulted in 95.8% using Renyi Entropy (REN) of different orders [11]. The highest accuracy resulted was by using REN of order 1-6 and SVM as the classifier. Both researches used the feature extraction process prior to the classification process. Comparison of proposed method and other method is presented in Table 3. From Table 3 it can be seen that the accuracy of the proposed method is only lower than that of the study by Kaya and Pehlivan [8]. However, the Kaya and Pehlivan method still requires a dimensional reduction process using PCA, SOM, or ICA. The proposed method excels in the number of processes used in feature extraction. From Table 3, it can be seen that the feature reduction methods used include PCA, ICA, SOM, with several variations in the use of discrete wavelet transforms for signal decomposition and rough theory for feature subset selection [4][6] [8]. Meanwhile, the features used such as Shannon entropy, Renyi entropy, wavelet entropy and RR beat parameters the ECG signal. In terms of the amount of data used, this study uses more data than other studies, except for Rizal & Wijayanto which uses the same amount of data [10].
The use of deep learning with any strategies has been done in the previous researches. Rahhal et.al used the deep neural network (DNN) for the classification of ECG signals in any databases [18]. Meanwhile, other research used DNN for the biometric ECG classification [19]. Ulah, et al transformed 1d ECG signal to 2-D spectrograms through short-time Fourier transform [9]. 2D-CNN was used as classifier to produce 99.11% of accuracy. In the research it was reported that deep learning had a high accuracy without any feature extraction process. As the deep learning is included in the supervised learning, then there is a need for the training in a quite more number of data. The load of computation in deep learning becomes a challenge in the system implementation using the deep learning into the embedded system.

BIOGRAPHY OF AUTHORS
He is a senior lecturer in School of Computing at Telkom University, Bandung Indonesia. He received Master degree in Mathematic from Institut Teknologi Bandung, Bandung, Indonesia in Febuary 1999. His research is on machine learning for biomedical signal classification.
He is a senior lecturer in School of Electrical Engineering at Telkom University, Bandung Indonesia. He received Master degree in biomedical engineering from Institut Teknologi Bandung, Bandung, Indonesia in October 2006. Meanwhile, He received Ph.D. degree from Universitas Gadjah Mada, Yogyakarta Indonesia in 2019. His research is on the signal complexity analysis of biomedical signal, biomedical instrumentation, and telemedicine.