Method and system for acquiring dye color formula of silk floss knitted printed fabric
In the process of obtaining dye color formulas for silk-soft knitted printed fabrics, the color prediction model based on dye characteristic feature embedding and the dye combination optimization model based on Markov decision-making was solved in the existing technology that the impact of fabric functional characteristics and dye parameters was not effectively considered, and more efficient and accurate dye color formula acquisition was achieved.
Patent Information
- Application Number
- CN202510637270.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-19
- Publication Date
- 2025-06-20
- Estimated Expiration
- 2045-05-19
AI Technical Summary
When obtaining the dye color formula of silk cotton knitted printed fabrics, the prior art fails to effectively consider the functional characteristics of the fabric after dyeing, and the dye is easily affected by parameters such as temperature and pH during the dyeing process, making it difficult to ensure accuracy of the dye performance results, affecting the cost of dye, dye quality and production cycle.
The color prediction model based on dye characteristic feature embedding and the dye combination optimization model based on Markov decision-making were used to train the model through historical dye data, combining dye data, target color and current dye parameter data, the dye combination was optimized to adapt to dynamic parameter changes during the dyeing process.
Improve the efficiency and accuracy of dye color formula acquisition, ensure the functional characteristics and color consistency of the fabric, reduce color deviation and dye costs, and improve production efficiency and quality.
Smart Images

Figure CN120183540A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of obtaining dye formulations, and specifically to a method and system for obtaining a dye color formulation for a silk-cotton knitted printed fabric. Background Art
[0002] In order to ensure the color and performance of the final product, each color must undergo a pre-dyeing sample-making process before large-scale production. This process aims to determine the optimal color matching scheme, verify the accuracy of the initial dye formulation, evaluate the feasibility of dyeing process parameters, estimate the cost of dye chemicals, and ensure that the fabric can ultimately meet various indicators.
[0003] However, in the current process of obtaining dye color formulations, only the problem of color deviation is considered, and the functional characteristics of the silk-cotton knitted printed fabric after dyeing are not taken into account. At the same time, dyes are extremely susceptible to parameter factors such as temperature and pH value during the dyeing process, making it difficult to ensure the accuracy of the dyeing performance results of fixed color formulations, thereby unable to control the dye cost, dyeing quality, and product production cycle, and reducing the overall production efficiency and quality. Summary of the Invention
[0004] The purpose of the present invention is to provide a method and system for obtaining a dye color formulation for a silk-cotton knitted printed fabric. First, obtain dye data, target color, current dyeing parameter data, and historical dyeing data; then, input the historical dyeing data into a color prediction model based on dye characteristic feature embedding for training to obtain a pre-trained color prediction model; combine the dye data, target color, pre-trained color prediction model, and optimization algorithm to obtain a predicted dye combination; next, construct a dye combination optimization model based on Markov decision, define the state space, action space, and reward function of the Markov decision process, select DQN as the backbone network, and use the historical dyeing data to train the dye combination optimization model. Finally, input the predicted dye combination and current dyeing parameter data into the trained dye combination optimization model for optimization to obtain the optimal dye combination.
[0005] To achieve the above purpose, the present invention provides the following technical solutions: A method for obtaining a dye color formulation for a silk-cotton knitted printed fabric, comprising: Obtain dye data, target color, current dyeing parameter data, and historical dyeing data; wherein, the dye data includes: dye characteristics, dye types, dye ratios, and dye concentrations; Construct a color prediction model based on dye characteristic feature embedding, input the historical dye color formulation data into the color prediction model for training to obtain a pre-trained color prediction model; combine the dye data, the target color, the pre-trained color prediction model, and an optimization algorithm to obtain a predicted dye combination; Construct a dye combination optimization model based on Markov decision, define the state space, action space, and reward function of the Markov decision process, select DQN as the backbone network, and use the historical dyeing data to train the dye combination optimization model. Then, input the predicted dye combination and the current dyeing parameter data into the trained dye combination optimization model for optimization to obtain the optimal dye combination.
[0006] Further, the current dyeing parameter data includes: dyeing time, dyeing temperature, pH value, and dyeing bath ratio; the historical dyeing data includes: historical dye data, historical dyeing parameter data, and historical dyeing result data; wherein, the historical dyeing result data includes historical color data and historical color fastness data.
[0007] Further, the color prediction model based on dye characteristic feature embedding includes: an input layer, a feature extraction layer, a weighted self-attention layer based on dye characteristic feature embedding, a fully connected layer, and an output layer; wherein, the input layer converts the historical dye color formula data into data features; The feature extraction layer further extracts the data features to obtain deep features; The weighted self-attention layer based on dye characteristic feature embedding processes the deep features by combining dye characteristic features and the weighted self-attention mechanism to obtain attention features; The fully connected layer converts the attention features into predicted color features; The output layer outputs the predicted color result according to the predicted color features.
[0008] Further, the weighted self-attention layer based on dye characteristic feature embedding performs linear transformation on the deep features and the dye characteristic features to obtain their respective query matrices, key matrices, and value matrices; performs weighted fusion on the query matrix, key matrix, and value matrix of the deep features according to the learnable weight parameters and the query matrix, key matrix, and value matrix of the dye characteristic features to obtain the fused query matrix, key matrix, and value matrix, and combines the calculation formula of the attention weight to obtain the attention features.
[0009] Further, the specific steps of obtaining the predicted dye combination by combining the dye data, the target color, the pre-trained color prediction model, and the optimization algorithm include: Step 1: Determine the dye type range, dye ratio range, and dye concentration range according to the dye data; Step 2: Randomly generate a set of dye combinations, including: the dye type, the dye ratio, and the dye concentration; Step 3: Input the dye combination, the dye characteristics, and the given dyeing condition data into the pre-trained color prediction model to obtain the Lab values of the predicted color; Step 4: Calculate the color deviation between the Lab values of the predicted color and the Lab values of the target color; Step 5: According to the color deviation, use the optimization algorithm to update the dye combination, and update it in the direction of the decrease of the color deviation; Step 6: Iteratively execute Step 3 - Step 5 until the preset number of iterations is reached or the color deviation is less than the preset threshold; Step 7: Output the dye combination with the minimum color deviation as the predicted dye combination.
[0010] Furthermore, the process of training the dye combination optimization model using the historical dyeing data includes: Obtain the historical dyeing data and define the Markov decision environment; Among them, the Markov decision environment includes: the state space, the action space, and the reward function; Construct a DQN network, randomly initialize the weights of the DQN network, and perform cyclic iteration on the DQN network in combination with the Markov decision until convergence, that is, the Q value output by the DQN network no longer changes significantly.
[0011] Furthermore, the state space includes: dye combination, dyeing parameters, and initial color; the action space includes: dye combination adjustment and dyeing parameter adjustment; the reward function includes: color deviation, color fastness, dye cost, color change response time, and antibacterial rate.
[0012] A system for obtaining a dye color formula for a silk-cotton knitted printed fabric includes: a system control module, a data acquisition module, a color prediction module, a dye combination prediction module, a dye combination optimization module, and an output module; Among them, the system control module is used to control the start, pause, and stop of the system; The data acquisition module is used to obtain dye data, target color, current dyeing parameter data, and historical dyeing data; among them, the dye data includes: dye characteristics, dye types, dye ratios, and dye concentrations; The color prediction module is used to input the historical dye color formula data into the color prediction model based on dye characteristic feature embedding for training to obtain a pre-trained color prediction model; The dye combination prediction module is used to combine the dye data, the target color, the pre-trained color prediction model, and the optimization algorithm to obtain a predicted dye combination; The dye combination optimization module is used to input the predicted dye combination and the current dyeing parameter data into a trained dye combination optimization model based on Markov decision for optimization, so as to obtain an optimal dye combination; The output module is used to output the optimal dye combination.
[0013] Compared with the prior art, the beneficial effects of the present invention are as follows: 1. The present invention proposes a color prediction model based on dye characteristic feature embedding for predicting color results according to a dye combination; the model combines dye characteristic features and a weighted attention mechanism through a weighted self-attention layer based on dye characteristic feature embedding, and utilizes the inherent attributes of different dyes, so as to more accurately capture the interaction between dyes and the influence they have on the final color result, and further improve the efficiency and accuracy of obtaining a dye color formula.
[0014] 2. The present invention proposes a dye combination prediction method for obtaining a predicted dye combination; the method provides accurate color prediction for an optimization algorithm through a pre-trained color prediction model, thereby accelerating the optimization process and obtaining a better color formula matching effect; by combining model prediction and algorithm optimization, the color deviation can be significantly reduced and the blind trial and error in the traditional manual proofing process can be effectively reduced, so as to improve the efficiency and accuracy of obtaining a dye color formula.
[0015] 3. The present invention proposes a dye combination optimization method based on Markov decision for adjusting a predicted dye combination to adapt to the influence of dynamic parameters in the dyeing process; the method can dynamically adjust the dye combination according to the current dyeing parameter data during the dyeing process by combining Markov decision and a DQN network, overcome the influence of fluctuations in factors such as temperature and pH value during the dyeing process, and learn the optimal dye combination strategy in different states, so as to effectively improve the efficiency and accuracy of obtaining a dye color formula. BRIEF DESCRIPTION OF THE DRAWINGS
[0016] Figure 1 It is a schematic flow chart of a method for obtaining a dye color formula for a silk-cotton knitted printed fabric according to the present invention; Figure 2 It is a schematic flow chart of obtaining a predicted dye combination according to the present invention; Figure 3 It is a schematic structural diagram of a system for obtaining a dye color formula for a silk-cotton knitted printed fabric according to the present invention. DETAILED DESCRIPTION OF THE INVENTION
[0017] Next, the technical solutions in the embodiments of the present invention will be clearly and completely described in conjunction with the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only a part of the embodiments of the present invention, rather than all the embodiments. All other embodiments obtained by those of ordinary skill in the art based on the embodiments of the present invention without creative efforts shall fall within the protection scope of the present invention.
[0018] The present invention provides a method and system for obtaining a dye color formula for a silk floss knitted printed fabric to improve the efficiency and accuracy of obtaining the dye color formula for the silk floss knitted printed fabric. The method and system proposed by the present invention will be described in detail below in conjunction with Embodiment 1 and Embodiment 2, specifically as follows:
[0019] Embodiment 1 In order to accurately and efficiently obtain the dye color formula for a silk floss knitted printed fabric, a dyeing factory used a method for obtaining a dye color formula for a silk floss knitted printed fabric proposed by the present invention. The process schematic of this method is as Figure 1 shown and specifically includes: S1. Obtain dye data, target color, current dyeing parameter data, and historical dyeing data; Further, the dye data includes: dye characteristics, dye types, dye ratios, and dye concentrations; Further, the current dyeing parameter data includes: dyeing time, dyeing temperature, pH value, and dyeing bath ratio; the historical dyeing data includes: historical dye data, historical dyeing parameter data, and historical dyeing result data; among them, the historical dyeing result data includes historical color data and historical color fastness data; Further, randomly select two groups of current dyeing parameter data as references and display them in a list, which are respectively recorded as Sample 1 and Sample 2, as shown in Table 1.
[0020] Table 1. Current dyeing parameter data
[0021] Further, the dye data and historical dyeing data are obtained by calling the database; the current dyeing parameter data is collected by using corresponding sensors; the target color and historical color data are represented by Lab values.
[0022] By using the current dyeing parameter data, historical dyeing data, and dye data, reliable data support is provided for subsequent color prediction, dye combination prediction, and dye combination optimization, thereby effectively improving the efficiency and accuracy of obtaining the dye color formula.
[0023] S2. Construct a color prediction model based on dye characteristic feature embedding, input the historical dyeing data into the color prediction model for training, and obtain a pre-trained color prediction model; Furthermore, the color prediction model based on the embedding of dye characteristic features includes: an input layer, a feature extraction layer, a weighted self-attention layer based on the embedding of dye characteristic features, a fully connected layer, and an output layer; Among them, the input layer converts historical dye color formula data into data features; Furthermore, the historical dye color formula data includes historical dye data and historical dyeing parameter data.
[0024] The feature extraction layer further extracts the data features to obtain deep features; The weighted self-attention layer based on the embedding of dye characteristic features combines dye characteristic features and the weighted self-attention mechanism to process the deep features and obtain attention features; The fully connected layer converts the attention features into predicted color features; The output layer outputs the predicted color result according to the predicted color features; By combining dye characteristics, dyeing parameters, and deep learning techniques, the accuracy, generalization ability, and adaptability of color prediction can be improved. At the same time, using dye characteristic features can provide a reference for the subsequent dye combination prediction optimization method in terms of the influence of dyeing performance. For example, the adsorption of dyes will affect the permeability of dyed fabrics, thereby improving the efficiency and accuracy of obtaining dye color formulas.
[0025] Furthermore, the process of the weighted self-attention layer based on the embedding of dye characteristic features to obtain attention features includes: Performing linear transformation on the deep features and dye characteristic features to obtain their respective query matrices, key matrices, and value matrices; According to the learnable weight parameters and the query matrix, key matrix, and value matrix of the dye characteristic features, performing weighted fusion on the query matrix, key matrix, and value matrix of the deep features to obtain the fused query matrix, key matrix, and value matrix; Combining the calculation formula of the attention weights to obtain attention features; Furthermore, the dye characteristic features are obtained by encoding the dye characteristics and then using convolution kernel transformation; Dye characteristics such as: molecular weight, solubility, chargeability, etc.; Furthermore, the dye characteristic features include: dye molecular weight features, dye solubility features, dye chargeability features, dye adsorption features, etc.; Furthermore, the fused query matrix, key matrix, and value matrix can be expressed by the following formula as: ; Among them, 、 and are the fused query matrix, key matrix, and value matrix respectively; 、 and are the query matrix, key matrix, and value matrix obtained after linear transformation of the deep features respectively; , and are learnable weight parameters used to control the influence degree of the dye characteristic features; , and are the query matrix, key matrix, and value matrix obtained after linear transformation of the dye characteristic features respectively; Furthermore, the calculation formula of the attention weight is expressed as: ; wherein, is the attention weight; is the normalization function; and are the fused query matrix and the transposed key matrix respectively; is the inner product operation; is the dimension of the query matrix and the key matrix.
[0026] To illustrate the effectiveness of the weighted self-attention layer based on dye characteristic feature embedding, two schemes are selected to verify that the weighted self-attention layer based on dye characteristic feature embedding proposed by the present invention can enable the subsequent predicted dye combination to maintain the fabric performance. One is the mechanism of using dye characteristic feature weighted attention, denoted as Scheme 1; the other is the scheme without adding dye characteristic features, denoted as Scheme 2. To better illustrate the influence on the fabric performance, the fabric penetration uniformity is selected as the reference performance index; a group of dye combinations is randomly selected, combined with different schemes and the process of predicting the dye combination, the predicted dye combinations under different schemes are obtained, and the fabric penetration uniformity under different schemes is compared with the target fabric penetration uniformity by using the predicted dye combinations. The deviation range is set at [-5%, 5%]. The test results of the effectiveness of dye characteristic feature embedding are shown in Table 2.
[0027] Table 2. Test results of the effectiveness of dye characteristic feature embedding
[0028] As can be seen from Table 2, the color prediction model using the weighted self-attention layer based on dye characteristic feature embedding can make the output result of the dye combination prediction model retain high dyeing fabric characteristics, so that the dyeing fabric characteristics can be ensured not to decrease while keeping the color deviation minimum.
[0029] In this embodiment, the weighted self-attention layer embedded based on dye characteristic features combines dye characteristic features and a weighted attention mechanism, leveraging the inherent properties of different dyes to more accurately capture the interactions between dyes and their impacts on the final color result and fabric performance, further improving the efficiency and accuracy of obtaining dye color formulations.
[0030] To further verify the effectiveness of the color prediction model proposed in the present invention, which is embedded based on dye characteristic features, historical dyeing data from the past 5 years is selected for a model ablation control test, denoted as Test One, Test Two, and Test Three. The historical dyeing data from nearly 3 - 5 years and nearly 1 - 2 years are used as the model training dataset and the model test dataset respectively, with the corresponding data quantities being 600 groups and 400 groups. The historical dye data and historical dyeing parameter data in the historical dyeing data are used as the model input data, while the historical dyeing result data is used as the model output comparison data. Three different models are selected for ablation comparison. The model training dataset is input into different models to obtain different pre-trained models, and then the corresponding pre-trained models are used to process the model test dataset to obtain the color prediction results of different models. According to the color prediction results and the target color, the color deviation is obtained, and the color deviation is compared with the deviation threshold to obtain the test results of different models. Among them, the deviation threshold is set to 0.95. The models are as follows: the color prediction model proposed in the present invention, which is embedded based on dye characteristic features, denoted as Model One; removing the dye characteristic feature embedding and weighted processing in the weighted self-attention layer based on dye characteristic features, only retaining the self-attention layer, denoted as Model Two; removing the entire weighted self-attention layer of dye characteristic feature embedding, denoted as Model Three. The test results of the effectiveness of the color prediction model can be referred to in Table 3.
[0031] Table 3. Test Results of the Effectiveness of the Color Prediction Model
[0032] As can be seen from Table 3, the color prediction model (Model One) proposed in the present invention, which is embedded based on dye characteristic features, is superior to other models in accurately predicting colors. This indicates that the color prediction model proposed in the present invention can provide accurate predicted colors for subsequent dye combination prediction, and at the same time, it can not only obtain the correlation between the dye combination and the dyeing result, but also utilize the dye characteristic features to obtain the relationship between the dye characteristics and the performance of the dyed fabric, thereby improving the efficiency and accuracy of obtaining dye color formulations.
[0033] S3. Combine the dye data, target color, pre-trained color prediction model, and optimization algorithm to obtain the predicted dye combination. Further, by combining dye data, target color, pre-trained color prediction model, and optimization algorithm, a predicted dye combination is obtained. The process schematic for obtaining the predicted dye combination can be referred to Figure 2 , as follows: Step 1: Determine the range of optional dye types, dye ratios, and dye concentrations based on the dye data; Step 2: Randomly generate a set of dye combinations, including: dye types, dye ratios, and dye concentrations; Step 3: Input the dye combination, dye characteristics, and given dyeing condition data into the pre-trained color prediction model to obtain the Lab values of the predicted color; Step 4: Calculate the color deviation between the Lab values of the predicted color and the target color; Step 5: According to the color deviation, use the optimization algorithm to update the dye combination, making it update in the direction of the decreasing color deviation; Step 6: Iteratively execute Steps 3 - 5 until the preset number of iterations is reached or the color deviation is less than the preset threshold; Step 7: Output the dye combination with the minimum color deviation as the predicted dye combination; Further, the color deviation is calculated by using the CIEDE2000 color difference formula; Further, the optimization algorithm can be selected from genetic algorithm, particle swarm algorithm, simulated annealing algorithm, etc.; Further, the preset number of iterations and the preset threshold are set to 150 and 1.0 respectively.
[0034] By combining color model prediction and intelligent algorithm optimization, the color deviation can be significantly reduced, and at the same time, the correlation between the dye characteristics obtained from the pre-trained color prediction model and the performance of the dyed fabric is used to maintain the fabric performance, thereby improving the efficiency and accuracy of obtaining the dye color formula.
[0035] S4. Construct a dye combination optimization model based on Markov decision, define the state space, action space, and reward function of the Markov decision process, select DQN as the backbone network, and use historical dyeing data to train the dye combination optimization model. Then, input the predicted dye combination and the current dyeing parameter data into the trained dye combination optimization model for optimization to obtain the optimal dye combination.
[0036] Further, DQN, whose full name is Deep Q-Network, is a model-free reinforcement learning algorithm, and this algorithm does not need to know the state transition probability; Further, the process of using historical dyeing data to train the dye combination optimization model includes: Obtain historical dyeing data and define the Markov decision environment; Among them, the Markov decision environment includes: a state space, an action space, and a reward function; Construct a DQN network and randomly initialize the weights of the DQN network; Input the historical dyeing data into the DQN network for training, and perform cyclic iteration on the DQN network in combination with Markov decision until convergence, that is, the Q value output by the DQN network no longer changes significantly; Furthermore, input the predicted dye combination and the current dyeing parameter data into the trained dye combination optimization model for optimization to obtain the optimal dye combination.
[0037] By combining Markov decision and the DQN network, the dye combination can be dynamically adjusted according to the current dyeing parameter data during the dyeing process, overcoming the influence of fluctuations in factors such as temperature and pH value during the dyeing process, learning the optimal dye combination strategy under different states, improving the performance of the dyed fabric while minimizing color deviation, thereby effectively improving the efficiency and accuracy of obtaining the dye color formula.
[0038] Furthermore, the state space includes: dye combination, dyeing parameters, and initial color; the action space includes: dye combination adjustment and dyeing parameter adjustment; the reward function includes: color deviation, color fastness, dye cost, color change response time, and antibacterial rate; Furthermore, the numerical values in the state space and the action space need to be discretized; Furthermore, the reward function R(s,a,s’) defines the reward obtained after taking action a in state s and transitioning to state s’, and can be expressed as: ; Among them, represents the color deviation; and are the wash color fastness grade and the light color fastness grade respectively; is the dye cost; 、 、 、 and are the corresponding weights used to balance color deviation, color fastness, dye cost, color change response time, and antibacterial rate; Furthermore, the wash color fastness grade and the light color fastness grade are respectively obtained through the test of "GB / T3921-2008 Textiles - Colorfastness to soaping" and "GB / T8427-2008 Textiles - Colorfastness to light: Exposure to daylight" and the staining rating is carried out through a gray scale; Furthermore, the range of the wash color fastness grade and the light color fastness grade is 1-5, and the higher the grade, the better the effect.
[0039] To further illustrate the effectiveness of the dye combination optimization method based on Markov decision, a set of data is randomly selected for testing. This data includes a set of predicted dye combinations and corresponding current dyeing parameter data. Among them, one set of data uses the dye combination optimization method based on Markov decision proposed by the present invention, and the used and unused dyeing results are obtained respectively, mainly reflected in color deviation, color fastness to washing grade, color change response time, and antibacterial rate. The test results of dye combination optimization can be referred to Table 4.
[0040] Table 4. Test Results of Dye Combination Optimization
[0041] As can be seen from Table 4, using the dye combination optimization method based on Markov decision proposed by the present invention can further optimize the dye combination while enabling the dyed silk-cotton knitted printed fabric to improve the photosensitive color change performance and antibacterial performance of the dyed fabric, so that the color can be kept consistent, and the dye color formula based on the silk-cotton knitted printed fabric can have the function of composite functions.
[0042] By defining the Markov decision environment, namely the state space, action space, and reward function, the DQN network can learn the impacts brought by the dynamic changes of parameters in the dyeing process on dye combination allocation, color deviation, color fastness, dye cost, color change response time, and antibacterial rate during the cyclic iteration, so as to obtain a more accurate dye color formula.
[0043] In this embodiment, a method for obtaining a dye color formula for silk-cotton knitted printed fabric is proposed; this method combines dye data, target color, pre-trained color prediction model, and optimization algorithm to obtain a predicted dye combination; then, a dye combination optimization model based on Markov decision is constructed, and the dye combination optimization model is trained using historical dyeing data. Finally, the predicted dye combination and current dyeing parameter data are input into the trained dye combination optimization model for optimization to obtain the optimal dye combination; this method combines deep learning, Markov decision, and intelligent algorithm, which can effectively improve the efficiency and accuracy of obtaining the dye color formula.
[0044] Embodiment 2 The present invention provides a system for obtaining a dye color formula for silk-cotton knitted printed fabric. The structure of this system can be referred to Figure 3 , including: a system control module, a data acquisition module, a color prediction module, a dye combination prediction module, a dye combination optimization module, and an output module; The system control module is used to control the start, pause, and stop of the system; Refer to Figure 1S1 in it is applied to the data acquisition module of a dye color formula acquisition system for silk floss knitted printed fabrics. The data acquisition module is used to acquire dye data, target colors, current dyeing parameter data, and historical dyeing data. Among them, the dye data includes: dye characteristics, dye types, dye ratios, and dye concentrations; Refer to Figure 1 S2 in it is applied to the color prediction module of a dye color formula acquisition system for silk floss knitted printed fabrics. The color prediction module is used to input historical dye color formula data into a color prediction model based on dye characteristic feature embedding for training to obtain a pre-trained color prediction model; Refer to Figure 1 S3 in it is applied to the dye combination prediction module of a dye color formula acquisition system for silk floss knitted printed fabrics. The dye combination prediction module is used to combine dye data, target colors, the pre-trained color prediction model, and an optimization algorithm to obtain a predicted dye combination; Furthermore, the process by which the dye combination prediction module obtains the predicted dye combination is as follows: Step 1: Determine the range of optional dye types, dye ratios, and dye concentrations according to the dye data; Step 2: Randomly generate a set of dye combinations, including: dye types, dye ratios, and dye concentrations; Step 3: Input the dye combination, dye characteristics, and given dyeing condition data into the pre-trained color prediction model to obtain the Lab value of the predicted color; Step 4: Calculate the color deviation between the Lab value of the predicted color and the Lab value of the target color; Step 5: According to the color deviation, use the optimization algorithm to update the dye combination so that it updates in the direction of the decrease in color deviation; Step 6: Iteratively execute Step 3 - Step 5 until the preset number of iterations is reached or the color deviation is less than the preset threshold; Step 7: Output the dye combination with the minimum color deviation as the predicted dye combination.
[0045] To illustrate the effectiveness of the proposed dye combination prediction method of the present invention, 100 target colors were randomly selected and their Lab values were calculated; the dyeing condition data were the dyeing temperature, pH value, dyeing time, and liquor ratio respectively; two sets of dyeing condition data were given, denoted as Condition 1 on the left, with the data being 75°C, 9.7, 40 min, and 1:15; and denoted as Condition 2 on the right, with the data being 85°C, 10.3, 55 min, and 1:19; two different methods were used for dye combination prediction to obtain the corresponding predicted dye combinations, and the color values obtained by dyeing with the predicted dye combinations were compared with the target colors to obtain the reasonable proportion of the dyeing results of different dye combination prediction methods under different conditions; the left corresponded to the proportion under Condition 1, and the right was the proportion under Condition 2; among them, the methods included: the method used by the dye combination prediction module, denoted as Method 1; replacing the optimization algorithm in Step 5 with manual update of the dye combination, and the rest remained unchanged, denoted as Method 2; the effectiveness test results of the dye combination prediction method are shown in Table 5.
[0046] Table 5. Effectiveness test results of the dye combination prediction method
[0047] As can be seen from Table 5, the proposed dye combination prediction method (Method 1) of the present invention is better than Method 2 in predicting the actual dyeing effect of the dye combination, which indicates that the optimization algorithm combined with the pre-trained color prediction model can provide a relatively accurate dye combination, thus improving the efficiency and accuracy of obtaining the dye color formula.
[0048] Referring to Figure 1 S4 in, S4 is applied to the dye combination optimization module of a dye color formula acquisition system for silk knitted printed fabrics. The dye combination optimization module is used to input the predicted dye combination and the current dyeing parameter data into the trained dye combination optimization model based on Markov decision-making for optimization to obtain the optimal dye combination; Furthermore, the process of the dye combination optimization module training the dye combination optimization model includes: Obtaining historical dyeing data and defining the Markov decision-making environment; Among them, the Markov decision-making environment includes: state space, action space, and reward function; Constructing a DQN network and randomly initializing the weights of the DQN network; Inputting the historical dyeing data into the DQN network for training, and performing cyclic iteration on the DQN network in combination with Markov decision-making until convergence, that is, the Q value output by the DQN network no longer changes significantly.
[0049] The output module is used to output the optimal dye combination.
[0050] Although embodiments of the present invention have been shown and described, it will be understood by those of ordinary skill in the art that various changes, modifications, substitutions and variations can be made to these embodiments without departing from the principles and spirit of the present invention, and the scope of the present invention is defined by the appended claims and their equivalents.
Claims
1. A method for obtaining a dye color formula for a silk cotton knitted printed fabric, characterized in that: include: Acquire dye data, target color, current dyeing parameter data and historical dyeing data of silk cotton knitted printed fabric; wherein the dye data includes: dye characteristics, dye types, dye ratio and dye concentration; Constructing a color prediction model based on dye characteristic feature embedding, inputting historical dye color formula data into the color prediction model for training, and obtaining a pre-trained color prediction model; combining the dye data, the target color, the pre-trained color prediction model and the optimization algorithm to obtain a predicted dye combination; A dye combination optimization model based on Markov decision is constructed, the state space, action space and reward function of the Markov decision process are defined, DQN is selected as the backbone network, and the dye combination optimization model is trained using the historical dyeing data. Then, the predicted dye combination and the current dyeing parameter data are input into the trained dye combination optimization model for optimization to obtain the optimal dye combination.
2. The method for obtaining a dye color formula for a silk cotton knitted printed fabric according to claim 1, characterized in that: The current dyeing parameter data includes: dyeing time, dyeing temperature, pH value and dyeing bath ratio; the historical dyeing data includes: historical dye data, historical dyeing parameter data and historical dyeing result data; wherein the historical dyeing result data includes historical color data, historical color fastness data, historical color change response data and historical antibacterial rate data.
3. The method for obtaining a dye color formula for a silk cotton knitted printed fabric according to claim 1, characterized in that: The color prediction model based on dye characteristic feature embedding includes: an input layer, a feature extraction layer, a weighted self-attention layer based on dye characteristic feature embedding, a fully connected layer and an output layer; wherein the input layer converts the historical dye color formula data into data features; The feature extraction layer further extracts the data features to obtain deep features; The weighted self-attention layer based on the dye characteristic feature embedding combines the dye characteristic feature and the weighted self-attention mechanism to process the deep feature to obtain an attention feature; The fully connected layer converts the attention feature into a predicted color feature; The output layer outputs a predicted color result according to the predicted color feature.
4. The method for obtaining the dye color formula of a silk cotton knitted printed fabric according to claim 3, characterized in that: The weighted self-attention layer based on dye characteristic feature embedding linearly transforms the deep features and the dye characteristic features to obtain respective query matrices, key matrices and value matrices; the query matrix, key matrix and value matrix of the deep features are weightedly fused according to the learnable weight parameters and the query matrix, key matrix and value matrix of the dye characteristic features to obtain the fused query matrix, key matrix and value matrix, and the attention features are obtained in combination with the calculation formula of the attention weight.
5. The method for obtaining the dye color formula of a silk cotton knitted printed fabric according to claim 1, characterized in that: The specific steps of combining the dye data, the target color, the pre-trained color prediction model and the optimization algorithm to obtain the predicted dye combination include: Step 1: Determine the dye type range, dye ratio range and dye concentration range according to the dye data; Step 2: randomly generating a set of dye combinations, including: the dye type, the dye ratio and the dye concentration; Step 3: inputting the dye combination, the dye characteristics and the given dyeing condition data into the pre-trained color prediction model to obtain the Lab value of the predicted color; Step 4: Calculate the color deviation between the Lab value of the predicted color and the Lab value of the target color; Step 5: According to the color deviation, use the optimization algorithm to update the dye combination so that it is updated in the direction of decreasing the color deviation; Step 6: Iterate step 3 to step 5 until a preset number of iterations is reached or the color deviation is less than a preset threshold; Step 7: Output the dye combination with the minimum color deviation as the predicted dye combination.
6. The method for obtaining a dye color formula for a silk cotton knitted printed fabric according to claim 1, characterized in that: The process of training the dye combination optimization model using the historical dyeing data includes: Obtaining the historical dyeing data and defining a Markov decision environment; Wherein, the Markov decision environment includes: the state space, the action space and the reward function; Construct a DQN network, randomly initialize the weights of the DQN network; input the historical coloring data into the DQN network and perform a cyclic iteration on the DQN network in combination with Markov decision making until convergence.
7. The method for obtaining the dye color formula of silk cotton knitted printed fabric according to claim 6, characterized in that: The state space includes: dye combination, dyeing parameters and initial color; the action space includes: dye combination adjustment and dyeing parameter adjustment; the reward function includes: color deviation, color fastness, dye cost, color change response time and antibacterial rate.
8. A dye color formula acquisition system for silk cotton knitted printed fabrics, characterized in that: include: System control module, data acquisition module, color prediction module, dye combination prediction module, dye combination optimization module and output module; Wherein, the system control module is used to control the start, pause and stop of the system; The data acquisition module is used to obtain dye data, target color, current dyeing parameter data and historical dyeing data; wherein the dye data includes: dye characteristics, dye types, dye ratio and dye concentration; The color prediction module is used to input historical dye color formula data into a color prediction model based on dye characteristic feature embedding for training, to obtain a pre-trained color prediction model; The dye combination prediction module is used to combine the dye data, the target color, the pre-trained color prediction model and the optimization algorithm to obtain a predicted dye combination; The dye combination optimization module is used to input the predicted dye combination and the current dyeing parameter data into a trained dye combination optimization model based on Markov decision making to optimize and obtain an optimal dye combination; The output module is used to output the optimal dye combination.
Citation Information
Patent Citations
Dyeing formula optimization method based on multi-model collaboration
CN117807891A
Dyeing method and device based on dyeing prediction model, computer equipment and storage medium
CN119782924A
Method for establishing dyeing model, dyeing method, and dyeing device
US20230384769A1
Cited By
Intelligent monitoring method and system for textile printing and dyeing production equipment
CN120779896A