## 2 Materials and Methods
### Distance IoU Loss Function  
When using object detection algorithms, the precise positioning of the target bounding box is undoubtedly one of the core metrics for measuring algorithm performance. It is crucial to select an appropriate loss function for optimizing and ranking the position of bounding boxes, as different loss functions have their own advantages in calculation  
\begin{table}
\begin{tabular}{c c c c c} \hline \hline
**Model** & **Precision (\%)** & **Recall (\%)** & **[EMAIL_ADDRESS] (\%)** & **[EMAIL_ADDRESS] (\%)** \\ \hline CA & 91.1 & 87.1 & 93.7 & 69.8 \\ CBAM & 91.8 & 88.0 & 94.1 & 70.1 \\ EMA & 89.9 & 87.4 & 93.9 & 68.2 \\ GAM & 87.8 & 88.1 & 93.6 & 69.1 \\ SE & 92.9 & 88.8 & 94.1 & 70.7 \\ \hline \hline \end{tabular}
\end{table}
Table 2: Comparison results of attention mechanisms.  
Figure 3: The algorithm flowchart for the SE (Squeeze-and-Excitation) attention mechanism.  
methods and are directly related to the accuracy of the model's prediction of the target bounding box. YOLOv8, as an advanced object detection model, initially adopted CIOU (Complete Intersection over Union) as its core loss function, aiming to improve detection accuracy through more refined and complex computational logic. CIOU not only considers the degree of overlap between bounding boxes but also introduces various factors such as center point distance and aspect ratio consistency to achieve more accurate matching results. However, in the process of in-depth analysis and experimentation, we noticed that the aspect ratio penalty mechanism in CIOU did not significantly affect the selection accuracy of target bounding boxes as expected for specific datasets. This discovery suggests that, for certain specific application scenarios or datasets, the complex computational mechanism of CIOU may not be necessary and may instead increase the computational burden of the model due to overfitting or redundant calculations, affecting detection efficiency. In view of this, this article proposes adjusting the loss function from CIOU to DIOU (Distance IoU Loss). This change is based on the following considerations:  
Simplify calculations and improve efficiency: DIOU retains only the key parts of CIOU regarding the distance between the center points of the bounding boxes and the overlapping area, removing complex calculations such as aspect ratio penalties, thereby significantly reducing the computational complexity of the model and helping to improve detection speed.  
Maintaining accuracy advantage: Despite removing aspect ratio penalties, DIOU can still maintain good detection accuracy on most datasets, especially in scenarios where aspect ratio changes have little impact on detection results, where its performance is particularly outstanding.  
Stronger adaptability: By simplifying the loss function, the SDCB-YOLO model demonstrates stronger adaptability and flexibility, making it easier to cater to the needs of different datasets and detection tasks, providing more possibilities for practical applications.  
In summary, by modifying the loss function from CIOU to DIOU, the SDCB-YOLO model not only simplifies the calculation process and improves detection efficiency but also maintains good detection accuracy.  
DIOU minimizes the relative position of the center points of two BBox frames [20]. DIOU is calculated according to Equation (1).  
\[L_{DIOU}=1-IOU+\frac{\rho^{2}\big{(}b,b^{st}\big{)}}{C^{2}} \tag{1}\]  
\"b\" and \"bst\" represent the center positions of the two bounding boxes, respectively; \"\(\rho\) (\") is the function used to calculate the distance; and \"C\" represents the smallest rectangular box that encloses both bounding boxes. The modified model achieves improved lightweight performance without compromising detection accuracy.