# Research on ECG Signal Classification Based on Hybrid Residual Network
## 2 Method
### ECG Signal Classification  
To tackle the challenges of inadequate feature extraction efficiency and a sluggish model learning speed in ECG signal classification, we proposed a Hybrid Residual Network architecture that combines traditional convolution and separable convolution layers. This model, with its uniquely built hybrid residual blocks, improves the feature extraction efficiency and greatly accelerates model training speed, offering a better solution for handling complex ECG signals. Figure 3 presents a comprehensive depiction of the overall architecture of this deep neural network. The proposed model consists of multiple deep layers, featuring an initial convolution block, two hybrid residual blocks, and a classification block. The input to the model is a 1-D ECG signal comprising 280 samples, which encapsulates the characteristics of a single-lead ECG recording. The detailed architecture of the model is as follows: it incorporates standard convolution layers and separable convolution layers, and employs batch normalization (BN), ReLU activation functions, and residual connections to ensure the stability of feature extraction and the efficiency of training. First, the input data undergo processing via a 1-D convolutional layer using 64 filters, a kernel size of 3, and a stride of 2. The output feature map from this convolutional layer is passed through a batch normalization layer to stabilize the training process, followed by the ReLU activation function to introduce non-linearity and enhance the model's expressive capacity. A max-pooling layer is subsequently deployed, halving the spatial dimensions of the feature map and therefore alleviating the computational strain on subsequent layers. In the first hybrid residual block, the input data are first processed through a separable convolution layer featuring 64 filters and a stride of 2, succeeded by a batch normalization layer. They are then processed through another separable convolution layer with the same configuration and another batch normalization layer. To ensure the model's learning capacity, this residual block employs a skip connection that directly adds the original input to the final output, subsequently applying the ReLU activation function for non-linear processing. Next, a 1-D convolution layer with 64 filters is added, and its output is added to the activations from the previous part, resulting in the final residual output. \begin{table}
\begin{tabular}{c c c c} \hline \hline
**Hearbeat Classes** & **Samples in Origin Dataset** & **Training Samples** & **Training Samples After SMOTE** & **Testing Samples** \\ \hline N & 90,502 & 81,463 & 81,463 & 9039 \\ V & 7226 & 6499 & 6499 & 727 \\ S & 2777 & 2483 & 6000 & 294 \\ F & 802 & 730 & 6000 & 72 \\ Q & 8031 & 7229 & 7229 & 802 \\ \hline \hline \end{tabular}
\end{table} 
Table 2: Heartbeats in training dataset classes before and after SMOTE. The configuration of the second hybrid residual block resembles that of the first, with the sole distinction being the inclusion of 128 filters in this block. This residual block is configured with two separable convolution layers, each succeeded by a batch normalization layer. A skip link facilitates the addition of the input to the output of the convolution layers, followed by the application of the ReLU activation function to enhance the non-linear representation. A 1-D convolution layer with 128 filters is applied next, and its output is added to the output of the preceding section, forming the residual output of this block. Ultimately, the network proceeds to the classification stage. The multidimensional feature maps are initially flattened into a one-dimensional vector, followed by a dropout layer with a dropout rate of 50% to reduce the risk of overfitting. The flattened data are then transmitted across a fully connected layer, where the ReLU activation function is used to augment non-linear processing capabilities.