## 3 Methods
### Object Detection
#### 3.2.1. Heatmap Prediction Distance Difference  
For the input image \(I\in R^{W\times H\times K}\), where \(K=1\), a center point heatmap is generated at the time of prediction, denoted as \(\hat{M}\in[0,1]^{\frac{W}{4}\times\frac{H}{4}\times K}\); 4 denotes 4-fold downsampling. When \(\hat{M}_{x,y,k}=1\), this point is the detection center point, otherwise it belongs to the background. For (ground truth) GT values, the center point is denoted as \(c=\left(c_{x},c_{y}\right)\in R^{2}\). The center point is computed as \(c=\left(\frac{x_{1}+x_{2}}{2},\frac{y_{1}+y_{2}}{2}\right)\), and its downsampled corresponding center point is \(\hat{c}=\left\lfloor\frac{\xi}{4}\right\rfloor\). The image is labeled with \(M\in[0,1]^{\frac{W}{4}\times\frac{H}{4}\times K}\) and the center point is noted as the GT point in the downsampled [128,128] image will be represented in the form of \(M\in[0,1]^{\frac{W}{4}\times\frac{H}{4}\times K}\). The heat map response of GT satisfies a Gaussian distribution:  
\[M_{x,y,k}=\exp\left(-\frac{\left(x-\hat{c}_{x}\right)^{2}+\left(y-\hat{c}_{y }\right)^{2}}{2\sigma_{c}^{2}}\right), \tag{1}\]  
\(\sigma_{c}\) is the standard deviation associated with the target size. The generated Gaussian kernel (target frame size) is placed on the corresponding position of the original image (image size), each point \(M\in[0,1]^{\frac{W}{4}\times\frac{H}{4}\times K}\) ranges from 0-1 and 1 represents the center point of this target. The Heatmap output from the Heatmap head is used to predict the target centroid position. The sizes of the Heatmap are \(1\times H\times W\). If a position of the Heatmap has a value of 1, indicating the coincidence with the target centroid, it is expressed as the GT response value. However, predicting the target center point via heatmap is prone to the situation that the predicted position is shifted and cannot hit the target GT position accurately, as shown in Figure 2. The size of the heat map is 272 \(\times\) 152. Numbers are response values and axes are labeled as coordinate positions in the heatmap. (a) is the true value GT heatmap of the target, the star marking is the target GT position (GT response value is 1); (b) is the predictive heatmap and the circle marking is the position of the highest response value of the predicted target, i.e., the predictive heatmap target position. It can be seen that there is a certain deviation between the predicted position and the GT position. Although this small deviation has a small impact on the detection accuracy, since the Re-ID feature map only sets the learnable feature vectors at the GT position, the small deviation can also lead to the inability to determine the learnable feature position, which affects the Re-ID effect. To solve the problem, this paper defines the distance from the predicted position to the corresponding true position as the distance difference, and constructs the predicted distance  
Figure 2. (a) A True GT heatmap, with the star marking the target GT position (true response value of 1); (b) A Predictive heatmap, with the circle marking the position of the highest response value of the predicted target, i.e., the target Predictive position. There is a bias in the response value. difference loss with the average distance difference of high response values to suppress the magnitude of the predicted response values at non-true positions, so that the predicted position is closer to the true value and further improves the detection accuracy. With the object's true value position as the center, the farther the predicted position with higher response value is from the true value, the greater the loss brought about and the stronger the suppression effect on its response value; on the contrary, the closer the true value position is, the smaller the suppression effect on the high response value, thus bringing the predicted high response value closer to the true value position and realizing the correction of the prediction distance difference.