English

中国农机化学报

中国农机化学报 ›› 2025, Vol. 46 ›› Issue (1): 185-189.DOI: 10.13733/j.jcam.issn.2095-5553.2025.01.028

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

基于改进YOLOv8算法的谷子田杂草检测

王鑫淼,张正,董晓威,王林烽,李瑞祥   

  1. 黑龙江八一农垦大学工程学院,黑龙江大庆,163000
  • 出版日期:2025-01-15 发布日期:2025-01-24
  • 基金资助:
    国家自然科学基金项目(52275246);黑龙江省博士后基金项目(LBH—Z20203);黑龙江八一农垦大学杂粮优势特色学科项目(GCZL202306)

Research on weed detection in millet field based on improved YOLOv8 algorithm

Wang Xinmiao, Zhang Zheng, Dong Xiaowei, Wang Linfeng, Li Ruixiang   

  1. School of Engineering, Heilongjiang Bayi Agricultural University, Daqing, 163000, China
  • Online:2025-01-15 Published:2025-01-24

摘要: 针对谷子田环境复杂、杂草种类众多、杂草分布密集的特点导致识别精度低的问题,提出一种基于YOLOv8的改进模型。通过加入CloFormer结构来减少YOLOv8算法计算量并提高识别精度,使用Global和Local的注意力与c2f模块进行融合,使用AttnConv共享权重来整合局部信息,部署上下文感知权重来增强局部特征;为进一步提高识别精度,另外添加Gam注意力机制,与当前较先进的注意力机制进行对比试验,并与YOLO各系列模型进行对比试验。结果表明,YOLOv8-CG模型检测的平均精度均值为92.6%,比YOLOv5模型高4%。同时分析垄的种植密度不同对模型识别产生的影响,种植较为稀疏的10号垄比种植密集的2号垄精度高6.6%。

关键词: 杂草检测, 谷子, YOLOv8, 注意力机制, 轻量级模型

Abstract: An improved model based on YOLOv8 was proposed to solve the problem of low recognition accuracy due to the complex environment, numerous weed species and dense weed distribution in millet field. By adding CloFormer structure, the model reduced the computational load of YOLOv8 algorithm and improved the recognition accuracy. This structure mainly used Global and Local attention to integrate with c2f module, used AttnConv shared weights to integrate local information, and deployed contextaware weights to enhance local features. In order to further improve the recognition accuracy, Gam attention mechanism was added, and comparison experiments were conducted with the current more advanced attention mechanism and the YOLO series. According to the experiments, the average detection accuracy of YOLOv8-CG model was 92.6%, 4% higher than that of YOLOv5 model. At the same time, the effect of different planting density on model recognition was analyzed. The experiment showed that the precision of row 10 with sparse planting was 6.6% higher than that of row 2 with dense planting.

Key words: weed detection, millet, YOLOv8, attention mechanism, lightweight model

中图分类号: