Digital pathology scanner multi-dimensional lut color correction method and device supporting multi-color style and individual preference, and medium
Patent Information
- Application Number
- CN202611272912.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2026-08-21
- Publication Date
- 2026-10-23
- Estimated Expiration
- 2046-08-21
AI Technical Summary
[0007]本发明实施例提供了一种支持多色彩风格与个性化偏好的数字病理扫描仪多维LUT色彩校正方法、装置及介质,针对现有数字病理色彩校正技术因采用等权全局拟合而导致色域边缘与诊断关键色彩校正精度不足,且单一查找表无法在保证色差精度的前提下兼顾多诊断场景的色彩风格切换与病理医生的个性化偏好适配等问题
1.本发明采用Matern 5/2核构建高斯过程回归模型,能够同时输出预测均值与预测方差,并以预测方差表征的不确定度为判据自适应指导局部网格细分加密,结合哈希表与KD-tree实现高效稀疏存储与快速索引;在此基础上级联以全部训练色块为中心的高斯径向基函数残差修正项并辅以Huber与RANSAC鲁棒回归,彻底克服了传统全局拟合在高饱和色域边缘和深色区域的失真缺陷,将平均CIE DE2000色差降低至2.0以下,色域边缘平均色差降至2.08,最大色差显著受控。
Smart Images

Figure CN122780069B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of digital pathology and medical image processing technology, and in particular to a method, apparatus and medium for color correction of a multidimensional LUT for a digital pathology scanner that supports multiple color styles and personalized preferences. Background Technology
[0002] In the process of digital pathology whole slide imaging, due to differences in the spectral response characteristics of image sensors, the spectral distribution of illumination sources, the attenuation of optical lenses, and the differences in the optical path of microscopic imaging, the digital slide images acquired by digital pathology scanners often have obvious color distortion and color inconsistencies between devices.
[0003] Conventional color correction schemes typically employ global multinomial regression based on a standard color chart or a single static 3D lookup table (3D LUT) for color space mapping. In practice, these methods apply equal weighted fitting to all color patches on the color chart, failing to reflect the varying color importance of specific pathological staining samples in clinical diagnosis. This results in an average allocation of fitting resources, neglecting to prioritize the correction accuracy of critical diagnostic colors such as the pink-purple regions in hematoxylin and eosin (H&E) staining or the brown-blue regions in immunohistochemical (IHC) staining.
[0004] Meanwhile, the global parameterization model has limited ability to fit the nonlinear response of the scanner. It is prone to systematic deviations at the edges of high-saturation color gamuts and in dark areas, resulting in large color differences and difficulty in eliminating local residual errors. Individual abnormal color blocks can also easily deviate from the overall regression surface.
[0005] Furthermore, in clinical diagnostic practice, different pathologists have different visual preferences for color presentation (e.g., a preference for warmer tones to help distinguish between cell nuclei and cytoplasm, or a preference for high saturation to enhance the contrast of positive staining signals), and different diagnostic scenarios (routine diagnosis, remote consultation, teaching demonstration) also have different requirements for color style; existing digital pathology color correction technology can only output images with a single fixed style, lacking a mechanism to take into account the continuous switching of multiple styles and the adaptation to doctors' personalized preferences within a strictly controlled range of color difference, and it is difficult to cope with hardware color drift caused by long-term operation of the equipment.
[0006] Therefore, there is an urgent need for a digital pathology scanner multidimensional LUT color correction method, device, and medium that supports multiple color styles and personalized preferences to solve the problems existing in the current technology. Summary of the Invention
[0007] This invention provides a method, apparatus, and medium for color correction of a multidimensional LUT for digital pathology scanners that supports multiple color styles and personalized preferences. It addresses the problems of existing digital pathology color correction technologies, which suffer from insufficient accuracy in color gamut edge and diagnostic key color correction due to the use of equal-weight global fitting, and the inability of a single lookup table to simultaneously accommodate color style switching for multiple diagnostic scenarios and adapt to the personalized preferences of pathologists while ensuring color difference accuracy.
[0008] The core technology of this invention mainly involves using Gaussian process regression to predict uncertainty, driving adaptive non-uniform mesh subdivision, and cascading radial basis function residual correction to construct a high-precision benchmark lookup table. It also integrates pathological diagnosis weighting and synthesizes a multi-basis lookup table through low-dimensional style description vector parameterization. Furthermore, under color difference hard constraints, it combines total variation and monotonicity regularization terms to optimize mesh node perturbations and fine-tune the generation of a personalized correction lookup table.
[0009] In a first aspect, the present invention provides a color correction method for a multidimensional LUT of a digital pathology scanner that supports multiple color styles and personalized preferences, the method comprising the following steps: Obtain the device RGB values obtained by scanning the standard color chart using a digital pathology scanner, and align the device RGB values with the reference chromaticity data of the standard color chart to convert them to the target color space; The mapping relationship between the device's RGB values and the target color space is constructed based on Gaussian process regression, generating a base model and the corresponding prediction uncertainty. Based on the prediction uncertainty, the high uncertainty region of the preset lookup table grid is locally subdivided and refined. A cascaded residual lookup table is constructed by combining the residuals of each color block through radial basis function interpolation. The base model and the cascaded residual lookup table are superimposed to obtain the benchmark lookup table. By combining the color distribution characteristics of pathological images, diagnostic weights are assigned to each color block of the standard color chart. Based on the diagnostic weights, multiple base lookup tables corresponding to different target color styles are trained. According to the input style description vector, the combined weights of multiple base lookup tables are calculated through a preset weight prediction function to synthesize a target style lookup table. Obtain the color preference direction vector of the target doctor, and apply perturbation optimization to the lookup table grid nodes under the constraints of color difference threshold, total variation smoothing regularization term and gradient monotonicity regularization term to fine-tune the target stylized lookup table and generate a personalized correction lookup table. Pixel-by-pixel color correction is performed on the target pathological image based on a personalized correction lookup table.
[0010] Furthermore, a mapping relationship between device RGB values and the target color space is constructed based on Gaussian process regression, including: The Matern5 / 2 kernel function is used to construct the L-axis from the device's RGB space to the CIELAB color space. a b The three-channel independent regression model optimizes the model hyperparameters by maximizing the marginal likelihood and outputs the prediction mean and the prediction variance, which represents the prediction uncertainty, at the test points. Based on the prediction uncertainty, the high uncertainty region of the preset lookup table grid is locally subdivided and refined, including: When the prediction variance is greater than the preset high threshold, the corresponding region’s grid is refined from a standard 33×33×33 grid to a 65×65×65 refined grid by recursive subdivision of an octree. A hash table is used to sparsely store the incremental nodes of the encrypted grid relative to the standard grid, and a KD-tree auxiliary index is used to perform spatial partitioning queries on the hash table during the query phase.
[0011] Furthermore, a cascaded residual lookup table is constructed by combining the residuals of each color block through radial basis function interpolation, including: Using the device RGB coordinates of all training color blocks as the center point of the radial basis function, the residual vector of the training color blocks is interpolated using the Gaussian kernel function to construct a residual lookup table. The residual lookup table is then iteratively updated by serially superimposing it into the base model until the maximum residual is less than the preset color difference convergence threshold. When constructing the base model, the Huber loss function is used in combination with the iterative weighted least squares algorithm for robust regression, and the random sampling consensus (RANSAC) algorithm is used to remove outlier color blocks.
[0012] Furthermore, diagnostic weights are assigned to each color patch of the standard color chart based on the color distribution characteristics of pathological images, including: The frequency of occurrence of the corresponding color in each color block in the statistical pathological image dataset is used as the basic weight, and the diagnostic weight of each color block is obtained by normalization calculation in combination with the prior weight of pathological staining. Among them, the prior weight of H&E staining high-frequency color blocks is higher than the prior weight of IHC staining characteristic color blocks, the prior weight of IHC staining characteristic color blocks is higher than the prior weight of grayscale color blocks, and the prior weight of grayscale color blocks is higher than the prior weight of other background color blocks. Multiple base lookup tables include a standard neutral style base lookup table, a warm color style base lookup table, and a high saturation style base lookup table; the target chromaticity value of each base lookup table is determined by a combination of standard color card reference data, the expected chromaticity value calibration results of representative pathological slides under the target style, and the exclusive base lookup table registered by the doctor for fine-tuning.
[0013] Furthermore, the style description vector includes at least a color temperature offset dimension, a saturation gain dimension, and a contrast adjustment dimension; The weight prediction function uses the Softmax function to map the style description vector into a non-negative combined weight that sums to 1; The parameter matrix and bias term of the weight prediction function are obtained through end-to-end gradient descent optimization. The optimization process is supervised by a selected representative style pathology image set, and aims to minimize the composite loss function of weighted chromatic aberration loss, total variation regularization term and monotonicity regularization term.
[0014] Furthermore, the color preference direction vector of the target doctor is obtained, including: By showing doctors pathological images of color variants with applied perturbations through pairwise comparison experiments and recording their preference choices, a preference direction vector representing the direction of color shift is obtained by fitting the image in the CIELAB space. The optimization involves applying perturbations to the lookup table grid nodes, including: A quadratic programming model is constructed with the objectives of minimizing the deviation between the perturbation amount of the lookup table node and the preference direction vector, total variation smoothing regularization, and gradient monotonicity regularization, and with the inequality hard constraint that the color difference after correction of each color block is not greater than the preset maximum allowable color difference. The perturbation amount of each grid node is solved by the augmented Lagrange method. The maximum allowable color difference is configured as a multi-level threshold including standard level, balanced level, and relaxed level.
[0015] Furthermore, it also includes drift detection and stylized drift compensation steps: The calibration color chart is periodically scanned to calculate the color difference between the RGB values of the currently scanned device and the RGB values of the reference device. When the average color difference or the number of single out-of-range color blocks reaches the preset drift threshold, color drift is determined to have occurred. Weighted residual regression is performed on multiple base lookup tables to solve for the independent compensation terms of each base lookup table; Based on the compensated base lookup tables, all stylized lookup tables are synchronously reprojected and updated using a weighted prediction function. For local color patches where the color difference still exceeds the preset threshold after reprojection and updating, local fixed-point correction is implemented by serially superimposing radial basis function residual compensation terms on the corresponding stylized lookup table.
[0016] Secondly, the present invention provides a multidimensional LUT color correction device for a digital pathology scanner that supports multiple color styles and personalized preferences, comprising: The data acquisition and preprocessing module is used to acquire the device RGB values obtained by the digital pathology scanner scanning the standard color chart, and to align the device RGB values with the reference chromaticity data of the standard color chart and convert them to the target color space; The feature modeling module is used to construct the mapping relationship between the device's RGB values and the target color space based on Gaussian process regression, and generate the base model and the corresponding prediction uncertainty. Based on the prediction uncertainty, the high uncertainty region of the preset lookup table grid is locally subdivided and densified, and a cascaded residual lookup table is constructed by combining the residuals of each color block through radial basis function interpolation. The baseline lookup table is obtained by superimposing the base model and the cascaded residual lookup table. The multi-style synthesis module is used to assign diagnostic weights to each color block of the standard color chart based on the color distribution features of pathological images, and train multiple base lookup tables corresponding to different target color styles based on the diagnostic weights; according to the input style description vector, the combined weights of multiple base lookup tables are calculated through a preset weight prediction function to synthesize the target style lookup table in a weighted manner. The preference fine-tuning module is used to obtain the color preference direction vector of the target doctor. Under the constraints of color difference threshold, total variation smoothing regularization term and gradient monotonicity regularization term, it applies perturbation optimization to the lookup table grid nodes to fine-tune the target stylized lookup table and generate a personalized correction lookup table. The color correction module is used to perform pixel-by-pixel color correction on the target pathological image based on a personalized correction lookup table.
[0017] Thirdly, the present invention provides an electronic device including a memory and a processor, wherein the memory stores a computer program and the processor is configured to run the computer program to execute the above-described digital pathology scanner multidimensional LUT color correction method that supports multiple color styles and personalized preferences.
[0018] Fourthly, the present invention provides a readable storage medium storing a computer program, which, when executed by a processor, implements the above-described digital pathology scanner multidimensional LUT color correction method that supports multiple color styles and personalized preferences.
[0019] The main contributions and innovations of this invention are as follows: 1. This invention uses a Matern 5 / 2 kernel to construct a Gaussian process regression model, which can simultaneously output the predicted mean and predicted variance. The uncertainty represented by the predicted variance is used as the criterion to adaptively guide the local grid subdivision and encryption. Combined with hash tables and KD-trees, it achieves efficient sparse storage and fast indexing. On this basis, a Gaussian radial basis function residual correction term centered on all training color blocks is cascaded and supplemented with Huber and RANSAC robust regression, which completely overcomes the distortion defects of traditional global fitting at the edges of high-saturation color gamut and dark regions. The average CIE DE2000 color difference is reduced to below 2.0, the average color difference at the edge of the color gamut is reduced to 2.08, and the maximum color difference is significantly controlled.
[0020] 2. This invention deeply integrates the statistical frequency of color distribution in pathological images with prior staining knowledge, assigns differentiated diagnostic weights to the pink-purple high-frequency colors of H&E staining, the brown-blue characteristic colors of IHC staining, and grayscale color patches, and performs weighted regression, optimizing the spatial allocation of fitting resources, reducing the correction error of pathological high-frequency key color patches by more than 30%, and ensuring highly faithful color reproduction of cell nuclei, cytoplasm, and specific staining markers.
[0021] 3. This invention constructs standard neutral, warm, and high-saturation multi-base lookup tables through joint calibration, and establishes an end-to-end parameterized mapping model from low-dimensional style description vectors to combined weights. It eliminates the need for repeated scanning of color charts and retraining for each style. Only the style description parameters need to be adjusted to complete the dynamic weighted synthesis of the target style lookup table within 10ms. While supporting various clinical diagnostic and teaching demonstration scenarios, it ensures that the color difference CIEDE2000 of different scanners under the same style settings is less than 3.0.
[0022] 4. This invention quantifies and extracts the doctor's preference direction vector through pairwise comparison experiments, and constructs a quadratic programming model for personalized preference fine-tuning with preference approximation, total variation smoothness, and gradient monotonicity as optimization objectives, and with the maximum allowable color difference of each color block as an inequality hard constraint. The augmented Lagrange method is used to solve the model. Under the standard, balanced, and relaxed level threshold control, it can not only enable the doctor's preference satisfaction to reach up to 95%, but also strictly lock the upper limit of the maximum color difference to prevent image discontinuity, oversaturation artifacts, or pathological information distortion caused by subjective color adjustment.
[0023] 5. This invention constructs a three-layer closed-loop drift compensation mechanism consisting of base lookup table correction, stylized lookup table parametric reprojection, and local fallback of radial basis function for high-bias color blocks. When hardware performance degradation or light source aging drift is detected, only weighted compensation needs to be applied to the base lookup table to simultaneously correct all derived style lookup tables. It has both extremely low computational overhead and excellent local extreme color difference elimination capability, ensuring stable color output throughout the scanner's entire lifecycle.
[0024] Details of one or more embodiments of the present invention are set forth in the following drawings and description, so that other features, objects and advantages of the invention will be more readily understood. Attached Figure Description
[0025] The accompanying drawings, which are included to provide a further understanding of the invention and form part of this invention, illustrate exemplary embodiments of the invention and are used to explain the invention, but do not constitute an undue limitation of the invention. In the drawings: Figure 1 This is a schematic diagram of the overall architecture of a color calibration system according to an embodiment of the present invention (including multiple style and preference modules); Figure 2 This is an improved color feature modeling flowchart (Gaussian process regression + adaptive mesh + residual correction) according to an embodiment of the present invention. Figure 3 This is a schematic diagram of adaptive non-uniform grid encryption according to an embodiment of the present invention; Figure 4 This is a flowchart of a multidimensional LUT color correction method for digital pathology scanners that supports multiple color styles and personalized preferences, according to an embodiment of the present invention; Figure 5 This is a comparison chart of correction effects under different doctors' preferences according to embodiments of the present invention; Figure 6 This is a comparison chart of the correction effects of preference-driven LUT according to an embodiment of the present invention; Figure 7 These are comparison images of multiple styles (neutral / warm / high saturation) effects according to embodiments of the present invention; Figure 8 This is a schematic diagram of the hardware structure of an electronic device according to an embodiment of the present invention. Detailed Implementation
[0026] Exemplary embodiments will now be described in detail, examples of which are illustrated in the accompanying drawings. When the following description relates to the drawings, unless otherwise indicated, the same numerals in different drawings denote the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with one or more embodiments of this specification. Rather, they are merely examples of apparatuses and methods consistent with some aspects of one or more embodiments of this specification as detailed in the appended claims.
[0027] It should be noted that the steps of the corresponding methods are not necessarily performed in the order shown and described in this specification in other embodiments. In some other embodiments, the methods may include more or fewer steps than described in this specification. Furthermore, a single step described in this specification may be broken down into multiple steps in other embodiments; and multiple steps described in this specification may be combined into a single step in other embodiments.
[0028] To facilitate understanding of the technical solution of this invention, the core symbols and terms involved in this invention are defined as follows: This represents the RGB three-channel color value of the k-th color patch in the scanner's device space; This refers to the CIE 1931 XYZ color space. express Uniform color space; and These represent the Gaussian process regression (GPR) model at the test input points. The predicted mean at (corresponding to) Three-channel components) and prediction variance (characterizing prediction uncertainty); Represents the kernel function. Represents the kernel matrix of the training samples. To observe the noise variance, For signal variance, The length scale hyperparameter of the kernel function; Indicates the first The residual vector of each color block; , and These represent the baseline lookup table, the residual lookup table, and the final lookup table after superposition correction, respectively. This represents the spatial smoothing regularization term of the total variation. or Represents a monotonicity regularization term; This represents the direction vector of the doctor's personalized color preference; This represents the dynamic combination weights of the i-th base lookup table given the input style description parameter vector s; This represents the CIEDE2000 color difference calculation formula; Indicates the color difference value. This indicates the preset maximum allowable color difference threshold; and These represent the high and low thresholds for determining the uncertainty of Gaussian process regression prediction, respectively. These represent the regularization weight coefficients in each optimization objective.
[0029] like Figure 1 As shown, the color calibration system of this invention includes the following core modules: a standard color calibration module, an improved color feature generation module (including Gaussian process regression, adaptive non-uniform mesh, residual correction, and robust regression), a multi-base lookup table generation and style combination module, a preference-driven lookup table fine-tuning module, an ICC profile generation module, a color correction and conversion module, and a color quality assessment and monitoring module. The modules are connected sequentially in the order of calibration → feature generation → weighted training → style synthesis → preference fine-tuning → color correction → quality monitoring. The output of the previous module serves as the input of the next module, forming a complete color calibration technology chain.
[0030] Example 1 This invention aims to propose a multidimensional LUT color correction method for digital pathology scanners that supports multiple color styles and personalized preferences. Specifically, refer to... Figure 4 The method includes: S1: Preparation of pathological standard calibration vehicle and setting of scanning camera Using an IT8.7 / 2 transmissive standard color chart, the color chart film was sealed between a standard pathological slide (1 mm thick) and a coverslip (0.17 mm thick) using refractive index-matching optical adhesive (refractive index n approximately 1.52), creating a pathological standard calibration carrier containing 288 standard color patches. The color chart slide size is consistent with the standard pathological slide size, 75 mm × 25 mm, to ensure that the optical path conditions during scanning are consistent with the actual pathological slide scanning conditions.
[0031] Before scanning, the digital pathology scanner was configured as follows: the camera's GAMMA value was set to 1, the gain value to 0, and the built-in tone mapping and saturation enhancement functions of the scanner's image signal processor (ISP) were disabled to ensure that the device's RGB output from the ISP maintained a linear response to the sensor's original irradiance. The exposure value and light source intensity were set according to the uniform standard for shooting blank slides, and the white balance was adjusted so that the RGB value of the blank background was 240.
[0032] It should be noted that the raw RAW data from the scanner camera is already linearly responsive, meaning the number of photoelectrons is proportional to the irradiance. Through the parameter settings described above, this invention ensures that the RGB values output by the ISP maintain a linear relationship with the original irradiance, eliminating the need for additional inverse gamma correction. If gamma encoding is enabled by default in the ISP workflow in practical applications, an inverse gamma correction step must be inserted before the subsequent color feature modeling steps to inversely transform the device's RGB values to the linear domain.
[0033] S2: Color Block Positioning and RGB Extraction from Devices The prepared pathological standard calibration carrier was placed on the stage of the digital pathology scanner for scanning. A color patch localization algorithm based on edge detection and perspective transformation was used to locate each color patch in the scanned image. To eliminate aliasing effects caused by optical diffraction or adhesive layer boundaries at the edges of the color patches, pixel values were extracted from the central region of each color patch (accounting for 60% to 80% of the total pixel area). The median values of the extracted pixel values were then calculated for the R, G, and B channels to suppress dust and dead pixel noise, resulting in 288 sets of device RGB values.
[0034] S3: Reference Data Registration and White Point Normalization Read the reference data file accompanying the color chart. This file contains the CIEXYZ and CIELAB values for each color patch measured by a 2-degree standard observer under D50 illumination conditions. Register the 288 sets of device RGB values with the corresponding reference chromaticity data, one by one according to the color patch number. Determine the media white point using the reference XYZ values corresponding to the bottom 24 grayscale color patches. And normalize the RGB values of all devices to the range of [0, 1].
[0035] S4: Bradford Color Adaptation Transformation The scanner's illumination source has a color temperature of D65, while the standard illuminator for the color chart reference data is D50, resulting in a color temperature difference. A Bradford color adaptation transformation is performed on the reference XYZ values to convert the reference chromaticity values under the D50 standard illuminator to those under D65 illumination, and then further converts them to reference values in the CIELAB color space. After this transformation, the device's RGB values are paired with the reference CIELAB values under the same lighting conditions, and can be directly used for subsequent color feature modeling.
[0036] S5: Improved Color Feature Modeling Steps Step S5 aims to establish a high-precision non-linear mapping relationship from the device's RGB color space to the CIELAB color space. For example... Figure 2 As shown, this invention employs a cascaded combination of four techniques—Gaussian process regression modeling, adaptive non-uniform mesh refinement, radial basis function residual correction, and robust regression—in the device's linear RGB space [0,1]³ to gradually improve the accuracy of color characterization.
[0037] S5.1: Gaussian Process Regression Modeling Construct L from device RGB to CIELAB using Matérn 5 / 2 kernel functions. a b Three independent Gaussian process regression models. For a given test point x The GPR model outputs both the predicted mean and the predicted variance: Mean prediction:
[0038] Variance prediction:
[0039] The kernel function is:
[0040] In the formula This represents the Euclidean distance between two points. (Hyperparameter) (Signal variance) (Length scale) and (Observation noise variance) is optimized by maximizing the marginal likelihood function. Prediction variance The prediction uncertainty of the feature model in this color region was quantified. The larger the variance value, the lower the confidence level, which provides a driving signal for subsequent adaptive grid encryption.
[0041] In a specific embodiment, the hyperparameter values after optimization by maximizing marginal likelihood are: = 15.2, = 0.35, = 0.8.
[0042] S5.2: Adaptive Non-uniform Mesh like Figure 3As shown, based on the prediction uncertainty output by the Gaussian process regression model, an adaptive non-uniform refinement is applied to the lookup table grid. A high threshold for the prediction uncertainty is set. and low threshold When the prediction variance of a certain region is greater than When the region is identified as a high-uncertainty area (typically the edge of a high-saturation color gamut and a dark region), the mesh of this region is refined from a standard 33×33×33 mesh to a refined 65×65×65 mesh using recursive subdivision via an octree. When the prediction variance of a region is lower than... When the region is determined to be a low uncertainty region, the standard grid density of 33×33×33 is kept constant.
[0043] The encrypted incremental grid nodes are stored using a sparse data structure to balance accuracy and storage overhead. This invention preferably employs a hash table-based sparse storage method: using RGB triples (R, G, B) as hash keys and the corresponding CIELAB triples as hash values, incremental nodes in the 65³ grid relative to the 33³ standard grid are inserted into the hash table as needed, thereby controlling the storage overhead to O(M), where M is the number of incremental nodes, much smaller than the O(65³) storage space required for a dense 65³ grid. During the query phase, a KD-tree auxiliary index is used to partition the hash table, reducing the average time complexity of node queries to O(log M) and avoiding linear scans. This data structure combining a hash table and a KD-tree supports both random sampling and tetrahedral interpolation, meeting the real-time requirements of online color correction in digital pathology.
[0044] In a specific embodiment, = 0.5, = 0.1, the final number of grid nodes is approximately 45,000.
[0045] S5.3: Residual Lookup Table and Iterative Correction After the Gaussian process regression basis model makes predictions, the residual values of each training color patch are calculated:
[0046] in This is the reference CIELAB value of the k-th color patch after color adaptation transformation. This is the predicted mean of GPR at this color block.
[0047] A residual lookup table is constructed in RGB space using radial basis function interpolation. The present invention preferably uses a Gaussian kernel as the RBF kernel function, which has the following form:
[0048] Where r is the Euclidean distance between two points in RGB space, and ε is the shape parameter, selected in the range of 0.5 to 2.0 through cross-validation. The center point of the radial basis function directly uses the RGB coordinates of all 288 training color patches, that is, each training color patch corresponds to one RBF center point, without the need for additional clustering or subsampling steps, to ensure accurate fitting of the residual interpolation at the training samples.
[0049] The residual lookup table and the base model are superimposed in a serial manner (cascaded): first generated by the Gaussian process regression base model. Predict, then superimpose the residual correction term obtained from radial basis function interpolation. This yields the final lookup table:
[0050] This serial overlay method facilitates separate calibration of the base model and residual terms, and the computation can be cached in stages. Further, iterative correction is performed: the residuals are repeatedly calculated and the residual lookup table is updated using RBF interpolation until the maximum residual color difference in the training color patches is less than a preset threshold (ΔE < 0.5). In a specific embodiment, after three iterations, the maximum residual decreases to ΔE = 0.42.
[0051] S5.4: Robust Return To further reduce the impact of outlier color patches on the overall regression results, this invention uses the Huber loss function instead of the traditional L2 loss function. The definition of the Huber loss function is as follows:
[0052]
[0053] Here, the Huber parameter δ = 1.0 (corresponding to ΔE approximately 1.0). When the residuals are small, the Huber loss approximates the L2 loss, maintaining the least-squares fitting characteristic for normal color patches; when the residuals are large, the Huber loss increases linearly, reducing the weighting influence of outlier color patches on the overall fit. This optimization problem is solved using the Iterative Weighted Least Squares (IRLS) algorithm.
[0054] Simultaneously, the RANSAC (Random Sample Consensus) algorithm is used to detect and remove outlier color patches. In a specific embodiment, IRLS converges after 20 iterations, and RANSAC detects two outlier color patches (numbered 147 and 203), which are then removed, and the model is refitted.
[0055] S5.5: Region-by-region cross-validation The 288 color blocks were divided into 24 regions, consisting of 8 hue intervals multiplied by 3 saturation intervals, based on hue (H) and saturation (C). The correction error of each region was evaluated to locate areas with weak accuracy and to perform targeted optimization.
[0056] S6: Diagnostic Importance Weighting and Multibase Lookup Table Training Steps S6.1: Diagnostic Importance Weighting This invention assigns weights to 288 color patches based on the color distribution characteristics of pathological images. First, the frequency of occurrence of the corresponding color for each color patch in a large dataset of pathological images was statistically analyzed and used as the basic weight. Then, prior weights for various colors are set based on the prior importance of diagnosis. The prior weights for high-frequency colors (pink and purple areas) in H&E staining are set to 2.0; the prior weights for characteristic colors (brown and blue areas) in IHC staining are set to 1.8; the prior weights for grayscale color patches are set to 1.5 to prioritize ensuring the accuracy of white balance; and the prior weights for other color patches are set to 1.0.
[0057] The final weights are obtained through normalization calculation:
[0058] Based on this weighted result, the regression objective for color feature modeling is adjusted to a weighted regression objective: This allows high-frequency colors and diagnostic key colors to receive higher weights in model fitting.
[0059] S6.2: Multibase Lookup Table Training K base lookup tables (BasisLUTs) are trained, with K=3 in this embodiment, and optimized for different color styles: The standard neutral style aims to minimize DE2000 and faithfully reproduce the reference colors. For a warm color scheme, moderately enhance a The channel enhances the warm red hue, making it suitable for observation scenarios involving some IHC staining. For a highly saturated style, chroma is moderately increased to enhance color differentiation, making it suitable for teaching and demonstration scenarios.
[0060] The target LAB value for each base lookup table is determined jointly by the following methods: (a) Using the standard neutral LAB value corresponding to the color card reference data as the benchmark anchor point, ensure that the base lookup table has the minimum DE2000 with the reference value under the standard neutral style; (b) Based on the output of the standard neutral lookup table, no fewer than three senior pathologists, in combination with representative pathological images (typical H&E and IHC diagnostic slides) under the target style represented by each base lookup table, jointly determine the expected LAB value of 288 color blocks under the target style through group consultation or mode voting. (c) Support each doctor to make local fine-tuning of the base lookup table in the image reading software based on their own preferences. The personalized base lookup table generated after fine-tuning is registered and used as the doctor's exclusive base lookup table in the system.
[0061] During the training of each base lookup table, a total variation regularization term (to ensure the smoothness of the lookup table space) and a monotonicity regularization term (to ensure the monotonicity of the color mapping) are applied respectively. In a specific embodiment, the total variation regularization weights are... =0.0001, monotonicity regularization weight =10.
[0062] S6.3: Parameterization of Style Descriptors Define style parameter vector It includes three dimensions: color temperature offset t (range [-0.5, 0.5]), saturation gain c (range [0, 1]), and contrast adjustment v (range [0, 1]). The combined weights of each base lookup table are calculated using a weight prediction function.
[0063] in This is the weight matrix. Let be the bias vector, and d be the input dimension. The softmax function ensures that all weights are non-negative and sum to 1.
[0064] S6.4: Stylized Lookup Table Composition Dynamically synthesize target stylization lookup table based on style descriptors:
[0065] The synthesized lookup table maintains a 33×33×33 (or adaptive mesh) structure and can be directly used for tetrahedral interpolation. Style switching is completed in real time by adjusting the style descriptor s, and the computation time for synthesizing the lookup table is less than 10 milliseconds.
[0066] In this embodiment, s=(0,0,0.5) corresponds to a standard neutral style, with a combination weight of α=(0.82,0.10,0.08) and an average DE2000 of 1.92; s=(0.3,0.3,0.5) corresponds to a warm style, with a combination weight of α=(0.15,0.72,0.13) and an average DE2000 of 2.35; and s=(0,0.8,0.7) corresponds to a high-saturation style, with a combination weight of α=(0.12,0.08,0.80) and an average DE2000 of 2.68.
[0067] S6.5: Weight Optimization Training Using the style target reference image as a supervisory signal, the system performs end-to-end optimization of the combined weight parameters W and b. The "style target reference image" is selected by at least three senior pathologists based on their long-term diagnostic experience, each choosing one representative pathological image from a database of real diagnostic cases that embodies a specific style (typically selected from representative H&E or IHC slides with clear tissue structure, significant staining features, and those most frequently used by the physician). This selection is then unanimously confirmed by the group to form a "representative style pathological image set." The system pairs the device RGB value of each pixel in this image set with the physician's desired target LAB value, using this pairing as a supervisory signal for the style lookup table synthesis weights.
[0068] The loss function is defined as follows:
[0069] in, , Let LAB be the expected LAB value of color block k under the target style. R_mono is the total variation regularization term, and R_mono is the monotonicity regularization term. W and b are optimized by gradient descent, with a learning rate of 0.001 and 10,000 iterations in this specific embodiment.
[0070] S7: Preference-Driven Lookup Table Fine-Tuning Steps S7.1: Doctor Preference Profile Collection Color preference information from pathologists was collected through pairwise comparison experiments. Multiple color variations of the same pathological image were presented to the pathologists, each generated by applying perturbations in different directions within the CIELAB color space. The pathologists selected the variation that best matched their preference from each pair. After recording all preference selections, the system fitted a preference direction vector into the CIELAB color space. This vector represents the direction of the color shift in a doctor's preference. For example, a warmer preference corresponds to a. Positive shift and saturation preference correspond to an increase in chroma.
[0071] In a specific embodiment, five pathologists participated in preference collection, each completing 100 pairs of comparisons. The fitted preference direction vectors are as follows: Doctor A's =(-2.1,1.5,0.8), indicating a warmer, redder tone; Doctor B's =(0.5,-0.8,-1.2), indicating a cooler, more bluish tone; Doctor C's =(1.0,2.3,-1.5), indicating slightly high saturation; Doctor D's =(-1.5,0.3,0.5), indicating a slightly brighter color; Doctor E's =(0.0,0.0,0.0), which means no preference, neutral.
[0072] S7.2: Lookup Table Node Perturbation Model For each grid node of the 33×33×33CLUT lookup table Introducing disturbance The corrected lookup table node values are:
[0073] in, The node values of the baseline lookup table generated for the existing feature model.
[0074] S7.3: CIEDE2000 Color Difference Constraint Optimization Construct the following constrained optimization problem. The objective function is:
[0075] Where α(p) is the preference intensity at node p, which is inversely weighted according to the spatial distance from the color block to the node; TV(δ) is the total variation regularization term, which ensures the smoothness of the lookup table space and prevents drastic local color jumps; δ² is the gradient regularization term, which ensures the monotonicity of color mapping and eliminates contour artifacts and color breaks. and The regularization weights are determined through cross-validation.
[0076] The constraints are: For all .
[0077] S7.4: Solution Method The augmented Lagrange method is used to solve the constrained quadratic programming problem described above. The inequality constraints are transformed into penalty function terms, and the Lagrange multipliers and penalty parameters are iteratively updated until convergence. The convergence criterion is that the change in ΔE is less than 0.01. In a specific embodiment, =0.001, =10, the augmented Lagrange method converges after 500 iterations.
[0078] S7.5: CIEDE2000 color difference grading threshold This invention provides a configurable accuracy-preference trade-off mechanism, setting at least two selectable maximum permissible color difference thresholds. .
[0079] Standard grade: =2.0, precision is prioritized, with a preference for small fine-tuning range. The average DE2000 of the 288 color blocks is no greater than 2.0, the maximum DE2000 is no greater than 3.0, the preference satisfaction rate is 62%, and the preference direction offset angle is 38 degrees.
[0080] Balance level: =2.8, precision and preference are balanced, the average DE2000 is 2.65, the maximum DE2000 is 3.42, the preference satisfaction rate is 85%, and the preference direction offset angle is 15 degrees.
[0081] Relaxed level: =3.5, preference priority, allows for greater color style shift, average DE2000 is 3.38, maximum DE2000 is 4.15, preference satisfaction is 95%, preference direction shift angle is 5 degrees.
[0082] S8: Pixel-by-pixel color correction of target pathological images S8.1: Read the device RGB value of each pixel in the target pathological image and normalize it to the [0,1] interval.
[0083] S8.2: Apply linearization to the tone reproduction curve (TRC) of the ICC profile.
[0084] S8.3: Perform tetrahedral interpolation lookup in the stylized lookup table to obtain the corrected color value corresponding to each pixel. The lookup table is the final lookup table obtained by fine-tuning the preferences in step S7 after synthesizing the stylized lookup table in step S6. Tetrahedral interpolation divides the cubic mesh cell containing the RGB value to be queried into several tetrahedra, and performs linear interpolation on the LAB value of the vertex according to the centroid coordinates of the query point in the tetrahedron, achieving sub-mesh precision color conversion.
[0085] S8.4: If it is necessary to convert the calibrated image to the RGB color space (such as sRGB) of the target display device, a secondary conversion is performed by embedding the B2A table of the target display's ICC profile.
[0086] S9: ICC Configuration File Generation The A2B table (device to PCS conversion), B2A table (PCS to device conversion), media white points, and media black points of the stylized lookup table are encoded into LUT16Type format according to the ICC.1:2022 standard to generate a complete ICC device profile file. This invention supports generating multiple independent ICC Profiles corresponding to different color styles, or generating a parameterized Profile with style descriptor s as a parameter.
[0087] The tag structure of ICCProfile includes: wtpt (media white point XYZ value), bkpt (media black point XYZ value), A2B0 (device to PCS lookup table), B2A0 (PCS to device lookup table), and desc (device description).
[0088] S10: Color consistency across scanners The color spaces of different scanners are uniformly mapped to the CIEXYZ common color exchange space, and then mapped to the sRGB color space under the same display conditions to ensure that different scanners produce images with consistent colors under the same style settings. The color difference between the color reference image and the output images of each scanner is calculated using the CIEDE2000 color difference formula to quantitatively evaluate color consistency.
[0089] S11: Color Quality Monitoring and Stylization Shift Compensation The calibration color chart is scanned periodically to detect color drift. When drift is detected, the deviations of the base lookup table and each style lookup table are evaluated simultaneously to construct a stylized drift compensation model. The specific algorithm is as follows.
[0090] S11(a): Drift Detection. Using the 288 sets of device RGB values from the most recently calibrated color chart as a baseline, the color difference is calculated block by block against the RGB values of the devices scanned in this scan. When the average ΔE exceeds the threshold... (Default 1.5), or a single block ΔE exceeds the threshold. When the number of color blocks (default 3.5) exceeds 5, color shift is determined to have occurred.
[0091] S11(b): Base lookup table level compensation. Using the same weighted correction method as in step S6.4, the base lookup tables ( Perform weighted residual regression independently and solve for the compensation terms in each basis lookup table. This minimizes the average ΔE of the compensated base lookup table on the new color card.
[0092] S11(c): Stylization consistency is maintained. Based on the base lookup table level compensation, all stylization lookup tables synthesized from the base lookup tables are synchronously reprojected and updated through the style descriptor parameterization mapping defined in step S6.3. Specifically, for any style descriptor s, the recalculated compensated stylization lookup table is as follows:
[0093] because The weighting relationship remains unchanged before and after compensation, so the color relationship between styles can be kept linearly consistent.
[0094] S11(d): Independent residual fallback. If, after weighted correction using the base lookup table, there are still local color patches with a ΔE greater than 2.0, then an independent RBF residual compensation term is superimposed on the stylized lookup table. (Using the same serial superposition method as in step S5.3), perform fixed-point correction on the high ΔE color blocks.
[0095] S11(e): Log recording. The system automatically records the timestamps of each calibration and drift compensation, the parameters of each base lookup table before and after compensation, the color difference data of each style lookup table, and the size of the compensation item, forming a complete color quality management log, which supports subsequent drift trend analysis and statistical process control (SPC).
[0096] Example 2 This embodiment proposes an implementation method for improving the accuracy verification of color feature modeling: The experimental equipment included a digital pathology scanner with a CCD sensor (LED light source, color temperature 5000K, supporting 20x objective lens), an IT8.7 / 2 transmissive standard color chart (288 color blocks), and a workstation equipped with color management software.
[0097] Color cards were prepared according to steps S1 to S4, and 288 sets of device RGB values and reference LAB values were collected. A Gaussian process regression model was constructed according to step S5.1, and the hyperparameters were optimized by maximizing marginal likelihood. Perform adaptive mesh encryption according to step S5.2. =0.5, =0.1, the high uncertainty region is refined to 65×65×65, and the low uncertainty region remains at 33×33×33, with a final grid node count of approximately 45,000. Residual correction is performed according to step S5.3, and after 3 iterations, the maximum residual decreases to ΔE=0.42. Huber robust regression (δ=1.0) is performed according to step S5.4, and IRLS converges after 20 iterations. RANSAC detects two outlier patches (numbered 147 and 203), which are removed, and the system is refitted.
[0098] The error comparisons of the various method combinations are shown in Table 1: Table 1
[0099] As shown in Table 1, the accuracy is continuously improved by layering the four techniques. The final complete combination scheme reduces the average DE2000 from 3.42 to 1.76, the maximum DE2000 from 5.12 to 2.98, and the average DE2000 at the color gamut edge from 4.68 to 2.08, verifying that the adaptive mesh refinement and residual correction have a particularly significant effect on improving accuracy in the color gamut edge region.
[0100] Example 3 This embodiment proposes a specific implementation method for weighted combination verification using multi-base lookup tables: Three base lookup tables were trained, corresponding to standard neutral, warm, and high-saturation styles, respectively. Following step S6.1, diagnostic importance weighting was performed, and the color distribution of 1000 H&E and IHC pathological images was statistically analyzed. The prior weights for high-frequency color patches in H&E were set to 2.0, for characteristic colors in IHC to 1.8, and for grayscale color patches to 1.5. Following step S6.2, the three base lookup tables were trained with different style target LAB values, and total variation regularization was applied to each. =0.0001) and monotonicity regularization ( =10). Set the style descriptor parameters according to step S6.3 and perform weight prediction training. Use reference style images selected by three senior pathologists as supervision to optimize the weight matrix W and bias b.
[0101] The combined weights and correction errors for the three styles are shown in Table 2: Table 2
[0102] like Figure 5 As shown, Figure 5 (1) is the original image without color correction. Figure 5 (2) is a standard neutral lookup table color calibration image. Figure 5 (3) is an image processed by a warm color style lookup table (this style image is the closest to the color style under a full-spectrum light source microscope). Figure 5 (4) is a high-saturation style lookup table for image processing.
[0103] Five pathologists participated in preference collection, each completing 100 pairs of comparison experiments. Preference selection was collected according to step S7.1, and the preference direction vector for each pathologist was fitted in the CIELAB space. CIEDE2000 color difference constraint optimization was performed according to steps S7.3 and S7.4. = 0.001, = 10, the augmented Lagrange method converges after 500 iterations.
[0104] different The preference satisfaction and error are shown in Table 3: Table 3
[0105] like Figure 6 As shown, Figure 6 (1) is the original image without color correction. Figure 6 (2) is a non-biased / neutral style corrected image. Figure 6 (3) is a corrected image with a high saturation style. Figure 6(4) is a corrected image with a warmer, redder style. Figure 6 (5) is a corrected image with a cooler, bluer style. Figure 6 (6) is the corrected image with a brighter style.
[0106] Example 4 This embodiment proposes a specific implementation method for comprehensive system verification: Three scanners with different light source types (Scanner A: LED 5500K, Scanner B: LED 5000K, Scanner C: Halogen lamp 3200K) were used, along with five doctors, three different styles, and three representative pathological slides (H&E, TCT, and immunohistochemistry), to conduct a comprehensive and systematic validation. The overall error is shown in Table 4. Table 4
[0107] All combinations of the DE2000 scanner have a value less than 3.0, meeting the consistency requirements.
[0108] like Figure 7 As shown, Figure 7 (1) Figure 7 (5) Figure 7 (9) are the original, uncolored images of three representative pathological slide samples: immunohistochemistry, TCT, and H&E. Figure 7 (2) Figure 7 (6) Figure 7 (10) is an image with neutral correction style; Figure 7 (3) Figure 7 of (7), Figure 7 (11) is an image with a warm color correction style; Figure 7 (4) Figure 7 (8) Figure 7 (12) is an image with a high saturation correction style.
[0109] Example 5 Based on the above method, the present invention also provides a color correction device for a digital pathology scanner that supports multiple color styles and personalized preferences, comprising: The data acquisition and preprocessing module is used to acquire the device RGB values obtained by the digital pathology scanner scanning the standard color chart, and to align the device RGB values with the reference colorimetric data of the standard color chart and convert them to the CIELAB color space. The feature modeling module is used to construct the mapping relationship between the RGB values of the device and the CIELAB color space based on Gaussian process regression, generate the base model and the corresponding prediction uncertainty; according to the prediction uncertainty, the high uncertainty area of the preset lookup table grid is locally subdivided and densified, and a cascaded residual lookup table is constructed by combining the residuals of each color block through radial basis function interpolation. The base model and the cascaded residual lookup table are superimposed to obtain the benchmark lookup table. The multi-style synthesis module is used to assign diagnostic weights to each color block of the standard color chart based on the color distribution features of pathological images, and train multiple base lookup tables corresponding to different target color styles based on the diagnostic weights; according to the input style description vector, the combined weights of multiple base lookup tables are calculated through a preset weight prediction function to synthesize the target style lookup table in a weighted manner. The preference fine-tuning module is used to obtain the color preference direction vector of the target doctor. Under the constraints of color difference threshold, total variation smoothing regularization term and gradient monotonicity regularization term, it applies perturbation optimization to the lookup table grid nodes to fine-tune the target stylized lookup table and generate a personalized correction lookup table. The color correction module is used to perform pixel-by-pixel color correction on the target pathological image based on a personalized correction lookup table.
[0110] Example 6 This embodiment also provides an electronic device, see reference. Figure 8 It includes a memory 402 and a processor 401, the memory 402 storing a computer program and the processor 401 being configured to run the computer program to perform the steps in any of the above method embodiments.
[0111] Specifically, the processor 401 may include a central processing unit (CPU), an application specific integrated circuit (ASIC), or one or more integrated circuits that can be configured to implement the embodiments of the present invention.
[0112] The memory 402 may include a mass storage device for data or instructions. For example, and not limitingly, the memory 402 may include a hard disk drive (HDD), a floppy disk drive, a solid-state drive (SSD), flash memory, an optical disk drive, a magneto-optical disk drive, magnetic tape, or a Universal Serial Bus (USB) drive, or a combination of two or more of these. Where appropriate, the memory 402 may include removable or non-removable (or fixed) media. Where appropriate, the memory 402 may be internal or external to a data processing device. In a particular embodiment, the memory 402 is non-volatile memory. In a particular embodiment, the memory 402 includes read-only memory (ROM) and random access memory (RAM). Where appropriate, the ROM may be a mask-programmed ROM, a programmable read-only memory (PROM), an erasable read-only memory (EPROM), an electrically erasable read-only memory (EEPROM), an electrically alterable read-only memory (EAROM), or flash memory, or a combination of two or more of these. Where appropriate, the RAM can be Static Random-Access Memory (SRAM) or Dynamic Random-Access Memory (DRAM). DRAM can be Fast Page Mode Dynamic Random Access Memory (FPMDRAM), Extended Data Out Dynamic Random Access Memory (EDODRAM), Synchronous Dynamic Random-Access Memory (SDRAM), etc.
[0113] The memory 402 can be used to store or cache various data files that need to be processed and / or communicated, as well as possible computer program instructions executed by the processor 401.
[0114] The processor 401 reads and executes computer program instructions stored in the memory 402 to implement any of the digital pathology scanner multidimensional LUT color correction methods that support multiple color styles and personalized preferences in the above embodiments.
[0115] Optionally, the electronic device may further include a transmission device 403 and an input / output device 404, wherein the transmission device 403 is connected to the processor 401 and the input / output device 404 is connected to the processor 401.
[0116] The transmission device 403 can be used to receive or send data via a network. Specific examples of the network described above may include wired or wireless networks provided by the communication provider of the electronic device. In one example, the transmission device includes a Network Interface Controller (NIC), which can connect to other network devices via a base station to communicate with the Internet. In another example, the transmission device 403 may be a Radio Frequency (RF) module used for wireless communication with the Internet.
[0117] Input / output device 404 is used for inputting or outputting information. It can be a speaker, microphone, monitor, or keyboard.
[0118] Example 8 This embodiment also provides a readable storage medium storing a computer program. When the computer program is executed by a processor, it implements the digital pathology scanner multidimensional LUT color correction method that supports multiple color styles and personalized preferences, as described in Embodiment 1.
[0119] It should be noted that the specific examples in this embodiment can refer to the examples described in the above embodiments and optional implementations, and will not be repeated here.
[0120] Generally, various embodiments can be implemented in hardware or dedicated circuitry, software, logic, or any combination thereof. Some aspects of the invention can be implemented in hardware, while others can be implemented by firmware or software executed by a controller, microprocessor, or other computing device, but the invention is not limited thereto. Although various aspects of the invention may be shown and described as block diagrams, flowcharts, or using some other graphical representation, it should be understood that, by way of non-limiting example, these blocks, apparatuses, systems, techniques, or methods described herein can be implemented in hardware, software, firmware, dedicated circuitry or logic, general-purpose hardware or controllers or other computing devices, or some combination thereof.
[0121] Embodiments of the present invention can be implemented by computer software, which may be executable by a data processor of a mobile device, such as a processor entity, or by hardware, or by a combination of software and hardware. Computer software or programs (also referred to as program products) including software routines, applets, and / or macros can be stored in any device-readable data storage medium, and they include program instructions for performing specific tasks. The computer program product may include one or more computer-executable components configured to perform the embodiments when the program is run. The one or more computer-executable components may be at least one piece of software code or a portion thereof. Additionally, it should be noted in this respect that, as Figure 4 Any box in the logical flow can represent a program step, or interconnected logic circuits, boxes and functions, or a combination of program steps and logic circuits, boxes and functions. Software can be stored on physical media such as memory chips or blocks of storage implemented within a processor, magnetic media such as hard disks or floppy disks, and optical media such as DVDs and their data variants, CDs, etc. The physical medium is a non-transient medium.
[0122] Those skilled in the art should understand that the technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments have been described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0123] The above embodiments are merely illustrative of several implementations of the present invention, and their descriptions are relatively specific and detailed, but they should not be construed as limiting the scope of the present invention. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of the present invention, and these all fall within the protection scope of the present invention. Therefore, the protection scope of the present invention should be determined by the appended claims.
Claims
1. A color correction method for a multidimensional LUT of a digital pathology scanner that supports multiple color styles and personalized preferences, characterized in that, Includes the following steps: The device RGB values obtained by scanning a standard color chart using a digital pathology scanner are then acquired, and the device RGB values are aligned with the reference chromaticity data of the standard color chart and converted to the target color space. The mapping relationship between the device's RGB values and the target color space is constructed based on Gaussian process regression, generating a base model and the corresponding prediction uncertainty; the high uncertainty region of the preset lookup table grid is locally subdivided and densified according to the prediction uncertainty, and a cascaded residual lookup table is constructed by radial basis function interpolation in combination with the residuals of each color block; the base model and the cascaded residual lookup table are superimposed to obtain the benchmark lookup table. Diagnostic weights are assigned to each color block of the standard color chart based on the color distribution features of pathological images. Multiple base lookup tables corresponding to different target color styles are trained based on the diagnostic weights. According to the input style description vector, the combined weights of the multiple base lookup tables are calculated through a preset weight prediction function to synthesize a target style lookup table. Obtain the color preference direction vector of the target doctor, and apply perturbation optimization to the lookup table grid nodes under the constraints of color difference threshold, total variation smoothing regularization term and gradient monotonicity regularization term to fine-tune the target stylized lookup table and generate a personalized correction lookup table. Perform pixel-by-pixel color correction on the target pathological image according to the personalized correction lookup table; The method of assigning diagnostic weights to each color patch of the standard color chart based on the color distribution characteristics of pathological images includes: The frequency of occurrence of the corresponding color in each color block in the statistical pathological image dataset is used as the basic weight, and the diagnostic weight of each color block is obtained by normalization calculation in combination with the prior weight of pathological staining. Among them, the prior weight of H&E staining high-frequency color blocks is higher than the prior weight of IHC staining characteristic color blocks, the prior weight of IHC staining characteristic color blocks is higher than the prior weight of grayscale color blocks, and the prior weight of grayscale color blocks is higher than the prior weight of other background color blocks. The multiple base lookup tables include a standard neutral style base lookup table, a warm color style base lookup table, and a high saturation style base lookup table; the target chromaticity value of each base lookup table is determined by a combination of standard color card reference data, the expected chromaticity value calibration results of representative pathological slides under the target style, and the exclusive base lookup table registered by the doctor for fine-tuning. Obtain the color preference direction vector of the target doctor, including: By showing doctors pathological images of color variants with applied perturbations through pairwise comparison experiments and recording their preference choices, a preference direction vector representing the direction of color shift is obtained by fitting the image in the CIELAB space. The optimization of applying perturbations to the lookup table grid nodes includes: A quadratic programming model is constructed with the objectives of minimizing the deviation between the perturbation amount of the lookup table node and the preference direction vector, total variation smoothing regularization, and gradient monotonicity regularization, and with the inequality hard constraint that the color difference after correction of each color block is not greater than the preset maximum allowable color difference. The perturbation amount of each grid node is solved by the augmented Lagrange method. The maximum allowable color difference is configured as a multi-level threshold including standard level, balanced level, and relaxed level.
2. The color correction method for a multidimensional LUT in a digital pathology scanner as described in claim 1, characterized in that, The mapping relationship between the device's RGB values and the target color space is constructed based on Gaussian process regression, including: The Matern5 / 2 kernel function is used to construct the L-axis from the device's RGB space to the CIELAB color space. a b The three-channel independent regression model optimizes the model hyperparameters by maximizing the marginal likelihood and outputs the prediction mean and the prediction variance, which represents the prediction uncertainty, at the test points. Based on the predicted uncertainty, the high uncertainty region of the preset lookup table grid is locally subdivided and refined, including: When the predicted variance is greater than the preset high threshold, the corresponding region’s grid is densified from a 33×33×33 standard grid to a 65×65×65 densified grid by recursive subdivision of an octree. A hash table is used to sparsely store the incremental nodes of the encrypted grid relative to the standard grid, and a KD-tree auxiliary index is used to perform spatial partitioning queries on the hash table during the query phase.
3. The color correction method for a multidimensional LUT in a digital pathology scanner as described in claim 1, characterized in that, A cascaded residual lookup table is constructed by combining the residuals of each color block through radial basis function interpolation, including: Using the device RGB coordinates of all training color blocks as the center point of the radial basis function, a Gaussian kernel function is used to interpolate the residual vectors of the training color blocks to construct a residual lookup table. The residual lookup table is then iteratively updated by serially superimposing it into the base model until the maximum residual is less than the preset color difference convergence threshold. When constructing the base model, the Huber loss function is used in combination with the iterative weighted least squares algorithm for robust regression, and the random sampling consensus (RANSAC) algorithm is used to remove outlier color blocks.
4. The color correction method for a multidimensional LUT in a digital pathology scanner as described in claim 1, characterized in that, The style description vector includes at least a color temperature offset dimension, a saturation gain dimension, and a contrast adjustment dimension; The weight prediction function uses the Softmax function to map the style description vector into a non-negative combined weight that sums to 1. The parameter matrix and bias term of the weight prediction function are obtained through end-to-end gradient descent optimization. The optimization process is supervised by a selected representative style pathology image set and aims to minimize the composite loss function of weighted chromatic aberration loss, total variation regularization term and monotonicity regularization term.
5. The color correction method for a multidimensional LUT in a digital pathology scanner as described in claim 1, characterized in that, It also includes drift detection and stylized drift compensation steps: The calibration color chart is periodically scanned to calculate the color difference between the RGB values of the currently scanned device and the RGB values of the reference device. When the average color difference or the number of single out-of-range color blocks reaches the preset drift threshold, color drift is determined to have occurred. Weighted residual regression is performed on each of the multiple base lookup tables to solve for the independent compensation terms of each base lookup table; Based on the compensated base lookup tables, all stylized lookup tables are synchronously reprojected and updated using the weight prediction function. For local color patches where the color difference still exceeds the preset threshold after reprojection and updating, local fixed-point correction is implemented by serially superimposing radial basis function residual compensation terms on the corresponding stylized lookup table.
6. An apparatus for implementing the digital pathology scanner multidimensional LUT color correction method according to any one of claims 1 to 5, characterized in that, include: The data acquisition and preprocessing module is used to acquire the device RGB values obtained by the digital pathology scanner scanning the standard color card, and to align the device RGB values with the reference chromaticity data of the standard color card and convert them to the target color space. The feature modeling module is used to construct the mapping relationship between the RGB values of the device and the target color space based on Gaussian process regression, generate a base model and the corresponding prediction uncertainty; according to the prediction uncertainty, the high uncertainty region of the preset lookup table grid is locally subdivided and densified, and a cascaded residual lookup table is constructed by combining the residuals of each color block through radial basis function interpolation; the base model and the cascaded residual lookup table are superimposed to obtain the benchmark lookup table. A multi-style synthesis module is used to assign diagnostic weights to each color block of the standard color chart based on the color distribution features of the pathological image, and to train multiple base lookup tables corresponding to different target color styles based on the diagnostic weights; according to the input style description vector, the combined weights of the multiple base lookup tables are calculated through a preset weight prediction function to synthesize a target style lookup table in a weighted manner. The preference fine-tuning module is used to obtain the color preference direction vector of the target doctor. Under the constraints of color difference threshold, total variation smoothing regularization term and gradient monotonicity regularization term, it applies perturbation optimization to the lookup table grid nodes to fine-tune the target stylized lookup table and generate a personalized correction lookup table. The color correction module is used to perform pixel-by-pixel color correction on the target pathological image according to the personalized correction lookup table.
7. An electronic device comprising a memory and a processor, characterized in that, The memory stores a computer program, and the processor is configured to run the computer program to perform the digital pathology scanner multidimensional LUT color correction method according to any one of claims 1 to 5.
8. A readable storage medium, characterized in that, The readable storage medium stores a computer program that, when executed by a processor, implements the digital pathology scanner multidimensional LUT color correction method as described in any one of claims 1 to 5.
Citation Information
Patent Citations
Color adjustment method and device based on hardware implementation and storage medium
CN118537276A
Pathological image color correction method and device and readable storage medium thereof
CN120634933A