基于改进YOLOv8n-seg的小麦籽粒与杂质图像分割及像素估测含杂率检测方法

Detection method of wheat impurity rate via pixel estimation and image segmentation based on improved YOLOv8n-seg

  • 摘要:
    目的 针对小麦联合收获场景下籽粒与杂质混合物料在线检测需求,基于深度学习实例分割算法构建快速检测模型,实现收获物含杂率的实时测算。
    方法 针对传统人工含杂检测效率低、难以满足收获现场实时监测需求的痛点,提出轻量化小麦含杂率检测模型YOLOv8n-SCW。重构基线网络C2f 模块,引入StarNetBlock模块搭配CAA注意力机制优化特征提取融合能力;采用WIOUv3作为边界框损失函数,通过自适应梯度调节机制降低异常样本对模型优化过程的不利影响;训练全程开启Mosaic数据增强策略,提升模型泛化鲁棒性。
    结果 在自建小麦籽粒-杂质图像数据集测试,相较于原始YOLOv8n-seg基线,杂质分割精确率提升1.3%、召回率提升3.1%、F1调和平均数提升2.24%;小麦籽粒分割精度同步改善,单张图像推理耗时仅为0.033 s。YOLOv8n-SCW相比基线模型,参数量增加1.3 M,浮点计算量增加1.7 GFLOPS,在保持模型精度提升的同时维持了较低计算开销。
    结论 本轻量化改进模型具备应用于小麦联合收割机载视觉检测系统的潜力,可为小麦收获作业含杂率实时在线监测提供轻量化算法支撑与技术参考。

     

    Abstract:
    Objective To address the demand for online detection of grain-impurity mixtures during wheat combine harvesting, this study developed a rapid detection model based on a deep learning instance segmentation algorithm to enable real-time measurement of harvest impurity rates.
    Methods To overcome the limitations of traditional manual detection, which is inefficient and inadequate for real-time monitoring in harvesting fields, a lightweight wheat impurity rate detection model named YOLOv8n-SCW was proposed. The baseline network's C2 module was reconstructed by introducing the StarNetBlock module combined with the CAA attention mechanism to optimize feature extraction and fusion capabilities. WIoUv3 was adopted as the bounding box loss function, incorporating an adaptive gradient adjustment mechanism to mitigate the adverse effects of outlier samples on the optimization process. Mosaic data augmentation was enabled throughout the training process to enhance model generalization and robustness.
    Results Evaluated on a self-constructed wheat kernel-impurity image dataset, the improved model achieved a 1.3% increase in impurity segmentation precision, a 3.1% increase in recall, and a 2.24% increase in the F1 score compared to the original YOLOv8n-seg baseline. Wheat kernel segmentation accuracy was also improved, with inference time of only 0.033 s per image. Compared to the baseline model, YOLOv8n-SCW increased the number of parameters by 1.3M and computational cost by 1.7 GFLOPS, while maintaining a relatively low computational overhead alongside the accuracy improvement.
    Conclusion This lightweight improved model demonstrates potential for application in vision-based detection systems for wheat combine harvesters, providing a lightweight algorithmic reference and technical support for real-time online monitoring of impurity rates during wheat harvesting operations.

     

/

返回文章
返回