Abstract:
High accuracy of intelligent detection can often be required under different cultivation modes. In this study, a lightweight improved YOLOv8n (YOLO-iBPD) was proposed for the fruit positioning, in order to reduce the missed and false detection. The experimental material was taken as the 'Yuluxiang' pear. Firstly, the C2f module in the backbone network was replaced with the more efficient C2fi module, in order to enhance the feature extraction and expression of the improved model. Secondly, the Bi-directional Feature Pyramid Network (BiFPN) was optimized and then introduced into the neck network to improve the detection of targets at different scales. Then, the bounding box loss function was selected as the PIoUv2 to enhance the focus on fruit information. Finally, the knowledge distillation was also employed to further improve the generalization and precision of the improved model. A total of
4234 images were collected as the 'Yuluxiang' pear dataset. Then the dataset was divided into
2965 training sets, 846 validation sets, and 423 test sets, according to a ratio of 7:2:1. The test results show that the F1 score and average precision (AP) of the C2fi module YOLOv8n-ib in the backbone network increased by 0.13 and 0.25 percentage points, respectively, whereas, the model size was reduced by 0.69 MB. The ablation test was carried out to verify the effectiveness of different strategies during detection. The Yolov8n-iBP model reached 88.60% and 92.89% on the F1 and AP, respectively. The Localization error (Loc), Background Error (Bkg), and Missed ground truth error (Miss) rates decreased by 0.1, 0.36, and 0.17, respectively, compared with the YOLOv8n. Specifically, the size of the YOLO-iBPD model after knowledge distillation was 3.34 MB, the inference time was 1.4 ms, and the AP was 93.32%. The values of Loc, Bkg, and Miss were 1.22, 2.78, and 1.04, respectively. Compared with YOLOv8n,the model size of YOLO-iBPD was only 56.04%, the AP increased by 1.07 percentage points, whereas, the Loc, Bkg, and Miss were reduced by 0.32, 0.52, and 0.17, respectively. Furthermore, the AP values of YOLO-iBPD were 2.57, 1.06, 0.13 and 0.13 percentage points higher than those of YOLOv8n, respectively, in the scenarios of High stem open-center pear tree-Daytime (HPD), Double-armed parallel pear tree-Daytime (DPD), High stem open-center pear tree-Nighttime (HPN) and Double-armed parallel pear tree-Nighttime (DPN). The AP values of YOLO-iBPD during the daytime and nighttime were 1.87 and 0.1 percentage points higher than those of YOLOv8n, respectively. The AP values of YOLO-iBPD in the High-stem open-center pear tree (HP) and Double-armed parallel pear tree (DP) cultivation modes increased by 1.53 and 0.6 percentage points, respectively. The AP values of the YOLO-iBPD were improved by 3.08, 0.57, 1.14, 1.69, 0.06, 1.28 and 1.49 percentage points, respectively, compared with the mainstream lightweight models, such as the YOLOv3-Tiny, YOLOv4-Tiny, YOLOv5n, YOLOv7-Tiny, YOLOv9s, YOLOv10s and YOLOv11n. The lightweight improved model shared high stability and robustness under different cultivation modes and lighting conditions. The real-time, intelligent, and high accuracy was realized in the detection of 'Yuluxiang' pear fruits. This finding can provide a theoretical basis for the accurate positioning and efficient picking of harvesting robots, particularly for intelligent and refined management in orchards.