To detect quickly and accurately “Yuluxiang” pear fruits in non-structural environments, a lightweight YOLO-GEW detection model is proposed to address issues such as similar fruit color to leaves, fruit bagging, and complex environments. This model improves upon YOLOv8s by using GhostNet as its backbone for extracting features of the “Yuluxiang” pears. Additionally, an EMA attention mechanism was added before fusing each feature in the neck section to make the model focus more on the target information of “Yuluxiang” pear fruits, thereby improving target recognition ability and localization accuracy. Furthermore, the CIoU Loss was replaced with the WIoUv3 Loss as the loss function, which enhances the capability of bounding box fitting and improves model performance without increasing its size. Experimental results demonstrated that the enhanced YOLO-GEW achieves an F1 score of 84.47% and an AP of 88.83%, while only occupying 65.50% of the size of YOLOv8s. Compared to lightweight algorithms such as YOLOv8s, YOLOv7-Tiny, YOLOv6s, YOLOv5s, YOLOv4-Tiny, and YOLOv3-Tiny; there are improvements in AP by 2.32%, 1.51%, 2.95%, 2.06%, 2.92%, and 5.38% respectively. This improved model can efficiently detect “Yuluxiang” pears in non-structural environments in real-time and provides a theoretical basis for recognition systems used by picking robots.
The intelligent detection of young peaches is the main technology of fruit-thinning robots, which is crucial for enhancing peach fruit quality and reducing labor costs. This study presents the lightweight YOLO-PEM model based on YOLOv8s to achieve high-precision and automatic detection of young “Okubo” peaches. Firstly, the C2f_P module was devised by partial convolution (PConv), replacing all C2f modules in YOLOv8s to achieve the model’s lightweight. Secondly, embedding the efficient multi-scale attention (EMA) module in the lightweight C2f_P_1 module of the backbone network enhanced the feature extraction capability and accuracy for young peaches. Finally, the MPDIoU loss function was utilized to replace the original CIoU loss function, which improved the detection accuracy of the bounding box while speeding up the convergence of the model. The experimental results demonstrate that the YOLO-PEM model achieved an average precision (AP) of 90.86%, F1 score of 86.70%, and model size of 16.1 MB, which was a 1.85% improvement in the AP, 0.85% improvement in the F1 score, and 5.3 MB reduction in the model size compared with YOLOv8s. The AP was 6.26%, 6.01%, 2.05%, 2.12%, and 1.87% higher compared with the other lightweight detection models YOLOv3-tiny, YOLOv4-tiny, YOLOv5s, YOLOv6s, and YOLOv7-tiny, respectively. Furthermore, the FPS of YOLO-PEM was 196.2 f·s-1, which can fulfill the demand for the real-time detection of young peaches. YOLO-PEM effectively detects young peaches in complex orchard environments and can offer a basis for the theoretical design of the vision system of the “Okubo” peach fruit-thinning robot and scientific management of orchards.