Textile color matching optimization method, system, electronic device and storage medium
By combining a nonlinear residual compensation model with segmentation and bias calibration and a smooth surrogate model with a PG-KAMoE meta-learner, the color difference problem in dyeing formula prediction is solved, achieving high-precision and reliable dye concentration prediction, which is applicable to textile dyeing processes.
Patent Information
- Application Number
- CN202611306413.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2026-08-26
- Publication Date
- 2026-11-24
- Estimated Expiration
- 2046-08-26
AI Technical Summary
Existing dyeing formula prediction technologies lack systematic modeling of finishing processes, resulting in significant color differences. Furthermore, under small sample conditions, it is difficult to balance the model's generalization ability and prediction accuracy. In addition, there is a lack of interpretability and credibility assessment mechanisms, which fails to meet the accuracy requirements of industrial production.
A nonlinear residual compensation model with piecewise segmentation and bias calibration is adopted, combined with a smooth surrogate model and a PG-KAMoE meta-learner. Robust solution of dyeing formulation is achieved through manifold regularization and dual correction mechanism, generating highly reliable dye concentration predictions.
It achieves reverse compensation for color changes in post-finishing processes, improves prediction accuracy and interpretability, ensures the reliability and robustness of dyeing formulations, and is suitable for industrial production.
Smart Images

Figure CN122839682B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of dyeing formula prediction technology, specifically to textile color matching optimization methods, systems, electronic devices, and storage media. Background Technology
[0002] Dyeing formulation design plays a crucial role in textile dyeing processes, directly determining a company's economic benefits and resource utilization. However, existing dyeing formulation prediction technologies suffer from the following problems:
[0003] The lack of systematic modeling of finishing processes leads to fundamental biases in the prediction of dyeing formulations.
[0004] Existing dyeing formulation prediction techniques typically simplify the problem to finding the target chromaticity value ( The current method directly maps the dye concentration (c) to the dye concentration (c). However, this simplification ignores the complex finishing processes that fabrics must undergo from dyeing to finished product, such as washing, setting, and coating. In actual industrial production, these physicochemical processes have a significant and irreversible impact on the final apparent color of the fabric. Current technologies, lacking models that encompass the finishing processes, cannot reverse-compensate for and correct these color changes. Therefore, formulations directly derived from the finished product color often exhibit significant systematic color differences after finishing processes, limiting the robustness and engineering applicability of the prediction model in real-world production environments.
[0005] Under conditions of sparse coloring data, it is difficult for the model to balance generalization ability and prediction accuracy.
[0006] In the dyeing and printing industry, acquiring standardized, high-quality historical formula data is extremely costly, resulting in a typically small available sample size and highly uneven data distribution across the color space. On one hand, while traditional machine learning methods possess generalization capabilities to some extent, their fitting accuracy often falls short when dealing with high-precision color matching requirements. On the other hand, some existing technologies attempt to introduce neural networks with massive parameter scales to characterize highly nonlinear color mapping relationships. However, under the constraint of small sample sizes, such overparameterized models are prone to overfitting to high-frequency color regions in the training set, causing a sharp drop in prediction accuracy when processing edge color gamuts or non-high-frequency color regions, failing to meet the stringent accuracy requirements of industrial production.
[0007] The reverse derivation of nonlinear staining formulations lacks interpretability and credibility assessment mechanisms.
[0008] Dyeing formulation prediction is essentially a highly nonlinear inverse color mixing problem. Most existing data-driven methods employ a black-box mapping mechanism, lacking an explicit logical connection between the predicted dye concentration and historical database data such as hue, temperature, width, and auxiliary agent ratios. This lack of transparency prevents technicians from tracing the basis of the model's predictions, and makes effective causal analysis of any prediction failures difficult. Furthermore, current technologies generally lack mechanisms for quantifying the uncertainty and assessing the credibility of prediction results, making it difficult for frontline operators to determine the risk level of the predicted formulation. This hinders the establishment of trust and large-scale application of AI-powered color matching technology in actual production. Summary of the Invention
[0009] To address the aforementioned issues, this invention proposes a textile color matching optimization method, system, electronic device, and storage medium that can improve the quality of formula prediction and enhance interpretability and trustworthiness.
[0010] To achieve the above objectives, the present invention is implemented through the following technical solution:
[0011] This invention is a method for optimizing textile color matching, comprising:
[0012] The finished product's full color gamut is segmented, and a bias calibration mechanism and a nonlinear residual compensation model are introduced to perform dyeing of the formula to be predicted. The value is solved by reverse reasoning;
[0013] A smooth surrogate model is constructed, and a difficulty prototype is built based on historical color matching samples and the smooth surrogate model. This prototype is then used to predict the color matching formula after staining. The values are subjected to manifold-regularized geometric retrieval to generate an initial coarse solution and contextual features;
[0014] A PG-KAMoE meta-learner is constructed with the initial coarse solution and contextual features as meta-inputs, and a set of key hyperparameters is obtained.
[0015] Based on a smooth surrogate model and a set of key hyperparameters, a robust solution for the formulation to be predicted is obtained through a dual correction mechanism. The reliability of the solution is verified to determine the final formulation.
[0016] A further improvement of this invention lies in: constructing a smooth proxy model, specifically including:
[0017] Construct a logarithmic physical mapping to transform the dye concentration vector into logarithmic space, expressed as:
[0018]
[0019] in: Let the dye concentration vector be... Let be the dye concentration vector in logarithmic space. It is the concentration stability constant;
[0020] Based on the Mish-Sine architecture, the Spectral-KAN network is constructed to map dye concentration vectors in logarithmic space to colors. The smooth proxy model, the output of the smooth proxy model is:
[0021]
[0022] in, The total number of Mish smoothing components. The total number of spectral components of the sine spectrum. For the first The constant bias term for each color channel, For the first A mapping function for each color channel. For the first The dye concentration vector in the logarithmic space of each dye channel. , , The first In the color channel, the first The dye channel corresponds to the first The magnitude weights, input scaling coefficients, and translation biases of each Mish smoothing component. , , For the first In the color channel, the first The dye channel corresponds to the first The amplitude weights, angular frequencies, and phase biases of each Sine spectral component. This represents the number of dye channels.
[0023] A further improvement of this invention lies in: constructing a difficulty prototype based on historical color matching samples and a smooth surrogate model, and then staining according to the formula to be predicted. Geometric retrieval with manifold regularization is performed to generate an initial coarse solution and contextual features, specifically including:
[0024] The smooth surrogate model is trained using historical color matching samples, which include the dye concentration vector of historical formulas and the corresponding dyeing results. Value, finished products Values and corresponding process parameters; The trained smooth surrogate model is used to calculate the Jacobian matrix at the dye concentration vector of each historical formula in the historical color matching samples, and the solution difficulty is calculated based on the Jacobian matrix. The solution difficulty is:
[0025]
[0026] in, For the first The difficulty of solving for a historical color scheme sample For the first Jacobian matrix at the dye concentration vector in a historical color scheme sample. and These are the maximum and minimum singular values of the Jacobian matrix, respectively. To prevent the stability constant from having a denominator of zero;
[0027] After staining according to the formula to be predicted Values and staining results in historical color matching samples The color distance between values is used to weight the difficulty of solving historical color matching samples, resulting in an estimated difficulty of solving the formula to be predicted.
[0028]
[0029]
[0030] in, After staining the formula to be predicted The estimated difficulty of solving the corresponding value After staining the formula to be predicted value, For the first After staining a historical color matching sample value, For color distance bandwidth parameters, It is the stability constant. As weight, This represents the number of historical color scheme samples.
[0031] Based on historical color matching samples after staining The color depth and solution difficulty corresponding to the value are used to construct clustering features, and K-Medoids clustering is performed in the clustering space to extract multiple real historical recipe points as difficulty prototypes. Each difficulty prototype cluster is sorted in ascending order according to the median value of the solution difficulty within the cluster, and is labeled as easy, medium, hard and extremely hard difficulty clusters in turn.
[0032] After staining according to the formula to be predicted Values and staining of the formula to be predicted The difficulty of estimating the value Calculate the overall distance from the formula to be predicted to the prototype clusters of each difficulty level:
[0033]
[0034] in, For the formula to be predicted up to the 1st The combined distance of each difficulty level prototype cluster. For the first The coloring corresponding to each difficulty prototype value, For the first Within each difficulty prototype cluster The median value, and These are the weighting coefficients. This refers to the difficulty distance bandwidth parameter;
[0035] The difficulty prototype cluster with the smallest overall distance is determined as the corresponding difficulty prototype cluster. and the corresponding difficulty prototype cluster The adjacent difficulty clusters in the solution difficulty ranking are determined as the candidate retrieval cluster set. :
[0036]
[0037]
[0038] Among them, when When the candidate is located at the sorting boundary, only the existing adjacent difficulty clusters are retained. If the number of historical color matching samples in the candidate retrieval cluster is less than the preset minimum number, then one adjacent difficulty cluster is expanded outward.
[0039] Perform geometric retrieval with manifold regularization on historical color samples corresponding to the candidate retrieval cluster set to generate an initial coarse solution and contextual features.
[0040] A further improvement of this invention is that: the geometric retrieval based on manifold regularization employs manifold regularization reweighting to calculate the historical color matching samples after staining the formula to be predicted. The reference weight of the value is calculated using the following expression:
[0041]
[0042] in, For the first The reference weights of historical color scheme samples, After staining the formula to be predicted value, It is the stability constant. After staining the formula to be predicted The estimated difficulty of solving the corresponding value This is a collection of historical color scheme samples. The geometric difficulty penalty coefficient, , The first , The difficulty of solving for a historical color scheme sample , The first , After staining a historical color matching sample value, For color distance bandwidth parameters, This refers to the difficulty distance bandwidth parameter;
[0043] Generate an initial coarse solution based on the reference weights:
[0044]
[0045]
[0046] in, For the first The dye concentration vector of a historical color scheme sample. This is the initial coarse solution in the logarithmic space. This represents the initial coarse solution in the concentration space. is the concentration stability constant.
[0047] A further improvement of this invention lies in: constructing a PG-KAMoE meta-learner with initial coarse solutions and contextual features as meta-inputs, and obtaining a set of key hyperparameters, specifically including:
[0048] The initial coarse solution in the logarithmic space is concatenated with the context features to obtain the meta-learner input;
[0049] A gating mechanism is used to adaptively activate and weightedly fuse multiple Spectral-KAN experts based on manifold difficulty, resulting in the original policy vector, expressed as:
[0050]
[0051]
[0052]
[0053] in, For the first The output of an expert , This is the weight matrix. , For bias vectors, For Mish-Sine smooth basis function layers, Input for meta-learner For the first The activation weight of each expert For the formula to be predicted up to the 1st The combined distance of each difficulty level prototype cluster. For the first The difficulty center corresponding to each expert For the first The difficulty center corresponding to each expert For scale parameters, , For bias, For temperature coefficient, For the number of experts, This is the original policy vector;
[0054] The original policy vector is mapped to a set of key hyperparameters using an activation function, expressed as follows:
[0055]
[0056]
[0057]
[0058]
[0059] in, , , , The original policy output component is obtained by weighted fusion of multiple Spectral-KAN experts in the PG-KAMoE meta-learner. This represents the minimum lower bound of the global damping factor. This is the minimum lower bound of the preconditioning vector. The maximum allowable relaxation factor, It is a positive activation function. For normalized activation functions, The global damping factor. For preconditional vectors, For robust loss parameters, It is a relaxation factor.
[0060] A further improvement of this invention lies in: robustly solving the formula to be predicted through a dual correction mechanism, verifying the reliability of the solution results, and determining the final formula, specifically including:
[0061] Construct a robust objective function, expressed as:
[0062]
[0063] in: for Jacobian matrix of the next iteration for The predicted residual vector of the next iteration , , The key hyperparameters are the robust loss parameter, the global damping factor, and the preconditioning vector, respectively. For regularization terms, This is the formula concentration increment vector in the current iteration. Let be the robust objective function to be minimized. Robust loss parameters Robust kernel function for controlling shape, For color channel index, , , There are three color channels: lightness component, red-green axis chromaticity component, and yellow-blue axis chromaticity component.
[0064] The double correction matrix is calculated using the following expression:
[0065]
[0066]
[0067] in: , , For color channels , , The weight, For the iterative reweighting matrix, It is a diagonal matrix;
[0068] Combining the dual correction matrix and the robust objective function, the dye concentration vector of the formulation to be predicted is updated, and the update expression is:
[0069]
[0070]
[0071] in: for The transpose of the Jacobian matrix in the next iteration This is the transpose of a diagonal matrix. for The diagonal weight matrix of the next iteration for The formula concentration increment vector for the next iteration. As a relaxation factor, for The dye concentration vector of the formulation to be predicted in the next iteration. for The dye concentration vector of the formulation to be predicted in the next iteration. To project the updated concentration to the physically feasible concentration range Inside.
[0072] The textile color matching optimization system of the present invention includes:
[0073] The value solving module is used to segment the full color gamut of the finished product, and introduces a bias calibration mechanism and a nonlinear residual compensation model to calculate the value after dyeing the formula to be predicted. The value is solved by reverse reasoning;
[0074] The initial coarse solution generation module is used to construct a smooth surrogate model. A difficulty prototype is built based on historical color matching samples and the smooth surrogate model, and then stained according to the formula to be predicted. The values are subjected to manifold-regularized geometric retrieval to generate an initial coarse solution and contextual features;
[0075] The meta-learner building module is used to construct a PG-KAMoE meta-learner with the initial coarse solution and contextual features as meta-inputs, and to obtain a set of key hyperparameters.
[0076] The formulation solution and verification module is used to robustly solve the formulation to be predicted based on a smooth surrogate model and a set of key hyperparameters through a dual correction mechanism, verify the reliability of the solution results, and determine the final formulation.
[0077] The electronic device of the present invention includes a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, it implements the steps of the above-described textile color matching optimization method.
[0078] The present invention provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the steps of the above-described textile color matching optimization method.
[0079] The beneficial effects of this invention are as follows: This invention achieves reverse compensation for color changes in the post-processing stage through a high-precision forward composite model combining piecewise linear modeling, bias calibration, and GBM residual compensation, thus eliminating systematic biases. This invention employs a smooth surrogate model constructed using a Spectral-KAN network with a Mish-Sine architecture, ensuring that eigenvalues do not fluctuate drastically and that gradient solving is non-oscillating. Combined with a gating mechanism to assign Spectral-KAN experts, this achieves overfitting of sparse staining data with a small number of parameters.
[0080] This invention constructs a dual correction mechanism that includes noise isolation at the data end and bias suppression at the model end. Combined with positive verification, it can quickly and effectively complete high-precision digital formula simulation and confidence assessment on the computer. Furthermore, it can be further developed and upgraded into an intelligent formula prediction system for convenient operation and use by printing and dyeing and coating enterprises. Attached Figure Description
[0081] Figure 1 This is a schematic diagram of the method flow in an embodiment of the present invention. Detailed Implementation
[0082] To make the objectives, technical solutions, and advantages of this invention clearer, the invention will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the invention. Furthermore, the technical features involved in the various embodiments of this invention described below can be combined with each other as long as they do not conflict with each other.
[0083] like Figure 1 As shown, the textile color matching optimization method of this embodiment includes:
[0084] Step 1: Segment the full color gamut of the finished product, introduce a bias calibration mechanism and a nonlinear residual compensation model, and apply the dyeing process to the formula to be predicted. The value is solved by reverse calculation.
[0085] This embodiment segments the entire color gamut of the finished product according to color depth and hue angle. For any finished product value ,in, These are the lightness component, the red-green axis chromaticity component, and the yellow-blue axis chromaticity component, respectively, used to calculate color depth. chromaticity and hue angle ,in, Normalization to Within the range. Color depth follows the boundary. , , and Divided into 4 segments, hue angle according to the boundary , , , , , , , The color gamut is divided into 8 sectors, thus dividing the entire color gamut into 32 color segments. For low-saturation neutral colors, when the chromaticity... Less than the preset threshold When the hue angle is unstable, the hue angle sector is determined by prioritizing color depth and combining it with the closest color sample from historical color matching samples. The historical color matching samples include: the dye concentration vector of historical formulas. , corresponding staining value The corresponding Lab value of the finished product Process parameters include fabric type, liquor ratio, temperature, time, auxiliary agent ratio, and width.
[0086] Within each color segment, establish the post-coloring... Value to finished product Local linear benchmark model of values:
[0087]
[0088] in, For staining value, Finished product predicted by the linear baseline model value, For the first The linear transformation matrix corresponding to each color segment This is a linear bias term.
[0089] For the Calculate the residuals from historical color matching samples within each color segment. :
[0090]
[0091] in, For the first Finished product of a historical color scheme sample value, For the first After staining a historical color matching sample value.
[0092] Segment the colors All residuals exist , , That is, taking the median values of the three color channels—the lightness component, the red-green axis chromaticity component, and the yellow-blue axis chromaticity component—to obtain the intra-segment median offset. :
[0093]
[0094] in, For the first A collection of historical color scheme samples within each color segment.
[0095] To avoid excessive bias due to a small number of samples or outliers in the historical color scheme sample set, this embodiment employs a shrinkage strategy that shrinks towards the global median bias and truncates the amplitude. Let the global median bias be... , No. The number of samples within each color segment is The shrinkage coefficient is The midpoint offset within the contracted segment is then... for:
[0096]
[0097] Constrain the midpoint offset within the contracted segment:
[0098]
[0099] in, For the maximum allowable offset amplitude, To prevent the stability constant from having a denominator of zero, This represents the bias amplitude after contraction. This is the median bias within the segment obtained after constraints. The shrinkage strategy in this embodiment can retain the ability to correct systematic biases within the segment while avoiding drastic jumps in the bias term caused by a small number of abnormal historical color matching samples.
[0100] The nonlinear residual compensation model in this embodiment is the gradient boosting tree model, i.e., the GBM model. For each color segment, based on the stained area... Using the values and process parameters as input features, and taking the residuals that are still unexplained after median bias correction from the local linear baseline model as learning targets, a nonlinear residual compensation model is trained:
[0101]
[0102] in, For the first The nonlinear residual compensation amount corresponding to each color segment For the first A tree of return, For learning rate, For the number of regression trees, For staining Input features consisting of values and process parameters.
[0103] No. The post-composition forward combination model within each color segment is represented as follows:
[0104]
[0105] in, For process parameters, For staining value Predicted finished products The post-combination model of values.
[0106] The post-combination forward model is used as the objective function for consistent back-reasoning. For the target product... value Solve to make the output of the post-processing forward combination model equal to the target product. After staining the corresponding value Value, i.e., the value after staining of the formula to be predicted. value :
[0107]
[0108] in, For Lab color, the physically feasible domain, This is the color channel weight matrix. After staining, the sample closest to the target finished product color in the historical color matching samples is stained. value, To stabilize the regularization coefficient, For staining value Predicted finished products The post-combination model of values.
[0109] The consistent reverse reasoning solution process includes: first, based on the target product... The initial color segmentation is determined by the initial values; then the inverse solution of the local linear baseline model is used as the initial values; subsequently, a numerical optimization method with boundary constraints is used to iteratively solve and tidy up the forward combination model; if the solution crosses the color segment boundary during the iteration process, that is, the dyeing result of the predicted formula obtained after the solution is obtained... value Does not conform to the corresponding color segmentation Color physical feasible region, i.e. If this is not the case, then the color segment is redefined and the corresponding post-processing forward combination model is updated; this continues until the color segmentation is stable and the output of the post-processing forward combination model matches the target product. If the error between the values is less than a preset threshold, the staining result of the formula to be predicted is obtained. value .
[0110] Step 2: Construct a smooth surrogate model. Based on historical color matching samples and the smooth surrogate model, build a difficulty prototype. After staining according to the formula to be predicted... The values are subjected to manifold regularized geometric retrieval to generate an initial coarse solution and contextual features.
[0111] In order to reduce the nonlinearity between color and dye concentration in this embodiment, a physical conservation mapping from concentration space to color space is established, that is, a logarithmic physical mapping is constructed, which specifically includes:
[0112] Obtain historical color matching samples. In this embodiment, the historical color matching samples include: dye concentration vectors of historical formulas. , corresponding staining value Corresponding finished products value Process parameters include fabric type, liquor ratio, temperature, time, auxiliary agent ratio, and width.
[0113] set up Given a dye concentration vector, perform a logarithmic transformation on the dye concentration vector to obtain the dye concentration vector in logarithmic space:
[0114]
[0115] in, Let be the dye concentration vector in logarithmic space. is the concentration stability constant.
[0116] This embodiment uses the Mish-Sine architecture's Spectral-KAN network to establish a smooth surrogate model. The smooth surrogate model is used to transform the dye concentration vector in logarithmic space. Mapped to staining value:
[0117]
[0118] in, For mapping functions, , , After mapping and staining value.
[0119] For color channels The output of the smooth proxy model is:
[0120]
[0121] in, The total number of Mish smoothing components. The total number of spectral components of the sine spectrum. For the first The constant bias term for each color channel, For the first A mapping function for each color channel. For the first The dye concentration vector in the logarithmic space of each dye channel. , , , , , All of these are parameters learned from historical color matching samples during model training, where: For the first In the color channel, the first The dye channel corresponds to the first The magnitude weight of each Mish smoothing component is used to control the contribution intensity of that Mish component to the output color channel. For the first In the color channel, the first The dye channel corresponds to the first The input scaling coefficients of each Mish smoothing component are used to adjust the dye concentration vector in logarithmic space. Sensitivity to Mish portion; For the first In the color channel, the first The dye channel corresponds to the first The translation offset of the Mish smoothing component is used to adjust the first... The position of each Mish component in the concentration space; For the first In the color channel, the first The dye channel corresponds to the first The amplitude weight of the sine spectral component is used to control the magnitude of the sine component. The contribution intensity of each Sine spectral component to the nonlinear color change; For the first In the color channel, the first The dye channel corresponds to the first The angular frequency of the 1st Sine spectral component is used to control the 1st... The oscillation rate of each Sine spectral component as a function of the logarithmic concentration variable is used to characterize the nonlinear color mixing effect at different scales. For the first In the color channel, the first The dye channel corresponds to the first The phase offset of each Sine spectral component is used to collectively characterize the effect of dye concentration changes on... , , The smoothing nonlinear effect of the three color channels This represents the number of dye channels.
[0122] The training data for the smooth surrogate model includes historical color matching samples. Regarding process parameters. During training, first... Dye concentration vector transformed into logarithmic space , and then For input, Use supervised labels to train a smooth proxy model.
[0123] The training objective function is:
[0124]
[0125] in, For smooth surrogate models in Jacobian matrix at the location, For Hessian matrix, For the regularization norm, , , The regularization coefficient is . For mapping functions, The number of historical color scheme samples, For the complete set of learnable parameters of the smooth surrogate model, including , , , , , , By using Jacobi regularization and second-order smoothing regularization, overfitting and gradient oscillations under small sample conditions can be suppressed, enabling the subsequent solver to obtain a continuous and smooth gradient field.
[0126] This embodiment utilizes the trained smooth surrogate model to extract implicit physical geometric properties, namely, calculating the Jacobian matrix and its condition number, to quantify the difficulty of the solution. For the ... A historical color scheme sample was first used to calculate a smooth surrogate model through automatic differentiation. Jacobian matrix at:
[0127]
[0128] Next, calculate the condition number of the Jacobian matrix:
[0129]
[0130] in, To prevent the stability constant from having a denominator of zero.
[0131] condition number The condition number is used to characterize the curvature and ill-conditioning of the color-formula manifold near the historical color sample, thus representing the difficulty of the solution. The larger the condition number, the more sensitive the color changes in that region are to concentration perturbations, and the more likely the solution process is to oscillate, reach local minima, or experience unstable updates.
[0132] The first Mapping historical color scheme samples to a clustering space :
[0133]
[0134] in, For the first The color depth corresponding to each historical color scheme sample For the first Logarithmic difficulty features of historical color scheme samples is the stability constant. This represents the clustering feature obtained after performing a logarithmic transformation on the solution difficulty index, which is used to reduce the scale difference between samples of different difficulty levels.
[0135] K-Medoids clustering is performed within the clustering space according to a preset configuration to extract... A real historical recipe point serves as the prototype for difficulty. In this embodiment, The value is set to 4, and is determined based on the difficulty index within each cluster. or logarithmic difficulty features The median values are sorted from smallest to largest, and the four difficulty prototype clusters are labeled as simple, medium, difficult and extremely difficult solution conditions.
[0136] This embodiment is based on the dyeing process of the formula to be predicted. value Geometric retrieval with manifold regularization is performed on historical color scheme samples. Specifically, this includes:
[0137] After staining according to the formula to be predicted value After staining compared to historical color matching samples The color distance between values is used to weight the difficulty of solving historical color matching samples, thus obtaining the estimated difficulty of solving the formula to be predicted. :
[0138]
[0139]
[0140] in, After staining the formula to be predicted The estimated difficulty of solving the corresponding value For color distance bandwidth parameters, For weights.
[0141] After staining according to the formula to be predicted Value and estimation difficulty Calculate the combined distance from the formula to be predicted to the prototype clusters of each difficulty level. :
[0142]
[0143] in, For the formula to be predicted up to the 1st The combined distance of each difficulty level prototype cluster. For the first The coloring corresponding to each difficulty prototype value, For the first Within each difficulty prototype cluster The median value, and These are the weighting coefficients. This refers to the difficulty distance bandwidth parameter.
[0144] The difficulty prototype cluster with the smallest overall distance is determined as the corresponding difficulty prototype cluster. In determining Afterwards, Together with adjacent difficulty clusters, a candidate retrieval cluster set is obtained. :
[0145]
[0146]
[0147] Among them, adjacent difficulty clusters refer to those clusters sorted by their median difficulty in ascending order, and adjacent to each other. Adjacent difficulty prototype clusters. If If the cluster is of easy difficulty, then only the medium difficulty cluster will be retained; if If the difficulty level is extremely high, only the difficult difficulty level cluster will be retained. If the number of candidate historical color scheme samples is lower than the preset minimum number, then an adjacent difficulty level cluster will be expanded outward.
[0148] In the candidate retrieval cluster set Corresponding historical color scheme sample set Calculate reference weights And generate an initial coarse solution based on the weights:
[0149]
[0150]
[0151]
[0152] in, For the first The reference weights of historical color scheme samples, The geometric difficulty penalty coefficient, For the first The difficulty of solving for a historical color scheme sample For the first After staining a historical color matching sample value, This is the initial coarse solution in the logarithmic space. This represents the initial coarse solution in the concentration space.
[0153] Initial coarse solution Meanwhile, it is derived from historical color scheme samples that are close in color distance, have similar solution difficulty, and are located in the corresponding difficulty prototype cluster and adjacent difficulty clusters, which can avoid relying solely on samples with similar colors but large differences in solution difficulty.
[0154] Contextual features include: the formula to be predicted to the set of candidate retrieval clusters. The overall distance of the corresponding difficulty prototype, the cluster type of the corresponding difficulty prototype, and the estimated solution difficulty. Historical color scheme sample collection The mean of the condition number, the variance of the condition number, the variance of the dye concentration in the formulation, and the number of valid samples.
[0155] Step 3: Construct a PG-KAMoE meta-learner with the initial coarse solution and contextual features as meta-inputs. Use a gating mechanism to adaptively activate and weightedly fuse multiple Spectral-KAN experts based on manifold difficulty, and output a set of key hyperparameters.
[0156] In this embodiment, the initial coarse solution and contextual features are input together into the PG-KAMoE meta-learner. The specific operations include:
[0157] The initial coarse solution in the logarithmic space After staining with the predicted formula value The overall distance of the corresponding difficulty prototype Estimate the difficulty of solving Historical color scheme sample collection The condition number mean, condition number variance, and dye concentration variance are concatenated to obtain the meta-learner input:
[0158]
[0159] in, For the input of the meta-learner, To predict the formula to the candidate retrieval cluster set The overall distance corresponding to the difficulty prototype. A collection of historical color scheme samples The mean of the condition number, A collection of historical color scheme samples The condition number variance of , A collection of historical color scheme samples The variance of the dye concentration in the formulation.
[0160] The output of the PG-KAMoE meta-learner is a set of key hyperparameters. :
[0161]
[0162] in, The global damping factor. For preconditional vectors, For robust loss parameters, As a relaxation factor, This represents the dimension of the dye concentration vector of the formulation to be predicted, i.e., the number of dye channels.
[0163] The expert network architecture in this embodiment is a lightweight Spectral-KAN network, namely a Spectral-KAN expert. The expression for each Spectral-KAN expert is:
[0164]
[0165] in, For the first The output of an expert , This is the weight matrix. , For bias vectors, It is a Mish-Sine smooth basis function layer.
[0166] In this embodiment, the first A Spectral-KAN expert first analyzed the meta-learner input. Perform a linear mapping to obtain the hidden input vector within the expert. :
[0167]
[0168] in:
[0169]
[0170] in, For the hidden layer dimension, To hide the input vector The 1st and 2nd Each component.
[0171] This embodiment defines: ,in, For the scalar input components of the Mish-Sine smoothed basis function layer, the scalar input components are... The corresponding output of the Mish-Sine smooth basis function layer Represented as:
[0172]
[0173] in, For Mish component weights, For the first Weights of each Sine spectral component For learnable frequencies, For phase parameters, The number of spectral components.
[0174] The gating mechanism uses the Softmax function to calculate the activation weights of each expert based on the comprehensive distance:
[0175]
[0176] in, For the first The activation weight of each expert For the first The difficulty center corresponding to each expert For the first The difficulty center corresponding to each expert For scale parameters, , For bias, For temperature coefficient, For the number of experts.
[0177] The outputs of all experts are weighted and fused to obtain the original policy vector:
[0178]
[0179] Wherein, the original policy vector , Let the space be a real vector space, and the original policy vector be... Divided according to the fixed-dimensional slicing method:
[0180]
[0181] in:
[0182]
[0183]
[0184]
[0185] in, , , , The original policy output components obtained by weighted fusion of multiple Spectral-KAN experts in the PG-KAMoE meta-learner are used to generate the global damping factor, preconditioning vector, robust loss parameter, and relaxation factor, respectively. , , , , These are the components of the original policy vector.
[0186] The original policy vector is mapped to a set of key hyperparameters using an activation function:
[0187]
[0188]
[0189]
[0190]
[0191] in, This represents the minimum lower bound of the global damping factor. This is the minimum lower bound of the preconditioning vector. The maximum allowable relaxation factor, This is a positive activation function, used to ensure that the output parameter is positive. This is a normalized activation function used to restrict the output to a certain value. Within the range.
[0192] Global damping factor Used to control the regularization strength in the Gauss-Newton update process. When the color-recipe manifold corresponding to the current task is ill-conditioned or the solution is unstable, a larger regularization is used. This can enhance the damping effect, suppress excessively large concentration update step sizes, and improve iteration stability. The minimum lower bound of the global damping factor. This is used to prevent the update process from oscillating or becoming numerically unstable due to an excessively small damping factor.
[0193] Precondition vector The dimension of the vector is consistent with the dimension of the dye concentration vector of the formulation to be predicted. If the current formulation contains... If there are one dye channel, then:
[0194]
[0195] in, From 1 to The precondition weights corresponding to each dye channel are used to construct the precondition matrix:
[0196]
[0197] Precondition matrix The regularization term applied to the increase in the concentration of the formulated dye is used to suppress aggressive updates in the direction of untrusted dye channels; it is the minimum lower bound of the preconditioning vector. This is used to ensure that each dye channel has basic regularization constraints.
[0198] Robust loss parameters Restricted to Within the interval, the shape of the robust kernel function is controlled. Different The values correspond to different anomaly residual suppression intensities, thus determining the solver's sensitivity to anomalous color residuals or noisy samples. Generally speaking, The smaller the value, the stronger the suppression of abnormal residuals. The closer the value is to 2, the closer the loss function is to ordinary quadratic loss.
[0199] relaxation factor Used to control the actual update ratio of concentration correction in each iteration. Restricted to Within the range. Smaller. It can reduce the update step size, prevent the formulation concentration from being updated too drastically and exceeding the physically feasible range, and has a larger [capacity / scalability]. This helps to accelerate convergence when solving for stability. Maximum allowable relaxation factor. Used to limit the maximum update size in a single iteration.
[0200] The core advantage of the expert network architecture in this embodiment lies in establishing a... An infinitely smooth control manifold ensures accurate staining of the formulation to be predicted. When the geometric characteristics of the value change slightly, the change in the solution strategy of the output is continuous and smooth, avoiding the instability of the solution caused by abrupt changes in strategy.
[0201] Step 4: Based on the smooth surrogate model and the set of key hyperparameters, a robust solution for the formulation to be predicted is performed through a dual correction mechanism. The reliability of the solution results is verified to determine the final formulation.
[0202] This embodiment performs robust solving of the improved iterative reweighted least squares-Gauss-Newton (IRLS-GN) algorithm using the IRLS-GN solver. The solution process utilizes the Jacobian matrix of the smooth surrogate model and the set of key hyperparameters output by the PG-KAMoE meta-learner, implemented through a dual correction mechanism. The main operations include the following:
[0203] Constructing a robust objective function. The robust objective function constructed in this embodiment integrates an adaptive robust kernel function and manifold regularization, overcoming the shortcomings of the traditional Gauss-Newton method, such as sensitivity to outliers and susceptibility to local minima. The expression is:
[0204]
[0205] in: For Jacobian matrices, To predict the residual vector, For regularization terms, For robust loss parameters Robust kernel function for controlling shape, when for It degenerates into L2 loss. for This can evolve into Cauchy or Welsch loss. This is the formula concentration increment vector in the current iteration. Let be the robust objective function to be minimized. The robust kernel function allows the solver to reduce the influence of extreme residual terms on the optimization direction and prevent gradient explosion caused by data noise.
[0206] To calculate the dual correction matrix, this embodiment constructs two independent matrices: the iterative reweighting matrix. and diagonal matrix This achieves isolation of data-side noise and suppression of model-side bias. The iterative reweighting matrix is one such component. Using the principle of iterative reweighted least squares, the nonlinear robust kernel function is transformed into a diagonal weight matrix, expressed as:
[0207]
[0208] in: , , For color channels The weight, , For robust kernel functions For color channels Predicted residual vector First derivative, color channel , It is a constant. If the prediction residual vector of a certain color channel is a constant. Exceeding the preset residual threshold and Instructions need to be robustly handled, i.e. for The calculated weights Approaching 0. The solver will abandon fitting the noisy channel, thus isolating the data measurement noise from interfering with the optimization direction.
[0209] Let the dye concentration vector at the current iteration be... Smooth surrogate model predicts the post-staining value for:
[0210]
[0211] Predicting residual vector for:
[0212]
[0213] Calculate the Jacobian matrix using automatic differentiation:
[0214]
[0215] Combined with iterative reweighting matrix Global damping factor and precondition matrix Solve for the concentration correction factor:
[0216]
[0217] Update the formula using relaxation factors:
[0218]
[0219] in, This indicates that the updated concentration is projected onto the physically feasible concentration range. To prevent negative concentrations or concentrations exceeding the maximum allowable limit of the process.
[0220] In this embodiment, after the solution converges, the optimal formula is... That is, the optimal dye concentration vector is input into the smooth surrogate model to obtain the predicted dyeing result. value :
[0221]
[0222] And After staining with the formula to be predicted obtained in step 1 value Compare and calculate the predicted color difference after dyeing:
[0223]
[0224] in, To predict color difference after dyeing, , , The optimal formulas are respectively After staining predicted by the smooth surrogate model The values include the lightness component, the red-green axis chromaticity component, and the yellow-blue axis chromaticity component; , , These represent the staining results of the formula to be predicted obtained by reverse calculation in step 1. The values include the lightness component, the red-green axis chromaticity component, and the yellow-blue axis chromaticity component. Predicted color difference after dyeing. Used to evaluate whether the optimal formulation can approximate the target color space after dyeing. Value, i.e., the value after staining of the formula to be predicted. value.
[0225] Furthermore, the prediction after staining value Input the post-combination forward combination model from step 1 to obtain the predicted product. value :
[0226]
[0227] Predicted finished products value With the target finished product value Compare and calculate the predicted color difference of the finished product:
[0228]
[0229] in, The predicted color difference of the finished product after verification by the post-processing forward combination model. , , Target finished products The values represent the lightness component, red-green axis chromaticity component, and yellow-blue axis chromaticity component, with subscripts... Indicates the target object, superscript This is the color space for the finished product.
[0230] Simultaneously, calculate the condition number of the Jacobian matrix at the optimal formulation:
[0231]
[0232] in, For smooth surrogate models in optimal formulation The Jacobian matrix at that point. Condition number threshold. The condition number distribution of historical successful color matching samples is determined by taking the 95th percentile of the condition number of historical successful samples.
[0233] like Exceeding the preset threshold, or Exceeding the preset threshold, or If the current task has a high risk of failure or no stable physically feasible solution, the automatic formula output will be rejected, and a manual review process will be initiated; otherwise, the optimal formula will be output. and confidence interval .in, Given the posterior covariance matrix, a smooth surrogate model is used in the optimal formulation. The Jacobian matrix at the given location and the corresponding iterative reweighting matrix The calculation yields the following expression:
[0234] .
[0235] In this embodiment, the dynamic control of the dye concentration formulation prediction solution strategy is achieved by constructing a physics-guided hybrid expert meta-learner (PG-KAMoE). The gating mechanism automatically adjusts the expert network according to the manifold difficulty to output the global damping factor and precondition vector. This constitutes a white-box mapping from geometric features to the solution strategy, which is the biggest difference between this embodiment and traditional fixed parameter solutions or black-box predictions.
[0236] It will be understood by those skilled in the art that, unless otherwise defined, all terms used herein (including technical and scientific terms) have the same meaning as commonly understood by one of ordinary skill in the art to which this invention pertains. It should also be understood that terms such as those defined in general dictionaries should be understood to have the same meaning as in the context of the prior art, and should not be interpreted in an idealized or overly formal sense unless defined as such herein.
[0237] The specific embodiments described above further illustrate the purpose, technical solution, and beneficial effects of the present invention. It should be understood that the above description is only a specific embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the protection scope of the present invention.
Claims
1. A method for optimizing textile color matching, characterized in that, include: The full color gamut of the finished product is segmented, and a bias calibration mechanism and a nonlinear residual compensation model are introduced to perform dyeing of the formula to be predicted. The value is solved by reverse reasoning; A smooth surrogate model is constructed, and a difficulty prototype is built based on historical color matching samples and the smooth surrogate model. This prototype is then used to predict the color matching formula after staining. The values are subjected to manifold-regularized geometric retrieval to generate an initial coarse solution and contextual features; A PG-KAMoE meta-learner is constructed with the initial coarse solution and contextual features as meta-inputs, and a set of key hyperparameters is obtained. Based on a smooth surrogate model and a set of key hyperparameters, a robust solution to the formulation to be predicted is achieved through a dual correction mechanism. The reliability of the solution results is verified to determine the final formulation. Constructing a smooth proxy model specifically includes: Transform the dye concentration vector to logarithmic space; Based on the Mish-Sine architecture, the Spectral-KAN network is constructed to map dye concentration vectors in logarithmic space to colors. The smooth proxy model, the output of the smooth proxy model is: ; in, The total number of Mish smoothing components. The total number of spectral components of the sine spectrum. For the first The constant bias term for each color channel, For the first A mapping function for each color channel. Let be the dye concentration vector in logarithmic space. For the first The dye concentration vector in the logarithmic space of each dye channel. , , The first In the color channel, the first The dye channel corresponds to the first The magnitude weights, input scaling coefficients, and translation biases of each Mish smoothing component. , , For the first In the color channel, the first The dye channel corresponds to the first The amplitude weights, angular frequencies, and phase biases of each Sine spectral component. This represents the number of dye channels; A difficulty prototype was constructed based on historical color matching samples and a smooth surrogate model, and then dyed according to the formula to be predicted. The values are subjected to manifold regularization for geometric retrieval, generating an initial coarse solution and contextual features, including: The smooth proxy model is trained using historical color matching samples; The Jacobian matrix at each dye concentration vector in the historical color matching samples is calculated using a smooth surrogate model, and the solution difficulty is calculated based on the Jacobian matrix. After staining according to the formula to be predicted Values and staining results in historical color matching samples The color distance between values is used to weight the difficulty of solving historical color matching samples, resulting in a prediction of the color distance after dyeing. The difficulty of estimating the value ; Based on historical color matching samples after staining The color depth and solution difficulty corresponding to the value are used to construct clustering features, and K-Medoids clustering is performed to extract multiple real historical recipe points as difficulty prototypes. The prototype clusters of each difficulty level are sorted in ascending order according to the median value of the solution difficulty within the cluster, and are labeled as easy, medium, hard, and extremely hard difficulty clusters in turn; After staining according to the formula to be predicted The value and estimated solution difficulty are used to calculate the comprehensive distance from the formula to be predicted to the prototype clusters of each difficulty level. The difficulty prototype cluster with the smallest comprehensive distance is determined as the corresponding difficulty prototype cluster, and the corresponding difficulty prototype cluster and the adjacent difficulty clusters in the solution difficulty ranking are determined as the candidate retrieval cluster set; Perform geometric retrieval with manifold regularization on historical color samples corresponding to the candidate retrieval cluster set to generate an initial coarse solution and contextual features.
2. The textile color matching optimization method according to claim 1, characterized in that, Geometric retrieval employs manifold regularization and reweighting to calculate the staining results of historical color samples for the formula to be predicted. Reference weight of the value: ; in, For the first The reference weights of historical color scheme samples, After staining the formula to be predicted value, It is the stability constant. This is a collection of historical color scheme samples. The geometric difficulty penalty coefficient, , The first , The difficulty of solving for a historical color scheme sample , The first , After staining a historical color matching sample value, For color distance bandwidth parameters, This refers to the difficulty distance bandwidth parameter; The generated initial coarse solution is: ; ; in, For the first The dye concentration vector of a historical color scheme sample. This is the initial coarse solution in the logarithmic space. This represents the initial coarse solution in the concentration space. is the concentration stability constant.
3. The textile color matching optimization method according to claim 1, characterized in that, A PG-KAMoE meta-learner is constructed with the initial coarse solution and contextual features as meta-inputs, and a set of key hyperparameters is obtained, specifically including: The initial coarse solution in the logarithmic space is concatenated with the context features to obtain the meta-learner input; A gating mechanism is used to adaptively activate and weightedly fuse multiple Spectral-KAN experts to obtain the original policy vector, expressed as: ; ; ; in, For the first The output of an expert , This is the weight matrix. , For bias vectors, For Mish-Sine smooth basis function layers, For the input of the meta-learner, For the first The activation weight of each expert For the formula to be predicted up to the 1st The combined distance of each difficulty level prototype cluster. For the first The difficulty center corresponding to each expert For the first The difficulty center corresponding to each expert For scale parameters, , For bias, For temperature coefficient, For the number of experts, This is the original policy vector; The original policy vector is mapped to a set of key hyperparameters through an activation function.
4. The textile color matching optimization method according to claim 1, characterized in that, Robust solution of the formulation to be predicted is achieved through a dual correction mechanism, including: Constructing a robust objective function: ; in: for Jacobian matrix of the next iteration for The predicted residual vector of the next iteration , , The key hyperparameters are the robust loss parameter, the global damping factor, and the preconditioning vector, respectively. For regularization terms, This is the formula concentration increment vector in the current iteration. Let be the robust objective function to be minimized. Robust loss parameters Robust kernel function for controlling shape, For color channel index, , , There are three color channels: lightness component, red-green axis chromaticity component, and yellow-blue axis chromaticity component. Calculate the double correction matrix: ; ; in: , , For color channels , , The weight, For the iterative reweighting matrix, It is a diagonal matrix; By combining the dual correction matrix and the robust objective function, the dye concentration vector of the formulation to be predicted is updated.
5. A textile color matching optimization system based on the method of any one of claims 1 to 4, characterized in that, include: The value solving module is used to segment the full color gamut, introduce a bias calibration mechanism and a nonlinear residual compensation model, and perform colorimetric calculations after dyeing the formula to be predicted. The value is solved by reverse reasoning; The initial coarse solution generation module is used to construct a smooth surrogate model. A difficulty prototype is built based on historical color matching samples and the smooth surrogate model, and then stained according to the formula to be predicted. The values are subjected to manifold-regularized geometric retrieval to generate an initial coarse solution and contextual features; The meta-learner building module is used to construct a PG-KAMoE meta-learner with the initial coarse solution and contextual features as meta-inputs, and to obtain a set of key hyperparameters. The formulation solution and verification module is used to robustly solve the formulation to be predicted based on a smooth surrogate model and a set of key hyperparameters through a dual correction mechanism, verify the reliability of the solution results, and determine the final formulation.
6. An electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, it implements the steps of the textile color matching optimization method as described in any one of claims 1 to 4.
7. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, it implements the steps of the textile color matching optimization method as described in any one of claims 1 to 4.
Citation Information
Patent Citations
Textile printing and dyeing intelligent color matching method based on data driving
CN114564888A
Cheese intelligent color matching and dyeing quality prediction method and system
CN122334627A
