English

中国农机化学报

中国农机化学报 ›› 2025, Vol. 46 ›› Issue (6): 128-135.DOI: 10.13733/j.jcam.issn.2095-5553.2025.06.019

• 农业智能化研究 • 上一篇    下一篇

基于改进YOLOv7的复杂环境下香梨和果梗的采摘识别

邵明明,张立萍,郑威强,吕文涛,雷佳乐   

  1. (新疆大学机械工程学院,乌鲁木齐市,830017)
  • 出版日期:2025-06-15 发布日期:2025-05-22
  • 基金资助:
    国家自然科学基金项目(52265039);新疆维吾尔自治区重点研发项目计划(2022B02028—4)

Picking recognition of fragrant pear and fruit stem based on improved YOLOv7

Shao Mingming, Zhang Liping, Zheng Weiqiang, Lü Wentao, Lei Jiale   

  1. (College of Mechanical Engineering, Xinjiang University, Urumqi, 830017, China)
  • Online:2025-06-15 Published:2025-05-22

摘要:

为解决遮挡、光照、密集程度等复杂生长环境造成香梨采摘识别成功率不高及夹取采摘使果实破损的问题,提出一种基于YOLOv7的改进模型与一种剪抓相辅的采摘方式;制作基于真实复杂采摘环境下的香梨与果梗的数据集;增加BiFormer注意力机制提高模型对小目标的检测精度及效率;增加损失函数WIoU提升目标检测锚框的质量。经试验测试,改进的模型对样本数据集的平均精度均值mAP达到89.9%,比原模型提升1.9%,少特征的果梗平均精度AP值提高3.0%。与SSD、Faster R—CNN、Deformable DETR、YOLOv7模型对比,mAP值与检测速度均有较大的提升。结果表明,提升后的模型能较好完成对香梨与果梗的检测,模型识别速度快,能够满足实时检测需求。

关键词: 香梨与果梗, 注意力机制, 损失函数, 复杂环境, 图像识别

Abstract:

To address the challenges of low success rate in picking and recognizing fragrant pears, caused by a complex growth environment with factors such as occlusion, illumination, and density, as well as fruit damage during harvesting, an improved model based on YOLOv7 and a cutting‑and‑grasping picking method were proposed. A dataset was created for fragrant pears and fruit stems, reflecting real‑world complex picking conditions. The BiFormer attention mechanism was incorporated to enhance the detection accuracy and efficiency of the model, particularly for small targets. Additionally, the WIoU loss function was introduced to improve the quality of anchor frame, thereby enhancing target detection precision. The experimental results showed that the mAP of the improved model for the sample dataset reached 89.9%, which was a 1.9% increase over the original model. The AP value for detecting fruit stems, which have fewer features, increased by 3.0%. When compared to SSD, Faster R—CNN, Deformable DETR, and YOLOv7, both the mAP and detection speed showed significant improvements. These findings indicate that the enhanced model can more effectively detect pears and fruit stems while maintaining fast recognition speeds, making it suitable for real‑time detection.

Key words: fragrant pear and fruit stem, attention mechanism, loss function, complex environment, image recognition

中图分类号: