An interpretable staging prediction method for small sample colorectal cancer images
By combining dual-domain collaborative variational bias field correction and multi-scale morphological gradient factor texture analysis with feature decoupling network and few-shot learning framework, the problems of brightness bias and texture noise in colorectal cancer pathological image staging prediction are solved, and high-precision interpretable staging prediction is achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- NANFANG HOSPITAL OF SOUTHERN MEDICAL UNIV
- Filing Date
- 2026-03-26
- Publication Date
- 2026-07-24
AI Technical Summary
Existing methods for predicting the staging of colorectal cancer pathological images are difficult to effectively eliminate brightness bias and texture noise in small-sample learning scenarios, resulting in image quality that does not meet the requirements of high-precision analysis. Furthermore, general enhancement methods cannot adaptively enhance local structures, affecting the model's generalization ability and prediction reliability.
By employing dual-domain collaborative variational bias field correction and multi-scale morphological gradient factor texture analysis, a structural consistency adjustment coefficient matrix is generated for differential enhancement and global color remapping. Combined with a pre-trained feature decoupling network and few-shot learning framework, interpretable staging prediction results are generated.
It effectively eliminates brightness bias and texture noise, enhances the local structural features of the image, improves the discriminativeness and robustness of image features under small sample conditions, and improves the accuracy and interpretability of stage prediction.
Smart Images

Figure CN122023388B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of medical image analysis technology, and in particular to an interpretable staging prediction method for small sample colorectal cancer images. Background Technology
[0002] Existing methods for predicting colorectal cancer pathological image staging largely depend on the quality of image preprocessing. During the digitization of pathological sections, factors such as differences in staining concentration, uneven section thickness, and scanning illumination often introduce non-uniform brightness bias fields. These artifacts can mask the true morphological features of the tissue, interfering with subsequent feature extraction and classification. Conventional preprocessing techniques often employ single-domain correction strategies, such as histogram matching or homomorphic filtering in the spatial domain, or background estimation and subtraction in the transform domain. These methods often struggle to simultaneously and effectively eliminate the effects of large-scale smooth brightness gradients and local high-frequency noise. The corrected image may still retain artifacts or lose important texture details, resulting in image quality that fails to meet the requirements of high-precision analysis.
[0003] In the feature enhancement and extraction stages, existing methods typically employ uniform image enhancement algorithms or fixed convolutional neural network structures. However, the histological features corresponding to different stages of colorectal cancer vary in texture, contrast, and spatial distribution. General enhancement methods cannot adaptively enhance these discriminative local structures, potentially over-smoothing key regions or over-enhancing irrelevant backgrounds. This is particularly disadvantageous in few-shot learning scenarios, as limited labeled data requires highly refined and discriminative feature representations. Any noise introduced by improper preprocessing or inaccurate feature enhancement will reduce the model's generalization ability and prediction reliability. Summary of the Invention
[0004] The purpose of this invention is to overcome the shortcomings of existing technologies and propose an interpretable staging prediction method for small sample colorectal cancer images.
[0005] To achieve the above objectives, the present invention employs the following technical solution: an interpretable staging prediction method for small sample colorectal cancer images, comprising: The raw image data of colorectal tissue pathology images were acquired, and the raw image data were subjected to dual-domain synergistic variational bias field correction to obtain the corrected pathology images. The corrected pathological images are subjected to multi-scale morphological gradient factor texture analysis to generate a structural consistency adjustment coefficient matrix. Based on the structural consistency adjustment coefficient matrix, the corrected pathological images are subjected to differential enhancement processing to obtain region-specific optimized images; A combination of global color remapping and local brightness optimization is performed on the region-specific optimized image to obtain a visually enhanced image to be analyzed. The visually enhanced image to be analyzed is input into a pre-trained feature decoupling network to generate an image feature encoding vector; The image feature encoding vector is input into the few-shot learning framework and combined with labeled samples in the support set to generate a task-adaptive feature representation. Based on task-adaptive feature representation, a stage prediction result and corresponding visual interpretation map are generated through an interpretable classifier.
[0006] As a further aspect of the present invention, the original image data is subjected to dual-domain collaborative variational bias field correction processing to obtain a corrected pathological image, including: The original image data is decomposed into low-frequency bias field components and high-frequency detail layer components, wherein the low-frequency bias field components are extracted by low-pass filtering. The L2 norm constraint is applied to the low-frequency bias field component to suppress the global intensity variation of the low-frequency bias field component; at the same time, the total variation norm constraint is applied to the high-frequency detail layer component to preserve the local structural information of the high-frequency detail layer component. The gradient adaptive detail preservation weights are calculated based on the gradient magnitudes of the high-frequency detail layer components. The gradient adaptive detail preservation weights are positively correlated with the gradient magnitudes. A co-optimization objective function containing norm constraints and gradient adaptive detail-preserving weights is constructed. The norm constraints include L2 norm constraints on the low-frequency bias field components and total variation norm constraints on the high-frequency detail layer components. The co-optimization objective function is solved by an iterative optimization algorithm to obtain the optimized low-frequency bias field components and the optimized high-frequency detail layer components. The optimized low-frequency bias field component and the optimized high-frequency detail layer component are weighted and fused to obtain a corrected pathological image with uniform illumination and enhanced details.
[0007] As a further aspect of the present invention, the corrected pathological image is subjected to multi-scale morphological gradient factor texture analysis processing to generate a structural consistency adjustment coefficient matrix, including: Morphological gradient operations were performed on the corrected pathological images using multiple structuring elements of different sizes, and texture distribution feature maps and edge gradient feature maps were obtained at each scale. Spatially align and stack the texture distribution feature maps of all scales to form a multi-scale texture distribution feature tensor; Spatially align and stack the edge gradient feature maps of all scales to form a multi-scale edge gradient feature tensor. The multi-scale texture distribution feature tensor and the multi-scale edge gradient feature tensor are jointly input into the nonlinear mapping module, which is composed of a multi-layer fully connected network. The nonlinear mapping module maps the multi-scale texture distribution feature tensor and the multi-scale edge gradient feature tensor to the same feature representation space and outputs a coefficient matrix with the same spatial size as the input image, which serves as the structural consistency adjustment coefficient matrix. The value at each position in the matrix represents the structural consistency strength of the region to which the pixel belongs.
[0008] As a further aspect of the present invention, based on the structural consistency adjustment coefficient matrix, the corrected pathological image is subjected to differential enhancement processing to obtain a region-specific optimized image, including: Each value in the structural consistency adjustment coefficient matrix is compared with a preset texture threshold. If the value is greater than the texture threshold, the corresponding position is determined to be a textured region; otherwise, it is determined to be a non-textured region. For texture regions, a low-pass filter is used to smooth the corresponding regions of the corrected pathological image to obtain the base smoothed image of the texture region. The high-frequency difference image between the corrected pathological image and the base smoothed image is calculated. The high-frequency difference image is multiplied by the weighting coefficients derived from the structural consistency adjustment coefficient matrix and then superimposed back onto the base smoothed image to complete the adaptive sharpening of the texture region. For non-texture regions, a Gaussian filter is used to perform preliminary smoothing on the corresponding regions of the corrected pathological image, and a bilateral filter is used to perform edge-preserving smoothing on the same region. The results of the preliminary smoothing and the edge-preserving smoothing are then mixed according to a preset ratio to complete the blending smoothing of non-texture regions. The textured areas that have undergone adaptive sharpening are stitched together with the non-texture areas that have undergone blending and smoothing according to their original spatial positions to generate a region-specific optimized image.
[0009] As a further aspect of the present invention, a combination of global color remapping and local brightness optimization is performed on the region-specific optimized image to obtain a visually enhanced image to be analyzed, including: The image is optimized in a region-specific manner by converting it from the original color space to a color space. In the color space, the global statistical characteristics of the luminance channel, the first chromaticity channel and the second chromaticity channel are calculated respectively. Based on global statistical characteristics, mapping functions are constructed for the luminance channel, the first chroma channel, and the second chroma channel. The mapping functions map the original pixel values of each channel to the target distribution range. The mapping function is executed independently for each channel to obtain a color-balanced intermediate image. The calculation region optimizes the local brightness mean of each pixel in the image. Based on the difference between the local brightness mean and the preset target brightness, an exponential decay function or a gain function is constructed. The exponential decay function is used to reduce the brightness of overly bright areas, and the gain function is used to increase the brightness of overly dark areas. When applying an exponential decay function or gain function, a boundary distance weighting factor is introduced to ensure that brightness adjustment transitions smoothly at the region boundary. The brightness channel, after brightness adjustment, is merged with the mapped color channel and converted back to the original color space to output the visually enhanced image to be analyzed.
[0010] As a further aspect of the present invention, the visually enhanced image to be analyzed is input into a pre-trained feature decoupling network to generate an image feature encoding vector, including: The pre-trained feature decoupling network contains a shared encoder and multiple parallel decoupling branches. The shared encoder consists of alternating convolutional and pooling layers. The visually enhanced image to be analyzed is first processed by a shared encoder to extract a shared feature map; The shared feature map is simultaneously fed into the morphological feature decoupling branch, the texture feature decoupling branch, and the color feature decoupling branch. The morphological feature decoupling branch focuses on extracting features related to glandular structure and cell nucleus morphology, the texture feature decoupling branch focuses on extracting features related to cell arrangement and matrix texture, and the color feature decoupling branch focuses on extracting features related to staining depth and color distribution. Each decoupling branch outputs a decoupling feature vector. The feature vectors output by all decoupling branches are concatenated and fused, and then dimensionality reduction and integration are performed through a fully connected layer. Finally, a fixed-dimensional vector is output as the image feature encoding vector.
[0011] As a further aspect of the present invention, the image feature encoding vector is input into a few-shot learning framework, and combined with labeled samples in the support set, a task-adaptive feature representation is generated, including: The few-shot learning framework employs a metric-based learning method, with the support set containing a small number of labeled sample images from multiple different phases and their corresponding phase labels. Using a pre-trained feature decoupling network, the sample feature encoding vector of each labeled sample image in the support set is extracted. A task feature prototype is constructed, which is obtained by calculating the mean value of the feature encoding vectors of all samples belonging to the same period in the support set. Calculate the feature distance between the image feature encoding vector and the task feature prototype for each stage; Using an attention mechanism, weights are assigned to the prototypes of task features for each phase based on feature distance, with prototypes that are closer in distance having higher weights. All weighted task feature prototypes are aggregated to generate a task context-aware feature representation, which is the task-adaptive feature expression.
[0012] As a further aspect of the present invention, based on task-adaptive feature representation, a staged prediction result and corresponding visual interpretation map are generated through an interpretable classifier, including: The interpretable classifier includes a fully connected classification layer and a gradient backpropagation interpretation module; The task-adaptive feature representation is input into the fully connected classification layer, and after nonlinear transformation, the predicted probability value of each stage category is output. The stage category corresponding to the highest predicted probability value is taken as the stage prediction result. After obtaining the prediction result in the fully connected classification layer, the gradient of the task-adapted feature representation with respect to the final predicted category is calculated through the gradient backpropagation interpretation module. The calculated gradient is mapped back to the original image space. Specifically, the gradient value is backpropagated along the decoding path of the pre-trained feature decoupling network until it reaches the pixel space of the visually enhanced image to be analyzed. A heatmap with the same size as the input image is obtained in pixel space. The intensity value of each pixel in the heatmap represents the degree of contribution of the pixel to the final prediction result. This heatmap is the visual interpretation map.
[0013] As a further aspect of the present invention, the process of calculating the gradient adaptive detail-preserving weights based on the gradient magnitudes of the high-frequency detail layer components includes: In the high-frequency detail layer components, the Sobel operator is used to calculate the gradient components of each pixel in the horizontal and vertical directions; Calculate the gradient magnitude of each pixel based on the horizontal and vertical gradient components. The gradient magnitude is normalized so that its value ranges from zero to one. The normalized gradient magnitude is input into a monotonically increasing transformation function. The output value of the transformation function is the gradient adaptive detail preservation weight of the pixel. The larger the gradient magnitude of the pixel, the higher its corresponding gradient adaptive detail preservation weight, so as to better preserve the edge and detail information of the corresponding pixel position in subsequent fusion.
[0014] As a further aspect of the present invention, the process of determining how to multiply the high-frequency difference image by weighting coefficients derived from the structural consistency adjustment coefficient matrix and then superimpose it back onto the base smooth image includes: The structural consistency adjustment coefficient matrix is normalized so that the values in the matrix are between zero and one. Set a base sharpening intensity factor and a maximum sharpening intensity factor; For each pixel location in the texture region, the normalized structural consistency adjustment coefficient value of the corresponding location is multiplied by the difference between the maximum sharpening intensity coefficient and the base sharpening intensity coefficient, and then added to the base sharpening intensity coefficient to obtain the final weighting coefficient for the corresponding pixel location. The weighting coefficient is used to control the intensity of the high-frequency difference image when it is superimposed on the base smooth image at the corresponding pixel position. The higher the coefficient, the stronger the sharpening effect.
[0015] Compared with the prior art, the advantages and positive effects of the present invention are as follows: A dual-domain collaborative variational bias field correction method is employed, which collaboratively optimizes the brightness field modeling in the spatial domain with the frequency or wavelet domain constraints in the transform domain through a unified variational energy function. This method not only accurately estimates and corrects smoothly varying brightness shifts in the image but also effectively suppresses block artifacts or texture distortions that may occur during the correction process through transform domain constraints. Unlike conventional single-domain correction, this technique can more thoroughly eliminate non-uniformity artifacts introduced by the staining and imaging systems, restoring pathological images that are closer to the ideal staining state. This results in a more realistic and consistent grayscale and contrast distribution of biological structures such as cell nuclei and gland edges in the image, providing a data foundation with lower noise and higher fidelity for all subsequent analysis steps.
[0016] A texture parsing approach based on multi-scale morphological gradient factors is introduced to generate a structural consistency adjustment coefficient matrix, which quantifies the texture stability and structural saliency of local image regions. This matrix is then used to differentially enhance the corrected pathological images, making the enhancement operation no longer globally uniform but adaptively adjusted based on the morphological characteristics of local textures. In areas with clear glandular structures and sharp edges, the enhancement level is increased to highlight their morphological features; in areas with homogeneous textures or blurred structures, the enhancement is reduced to avoid introducing noise or over-enhancing irrelevant information. This data-driven enhancement strategy, bound to local structural characteristics, can automatically focus on and enhance the microscopic morphological features most relevant to cancer staging, effectively improving the discriminativeness and robustness of the extracted image features under small sample conditions. Attached Figure Description
[0017] Figure 1 This is a flowchart of the interpretable staging prediction method for small sample colorectal cancer images according to the present invention; Figure 2 A flowchart for dual-domain collaborative variational bias field correction processing; Figure 3 A flowchart for multi-scale morphological gradient factor texture parsing processing; Figure 4 A graph showing the change in the similarity of feature prototypes during the small-sample learning phase of colorectal cancer. Figure 5 This is a graph showing the performance changes of multiple indicators for a small-sample colorectal cancer staging prediction model. Detailed Implementation
[0018] To make the objectives, technical solutions, and advantages of this invention clearer, the invention will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the invention.
[0019] In the description of this invention, it should be understood that the terms "length," "width," "upper," "lower," "front," "rear," "left," "right," "vertical," "horizontal," "top," "bottom," "inner," and "outer," etc., indicating orientation or positional relationships, are based on the orientation or positional relationships shown in the accompanying drawings and are only for the convenience of describing the invention and simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, or be constructed and operated in a specific orientation, and therefore should not be construed as a limitation of the invention. Furthermore, in the description of this invention, "a plurality of" means two or more, unless otherwise explicitly specified.
[0020] See Figure 1 The original image data of colorectal tissue pathology images were acquired, and dual-domain collaborative variational bias field correction was performed on the original image data to obtain corrected pathology images with uniform illumination and clear details. Multi-scale morphological gradient factor texture analysis was then performed on the corrected pathology images to generate a structure consistency adjustment coefficient matrix that quantifies the strength of local structural consistency in the image. Based on the structure consistency adjustment coefficient matrix, differential enhancement processing was performed on textured and non-textured regions of the corrected pathology images, including adaptive sharpening of textured regions and blending smoothing of non-textured regions, thus obtaining region-specific optimized images. A combination of global color remapping and local brightness optimization was then performed on the region-specific optimized images to adjust the color distribution and local brightness of the images, resulting in visually enhanced images for analysis. The visually enhanced images for analysis were then input into a pre-trained feature decoupling network. This network extracts morphological, texture, and color features through multiple parallel decoupling branches, ultimately generating a fused image feature encoding vector. In the prediction phase, the image feature encoding vector of the image to be analyzed is input into a few-shot learning framework. This framework, combined with a small number of labeled samples from the support set, calculates a task feature prototype and uses an attention mechanism to generate a task-adaptive feature representation relevant to the current task context. Finally, the task-adaptive feature representation is input into an interpretable classifier, which generates phased prediction results and, through a gradient backpropagation mechanism, generates a visual interpretation map corresponding to the prediction results to indicate regions in the image that significantly contribute to the prediction.
[0021] See Figure 2 In one embodiment of the present invention, a dual-domain co-variable bias field correction is performed on the original image data of a colorectal tissue pathology image. The original image data may exhibit local brightness variations due to uneven illumination introduced during the scanning process. The dual-domain co-variable bias field correction aims to eliminate such unevenness and enhance details. The implementation process follows specific steps. The original image data is passed through a set low-pass filter at a cutoff frequency to separate the low-frequency bias field component carrying slowly changing illumination information and the high-frequency detail layer component containing tissue cell details. The L2 norm constraint is applied to the low-frequency bias field component to suppress its overall intensity fluctuation, while the total variation norm constraint is applied to the high-frequency detail layer component to protect the edge and texture structure while removing noise.
[0022] In some embodiments, the process of calculating the gradient adaptive detail preservation weight based on the gradient magnitude of the high-frequency detail layer components is specifically elaborated as follows: For the high-frequency detail layer components, the Sobel operator is used to calculate the gradient components of each pixel in the horizontal and vertical directions. The gradient magnitude of each pixel is calculated based on the horizontal and vertical gradient components. The gradient magnitudes of all pixels are normalized to map the values to between zero and one. The normalized gradient magnitudes are then input into a preset monotonically increasing transformation function. The output value of the transformation function is the gradient adaptive detail preservation weight of the corresponding pixel. Pixels with larger gradient magnitudes have higher gradient adaptive detail preservation weights. One formula for the transformation function is: ; in: This indicates gradient-adaptive detail-preserving weights. This represents the normalized gradient magnitude. This represents a preset parameter that controls the growth rate of the transformation function. The preset parameter indicates the center position of the transformation function.
[0023] A collaborative optimization objective function is constructed, which includes an L2 norm constraint term for the low-frequency bias field component, a total variational norm constraint term for the high-frequency detail layer component, and a detail retention term consisting of gradient adaptive detail retention weights. The detail retention term is a weighted sum of the gradient adaptive detail retention weights and the magnitudes of the high-frequency detail layer components, aiming to assign higher retention weights to regions with large gradient magnitudes. The collaborative optimization objective function is solved using an iterative optimization algorithm, such as the alternating direction multiplier method. After multiple iterations, the optimized low-frequency bias field component and the optimized high-frequency detail layer component are obtained. The intensity distribution of the optimized low-frequency bias field component is flatter.
[0024] It is understandable that the optimized low-frequency bias field component and the optimized high-frequency detail layer component are weighted and fused. During the weighted fusion process, the fusion weight of each pixel position is determined by the gradient adaptive detail preservation weight pre-calculated for that position. For positions with a high gradient adaptive detail preservation weight, the optimized high-frequency detail layer component has a higher proportion in the fusion result, ultimately resulting in a corrected pathological image with uniform illumination and enhanced detail contours. In the example scenario, the gland edges that were originally blurred due to shadows in the original image become clearly distinguishable in the corrected pathological image. Optionally, the low-pass filter can be a Gaussian low-pass filter or a mean filter, with its specific parameters pre-set according to the typical structural size of the pathological image. The termination condition of the iterative optimization algorithm can be set to the change in the value of the co-optimized objective function being less than a preset threshold in two adjacent iterations.
[0025] See Figure 3 In one embodiment of the present invention, the corrected pathological image obtained by completing the dual-domain cooperative variational bias field correction process is subjected to multi-scale morphological gradient factor texture analysis processing. The purpose of the processing is to quantify the structural consistency intensity of local regions of the image and generate a structural consistency adjustment coefficient matrix. The processing involves multi-scale feature extraction and nonlinear mapping. Three square structuring elements of different sizes are used to perform morphological gradient operations on the corrected pathological image. The side lengths of the three structuring elements are set to three different pixel values. At each selected scale, the morphological gradient operation produces two results simultaneously: one is a texture distribution feature map reflecting the density of texture distribution at that scale, and the other is an edge gradient feature map highlighting the edge gradient intensity at that scale.
[0026] In some embodiments, the texture distribution feature maps calculated at all scales are spatially aligned and stacked. Spatial alignment ensures that the feature maps from different scales correspond completely in pixel coordinates. Feature stacking stitches multiple two-dimensional feature maps along a new dimension to form a three-dimensional multi-scale texture distribution feature tensor. Similarly, the edge gradient feature maps calculated at all scales are spatially aligned and stacked to form a three-dimensional multi-scale edge gradient feature tensor. The multi-scale texture distribution feature tensor and the multi-scale edge gradient feature tensor are used together as inputs to the subsequent nonlinear mapping module.
[0027] It can be understood that the nonlinear mapping module consists of multiple fully connected layers. The multi-scale texture distribution feature tensor and the multi-scale edge gradient feature tensor are first flattened into feature vectors. The flattened feature vectors are then fed into the nonlinear mapping module. Through its internal multiple fully connected layers and activation functions, the nonlinear mapping module maps the information contained in the multi-scale texture distribution feature tensor and the multi-scale edge gradient feature tensor to a unified feature representation space, and finally outputs a two-dimensional matrix. This two-dimensional matrix is consistent with the input corrected pathological image in terms of spatial size. The value at each position in the matrix represents the structural consistency strength of the local region to which the corresponding pixel belongs. This matrix is the structural consistency adjustment coefficient matrix. The internal mapping process of the nonlinear mapping module can be represented by an exemplary functional relationship as follows: ; in: This represents the output structure consistency adjustment coefficient matrix. This represents the Sigmoid activation function. This represents the weight matrix of a fully connected layer in the nonlinear mapping module, and Concat represents the concatenation operation. This represents the flattened multi-scale texture distribution feature tensor vector. This represents the flattened multi-scale edge gradient feature tensor vector. This represents the corresponding bias vector.
[0028] Optionally, the structural elements are not limited to square shapes; disc-shaped or cross-shaped structural elements can be used. The specific dimensions of structural elements at different scales can be preset according to the size range of typical texture structures in pathological images. The number of fully connected layers, the number of neurons in each layer, and the type of activation function in the nonlinear mapping module can all be adjusted and configured.
[0029] In some embodiments, the texture analysis processing of multi-scale morphological gradient factors, when applied to a colorectal cancer pathological image region containing glands and stroma, shows that at smaller scale structuring elements, gland edges generate strong edge gradient features while texture distribution features are weak. At larger scale structuring elements, the complex texture of the stroma region generates significant texture distribution features. The nonlinear mapping module fuses this multi-scale information, ultimately resulting in higher coefficient values for gland contour edges and homogenized regions in the structural consistency adjustment coefficient matrix, while regions with messy textures or background regions obtain lower coefficient values. Optionally, before performing morphological gradient calculations, the corrected pathological image can be preprocessed with normalization to ensure consistency in intensity range between different images.
[0030] In one embodiment of the present invention, differential enhancement processing is performed on the corrected pathological image according to the structural consistency adjustment coefficient matrix to obtain a region-specific optimized image. The core of this process is to divide the image into regions and apply different enhancement strategies according to the structural consistency adjustment coefficient matrix. Each value in the structural consistency adjustment coefficient matrix is compared with a preset texture threshold. The texture threshold is a constant value between zero and one. If the value at a certain position in the matrix is greater than the texture threshold, the image pixel corresponding to that position is determined to be a texture region. If the value is less than or equal to the texture threshold, it is determined to be a non-texture region.
[0031] In some embodiments, for a set of pixels identified as texture regions, a mean filter or a Gaussian low-pass filter is used to smooth the corresponding region in the corrected pathological image to obtain a base smoothed image of the texture region. The difference between the corrected pathological image and the base smoothed image at the corresponding pixel position in the texture region is calculated to form a high-frequency difference image. The high-frequency difference image mainly contains the edge and detail information of the texture region. The high-frequency difference image is multiplied by a weighting coefficient derived from the structure consistency adjustment coefficient matrix and then superimposed back onto the base smoothed image to complete the adaptive sharpening of the texture region. The process of determining the weighting coefficient includes: normalizing the structure consistency adjustment coefficient matrix so that all values in the matrix are mapped to the range of zero to one; setting a base sharpening intensity coefficient and a maximum sharpening intensity coefficient; for each pixel position in the texture region, the normalized structure consistency adjustment coefficient value at that position is multiplied by the difference between the maximum sharpening intensity coefficient and the base sharpening intensity coefficient, and then added to the base sharpening intensity coefficient to obtain the final weighting coefficient for that pixel position. This relationship formula is expressed as: ; in: This represents the final weighting coefficient at pixel coordinates (x, y). Indicates the base sharpening intensity coefficient. This represents the normalized structural consistency adjustment coefficient value at coordinates (x, y). This represents the maximum sharpening intensity coefficient. The weighting coefficient is used to control the intensity of the high-frequency difference image when it is superimposed on the base smooth image at the corresponding pixel position. The higher the weighting coefficient, the stronger the sharpening effect.
[0032] It is understandable that for a set of pixels identified as non-texture regions, a Gaussian filter with a large standard deviation is used to perform preliminary smoothing on the corresponding regions in the corrected pathological image. This preliminary smoothing aims to eliminate noise and minor intensity fluctuations. Simultaneously, a bilateral filter is used to perform edge-preserving smoothing on the same non-texture region. The bilateral filter can better preserve potentially weak boundaries between regions while smoothing. The results of the preliminary smoothing and edge-preserving smoothing are mixed according to a preset ratio, for example, a weighted sum of the two at a 7:3 ratio, thus completing the blended smoothing of the non-texture region. This blended smoothing aims to obtain a more uniform regional background while avoiding boundary blurring. The texture region that has undergone adaptive sharpening and the non-texture region that has undergone blended smoothing are then stitched and merged according to their spatial positions in the original image, directly overwriting the corresponding pixel positions. Finally, a region-specific optimized image is generated. In the example scenario, an image containing clear glands and complex matrix might have its gland edges identified as texture regions and sharpened to make them more prominent, while the interior of the glands or homogeneous matrix regions might be identified as non-texture regions and smoothed to make them more uniform.
[0033] Optionally, the specific value of the texture threshold can be determined by statistical analysis of the structural consistency adjustment coefficient matrix of a batch of sample images. The type and kernel size of the low-pass filter used to generate the base smoothed image can be adjusted according to the texture coarseness. The parameters and blending ratios of the two filters used for blending and smoothing non-textured regions can be adjusted according to the image content.
[0034] In one embodiment of the present invention, a combination of global color remapping and local brightness optimization is performed on a region-specific optimized image to obtain a visually enhanced image to be analyzed. The implementation process includes a series of operations from color space conversion, statistical characteristic calculation to independent channel mapping and local adjustment. The region-specific optimized image is converted from the original RGB color space to the Lab color space. The Lab color space consists of a luminance channel L, a first chrominance channel a, and a second chrominance channel b. In the Lab color space, the global statistical characteristics of the luminance channel L, the first chrominance channel a, and the second chrominance channel b are calculated respectively. The global statistical characteristics include the mean and standard deviation of all pixel values of each channel.
[0035] In some embodiments, based on the calculated global statistical characteristics, nonlinear mapping functions are constructed for the luminance channel L, the first chroma channel a, and the second chroma channel b, respectively. The mapping functions aim to map the original pixel value distribution of each channel to a preset target distribution interval. The target distribution interval is defined by the target mean and the target standard deviation. For the luminance channel L, an exemplary mapping function implementation formula is shown below: ; in: This represents the output pixel value of the luminance channel L after mapping. This represents the target mean value of the luminance channel L. This represents the raw input pixel value of the luminance channel L. This represents the mean of the original input for the luminance channel L. This represents the target standard deviation of the luminance channel L. The standard deviation of the original input for the luminance channel L is represented by the standard deviation of ...
[0036] Table 1: Comparison of Statistical Characteristics Before and After Mapping of Each Channel in Lab Color Space
[0037] Brightness L 65.3 18.7 70.0 22.0 Chromaticity a 132.5 15.2 128.0 18.0 Color b 115.8 12.4 120.0 15.0 It is understandable that after completing global color remapping, local brightness optimization is performed. The average brightness of each pixel in the image is calculated and optimized in a targeted manner within its local neighborhood. The local neighborhood is defined as a square window with an odd side length centered on the pixel. Based on the difference between the calculated average local brightness and a preset target brightness value, an adjustment function is constructed. When the average local brightness is higher than the target brightness value, an exponential decay function is used to reduce the brightness of overly bright areas. When the average local brightness is lower than the target brightness value, a gain function is used to increase the brightness of overly dark areas. When applying the decay function or gain function, a boundary distance weighting factor is introduced. The boundary distance weighting factor is calculated based on the distance from the pixel to the boundary of its homogeneous region, ensuring that the brightness adjustment can smoothly transition at the region boundary without producing abrupt brightness steps. The brightness channel L after local brightness adjustment is merged with the first chroma channel a and the second chroma channel b after global mapping, and converted back to the original RGB color space to output the visually enhanced image to be analyzed.
[0038] The visually enhanced image to be analyzed is input into a pre-trained feature decoupling network to generate an image feature encoding vector. The pre-trained feature decoupling network contains a shared encoder and three parallel decoupling branches. The shared encoder consists of five alternating convolutional layers and four pooling layers. The convolutional layers are used for feature extraction, and the pooling layers are used for downsampling. The visually enhanced image to be analyzed first passes through the shared encoder to extract a shared feature map. Optionally, the target mean and target standard deviation in the Lab color space can be set based on statistical priors from large-scale pathological image datasets. The size of the neighborhood window used to calculate the local brightness mean is typically set to a size comparable to the cell nucleus size.
[0039] See Figure 4 This is a curve showing the change in the similarity between feature prototypes during the small-sample learning stage of colorectal cancer. It illustrates the trend of similarity between feature encodings and corresponding stage feature prototypes for colorectal cancer samples at different stages as the number of labeled samples in the small-sample support set increases. The similarity for all stages increases with the increase in the number of labeled samples, indicating that increasing the number of labeled samples significantly improves the feature matching ability of the small-sample learning framework. The similarity increases most rapidly when the number of samples increases from 5 to 15; the growth rate slows significantly after the number of samples exceeds 20. This suggests that in small-sample scenarios, the size of the support set does not need to be excessively expanded; 15-20 labeled samples are sufficient to achieve a relatively stable feature matching effect. The relative positions of the curves for each stage remain unchanged, indicating that the model has a consistent ability to distinguish features at different stages in small-sample learning, with the feature recognition accuracy of early-stage tumors consistently higher than that of late-stage tumors. This result verifies the feasibility of small-sample learning in colorectal cancer staging prediction. Even with only a small number of labeled samples, it is possible to establish discriminative feature prototypes, especially for the more reliable identification of early-stage tumors.
[0040] In one embodiment of the present invention, the image feature encoding vector is input into a few-shot learning framework to generate a task-adaptive feature representation. The few-shot learning framework adopts a metric-based learning method. The support set contains a small number of labeled sample images from multiple different periods and their corresponding period labels. A pre-trained feature decoupling network is used to extract the sample feature encoding vector of each labeled sample image in the support set. For each labeled sample image in the support set, it is input into the pre-trained feature decoupling network. After processing by a shared encoder and multiple parallel decoupling branches, a fixed-dimensional sample feature encoding vector is finally output.
[0041] In some embodiments, a task feature prototype is constructed by calculating the arithmetic mean of the feature encoding vectors of all samples belonging to the same period in the support set. Each period corresponds to a task feature prototype. The feature distance between the image feature encoding vector of the image to be analyzed and the task feature prototype of each period is calculated using Euclidean distance. An attention mechanism is then used to assign attention weights to the task feature prototypes of each period based on the calculated feature distances. Task feature prototypes with closer feature distances are assigned higher attention weights. The assignment of attention weights is implemented through a softmax function, with the specific relationship formula as follows: ; in: This represents the attention weight assigned to the task feature prototype corresponding to the j-th phase. This represents the Euclidean distance between the image feature encoding vector and the task feature prototype for the j-th stage. This indicates the total number of period categories included in the support set. The natural exponential function aggregates all weighted task feature prototypes to generate a task context-aware feature representation. The aggregation operation calculates the weighted sum of all task feature prototypes. This task context-aware feature representation is the task-adaptive feature expression.
[0042] It is understandable that the task-adaptive feature representation generates stage prediction results and corresponding visual interpretation maps through an interpretable classifier. The interpretable classifier includes a fully connected classification layer and a gradient backpropagation interpretation module. The task-adaptive feature representation is input into the fully connected classification layer, which outputs the predicted probability value of each stage category after a nonlinear transformation. The nonlinear transformation includes fully connected operations and a softmax activation function. The stage category corresponding to the highest predicted probability value is taken as the final stage prediction result. After the prediction result is obtained from the fully connected classification layer, the gradient of the task-adaptive feature representation with respect to the final predicted category is calculated through the gradient backpropagation interpretation module. The gradient calculation is completed through the backpropagation algorithm. The calculated gradient value is backpropagated along the decoding path of the pre-trained feature decoupling network. The decoding path refers to the reverse data flow path starting from the input of the fully connected classification layer, passing through the feature concatenation layer, each decoupling branch, the shared encoder, and back to the original input image space, until it propagates back to the pixel space of the visually enhanced image to be analyzed.
[0043] In some embodiments, a heatmap with the same size as the input image is obtained in the pixel space. Each pixel location in the heatmap has an intensity value, which is determined by the gradient magnitude propagating to that pixel location, representing the degree of contribution of that pixel to the final prediction result. This heatmap is the visual interpretation map. Optionally, the calculation method of feature distance is not limited to Euclidean distance; negative cosine similarity or other distance metrics can be used. The temperature coefficient of the softmax function in the attention mechanism can be adjusted to control the concentration of the weight distribution. During the backpropagation process, the gradient backpropagation interpretation module can aggregate the gradients of intermediate layers using a gradient-weighted class activation mapping method. Optionally, the hidden layer dimension of the fully connected classification layer and the number of categories in the final output can be set according to the number of categories in the specific task. After the gradient is backpropagated to the input space, the generated heatmap can be normalized and pseudo-color mapped for easy visualization. The backpropagation process can calculate only the gradients of the first few layers that contribute the most to the final predicted category to balance the clarity of the interpretation map and computational efficiency.
[0044] See Figure 5This is a performance curve of a small-sample colorectal cancer staging prediction model, showing the dynamic changes of three key performance indicators as the support set sample size increases from 1 to 10. All three indicators show an upward trend with the increase in support set sample size, indicating that increasing labeled samples can simultaneously improve the model's predictive ability, confidence, and interpretability, validating the effectiveness of the small-sample learning framework. The confidence score is consistently higher than the prediction accuracy, reflecting that the model's confidence in its own prediction results is slightly higher than the actual accuracy, which is a common phenomenon in small-sample scenarios. This suggests that the confidence score can be further calibrated by introducing regularization or increasing heterogeneous samples. The interpretability score shows the most stable growth trend, and the growth rate accelerates after the sample size exceeds 8, indicating that when the support set sample size is sufficient, the model's visual interpretation module can more accurately locate the contribution of pathological regions, which is crucial for clinicians to understand the prediction results. When the support set sample size increased from 8 to 9, all three indicators showed a significant jump, and then the growth rate slowed down, suggesting that in this task, the model performance was close to saturation when the support set sample size was around 9, and the marginal benefit of further increasing the sample size was limited.
[0045] The above are merely preferred embodiments of the present invention and are not intended to limit the present invention in any other way. Any person skilled in the art may make changes or modifications to the above-disclosed technical content to create equivalent embodiments that can be applied to other fields. However, any simple modifications, equivalent changes, and modifications made to the above embodiments based on the technical essence of the present invention without departing from the scope of the present invention shall still fall within the protection scope of the present invention.
Claims
1. A method for predicting the interpretable staging of colorectal cancer images in a small sample, characterized in that, The method includes: Obtain raw image data of colorectal tissue pathology images. The original image data is decomposed into low-frequency bias field components and high-frequency detail layer components. The L2 norm constraint is applied to the low-frequency bias field component to suppress the global intensity variation of the low-frequency bias field component; at the same time, the total variation norm constraint is applied to the high-frequency detail layer component to preserve the local structural information of the high-frequency detail layer component. The gradient adaptive detail preservation weights are calculated based on the gradient magnitudes of the high-frequency detail layer components. The gradient adaptive detail preservation weights are positively correlated with the gradient magnitudes. A co-optimization objective function containing norm constraints and gradient adaptive detail-preserving weights is constructed. The norm constraints include L2 norm constraints on the low-frequency bias field components and total variation norm constraints on the high-frequency detail layer components. The co-optimization objective function is solved by an iterative optimization algorithm to obtain the optimized low-frequency bias field components and high-frequency detail layer components. The optimized low-frequency bias field component and high-frequency detail layer component are weighted and fused to obtain a corrected pathological image with uniform illumination and enhanced details. Morphological gradient operations were performed on the corrected pathological images using multiple structuring elements of different sizes, and texture distribution feature maps and edge gradient feature maps were obtained at each scale. Spatially align and stack the texture distribution feature maps and edge gradient feature maps of all scales to form corresponding multi-scale texture distribution feature tensors and multi-scale edge gradient feature tensors. The multi-scale texture distribution feature tensor and the multi-scale edge gradient feature tensor are mapped to the same feature representation space through the nonlinear mapping module, and a coefficient matrix with the same spatial size as the corrected pathological image is output as the structural consistency adjustment coefficient matrix. The value of each position in the matrix represents the structural consistency strength of the region to which the pixel belongs. Each value in the structural consistency adjustment coefficient matrix is compared with a preset texture threshold. If the value is greater than the texture threshold, the corresponding position is determined to be a textured region; otherwise, it is determined to be a non-textured region. For texture regions, a low-pass filter is used to smooth the corresponding regions of the corrected pathological image to obtain the base smoothed image of the texture region. The high-frequency difference image between the corrected pathological image and the base smoothed image is calculated. The high-frequency difference image is multiplied by the weighting coefficients derived from the structural consistency adjustment coefficient matrix and then superimposed back onto the base smoothed image to complete the adaptive sharpening of the texture region. For non-texture regions, a Gaussian filter is used to perform preliminary smoothing on the corresponding regions of the corrected pathological image, and a bilateral filter is used to perform edge-preserving smoothing on the same region. The results of the preliminary smoothing and the edge-preserving smoothing are then mixed according to a preset ratio to complete the blending smoothing of non-texture regions. The textured areas that have undergone adaptive sharpening and the non-texture areas that have undergone blending and smoothing are stitched together according to their original spatial positions to generate a region-specific optimized image; A combination of global color remapping and local brightness optimization is performed on the region-specific optimized image to obtain a visually enhanced image to be analyzed. The visually enhanced image to be analyzed is input into a pre-trained feature decoupling network to generate an image feature encoding vector; The image feature encoding vector is input into the few-shot learning framework and combined with labeled samples in the support set to generate a task-adaptive feature representation. Based on the task-adaptive feature representation, a stage prediction result and corresponding visual interpretation map are generated through an interpretable classifier.
2. The interpretable staging prediction method for small sample colorectal cancer images according to claim 1, characterized in that, A combination of global color remapping and local brightness optimization is performed on the region-specific optimized image to obtain a visually enhanced image for analysis, including: The image is optimized in a region-specific manner by converting it from the original color space to a color space. In the color space, the global statistical characteristics of the luminance channel, the first chromaticity channel and the second chromaticity channel are calculated respectively. Based on global statistical characteristics, mapping functions are constructed for the luminance channel, the first chroma channel, and the second chroma channel. The mapping functions map the original pixel values of each channel to the target distribution range. The mapping function is executed independently for each channel to obtain a color-balanced intermediate image. The calculation region optimizes the local brightness mean of each pixel in the image. Based on the difference between the local brightness mean and the preset target brightness, an exponential decay function or a gain function is constructed. The exponential decay function is used to reduce the brightness of overly bright areas, and the gain function is used to increase the brightness of overly dark areas. When applying an exponential decay function or gain function, a boundary distance weighting factor is introduced to ensure that brightness adjustment transitions smoothly at the region boundary. The brightness channel, after brightness adjustment, is merged with the mapped color channel and converted back to the original color space to output the visually enhanced image to be analyzed.
3. The interpretable staging prediction method for small sample colorectal cancer images according to claim 1, characterized in that, The visually enhanced image to be analyzed is input into a pre-trained feature decoupling network to generate an image feature encoding vector, including: The pre-trained feature decoupling network contains a shared encoder and multiple parallel decoupling branches. The shared encoder consists of alternating convolutional and pooling layers. The visually enhanced image to be analyzed is first processed by a shared encoder to extract a shared feature map; The shared feature map is simultaneously fed into the morphological feature decoupling branch, the texture feature decoupling branch, and the color feature decoupling branch. The morphological feature decoupling branch focuses on extracting features related to glandular structure and cell nucleus morphology, the texture feature decoupling branch focuses on extracting features related to cell arrangement and matrix texture, and the color feature decoupling branch focuses on extracting features related to staining depth and color distribution. Each decoupling branch outputs a decoupling feature vector. The feature vectors output by all decoupling branches are concatenated and fused, and then dimensionality reduction and integration are performed through a fully connected layer. Finally, a fixed-dimensional vector is output as the image feature encoding vector.
4. The interpretable staging prediction method for small sample colorectal cancer images according to claim 3, characterized in that, The image feature encoding vector is input into a few-shot learning framework, and combined with labeled samples from the support set, to generate task-adaptive feature representations, including: The few-shot learning framework employs a metric-based learning method, with the support set containing a small number of labeled sample images from multiple different phases and their corresponding phase labels. Using a pre-trained feature decoupling network, the sample feature encoding vector of each labeled sample image in the support set is extracted. A task feature prototype is constructed, which is obtained by calculating the mean value of the feature encoding vectors of all samples belonging to the same period in the support set. Calculate the feature distance between the image feature encoding vector and the task feature prototype for each stage; Using an attention mechanism, weights are assigned to the prototypes of task features for each phase based on feature distance, with prototypes that are closer in distance having higher weights. All weighted task feature prototypes are aggregated to generate a task context-aware feature representation, which is the task-adaptive feature expression.
5. The interpretable staging prediction method for small sample colorectal cancer images according to claim 4, characterized in that, Based on the task-adaptive feature representation, a staging prediction result and corresponding visual interpretation map are generated through an interpretable classifier, including: The interpretable classifier includes a fully connected classification layer and a gradient backpropagation interpretation module; The task-adaptive feature representation is input into the fully connected classification layer, and after nonlinear transformation, the predicted probability value of each stage category is output. The stage category corresponding to the highest predicted probability value is taken as the stage prediction result. After obtaining the prediction result in the fully connected classification layer, the gradient of the task-adapted feature representation with respect to the final predicted category is calculated through the gradient backpropagation interpretation module. The calculated gradient is mapped back to the original image space. Specifically, the gradient value is propagated back along the decoding path of the pre-trained feature decoupling network until it is propagated to the pixel space of the visually enhanced image to be analyzed. A heatmap with the same size as the visually enhanced image to be analyzed is obtained in pixel space. The intensity value of each pixel in the heatmap represents the degree of contribution of the pixel to the final prediction result. This heatmap is the visual interpretation map.
6. The interpretable staging prediction method for small sample colorectal cancer images according to claim 1, characterized in that, The process of calculating gradient adaptive detail-preserving weights based on the gradient magnitudes of high-frequency detail layer components includes: In the high-frequency detail layer components, the Sobel operator is used to calculate the gradient components of each pixel in the horizontal and vertical directions; Calculate the gradient magnitude of each pixel based on the horizontal and vertical gradient components. The gradient magnitude is normalized so that its value ranges from zero to one. The normalized gradient magnitude is input into a monotonically increasing transformation function. The output value of the transformation function is the gradient adaptive detail preservation weight of the pixel. The larger the gradient magnitude of the pixel, the higher its corresponding gradient adaptive detail preservation weight, so as to better preserve the edge and detail information of the corresponding pixel position in subsequent fusion.
7. The interpretable staging prediction method for small sample colorectal cancer images according to claim 1, characterized in that, The process of determining how to multiply the high-frequency difference image by weighting coefficients derived from the structure consistency adjustment coefficient matrix and then superimpose it back onto the base smooth image includes: The structural consistency adjustment coefficient matrix is normalized so that the values in the matrix are between zero and one. Set a base sharpening intensity factor and a maximum sharpening intensity factor; For each pixel location in the texture region, the normalized structural consistency adjustment coefficient value of the corresponding location is multiplied by the difference between the maximum sharpening intensity coefficient and the base sharpening intensity coefficient, and then added to the base sharpening intensity coefficient to obtain the final weighting coefficient for the corresponding pixel location. The weighting coefficient is used to control the intensity of the high-frequency difference image when it is superimposed on the base smooth image at the corresponding pixel position. The higher the coefficient, the stronger the sharpening effect.