基于改进YOLOv5s的松科球果目标检测与定位
2025-08-03滕弛董希斌宋梓恺张佳旺郭奔张雨晨刘慧高彤
关键词:松科球果;目标检测;目标定位;YOLOv5s算法;双目深度相机 中图分类号:S791.24;TP391.4;TP18 文献标识码:A DOI:10.7525/j.issn.1006-8023.2025.04.015
Abstract:Traditional methods for harvesting pinecone speciesface challenges such as low eficiency,high risks,and uncontrollable costs.To addressreal-time recognition and localization in automated pinecone harvesting,we proposed animproved YOLOv5s-7.0(youonlylookonce)objectdetectionmodeland constructabinoculardepthcamera-based detectionand localization network.To improvetheaccuracyand eficiencyof object detection,theYOLOv5s model was improved byembeddng partial convolutions (PConv)into the neck module's multi-branch stacked structure to enhance sparsefeature processng capability,improve robustness,and reduce feature redundancy incomplex scenarios of pinecones.Aditionally,the simple atention mechanism (SimAM)was integrated at deep backbone layers and backboneneck connections tooptimizethe model’sfeatureextractionabilityand information transmision eficiencyincomplex backgrounds without significantparameter increases.To meet therequirements of efficient detectionand localization,a target detection and real-time localizationcode was developedusing binocular vision principlesand the improved YOLOv5s model,and a pinecone detection and localization system was constructed through depth matching.Based on theconstructed datasetof Pinus sylvestris var.mongolicacones fromthe Greater Khingan Mountains and Pinus koraiensis cones from the Lesser Khingan Mountains,the improved YOLOv5s model achieved a precision of 96.8% ,a recall of 94.0% , and an average precision (AP) of 96. 3% in target detection tasks. The proposed pinecone detection and localization system demonstrated mean absolute errors of ( ).644cm ,0 ⋅620cm ,and 0.740 cm along the x ,y-,and Z -axes, respectively. Under front,side,and backlighting conditions,the localization success rate reached 93.3% ,while in lowlight environments,it maintained a success rate of 83.3% . Other performance indicators,including field of view,meet the operational requirements for pinecone harvesting.The proposed pinecone detection and localization system provides a reliable solution for real-time target detection and localization problems in mechanized pinecone harvesting.
Keywords:Pinecone;target detection;target localization;YOLOv5s algorithm;binocular depth camera
0 引言
松科球果作为一种重要的林业资源,因其在食品、医药和化工领域的广泛应用而备受关注[1]。松科树种属于高大乔木,果实生长于树梢,在天然红松林内树高多为 25~30m ,其球果的采摘主要依赖人工,随着全球林业资源需求的增长和劳动力成本的持续上升,传统松塔采摘模式面临效率低、风险高和成本不可控等严峻挑战,而季节性劳动力短缺进一步加剧了松科球果资源的浪费,不能满足行业发展需要[2],基于此,自动化采摘在提高效率、降低人力成本和减少安全风险方面展现出巨大潜力,实现精准、快速的松科球果检测与定位是推动自动化采摘技术发展的关键,也是制约采摘机器人在实际采摘中推广应用的主要因素[3]。
在目标检测方面,目前,松果检测模型主要可以被划分为两阶段模型与单阶段模型2类。两阶段模型的工作流程为先从背景中提取候选区域,然后对自标进行分类和定位,尽管这种方法在检测精度上表现出色,但由于其复杂的处理步骤,通常无法满足实时检测的需求[4]。其中,RCNN[5]、Fast RCNN[6]和Faster-RCNN[7]是该类模型的典型代表。程嘉瑜等[8]提出无人机遥感结合改进Faster-RCNN算法对桃树进行检测,引入注意力模块CBAM、使用ROIAlign替代原本池化结构、引人损失函数FocalLoss这3个方面对Faster-RCNN算法进行优化,改进后的算法对桃树检测平均精度达 86.46% ,但双阶段模型的实时性存在一定缺陷。相较之下,单阶段模型则直接从图像中预测目标的类别和位置,在检测精度和检测速度上做出了较优的平衡,代表性的模型包括 SSD[9] 、YOLO[10]等。……
