# Research on Multi-Modal Pedestrian Detection and Tracking Algorithm Based on Deep Learning
## 3 Prediction Layer  
### Prediction Layer Design  
In this paper, the YOLOv4 algorithm serves as the backbone of the proposed pedestrian detection framework. It partitions the input feature map into a grid of S \(\times\) S at different scales, with each grid responsible for generating B bounding boxes. These bounding boxes are constrained by anchor boxes, which encode the geometric characteristics of the predicted targets, thus expediting the convergence rate of the prediction module and enhancing detection accuracy.  
Consequently, the primary role of the prediction layer is to regress B bounding box parameters for each grid on the feature map. These parameters include the coordinates (\(t_{yx}\)) of the center point relative to the upper-left corner, as well as the width (\(t_{w}\)) and height (\(t_{h}\)) parameters of the bounding box. Additionally, the prediction layer is tasked with  
Figure 5: Improved PANet multi-scale feature fusion network based on FPN.  
Figure 6: CSP-SPPNet module (CBL—the smallest component within the YOLOv3 network architecture, comprises three components: convolution (Conv), batch normalization (BN), and the leaky ReLU activation function).  
outputting confidence scores (conf) indicating the likelihood of a bounding box containing the target, along with scores for various target classes [c\({}_{1}\), c\({}_{2}\),..., c\({}_{n}\)].  
Therefore, the prediction layer generates vectors of size B \(\times\) (4 + 1 + num_classes) for each grid, resulting in an S \(\times\) S \(\times\) B \(\times\) (4 + 1 + num_classes) matrix for the entire input feature map. The process of the prediction layer is illustrated in Figure 7 below.  
To obtain the relative center position and width and height values of the bounding box in the entire input image, the following formula is also needed to achieve the correct mapping [11]. The process is completed by the YOLO layer after the prediction layer. When using the Sigmoid activation function in the YOLO layer to the regression bounding box, the values of \(t_{x}\) and \(t_{y}\) can be kept between [0, 1], which can effectively ensure that the target center is in the center of the grid unit performing the prediction and prevent the occurrence of deviation.  
In addition, the confidence and category score in the prediction vector corresponding to the output of each grid anchor box are also noteworthy parameters when detecting the output of the YOLOv4 algorithm based on this paper. For confidence, on the one hand, it indicates whether there is a prospect target in the current prediction box [12]. On the other hand, it also reflects the overlap degree between the predicted target boundary box and the marked real boundary box, that is, IoU. Therefore, the expected calculation expression of confidence is as follows:  
\[C_{i}^{j}=P_{r}(object)\times IoU_{pred}^{truth} \tag{1}\]  
In the formula, \(C_{i}^{j}\) is the JTH predicted boundary box confidence for the \(i\)-th grid, \(P_{r}(object)\) predicts the probability of the existence of an object in the bounding box, and \(IoU_{pred}^{truth}\) is the intersection ratio between the predicted boundary box and the marked actual boundary box.