## 4 Detection Method
### YOLOv5 Network Architecture  
The pre-processed images were detected using the YOLOv5 model. The YOLOv5 network architecture is shown in Figure 5. The YOLOv5 model mainly had three network blocks, as follows: Backbone, Neck, and Output. The Backbone block was mainly used for feature extraction and continuously shrinks the feature map, with the main structures including the Conv module, C3 module, and SPP module. The Conv module was an important component of the object detection algorithm YOLOv5, which mainly consisted of Conv2d, BatchNorm2d, and SiLU. The Conv module could help the model effectively extract features and organize the feature maps, providing useful information for subsequent processing steps. The Conv2d layer was one of the most basic operations in convolutional neural networks, which could extract features and scale the feature map (halving width and height). In YOLOv5, the Conv2d layer was widely used at different layers of the network to extract features at different scales. Unlike traditional convolution operations, the Conv2d layer of YOLOv5 typically used small convolution kernels (3 \(\times\) 3 or 1 \(\times\) 1), which could reduce the number of parameters and, thus, optimize the operation speed. YOLOv5 also employed some optimization techniques, such as depthwise separable convolution to enhance efficiency. The BatchNorm2d layer was a normalization layer that could normalize each batch of data, thereby accelerating the training process of the network, while also alleviating the problems of gradient disappearance and explosion and improving the robustness and generalization ability of the model. In YOLOv5, the  
Figure 5: YOLOv5 architecture diagram. BatchNorm2d layer was usually applied after the Conv2d layer to normalize the feature maps, to further enhance the performance of the model. As shown in Formulas (1) and (2), SiLU was a new type of activation function, which was a linear combination of Sigmoid weighting. It could increase the nonlinear characteristics of the network, thus improving the expressiveness and accuracy of the model. Different from the traditional activation function, SiLU had the characteristics of symmetry and smoothness, and the SiLU function was differentiable everywhere and continuously smooth, which could effectively alleviate the problems of gradient disappearance and explosion and enhance the training speed and convergence of the model. In YOLOv5, the SiLU activation function was widely used in different levels of the Conv module to improve feature expression ability and detection accuracy. \[\text{SiLU}(\mathrm{x})=\mathrm{x}\times\text{Sigmoid}(\mathrm{x}) \tag{1}\]  
\[\text{Sigmoid}(\mathrm{x})=\frac{1}{1+\exp(-\mathrm{x})} \tag{2}\]  
The C3 module mainly consisted of three Conv modules and one Bottleneck module, as shown in Figure 6. This module mainly undertook the more important feature extraction function. The three Conv modules in this module were all 1 \(\times\) 1 convolutions, which mainly controlled the size of the feature map and had almost no feature extraction function. The Bottleneck, here, used residual connections, as shown in Figure 7, which include two Convs, the first of which was 1 \(\times\) 1 convolution, and reduce the number of channels to half of the original. The second one was a 3 \(\times\) 3 convolution, doubling the number of channels, and, finally, added the input and output using a residual structure. The design of the SPP module was based on the idea of pyramid pooling. It divided the input feature map into multiple scales and each scale with maximum pooling operation. The pooled results were spliced together to form a unified scale, as shown in Figure 8. The output size of the SPP module was not limited by the input size, which could adapt to different sizes of targets and improved the generalization ability of the network, so as to enhance the detection accuracy. In object detection tasks, features of different scales have different importance for targets of different sizes and shapes.