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

计算机工程 ›› 2022, Vol. 48 ›› Issue (12): 288-295. doi: 10.19678/j.issn.1000-3428.0063507

• 开发研究与工程应用 • 上一篇    下一篇

多尺度特征自适应融合的轻量化织物瑕疵检测

杨毅, 桑庆兵   

  1. 江南大学 人工智能与计算机学院, 江苏 无锡 214122
  • 收稿日期:2021-12-13 修回日期:2022-02-13 发布日期:2022-02-15
  • 作者简介:杨毅(1996—),男,硕士研究生,主研方向为计算机视觉;桑庆兵,副教授。
  • 基金资助:
    国家自然科学基金面上项目(52172324);陕西省交通厅重点项目(20-38T);西安市未央区科技计划项目(202121);长安大学实验教学改革研究项目(20211811)。

Lightweight-Fabric Defect Detection Based on Adaptive Fusion of Multiscale Features

YANG Yi, SANG Qingbing   

  1. School of Artificial Intelligence and Computer, Jiangnan University, Wuxi, Jiangsu 214122, China
  • Received:2021-12-13 Revised:2022-02-13 Published:2022-02-15

摘要: 织物瑕疵检测是纺织行业保证产品质量的重要环节,针对织物瑕疵检测中存在小目标瑕疵检测困难、不同种类瑕疵长宽比差异大、对实时性要求高等问题,提出一种新的轻量化织物瑕疵检测算法。以YOLOv4网络为基础,使用轻量化网络MobileNetv2为主干网络,有效减少模型参数总量与运算量,以满足实时性需求。在MobileNetv2的逆残差结构中加入CoordAttention注意力模块,将空间精确位置信息嵌入到通道注意力中,增强网络聚焦小目标特征的能力。使用自适应空间特征融合(ASFF)网络改进路径聚合网络(PANet),使模型通过学习获得多尺度特征图的融合权重,从而充分利用浅层特征与深层特征,提高算法对小目标瑕疵的检测精度。采用K-means++算法确定先验框尺寸,并用Focal Loss函数修改模型损失函数,降低正、负样本不平衡对检测结果的影响,解决不同种类瑕疵长宽比差异大及类别不平衡的问题。实验结果表明,相较于YOLOv4算法,所提算法的平均精度均值提高了2.3个百分点,检测速度提升了12 frame/s,能较好地应用于织物瑕疵检测。

关键词: 织物瑕疵检测, 自适应空间特征融合, CoordAttention模块, YOLOv4网络, MobileNetv2网络

Abstract: Fabric defect detection is an essential process in the textile industry for ensuring product quality.A algorithm for detecting lightweight fabric defects based on multiscale feature adaptive fusion is proposed to minimize small-target defect detection difficulties in fabric defect detection and the significant differences in the aspect ratios of different defects and high requirements for real-time performance.Based on the YOLOv4 network, lightweight network MobileNetv2 is used as the backbone network to effectively reduce the total number of model parameters and the cost of calculations to satisfy real-time requirements.In the inverse residual structure of MobileNetv2, a new attention mechanism is added.CoordAttention module, which embeds the spatially accurate position information necessary for detecting small-target defects into the channel attention, is used to enhance the ability of the network to focus on small-target features.Second, the Adaptive Spatial Feature Fusion(ASFF) network is used to improve Path Aggregation Network(PANet) to enable the model to obtain the fusion weights of multiscale feature maps through learning, fully utilize shallow and deep features, and further improve the detection accuracy of small-target defects.For different defect types and problems with significant aspect ratio differences and unbalanced categories, the K-means++ algorithm is used to determine the prior frame size, and the Focal Loss function is used to modify the model loss function to reduce the impact of the positive and negative sample imbalance on the detection result.The experimental results show that compared with YOLOv4, the mean Average Precision(mAP) of the proposed algorithm increases by 2.3 percentage points, and the detection speed increases by 12 frame/s.The proposed approach can be effectively applied to fabric defect detection.

Key words: fabric defect detection, Adaptively Spatial Feature Fusion(ASFF), CoordAttention module, YOLOv4 network, MobileNetv2 network

中图分类号: