FEW-YOLO: a lightweight ripe fruit detection algorithm in wolfberry based on improved YOLOv8
摘要
Detecting ripe wolfberry fruits in natural environments is complicated owing to complex growing conditions and uneven illumination caused by fruit aggregation. To tackle this challenge, we proposed FEW-YOLO, a lightweight and efficient detection method in view of an enhanced YOLOv8 architecture tailored for wolfberry fruit recognition. First, the bottleneck module in the original C2F structure was substituted by FasterNet, forming the C2F-F module, which reduced the computational volume of the network and made it more effective in extracting spatial features. Next, to enhance the discriminative capability, the efficient multi-scale attention (EMA) module was integrated after FasterNet, which improved the network’s capacity to extract features from small target objects. Moreover, the dynamic non-monotonic focusing mechanism Wise-IoU loss function was employed to replace the CIoU loss, thereby refining the quality of predicted bounding boxes. The improved YOLOv8 model was subjected to training optimisation, ablation experiments, performance comparisons in training set and validated in 960 testing set images. The evaluation metrics for the enhanced YOLOv8 architecture demonstrated Precision, Recall, and mean Average Precision (mAP) values of 97.36%, 94.04%, and 93.53%, respectively. Meanwhile, the detection time of the model was 18.59 ms, and the size of the model was 8.9 MB. Compared with Faster R-CNN, YOLOv5, YOLOv7, and the original YOLOv8, the mAP was improved by 6.27%, 4.58%, 3.91% and 1.89% respectively, while the detection time was reduced by 20.25%. The proposed model improves small object detection precision and enables reliable real-time identification of wolfberry fruits in complex environments, providing a valuable reference for non-destructive ripeness detection in other foodstuffs.