Abstract
To improve the intelligent detection accuracy of 'Yuluxiang' pear fruit under different cultivation modes, a lightweight detection method, YOLO-iBPD, based on YOLOv8n, was proposed in this study to address problems such as poor fruit positioning accuracy, missed detection and false detection. Firstly, the C2f module in the backbone network is replaced with a more efficient C2fi module to enhance the model's feature extraction and expression capabilities. Secondly, the optimized Bi-directional Feature Pyramid Network (BiFPN) is introduced into the neck network to improve the detection ability of targets at different scales. Then, change the bounding box loss function to PIoUv2 to enhance focus on fruit information. Finally, knowledge distillation is employed to further improve the model's generalization ability and precision. In this study, a total of 4234 images were collected as the 'Yuluxiang' pear dataset, which 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 were increased by 0.13 and 0.25 percentage points, respectively, and the model size was reduced by 0.69 MB. The ablation test verified the effectiveness of different strategies in the detection of 'Yuluxiang' pear. Yolov8n-ibp reached 88.60% and 92.89% on F1 and AP, respectively. Compared with YOLOv8n, the Localization error (Loc), Background Error (Bkg) and Missed ground truth error (Miss) rates decreased by 0.1, 0.36 and 0.17, respectively. The size of the YOLO-iBPD model obtained by knowledge distillation was 3.34 MB, the inference time was 1.4 ms, the AP was 93.32%. The values of Loc, Bkg, and Miss were 1.22, 2.78, and 1.04, respectively. The size of the improved model was reduced to 56.04 percentage point of YOLOv8n. Inference time was 0.3 ms faster, AP was increased by 1.07 percentage point, Loc, Bkg and Miss were reduced by 0.32, 0.52 and 0.17 respectively. In High stem open-centre pear tree-Daytime (HPD), Double-armed parallel pear tree-Daytime (DPD), High stem open-centre pear tree-Nighttime (HPN) and Double-armed parallel pear tree-Nighttime (DPN) scenarios, the AP of YOLO-iBPD was 2.57, 1.06, 0.13 and 0.13 percentage points higher than that of YOLOv8n, respectively. The AP of YOLO-iBPD during the daytime and nighttime was 1.87 and 0.1 percentage points higher than that of YOLOv8n, respectively. Comparing the detection effect of different cultivation modes, the AP of YOLO-iBPD in High stem open-centre pear tree (HP) and Double-armed parallel pear tree (DP) modes were increased by 1.53 and 0.6 percentage points respectively. Compared with the mainstream lightweight models, YOLOv3-Tiny, YOLOv4-Tiny, YOLOv5n, YOLOv7-Tiny, YOLOv9s, YOLOv10s and YOLOv11n, The AP of YOLO-iBPD was improved by 3.08, 0.57, 1.14, 1.69, 0.06, 1.28 and 1.49 percentage points, respectively. On the basis of lightweight model, this study improved the detection accuracy of 'Yuluxiang' pear fruit, and showed good stability and robustness under different cultivation modes and lighting conditions, and realized the real-time intelligent detection of 'Yuluxiang' pear fruit. This provides a theoretical basis for the accurate positioning and efficient picking of the picking robot, and promotes the intelligent and refined development of orchard management.