## 4 Automatic Classification of ECG Signal
### ECG Signal Classification  
In MIT-BIH ECG data, the highest point is where the R wave [31] appears. Therefore, when intercepting the ECG waveform, we take the R wave point as the cut-off, from which several sampling points are taken in front and behind, reaching a total of 300 as a sample. Each waveform is intercepted according to this method. In the EU ST-T ECG database, due to the low sampling rate, reducing the quantity of sampling points is important. Then, 200 sampling points are taken as a sample. Each section of ECG signal data is intercepted according to this method. Based on the segmentation format of ECG datasets, we use three other network models to compare with the proposed network model. Figure 6 shows the CNN (Network-A), CNN-R (Network-B), ResNet-18 (Network-C), and APRN (Network-D) based on the depth residual and R-wave point from left to right. Network-A is a CNN constructed with the optimization goal of adjusting the number of convolutional layers and neurons in all hidden layers. Finally, four convolutional layers and one fully connected layer are used. Network-B adds a residual unit on Network-A to extract signal features and verify the performance of the residual unit at a deeper level. Network-C is the original 18-layer deep residual Network, which is optimized only to adjust the hyper-parameters without changing the network architecture. Network-D is an optimization based on Network-C architecture, as follows: we insert the maximum pooling layer in the middle of the original residual block, expand the number of channels twice, and use the residual connection once. Then, to halve the number of channels, the convolution layer with a kernel size of 1 is used. Meanwhile, a residual connection is established. Finally, we change the adaptive average pooling layer to the adaptive maximum pooling layer. In specific use, compared with Network-C, Network-D removes the first residual block. Figure 5: Comparison diagram before and after wavelet denoising. Figure 7 shows three types of residual blocks RE1, RE2, and RE3 used in Network-B, Network-C, and Network-D, respectively. In this study, we explore the classification of 1D ECG data. Therefore, in RE1, m represents the dimension of data, n represents the number of channels of data, C (29,14) represents the convolution kernel size used of 29, padding is 14, P (3,1) represents the kernel size of the maximum pooling layer used of 3, padding is 1, and OP represents the final output. Meanwhile, the residual connection in RE1 is assumed by C (1,0). Various representations in RE2 and RE3 are similar to those in RE1. In Figure 8, comparing Network-A and Network-B, the effect of residual units on feature extraction can be observed. Network-C is a series of residual units. Only after convolution calculation is performed in one residual unit can the calculation result be sent to the next one, and finally classified by SoftMax. Network-D and Network-C are used to compare classification effects after the residual network adjustment. When all hyper-parameters are consistent and the network models differ, the classification accuracy of each model on different datasets and of each category is obtained. Figure 6: Structure diagram of four network models. Figure 7: Three kinds of residual blocks in networks. In the third part of Table 4, the EU ST-T ECG Database-double lead combines the MLIII lead data in the first part with the V5 lead data in the second part. In the fourth part, the average is that of the data in the first three parts. Analysis of Tables 3-6 shows that the effect of Network-D and the accuracy of its classification are better than those of the other networks in the specific classification of datasets in a single database. Next, we can check the performance of the original ResNet and the network APRN on the training and verification sets.