|
|
Denim fabric defect detection algorithm based on improved RT-DETR |
Gengliang LIANG1( ),Shuguang HAN2,*( ) |
1. School of Computer Science and Technology (School of Artificial Intelligence), Zhejiang Sci-Tech University, Hangzhou 310018, China 2. School of Science, Zhejiang Sci-Tech University, Hangzhou 310018, China |
|
|
Abstract A detection algorithm based on improved RT-DETR was proposed, to achieve rapid and accurate detection of minor defects on surfaces of denim fabrics and to overcome the decline in detection performance of existing models under complex textured backgrounds. First, partial convolution (PConv) was utilized to enhance the model’s ability to recognize key features through the Efficient Multi-Scale Attention mechanism. Second, on the basis of adding the S2 feature detection layer, two feature fusion operations, multi-feature encoding (MFE) and multi-scale feature fusion (MSFF), were introduced to enhance the integration of feature information at different scales, and the Deformable Attention mechanism was employed to better address defect deformation. In terms of loss function, a new loss function was proposed, which could accelerate the network convergence and improve the accuracy of network detection. Tests conducted on the fabric defect dataset from Tianchi Cloud demonstrated that the improved RT-DETR model achieved an average mAP@0.5 of 60%, marking 5.3% improvement over the RT-DETR-R18 model, with a 40.1% reduction in the total number of model parameters. Compared to YOLOv5 and YOLOv8, improvements of 9.5% and 9.9% in mAP@0.5 were observed, respectively. The improved RT-DETR model shows significant enhancements in the positioning accuracy and detection precision of defect detection, meeting the requirements for industrial-scale detection. This model serves as an important reference for the intelligent transformation and development of the textile and apparel industry.
|
Received: 30 March 2024
Published: 30 May 2025
|
|
Fund: 国家自然科学基金资助项目(12471304). |
Corresponding Authors:
Shuguang HAN
E-mail: 13959104785@163.com;dawn1024@zstu.edu.cn
|
基于改进RT-DETR的牛仔面料疵点检测算法
为了实现牛仔面料微小疵点的快速准确检测,克服已有模型在复杂纹理背景下检测性能不佳的问题,提出基于改进RT-DETR的检测算法. 采用部分卷积(PConv)结合Efficient Multi-Scale Attention机制增强模型对关键特征的识别能力;在添加S2特征检测层的基础上,提出多特征编码模块(MFE)和多尺度特征融合模块(MSFF)这2个特征融合操作,增强不同尺度的特征信息融合,并使用Deformable Attention注意力机制应对多样的疵点. 在损失函数方面,提出新的联合损失函数,在加快网络收敛的同时,提高网络检测的精度. 在天池云的布匹缺陷数据集上进行实验,结果表明改进RT-DETR模型的平均mAP@0.5为60%,与RT-DETR-R18模型相比,mAP@0.5提升5.3个百分点,模型总参数量下降40.1%;与YOLOv5、YOLOv8相比,mAP@0.5分别提升9.5、9.9个百分点. RT-DETR改进模型在疵点检测的定位准确度与精度上均有显著提升,能满足工业大规模检测要求,对于纺织服装产业的智能化转型具有重要的借鉴作用.
关键词:
面料缺陷,
缺陷检测,
RT-DETR,
部分卷积(PConv),
可变形注意力,
归一化 Wasserstein 距离(NWD)
|
|
[1] |
张缓缓, 马金秀, 景军锋, 等 基于改进的加权中值滤波与K-means聚类的织物缺陷检测[J]. 纺织学报, 2019, 40 (12): 50- 56 ZHANG Huanhuan, MA Jinxiu, JING Junfeng, et al Fabric defect detection method based on improved fast weighted Median filtering and K-means[J]. Journal of Textile Research, 2019, 40 (12): 50- 56
|
|
|
[2] |
郑兆伦, 鲁玉军 基于奇异值分解的双算法织物缺陷检测[J]. 纺织学报, 2022, 43 (11): 59- 67 ZHENG Zhaolun, LU Yujun Dual-algorithm for fabric defect detection based on singular value decomposition[J]. Journal of Textile Research, 2022, 43 (11): 59- 67
|
|
|
[3] |
周文明, 周建, 潘如如 应用上下文视觉显著性的色织物疵点检测[J]. 纺织学报, 2020, 41 (8): 39- 44 ZHOU Wenming, ZHOU Jian, PAN Ruru Yarn-dyed fabric defect detection based on context visual saliency[J]. Journal of Textile Research, 2020, 41 (8): 39- 44
|
|
|
[4] |
闫本超, 潘如如, 周建, 等 基于改进Itti显著模型的织物疵点实时检测[J]. 纺织学报, 2023, 44 (7): 95- 102 YAN Benchao, PAN Ruru, ZHOU Jian, et al Real-time detection of fabric defects based on use of improved Itti salient model[J]. Journal of Textile Research, 2023, 44 (7): 95- 102
|
|
|
[5] |
GIRSHICK R. Fast R-CNN [C]// IEEE International Conference on Computer Vision. Santiago: IEEE, 2015: 1440–1448.
|
|
|
[6] |
王安静, 袁巨龙, 朱勇建, 等 基于改进YOLOv8s的鼓形滚子表面缺陷检测算法[J]. 浙江大学学报: 工学版, 2024, 58 (2): 370- 380,387 WANG Anjing, YUAN Julong, ZHU Yongjian, et al Drum roller surface defect detection algorithm based on improved YOLOv8s[J]. Journal of Zhejiang University: Engineering Science, 2024, 58 (2): 370- 380,387
|
|
|
[7] |
张艳, 孙晶雪, 孙叶美, 等 基于分割注意力与线性变换的轻量化目标检测[J]. 浙江大学学报: 工学版, 2023, 57 (6): 1195- 1204 ZHANG Yan, SUN Jingxue, SUN Yemei, et al Lightweight object detection based on split attention and linear transformation[J]. Journal of Zhejiang University: Engineering Science, 2023, 57 (6): 1195- 1204
|
|
|
[8] |
LIU B, WANG H, CAO Z, et al PRC-light YOLO: an efficient lightweight model for fabric defect detection[J]. Applied Sciences, 2024, 14 (2): 938
doi: 10.3390/app14020938
|
|
|
[9] |
CARION N, MASSA F, SYNNAEVE G, et al. End-to-end object detection with transformers [C]// European Conference on Computer Vision. Cham: Springer, 2020: 213–229.
|
|
|
[10] |
ZHANG H, LI F, LIU S, et al. DINO: detr with improved DeNoising anchor boxes for end-to-end object detection [EB/OL]. (2022-03-07) [2024-02-24]. https://arxiv.org/abs/2203.03605v4.
|
|
|
[11] |
ZHAO Y, LV W, XU S, et al. DETRs beat YOLOs on real-time object detection [C]// IEEE/CVF Conference on Computer Vision and Pattern Recognition. Seattle: IEEE, 2024: 16965–16974.
|
|
|
[12] |
HOWARD A G, ZHU M, CHEN B, et al. MobileNets: efficient convolutional neural networks for mobile vision applications [EB/OL]. (2017-04-17) [2024-02-26]. https://arxiv.org/abs/1704.04861v1.
|
|
|
[13] |
HAN K, WANG Y, TIAN Q, et al. GhostNet: more features from cheap operations [C]// IEEE/CVF Conference on Computer Vision and Pattern Recognition. Seattle: IEEE, 2020: 1580–1589.
|
|
|
[14] |
MA N, ZHANG X, ZHENG H T, et al. ShuffleNet V2: practical guidelines for efficient CNN architecture design [C]// European Conference on Computer. Cham: Springer, 2018: 122–138.
|
|
|
[15] |
CHEN J, KAO S H, HE H, et al. Run, don’t walk: chasing higher FLOPS for faster neural networks [C]// IEEE/CVF Conference on Computer Vision and Pattern Recognition. Vancouver: IEEE, 2023: 12021–12031.
|
|
|
[16] |
OUYANG D, HE S, ZHANG G, et al. Efficient multi-scale attention module with cross-spatial learning [C]// IEEE International Conference on Acoustics, Speech and Signal Processing. Rhodes Island: IEEE, 2023: 1–5.
|
|
|
[17] |
ZHU X, SU W, LU L, et al. Deformable DETR: deformable transformers for end-to-end object detection [EB/OL]. (2020-10-08) [2024-02-26]. https://arxiv.org/abs/2010.04159v4.
|
|
|
[18] |
WANG J, XU C, YANG W, et al. A normalized Gaussian Wasserstein distance for tiny object detection [EB/OL]. (2021-10-26) [2024-02-26]. https://arxiv.org/abs/2110.13389v2.
|
|
|
[19] |
LIU W, LU H, FU H, et al. Learning to upsample by learning to sample [EB/OL]. (2023-8-29) [2024-02-26]. https://arxiv.org/abs/2308.15085v1.
|
|
|
[20] |
XU G, LIAO W, ZHANG X, et al Haar wavelet downsampling: a simple but effective downsampling module for semantic segmentation[J]. Pattern Recognition, 2023, 143: 109819
doi: 10.1016/j.patcog.2023.109819
|
|
|
|
Viewed |
|
|
|
Full text
|
|
|
|
|
Abstract
|
|
|
|
|
Cited |
|
|
|
|
|
Shared |
|
|
|
|
|
Discussed |
|
|
|
|