# Feature Extraction and Recognition of Human Physiological Signals Based on the Convolutional Neural Network

Authors: Chansol Hurr; Caiyan Li; Heng Li
Journal: Mobile Information Systems
 (2022)

---

## Abstract

Human physiological signal processing is one of the research fields widely used in recent years. Research on human physiological signals plays a vital role in predicting human health and detecting and classifying certain disease outbreaks. The network of human physiological signals is difficult to determine because it contains a lot of information about human activities. To this end, a variety of feature extraction, feature selection, and classification algorithms have been implemented in the anomaly prediction process. However, it has the main disadvantage of classification results, using a large number of features and increasing complexity. In order to solve these problems, this paper proposes a convolutional neural network-based extraction technique for human physiological signal features and uses an MPL classifier to detect whether the ECG signal is normal or not, taking the ECG signal as an example. In this paper, the signal preprocessing method based on wavelet transform and morphological filtering is adopted, and the high-frequency signal is removed by wavelet transform, and the low-frequency signal is removed by morphological filtering. A wide range of tests on ECG signals obtained from the MIT-BIH-AR databank and INCART database showed that the method has good detection performance with sensitivity Sen = 99.54%, positive prediction rate PPR = 99.65%, detecting mistake ratio DER = 0.35% and precision Acc = 99.55%, which is an improved performance compared to other techniques, proving the superiority of the present technique.


---

## Body

## 1. Introduction

There are many kinds of physiological signals in the human body. According to the nature of electricity, they can be divided into ECG, EMG, EEG, and so on. There are also respiration, invasive blood pressure, noninvasive blood pressure, blood oxygen saturation, end-tidal carbon dioxide, body temperature, cardiac output, pulse, etc. Human physiological signals are of great significance to reflect the health status of the human body, but currently, the statistical signal-based feature extraction is not ideal for classification and recognition, and the conventional feature extraction methods have certain limitations. The heart is a vital organ of the human body. ECG signals play an important role in human physiological signals. Electrocardiogram is currently the most commonly used method of recording the electrical activity of the heart. This paper extracts and recognizes the characteristics of human physiological signals based on the convolutional neural network in order to make a certain contribution to the health of human physiology.In latest years, various related techniques have been discussed and improved by researchers in the field of human signal feature extraction and signal classification. Kaiser’s team proposed the engineering and realization of a low-cost solar-powered chair for persons with disabilities. This solution uses surface electromyography (sEMG) technology to obtain signals needed to manipulate a wheelchair from different muscles of the hand [1]. Li’s team proposed a nonlinear feature extraction method for ECG signatures incorporating wavesaw package factorization (WPD) and near-entropy (AP-EN). Signal classification uses an improved support vector machine (SVM) classifier [2]. Regarding the topic of character optimization and recognition of ECG samples, many scholars have conducted research in this area. More typically, Chandra’s team proposed a method to eliminate ECG signals with different types of noise using the maximum overlap divergent wavelet transforms and generic thresholding. The discretized wavelet transforms and thresholds are used to detect these noise-free ECG samples. The R-peak reference point and then a number of rule-based methods are used to identify additional signatures. Finally, other important features are calculated using the extracted features [3]. Sabut et al. [4] team presented a modified algorithm for detecting intricate characteristics of QRS, which is designed to categorize four kinds of ECG rhythms based on the multiresolution wavelet converter [4]. Wang et al. [5] team proposed a design and implementation method of a portable abnormal ECG signal analyzer based on feature classification [5]. In addition, convolutional neural networks have also been used by some scholars in feature extraction and classification of ECG signals [6–8]. More typically, Kamaleswaran et al. [6] team proposed a powerful deep learning-based architecture. The architecture is a 13-layer convolutional neural network (CNN) model. The model can use a single lead short ECG record to identify abnormal heart rhythms. There are also many literatures that apply convolutional neural networks to human feature signal processing. For example, Yu et al. [9] proposed a wireless channel fingerprint extraction and classification method based on convolutional neural networks. Tang et al. [10], Maram and Elrefaei [11] proposed the iris recognition feature extraction technology based on convolutional neural network and so on [9–11].Based on the above research, to reduce the computational cost, to adapt to the changes of ECG signals, to discard the defects of hand-made features, and to improve the accuracy of ECG signal feature detection, this article presents a two-dimensional deconvolutional nerve network-based ECG signal function selection method and classifies ECG signals using an improved SVM model. In this article, a two-layer CNN consisting of a target layer and a partial layer CNN is used to extract morphological features of ECG for detecting QRS waves,T waves, and R waves. After extracting QRS wave, T wave, and R wave, the ECG signals obtained from MIT-BIH database and INCART database were tested extensively and compared with previous techniques in terms of detection sensitivity, predictability, and accuracy. There are some improvements.The innovations of this paper are as follows. (1) The method of signal preprocessing is analyzed and discussed. (2) A convolutional neural network model is constructed. (3) The feature extraction and signal classification are analyzed and studied. (4) Finally, the ECG signals of MIT-BIH-AR database and INCART database were tested and analyzed.


## 2. Proposed Method

### 2.1. Signal Preprocessing

#### 2.1.1. Wavelet Transform

Nonstationary biomedical signals are generally processed by potential transforms such as Hilbert transform [12], short-time Fourier transform (STFT) [13], and wavelet transfer [3, 4] for noise removal and analysis. Wavelet transform is a new transform analysis method, which inherits and develops the idea of localization of short-time Fourier transform. At the same time, it overcomes the shortcomings that the window size does not change with frequency and can provide a “time-frequency” window that changes with frequency, which is an ideal tool for signal time-frequency analysis and processing. The wavelet transform can provide temporal presentation of the signatures and temporal positioning of the optical constituents. As an important numerical tool in the field of unsteady waveform analytics, wavelet transform can detect signal structures at different scales. Wavelets are also widely used in signal analysis. It can be used for boundary processing and filtering, time-frequency analysis, signal-to-noise separation and extraction of weak signals, fractal index calculation, signal identification and diagnosis, and multiscale edge detection. The basic principle of wavelet transform is to split the signal into different functions by using the translation and expansion properties of the mother wave (φ (t)). It is specified as an archetypal value of(1)φabt=a−1/2φt−ba.The wavelet transform is divided into consecutive waveslet transfer (CWT) and discreet groups of waveslet transfer (DWT). CWT can be expressed as(2)wfb,a=a−1/2∫−∞∞ftϕ∗t−badt.The adaptive and multiple resolution properties of the CWT small wavelet transforms make the analysis simple and efficient. DWT is expressed as(3)Wxm,n=∫−∞∞xtϕm,ntdt.In the discretized wavelet transform, the incoming data are discretized at various levels and the equation is as given below(4)xt=∑j=1K∑k=−∞∞djkφj,kt+∑−∞∞akkψk,kt.Among themdjk, ϕj, kt, akk are the detailed signal, discrete analysis wavelet,and discrete scale function, respectively. DWT can be implemented using the following expressions:(5)hn=12ψt,ψ2t−n,(6)gn=12ϕt,ψ2t−n=−1nh1−n.


#### 2.1.2. Mathematical Morphology

Mathematical morphology is a new research area that has attracted attention [14, 15]. Basic morphological operations include erosion and swelling.Definition of inflation(7)f⊕hm=maxn=m−M+1,…,mfn+hm−n+1.Definition of erosion(8)f⊕hm=minn=1,2,…mfm+n−1+hn.PVE (f) works by subtracting the opening and closing off from the original signal f, and the resulting signal consists of the peak and valley values of the signal that does not contain B.


#### 2.1.3. Signal Preprocessing Method Based on Wavelet Transform and Morphological Filtering

This paper uses a signal preprocessing method based on wavelet transform and morphological filtering. The preprocessing process needs to remove the three main types of noise: power frequency interference, EMG interference, and baseline drift. EMG and power frequency interference are relatively high-frequency signals compared to ECG signals, while baseline drift is low-frequency signals [16–18]. In this paper, wavelet transform is used to remove high-frequency signals, and morphological filtering is used to remove low frequency signals. First, the signal is divided into 4 scales. According to the characteristics of wavelet decomposition, the EMG interference is basically on the 1 and 2 scales, the power frequency interference is on the 2 and 3 scales, and the ECG signal is on the 3 and 4 scales [19]. Threshold processing is performed on the detail coefficients on 3 scales, and a threshold is set to determine whether the detail coefficient is set to 0. Finally, the processed scale coefficients are used to reconstruct the signal, and then morphological filtering is performed to remove baseline drift to obtain a filtered signal. The flowchart of the preprocessing method in this paper is shown in Figure 1.Figure 1
Flowchart of preprocessing.


### 2.2. Convolutional Neural Network Model

The convolutional neural network is a kind of feedforward neural network that includes convolutional computation and has deep structure and is one of the representative algorithms of deep learning.


#### 2.2.1. Convolutional Layer

The process of involution operates as(9)xjk=f∑I=1MJK−1xik−1⊗wijk+bkj,j=1,…,N.In formula (9), the i-th feature surface of the k−1 layer and the convolution kernel of the k-th layer performs a convolution operation, and the final output is xjk, which in turn can be used as the input of the next network layer.In building the CNN structures, the use of successive involution not only keeps the receiver domain of the network constant but also reduces the trainingable arguments in the problem. The structure of the convolutional neural network includes an input layer, a hidden layer, and an output layer as illustrated in Figure2.Figure 2
Three-layer continuous convolution.The size of the filter in the picture above is 3 × 3. The perceptual field range is the identical following one involution with the filter of size 5 × 5. For a factor of size 3 × 3, the amount of parameters that can be trained in the network after two consecutive convolutions is 18; if one convolution is performed with a filter of size 5 × 5, the network can be trained with 25 parameters.


#### 2.2.2. Pooling Layer

The Iked layer scales down the scale of incoming imagery based on the filtering outcome of the convolution level, ultimately decreasing the amount of variables in the model, so it is also known as the downsampling or downsampling level. The introduction of the pooling layer in CNN ensures the translation invariance of the image to some extent. In addition, the pooling operation allows the network to have a larger receptive field so that it can accept larger inputs, the receptive field increases, and the higher network layers of the network can learn more abstract features. However, in recent models such as LetNet and AlextNet, the maximum pooling method is used to select each region. The largest element in the receptive field spreads to the next layer. Assuming an input image with a size of 4 × 4, if the filter size used is 2 × 2 and the step size is 2, the maximum pooled output will be the maximum value of each 2 × 2 region, and the pooled average will be combined to output the average roundness of each sampling region which enters an integer value.Depending on the asynchronous size employed in the Ikea method, there are mainly overlapping pooling methods and nonoverlapping pooling methods. The graph in Figure3 shows the two various pooling methods.Figure 3
Overlapping pooling and nonoverlapping pooling.


#### 2.2.3. Fully Connected Layer

The fully connected layer follows the stacking layer of the convolutional layer and the pooling layer, interprets the extracted features, and performs advanced inference functions for classification problems. The final fully connected layer usually uses a classifier to classify the extracted features and generate output results. Early neural networks used radial basis functions to solve image classification problems and achieved great success. In the deep convolution neural network (DCNN) that has appeared in recent years, Softmax classifiers are increasingly used for image classification issues.


#### 2.2.4. Activation Function

The sigmoid activation function is shown as follows:(10)σx=sigmx=11+e−x,(11)tanhx=ex−e−xex+e−x,(12)ReLUx=max0,x=x,x≥0,0,x<0..The calculation formula for the leaky ReLU activation function of the leakage correction linear unit is shown as(13)LReLUx=1,x≥0,ax,x<0,0<a<1,(14)ELUx=1,x≥0,aex−1,x<0,0<a<1.ELU has almost all the advantages of ReLU but has a large computational overhead. Therefore, in practical applications, it has not been fully demonstrated that using the ELU optimization function is necessarily preferable to the ReLU optimization function.


### 2.3. Feature Extraction and Signal Classification

#### 2.3.1. ECG Signal Detection

The ECG consists mainly ofP wave, QRS wave, and T wave, as shown in Figure 4, where the R wave peak in the QRS complex can be used as a significant feature for locating the QRS complex. First, you need to locate the area of the QRS complex. According to the feature that the R wave is the largest peak in the QRS complex, you can quickly locate the R wave. The point where the maximum value is retrieved is a prerequisite for determining the peak of the R wave, and the condition for determining the peak must also be met. If the peak condition is not satisfied, determine which direction is greater than the value of the point. If the value on the right is large, continue to the right. The search does not determine the position of the R wave until it finds a location that meets the crest conditions. After the R wave is retrieved, Q and S are retrieved based on the position of the R wave. Q and S are the trough positions on both sides of the R wave. Therefore, we calculate the differential signal and average differential signal of the ECG signal separately. When the original ECG signal sampled at 360 Hz in the MIT-BIH-AR database is selected, and the current sampling point is taken as the median value, after preprocessing, all are 56. The average difference signal of each sample is 0.69 s, and the difference signal is 0.13 s. In this way, when the current detection point is the R-peak, it can cover both the entire heartbeat cycle and the QRS complex. P waves and T waves are concentrated during the R-R period. P and T waves are the more obvious peaks during R-R. For this purpose, all peak points during R-R are retrieved. The largest peak position retrieved from the first half of the R-R period is the T wave. The P and T wave end point retrieval method is to retrieve the position of the trough, respectively, on both sides. Figure 5 shows the segmentation process for ECG signals.Figure 4
Normal ECG signal diagram.Figure 5
Segment method used for ECG signal.


#### 2.3.2. ECG Signal Feature Extraction

In order to extract morphological features with different granularity from differential signals and average differential signals, this paper proposes an automatic feature extraction technology based on the convolutional neural networks. Feature extraction is a primary operation in image processing, that is to say, it is the first operation processing performed on an image. It examines each pixel to determine whether the pixel represents a feature. It consists of low-CNN and high-CNN, as shown in Figure6. Among them, high-CNN is used to select coarse-grained functions belonging to high-level segments. This part of the ECG signal will be averaged and differentially processed after preprocessing. This section of the ECG signal is processed only by differential operation. The two levels of the system are combined and trained using the BP algorithm. The two-layer CNN uses a hierarchical structure to extract different abstract features from different levels. The weights are shared and multiple feature maps can be calculated in stages. The sampling phase combines the clustered neuron outputs from the convolution phase into one. All features extracted by the two-stage CNN are concatenated and sent to the MPL for final recognition of the ECG signal. Among them, the feature types of feature extraction mainly include edges, corners, regions, and ridges. The ECG signal detection process includes two steps: training and decision-making.Figure 6
Structure of attention-based two-level 1-D CNN.


## 2.1. Signal Preprocessing

### 2.1.1. Wavelet Transform

Nonstationary biomedical signals are generally processed by potential transforms such as Hilbert transform [12], short-time Fourier transform (STFT) [13], and wavelet transfer [3, 4] for noise removal and analysis. Wavelet transform is a new transform analysis method, which inherits and develops the idea of localization of short-time Fourier transform. At the same time, it overcomes the shortcomings that the window size does not change with frequency and can provide a “time-frequency” window that changes with frequency, which is an ideal tool for signal time-frequency analysis and processing. The wavelet transform can provide temporal presentation of the signatures and temporal positioning of the optical constituents. As an important numerical tool in the field of unsteady waveform analytics, wavelet transform can detect signal structures at different scales. Wavelets are also widely used in signal analysis. It can be used for boundary processing and filtering, time-frequency analysis, signal-to-noise separation and extraction of weak signals, fractal index calculation, signal identification and diagnosis, and multiscale edge detection. The basic principle of wavelet transform is to split the signal into different functions by using the translation and expansion properties of the mother wave (φ (t)). It is specified as an archetypal value of(1)φabt=a−1/2φt−ba.The wavelet transform is divided into consecutive waveslet transfer (CWT) and discreet groups of waveslet transfer (DWT). CWT can be expressed as(2)wfb,a=a−1/2∫−∞∞ftϕ∗t−badt.The adaptive and multiple resolution properties of the CWT small wavelet transforms make the analysis simple and efficient. DWT is expressed as(3)Wxm,n=∫−∞∞xtϕm,ntdt.In the discretized wavelet transform, the incoming data are discretized at various levels and the equation is as given below(4)xt=∑j=1K∑k=−∞∞djkφj,kt+∑−∞∞akkψk,kt.Among themdjk, ϕj, kt, akk are the detailed signal, discrete analysis wavelet,and discrete scale function, respectively. DWT can be implemented using the following expressions:(5)hn=12ψt,ψ2t−n,(6)gn=12ϕt,ψ2t−n=−1nh1−n.


### 2.1.2. Mathematical Morphology

Mathematical morphology is a new research area that has attracted attention [14, 15]. Basic morphological operations include erosion and swelling.Definition of inflation(7)f⊕hm=maxn=m−M+1,…,mfn+hm−n+1.Definition of erosion(8)f⊕hm=minn=1,2,…mfm+n−1+hn.PVE (f) works by subtracting the opening and closing off from the original signal f, and the resulting signal consists of the peak and valley values of the signal that does not contain B.


### 2.1.3. Signal Preprocessing Method Based on Wavelet Transform and Morphological Filtering

This paper uses a signal preprocessing method based on wavelet transform and morphological filtering. The preprocessing process needs to remove the three main types of noise: power frequency interference, EMG interference, and baseline drift. EMG and power frequency interference are relatively high-frequency signals compared to ECG signals, while baseline drift is low-frequency signals [16–18]. In this paper, wavelet transform is used to remove high-frequency signals, and morphological filtering is used to remove low frequency signals. First, the signal is divided into 4 scales. According to the characteristics of wavelet decomposition, the EMG interference is basically on the 1 and 2 scales, the power frequency interference is on the 2 and 3 scales, and the ECG signal is on the 3 and 4 scales [19]. Threshold processing is performed on the detail coefficients on 3 scales, and a threshold is set to determine whether the detail coefficient is set to 0. Finally, the processed scale coefficients are used to reconstruct the signal, and then morphological filtering is performed to remove baseline drift to obtain a filtered signal. The flowchart of the preprocessing method in this paper is shown in Figure 1.Figure 1
Flowchart of preprocessing.


## 2.1.1. Wavelet Transform

Nonstationary biomedical signals are generally processed by potential transforms such as Hilbert transform [12], short-time Fourier transform (STFT) [13], and wavelet transfer [3, 4] for noise removal and analysis. Wavelet transform is a new transform analysis method, which inherits and develops the idea of localization of short-time Fourier transform. At the same time, it overcomes the shortcomings that the window size does not change with frequency and can provide a “time-frequency” window that changes with frequency, which is an ideal tool for signal time-frequency analysis and processing. The wavelet transform can provide temporal presentation of the signatures and temporal positioning of the optical constituents. As an important numerical tool in the field of unsteady waveform analytics, wavelet transform can detect signal structures at different scales. Wavelets are also widely used in signal analysis. It can be used for boundary processing and filtering, time-frequency analysis, signal-to-noise separation and extraction of weak signals, fractal index calculation, signal identification and diagnosis, and multiscale edge detection. The basic principle of wavelet transform is to split the signal into different functions by using the translation and expansion properties of the mother wave (φ (t)). It is specified as an archetypal value of(1)φabt=a−1/2φt−ba.The wavelet transform is divided into consecutive waveslet transfer (CWT) and discreet groups of waveslet transfer (DWT). CWT can be expressed as(2)wfb,a=a−1/2∫−∞∞ftϕ∗t−badt.The adaptive and multiple resolution properties of the CWT small wavelet transforms make the analysis simple and efficient. DWT is expressed as(3)Wxm,n=∫−∞∞xtϕm,ntdt.In the discretized wavelet transform, the incoming data are discretized at various levels and the equation is as given below(4)xt=∑j=1K∑k=−∞∞djkφj,kt+∑−∞∞akkψk,kt.Among themdjk, ϕj, kt, akk are the detailed signal, discrete analysis wavelet,and discrete scale function, respectively. DWT can be implemented using the following expressions:(5)hn=12ψt,ψ2t−n,(6)gn=12ϕt,ψ2t−n=−1nh1−n.


## 2.1.2. Mathematical Morphology

Mathematical morphology is a new research area that has attracted attention [14, 15]. Basic morphological operations include erosion and swelling.Definition of inflation(7)f⊕hm=maxn=m−M+1,…,mfn+hm−n+1.Definition of erosion(8)f⊕hm=minn=1,2,…mfm+n−1+hn.PVE (f) works by subtracting the opening and closing off from the original signal f, and the resulting signal consists of the peak and valley values of the signal that does not contain B.


## 2.1.3. Signal Preprocessing Method Based on Wavelet Transform and Morphological Filtering

This paper uses a signal preprocessing method based on wavelet transform and morphological filtering. The preprocessing process needs to remove the three main types of noise: power frequency interference, EMG interference, and baseline drift. EMG and power frequency interference are relatively high-frequency signals compared to ECG signals, while baseline drift is low-frequency signals [16–18]. In this paper, wavelet transform is used to remove high-frequency signals, and morphological filtering is used to remove low frequency signals. First, the signal is divided into 4 scales. According to the characteristics of wavelet decomposition, the EMG interference is basically on the 1 and 2 scales, the power frequency interference is on the 2 and 3 scales, and the ECG signal is on the 3 and 4 scales [19]. Threshold processing is performed on the detail coefficients on 3 scales, and a threshold is set to determine whether the detail coefficient is set to 0. Finally, the processed scale coefficients are used to reconstruct the signal, and then morphological filtering is performed to remove baseline drift to obtain a filtered signal. The flowchart of the preprocessing method in this paper is shown in Figure 1.Figure 1
Flowchart of preprocessing.


## 2.2. Convolutional Neural Network Model

The convolutional neural network is a kind of feedforward neural network that includes convolutional computation and has deep structure and is one of the representative algorithms of deep learning.


### 2.2.1. Convolutional Layer

The process of involution operates as(9)xjk=f∑I=1MJK−1xik−1⊗wijk+bkj,j=1,…,N.In formula (9), the i-th feature surface of the k−1 layer and the convolution kernel of the k-th layer performs a convolution operation, and the final output is xjk, which in turn can be used as the input of the next network layer.In building the CNN structures, the use of successive involution not only keeps the receiver domain of the network constant but also reduces the trainingable arguments in the problem. The structure of the convolutional neural network includes an input layer, a hidden layer, and an output layer as illustrated in Figure2.Figure 2
Three-layer continuous convolution.The size of the filter in the picture above is 3 × 3. The perceptual field range is the identical following one involution with the filter of size 5 × 5. For a factor of size 3 × 3, the amount of parameters that can be trained in the network after two consecutive convolutions is 18; if one convolution is performed with a filter of size 5 × 5, the network can be trained with 25 parameters.


### 2.2.2. Pooling Layer

The Iked layer scales down the scale of incoming imagery based on the filtering outcome of the convolution level, ultimately decreasing the amount of variables in the model, so it is also known as the downsampling or downsampling level. The introduction of the pooling layer in CNN ensures the translation invariance of the image to some extent. In addition, the pooling operation allows the network to have a larger receptive field so that it can accept larger inputs, the receptive field increases, and the higher network layers of the network can learn more abstract features. However, in recent models such as LetNet and AlextNet, the maximum pooling method is used to select each region. The largest element in the receptive field spreads to the next layer. Assuming an input image with a size of 4 × 4, if the filter size used is 2 × 2 and the step size is 2, the maximum pooled output will be the maximum value of each 2 × 2 region, and the pooled average will be combined to output the average roundness of each sampling region which enters an integer value.Depending on the asynchronous size employed in the Ikea method, there are mainly overlapping pooling methods and nonoverlapping pooling methods. The graph in Figure3 shows the two various pooling methods.Figure 3
Overlapping pooling and nonoverlapping pooling.


### 2.2.3. Fully Connected Layer

The fully connected layer follows the stacking layer of the convolutional layer and the pooling layer, interprets the extracted features, and performs advanced inference functions for classification problems. The final fully connected layer usually uses a classifier to classify the extracted features and generate output results. Early neural networks used radial basis functions to solve image classification problems and achieved great success. In the deep convolution neural network (DCNN) that has appeared in recent years, Softmax classifiers are increasingly used for image classification issues.


### 2.2.4. Activation Function

The sigmoid activation function is shown as follows:(10)σx=sigmx=11+e−x,(11)tanhx=ex−e−xex+e−x,(12)ReLUx=max0,x=x,x≥0,0,x<0..The calculation formula for the leaky ReLU activation function of the leakage correction linear unit is shown as(13)LReLUx=1,x≥0,ax,x<0,0<a<1,(14)ELUx=1,x≥0,aex−1,x<0,0<a<1.ELU has almost all the advantages of ReLU but has a large computational overhead. Therefore, in practical applications, it has not been fully demonstrated that using the ELU optimization function is necessarily preferable to the ReLU optimization function.


## 2.2.1. Convolutional Layer

The process of involution operates as(9)xjk=f∑I=1MJK−1xik−1⊗wijk+bkj,j=1,…,N.In formula (9), the i-th feature surface of the k−1 layer and the convolution kernel of the k-th layer performs a convolution operation, and the final output is xjk, which in turn can be used as the input of the next network layer.In building the CNN structures, the use of successive involution not only keeps the receiver domain of the network constant but also reduces the trainingable arguments in the problem. The structure of the convolutional neural network includes an input layer, a hidden layer, and an output layer as illustrated in Figure2.Figure 2
Three-layer continuous convolution.The size of the filter in the picture above is 3 × 3. The perceptual field range is the identical following one involution with the filter of size 5 × 5. For a factor of size 3 × 3, the amount of parameters that can be trained in the network after two consecutive convolutions is 18; if one convolution is performed with a filter of size 5 × 5, the network can be trained with 25 parameters.


## 2.2.2. Pooling Layer

The Iked layer scales down the scale of incoming imagery based on the filtering outcome of the convolution level, ultimately decreasing the amount of variables in the model, so it is also known as the downsampling or downsampling level. The introduction of the pooling layer in CNN ensures the translation invariance of the image to some extent. In addition, the pooling operation allows the network to have a larger receptive field so that it can accept larger inputs, the receptive field increases, and the higher network layers of the network can learn more abstract features. However, in recent models such as LetNet and AlextNet, the maximum pooling method is used to select each region. The largest element in the receptive field spreads to the next layer. Assuming an input image with a size of 4 × 4, if the filter size used is 2 × 2 and the step size is 2, the maximum pooled output will be the maximum value of each 2 × 2 region, and the pooled average will be combined to output the average roundness of each sampling region which enters an integer value.Depending on the asynchronous size employed in the Ikea method, there are mainly overlapping pooling methods and nonoverlapping pooling methods. The graph in Figure3 shows the two various pooling methods.Figure 3
Overlapping pooling and nonoverlapping pooling.


## 2.2.3. Fully Connected Layer

The fully connected layer follows the stacking layer of the convolutional layer and the pooling layer, interprets the extracted features, and performs advanced inference functions for classification problems. The final fully connected layer usually uses a classifier to classify the extracted features and generate output results. Early neural networks used radial basis functions to solve image classification problems and achieved great success. In the deep convolution neural network (DCNN) that has appeared in recent years, Softmax classifiers are increasingly used for image classification issues.


## 2.2.4. Activation Function

The sigmoid activation function is shown as follows:(10)σx=sigmx=11+e−x,(11)tanhx=ex−e−xex+e−x,(12)ReLUx=max0,x=x,x≥0,0,x<0..The calculation formula for the leaky ReLU activation function of the leakage correction linear unit is shown as(13)LReLUx=1,x≥0,ax,x<0,0<a<1,(14)ELUx=1,x≥0,aex−1,x<0,0<a<1.ELU has almost all the advantages of ReLU but has a large computational overhead. Therefore, in practical applications, it has not been fully demonstrated that using the ELU optimization function is necessarily preferable to the ReLU optimization function.


## 2.3. Feature Extraction and Signal Classification

### 2.3.1. ECG Signal Detection

The ECG consists mainly ofP wave, QRS wave, and T wave, as shown in Figure 4, where the R wave peak in the QRS complex can be used as a significant feature for locating the QRS complex. First, you need to locate the area of the QRS complex. According to the feature that the R wave is the largest peak in the QRS complex, you can quickly locate the R wave. The point where the maximum value is retrieved is a prerequisite for determining the peak of the R wave, and the condition for determining the peak must also be met. If the peak condition is not satisfied, determine which direction is greater than the value of the point. If the value on the right is large, continue to the right. The search does not determine the position of the R wave until it finds a location that meets the crest conditions. After the R wave is retrieved, Q and S are retrieved based on the position of the R wave. Q and S are the trough positions on both sides of the R wave. Therefore, we calculate the differential signal and average differential signal of the ECG signal separately. When the original ECG signal sampled at 360 Hz in the MIT-BIH-AR database is selected, and the current sampling point is taken as the median value, after preprocessing, all are 56. The average difference signal of each sample is 0.69 s, and the difference signal is 0.13 s. In this way, when the current detection point is the R-peak, it can cover both the entire heartbeat cycle and the QRS complex. P waves and T waves are concentrated during the R-R period. P and T waves are the more obvious peaks during R-R. For this purpose, all peak points during R-R are retrieved. The largest peak position retrieved from the first half of the R-R period is the T wave. The P and T wave end point retrieval method is to retrieve the position of the trough, respectively, on both sides. Figure 5 shows the segmentation process for ECG signals.Figure 4
Normal ECG signal diagram.Figure 5
Segment method used for ECG signal.


### 2.3.2. ECG Signal Feature Extraction

In order to extract morphological features with different granularity from differential signals and average differential signals, this paper proposes an automatic feature extraction technology based on the convolutional neural networks. Feature extraction is a primary operation in image processing, that is to say, it is the first operation processing performed on an image. It examines each pixel to determine whether the pixel represents a feature. It consists of low-CNN and high-CNN, as shown in Figure6. Among them, high-CNN is used to select coarse-grained functions belonging to high-level segments. This part of the ECG signal will be averaged and differentially processed after preprocessing. This section of the ECG signal is processed only by differential operation. The two levels of the system are combined and trained using the BP algorithm. The two-layer CNN uses a hierarchical structure to extract different abstract features from different levels. The weights are shared and multiple feature maps can be calculated in stages. The sampling phase combines the clustered neuron outputs from the convolution phase into one. All features extracted by the two-stage CNN are concatenated and sent to the MPL for final recognition of the ECG signal. Among them, the feature types of feature extraction mainly include edges, corners, regions, and ridges. The ECG signal detection process includes two steps: training and decision-making.Figure 6
Structure of attention-based two-level 1-D CNN.


## 2.3.1. ECG Signal Detection

The ECG consists mainly ofP wave, QRS wave, and T wave, as shown in Figure 4, where the R wave peak in the QRS complex can be used as a significant feature for locating the QRS complex. First, you need to locate the area of the QRS complex. According to the feature that the R wave is the largest peak in the QRS complex, you can quickly locate the R wave. The point where the maximum value is retrieved is a prerequisite for determining the peak of the R wave, and the condition for determining the peak must also be met. If the peak condition is not satisfied, determine which direction is greater than the value of the point. If the value on the right is large, continue to the right. The search does not determine the position of the R wave until it finds a location that meets the crest conditions. After the R wave is retrieved, Q and S are retrieved based on the position of the R wave. Q and S are the trough positions on both sides of the R wave. Therefore, we calculate the differential signal and average differential signal of the ECG signal separately. When the original ECG signal sampled at 360 Hz in the MIT-BIH-AR database is selected, and the current sampling point is taken as the median value, after preprocessing, all are 56. The average difference signal of each sample is 0.69 s, and the difference signal is 0.13 s. In this way, when the current detection point is the R-peak, it can cover both the entire heartbeat cycle and the QRS complex. P waves and T waves are concentrated during the R-R period. P and T waves are the more obvious peaks during R-R. For this purpose, all peak points during R-R are retrieved. The largest peak position retrieved from the first half of the R-R period is the T wave. The P and T wave end point retrieval method is to retrieve the position of the trough, respectively, on both sides. Figure 5 shows the segmentation process for ECG signals.Figure 4
Normal ECG signal diagram.Figure 5
Segment method used for ECG signal.


## 2.3.2. ECG Signal Feature Extraction

In order to extract morphological features with different granularity from differential signals and average differential signals, this paper proposes an automatic feature extraction technology based on the convolutional neural networks. Feature extraction is a primary operation in image processing, that is to say, it is the first operation processing performed on an image. It examines each pixel to determine whether the pixel represents a feature. It consists of low-CNN and high-CNN, as shown in Figure6. Among them, high-CNN is used to select coarse-grained functions belonging to high-level segments. This part of the ECG signal will be averaged and differentially processed after preprocessing. This section of the ECG signal is processed only by differential operation. The two levels of the system are combined and trained using the BP algorithm. The two-layer CNN uses a hierarchical structure to extract different abstract features from different levels. The weights are shared and multiple feature maps can be calculated in stages. The sampling phase combines the clustered neuron outputs from the convolution phase into one. All features extracted by the two-stage CNN are concatenated and sent to the MPL for final recognition of the ECG signal. Among them, the feature types of feature extraction mainly include edges, corners, regions, and ridges. The ECG signal detection process includes two steps: training and decision-making.Figure 6
Structure of attention-based two-level 1-D CNN.


## 3. Experiments

### 3.1. Experimental Configuration

The core language is C++. According to the framework, various convolutional neural network structures are defined. Caffe has very high modularity, the module mainly includes 4 parts: blob, layer, net, and solver. Blob is a 4-dimensional array. Layer is the core part of Caffe; all calculations of caffe are expressed in the form of layer, and each neural network module is a layer. Each layer needs to define two operations, forward operation and reverse operation. The forward operation is to calculate the output result from the input data and predict the model. The inverse operation is to solve the gradient relative to the output from the gradient at the output, optimize parameters, and reduce errors. Net represents a true deep network model with various layers. The Caffe platform has the advantages of fast running speed, easy operation, good openness, modularity, and perfect community construction. These advantages are applicable to the research of this topic. The detailed configuration of the two-stage CNN in this experiment is shown in Table1. The entire experimental environment includes three parts: the software operating platform uses a combination of the Linux system and the Caffe framework; and the Linux system uses Ubuntu 16.04LTS, the CPU model is IntelI7-7800X, the memory is 32G, the GPU model is NVIDIAGTX1080, 8 GB video memory; and the GPU acceleration uses CUDA9.0 cudnn7.0.Table 1
Detailed description of two-level one-dimensional CNN structure.
High-level CNNLow-level CNNCNN layer 11D convolution kernel length661D subsampling factor33Number of neurons66CNN layer 21D convolution kernel length6None1D subsampling factor3NoneNumber of neurons6None


### 3.2. Data Preparation

In ECG pattern recognition, a standard database is needed as an algorithm evaluation index. Currently, it is generally recognized as the arrhythmia database (MIT-BIH-AR) recorded and labeled by MIT. It contains 48 ECG records from different patients; each record contains double lead data, the duration is 30 minutes, and 360 Hz sampling. The American Association for the Advancement of Medical Devices (AAMI) divides ECG waveforms into five categories, which are normal (N), supraventricular arrhythmia (S), ventricular arrhythmia (V), fusion heartbeat (F), and OK (Q). Generally, the Q class is discarded in the heartbeat pattern recognition because the number is too small. In this experiment, only MLII leads were used, so records 102 and 104 were not considered. It should be noted that the Internet database does not exactly match the MIT-BIH-AR database, so each record in the INCART database needs to be resampled at 360 Hz.


### 3.3. Experimental Steps

After the experimental hardware configuration and software configuration have been prepared, the signal data can be preprocessed, including the use of discrete wavelet transform to remove signal noise. Based on denoising and baseline calibration, it is necessary to extract the differential signal and the average differential signal from the original signal. The average differential signal is used to extract coarse-grained features in the upper layer of the convolutional neural network model. The differential signal is used in the model. The lower layers extract fine-grained features. The framework of ECG signal feature extraction process based on the convolutional neural network is shown in Figure7.Figure 7
ECG signal feature extraction flow framework.


## 3.1. Experimental Configuration

The core language is C++. According to the framework, various convolutional neural network structures are defined. Caffe has very high modularity, the module mainly includes 4 parts: blob, layer, net, and solver. Blob is a 4-dimensional array. Layer is the core part of Caffe; all calculations of caffe are expressed in the form of layer, and each neural network module is a layer. Each layer needs to define two operations, forward operation and reverse operation. The forward operation is to calculate the output result from the input data and predict the model. The inverse operation is to solve the gradient relative to the output from the gradient at the output, optimize parameters, and reduce errors. Net represents a true deep network model with various layers. The Caffe platform has the advantages of fast running speed, easy operation, good openness, modularity, and perfect community construction. These advantages are applicable to the research of this topic. The detailed configuration of the two-stage CNN in this experiment is shown in Table1. The entire experimental environment includes three parts: the software operating platform uses a combination of the Linux system and the Caffe framework; and the Linux system uses Ubuntu 16.04LTS, the CPU model is IntelI7-7800X, the memory is 32G, the GPU model is NVIDIAGTX1080, 8 GB video memory; and the GPU acceleration uses CUDA9.0 cudnn7.0.Table 1
Detailed description of two-level one-dimensional CNN structure.
High-level CNNLow-level CNNCNN layer 11D convolution kernel length661D subsampling factor33Number of neurons66CNN layer 21D convolution kernel length6None1D subsampling factor3NoneNumber of neurons6None


## 3.2. Data Preparation

In ECG pattern recognition, a standard database is needed as an algorithm evaluation index. Currently, it is generally recognized as the arrhythmia database (MIT-BIH-AR) recorded and labeled by MIT. It contains 48 ECG records from different patients; each record contains double lead data, the duration is 30 minutes, and 360 Hz sampling. The American Association for the Advancement of Medical Devices (AAMI) divides ECG waveforms into five categories, which are normal (N), supraventricular arrhythmia (S), ventricular arrhythmia (V), fusion heartbeat (F), and OK (Q). Generally, the Q class is discarded in the heartbeat pattern recognition because the number is too small. In this experiment, only MLII leads were used, so records 102 and 104 were not considered. It should be noted that the Internet database does not exactly match the MIT-BIH-AR database, so each record in the INCART database needs to be resampled at 360 Hz.


## 3.3. Experimental Steps

After the experimental hardware configuration and software configuration have been prepared, the signal data can be preprocessed, including the use of discrete wavelet transform to remove signal noise. Based on denoising and baseline calibration, it is necessary to extract the differential signal and the average differential signal from the original signal. The average differential signal is used to extract coarse-grained features in the upper layer of the convolutional neural network model. The differential signal is used in the model. The lower layers extract fine-grained features. The framework of ECG signal feature extraction process based on the convolutional neural network is shown in Figure7.Figure 7
ECG signal feature extraction flow framework.


## 4. Discussion

### 4.1. Comparison of Filtering Methods

Before performing ECG signal feature extraction, in order to verify the effectiveness of wavelet transform combined with the morphological filtering method on signal denoising, the 120 s signal of 30 s in MIT-BIH database was selected as the experimental signal, and 50 Hz power frequency interference was added to the signal, 200 Hz high-frequency interference, and 0.1 Hz squeezing baseline drift interference. Wavelet threshold denoising, algorithm, and adaptive denoising are performed, respectively. The SNR and calculation time of these algorithms are compared. The results are shown in Table2.Table 2
Comparison between several filtering methods.
MethodSNR (dB)Cost time (s)This work9.3420.201Wavelet transform [20]8.6430.347Self-adaptive filter [21]6.6040.186Figure8 shows the test results of QRS complexes after ECG signal preprocessing.Figure 8
Detection results of the QRS complex.Figure9 shows the changes in the Sen, PPR, and DER values according to different SNR values. Compared with the noiseless ECG signal detection performance, when the signal-to-noise ratio is greater than 10db, both the Sen value and the PPR value are close to the noiseless value.Figure 9
According to different SNR values based on different ECG records.
(a)(b)(c)


### 4.2. Performance Comparison of ECG Signal Detection Methods

The measurement indicators used in this experiment to evaluate detection performance include sensitivity (Sen), positive prediction rate (PPR), detection error rate (DER), and accuracy (Acc)(15)Sen%=TPTP+FN∗100,PPR%=TPTP+FP∗100,DER%=FN+FPTP+FN∗100,Acc%=TPTP+FP+FN∗100.The above four indicators are calculated based on the number of true positives (TP), false positives (FP), and false negatives (FN). FN is the number of ECGs that were falsely rejected. The performance comparison of the proposed method with the other three methods is shown in Table3. As shown in the table, for the MIT-BIH-AR database, the performance of our proposed method on the training set has certain advantages compared with other algorithms.Table 3
ECG signal detection using the MIT-BIH-AR database.
MethodTPFPFNSen (%)PPR (%)DER (%)This work110,22410127699.8899.920.33Hamdi et al. [22]78,2659928499.7999.880.42Burguera [23]109,35423114199.8299.760.35Guillou et al. [24]110,22413921399.8199.870.34Figure10 shows the values of Sen, PPR, and DER under different methods. It can be easily seen that the method in this paper has certain performance advantages [25–27].Figure 10
Values of Sen, PPR, and DER in different methods.In this experiment, ECG signals from the INCART database of more than 190,000 beats were also used to evaluate the capabilities of the proposed ECG signal detection method. The experimental results are shown in Table4 [28]. The ECG signal records the depolarization and repolarization process of cardiac cells from a macroscopic perspective, which objectively reflects the physiological conditions of various parts of the heart to a certain extent, so it is of great significance in clinical medicine.Table 4
ECG signal detection using the NCART database.
TotalTPFPFNSen (%)PPR (%)DER (%)Acc (%)192,174165,55017922499.5499.650.3599.55


## 4.1. Comparison of Filtering Methods

Before performing ECG signal feature extraction, in order to verify the effectiveness of wavelet transform combined with the morphological filtering method on signal denoising, the 120 s signal of 30 s in MIT-BIH database was selected as the experimental signal, and 50 Hz power frequency interference was added to the signal, 200 Hz high-frequency interference, and 0.1 Hz squeezing baseline drift interference. Wavelet threshold denoising, algorithm, and adaptive denoising are performed, respectively. The SNR and calculation time of these algorithms are compared. The results are shown in Table2.Table 2
Comparison between several filtering methods.
MethodSNR (dB)Cost time (s)This work9.3420.201Wavelet transform [20]8.6430.347Self-adaptive filter [21]6.6040.186Figure8 shows the test results of QRS complexes after ECG signal preprocessing.Figure 8
Detection results of the QRS complex.Figure9 shows the changes in the Sen, PPR, and DER values according to different SNR values. Compared with the noiseless ECG signal detection performance, when the signal-to-noise ratio is greater than 10db, both the Sen value and the PPR value are close to the noiseless value.Figure 9
According to different SNR values based on different ECG records.
(a)(b)(c)


## 4.2. Performance Comparison of ECG Signal Detection Methods

The measurement indicators used in this experiment to evaluate detection performance include sensitivity (Sen), positive prediction rate (PPR), detection error rate (DER), and accuracy (Acc)(15)Sen%=TPTP+FN∗100,PPR%=TPTP+FP∗100,DER%=FN+FPTP+FN∗100,Acc%=TPTP+FP+FN∗100.The above four indicators are calculated based on the number of true positives (TP), false positives (FP), and false negatives (FN). FN is the number of ECGs that were falsely rejected. The performance comparison of the proposed method with the other three methods is shown in Table3. As shown in the table, for the MIT-BIH-AR database, the performance of our proposed method on the training set has certain advantages compared with other algorithms.Table 3
ECG signal detection using the MIT-BIH-AR database.
MethodTPFPFNSen (%)PPR (%)DER (%)This work110,22410127699.8899.920.33Hamdi et al. [22]78,2659928499.7999.880.42Burguera [23]109,35423114199.8299.760.35Guillou et al. [24]110,22413921399.8199.870.34Figure10 shows the values of Sen, PPR, and DER under different methods. It can be easily seen that the method in this paper has certain performance advantages [25–27].Figure 10
Values of Sen, PPR, and DER in different methods.In this experiment, ECG signals from the INCART database of more than 190,000 beats were also used to evaluate the capabilities of the proposed ECG signal detection method. The experimental results are shown in Table4 [28]. The ECG signal records the depolarization and repolarization process of cardiac cells from a macroscopic perspective, which objectively reflects the physiological conditions of various parts of the heart to a certain extent, so it is of great significance in clinical medicine.Table 4
ECG signal detection using the NCART database.
TotalTPFPFNSen (%)PPR (%)DER (%)Acc (%)192,174165,55017922499.5499.650.3599.55


## 5. Conclusions

Taking ECG signals as an example, a two-layer convolutional neural network structure is used to automatically extract the QRS wave,T wave, and P wave features of the ECG, and detect the ECG signal. The ECG signal feature extraction model based on the convolutional neural network was used to extract the coarse-grained and fine-grained morphological features in the ECG signal, eliminating the need for manual feature extraction and simplifying the feature extraction operation to a certain extent. And in order to facilitate the feature extraction, a preprocessing technique combining wavelet transform with morphological filtering is also used in this paper. First, noise such as power frequency interference and EMG interference is removed from the ECG signal by wavelet transform, and then the baseline drift noise in the signal is removed by the morphological filtering method to obtain a filtered signal. Compared with other preprocessing techniques through experiments, the signal preprocessing technique proposed in this paper has certain advantages.The input signal of the convolutional neural network model is obtained by performing the difference and average difference processing on the denoised signal, and the training and test data are obtained by using the MIT-BIH-AR database and the INCART database. The experimental results show that the performance of the ECG signal detection model based on the convolutional neural network proposed in this paper has certain advantages compared with other methods listed in the paper. The technical methods in this article can help medical diagnosis to a certain extent and can be used as the entry point for almost all automatic ECG analysis. However, the feature extraction and detection methods described in this article also have some shortcomings. For example, as the training data increases, the training time is too long; after determining the structure of CNN and MPL, the length of the output ECG signal is limited. This defect will cause the model structure to be fixed, which is not conducive to improvement.In future work, we need to further optimize this aspect of the model and will incorporate ECG signatures and additional biomedical signatures to increase the precision and noise immunity of ECG signal testing. Furthermore, the detectable waveforms will be utilized for cardiac sorting, which is essential for the diagnosis of circulatory diseases. At the same time, the processing of convolutional neural network in the field of ECG signal will also be further studied.



---

*Source: 8982881-2022-07-18.xml*