## 3 Modifications to the Reference Network
### Focaler-CloU Loss Function  
The loss \(L_{CloU}\) of the original network bounding box of YOLOv8 is calculated using the CIoU (complete intersection over union loss) formula, as shown in Equations (3) to (5).  
\[L_{CIoU}=1-IOU+\frac{\rho(b,b^{\delta})}{c^{2}}+\alpha v \tag{3}\]  
\[\alpha=\frac{v}{(1-IOU)+v} \tag{4}\]  
\[v=\frac{4}{\pi^{2}}(\arctan\frac{w\delta}{h^{\delta}}-\arctan\frac{w}{h})^{2} \tag{5}\]  
Here, \(v\) is a measure of the consistency of the aspect ratio of the predicted box and the true box, and \(\alpha\) is a weight function that depends on the difference in the aspect ratio of the predicted box and the true box. \(w\)s and \(h\)s are the width and height of the true box, respectively. In the detection of small blueberry objects, due to the small size of the object, the CIoU loss function cannot accurately reflect the actual situation, resulting in unsatisfactory optimization results. The scale of objects varies greatly, especially for small-object detection, which strongly depends on the camera view and distance. CIoU has limited performance in dealing with an uneven sample distribution and is prone to overfitting for easy-to-classify samples while ignoring difficult-to-classify samples. In complex tasks, the convergence speed of CIoU is still slow, and it does not dynamically adjust sample features, resulting in an overall unbalanced performance and certain limitations.  
To address these issues, we combine the CIoU loss function with the Focaler-IoU loss and introduce Focaler-CloU. This strengthens the bounding box regression by focusing on the sample distribution to solve the problem of sample imbalance. Our method reconstructs the IoU in the loss function, making the model more focused on positive samples that are difficult to classify, thereby improving detection accuracy. The formula for LFocaler-CIoU is shown in (6) to (7).  
\[IOU^{focaler}=\left\{\begin{array}{ll}0,&IoU\;<\;d\\ \frac{IoU-d}{u-d}&d\;\leq\;IoU\;\leq\;u\\ 1&IoU>\;u\end{array}\right. \tag{6}\]  
\[L_{Focaler-CIoU}=L_{CIoU}+IOU-IoU^{focaler} \tag{7}\]  
Figure 4: FASFF detection head structure.  
\(L_{Focalar\text{-}CloU}\) is the improved loss, and \(d\) and \(u\) are the lower and upper thresholds, respectively, where \(d\), \(u\in[0,\,1]\). Focaler-CloU optimizes the loss function by using the intersection over union (IoU) value, thereby increasing the model's sensitivity to samples with medium overlap, enabling it to learn the features of these samples more effectively. By adjusting the thresholds, the IoU can focus on different regression samples rather than just the simplest or most difficult ones, as shown in Figure 5. Figure 5(a,b) show the linear mapping curves of Focaler-CIoU for difficult samples and simple samples, respectively. A loss function designed in this way can effectively distinguish samples with different IoU values, allowing the model to learn more selectively. Specifically, samples with an extremely low IoU will be ignored to prevent the model from overly focusing on negative samples that are still too difficult to learn. For samples with an IoU in the medium range, the loss function is more sensitive to changes in the IoU, which leads to the model performing better on these samples. For samples with a very high IoU, \(IoU^{\textit{real}}\) is fixed to 1 to avoid over optimization of the model on these already well performing samples, thereby saving computational resources.  
Figure 5: IoU deviation curve.  
Figure 6: Representative examples of the dataset under varying illumination and view conditions.