## 2 Algorithm Improvement  
### YOLOv4 Target Detection Algorithm  
The current target detection methods can be roughly divided into two categories: one stage detection method and two stage detection method. The two stage targets detection method is represented by RCNN series models. RCNN series models first extract the proposal with the selective search method, then extract the feature with CNN, and finally train the classifier with SVM to complete the targets detection task. YOLO (You Only Look Once) is a proposal-free regression method [20]. YOLO removes the region proposal module, can directly predict whether each grid contains targets and the probability of including targets from the feature map. YOLO extracts the proposal and targets recognition  
Figure 1: Schematic diagram of article content structure.  
by sharing convolution features. The region proposal is constrained by using the grid. A faster training and testing speed can be obtained by avoiding repeatedly extracting proposals in some areas. On the premise that the ground truth is known in the training process, the regression equation from characteristic map to parameters such as coordinates and confidence can be established by YOLO. The model fitting curve can finally be obtained by learning the parameters of the regression equation through a lot of training. The annotation, confidence, and category probability calculation of the end-to-end bounding boxes of the targets can be completed only by inputting the picture once [21]. YOLO has high recognition efficiency and is widely used in real-time detection. The predicted value of YOLO can be represented by five elements (\(x\), \(y\), \(w\), \(h\), \(C\)). Where (\(x\), \(y\)) is the center coordinate position of the bounding boxes, \(w\) and \(h\) are the width and height of the bounding boxes, and \(C\) is the confidence level of the bounding boxes. In YOLO's classification task, each cell must also give the conditional probability value \(C\) (\(C\in R^{+}\)) [22]. The conditional class probability of each grid is multiplied in the network test by the confidence of each bounding box. The specific class confidence scores of each bounding box can be obtained. The calculation method is described as follows.  
\[\Pr(Class_{i}|Object)*\Pr(Object)*IOU_{pred}^{truth}=\Pr(Class_{i})* IOU_{pred}^{truth} \tag{1}\]  
where \(IOU_{pred}^{truth}\) is the ratio of the intersection and union of predictor with the actual bounding boxes in the computer detection task. \(\Pr(Class_{i}|Object)\) represents the probability that the current cell has an object and belongs to class \(i\). \(\Pr(Object)\) indicates the probability of the targets containing in the grid. \(\Pr(Class_{i})\) represents the probability that the target in the grid is class \(i\).  
The conditional class probability is predicted for each bounding box. We know that YOLOv4 is obtained through a series of enhancements and improvements of YOLOv3. The main contents are presented as follows.  
1. Upgrading the original backbone feature extraction network Darknet-53 to CSPDarknet-53;
2. Enhancing the effect of feature extraction network, using the SPP and PANet structure;
3. Utilizing the Mosaic function to complete the data enhancement;
4. Using CIOU as return LOSS;
5. Using Mish function as the activation function of the network.  
The YOLOv4 network structure diagram is shown in Figure 2. The YOLOv4 network structure mainly includes the backbone feature extraction network (CSPDarknet53), the spatial pyramid pooling structure (SPP), and the path aggregation network (PANet).