Color space conversion method based on stacking ensemble learning

By adopting stacking integrated learning method in color space conversion, combining multiple color conversion algorithms and linear regression, the problem of insufficient color conversion accuracy in the existing technology is solved, and higher color conversion accuracy and stability are achieved, reducing data Dependencies and costs.

CN119090031APending Publication Date: 2024-12-06ZHEJIANG UNIV OF TECH
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411003309.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-07-25
Publication Date
2024-12-06

AI Technical Summary

Technical Problem

The existing color space conversion methods have insufficient accuracy, especially the data collection time is long and the consistency of color reproduction needs to be improved.

Method used

The method based on stacking ensemble learning is adopted, combining different color conversion algorithms as primary learners, and linear regression as secondary learners, integrating the prediction results of multiple algorithms to improve the color conversion accuracy.

Benefits of technology

在不增加数据量的情况下,显著提高了色彩转换的精度和稳定性,降低了数据依赖性和成本,增强了色彩空间转换方法的适用性和鲁棒性。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119090031A_ABST
    Figure CN119090031A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of machine learning, and discloses a color space conversion method based on stacking ensemble learning, which comprises the following steps: S1, acquiring data of corresponding input and output color spaces by using a spectrophotometer to make a data set; s2, dividing the collected data set into a training set and a test set, and dividing the training set into a plurality of training set subsets and a test set by using k-fold cross validation; s3, putting the divided data set into a first-level learning device for training, and adjusting each model to the optimal structure and parameter; s4, calculating contribution degrees of different learners, and screening first-level learners; s5, linear regression is adopted as a second-level learner, prediction results of the selected first-level learner are fused, and a final prediction result is obtained; by combining the characteristics of different color space conversion algorithms, a more accurate color space conversion method is obtained.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of machine learning, and in particular to a color space conversion method based on stacking ensemble learning. Background Art

[0002] Color management is a method that achieves accurate color reproduction between different devices through a combination of software and hardware, and color conversion is an important part of color management. The key technology of color space conversion is to convert the device color space to the target color space. The accuracy of color space conversion directly affects the consistency of color reproduction of images between different devices. With the development of digital inkjet printing technology, the requirements for color are gradually increasing. In order to ensure the consistency of color in the printing process, it is very important to establish a color space conversion model for digital inkjet printers.

[0003] Research on color space conversion methods has made significant progress. The main methods can be divided into the following categories: table lookup interpolation, polynomial regression, model method and neural network. However, the existing methods do not do well in the accuracy of color conversion results. There are certain problems. Table lookup and neural network can achieve high accuracy by collecting a large amount of data, but the collection of this data takes longer.

[0004] The present invention proposes a stacking ensemble learning method combining different color conversion algorithms, which can improve the color conversion accuracy without increasing the amount of data. The method uses different color conversion algorithms as the first-level learners and other neural networks as the second-level learners to achieve color conversion. The advantages of different algorithms are combined to obtain a color conversion algorithm with higher accuracy. Summary of the invention

[0005] In order to solve the problems in the prior art, the present invention provides a method for color space conversion based on stacked ensemble learning. The relationship between the first-level models of the data is utilized to select a suitable first-level learner, thereby improving the accuracy of color conversion. No complicated improvements are required, and it can be achieved only through the stacking method of ensemble learning.

[0006] The technical solution of the present invention is as follows:

[0007] A color space conversion method based on stacking ensemble learning, the specific steps are as follows:

[0008] S1: Use a spectrophotometer to collect data of the corresponding input and output color spaces to create a data set;

[0009] S2: Divide the collected data set into a training set and a test set. For the training set, use k-fold cross validation to divide the training set into several training set subsets and a test set; for the test set, use k-fold cross validation to divide the test set into several test subsets;

[0010] S3: Put the divided data set into the first-level learner for training, and adjust each first-level learner model to the optimal structure and parameters;

[0011] S4: Calculate the contribution of different learners and select the first-level learner;

[0012] S5: Linear regression is used as the secondary learner to fuse the prediction results of the selected primary learner to obtain the final prediction result;

[0013] Furthermore, the specific method of S2 is:

[0014] S2.1: The dataset is randomly divided into training and test sets in a ratio of 4:1;

[0015] S2.2: K-fold cross validation divides the training set into k subsets, of which k-1 subsets are used as training sets and one subset is used as model prediction input; the model is trained and predicted k times in total, so that each subset is used as input to predict its output; the results of k tests are spliced ​​into a new training set, which is the training set input of the secondary learner;

[0016] S2.3: The test set obtained by step S2.1 is also subject to k-fold cross-validation in step S2.2 to obtain the prediction output of k test sets (output prediction results). The average of the test set prediction results of k first-level learners is taken as the test set input of the second-level learner.

[0017] Furthermore, the specific method of S3 is:

[0018] S3.1: In order to increase the diversity of features extracted by the first-level learner, the selection of the first-level learner is considered from the following three aspects: linear feature extraction, nonlinear feature extraction and neural network feature extraction; the specific first-level learners are: tetrahedral interpolation algorithm, trilinear interpolation algorithm, RBF interpolation algorithm, polynomial regression algorithm, KAN network model, BPNN network model;

[0019] S3.2: Some models in the first-level learner do not need to be adjusted, but the neural network model needs hyperparameter adjustment. For example, the number of intermediate layers in the KAN network model and the order of edges and splines need to be adjusted until the optimal effect is achieved;

[0020] Furthermore, the specific method of S4 is:

[0021] S4.1: Method for calculating contribution: First, train an ensemble learning model containing all first-level learners, and calculate the color difference between the model's prediction results and the standard value on the test set. The color difference used includes two types: CIEDE2000 color difference and ΔE color difference. The calculation formula is as follows:

[0022]

[0023] L1 and L2 represent the brightness values ​​of the two colors, ranging from 0-100. The closer to 100, the brighter the color. a1 and a2 represent the values ​​of the two colors on the red-green axis (a). Positive values ​​represent red and negative values ​​represent green. The range is (-128, 128). b1 and b2 represent the values ​​of the two colors on the yellow-blue axis (b). Positive values ​​represent yellow and negative values ​​represent blue. The range is (-128, 128).

[0024] S4.2: Remove one of the first-level learners, then train the ensemble learning model composed of the remaining learners, and calculate the color difference between the model's prediction results and the standard value on the test set.

[0025] Contribution of learner = performance of complete ensemble model – performance of model after removing learner

[0026] If the color difference ΔE is used to evaluate the performance of the model, the calculation of contribution is further changed to:

[0027] Contribution of learner = ΔE of model after removing learner – ΔE of complete ensemble model

[0028] That is, keep other learners unchanged and calculate the performance change of the model after changing a certain first-level learner. This change is used as the contribution of the learner.

[0029] S4.3: Repeat step S4.2 to calculate the contribution of each first-level learner;

[0030] S4.4: The contribution of the first-level learner to the model can be positive or negative. Delete the first-level learners with negative contributions.

[0031] Furthermore, the specific method of S5 is:

[0032] S5.1: The first-level learner extracts enough features, and the second-level learner cannot use a complex learner to avoid overfitting, so a simple linear regression is used; linear regression is used to integrate the prediction results of the first-level learner selected in S4.

[0033] S5.2: The formula of the linear regression fusion model is as follows:

[0034] y=β0+β1f1+β2f2+…+β n f n

[0035] Where: β0 is a constant term; β1…β n represents the weights of different first-level learners; f1…f n Represents the prediction results of different first-level learners.

[0036] Beneficial effects of the present invention:

[0037] The present invention obtains a more accurate color space conversion method by combining the characteristics of different color space conversion algorithms. By combining multiple color space conversion algorithms, the features of the color space are extracted from different aspects. Each algorithm has unique advantages in color feature extraction. By integrating these advantages, a more comprehensive and accurate color space conversion result can be obtained. By combining the multi-algorithm fusion method with K-fold cross validation, the model accuracy can be improved without adding additional data sets. Because the feature extraction of different algorithms already contains rich information, through a reasonable fusion strategy, accuracy can be improved on the basis of existing data, reducing data dependence and cost. The fusion of multiple algorithms enhances the applicability and robustness of the color space conversion method. The advantages of different algorithms in different scenarios complement each other. By calculating the contribution of different algorithms, unnecessary algorithms can be flexibly deleted, so that the method of the present invention can maintain high conversion accuracy and stability in various complex scenarios. BRIEF DESCRIPTION OF THE DRAWINGS

[0038] Figure 1 Flowchart of the algorithm of the present invention. DETAILED DESCRIPTION

[0039] The following are specific embodiments of the present invention and the accompanying drawings to further describe the technical solution of the present invention.

[0040] like Figure 1 As shown in the figure, a color space conversion method based on stacking ensemble learning is shown. Here, the color conversion in the printing field is taken as an example, which is the process of converting from CMYK printing color to LAB, which is device-independent color space.

[0041] The specific steps are as follows:

[0042] Step 1: Print a sample and use a spectrophotometer to measure and collect data.

[0043] Step 1.1: Generate a sample image with 1200 color blocks using the code, and then print it using a KGT-L-press330s printer after rip.

[0044] Step 1.2: Use X-Rite's i1 pro 3 spectrophotometer to measure the spectral data of the sample under the conditions of D50 light source and 2° observation angle, and calculate the corresponding LAB data, create a cmyk-lab data set, and normalize the data set.

[0045] Step 2: Divide the collected data set into a training set and a test set, divide the training set into five subsets, and use k-fold cross validation with k=5;

[0046] Step 2.1: Divide the collected data set into training set and test set in a ratio of 4:1, divide the training set into five subsets, and use cross-validation with k=5;

[0047] Step 2.2: k-fold cross validation divides the training set into 5 subsets, 4 of which are used as training sets and 1 subset as the prediction input of the first-level learner; the first-level learner is trained and tested 5 times in total, so that each subset is used as input to predict its output; the results of the 5 tests are spliced ​​into a new training set, the size of which is the same as the original training set, and the new training set is used as the input of the second-level learner;

[0048] Step 2.3: The test set obtained by step 2.1 also needs to go through the k-fold cross validation in step 2.2. Using k=5 cross validation, we get the prediction output of 5 test sets. The prediction results of the 5 test sets are averaged as the test set input of the secondary learner.

[0049] Step 3: Put the divided data set into the first-level learner for training, and adjust each first-level learner to the optimal structure and parameters;

[0050] Step 3.1: The first-level learners used are considered from three aspects: extracting linear features, nonlinear features, and extracting features through neural networks. Therefore, the first-level learners selected are trilinear interpolation, tetrahedral interpolation, RBF interpolation, polynomial regression, KAN network, and neural network (BPNN).

[0051] Step 3.2: Before merging the models, adjust the performance of the first-level learner to the best. For example, trilinear interpolation, tetrahedral interpolation, and polynomial regression do not need to be adjusted;

[0052] The RBF interpolation function will get different results when using different radial basis functions, and the best radial basis function needs to be selected based on experiments. As shown in Table 1, the results of different radial basis functions are obtained through experiments, and the thin plate spline radial basis function with the smallest average color difference is selected by comparing the prediction results.

[0053] Table 1 Performance of different radial basis functions

[0054] Model MaxΔE Mean ΔE Multi-quadratic radial basis functions 7.249 1.632 Thin Plate Spline Radial Basis Function 7.288 1.591 Cubic radial basis function 7.566 1.700

[0055] Table 1 shows the results of different radial basis function interpolation, and the radial basis function with the best result is selected as the first-level learner of ensemble learning.

[0056] The two neural network models, KAN and BPNN, require continuous experiments to adjust hyperparameters and optimize the network structure. In particular, KAN is different from BPNN in its calculation method. KAN has no nodes but edges, and each edge has multiple spline functions. The shape of the spline is changed through training to fit the data. The parameters of the KAN and BPNN models are shown in Table 2.

[0057] Table 2 Model parameters

[0058]

[0059] For model parameters not specified in Table 2, the model default settings are used.

[0060] Step 3.3: Experimentally adjust the hyperparameters of the model. For example, to determine the hyperparameters of the KAN network model, KAN needs to set the number of edges and the order of the initial spline. The number of intermediate layers of the KAN network model will affect the performance of the model. After four experiments with different data, the optimal number of model layers was selected. The performance is optimal when the KAN intermediate layer is three layers. The number of spline grids on each edge of the KAN network model also needs to be adjusted. Increasing the grid can improve the flexibility and fitting ability of the spline function. However, increasing the grid will face the risk of overfitting. After experiments, the grid in this article is set to 5. The spline function initialized by the model is a cubic spline. KAN needs to set the highest order R of the initial spline function. The setting of R will affect the flexibility of the spline. A larger R value can make the model fit more complex data, but it will increase the risk of overfitting. Referring to the formula of the polynomial color space conversion algorithm, it is found that the highest order of the polynomial is generally set to 3; therefore, the maximum power of the spline of the KAN model is set to 3.

[0061] Step 4: Since there are a large number of first-level learners available, the contribution of each learner is calculated and some first-level learners with smaller contributions are deleted to reduce the complexity of the model and avoid overfitting.

[0062] Step 4.1: First, train the ensemble learning model containing all the first-level learners, then use the test set to predict the results and calculate the color difference with the standard value. The ΔE color difference calculation formula is as follows:

[0063]

[0064] Where L1 and L2 represent the prediction result and standard value respectively.

[0065] Step 4.2: Eliminate a first-level learner, retrain the ensemble learning model, and then predict the results of the test set and calculate the color difference ΔE. Calculate the contribution of the eliminated learner as follows:

[0066] Contribution of learner = ΔE of model after removing learner – ΔE of complete integrated model (contribution calculation principle)

[0067] That is, keep other learners unchanged and calculate the performance change of the model after changing a certain first-level learner. This change is used as the contribution of the learner.

[0068] Step 4.3: Because there are many models used initially, there is a risk of overfitting. And deleting some models will improve the performance of the model, so the contribution is positive and negative. In this embodiment, the model with negative contribution is deleted. In this embodiment, the model with smaller contribution can also be deleted according to the set threshold.

[0069] Step 4.4: In this example, the first-level learners finally selected through experiments are: tetrahedral interpolation, radial basis function interpolation, and KAN network. The first-level learners with positive contributions are selected, and the contributions are shown in Table 3 below.

[0070] Table 3 Contribution of first-level learner

[0071]

[0072]

[0073] The tetrahedral interpolation calculation formula is as follows:

[0074]

[0075] Where P is the input interpolation point. The tetrahedron is subdivided into four sub-tetrahedrons according to the position of P. OABP 、T OACP 、T OBCP 、T ABCP . Use the corresponding volume as the weight of vertices C, B, A, and O. For example, to simplify the expression, OABP Recorded as T c ; V(T n ) represents the volume of the corresponding tetrahedron, F(n) represents the value L, a, b of vertex n in the LAB space, F(P) represents the interpolation result of the input interpolation point, and the tetrahedron required for the interpolation point is found through the tabular data in the corresponding lookup table. In this example, the lookup table in the color characteristic file of the printer is directly used.

[0076] The radial basis function interpolation calculation formula is as follows:

[0077]

[0078] The j in the formula represents different output dimensions. Here the output is LAB three-dimensional, and the range of j is 1-3. i The input point set X = {x1,…,x n}, xi represents the i-th data point in the input point set X, n is the number of input data points, ω ij is a point x in the input point set i The coefficient in dimension j, is the radial basis function. By substituting the known data points into the above equation, we can solve the coefficient matrix ω ij .

[0079] The formula of the KAN network model is as follows:

[0080]

[0081] Where x is the input, Φ0 etc. are the spline functions of the KAN network; It represents the composition of functions, that is, the output of one function is used as the input of the next function, and the application order is from right to left; the essence of KAN model training is to train these spline functions and change the shape of the spline so that the final output is closer to the target value.

[0082] Step 5: Use linear regression as the secondary learner to fuse the prediction results of the selected primary learner to obtain the final prediction result;

[0083] Step5.1: After the selection in step4, it is guaranteed that the first-level learner has rich enough features, so the second-level learner only needs a simple model. Linear regression is selected as the second-level learner.

[0084] The experimental results obtained by the present invention based on the above model parameters are shown in Table 3.

[0085] Table 3 Comparison of experimental results

[0086]

[0087] The maximum color difference is improved by the method of the present invention, and the average color difference is significantly reduced. Compared with the single model KAN with a small average color difference, the average color difference is reduced from 1.397 to 1.145, which is a decrease of 18%. Under the CIEDE2000 evaluation index, the average color difference is still the smallest, and the maximum color difference is also the smallest, which is significantly better than other models.

[0088] The above embodiments are only preferred embodiments of the present invention and are not limitations of the technical solutions of the present invention. Any technical solution that can be implemented on the basis of the above embodiments without creative work should be deemed to fall within the scope of protection of the patent of the present invention.

Claims

1. A color space conversion method based on stacking ensemble learning, characterized in that: The steps include: S1: Use a spectrophotometer to collect data of the corresponding input and output color spaces to create a data set; S2: Divide the collected data set into training set train1 and test set test1 in proportion, use k-fold cross validation to further divide the training set train1 and test set test1, and put the divided training set train1 and test set test1 into the first-level learner for training respectively; S3: Preliminarily select the first-level learners based on the data characteristics, and adjust each first-level learner to the optimal structure and parameters; S4: Calculate the contribution of different first-level learners and finally select the first-level learner; S5: Linear regression is used as the secondary learner to fuse the prediction results of the final selected primary learner to obtain the final prediction results.

2. The color space conversion method based on stacking ensemble learning according to claim 1 is characterized in that: The specific process of S2 is as follows: S2.1: The dataset is randomly divided into training set train1 and test set test1 in a ratio of 4:1; S2.2: K-fold cross validation divides the training set train1 into k subsets, of which k-1 subsets are used as training sets and 1 subset is used as test subset. The first-level learner is trained and tested k times in total, so that each subset is used as input to predict its output; the results of the k predictions are reassembled and spliced ​​into a new training set in the order of the original training set, which is used as the training set input of the second-level learner; S2.3: The test set test1 obtained in step S2.1 is also subjected to k-fold cross-validation in step S2.

2. The first-level learner is trained and tested k times in total, and k prediction results are obtained. The average value is taken as the test set input for the second-level learner.

3. The color space conversion method based on stacking ensemble learning according to claim 1 is characterized in that: The specific process of S3 is as follows: S3.1: The selection of the first-level learner considers the following three aspects: linear feature extraction, nonlinear feature extraction and neural network feature extraction, including: tetrahedral interpolation algorithm, trilinear interpolation algorithm, RBF interpolation algorithm, polynomial regression algorithm, KAN network model, BPNN network model; S3.2: The KAN network model and BPNN network model in the first-level learner require hyperparameter adjustment; the tetrahedral interpolation algorithm, trilinear interpolation algorithm, and polynomial regression algorithm do not need to be adjusted.

4. The color space conversion method based on stacking ensemble learning according to claim 1, characterized in that: The specific process of S4 is as follows: S4.1: Calculate contribution: First, train an ensemble learning model containing all first-level learners, and calculate the color difference between the model's prediction results and the standard value on the test set; S4.2: Remove one of the first-level learners and then train the ensemble learning model composed of the remaining learners, that is, keep other learners unchanged and calculate the performance change of the model after changing a first-level learner as the contribution of the learner; S4.3: Repeat step S4.2, calculate the contribution of each first-level learner, and select the first-level learner according to the requirements.

5. The color space conversion method based on stacking ensemble learning according to claim 1 is characterized in that: The specific process of S5 is as follows: S5.1: Use linear regression to integrate the prediction results of the first-level learner selected in step S4; S5.2: The formula of the linear regression fusion model is as follows: y=β0+β1f1+β2f2+…+β n f n Where: β0 is a constant term; β1…β n represents the weights of different first-level learners; f1…f n Represents the prediction results of different first-level learners.