作者投稿和查稿 主编审稿 专家审稿 编委审稿 远程编辑

计算机工程 ›› 2026, Vol. 52 ›› Issue (1): 400-413. doi: 10.19678/j.issn.1000-3428.0069978

• 交叉融合与工程应用 • 上一篇    下一篇

基于YOLOv8的轻量级田间棉花品级检测

刘杰, 黄晓辉*(), 郭敬博   

  1. 新疆大学计算机科学与技术学院, 新疆 乌鲁木齐 830017
  • 收稿日期:2024-06-07 修回日期:2024-08-01 出版日期:2026-01-15 发布日期:2026-01-15
  • 通讯作者: 黄晓辉
  • 作者简介:

    刘杰, 男, 硕士研究生, 主研方向为目标检测

    黄晓辉(通信作者), 副教授

    郭敬博, 硕士研究生

  • 基金资助:
    科技部科技创新2030-重大项目(2022ZD0115802); 新疆天山英才科技创新团队项目(2023TSYCTD0012)

Lightweight Field Cotton Grade Detection Based on YOLOv8

LIU Jie, HUANG Xiaohui*(), GUO Jingbo   

  1. College of Computer Science and Technology, Xinjiang University, Urumqi 830017, Xinjiang, China
  • Received:2024-06-07 Revised:2024-08-01 Online:2026-01-15 Published:2026-01-15
  • Contact: HUANG Xiaohui

摘要:

针对复杂田间棉花的多尺度变化导致现存目标检测算法误报率及漏报率较高、现存检测算法计算量较大难以部署到边缘设备中的问题, 通过优化特征提取与特征融合, 并结合模型剪枝与知识蒸馏技术, 提出一种轻量级田间棉花品级检测算法YOLOv8-Cotton。首先, 在特征提取网络中设计多尺度卷积(MSConv), 其包含不同尺度的卷积核, 能够增强网络的特征提取能力; 其次, 在颈部网络中构建高效的局部特征选择(ELS)机制, 在空间维度上捕获水平和垂直方向的特征, 抑制不相关区域对预测结果的影响, 并利用ELS机制构建新型的分级特征路径融合网络(HL-PAN), 利用其上采样特征融合(U-SFF)及下采样特征融合(D-SFF)所产生的互补信息指导特征融合, 增强模型对棉花多尺度变化的检测能力; 接着, 通过分层自适应幅度剪枝(LAMP)模型剪枝算法压缩模型, 达到轻量化效果; 最后, 利用CWD损失函数进行特征蒸馏, 以增强轻量化模型的检测性能。实验结果表明, YOLOv8-Cotton在自建数据集上的mAP@0.5、mAP@0.5∶0.95值分别达到75.4%、53.1%, 比基线算法分别提高5.1、2.1百分点的同时, 模型大小下降4.83 MB, 计算量减少5.8×109, 并在公开数据集上验证了模型的泛化性。

关键词: 目标检测, 多尺度卷积, 特征融合, 模型剪枝, 知识蒸馏

Abstract:

To address issues such as high false alarm and missed alarm rates in existing target detection algorithms owing to multi-scale variations in complex field cotton and large computational volume of existing detection algorithms, which make their deployment in edge devices challenging, a lightweight field cotton grade detection algorithm, YOLOv8-Cotton, is proposed. This algorithm optimizes feature extraction and fusion and combines model pruning and knowledge distillation techniques. First, a Multi-Scale Convolutional (MSConv) is designed in the feature extraction network, which contains convolutional kernels of different scales and can enhance the feature extraction capability of the network. Second, an Efficient Local Feature Selection (ELS) mechanism is constructed in the neck network to capture horizontal and vertical features in the spatial dimension and suppress irrelevant regions from affecting the prediction results. Then, a novel hierarchical feature fusion network, HL-PAN, is constructed using the ELS mechanism to utilize the complementary information generated by its Upsampling Selection Feature Fusion (U-SFF) and Downsampling Selection Feature Fusion (D-SFF) to guide the feature fusion, which enhances the ability of the model to detect multi-scale changes in cotton. Third, the model is compressed using the Layer-Adaptive Magnitude-based Pruning (LAMP) model pruning algorithm to reduce its weight. Finally, feature distillation is performed using the CWD loss function to enhance the detection performance of the lightweight model. Experimental results show that YOLOv8-Cotton achieves mAP@0.5 and mAP@0.5∶0.95 values of 75.4% and 53.1%, respectively, on the self-constructed dataset, which are 5.1 and 2.1 percentage point improvements over the baseline algorithm. Furthermore, the model size decreases by 4.83 MB and computation is reduced by 5.8×109. Additionally, the results show that the model can be generalized on a publicly available dataset.

Key words: object detect, Multi-Scale Convolutional (MSConv), feature fusion, model pruning, knowledge distillation