Development of deep CNN architecture for anomalies in ECG signals

In this paper, we propose a deep learning convolutional neural network (CNN) approach to classify arrhythmia based on the time interval of the QRS complex of the ECG signal. The ECG signal was denoised using multiple (cid:977)ilters based on the Pan Tompkins algorithm. QRS detection has been done using Pan Tomp-kins Algorithm. Then the QRS complex is identi(cid:977)ied using local peaks based technique inside the layers of the Convolutional Neural Network where the repeated application of the same (cid:977)ilter to our input results in a map of activations called a feature map, indicating the locations and strength of a detected feature in an input which in our case is the changes in the q-s time interval. Based on the R-R time interval, Heart rate variability (HRV) was computed, and Poincare plot was generated. Instead of using raw ECG signal to train the CNN, we used the feature extracted from ECG signal obtained from Physionet database to train the CNN and map the pattern changes for different classes of diseases. The classi(cid:977)ier was then used to classify the test input as either or normal, tachyarrhythmia or intracardiac atrial (cid:977)ibrillation. Data acquisition, ECG data pre-processing and CNN classi(cid:977)ier are the several methods that are involved for the classi(cid:977)ication of several arrhythmias.


INTRODUCTION
Electrocardiogram (ECG), as shown in Figure 1, plays a crucial role in detecting cardiac disorders. Heart disease comprises of enormous categories of Arrhythmias consisting of dilatory, mercurial or irregular heart rhythm (Acharya et al., 2017). Prediction of the Arrhythmias can be made by identifying normal versus abnormal heartbeats of individual on Electrocardiogram (ECG). Early pinpoint-ing of heart disease patients assists in ECG Arrhythmia analysis (Ji et al., 2019). On the contrary, only an experienced doctor can distinguish between the different abnormalities recorded by different waveform signals. Heart rate variability (HRV) has led to hazardous of cardiovascular death rate in adults. HRV has been appraised using either time-domain technique (Mean interval or standard deviation) or frequency-domain technique (Smith et al., 2009) Sinoatrial node present in the heart is responsible for the generation of electric pulses. This node is also known as the natural pacemaker of the heart. The pulses generated by the SA node can be represented in the form of P, QRS and T waves (Oweis and Al-Tabbaa, 2014). Poincare plot (also termed as return map) is a graphical representation of RR interval mapped as a function of preceding RR interval. The Poincare plot has been estimated uniquely by using their geometrical (visual) pattern, and the shape of plots provides summarised information as well as brief beat to beat information of the behaviour of heart (Hsu et al., 2012) . There are standard descriptors used for the titration of Poincare plot geometry, termed as SD1 and SD2. Poincare plot also helps in distinguishing randomness by embedding a set of data into higher dimensional state space.
During the processing of ECG waves on the electrocardiogram, the signal is pre-processed to minimize the noise. Out of several techniques of noise removal, dc drift cancellation was carried out along with normalization for the electrocardiogram. ECG signal processing if done in the time domain would mean using values between the beat intervals and amplitudes (Mayapur, 2018). The output signal after dc drifts cancellation and normalization was made to pass through a low pass ilter and then through high pass ilter to remove unwanted frequencies from the signal for further processing (Mahajan et al., 2015). QRS complex detection has been done using the Pan Tompkins Algorithm in which the ECG was initially iltered using a bandpass ilter (BPF) and then followed by differentiating the signal (Jeyarani and Singh, 2010). Convolutional neural network (CNN) is systemized by diverse uninterrupted convolutional layers followed by pooling layer (Isin and Ozdalili, 2017). CNN has achieved great success, as it assists in the diagnosis of certain diseases . ECG signal in this paper has been obtained from the database ( www.physionet.org) which is most commonly used as an arrhythmia database for classi ication of several arrhythmias. Data acquisition, ECG data preprocessing and CNN classi ier are the several methods that are involved for the classi ication of several arrhythmias (Andreotti et al., 2017) .

Input layer
The input layer of a neural network is composed of input neurons. It brings the initial data, as shown in Figure 3, into the system for further processing by subsequent layers of neurons (Fujita and Cimr, 2019). The input layer is the very beginning of the work low for the neural network. Here the input training data is fed irst, and they are then assigned weights before feeding to the convolution layer.

Convolution layer/Interconnect layer
The convolutional layer is the primary building block used in our convolutional neural network. Convolution is the elementary prosecution of a ilter to an input that results in activation (Munir et al., 2018). Replicate prosecution of the identical ilter to our input results in a map of activations termed as a feature map, indicating the locations and strength of a detected feature in an input which in our case is the changes in the q-s time interval. They result in highly speci ic features that can be detected any-where on the data. The use of a convolutional neural network is to learn the ilter during training in the context of a speci ic prediction which is change patterns in the q-s time interval in our neural network. The convolution layer uses 256 nodes per sample statically to reduce processing time and give reasonably accurate feature activations.

Output layer
It is used to give the output, which in our case is the diseases. Three nodes are used for the different classes intracardiac atrial ibrillation, tachycardia and normal (Qiu et al., 2018). The three nodes are activated based on the processing at the interconnect layer.

METHODOLOGY
The proposed methodology is depicted in Figure 2. Due to breathing the signal is contaminated with a dc drift component and to remove this the signal is matched with the spectrum of the average QRS complex. Is known as DC drift cancellation and is shown in Figure 4.
After this for the signal to be comparable with other signals, it is standardized as the range of values of data may vary widely for different signals. The signal is then passed through a low pass ilter which attenuates all the frequencies above the cut off frequencies shown in Figure 5. After passing through a low pass ilter, the signal is made to pass through a high pass ilter which attenuates all frequencies below the cut off frequency, as shown in Figure 6. This step is necessary to remove baseline drift from the signal (Midani et al., 2019) This signal is then given as input to a derivative ilter which is used to smoothen the signal. Information on the slope of QRS is obtained in this stage, as shown in Figure 7.
The output from the derivative ilter is then passed through a squaring algorithm to get scalar quantity for a complex signal, as shown in Figure 8 and Figure 10. This step also intensi ies the slope of the frequency response curve. It is necessary as this prevents false positives by t wave with higher amplitudes than usual.
Then this signal is passed through a moving window integrator which produces a signal that includes the slope of the QRS complex. After this stage, the QRS complex is detected, as shown in Figure 9.
The time interval of the QRS complex is detected and used to plot two indicative plots HRV and Poincare. The Poincare plot, as shown in Figure 11 and Figure 12, can be used to distinguish an arrhythmia patient and normal person. The HRV plot is a measure of variation in the heart rate, which is detected using the R-R time interval (Asha V. Thalange and Rohini R. Mergu, 2010).
Data collected from Physionet is used to train the CNN after the steps mentioned above are followed. The QRS complex time data is used to train the CNN. After training the CNN, the network can take live inputs and detect the arrhythmia based on its training data (Amrani et al., 2018).

FEATURE EXTRACTION
The feature extraction stage is used to get diagnostic information about the ECG signals (Zhao et al., 2019). It helps in determining the dynamic features such as RR interval, HRV etc. ECG signals consist of various attributes, segments, intervals and points (Faust et al., 2018).
To classify ECG signals as normal as shown in Figure 13 or abnormal as shown in Figure 14 and Figure 15, we need to determine and identify all those attributes and then classify it accordingly (Yıldirim et al., 2018) QRS detection has been done using Pan Tompkins Algorithm. ECG signals were iltered using low pass ilter and high pass ilter followed by differentiating the signal, which gives information about the slope. The process is further followed by squaring the sig-nal and then continued by window integration. The Q and S can be estimated by knowing the irst local minimum from the left and right of the irst positive R wave (Arzeno et al., 2008). P and T peak points can also be determined by using a moving window integration method along with the amplitudes and durations in the ECG signals (Jane et al., 1992). Since the wave form boundaries are known, this could help determine the onset and offset of every wave. This feature could help us in estimating the various attributes and various segments that make up the ECG (Hong et al., 2019).
Biomedical signals are non-stationary signals whose analyses require better time and frequency resolution. The irst aim involves the classi ication of ECG signals as normal and abnormal (Savalia and Emamian, 2018). Then we further classify the various types of abnormalities (arrhythmias) found in ECG signals.

CONCLUSION
ECG is a biomedical waveform which provides lots of detailed information to the doctors. The work done gives the result and helps in the classi ication and detection of arrhythmias. Any further research in this direction needs a large sample of data to get the accuracy. The accuracy of this approach is 96%. It can be made more compact with the latest technology. Evolved techniques assist in enhancement modi ication.

ACKNOWLEDGEMENT
I would like to express my deepest gratitude to my guide, SHARANYA S. her valuable guidance, consistent encouragement, personal care, timely help and providing us with an excellent atmosphere for doing research. All through the work, in spite of her busy schedule, she has extended her cheerful and cordial support to us for completing this research work.

Funding Support
There is no funding associated with this study. Data is collected from online database.

Con lict Of Interest
The authors declare that there is no con lict of interests regarding the publication of this paper.