## 3 Methodology
### Skip Layer Pooling Fusion  
We present a simple but effective feature fusion technique called skip layer pooling fusion in this subsection. Figure 4 illustrates the architecture of a conventional CNN for image classification, while Figure 5 depicts the SLPF architecture, where a branch is introduced at each intermediate layer of the neural network. The branches we added use global average pooling(GAP) [38] to align the features. After GAP, the size of the feature maps is the same (1 \(\times\) 1 for all), and then the features are fused. It is worth noting that the critical parameter of skip layer pooling fusion technology is the convolutional kernel size of the convolutional layer added before global average pooling. In our experiment, we used 1 \(\times\) 1, 3 \(\times\) 3 and 5 \(\times\) 5 convolutional kernels and then found that their effects were almost the same. While considering the parameter quantity, we chose a 1 \(\times\) 1 convolutional kernel. The pseudocode of SLPF is shown in Algorithm 1. Figure 4: A regular CNN image classifier. Figure 5: A CNN classifier with SLPF added. Figure 3: Training and usage process of the real-time detection model. ```
1x=conv1(x)//Forwardpropagation,performingconvolutionoperations,wherexistheinputimage. 2x1=gap(conv1_finetune(x))//Useglobalaveragepooling tocompressfeaturesafterfine-tuningthem. 3x=conv2(x)//Forwardpropagation,performingconvolutionoperations. 4x=conv3(x)//Forwardpropagation,performingconvolutionoperations. 5x3=gap(conv3_finetune(x))//Useglobalaveragepooling tocompressfeaturesafterfine-tuningthem
6x=torch_cat(x1,x3)//Featurefusion
7x=conv_transfer(x)//Channelconversion
8x=fc(x)//Feedtheobtainedfeaturesintothefullyconnectedlayer
```  
**Algorithm 1**Skip layer pooling fusion. To achieve this, a decision must be made as to which layers the branch should be added to. It depends on the last convolutional layer that does not contain a convolutional kernel size of \(1\times 1\) for feature extraction in CNN. If it is an odd layer, the branches are added to the odd layers. Otherwise, they are added to the even layers. This is because prior studies suggest that the features extracted by the last convolutional layer have the most significant impact on the classification results. That is why most CNNs use only the features from the last layer for classification. The motivation behind employing skip-layer feature fusion is that we think adjacent convolutional layers tend to extract similar features. By incorporating the features extracted from the skip layers, we can mitigate issues such as excessive model parameters and overfitting, resulting in an improvement of the model's overall performance. The proposed SLPF structure offers several advantages. First, feature fusion is performed after the GAP of the features from each layer. This approach effectively compresses the features of the model before fusion. For instance, given an input image of size 256 \(\times\) 256, if without utilizing GAP, as shown in Figure 6, the size of the feature maps obtained from layer B after multiple convolutions may be 32 \(\times\) 32 \(\times\) \(b\), where \(b\) is the number of convolutional kernels in layer B, while the size of the previous layer A could be 64 \(\times\) 64 \(\times\) \(a\), where a is the number of convolutional kernels in A. When the feature maps of B are upsampled and combined with the feature maps of A, the output becomes 64 \(\times\) 64 \(\times\) (\(a+b\)). Figure 6: Common feature fusion methods using upsampling aligned features. By utilizing GAP, the feature map sizes of A and B are reduced to \(1\times 1\times a\) and \(1\times 1\times b\), respectively, as shown in Figure 7. Consequently, the size of fused features will be \(1\times 1\times(a+b)\), which is significantly smaller when compared to 64 \(\times\) 64 \(\times\) (\(a+b\)) (around 4000 times). This fusion method significantly reduces the number of parameters added to the model, i.e., the size of the model.