## 3 Methodology
### DFL-SloU Loss Function  
Dense pedestrian detection constitutes a single-category detection task, where the network's localization capability should be particularly strengthened during the classification and localization stages. Therefore, we employed a combined regression loss consisting of distributed focal loss (DFL) [36] and an improved CIoU [37] to enhance model convergence and achieve superior bounding box prediction performance. DFL uses the distances from a point to the four edges of the bounding box as regression targets. Since real targets typically distribute near annotation positions, DFL explicitly increases the probabilities of the two nearest anchor points \(y_{i}\) and \(y_{i+1}\) (where \(y_{i}\leq y\leq y_{i+1}\)) to the ground truth label \(y\), enabling the network to rapidly converge to values near the true label \(y\). The mathematical definition of DFL is expressed as:  
\[\text{DFL}(\text{S}_{i},\text{S}_{i+1})=-\big{(}\big{(}y_{i+1}-y_{i}\big{)} \text{log}(\text{S}_{i})+-(y-y_{i})\text{log}\left(\text{S}_{i+1}\right)) \tag{10}\]  
where \(\text{S}_{i}=\frac{y_{i+1}-y}{y_{i+1}-y_{i}}\), and \(\text{S}_{i+1}=\frac{y-y_{i}}{y_{i+1}-y_{i}}\) can guarantee the estimated return target \(\hat{y}\) wireless close tag \(y\). While DFL calculates loss by regressing anchor boxes toward annotated boxes, it cannot explicitly determine the containment relationship between anchors and ground truth boxes. To address this limitation, we introduced an enhanced CIoU loss to compute overlap loss between ground truth and anchor boxes, combining it with DFL to form the final bounding box regression loss. The formal definition of CIoU is presented in Equations (11)-(13):  
\[\text{CIOU}=1-\text{IOU}+\frac{\rho^{2}\big{(}\text{b},\text{b}_{\text{gt}} \big{)}}{\text{C}^{2}}+\text{av} \tag{11}\]  
\[v=\frac{4}{\pi^{2}}\bigg{(}arctan\frac{w_{gt}}{h_{gt}}-arctan\frac{w}{h} \bigg{)}^{2} \tag{12}\]  
\[a=\frac{v}{(1-\text{IoU})+v} \tag{13}\]  
where IoU denotes the intersection-over-union ratio and b and b\({}_{\text{gt}}\) represent the center points of the predicted box and ground truth box, respectively. Additionally, \(\rho\) indicates the Euclidean distance between these centers, C denotes the diagonal length of the minimum bounding rectangle enclosing both boxes, and w and wgt correspond to the width and height of the predicted box and ground truth box, respectively. Our analysis reveals two critical issues in the current formulation. In Equation (12), v only reflects the difference in aspect ratios rather than capturing the actual proportional relationships between predicted/ground truth widths (w and wgt) or heights (h and hgt). The partial derivatives exhibit contradictory behavior: \(\frac{\partial\
u}{\partial w}=-\frac{\mathrm{h}}{\mathrm{w}}\frac{\partial\
u} {\partial\mathrm{h}}\). Consequently, if one variable (either w or h) increases, the other decreases. This unstable gradient behavior may lead to gradient explosion, particularly when detecting small-scale targets. Therefore, the CIoU loss may optimize similarity in an irrational manner, hindering the model from effectively reducing the actual discrepancies between w, h, and wgt, hgt. To address these two limitations, this paper proposes a more stable loss function named SloU, formally defined in Equations (14) and (15):  
\[\mathrm{SIoU}=1-\mathrm{IOU}+\frac{\rho^{2}\big{(}\mathrm{b},\mathrm{bgt} \big{)}}{\mathrm{C}^{2}}+\frac{\rho^{2}\big{(}\mathrm{w},\mathrm{wgt}\big{)}} {\mathrm{C}^{2}_{\mathrm{w}}}+\frac{\rho^{2}\big{(}\mathrm{h},\mathrm{hgt} \big{)}}{\mathrm{C}^{2}_{\mathrm{h}}}+\gamma \tag{14}\]  
\[\gamma=\frac{(\mathrm{e}^{-\mathrm{w}g}-\mathrm{e}^{-\mathrm{w}})^{2}+( \mathrm{e}^{-\mathrm{h}gt}-\mathrm{e}^{-\mathrm{h}})^{2}}{2}+\varepsilon \tag{15}\]  
where Cw and Ch represent the width and height of the minimum enclosing rectangle covering both the predicted and ground truth bounding boxes, \(\varepsilon\) is an offset added to prevent the case where \(\gamma\) = 0, and other parameters retain the same definitions as in CIoU.