# USD-YOLO: An Enhanced YOLO Algorithm for Small Object Detection in Unmanned Systems Perception
## 3 Methodology  
### Anchor-Free Precision Enhancer  
IoU is a metric used to calculate the ratio of the intersection to the union between a candidate box and a target box in YOLO [27]. Its mathematical expression is given in Equation (1), with \(A\) and \(B\) representing the areas of two detection boxes. A higher IoU value indicates greater overlap between the two boxes. However, IoU only measures area overlap between the predicted and target boxes without considering factors such as the distance between their centers or size differences. \[IoU=\frac{A\cap B}{A\cup B} \tag{1}\]  
\[s_{i}= \begin{cases}s_{i},\ \ \text{IoU}(\mathcal{M},b_{i})<N_{t}\\ 0,\ \ \ \text{IoU}(\mathcal{M},b_{i})\geqslant N_{t}\end{cases}  \tag{2}\]  
NMS is a post-processing technique in YOLO that filters and retains candidate boxes with higher confidence scores based on IoU values while eliminating those that overlap significantly with the retained boxes but have lower confidence scores [28]. In Equation (2), \(\mathcal{M}\) and \(b_{i}\) represent the candidate box with the highest confidence score and the current candidate box, respectively. Candidate boxes with IoU values exceeding the threshold \(N_{t}\) have their scores set to 0 and are subsequently removed, while those with IoU values below \(N_{t}\) retain their scores \(s_{i}\). However, NMS applies a fixed threshold \(N_{t}\), which is not suitable for all scenarios. In real-world object detection scenarios, densely distributed small objects can lead to high overlap and high IoU values, causing important candidate boxes to be mistakenly removed due to occlusion. Conversely, increasing the threshold \(N_{t}\) may result in a large number of false detections in some cases. Soft-NMS extends NMS by introducing a penalty decay mechanism, incorporating a Gaussian decay function to mitigate threshold-related issues and reduce false removals or false detections [29]. However, since IoU only measures area overlap without accounting for distance or scale relationships between target boxes, Soft-NMS, which relies on IoU calculations, may still lead to false removals or false detections in certain cases. To address the limitations of NMS and IoU, we designed the APE module. APE integrates EIoU for more precise IoU calculations and enhances Soft-NMS to improve detection performance for high-density small objects. EIoU is an advanced IoU calculation method that incorporates additional factors [30]. It optimizes IoU calculation by considering three additional aspects: center distance loss, the size difference between boxes A and B, and the size of the minimum enclosing box. This leads to more accurate IoU calculations for target detection boxes. The mathematical expression of EIoU is given in Equation (3), where \(\rho(a,b)=\|a-b\|\) represents the Euclidean distance, and the remaining parameters are illustrated in Figure 2.  
\[EIoU=IoU-\frac{\rho^{2}(b,b^{gt})}{\omega_{c}^{2}+h_{c}^{2}}-\frac{\rho^{2}(w, w^{gt})}{\omega_{c}^{2}}-\frac{\rho^{2}(h,h^{gt})}{h_{c}^{2}} \tag{3}\]  
Algorithm 1 presents the complete flowchart of the APE method. The algorithm first initializes an empty set \(\mathcal{D}\) to store the final detection boxes. While the candidate box set \(\mathcal{B}\) is not empty, the box \(\mathcal{M}\) with the highest score in \(\mathcal{S}\) is selected and added to \(\mathcal{D}\). The mathematical expression of \(s_{i}\) in \(\mathcal{S}\) is given in Equation (4). Next, for each remaining box in \(\mathcal{B}\), its score is dynamically adjusted based on its EIoU value with \(\mathcal{M}\) rather than being directly removed. Finally, the algorithm returns the filtered detection box set \(\mathcal{D}\) and the updated scores \(\mathcal{S}\). By incorporating a Gaussian decay function, APE minimizes false removals while improving the screening and localization accuracy of candidate boxes.