## 3 Materials and Methods
### Model Improvement
#### 3.4.3 Improvement of the Loss Function  
The CIOU (Complete IoU) [16] loss function used in the original YOLO11, although it takes into account the centroid distance, overlap area, and aspect ratio, still has some limitations in high-quality prediction frame optimization and is especially prone to unstable convergence and frame regression bias when detecting dense targets. The introduction of Unified-IoU (UIoU) [17] loss function can effectively solve these problems. UIoU adopts a dynamic weight adjustment mechanism in order to balance the contradiction between model attention and convergence speed; a dynamic hyperparameter \"ratio\" is designed to adjust the scaling ratio of the bounding box. Specifically, convergence is accelerated by expanding the bounding box at the beginning of training, which is equivalent to reducing the IoU loss of high-quality prediction frames and allowing the model to focus on low-quality anchor frames (ratio > 1). During the training process, the \"ratio\" gradually decreases, and the model's attention is gradually shifted to high-quality prediction frames. In the later stages of training, the final detection accuracy is improved by shrinking the bounding box, which corresponds to increasing the IoU loss of the high-quality prediction frames, thus focusing the model's attention on the high-quality anchor frames (ratio < 1). The value of \"ratio\" is related to the current training rounds, and the initial value of the hyperparameter \"ratio\" is set to 2 in order to reach a certain accuracy as soon as possible at the beginning of training, and the end value of \"ratio\" is set to 0.5 in order to focus more on high-quality prediction frames at the later stage of training to improve the final quality of object detection. The initial value of the hyperparameter \"ratio\" is set to 2 in order to reach a certain accuracy as soon as possible at the beginning of training, and the end value of \"ratio\" is set to 0.5 in order to pay more attention to the high-quality prediction frames at the later stage of training, so as to improve the final quality of object detection. For the formulated three hyper-parameter \"ratio\" reduction modes, their relationship with the training round epoch is as follows.  
Linear descent strategy:  
\[\text{ratio}=-0.005\times\text{epoch}+2. \tag{1}\]  
Cosine descent strategy:  
\[\text{ratio}=0.75\times\text{cos}\bigg{(}\frac{\pi\times\text{epoch}}{300} \bigg{)}+1.25. \tag{2}\]  
Figure 9: GSConv structure diagram.  
Score descent strategy:  
\[\text{ratio}=\frac{200}{\text{epoch}+100}. \tag{3}\]  
For the field came detection task, this mechanism can help the model to fit the target boundary more accurately and perform target localization more robustly, even in the face of complex backgrounds or partially occluded canes. In addition, UIoU introduces a dual-attention mechanism, which enables the model to adaptively adjust its attention to different target scales during the optimization process. It especially performs better when dealing with small-scale targets. Compared with CIOU, Unified-IoU can also reduce the jitter phenomenon of frame regression, improve the stability of the prediction frame, avoid detection errors caused by inaccurate bounding box regression, which can better adapt to the complex environment in the field, improve the accuracy and robustness of the target detection in the overall area of the sugarcane tail tip, and optimize the detection performance, especially under high IoU thresholds, so that its performance in the real application scenario is more reliable. The diagram of the improved Slim-YOLO model is shown in Figure 10. The part labeled in the red box in the figure is the improved part.