ECG Data Analysis with Denoising Approach and Customized CNNs

In the last decade, the proactive diagnosis of diseases with artificial intelligence and its aligned technologies has been an exciting and fruitful area. One of the areas in medical care where constant monitoring is required is cardiovascular diseases. Arrhythmia, one of the cardiovascular diseases, is generally diagnosed by doctors using Electrocardiography (ECG), which records the heart’s rhythm and electrical activity. The use of neural networks has been extensively adopted to identify abnormalities in the last few years. It is found that the probability of detecting arrhythmia increases if the denoised signal is used rather than the raw input signal. This paper compares six filters implemented on ECG signals to improve classification accuracy. Custom convolutional neural networks (CCNNs) are designed to filter ECG data. Extensive experiments are drawn by considering the six ECG filters and the proposed custom CCNN models. Comparative analysis reveals that the proposed models outperform the competitive models in various performance metrics.


Introduction
Medical assistance with technology has been increasing rapidly over the last few years. It is an efficient way to treat and monitor patients who require constant medical support. Cardiovascular diseases are primal diseases that humans have been facing for many years. The heart is a vital organ in the body, and identification and diagnosis of heart diseases is critical. These diseases are caused by interruption of oxygen supply to heart muscles due to blockages, resulting in muscle death. Reports cite that 17.9 million people die of arrhythmia each year, estimated at 32% of all deaths [1]. With changing lifestyles and food habits worldwide, all the age groups are now being affected by these diseases, and the pattern of identification became random. Generally, arrhythmia is identified by ECG, which records electricity flowing through the heart [2]. ECG must be studied deeply to identify trends in the graph to predict arrhythmia. A person that is affected by the disease and is prone to it needs continuous observation by ECG.
The scarcity of trained medical professionals in lower-middle-and low-income countries is prevalent, especially in rural areas [3]. Even continuous monitoring of heart disease by an individual is so difficult. With ECG data, arrhythmia identification can be made using computer-aided diagnosis systems [2]. Recent advancements in the computer field, such as 1.
Denoising the raw ECG data to extract accurate data. 2.
The use of custom convolution neural networks produced 94% and 93% accuracy to analyze the signals and observe the patterns.
The novelty of this paper lies in the comprehensive comparison of six (6) widely used filters for denoising waveforms, finding out the filter which performs best on ECG data. Then, applying the filter onto the data and using the denoised information to train and test the three (3) custom convolutional neural networks (CCNNs) built using a combination of different types of layers and corresponding parameters. The advantages and disadvantages of implementing custom convolutional neural networks (CCNNs) on ECG data are widely discussed.
The paper is organized as follows. Section 2 states the literature review. Section 3 describes the data set and the filters used for denoising. Section 4 represents the architecture of the custom convolution neural networks used. Section 5 presents the results and discussion. Finally, Section 6 concludes the findings of the implementation and future scope of the work.

Related Work
Detection of arrhythmia is an important and challenging task. ECG signals are analyzed to identify the patterns and detect the insights. Almahamdy et al. [6] used different denoising techniques to filter out and get a pure ECG signal. Hilbert transform is one of the efficient methods for denoising the signal. Sabut et al. [7] used this method and adaptive filters for filtering out the input ECG. Altan et al. [8] applied Hilbert transform on the initial data to identify the complexes, and the results obtained were used to diagnose heart diseases. Zhang et al. [9] used wavelet energy and sub-smoothing filters to eliminate unwanted disturbances on ECG signals generated while recording the data. Chandra et al. [10] performed denoising techniques and feature extraction to detect arrhythmia. Median filter, Gaussian filter, and other filters were used by Subbiah et al. [11] to denoise the signal and identify which filter gives the best result. Kumar et al. [12] used multidimensional noise cancellation of ECG signal to extract pure ECG signal. Rajeshwari et al. [13] used efficient preprocessing techniques on MRI images. Pace et al. [14] developed interactive algorithm to segment heart chambers, epicardial surfaces and great vessel walls from pedic cardiac MRI of congenital heart diseases. Sraitih et al. [15] implemented different machine learning algorithms such as support vector machine (SVM) K-nearest neighbor(KNN) on the preprocessed ECG data for classifying different types of beats. Berntson et al. [16] used a high-pass filter to measure root mean square successive heart period variability. Ali et al. [17] used different deep learning architectures, such as convolutional neural networks (CNNs), long short-term memory (LSTM), autoencoders, etc., to classify ECG signals to detect arrhythmia. Naz et al. [18] took ECG data as an input, convert the data into a binary image, classify using deep learning, and discussed the limitations of using ECG data rather than image data. Wu et al. [19] used convolutional neural networks on a denoised ECG signal to classify different peaks in the signal. Aziz et al. [20] used two-event Sensors 2022, 22, 1928 3 of 19 corresponding moving average (TERMA) and fractional Fourier transform (FrFT) to extract different peaks and then used machine learning to classify the heart as normal or abnormal.
Pattern detection and feature extraction from the raw data produce multi-layered longduration crucial in the whole process. Patro et al. [21] used ANN on ECG data to identify patterns based on psychological and geometrical conditions of the heart used for biometric identification. Lastre et al. [22] identified heart abnormalities after FIR smoothing on data. Acharya et al. [23] implemented grayscale feature extraction from electrocardiographic images for identifying CAD using the GMM classifier. Extraction of heart rate signals from ECG to identify CAD by using linear and nonlinear analysis was performed by Acharya et al. [24]. Bhyri et al. [25] used CNN for feature extraction from ECG to identify QRS complexes in the data. Lin et al. [26] efficiently implemented the use of convolutional neural networks for feature extraction using a person's facial features, which indeed helps identify coronary heart diseases. ML algorithms were used by Akella et al. [27] for feature extraction and classification of heart diseases. Valluraiah et al. [28] identified and located R peaks and QRS detection using the Hilbert transform.
The last phase would identify and classify arrhythmia and heart diseases using the preprocessed data4 and extracted features. Yıldırım et al. [29] used 1-dimensional CNN to identify cardiac arrhythmia with the help of long-duration ECG signals. This method achieved 91% accuracy and took much less time when compared with traditional methods.
Luz et al. [30] performed both preprocessing of ECG data and classification of two significant types of arrhythmias using the preprocessed data. A relevance vector machine (RVM) is used to classify five types of arrhythmias which produced more significant results than Gayathri et al. [31]. Rajpurkar et al. [32] used 34-layered convolutional neural networks to identify arrhythmia using ECG signals. ECG signals are converted into 2-D vectors by Li et al. [33] to detect irregular heartbeats to identify abnormalities that have produced more significant results. Avanzato et al. [34] used multi-layered CNN onto the ECG dataset to classify CAD, and it produced an accuracy of~98%. Alizadehsani et al. [35] used different ML algorithms to analyze factors that cause CAD and thus detect CAD. Acharya et al. [36] and Acharya et al. [37] used multi-layered CNN for analyzing long-duration ECG signals for detecting CHD. The detailed overview of models, datasets, and their accuracy in diagnosis of heart related diseases are presented in Table 1.

Methodology
This section is as follows. Section 3.1 briefly describing the dataset and its contents. Section 3.2 contains preprocessing information about the data. Section 3.3 explains about different filters applied to ECG signals. Section 3.4 describes the model architecture, which is further explained in Sections 3.4.1-3.4.3 about model 1, model 2, and model 3, respectively. Finally, Section 3.5 explains performance metrics used to evaluate and measure the model's performance.

Data Description
Forty-eight half-hour labeled two-channel ambulatory ECG recordings were presented in the MIT-BIH Arrhythmia Database. In the dataset above, 47 people were investigated between 1975 and 1979 in the BIH arrhythmia laboratory [38] and published in 2005. A random selection of twenty-three recordings was made from a collection of 4000 24-h ambulatory ECG recordings collected from a diverse population of outpatients (40%) and inpatients (60%) at Boston's Beth Israel Hospital. The remaining 25 recordings were selected from the same set to include rare but clinically significant arrhythmias. This was done to ensure the dataset is generalized and contains a variety of arrhythmias. The ECG recording of the database was converted to digital format, and two cardiologists resolved any difference present in data. The annotation of heartbeats is presented in Figure 1. This procedure overcomes the problem of amplitude scaling and removes the offset effect. After preprocessing, the data in the dataset are first randomized, then divided into training sets and testing sets with 80% and 20% of total data, respectively. Eighty percent of training data is fed to the model to train on the data, and then the 20% test data is used to test and evaluate the model.

Filters
Noises are unwanted signals in data acquisition that must be denoised for processing signals for critical situations. The authors used six filters to denoise and filter out the noise from the ECG data. The filters are as follows: 1. Median Filter: The median denoising filter filters out salt and pepper type noise [39]. It is a nonlinear filter. In this filter, a window slides over the input, and in each case, the median of the window is calculated, and the median value replaces other pixels.

Gaussian Filter:
A Gaussian denoising filter is also known as a Gaussian blur. It denoises the signal and creates kernels with normal distribution [40]. The window size is restricted to a value in this filter as Gaussian filters generally use an infinite range for each input. A Gaussian impulse has been created that denoises the entire input data or signal.

Moving Average Filter:
Smoothing the signal is one of the main tasks performed by the Moving Average filter. This filter finds the average over the data points on the whole input signal to smoothen the signal [41]. This filter smoothens short-term fluctuations and disturbances to observe long-term trends in the signal.

Savitzky-Golay filter:
In this filter, some points to fit a polynomial and replace the input with the output, which smoothens the signal on performing this process over the signal input [42,43].

Low-Pass Butter Filter:
It is designed to make frequency response as flat as possible on the passband. It allows the input signal to appear at the output until the frequency is lower than the

Preprocessing
The ECG signal from MIT-BIH Arrhythmia Database was sampled at 360 Hz. The data from the dataset are well-curated, but in the real-world scenario, ECG signals contain noise, so to test and train the proposed model to perform under those circumstances, the random noise was added to the dataset. The denoising of the dataset was performed using wavelet transformation, median filter, 1-D Gaussian filter, Moving Average filter, Savitzky-Golay filter, and low-pass Butterworth filter. The performance of the filters is presented in the result section, out of which the median filter performed well compared to other filters; therefore, we used it to denoise the ECG signal. ECG signals are segmented into heartbeats as per the annotation provided in the dataset. A Z-score normalization procedure normalizes each ECG segment to increase the data and reduce noise.
This procedure overcomes the problem of amplitude scaling and removes the offset effect. After preprocessing, the data in the dataset are first randomized, then divided into training sets and testing sets with 80% and 20% of total data, respectively. Eighty percent of training data is fed to the model to train on the data, and then the 20% test data is used to test and evaluate the model.

Filters
Noises are unwanted signals in data acquisition that must be denoised for processing signals for critical situations. The authors used six filters to denoise and filter out the noise from the ECG data. The filters are as follows: 1.
Median Filter: The median denoising filter filters out salt and pepper type noise [39]. It is a nonlinear filter. In this filter, a window slides over the input, and in each case, the median of the window is calculated, and the median value replaces other pixels.

2.
Gaussian Filter: A Gaussian denoising filter is also known as a Gaussian blur. It denoises the signal and creates kernels with normal distribution [40]. The window size is restricted to a value in this filter as Gaussian filters generally use an infinite range for each input. A Gaussian impulse has been created that denoises the entire input data or signal.

3.
Moving Average Filter: Smoothing the signal is one of the main tasks performed by the Moving Average filter. This filter finds the average over the data points on the whole input signal to smoothen . This filter smoothens short-term fluctuations and disturbances to observe long-term trends in the signal.

4.
Savitzky-Golay filter: In this filter, some points to fit a polynomial and replace the input with the output, which smoothens the signal on performing this process over the signal input [42,43].

5.
Low-Pass Butter Filter: It is designed to make frequency response as flat as possible on the passband. It allows the input signal to appear at the output until the frequency is lower than the cutoff frequency. It is always assumed to make the signal smooth and keep the frequency low [44].

6.
Wavelet Denoising Filter: Wavelet consists of oscillations where the oscillation begins at 0, increases, and decreases. This filter filters the signal in the wavelet space using the threshold value then inverts the filtered signal to produce the original [43].

Model 1
In model 1, as shown in Figure 2, the input shape is (2160, 1), and each layer has RELU as its activation function. Each alternating convolution layer has filters as 400, 256, 178, 88, and 44, respectively, and kernel sizes of 20, 15, 7, 5, and 3. The dropout rate between the first three sets of convolution and max pool layers is 0.5, but it is set to 0.25 for the last two sets. Max pooling layers are set to pool size as 2, consisting of strides which are also set to 2, and padding is present. The final layer, the output layer, has an activation function as a sigmoid. cutoff frequency. It is always assumed to make the signal smooth and keep the frequency low [44].

Wavelet Denoising Filter:
Wavelet consists of oscillations where the oscillation begins at 0, increases, and decreases. This filter filters the signal in the wavelet space using the threshold value then inverts the filtered signal to produce the original [43].

Model 1
In model 1, as shown in Figure 2, the input shape is (2160, 1), and each layer has RELU as its activation function. Each alternating convolution layer has filters as 400, 256, 178, 88, and 44, respectively, and kernel sizes of 20, 15, 7, 5, and 3. The dropout rate between the first three sets of convolution and max pool layers is 0.5, but it is set to 0.25 for the last two sets. Max pooling layers are set to pool size as 2, consisting of strides which are also set to 2, and padding is present. The final layer, the output layer, has an activation function as a sigmoid. In Model 2 presented in Figure 3, the structure is as follows: a dropout separates the convolution and max-pooling layers. The input layer has an input size of (2160, 1). The convolution layers, including the input layer, have an activation function as

Model 2
In Model 2 presented in Figure 3, the structure is as follows: a dropout separates the convolution and max-pooling layers. The input layer has an input size of (2160, 1). The convolution layers, including the input layer, have an activation function as RELU. The filters of alternating convolution layers are set to 600, 400, 266, 178, and 88, respectively, and the kernel size of each alternating layer is 20, 15, 10, 7, and 20, respectively. Each convolution layer and max-pooling layer set has a dropout place between them, with a rate of 0.25 throughout the model. Each max pool layer has padding activated, has a max pool size of two (2), and strides set to two (2). The model is flattened before the dense layer, and the dense layer has activation specified as sigmoid. 88, respectively, and the kernel size of each alternating layer is 20, 15, 10, 7, and 20, respectively. Each convolution layer and max-pooling layer set has a dropout place between them, with a rate of 0.25 throughout the model. Each max pool layer has padding activated, has a max pool size of two (2), and strides set to two (2). The model is flattened before the dense layer, and the dense layer has activation specified as sigmoid.

Model 3
The structure of Model-3 shown in Figure 4 is as follows: a dropout separates the convolution layer and max-pooling layer. The input layer has an input size of (2160, 1). The convolution layers, including the input layer, have an activation function as relu. The filters of alternating convolution layers are set to 256, 128, 72, and 36, respectively, and the kernel size of each layer is 5. Each convolution layer and maxpooling layer set has a dropout place between them, with a rate of 0.50 throughout the model. Each max pool layer has padding activated, has a max pool size of two (2), and strides set to two (2). Before the dense layers, the model is flattened. Three dense layers are placed with neurons (50, 32, 1), activation function used in the first two dense layers is relu, and the activation function specified in the third layer is sigmoid.

Performance Matrix
The filters are compared using peak to signal noise ratio (PSNR), which is defined as the ratio between the maximum value of the signal to the distorting noise in the signal.
where MSE is mean square error, RMSE is root mean squared error, and L represents number of maximum possible intensity levels. Evaluation of a model is one of the essential steps in building a neural network. Evaluation of a model focuses on testing the model's performance on the test dataset after training the model. ECG signal classification performance measure is done using loss, accuracy, sensitivity, specificity, precision, and recall.

Model 3
The structure of Model-3 shown in Figure 4 is as follows: a dropout separates the convolution layer and max-pooling layer. The input layer has an input size of (2160, 1). The convolution layers, including the input layer, have an activation function as relu. The filters of alternating convolution layers are set to 256, 128, 72, and 36, respectively, and the kernel size of each layer is 5. Each convolution layer and max-pooling layer set has a dropout place between them, with a rate of 0.50 throughout the model. Each max pool layer has padding activated, has a max pool size of two (2), and strides set to two (2). Before the dense layers, the model is flattened. Three dense layers are placed with neurons (50, 32, 1), activation function used in the first two dense layers is relu, and the activation function specified in the third layer is sigmoid.

Performance Matrix
The filters are compared using peak to signal noise ratio (PSNR), which is defined as the ratio between the maximum value of the signal to the distorting noise in the signal.
where MSE is mean square error, RMSE is root mean squared error, and L represents number of maximum possible intensity levels. Evaluation of a model is one of the essential steps in building a neural network. Evaluation of a model focuses on testing the model's performance on the test dataset after Recall = TP/(TP + FN) (6) Figure 5 represents the process flow starting from the data and classifying it. ECG signal is taken from the dataset on which one-hot encoding is performed. These data are normalized using Z-score, and then heartbeat segmentation is done. The data are denoised using different filters such as wavelet transform, low-pass Butterworth filter, Savitzky-Golay filter, moving average filter, median filter, and gaussian filter. The preprocessed and denoised data is now split into training and testing sets and then fed to CCNNs to perform the heartbeat classification.  Figure 5 represents the process flow starting from the data and classifying it. ECG signal is taken from the dataset on which one-hot encoding is performed. These data are normalized using Z-score, and then heartbeat segmentation is done. The data are denoised using different filters such as wavelet transform, low-pass Butterworth filter, Savitzky-Golay filter, moving average filter, median filter, and gaussian filter. The preprocessed and denoised data is now split into training and testing sets and then fed to CCNNs to perform the heartbeat classification.

Results and Discussion
This part of the paper as follows: Section 4.1 provides details about the filters used in the study, and their performance is analyzed on the dataset. Comparative analyses of the filters are done in Section 4.1.7 using peak to signal noise ratio (PSNR); Section 4.2 explains and presents the results of three different convolutional neural networks used in this experimental study.

Denoising
Denoising is a process in which signals are reconstructed and extracted from noisy and mixed signals. Its main goal is to eliminate noise and preserve helpful information. Some denoising techniques are discussed, and their results are presented in this section.

Wavelet Denoising Filter
Wavelet denoising depends on the wavelet representation of the signals. Small values in the wavelet domain are Gaussian noise which can be removed by setting coefficients below threshold or zero, or all coefficients are shrunk toward zero by the given amount. This study used soft thresholding, Bayes Shrink algorithm, and sym8 wavelet in denoising raw signals. It achieved a peak signal-to-noise ratio of 56.9, and the results of wavelet denoising can be seen in Figure 6.

Median Filter
It is a nonlinear filtering technique often used to remove impulse noise from signals. Removal of noise from the raw signal is a preprocessing step. The central concept behind median filtering is to run signal entry by entry, replacing each entry with the median of the neighboring entries. The pattern of neighbors used to find the median is called a window, which slides entry by entry over the entire signal. The peak to signal noise achieved by the median filter in this study is 87.3, and the results of median filter denoising can be seen in Figure 7.

Results and Discussion
This part of the paper as follows: Section 4.1 provides details about the filters used in the study, and their performance is analyzed on the dataset. Comparative analyses of the filters are done in Section 4.1.7 using peak to signal noise ratio (PSNR); Section 4.2 explains and presents the results of three different convolutional neural networks used in this experimental study.

Denoising
Denoising is a process in which signals are reconstructed and extracted from noisy and mixed signals. Its main goal is to eliminate noise and preserve helpful information. Some denoising techniques are discussed, and their results are presented in this section.

Wavelet Denoising Filter
Wavelet denoising depends on the wavelet representation of the signals. Small values in the wavelet domain are Gaussian noise which can be removed by setting coefficients below threshold or zero, or all coefficients are shrunk toward zero by the given amount. This study used soft thresholding, Bayes Shrink algorithm, and sym8 wavelet in denoising raw signals. It achieved a peak signal-to-noise ratio of 56.9, and the results of wavelet denoising can be seen in Figure 6.

Median Filter
It is a nonlinear filtering technique often used to remove impulse noise from signals. Removal of noise from the raw signal is a preprocessing step. The central concept behind median filtering is to run signal entry by entry, replacing each entry with the median of the neighboring entries. The pattern of neighbors used to find the median is called a window, which slides entry by entry over the entire signal. The peak to signal noise achieved by the median filter in this study is 87.3, and the results of median filter denoising can be seen in Figure 7.

Gaussian Filter
The Gaussian function is the impulse response of the Gaussian filter. The accurate gaussian response would have an infinite impulse response. Convolution of the input signal and Gaussian filter modify and denoise signals. The window size is restricted to a value in this filter as Gaussian filters generally use an infinite range for each input. A gaussian impulse is created, which denoises the entire input data or signal. In this study, the Gaussian filter achieved a peak to signal noise value is 86.5, and the output of the Gaussian filter can be seen in Figure 8.

Gaussian Filter
The Gaussian function is the impulse response of the Gaussian filter. The accurate gaussian response would have an infinite impulse response. Convolution of the input signal and Gaussian filter modify and denoise signals. The window size is restricted to a value in this filter as Gaussian filters generally use an infinite range for each input. A gaussian impulse is created, which denoises the entire input data or signal. In this study, the Gaussian filter achieved a peak to signal noise value is 86.5, and the output of the Gaussian filter can be seen in Figure 8.

Gaussian Filter
The Gaussian function is the impulse response of the Gaussian filter. The accurate gaussian response would have an infinite impulse response. Convolution of the input signal and Gaussian filter modify and denoise signals. The window size is restricted to a value in this filter as Gaussian filters generally use an infinite range for each input. A gaussian impulse is created, which denoises the entire input data or signal. In this study, the Gaussian filter achieved a peak to signal noise value is 86.5, and the output of the Gaussian filter can be seen in Figure 8.

Gaussian Filter
The Gaussian function is the impulse response of the Gaussian filter. The accurate gaussian response would have an infinite impulse response. Convolution of the input signal and Gaussian filter modify and denoise signals. The window size is restricted to a value in this filter as Gaussian filters generally use an infinite range for each input. A gaussian impulse is created, which denoises the entire input data or signal. In this study, the Gaussian filter achieved a peak to signal noise value is 86.5, and the output of the Gaussian filter can be seen in Figure 8.

Moving Average Filter
A moving average filter is simply a low-pass Finite Impulse Response (FIR). This filter is used to regulate an array of sample data or signals. Samples of the input are taken at a time. Then, input samples and an average of those values are taken to signal output. It is found that as the length of the filter increases, the smoothness of the output increases. The peak to signal noise ratio achieved by moving the average filter is 81.05 and the denoised signal produced, and its comparison with a raw signal is presented in Figure 9.

Moving Average Filter
A moving average filter is simply a low-pass Finite Impulse Response (FIR). This filter is used to regulate an array of sample data or signals. Samples of the input are taken at a time. Then, input samples and an average of those values are taken to signal output. It is found that as the length of the filter increases, the smoothness of the output increases. The peak to signal noise ratio achieved by moving the average filter is 81.05 and the denoised signal produced, and its comparison with a raw signal is presented in Figure 9.

Savitzky-Golay Filter
Savitzky-Golay filters are commonly used to remove signals whose frequency span is significant. Savitzky-Golay filters are also known as digital smoothing polynomial filters or least-squares smoothing filters. These filters perform better than standard averaging FIR filters in some applications, which filters high-frequency signals with noise. Savitzky-Golay filters are more successful at preserving high-frequency signals. The peak to signal noise ratio achieved by the Savitzky-Golay filter is 80.5 in this study, and the filter is implemented using Scipy library with window size 25 and polynomial of order 7 is used to fit the sample. The performance of the Savitzky-Golay filter can be seen in Figure 10.

Savitzky-Golay Filter
Savitzky-Golay filters are commonly used to remove signals whose frequency span is significant. Savitzky-Golay filters are also known as digital smoothing polynomial filters or least-squares smoothing filters. These filters perform better than standard averaging FIR filters in some applications, which filters high-frequency signals with noise. Savitzky-Golay filters are more successful at preserving high-frequency signals. The peak to signal noise ratio achieved by the Savitzky-Golay filter is 80.5 in this study, and the filter is implemented using Scipy library with window size 25 and polynomial of order 7 is used to fit the sample. The performance of the Savitzky-Golay filter can be seen in Figure 10.

Moving Average Filter
A moving average filter is simply a low-pass Finite Impulse Response (FIR). This filter is used to regulate an array of sample data or signals. Samples of the input are taken at a time. Then, input samples and an average of those values are taken to signal output. It is found that as the length of the filter increases, the smoothness of the output increases. The peak to signal noise ratio achieved by moving the average filter is 81.05 and the denoised signal produced, and its comparison with a raw signal is presented in Figure 9.

Savitzky-Golay Filter
Savitzky-Golay filters are commonly used to remove signals whose frequency span is significant. Savitzky-Golay filters are also known as digital smoothing polynomial filters or least-squares smoothing filters. These filters perform better than standard averaging FIR filters in some applications, which filters high-frequency signals with noise. Savitzky-Golay filters are more successful at preserving high-frequency signals. The peak to signal noise ratio achieved by the Savitzky-Golay filter is 80.5 in this study, and the filter is implemented using Scipy library with window size 25 and polynomial of order 7 is used to fit the sample. The performance of the Savitzky-Golay filter can be seen in Figure 10.

Low-Pass Butterworth Filter
Butterworth filters are those filters whose frequency is flat after the passband region. The output provided by the low pass filter from DC up to a cut-off frequency f(H) and the signal above the frequency gets rejected by the low-pass Butterworth filter. The peak to signal noise ratio achieved by the low-pass Butterworth filter is 78.6 in this study, and the performance of the low-pass Butterworth filter is shown in Figure 11.

Low-Pass Butterworth Filter
Butterworth filters are those filters whose frequency is flat after the passband region. The output provided by the low pass filter from DC up to a cut-off frequency f(H) and the signal above the frequency gets rejected by the low-pass Butterworth filter. The peak to signal noise ratio achieved by the low-pass Butterworth filter is 78.6 in this study, and the performance of the low-pass Butterworth filter is shown in Figure 11. Figure 11. Raw ECG signal (Blue) denoising using low-pass Butterworth filter compares denoised (Orange) and raw signals.

Comparison between Filters
The details of the ECG signals of the MIT-BIH dataset are present in the three files. They are (.hea) denoted as a header file, (.dat) denoted as a binary file, and (.atr) denoted as a binary annotation file.
The header file holds comprehensive information about the ECG signal, such as lead used for the patient and the number of leads used to diagnose diseases, the sampling frequency of the signals, and patient details. Format of the signal is present in the binary file, and information related to beats is stored in the binary file. Multiple filters are implemented on ECG signals before segmenting them into the single-single heartbeats to remove different kinds of noises like muscle artifact noise, electrode motion artifact noise, and baseline wander. A comparison of the outputs of the filters was made using PSNR.
It can be observed from Table 2 that median and Gaussian filters perform better than other filters in removing noise from raw ECG signals.

Results of CCNNs
This experimental study was conducted on Google colab with Tesla K80 GPU, CPU Intel(R) Xenon(R), RAM 13 Gb. We use the proposed two convolutional neural networks and one Residual neural network. These are trained using heartbeats segmented from the ECG signal database. The results achieved by the models are presented in Tables 3 and 4. It can be seen from the tables that Model-1 achieved better results than the other two models. Figure 11. Raw ECG signal (Blue) denoising using low-pass Butterworth filter compares denoised (Orange) and raw signals.

Comparison between Filters
The details of the ECG signals of the MIT-BIH dataset are present in the three files. They are (.hea) denoted as a header file, (.dat) denoted as a binary file, and (.atr) denoted as a binary annotation file.
The header file holds comprehensive information about the ECG signal, such as lead used for the patient and the number of leads used to diagnose diseases, the sampling frequency of the signals, and patient details. Format of the signal is present in the binary file, and information related to beats is stored in the binary file. Multiple filters are implemented on ECG signals before segmenting them into the single-single heartbeats to remove different kinds of noises like muscle artifact noise, electrode motion artifact noise, and baseline wander. A comparison of the outputs of the filters was made using PSNR.
It can be observed from Table 2 that median and Gaussian filters perform better than other filters in removing noise from raw ECG signals.

Results of CCNNs
This experimental study was conducted on Google colab with Tesla K80 GPU, CPU Intel(R) Xenon(R), RAM 13 Gb. We use the proposed two convolutional neural networks and one Residual neural network. These are trained using heartbeats segmented from the ECG signal database. The results achieved by the models are presented in Tables 3 and 4. It can be seen from the tables that Model-1 achieved better results than the other two models.

AUC-ROC CURVE
Receiver operating characteristic curve (ROC) is a plot between two parameters-True Positive Rate (TPR) and False Positive Rate (FPR)-which are plotted on Y and X axis, respectively. ROC curve is plotted by computing TPR and FPR at different thresholds and plotting it onto the graph to find the best threshold for the model.
ROC plot shows the following: • Relationship between sensitivity and specificity. As sensitivity increases specificity increases.

•
The classification power of the model at different thresholds. As the threshold decreases more data items are classified as positive.

•
Test accuracy which can be identified as the closer the curve to the top leftmost corner of the graph accurate the model is. An ideal curve would go straight from zero up to the top-left corner and then parallel to the X-axis. The curve which will be nearer to the diagonal would be less accurate.
Area Under Curve (AUC) is used to summarize the performance of the ROC curve. AUC curve is the measure of the ability of the model to distinguish between the classes.
From Figure 12, it is evident that Model-2 curve is much nearer to the top left corner and Model-3 is much nearer to the diagonal. Therefore, Model-2 has a higher AUC value when compared to Model-1 and Model-3. Furthermore, Figures 13-15 represent AUC values of the model at different number of training points. Model-2 at any instant has the higher AUC value when compared with Model-1 and Model-3. Therefore, Model-2 has higher performance than Model-1 and Model-3 when the models are compared using ROC curve that is shown in Figure 12 and AUC values.

Discussion
The deep learning architectures Model-1, Model-2, and Model-3 proposed for ECG classification are motivated by classification and analysis [45,46]. Various studies are performed using conventional neural networks to characterize abnormal ECG signals. Our ECG monitoring and classification system, which is patient-specific, was developed using a three-layer convolutional neural network structure. R-wave was used to detect ventricular and supraventricular electrical activity in this system, giving 99.60% and 97.60% accuracy, respectively. In Zubain et al. [47], 3-layer convolutional neural network model was trained using R peak ECG beat patterns and achieved an

Discussion
The deep learning architectures Model-1, Model-2, and Model-3 proposed for ECG classification are motivated by classification and analysis [45,46]. Various studies are performed using conventional neural networks to characterize abnormal ECG signals. Our ECG monitoring and classification system, which is patient-specific, was developed using a three-layer convolutional neural network structure. R-wave was used to detect ventricular and supraventricular electrical activity in this system, giving 99.60% and 97.60% accuracy, respectively. In Zubain et al. [47], 3-layer convolutional neural network model was trained using R peak ECG beat patterns and achieved an

Discussion
The deep learning architectures Model-1, Model-2, and Model-3 proposed for ECG classification are motivated by classification and analysis [45,46]. Various studies are performed using conventional neural networks to characterize abnormal ECG signals. Our ECG monitoring and classification system, which is patient-specific, was developed using a three-layer convolutional neural network structure. R-wave was used to detect ventricular and supraventricular electrical activity in this system, giving 99.60% and 97.60% accuracy, respectively. In Zubain et al. [47], 3-layer convolutional neural network model was trained using R peak ECG beat patterns and achieved an From Table 4, it can be noted that validation accuracies are 86%, 87%, and 93% for Model-3, Model-1, and Model-2, respectively. These values implies that Model-2 had performed well compared to other two models on the fed ECG data.

Discussion
The deep learning architectures Model-1, Model-2, and Model-3 proposed for ECG classification are motivated by classification and analysis [45,46]. Various studies are performed using conventional neural networks to characterize abnormal ECG signals. Our ECG monitoring and classification system, which is patient-specific, was developed using a three-layer convolutional neural network structure. R-wave was used to detect ventricular and supraventricular electrical activity in this system, giving 99.60% and 97.60% accuracy, respectively. In Zubain et al. [47], 3-layer convolutional neural network model was trained using R peak ECG beat patterns and achieved an accuracy of 92.7% in detecting five different ECG classes. Four ECG classes were characterized by an 11-layer convolutional neural network using two and five seconds of ECG signal. They yielded an accuracy of 92.50%, a sensitivity of 98.09%, and a specificity of 93.13 for two-second ECG. Furthermore, this system achieved 94.90% accuracy, 99.13% sensitivity, and 81.44% specificity for five seconds of ECG signals (Acharya et al. [48]). Robust features were extracted from ECG signals using alternative convolutional, pooling, and dropout layers. Then, features were linked to fully connected layers for ECG signal characterization. The results presented in Tables 3 and 4 reveal that the proposed model achieves remarkable results. Moreover, the implementation of the proposed architecture is economical and needs light hardware because architecture needs only 1-dimensional convolutions.
We have trained the proposed models with six epochs with 32 batch size. We have considered the epoch value as 6 as if we try with higher epoch size models will start memorizing the ECG patterns, and, thus, may lead to overfitting problem. Model The advantages of proposed models are as follows: 1. The proposed CCNN model is robust.

2.
There is no requirement for QRS detection. 3.
CCNN structure consists of feature extraction, selection, and classification.

4.
The proposed model is light on the computation side; it is cost-effective.
The limitations are as follows: 1.
The training phase of CCNN is much higher.

2.
A huge database is required to fulfill the training criteria. 3.
CCNN required a fixed ECG signal; thus, ECG signal length must be fixed for both the training and testing phase.

Conclusions and Future Scope
The most common cause of heart attack is coronary artery disease (CAD). Despite significant technical developments, an automated diagnosis method that is both reliable and efficient is required for the early detection of CAD. Three custom CCNN structures (Model 1, Model 2, and Model 3) were built out of which first two models consisted of five convolutional layers, five max-pooling layers, and one fully connected layer, and the third Model-3 consists of four convolutional layers, four max-pooling layers, and three fully connected layers to detect two classes (regular and CAD). Model-1 achieved 93.03% accuracy, 52.18% sensitivity, and 84.45% specificity. While Model-2 achieved 89.03% accuracy, 47.92% sensitivity, and 95.88% specificity. Model-3 achieved 89.56% accuracy, 47.48% sensitivity, and 87.20% specificity. The new technique can aid clinicians in accurately diagnosing coronary artery disease.
The approach is easy to use, inexpensive, and suitable for cardiac screening in developing countries. The scientists can use an extensive database to improve the CCNN structure in future research. This research can also be applied to the early detection of coronary artery disease (CAD), different phases of myocardial infarction (MI), and congestive heart failure (CHF) utilizing ECG signals. This will aid medics in providing appropriate medication and saving lives.