浙江农业学报 ›› 2026, Vol. 38 ›› Issue (9): 1900-1910.DOI: 10.3969/j.issn.1004-1524.20250494

• 生物系统工程 • 上一篇    下一篇

基于YOLOv8n改进的杂草轻量检测算法

朱洪廷(), 方睿(), 肖潇, 蔡鑫地, 何兵   

  1. 成都信息工程大学 计算机学院, 四川 成都 610225
  • 收稿日期:2025-07-19 出版日期:2026-09-25 发布日期:2026-10-28
  • 作者简介:朱洪廷,研究方向为机器视觉。E-mail:377895550@qq.com
  • 通讯作者: 方睿,E-mail:fangrui@cuit.edu.cn
  • 基金资助:
    四川省自然科学基金(2023NSFSC0243)

Improved lightweight weed-detection algorithm based on YOLOv8n

ZHU Hongting(), FANG Rui(), XIAO Xiao, CAI Xindi, HE Bing   

  1. School of Computer Science, Chengdu University of Information Technology, Chengdu 610225, China
  • Received:2025-07-19 Published:2026-09-25 Online:2026-10-28

摘要:

针对农业场景中杂草检测模型参数量大、多尺度特征融合效率低、遮挡环境下检测精度不足等问题,提出一种基于改进YOLOv8n的轻量级模型CDMC-YOLO。设计一种融合邻近上下文与全局上下文的上下文特征增强(contextual feature enhancement, CFE)模块,将其集成至C2f模块,以提升模型对边缘模糊目标的检测精度;设计一种轻量级共享卷积检测头(DWConv-lightweight shared convolutional detection,DLSCD),以降低计算成本;引入多尺度空洞注意力(multi-scale dilated attention,MSDA)机制,增强模型对遮挡目标和复杂背景的感知能力;利用跨尺度特征融合模块(cross-scale feature fusion module, CCFM)优化特征金字塔结构,采用通道拼接与简化的卷积操作替代冗余的多层级联。实验结果表明,CDMC-YOLO的参数量与计算量较YOLOv8n分别减少40.0%与23.2%,平均精度均值(交并比阈值为0.5)提升2.1百分点,为农业智能化除草提供了高效解决方案。

关键词: 深度学习, 杂草检测, 跨尺度融合, 特征增强, 轻量化模型

Abstract:

To address the issues of excessive parameters, inefficient multi-scale feature fusion, and insufficient detection accuracy under occlusion in weed detection models for agricultural scenes, this paper proposes CDMC-YOLO, a lightweight model based on an improved YOLOv8n architecture. A contextual feature enhancement (CFE) module, which integrates adjacent and global context, is designed and integrated into the C2f module to improve detection accuracy for edge-blurred targets. A lightweight shared convolutional detection head (DWConv-lightweight shared convolutional detection, DLSCD) is designed to reduce computational costs. By incorporating a multi-scale dilated attention (MSDA) mechanism, the perception capability of the model for occluded targets and complex backgrounds is enhanced. Furthermore, a cross-scale feature fusion module (CCFM) is introduced to optimize the feature pyramid structure, replacing redundant multi-layer cascades with channel concatenation and simplified convolution operations. Experimental results demonstrate that CDMC-YOLO reduces parameters and computational load by 40.0% and 23.2%, respectively, compared with YOLOv8n, while increasing mean average precision (interaction over union threshold of 0.5) by 2.1 percentage points. This study provides an efficient solution for intelligent agricultural weeding.

Key words: deep learning, weed detection, cross scale fusion, feature enhancement, lightweight model

中图分类号: