A method and system for constructing bidirectional spectrum prediction of woven yarns and fabrics

By constructing a bidirectional spectral relationship model between yarn and fabric, and using spectrophotometers and neural networks, the fabric color difference problem caused by changes in yarn weaving process parameters is solved, and the accurate prediction of yarn and fabric spectrum is achieved, which improves supply efficiency and reduces inventory backlog.

CN119394969BActive Publication Date: 2025-08-12WUHAN TEXTILE UNIV
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202411647760.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-11-18
Publication Date
2025-08-12
Estimated Expiration
2044-11-18

AI Technical Summary

Technical Problem

The prior art cannot effectively solve the difference in the color of the yarn under different weaving process parameters, resulting in inaccurate product color, causing inventory backlog, and lack of a method for building a spectral relationship model of yarn and fabric.

Method used

By establishing a bidirectional spectral relationship model between yarn and fabric, using a spectrophotometer to measure the spectral reflectivity, combining multi-output wrap linear regression and multi-layer perceptron neural network, a spectral prediction model from yarn to fabric and fabric to yarn is constructed to achieve bidirectional spectral prediction of yarn and fabric.

Benefits of technology

It realizes accurate prediction of yarn and fabric spectrum, solves the problem of inaccurate product color, improves corporate supply efficiency, and reduces inventory backlog.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119394969B_ABST
    Figure CN119394969B_ABST
Patent Text Reader

Abstract

The present invention provides a method and system for constructing a bidirectional spectrum prediction for woven yarns and fabrics. The method comprises: collecting yarns of different colors to prepare yarn winding samples; obtaining spectral reflectance data of the yarns by measuring with a spectrophotometer; setting process parameters for preparing woven fabric samples by using the yarns; preparing woven fabric samples by using a woven fabric sampler according to the set process parameters; obtaining spectral reflectance data of the fabric samples by measuring with a spectrophotometer; constructing a yarn-to-fabric forward spectrum prediction model based on the fabric process parameters; constructing a fabric-to-yarn reverse spectrum prediction model based on the fabric process parameters; preparing test fabrics according to new process parameters, and testing the performance of the bidirectional spectrum prediction models for the yarns and fabrics respectively; and calculating an average value of the root mean square error (RMSE) of the spectra of the test fabrics under the two models as an indicator for evaluating the overall performance of the two models, thereby obtaining a final bidirectional spectrum prediction model.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of computer digital image processing, and in particular relates to a method and system for constructing bidirectional spectrum prediction of woven yarns and fabrics. Background Art

[0002] In the textile production process, accurate analysis and production of fabric colors have always been a difficult problem faced by enterprises. Problems such as "goods not matching the order" caused by inaccurate fabric color production are endless, causing large amounts of product inventory in enterprises, bringing huge human, material and economic losses to the textile industry. At present, neither academia nor industry has proposed an effective solution.

[0003] Unlike the color measurement and management of smooth surfaces in traditional printed materials, textiles are typically woven from yarns using specific weaving processes. For example, in machine-woven production, colored yarns are woven according to set warp and weft densities, along with other weaving parameters, to create plain, twill, and satin fabrics with varying textures to meet the fabric needs of textile manufacturers. However, during the weaving process, when yarns of the same color are woven using different weaving parameters, these variations in process parameters lead to surface texture variations in the resulting fabrics. This, in turn, causes differences in light transmission through the surface and interior of the fabric, leading to color variations under these parameters. Consequently, yarns of the same color woven using different weaving parameters can produce varying colors. However, no research has yet explored the mechanisms and patterns of color variation in fabrics produced under different weaving parameters, hindering companies' ability to accurately analyze the color of incoming customer samples. This can lead to inconsistent product colors and lead to inventory backlogs.

[0004] Furthermore, the spectrum is the fingerprint of color. Given the spectral information of yarns and fabrics, a relationship model can be constructed based on the spectral information of the yarns, weaving process parameters, and corresponding fabrics. This allows for accurate prediction of the fabric spectrum of any color under specific weaving process parameters. Conversely, the corresponding yarn spectrum can be reversely solved based on the fabric spectrum and its corresponding weaving process parameters, enabling accurate prediction of the bidirectional spectrum of yarns and fabrics. This supports companies in accurately analyzing and producing customer samples, improving supply efficiency, reducing inventory backlogs, and bringing tangible benefits to companies and the industry. However, for the construction of relationship models among yarn spectra, weaving process parameters, and fabric spectra, neither academia nor industry, both domestically and internationally, has yet to come up with a sound solution. Summary of the Invention

[0005] The purpose of the present invention is to solve the problems described in the background technology. By establishing a bidirectional relationship model between yarn and fabric spectra with textile process parameters as the medium, the spectrum prediction of yarn of any color after being woven into fabric and the accurate analysis of yarn spectrum corresponding to fabric samples of any color can be realized, thereby solving the problem of product color mismatch in actual production of enterprises. The implementation of this technology requires first collecting yarns of different colors and making yarn winding samples; secondly, using a spectrophotometer to measure the spectral reflectance of the yarn winding samples; then, setting the process parameters for making woven fabric samples using yarn, and using woven fabric proofing equipment to prepare fabric samples with different texture characteristics according to the set process parameters; then, using a spectrophotometer to measure the spectral reflectance of the fabric samples; then, using a multi-output wrapped linear regression model, constructing a yarn to fabric forward spectral prediction model based on fabric process parameters; then, using a multi-layer perceptron neural network, constructing a fabric to yarn reverse spectral prediction model based on fabric process parameters; then, making test fabrics according to the new process parameters, and testing the performance of the bidirectional spectral prediction model of yarn and fabric respectively; finally, calculating the average value of the spectral root mean square error of the test fabric under the two models as an indicator for evaluating the overall performance of the two models, and obtaining the final bidirectional spectral prediction model. The technical solution of the present invention is a method for constructing bidirectional spectral prediction of woven yarn and fabric, which specifically includes the following steps:

[0006] Step 1, collect yarns of different colors and make yarn winding samples;

[0007] Step 2, using a spectrophotometer to measure and obtain spectral reflectance data of the yarn;

[0008] Step 3, setting process parameters for making woven fabric samples using yarn;

[0009] Step 4, using a woven fabric sampling device to make woven fabric samples according to set process parameters;

[0010] Step 5: Using a spectrophotometer to measure and obtain spectral reflectance data of the fabric sample;

[0011] Step 6: construct a yarn-to-fabric forward spectrum prediction model based on fabric process parameters;

[0012] Step 7: construct a fabric-to-yarn reverse spectrum prediction model based on fabric process parameters;

[0013] Step 8: Using the methods of steps 3 and 4, test fabric samples are made according to the new process parameters, and the performance of the two-way spectral prediction model for yarn and fabric is tested separately;

[0014] Step 9: Calculate the average value of the root mean square error of the spectrum of the test fabric under the two models as an indicator to evaluate the overall performance of the two models, and obtain the final bidirectional spectrum prediction model.

[0015] Furthermore, in step 1, a total of N colors of yarn are collected. These N colors of yarn need to be as dispersed as possible in the color space to cover a sufficiently large color range. Each of these N colors of yarn is wound four times on a white reflective standard plate to obtain a standard yarn winding sample.

[0016] Furthermore, in step 2, each yarn sample is measured M times on a desktop spectrophotometer, and the average value is taken to obtain the spectral reflectance data of the yarn.

[0017] Furthermore, in step 3, the main process parameters in woven fabric production include texture and yarn density, among which texture parameters mainly include plain, twill, and satin. Under the premise of selecting texture parameters, a fabric with a specific texture is obtained by interweaving warp and weft yarns. Among them, the factors affecting yarn density are divided into two aspects: warp density and weft density. Warp density is mainly determined by the number of reeds in the proofing equipment, and weft density is mainly determined by the number of picks in the proofing equipment. Based on the range of the company's actual production process parameters, an orthogonal experiment is used to set a reasonable parameter combination of texture, warp density, and weft density for proofing actual fabric samples.

[0018] Furthermore, in step 4, proofing is performed using a fully automatic weaving machine according to the proofing parameters set in step 3. By setting the texture, the yarn is sequentially wound around the warp beam, which gradually releases the yarn, ensuring consistent tension and alignment during the weaving process. After the yarn passes through the heald frame and reed, the heald frame controls the up and down movement of the warp yarn to form the weaving fell, allowing the weft yarn to be smoothly inserted and combined, forming an interlaced fabric structure. The reed is used to arrange the warp yarn and beat the weft yarn to ensure uniform yarn density and a tight bond between the fabric, thereby obtaining a fabric with a specific density and texture.

[0019] Furthermore, in step 5, each fabric sample obtained by proofing is measured M times on a desktop spectrophotometer, and the average value is taken to obtain the spectral reflectance data of the fabric sample.

[0020] Furthermore, in step 6, a yarn-to-fabric forward spectrum prediction model based on fabric process parameters is constructed, and the implementation method is as follows:

[0021] First, based on steps 1 to 5, the yarn spectral dataset and the fabric spectral dataset were obtained and preprocessed. The texture of the fabric was set as a categorical variable and converted into a numerical feature using one-hot encoding. The number of reeds and the number of picks were used as continuous numerical features. The above feature data were processed using the z-score normalization method to eliminate the influence of different dimensions. The normalization formula used is shown in formula (1):

[0022]

[0023] In the formula, x is the original eigenvalue, μ is the mean of the feature, σ is the standard deviation of the feature, and x * is the standardized eigenvalue.

[0024] Secondly, the standardized parameter features corresponding to each fabric sample and the spectral reflectance of the corresponding yarn are combined as the input features of the yarn-to-fabric forward spectral prediction model. The spectral reflectance of each fabric sample is used as the output feature of the model to complete the construction of the paired data set required for model training.

[0025] Then, a linear multi-output regression model is used to construct a forward spectral prediction model from yarn to fabric. For the sampled fabric, by testing the yarn density and the spectral reflectance of the corresponding fabric under different texture characteristics, it is found that there is a significant linear negative correlation between yarn density and fabric spectral reflectance. That is, the greater the yarn density, the lower the value of each wavelength of the fabric spectral reflectance. Therefore, the present invention uses a linear multi-output regression model to construct a mapping relationship between each band of the spectral reflectance of the fabric sample and the process parameters. The goal is to predict the spectral reflectance of the fabric based on the spectral reflectance of the standard yarn and the process parameters of the fabric (texture, reed number, and pick number).

[0026] For the i-th fabric sample and wavelength λ j , the linear regression model is expressed as shown in formula (2):

[0027]

[0028] Where: is the i-th sample at wavelength λ j The predicted response rate under is the wavelength λ j The intercept term of is the wavelength λ j The regression coefficient of feature k (k = 1, 2, 3, 4, 5, 6, 7), X Reed,i and X Weft,i are the number of reeds and the number of picks, respectively, Plain,i , X TwillReverse,i , X TwillFront,i , X SatinReverse,i and X SatinFront,i is the one-hot encoded variable of the weaving process.

[0029] To estimate the regression coefficient matrix β and the intercept vector B, the least squares method (Ordinary Least Squares, OLS) is used, whose goal is to minimize the residual sum of squares. j , the loss function is defined as formula (3):

[0030]

[0031] Where: is the i-th sample at wavelength λ j The true response rate under is the i-th sample at wavelength λ j The predicted response rate.

[0032] Finally, the s-fold cross validation method is used to complete the training and validation of the model to ensure the robustness of the model. Divide into s disjoint subsets D1, D2, ..., D s , each subset size is n / s. In the i-th iteration (i∈{1,2,...,k}), select D i The remaining s-1 subsets are used as validation sets and the training sets. The training process of each fold is carried out independently. Finally, the results of the five experiments are summarized to calculate the performance of the model. A sample weight adjustment mechanism is introduced in each fold to improve the prediction effect of the model.

[0033] The weights of all samples are initialized to 1 at the beginning of training, which means that each sample contributes equally to the model during training, as shown in formula (4).

[0034]

[0035] Where, represents the initial weight of the i-th sample, and N is the total number of samples in the training set.

[0036] During each fold training process, based on the current sample feature X i and weights Train the regression model and generate predictions for each sample As shown in formula (5),

[0037]

[0038] Where, Indicates that at the tth iteration, the current weight is used The predicted value of the trained model for the i-th sample.

[0039] For each sample, calculate its prediction error And in the multi-output regression task, the errors of all outputs are averaged, as shown in formula (6),

[0040]

[0041] Where M is the output dimension (i.e. the number of wavelengths), and They represent the true value and predicted value of the i-th sample at the m-th output (wavelength), respectively.

[0042] The weight of each sample is adjusted according to its error. The weight of the sample with larger error increases, and the weight of the sample with smaller error decreases. The weight adjustment formula is shown in formula (7):

[0043]

[0044] Here, α is an adjustment factor (usually 0.1 or less) that controls the magnitude of weight updates. According to this formula, samples with larger errors receive higher weights, thus having a greater impact on the model in the next round of training.

[0045] In order to prevent the weights of some samples from being too large or too small, the weights of all samples need to be normalized to ensure that the sum of all sample weights is 1 as shown in formula (8).

[0046]

[0047] The normalization process ensures the balance of sample weights, allowing the model to optimize its performance based on the weights of different samples during each training.

[0048] After each fold of training is completed, the model will make predictions on the training set and calculate the error. The results of all folds will be aggregated to calculate the root mean square error (RMSE) of the spectrum to evaluate the overall performance of the model.

[0049] RMSE is used to measure the average deviation between the model's predicted value and the actual value, reflecting the model's prediction accuracy. Its calculation formula is (9):

[0050]

[0051] Where n is the number of samples; y i is the actual value of the i-th sample; is the predicted value of the i-th sample.

[0052] Furthermore, in step 7, a fabric-to-yarn reverse spectrum prediction model based on fabric process parameters is constructed, and the implementation method is as follows:

[0053] First, the data source remains consistent with the forward yarn-to-fabric spectral prediction model based on fabric process parameters. However, the inverse model takes the fabric spectral reflectance and process parameters as input, and outputs the yarn spectral reflectance. The input feature X is generated using the fabric spectral data and the corresponding process parameters (texture, reed count, and pick count), and the target variable y is generated using the corresponding yarn spectral emissivity.

[0054] Then, a multi-layer perceptron (MLP) neural network is used to learn the reverse mapping relationship from fabric spectral reflectance and process parameters to yarn spectrum. The core of the reverse model is a multi-layer perceptron (MLP) neural network, which consists of two fully connected layers. The first layer contains 128 neurons and the second layer contains 32 neurons. Each layer contains a ReLU activation function and L2 regularization to avoid overfitting. To further prevent overfitting, a dropout layer is added. The dropout layer uses dropout after each layer to randomly discard the connections of some neurons to further reduce overfitting. The mathematical expression of the model can be expressed as formula (10):

[0055] y=f(X)(10)

[0056] Here, X is the input feature vector, which contains the encoded features of the reed number, pick number, and texture, as well as the predicted value of the fabric spectrum; y is the output of the model, representing the predicted yarn spectral reflectance. f(X) represents the mapping process through a multi-layer perceptron network, where the output of each layer is the weighted sum of the previous layer and converted by an activation function. The mean square error (MSE) is used as the loss function to measure the difference between the predicted and actual values. The mean square error is a commonly used loss function in regression tasks and its formula is:

[0057]

[0058] Among them, y i is the true value; is the predicted value; N is the number of samples.

[0059] Finally, to evaluate the model's generalization ability, we also used the s-fold cross-validation method to complete model training and validation, ensuring robustness. During each fold of training and validation, the neural network updates weights and biases based on the loss function through backpropagation, optimizing the network parameters. For each s-fold cross-validation, we split the data into training and validation sets, following the method in step 6. The model is trained on the training set and evaluated on the validation set.

[0060] Furthermore, in step 8, the methods of steps 3 and 4 are used to produce test fabric samples according to the new process parameters, and the yarn spectral reflectance, process parameters, and test fabric spectral reflectance are processed in the same way according to the data processing methods used in the forward and reverse spectral prediction models, and the performance of the two-way spectral prediction models for yarn and fabric are tested respectively;

[0061] Furthermore, in step 9, the RMSE averages of all test samples under both the forward and reverse models are calculated. The overall average of these RMSE averages is used as an indicator to evaluate the overall performance of the two models, resulting in the final bidirectional spectral prediction model. This completes the construction of the bidirectional spectral prediction model for woven yarns and fabrics.

[0062] The present invention also provides a system for constructing a bidirectional spectrum prediction model for woven yarns and fabrics, comprising:

[0063] one or more processors;

[0064] A storage device for storing one or more programs, which, when executed by the one or more processors, enables the one or more processors to implement a method for constructing a bidirectional spectral prediction model for woven yarns and fabrics as described in the above technical solution.

[0065] The present invention solves the current problem of color consistency management and proposes to establish a mapping model between fabric process parameters and fabric spectral reflectance to accurately predict the spectral reflectance of fabric and yarn, which has important application value for color control of textiles, fabric color matching and product design. BRIEF DESCRIPTION OF THE DRAWINGS

[0066] Figure 1 Flowchart of an embodiment of the present invention.

[0067] Figure 2 This is the forward spectrum prediction result from yarn to fabric of the test fabric in the present invention.

[0068] Figure 3 This is the reverse spectrum prediction result from fabric to yarn for the test fabric in the present invention. DETAILED DESCRIPTION

[0069] When the technical solution of the present invention is specifically implemented, those skilled in the art can use computer software technology to run it.

[0070] Combined with attachment Figure 1 The embodiment of the present invention proposes a method for constructing a bidirectional spectrum prediction model for woven yarns and fabrics, which specifically includes the following steps:

[0071] Step 1, collect yarns of different colors and make yarn winding samples;

[0072] Step 2, using a spectrophotometer to measure and obtain spectral reflectance data of the yarn;

[0073] Step 3, setting process parameters for making woven fabric samples using yarn;

[0074] Step 4, using a woven fabric sampling device to make woven fabric samples according to set process parameters;

[0075] Step 5: Using a spectrophotometer to measure and obtain spectral reflectance data of the fabric sample;

[0076] Step 6: construct a yarn-to-fabric forward spectrum prediction model based on fabric process parameters;

[0077] Step 7: construct a fabric-to-yarn reverse spectrum prediction model based on fabric process parameters;

[0078] Step 8: Using the methods of steps 3 and 4, test fabric samples are made according to the new process parameters, and the performance of the two-way spectral prediction model for yarn and fabric is tested separately;

[0079] Step 9: Calculate the average value of the root mean square error of the spectrum of the test fabric under the two models as an indicator to evaluate the overall performance of the two models, and obtain the final bidirectional spectrum prediction model.

[0080] The following examples illustrate the processing of each step: The method of the present invention is tested based on an SGA598 fully automatic rapier loom, an X-rite Colori7 desktop spectrophotometer, a white reflective standard plate, and 32-count pure cotton yarn.

[0081] In step 1, a total of N colors of yarn are collected, each made from 32-count pure cotton yarn. These N colors of yarn need to be as dispersed as possible in the color space, covering a sufficiently large color range. Each of these N colors of yarn is wrapped four times around a white reflective standard board to create a standard winding sample. For testing, a total of six colors of yarn are collected in the example: red, green, yellow, blue, purple, and gray, ensuring sufficient color dispersion.

[0082] In step 2, for each yarn sample, an X-rite Colori7 desktop spectrophotometer is used with a 20 mm large aperture and SCE mode to perform M measurements, and the average value is taken to obtain the spectral reflectance data of the yarn. In the embodiment, the value of M is 10 times.

[0083] In step 3, the main process parameters in the production of woven fabrics include texture and yarn density, among which the texture parameters mainly include plain weave, twill and satin weave. Under the premise of selecting the texture parameters, a fabric with a specific texture is obtained by interweaving warp and weft yarns. Among them, the factors affecting yarn density are divided into two aspects: warp density and weft density. Warp density is mainly determined by the number of reeds of the proofing equipment, and weft density is mainly determined by the number of picks of the proofing equipment. According to the range of the actual production process parameters of the enterprise, a reasonable parameter combination of texture, warp density and weft density is set through orthogonal experiments for proofing of actual fabric samples. In the embodiment, the values of the reed number are 40, 50, and 60 respectively, and the values of the pick number are 1, 5, 10, and 20 respectively. The texture parameters mainly include plain weave, twill front, twill back, satin front, and satin back.

[0084] In step 4, proofing is performed using an SGA598 fully automatic rapier weaving machine according to the proofing parameters set in step 3. By setting the texture, the yarn is wound around the warp beam in sequence, and the warp beam gradually releases the yarn to ensure consistent tension and arrangement during the weaving process. After the yarn passes through the heald frame and the reed, the heald frame controls the up and down movement of the warp yarn to form a cloth fell, so that the weft yarn can be smoothly inserted and combined to form an interlaced fabric structure. The reed is used to arrange the warp yarn and beat the weft to ensure that the yarn density is uniform and the fabric is tightly combined, thereby obtaining a fabric with a specific density and texture. In the embodiment, a total of 360 fabric samples were obtained using 6 colors of yarn and the proofing parameters in step 3.

[0085] Furthermore, in step 5, each fabric sample obtained by sampling is measured M times using an X-rite Colori7 desktop spectrophotometer at a 20 mm large aperture and SCE mode, and the average value is taken to obtain the spectral reflectance data of the fabric sample. In the embodiment, the value of M is 10 times.

[0086] In step 6, a yarn-to-fabric forward spectral prediction model based on fabric process parameters is constructed. The implementation method is as follows:

[0087] First, based on steps 1 to 5, the yarn spectral dataset and the fabric spectral dataset were obtained and preprocessed. The texture of the fabric was set as a categorical variable and converted into a numerical feature using one-hot encoding. The number of reeds and the number of picks were used as continuous numerical features. The above feature data were processed using the z-score normalization method to eliminate the influence of different dimensions. The normalization formula used is shown in formula (1):

[0088]

[0089] In the formula, x is the original eigenvalue, μ is the mean of the feature, σ is the standard deviation of the feature, and x * is the standardized eigenvalue.

[0090] Secondly, the standardized parameter features corresponding to each fabric sample and the spectral reflectance of the corresponding yarn are combined as the input features of the yarn-to-fabric forward spectral prediction model. The spectral reflectance of each fabric sample is used as the output feature of the model to complete the construction of the paired data set required for model training.

[0091] Then, a linear multi-output regression model is used to construct a forward spectral prediction model from yarn to fabric. For the sampled fabric, by testing the yarn density and the spectral reflectance of the corresponding fabric under different texture characteristics, it is found that there is a significant linear negative correlation between yarn density and fabric spectral reflectance. That is, the greater the yarn density, the lower the value of each wavelength of the fabric spectral reflectance. Therefore, the present invention uses a linear multi-output regression model to construct a mapping relationship between each band of the spectral reflectance of the fabric sample and the process parameters. The goal is to predict the spectral reflectance of the fabric based on the spectral reflectance of the standard yarn and the process parameters of the fabric (texture, reed number, and pick number).

[0092] For the i-th fabric sample and wavelength λ j , the linear regression model is expressed as shown in formula (2):

[0093]

[0094] Where: is the i-th sample at wavelength λ j The predicted response rate under is the wavelength λ j The intercept term of is the wavelength λ j The regression coefficient of feature k (k = 1, 2, 3, 4, 5, 6, 7), X Reed,i and X Weft,i are the number of reeds and the number of wefts, respectively, Plain,i , X TwillReverse,i , X TwillFront,i , X SatinReverse,i and X SatinFront,i is the one-hot encoded variable of the weaving process.

[0095] To estimate the regression coefficient matrix β and the intercept vector B, the least squares method (Ordinary Least Squares, OLS) is used, whose goal is to minimize the residual sum of squares. j , the loss function is defined as formula (3):

[0096]

[0097] Where: is the i-th sample at wavelength λ j The true response rate under is the predicted reaction rate of the i-th sample at wavelength λj.

[0098] Finally, the s-fold cross validation method is used to complete the training and validation of the model to ensure the robustness of the model. Divide into s disjoint subsets D1, D2, ..., D s , each subset size is n / s. In the i-th iteration (i∈{1,2,...,k}), select D i The remaining s-1 subsets were used as the validation set, and the training set was used. Each fold was trained independently, and the results of the five experiments were finally aggregated to calculate the model performance. A sample weight adjustment mechanism was introduced in each fold to improve the model's prediction effect. In this embodiment, the value of s was taken as 5-fold and 10-fold for model construction and verification.

[0099] The weights of all samples are initialized to 1 at the beginning of training, which means that each sample contributes equally to the model during training, as shown in formula (4).

[0100]

[0101] Where, represents the initial weight of the i-th sample, and N is the total number of samples in the training set.

[0102] During each fold training process, based on the current sample feature X i and weights Train the regression model and generate predictions for each sample As shown in formula (5),

[0103]

[0104] Where, Indicates that at the tth iteration, the current weight is used The predicted value of the trained model for the i-th sample.

[0105] For each sample, calculate its prediction error And in the multi-output regression task, the errors of all outputs are averaged, as shown in formula (6),

[0106]

[0107] Where M is the output dimension (i.e. the number of wavelengths), and They represent the true value and predicted value of the i-th sample at the m-th output (wavelength), respectively.

[0108] The weight of each sample is adjusted according to its error. The weight of the sample with larger error increases, and the weight of the sample with smaller error decreases. The weight adjustment formula is shown in formula (7):

[0109]

[0110] Here, α is an adjustment factor (usually 0.1 or less) that controls the magnitude of weight updates. According to this formula, samples with larger errors receive higher weights, thus having a greater impact on the model in the next round of training.

[0111] In order to prevent the weights of some samples from being too large or too small, the weights of all samples need to be normalized to ensure that the sum of all sample weights is 1 as shown in formula (8).

[0112]

[0113] The normalization process ensures the balance of sample weights, allowing the model to optimize its performance based on the weights of different samples during each training.

[0114] After each fold of training is completed, the model will make predictions on the training set and calculate the error. The results of all folds will be aggregated to calculate the root mean square error (RMSE) of the spectrum to evaluate the overall performance of the model.

[0115] RMSE is used to measure the average deviation between the model's predicted value and the actual value, reflecting the model's prediction accuracy. Its calculation formula is (9):

[0116]

[0117] Where n is the number of samples; y i is the actual value of the i-th sample; is the predicted value for the i-th sample. Since the output variable is spectral reflectance data from 400 nm to 700 nm, a total of 31 wavelengths, the RMSE is calculated for each wavelength. This wavelength-by-wavelength RMSE calculation helps analyze the model's predictive performance at different wavelengths.

[0118] In step 7, a fabric-to-yarn reverse spectrum prediction model based on fabric process parameters is constructed. The implementation method is as follows:

[0119] First, the data source remains consistent with the forward yarn-to-fabric spectral prediction model based on fabric process parameters. However, the inverse model takes the fabric spectral reflectance and process parameters as input, and outputs the yarn spectral reflectance. The input feature X is generated using the fabric spectral data and the corresponding process parameters (texture, reed count, and pick count), and the target variable y is generated using the corresponding yarn spectral emissivity.

[0120] Then, a multi-layer perceptron (MLP) neural network is used to learn the reverse mapping relationship from fabric spectral reflectance and process parameters to yarn spectrum. The core of the reverse model is a multi-layer perceptron (MLP) neural network, which consists of two fully connected layers. The first layer contains 128 neurons and the second layer contains 32 neurons. Each layer contains a ReLU activation function and L2 regularization to avoid overfitting. To further prevent overfitting, a dropout layer is added. The dropout layer uses dropout after each layer to randomly discard the connections of some neurons to further reduce overfitting. The mathematical expression of the model can be expressed as formula (10):

[0121] y=f(X) (10)

[0122] Here, X is the input feature vector, which contains the encoded features of the reed number, pick number, and texture, as well as the predicted value of the fabric spectrum; y is the output of the model, representing the predicted yarn spectral reflectance. f(X) represents the mapping process through a multi-layer perceptron network, where the output of each layer is the weighted sum of the previous layer and converted by an activation function. The mean square error (MSE) is used as the loss function to measure the difference between the predicted and actual values. The mean square error is a commonly used loss function in regression tasks and its formula is:

[0123]

[0124] Among them, y i is the true value; is the predicted value; N is the number of samples.

[0125] Finally, in order to evaluate the generalization ability of the model, the s-fold cross validation method is also used to complete the training and verification of the model to ensure the robustness of the model. In the training and verification process of each fold, the neural network updates the weights and biases according to the loss function through the back propagation algorithm to optimize the parameters of the network. For each s-fold cross validation, according to the method in step 6, the data is also divided into a training set and a verification set, and the training set is used to train the model and evaluate it on the verification set. In the embodiment, the value of s is taken as 5 fold and 10 fold respectively for model construction and verification.

[0126] In step 8, using the methods of steps 3 and 4, 6 test fabric samples are made according to the new process parameters, and the yarn spectral reflectance, process parameters and test fabric spectral reflectance are processed in the same way according to the data processing methods used in the forward and reverse spectral prediction models. The performance of the two-way spectral prediction model for yarn and fabric is tested respectively.

[0127] In step 9, the RMSE averages of all test samples under both the forward and reverse models are calculated. The overall average of these RMSEs is used as an indicator to evaluate the overall performance of the two models, resulting in the final bidirectional spectral prediction model. This completes the construction of the bidirectional spectral prediction model for woven yarns and fabrics.

[0128] In the embodiment, the specific results are shown in Table 1 and Table 2 respectively. The average RMSE of the two models under 5-fold and 10-fold conditions are 0.0090 and 0.0081 respectively. The spectral prediction results of the corresponding forward and reverse models for the six test fabrics are shown in Table 1 and Table 2 respectively. Figure 2 and Figure 3 shown.

[0129] Table 1

[0130]

[0131] Table 2

[0132]

[0133]

[0134] On the other hand, an embodiment of the present invention further provides a system for constructing a bidirectional spectral prediction model for woven yarns and fabrics, comprising:

[0135] one or more processors;

[0136] A storage device for storing one or more programs, which, when executed by the one or more processors, enables the one or more processors to implement a method for constructing a bidirectional spectral prediction model for woven yarns and fabrics as described in the above technical solution.

[0137] The specific embodiments described herein are merely illustrative of the spirit of the present invention. Persons skilled in the art may make various modifications, additions, or substitutions to the described specific embodiments without departing from the spirit of the present invention or exceeding the scope of the appended claims.

Claims

1. A method for constructing a bidirectional spectrum prediction model for woven yarns and fabrics, characterized in that: The specific steps include: Step 1, collect yarns of different colors and make yarn winding samples; Step 2, using a spectrophotometer to measure and obtain spectral reflectance data of the yarn; Step 3, setting process parameters for making woven fabric samples using yarn; Step 4, using a woven fabric sampling device to make woven fabric samples according to set process parameters; Step 5: Using a spectrophotometer to measure and obtain spectral reflectance data of the fabric sample; Step 6, using a linear multi-output regression model to construct a yarn-to-fabric forward spectrum prediction model based on fabric process parameters; In step 6, a yarn-to-fabric forward spectral prediction model based on fabric process parameters is constructed. The implementation method is as follows: First, based on steps 1 to 5, the yarn spectral dataset and fabric spectral dataset were obtained respectively, and the datasets were preprocessed. The texture of the fabric was set as a categorical variable and converted into a numerical feature using one-hot encoding. The number of reeds and picks were used as continuous numerical features. The above feature data were processed using the z-score normalization method to eliminate the influence of different dimensions. Secondly, the standardized parameter features corresponding to each fabric sample and the spectral reflectance of the corresponding yarn are combined as the input features of the yarn-to-fabric forward spectral prediction model. The spectral reflectance of each fabric sample is used as the output feature of the model to complete the construction of the paired data set required for model training. Then, a linear multi-output regression model is used to construct a yarn-to-fabric forward spectrum prediction model: For the 𝑖th fabric sample and wavelength 𝜆 𝑗 , the linear regression model is expressed as shown in formula (2): (2); Where: is the 𝑖th sample at wavelength 𝜆 𝑗 The predicted response rate under is the wavelength 𝜆 𝑗 The intercept term of is the wavelength 𝜆 𝑗 The regression coefficient of feature k, k = 1, 2, 3, 4, 5, 6, 7, and are the number of reeds and the number of wefts, , , , and is the one-hot encoded variable of the weaving process; To estimate the regression coefficient matrix 𝛽 and the intercept vector 𝐵, the least squares method is used, whose goal is to minimize the residual sum of squares; for the wavelength 𝜆 𝑗 , the loss function is defined as formula (3): (3); Where: is the 𝑖th sample at wavelength 𝜆 𝑗 The true response rate under is the 𝑖th sample at wavelength 𝜆 𝑗 The predicted response rate under Step 7, using a multi-layer perceptron (MLP) neural network to construct a fabric-to-yarn reverse spectrum prediction model based on fabric process parameters; In step 7, a fabric-to-yarn reverse spectrum prediction model based on fabric process parameters is constructed. The implementation method is as follows: First, the data source is consistent with the forward spectral prediction model of yarn to fabric based on fabric process parameters. The difference is that the input of the reverse model is the spectral reflectance and process parameters of the fabric, and the output is the spectral reflectance of the yarn. The input feature 𝑋 is generated using the spectral data of the fabric and the corresponding process parameters, and the target variable 𝑦 is generated using the corresponding yarn spectral emissivity. Then, a multi-layer perceptron (MLP) neural network is used to learn the reverse mapping relationship from fabric spectral reflectance and process parameters to yarn spectrum. The core of the reverse model is a multi-layer perceptron (MLP) neural network, which includes two fully connected layers. The first layer contains 128 neurons and the second layer contains 32 neurons. Each layer contains a ReLU activation function and L2 regularization to avoid overfitting. In order to further prevent overfitting, a Dropout layer is added. The Dropout layer uses Dropout after each layer to randomly discard the connections of some neurons to further reduce overfitting. The mathematical expression of the model can be expressed as formula (10): (10); Where 𝑋 is the input feature vector, which contains the encoded features of the reed number, pick number and texture, as well as the predicted value of the fabric spectrum; 𝑦 is the output of the model, which represents the predicted yarn spectral reflectance, Represents the process of mapping through a multi-layer perceptron network, where the output of each layer is transformed by the weighted sum of the previous layer through an activation function; the mean square error (MSE) is used as the loss function to measure the difference between the predicted and actual values, and its formula is: (11); in, is the true value; is the predicted value; N is the number of samples; Step 8: Using the methods of steps 3 and 4, test fabric samples are produced according to the new process parameters, and the performance of the bidirectional spectral prediction model of yarn and fabric is tested separately. The bidirectional spectral prediction model includes a yarn-to-fabric forward spectral prediction model and a fabric-to-yarn reverse spectral prediction model. Step 9: Calculate the average value of the root mean square error of the spectrum of the test fabric under the two models as an indicator to evaluate the overall performance of the two models, and obtain the final bidirectional spectrum prediction model.

2. The method for constructing a bidirectional spectral prediction model for woven yarns and fabrics according to claim 1, wherein: A total of N colors of yarn are collected, and these N colors of yarn are respectively wound four times on a white reflective standard plate to obtain a standard yarn winding sample.

3. The method for constructing a bidirectional spectral prediction model for woven yarns and fabrics according to claim 1, wherein: In step 2, for each yarn sample, M measurements are performed on a desktop spectrophotometer, and the average value is taken to obtain the spectral reflectance data of the yarn.

4. The method for constructing a bidirectional spectral prediction model for woven yarns and fabrics according to claim 1, wherein: In step 3, the process parameters include texture and yarn density, among which the texture parameters include plain weave, twill and satin. Under the premise of selecting the texture parameters, the fabric with a specific texture is obtained by interlacing the warp and weft yarns; among which, the factors affecting the yarn density are divided into two aspects: warp density and weft density. The warp density is determined by the reed number of the proofing equipment, and the weft density is determined by the weft number of the proofing equipment. According to the range of the actual production process parameters of the enterprise, a reasonable parameter combination of texture, warp density and weft density is set through orthogonal experiments for the proofing of actual fabric samples.

5. The method for constructing a bidirectional spectrum prediction model for woven yarns and fabrics according to claim 1, wherein: The s-fold cross-validation method is used to complete the training and validation of the yarn-to-fabric forward spectral prediction model to ensure the robustness of the model; For each s-fold cross validation, the dataset Divide into s disjoint subsets D1, D2,..., D s , each subset size is n / s; in the i-th iteration, select D i The remaining s-1 subsets are used as validation sets, and the training sets are used. The training process of each fold is carried out independently. Finally, the results of the five experiments are summarized to calculate the performance of the model. A sample weight adjustment mechanism is introduced in each fold to improve the prediction effect of the model. The weights of all samples are initialized to 1 at the beginning of training, which means that each sample contributes equally to the model during training, as shown in formula (4). (4); Where, represents the initial weight of the i-th sample, and N is the total number of samples in the training set; During each fold of training, based on the current sample features and weights , train the regression model and generate the predicted value for each sample , as shown in formula (5), (5); Where, Indicates that at the 𝑡th iteration, the current weight is used The predicted value of the trained model for the 𝑖th sample; For each sample, calculate its prediction error , and average the errors of all outputs in the multi-output regression task, as shown in formula (6), (6); Where M is the output dimension, i.e. the number of wavelengths, and Represent the true value and predicted value of the 𝑖th sample at the 𝑚th output respectively; Adjust the weight of each sample according to its error. The weight adjustment formula is shown in formula (7): (7); Where 𝛼 is the adjustment coefficient, which controls the amplitude of weight update; In order to prevent the weights of some samples from being too large or too small, the weights of all samples need to be normalized to ensure that the sum of all sample weights is 1, as shown in formula (8), (8); After each fold of training is completed, the model will predict the training set and calculate the error. The results of all folds will be summarized and the spectral root mean square error (RMSE) will be calculated to evaluate the overall performance of the model. The calculation formula is (9): (9); Where n is the number of samples; is the actual value of the i-th sample; is the predicted value of the i-th sample.

6. The method for constructing a bidirectional spectrum prediction model for woven yarns and fabrics according to claim 1, wherein: In step 7, the s-fold cross-validation method is used to complete the training and verification of the fabric-to-yarn reverse spectral prediction model. During the training and verification process of each fold, the neural network updates the weights and biases according to the loss function through the back propagation algorithm to optimize the network parameters.

7. The method for constructing a bidirectional spectrum prediction model for woven yarns and fabrics according to claim 1, wherein: In step 9, the RMSE average values of all test samples under the yarn-to-fabric forward spectral prediction model and the fabric-to-yarn reverse spectral prediction model are calculated respectively, and the overall average of the RMSE average values of all test samples under the two models is taken as an indicator to evaluate the overall performance of the two models, and the final bidirectional spectral prediction model is obtained. At this point, the construction of the bidirectional spectral prediction model for woven yarns and fabrics is completed.

8. A system for constructing a bidirectional spectrum prediction model for woven yarns and fabrics, characterized in that: include: one or more processors; A storage device for storing one or more programs, which, when executed by the one or more processors, enables the one or more processors to implement a method for constructing a bidirectional spectral prediction model for woven yarns and fabrics as described in any one of claims 1 to 7.

Citation Information

Patent Citations

  • Colored fiber mixed color matching method based on double-constant Kubelka-Munk theory

    CN106469258A

  • Modeling method for chlorophyll content of corn canopy

    CN118212525A

  • Simulation model training method and device for colored spun yarn and fabric thereof and storage medium

    CN118378529A