Lightweight Grape Object Detection Fusion Algorithm Based on Improved YOLOv5s
A lightweight grape target detection network YM-GDM(YOLOv5s-MobileNetV3 grape detection model)was proposed to meet the requirements of accuracy,real-time performance,and lightweight of target detection models for agricultural automatic harvesting machinery.MobileNetV3 was employed as the backbone network instead of CSPDarknet53 in YOLOv5s to achieve model lightweighting.The introduction of Res2Net_C2f module and BiFPN(Bi-directional feature pyramid network)structure aimed to enhance the model's multi-scale feature fusion capability.Additionally,the VariFocalLoss loss function was adopted to train the model,mitigating the impact of imbalanced positive and negative samples.The self-made data set containing five types of table grapes and the open data set(WGISD)containing five types of wine grapes were used as test data sets.The experimental results showed that the YM-GDM network achieved a mAP50 of 90.8%for the detection of 10 grape classes.Compared to YOLOv3-tiny,and YOLOv5s,it improved by 6.2,and 2.2 percentage points respectively.The model size was 9.73 MB,which was reduced by 44.4%and 32.8%compared to YOLOv3-tiny and YOLOv5s,respectively.Furthermore,by further reducing the number of parameters,a lightweight specialized model,YM-GDM-tiny,was obtained with a model size of 4.73 MB and a mAP50 of 86.8%,suitable for deployment on mobile devices with lower computing power.