## 3 Proposed Method
### Loss Function  
The total loss function consists of three parts, which correspond to the three prediction branches of the network. **Center Prediction Loss**  
First of all, for the center prediction branch, we directly transform it into a classification problem, and each pixel is assigned a classification score, so we use the cross-entropy loss commonly used in classification problems. Because the center point often predicted by this branch may not be the actual center point. For example, the predicted center point is the adjacent point of the actual center point, and the effect is still very good. However, it will be directly recognized as a recognition error, which is obviously inappropriate and difficult to train. Thus, we need to use a two-dimensional Gaussian mask besides locating the center point positive and determining other points as negative. Let the points around the center point have a certain weight according to Gaussian distribution. The closer to the center point, the higher the weight, which is advantageous for convergence, makes the training process smoother and predicts the center point easier. This Gaussian mask can be formulated as:  
\[G_{ij}=\max_{k=1,2,...,n}e^{-\frac{(i-x_{k})^{2}}{2x_{k}^{2}}+\frac{(j-y_{k})^ {2}}{2x_{k}^{2}}} \tag{9}\]  
In which \(i\) and \(j\) represent the \(i\)-th row and the \(j\)-th column of the feature map respectively, thus \(i\) and \(j\) represent a single pixel when combined. \(k\) represents the \(k\)-th object in the image, and \(x_{k},y_{k},w_{k},h_{k}\) respectively represent the abscissa, ordinate, width, and height of the center point of the \(k\)-th object. \(\sigma\) represents the Gaussian kernel used to control the range of Gaussian mask. If Gaussian masks overlap, the maximum value is taken as the value of the overlapping part. \(G_{ij}\) represents the Gaussian mask value of the \((i,j)\) point. \[L_{center}=-\frac{1}{k}\sum_{l=1}^{\hat{W}}\sum_{j=1}^{\hat{H}}\alpha_{ij} \big{(}1-\hat{\epsilon}_{ij}\big{)}^{r}\log\big{(}\xi_{ij}\big{)} \tag{10}\]The loss function of the center branch is as shown above. In which, \(\hat{W}=\frac{W}{s}\), \(\hat{H}=\frac{H}{s}\), and \(s\) indicates the scaling factor of the original image compared with the current feature map. Since pedestrian detection is often extremely imbalanced in samples and many negative samples are very similar to positive samples, we refer to the focal loss and give a smaller weight to a large number of samples that are easy to classify but give greater weight to samples that are difficult to classify. The formulas for \(\hat{c}_{ij}\) and \(\alpha_{ij}\) in the above formula are as follows:  
\[\hat{c}_{ij}= \begin{cases}c_{ij}&\text{if}\quad g_{ij}=1\\ 1-c_{ij}&\text{otherwise}\end{cases}  \tag{11}\]  
\[\alpha_{ij}= \begin{cases}1&\text{if}\quad g_{ij}=1\\ (1-G_{ij})^{\beta}&\text{otherwise}\end{cases}  \tag{12}\]  
\(c_{ij}\) represents the probability that the object center point exists at the \((i,j)\) point predicted by the model, with the value ranging from 0 to 1. While \(g_{ij}\) represents the ground truth of the \((i,j)\) point, with the value being 0 or 1. When \(g_{ij}\) is 1, it means that it is the actual object center point, while 0 means the negative point. Among them, \(\beta\) and \(\gamma\) are two hyperparameters, and \(\gamma\) is used to reduce the weight of easily classified samples. Experiments show that the best performance is got when \(\gamma\) is set to 2, \(\beta\) is used to adjust the penalty degree of Gaussian mask, and 4 for \(\beta\) is the best. With the offset prediction branch, the model can learn the offset value between the actual center point and the scaled center point. We use SmoothL1 loss to penalize for ease of training and convergence.