纺织学报 ›› 2025, Vol. 46 ›› Issue (03): 56-63.doi: 10.13475/j.fzxb.20240301901

• 纺织工程 • 上一篇    下一篇

基于改进YOLOv8的梳棉机棉网上棉结检测方法

白雨薇, 徐健(), 朱耀麟, 丁展博, 刘晨雨   

  1. 西安工程大学 电子信息学院, 陕西 西安 710048
  • 收稿日期:2024-03-07 修回日期:2024-05-08 出版日期:2025-03-15 发布日期:2025-04-16
  • 通讯作者: 徐健(1963—),男,教授。主要研究方向为机器视觉、目标检测和目标跟踪。E-mail:xujian@xpu.edu.cn
  • 作者简介:白雨薇(1998—),女,硕士生。主要研究方向为机器视觉、深度学习和目标检测。
  • 基金资助:
    陕西省自然科学基金重点项目(2023-JC-ZD-33)

Image detection of cotton nep in carding net based on improved YOLOv8

BAI Yuwei, XU Jian(), ZHU Yaolin, DING Zhanbo, LIU Chenyu   

  1. School of Electronics and Information, Xi'an Polytechnic University, Xi'an, Shaanxi 710048, China
  • Received:2024-03-07 Revised:2024-05-08 Published:2025-03-15 Online:2025-04-16

摘要:

针对基于深度学习的棉结目标检测模型占用过多计算资源、难以满足嵌入式设备及移动端的实时在线检测的问题,提出基于改进型YOLOv8的梳棉机棉网上棉结检测方法。首先,将轻量型网络MobileNetv3_Small用作YOLOv8n骨干网络,降低计算参数量;其次,在MobileNetv3网络中使用自改进协调注意力机制(coordinate attention)模块替换原有的压缩和激励(squeeze-and-excitation) 注意力机制模块,提升对棉结的检测精度;最后,使用EIoU损失函数取代原YOLOv8n中的CIoU损失函数,在处理数据时保留更多有效信息。在自制棉结图像数据集上验证改进型YOLOv8算法的检测效果,结果表明:基于改进型YOLOv8的检测方法平均准确率均值达到95.8%,相较于改进前提升了2.6%;参数量减少了34.2%。改进后算法的检测效果更好,且模型更加轻量,可满足嵌入式设备的使用。

关键词: 梳棉机棉网, 深度学习, 目标检测, 棉结, 轻量化模型, YOLOv8, 图像检测

Abstract:

Objective In order to improve the nep detection using deep learning with minimal computing resources and to achieve real-time online detection using embedded devices and mobile terminals, this research proposed an improved YOLOv8 detection method.

Method Lightweight network MobileNetv3_Small was used as YOLOv8 backbone network so as to reduce the number of parameters. The self-improved CA (coordinate attention) model was adopted to replace the SE (squeeze-and-excitation)attention mechanism model in MobileNetv3 so as to improve the accuracy of nep detection. EIoU loss function substituted CIoU loss function was employed to retain more effective information in data processing.

Results The dataset constructed includes three target objects, which were named lumpy nep, strip nep and cotton miscellaneous matters. Different light intensities and camera orientation on model detection effec was studied by using test set. The experimental results show that no missed detections and false detections of all target objects was found under different light intensities and different camera orientations. The average accuracy of improved YOLOv8 model reached 95.8%, with an increase of 2.6% compared with the reported model. Compared with the improved YOLOv8, YOLOv7, YOLOv5 and Faster R-CNN network models, the improved YOLOv8 network model involved fewer parameters but with higher average accuracy. According to the average accuracy of the improved YOLOv8 model for each type, the detection rate reached more than 95.1% with high accuracy. The improved model ablation experiments show when MobileNetv3 replaced the YOLOv8 backbone network, the parameter quantity is greatly reduced, and it was found from the comparison experiment between the loss function CIoU and EIoU that when the loss function is EIoU, the average accuracy of model detection is higher than CIoU. In addition, the number of parameters in the model became smaller, which is beneficial for embedded equipment and would satisfy the actual industrial production requirements.

Conclusion A nep detection method based on improved YOLOv8 model is proposed combining the characteristics of nep. By improving the original YOLOv8 model and inducting improved MobileNetv3 module, the accuracy of the model is improved, and the number of parameters is reduced, which benefits effective detection. The improved model can effectively reduce the parameter number and make the detection accuracy improved. Compared with the classic detection methods, the accuracy of the proposed model is higher, and the parameters get fewer. This method can be used with mobile devices or built-in devices for intelligent factory equipment.

Key words: carding net, deep learning, object detection, nep, lightweight model, YOLOv8, image detection

中图分类号: 

  • TP391

表1

改进后的YOLOv8骨干结构"

网络结构 输入分辨率/
像素
输出通道数 网络层数
Conv3×3 640×640 16 1
Bottleneck3×3 320×320 16 1
Bottleneck3×3 160×160 24 1
Bottleneck3×3 80×80 24 1
Bottleneck5×5 80×80 40 1
Bottleneck5×5 40×40 40 2
Bottleneck5×5 40×40 48 2
Bottleneck5×5 40×40 96 1
Bottleneck5×5 20×20 96 2

图1

改进型CA模块结构图 注: Sigmoid表示S型生长曲线。"

图2

检测流程图"

图3

棉结标注图"

图4

改进前模型检测效果"

图5

改进后模型检测效果"

图6

不同相机方位的检测结果"

图7

不同光照条件下的检测结果"

表2

改进型YOLOv8分类检测效果"

棉结类别 训练集标签数量/个 精确率/%
团状棉结 1 924 95.1
条状棉结 516 96.1
棉杂 531 96.3

表3

不同模型下的检测结果对比"

模型 参数量/
106
精确率/
%
召回率/
%
平均准确
率均值/%
推理
时间/s
本文算法 1.98 93.4 90.2 95.8 0.015
YOLOv8 3.01 87.7 88.9 93.2 0.024
YOLOv7 4.80 93.3 87.7 91.3 0.023
YOLOv5 7.01 89.8 86.3 90.6 0.019
Faster R-CNN 137.10 73.9 91.8 92.4 0.032

表4

消融实验结果"

模型编号 模型名称 CA CA+sigmoid EIoU 精确率/% 召回率/% 平均准确率均值/% 模型计算量/106
1 YOLOv8 × × × 87.7 88.9 93.2 3.01
2 YOLOv8-M × × × 93.4 93.6 95.4 2.34
3 YOLOv8-M × × 87.5 95.5 95.5 1.98
4 YOLOv8-M × 93.6 93.9 95.7 1.98
5 YOLOv8-E × × 92.6 90.3 95.6 3.01
6 YOLOv8-M-E 93.4 90.2 95.8 1.98
[1] 董奎勇. 中国棉纺织工业发展历程与创新之路[J]. 棉纺织技术, 2023, 51(10):5-13.
DONG Kuiyong. Development course and innovation road of china cotton textile industry[J]. Cotton Textile Technology, 2023, 51 (10):5-13.
[2] 倪锦文. 纱线棉结形成原因的研究与减少措施的探索[D]. 天津: 天津工业大学, 2017:10.
NI Jinwen. Study on the causes of yarn neps formation and exploration of measures to reduce them[D]. Tianjin: Tiangong University, 2017:10.
[3] 陈玉峰, 周茂榕. 梳棉工序棉结与短绒控制的矛盾分析[J]. 棉纺织技术, 2018, 46 (12): 9-12.
CHEN Yufeng, ZHOU Maorong. Contradiction analysis of nep and short fiber control in carding process[J]. Cotton Textile Technology, 2018, 46 (12): 9-12.
[4] 王延蒙, 付晓艳, 张朝彪. 基于线阵CCD的纱线常发性疵点检测研究[J]. 纺织器材, 2022, 49 (6): 5-8.
WANG Yanmeng, FU Xiaoyan, ZHANG Chaobiao. Research on yarn recurrent defect detection based on linear CCD[J]. Textile Accessories, 2022, 49 (6): 5-8.
[5] 周建, 潘如如, 高卫东. 机器视觉在纺织中的应用现状与发展趋势[J]. 棉纺织技术, 2019, 47(2):15-17.
ZHOU Jian, PAN Ruru, GAO Weidong. Application status and development trend of machine vision in textile industry[J]. Cotton Textile Technology, 2019, 47 (2):15-17.
[6] 陈俊琰. 梳棉机棉网质量计算机视觉检测系统研究[D]. 上海: 东华大学, 2014:53.
CHEN Junyan. Study on computer vision inspection system for web quality of carding machine[D]. Shanghai: Donghua University, 2014:53.
[7] HOWARD A, SANDLER M, CHU G, et al. Searching for MobileNetV3[C]// Proceedings of the IEEE/CVF International Conference on Computer Vision (ICCV). Seoul: IEEE, 2019:1314-1324.
[8] HU J, SHEN L, ALBANIE S, et al. Squeeze-and-Excitation networks[J] IEEE Transactions on Pattern Analysis and Machine Intelligence, 2020, 42(8): 2011-2023.
doi: 10.1109/TPAMI.2019.2913372 pmid: 31034408
[9] ZHENG Zhaohui, WANG Ping, REN Dongwei, et al. Enhancing geometric factors in model learning and inference for object detection and instance segmentation[J]. IEEE Transactions on Cybernetics, 2021, 52(8): 8574-8586.
[10] ZHANG Yifan, REN Weiqiang, ZHANG Zhang, et al. Focal and efficient IOU loss for accurate bounding box regression[J]. Neurocomputing, 2022, 506: 146-157.
[11] 徐健, 胡道杰, 刘秀平, 等. 基于改进型RFB-MobileNetV3的棉杂图像检测[J]. 纺织学报, 2023, 44(1):179-187.
XU Jian, HU Daojie, LIU Xiuping, et al. Cotton clutter detection based on improved RFB-MobileNetV3[J]. Journal of Textile Research, 2023, 44(1):179-187.
[12] 陈海永, 刘新如. 交叉门控融合的改进语义分割网络及应用[J]. 重庆理工大学学报(自然科学), 2023, 37(6):187-195.
CHEN Haiyong, LIU Xinru. Improved semantic segmentation network based on cross-gated fusion and its application[J]. Journal of Chongqing University of Technology (Natural Science Edition), 2023, 37(6):187-195.
[1] 黄小源, 侯珏, 杨阳, 刘正. 基于改进深度学习模型的高精度服装样板自动生成[J]. 纺织学报, 2025, 46(02): 236-243.
[2] 蔡丽玲, 王梅, 邵一兵, 陈炜, 曹华卿, 季晓芬. 基于改进堆叠生成对抗网络的传统汉服智能定制推荐[J]. 纺织学报, 2024, 45(12): 180-188.
[3] 刘燕萍, 郭佩瑶, 吴莹. 面向织物疵点检测的深度学习技术应用研究进展[J]. 纺织学报, 2024, 45(12): 234-242.
[4] 李杨, 张永超, 彭来湖, 胡旭东, 袁嫣红. 基于改进甲壳虫全域搜索算法的机织物疵点检测[J]. 纺织学报, 2024, 45(10): 89-94.
[5] 陆寅雯, 侯珏, 杨阳, 顾冰菲, 张宏伟, 刘正. 基于姿态嵌入机制和多尺度注意力的单张着装图像视频合成[J]. 纺织学报, 2024, 45(07): 165-172.
[6] 朱凌云, 王晨宇, 赵悦莹. 基于多度量多模型图像投票的织物表面瑕疵检测方法[J]. 纺织学报, 2024, 45(06): 89-97.
[7] 文嘉琪, 李新荣, 冯文倩, 李瀚森. 印花面料的边缘轮廓快速提取方法[J]. 纺织学报, 2024, 45(05): 165-173.
[8] 陆伟健, 屠佳佳, 王俊茹, 韩思捷, 史伟民. 基于改进残差网络的空纱筒识别模型[J]. 纺织学报, 2024, 45(01): 194-202.
[9] 池盼盼, 梅琛楠, 王焰, 肖红, 钟跃崎. 基于边缘填充的单兵迷彩伪装小目标检测[J]. 纺织学报, 2024, 45(01): 112-119.
[10] 李学良, 杜玉红, 任维佳, 左恒力. 基于近红外光谱和残差神经网络的异性纤维分类识别[J]. 纺织学报, 2023, 44(05): 84-92.
[11] 杨宏脉, 张效栋, 闫宁, 朱琳琳, 李娜娜. 一种高鲁棒性经编机上断纱在线检测算法[J]. 纺织学报, 2023, 44(05): 139-146.
[12] 顾冰菲, 张健, 徐凯忆, 赵崧灵, 叶凡, 侯珏. 复杂背景下人体轮廓及其参数提取[J]. 纺织学报, 2023, 44(03): 168-175.
[13] 李杨, 彭来湖, 李建强, 刘建廷, 郑秋扬, 胡旭东. 基于深度信念网络的织物疵点检测[J]. 纺织学报, 2023, 44(02): 143-150.
[14] 王斌, 李敏, 雷承霖, 何儒汉. 基于深度学习的织物疵点检测研究进展[J]. 纺织学报, 2023, 44(01): 219-227.
[15] 徐健, 胡道杰, 刘秀平, 韩琳, 闫焕营. 基于改进型RFB-MobileNetV3的棉杂图像检测[J]. 纺织学报, 2023, 44(01): 179-187.
Viewed
Full text


Abstract

Cited

  Shared   
  Discussed   
No Suggested Reading articles found!