Kidney pathology full-slice image glomerular detection system

By combining preprocessing and a multi-scale feature interaction glomerular detection network, the problems of low efficiency and accuracy in glomerular detection in WSI images are solved, achieving efficient, accurate and spatially consistent output of glomerular detection.

CN120953675APending Publication Date: 2025-11-14UNIV OF ELECTRONICS SCI & TECH OF CHINA +2
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511063197.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-07-31
Publication Date
2025-11-14

AI Technical Summary

Technical Problem

Existing technologies for renal pathology image analysis suffer from several drawbacks: high WSI image resolution and large data volume make direct processing impossible, resulting in low glomerular detection efficiency. Furthermore, the small size and sparse number of glomeruli make them easily confused with the background, leading to a high risk of false positives and false negatives.

Method used

A preprocessing module is used to extract and preprocess the kidney tissue region, including mask extraction, overlapping window slicing, and selection of valid patches. It is combined with a multi-scale feature interactive glomerular detection network for detection, outputting localization prediction boxes and classification results. The results are then restored to the coordinate system of the whole slice image through a mapping output module.

Benefits of technology

It effectively solves the efficiency problem of WSI image processing, improves the accuracy and spatial consistency of glomerular detection, reduces invalid calculations in redundant background areas, and improves detection efficiency and accuracy.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120953675A_ABST
    Figure CN120953675A_ABST
Patent Text Reader

Abstract

The invention provides a kidney pathological full-slice image glomerulus detection system, which relates to the technical field of medical image processing and comprises a preprocessing module, a detection module and a mapping output module. The preprocessing module is used for executing kidney tissue region extraction and image preprocessing of the kidney pathology full-slice image, and comprises the following steps: extracting a kidney tissue region mask from the kidney pathology full-slice image under a preset magnification, mapping the mask to a first resolution image, performing overlapping window-sliding slicing on the first resolution image, and screening effective patches; the detection module comprises a multi-scale feature interaction glomerular detection network and is used for performing glomerular detection on the screened patches and outputting a glomerular positioning prediction frame and a corresponding classification prediction result; and the mapping output module is used for restoring the patch-level detection result to the full-slice image coordinate system. According to the method, the robustness and precision of target detection can be effectively improved, and reliable technical support is provided for intelligent analysis and auxiliary diagnosis of kidney pathological images.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of medical image processing technology, specifically to a system for detecting glomeruli in whole-section images of kidney pathology. Background Technology

[0002] Crescental glomerulonephritis is a typical progressive glomerular disease, often indicating severe glomerular damage. If not identified and intervened in a timely manner, it may rapidly develop into acute or chronic renal failure. Therefore, accurate and rapid detection of crescentic glomeruli is of significant clinical importance for the early diagnosis, pathological classification, and treatment evaluation of kidney diseases.

[0003] Previous studies have achieved some success in the analysis of renal pathological images using deep learning methods, with some models realizing automatic detection and classification of glomerular regions in whole-slice images. However, existing related technologies still generally have the following shortcomings: First, WSI images have extremely high resolution and a large amount of data, which means that traditional end-to-end detection networks cannot directly process the entire image and need to rely on slicing and preprocessing. However, most methods have not systematically optimized this process, resulting in many invalid detections and affecting detection efficiency.

[0004] Second, glomeruli, as tiny structures, are sparsely distributed and have diverse morphologies in WSI, often being confused with background tissues such as renal tubules and interstitium, leading to an increased risk of false positives and false negatives.

[0005] Third, although some methods introduce multi-stage detection and classification mechanisms, they suffer from problems such as coarse candidate windows, insufficient contextual understanding, and patch-level error accumulation, which limit the model's ability to accurately identify key pathological regions in clinical applications. Summary of the Invention

[0006] To address the technical problems in related technologies, this invention provides a glomerular detection system for whole-slice images of kidney pathology. This invention effectively adapts to the characteristics of glomeruli in WSI images—namely, their small size, sparse number, and complex structure—improving the robustness and accuracy of target detection and providing reliable technical support for intelligent analysis and assisted diagnosis of kidney pathology images.

[0007] To achieve the above objectives, the technical solution adopted by the present invention is as follows: A whole-section imaging system for renal pathology glomeruli detection includes: The preprocessing module is used to perform kidney tissue region extraction and image preprocessing of whole kidney pathology slice images, including: extracting kidney tissue region mask from whole kidney pathology slice images at a preset magnification, mapping the mask to a first resolution image, performing overlapping window slicing on the first resolution image, and filtering valid patches. The detection module includes a multi-scale feature interaction glomerular detection network, which is used to detect glomeruli in the screened patches and output the localization prediction boxes of the glomeruli and the corresponding classification prediction results. The mapping output module is used to restore the patch-level detection results to the coordinate system of the full-slice image.

[0008] Optionally, when performing mask extraction during the preprocessing: The whole-section image of kidney pathology was downsampled by 16 times to generate a second-resolution image, wherein the first resolution is greater than the second resolution. A pre-trained U-Net network was used to perform binary segmentation on the second-resolution image to generate a mask.

[0009] Optionally, the preprocessing module upsamples the mask to a first resolution and multiplies it pixel by pixel with the original image to extract the kidney tissue region, and determines the minimum bounding rectangle region through connected component analysis.

[0010] Optionally, the overlapping window slicing is based on the minimum bounding rectangle area, uses a window size of 1024×1024 pixels, and sets an overlap of 20% for slicing.

[0011] Optionally, when the preprocessing module filters valid patches, it calculates the proportion of organized pixels in each patch. If the proportion exceeds a set threshold, the patch is retained as a candidate region for subsequent detection; otherwise, it is discarded.

[0012] Optionally, the multi-scale feature-interactive glomerular detection network includes: The backbone feature extraction network is used to output feature maps S2, S3, S4, and S5 at four scales, with spatial dimensions of 1 / 4, 1 / 8, 1 / 16, and 1 / 32 of the input image, respectively. The feature fusion encoder includes a single-scale channel attention module that acts on feature map S5 and an adaptive bidirectional feature pyramid module that fuses feature maps S2-S5. The prior-aware decoder includes an IoU-aware query selection module, a denoising training module, and a Transformer decoder. The IoU-aware query selection module guides high-quality query vectors to perform one-to-one matching with targets based on the IoU matching degree between predicted and ground truth bounding boxes during the training phase. The denoising training module generates noise samples by copying and perturbing ground truth labels to guide the model in learning to stably recover target information under uncertain inputs. The Transformer decoder includes multi-layered stacked self-attention and cross-attention structures, each layer containing residual connections and feedforward networks, used to achieve dynamic matching and semantic interaction between query vectors and image features. Each query vector ultimately outputs a target's category label and bounding box parameters. During the training phase, a Hungarian algorithm is used for one-to-one label assignment to obtain glomerular prediction results.

[0013] Optionally, the fusion process of the adaptive bidirectional feature pyramid module satisfies: In the formula, It is a sequence of feature maps. Indicates the first Each feature map It is a feature map The corresponding weight coefficients are learnable parameters, and their non-negativity is guaranteed by the ReLU function. This is a smoothing factor.

[0014] Optionally, the denoising training module constructs multiple sets of noise boxes and noise category labels using the following formula: In the formula, , , , These are the coordinates of the top left and bottom right corners of the original noise box, respectively. , , , This represents the coordinate perturbation value; These represent the coordinates of the current bounding box. Indicates the width of the box; , , and It is a perturbation parameter sampled from a uniform distribution. If the sample is positive, its value ranges from 0 to 1; if the sample is negative, its value ranges from 1 to 2.

[0015] Optionally, the loss function used during training is: In the formula, , and These are hyperparameters, used to control the weighted contribution of each loss term. Represents the classification loss function. Represents the coordinates of the true bounding box. Let represent the coordinates of the model's predicted bounding box, and . in, , which is the network's prediction confidence for each category to which the target belongs. It is a vector of length equal to the number of categories, where the value at each position represents the prediction probability that the sample is predicted to belong to that category. This represents the target quality score estimated based on IoU. For foreground samples, its value is the IoU value between the corresponding predicted box and the ground truth box; for background samples, ;parameter and These are the scaling factors and hard case mining intensity used to control the negative sample loss, respectively. express Loss, and, in, and They represent the first The coordinates of the predicted bounding box and the ground truth bounding box. The number of predicted positive sample frames This indicates GIoU loss, and, in, This represents the intersection-union ratio (IUU) of the ground truth bounding boxes and the predicted bounding boxes. This represents the smallest bounding rectangle containing both the ground truth bounding box and the predicted bounding box. This represents the union of the ground truth bounding box and the predicted bounding box.

[0016] Optionally, the mapping output module will map the detected local coordinate results to WSI coordinates according to the positional relationship of the patch in the minimum bounding rectangle and the original WSI image, using the following formula: in, , This indicates the coordinates of the top-left corner of the glomerular detection box in the original WSI image. To detect the local coordinates of the glomerular target box output by the network within the patch, These are the offset coordinates of the patch within the bounding rectangle. The coordinates of the top-left corner of the minimum bounding rectangle in the original WSI image. The nonmaximum suppression algorithm is used to remove duplicate detection boxes to obtain the final glomerular detection results.

[0017] Beneficial effects: 1. Through the above technical solution, firstly, the present invention can effectively solve the fundamental efficiency problem of WSI image processing. Specifically, through the preprocessing module's process of "downsampling image to extract mask → mapping to original resolution → overlapping window slicing → filtering effective patches," ultra-large WSI images (e.g., 100,000 × 100,000 pixels) can be transformed into a limited number of effective detection units. This avoids directly inputting ultra-large images into the detection network, effectively eliminating the memory explosion risk of traditional end-to-end models, and solving the problem of not being able to directly input conventional neural networks.

[0018] Secondly, this invention can effectively improve the accuracy of glomerular detection. Specifically, the detection module of this invention processes patches through a multi-scale feature interaction glomerular detection network. Its design is essentially aimed at the characteristics of glomeruli, such as "small size, diverse shapes, and easy confusion with the background." It can achieve dual output of "localization prediction box + classification prediction result" at the patch level, providing structured target information for subsequent full-image mapping, thereby providing structured target information for pathological diagnosis.

[0019] Third, this invention can effectively ensure the spatial consistency of detection results. Specifically, the mapping output module of this invention can unify fragmented patch detection results into the original WSI space by restoring the coordinate mapping to the full-slice coordinate system; thereby solving the problem of coordinate fragmentation caused by slice detection, and can output complete glomerular distribution information at the full-map scale.

[0020] In summary, this invention is a glomerular detection system for whole-slice images of kidney pathology. Firstly, this invention proposes a structured preprocessing workflow for large-size WSI (Whole Slice Image) images, which includes steps such as kidney tissue region mask extraction at a preset magnification, mask restoration mapping, high-resolution image slicing, and patch selection. This workflow can significantly reduce invalid computation caused by redundant background regions while ensuring glomerular integrity, thereby improving processing efficiency and providing high-quality input for subsequent network detection.

[0021] 2. Other beneficial effects or advantages of the present invention will be described in detail in the specific embodiments. Attached Figure Description

[0022] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0023] in: Figure 1 This is an exemplary embodiment of the present invention, which provides an overall flowchart of the renal pathology whole-section imaging glomerular detection system for renal pathology whole-section imaging glomerular detection. Figure 2 This is a schematic diagram of the multi-scale feature-interactive glomerular detection network structure in a whole-section image glomerular detection system for renal pathology provided by an exemplary embodiment of the present invention; Figure 3 This is a schematic diagram of the backbone feature extraction network structure and HGBlock structure provided in an exemplary embodiment of the present invention; Figure 4 This is a schematic diagram of the SEv2 module structure provided in an exemplary embodiment of the present invention; Figure 5 This is a schematic diagram of the structure of a feature fusion encoder provided in an exemplary embodiment of the present invention; Figure 6 This is a schematic diagram of the structure of a priori sensing encoder provided in an exemplary embodiment of the present invention. Detailed Implementation

[0024] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are some embodiments of the present invention, but not all embodiments.

[0025] Therefore, the following detailed description of the embodiments of the invention provided in the accompanying drawings is not intended to limit the scope of the claimed invention, but merely to illustrate selected embodiments of the invention. All other embodiments obtained by those skilled in the art based on the embodiments of the invention without inventive effort are within the scope of protection of the invention.

[0026] Furthermore, the terms "comprising" and "having," and any variations thereof, used in the description of this invention are intended to cover non-exclusive inclusion. For example, a process, method, system, product, or device that includes a series of steps or units is not limited to the listed steps or units, but may optionally include other steps or units not listed, or may optionally include other steps or units inherent to these processes, methods, products, or devices. It should also be noted that in embodiments of this invention, the words "exemplary" or "for example" are used to indicate examples, illustrations, or descriptions. Any embodiment or design described as "exemplary" or "for example" in embodiments of this invention should not be construed as preferred or advantageous over other embodiments or designs. Specifically, the use of the words "exemplary" or "for example" is intended to present the relevant concepts in a specific manner.

[0027] To facilitate a clearer and more accurate understanding of the technical solutions of this invention by those skilled in the art, the existing related technologies and their technical problems will be described in more detail below.

[0028] Kidney biopsy is the gold standard for diagnosing kidney disease. The glomeruli, as the most fundamental functional units of kidney tissue, are the key focus of kidney pathological analysis in terms of their number, structure, and pathological characteristics. In clinical practice, doctors need to locate and assess the morphology of each glomerulus to determine the type of nephritis, disease activity, and severity of the lesions.

[0029] Crescental glomerulonephritis is a typical progressive glomerular disease, often indicating severe glomerular damage. If not identified and intervened in a timely manner, it may rapidly develop into acute or chronic renal failure. Therefore, accurate and rapid detection of crescentic glomeruli is of significant clinical importance for the early diagnosis, pathological classification, and efficacy evaluation of kidney diseases.

[0030] With the development of digital pathology technology, kidney biopsy images are scanned into ultra-high resolution whole-slide images (WSIs), which, while enabling automated analysis, also bring new challenges. On the one hand, WSI images are enormous (up to 100,000 x 100,000 pixels), making them unsuitable for direct input into conventional neural networks. On the other hand, glomeruli are small, sparse, and easily confused with surrounding tissue structures, often leading to false positives or false negatives. This is especially true in crescentic glomerulonephritis, where the lesion area exhibits complex morphological changes such as cell infiltration and fibrosis, resulting in blurred boundaries and further increasing the difficulty of identification. Although deep convolutional neural networks such as U-Net have been widely used in medical image segmentation, traditional methods still have significant shortcomings in terms of efficiency and detection accuracy when facing the "large image + small target" problem in WSI scenarios.

[0031] Therefore, there is an urgent need to construct a glomerular detection method that combines preprocessing with a high-performance target detection network to achieve accurate localization of key targets such as crescent lesions, and to provide intelligent support for renal pathology analysis and auxiliary diagnosis.

[0032] Among existing related technologies, deep convolutional neural networks (DCNNs) can achieve end-to-end automatic learning and extract image features at different levels, and have made a series of important advances in the field of medical image processing.

[0033] For example, the paper "Hermsen M, de Bel T, den Boer M, et al. Deep learning-based histoathologic assessment of kidney tissue [J]. Journal of the American Society of Nephrology, 2019, 30(10): 1968–1979" uses a fully convolutional neural network model built on U-Net to automatically detect key structures such as glomeruli, tubules, interstitium, and blood vessels in large-scale whole-slice images (WSIs) of kidney pathology. This method achieved a glomerular detection accuracy of 94.7% in the training set and demonstrated good generalization ability on WSIs from multiple centers and scanned using different devices. However, this method still has limitations in segmenting tissue edges and detailed regions.

[0034] For example, the paper "Marsh JN, Matlock MK, Kudose S, et al. Deep learning global glomerulosclerosis classifier using renal frozen sections [J]. ModernPathology, 2021, 34(5): 878–887" utilizes a three-channel fusion strategy for multi-stained images to construct a deep convolutional neural network, enabling automatic detection of glomeruli and their sclerotic state in frozen sections of kidney transplants. Experimental results show that the accuracy rate for glomerular detection is 95.2%, and the accuracy rate for sclerotic / non-sclerotic classification is 92.1%. This method can provide auxiliary evidence for kidney transplant rejection assessment; however, its research mainly focuses on sclerotic glomeruli, and its ability to detect other types of lesions is limited.

[0035] For example, the paper "Meng ZY, Li W, Li C, et al. Automatic detection and classification of glomerular lesions in renal pathology WSIs using a deep learning-based multi-stage framework [J]. Frontiers in Medicine, 2022, 9:840446." constructs a deep learning framework that includes four stages: detection window generation, coarse classification, glomerular merging, and fine classification. This method achieves a coarse classification accuracy of 97.6% on the validation set, with a fine classification accuracy of 88.3% for crescents and sclerotic glomeruli. Despite its overall superior performance, this method still suffers from problems in practical applications, such as a high false positive rate, accumulation of stage errors, and insufficient utilization of contextual semantic information.

[0036] In summary, existing research has achieved certain results in renal pathology image analysis based on deep learning methods, with some models realizing automatic detection and classification of glomerular regions in whole-slice images. However, current related technologies still generally have the following shortcomings: First, WSI images have extremely high resolution and a large amount of data, which means that traditional end-to-end detection networks cannot directly process the entire image and need to rely on slicing and preprocessing. However, most methods have not systematically optimized this process, resulting in many invalid detections and affecting detection efficiency.

[0037] Second, glomeruli, as tiny structures, are sparsely distributed and have diverse morphologies in WSI, often being confused with background tissues such as renal tubules and interstitium, leading to an increased risk of false positives and false negatives.

[0038] Third, although some methods introduce multi-stage detection and classification mechanisms, they suffer from problems such as coarse candidate windows, insufficient contextual understanding, and patch-level error accumulation, which limit the model's ability to accurately identify key pathological regions in clinical applications.

[0039] Therefore, there is an urgent need to propose a glomerular detection method that is adapted to WSI image features, has a structured detection process, and is highly efficient, in order to improve the detection accuracy and clinical usability in complex pathological conditions such as crescentic glomerulonephritis.

[0040] The technical solution of the present invention will be described in detail below with reference to the accompanying drawings.

[0041] like Figures 1 to 6 As shown, this embodiment provides a whole-section imaging glomerular detection system for kidney pathology, including: The preprocessing module is used to perform kidney tissue region extraction and image preprocessing of whole kidney pathology slice images, including: extracting kidney tissue region mask from whole kidney pathology slice images at a preset magnification, mapping the mask to a first resolution image, performing overlapping window slicing on the first resolution image, and filtering valid patches. The detection module includes a multi-scale feature interaction glomerular detection network, which is used to detect glomeruli in the screened patches and output the localization prediction boxes of the glomeruli and the corresponding classification prediction results. The mapping output module is used to restore the patch-level detection results to the coordinate system of the full-slice image.

[0042] Through the above technical solution, firstly, this invention can effectively solve the fundamental efficiency problem of WSI image processing. Specifically, through the preprocessing module's process of "downsampling image to extract mask → mapping to original resolution → overlapping window slicing → filtering effective patches," ultra-large WSI images (e.g., 100,000 × 100,000 pixels) can be transformed into a limited number of effective detection units. This avoids directly inputting ultra-large images into the detection network, effectively eliminating the memory explosion risk of traditional end-to-end models, and solving the problem of not being able to directly input conventional neural networks.

[0043] Secondly, this invention can effectively improve the accuracy of glomerular detection. Specifically, the detection module of this invention processes patches through a multi-scale feature interaction glomerular detection network. Its design is essentially aimed at the characteristics of glomeruli, such as "small size, diverse shapes, and easy confusion with the background." It can achieve dual output of "localization prediction box + classification prediction result" at the patch level, providing structured target information for subsequent full-image mapping, thereby providing structured target information for pathological diagnosis.

[0044] Third, this invention can effectively ensure the spatial consistency of detection results. Specifically, the mapping output module of this invention can unify fragmented patch detection results into the original WSI space by restoring the coordinate mapping to the full-slice coordinate system; thereby solving the problem of coordinate fragmentation caused by slice detection, and can output complete glomerular distribution information at the full-map scale.

[0045] In summary, this invention is a glomerular detection system for whole-slice images of kidney pathology. This invention proposes a structured preprocessing workflow for large-size WSI (Whole Slice Image) images, which includes steps such as kidney tissue region mask extraction at a preset magnification, mask restoration mapping, high-resolution image slicing, and patch selection. This workflow can significantly reduce invalid computation caused by redundant background regions while ensuring glomerular integrity, thereby improving processing efficiency and providing high-quality input for subsequent network detection.

[0046] The effectiveness of this invention was verified through comparative experimental results. Compared with mainstream object detection methods such as Faster-RCNN, SSD, ViTDet, YOLOv8, and RT-DETR (the comparison results are shown in Table 1 below), this invention achieved the best performance in all four metrics: Precision (91.4%), Recall (91.6%), mAP0.5 (92.8%), and mAP0.5:0.95 (73.7%).

[0047] Table 1. Comparison of the present invention with existing related technologies The following detailed description of an exemplary embodiment of the present invention is provided in conjunction with the accompanying drawings.

[0048] Please see Figure 1 , Figure 1 As an exemplary embodiment of the present invention, the cascaded multitasking method framework provided by the present invention includes the following method flow: Step S1: Image preprocessing and candidate patch generation. This stage uses multi-step image processing techniques to construct detection candidate regions, improving subsequent detection efficiency.

[0049] Specifically, firstly, the whole-section image of kidney pathology is downsampled by 16 times to reduce the image resolution. This downsampled image is then fed into a pre-trained U-Net network to perform binary segmentation, distinguishing the kidney tissue region from the background region to obtain a Region of Interest (ROI) mask. The kidney tissue region in the mask is marked as 1, and the background region as 0, corresponding to white and black areas in the image, respectively. After upsampling the mask back to its original resolution, it is multiplied pixel-by-pixel with the original image to obtain the kidney tissue region at high resolution.

[0050] After extracting the tissue region, its contour is extracted using OpenCV's connected component analysis functions, and the minimum bounding rectangle is determined. This step removes a large number of blank areas and avoids invalid detection. This rectangular region is then divided into multiple 1024×1024 image patches. To prevent glomeruli from being truncated precisely at the edge of the slice, a 20% overlap is designed to ensure that glomeruli remain intact in adjacent patches.

[0051] To further improve detection efficiency and reduce redundant computation, a patch validity screening mechanism is designed. Specifically, for each patch, the proportion of internal tissue pixels is calculated. If it exceeds a set threshold (e.g., 0.1), the patch is retained as a candidate region for subsequent detection; otherwise, it is discarded. The screened valid patches are input into the glomerular detection network to achieve glomerular detection.

[0052] Step S2: Construct a glomerular detection network for the patch. This stage constructs a multi-scale feature fusion glomerular detection network to improve the ability to identify glomerular targets and achieve detection results for glomeruli on the patch.

[0053] The multi-scale feature-interactive glomerular detection network structure proposed in this invention can be found in [reference needed]. Figure 2 The network consists of three parts: a backbone feature extraction network, a feature fusion encoder, and a priori perception decoder. For the input kidney pathology slices, the backbone feature extraction network first extracts feature maps; the specific process is as follows: Figure 3 The diagram shows the backbone feature extraction network in the multi-scale feature interaction glomerular detection network proposed in this invention. Its overall architecture consists of an HGStem module, multiple HGBlock modules, a global pooling layer, and a fully connected layer. The backbone network takes a kidney pathology image of size H×W as input and extracts multi-level semantic features step-by-step through a series of convolutional operations.

[0054] The input image is first processed by the HGStem module, which combines standard convolution, lightweight convolution, max pooling, and channel concatenation. This allows the network to retain rich feature representation capabilities while performing efficient computation. It is used to perform initial downsampling of the input image and feature extraction of the glomerular region, enabling rapid capture of low-level texture and structural features and providing high-quality input features for HGBlock.

[0055] HGBlock is a core component of this backbone network, and its structure is as follows: Figure 4 As shown, this module contains five consecutive 3×3 convolutional kernels, each used to extract semantic input features from different receptive fields. The formula is expressed as follows: Equation (1) In the formula, and For the first Layer convolution and weights and biases, It's a convolution operation. This represents the ReLU activation function. After passing through five consecutive convolutional layers, the receptive fields of the output features from each layer are 3×3, 5×5, 7×7, 9×9, and 11×11, respectively. The multi-scale information is concatenated after feature extraction by the convolutional layers and then stitched together to obtain the fused features. The formula is as follows: Equation (2) In the formula, This represents the concatenation operation of feature maps along the channel dimension. Represents the original input feature map. This represents the feature map obtained after the input feature map has undergone the first convolution operation. express The feature map obtained after the second convolution operation express The feature map obtained after the third convolutional layer operation express The feature map obtained after the fourth convolutional operation express The feature map obtained after the fifth convolutional operation; This operation allows the original feature information to still participate in subsequent calculations. After concatenation, channel dimensionality reduction and fusion are performed through 1×1 convolution, enabling the network to learn the global representation of features at various scales.

[0056] Entering the ESE module, we find that it's a lightweight channel information fusion module used to efficiently fuse multi-scale features of kidney pathology images, enhancing channel expression capabilities. It first... Perform a Squeeze operation to reduce the dimensionality of a 1×1 convolution and compress the channel information, as expressed in equations 3 and 4: Equation (3) In the formula, This represents the feature map after channel compression. The weight matrix represents the convolution kernel and is used for linear transformations. Indicates the bias term; Then, an excitation operation is performed to adjust the number of channels using a 1×1 convolution, thereby enhancing the features. The formulas are expressed as Equations 3 to 6: Equation (4) In the formula, This represents the feature map after channel enhancement. This represents the weight matrix of the convolution kernel used to adjust the number of channels. Indicates the corresponding bias term; After channel compression and activation, the features are further input into the SEv2 module; the structure can be found in [reference needed]. Figure 5 .

[0057] The SEv2 module first performs global average pooling on the feature map to obtain statistical information for each channel: Equation (5) In the formula, This represents the global average pooling result for the C-th channel, where H and W represent the height and width of the feature map, respectively. Represents the coordinates of a pixel.

[0058] Next, each channel is fed into four fully connected networks for nonlinear transformation, and the outputs are as follows: Equation (6) In the formula, , , and These represent the weights of the four fully connected networks. , , and These represent the output results.

[0059] Subsequently, the four sets of transformed channel information are spliced ​​together to form a holistic channel fusion representation: Equation (7) The channel attention weights are obtained by restoring the original channel dimension through the last fully connected layer mapping. : Equation (8) In the formula, These are the weights of the fully connected layer. It is the Sigmoid activation function.

[0060] Finally, the channel attention weights are multiplied channel by channel with the original input features to obtain the output features of SEv2: Equation (9) Concatenate this output with the original input residual to form the final output of HGBlock: Equation (10) This invention constructs a multi-scale feature interaction detection network based on a hybrid CNN and Transformer structure. The backbone of the network adopts a convolutional structure and introduces a lightweight channel attention module (SEv2) to extract multi-level feature maps (S2–S5). An adaptive feature pyramid is designed in the feature enhancement encoder to realize intra-scale enhancement and inter-scale interaction between feature maps, thereby enhancing the model's ability to detect glomerular targets.

[0061] To further refine and optimize key lesion features and enhance the model's ability to distinguish glomerular and crescentic lesion regions in complex backgrounds, this invention designs a feature enhancement encoder, the specific structure of which is as follows: Figures 3 to 5As shown, this module consists of two parts: a single-scale attention module (SSAM) and an adaptive bidirectional feature interaction pyramid module. SSAM focuses on semantic enhancement within high-level features and the interaction fusion between multi-scale features, respectively, further improving the model's feature representation ability and discriminative performance. The specific processing flow of the feature enhancement encoder is as follows: First, for the high-level feature map S5 extracted by the backbone network, a single-scale attention module is used for fine-grained feature enhancement. This module, based on a self-attention mechanism, models the potential long-range dependencies within spatially sparse and unevenly distributed lesion regions, thus mining the complex semantic associations within crescent-shaped lesions. The formula is expressed as follows: Equation (11) Equation (12) In the formula, , These represent the query, key, and value matrices in the attention mechanism, respectively. This means flattening the high-dimensional feature map S5 into a two-dimensional matrix. This represents the enhanced high-level feature map. This indicates that the attention output will be readjusted to the same spatial dimensions as S5. This represents the output after performing attention calculations on Q, K, and V and extracting global semantic relationships. To fully integrate features from different levels and improve the accuracy of glomerular localization and the ability to distinguish crescent lesions, this invention introduces an adaptive bidirectional feature pyramid structure, which enhances the expressive power of high-level semantic features while maintaining high-resolution detail information. This structure fuses the multi-scale feature maps (S2, S3, S4) extracted from the backbone network with the high-level feature map F5 processed by the single-scale attention module, achieving bidirectional interaction between low-level details and high-level semantics. The specific implementation process is as follows: To facilitate the fusion of features at different scales, the input feature maps at each level (S2, S3, S4, F5) are first subjected to a 1×1 convolution to unify the number of channels, ensuring they have the same channel dimension. This operation provides structurally consistent input for subsequent feature interactions, as shown in Equations 3 to 14: Equation (13) In the formula, Indicates the first The output features of the layer This represents the activation function of the Sigmoid Linear Unit. This indicates a batch normalization operation. Indicates to Perform a 1×1 convolution operation. This indicates that a 1×1 convolution operation is performed on F5; After channel alignment, the feature fusion process first adopts a top-down strategy, starting from the highest-level feature map (which has the richest semantic information) and transferring and fusing features layer by layer to the lower-level feature maps. This process maps high-level features to the same spatial resolution as low-level features through upsampling operations, and then performs point-by-point addition or cascade fusion with them, so that semantic information is passed down to shallow features containing more details, thereby enhancing the semantic expressive power of low-level features. Specifically, the top-down fusion process is implemented through multi-level operations, and the fusion relationship between different levels can be formally represented by equations (14) to (16), where each level of fusion includes upsampling, feature alignment, and feature fusion operations to ensure that semantic and detailed information is effectively transferred between layers: Equation (14) Equation (15) Equation (16) In the formula, This indicates a 2x upsampling. , These represent the fusion feature maps of the fourth, third, and second layers respectively during the top-down fusion process. To achieve adaptive fusion weights, normalization is performed using Softmax: Equation (17) After completing the top-down information transfer, a bottom-up feature fusion strategy is further introduced to enhance the perception of detailed structures by high-level features. This process starts with the lowest-level features, which have the highest spatial resolution, and samples and fuses them layer by layer into the higher-level feature maps. It gradually injects the preserved edge details and local structural information into the deeper features, which are richer in semantic information, thus improving the sensitivity of the high-level semantic representation to changes in target boundaries and morphology. Similarly, the bottom-up fusion process is implemented sequentially through multiple levels of operations. The fusion relationships between different levels can be formally represented by Equations 18 to 20: Equation (18) Equation (19) Equation (20) In the formula, , , These represent the feature maps of the third, fourth, and fifth layers respectively during the bottom-up fusion process. Indicates adaptive fusion weights; The fusion process of BiFPN can be formally represented as equation (3-22): Equation (21) In the formula, For feature map sequences, Indicates the first Each feature map It is a feature map The corresponding weight coefficients are learnable parameters, and their non-negativity is guaranteed by the ReLU function. The smoothing factor (for example, its value can be...) ).

[0062] The RepC3 module further enhances feature representation capabilities, as shown in the following formula: Equation (22) The adaptive bidirectional feature pyramid, while transmitting high-level semantics from top to bottom, introduces a bottom-up path to supplement high-level features with spatial details from lower levels, achieving bidirectional information interaction and multi-scale fusion, effectively improving the representation ability of glomerular spatial structure and crescent lesion regions. Simultaneously, a learnable weight mechanism is introduced to dynamically adjust the fusion ratio based on the feature map content, suppressing redundant background interference and enhancing the response of key regions. This feature enhancement module, through cross-scale fine-grained modeling, significantly improves the model's detection robustness and classification accuracy under complex backgrounds and scale variations. Figure 6 The diagram shows the prior perception decoder in the glomerular crescent lesion detection network proposed in this invention. This decoder consists of three parts: an IoU perception query selection module, a denoising module, and a Transformer decoder. The specific processing flow is as follows.

[0063] The feature map output by the feature hybrid encoder first enters the IoU query selection module. In this module, the feature map is processed through multiple perceptron layers to predict the relative position of the target, and then added to the preset anchor coordinates in the feature map to obtain the absolute position of the target. Simultaneously, the feature map also passes through a fully connected layer to obtain the predicted class information for each query. Next, the class with the highest confidence is selected from each query as the final predicted class. Finally, by selecting the top 300 queries with the highest confidence, the query with the richest prior information is obtained. To further improve the model's stability and convergence speed, the denoising module randomly perturbs the coordinates and classes of the ground truth bounding boxes, constructing multiple sets of noise bounding boxes and noise class labels, as shown in Equation 23: Equation (23) In the formula, , This indicates the coordinates of the top-left corner of the glomerular detection box in the original WSI image. To detect the local coordinates of the glomerular target box output by the network within the patch, These are the offset coordinates of the patch within the bounding rectangle. The coordinates of the top-left corner of the minimum bounding rectangle in the original WSI image. Category label noise addition involves replacing the true labels with other labels and encoding the label values ​​into embedding vectors.

[0064] Next, the Top 300 queries output by the IoU query selection module are concatenated with the 200 noisy queries obtained from the denoising module, using bounding boxes and categories. This concatenation is then used as input to the Transformer decoder for decoding. The decoded results are then used by the prediction head to generate category information and bounding boxes for each query, resulting in the final prediction.

[0065] The IoU-aware query selection module enables the input query to the Decoder to carry prior knowledge, thereby accelerating the model's convergence process. Simultaneously, the denoising module addresses the instability issue of Hungarian matching in the DETR model, further improving the model's convergence speed.

[0066] Step S3: Loss Function Design. This stage employs a multi-branch joint loss function for supervised training, optimizing model parameters and balancing classification accuracy and localization robustness for glomerular targets.

[0067] This invention employs Varifocal Loss as the classification loss function and introduces IoU-aware weights to enhance the learning ability of high-quality predicted boxes. Varifocal Loss can simultaneously optimize class distribution and object quality estimation, and its mathematical expression is as follows: Equation (24) in, , which is the network's prediction confidence for each category to which the target belongs. It is a vector of length equal to the number of categories, where the value at each position represents the prediction probability that the sample is predicted to belong to that category. This represents the target quality score estimated based on IoU. For foreground samples, its value is the IoU value between the corresponding predicted box and the ground truth box; for background samples, ;parameter and The scaling factor and hard example mining intensity are used to control the negative sample loss (for example, their values ​​can be set to [values]); the values ​​are set to [values]. , This is the stable configuration recommended in the Varifocal Loss literature.

[0068] This loss function can achieve a balance between classification prediction and localization quality. The model directly learns the IoU information of the candidate boxes through the classification loss. The classification score after training has localization awareness. It can not only dynamically filter high-quality queries and effectively improve computational efficiency, but also improve the model's ability to classify difficult samples and high-quality targets.

[0069] The bounding box loss function consists of two parts: L1 loss and GIoU loss. L1 loss focuses on the rapid regression of the absolute error of the glomerular bounding box to ensure that the position is basically accurate; GIoU loss focuses on the spatial overlap quality of the glomerular bounding box, finely adjusting and optimizing the predicted bounding box to ensure the stability and effectiveness of the regression process.

[0070] Equation (25) in, and They represent the first The coordinates of the predicted bounding box and the ground truth bounding box. This represents the number of predicted positive sample frames. The specific calculation method for GIoU is as follows: Equation (26) in, This represents the intersection-union ratio (IUU) of the ground truth bounding boxes and the predicted bounding boxes. This represents the smallest bounding rectangle between the ground truth bounding box and the predicted bounding box. This represents the union of the ground truth bounding boxes and the predicted bounding boxes.

[0071] Ultimately, the total loss function is a weighted sum of the components: Equation (27) In the formula, , and These are hyperparameters used to control the weight contribution of each loss term. For example, their values ​​can be set to... , , This parameter combination has been verified through multiple grid searches in experiments, and it can achieve a good balance between classification accuracy and bounding box regression stability, thereby improving the overall detection performance.

[0072] Step S4: Mapping and Output of Detection Results. This stage maps the patch-level detection results back to the original WSI, achieving target localization at the WSI scale.

[0073] The detected local coordinates will be uniformly mapped to WSI coordinates based on the positional relationship of the patch in the minimum bounding rectangle and the original WSI image, using coordinate transformation formula 28.

[0074] Equation (28) in, , This indicates the coordinates of the top-left corner of the glomerular detection box in the original WSI image. To detect the local coordinates of the glomerular target box output by the network within the patch, These are the offset coordinates of the patch within the bounding rectangle. The coordinates of the top-left corner of the minimum bounding rectangle in the original WSI image.

[0075] Finally, duplicate detection boxes are removed using a nonmaximum suppression algorithm to obtain the final glomerular detection results.

[0076] This process, through the "effective region extraction + slice detection" strategy, can significantly reduce invalid computation areas, provide high-quality input data for the detection network, and improve detection efficiency.

[0077] The above are merely specific embodiments of the present invention, but the scope of protection of the present invention is not limited thereto. Any variations or substitutions within the technical scope disclosed in the present invention should be included within the scope of protection of the present invention. Therefore, the scope of protection of the present invention should be determined by the scope of the claims.

Claims

1. A whole-section imaging system for renal pathology to detect glomeruli, characterized in that, include: The preprocessing module is used to perform kidney tissue region extraction and image preprocessing of whole kidney pathology slice images, including: extracting kidney tissue region mask from whole kidney pathology slice images at a preset magnification, mapping the mask to a first resolution image, performing overlapping window slicing on the first resolution image, and filtering valid patches. The detection module includes a multi-scale feature interaction glomerular detection network, which is used to detect glomeruli in the screened patches and output the localization prediction boxes of the glomeruli and the corresponding classification prediction results. The mapping output module is used to restore the patch-level detection results to the coordinate system of the full-slice image.

2. The whole-section imaging glomerular detection system for kidney pathology according to claim 1, characterized in that, During the preprocessing mask extraction: The whole-section image of kidney pathology was downsampled by 16 times to generate a second-resolution image, wherein the first resolution is greater than the second resolution. A pre-trained U-Net network was used to perform binary segmentation on the second-resolution image to generate a mask.

3. The whole-section imaging glomerular detection system for kidney pathology according to claim 2, characterized in that, The preprocessing module upsamples the mask to the first resolution and multiplies it pixel by pixel with the original image to extract the kidney tissue region, and determines the minimum bounding rectangle region through connected component analysis.

4. The whole-section imaging glomerular detection system for kidney pathology according to claim 3, characterized in that, The overlapping window slicing is based on the minimum bounding rectangle area, uses a window size of 1024×1024 pixels, and sets an overlap of 20% for slicing.

5. The whole-section imaging glomerular detection system for kidney pathology according to claim 1, characterized in that, When the preprocessing module filters valid patches, it calculates the proportion of organized pixels in each patch. If the proportion exceeds a set threshold, the patch is retained as a candidate region for subsequent detection; otherwise, it is discarded.

6. The whole-section imaging glomerular detection system for kidney pathology according to claim 1, characterized in that, The multi-scale feature-interactive glomerular detection network includes: The backbone feature extraction network is used to output feature maps S2, S3, S4, and S5 at four scales, with spatial dimensions of 1 / 4, 1 / 8, 1 / 16, and 1 / 32 of the input image, respectively. The feature fusion encoder includes a single-scale channel attention module that acts on feature map S5 and an adaptive bidirectional feature pyramid module that fuses feature maps S2-S5. The prior-aware decoder includes an IoU-aware query selection module, a denoising training module, and a Transformer decoder. The IoU-aware query selection module guides high-quality query vectors to perform one-to-one matching with targets based on the IoU matching degree between predicted and ground truth bounding boxes during the training phase. The denoising training module generates noise samples by copying and perturbing ground truth labels to guide the model in learning to stably recover target information under uncertain inputs. The Transformer decoder includes multi-layered stacked self-attention and cross-attention structures, each layer containing residual connections and feedforward networks, used to achieve dynamic matching and semantic interaction between query vectors and image features. Each query vector ultimately outputs a target's category label and bounding box parameters. During the training phase, a Hungarian algorithm is used for one-to-one label assignment to obtain glomerular prediction results.

7. The whole-section imaging glomerular detection system for kidney pathology according to claim 6, characterized in that, The fusion process of the adaptive bidirectional feature pyramid module satisfies: In the formula, For feature map sequences, Indicates the first Each feature map It is a feature map The corresponding weight coefficients are learnable parameters, and their non-negativity is guaranteed by the ReLU function. This is a smoothing factor.

8. The whole-section imaging glomerular detection system for kidney pathology according to claim 6, characterized in that, The noise reduction training module constructs multiple sets of noise bounding boxes and noise category labels using the following formula: In the formula, , , , These are the coordinates of the top left and bottom right corners of the original noise box, respectively. , , , This represents the coordinate perturbation value; These represent the coordinates of the current bounding box. Indicates the width of the box; , , and It is a perturbation parameter sampled from a uniform distribution. If the sample is positive, its value ranges from 0 to 1; if the sample is negative, its value ranges from 1 to 2.

9. The whole-section imaging glomerular detection system for kidney pathology according to claim 6, characterized in that, The loss function used during training is: In the formula, , and These are hyperparameters, used to control the weighted contribution of each loss term. Represents the classification loss function. Represents the coordinates of the true bounding box. Let represent the coordinates of the model's predicted bounding box, and . in, , which is the network's prediction confidence for each category to which the target belongs. It is a vector of length equal to the number of categories, where the value at each position represents the prediction probability that the sample is predicted to belong to that category. This represents the target quality score estimated based on IoU. For foreground samples, its value is the IoU value between the corresponding predicted box and the ground truth box; for background samples, ;parameter and These are the scaling factors and hard case mining intensity used to control the negative sample loss, respectively. express Loss, and, in, and They represent the first The coordinates of the predicted bounding box and the ground truth bounding box. The number of predicted positive sample frames; This indicates GIoU loss, and, in, This represents the intersection-union ratio (IUU) of the ground truth bounding boxes and the predicted bounding boxes. This represents the smallest bounding rectangle that can simultaneously contain both the predicted bounding box and the ground truth bounding box. This represents the union of the ground truth bounding box and the predicted bounding box.

10. The whole-section imaging glomerular detection system for kidney pathology according to claim 6, characterized in that, The mapping output module will map the detected local coordinates to WSI coordinates based on the positional relationship of the patch within the minimum bounding rectangle and the original WSI image, using the following formula: in, , This indicates the coordinates of the top-left corner of the glomerular detection box in the original WSI image. To detect the local coordinates of the glomerular target box output by the network within the patch, These are the offset coordinates of the patch within the bounding rectangle. The coordinates of the top-left corner of the minimum bounding rectangle in the original WSI image; The nonmaximum suppression algorithm is used to remove duplicate detection boxes to obtain the final glomerular detection results.