## 4 Automatic Classification of ECG Signal
### ECG Signal Classification
In Figure 9, from top to bottom, the loss and accuracy of the two networks, Network-C and Network-D, on type I data, type II dual-lead data, type III data, and type IV data, using the training set and verification set, respectively, and train_acc_mr represent the accuracy of the training set when Network-D is used. Similarly, train_acc_pr represents the accuracy of the training set when Network-C is used, and vail_loss_mr represents the change in the mean loss of the validation set when APRN is used. From the accuracy of the training and verification sets, the performance of APRN on all data is higher than or equal to rennet. In terms of loss changes, APRN performs better than ResNet. \begin{table}
\begin{tabular}{c c c c c c c} \hline \hline \multirow{2}{*}{**Network**} & \multirow{2}{*}{**Dataset**} & \multirow{2}{*}{**All Accuracy**} & \multicolumn{5}{c}{**Classification Accuracy**} \\ \cline{4-7}  & & & **N** & **V** & **I** & **L** & **B** \\ \hline Network-A & & 97.43 & 99.02 & 97.37 & 90.51 & 90.94 & 99.57 \\ Network-B & Sudden Cardiac Death Dynamic & 97.58 & 99.28 & 90.53 & 90.56 & 99.75 & 97.58 \\ Network-C & ECG Database & 97.83 & 99.08 & 92.14 & 91.49 & 99.75 & 98.49 \\ Network-D & & 97.88 & 99.31 & 91.40 & 91.58 & 99.77 & 98.52 \\ \hline \hline \end{tabular}
\end{table} 
Table 6: Test results of all networks on type IV data. \begin{table}
\begin{tabular}{c c c c c c c} \hline \hline \multirow{2}{*}{**Network**} & \multirow{2}{*}{**Dataset**} & \multirow{2}{*}{**All Accuracy**} & \multicolumn{5}{c}{**Classification Accuracy**} \\ \cline{4-7}  & & & **N** & **S** & **V** & **L** \\ \hline Network-A & & 96.70 & 98.29 & 86.47 & 94.34 & 97.70 \\ Network-B & EU ST-T ECG & 97.26 & 98.85 & 88.57 & 95.33 & 97.89 \\ Network-C & Database—Double & 97.46 & 99.21 & 84.87 & 96.77 & 97.90 \\ Network-D & Lead & 97.68 & 99.14 & 89.67 & 96.70 & 97.86 \\ Network-A & & 97.39 & 98.43 & 83.31 & 89.92 & 98.19 \\ Network-B & & 97.69 & 98.83 & 84.19 & 90.59 & 98.46 \\ Network-C & Average & 98.05 & 99.09 & 87.14 & 92.63 & 98.36 \\ Network-D & & 98.25 & 99.20 & 88.05 & 95.58 & 98.41 \\ \hline \hline \end{tabular}
\end{table} 
Table 4: _Cont._ \begin{table}
\begin{tabular}{c c c c c c} \hline \hline \multirow{2}{*}{**Network**} & \multirow{2}{*}{**Dataset**} & \multirow{2}{*}{**All Accuracy**} & \multicolumn{5}{c}{**Classification Accuracy**} \\ \cline{4-7}  & & & **S** & **V** & **N** \\ \hline Network-A & & 98.69 & 99.41 & 95.00 & 95.34 \\ Network-B & MIT-BIH ECG & 98.94 & 99.41 & 97.41 & 93.75 \\ Network-C & Database—ST & 99.10 & 100.00 & 95.67 & 91.83 \\ Network-D & Segment Data & 99.18 & 99.70 & 97.48 & 93.47 \\ \hline \hline \end{tabular}
\end{table} 
Table 5: Test results of all networks on type III data. Table 7 shows the accuracy of the network models used by several scholars on the MIT-BIH dataset. Most of them do not divide the data into validation sets, but only use training and test sets, which highly affect the generalization of the model. Moreover, previous studies only tested models on one type of data, and not on other datasets for testing. In the training, the present study only uses the training set for training, and optimizes the model according to the validation set and the effect curve of the training set, which increases the generalizability of the model to a certain extent. At the same time, this study does not adjust the parameters of the optimization and the loss functions, which are the default values, proving that the effect of the model itself is more reliable. Figure 9: Comparison of Network-C and Network-D training processing. In addition, six machine learning algorithm classifiers are used to train and predict the above four datasets. The following table shows the classification results of these classification algorithms: K-Nearest Neighbor (KNN) [37], Logistic Regression (LR) [38], Random Forest (RF) [39], Decision Tree (DT) [40], Gradient Boosting Decision Tree (GBDT) [41], and Adaptive Boosting (AdaBoost) [42].