基于改进Yolov5s的果园苹果检测算法OA
Orchard Apple Detection Algorithm Based on Improved YOLOv5s
目的 针对果园环境下现有苹果检测识别精度低以及模型参数量大、计算量高的问题,提出一种基于Yolov5s的改进型果园苹果检测算法.方法 首先在YOLOv5s算法中使用Soft_NMS替换模型原有的NMS,改变原模型对预测框的处理方式,从而减少果园环境下苹果遮挡重叠带来的错检、漏检情况,提升检测精度;然后再使用OTA优化原模型的标签分配方式,将标签分配看作最优传输问题,并完整利用上下文信息减少模糊框的数量,更好地处理苹果密集遮挡的问题,进一步提高模型对果园苹果的检测性能;最后使用FasterNet块替换主干网络中的卷积模块作为新的特征提取网络,降低模型的参数量和计算量,从而实现模型的轻量化.结果 实验结果显示:在果园苹果数据集上,改进的算法模型相对于原模型,mAP提升了 2.8%,参数量和计算量分别下降了 21%和29%,与其他同系列主流检测模型相比,改进模型具有更高的检测精度,更低的参数量和计算量.结论 改进的模型更适合果园场景下的苹果检测,并可作为一种解决方案来参考并应用于相关领域.
Objective To address the problems of low detection accuracy,high model parameter count,and high computational cost in existing apple detection in orchard environments,an improved orchard apple detection algorithm based on YOLOv5s is proposed.Methods First,Soft-NMS was used in the YOLOv5s algorithm to replace the original NMS of the model,and the way the original model processed prediction boxes was changed,so as to reduce false detections and missed detections caused by the overlapping and occlusion of apples in the orchard environment and improve the detection accuracy.Then,OTA was used to optimize the label assignment of the original model.The label assignment was regarded as an optimal transport problem,and the context information was fully utilized to reduce the number of ambiguous boxes so as to better handle the problem of dense apple occlusion and further improve the model's detection performance for orchard apples.Finally,the convolution module in the backbone network was replaced with FasterNet blocks,which served as a new feature extraction network.This replacement reduced the parameter count and the computational cost of the model,thereby achieving a lightweight model.Results The experimental results showed that on the orchard apple dataset,compared with the original model,the mAP of the improved algorithm model increased by 2.8%,and the parameter count and the computational cost decreased by 21%and 29%,respectively.Compared with other mainstream detection models in the same series,the improved model had higher detection accuracy,fewer parameters,and lower computational cost.Conclusion The improved model is more suitable for apple detection in orchard scenarios and can be used as a solution for reference and application in related fields.
王彦辉;汪军
安徽工程大学计算机与信息学院,安徽芜湖 241000安徽工程大学计算机与信息学院,安徽芜湖 241000
农业科技
苹果识别YOLOv5s非极大值抑制算法最优传输分配FasterNet
apple recognitionYOLOv5snon-maximum suppression algorithmoptimal transport assignmentFasterNet
《重庆工商大学学报(自然科学版)》 2026 (4)
52-58,7
评论