## 2 Materials and Methods
### YOLOv5 Object Detection Framework  
The principle of YOLO is to divide the input image tensor into N * N cell grids [18]. If the center of the target is in a grid cell, select that grid cell as the predicted bounding box. Figure 2 shows the architecture of the YOLOv5 detector. The network consists of three parts: the backbone network, the neck network, and the head network. The backbone network is used for feature extraction of input tensors. The neck network is used for collecting multi-scale features and fed to the head. A YOLOv3 [20] detect head used for output multi-scale object detection information in a one-hot form with location and classification information. Figure 3 shows the structure of the constituent unit: CONV units, C3 units, and an SPP unit. CONV unit performs 2D convolution, batch normalization, and Sigmoid-weighted Linear Unit (SiLU) activation in sequence. SiLU is a special case of the swish function which performs nonlinear smoothing on the ReLU function [34; 35]. SiLU is defined as the following equation [35]:  
\[S(x)=x\cdot\sigma(x)\text{, where }\sigma(t)=(1+\exp(-t))^{-1} \tag{1}\]  
Figure 2: The network architecture of the YOLOv5 detector. Modules with different colors represent different structures, the details are shown in Figure 3.  
The C3 is a Cross Stage Partial (CSP) module, it divides the input tensor into two compute branches, after the calculation, the two branches connect and operate a CONV unit. Two types of C3 units are used in YOLOv5, as shown in Figure 3, the blue C3 unit shows the C3 unit with residual structure applied to the backbone network, and Resunit [36] is a residual structure that avoids depth computation degradation issues in the process; the green C3 unit with no residual structure was used for Neck, and the Resunit was replaced with the CONV unit. Figure 4 shows the Spatial Pyramid Pooling (SPP) module [37]; it concatenates different scale receptive fields to adapt to multi-scale targets. For binary classification problems, the design of the loss function should consider bounding box loss and object confidence loss synchronously. The object confidence loss  
Figure 4: Structural details of the SPP unit. Figure 3: Structural details of the C3 and the CONV units. The blue C3 module contains the Shortcut structure, the green C3 module does not contain the Shortcut structure. is used to reflect the confidence probability that the bounding box contains an object. The confidence prediction is closer to 1, the more likely it is that the center of the object is within this bounding box. _Object Confidence_ is defined as follows [21]:  
\[ObjectConfidence=Probability(Object)*IOU_{p}^{GT} \tag{2}\]  
The \(IOU_{p}^{GT}\) indices measure the relevance correlation between prediction bounding box and ground truth boundingbox, \(IOU_{p}^{GT}\) defined as the following equation:  
\[IOU_{P}^{GT}=\frac{B_{P}\cap B_{GT}}{B_{P}\cup  
The basic unit of language information is a word, but a picture is composed of pixels. If a method similar to NLP is used to arrange the pixels into a queue for input, the input dimension has far exceeded the sequence length that the Transformer could carry; therefore, based on this problem, the Vision Transformer proposes a strategy to block the image, that is, the original image is divided into small patches and encoded in blocks. Figure 5 shows a block composition of VisionTransofomer. The input tensor first passes through Layer Normalization, then passes through a Multi-Head Attention, passes through a residual connection, then passes through Layer Normalization, and finally obtains the output through an MLP and residual connection. Dimensions remain unchanged. A vision transformer encoder contains two stages with residual connections. One is a multi-head attention layer, and the other is a fully connected MLP layer. The transformer encoder block adds the ability to focus on the current pixel and acquire the semantics of the context.