Cotton yarn evenness prediction model construction method
By using multiple strategies to improve the sparrow search algorithm in the cotton yarn dry uniformity prediction model, combined with strategies such as the Good Point Set and Levy flight behavior, the accuracy and stability of cotton yarn dry uniformity prediction in the actual industrial environment of textile enterprises are solved. The problem is that high-precision prediction results are achieved and are suitable for the production environment of textile enterprises.
Patent Information
- Application Number
- CN202411237804.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-04
- Publication Date
- 2024-12-27
AI Technical Summary
The existing technology is difficult to accurately predict the uniformity of strip dryness of cotton yarn in actual industrial environments. The traditional BP neural network model has low prediction accuracy and is easy to fall into local optimal solutions. Tao Jing's online extraction method is only applicable to experimental environments and cannot be directly applied. in textile enterprises.
The cotton yarn dry uniformity prediction model based on multi-strategy improvement sparrow search algorithm is adopted. By pre-processing the raw cotton data, the topological structure of the BP neural network is determined, and the sparrow population position is initialized using the good point set strategy, combining Levy flight behavior and championship selection The method updates the population position, ensures the diversity and optimization effect of the model, and finally determines the optimal weight and threshold of the BP neural network, so as to achieve accurate prediction of the dry uniformity of the cotton yarn strip.
Improve the accuracy and stability of prediction of dry uniformity of cotton yarn, overcome the problems of traditional BP neural networks that are prone to local minimum values and low prediction accuracy, can be directly applied in actual factory environments, providing reliable quality control and production optimization .
Smart Images

Figure CN119204145A_ABST
Abstract
Description
Technical Field
[0001] The invention belongs to the technical field of spinning, and in particular relates to a method for constructing a cotton yarn evenness prediction model for spinning control. Background Art
[0002] The textile industry is an important pillar of the national economy. In the textile production process, the quality of cotton yarn is the most critical factor. High-quality cotton yarn has an important impact on fabric quality, fabric production efficiency and fabric market competitiveness. Among them, the key indicator for measuring cotton yarn quality is yarn uniformity. Yarn uniformity is a parameter that reflects whether the thickness of the yarn is consistent. The larger the value, the more uneven the thickness of the yarn, and the worse the quality. One of the important factors affecting the uniformity of cotton yarn is the characteristics of raw cotton. However, due to the complex nonlinear relationship between the characteristics of raw cotton and the uniformity of cotton yarn, the uniformity of cotton yarn is difficult to measure accurately. Therefore, it is very important to find a reasonable method to predict the uniformity of cotton yarn.
[0003] Based on the traditional three-layer BP neural network model, Liu Gen et al. proposed a four-layer BP neural network model with double hidden layers, which reduced the relative average error of cotton thread evenness from 10.2% to 8.3%. Although this method can predict the quality of cotton thread, the prediction accuracy is still low. In addition, Tao Jing et al. proposed an online extraction method that combines deep learning and morphological operations to provide high-quality contour feature extraction and achieve accurate extraction of strip evenness contour under hairiness interference. However, Tao Jing's method is only applicable to experimental environments and cannot be directly applied to textile enterprises.
[0004] Therefore, in order to solve the above problems, it is necessary to provide a prediction model that has high prediction accuracy for cotton yarn evenness and can be applied to actual industrial production. Summary of the invention
[0005] The present invention provides a method for constructing a cotton yarn evenness prediction model based on a multi-strategy improved sparrow search algorithm. The constructed prediction model can accurately predict the cotton yarn evenness and can be directly used in an actual factory production environment.
[0006] To achieve the above object, the present invention adopts the following technical scheme: a method for constructing a cotton yarn uniformity prediction model, characterized in that the method is implemented by the following steps:
[0007] The first step is to preprocess the raw cotton data;
[0008] The second step is to determine the topological structure of the BP neural network;
[0009] The third step is to use the good point set strategy to initialize the position of the sparrow population and calculate the fitness value of each individual sparrow;
[0010] The fourth step is to update the discoverer position based on the improved strategy of Levy flight behavior;
[0011] Step 5: Update the follower position;
[0012] Step 6: Update the explorer position using the tournament selection method;
[0013] Step 7: Update fitness;
[0014] Step 8: Determine whether the iteration stop condition is met. If it is met, proceed to the next step, otherwise return to step 3;
[0015] The ninth step is to determine the optimal weights and thresholds of the BP neural network;
[0016] The tenth step is to use the BP neural network of the optimal individual to simulate and predict the uniformity of the cotton yarn, and further provide a reliable and accurate prediction value for the uniformity of the cotton yarn.
[0017] The first step of preprocessing the raw cotton data includes data cleaning, data conversion and feature selection.
[0018] The data cleaning process includes removing data that is useless for the research question and duplicate data items to reduce the redundancy of the data set.
[0019] The data conversion refers to normalizing the data, and the formula is: X is a set of raw cotton data in the spinning data set, max(X) is the maximum value in one set of raw cotton data, x i Enter the value for the raw cotton data, y i is the normalized output data.
[0020] The feature selection refers to the use of a combination of grayscale correlation analysis and mutual information method to reduce the dimension of 12 raw cotton indicators collected during the cotton yarn forming process, and to mine the 5 most important raw cotton indicators as input variables of the BP neural network prediction model.
[0021] In the second step, the topological structure of the BP neural network is determined, specifically, the input layer nodes, output layer nodes, number of hidden layers, number of nodes per hidden layer, and activation function. The five most important raw cotton indicators in feature selection are used as input layer nodes. The neuron for cotton yarn uniformity is used as the output layer node. The output layer only requires one hidden layer for the BP neural network, and the network can perform any function, so a single hidden layer BP neural network structure is used. The number of neurons S in the hidden layer of the network can be obtained by the empirical formula It is concluded that, where n is the number of neurons in the network input layer, m is the number of neurons in the network output layer, α is the adjustment constant between [1,10], here α is selected as 1, and the number of neurons S in the hidden layer of the network is 4 through the empirical formula. The selection of the activation function is crucial to the topological structure of the BP neural network. Here, the hyperbolic tangent function tanh is selected as the activation function of the BP neural network. The function expression of tanh is The output of tanh is centered on 0, which helps make the neuron input values of subsequent layers contain both positive and negative values, which helps with model training.
[0022] The population initialization method based on the good point set strategy in the third step can ensure that the population is evenly distributed, thereby making the population diverse and ergodic. Specifically, the good point set G is defined as D is the unit cube, r∈G D , and the form is: Deviation Satisfaction In the formula: C(r,ε) is a constant that is only related to r and ε (ε>0).
[0023] The fourth step introduces an improved strategy of Levy flight behavior to update the position of the discoverer. This strategy effectively avoids the problem of the algorithm falling into the local optimal solution during the iteration process, balances the contradiction between the optimization speed and the solution accuracy in the optimization algorithm, and solves the optimization problem of high-dimensional space. The discoverer can give priority to the position with a better fitness value, be responsible for searching for food, and provide the direction of the food source for other discoverers to join. The position update of the discoverer is expressed as t represents the current iteration number; represents the position value of the i-th sparrow in the population on the j-th dimension, where i = 1, 2, ..., n, j = 1, 2, ..., D; T max A constant representing the maximum number of iterations; α is a random number, and its value range is α∈(0,1]; the value range of the warning parameter R2 is R2∈[0,1]; the safety parameter S t The value range of The matrix L is a 1×D vector with all elements equal to 1. t t , it means that there is no predator. At this time, the discoverer can conduct a large-scale search around the foraging location. Otherwise, it means that a predator has appeared, and it is necessary to alert the companions and move the search to a safer foraging location.
[0024] After the improvement of the levy flight behavior disturbance in the fifth step, the follower position update formula is: Where: The best current position for the finder; Indicates the worst position of the current iteration; the matrix A represents a 1×D vector, where the elements of the vector are randomly selected as 1 or -1, and satisfy the condition A + =A T (AA T ) -1 , if i>n / 2, it means that the joiner with lower fitness value of i fails to obtain food and flies to other places to find food. The search Levy flight mechanism is: Wherein: r3 and r4 are both random numbers in the range of [0,1], and the value of ξ in the present invention is 1.5.
[0025] In the sixth step, the tournament selection strategy is to take out a part of individuals from the population each time, and select the individuals with relatively large fitness to enter the next generation population. The present invention adopts a binary tournament selection method, that is, by randomly selecting any two sparrow individuals for comparison, and then allowing the individual with the larger fitness value to enter the next generation population, repeating n times until the new population size reaches the original population size, and the individual with the higher final score has a higher weight. Based on the tournament selection strategy, it ensures that each sparrow individual has the same probability of being selected, avoids the influence of super individuals on the evolution process, and protects the diversity of the sparrow population. The formula for selection probability is c i Score individual sparrows. i is the probability of a sparrow being selected. The formula for updating the reconnaissance and early warning behavior based on the tournament is: t represents the position of the individual sparrow selected after the tth iteration.
[0026] In the seventh step, the fitness value is updated by calculating the objective function value of each individual to obtain the evaluation fitness, and the fitness value of each individual is updated according to the evaluation result of the individual, and then it is standardized to map the fitness to a suitable range, usually [0,1]. In the present invention, the fitness value of each individual is divided by the maximum value of all fitness values in the population to achieve it, and the calculated standardized fitness value is linked to the individual, and the fitness value stored in the individual is updated to complete the update of the fitness. The fitness value can reflect the performance of the individual in the current population. The higher the fitness value, the greater the advantage of the individual, and the greater the probability of being selected in the evolutionary process.
[0027] In the eighth step, it is determined whether the iteration stop condition is met, and the difference between the current iteration result and the target result is calculated. If the calculated difference is less than the set threshold, it is considered that the iteration condition is met and the next step is continued. Otherwise, it returns to the third step and iterates again until the iteration condition is met. When performing the calculation, a maximum number of iterations needs to be set as the iteration condition. When the number of iterations reaches the set value, even if the iterated result does not match the set threshold, the iteration condition will be met and the next step will be performed.
[0028] In the ninth step, the optimal weights and thresholds are determined by iterative optimization through the training data set. First, all the weights and thresholds of the network are randomly initialized, and a suitable loss function is selected. In the present invention, the mean square error (MSE) is selected as the loss function, and the input data is forward propagated through the neural network to calculate the error between the output value of each neuron and the actual output value. The partial derivatives of the errors of neurons in each layer with respect to the weights and thresholds are calculated using the chain rule based on the errors. The gradient of the loss function (MSE) is used to backpropagate from the output layer to adjust the weights and thresholds of neurons in each layer, and the above steps are repeated to determine the optimal weights and thresholds of the BP neural network.
[0029] In the tenth step, the BP neural network of the optimal individual selected by the above steps can provide a reliable and accurate prediction value of the uniformity of cotton yarn. Such prediction results can be used for quality control and optimization in industrial production, help improve production processes, and improve product quality. In order to obtain better prediction results, certain work needs to be done in data preprocessing, neural network structure design, and parameter tuning. In addition, for the problem of cotton yarn uniformity prediction, it may also be necessary to consider the influence of other factors, such as raw material quality, processing equipment, etc., to improve the accuracy and stability of the prediction.
[0030] Compared with the prior art, the present invention has the following beneficial effects:
[0031] 1. The present invention is based on the traditional BP neural network model, improves the sparrow search algorithm, introduces the optimal point set uniform population strategy, the modified strategy based on levy flight behavior, the tournament selection method, etc. This model overcomes the problems of the traditional BP neural network that is easy to fall into the local minimum, low prediction accuracy, poor population diversity, super individuals affecting the evolution process, etc., and ensures the accuracy of cotton yarn quality prediction.
[0032] 2. The cotton yarn evenness prediction model based on the multi-strategy improved sparrow search algorithm of the present invention can be separated from the experimental environment and directly applied to the actual factory environment, thus providing a guarantee for the spinning benefits of textile enterprises. BRIEF DESCRIPTION OF THE DRAWINGS
[0033] Figure 1 It is a flow chart of the steps of the method of the present invention.
[0034] Figure 2 It is a schematic diagram of the basic structure of the three-layer BP neural network adopted in the present invention.
[0035] Figure 3 It is a comparison diagram of the random point distribution and the uniform population of the best point set distribution of the present invention.
[0036] Figure 4It is a grey correlation diagram between various raw cotton indexes and cotton yarn evenness of the present invention.
[0037] Figure 5 It is a mutual information diagram of various raw cotton indicators and cotton yarn evenness of the present invention.
[0038] Figure 6 It is a comparison chart of mean square error iteration curves of various BP neural network algorithms adopted by the present invention.
[0039] Figure 7 It is the ISSA-BP network prediction output diagram of the strip uniformity of the present invention. DETAILED DESCRIPTION
[0040] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present invention.
[0041] The following is combined with Figure 1-7 The present invention is described in further detail.
[0042] like Figure 1 As shown, a method for constructing a cotton yarn uniformity prediction model of the present invention is implemented by the following steps: the first step is to preprocess the raw cotton data; the second step is to determine the topological structure of the BP neural network; the third step is to initialize the position of the sparrow population using the best point set strategy and calculate the fitness value of each sparrow individual; the fourth step is to update the discoverer position based on the improved strategy of Levy flight behavior; the fifth step is to update the follower position; the sixth step is to update the explorer position using the tournament selection method; the seventh step is to update the fitness; the eighth step is to determine whether the iteration stop condition is met, and if it is met, continue to the next step, otherwise return to the third step; the ninth step is to determine the optimal weight and threshold of the BP neural network; the tenth step is to use the BP neural network of the optimal individual to simulate and predict the cotton yarn uniformity, and further provide a reliable and accurate prediction value for the cotton yarn uniformity.
[0043] Reference Figure 2 The present invention adopts a single hidden layer BP neural network structure to train the data to obtain a prediction model. The single hidden layer BP neural network has fewer parameters, a relatively fast training speed, and a relatively simple model structure, which is more suitable for the present invention.
[0044] The present invention adopts the method of uniform population of good point set when initializing the population. The present invention uses the random point distribution method and the good point set point distribution method to construct an initial population distribution map containing 50 two-dimensional points. For details, refer to Figure 3,Comparing the two, initializing the population with the best point set will make the population distribution more uniform, maintain the diversity of the population, and avoid the occurrence of premature phenomenon.
[0045] Example
[0046] In this embodiment, spinning is carried out under the same production conditions, and a total of 60 groups of sample data are collected, of which the first 50 groups of data are used to train the model, and the last 10 groups of data are used to test the accuracy of the model. Part of the data is shown in Table 1.
[0047] Table 1 Part of the original data
[0048]
[0049] The present invention compares the upper half length, uniformity, 16mm short lint rate, maturity, micronaire value, strength, fineness, 5% length, upper quarter length, 12.7mm short lint rate, moisture regain, elongation and other characteristics. The gray correlation value calculated by gray correlation analysis can intuitively determine which characteristics are highly correlated with the raw cotton performance and the uniformity of the cotton yarn. The gray correlation values of various raw cotton indicators and the uniformity of the cotton yarn are referenced Figure 4 According to the mutual information method, the amount of information shared between the selected features and the cotton yarn uniformity can be intuitively understood. The mutual information between the specific cotton yarn index and the cotton yarn uniformity can be referenced. Figure 5 , combined with Figure 4 , Figure 5 , based on the mutual information being not 0 and having a correlation with the dry uniformity of cotton yarn, elongation, uniformity, 16mm short fiber rate, strength, and fineness were finally selected as the input feature data of raw cotton performance.
[0050] In this example, Python's built-in mathematical processing module is first used for feature extraction, and then the Keras artificial neural network library written in Python is used to learn and train the cotton yarn evenness model. In the BP neural network model training, the maximum number of iterations is set to 500, the Adam algorithm learning rate is 0.001, and the Dropout probability is 0.2.
[0051] After the BP neural network model training is completed, GA (genetic algorithm), PSO (particle swarm algorithm), SSA (sparrow search algorithm) and ISSA (improved sparrow search algorithm) are used to simulate and train the neural network model. The specific comparison results of the error function iteration curves of various algorithms are shown in Figure 5 BP, GA-BP, PSO-BP and SSA-BP stabilized at 3.72×10 after 210, 288, 275 and 260 iterations, respectively. -2 , 2.55×10 -2 , 1.74×10 -2and 8.14×10 -3 , while ISSA converges to 7.04×10 after only 201 iterations. -3 The present invention uses the good point set strategy to uniformly initialize the population, adds the levy flight strategy in the sparrow follower update process, jumps out of the local optimal value, and then combines the tournament selection strategy to make full use of the population scout role function to effectively control the global search range in the later iteration. Figure 6 It is known that the ISSA-BP curve has an inflection point first and the convergence mean square error is the smallest. Therefore, it can be seen that the improved model has the fastest convergence speed and the highest convergence accuracy.
[0052] The present invention adopts a multi-strategy improved sparrow search algorithm to predict the uniformity of cotton yarn and compare it with the last 10 groups of data used to test the accuracy of the model. The BP, GA-BP, PSO-BP and other algorithms are compared to predict the uniformity of cotton yarn. The comparison results are shown in Table 2. The maximum relative error of the present invention for predicting the uniformity of cotton yarn is 4.63%, the best error is only 0.16%, and the average error is 1.52%. The prediction results of the present invention are compared with the true values. Figure 7 From the comprehensive results, the present invention has obvious advantages in the prediction convergence accuracy of cotton yarn uniformity, and can effectively avoid the problem of model overfitting. It shows that the cotton yarn uniformity prediction method of the present invention has good prediction accuracy, and also provides a feasible cotton yarn uniformity prediction method for spinning enterprises.
[0053] Table 2 Comparison of cotton yarn uniformity results
[0054]
Claims
1. A method for constructing a cotton yarn uniformity prediction model, characterized in that: This method is implemented by the following steps: The first step is to preprocess the raw cotton data; Including data cleaning, data conversion and feature selection; the data cleaning process includes removing data that is useless for the research problem and repeated data items to reduce the redundancy of the data set; The data conversion refers to normalizing the data, and the formula is: X is a set of raw cotton data in the spinning data set, max(X) is the maximum value in one set of raw cotton data, x i Enter the value for the raw cotton data, y i is the normalized output data; The feature selection refers to using a combination of grayscale correlation analysis and mutual information method to reduce the dimension of 12 raw cotton indicators collected during the cotton yarn forming process, including the upper half length, uniformity, 16mm short fiber rate, maturity, micronaire value, strength, fineness, 5% length, upper quarter length, 12.7mm short fiber rate, regain, and elongation, and to mine the 5 most important raw cotton indicators as input variables of the BP neural network prediction model; The second step is to determine the topological structure of the BP neural network; specifically, to determine the input layer nodes, output layer nodes, number of hidden layers, number of nodes per hidden layer, activation function, the five most important raw cotton indicators in feature selection as input layer nodes, the cotton yarn evenness neuron as output layer node, and a single hidden layer BP neural network structure. The number of neurons S in the hidden layer of the network is given by the empirical formula It is concluded that, where n is the number of neurons in the network input layer, m is the number of neurons in the network output layer, α is the adjustment constant between [1,10], and the hyperbolic tangent function tanh is selected as the BP neural network activation function. The function expression of tanh is The output of tanh is centered around 0; The third step is to use the good point set strategy to initialize the position of the sparrow population and calculate the fitness value of each sparrow individual; define the good point set G D is the unit cube, r∈G D , and the form is: Deviation Satisfaction Where: C(r,ε) is a constant related only to r and ε (ε>0); The fourth step is to update the discoverer position based on the improved strategy of Levy flight behavior; the discoverer position update is expressed as t represents the current iteration number; represents the position value of the i-th sparrow in the population on the j-th dimension, where i = 1, 2, ..., n, j = 1, 2, ..., D; T max A constant representing the maximum number of iterations; α is a random number, and its value range is α∈(0,1]; the value range of the warning parameter R2 is R2∈[0,1]; the safety parameter S t The value range of The matrix L is a 1×D vector with all element values 1; if R t t , it means that there is no predator, and the discoverer can conduct a large-scale search around the foraging location; otherwise, it means that a predator has appeared, and it is necessary to alert the companions and move to a safer foraging location; Step 5: Update the follower position. After improving the levy flight behavior perturbation, the follower position update formula is: Where: The best current position for the finder; Indicates the worst position of the current iteration; the matrix A represents a 1×D vector, where the elements of the vector are randomly selected as 1 or -1, and satisfy the condition A + =A T (AA T ) -1 , if i>n / 2, it means that the joiner with lower fitness value of i fails to obtain food and flies to other places to find food; the search Levy flight mechanism is: Where: r3 and r4 are random numbers in the range of [0,1]; Step 6: Use the binary tournament selection method to update the explorer position; that is, randomly select any two sparrow individuals for comparison, and then allow the individual with the larger fitness value to enter the next generation population, repeating n times until the new population size reaches the original population size, and the individual with the higher score has a higher weight; The formula for the probability of selection is c i is the score of the sparrow individual, P i is the probability of a sparrow individual being selected, and the formula for updating the reconnaissance and early warning behavior based on the tournament is: t represents the position of the individual sparrow selected after the tth iteration; Step 7: Update the fitness. This is done by dividing the fitness value of each individual by the maximum value of all fitness values in the population. The calculated standardized fitness value is associated with the individual, and the fitness value stored in the individual is updated to complete the fitness update. Step 8: Determine whether the iteration stop condition is met. If it is met, proceed to the next step, otherwise return to step 3; calculate the difference between the current iteration result and the target result. If the calculated difference is less than the set threshold, it is considered that the iteration condition is met; The ninth step is to determine the optimal weights and thresholds of the BP neural network; the optimal weights and thresholds are determined by iterative optimization through the training data set. First, all the weights and thresholds of the network are randomly initialized, and the mean square error is selected as the loss function. The input data is forward propagated through the neural network to calculate the error between the output value of each neuron and the actual output value. The partial derivative of the error of each layer of neurons with respect to the weights and thresholds is calculated using the chain rule based on the error. The gradient of the loss function is used to backpropagate from the output layer to adjust the weights and thresholds of each layer of neurons. Repeat the above steps to determine the optimal weights and thresholds of the BP neural network; The tenth step is to use the BP neural network of the optimal individual to simulate and predict the uniformity of the cotton yarn, so as to provide a reliable and accurate prediction value for the uniformity of the cotton yarn.
2. The method for constructing a cotton yarn uniformity prediction model according to claim 1, wherein: In the second step, α is selected as 1, and the number of neurons S in the hidden layer of the network is obtained as 4 through the empirical formula.
3. The method for constructing a cotton yarn uniformity prediction model according to claim 1, wherein: In the fifth step, the value of ξ is taken as 1.5.
Citation Information
Cited By
Energy demand quantity prediction method and device, equipment, storage medium and product
CN119990409A
Cartilage powder tabletting content uniformity prediction method based on machine learning
CN122348012A
A method for predicting the content uniformity of cartilage powder tablets based on machine learning
CN122348012B
