Kidney pathological tissue image enhancement and lesion area segmentation method

By employing a multi-scale gradient perception enhancement network and a context-guided lesion segmentation architecture, the problem of blurred lesion boundaries in renal pathology images was solved, achieving high-precision lesion region segmentation and improving the reliability and diagnostic accuracy of automated pathology assessment.

CN122066718APending Publication Date: 2026-05-19FOURTH MILITARY MEDICAL UNIVERSITY
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
FOURTH MILITARY MEDICAL UNIVERSITY
Filing Date
2026-01-14
Publication Date
2026-05-19

AI Technical Summary

Technical Problem

When processing kidney pathology images, existing technologies, such as traditional enhancement methods, struggle to distinguish subtle differences between lesions and normal tissues. Furthermore, segmentation models lack effective perception of weak boundaries, leading to boundary breaks or excessive smoothing, which affects the accuracy and reliability of automated pathology assessment.

Method used

A multi-scale gradient perception enhancement network and a context-guided lesion segmentation architecture are constructed. Non-uniform contrast enhancement of pathological images is performed through multi-scale gradient field modeling and adaptive gradient perception enhancement operators. High-fidelity segmentation of lesion regions is achieved by combining spatial attention gating module and channel-position joint encoder. The segmentation results are optimized using boundary consistency constraint loss function.

Benefits of technology

It significantly improves the segmentation accuracy of glomerular sclerosis and interstitial fibrosis lesions, with a boundary positioning error of less than 1.5 pixels, enhances the automated quantitative analysis capability of renal pathology images, and improves the accuracy of early diagnosis.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122066718A_ABST
    Figure CN122066718A_ABST
Patent Text Reader

Abstract

The invention relates to the crossing field of artificial intelligence and medical image processing, and discloses a kidney pathological tissue image enhancement and focus area segmentation method. The method comprises the following steps: performing multi-scale gradient field modeling on an original pathological image to generate a local gradient intensity diagram and a global gradient direction diagram; constructing a self-adaptive gradient perception enhancement operator to realize non-uniform contrast enhancement; and the enhanced image is input into a context-guided focus segmentation network, the focus segmentation network integrates a space attention gating module and a channel-position joint encoder, a boundary consistency constraint loss function is combined to optimize a segmentation result, and a pixel-level focus mask is output. According to the technical scheme, the weak boundary strengthening effect and the focus segmentation precision are remarkably improved, the Dice coefficients reach 0.92 and 0.89 respectively, and the boundary positioning error is smaller than 1.5 pixels.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the interdisciplinary field of artificial intelligence and medical image processing, specifically relating to a method for enhancing kidney pathological tissue images and segmenting lesion regions. Background Technology

[0002] With the increasing application of digital pathology in clinical diagnosis and scientific research analysis, artificial intelligence-based automated analysis technology for kidney pathology images has attracted widespread attention. Microscopic images formed after staining kidney tissue sections contain a wealth of structural information; morphological changes in the glomeruli, tubules, and interstitial regions are key indicators for assessing the progression of chronic kidney disease.

[0003] Due to factors such as tissue preparation processes, uneven staining, and limitations in optical imaging, pathological images generally suffer from low contrast, strong noise interference, and blurred local details. In particular, in lesion areas such as glomerular sclerosis or interstitial fibrosis, the boundary between the lesion and the surrounding normal tissue often shows a gradual transition, lacking clear intensity or texture abrupt changes.

[0004] Accurate segmentation of lesion regions relies on the effective enhancement and preservation of weak boundaries. Traditional image enhancement methods often employ global histogram equalization or isotropic filtering strategies with fixed parameters. While these can improve overall contrast, they struggle to distinguish subtle differences between lesions and normal tissue. Classical edge detection operators (such as Canny and Sobel) are sensitive to noise and only respond to strong gradients, making them prone to breakage or missed detections when dealing with blurred boundaries. Some existing segmentation models attempt to incorporate deep learning for end-to-end training, but if the input image itself lacks sufficient boundary information, even with a complex network structure, it is difficult to recover smoothed or lost key contour features, resulting in jagged, offset, or even completely missing segmentation results at lesion edges.

[0005] Existing technologies for processing highly blurred pathological images generally suffer from a disconnect between enhancement and segmentation tasks: the enhancement module fails to consider the requirements of boundary continuity and semantic consistency for subsequent segmentation, while the segmentation model lacks an effective mechanism for perceiving weak boundaries in the original image. Furthermore, single-scale gradient calculation cannot capture the structural characteristics of lesion boundaries at different spatial granularities, and uniform diffusion strategies can erase diagnostically valuable fine textures. These problems are particularly prominent in the quantitative analysis of progressive lesions such as glomerulosclerosis, severely limiting the accuracy and reliability of automated pathological assessment systems. Therefore, there is an urgent need for an image preprocessing method that can synergistically optimize boundary enhancement and semantic segmentation. Summary of the Invention

[0006] This invention provides a method for enhancing renal pathological tissue images and segmenting lesion regions, aiming to solve the technical problems of traditional edge detection or uniform enhancement methods, which are prone to boundary breaks or over-smoothing due to the blurred and highly gradable boundaries between lesions and normal tissues such as glomerular sclerosis and interstitial fibrosis. This method achieves precise enhancement of weak boundary structures in pathological images and high-fidelity segmentation of lesion regions by constructing a multi-scale gradient perception enhancement network and a context-guided lesion segmentation architecture.

[0007] According to one aspect of the present invention, a method for enhancing renal pathological tissue images and segmenting lesion regions is provided, comprising: acquiring original digital slice images of renal pathological tissue; performing multi-scale gradient field modeling on the original digital slice images of renal pathological tissue to generate local gradient intensity maps and global gradient direction maps; constructing an adaptive gradient-aware enhancement operator based on the local gradient intensity maps and global gradient direction maps to perform non-uniform contrast enhancement on the original image to obtain an enhanced pathological image; inputting the enhanced pathological image into a context-guided lesion segmentation network, the lesion segmentation network including a spatial attention gating module and a channel-position joint encoder for extracting multi-level semantic features and fusing long-range contextual dependency information; upsampling and reconstructing the fused features through a decoder, and optimizing the segmentation results by combining a boundary consistency constraint loss function to output pixel-level segmentation masks for glomerular sclerosis regions and interstitial fibrosis regions.

[0008] As one embodiment of the present invention, the acquisition of original digital slide images of kidney pathological tissue specifically includes: acquiring whole slide images of kidney tissue stained with hematoxylin and eosin from a digital pathology scanner, with an image resolution of 0.25 micrometers per pixel, a color space of standard RGB format, and an image size of not less than 10000×10000 pixels.

[0009] As one embodiment of the present invention, the multi-scale gradient field modeling of the original digital slice image of kidney pathological tissue specifically includes: calculating the first-order partial derivatives of the image at three different scales, wherein the kernel size of the smallest scale is 3×3, the kernel size of the middle scale is 5×5, and the kernel size of the largest scale is 7×7; obtaining the gradient components in the horizontal and vertical directions for the first-order partial derivatives at each scale; stacking the gradient components of each scale by channel to form a twelve-channel initial gradient tensor; normalizing the initial gradient tensor so that the numerical range of each channel is compressed to between 0 and 1; and using principal component analysis to reduce the dimensionality of the normalized gradient tensor, retaining the first two principal components, which correspond to the local gradient intensity map and the global gradient direction map, respectively.

[0010] As one embodiment of the present invention, constructing the adaptive gradient-aware enhancement operator specifically includes: defining an enhancement weight function. ,in For the local gradient intensity map in coordinates The value at that location, For the global gradient pattern in coordinates The value at that location, and As a preset constant, The value is 0.7. A value of 0.3 will be used to convert the original image. Switch to Color space, obtained aisle, Channel and The channel is only for... The channel applies the enhancement weighting function to calculate the enhanced luminance value. ,in The enhancement factor is set to 1.2. for The maximum possible value of the channel is 100, which will enhance the... Channel and Original Channels are recombined and converted back. The color space is used to obtain enhanced pathological images.

[0011] In one embodiment of the present invention, the context-guided lesion segmentation network includes an encoder-decoder structure. The encoder consists of five consecutive residual convolutional blocks, each containing two 3×3 convolutional layers, a batch normalization layer, and a modified linear unit activation function. Dilated convolutional operations with dilation rates of 2, 4, and 8 are introduced after the third, fourth, and fifth residual convolutional blocks, respectively, to expand the receptive field. A spatial attention gating module is connected to the encoder output. This module receives a concatenated input from the encoder's highest-level and lowest-level feature maps, compresses the channel dimension to 16 using a 1×1 convolution, and then generates a spatial weight map using a 3×3 convolution and a sigmoid function. This weight map is used for positional weighting of high-level semantic features. The channel-position joint encoder consists of 3.5 parallel branches, each processing feature maps of different scales. Each branch includes a channel attention module and a positional encoding embedding layer. The channel attention module uses global average pooling and a two-layer fully connected network to generate channel weights. The positional encoding embedding layer uses a learnable two-dimensional sine and cosine positional encoding matrix, with dimensions equal to the input features. Figure 1 To.

[0012] In one embodiment of the present invention, the decoder adopts a four-level upsampling structure, each level including a transposed convolutional layer and a skip connection fusion unit; the skip connection fusion unit receives the feature map from the corresponding level of the encoder and the feature map output by the previous level decoder, first unifies the number of channels through a 3×3 convolution, and then adds them element by element; after the last level of upsampling, a 3×3 convolutional layer and a Softmax activation function are connected to output a three-channel probability map, corresponding to the background, the glomerular sclerosis region and the interstitial fibrosis region, respectively.

[0013] In one embodiment of the present invention, the boundary consistency constraint loss function consists of three parts: a cross-entropy loss term, a Dice similarity coefficient loss term, and a boundary gradient alignment loss term. The cross-entropy loss term calculates the pixel-level classification error between the predicted probability map and the true label. The Dice similarity coefficient loss term is used to alleviate the class imbalance problem, and its expression is as follows: ,in To predict probabilities, The true label is used; the boundary gradient alignment loss term calculates the gradient magnitude maps of the predicted segmentation mask and the true label respectively using the Sobel operator, and then calculates the mean square error between the two to force the model to maintain gradient consistency at the boundary position.

[0014] In one embodiment of the present invention, a two-stage training strategy is adopted when training the context-guided lesion segmentation network: In the first stage, only the main structures of the encoder and decoder are trained, and the parameters of the spatial attention gating module and the channel-position joint encoder are fixed; in the second stage, all parameters are unfrozen, and fine-tuning is performed with a small learning rate, set to 1 / 10 of the first stage; the optimizer uses a momentum-driven stochastic gradient descent algorithm with a momentum coefficient of 0.9 and a weight decay coefficient of [missing value]. The batch size is set to 4, the maximum number of iterations is 200, and training is terminated early when the Dice coefficient on the validation set does not improve for 15 consecutive iterations.

[0015] As one embodiment of the present invention, the method further includes a post-processing step: performing morphological closing operation on the output segmentation mask, with the structuring element being a 5×5 circular kernel; then performing connected component analysis to remove isolated regions with an area less than 50 pixels; finally, performing boundary refinement processing on the glomerular sclerosis region and the interstitial fibrosis region respectively, using the Zhang-Suen refinement algorithm to retain the precise boundary of a single pixel width.

[0016] Compared with the prior art, the beneficial effects of the present invention are as follows: This invention effectively enhances the weak boundary structure of glomerular sclerosis and interstitial fibrosis lesions through multi-scale gradient field modeling and adaptive gradient-aware enhancement operators, avoiding the over-smoothing or boundary breakage problems caused by traditional uniform enhancement methods. The constructed context-guided lesion segmentation network integrates spatial attention mechanisms and channel-position joint encoding, which can capture long-range spatial dependencies while maintaining high semantic discriminative power, significantly improving the segmentation accuracy of lesions with blurred boundaries. The introduction of a boundary consistency constraint loss function ensures that the segmentation results are highly aligned with the ground truth annotations on the geometric boundaries.

[0017] This invention achieves a Dice coefficient of 0.92 for glomerular sclerosis regions and 0.89 for interstitial fibrosis regions on publicly available kidney pathology datasets, with a boundary localization error of less than 1.5 pixels, significantly outperforming existing segmentation methods based on U-Net or DeepLab. This method provides reliable technical support for the automated quantitative analysis of kidney pathology images, contributing to improved accuracy in early diagnosis and efficiency in pathological assessment of chronic kidney disease. Attached Figure Description

[0018] Figure 1 This is a schematic diagram of the overall technical solution architecture of the present invention; Figure 2 This is a schematic diagram of the core principle framework of the multi-scale gradient sensing enhancement network in this invention; Figure 3 This is a schematic diagram of the core principle framework of the context-guided lesion segmentation network in this invention; Figure 4 This is a flowchart illustrating the logical process of acquiring the original image and modeling the multi-scale gradient field in this invention. Figure 5 This is a flowchart illustrating the logical flow of the adaptive gradient-aware enhancement operator construction and non-uniform contrast enhancement in this invention. Figure 6 This is a schematic diagram of the multi-level interaction relationship and data flow between the terminal and the cloud in this invention. Detailed Implementation

[0019] This invention provides a method for enhancing renal pathological tissue images and segmenting lesion regions, addressing the technical problems of blurred boundaries and high gradation between lesions and normal tissues in glomerular sclerosis, interstitial fibrosis, etc., which easily lead to boundary breaks or over-smoothing in traditional edge detection or uniform enhancement methods. This method achieves precise enhancement of weak boundary structures and high-fidelity segmentation of lesion regions in pathological images by constructing a multi-scale gradient-aware enhancement network and a context-guided lesion segmentation architecture. The following will be combined with the attached... Figures 1 to 6 The specific implementation methods of each component of the system are described in detail.

[0020] The method includes the following steps: acquiring original digital slice images of kidney pathological tissue; performing multi-scale gradient field modeling on the original digital slice images of kidney pathological tissue to generate local gradient intensity maps and global gradient direction maps; constructing an adaptive gradient-aware enhancement operator based on the local gradient intensity maps and global gradient direction maps to perform non-uniform contrast enhancement on the original images to obtain enhanced pathological images; inputting the enhanced pathological images into a context-guided lesion segmentation network, wherein the lesion segmentation network includes a spatial attention gating module and a channel-position joint encoder for extracting multi-level semantic features and fusing long-range contextual dependency information; upsampling and reconstructing the fused features through a decoder, and optimizing the segmentation results by combining a boundary consistency constraint loss function to output pixel-level segmentation masks for glomerular sclerosis regions and interstitial fibrosis regions.

[0021] In step S1, raw digital slide images of kidney pathology tissue are acquired. This step specifically includes acquiring whole-slide images of kidney tissue stained with hematoxylin and eosin from a digital pathology scanner. The image resolution is 0.25 micrometers per pixel, the color space is standard RGB format, and the image size is no less than 10000×10000 pixels. Image data is stored in a lossless compressed format on a local storage device or in a cloud-based pathology database, and accessed via a standardized interface protocol. During image acquisition, light source stability, focal plane consistency, and staining batch correction are ensured to avoid artifacts introduced by fluctuations in imaging conditions. All images undergo white balance correction and color consistency normalization before entering subsequent processing, ensuring that the color temperature deviation between different batches of images is controlled within the CIEDE2000 color difference threshold of 3.5. Image metadata includes acquisition time, scanner model, staining reagent batch number, operator identification, and patient anonymity number, used for subsequent traceability analysis.

[0022] In step S2, multi-scale gradient field modeling is performed on the original digital slice image of kidney pathological tissue to generate a local gradient intensity map and a global gradient direction map. Specifically, this step involves calculating the first-order partial derivatives of the image at three different scales: a minimum scale kernel size of 3×3, an intermediate scale kernel size of 5×5, and a maximum scale kernel size of 7×7. Each scale kernel is calculated using a Gaussian weighted difference, with standard deviations of 0.8, 1.5, and 2.2, respectively, to match the tissue texture variations at different scales.

[0023] The gradient components in the horizontal and vertical directions of the first-order partial derivatives at each scale are calculated and denoted as follows: ,in This corresponds to three scales. The gradient components at each scale are stacked by channel to form a twelve-channel initial gradient tensor. ,in and These represent the image height and width, respectively. The initial gradient tensor is normalized using channel-wise min-max normalization, compressing the numerical range of each channel to between 0 and 1. ,in and These are the minimum and maximum values ​​of the k-th channel, respectively.

[0024] Principal component analysis (PCA) is used to reduce the dimensionality of the normalized gradient tensor, retaining the first two principal components, which correspond to the local gradient intensity maps. With global gradient direction pattern Principal component analysis is achieved through eigenvalue decomposition of the covariance matrix. ,in Given the total number of pixels, the feature vectors are sorted in descending order of their eigenvalues, and the first two columns are used to form the projection matrix. The local gradient intensity map and the global gradient direction map are derived from... The first and second columns were obtained separately. The local gradient intensity map reflects the degree of local structural abrupt change, with high-value regions corresponding to microstructures such as the edge of the cell nucleus and the inflection of the basement membrane; the global gradient direction map represents the orientation of large-scale tissues, such as the arrangement direction of renal tubules and the extension trend of fiber bundles, and its value range is mapped to the interval of 0 to 1 by the arctangent function.

[0025] In step S3, based on the local gradient intensity map and the global gradient direction map, an adaptive gradient-aware enhancement operator is constructed to perform non-uniform contrast enhancement on the original image, resulting in an enhanced pathological image. This step specifically includes defining an enhancement weight function. ,in For the local gradient intensity map in coordinates The value at that location, For the global gradient pattern in coordinates The value at that location, and As a preset constant, The value is 0.7. The value is 0.3.

[0026] The design logic of the enhancement weight function is as follows: in regions with high local gradient strength (such as the true boundary), a higher enhancement weight is assigned; in regions with strong global gradient direction consistency (such as smooth transition regions), the enhancement weight is reduced to avoid over-sharpening. (The original image is then processed.) Switch to Color space, obtained aisle, Channel and Channel. Only for The channel applies the enhancement weighting function to calculate the enhanced luminance value. ,in The enhancement factor is set to 1.2. for The maximum possible value for the channel is 100.

[0027] This formula ensures that the enhancement level is dynamically adjusted according to the current brightness value: in low-brightness areas, The enhancement effect is significant; in high-brightness areas, the enhancement tends to saturate, preventing overexposure. (Enhanced image / image) Channel and Original Channels are recombined and converted back. Color space, resulting in enhanced pathological images The conversion process uses standard... A linear transformation matrix under the white dot ensures color fidelity. The enhanced image retains the color distribution characteristics of the original tissue structure while significantly improving the contrast of lesion boundaries, making the hyalinized structures in the glomerular sclerosis area and the collagen deposition contours in the interstitial fibrosis area clearly visible.

[0028] In step S4, the enhanced pathological image is input into a context-guided lesion segmentation network. This network includes a spatial attention gating module and a channel-position joint encoder to extract multi-level semantic features and fuse long-range contextual dependency information. The lesion segmentation network employs an encoder-decoder structure. The encoder consists of five consecutive residual convolutional blocks, each containing two 3×3 convolutional layers, a batch normalization layer, and a modified linear unit activation function. The input image first passes through a 7×7 convolutional layer with a stride of 2, expanding the number of channels to 64, as initial feature extraction. The first residual block outputs 64 channels, the second 128, the third 256, the fourth 512, and the fifth 1024. Dilated convolution operations with dilation rates of 2, 4, and 8 are introduced after the third, fourth, and fifth residual convolutional blocks, respectively, to expand the receptive field. The introduction of dilated convolutions allows high-level features to capture a wider range of contextual information without increasing the number of parameters or reducing the feature map resolution.

[0029] A spatial attention gating module is connected to the output of the encoder. The spatial attention gating module receives the highest-level feature map from the encoder. With low-level feature maps The concatenated input. The low-level feature map F2 is upsampled to [value] using bilinear interpolation. The dimensions are then combined with F5 along the channel dimension to form a spliced ​​feature map. The concatenated feature map is compressed to 16 channel dimensions through a 1×1 convolution, and then a spatial weight map is generated by a 3×3 convolution and a sigmoid function. .

[0030] This spatial weight map is used to perform positional weighting on the high-level semantic feature F5, i.e. ,in This indicates element-wise multiplication. This mechanism allows the network to focus on potential lesion regions indicated by low-level features, suppressing irrelevant background interference. The channel-location joint encoder consists of four parallel branches, processing feature maps of different scales F1 to F4 respectively. Each branch contains a channel attention module and a location encoding embedding layer. The channel attention module uses global average pooling to spatially compress the input feature map, obtaining a channel description vector, which is then passed through two fully connected layers (the hidden layer dimension is 1 / 16 of the input channel number) to generate a channel weight vector. After sigmoid activation, it is multiplied channel-wise with the original feature map. The location encoding embedding layer uses a learnable two-dimensional sine and cosine location encoding matrix, with dimensions equal to the input feature map. Figure 1 The initialization follows a standard normal distribution, and it is updated synchronously with the network parameters during training. This two-dimensional sine and cosine positional encoding explicitly injects spatial coordinate information, compensating for the lack of absolute position awareness in convolution operations, and is particularly helpful in distinguishing lesion structures with similar morphology but different locations.

[0031] In step S5, the fused features are upsampled and reconstructed by the decoder, and the segmentation result is optimized by combining the boundary consistency constraint loss function, outputting a pixel-level segmentation mask for the glomerular sclerosis region and the interstitial fibrosis region. The decoder adopts a four-level upsampling structure, with each level containing a transposed convolutional layer and a skip connection fusion unit.

[0032] Level 1 reception Fusion features with channel-position co-encoder output Upsampled to transposed convolution The number of channels is halved to 512. The skip connection fusion unit receives feature maps from the fourth layer of the encoder. First, the number of channels is unified to 512 through a 3×3 convolution, and then added element by element to the upsampled features.

[0033] Second-level upsampling to fusion Level 3 to fusion Level 4 to The algorithm incorporates F1 scores. Each upsampling stage includes batch normalization and corrected linear unit activation. After the final upsampling stage, a 3×3 convolutional layer with a Softmax activation function is applied, outputting a three-channel probability map. These correspond to the background, glomerular sclerosis area, and interstitial fibrosis area, respectively. To restore the original resolution, the final output is upsampled using bilinear interpolation. .

[0034] The boundary consistency constraint loss function consists of three parts: the cross-entropy loss term. Dice similarity coefficient loss term Loss term aligned with boundary gradient The cross-entropy loss term calculates the pixel-level classification error between the predicted probability map and the true label, expressed as follows: ,in The true label for one-hot encoding To predict probabilities. The Dice similarity coefficient loss term is used to mitigate the class imbalance problem, and its expression is: ,in To predict probabilities, For the ground truth labels, summation is performed across all pixels and categories. The boundary gradient alignment loss term uses the Sobel operator to calculate the gradient magnitude maps of the predicted segmentation mask and the ground truth labels separately, and then calculates the mean squared error between them. The Sobel operator uses a 3×3 kernel; the horizontal and vertical gradients are calculated separately and their Euclidean norms are taken to obtain the boundary response map. and ,but The total loss function is ,in The values ​​are 1.0, 1.0, and 0.5 respectively.

[0035] A two-stage training strategy was employed when training the context-guided lesion segmentation network. In the first stage, only the encoder and decoder main structures were trained, with the parameters of the spatial attention gating module and the channel-position joint encoder fixed. The optimizer used a momentum-driven stochastic gradient descent algorithm with a momentum coefficient of 0.9 and a weight decay coefficient of [missing value]. The initial learning rate was set to 0.01, the batch size to 3.5, and the maximum number of iterations to 100. In the second stage, all parameters were unfrozen, and fine-tuning was performed with a smaller learning rate (1 / 10 of the first stage, i.e., 0.001), also with a maximum of 100 iterations. Training was terminated early if the Dice coefficient on the validation set did not improve for 15 consecutive iterations. The training data came from a publicly available kidney pathology dataset, containing 300 whole-slice images annotated by pathologists, with annotations including precise boundaries between glomerular sclerosis and interstitial fibrosis areas. Data augmentation strategies included random rotation, horizontal flipping, color jitter, and elastic deformation to improve the model's generalization ability. The validation and test sets each comprised 15% of the total dataset to ensure unbiased evaluation results.

[0036] After segmentation, the method also includes a post-processing step. Morphological closing operations are performed on the output segmentation mask, with a 5×5 circular kernel as the structuring element, to fill internal holes and smooth boundaries. Connectivity analysis is then performed to remove isolated regions with an area less than 50 pixels, eliminating false lesions caused by noise or misdetection. Finally, the boundaries of the glomerular sclerosis and interstitial fibrosis regions are refined using the Zhang-Suen thinning algorithm to preserve precise boundaries of a single pixel width. This thinning algorithm iteratively deletes boundary pixels that satisfy specific topological conditions, ensuring that the refined boundaries maintain connectivity and do not alter the topological structure of the original region. The final output segmentation mask is saved in PNG format, with each pixel value being 0, 1, or 2, corresponding to the background, glomerular sclerosis region, and interstitial fibrosis region, respectively, for subsequent quantitative analysis.

[0037] The aforementioned method effectively enhances the weak boundary structure of glomerular sclerosis and interstitial fibrosis lesions through multi-scale gradient field modeling and adaptive gradient-aware enhancement operators, avoiding the over-smoothing or boundary breakage problems caused by traditional uniform enhancement methods. The constructed context-guided lesion segmentation network integrates spatial attention mechanisms and channel-position joint encoding, which can capture long-range spatial dependencies while maintaining high semantic discriminative power, significantly improving the segmentation accuracy of lesions with blurred boundaries. The introduction of a boundary consistency constraint loss function ensures that the segmentation results are highly aligned with the ground truth annotations on the geometric boundaries. Experiments show that the present invention achieves a Dice coefficient of 0.92 for glomerular sclerosis regions and 0.89 for interstitial fibrosis regions on publicly available kidney pathology datasets, with a boundary localization error of less than 1.5 pixels, significantly outperforming existing segmentation methods based on U-Net or DeepLab. This method provides reliable technical support for the automated quantitative analysis of kidney pathology images, helping to improve the accuracy of early diagnosis and the efficiency of pathological assessment of chronic kidney disease.

Claims

1. A method for enhancing renal pathological tissue images and segmenting lesion regions, characterized in that, include: Obtain raw digital slide images of kidney pathological tissue; Multi-scale gradient field modeling was performed on the original digital slice images of kidney pathological tissue to generate local gradient intensity maps and global gradient direction maps. Based on the local gradient intensity map and the global gradient direction map, an adaptive gradient-aware enhancement operator is constructed to perform non-uniform contrast enhancement on the original image, resulting in an enhanced pathological image. The enhanced pathological image is input into a context-guided lesion segmentation network, which includes a spatial attention gating module and a channel-position joint encoder to extract multi-level semantic features and fuse long-range contextual dependency information. The decoder upsamples and reconstructs the fused features, and combines the boundary consistency constraint loss function to optimize the segmentation results, outputting pixel-level segmentation masks for glomerular sclerosis and interstitial fibrosis regions.

2. The method for enhancing renal pathological tissue images and segmenting lesion regions according to claim 1, characterized in that, Multi-scale gradient field modeling is performed on the original digital slice images of kidney pathological tissue to generate local gradient intensity maps and global gradient direction maps, including: The first-order partial derivatives of the image are calculated at three different scales, where the kernel size is 3×3 at the smallest scale, 5×5 at the middle scale, and 7×7 at the largest scale. The gradient components in the horizontal and vertical directions are obtained for the first-order partial derivatives at each scale. The gradient components at each scale are stacked by channel to form a twelve-channel initial gradient tensor; The initial gradient tensor is normalized so that the numerical range of each channel is compressed to between 0 and 1; Principal component analysis is used to reduce the dimensionality of the normalized gradient tensor, retaining the first two principal components, which correspond to the local gradient intensity map and the global gradient direction map, respectively.

3. The method for enhancing renal pathological tissue images and segmenting lesion areas according to claim 2, characterized in that, An adaptive gradient-aware enhancement operator is constructed to perform non-uniform contrast enhancement on the original image, resulting in an enhanced pathological image, including: Define the enhanced weight function ,in For the local gradient intensity map in coordinates The value at that location, For the global gradient pattern in coordinates The value at that location, and As a preset constant, The value is 0.

7. The value is 0.3; Original image Switch to Color space, obtained aisle, Channel and aisle; Only for The channel applies the enhancement weighting function to calculate the enhanced luminance value. ,in The enhancement factor is set to 1.

2. for The maximum possible value for the channel is 100; Enhanced Channel and Original Channels are recombined and converted back. The color space is used to obtain enhanced pathological images.

4. The method for enhancing renal pathological tissue images and segmenting lesion areas according to claim 3, characterized in that, The enhanced pathological image is input into a context-guided lesion segmentation network, including: The lesion segmentation network adopts an encoder-decoder structure, wherein the encoder consists of 5 consecutive residual convolutional blocks, and each residual convolutional block contains two 3×3 convolutional layers, a batch normalization layer, and a modified linear unit activation function. After the third, fourth, and fifth residual convolutional blocks, dilated convolution operations with dilation rates of 2, 4, and 8 are introduced respectively to expand the receptive field; A spatial attention gating module is connected to the output of the encoder. The spatial attention gating module receives the concatenated input from the highest-level feature map and the lowest-level feature map of the encoder. It compresses the channel dimension to 16 through 1×1 convolution, and then generates a spatial weight map through 3×3 convolution and the Sigmoid function, which is used to perform positional weighting on the high-level semantic features. The channel-position joint encoder consists of 3.5 parallel branches that process feature maps of different scales. Each branch contains a channel attention module and a position encoding embedding layer. The channel attention module uses global average pooling and two fully connected network layers to generate channel weights. The position encoding embedding layer uses a learnable two-dimensional sine and cosine position encoding matrix with the same dimension as the input feature map.

5. The method for enhancing renal pathological tissue images and segmenting lesion areas according to claim 4, characterized in that, Calculate the first-order partial derivatives of the image at three different scales, including: The kernels for each scale were obtained using Gaussian weighted differencing, with standard deviations of 0.8, 1.5, and 2.2, respectively. The gradient components in the horizontal and vertical directions of the first-order partial derivatives at each scale are calculated and denoted as follows: ,in It corresponds to 3 scales.

6. The method for enhancing renal pathological tissue images and segmenting lesion areas according to claim 5, characterized in that, Normalizing the initial gradient tensor includes: Channel-wise minimum-maximum normalization is adopted, i.e. ,in and These are the minimum and maximum values ​​of the k-th channel, respectively.

7. The method for enhancing renal pathological tissue images and segmenting lesion regions according to claim 6, characterized in that, Principal component analysis is used to reduce the dimensionality of the normalized gradient tensor, including: This is achieved through eigenvalue decomposition of the covariance matrix. ,in Total number of pixels; The eigenvectors are arranged in descending order of their eigenvalues, and the first two columns are used to form the projection matrix. ; The local gradient intensity map and the global gradient direction map are derived from The first and second columns are obtained respectively.

8. The method for enhancing renal pathological tissue images and segmenting lesion regions according to claim 7, characterized in that, The enhanced pathological image is input into a context-guided lesion segmentation network, including: The low-level feature maps are upsampled to the same size as the highest-level feature maps using bilinear interpolation and then stitched together along the channel dimension. The concatenated feature map is compressed to 16 channel dimensions through a 1×1 convolution, and then a spatial weight map is generated through a 3×3 convolution and a Sigmoid function.

9. The method for enhancing renal pathological tissue images and segmenting lesion regions according to claim 8, characterized in that, The fused features are upsampled and reconstructed using a decoder, and the segmentation result is optimized by combining a boundary consistency constraint loss function, including: The decoder employs a four-stage upsampling structure, with each stage containing a transposed convolutional layer and a skip connection fusion unit; The skip connection fusion unit receives the feature map from the corresponding level of the encoder and the feature map output from the previous level decoder. It first unifies the number of channels through a 3×3 convolution and then adds them element by element. After the final upsampling stage, a 3×3 convolutional layer and a Softmax activation function are applied to output a three-channel probability map, corresponding to the background, glomerular sclerosis region, and interstitial fibrosis region, respectively.

10. The method for enhancing renal pathological tissue images and segmenting lesion regions according to claim 9, characterized in that, The boundary consistency constraint loss function consists of three parts: The cross-entropy loss term calculates the pixel-level classification error between the predicted probability map and the true label. The Dice similarity coefficient loss term is used to mitigate the class imbalance problem, and its expression is as follows: ,in To predict probabilities, This is a real label; The boundary gradient alignment loss term is calculated by using the Sobel operator to calculate the gradient magnitude maps of the predicted segmentation mask and the real label respectively, and then calculating the mean square error between the two.