Journal of Textile Research ›› 2024, Vol. 45 ›› Issue (07): 72-77.doi: 10.13475/j.fzxb.20230307001

• Textile Engineering • Previous Articles     Next Articles

Fabric quality prediction technology based on K-nearest neighbor algorithm improved particle swarm optimization-back propagation algorithm

SUN Changmin1, DAI Ning1(), SHEN Chunya2, XU Kaixin1, CHEN Wei3, HU Xudong1, YUAN Yanhong1, CHEN Zuhong2   

  1. 1. Key Laboratory of Modern Textile Machinery & Technology of Zhejiang Province, Zhejiang Sci-Tech University, Hangzhou, Zhejiang 310018, China
    2. Zhejiang Kangli Automation Technology Co., Ltd., Shaoxing, Zhejiang 312500, China
    3. Zhejiang Tianheng Information Technology Co., Ltd., Shaoxing, Zhejiang 312500, China
  • Received:2023-03-30 Revised:2024-03-12 Online:2024-07-15 Published:2024-07-15
  • Contact: DAI Ning E-mail:990713260@qq.com

Abstract:

Objective The confirmation of fabric quality in the textile industry is usually to put the woven fabric into the inspection equipment for inspection. When the fabric defects are found in the inspection process, the repair will be carried out and so increases the production time, thereby reducing the workshop efficiency. In order to improve the efficiency of the workshop, by collecting the real-time data of the weaving workshop, the fabric quality prediction model is established to predict the fabric quality and reduce the fabric production time.

Method Aiming at the problem of large difference in fabric quality and long time of conventional fabric inspection, a fabric quality grade prediction method based on K-nearest neighbor algorithm(KNN)improved PSO-BP algorithm was proposed by combining KNN and particle swarm optimization (PSO) improved error back propagation (BP) neural network algorithm. Firstly, the fabric quality prediction model is analyzed, and the fabric defects and fabric quality grades are divided. Secondly, 14 factors affecting the fabric quality are selected as the model input, and then the KNN algorithm is adopted to classify the original sample set. Finally, the classified data is brought into the fabric quality prediction model. The fabric quality prediction model is to use the particle swarm optimization algorithm to obtain the position and speed of the optimal solution through iterative update, and take this as the initial weight and threshold into the neural network structure for training to obtain the model. By predicting the fabric quality grade, the fabric quality is improved.

Results 16,186 fabric production data collected over a 3-month period from a textile factory in Lanxi, Zhejiang Province were adopted to establish a fabric quality prediction model. Firstly, the original data set was adopted to compare and analyze PSO-BP and BP algorithms with different training target errors. According to results of KNN-PSO-BP netural network model, PSO-BP algorithm showed higher accuracy and higher training speed than BP algorithm, and PSO-BP neural network model demonstrated an accuracy of 96% with the training target error 0.000 1. The KNN algorithm was adopted to divide the original sample set into five categories. The mean square error, accuracy and training time of the neural network model were calculated when the training target error is 0.000 1. The accuracy of the KNN-PSO-BP neural network model was 98.054%.

Conclusion This research demonstrated that KNN-PSO-BP algorithm has higher accuracy than PSO-BP algorithm and BP algorithm. The training time of fabric quality grade prediction is only 4.8 s, and the accuracy rate is 98.054%. The algorithm greatly shortens the detection time while ensuring the accuracy of fabric quality prediction, improves the production efficiency of weaving, and provides a certain basis for subsequent research on the location and size of fabric defects.

Key words: weaving workshop, fabric quality, K-nearest neighbor algorithm, particle swarm optimization-back propagation neural network algorithm, fabric quality prediction

CLC Number: 

  • TS103.3

Fig.1

Flow chart of fabric quality prediction"

Fig.2

Classification algorithm operation flowchart"

Tab.1

European distance di from test set to training set"

测试集编号 di
1135 0
68 38
3 78
10275 1 090
3556 1 258

Tab.2

Calculation results of errors of different training objectives"



算法
0.01 0.005 0.001 0.0001
均方
误差
准确率/
%
训练
时长/s
均方
误差
准确率/
%
训练
时长/s
均方
误差
准确率/
%
训练
时长/s
均方
误差
准确率/
%
训练
时长/s
PSO-BP 0.136 92 4.304 0.129 92 4.098 0.100 94 4.051 0.060 96 3.089
BP 0.293 88 3.848 0.285 90 3.673 0.218 90 3.716 0.310 83 4.375

Fig.3

Prediction results of five kinds of samples. (a) First class; (b) Second class; (c) Third class; (d) Fourth class; (e) Fifth class"

Tab.3

Calculation results of KNN-PSO-BP netural network model for five kinds of samples"

参数 训练目标误差为0.000 1
均方误差 准确率/% 训练时长/s
第1类 0.124 97.55 8.284
第2类 0.195 98.47 3.869
第3类 0.159 100.00 0.875
第4类 0.200 97.39 4.777
第5类 0.103 96.86 6.005
平均值 0.124 98.054 4.762
[1] 熊经纬, 杨建国, 徐兰. 基于PSO-BP神经网络的纱线质量预测[J]. 东华大学学报(自然科学版), 2015, 41(4): 498-502.
XIONG Jingwei, YANG Jianguo, XU Lan. Combining the particle swarm optimization with BP neural network for yarn quarlity forecasting[J]. Journal of Donghua University(Natural Science), 2015, 41 (4): 498-502.
[2] 王侃枫, 马佳陆. 基于遗传规划的纱线质量预测[J]. 纺织报告, 2020, 39(12): 21-23,26.
WANG Kanfeng, MA Jialu. Yarn quality prediction based on genetic programming[J]. Textile Reports, 2020, 39(12): 21-23,26.
[3] 查刘根, 谢春萍. 应用四层BP神经网络的棉纱成纱质量预测[J]. 纺织学报, 2019, 40(1): 52-54,61.
ZHA Liugen, XIE Chunping. Prediction of cotten yarn quality based on four-layer BP neural network[J]. Journal of Textile Research, 2019, 40(1): 52-54,61.
[4] 金守峰, 侯一泽, 焦航, 等. 基于改进AlexNet模型的抓毛织物质量检测方法[J]. 纺织学报, 2022, 43(6): 133-139.
JIN Shoufeng, HOU Yize, JIAO Hang, et al. An improved AlexNet model for fleece fabric quality inspection[J]. Journal of Textile Research, 2022, 43(6): 133-139.
[5] 郭波, 吕文涛, 余序宜, 等. 基于改进YOLOv5模型的织物疵点检测算法[J]. 浙江理工大学学报(自然科学版), 2022, 47(5): 755-763.
GUO Bo, LÜ Wentao, YU Xuyi, et al. Fabric defect detection algorithm based on improved YOLOv5 model[J]. Journal of Zhejiang Sci-Tech University(Natural Science), 2022, 47(5): 755-763.
[6] 王玉亮, 于伟东. 织造工艺过程质量预报及质量控制[J]. 毛纺科技, 2004(10): 13-16.
WANG Yuliang, YU Weidong. Quality forecast and control for weaving processing[J]. Wool Textile Journal, 2004(10): 13-16.
[7] 王玉亮, 于伟东. 毛精纺中织造质量的BP神经网络预报技术[J]. 东华大学学报(自然科学版), 2006(1): 84-88.
WANG Yuliang, YU Weidong. Forecasting technique of BP neural network in weaving processing of wool worsted[J]. Journal of Donghua University(Natural Science), 2006(1): 84-88.
[8] 张著英, 黄玉龙, 王翰虎. 一个高效的KNN分类算法[J]. 计算机科学, 2008(3): 170-172.
ZHANG Zhuying, HUANG Yulong, WANG Hanhu. A new KNN classfication approach[J]. Computer Science, 2008(3): 170-172.
[9] 王嵘冰, 徐红艳, 李波, 等. BP神经网络隐含层节点数确定方法研究[J]. 计算机技术与发展, 2018, 28(4): 5.
WANG Rongbing, XU Hongyan, LI Bo, et al. Research on method of determining hidden layer nodes in BP neural network[J]. Computer Technology and Development, 2018, 28(4): 5.
[10] 李爱国, 覃征, 鲍复民, 等. 粒子群优化算法[J]. 计算机工程与应用, 2002(21): 1-3.
LI Aiguo, QIN Zheng, BAO Fumin, et al. Partical swarm optimization algorithms[J]. Computer Engineering and Applications, 2002(21): 1-3.
[1] SHEN Chunya, FANG Liaoliao, PENG Laihu, LIANG Huijiang, DAI Ning, RU Xin. Production scheduling of warping department based on adaptive simulated annealing algorithm [J]. Journal of Textile Research, 2024, 45(03): 81-86.
[2] LEI Junjie, SHEN Chunya, HU Xudong, RU Xin, PENG Laihu. Large-scale scheduling of weaving workshop based on NSGAII and neural network [J]. Journal of Textile Research, 2023, 44(11): 208-215.
[3] FU Han, HU Feng, GONG Jie, YU Lianqing. Defect reconstruction algorithm for fabric defect detection [J]. Journal of Textile Research, 2023, 44(07): 103-109.
[4] JIN Shoufeng, HOU Yize, JIAO Hang, ZHNAG Peng, LI Yutao. An improved AlexNet model for fleece fabric quality inspection [J]. Journal of Textile Research, 2022, 43(06): 133-139.
[5] SHEN Chunya, LEI Junjie, RU Xin, PENG Laihu, HU Xudong. Multi-objective large-scale dynamic scheduling for weaving workshops based on improved NSGAII [J]. Journal of Textile Research, 2022, 43(04): 74-83.
Viewed
Full text


Abstract

Cited

  Shared   
  Discussed   
No Suggested Reading articles found!