Glandular structure heterotype quantitative analysis method and system based on gastroscope image

By using an improved deep learning model and gradient boosting decision tree technology, multi-dimensional quantitative features of glandular structures in gastroscopy images are extracted, solving the problem of inaccurate glandular structure identification and quantification in existing technologies, and achieving accurate identification of glandular structures and efficient assessment of cancer risk.

CN121329941APending Publication Date: 2026-01-13THE FIRST AFFILIATED HOSPITAL OF CHONGQING MEDICAL UNIVERSITY
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202511504466.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-10-21
Publication Date
2026-01-13

AI Technical Summary

Technical Problem

Existing gastroscopy image analysis methods fail to accurately identify and quantify the morphological details of glandular structures, making it impossible to accurately assess the risk of cancer.

Method used

An improved deep learning model with multi-channel fusion input, combined with a gradient boosting decision tree, is used to extract quantitative features of glandular structure through morphological, structural arrangement, and complexity dimensions, and generate an heterogeneity index. A sliding window strategy is then used for local analysis.

Benefits of technology

It enables precise identification and quantification of glandular structures in gastroscopy images, generates anomalous heat maps, helps doctors accurately locate high-risk areas, and improves the accuracy of cancer risk assessment.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121329941A_ABST
    Figure CN121329941A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of image processing, in particular to a gland structure irregularity quantitative analysis method and system based on a gastroscope image, and the method comprises the steps: carrying out the color correction and image contrast enhancement of an obtained original gastroscope image, and constructing a corresponding image pyramid; inputting the images in the image pyramid into an improved deep learning model for learning by adopting a multi-channel fusion input mode, and obtaining a gland binary mask after morphological processing; based on three dimensions of morphology, structural arrangement and complexity, quantitative features of a single gland structure are extracted from the gland binary mask; the extracted multi-dimensional quantitative features are trained through a gradient lifting decision tree model, an irregularity index is output, feature importance analysis is carried out, and the gland structure in the gastroscope image can be accurately recognized and quantized.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of image processing technology, and in particular to a method and system for quantitative analysis of glandular structural heterogeneity based on gastroscopy images. Background Technology

[0002] Gastroscopy is currently the primary method for gastric cancer screening. Doctors visually observe morphological changes in the glandular structures on the gastric mucosa (such as disordered arrangement, irregular shape, and inconsistent size) to determine the presence of tissue atypia and thus assess the risk of cancer. However, while existing clinical diagnostic methods have begun to utilize image processing techniques to assist in the analysis of glandular structures, they mostly focus on extracting or classifying overall texture features. They fail to perform refined modeling of the morphological details of glandular structures (such as glandular lumen contours and spatial arrangement patterns), resulting in an inability to accurately identify and quantify glandular structures in gastroscopy images. Summary of the Invention

[0003] The purpose of this invention is to provide a method and system for quantitative analysis of glandular structural heterogeneity based on gastroscopy images, which can accurately identify and quantify glandular structures in gastroscopy images.

[0004] To achieve the above objectives, in a first aspect, the present invention provides a method for quantitative analysis of glandular structural atypia based on gastroscopy images, comprising the following steps: The acquired raw gastroscopy images were subjected to color correction and image contrast enhancement processing, and the corresponding image pyramid was constructed. The images in the image pyramid are input into an improved deep learning model using a multi-channel fusion input method, and a gland binary mask is obtained after morphological processing. Based on three dimensions—morphology, structural arrangement, and complexity—quantitative features of individual gland structures are extracted from the binary mask of the glands. The extracted multi-dimensional quantified features are trained using a gradient boosting decision tree model to output a heterogeneity index and perform feature importance analysis.

[0005] The method further includes: A sliding window strategy is used to divide the original gastroscopy image into several overlapping sub-regions; The steps from inputting the image pyramid to outputting the anisotropy index are performed independently for each sub-region to calculate the local anisotropy index; A heatmap of anomalousness of the original gastroscopy image is generated based on the local anomalousness index and superimposed on the original gastroscopy image.

[0006] The process includes color correction and image contrast enhancement of the acquired raw gastroscopy images, and the construction of a corresponding image pyramid, including: The acquired raw gastroscopy images were subjected to color correction, intensity normalization, and image contrast enhancement. The processed original gastroscopy image is used as the bottom layer, and the downsampled image is constructed on the bottom layer. After repeated downsampling, the corresponding image pyramid is constructed.

[0007] Specifically, a multi-channel fusion input method is used to input the images in the image pyramid into an improved deep learning model for learning, and after morphological processing, a gland binary mask is obtained, including: All images in the image pyramid are upsampled or downsampled and then adjusted to a uniform size. After being concatenated across multiple channels, the data is fed into the improved U-Net deep learning model for convolution and downsampling. After processing using the attention gate mechanism, the output probability graph is weighted using a composite loss function; After combining morphological processing, a binary mask of the gland is obtained.

[0008] Among them, after combining morphological processing, a binary mask of the gland is obtained, including: Each pixel in the processed probability map is judged using a set binary threshold. Pixels greater than or equal to the binary threshold are judged as glands, and pixels less than the binary threshold are judged as background. For each connected region identified as a gland, holes are filled, and the area of ​​all connected regions is calculated. If the area is less than the set area threshold, it is identified as noise and removed to obtain a binary mask of the gland.

[0009] Among them, the quantitative features extracted based on the morphological dimension include glandular lumen area, glandular lumen perimeter, roundness, elliptic fit, concavity / convexity and boundary irregularity index. Quantitative features extracted based on structural arrangement dimensions include neighboring gland distance, gland orientation consistency features, Volonoj map features, and Delaunay triangulation features; The quantization features extracted based on the complexity dimension include fractal dimension, Gabor texture energy, and local binary mode variance.

[0010] Specifically, a gradient boosting decision tree model is used to train the extracted multi-dimensional quantified features, outputting a heterogeneity index, and performing feature importance analysis, including: The quantitative features extracted from the three dimensions of morphology, structural arrangement, and complexity are standardized and then concatenated into a one-dimensional array. The one-dimensional array is input into the gradient boosting decision tree model, trained using the set training labels, and the output probabilities are weighted and summed based on the set weight coefficients to obtain the heterogeneity index. Feature importance analysis based on the SHAP method.

[0011] Feature importance analysis based on the SHAP method includes: Calculate the SHAP value for each quantified feature of each of the glandular structures; Calculate the SHAP values ​​of the quantified features of all glandular structures on the binary mask of the gland, take the absolute values ​​and calculate the average value to obtain the importance ranking of each glandular structure.

[0012] In a second aspect, the present invention provides a system for quantitative analysis of glandular structural heterogeneity based on gastroscopy images, which is applied to a method for quantitative analysis of glandular structural heterogeneity based on gastroscopy images as provided in the first aspect. The system for quantitative analysis of glandular structural heterogeneity based on gastroscopy images includes a data acquisition module, a mask image generation module, a feature extraction module, and a quantitative analysis module. The data acquisition module is used to perform color correction and image contrast enhancement processing on the acquired raw gastroscopy images, and to construct the corresponding image pyramid. The mask image generation module is used to input the image in the image pyramid into the improved deep learning model for learning using a multi-channel fusion input method, and obtain the gland binary mask after morphological processing. The feature extraction module is used to extract quantitative features of a single gland structure from the gland binary mask based on three dimensions: morphology, structural arrangement, and complexity. The quantitative analysis module is used to train the extracted multi-dimensional quantitative features through a gradient boosting decision tree model, output the heterogeneity index, and perform feature importance analysis.

[0013] This invention discloses a method and system for quantitative analysis of glandular structural heterogeneity based on gastroscopy images. The system includes a data acquisition module, a mask image generation module, a feature extraction module, and a quantitative analysis module. The system performs color correction and image contrast enhancement on the acquired raw gastroscopy images and constructs a corresponding image pyramid. Using a multi-channel fusion input method, the images from the image pyramid are input into an improved deep learning model for learning, and a binary glandular mask is obtained after morphological processing. Based on three dimensions—morphology, structural arrangement, and complexity—quantitative features of individual glandular structures are extracted from the binary glandular mask. The extracted multi-dimensional quantitative features are trained using a gradient boosting decision tree model to output a heterogeneity index and perform feature importance analysis, enabling accurate identification and quantification of glandular structures in gastroscopy images. Attached Figure Description

[0014] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the accompanying drawings used in the description of the embodiments or the prior art will be briefly introduced below.

[0015] Figure 1 This is a schematic diagram illustrating the steps of a method for quantitative analysis of glandular structural heterogeneity based on gastroscopy images according to the first embodiment of the present invention.

[0016] Figure 2 This is a flowchart illustrating a method for quantitative analysis of glandular structural heterogeneity based on gastroscopy images provided by the present invention.

[0017] Figure 3 This is a complete flowchart of the first embodiment provided by the present invention.

[0018] Figure 4 This is a schematic diagram of a glandular structural heterogeneity quantitative analysis system based on gastroscopy images, according to a second embodiment of the present invention.

[0019] Figure 5 This is a schematic diagram of the electronic device of the present invention.

[0020] In the diagram: 101 - Data acquisition module, 102 - Mask image generation module, 103 - Feature extraction module, 104 - Quantization analysis module. Detailed Implementation

[0021] Exemplary embodiments will now be described in detail, examples of which are illustrated in the accompanying drawings. When the following description relates to the drawings, unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with this application.

[0022] The terminology used in this application is for the purpose of describing particular embodiments only and is not intended to be limiting of the application. The singular forms “a,” “the,” and “the” used in this application and the appended claims are also intended to include the plural forms unless the context clearly indicates otherwise. It should also be understood that the term “and / or” as used herein refers to and includes any or all possible combinations of one or more of the associated listed items.

[0023] It should be understood that although the terms first, second, third, etc., may be used in this application to describe various information, such information should not be limited to these terms. These terms are only used to distinguish information of the same type from one another. For example, without departing from the scope of this application, first information may also be referred to as second information, and similarly, second information may also be referred to as first information. Depending on the context, the word "if" as used herein may be interpreted as "when," "when," or "in response to determination."

[0024] The first embodiment of this application is as follows: Please see Figures 1-3 This invention provides a method for quantitative analysis of glandular structural atypia based on gastroscopy images, comprising the following steps: S101. Perform color correction and image contrast enhancement processing on the acquired raw gastroscopy images, and construct the corresponding image pyramid.

[0025] Specifically, during the acquisition of gastroscopy images, significant differences in color and brightness exist due to factors such as the type of endoscopic equipment, lighting conditions, and individual patient differences. This inconsistency severely affects the stability of subsequent gland segmentation and feature extraction. Therefore, the original gastroscopy images are first standardized to eliminate non-biological variations and transform the images into a standard space with relatively consistent color and intensity distribution. This process consists of two sub-steps: I. Color Correction An adaptive color mapping method based on a standard color chart is employed. First, a reference color chart image captured under standard lighting is built-in, containing a series of color patches with known RGB values. For each input frame of a gastroscopy image, the algorithm automatically detects regions in the image that may resemble the reference color chart, such as instrument edges and markers. If no obvious regions are found, a statistical color balance method based on large mucosal areas is used. By matching the detected color patches with corresponding color patches on the reference color chart, a color transformation matrix is ​​calculated. Applying this matrix to the entire input image corrects its color style to a standard space consistent with the reference device. This method effectively overcomes color difference issues between different devices, ensuring that subsequent analysis is unaffected by inaccurate white balance or differences in light source color temperature.

[0026] II. Strength Standardization A percentile-based grayscale stretching method is employed. Unlike simple linear stretching, this method resists interference from extremely bright (e.g., reflective points) or extremely dark (e.g., shadows) noise points in the image. First, the color-corrected image is converted to a grayscale image. Then, the pixel intensity percentiles of the grayscale image are calculated, such as by removing the minimum and maximum values ​​of 0.5%, to determine the true intensity range of meaningful regions in the image. Finally, the intensity range is linearly mapped to a standard range [0, 255]. This process ensures that all subsequently processed images have a comparable illumination baseline.

[0027] In order to further highlight the edge and texture details of the glandular structure on the basis of standardization, targeted enhancement is required.

[0028] First, contrast-limited adaptive histogram equalization is performed: the CLAHE algorithm is applied to the normalized grayscale image or luminance channel, such as the V channel of the HSV color space. CLAHE divides the image into several small blocks, performs histogram equalization independently on each block, and avoids excessive noise amplification through "contrast limiting." This operation significantly enhances the contrast between the gland and the surrounding mucosal tissue, especially for images with uneven lighting. CLAHE (Contrast Limited Adaptive Histogram Equalization) is an improved adaptive histogram equalization algorithm that avoids the noise amplification problem caused by traditional methods by limiting local contrast enhancement.

[0029] Then, median filtering is performed: a median filter with a small kernel size (such as 3x3 or 5x5) is used to smooth the image. This filter can effectively suppress "salt and pepper noise" and tiny mucus spots in the image, while preserving gland edge information relatively well.

[0030] The pre-processed image (after color correction, enhancement, and denoising) is used as the bottom layer of the pyramid, the original resolution layer (Level 0). Gaussian blur is applied to the current layer image, smoothing it with a Gaussian convolution kernel to suppress aliasing caused by downsampling. Then, downsampling is performed, typically by alternating rows and columns, reducing the size to half its original size. This process is repeated, generating a series of images with progressively lower resolution. Each downsampling step builds upon the previous one, typically constructing a pyramid with 3-4 levels. For example, Level 0: original image, Level 1: 1 / 2 size, Level 2: 1 / 4 size, Level 3: 1 / 8 size. The number of levels depends on the resolution of the original image and the expected size of the smallest gland. Higher (lower resolution) images show the overall layout and macroscopic shape of the gland region, while lower (higher resolution) images preserve the fine texture and details of the gland edges.

[0031] S102. The images in the image pyramid are input into the improved deep learning model using a multi-channel fusion input method, and the gland binary mask is obtained after morphological processing.

[0032] Specifically, the improved deep learning model is a targeted improvement on the classic U-Net architecture, constructing a multi-scale input fusion Attention U-Net model. This model consists of three main parts: an encoder, a decoder, and skip connections, and incorporates an attention gate mechanism.

[0033] The encoder (feature extraction path) is responsible for downsampling layer by layer to extract multi-scale features from the image, from low to high levels. Its backbone network uses a ResNet-34 pre-trained on a large dataset (such as ImageNet). Using a pre-trained model can accelerate convergence and improve feature extraction capabilities, especially in scenarios with limited medical image data. The encoder's output is a highly abstract feature map.

[0034] Decoder (feature recovery path): Responsible for upsampling layer by layer, mapping the high-level semantic features extracted by the encoder back to the original image resolution to achieve pixel-level localization. Each upsampling layer is fused with the feature map of the corresponding layer of the encoder.

[0035] Skip connections: These connect the output of each layer of the encoder directly to the corresponding layer of the decoder. They pass the rich spatial detail information captured by the encoder, such as edges and textures, to the decoder, compensating for the information loss caused during downsampling and thus ensuring the accuracy of the segmentation boundaries.

[0036] Attention gating mechanism: This is an enhancement to traditional skip connections. Instead of simply concatenating features from the encoder and decoder, it uses a learnable attention gating mechanism to allow the network to automatically focus on features relevant to the glandular region and suppress interference from irrelevant background regions. This significantly improves segmentation accuracy in complex gastroscopy contexts.

[0037] The images of each layer of the pyramid are uniformly resized to the same size as the original resolution layer (Level 0) through upsampling or downsampling. Then, they are stitched together along the channel dimension. Assuming the original image is 3-channel (RGB), after stitching 3 layers of the pyramid, the input to the improved deep learning model becomes a 9-channel (3 channels x 3 layers) tensor. This allows the network to simultaneously "see" multi-scale representations of the same region in the initial convolutional layers. The low-resolution image provides global context and coarse location of gland distribution, while the high-resolution image provides precise edge details.

[0038] The 9-channel input tensor first passes through an initial convolutional layer for channel fusion and preliminary feature extraction, outputting a feature map with a set number of channels (e.g., 64 channels). This fused feature map is then fed into the ResNet-34 encoder. It undergoes multiple stages of downsampling—through convolution and pooling—each stage doubling the number of channels and halving the spatial size to progressively extract more abstract features. The output is then transmitted to the decoder, where it is fused with the feature map from the corresponding layer of the encoder via an attention gate after each upsampling.

[0039] The upsampled features of a certain layer of the decoder are used as the gating signal. This signal contains high-level semantic information, including what the target to be segmented is and where it is. This signal is compared with the features of the corresponding layer of the encoder. Figure 1 Similar to the input attention gate, the attention gate calculates a weight map with values ​​between 0 and 1. The closer the weight value is to 1, the greater the probability that the pixel location is a glandular region. Finally, the encoder's feature map is multiplied point-by-point with this weight map to obtain a weighted feature map that highlights the glandular region and suppresses the background. The weighted feature map is concatenated with the decoder's upsampling result, and then processed through a convolutional layer to gradually restore spatial details. The last layer of the decoder uses a 1x1 convolutional layer and a sigmoid activation function to compress the number of channels to 1 and outputs a probability map with the same size as the original image. The value of each pixel in the image represents the probability that the pixel belongs to a glandular structure, between 0 and 1.

[0040] In medical image segmentation, glands typically occupy only a small portion of the entire image, leading to severe class imbalance. Using cross-entropy loss alone tends to predict the background, making the model insensitive to the foreground. Therefore, a composite loss function is employed to balance global and local optimization: Dice Loss directly optimizes the overlap between the segmented glands and the predicted results, i.e., the Dice coefficient. It is highly sensitive to foreground regions, effectively addressing the positive-negative sample imbalance problem and driving the model to learn segmented regions with good connectivity. Focal Loss introduces two modulation factors on top of the standard cross-entropy loss, reducing the loss weight of easily classified samples to prevent model training from being dominated by a large number of simple background pixels. The composite loss function is a weighted sum of Dice Loss and Focal Loss, with a weight system sum of 1.

[0041] Set a binary threshold, such as 0.5. For each pixel in the probability map, if its value is greater than or equal to the threshold, it is identified as a gland and assigned a value of 1; otherwise, it is identified as background and assigned a value of 0. This yields an initial binary segmentation map.

[0042] To address potential sporadic noise and small holes after thresholding, a series of morphological operations are employed for optimization: First, for each connected region predicted as a gland, any background holes that may exist within it are detected and filled to ensure the integrity of the gland structure. Next, the area of ​​all connected regions is calculated, and regions with an area smaller than a preset threshold (this threshold is set based on image resolution and prior knowledge, such as 1 / 2 of the expected minimum gland area) are considered noise and removed from the initial binary segmentation image. This results in an accurate, connected, and noise-free binary mask for the gland, which precisely labels the pixel position of each gland structure in the image.

[0043] S103. Based on the three dimensions of morphology, structural arrangement, and complexity, extract the quantitative features of a single gland structure from the binary mask of the gland.

[0044] Specifically, quantitative features are extracted based on morphological dimensions, which aim to quantify the irregularity of the shape and size of individual glandular units. This is an important basis for pathologists to evaluate under a microscope.

[0045] Connectivity analysis was performed on the binary mask to identify each individual glandular cavity region. For each identified glandular cavity, the following set of basic morphological indices were calculated: Glandular area: The total number of pixels contained in the glandular lumen region. Directly reflects the size of the gland.

[0046] Glandular perimeter: The total length of the outer boundary of the glandular cavity region.

[0047] Roundness: The calculation formula is (4 * π * gland lumen area) / (gland lumen perimeter) ^2 A perfect circle has a value of 1, and the more irregular the shape, the closer the value is to 0. It is used to assess the regularity of the glandular cavity.

[0048] Ellipse fit: Fits the glandular cavity to an optimal ellipse by calculating the intersection-union ratio (IoU) between the glandular cavity region and the elliptical region. The closer the value is to 1, the closer the glandular cavity is to an ellipse.

[0049] Concavity / convexity: The calculation formula is gland lumen area / convex hull area. The convex hull is the smallest convex polygon that contains the gland lumen; the more concave the gland lumen, the smaller this value.

[0050] Boundary Irregularity Index: This index is quantified by calculating the variance of curvature changes at boundary pixels, or by calculating the difference between the reconstructed boundary and the original shape using Fourier descriptors. A higher value indicates a more jagged or spiky boundary.

[0051] The above six indicators are for a single glandular cavity. For an entire image, there are typically dozens to hundreds of glandular cavities. Therefore, for each indicator of all identified glandular cavities in the image, its statistical characteristics are calculated separately, including: mean, standard deviation, skewness (distribution asymmetry), and kurtosis (distribution steepness). Finally, there will be four features representing the area: mean lumen area, standard deviation of lumen area, skewness of lumen area, and kurtosis of lumen area.

[0052] The number of output features for this dimension is 24 feature values, calculated by multiplying 6 indicators by 4 statistics.

[0053] The quantitative features extracted based on the structural arrangement dimension mainly quantify the spatial distribution relationship between glandular cavities. Normal glands are usually arranged in an orderly manner with uniform spacing; while dysplasia leads to disordered arrangement and uneven density.

[0054] The object to be extracted is the set of centroid coordinates of all glandular cavities.

[0055] Distance distribution between neighboring glands: Calculate the Euclidean distance from the centroid of each gland to its nearest 1st, 2nd, and 3rd neighbors (usually k=3); for all glands, calculate the global mean, standard deviation, maximum, and minimum values ​​of these nearest neighbor distances. An increase in the standard deviation indicates uneven spacing between glands, resulting in four characteristic values.

[0056] Glandular orientation consistency: For each glandular cavity, principal component analysis (PCA) is used to calculate its principal axis direction, i.e., the long axis direction angle. Taking each gland as the center, the standard deviation of its orientation angle relative to the orientation angles of neighboring glands within a certain range is calculated. The local orientation deviations calculated for all glands are then used to calculate their mean and standard deviation. A high mean indicates overall orientation disorder, while the standard deviation often indicates the existence of regions with inconsistent local orientation heights, resulting in two characteristic values.

[0057] Voronoi diagram characteristics: A Voronoi diagram is generated based on the centroids of all glands. Any point within a Voronoi cell is closer to its corresponding centroid than to any other centroid. The area and perimeter of all Voronoi cells are calculated. The mean and standard deviation of the area and perimeter of each Voronoi cell are calculated. The standard deviation of the Voronoi cell area is the gold standard for measuring the uniformity of spatial distribution; a larger value indicates a more disordered distribution. This results in two indicators multiplied by two statistics, or four characteristic values.

[0058] Delaunay triangulation features: A Delaunay triangulation network is generated based on the centroids of all glands. The side lengths and areas of all triangles are calculated, and the mean and standard deviation of these side lengths and areas are calculated respectively. The standard deviation of the triangle side lengths can reflect the degree of gland clustering or dispersion, resulting in two indices multiplied by two statistics, yielding four eigenvalues.

[0059] Number of output features in this dimension: 4 (distance) + 2 (orientation) + 4 (Voronoi) + 4 (Delaunay) = 14 feature values.

[0060] Quantitative features extracted based on the complexity dimension: This dimension assesses the overall complexity of glandular regions from a more macroscopic perspective of texture and fractals, capturing pattern changes that are difficult for the human eye to perceive intuitively.

[0061] The extraction target is either the entire gland binary mask image or a large local region.

[0062] Fractal dimension: The fractal dimension of the entire glandular region was calculated using the box-counting method. It quantifies the structure's space-filling capacity and complexity. Tissues with increased heterogeneity typically exhibit a higher fractal dimension, yielding one eigenvalue.

[0063] Gabor texture energy: On the preprocessed gland binary mask, a set of Gabor filters with different orientations and scales are applied, for example, 4 orientations, 3 scales, and a total of 12 filters. On each filter response map, the mean and standard deviation of the response amplitude are calculated only for pixels within the gland mask region. This yields 12 filters multiplied by 2 statistics, resulting in 24 eigenvalues.

[0064] Local Binary Pattern Variance: A rotation-invariant Uniform LBP (Local Binary Pattern) feature map is computed on a glandular binary mask. Similarly, the variance of the LBP encoded values ​​is calculated only for pixels within the glandular region. The LBP variance effectively reflects the uniformity of local texture; cancerous regions typically have more uneven texture and higher variance, resulting in one feature value.

[0065] Number of output features in this dimension: 1 (fractal) + 24 (Gabor) + 1 (LBP) = 26 feature values.

[0066] Three complementary dimensions are extracted, and each dimension ultimately generates multiple feature values, which together form a high-dimensional (64-dimensional) feature vector, serving as the input to the gradient boosting decision tree model. This vector comprehensively encodes the morphological, arrangement, and texture complexity information of the glandular structures in the image.

[0067] S104. Train the extracted multi-dimensional quantitative features using a gradient boosting decision tree model, output the heterogeneity index, and perform feature importance analysis.

[0068] Specifically, the 64 extracted features vary greatly in size and numerical range; for example, the area might be thousands of pixels, while the roundness ranges from 0 to 1. Directly inputting these features into the model would cause the optimization process to be dominated by features with large numerical ranges. To eliminate the influence of size and bring all features to the same order of magnitude, accelerating model convergence and improving performance, pre-standardization is necessary, using Z-score standardization. Each feature dimension in the training set is computed independently. First, the mean and standard deviation of each feature are calculated on the training set. Then, these parameters are used to standardize all glandular structures on both the training and test sets. This operation ensures that the distribution of each feature on the training set has a mean of 0 and a standard deviation of 1.

[0069] The standardized 64-dimensional feature vectors are directly concatenated into a one-dimensional array, which serves as the input to the Gradient Boosting Decision Tree (GBDT) model. The labeled data is randomly divided into training and validation sets in a certain ratio (e.g., 7:3). GBDT uses an additive model to train a series of decision trees (T_1, T_2, ..., T_m) one by one. The first tree learns how to predict labels from the original features; the second tree learns to predict the residual of the first tree, the difference between the predicted and true values, and so on. The construction of each new tree aims to correct the prediction errors of all previous tree combinations. Cross-validation is used to fine-tune key hyperparameters such as the maximum tree depth, learning rate, and number of trees to prevent overfitting and pursue the best performance of the model on the validation set. Training stops when the performance on the validation set no longer improves or when the preset maximum number of trees is reached. The data is labeled with predefined training labels, which (supervision signals) come from the diagnostic results of senior pathologists. Each doctor's diagnosis is based on the gold standard—pathological examination of gastric mucosal biopsy. The labels are ordered categories: 0: normal; 1: low-level heterogeneity; 2: high-level heterogeneity.

[0070] Although the model is trained using classification labels, the original output of the GBDT model is the probability of each glandular structure belonging to each category. Based on the weight coefficients corresponding to each label category, the output probabilities are weighted and summed to obtain the atypia index (DI value). The weight coefficients need to be jointly set with the pathologist based on clinical importance. The atypia index is a continuous value between 0 and 1. The closer to 0, the more normal it is; around 0.5, it is considered low-grade atypia; and the closer to 1, the more high-grade atypia it is. It provides a more refined grayscale evaluation than the "low, medium, high" three-category classification, reflecting the continuous spectrum of lesion changes and facilitating the monitoring of disease progression.

[0071] To enhance the model's credibility and interpretability, SHAP (SHapley Additive Explanations) values ​​are used for feature importance analysis. For each predicted glandular structure, the SHAP method calculates the contribution of each feature (each of the 64 dimensions) to the prediction result. This value can be positive (increasing the DI value) or negative (decreasing the DI value). By averaging the absolute values ​​of the SHAP values ​​of each feature for all glandular structures on the binary glandular mask, the global importance ranking of each feature is obtained. For the prediction results of a single image, a force plot can be generated. This plot shows how the base value (the average of all predictions) is driven by the SHAP values ​​of each feature, ultimately reaching the DI value output by the model. Finally, a feature contribution report is generated, listing the 10 most important features globally and their average influence direction.

[0072] To facilitate viewing the results, the method further includes: using a sliding window strategy to divide the original gastroscopy image into several overlapping sub-regions; independently performing the steps from inputting the image pyramid to outputting the anomalism index for each sub-region to calculate the local anomalism index; generating an anomalism heatmap of the original gastroscopy image based on the local anomalism index and overlaying it onto the original gastroscopy image.

[0073] Specifically, a multi-scale sliding window strategy is employed, setting three window sizes: large, medium, and small, such as 256x256, 128x128, and 64x64 pixels. These sizes are set based on prior knowledge to ensure coverage of at least several to dozens of glands. To ensure no tiny lesions are missed and to generate a smooth heatmap, the step size is typically set to half the window size; for example, the step size for a 256x256 window is 128 pixels. This guarantees a 50% overlap between windows, providing both global coverage and sufficient spatial resolution. When a window slides to the edge of the image, it is allowed to extend beyond the boundary, and the extended portion is filled with the background color (usually black or the image mean) to ensure that each window is a standard size. Through this sliding window strategy, a complete raw gastroscopy image is divided into multiple sub-regions. The segmentation of each window is based solely on information within the window, avoiding errors that may occur at the edges in global segmentation. Although this approach is more computationally intensive, performing sliding window analysis from the raw image is a more rigorous and accurate method, meeting the extremely high accuracy requirements of medical image analysis. Computational pressure can be alleviated through engineering optimizations (such as GPU acceleration and model lightweighting).

[0074] For each sliding window sub-region, a process as described in steps S101 to S104 is executed independently. At this point, each window has obtained its geographic center coordinates (x_i, y_i) and a corresponding DI value. This DI value represents the severity of the anomaly in the small region centered at (x_i, y_i).

[0075] A blank grayscale image H, identical in size to the original gastroscopy image and initially set to 0, is generated as the basis for the heatmap. However, directly assigning a DI value to the center point of a window would result in a blocky, discontinuous heatmap. To generate a smooth, continuous heatmap, interpolation is necessary. For each pixel p in the heatmap H, its heatmap value is not directly derived from a single window, but is determined by the anisotropy indices of all surrounding window center points. An inverse distance-weighted interpolation method is used. The value of pixel p is obtained by interpolating from the center points (x_i, y_i) of all surrounding windows within a certain range. The closer a window is to p, the greater the weight of its anisotropy index value on p.

[0076] The interpolated continuous anomalism index matrix (range [0,1]) is converted into a color image using a predefined color mapping table, employing a cool-warm color scheme that aligns with medical intuition. For example: DI ≈ 0 (normal) is mapped to dark blue; DI ≈ 0.5 (low-grade anomalism) is mapped to yellow; and DI ≈ 1 (high-grade anomalism) is mapped to bright red. Thus, on the generated heatmap, the red areas represent the high-risk areas with the highest degree of anomalism.

[0077] The generated color heatmap is overlaid onto the original gastroscopy image with a certain degree of transparency. The final output is a comprehensive atypia heatmap that integrates the original anatomical structure and atypia distribution information. Doctors can clearly see which specific areas exhibit abnormal colors against a normal mucosal background, enabling precise localization. This overcomes the limitations of single-scale analysis, ensuring that lesions of different sizes can be effectively captured and assessed. A sliding window enables pixel-level dense prediction and assessment, successfully transforming global quantitative analysis into precise local localization. The final output includes: an overall atypia index, atypia level classification (e.g., low / medium / high risk), local heatmap visualization results, and a report on the contribution of key features.

[0078] The second embodiment of this application is as follows: Please see Figure 4 The present invention provides a system for quantitative analysis of glandular structural heterogeneity based on gastroscopy images, which is applied to a method for quantitative analysis of glandular structural heterogeneity based on gastroscopy images as provided in the first embodiment. The system for quantitative analysis of glandular structural heterogeneity based on gastroscopy images includes a data acquisition module 101, a mask image generation module 102, a feature extraction module 103, and a quantitative analysis module 104. The data acquisition module 101 is used to perform color correction and image contrast enhancement processing on the acquired raw gastroscopy images, and to construct the corresponding image pyramid. The mask image generation module 102 is used to input the image in the image pyramid into the improved deep learning model for learning using a multi-channel fusion input method, and obtain the gland binary mask after morphological processing. The feature extraction module 103 is used to extract quantitative features of a single gland structure from the gland binary mask based on three dimensions: morphology, structural arrangement, and complexity. The quantitative analysis module 104 is used to train the extracted multi-dimensional quantitative features through a gradient boosting decision tree model, output the heterogeneity index, and perform feature importance analysis.

[0079] Regarding the system in the above embodiments, the specific ways in which each module performs operations have been described in detail in the embodiments related to the method, and will not be elaborated here.

[0080] For the system embodiments, since they basically correspond to the method embodiments, the relevant parts can be referred to in the description of the method embodiments. The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this application according to actual needs. Those skilled in the art can understand and implement this without creative effort.

[0081] Accordingly, this application also provides an electronic device, comprising: one or more processors; a memory for storing one or more programs; and when the one or more programs are executed by the one or more processors, causing the one or more processors to implement the above-described method for quantitative analysis of glandular structural heterogeneity based on gastroscopy images. Figure 5 The diagram shown is a hardware structure diagram of any device with data processing capabilities, which is part of a system for quantitative analysis of glandular structural heterogeneity based on gastroscopy images provided in an embodiment of the present invention. Except for... Figure 5 In addition to the processor, memory, and network interface shown, any data processing device in the embodiment may also include other hardware depending on the actual function of the data processing device, which will not be described in detail here.

[0082] Accordingly, this application also provides a computer-readable storage medium storing computer instructions thereon, which, when executed by a processor, implement the aforementioned method for quantitative analysis of glandular structural heterogeneity based on gastroscopy images. The computer-readable storage medium can be an internal storage unit of any data-processing device as described in any of the foregoing embodiments, such as a hard disk or memory. The computer-readable storage medium can also be an external storage device, such as a plug-in hard disk, smart media card (SMC), SD card, flash card, etc., equipped on the device. Furthermore, the computer-readable storage medium can include both internal storage units of any data-processing device and external storage devices. The computer-readable storage medium is used to store the computer program and other programs and data required by the data-processing device, and can also be used to temporarily store data that has been output or will be output.

[0083] Other embodiments of this application will readily occur to those skilled in the art upon consideration of the specification and practice of the disclosure herein. This application is intended to cover any variations, uses, or adaptations of this application that follow the general principles of this application and include common knowledge or customary techniques in the art not disclosed herein.

[0084] It should be understood that this application is not limited to the precise structure described above and shown in the accompanying drawings, and various modifications and changes can be made without departing from its scope.

Claims

1. A method for quantitative analysis of glandular structural atypia based on gastroscopy images, characterized in that, Includes the following steps: The acquired raw gastroscopy images were subjected to color correction and image contrast enhancement processing, and the corresponding image pyramid was constructed. The images in the image pyramid are input into an improved deep learning model using a multi-channel fusion input method, and a gland binary mask is obtained after morphological processing. Based on three dimensions—morphology, structural arrangement, and complexity—quantitative features of individual gland structures are extracted from the binary mask of the glands. The extracted multi-dimensional quantified features are trained using a gradient boosting decision tree model to output a heterogeneity index and perform feature importance analysis. The method further includes: A sliding window strategy is used to divide the original gastroscopy image into several overlapping sub-regions; The steps from inputting the image pyramid to outputting the anisotropy index are performed independently for each sub-region to calculate the local anisotropy index; A heatmap of anomalousness of the original gastroscopy image is generated based on the local anomalousness index and superimposed on the original gastroscopy image.

2. The method for quantitative analysis of glandular structural atypia based on gastroscopy images as described in claim 1, characterized in that, The acquired raw gastroscopy images are subjected to color correction and image contrast enhancement processing, and a corresponding image pyramid is constructed, including: The acquired raw gastroscopy images were subjected to color correction, intensity normalization, and image contrast enhancement. The processed original gastroscopy image is used as the bottom layer, and the downsampled image is constructed on the bottom layer. After repeated downsampling, the corresponding image pyramid is constructed.

3. The method for quantitative analysis of glandular structural atypia based on gastroscopy images as described in claim 1, characterized in that, The images in the image pyramid are input into an improved deep learning model using a multi-channel fusion input method. After morphological processing, a gland binary mask is obtained, including: All images in the image pyramid are upsampled or downsampled and then adjusted to a uniform size. After being concatenated across multiple channels, the data is fed into the improved U-Net deep learning model for convolution and downsampling. After processing using the attention gate mechanism, the output probability graph is weighted using a composite loss function; After combining morphological processing, a binary mask of the gland is obtained.

4. The method for quantitative analysis of glandular structural atypia based on gastroscopy images as described in claim 3, characterized in that, After morphological processing, a binary mask of the gland is obtained, including: Each pixel in the processed probability map is judged using a set binary threshold. Pixels greater than or equal to the binary threshold are judged as glands, and pixels less than the binary threshold are judged as background. For each connected region identified as a gland, holes are filled, and the area of ​​all connected regions is calculated. If the area is less than the set area threshold, it is identified as noise and removed to obtain a binary mask of the gland.

5. The method for quantitative analysis of glandular structural atypia based on gastroscopy images as described in claim 1, characterized in that, Quantitative features extracted based on morphological dimensions include glandular lumen area, glandular lumen perimeter, roundness, elliptic fit, concavity / convexity, and boundary irregularity index. Quantitative features extracted based on structural arrangement dimensions include neighboring gland distance, gland orientation consistency features, Volonoj map features, and Delaunay triangulation features; The quantization features extracted based on the complexity dimension include fractal dimension, Gabor texture energy, and local binary mode variance.

6. The method for quantitative analysis of glandular structural atypia based on gastroscopy images as described in claim 1, characterized in that, The extracted multi-dimensional quantified features are trained using a gradient boosting decision tree model to output a heterogeneity index, and feature importance analysis is performed, including: The quantitative features extracted from the three dimensions of morphology, structural arrangement, and complexity are standardized and then concatenated into a one-dimensional array. The one-dimensional array is input into the gradient boosting decision tree model, trained using the set training labels, and the output probabilities are weighted and summed based on the set weight coefficients to obtain the heterogeneity index. Feature importance analysis based on the SHAP method.

7. The method for quantitative analysis of glandular structural atypia based on gastroscopy images as described in claim 6, characterized in that, Feature importance analysis based on the SHAP method includes: Calculate the SHAP value for each quantified feature of each of the glandular structures; Calculate the SHAP values ​​of the quantified features of all glandular structures on the binary mask of the gland, take the absolute values ​​and calculate the average value to obtain the importance ranking of each glandular structure.

8. A system for quantitative analysis of glandular structural atypia based on gastroscopy images, applied to the method for quantitative analysis of glandular structural atypia based on gastroscopy images as described in claim 1, characterized in that, The glandular structural heterogeneity quantitative analysis system based on gastroscopy images includes a data acquisition module, a mask image generation module, a feature extraction module, and a quantitative analysis module. The data acquisition module is used to perform color correction and image contrast enhancement processing on the acquired raw gastroscopy images, and to construct the corresponding image pyramid. The mask image generation module is used to input the image in the image pyramid into the improved deep learning model for learning using a multi-channel fusion input method, and obtain the gland binary mask after morphological processing. The feature extraction module is used to extract quantitative features of a single gland structure from the gland binary mask based on three dimensions: morphology, structural arrangement, and complexity. The quantitative analysis module is used to train the extracted multi-dimensional quantitative features through a gradient boosting decision tree model, output the heterogeneity index, and perform feature importance analysis.

Citation Information

Cited By

  • A gastric cancer tissue slice image noise suppression method and system

    CN122347523A