A multi-classification color correction method based on spectral shape driving

By using multi-class local modeling and weighted fusion prediction driven by spectral shape features, the problem of response differences in colorimeters when measuring samples with high and low reflectance is solved, and more accurate color calibration is achieved.

CN121677939BActive Publication Date: 2026-05-15AOPU TIANCHENG (WUHAN) OPTOELECTRONICS TECHNOLOGY CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
AOPU TIANCHENG (WUHAN) OPTOELECTRONICS TECHNOLOGY CO LTD
Filing Date
2026-02-10
Publication Date
2026-05-15

AI Technical Summary

Technical Problem

Existing colorimeters exhibit significant differences in color data response compared to reference values ​​when measuring samples with high and low reflectivity, making it impossible to effectively perform local distortion calibration of the global domain spectrum, thus leading to measurement errors.

Method used

An adaptive closed-loop calibration method for colorimeters is adopted, which involves multi-class local modeling, weighted fusion prediction, and regularization optimization. By using constrained clustering driven by spectral shape features, the spectral reflectance data is divided into multiple categories to construct a calibration model, and weighted fusion calibration is performed based on the similarity between the sample and the centroid.

Benefits of technology

It improves the generalization ability of high and low reflectivity regions, reduces systematic errors, makes the measurement data closer to the reference value of the standard color chart, and significantly improves the calibration performance.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121677939B_ABST
    Figure CN121677939B_ABST
Patent Text Reader

Abstract

The present application belongs to the field of color correction, and discloses a multi-classification color correction method based on spectral shape driving, which comprises the following steps: obtaining standard tristimulus values of a plurality of standard color panels, collecting spectral reflectance data of the standard color panels and performing smoothing and normalization processing; extracting a group of spectral shape features from the processed spectral reflectance data, and performing standardization processing on the feature vectors composed of the spectral shape features; dividing all the standard color panels into multiple categories, and determining the centroid of each category; constructing a design matrix and a target matrix for each category, designing a corresponding loss function, solving to obtain the calibration coefficient matrix and the regularization hyperparameter of each category, and packaging them into a calibration model for deployment to a color difference meter; predicting samples by using the calibration model of each category, and performing weighted fusion according to the similarity value to output corrected tristimulus values. While maintaining the measurement accuracy of the color difference meter, the color calibration stability of the high and low reflectivity regions is significantly improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of color correction technology, and in particular to a multi-class color correction method based on spectral shape-driven methods. Background Technology

[0002] During long-term use, colorimeters experience measurement drift deviations in their spectral response and colorimetric calculation mechanisms due to factors such as light source attenuation, detector aging, optical path contamination, or changes in electronic noise. Periodic calibration is typically required to maintain measurement accuracy. The BCRA Series II standard color chart comprises 12 high-precision ceramic color charts, each defining standard tristimulus values ​​and the Lab color space. Therefore, the BCRA Series II standard color chart is commonly used as a benchmark for the periodic calibration of colorimeters, verifying and correcting the spectral response and colorimetric calculation mechanism. The colorimeter measures the readings of each BCRA Series II standard color chart. Software then compares these readings with the standard data, allowing for readjustment of the instrument's internal optical coefficients, white card reference, colorimetric conversion matrix, or compensation parameters. This restores the colorimeter to its correct colorimetric measurement state across the entire color gamut.

[0003] Existing technologies typically involve setting up a standard white board within the optical system to establish a mapping relationship between measured values ​​and standard values, and automatically calibrating during each test. However, this is usually a single global mapping, which cannot take into account the local distortions of different spectral shapes, resulting in systematic errors and response differences. The color data calculated for high reflectivity and low reflectivity will have different responses than the reference values. Alternatively, high-precision measurements can be achieved through methods such as built-in camera positioning, multi-aperture adaptation, and full-spectrum LEDs. However, when the uncertainty of the colorimeter approaches or exceeds the batch consistency requirements, it is difficult to guarantee stable calibration performance for samples within a batch. Summary of the Invention

[0004] The purpose of this invention is to address the technical problem of large response differences between color data and reference values ​​for high-reflectivity and low-reflectivity samples in existing colorimeter color calibration methods. This invention progressively designs an adaptive closed-loop calibration method for colorimeters, employing multi-class local modeling, weighted fusion prediction, and regularization optimization. The core of this method lies in splicing chromaticity information and spectral shape information, dividing the global spectrum into multiple categories for local modeling to construct a multi-class calibration prediction model, thus improving the model's generalization ability in high and low reflectivity regions. Weighted fusion of the multi-class prediction results yields the corrected tristimulus values, constructing a robust prediction model and enhancing calibration performance.

[0005] In a first aspect, embodiments of the present invention provide a multi-class color correction method based on spectral shape-driven methods, the method comprising:

[0006] Obtain the standard tristimulus values ​​of multiple standard color plates, and collect the spectral reflectance data of each standard color plate at fixed intervals of wavelength, and perform smoothing and normalization processing on the spectral reflectance data;

[0007] From the spectral reflectance data processed from each standard color swatch, a set of spectral shape features are extracted to form the feature vector of that standard color swatch; and each feature vector is standardized to obtain a standardized feature vector.

[0008] With minimizing intra-class dispersion as the optimization objective, and under the constraints that each standard color swatch must be assigned to one and only one category, and each category contains a fixed number of color swatches, clustering is performed based on the standardized feature vectors of all standard color swatches to divide all standard color swatches into multiple categories and determine the centroid of each category.

[0009] For each category, the uncorrected tristimulus values ​​of each standard color swatch are calculated based on the spectral reflectance data of all standard color swatches in that category. The uncorrected tristimulus values ​​of each standard color swatch are concatenated with their corresponding feature vectors and a constant bias term is added to form an extended input vector. The extended input vectors of all standard color swatches in that category are stacked to form a design matrix, and the standard tristimulus values ​​of all standard color swatches in that category are stacked to form a target matrix. By minimizing the loss function consisting of the design matrix, the target matrix, and the regularization term, the calibration coefficient matrix and the regularization hyperparameter of that category are obtained.

[0010] For each category, its calibration coefficient matrix and hyperparameters are encapsulated into an independent calibration model; the resulting calibration models for all categories are then deployed to the colorimeter.

[0011] When the colorimeter measures the sample, it calls all the calibration models for each category to predict the sample, and then weights and fuses the prediction results of each model according to the similarity between the sample and the centroid of each category, and outputs the corrected tristimulus value.

[0012] Optionally, the spectral reflectance data may be smoothed and normalized, including:

[0013] The Savitzky-Gore filtering algorithm is used to smooth the spectral reflectance data of each standard color plate with a preset window width and smoothing order to obtain the smoothed spectral data corresponding to each color plate.

[0014] For each standard color swatch, its smoothed spectral data is normalized based on the maximum value of the smoothed spectral data of that color swatch.

[0015] Optionally, the set of spectral shape features includes: spectral centroid, first-order difference mean, second-order difference mean, short-wavelength energy ratio, mid-wavelength energy ratio, and long-wavelength energy ratio;

[0016] The spectral centroid is obtained by calculating the sum of the product of the processed spectral reflectance data and the corresponding wavelength, and then dividing by the sum of the processed spectral reflectance data. It is used to characterize the center wavelength of the spectral energy distribution.

[0017] The first-order difference mean is obtained by calculating the first-order difference between every two adjacent wavelength points of the processed spectral reflectance data and taking the arithmetic mean of all difference values, which is used to characterize the overall trend of the spectral curve.

[0018] The second-order difference mean is obtained by calculating the discrete second-order derivative of the processed spectral reflectance data at every three consecutive wavelength points and taking the arithmetic mean of all second-order derivative values. It is used to characterize the average curvature or local concavity and convexity features of the spectral curve.

[0019] The short-wavelength energy ratio, mid-wavelength energy ratio, and long-wavelength energy ratio are obtained by dividing the visible spectrum into three sub-bands: short-wavelength, mid-wavelength, and long-wavelength. The ratio of the sum of spectral reflectance data in each sub-band to the sum of spectral reflectance data in the entire spectrum is calculated and used to characterize the relative response intensity of color stimuli on the three types of cone cells in the human eye.

[0020] Optionally, the step of extracting a set of spectral shape features to form the feature vector of the standard color chart, and standardizing each feature vector to obtain a standardized feature vector, includes:

[0021] The spectral shape features of each standard color swatch are arranged in an ordered manner into row vectors, and the row vectors are transposed to obtain the feature vector of the standard color swatch.

[0022] Calculate the arithmetic mean of all standard color swatches across all spectral shape features to form a mean vector; and calculate the standard deviation of all standard color swatches across all spectral shape features to form a standard deviation vector.

[0023] For each standard color swatch, subtract the mean vector from its feature vector, and then divide each element of the resulting difference vector by the corresponding element of the standard deviation vector to obtain the standardized feature vector of the standard color swatch.

[0024] Optionally, clustering can be performed based on the standardized feature vectors of all standard color swatches, dividing all standard color swatches into three categories, achieved through the following constraints:

[0025] Define binary decision variables Among them, the standard color swatch index Category Index When the standard color swatch Category hour, Otherwise, it is 0; where the sum of the binary variables of each standard color swatch in all categories is 1, indicating that each standard color swatch must and can only be assigned to one category;

[0026] Furthermore, the sum of the binary variables of all standard color palettes within each category must be equal to 4 to ensure a balanced training sample across categories.

[0027] The centroid of each category is defined as the arithmetic mean of the standardized eigenvectors of all standard color swatches within that category.

[0028] The objective function of the clustering is defined as the sum of the squared Euclidean distances between the normalized feature vectors of all standard color palettes and the centroids of their respective categories. The optimization objective is to minimize the value of this objective function.

[0029] Optionally, the calibration coefficient matrix and regularization hyperparameters for this category can be obtained by minimizing the loss function consisting of the design matrix, the objective matrix, and the regularization term, including:

[0030] The product of the calibration coefficient matrix to be solved and the design matrix is ​​subtracted from the target matrix to obtain the residual matrix, and the first sum of squares of the residual matrix is ​​calculated.

[0031] The loss function is obtained by adding the product of the regularization hyperparameter to be solved and the second sum of the squares of all elements in the calibration coefficient matrix to be solved, to the first sum of squares.

[0032] By setting the derivative of the loss function with respect to the calibration coefficient matrix to be zero, the closed-form solution of the calibration coefficient matrix and the regularization hyperparameters are obtained.

[0033] Optionally, when the colorimeter measures the sample to be tested, it calls all categories of calibration models to predict the sample, and weights and fuses the prediction results of each model according to the similarity between the sample to be tested and the centroids of each category, outputting the corrected tristimulus values, including:

[0034] For the sample to be tested, its extended input vector is calculated and input into the calibration model of all categories to obtain the preliminary correction results for each category.

[0035] Calculate the Mahalanobis distance from the feature vector of the sample to be tested to the centroid of each class;

[0036] Based on the Mahalanobis distance, the similarity values ​​between the sample to be tested and each category are calculated using the Gaussian kernel function, and the similarity values ​​of all categories are normalized to obtain the fusion weights corresponding to each category.

[0037] The preliminary correction results for each category are multiplied by their corresponding fusion weights and then summed to obtain the corrected tristimulus values.

[0038] Secondly, embodiments of the present invention provide a multi-class color correction device based on spectral shape driving, comprising:

[0039] The data acquisition and preprocessing module is used to acquire the standard tristimulus values ​​of multiple standard color plates, and to collect the spectral reflectance data of each standard color plate at fixed intervals of wavelength, and to perform smoothing and normalization processing on the spectral reflectance data.

[0040] The feature extraction module is used to extract a set of spectral shape features from the spectral reflectance data processed from each standard color swatch to form the feature vector of the standard color swatch; and to standardize each feature vector to obtain a standardized feature vector.

[0041] The capacity-constrained clustering module is used to minimize intra-class dispersion as the optimization objective. Under the constraints that each standard color swatch must be assigned to one and only one class, and each class contains a fixed number of color swatches, it performs clustering based on the standardized feature vectors of all standard color swatches, divides all standard color swatches into multiple classes, and determines the centroid of each class.

[0042] The model parameter calculation module is used to calculate the uncorrected tristimulus values ​​of each standard color swatch for each category based on the spectral reflectance data of all standard color swatches in that category. The uncorrected tristimulus values ​​of each standard color swatch are concatenated with their corresponding feature vectors and a constant bias term is added to form an extended input vector. The extended input vectors of all standard color swatches in that category are stacked to form a design matrix, and the standard tristimulus values ​​of all standard color swatches in that category are stacked to form a target matrix. By minimizing the loss function consisting of the design matrix, the target matrix, and the regularization term, the calibration coefficient matrix and the regularization hyperparameters of that category are obtained.

[0043] The encapsulation and deployment module is used to encapsulate the calibration coefficient matrix and hyperparameters of each category into an independent calibration model; and deploy the resulting calibration models of all categories to the colorimeter.

[0044] The online sample calibration module is used to call all categories of calibration models to predict the sample when the colorimeter measures the sample, and to perform weighted fusion of the prediction results of each model according to the similarity between the sample and the centroid of each category, and output the corrected tristimulus value.

[0045] Thirdly, embodiments of the present invention provide an electronic device, including:

[0046] At least one processor;

[0047] Memory for storing the at least one processor-executable instruction;

[0048] The at least one processor is configured to execute the instructions to implement the method as described in any of the first aspects.

[0049] Fourthly, embodiments of the present invention provide a computer-readable storage medium that, when instructions in the computer-readable storage medium are executed by a processor of an electronic device, enables the electronic device to perform the method as described in any of the first aspects.

[0050] The technical solution provided in this invention involves obtaining standard tristimulus values ​​from multiple standard color swatches and collecting spectral reflectance data of each standard color swatch at fixed wavelength intervals. The spectral reflectance data is then smoothed and normalized. From the processed spectral reflectance data of each standard color swatch, a set of spectral shape features is extracted to form the feature vector of that standard color swatch. Each feature vector is then standardized to obtain a standardized feature vector. With minimizing intra-class dispersion as the optimization objective, and under the constraints that each standard color swatch must be assigned to one and only one category, and that each category contains a fixed number of color swatches, clustering is performed based on the standardized feature vectors of all standard color swatches to divide all standard color swatches into multiple categories, and the centroid of each category is determined. For each category, the uncalibrated features of each color swatch are calculated based on the spectral reflectance data of all standard color swatches in that category. For positive tristimulus values, the uncorrected tristimulus values ​​of each standard color swatch are concatenated with their corresponding feature vectors and a constant bias term is added to form an extended input vector. The extended input vectors of all standard color swatches in the class are stacked to form a design matrix, and the standard tristimulus values ​​of all standard color swatches in the class are stacked to form a target matrix. The calibration coefficient matrix and regularization hyperparameters of the class are obtained by minimizing the loss function composed of the design matrix, target matrix, and regularization term. For each class, its calibration coefficient matrix and hyperparameters are encapsulated into an independent calibration model. The obtained calibration models of all classes are deployed to the colorimeter. When the colorimeter measures the sample to be tested, the calibration models of all classes are called to predict the sample to be tested. The prediction results of each model are weighted and fused according to the similarity between the sample to be tested and the centroids of each class, and the corrected tristimulus values ​​are output.

[0051] The technical solution provided by this invention introduces a constraint clustering mechanism driven by spectral shape features. By automatically and scientifically dividing all standard color charts into multiple categories with uniform internal spectral characteristics through mathematical constraints that minimize intra-class dispersion and balance the capacity of each category, it fundamentally solves the core contradiction that a single global mapping cannot characterize the mapping relationship between nonlinear spectra and chromaticity. The balanced capacity constraint clustering method of this invention can highly fit the unique local response characteristics of each category of standard color charts, greatly improving the calibration model's ability to characterize local distortions in spectral shape and effectively eliminating systematic errors caused by differences in sample spectral characteristics. This makes the color data of high-reflectivity and low-reflectivity samples close to the reference values ​​of the standard color charts. Furthermore, based on the similarity between the prediction results and the centroids of each category, this invention performs weighted fusion of multiple prediction results to obtain corrected tristimulus values, constructing a dynamic decision boundary. For fuzzy samples whose spectral shape features are divided in the category boundary region, it can integrate multiple neighboring calibration models, making the prediction results smoother and more continuous, effectively addressing the problem of response differences when measuring high- and low-reflectivity samples. Attached Figure Description

[0052] Figure 1 This is a schematic flowchart of a multi-class color correction method based on spectral shape driven according to the present invention.

[0053] Figure 2 This is a schematic diagram of the structure of a multi-class color correction device based on spectral shape driven according to the present invention. Detailed Implementation

[0054] The present invention will be described in detail below through embodiments. These embodiments are based on the technical solution of the present invention and provide detailed implementation methods and specific operating procedures. However, the scope of protection of the present invention is not limited to the following embodiments.

[0055] In this invention, the terms "in one possible embodiment," "exemplary," or "for example" are used to indicate examples, illustrations, or descriptions. Any embodiment or design described as "in one possible embodiment," "exemplary," or "for example" in this invention should not be construed as being more preferred or advantageous than other embodiments or designs. Specifically, the use of terms such as "in one possible embodiment," "exemplary," or "for example" is intended to present the relevant concepts in a specific manner.

[0056] As the xenon lamp inside the colorimeter ages over time, its luminous intensity and spectral energy distribution decrease and change. At the same time, dust accumulates on optical components such as the inner wall of the integrating sphere, lenses, and fiber end faces, which reduces light flux and may introduce non-uniform scattering, altering the light sampling path. Changes in ambient temperature and humidity, or aging of circuit components, can alter the signal-to-noise ratio and baseline stability of the signal amplification link, leading to drift deviations in sample measurements. Therefore, periodic calibration is required to maintain the measurement accuracy of the colorimeter.

[0057] The BCRA Series II standard color chart serves as the reference for the periodic calibration of the colorimeter. The Lab color space includes a lightness channel, red-green axis, and yellow-blue axis. Automatic calibration is performed using the standard white plate inside the colorimeter. The calibrated white ceramic plate is used as a reference, and its reading is measured. This reading is compared with the stored standard data to calculate a white point correction factor, which is applied to the measurement of all subsequent samples. This white point correction factor is usually a simple multiplication factor or offset. It is assumed that the attenuation drift of the colorimeter is uniform across all wavelengths and all colors. However, the actual attenuation drift usually has spectral selectivity and nonlinear characteristics.

[0058] For example, if the blue light portion of a colorimeter's light source attenuates by 10% and the red light portion by 2%, the internal white plate calibration typically calculates an average attenuation coefficient based on the total energy of the full spectrum, such as a 5% average attenuation coefficient. However, a 5% average attenuation coefficient cannot compensate for the 10% loss in the blue light region. When measuring highly reflective blue samples, because the attenuation intensity of the blue light portion is greater than that of the red light portion, the signal received by the colorimeter in the blue light portion will be significantly weakened. This causes the yellow-blue axis in the Lab color space of the measured sample to tend towards the yellow axis, and the lightness channel to be darker. Consequently, even after calibration, the colorimeter still has a large error when measuring blue samples.

[0059] Therefore, how to design a method that enables sample measurement data to adaptively respond to the reference values ​​of the BCRA Series II standard color chart is a technical problem that urgently needs to be solved in this field.

[0060] This invention relates to the field of color correction technology, and more specifically, to a colorimeter color correction method based on spectral shape features driven by balanced clustering calibration, regularization modeling, and weighted fusion dynamic decision-making, aiming to solve the problem of response differences in spectral selectivity and nonlinear complex attenuation drift of colorimeters.

[0061] In a first aspect, embodiments of the present invention provide a multi-class color correction method based on spectral shape-driven methods, such as... Figure 1 As shown, the specific steps include:

[0062] S110 acquires the standard tristimulus values ​​of multiple standard color plates, and collects the spectral reflectance data of each standard color plate at fixed interval wavelengths, and performs smoothing and normalization processing on the spectral reflectance data.

[0063] For example, multiple standard color swatches specifically refer to the standard twelve BCRA Series II color swatches. Among them, the standard color swatch index Each standard color swatch Each has its corresponding standard tristimulus value ;in, To match the standard color chart The amount of red primary color required under standard light source illumination is related to the perceived intensity of the medium and long wavelength components; To match the standard color chart The amount of green primary color required under standard light source illumination is consistent with the spectral luminous efficiency function of human visual light vision, and also characterizes the brightness perceived by the human eye. To match the standard color chart The amount of blue primary color required under standard light source illumination is related to the perceived intensity of the medium and short wavelength components.

[0064] Using a colorimeter to be calibrated, the spectral reflectance data of twelve standard color plates were measured at fixed wavelength intervals. Among them, wavelength Among them, wavelength index Spectral reflectance data directly acquired by a colorimeter These are discrete data points with high-frequency irregular noise. The Savitzky-Gore filtering algorithm is used to process the spectral reflectance data. Filtering is performed to smooth the spectral reflectance data of each standard color swatch with a preset window width and smoothing order, so as to obtain smooth spectral data that retains the spectral peak position and shape characteristics; for each standard color swatch, normalization is performed based on the maximum value of the smooth spectral data of the standard color swatch itself to obtain normalized spectral reflectance data.

[0065] S120: Extract a set of spectral shape features from the spectral reflectance data of each standard color swatch after processing to form the feature vector of the standard color swatch; and perform standardization processing on each feature vector to obtain a standardized feature vector.

[0066] Specifically, for each normalized spectral reflectance data point, a robust, low-dimensional set of spectral shape features is extracted, including the spectral centroid. First-order difference mean Second-order difference mean Shortwave energy ratio Mid-band energy ratio and long-wavelength energy ratio Arrange the spectral shape features into row vectors, and transpose the row vectors to obtain the feature vectors of the standard color chart. Subsequently, the feature vectors of all standard color swatches are standardized: the arithmetic mean and standard deviation of each feature across all color swatches are calculated to form the mean vector and standard deviation vector, respectively; based on the mean vector and standard deviation vector, the feature vector of each standard color swatch is standardized to obtain its standardized feature vector.

[0067] S130, with the optimization objective of minimizing intra-class dispersion, performs clustering based on the standardized feature vectors of all standard color swatches under the constraints that each standard color swatch must be assigned to one category and each category contains a fixed number of color swatches, dividing all standard color swatches into multiple categories and determining the centroid of each category.

[0068] Specifically, the twelve standard color swatches are divided into three balanced groups with a fixed number of samples in each group, creating computationally achievable training samples for each group; and a binary decision variable is defined. The value range is 0 or 1, where the standard color swatch index is... Category Index When the standard color swatch Category At that time, binary decision variables Otherwise, it is 0; and each standard color swatch must be assigned to one and only one category; the category centroid is calculated by the category The average value of the standardized feature vectors of all standard color plates is obtained, and an objective function is designed to measure the dispersion of the spectral shape features within a class. Minimizing the objective function is used as a constraint for classification.

[0069] S140, For each category, calculate the uncorrected tristimulus value of each standard color plate based on the spectral reflectance data of all standard color plates in the category. Concatenate the uncorrected tristimulus value of each standard color plate with its corresponding feature vector and add a constant bias term to form an extended input vector. Stack the extended input vectors of all standard color plates in the category to form a design matrix, and stack the standard tristimulus values ​​of all standard color plates in the category to form a target matrix. By minimizing the loss function composed of the design matrix, the target matrix and the regularization term, the calibration coefficient matrix and the regularization hyperparameter of the category are obtained.

[0070] Specifically, CIE (Color Matching System) integration was used to calculate the spectral reflectance data of the twelve BCRA Series II standard color swatches. Uncorrected tristimulus values .in, The amount of red primary color required under illumination from the light source to be calibrated; The amount of green primary color required under the illumination of the light source to be calibrated; This represents the amount of blue primary color required under illumination from the light source to be corrected. The specific calculation formula is shown below:

[0071]

[0072]

[0073]

[0074] Among them, wavelength , The total number of wavelength sampling points, where the wavelength index is... This wavelength index is used to traverse all measurement wavelengths; Indicates the first The specific wavelength value corresponding to the sampling point This represents a fixed interval for sampling wavelengths, that is, the difference between two adjacent sampling wavelengths; Indicates standard color swatches exist Relative spectral power distribution at wavelength values; A predefined function used to describe the physiological characteristics of standard human color vision. For red primary color matching function, corresponding to long-wavelength sensitive L-shaped cone cells; The green primary color matching function corresponds to the mid-wavelength sensitive M-type cone cells; is the blue primary color matching function, corresponding to short-wavelength sensitive S-shaped cone cells; where, Indicates matching the standard color swatch The required amount of red primary color, Indicates matching the standard color swatch The required amount of green primary color, Indicates matching the standard color swatch The required amount of blue primary color.

[0075] For each standard color chart, the measurement is repeated M times, and the resulting M sets of uncorrected tristimulus values ​​are collected from each standard color chart. With M sets of feature vectors Concatenate and add a constant bias term of 1 to form an extended input vector. Among them, the index of measurement frequency :

[0076]

[0077] Each category Each has 4 standard color swatches Extend the input vector of all standard color palettes within this class. Stacking forms a design matrix :

[0078]

[0079] The standard tristimulus values ​​of all standard color swatches within this category Stacked to form the target matrix :

[0080]

[0081] Then train a design matrix Mapping to target matrix calibration coefficient matrix And construct the loss function for ridge regression, minimizing the loss function to make the in-class calibration coefficient matrix The parameters are not too large, and the error is minimized. The calibration coefficient matrices for the three categories are obtained by solving. and regularization hyperparameters.

[0082] S150 encapsulates the calibration coefficient matrix and hyperparameters of each category into an independent calibration model; the resulting calibration models for all categories are then deployed to the colorimeter.

[0083] Specifically, its calibration coefficient matrix The corresponding regularization hyperparameters are serialized and encapsulated, forming an independent calibration model for each category. Three categories correspond to three independent calibration models, packaged into a single, independently usable model package. During color calibration, when the device firmware or software calibrates the sample online, the model package is loaded and deployed to the colorimeter's calibration program for real-time use.

[0084] S160: When the colorimeter measures the sample to be tested, it calls all the calibration models of each category to predict the sample to be tested, and performs weighted fusion of the prediction results of each model according to the similarity between the sample to be tested and the centroid of each category, and outputs the corrected tristimulus value.

[0085] Specifically, when the colorimeter measures the sample, it calculates the tristimulus values ​​and eigenvectors of the sample based on the sample's spectral reflectance data, constructs an extended input vector, and uses calibration models corresponding to the three categories to locally predict the extended input vector of the sample, obtaining preliminary correction results for each category. By calculating the Mahalanobis distance from the sample's eigenvector to the centroid of each category, the class similarity of the sample is obtained, and a Gaussian kernel function is used to map the class similarity distance to a value between... The similarity values ​​between the three categories are normalized to obtain the fusion weights for each category. The preliminary correction results of each category are multiplied by the corresponding fusion weights and summed to obtain the corrected tristimulus values.

[0086] The technical solution provided in this invention involves obtaining standard tristimulus values ​​from multiple standard color swatches and collecting spectral reflectance data of each standard color swatch at fixed wavelength intervals. The spectral reflectance data is then smoothed and normalized. From the processed spectral reflectance data of each standard color swatch, a set of spectral shape features is extracted to form the feature vector of that standard color swatch. Each feature vector is then standardized to obtain a standardized feature vector. With minimizing intra-class dispersion as the optimization objective, and under the constraints that each standard color swatch must be assigned to one and only one category, and that each category contains a fixed number of color swatches, clustering is performed based on the standardized feature vectors of all standard color swatches to divide all standard color swatches into multiple categories, and the centroid of each category is determined. For each category, the uncalibrated features of each color swatch are calculated based on the spectral reflectance data of all standard color swatches in that category. For positive tristimulus values, the uncorrected tristimulus values ​​of each standard color swatch are concatenated with their corresponding feature vectors and a constant bias term is added to form an extended input vector. The extended input vectors of all standard color swatches in the class are stacked to form a design matrix, and the standard tristimulus values ​​of all standard color swatches in the class are stacked to form a target matrix. The calibration coefficient matrix and regularization hyperparameters of the class are obtained by minimizing the loss function composed of the design matrix, target matrix, and regularization term. For each class, its calibration coefficient matrix and hyperparameters are encapsulated into an independent calibration model. The obtained calibration models of all classes are deployed to the colorimeter. When the colorimeter measures the sample to be tested, the calibration models of all classes are called to predict the sample to be tested. The prediction results of each model are weighted and fused according to the similarity between the sample to be tested and the centroids of each class, and the corrected tristimulus values ​​are output.

[0087] The technical solution provided by this invention introduces a constraint clustering mechanism driven by spectral shape features. By automatically and scientifically dividing all standard color charts into multiple categories with uniform internal spectral characteristics through mathematical constraints that minimize intra-class dispersion and balance the capacity of each category, it fundamentally solves the core contradiction that a single global mapping cannot characterize the mapping relationship between nonlinear spectra and chromaticity. The balanced capacity constraint clustering method of this invention can highly fit the unique local response characteristics of each category of standard color charts, greatly improving the calibration model's ability to characterize local distortions in spectral shape and effectively eliminating systematic errors caused by differences in sample spectral characteristics. This makes the color data of high-reflectivity and low-reflectivity samples close to the reference values ​​of the standard color charts. Furthermore, based on the similarity between the prediction results and the centroids of each category, this invention performs weighted fusion of multiple prediction results to obtain corrected tristimulus values, constructing a dynamic decision boundary. For fuzzy samples whose spectral shape features are divided in the category boundary region, it can integrate multiple neighboring calibration models, making the prediction results smoother and more continuous, effectively addressing the problem of response differences when measuring high- and low-reflectivity samples.

[0088] Based on the above embodiments, as one implementation of the present invention, the specific implementation of smoothing and normalizing spectral reflectance data can be as follows:

[0089] Specifically, the Savitzky-Gore filtering algorithm is used to process the spectral reflectance data of each standard color swatch with a preset window width and smoothing order. Smoothing is performed, where the wavelength Among them, wavelength index ; Obtain smoothed spectral data corresponding to each color plate The specific formula is as follows:

[0090]

[0091] in, The Savitzky-Gore filter smoothing function is a convolution smoothing algorithm based on local polynomial fitting. To smooth the window width, It is the smoothing order;

[0092] In a window width Inside, use a smoothing order. By fitting the data points within the low-order polynomial within the window, the fitted value of the low-order polynomial at the center point of the window is obtained, and this fitted value is used to replace the measured value of the center point of the original spectral reflectance data, which can preserve the spectral peak position and spectral shape characteristics.

[0093] Next, for each standard color swatch, the maximum value of its own smoothed spectral data is used to normalize its smoothed spectral data. The specific formula is shown below:

[0094]

[0095]

[0096] in, Standard color chart The maximum value within all smoothed spectral data. Standard color chart Normalized spectral reflectance data, It is a very small positive number. Used to prevent program errors caused by division by zero, and to ensure numerical stability.

[0097] This implementation performs data quality control by smoothing and denoising the spectral reflectance data of each standard color plate, which are of varying magnitudes and contain noise. It also performs feature enhancement by peak normalization on the filtered data, further focusing on the shape features in the spectral reflectance data, removing brightness interference factors, and comparing and analyzing the spectral shape differences between different standard color plates at the same scale, which facilitates the subsequent extraction of spectral shape features.

[0098] Based on the above embodiments, as an implementation of the present invention, a set of spectral shape features includes: spectral centroid, first-order difference mean, second-order difference mean, short-wavelength energy ratio, mid-wavelength energy ratio and long-wavelength energy ratio, reducing the S-dimensional spectral reflectance data to 1-dimensional spectral shape features.

[0099] Spectral centroid This represents the energy center wavelength of the entire spectral reflectance data curve of the standard color chart. The spectral centroid is a stable color feature, and its value is derived from the calculated spectral reflectance data. With corresponding wavelength The sum of the products, divided by the processed spectral reflectance data. The sum of these formulas shows that when the overall incident light intensity increases or decreases, the spectral centroid remains unchanged. The specific formula is as follows:

[0100]

[0101] First difference mean This represents the average rate of change of the standard color chart along the wavelength direction, used to distinguish the overall spectral shape of the standard color chart, and is insensitive to changes in light intensity. The first-order difference mean is the calculated spectral reflectance data. The first-order difference between every two adjacent wavelength points is used to obtain the arithmetic mean of all the difference values. The specific formula is as follows:

[0102]

[0103] Second difference mean This is used to capture the nonlinear component in the spectral shape, i.e., the curvature of the spectral curve, to distinguish between similar centroids and slopes. The processed spectral reflectance data is then calculated. The discrete second derivative at every three consecutive wavelength points, and the arithmetic mean of all second derivative values, are used to characterize the average curvature or local concavity / convexity features of the spectral curve. The specific formula is as follows:

[0104]

[0105] Based on a predefined set of shortband indexes Medium band index set and long-wavelength band index set The visible spectrum wavelengths in each standard color chart are divided into three sub-bands: short-wave, medium-wave, and long-wave; for example, ; Calculate the spectral reflectance data within each sub-band The sum of these values ​​yields the shortwave energy. Mid-band energy and long-wavelength energy The specific formula is as follows:

[0106]

[0107] The ratio of local energy in the short-wave, mid-wave, and long-wave bands to the total spectral reflectance data across all bands is calculated using the following formula:

[0108]

[0109] in, For shortwave energy ratio, For mid-band energy ratio, This refers to the energy ratio in the long-wavelength band.

[0110] This embodiment extracts a set of robust, low-dimensional spectral shape features that are discriminative for classification from the processed spectral reflectance data, effectively eliminating systematic errors caused by the difference in spectral characteristics between high-reflectance and low-reflectance samples, so that the measurement data of high-reflectance and low-reflectance samples are close to the reference values ​​of the standard color chart.

[0111] Based on the above embodiments, as one implementation of the present invention, a set of spectral shape features are extracted to form the feature vector of the standard color chart; each feature vector is standardized to obtain a standardized feature vector. The specific process includes the following steps a1 to a3:

[0112] Step a1: Arrange the spectral shape features of each standard color swatch into row vectors, and transpose the row vectors to obtain the feature vector of the standard color swatch. Specifically .

[0113] Step a2: Calculate the arithmetic mean of all standard color swatches across all spectral shape characteristics. This forms a mean vector. Among them, spectral shape feature index The specific calculation formula is as follows:

[0114]

[0115] And calculate the standard deviation of all standard color swatches across all spectral shape characteristics. This forms a standard deviation vector. Among them, spectral shape feature index The specific formula is as follows:

[0116]

[0117] Step a3: For each standard color swatch, subtract the mean vector from its feature vector, and then divide each element of the resulting difference vector by the corresponding element of the standard deviation vector to obtain the standardized feature vector of the standard color swatch. The specific formula is as follows:

[0118]

[0119] in, Standard color chart The standardized feature vector, Standard color chart eigenvectors, Standard color chart The mean vector, Standard color chart The standard deviation vector.

[0120] This implementation transforms all spectral shape features into a standardized scale centered at 0 with a standard deviation of 1. The standardized feature vector contains multidimensional information that best reflects the color characteristics of the standard color swatch spectrum, representing the standard deviation multiple by which the original feature values ​​deviate from the data center. This eliminates dimensional and numerical scale differences between different features, allowing for direct comparison and calculation between different spectral shape features. It also prevents numerical overflow in subsequent ridge regression calculations, laying the foundation for the design of subsequent capacity-constrained clustering and ridge regression loss functions.

[0121] Based on the above embodiments, as one implementation of the present invention, clustering is performed based on the standardized feature vectors of all standard color swatches to divide all standard color swatches into three categories, achieved through the following three constraints:

[0122] 1. Define binary decision variables Chinese Standard Color Palette Index Category Index When the standard color swatch Category hour, Otherwise, it is 0; the specific formula is as follows:

[0123]

[0124] 2. The sum of the binary variables for each standard color swatch across all categories is 1, indicating that each standard color swatch must be assigned to one and only one category. The specific formula is as follows:

[0125]

[0126] 3. The sum of the binary variables of all standard color palettes within each category must equal 4 to ensure a balanced training sample across categories. The specific formula is shown below:

[0127]

[0128] The centroid of each category is calculated as the arithmetic mean of the normalized eigenvectors of all standard color swatches within that category. The centroid is the geometric center or average feature of the three categories in the spectral shape feature space. The specific formula is as follows:

[0129]

[0130] in, For the category centroid, This is a standardized feature vector.

[0131] The objective function for clustering is defined as the sum of the squared Euclidean distances between the normalized feature vectors of all standard color palettes and the centroids of their respective classes. The optimization objective is to minimize this objective function value, which measures the intra-class dispersion. The specific formula is shown below:

[0132]

[0133] in, The objective function for clustering is... Represents the norm. This is achieved by minimizing the objective function. This yields the final classification set. .

[0134] This implementation aims to minimize intra-class dispersion as the clustering optimization objective, thereby minimizing the clustering objective function. It represents that the spectral features of the standard color swatches within the same category are clustered around the centroid, and the color subspace within the category is flat. High-precision color correction within the category can be achieved using a simple model, solving the problem that a single global mapping cannot take into account the local distortion of different spectral shapes.

[0135] Based on the above embodiments, as one implementation of the present invention, the calibration coefficient matrix and regularization hyperparameter of the category are obtained by minimizing the loss function composed of the design matrix, the target matrix, and the regularization term. The specific implementation method is as shown in steps b1 to b3:

[0136] Step b1: Calculate the calibration coefficient matrix to be solved. With design matrix The product between them, and the target matrix Subtract the two to obtain the residual matrix, and calculate the first sum of squares of the residual matrix.

[0137] Step b2: Calculate the regularization hyperparameters to be solved. With the calibration coefficient matrix to be solved The loss function is obtained by adding the second square of all elements in the sum to the product of the two sums, and then adding the first square of the sum to the product of the two sums. The specific formula is shown below:

[0138]

[0139] in, Represents the norm, The numerical strength of the regularization hyperparameter must be greater than zero to ensure overall numerical stability.

[0140] Step b3: Set the derivative of the loss function with respect to the calibration coefficient matrix to zero to obtain the closed-form solution of the calibration coefficient matrix and the regularization hyperparameters, as shown in the following formulas:

[0141]

[0142] in, for The identity matrix, The length of the feature vector.

[0143] This implementation calculates the calibration coefficient matrix by differentiating the loss function from the calibration coefficient matrix to be solved, eliminating the need to set the learning rate and number of iterations, thus avoiding the risk of getting trapped in local optima. This results in faster calculation of the calibration parameters and ensures a unique and definite prediction result. Furthermore, it employs a ridge regression loss function to obtain a more robust model and address the instability of ordinary least squares solutions.

[0144] Based on the above embodiments, as one implementation of the present invention, when the colorimeter measures the sample to be tested, it calls all categories of calibration models to predict the sample to be tested, and performs weighted fusion of the prediction results of each model according to the similarity between the sample to be tested and the centroid of each category, and outputs the corrected tristimulus values. The specific process includes steps c1 to c4:

[0145] Step c1: For the sample to be tested Calculate its extended input vector Expand input volume Including uncorrected tristimulus values With the corresponding feature vector The specific formula is shown below:

[0146]

[0147] Based on the correction model, the extended input vector Inputting the data into the calibration models for all categories yields preliminary calibration results for each category. Preliminary correction results Used for prediction The tristimulus values ​​to which the categories should be corrected are given by the following formula:

[0148]

[0149] Step c2: Calculate the Mahalanobis distance from the eigenvectors of the sample to each class centroid. The specific formula is shown below:

[0150]

[0151] in, For category The centroid of the sample was determined using Mahalanobis distance. The difference vector between each class centroid and the centroid is scaled using the inverse of the covariance matrix, taking into account the categories. The characteristics of their respective distribution shapes reduce the correlation between features and the influence of dimensions. (Sample to be tested) With category The relationship between them is as follows:

[0152] 1. Mahalanobis distance The smaller the value, the better the sample is. With category The closer they are in statistical distribution in the spectral shape feature space;

[0153] 2. Mahalanobis distance The larger the value, the better the sample is. With category The greater the deviation in the statistical distribution in the spectral shape feature space.

[0154] Step c3: Based on the Mahalanobis distance, calculate the similarity value between the sample to be tested and each category using the Gaussian kernel function. The specific formula is as follows:

[0155]

[0156] The similarity values ​​for all categories are normalized to obtain the fusion weights for each category. The specific formula is as follows:

[0157]

[0158] Among them, category index Another way to represent it is , The normalization factor, i.e. The summation of the three categories represents the sample under test. The sum of similarity values ​​with all categories; Indicate category Weight in the final decision.

[0159] Step c4: Multiply the preliminary correction results of each category by their corresponding fusion weights and sum them to obtain the corrected tristimulus values. The specific calculation formula is as follows:

[0160]

[0161] This embodiment effectively improves the robustness, adaptability, and full color gamut consistency of colorimeter field calibration by calling multi-class calibration models for parallel prediction and by adaptively calculating fusion weights based on Mahalanobis distance and Gaussian kernel function.

[0162] Secondly, embodiments of the present invention also provide a multi-class color correction device 20 based on spectral shape-driven methods, such as... Figure 2 As shown, it includes:

[0163] The data acquisition and preprocessing module 210 is used to acquire the standard tristimulus values ​​of multiple standard color plates, and to collect the spectral reflectance data of each standard color plate at fixed intervals of wavelength, and to perform smoothing and normalization processing on the spectral reflectance data.

[0164] The feature extraction module 220 is used to extract a set of spectral shape features from the spectral reflectance data after processing each standard color plate to form the feature vector of the standard color plate; and to perform standardization processing on each feature vector to obtain a standardized feature vector.

[0165] The capacity-constrained clustering module 230 is used to perform clustering based on the standardized feature vectors of all standard color swatches, with the optimization objective of minimizing intra-class dispersion, under the constraints that each standard color swatch must be assigned to one category and each category contains a fixed number of color swatches, and to divide all standard color swatches into multiple categories and determine the centroid of each category.

[0166] The model parameter calculation module 240 is used to calculate the uncorrected tristimulus values ​​of each standard color plate for each category based on the spectral reflectance data of all standard color plates in the category. The uncorrected tristimulus values ​​of each standard color plate are concatenated with their corresponding feature vectors and a constant bias term is added to form an extended input vector. The extended input vectors of all standard color plates in the category are stacked to form a design matrix, and the standard tristimulus values ​​of all standard color plates in the category are stacked to form a target matrix. By minimizing the loss function composed of the design matrix, the target matrix and the regularization term, the calibration coefficient matrix and the regularization hyperparameter of the category are obtained.

[0167] The encapsulation and deployment module 250 is used to encapsulate the calibration coefficient matrix and hyperparameters of each category into an independent calibration model; and to deploy the resulting calibration models of all categories to the colorimeter.

[0168] The sample online calibration module 260 is used to call all categories of calibration models to predict the sample when the colorimeter measures the sample, and to perform weighted fusion of the prediction results of each model according to the similarity between the sample and the centroid of each category, and output the corrected tristimulus value.

[0169] Thirdly, embodiments of the present invention also provide an electronic device, comprising:

[0170] At least one processor;

[0171] Memory for storing the at least one processor-executable instruction;

[0172] The at least one processor is configured to execute the instructions to implement the method as described in the first aspect.

[0173] Fourthly, embodiments of the present invention also provide a computer-readable storage medium that, when instructions in the computer-readable storage medium are executed by a processor of an electronic device, enables the electronic device to perform the method as described in the first aspect.

[0174] The technical solution provided in this invention involves obtaining standard tristimulus values ​​from multiple standard color swatches and collecting spectral reflectance data of each standard color swatch at fixed wavelength intervals. The spectral reflectance data is then smoothed and normalized. From the processed spectral reflectance data of each standard color swatch, a set of spectral shape features is extracted to form the feature vector of that standard color swatch. Each feature vector is then standardized to obtain a standardized feature vector. With minimizing intra-class dispersion as the optimization objective, and under the constraints that each standard color swatch must be assigned to one and only one category, and that each category contains a fixed number of color swatches, clustering is performed based on the standardized feature vectors of all standard color swatches to divide all standard color swatches into multiple categories, and the centroid of each category is determined. For each category, the uncalibrated features of each color swatch are calculated based on the spectral reflectance data of all standard color swatches in that category. For positive tristimulus values, the uncorrected tristimulus values ​​of each standard color swatch are concatenated with their corresponding feature vectors and a constant bias term is added to form an extended input vector. The extended input vectors of all standard color swatches in the class are stacked to form a design matrix, and the standard tristimulus values ​​of all standard color swatches in the class are stacked to form a target matrix. The calibration coefficient matrix and regularization hyperparameters of the class are obtained by minimizing the loss function composed of the design matrix, target matrix, and regularization term. For each class, its calibration coefficient matrix and hyperparameters are encapsulated into an independent calibration model. The obtained calibration models of all classes are deployed to the colorimeter. When the colorimeter measures the sample to be tested, the calibration models of all classes are called to predict the sample to be tested. The prediction results of each model are weighted and fused according to the similarity between the sample to be tested and the centroids of each class, and the corrected tristimulus values ​​are output.

[0175] The technical solution provided by this invention introduces a constraint clustering mechanism driven by spectral shape features. By automatically and scientifically dividing all standard color charts into multiple categories with uniform internal spectral characteristics through mathematical constraints that minimize intra-class dispersion and balance the capacity of each category, it fundamentally solves the core contradiction that a single global mapping cannot characterize the mapping relationship between nonlinear spectra and chromaticity. The balanced capacity constraint clustering method of this invention can highly fit the unique local response characteristics of each category of standard color charts, greatly improving the calibration model's ability to characterize local distortions in spectral shape and effectively eliminating systematic errors caused by differences in sample spectral characteristics. This makes the color data of high-reflectivity and low-reflectivity samples close to the reference values ​​of the standard color charts. Furthermore, based on the similarity between the prediction results and the centroids of each category, this invention performs weighted fusion of multiple prediction results to obtain corrected tristimulus values, constructing a dynamic decision boundary. For fuzzy samples whose spectral shape features are divided in the category boundary region, it can integrate multiple neighboring calibration models, making the prediction results smoother and more continuous, effectively addressing the problem of response differences when measuring high- and low-reflectivity samples.

[0176] Although embodiments of the present invention have been shown and described above, it is understood that the above embodiments are exemplary and should not be construed as limiting the present invention. Those skilled in the art can make changes, modifications, substitutions and variations to the above embodiments within the scope of the present invention without departing from the principles and spirit of the present invention.

Claims

1. A multi-class color correction method based on spectral shape-driven classification, characterized in that, include: Obtain the standard tristimulus values ​​of multiple standard color plates, and collect the spectral reflectance data of each standard color plate at fixed intervals of wavelength, and perform smoothing and normalization processing on the spectral reflectance data; From the spectral reflectance data processed from each standard color swatch, a set of spectral shape features is extracted to form the feature vector of the standard color swatch; the set of spectral shape features includes: spectral centroid, first-order difference mean, second-order difference mean, short-wavelength energy ratio, mid-wavelength energy ratio, and long-wavelength energy ratio. The spectral centroid is obtained by calculating the sum of the product of the processed spectral reflectance data and the corresponding wavelength, and then dividing by the sum of the processed spectral reflectance data. It is used to characterize the center wavelength of the spectral energy distribution. The first-order difference mean is obtained by calculating the first-order difference between every two adjacent wavelength points of the processed spectral reflectance data and taking the arithmetic mean of all difference values, which is used to characterize the overall trend of the spectral curve. The second-order difference mean is obtained by calculating the discrete second-order derivative of the processed spectral reflectance data at every three consecutive wavelength points and taking the arithmetic mean of all second-order derivative values. It is used to characterize the average curvature or local concavity and convexity features of the spectral curve. The short-wavelength energy ratio, mid-wavelength energy ratio, and long-wavelength energy ratio are obtained by dividing the visible spectrum into three sub-bands: short-wavelength, mid-wavelength, and long-wavelength. The ratio of the sum of spectral reflectance data in each sub-band to the sum of spectral reflectance data in the entire spectrum is calculated. These ratios are used to characterize the relative response intensity of color stimuli on the three types of cone cells in the human eye. Each feature vector is then standardized to obtain a standardized feature vector. With minimizing intra-class dispersion as the optimization objective, and under the constraints that each standard color swatch must be assigned to one and only one category, and each category contains a fixed number of color swatches, clustering is performed based on the standardized feature vectors of all standard color swatches to divide all standard color swatches into multiple categories and determine the centroid of each category. For each category, the uncorrected tristimulus values ​​of each standard color swatch are calculated based on the spectral reflectance data of all standard color swatches in that category. The uncorrected tristimulus values ​​of each standard color swatch are concatenated with their corresponding feature vectors and a constant bias term is added to form an extended input vector. The extended input vectors of all standard color swatches in that category are stacked to form a design matrix, and the standard tristimulus values ​​of all standard color swatches in that category are stacked to form a target matrix. By minimizing the loss function consisting of the design matrix, the target matrix, and the regularization term, the calibration coefficient matrix and the regularization hyperparameter of that category are obtained. For each category, its calibration coefficient matrix and hyperparameters are encapsulated into an independent calibration model; the resulting calibration models for all categories are then deployed to the colorimeter. When the colorimeter measures the sample, it calls all the calibration models for each category to predict the sample, and then weights and fuses the prediction results of each model according to the similarity between the sample and the centroid of each category, and outputs the corrected tristimulus value.

2. The method according to claim 1, characterized in that, The spectral reflectance data is smoothed and normalized, including: The Savitzky-Gore filtering algorithm is used to smooth the spectral reflectance data of each standard color plate with a preset window width and smoothing order to obtain the smoothed spectral data corresponding to each color plate. For each standard color swatch, its smoothed spectral data is normalized based on the maximum value of the smoothed spectral data of that color swatch.

3. The method according to claim 1, characterized in that, The step involves extracting a set of spectral shape features to form the feature vector of the standard color chart; and standardizing each feature vector to obtain a standardized feature vector, including: The spectral shape features of each standard color swatch are arranged in an ordered manner into row vectors, and the row vectors are transposed to obtain the feature vector of the standard color swatch. Calculate the arithmetic mean of all standard color swatches across all spectral shape features to form a mean vector; and calculate the standard deviation of all standard color swatches across all spectral shape features to form a standard deviation vector. For each standard color swatch, subtract the mean vector from its feature vector, and then divide each element of the resulting difference vector by the corresponding element of the standard deviation vector to obtain the standardized feature vector of the standard color swatch.

4. The method according to claim 1, characterized in that, Clustering is performed based on the standardized feature vectors of all standard color swatches, dividing all standard color swatches into three categories, achieved through the following constraints: Define binary decision variables Among them, the standard color swatch index Category Index When the standard color swatch Category hour, Otherwise The sum of the binary variables for each standard color swatch across all categories is 1, indicating that each standard color swatch must be assigned to one and only one category. Furthermore, the sum of the binary variables of all standard color palettes within each category must be equal to 4 to ensure a balanced training sample across categories. The centroid of each category is defined as the arithmetic mean of the standardized eigenvectors of all standard color swatches within that category. The objective function of the clustering is defined as the sum of the squared Euclidean distances between the normalized feature vectors of all standard color palettes and the centroids of their respective categories. The optimization objective is to minimize the value of this objective function.

5. The method according to claim 1, characterized in that, By minimizing the loss function consisting of the design matrix, the objective matrix, and the regularization term, the calibration coefficient matrix and regularization hyperparameters for this category are obtained, including: The product of the calibration coefficient matrix to be solved and the design matrix is ​​subtracted from the target matrix to obtain the residual matrix, and the first sum of squares of the residual matrix is ​​calculated. The loss function is obtained by adding the product of the regularization hyperparameter to be solved and the second sum of the squares of all elements in the calibration coefficient matrix to be solved, to the first sum of squares. By setting the derivative of the loss function with respect to the calibration coefficient matrix to be zero, the closed-form solution of the calibration coefficient matrix and the regularization hyperparameters are obtained.

6. The method according to claim 1, characterized in that, When the colorimeter measures the sample, it calls all categories of calibration models to predict the sample, and then weights and fuses the prediction results of each model according to the similarity between the sample and the centroid of each category, outputting the corrected tristimulus values, including: For the sample to be tested, its extended input vector is calculated and input into the calibration model of all categories to obtain the preliminary correction results for each category. Calculate the Mahalanobis distance from the feature vector of the sample to be tested to the centroid of each class; Based on the Mahalanobis distance, the similarity values ​​between the sample to be tested and each category are calculated using the Gaussian kernel function, and the similarity values ​​of all categories are normalized to obtain the fusion weights corresponding to each category. The preliminary correction results for each category are multiplied by their corresponding fusion weights and then summed to obtain the corrected tristimulus values.

7. A multi-class color correction device based on spectral shape driving, used to perform the method of claim 1, characterized in that, include: The data acquisition and preprocessing module is used to acquire the standard tristimulus values ​​of multiple standard color plates, and to collect the spectral reflectance data of each standard color plate at fixed intervals of wavelength, and to perform smoothing and normalization processing on the spectral reflectance data. The feature extraction module is used to extract a set of spectral shape features from the spectral reflectance data processed from each standard color swatch to form the feature vector of the standard color swatch; and to standardize each feature vector to obtain a standardized feature vector. The capacity-constrained clustering module is used to minimize intra-class dispersion as the optimization objective. Under the constraints that each standard color swatch must be assigned to one and only one class, and each class contains a fixed number of color swatches, it performs clustering based on the standardized feature vectors of all standard color swatches, divides all standard color swatches into multiple classes, and determines the centroid of each class. The model parameter calculation module is used to calculate the uncorrected tristimulus values ​​of each standard color swatch for each category based on the spectral reflectance data of all standard color swatches in that category. The uncorrected tristimulus values ​​of each standard color swatch are concatenated with their corresponding feature vectors and a constant bias term is added to form an extended input vector. The extended input vectors of all standard color swatches in that category are stacked to form a design matrix, and the standard tristimulus values ​​of all standard color swatches in that category are stacked to form a target matrix. By minimizing the loss function consisting of the design matrix, the target matrix, and the regularization term, the calibration coefficient matrix and the regularization hyperparameters of that category are obtained. The encapsulation and deployment module is used to encapsulate the calibration coefficient matrix and hyperparameters of each category into an independent calibration model; and deploy the resulting calibration models of all categories to the colorimeter. The online sample calibration module is used to call all categories of calibration models to predict the sample when the colorimeter measures the sample, and to perform weighted fusion of the prediction results of each model according to the similarity between the sample and the centroid of each category, and output the corrected tristimulus value.

8. An electronic device, characterized in that, include: At least one processor; Memory for storing the at least one processor-executable instruction; The at least one processor is configured to execute the instructions to implement the method as described in any one of claims 1-6.

9. A computer-readable storage medium, characterized in that, When the instructions in the computer-readable storage medium are executed by the processor of the electronic device, the electronic device is enabled to perform the method as described in any one of claims 1-6.