Journal of Textile Research ›› 2023, Vol. 44 ›› Issue (09): 205-212.doi: 10.13475/j.fzxb.20220508801

• Machinery & Accessories • Previous Articles     Next Articles

Yarn state detection based on lightweight network and knowledge distillation

REN Guodong, TU Jiajia, LI Yang, QIU Zian, SHI Weiming()   

  1. Zhejiang Key Laboratory of Modern Textile Equipment Technology, Zhejiang Sci-Tech University, Hangzhou, Zhejiang 310018, China
  • Received:2022-05-30 Revised:2022-09-27 Online:2023-09-15 Published:2023-10-30

Abstract:

Objective The knotting machine in the circular weft knitting production line absorbs the yarn at the end of different yarn cylinders through the yarn guide tube, and sends the absorbed yarn to the knotting device to complete the knotting process. Aiming at the problem that it is difficult to detect the multi-state and multi-type yarn absorption in the yarn guide tube of the splitter, a detection scheme based on machine vision was proposed to realize the real-time monitoring of yarn number and color in the yarn guide tube of the knot machine to ensure the reliability of the joint.

Method In order to overcome the limitation of convenional yarn detection, an image classification method based on deep learning was proposed. 3 500 collected images were divided into 2 800 training sets and 700 test sets, and 560 images were separated from the training set as the verification set. Following that, a lightweight self-built student network was constructed by using superposition depth separable convolution. In order to overcome the defects of low accuracy and weak generalization performance of students' network, the combination training method of transfer learning and knowledge distillation was utilized to train the self-built network, and the final trained student network weight was deployed on the mobile terminal.

Results Experimental results showed that the teacher network using transfer learning had a verification set accuracy of more than 92% after the first round, and the convergence speed of the loss curve was also significantly accelerated (Fig. 9). When the student network was trained by knowledge distillation, the setting of loss weight α and distillation temperature T had no rule on the verification accuracy of the network. Compared with the student network verification accuracy of 95.7% before distillation, it was improved in general (Tab. 3). When the loss weight α was set to 0.2 and the distillation temperature T was set to 3, the best effect was achieved, and the top-1 accuracy on the verification set reached 99.57%. Comparative experiments of model reasoning were conducted on student network, teacher network and typical lightweight network before and after distillation (Tab. 4). The accuracy of the student network, which was originally 96.00% accurate on the test set, was improved to 99.28% after distillation. In addition, compared with the current typical lightweight model, the self-built lightweight student network had fewer parameters and less computation, which indirectly improved the forward reasoning time of the model. When the trained self-built network was deployed on the embedded terminal for actual test, the probability of a single yarn was higher than 70% (Fig. 11), while the probability of a double yarn was higher than 80%. The actual yarn detection accuracy rate was 98.86% after repeated experimental test on the yarn (Tab. 5). The difference in test accuracy between PC and embedded terminal was observed. The analysis showed that the PC side test was in the form of pictures taken before, while the embedded side test was in the form of actual video stream. On the other hand, the precision of weight parameters may be lost during the process of model quantization acceleration and deployment.

Conclusion The analysis result shows that, on the one hand, the PC side test is in the form of pictures taken before, while the embedded side test is in the form of actual video stream. On the other hand, the precision of weight parameters may be lost during the process of model quantization acceleration and deployment. It can be seen from the above yarn testing results that it meets the practical application needs and lays a solid foundation for promoting the application and popularization of the later knotting machine. In addition, the current yarn detection device is suitable for the knotting machine, but only it is necessary to optimize and upgrade the hardware and algorithm, useful in many occasions relating to yarn detection. Its lightweight size and low cost are undoubtedly progressed with commercial promotion value and significance.

Key words: yarn recognition, lightweight neural network, knowledge distillation, transfer learning, deployment model, knitting

CLC Number: 

  • TP391.41

Fig. 1

Schematic diagram of yarn frame (a) and knotting mechanism (b)"

Fig. 2

Schematic diagram of yarn detection process"

Fig. 3

Visualization of yarn sample set"

Fig. 4

Function module diagram of yarn detection board"

Fig. 5

Visualization of yarn sample set. (a)Common single; (b)Common double; (c) Hairiness single; (d)Hairiness double; (e)Bamboo single; (f) Bamboo double"

Fig. 6

Data enhancement changes"

Fig. 7

Schematic diagram of student network structure"

Tab. 1

Student network structure"

类型 卷积核尺寸/步长 输入尺寸
标准卷积 3×3/2 224×224×3
深度可分离卷积块 3×3/2,1×1 112×112×32
深度可分离卷积块 3×3/2,1×1 56×56×64
深度可分离卷积块 3×3/2,1×1 28×28×64
深度可分离卷积块 3×3/2,1×1 14×14×128
深度可分离卷积块 3×3,1×1 7×7×256
池化层 7×7 7×7×512
全连接层 512×7 1×1×512
Softmax 分类输出 1×1×7

Fig. 8

Overall training and deployment flow chart"

Tab. 2

Experimental parameter settings"

参数名称 参数值
模型输入尺寸 224×224×3
交叉熵损失函数 Categorical_crossentropy
优化器 Adam
分类器 Softmax
迭代次数 100
批大小 32
学习率 0.000 1

Fig. 9

Accuracy rate (a) and training loss (b) of verification set under transfer learning"

Tab. 3

Influence of parameters T and α on top-1 accuracy"

T 验证集Top-1准确率/%
α=0.1 α=0.2 α=0.3 α=0.4
1 99.04 99.21 99.21 97.96
3 99.21 99.57 97.61 98.68
5 97.72 97.61 99.21 99.57
7 98.68 97.96 99.04 97.96
10 99.04 99.21 99.39 97.68

Fig. 10

Accuracy rate (a) and training loss (b) of validation set under knowledge distillation"

Tab. 4

Comparison of network model inference performance"

模型 准确率/
%
参数量
106
运算量
106
内存大小/
MB
时间/ms
CPU GPU
老师网络
(ResNet34)
99.89 21.29 3 670 37.61 63.99 7.46
学生网络 96.00 0.19 34.44 10.12 8.11 1.73
KD+学生
网络
99.28 0.19 34.44 10.12 8.12 1.77
MobileNet_
V3_Small
99.16 1.53 58.80 50.39 22.07 7.33
ShuffleNet_
V2_x0.5
99.27 1.37 43.65 11.24 26.97 9.35

Fig. 11

Yarn inspection effect diagram. (a)Common single; (b)Common double; (c) Hairiness single; (d)Hairiness double;(e)Bamboo single;(f) Bamboo double"

Tab. 5

Embedded end detection accuracy"

类别 测试数量/张 正确数量/张 准确率/%
无纱 50 50 100
黑色普通单根 50 49 98
黑色普通双跟 50 50 100
白色毛羽单根 50 49 98
白色毛羽双根 50 50 100
白色竹节单根 50 48 96
白色竹节双根 50 50 100
总计 350 346 98.86
[1] 马海鹏. 针织圆纬机自动化和信息化关键技术研究[D]. 杭州: 浙江理工大学, 2017: 5-7.
MA Haipeng. Key Technology Research on automation and informatization of circular knitting machine[D]. Hangzhou: Zhejiang Sci-Tech University, 2017: 5-7.
[2] 赵文锐, 贺秋森, 张婧怡, 等. 纱线打结拓扑结构的稳定性研究[J]. 棉纺织技术, 2021, 49(8): 22-25.
ZHAO Wenrui, HE Qiusen, ZHANG Jingyi, et al. Study on the stability of yarn knotting Topology[J]. Cotton Textile Technology, 2021, 49(8): 22-25.
[3] 景慎全. 中国色纺纱行业的技术进步和发展趋势[J]. 纺织导报, 2020, 919(6): 22-27.
JING Shenquan. Technical progress and development trend of China's color spinning yarn industry[J]. China Textile Leader, 2019, 919(6): 22-27.
[4] 王萌萌, 刘成霞. 基于卷积神经网络的织物缝纫平整度客观评价[J]. 毛纺科技, 2020, 48(5): 87-91.
WANG Mengmeng, LIU Chengxia. Objective evaluation of fabric sewing smoothness based on convolutional neural network[J]. Wool Textile Technology, 2020, 48(5): 87-91.
[5] 吴震宇, 陈琳荣, 李子军, 等. 接触式纱线张力传感器动态测量模型[J]. 纺织学报, 2013, 34(8): 138-142.
WU Zhenyu, CHEN Linrong, LI Zijun, et al. Contactyarn tension sensor dynamic measurement model[J]. Journal of Textile Research, 2013, 34(8): 138-142.
[6] 章钰娟, 彭来湖, 徐郁山, 等. 非接触式纱线状态检测技术研究[J]. 现代纺织技术, 2022, 30(1): 101-108.
ZHANG Yujuan, PENG Laihu, XU Yushan, et al. Non-contact yarn state detection technology research[J]. Journal of Modern Textile Technology, 2022, 30 (1): 101-108.
[7] 李东洁, 郭帅, 杨柳. 基于改进图像阈值分割算法的纱线疵点检测[J]. 纺织学报, 2021, 42(3): 82-88.
LI Dongjie, GUO Shuai, YANG Liu. Yarn defect detection based on improved image threshold segmentation algorithm[J]. Journal of Textile Research, 2021, 42(3): 82-88.
[8] 张缓缓, 赵妍, 景军锋, 等. 基于亚像素边缘检测的纱线条干均匀度测量[J]. 纺织学报, 2020, 41(5): 45-49.
ZHANG Huanhuan, ZHAO Yan, JING Junfeng, et al. Yarn evenness measurement based on sub-pixel edge detection[J]. Journal of Textile Research, 2020, 41(5): 45-49.
[9] 马珂, 严凯, 张缓缓, 等. 基于贝叶斯阈值的纱线毛羽检测方法研究[J]. 棉纺织技术, 2021, 49(4):11-15.
MA Ke, YAN Kai, ZHANG Huanhuan, et al. Research on yarn hairiness detection method based on bayesian threshold[J]. Cotton Textile Technology, 2021, 49(4): 11-15.
[10] ZHANG X, ZHOU X, LIN M, et al. Shufflenet: an extremely efficient convolutional neural network for mobile devices[C]// Proceedings of the IEEE conference on computer vision and pattern recognition. 2018: 6848-6856.
[11] Chollet F. Xception: deep learning with depthwise separable convolutions[C]// Proceedings of the IEEE conference on computer vision and pattern recognition. 2017: 1251-1258.
[12] 董萍, 卫梦华, 时雷, 郭伟. 迁移学习在玉米叶片病害识别中的研究与应用[J]. 中国农机化学报, 2022, 43(3): 146-152.
DONG Ping, WEI Menghua, SHI Lei, et al. Migration study in research and application of corn leaf disease recognition[J]. Journal of Chinese Agricultural Mechanization, the Lancet, 2022, 43(3): 146-152.
[13] 黄震华, 杨顺志, 林威, 等. 知识蒸馏研究综述[J]. 计算机学报, 2022, 45(3): 624-653.
HUANG Zhenhua, YANG Shunzhi, LIN Wei, et al. A review of knowledge distillation[J]. Chinese Journal of Computers, 2022, 45(3): 624-653.
[1] LI Yuxian, WU Xiaowen, WU Guangjun, CONG Honglian. Parametric design modeling and implementation of patterns for knit sweaters [J]. Journal of Textile Research, 2023, 44(09): 168-174.
[2] LI Luhong, ZHAO Boyu, CONG Honglian. Design and performance of warp knit capacitive sensor using silver plated PA/cotton yarns with composite structure [J]. Journal of Textile Research, 2023, 44(08): 88-95.
[3] SUN Yuanyuan, ZHANG Qi, ZHANG Yanting, ZUO Lujiao, DING Ningyu. Development of three-jacquard spacer shoe fabrics with three-dimensional mesh structure and three-jacquard color [J]. Journal of Textile Research, 2023, 44(07): 110-115.
[4] ZHENG Peixiao, JIANG Gaoming, CONG Honglian, LI Bingxian. Design and three-dimensional simulation of multi-color striped fabrics [J]. Journal of Textile Research, 2023, 44(06): 85-90.
[5] ZHANG Jing, CONG Honglian, JIANG Gaoming. Establishment and realization of technological model for weft-knitted two-side transfer fabrics [J]. Journal of Textile Research, 2023, 44(06): 98-104.
[6] LI Yuxian, CONG Honglian, WU Guangjun. Full forming process design for three-dimensional knitted products [J]. Journal of Textile Research, 2023, 44(05): 132-138.
[7] YANG Hongmai, ZHANG Xiaodong, YAN Ning, ZHU Linlin, LI Na'na. Robustness algorithm for online yarn breakage detection in warp knitting machines [J]. Journal of Textile Research, 2023, 44(05): 139-146.
[8] YAN Bingyi, HOU Jin, HUANG Qiyu, YANG Hancheng, TIAN Jin, YANG Chunyong. Online recognition system for typical traditional costume images [J]. Journal of Textile Research, 2023, 44(05): 184-190.
[9] TU Jiajia, LI Changzheng, DAI Ning, SUN Lei, MAO Huimin, SHI Weimin. Detection methods for yarn capture state with automatic knotter [J]. Journal of Textile Research, 2023, 44(05): 205-212.
[10] CHEN Zhihao, BAO Wenjie, LI Fucai, JING Bo, HUANG Chaolin, SUN Jianwen. Vibration analysis of high speed warp knitting machine based on fast empirical mode decomposition [J]. Journal of Textile Research, 2023, 44(04): 204-211.
[11] YIN Ang, CONG Honglian. Design and structure optimization of warp knitted unidirectional moisture conducting fabrics [J]. Journal of Textile Research, 2023, 44(04): 86-91.
[12] NIU Li, LIU Qing, CHEN Chaoyu, JIANG Gaoming, MA Pibo. Fabrication and performances of self-powering knitted sensing fabric with bionic scales [J]. Journal of Textile Research, 2023, 44(02): 135-142.
[13] FENG Yingjie, JIANG Gaoming, WU Guangjun, JIN Shuai. Structural design and forming method for one-piece sports knee pads [J]. Journal of Textile Research, 2023, 44(01): 112-118.
[14] PENG Laihu, ZHANG Yujuan, LÜ Yongfa, DAI Ning, LI Jianqiang. Detection method and dynamic characteristics of weft yarn delivery [J]. Journal of Textile Research, 2022, 43(12): 167-172.
[15] CHEN Yushan, JIANG Gaoming, LI Bingxian. Design and 3-D simulation of weft knitted wrap fabric [J]. Journal of Textile Research, 2022, 43(12): 62-68.
Viewed
Full text


Abstract

Cited

  Shared   
  Discussed   
No Suggested Reading articles found!