A color matching method and system based on Oswald color three-dimensional grid model
Through the color mixing method based on the austenitic three-dimensional grid model, the problems of low color mixing efficiency and unstable results in the existing technology are solved, and high-precision color mixing and process efficiency are improved, providing intelligent solutions for the printing and dyeing industry.
Patent Information
- Application Number
- CN202510205872.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-02-25
- Publication Date
- 2025-05-02
- Estimated Expiration
- 2045-02-25
AI Technical Summary
The prior art relies on experience or trial and error methods in the process of color allocation, making it difficult to meet the needs of complex color systems and dynamic process conditions, resulting in low production efficiency and unstable distribution results.
The color allocation method based on the austenitic three-dimensional grid model is adopted to achieve accurate positioning by converting the user-specified color samples into three-dimensional coordinates, combining the RGB information extracted by spectrophotometer and color space conversion formula. Use Euclidean distance matching grid points, perform second-order polynomial fitting, and optimize process parameters for high-precision color matching.
It realizes accurate matching and color matching of color samples, improves the accuracy and efficiency of color matching, and provides an intelligent solution to meet the color matching needs under complex process conditions.
Smart Images

Figure CN119692209B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of color modeling, and in particular to a color matching method and system based on an Oswald color three-dimensional grid model. Background Art
[0002] Existing technologies still face many problems in the color matching process. Traditional color matching methods rely on experience or simple trial and error, which are difficult to meet the needs of complex color systems and dynamic process conditions. In addition, the lack of intelligent algorithms for global optimization of process parameters leads to low production efficiency, unstable matching results, and the inability to achieve efficient and accurate color matching. These technical defects limit the printing and dyeing industry's ability to further improve production efficiency and product quality.
[0003] Therefore, a color matching method and system based on Oswald color three-dimensional grid model is proposed. Summary of the invention
[0004] The object of the present invention is to provide a color matching method and system based on an Ostrich color three-dimensional grid model. The present invention converts the user-specified color sample into three-dimensional coordinates, combines the RGB information extracted by the spectrophotometer and the color space conversion formula, realizes precise positioning, and matches the grid points by Euclidean distance, so as to provide reliable data for color matching and process optimization. The present invention adopts a multi-task learning model to build a model, optimizes color difference and color fastness at the same time, and improves the model performance by a joint loss function and a dynamic weight mechanism. The process parameter combination is optimized based on the particle swarm optimization algorithm, and quickly converges to the optimal parameter combination, finally achieving high-precision color matching and process efficiency improvement, and providing an intelligent solution for the printing and dyeing field.
[0005] To achieve the above object, the present invention provides the following technical solutions:
[0006] A color matching method based on an Oswald color three-dimensional grid model, comprising:
[0007] Based on the Oswald color three-dimensional gridding model, the existing color data is mapped to a three-dimensional color grid, each grid point of the three-dimensional color grid contains a set of existing color data, the existing color data includes grid point coordinates and grid point color ratios, and the grid point coordinates include hue coordinates, lightness coordinates and saturation coordinates;
[0008] Receive a color sample specified by a user, convert the color sample into a sample three-dimensional coordinate corresponding to an Oswald color three-dimensional grid model, perform grid matching according to the sample three-dimensional coordinates, and obtain a sample matching grid;
[0009] Obtaining N grid points of the sample matching grid, performing second-order polynomial fitting according to the grid point coordinates and grid point color ratios of the N grid points to obtain a fitted second-order polynomial, and calculating the color ratio of the three-dimensional coordinates of the sample by using the fitted second-order polynomial to obtain the sample color ratio;
[0010] Color matching is performed according to the sample color ratio, the range of matching process parameters and optimization targets are determined, test experiments with different process parameter combinations are designed and experimental data are recorded, the experimental data are modeled through a multi-task learning model, and the process parameter combination is optimized through a particle swarm optimization algorithm. When the particle swarm optimization algorithm stops iterating, the optimal process parameters are obtained, and then the optimal color matching solution is obtained.
[0011] Further, obtaining the sample matching grid includes:
[0012] Receiving a color sample specified by a user, and extracting RGB color information of the color sample by a spectrophotometer;
[0013] Convert the RGB color information into the sample three-dimensional coordinates using a color space conversion formula;
[0014] Match the grid points using Euclidean distance to determine the closest N grid points;
[0015] The three-dimensional color grid to which the N grid points belong is determined to obtain the sample matching grid.
[0016] Further, obtaining the sample color ratio includes:
[0017] Arrange the grid point coordinates and grid point color ratios of N grid points into a ratio data set;
[0018] Performing second-order polynomial fitting on the ratio data set, respectively calculating the polynomial coefficients of the three pigment ratios of R, Y and B, and obtaining the second-order fitting polynomials of the three pigment ratios;
[0019] Substitute the three-dimensional coordinates of the sample into the second-order fitting polynomial to calculate the ratio of the three pigments R, Y and B, and then obtain the color ratio of the sample.
[0020] Furthermore, modeling the experimental data by a multi-task learning model includes:
[0021] Preprocessing the experimental data to obtain preprocessed data;
[0022] Dividing the preprocessed data into a training set and a test set, and constructing the multi-task learning model through the training set to achieve simultaneous optimization of color difference and color fastness;
[0023] Optimizing the multi-task learning model by using a joint loss function combined with a dynamic weight allocation mechanism;
[0024] The model performance is evaluated by k-fold cross validation and mean square error. When the mean square error is less than the error threshold, the training is stopped to obtain a pre-trained multi-task learning model.
[0025] Furthermore, obtaining the optimal color matching solution includes:
[0026] S401: randomly generating an initial position and initial velocity of a particle swarm, and initializing optimization parameters, wherein each particle represents a set of process parameter combinations; the optimization parameters include inertia weight, acceleration factor, maximum number of iterations, and convergence threshold, and the process parameters include temperature, pH value, time, and salt concentration;
[0027] S402: Design a fitness function to comprehensively evaluate color difference and color fastness, and calculate the fitness value of each particle, while recording the individual optimal position and the global optimal position;
[0028] S403: updating the speed according to the current speed of the particle, the individual optimal position and the global optimal position, and calculating the new position of the particle with the updated speed;
[0029] S404: Calculate the fitness value of each particle and update the individual optimal position and the global optimal position;
[0030] S405: Determine whether the iteration stop condition is met; if so, output the global optimal position as the optimal process parameter combination; otherwise, re-execute S403; the iteration stop condition is that the maximum number of iterations is reached or the fitness value of the global optimal position is less than the convergence threshold.
[0031] The present invention also proposes a color matching system based on an Oswald color three-dimensional grid model, comprising:
[0032] A three-dimensional grid model building module, for mapping existing color data to a three-dimensional color grid based on an Oswald color three-dimensional grid model, wherein each grid point of the three-dimensional color grid contains a set of existing color data, wherein the existing color data includes grid point coordinates and grid point color ratios, and wherein the grid point coordinates include hue coordinates, lightness coordinates, and saturation coordinates;
[0033] A sample positioning module is used to receive a color sample specified by a user, convert the color sample into a sample three-dimensional coordinate corresponding to the Oswald color three-dimensional grid model, and perform grid matching according to the sample three-dimensional coordinates to obtain a sample matching grid;
[0034] A sample color matching ratio acquisition module is used to acquire N grid points of the sample matching grid, perform second-order polynomial fitting according to the grid point coordinates and the grid point color matching ratio of the N grid points to obtain a fitted second-order polynomial, and calculate the color matching ratio of the sample three-dimensional coordinates by using the fitted second-order polynomial to obtain the sample color matching ratio;
[0035] The process parameter optimization module is used to perform color matching according to the sample color ratio, determine the range of the matching process parameters and the optimization target, design test experiments for different process parameter combinations and record experimental data, model the experimental data through a multi-task learning model, and optimize the process parameter combination through a particle swarm optimization algorithm. When the particle swarm optimization algorithm stops iterating, the optimal process parameters are obtained, and then the optimal color matching solution is obtained.
[0036] Further, obtaining the sample matching grid includes:
[0037] Receiving a color sample specified by a user, and extracting RGB color information of the color sample by a spectrophotometer;
[0038] Convert the RGB color information into the sample three-dimensional coordinates using a color space conversion formula;
[0039] Match the grid points using Euclidean distance to determine the closest N grid points;
[0040] The three-dimensional color grid to which the N grid points belong is determined to obtain the sample matching grid.
[0041] Further, obtaining the sample color ratio includes:
[0042] Arrange the grid point coordinates and grid point color ratios of N grid points into a ratio data set;
[0043] Performing second-order polynomial fitting on the ratio data set, respectively calculating the polynomial coefficients of the three pigment ratios of R, Y and B, and obtaining the second-order fitting polynomials of the three pigment ratios;
[0044] Substitute the three-dimensional coordinates of the sample into the second-order fitting polynomial to calculate the ratio of the three pigments R, Y and B, and then obtain the color ratio of the sample.
[0045] Furthermore, modeling the experimental data by a multi-task learning model includes:
[0046] Preprocessing the experimental data to obtain preprocessed data;
[0047] Dividing the preprocessed data into a training set and a test set, and constructing the multi-task learning model through the training set to achieve simultaneous optimization of color difference and color fastness;
[0048] Optimizing the multi-task learning model by using a joint loss function combined with a dynamic weight allocation mechanism;
[0049] The model performance is evaluated by k-fold cross validation and mean square error. When the mean square error is less than the error threshold, the training is stopped to obtain a pre-trained multi-task learning model.
[0050] Furthermore, obtaining the optimal color matching solution includes:
[0051] S401: randomly generating an initial position and initial velocity of a particle swarm, and initializing optimization parameters, wherein each particle represents a set of process parameter combinations; the optimization parameters include inertia weight, acceleration factor, maximum number of iterations, and convergence threshold, and the process parameters include temperature, pH value, time, and salt concentration;
[0052] S402: Design a fitness function to comprehensively evaluate color difference and color fastness, and calculate the fitness value of each particle, while recording the individual optimal position and the global optimal position;
[0053] S403: updating the speed according to the current speed of the particle, the individual optimal position and the global optimal position, and calculating the new position of the particle with the updated speed;
[0054] S404: Calculate the fitness value of each particle and update the individual optimal position and the global optimal position;
[0055] S405: Determine whether the iteration stop condition is met; if so, output the global optimal position as the optimal process parameter combination; otherwise, re-execute S403; the iteration stop condition is that the maximum number of iterations is reached or the fitness value of the global optimal position is less than the convergence threshold.
[0056] Compared with the prior art, the present invention has the following beneficial effects:
[0057] 1. The present invention converts the color sample specified by the user into the three-dimensional coordinates of the Occult color three-dimensional grid model, uses a spectrophotometer to accurately extract the RGB information of the color sample, and then completes the three-dimensional coordinate mapping through the color space conversion formula, so as to achieve accurate positioning of the color sample in the grid model. Combined with the Euclidean distance algorithm to match the closest N grid points, and further identify the three-dimensional color grid to which these grid points belong, it not only improves the accuracy of color matching, but also provides reliable basic data support for subsequent color matching and process optimization.
[0058] 2. Modeling experimental data through multi-task learning models can simultaneously optimize color difference and color fastness to achieve accurate color matching. By preprocessing data, dividing training sets and test sets, and adopting joint loss functions and dynamic weight allocation mechanisms, the balance and adaptability of the model are improved; combined with k-fold cross validation and mean square error evaluation, the stability and accuracy of the model performance are ensured. The final pre-trained model provides strong support for optimizing process parameters and improving the matching effect.
[0059] 3. Optimize the process parameter combination through the particle swarm optimization algorithm, effectively integrate the color difference and color fastness evaluation, and accurately calculate the optimal process parameters with the dynamic update of the global and individual optimal positions as the core. Through the steps of initial randomization setting, fitness function design, particle position and speed iterative update, the algorithm converges quickly and outputs the optimization results. Ultimately, the color matching accuracy and efficiency are significantly improved, providing an efficient and intelligent solution for color matching under complex process conditions. BRIEF DESCRIPTION OF THE DRAWINGS
[0060] Figure 1 A flow chart of a color matching method based on an Oswald color three-dimensional grid model provided by an embodiment of the present invention;
[0061] Figure 2 A flowchart for obtaining an optimal color matching solution provided by an embodiment of the present invention;
[0062] Figure 3 A structural diagram of a color matching system based on an Oswald color three-dimensional grid model provided in an embodiment of the present invention. DETAILED DESCRIPTION
[0063] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0064] The first embodiment provided by the present invention is as follows:
[0065] A color matching method based on the Oswald color three-dimensional grid model, such as Figure 1 As shown, including:
[0066] S100: Based on the Oswald color three-dimensional gridding model, the existing color data is mapped to a three-dimensional color grid, wherein each grid point of the three-dimensional color grid contains a set of existing color data, and the existing color data includes grid point coordinates and grid point color ratios, and the grid point coordinates include hue coordinates, lightness coordinates, and saturation coordinates;
[0067] S200: receiving a color sample specified by a user, converting the color sample into a sample three-dimensional coordinate corresponding to an Oswald color three-dimensional grid model, performing grid matching according to the sample three-dimensional coordinates, and obtaining a sample matching grid;
[0068] Further, obtaining the sample matching grid includes:
[0069] Receiving a color sample specified by a user, and extracting RGB color information of the color sample by a spectrophotometer;
[0070] Convert the RGB color information into the sample three-dimensional coordinates using a color space conversion formula;
[0071] Match the grid points using Euclidean distance to determine the closest N grid points;
[0072] The three-dimensional color grid to which the N grid points belong is determined to obtain the sample matching grid.
[0073] Specifically, the color space conversion formula is:
[0074] ;
[0075] Among them, R, G and B represent the component values of the red, green and blue channels respectively, max represents the maximum component value in the RGB channel, min represents the minimum component value in the RGB channel, H represents the hue coordinate, L represents the lightness coordinate, and S represents the saturation coordinate; the calculation formula of the Euclidean distance is:
[0076] ;
[0077] Where d represents the Euclidean distance, represents the three-dimensional coordinates of the sample, Represents the three-dimensional coordinates of the grid point i. Since each three-dimensional color grid of the Ostrich color three-dimensional grid model has 8 vertices, N is taken as 8; the sample matching grid can be confirmed through 8 grid points.
[0078] By converting the color samples specified by the user into the three-dimensional coordinates of the samples in the Occult color three-dimensional grid model, and combining the RGB color information extracted by the spectrophotometer and the color space conversion formula for coordinate conversion, and then using the Euclidean distance matching algorithm to quickly determine the closest N grid points, the position of the sample in the three-dimensional color grid can be accurately located, thereby achieving efficient and accurate sample grid matching, providing a reliable data basis for subsequent color matching and optimization.
[0079] S300: Obtain N grid points of the sample matching grid, perform second-order polynomial fitting according to the grid point coordinates and grid point color ratios of the N grid points to obtain a fitted second-order polynomial, and calculate the color ratio of the three-dimensional coordinates of the sample by using the fitted second-order polynomial to obtain the sample color ratio;
[0080] Further, obtaining the sample color ratio includes:
[0081] Arrange the grid point coordinates and grid point color ratios of N grid points into a ratio data set;
[0082] Performing second-order polynomial fitting on the ratio data set, respectively calculating the polynomial coefficients of the three pigment ratios of R, Y and B, and obtaining the second-order fitting polynomials of the three pigment ratios;
[0083] Substitute the three-dimensional coordinates of the sample into the second-order fitting polynomial to calculate the ratio of the three pigments R, Y and B, and then obtain the color ratio of the sample.
[0084] Specifically, the grid point coordinates and grid point color ratios of N grid points are organized into a ratio data set ,in represents the color ratio of grid point i, which represents the proportion of red, yellow and blue pigments respectively; fitting a second-order polynomial according to the color ratio, we have:
[0085] ;
[0086] in, , and Respectively represent the proportion of red, yellow and blue pigments The polynomial equation corresponding to the three-dimensional coordinates, a, b and c are all polynomial coefficients. The polynomial equation is solved by substituting the coordinates and color ratio of each grid point to obtain the second-order fitting polynomials of the three pigments R, Y and B; the three-dimensional coordinates of the sample are substituted into the three second-order fitting polynomials to calculate the proportions of the three pigments R, Y and B, and the color ratio of the sample can be obtained;
[0087] By sorting the coordinates and color ratios of N grid points in the sample matching grid and fitting a second-order polynomial, fitting polynomials for the three pigments R, Y and B are generated respectively, and the three-dimensional coordinates of the sample are substituted into the fitting formula to accurately calculate the pigment ratio. This method can effectively utilize the grid point information to achieve accurate prediction of the sample color ratio, significantly improving the accuracy and efficiency of the formula calculation, and providing effective technical support for the accurate restoration and efficient blending of complex colors.
[0088] S400: Perform color matching according to the sample color ratio, determine the range of matching process parameters and optimization targets, design test experiments for different process parameter combinations and record experimental data, model the experimental data through a multi-task learning model, and optimize the process parameter combination through a particle swarm optimization algorithm. When the particle swarm optimization algorithm stops iterating, the optimal process parameters are obtained, and then the optimal color matching solution is obtained.
[0089] Furthermore, modeling the experimental data by a multi-task learning model includes:
[0090] Preprocessing the experimental data to obtain preprocessed data;
[0091] Dividing the preprocessed data into a training set and a test set, and constructing the multi-task learning model through the training set to achieve simultaneous optimization of color difference and color fastness;
[0092] Optimizing the multi-task learning model by using a joint loss function combined with a dynamic weight allocation mechanism;
[0093] The model performance is evaluated by k-fold cross validation and mean square error. When the mean square error is less than the error threshold, the training is stopped to obtain a pre-trained multi-task learning model.
[0094] Specifically, the preprocessing process includes data normalization, missing data completion and duplicate data removal; the preprocessed data is divided into a training set and a test set in a ratio of 7:3, the input features of the multi-task learning model include temperature, pH value, time and salt concentration, and the shared feature extraction layer of the multi-task learning model is used to learn the input features. The shared feature extraction layer can be a multi-layer perceptron, a fully connected neural network or an LSTM model, and no specific restrictions are made here. The task-specific output layer of the multi-task learning model can output two types of prediction results, one for color difference prediction and the other for color fastness prediction; the formula of the joint loss function is:
[0095] ;
[0096] in, represents the color difference loss function, is the color fastness loss function. The loss function types of the two can be mean square error, cross entropy error or other loss functions, which are not limited here. and are the color difference loss weight and color fastness loss weight, respectively, which can be expressed as:
[0097] ;
[0098] in, represents the color difference experiment result of the tth iteration, represents the color difference prediction result of the t-th iteration, represents the color fastness experiment result of the tth iteration, represents the color fastness prediction result of the t-th iteration; the model performance is evaluated by k-fold cross validation and mean square error, and the training is stopped when the mean square error is less than the error threshold. In this embodiment, the error threshold is 0.1.
[0099] By modeling the experimental data with a multi-task learning model, the simultaneous optimization of color difference and color fastness is achieved; by combining data preprocessing, joint loss function, dynamic weight allocation, and k-fold cross-validation methods, the accuracy and reliability of the model are improved, providing efficient and scientific guidance for optimizing color mixing process parameters.
[0100] Further, the optimal color matching scheme is obtained as follows: Figure 2 As shown, including:
[0101] S401: randomly generating an initial position and initial velocity of a particle swarm, and initializing optimization parameters, wherein each particle represents a set of process parameter combinations; the optimization parameters include inertia weight, acceleration factor, maximum number of iterations, and convergence threshold, and the process parameters include temperature, pH value, time, and salt concentration;
[0102] S402: Design a fitness function to comprehensively evaluate color difference and color fastness, and calculate the fitness value of each particle, while recording the individual optimal position and the global optimal position;
[0103] S403: updating the speed according to the current speed of the particle, the individual optimal position and the global optimal position, and calculating the new position of the particle with the updated speed;
[0104] S404: Calculate the fitness value of each particle and update the individual optimal position and the global optimal position;
[0105] S405: Determine whether the iteration stop condition is met; if so, output the global optimal position as the optimal process parameter combination; otherwise, re-execute S403; the iteration stop condition is that the maximum number of iterations is reached or the fitness value of the global optimal position is less than the convergence threshold.
[0106] Table 1 Upper and lower limits of process parameters
[0107]
[0108] Specifically, the number of particle swarms is set to 50, and the initial position and speed are randomly generated within the upper and lower limits of each process parameter, where the upper and lower limits of each process parameter are shown in Table 1. The position of each particle represents a specific combination of process parameters. The initialization optimization parameters are shown in Table 2, including inertia weight, acceleration factor, maximum number of iterations and convergence threshold; the calculation formula of the fitness function is:
[0109] ;
[0110] in, Indicates that the particle is at position The fitness value of Indicates that the particle is at position The color difference, Indicates that the particle is at position Color fastness, represents the color difference fitness weight, Represents the color fastness fitness weight, calculates the fitness value of each particle, and records the individual optimal position and the global optimal position ; Update the speed according to the particle's current speed, individual optimal position and global optimal position, and use the updated speed to calculate the particle's new position. The speed update formula is:
[0111] ;
[0112] in, Represents particles exist The speed of the iteration, that is, the speed after the update, Represents particles exist The speed of iterations is is the initial velocity, Represents particles exist The position of the iteration, when is the initial position, and represents the acceleration factor, and represents a random number with a value in [0,1]. represents the inertia weight, which can be expressed as:
[0113] ;
[0114] in, In this embodiment, , In this embodiment, , represents the maximum number of iterations, Indicates the current iteration number; the formula for calculating the new position of the particle is:
[0115] ;
[0116] in, Represents particles exist The position of the iteration; calculate the fitness value of each particle again and update and ; Determine whether the number of iterations has reached or The fitness value of is less than the convergence threshold, that is, the fitness value difference of the global optimal position of the two iterations is less than 0.05; if so, output As the optimal process parameter combination; otherwise, re-update the speed and position of all particles.
[0117] Table 2 Initialization data of optimization parameters
[0118]
[0119] The particle swarm optimization algorithm is used to optimize the process parameter combination. By utilizing randomly initialized particle swarms, dynamically updating speed and position, comprehensive fitness function evaluation, and gradual iteration of individual optimal and global optimal positions, the optimal solution can be efficiently searched in the complex parameter space. By balancing the fitness evaluation criteria of color difference and color fastness, accurate optimization of color mixing process parameters is achieved, providing efficient and reliable algorithm support for obtaining the optimal color mixing solution, greatly improving production efficiency and mixing accuracy.
[0120] The second embodiment provided by the present invention is as follows:
[0121] In order to achieve industrial upgrading and improve the quality of fabric printing and dyeing, a printing and dyeing factory updated the technology of the original color matching system and adopted a color matching system based on the Oswald color three-dimensional grid model proposed in this invention. Figure 3 As shown, including:
[0122] A three-dimensional grid model building module, for mapping existing color data to a three-dimensional color grid based on an Oswald color three-dimensional grid model, wherein each grid point of the three-dimensional color grid contains a set of existing color data, wherein the existing color data includes grid point coordinates and grid point color ratios, and wherein the grid point coordinates include hue coordinates, lightness coordinates, and saturation coordinates;
[0123] A sample positioning module is used to receive a color sample specified by a user, convert the color sample into a sample three-dimensional coordinate corresponding to the Oswald color three-dimensional grid model, and perform grid matching according to the sample three-dimensional coordinates to obtain a sample matching grid;
[0124] A sample color matching ratio acquisition module is used to acquire N grid points of the sample matching grid, perform second-order polynomial fitting according to the grid point coordinates and the grid point color matching ratio of the N grid points to obtain a fitted second-order polynomial, and calculate the color matching ratio of the sample three-dimensional coordinates by using the fitted second-order polynomial to obtain the sample color matching ratio;
[0125] The process parameter optimization module is used to perform color matching according to the sample color ratio, determine the range of the matching process parameters and the optimization target, design test experiments for different process parameter combinations and record experimental data, model the experimental data through a multi-task learning model, and optimize the process parameter combination through a particle swarm optimization algorithm. When the particle swarm optimization algorithm stops iterating, the optimal process parameters are obtained, and then the optimal color matching solution is obtained.
[0126] Further, obtaining the sample matching grid includes:
[0127] Receiving a color sample specified by a user, and extracting RGB color information of the color sample by a spectrophotometer;
[0128] Convert the RGB color information into the sample three-dimensional coordinates using a color space conversion formula;
[0129] Match the grid points using Euclidean distance to determine the closest N grid points;
[0130] The three-dimensional color grid to which the N grid points belong is determined to obtain the sample matching grid.
[0131] Further, obtaining the sample color ratio includes:
[0132] Arrange the grid point coordinates and grid point color ratios of N grid points into a ratio data set;
[0133] Performing second-order polynomial fitting on the ratio data set, respectively calculating the polynomial coefficients of the three pigment ratios of R, Y and B, and obtaining the second-order fitting polynomials of the three pigment ratios;
[0134] Substitute the three-dimensional coordinates of the sample into the second-order fitting polynomial to calculate the ratio of the three pigments R, Y and B, and then obtain the color ratio of the sample.
[0135] Furthermore, modeling the experimental data by a multi-task learning model includes:
[0136] Preprocessing the experimental data to obtain preprocessed data;
[0137] Dividing the preprocessed data into a training set and a test set, and constructing the multi-task learning model through the training set to achieve simultaneous optimization of color difference and color fastness;
[0138] Optimizing the multi-task learning model by using a joint loss function combined with a dynamic weight allocation mechanism;
[0139] The model performance is evaluated by k-fold cross validation and mean square error. When the mean square error is less than the error threshold, the training is stopped to obtain a pre-trained multi-task learning model.
[0140] Furthermore, obtaining the optimal color matching solution includes:
[0141] S401: randomly generating an initial position and initial velocity of a particle swarm, and initializing optimization parameters, wherein each particle represents a set of process parameter combinations; the optimization parameters include inertia weight, acceleration factor, maximum number of iterations, and convergence threshold, and the process parameters include temperature, pH value, time, and salt concentration;
[0142] S402: Design a fitness function to comprehensively evaluate color difference and color fastness, and calculate the fitness value of each particle, while recording the individual optimal position and the global optimal position;
[0143] S403: updating the speed according to the current speed of the particle, the individual optimal position and the global optimal position, and calculating the new position of the particle with the updated speed;
[0144] S404: Calculate the fitness value of each particle and update the individual optimal position and the global optimal position;
[0145] S405: Determine whether the iteration stop condition is met; if so, output the global optimal position as the optimal process parameter combination; otherwise, re-execute S403; the iteration stop condition is that the maximum number of iterations is reached or the fitness value of the global optimal position is less than the convergence threshold.
[0146] The performance comparison before and after the color matching system proposed by the present invention is shown in Table 3. By comparing the table data, it can be seen that after adopting the color matching system based on the Oswald color three-dimensional grid model, the color difference is reduced from 2.2 to 1.4, the reduction rate is 36.4%, and the color matching accuracy is significantly improved; the color fastness is increased from 3.5 to 4.8, the growth rate is 37.1%, and the durability of dyeing is enhanced; the printing and dyeing time per kilometer is shortened from 95 minutes to 68 minutes, and the efficiency is improved by 28.4%. This system maps the existing color data to the three-dimensional color grid based on the Oswald color three-dimensional grid model, making it possible to accurately match the color samples; the color matching ratio of the three-dimensional coordinates of the sample is calculated by the second-order polynomial fitting algorithm, which improves the accuracy of color restoration; the color difference and color fastness are optimized synchronously in combination with the multi-task learning model, making the printing and dyeing effect more stable and efficient. In addition, the process parameters are dynamically adjusted by the particle swarm optimization algorithm, which further optimizes the stability and efficiency of the printing and dyeing process. This systematic improvement not only improves the printing and dyeing quality, but also significantly shortens the production time, meeting the needs of high-quality and high-efficiency industrial production.
[0147] Table 3 Performance comparison of color matching system before and after update
[0148]
[0149] Although embodiments of the present invention have been shown and described, it will be appreciated by those skilled in the art that various changes, modifications, substitutions and variations may be made to the embodiments without departing from the principles and spirit of the present invention, and that the scope of the present invention is defined by the appended claims and their equivalents.
Claims
1. A color matching method based on an Oswald color three-dimensional grid model, characterized in that: include: Based on the Oswald color three-dimensional gridding model, the existing color data is mapped to a three-dimensional color grid, each grid point of the three-dimensional color grid contains a set of existing color data, the existing color data includes grid point coordinates and grid point color ratios, and the grid point coordinates include hue coordinates, lightness coordinates and saturation coordinates; Receive a color sample specified by a user, convert the color sample into a sample three-dimensional coordinate corresponding to an Oswald color three-dimensional grid model, perform grid matching according to the sample three-dimensional coordinates, and obtain a sample matching grid; Obtaining N grid points of the sample matching grid, performing second-order polynomial fitting according to the grid point coordinates and grid point color ratios of the N grid points to obtain a fitted second-order polynomial, and calculating the color ratio of the three-dimensional coordinates of the sample by using the fitted second-order polynomial to obtain the sample color ratio; Color matching is performed according to the sample color ratio, the range of matching process parameters and optimization targets are determined, test experiments with different process parameter combinations are designed and experimental data are recorded, the experimental data are modeled through a multi-task learning model, and the process parameter combination is optimized through a particle swarm optimization algorithm. When the particle swarm optimization algorithm stops iterating, the optimal process parameters are obtained, and then the optimal color matching solution is obtained.
2. The color matching method based on the Oswald color three-dimensional grid model according to claim 1, characterized in that: Obtaining the sample matching grid includes: Receiving a color sample specified by a user, and extracting RGB color information of the color sample by a spectrophotometer; Convert the RGB color information into the sample three-dimensional coordinates using a color space conversion formula; Match the grid points using Euclidean distance to determine the closest N grid points; The three-dimensional color grid to which the N grid points belong is determined to obtain the sample matching grid.
3. The color matching method based on the Oswald color three-dimensional grid model according to claim 1, characterized in that: Obtaining the sample color ratio includes: Arrange the grid point coordinates and grid point color ratios of N grid points into a ratio data set; Performing second-order polynomial fitting on the ratio data set, respectively calculating the polynomial coefficients of the three pigment ratios of R, Y and B, and obtaining the second-order fitting polynomials of the three pigment ratios; Substitute the three-dimensional coordinates of the sample into the second-order fitting polynomial to calculate the ratio of the three pigments R, Y and B, and then obtain the color ratio of the sample.
4. The color matching method based on the Oswald color three-dimensional grid model according to claim 1, characterized in that: Modeling the experimental data by a multi-task learning model includes: Preprocessing the experimental data to obtain preprocessed data; Dividing the preprocessed data into a training set and a test set, and constructing the multi-task learning model through the training set to achieve simultaneous optimization of color difference and color fastness; Optimizing the multi-task learning model by using a joint loss function combined with a dynamic weight allocation mechanism; The model performance is evaluated by k-fold cross validation and mean square error. When the mean square error is less than the error threshold, the training is stopped to obtain a pre-trained multi-task learning model.
5. The color matching method based on the Oswald color three-dimensional grid model according to claim 1, characterized in that: Obtaining the optimal color matching solution includes: S401: randomly generating an initial position and initial velocity of a particle swarm, and initializing optimization parameters, wherein each particle represents a set of process parameter combinations; the optimization parameters include inertia weight, acceleration factor, maximum number of iterations, and convergence threshold, and the process parameters include temperature, pH value, time, and salt concentration; S402: Design a fitness function to comprehensively evaluate color difference and color fastness, and calculate the fitness value of each particle, while recording the individual optimal position and the global optimal position; S403: updating the speed according to the current speed of the particle, the individual optimal position and the global optimal position, and calculating the new position of the particle with the updated speed; S404: Calculate the fitness value of each particle and update the individual optimal position and the global optimal position; S405: Determine whether the iteration stop condition is met; if so, output the global optimal position as the optimal process parameter combination; otherwise, re-execute S403; the iteration stop condition is that the maximum number of iterations is reached or the fitness value of the global optimal position is less than the convergence threshold.
6. A color matching system based on an Oswald color three-dimensional grid model, characterized in that: include: A three-dimensional grid model building module, for mapping existing color data to a three-dimensional color grid based on an Oswald color three-dimensional grid model, wherein each grid point of the three-dimensional color grid contains a set of existing color data, wherein the existing color data includes grid point coordinates and grid point color ratios, and wherein the grid point coordinates include hue coordinates, lightness coordinates, and saturation coordinates; A sample positioning module is used to receive a color sample specified by a user, convert the color sample into a sample three-dimensional coordinate corresponding to the Oswald color three-dimensional grid model, and perform grid matching according to the sample three-dimensional coordinates to obtain a sample matching grid; A sample color matching ratio acquisition module is used to acquire N grid points of the sample matching grid, perform second-order polynomial fitting according to the grid point coordinates and the grid point color matching ratio of the N grid points to obtain a fitted second-order polynomial, and calculate the color matching ratio of the sample three-dimensional coordinates by using the fitted second-order polynomial to obtain the sample color matching ratio; The process parameter optimization module is used to perform color matching according to the sample color ratio, determine the range of the matching process parameters and the optimization target, design test experiments for different process parameter combinations and record experimental data, model the experimental data through a multi-task learning model, and optimize the process parameter combination through a particle swarm optimization algorithm. When the particle swarm optimization algorithm stops iterating, the optimal process parameters are obtained, and then the optimal color matching solution is obtained.
7. A color matching system based on an Oswald color three-dimensional grid model according to claim 6, characterized in that: Obtaining the sample matching grid includes: Receiving a color sample specified by a user, and extracting RGB color information of the color sample by a spectrophotometer; Convert the RGB color information into the sample three-dimensional coordinates using a color space conversion formula; Match the grid points using Euclidean distance to determine the closest N grid points; The three-dimensional color grid to which the N grid points belong is determined to obtain the sample matching grid.
8. The color matching system based on the Oswald color three-dimensional grid model according to claim 6, characterized in that: Obtaining the sample color ratio includes: Arrange the grid point coordinates and grid point color ratios of N grid points into a ratio data set; Performing second-order polynomial fitting on the ratio data set, respectively calculating the polynomial coefficients of the three pigment ratios of R, Y and B, and obtaining the second-order fitting polynomials of the three pigment ratios; Substitute the three-dimensional coordinates of the sample into the second-order fitting polynomial to calculate the ratio of the three pigments R, Y and B, and then obtain the color ratio of the sample.
9. The color matching system based on the Oswald color three-dimensional grid model according to claim 6, characterized in that: Modeling the experimental data by a multi-task learning model includes: Preprocessing the experimental data to obtain preprocessed data; Dividing the preprocessed data into a training set and a test set, and constructing the multi-task learning model through the training set to achieve simultaneous optimization of color difference and color fastness; Optimizing the multi-task learning model by using a joint loss function combined with a dynamic weight allocation mechanism; The model performance is evaluated by k-fold cross validation and mean square error. When the mean square error is less than the error threshold, the training is stopped to obtain a pre-trained multi-task learning model.
10. The color matching system based on the Oswald color three-dimensional grid model according to claim 6, characterized in that: Obtaining the optimal color matching solution includes: S401: randomly generating an initial position and initial velocity of a particle swarm, and initializing optimization parameters, wherein each particle represents a set of process parameter combinations; the optimization parameters include inertia weight, acceleration factor, maximum number of iterations, and convergence threshold, and the process parameters include temperature, pH value, time, and salt concentration; S402: Design a fitness function to comprehensively evaluate color difference and color fastness, and calculate the fitness value of each particle, while recording the individual optimal position and the global optimal position; S403: updating the speed according to the current speed of the particle, the individual optimal position and the global optimal position, and calculating the new position of the particle with the updated speed; S404: Calculate the fitness value of each particle and update the individual optimal position and the global optimal position; S405: Determine whether the iteration stop condition is met; if so, output the global optimal position as the optimal process parameter combination; otherwise, re-execute S403; the iteration stop condition is that the maximum number of iterations is reached or the fitness value of the global optimal position is less than the convergence threshold.
Citation Information
Patent Citations
Eight-element primary color HSB full-color-gamut color space gridding model and discrete chromatography construction method thereof
CN110490981A
Seven-primary-color polyester three-dimensional gridding blending three-dimensional color stereo and full-color-gamut color blending method based on gradient gray value construction
CN115115717A