纺织学报 ›› 2024, Vol. 45 ›› Issue (05): 60-69.doi: 10.13475/j.fzxb.20220902201

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

基于轻量化卷积神经网络的纬编针织物组织结构分类

胡旭东1, 汤炜1, 曾志发2, 汝欣1, 彭来湖1, 李建强3(), 王博平2   

  1. 1.浙江理工大学 浙江省现代纺织装备技术重点实验室, 浙江 杭州 310018
    2.浙江恒强科技股份有限公司, 浙江 杭州 311121
    3.浙江大学 生物医学工程与仪器科学学院, 浙江 杭州 310027
  • 收稿日期:2023-03-13 修回日期:2023-12-05 出版日期:2024-05-15 发布日期:2024-05-31
  • 通讯作者: 李建强(1990—),男,博士。主要研究方向为机器视觉、机电一体化技术。E-mail:wzcnljq@126.com。
  • 作者简介:胡旭东(1959—),男,教授,博士。主要研究方向为智能纺织装备技术。
  • 基金资助:
    浙江省公益技术研究计划项目(LGG21E050024);浙江理工大学科研启动基金项目(18022224-Y)

Structure classification of weft-knitted fabric based on lightweight convolutional neural network

HU Xudong1, TANG Wei1, ZENG Zhifa2, RU Xin1, PENG Laihu1, LI Jianqiang3(), WANG Boping2   

  1. 1. Key Laboratory of Modern Textile Machinery & Technology of Zhejiang Province, Zhejiang Sci-Tech University, Hangzhou, Zhejiang 310018, China
    2. Zhejiang Hengqiang Technology Co., Ltd., Hangzhou, Zhejiang 311121, China
    3. College of Biomedical Engineering & Instrument Science, Zhejiang University, Hangzhou, Zhejiang 310027, China
  • Received:2023-03-13 Revised:2023-12-05 Published:2024-05-15 Online:2024-05-31

摘要:

为解决纬编针织物组织结构自动分类时现有方法计算量偏大的问题,基于轻量化卷积神经网络,提出了一种改进的纬编针织物组织结构分类方法。采集纬编针织物组织双面的图像,以准确判断其结构类型。在特征提取步骤中,引入了注意力机制模块,修正各个层次特征在通道域和空间域的权重。构建的双分支网络架构能并行提取织物双面的特征信息。在分类阶段,采用了串行策略来融合高维特征向量,以确定纬编针织物组织所属类别。使用准确率、宏精确率、宏召回率以及宏F1评估模型的性能,并统计了参数量和计算复杂度衡量模型的资源消耗。实验结果显示,对于纬编针织物特殊的结构特点,双分支网络架构具有很好的适应性。改进后的模型增强了不同组织间的特征区分度,在受到角度旋转、尺度改变、光照条件变化等干扰下,本文方法的分类准确率可达99.51%,且保持了较小的资源消耗。

关键词: 纬编针织物, 组织结构分类, 轻量化卷积神经网络, 图像识别, 双分支网络, 注意力机制

Abstract:

Objective The structure of the fabric is one of the important parameters to guide the production of fabric. The automatic identification of the fabric structure through machine vision helps to improve the design and production efficiency. Weft knitted fabrics have complex knitting methods and various structures, and it is difficult to accurately determine the structure of the fabric only by the image of one side of the fabric. Therefore, it is necessary to design an efficient and accurate classification method for the special structure of weft knitted fabrics.

Method A fabric image acquisition platform was built to capture images of both sides of fabric samples at multi-scale and various lighting conditions. A dataset containing images of weft knitted fabrics in nine categories was produced. The method in this paper was improved based on GhostNet which is a lightweight convolutional neural network. In order to improve the network's ability to learn different features, two strategies were adopted to introduce an attention mechanism in the feature extraction stage. The network structure was adjusted to a dual-branch architecture, so that the features of the double-sided image of knitted fabrics were simultaneously extracted through the weight-sharing sub-network, and the extracted high-dimensional feature maps were serially fused.

Results The experimental part analyzes the effectiveness and performance of the proposed method. Multiple online augmentation methods increase the diversity of fabric sample data and improve the robustness of the model. Compared with the original data set, the model has higher accuracy rate on the validation set. Adding a dropout layer after the fully connected layer improves the generalization performance of the model. When the dropout rate is 0.4, the model has the best performance. For the fabric categories that are difficult to distinguish based on single-sided images, the proposed method has achieved a classification accuracy of more than 99%. In order to observe the feature extraction effect of the model more intuitively, the feature maps of different levels of the fabric image are visualized. The model pays more attention to important features such as the shape and texture of the fabric. Accuracy, macro precision, macro recall, and macro F1 are adopted to evaluate the performance of the model, and the number of parameters and computational complexity are calculated to measure the resource consumption of the model. The results of the ablation experiments show that the incorporation of the CBAM module effectively improves the performance of the model. Different models and methods are compared under the same hyper parameter settings. First, common CNN models are tested on the dataset constructed in this paper. The prosposed method achieves the highest classification accuracy of 99.51%, the macro precision rate is 0.994 1, the macro recall rate is 0.994 6, and the macro F1 score is 0.994 2, with lower FLOPs (0.31 G) and params (4.62 M) compared to other models.

Conclusion Aiming at the classification of weft-knitted fabrics, a double-sided image data set is used in the classification of knitted fabrics. An end-to-end classification method of knitted fabric structure was prosposed based on GhostNet, which is a lightweight convolutional neural network. The experimental results show that the CBAM module enhances the feature discrimination between different fabrics, which improves the network performance. The double-sided features of weft-knitted fabric were efficiently extracted by dual-branch network architecture. Compared with other classification methods based on CNN, the proposed method has a higher classification accuracy and consumes less resources, which is conducive to the deployment of the model on mobile devices or embedded devices. In future work, the case that a single fabric image contains multiple fabric structure will become the focus of research, which is of great significance to further improve the recognition efficiency of the algorithm in the actual design and production process of fabrics.

Key words: weft-knitted fabric, image recognition, lightweight convolutional neural network, two-branch network, attention mechanism

中图分类号: 

  • TS181

图1

纬编针织物样本示例"

表1

纬编针织物数据集概况"

试样
编号
类别 面密度/(g·m-2) 样本数量/组
0 单珠地 180、200、210、220 1 228
1 1×1 罗纹 170、200、220 636
2 2×2 罗纹 220、230、240 908
3 3×3 罗纹 200、210、220、230、240 868
4 4×2 罗纹 200、210、230 780
5 4×3 罗纹 180、200、210、220 684
6 毛圈 250、280、300 880
7 平针 170、190、200、220、230 1 256
8 双珠地 190、210、220 992

图2

幽灵模块"

图3

CBAM模块"

图4

通道注意力和空间注意力模块结构"

图5

改进的瓶颈结构"

图6

双分支网络的架构及参数"

图7

数据增强的影响"

图8

不同随机失活率的影响"

图9

混淆矩阵"

表2

测试集上的错分样本数量"

试样
编号
类别 测试集样本
数量/组
错分样本
数量/组
0 单珠地 246 0
1 1×1 罗纹 127 1
2 2×2 罗纹 182 0
3 3×3 罗纹 174 3
4 4×2 罗纹 156 1
5 4×3 罗纹 137 2
6 毛圈 176 0
7 平针 251 1
8 双珠地 198 0
- 总计 1 647 8

图10

纬编针织物图像的部分特征图"

表3

消融实验结果"

模型 FLOPs/G Params/M 宏精确率 宏召回率 F1分数 准确率/%
GhostNet_无注意力模块 0.31 3.64 0.962 4 0.949 8 0.954 3 95.81
GhostNet_SE模块 0.31 5.37 0.982 9 0.983 6 0.983 1 98.48
本文方法 0.31 4.62 0.994 1 0.994 6 0.994 2 99.51

表4

不同模型的实验结果"

模型 FLOPs/G Params/M 宏精确率 宏召回率 F1分数 准确率/%
Alexnet 0.61 24 0.911 5 0.910 9 0.910 9 91.98
ResNet18 3.65 11.19 0.979 4 0.977 1 0.977 9 97.99
MobileNet V2 0.65 2.25 0.984 0 0.980 9 0.981 8 98.42
MobileNet V3 0.12 2.12 0.954 2 0.948 4 0.950 8 95.50
DenseNet 5.79 6.97 0.983 4 0.980 8 0.982 0 98.29
EfficientNet 0.82 4.03 0.980 2 0.978 3 0.979 0 98.11
ShuffleNet 0.30 1.27 0.943 4 0.947 4 0.944 6 95.02
本文方法 0.31 4.62 0.994 1 0.994 6 0.994 2 99.51
[1] XIN B, ZHANG J, ZHANG R, et al. Color texture classification of yarn-dyed woven fabric based on dual-side scanning and co-occurrence matrix[J]. Textile Research Journal, 2017, 87(15): 1883-1895.
[2] ROOMI M M, SARANYA S. Bayesian classification of fabrics using binary co-occurrence matrix[J/OL]. International Journal of Information Sciences and Techniques, 2012, 2(2), 1-9. https://ssrn.com/abstract=3827595 .
[3] JING J, XU M, LI P, et al. Automatic classification of woven fabric structure based on texture feature and PNN[J]. Fibers and Polymers, 2014, 5(15): 1092-1098.
[4] TALAB A R R, SHAKOOR M H. Fabric classification using new mapping of local binary pattern[C]// 2018 International Conference on Intelligent Systems and Computer Vision. Fez: IEEE, 2018: 1-4.
[5] MALACA P, ROCHA L F, GOMES D, et al. Online inspection system based on machine learning techniques: real case study of fabric textures classification for the automotive industry[J]. Journal of Intelligent Manufacturing, 2019, 30(1): 351-361.
[6] GONG X, YUAN L, YANG Y, et al. Classification of colored spun fabric structure based on wavelet decomposition and hierarchical hybrid classifier[J]. Journal of The Textile Institute, 2021, 113(9): 1832-1837.
[7] XIAO Z, LIU X, WU J, et al. Knitted fabric structure recognition based on deep learning[J]. Journal of The Textile Institute, 2018, 109(9): 1217-1223.
[8] HUSSAIN I, Khan M.A.B, WANG Z, et al. Woven fabric pattern recognition and classification based on deep convolutional neural networks[J]. Electronics, 2020, 9(6): 1048.
[9] ZHANG X, ZHOU X, LIN M, et al. ShuffleNet: an extremely efficient convolutional neural network for mobile devices[C]// 2018 IEEE/CVF Conference on Computer Vision and Pattern Recognition. Salt Lake City: IEEE, 2018: 6848-6856.
[10] SANDLER M, HOWARD A, ZHU M, et al. MobileNetV2: inverted residuals and linear bottle-necks[C]// 2018 IEEE/CVF Conference on Computer Vision and Pattern Recognition. Salt Lake City: IEEE, 2018: 4510-4520.
[11] TAN M, LE Q. EfficientNet: Rethinking model scaling for convolutional neural networks[C]// International Conference on Machine Learning. New York: PMLR, 2019: 6105-6114.
[12] HAN K, WANG Y, TIAN Q, et al. GhostNet: more features from cheap operations[C]// 2020 IEEE/CVF Conference on Computer Vision and Pattern Recognition. Seattle: IEEE, 2020: 1580-1589.
[13] WOO S, PARK J, LEE J Y, et al. CBAM: convolutional block attention module[C]// European conference on computer vision. Switzerland: Springer, 2018: 3-19.
[14] 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
[1] 顾梅花, 花玮, 董晓晓, 张晓丹. 基于上下文提取与注意力融合的遮挡服装图像分割[J]. 纺织学报, 2024, 45(05): 155-164.
[2] 常辰玉, 王雨薇, 原旭阳, 刘锋, 卢致文. 基于交织点改进弹簧-质点模型的纬编针织物动态变形模拟[J]. 纺织学报, 2024, 45(01): 99-105.
[3] 师红宇, 位营杰, 管声启, 李怡. 基于残差结构的棉花异性纤维检测算法[J]. 纺织学报, 2023, 44(12): 35-42.
[4] 马创佳, 齐立哲, 高晓飞, 王子恒, 孙云权. 基于改进YOLOv4-Tiny的缝纫线迹质量检测方法[J]. 纺织学报, 2023, 44(08): 181-188.
[5] 付晗, 胡峰, 龚杰, 余联庆. 面向织物疵点检测的缺陷重构方法[J]. 纺织学报, 2023, 44(07): 103-109.
[6] 袁甜甜, 王鑫, 罗炜豪, 梅琛楠, 韦京艳, 钟跃崎. 基于注意力机制和视觉转换器的三维虚拟试衣网络[J]. 纺织学报, 2023, 44(07): 192-198.
[7] 陈佳, 杨聪聪, 刘军平, 何儒汉, 梁金星. 手绘草图到服装图像的跨域生成[J]. 纺织学报, 2023, 44(01): 171-178.
[8] 顾梅花, 刘杰, 李立瑶, 崔琳. 结合特征学习与注意力机制的服装图像分割[J]. 纺织学报, 2022, 43(11): 163-171.
[9] 汝欣, 朱婉珍, 史伟民, 彭来湖. 密度非均匀分布纬编针织物的变形预测及仿真[J]. 纺织学报, 2022, 43(06): 63-69.
[10] 孙春红, 丁广太, 方坤. 基于稀疏字典学习的羊绒与羊毛分类[J]. 纺织学报, 2022, 43(04): 28-32.
[11] 刘国维, 潘如如, 高卫东, 周建. 基于总变差的织物疵点分割方法[J]. 纺织学报, 2021, 42(11): 64-70.
[12] 胡旭东, 宋炎锋, 汝欣, 彭来湖. 大小头筒状纬编针织物建模及其线圈长度逆向设计[J]. 纺织学报, 2021, 42(04): 80-84.
[13] 刘立东, 李新荣, 刘汉邦, 李丹丹. 基于纬编针织物特性的静电吸附力模型[J]. 纺织学报, 2021, 42(03): 161-168.
[14] 孙亚博, 李立军, 马崇启, 吴兆南, 秦愈. 基于ABAQUS的筒状纬编针织物拉伸力学性能模拟[J]. 纺织学报, 2021, 42(02): 107-112.
[15] 李涛, 杜磊, 黄振华, 蒋玉萍, 邹奉元. 服装款式图识别与样板转换技术研究进展[J]. 纺织学报, 2020, 41(08): 145-151.
Viewed
Full text


Abstract

Cited

  Shared   
  Discussed   
No Suggested Reading articles found!