A lung fibrosis quantitative evaluation and spatial positioning method and system based on full-slice image weakly supervised tissue pattern aggregation

CN122989675APending Publication Date: 2026-10-27FUJIAN NORMAL UNIV
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
CN202611218974.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-08-12
Publication Date
2026-10-27

AI Technical Summary

Benefits of technology

[0032]本发明还提供一种电子设备,包括处理器和存储器,所述存储器中存储有计算机程序,所述计算机程序被所述处理器执行时,使所述电子设备实现上述方法。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122989675A_ABST
    Figure CN122989675A_ABST
Patent Text Reader

Abstract

The application provides a lung fibrosis quantitative evaluation and spatial positioning method based on full-slice image weakly supervised tissue pattern aggregation, and belongs to the field of digital pathology image processing. The method acquires a lung tissue full-slice image and extracts image blocks and spatial coordinates, and only uses a full-slice level reference fibrosis score as a supervision signal in the training stage; image block level features are extracted from each image block; in each full-slice image, a plurality of candidate tissue pattern division schemes are compared based on the features, and the optimal scheme is independently selected according to an internal effectiveness index to obtain a number of self-adaptive tissue pattern clusters; a cluster level fibrosis score is predicted by calculating a cluster internal feature mean vector and using a regression model; the cluster level score is assigned to each image block in the cluster and is aggregated by weighting according to the number of image blocks to obtain a full-slice level quantitative score; and a spatial distribution heat map is generated according to the spatial coordinates and the assigned score. The application realizes accurate evaluation and spatial positioning under small sample weak supervision.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the technical fields of biomedical image processing, digital pathology, computational pathology, and artificial intelligence-assisted scientific research image analysis. Specifically, it relates to a method and system for quantitative assessment and spatial localization of pulmonary fibrosis based on weakly supervised tissue pattern aggregation of whole-slice images. Background Technology

[0002] Pulmonary fibrosis is a pathological process characterized by collagen deposition, abnormal accumulation of extracellular matrix, thickening of alveolar septa, and tissue remodeling. In animal model drug efficacy evaluation, radiotherapy and chemotherapy-related lung injury studies, and lung tissue pathology studies, Masson staining can highlight collagen fiber deposition, and the Ashcroft score or similar semi-quantitative scores are often used to evaluate the degree of fibrosis.

[0003] With the development of whole-slice scanning technology, traditional microscope fields of view have been digitized into whole-slice images (WSI). WSI is characterized by high resolution, ultra-large size, and strong spatial heterogeneity. A single lung tissue WSI may simultaneously contain multiple tissue states, such as preserved alveolar structure, mild septal thickening, patchy collagen deposition, and dense fibrotic consolidation. Manual scoring relies on pathologists selecting fields of view and making subjective judgments, which is time-consuming and easily affected by field selection, experience differences, and inter-observer variability.

[0004] To improve the objectivity of fibrosis assessment, existing technologies have proposed various computational analysis schemes based on WSI, which can be broadly categorized into the following three types:

[0005] (1) Pixel-level / area quantification scheme based on staining specificity. Patent document CN122089696A discloses a method for image-based quantitative assessment of the degree of fibrosis in kidney pathological sections: after performing color normalization and contrast enhancement on Masson stained sections, pixel-level tissue component classification is performed through a multi-component semantic segmentation network, the fibrosis area ratio is statistically analyzed, and a ci score is output according to the Banff grading, while a fibrosis spatial distribution heatmap is generated. Patent document CN112514001B discloses a method for evaluating the fibrosis of tissue samples: based on stained images, multiple types of collagen images are generated, and parameters of each type of collagen are determined using a deep neural network trained by transfer learning, and then combined to obtain a quantitative fibrosis index. While such solutions can provide objective area metrics or quantitative indices, their pixel-level semantic segmentation or deep network training relies on large-scale fine annotation (such as hundreds of slices annotated by experts at the pixel level), which is costly and difficult to apply to small sample scenarios of animal models with only slice-level scores. Moreover, such solutions usually use area, density, or overall index as the statistical core, which makes it difficult to simultaneously characterize the morphology, texture, orientation of collagen fibers, and heterogeneity of tissue regions.

[0006] (2) Weakly supervised or unlabeled WSI classification / grading schemes. Patent document CN117408954B discloses a method for grading renal fibrosis based on a two-stage weakly supervised learning framework: using the WSI-level fibrosis grade as a weakly supervised label, screening local slice images strongly correlated with the WSI label through Monte Carlo discarding method, and then outputting the grading results through stitching and decision aggregation. Patent document CN119478503A discloses a histopathological image analysis method that does not require manual labeling: performing unsupervised clustering of image micro-patterns through variance-based feature selection, UMAP dimensionality reduction, and Leiden community detection to discover tissue structure categories, and using the clustering results as pseudo-labels to train a supervised classification model. Such schemes significantly reduce the label requirement, but their output is usually a discrete classification or grading result, making it difficult to provide continuous quantitative fibrosis scores; moreover, their clustering process and hyperparameters are preset fixed configurations, without adaptive adjustment for the tissue heterogeneity of a single WSI, and the clustering results are not directly correlated with slice-level quantitative scores.

[0007] (3) Two-level aggregation and grading scheme of patch-slice. Patent document CN118587483B discloses a method for basic lesion assessment of liver biopsy slices based on multi-scale feature extraction: first, a model trained by pathological prior knowledge is used to grade local lesions in image patches, and then the lesion grading at the whole slice level is achieved by aggregation of predicted means and adaptive patch proportion threshold. Although this scheme achieves hierarchical aggregation from patch to slice, the local model depends on a large number of patch-level pathological annotations, and the aggregation process is usually based on simple statistics or proportion thresholds, lacking deep coupling with tissue heterogeneity and spatial distribution.

[0008] In summary, under conditions of small sample size and weak labeling, existing technologies lack a method for analyzing whole-slice images of pulmonary fibrosis that can simultaneously output continuous quantitative scores and traceable spatial evidence, and adaptively characterize tissue heterogeneity, even with only slice-level reference scores available. Summary of the Invention

[0009] To address the shortcomings and deficiencies of existing technologies, this invention provides a method and system for quantitative assessment and spatial localization of pulmonary fibrosis based on weakly supervised tissue pattern aggregation from whole-slice images. The method takes whole-slice images of lung tissue as input, extracts multiple image patches and records their spatial coordinates. During the training phase, only a whole-slice-level reference fibrosis score is used as the supervision signal. After extracting image patch-level features from each image patch, multiple candidate tissue pattern partitioning schemes are compared within each whole-slice image. The optimal scheme is independently selected based on an internal effectiveness index, resulting in multiple tissue pattern clusters whose number is adaptively determined by the whole-slice image. A cluster-level fibrosis score is predicted for each tissue pattern cluster and assigned to image patches within the cluster. The clusters are then weighted and aggregated according to the number of image patches within the cluster to obtain a whole-slice-level quantitative score. The assigned cluster-level score is mapped back to the whole-slice image based on the spatial coordinates of the image patches, generating a fibrosis spatial distribution heatmap. The method can also output the localization result of the real-variable region based on spatial connectivity. This invention enables continuous quantitative assessment and spatial localization under small sample conditions with only weakly labeled slices, and provides traceable spatial evidence.

[0010] The specific technical solution adopted by this invention to solve its technical problem is as follows:

[0011] A method for quantitative assessment and spatial localization of pulmonary fibrosis based on weakly supervised tissue pattern aggregation of whole-slice images includes the following steps:

[0012] A whole-slice image of lung tissue is acquired, multiple image blocks are extracted from the whole-slice image and the spatial coordinates of each image block are recorded, wherein only the whole-slice level reference fibrosis score is used as a supervision signal during the training phase;

[0013] Extract image patch-level features from each image patch;

[0014] Within each full-slice image, multiple candidate organization pattern partitioning schemes are compared based on the image block-level features. The optimal organization pattern partitioning scheme for the full-slice image is selected independently based on the internal effectiveness index, resulting in multiple organization pattern clusters for the full-slice image. The number of organization pattern clusters for different full-slice images is adaptively determined.

[0015] For each tissue pattern cluster, the mean vector of image patch-level features of the image patches within the tissue pattern cluster is calculated, and the cluster-level fiber score of the tissue pattern cluster is predicted using a regression model trained with the full slice-level reference fiber score as the supervision signal.

[0016] The cluster-level fibrosis score of each tissue pattern cluster is assigned to each image patch within that tissue pattern cluster, and the cluster-level fibrosis score is weighted and aggregated according to the number of image patches contained in each tissue pattern cluster to obtain a full-slice level quantitative score for pulmonary fibrosis.

[0017] A heatmap of the spatial distribution of fiber is generated based on the spatial coordinates of each image patch and the cluster-level fiberization score assigned to it.

[0018] The aforementioned method uses tissue pattern clusters as an intermediary. First, an unsupervised clustering process aggregates image patches within each whole-slice image into tissue pattern clusters reflecting different tissue states (tissue pattern clusters can correspond to different tissue states such as preserved alveolar structures, mild septal thickening, patchy collagen deposition, and dense fibrotic consolidation). Then, at the cluster level, the mean vector of the features of the image patches within the cluster is used to predict cluster-level scores. These cluster-level scores are then assigned to each image patch within the cluster and weighted according to the number of image patches within the cluster to form a whole-slice-level score. Since the training phase relies only on the whole-slice-level reference score and does not depend on pixel-level or region-level manual annotation, this method is suitable for scenarios such as small-sample animal experiments with only slice-level scores. Furthermore, tissue pattern segmentation is performed independently within each whole-slice image, and the number of tissue pattern clusters is adaptively determined based on the comparison of candidate schemes and internal effectiveness evaluation results for that slice, adapting to differences in the degree of tissue heterogeneity between different slices. In addition, the hierarchical correspondence between cluster-level scores, image patch-level scores, and whole-slice-level scores allows the scoring results to be traced back to specific tissue pattern clusters and their spatial locations.

[0019] Further, extracting multiple image blocks from the full-slice image includes: performing tissue region detection on a downsampled image of the full-slice image to obtain a tissue region mask; extracting candidate image blocks on the full-slice image according to a preset window size; and retaining image blocks whose center is located within the tissue region and whose white background pixel ratio is lower than a preset threshold as valid image blocks.

[0020] By using tissue region detection and white background filtering, invalid image blocks whose centers are not within the tissue region or whose white background ratio is high can be removed. This allows subsequent feature extraction and clustering analysis to focus on effective tissue content and reduces the interference and computational overhead of background pixels on feature extraction. The preset threshold for the preset window size and the white background pixel ratio can be adjusted according to the image resolution and slice quality. For example, the window size can be selected as 256×256, 512×512, or 1024×1024 pixels, and the threshold for the white background pixel ratio can be selected as 0.90 to 0.98. The white background pixels can be determined by pixels in the HSV color space with a brightness greater than 200 and a saturation less than 30.

[0021] Further, extracting image block-level features from each image block includes: performing staining normalization on the tissue regions in each image block; generating collagen fiber-related representations, which include at least one of fiber binary maps, fiber grayscale maps, and fiber color maps; extracting manual fibrosis features from each image block, and extracting depth characterization features through a frozen pre-trained pathological image encoder, and fusing the two types of features to form image block-level fusion features.

[0022] Staining normalization can be performed in a color space where brightness and chroma are separated. Normalization parameters are statistically normalized based solely on tissue regions within image patches. Mean matching and standard deviation scaling are applied to the chroma channels, and the background area is set to white to reduce the impact of batch-to-batch staining variations on subsequent analysis. Collagen fiber representations characterize collagen fibers from different perspectives: the fiber binary map reflects the spatial distribution of fibers, the fiber grayscale map preserves the grayscale variation information of fibers, and the fiber color map preserves the color information of the tissue. These three representations respectively serve to extract different features such as fiber morphology, texture, and depth characterization. Manual fibrosis features may include at least one of the following: tissue area, tissue area ratio, fiber area, fiber area ratio, fiber number, average fiber width, average fiber length, average fiber area, average fiber perimeter, fiber perimeter-to-area ratio, fiber fractal dimension, fiber orientation mean, fiber orientation standard deviation, gray-level co-occurrence matrix texture features, gray-level statistical features, RGB channel statistical features, and blue channel collagen intensity features, characterizing fibrosis from dimensions such as area, density, morphology, orientation, texture, and staining intensity. A frozen pre-trained pathological image encoder extracts deep representation features without end-to-end parameter updates, supplementing high-level tissue context information. Optionally, the pre-trained pathological image encoder may be a PLIP-type image encoder, outputting a fixed-length vector, such as 512-dimensional.

[0023] Furthermore, the method also includes a feature engineering step: performing dimensionality reduction processing on the image block-level fusion features to obtain a low-dimensional clustering representation for organization pattern segmentation; selecting a set of scoring features with a fixed order based on the cross-whole slice variability of candidate features, their correlation with the low-dimensional clustering representation, and their correlation with the whole slice-level reference fiberization score; wherein, organization pattern segmentation is based on the low-dimensional clustering representation, and cluster-level fiberization score prediction is based on the intra-cluster mean vector of the scoring feature set.

[0024] The aforementioned feature engineering constructs two feature paths with different purposes: low-dimensional clustering representation for organizational pattern discovery, and a scoring feature set for cluster-level score prediction. The dimensionality reduction can employ UMAP, PCA, or kernel PCA, reducing dimensionality and noise while preserving the main structural information between image patches, thus serving clustering. The scoring feature set integrates the information content of features, their correlation with organizational pattern structure, and their relevance to fibrillation scores, retaining features closely related to the degree of fibrillation and maintaining a fixed order. Combined with standardized parameters saved during the training phase, this ensures consistency in feature processing between the training and inference phases. These two paths are independent and not interchangeable, allowing organizational pattern discovery and score prediction to each perform their respective functions.

[0025] Furthermore, comparing multiple candidate organizational pattern partitioning schemes and selecting the optimal organizational pattern partitioning scheme includes: within a preset clustering number range, comparing the clustering results of multiple candidate clustering algorithms under different clustering numbers to obtain multiple candidate organizational pattern partitioning schemes; calculating an internal validity index for each candidate organizational pattern partitioning scheme, wherein the internal validity index includes at least two of the silhouette coefficient, Calinski-Harabasz index, and Davies-Bouldin index; performing co-directional normalization on each internal validity index, weighted summing, and subtracting the oversegmentation penalty term related to the number of clusters to obtain a comprehensive score; and selecting the candidate organizational pattern partitioning scheme with the highest comprehensive score as the optimal organizational pattern partitioning scheme.

[0026] The candidate clustering algorithm may include at least one of K-means clustering, spectral clustering, and hierarchical clustering, and the preset number of clusters may range from 1 to 9. Internal validity indices measure clustering quality from different perspectives. For example, the silhouette coefficient reflects the balance between intra-cluster compactness and inter-cluster separation; the Calinski-Harabasz index reflects the ratio of inter-cluster dispersion to intra-cluster dispersion; and the Davies-Bouldin index reflects a measure of inter-cluster similarity. Indices with different directions are made numerically comparable through unidirectional normalization; that is, indicators with larger values ​​are positively normalized, and indicators with smaller values ​​are negatively normalized. When the candidate value is constant, the normalized value is set to a preset fixed value, and then weighted and summed according to preset weights (e.g., 0.5, 0.3, and 0.2). The oversegmentation penalty term increases with the number of clusters to suppress oversegmentation caused by setting too many clusters. By simultaneously comparing multiple algorithms and combinations of multiple clustering numbers, and by integrating internal effectiveness evaluation and oversegmentation penalty, an organizational pattern partitioning scheme that is appropriate for the degree of organizational heterogeneity can be selected for the slice in the candidate space.

[0027] Furthermore, the regression model is a ridge regression model, and its regularization coefficient is selected from the candidate set through cross-validation; the cluster-level fiber score is calculated as follows: the mean vector of image block-level features of image blocks within the cluster is standardized according to the standardized parameters saved during the training phase, and the predicted value is obtained by calculating the regression coefficient and intercept, and the predicted value is restricted to a preset score range.

[0028] Ridge regression strikes a balance between fitting ability and generalization ability through regularization. It can stably estimate regression coefficients and maintain interpretability even with small samples and correlations between features. The regularization coefficients are determined by cross-validation, for example, within a range of 10. -4 Up to 10 4Candidate values ​​are selected at logarithmic intervals. During the training phase, the order of scoring features, missing value imputation parameters, standardization parameters, regression coefficients, intercepts, and regularization coefficients are saved. During the inference phase, calculations are performed using the same parameters to ensure consistency between training and inference. Limiting predicted values ​​to a preset scoring range (e.g., 0 to 8 for a fiberized scoring system) avoids outputting outliers that exceed a reasonable range.

[0029] Furthermore, the method also includes a solid region localization step: screening image blocks with assigned cluster-level fibrosis scores reaching a preset high-level threshold; performing connected component analysis on the screened image blocks based on spatial adjacency relationships, selecting the connected component with the largest number of image blocks; and determining the region corresponding to the selected connected component as the solid region of pulmonary fibrosis and outputting it.

[0030] This step, based on cluster-level fibrosis scoring that is homologous to the full-slice-level scoring, filters high-scoring image patches and merges them into continuous regions through spatial connectivity analysis. The connected region with the largest number of image patches is selected as the real region output, providing a reference for the spatial localization of fibrotic lesions. The preset high-level threshold can be set according to the scoring system, for example, 4; the spatial adjacency relationship can adopt the adjacency rule that the Chebyshev distance is no greater than a preset interval, for example, 2 image patches. Manual region annotation is only used for evaluating the localization results and is not used as input for inference of new full-slice images.

[0031] This invention also provides a quantitative assessment and spatial localization system for pulmonary fibrosis based on weakly supervised tissue pattern aggregation of whole-slice images, comprising: an image input module for receiving whole-slice images of lung tissue, wherein only whole-slice-level reference fibrosis scores are used as supervision signals during the training phase; an image patch extraction module for extracting multiple image patches from the whole-slice images and recording the spatial coordinates of each image patch; a feature extraction module for extracting image patch-level features from each image patch; and a dynamic tissue pattern discovery module for comparing multiple candidate tissue pattern partitioning schemes within each whole-slice image, independently selecting the optimal tissue pattern partitioning scheme for the whole-slice image based on an internal effectiveness index, thereby obtaining multiple tissue patterns of the whole-slice image. The number of tissue pattern clusters in different full-slice images is adaptively determined. A cluster-level scoring module calculates the mean vector of image patch features for each tissue pattern cluster, predicts the cluster-level fiber score of the tissue pattern cluster using a regression model trained with the full-slice-level reference fiber score as a supervision signal, and assigns the cluster-level fiber score to each image patch within the tissue pattern cluster. An aggregation scoring module weights and aggregates the cluster-level fiber scores of each tissue pattern cluster according to the number of image patches contained in each tissue pattern cluster to obtain a full-slice-level quantitative score. A spatial output module generates a fiber spatial distribution heatmap based on the spatial coordinates of each image patch and its assigned cluster-level fiber score.

[0032] The present invention also provides an electronic device, including a processor and a memory, wherein the memory stores a computer program, and when the computer program is executed by the processor, the electronic device performs the above-described method.

[0033] The present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the above-described method.

[0034] Compared to existing technologies, this invention and its preferred scheme rely solely on whole-slice-level reference fibrosis scores as weak supervision signals, without relying on pixel-level or region-level manual annotation. This makes it suitable for scenarios with limited sample sizes, such as animal models, research samples, and drug efficacy evaluations, reducing reliance on large-scale, finely annotated data. By independently comparing and selecting the optimal tissue pattern division scheme within each whole-slice image, the number of tissue pattern clusters is adaptively determined according to the tissue heterogeneity of the slice itself, adapting to differences in fibrosis degree and tissue structure complexity among different slices. By using tissue pattern clusters as an intermediary for cluster-level scoring and weighted aggregation based on the number of image blocks within the cluster, a mapping path from local tissue patterns to whole-slice-level scores is established, allowing the scoring results to be traced back to specific tissue pattern clusters and their spatial distribution. Even when the number of tissue pattern clusters in different slices is inconsistent, a consistent and continuous score can still be output. By mapping cluster-level scores back to whole-slice images according to image block spatial coordinates to generate spatial distribution heatmaps, and outputting real-variable region location results based on spatial connectivity, quantitative scoring and spatial evidence corroborate each other, facilitating the verification of analysis results. In addition, the scoring process uses a lightweight regression model, with the main computational cost concentrated in the preprocessing and feature extraction stages, which can be deployed on ordinary workstations or servers. Attached Figure Description

[0035] The present invention will be further described in detail below with reference to the accompanying drawings and specific embodiments:

[0036] Figure 1 This is a schematic diagram of the overall method and training / inference process of an embodiment of the present invention;

[0037] Figure 2 This is a schematic diagram of whole-section image preprocessing and collagen fiber related representation generation in an embodiment of the present invention; in the figure, (a) is a thumbnail of the original whole-section image, (b) is an example of image patch extraction, (c) is the staining normalization result, and (d) is the fiber extraction result;

[0038] Figure 3 This is a schematic diagram of the staining normalization effect based on tissue region according to an embodiment of the present invention; in the figure, (a) is the original image block, (b) is the reference image block, and (c) is the normalized image block;

[0039] Figure 4This is a schematic diagram illustrating the hybrid feature extraction, scoring feature selection, and low-dimensional representation construction in an embodiment of the present invention;

[0040] Figure 5 This is a schematic diagram illustrating dynamic clustering search, cluster-level scoring, and full-slice-level scoring aggregation in an embodiment of the present invention.

[0041] Figure 6 This is a full-slice-level fiber grading heat map and a schematic diagram of the localization of the real variation region in an embodiment of the present invention; in the figure, (a) is the original full-slice image, (b) is the fiber grading heat map, (c) is the manually marked real variation region, (d) is the automatically identified real variation region, and (e) is the evaluation comparison diagram.

[0042] Figure 7 This is an example diagram of regional pathological review in an embodiment of the present invention; in the diagram, (a) is the original regional image, (b) is a heat map of fibrosis grading, (c) is the manually annotated solid region, (d) is the automatically identified solid region, and (e) is a comparison between the automatic results and the manually annotated results;

[0043] Figure 8 This is a schematic diagram of the system, electronic device, and computer-readable storage medium structure according to an embodiment of the present invention. Detailed Implementation

[0044] The present invention will be further described in detail below with reference to specific embodiments and accompanying drawings. It should be understood that the following embodiments are for illustrative purposes only and are not intended to limit the scope of protection of the present invention. Those skilled in the art can adjust the staining method, scanning magnification, slice size, threshold, model, feature combination, clustering algorithm, and hardware implementation without departing from the concept of the present invention.

[0045] like Figure 1 As shown, this embodiment provides a method and system for quantitative assessment and spatial localization of pulmonary fibrosis based on weakly supervised tissue pattern aggregation of whole-slice images. Using Masson-stained whole-slice images of lung tissue as input and a whole-slice-level reference fibrosis score as a weakly supervised signal, the method achieves quantitative assessment and spatial localization of pulmonary fibrosis through tissue pattern aggregation. The overall process of this method includes: extracting effective image blocks from the whole-slice images and extracting image block-level features; adaptively determining a tissue pattern division scheme and obtaining multiple tissue pattern clusters within each whole-slice image through candidate scheme comparison and internal effectiveness evaluation; calculating the mean of features within each tissue pattern cluster, predicting a cluster-level fibrosis score using a regression model, and assigning the score to the image blocks within the cluster; weighting and aggregating the scores according to the number of image blocks within the cluster to obtain a whole-slice-level quantitative score; and finally generating a fibrosis spatial distribution heatmap based on the spatial coordinates of the image blocks, which can output the localization results of the real variation region. During the training phase, only the whole-slice-level reference score is needed to complete the model training; the region-level manual annotation is only used for evaluation and is not a necessary input for inference on new samples.

[0046] The specific implementation of each part will be described in detail below through multiple embodiments.

[0047] Example 1: Quantitative Assessment and Spatial Localization Methods for Pulmonary Fibrosis

[0048] (I) Tissue Region Detection and Effective Image Patch Extraction

[0049] In this embodiment, the input is a Masson-stained lung tissue whole-section image file. The system first reads the whole-section image and generates a downsampled image based on the image size. Preferably, the downsampling factor is 16. After converting the downsampled image to grayscale, an initial tissue mask is generated using Otsu thresholding, and the mask is inverted to make the tissue region correspond to the foreground. Then, the system uses... Structural elements perform morphological closing operations to connect small gaps in tissue regions and reduce noise.

[0050] After generating the tissue mask, the system locates the outer contour and selects the tissue contour with the largest area as the main tissue region. For each candidate image patch window, the system calculates the corresponding coordinates of its center point in the downsampling mask and uses the relationship between points and polygons to determine whether the center point is located inside the main tissue contour. If the center point is not inside the tissue contour, the candidate image patch is discarded.

[0051] For candidate image patches whose center point is located within the tissue outline, the system further calculates the proportion of white background pixels. Preferably, the system converts the slices to the HSV color space and adjusts the brightness... Greater than 200 and saturation Pixels with a value less than 30 are considered white background pixels, and the white background ratio is calculated. The slice is saved when the white background ratio is less than a white background threshold. The preferred white background threshold is 0.95, but it can be adjusted between 0.90 and 0.98 depending on the data quality.

[0052] The system saves the filename and top-left corner coordinates of each valid image block. and The proportion of white background and the proportion of tissue area.

[0053] (ii) Adaptive staining normalization based on tissue region

[0054] In this embodiment, the system performs staining normalization on the effective image blocks. The system reads a preset reference slice and generates tissue masks for both the slice to be processed and the reference slice. Preferably, the tissue mask is obtained by converting the RGB image to a grayscale image and determining whether the grayscale value is less than 240. When the number of tissue pixels in the slice to be processed is less than 100, the system considers the tissue region of the slice to be too small and skips normalization.

[0055] The system converts the slice to be processed and the reference slice to the Lab color space. For Channels and In this channel, the system only calculates the mean and standard deviation of pixels within the tissue region, and then calculates the ratio of the mean difference and standard deviation between the reference tissue pixels and the pixels of the tissue to be processed. To avoid extreme color correction, the standard deviation ratio is limited to a certain range. to Between. Subsequently, only within the organizational area. Channels and The channel performs mean matching and standard deviation scaling correction.

[0056] As a preferred implementation, the preset reference slices are selected as follows: A Masson-stained whole-slice image with moderate fibrosis and a tissue region coverage area of ​​over 60% is selected from the training set. Valid image blocks are extracted from its downsampled image using the same tissue region detection and white background filtering process. A set of several (preferably 20) valid image blocks is randomly selected as the reference slice set; the reference slice set... Channel mean, Channel mean and The channel mean is recorded as the reference mean and used as the baseline for coloring normalization for all images to be processed. When the training set contains multiple coloring batches, a reference slice set can be created for each batch to further improve the batch adaptability of coloring normalization.

[0057] Preferably, the system performs minor hue and brightness adjustments on the tissue region after normalization, including... The number of channels has increased by 4. Channel 6 increased The number of channels will be increased to 8, and will Channel restrictions to , / Channel restrictions to Finally, the Lab image is converted back to an RGB image, with the tissue areas normalized and the background areas either left as their original background or set to pure white. The system simultaneously saves both the normalized color image and the normalized grayscale image.

[0058] like Figure 3As shown, the above-mentioned staining normalization method based on tissue regions can effectively reduce staining differences between different sections while maintaining a white background area. The image shows image patches representing low, medium, and high fibrosis levels from top to bottom. The left side is the original image patch, the middle is the reference image patch, and the right side is the normalized image patch. It can be seen that the color distribution of images with different fibrosis levels tends to be consistent after normalization, which helps improve the stability of subsequent fiber segmentation and feature extraction.

[0059] (III) Collagen fiber-related representation generation

[0060] In this embodiment, the system takes a normalized color image patch with a white background as input and generates a fiber color image, a fiber grayscale image, and a fiber binary image. Figure 3 Collagen fiber-related representation. The system first uses a staining vector estimation method based on Macenko principal component analysis to perform color deconvolution and obtain multiple staining separation channels. Based on the preset channel order, channel statistics, or consistency with the Masson collagen blue signal, collagen fiber-related candidate channels are determined from the staining separation channels, and another staining separation channel is used as an auxiliary channel for background and non-target tissue suppression.

[0061] The system analyzes candidate and auxiliary channels related to collagen fibers. Gaussian filtering is used to reduce noise. Background suppression is constructed by combining the Otsu thresholding result of the auxiliary channel with the highlight threshold of the collagen fiber-related candidate channels; pixels with candidate channel values ​​greater than 220 can be used as highlight background candidates. Non-target tissue suppression preferably uses the 75th percentile threshold of the auxiliary channel, combined with the intensity range of the candidate channels from the 35th percentile to the 75th percentile.

[0062] The system further employs a dual-threshold strategy to extract fiber candidates. Low threshold... Used to capture weakly stained or fine fibers, high threshold Used to define high-confidence core fibers. Preferably, Take the 20th percentile. Take the 55th percentile. The high-threshold region is... After morphological closing operation, it is used as the core fiber region; for each core fiber connected region, the system performs binary dilation a preset number of times, preferably 4 times, and intersects with the low threshold candidate region, thereby supplementing weak signal fibers.

[0063] The system merges the core fiber region and supplementary fiber region, and removes the background and non-target tissue regions. Then, morphological closing operations and connected component analysis are performed to remove regions with areas smaller than the minimum connected component area. The minimum connected component area is preferably 30 pixels. Finally, the system confines the fiber mask within the tissue mask to generate a strictly binary fiber map. The system also uses the strict mask to generate a fiber grayscale image and uses a loose mask to retain the original normalized tissue color on a white background to generate a fiber color image.

[0064] As a preferred implementation, the loose fiber mask is obtained by performing a preset number of binary dilation operations (preferably 2 times) on a strict binary fiber map, and confining the dilated mask within a tissue mask, thereby obtaining a loose fiber mask. The area covered by the loose fiber mask is slightly larger than the strict fiber region, used to preserve the tissue context information around the fibers in the fiber color image, so as to facilitate the depth image encoder to extract richer representations. The fiber grayscale image is generated based on the strict binary fiber map, that is, only the grayscale values ​​within the strict fiber region are retained, and the remaining areas are set to background grayscale.

[0065] The system further calculates basic indicators for each slice, such as slice area, tissue area, fiber mask area, fiber mask area ratio, and tissue area ratio, and saves the results as a structured statistical file for subsequent feature extraction and result verification.

[0066] like Figure 2 As shown, the process of generating collagen fiber-related representations from the original whole-section image includes three stages: tissue region detection and image patch extraction, staining normalization, and fiber extraction. In the figure, (a) is a thumbnail of the original whole-section image; (b) is an example of a valid image patch extracted within the tissue region according to a preset window size; (c) shows the staining normalization result, where (c1) is the normalized color image and (c2) is the normalized grayscale image; and (d) shows the fiber extraction result, where (d1) is the fiber color image, (d2) is the fiber grayscale image, and (d3) is the morphologically processed fiber binary image. The three types of fiber representations serve different feature extraction needs: the fiber color image is used for depth characterization extraction, the fiber grayscale image is used for texture analysis, and the fiber binary image is used for morphological feature calculation.

[0067] (iv) Hybrid Feature Extraction

[0068] In this embodiment, the system extracts hybrid features for each slice. Manual features are calculated based on normalized tissue images, fiber grayscale images, and fiber binary images. Area and density features include slice area, tissue area, tissue area ratio, fiber mask area, and fiber mask area ratio. Fiber morphology features are obtained through connected component analysis, including fiber quantity, average fiber width, average fiber length, average fiber area, average fiber perimeter, and fiber perimeter-to-area ratio.

[0069] The system also calculates the fiber fractal dimension to describe the fiber network complexity. Preferably, a box-counting method is used to convert the binary fiber map into a Boolean matrix, count the number of boxes containing fiber pixels at multiple box scales, fit the slope at a logarithmic scale, and take the negative slope as the fiber fractal dimension.

[0070] Fiber orientation features are obtained through orientation attributes in connected component regions, including fiber orientation mean and fiber orientation standard deviation. Fiber texture features are constructed based on a gray-level co-occurrence matrix of the fiber grayscale image; in a preferred implementation, the grayscale values ​​are divided by 8 to convert them into unsigned integers, and contrast, homogeneity, and energy are calculated under a distance of 1, an orientation of 0 radians, and symmetry and normalization settings.

[0071] Intensity features include the mean, standard deviation, maximum, skewness, kurtosis, and entropy of the normalized tissue grayscale image within the tissue region, as well as the mean and standard deviation of each RGB channel. For fiber color images, the mean of the fiber blue channel can also be calculated to reflect the collagen-related blue intensity in Masson staining.

[0072] Deep representation features are extracted from a frozen pre-trained pathology image encoder. Preferably, the system loads a local PLIP / CLIP-type pathology image encoder and its preprocessor, inputs fiber color images into the encoder, and obtains a 512-dimensional vector through the final image feature interface. The model is placed in evaluation mode and performs batch inference in a gradient-free environment; preferably, a CUDA-compatible GPU and half-precision inference are used, with a batch size preferably of 16. The encoder does not use this small sample data for end-to-end training.

[0073] (v) Feature selection, dimensionality reduction and model input construction

[0074] In this embodiment, the system concatenates the handcrafted features and deep representation features of each slice to form a high-dimensional fused feature. Since the fused feature has a high dimension and redundancy, the system first standardizes the numerical features and excludes non-feature fields such as slice name, image number, coordinates, cluster label, prediction score, and confidence level.

[0075] The system can randomly sample a certain proportion of slices from all training full-slice images for global dimensionality reduction model fitting, preferably sampling 10% of slices from each full-slice image, with a minimum of 20 slices. Preferably, the UMAP model is set to 15 dimensions, a neighborhood parameter of 10, a minimum distance of 0.0, Euclidean distance as the distance metric, spectral initialization, and a random seed of 42. The UMAP low-dimensional representation is used for pattern discovery and visualization, while the final quantitative score is still based on a selected subset of interpretable features.

[0076] For the full-slice image-level scoring model, the system first aggregates the slice feature statistics of each full-slice image to obtain a candidate feature table for each full-slice image. Then, the system calculates the variance ranking across full-slice images, the UMAP feature importance ranking, and the correlation with the reference score.

[0077] UMAP ranking score can be defined as:

[0078]

[0079] in, This represents the ranking score associated with the dimensionality reduction components. The total number of candidate features. This represents the ranking of this feature in UMAP importance.

[0080] As a preferred implementation, the Determined in the following manner: for each candidate feature Calculate the absolute value of the Pearson correlation coefficient between the feature and each component (preferably 15 components) in the UMAP low-dimensional representation, and take the maximum value as the correlation degree between the feature and the UMAP low-dimensional representation; sort all candidate features in descending order of this correlation degree, and the resulting ranking is the [ranking]. The feature with the highest correlation The value is 1. As a further preferred implementation, a random forest regressor can be used to train the model with each component of UMAP as the target and candidate features as input. The average reduction in impurity of each feature in the random forest is taken as the feature importance, and the features are ranked accordingly. .

[0081] The variance ranking score can be defined as:

[0082]

[0083] in, This represents the variance ranking score across the entire slice image. The total number of candidate features. This is the ranking of the feature in the variance across the whole slice image.

[0084] The relevance score can be defined as:

[0085]

[0086] in, The normalized score represents the correlation with the reference fibrosis score. Features Compared with reference score The correlation coefficient, It represents the maximum absolute value of the correlation coefficient among all candidate features.

[0087] As a preferred implementation, when the sum of the absolute values ​​of the correlation coefficients between all candidate features and the reference score is zero or close to zero (e.g., the extreme case where all features and the score are not correlated). Set as unified This means that all features score the same on this dimension, which does not affect the overall ranking; in this case, feature selection is mainly determined by... and leading.

[0088] The system weights and merges the three types of scores to obtain:

[0089]

[0090] in, To achieve a comprehensive feature score, , , These are weighting coefficients, and preferably all three are 1.

[0091] After ranking the candidate features, the system employs relevance redundancy removal: when the absolute correlation coefficient between two candidate features exceeds 0.85, the feature with the higher overall score is retained. The final output is the top-ranked feature. The mixed feature subset is preferably the top 30 feature set.

[0092] On a typical set of Masson-stained mouse lung tissue whole-section image validation data, after sorting by the comprehensive score according to the above three criteria and removing redundancy, the final top-30 mixed features (in descending order of comprehensive score) include, for example:

[0093] The hand-fiberized features include, for example, the following: fiber area ratio, average fiber width, average fiber length, fiber fractal dimension, fiber orientation mean, fiber orientation standard deviation, fiber GLCM contrast, fiber GLCM homogeneity, fiber GLCM energy, fiber quantity, fiber perimeter-to-area ratio, tissue area ratio, tissue region grayscale mean, tissue region grayscale standard deviation, tissue region grayscale entropy, fiber blue channel mean, RGB channel mean, RGB channel standard deviation, grayscale skewness, and grayscale kurtosis.

[0094] The deep representation features include, for example, several of the following: the dimensions in the 512-dimensional vector output by the PLIP encoder that are most strongly associated with the fibrotic tissue pattern.

[0095] The above-mentioned specific feature list is an exemplary implementation method. The actual selected features are automatically determined by the training data through the comprehensive scoring formula and redundancy removal rules, and do not constitute a limitation on the scope of protection.

[0096] like Figure 4As shown, the feature engineering in this embodiment adopts a dual-path architecture: a manual feature branch and a deep representation branch are extracted in parallel, and after being concatenated to form image block-level fusion features, they are respectively entered into the organization pattern path and the scoring path. The organization pattern path obtains a low-dimensional clustering representation through standardization and UMAP dimensionality reduction, which is used for subsequent dynamic clustering and organization pattern discovery; the scoring path obtains a scoring feature set with a fixed order through a comprehensive evaluation of cross-slice variance ranking, UMAP correlation ranking, and reference score correlation ranking, combined with redundancy removal, which is used for subsequent cluster-level regression scoring. The two paths are related but have different uses, taking into account the stability of organization heterogeneity modeling and quantitative scoring.

[0097] (vi) Dynamic clustering search and organizational pattern aggregation

[0098] In this embodiment, the system performs dynamic clustering search based on the slice features within each whole-slice image. Different whole-slice images exhibit varying tissue heterogeneity, and a fixed number of clusters may lead to oversegmentation of mildly fibrotic samples or undersegmentation of severely fibrotic samples. Therefore, this invention searches for candidate clustering schemes within a preset number of clusters and compares various clustering algorithms.

[0099] Preferably, the candidate clustering algorithms include K-means clustering, spectral clustering, and hierarchical clustering. K-means clustering uses k-means++ initialization, with a preferred number of initialization iterations of 10. Spectral clustering uses nearest neighbor graph affinity, with preferred candidate values ​​for the number of nearest neighbors being 8, 12, and 16, and the label assignment method preferably being discretized; when the number of samples is too large or the number of nearest neighbors is not less than the number of samples, the corresponding spectral clustering configuration can be skipped. Hierarchical clustering uses Ward's algorithm or average connectivity.

[0100] For each candidate clustering scheme, the system calculates the silhouette coefficient. Calinski-Harabasz index and Davies-Bouldin index .because , and Due to differences in the units of measurement and optimization direction, the system normalizes the three types of indicators within the candidate scheme set of the same full-slice image:

[0101]

[0102]

[0103]

[0104] in, , , These are the normalized silhouette coefficient, Calinski-Harabasz index, and Davies-Bouldin index, respectively. , These are the minimum and maximum values ​​of the silhouette coefficient in the candidate set, respectively; , These are the minimum and maximum values ​​of the Calinski-Harabasz index in the candidate set, respectively; , These are the minimum and maximum values ​​of the Davies-Bouldin index in the candidate set, respectively. When any index is constant within the candidate set, its normalized value is set to 0.5.

[0105] The system further introduces an over-segmentation penalty term, and the comprehensive score is defined as follows:

[0106]

[0107] in, For the number of clusters is The overall internal validity score at that time; This represents the current number of candidate clusters; and These represent the lower and upper limits of the number of candidate clusters participating in the ranking; This is the over-segmentation penalty coefficient. Preferably, , , The candidate scheme with the highest score is used as the organizational pattern segmentation result for the current full-slice image.

[0108] In some implementations, it is possible to As a fallback to a single-cluster solution. This is useful when internal validity metrics require at least two clusters. The proposed solution is not included in the ranking of indicators, or is assigned a fixed low score, and is only used as a fallback output when a valid multi-cluster solution is unavailable.

[0109] As a preferred implementation, when the number of valid image patches in the full slice image to be analyzed is too small (e.g., less than 20) to allow for reliable dynamic clustering search, the system automatically adopts a single-cluster backoff scheme: treating all valid image patches as a single organizational pattern cluster, directly calculating the mean of the scoring features of all image patches, using a trained regression model to predict the full slice image-level score, and uniformly assigning this score to all image patches to generate a heatmap. In this case, the real-variable region localization function can be downgraded to: outputting the bounding rectangle of the image patch with the highest preset ratio score.

[0110] As a further preferred implementation, when the number of valid image patches in a full-slice image in the training set is insufficient to participate in UMAP global dimensionality reduction fitting, the full-slice image does not participate in UMAP model fitting, but still participates in scoring feature selection and regression model training.

[0111] After clustering, the system calculates the intra-cluster mean vector of the scoring feature set for each tissue pattern cluster and records the number of image patches in that cluster. The intra-cluster mean vector is used for scoring, while the low-dimensional UMAP coordinates are mainly used for tissue pattern segmentation. Tissue pattern clusters can correspond to preserved alveolar regions, mild fibrotic remodeling regions, collagen deposition regions, or dense, high-load regions, thus providing traceable intermediate evidence for whole-slice image-level quantitative scoring.

[0112] For a full slice image containing multiple tissue pattern clusters and multiple valid image patches, the system uses a trained regression model to obtain the score of each cluster, assigns the cluster score to all image patches within the cluster, and calculates the arithmetic mean of the cluster scores corresponding to all valid image patches. Thus, it can maintain a uniform scalar output when different full slice images have different numbers of clusters.

[0113] (vii) Lightweight regression quantitative scoring

[0114] As a preferred implementation, the training samples of the ridge regression model are feature vectors at the full-slice image level. That is, for each training full-slice image, the score features of all its valid image blocks are arithmetically averaged according to the feature dimension to obtain the full-slice image level mean feature vector of the full-slice image. The ridge regression model is trained with the full-slice image level mean feature vector of all training full-slice images as input and the reference fiber score of the corresponding full-slice image as the target value.

[0115] The regression coefficients and intercepts obtained through this training are applicable to both direct scoring of the mean feature vector at the full slice image level and cluster-level scoring of the intra-cluster mean feature vector of the organizational pattern cluster. Both are on the same mean statistic in the same feature space, ensuring consistency between training and inference.

[0116] In this embodiment, the system uses the filtered hybrid features to train a lightweight regression model. Preferably, the system uses StandardScaler to standardize the features of the training full-slice image, removes zero-variance or constant features, and trains the ridge regression model using a reference fiberization score as the target value.

[0117] The regularization coefficients of the ridge regression model are selected from the candidate set using RidgeCV. Preferably, the candidate regularization coefficients are... to The system uses 50 log-interval values ​​between each pair of values. The number of internal cross-validation folds is determined by the sample size and is at most 5 folds. The scoring criterion is negative mean absolute error. If Rhodochrosite regression is unavailable, it can be reverted to ordinary linear regression. After model training is complete, the system saves the model coefficients, intercept, regularization coefficient, scoring feature names and order, missing value imputation parameters, standardized mean, and standardized scale.

[0118] As a preferred implementation, the weakly supervised training objective of this scheme can be expressed as:

[0119]

[0120] in, To train the number of full slice images, For the first Reference fiberization score (weakly supervised label) for Zhang Quan slice image. For the first The predicted score of Zhang Quan's slice image, i.e., the cluster-level score of each tissue pattern cluster is weighted by the number of image patches within the cluster:

[0121]

[0122] in, For the first The number of tissue pattern clusters in Zhang Quan's slice image. For the first Number of image patches in a cluster This represents the total number of valid image blocks in the full slice image. For the first Cluster-level score (predicted by ridge regression based on the cluster mean feature). Let be the ridge regression regularization coefficient.

[0123] Since the weighted average of the mean within a cluster is equal to the mean of the features of all image patches, the above objective is equivalent to directly training ridge regression on the mean features of the whole slice image. Thus, while maintaining mathematical simplicity, the method is given spatial interpretability and organizational heterogeneity modeling ability through dynamic clustering of each whole slice image and cluster-level scoring.

[0124] During the inference phase, the system constructs an intra-cluster mean vector for each organizational pattern cluster according to the scoring feature order saved during the training phase. Missing values ​​are imputed in the same manner as during training, and the input vectors are standardized in the same way. The cluster-level fibrillation score is then calculated using regression coefficients and intercepts. The cluster-level fibrillation score is calculated using the following formula:

[0125]

[0126] in, For the first Cluster-level scores for each organizational pattern cluster. For the number of scoring features, For the first The first organizational pattern cluster The within-cluster mean of each rating feature, and The first The standardized mean and standardized scale of each scoring feature are preserved during the training phase. For the first The regression coefficients corresponding to each rating feature The intercept is... and These are the lower and upper limits of the preset scoring range, respectively.

[0127] After assigning the score to all image blocks within a cluster, a full-slice image-level score is obtained by weighting the scores according to the number of image blocks within the cluster. As a preferred implementation, the lower limit of the preset score range... and upper limit The values ​​0 and 8 correspond to the numerical ranges of the Ashcroft fibrosis scoring system (0 for normal lung tissue, 8 for complete fibrotic consolidation). During the inference phase, cluster-level scores are limited to... Within the range, it can prevent scores from going out of bounds due to extreme feature combinations, ensuring that the output results are always within the pathologically interpretable range.

[0128] Besides ridge regression, this invention can also use linear regression, Lasso regression, elastic networks, support vector regression, multilayer perceptrons, or other lightweight supervised models as score mappers. However, preferably, ridge regression can stabilize coefficient estimation under conditions of small samples and high correlation features, while maintaining good interpretability.

[0129] like Figure 5 As shown, the complete process of dynamic clustering search and cluster-level score aggregation is as follows: Using the low-dimensional representation of image patches from a single full-slice image as input, various candidate clustering schemes, such as K-means, spectral clustering, and hierarchical clustering, are compared within a preset number of clusters. The silhouette coefficient, Calinski-Harabasz index, and Davies-Bouldin index of each scheme are calculated. After in-place normalization within the candidate set, the results are weighted and summed, and an oversegmentation penalty is deducted. The scheme with the highest comprehensive score is selected as the optimal organizational pattern partition. Subsequently, the mean score feature of each organizational pattern cluster is calculated. A trained ridge regression model is applied to predict the cluster-level fiberization score, and the cluster score is assigned to all image patches within the corresponding cluster. Finally, the full-slice image-level fiberization score is obtained by weighting the scores according to the number of image patches within the cluster. When an effective multi-cluster scheme is unavailable, the system reverts to a single-cluster scheme.

[0130] (viii) Spatial heat map and location of real change area

[0131] In this embodiment, the system maps the score of the tissue pattern cluster to which each image patch belongs back to the full-slice image thumbnail according to the original coordinates of the image patch. The system calculates the scaling ratio based on the original full-slice image size and the thumbnail size, draws each image patch as a rectangular area at the corresponding position, and uses discrete or continuous color bands to represent the score; this verification implements the drawing of cluster-level scores after rounding to discrete levels.

[0132] The system can overlay heatmaps and full-slice image thumbnails with preset transparency, preferably with a thumbnail weight of 0.6 and a heatmap weight of 0.4, and add color bars and the final full-slice score to the image. This spatial heatmap allows researchers to observe areas that the model considers to have a high fibrosis burden, rather than just obtaining a numerical value at the full-slice image level.

[0133] Real-variant region localization is achieved through threshold filtering and spatial connectivity analysis. The system first selects slices with prediction scores greater than or equal to a preset threshold, preferably 4. Then, the candidate image patches are converted to grid coordinates, and connectivity relationships are constructed based on adjacency rules where the Chebyshev distance is no greater than a preset interval. The preset interval is preferably two slices. The system traverses all candidate image patches, finds the largest connected component, and merges the rectangular regions corresponding to the largest connected component into the real-variant region result.

[0134] like Figure 6 As shown, the spatial output of this embodiment includes a full-slice-level fibrosis grading heatmap and solid region localization results. Figure (a) shows the original full-slice image, with six representative regions A to F selected; (b) shows the fibrosis grading heatmap obtained by projecting the image patch scores back onto the full-slice coordinates, with different colors representing different fibrosis levels; (c) shows the solid regions manually annotated by pathologists; (d) shows the solid regions automatically identified through threshold filtering and connected component analysis; and (e) shows a comparison of the automatic results and manually annotated evaluations, where green represents overlapping areas, yellow represents missed detection areas, and red represents false detection areas. This spatial output provides researchers with traceable visual evidence, facilitating pathological review of quantitative scoring results.

[0135] To verify the spatial localization effect of this invention on lung tissue consolidation regions, two pathologists manually annotated different original whole-slice images. Each whole-slice image was independently annotated by one pathologist, and the annotation was reviewed by the pathologist responsible for pulmonary fibrosis grading. Without knowing the algorithm processing results or experimental group information, the annotators used image editing software to observe the lung tissue structure in the original whole-slice images, determined the lung tissue consolidation regions and their boundaries based on pathological judgment, outlined the consolidation regions with red contours, and filled the contours with red pixels, thus forming an artificial consolidation region annotation mask as a reference for region localization verification.

[0136] During the evaluation of the regional positioning effect, the system reads the filled pixels with preset red codes in the artificially labeled mask to obtain artificial real variation region reference labels; the automatically generated candidate real variation region mask is aligned with the artificially labeled mask in terms of size and spatial position, and the artificial real variation region reference labels are used as a comparison benchmark to calculate the intersection-union ratio (IoU), Dice coefficient, precision, recall, accuracy, false positive rate, false negative rate, and false discovery rate.

[0137] The system can also mark overlapping areas in green, missed areas not detected by automatic positioning in yellow, and falsely detected areas detected by automatic positioning in red, based on the spatial correspondence between the automatic positioning results and the manually labeled reference tags, to form a spatial positioning comparison map. The manually labeled mask and its reference tags are only used for quantitative verification of the region positioning results and demonstration of implementation effects, and do not participate in the quantitative scoring of pulmonary fibrosis, image block scoring, spatial heatmap generation, or candidate consolidation region generation of the new whole-slice image.

[0138] like Figure 7 As shown, the regional pathological review example demonstrates a detailed comparison of six representative regions (A to F) selected from whole-section images. Each row corresponds to one region, from left to right: (a) original region image, (b) fibrosis grading heatmap, (c) manually labeled consolidation region, (d) automatically identified consolidation region, and (e) comparison between automatic results and manual labeling. It can be seen that for regions with different degrees of fibrosis and different tissue morphologies, the automatic localization results of this invention show good consistency with manual labeling, effectively identifying the spatial location and extent of fibrotic consolidation regions.

[0139] Example 2: System Implementation

[0140] like Figure 8 As shown, the present invention can also be implemented as an electronic device 200. The electronic device 200 includes a processor 201, a memory 202, and an input / output interface 204; the memory 202 stores a computer program 203, model parameters, and processing parameters. When the computer program 203 is executed by the processor 201, it forms a functional module and implements the above-described method. The electronic device 200 can be a workstation, a server, or a cloud computing node.

[0141] In one specific implementation, the functional modules include an image input module 101, a tissue detection and image block extraction module 102, a staining normalization module 103, a fiber representation generation module 104, a hybrid feature extraction module 105, a feature screening and dimensionality reduction module 106, a dynamic clustering module 107, a quantitative scoring module 108, an Ashcroft hierarchical heatmap generation module 109, a real variation region identification module 110, and a report output module 111. The image input module 101 receives Masson-stained WSI images of lung tissue, optionally receiving a reference score; the tissue detection and image patch extraction module 102 generates a tissue mask and extracts effective image patches; the staining normalization module 103 performs adaptive staining normalization based on tissue regions; the fiber representation generation module 104 generates fiber color images, fiber grayscale images, and fiber binary images; the hybrid feature extraction module 105 extracts handcrafted features and pre-trained image encoder features; the feature selection and dimensionality reduction module 106 performs standardization, feature selection, and UMAP dimensionality reduction; the dynamic clustering module 107 searches for tissue pattern partitioning schemes; the quantitative scoring module 108 trains or loads a lightweight regression model and outputs a WSI-level score; the Ashcroft graded heatmap generation module 109 performs coordinate projection and heatmap overlay to generate an Ashcroft graded heatmap; the solid region identification module 110 performs high-level region screening and connected component merging to identify solid regions of pulmonary fibrosis; and the report output module 111 outputs the WSI-level score, the Ashcroft graded heatmap, the solid region, and the report.

[0142] The system can be deployed on a regular workstation, server, or cloud computing environment. This verification implementation preferably uses a CUDA-compatible GPU to extract encoder features from frozen pathology images in batches, and can use multi-threaded or multi-process parallel processing during the preprocessing and feature extraction stages; when the operating environment does not have the required GPU, pre-cached depth features can be used, replaced with a frozen encoder that can run on existing hardware, or only manual fiberization features can be used in a predefined degraded implementation.

[0143] Verification Example

[0144] In a validation example, 24 whole-section images of Masson-stained mouse lung tissue were used for method validation. Each whole-section image was extracted based on tissue region detection and white background filtering. After adaptive staining normalization, fiber representation generation, hybrid feature extraction, dynamic clustering, and lightweight regression, the effective pixel image block outputs a full-slice image-level quantitative fiber score and spatial heatmap.

[0145] In this validation example, the method can obtain whole-slice image-level prediction results consistent with pathological reference scores and output spatial evidence corresponding to the solidified region. In the initial evaluation, the linear rank error of the entire process was 0.8, the Pearson correlation coefficient was 0.95, the Spearman correlation coefficient was 0.96, and the AUC for distinguishing between low-fibrosis and fibrosis whole-slice images was 1.00; the IoU for locating candidate high-ranking regions was 0.56, the Dice coefficient was 0.71, and the accuracy was 0.92. Five repeated hierarchical four-fold cross-validation resulted in 20 validation folds. The average MAE of the whole-slice images was 0.627, the RMSE was 0.881, the Pearson correlation coefficient was 0.908, and the Spearman correlation coefficient was 0.862; the average MAE of each fold was... RMSE is The Pearson correlation coefficient is The Spearman correlation coefficient is The above results are used to illustrate the feasibility of the method and do not constitute a limitation on the scope of protection.

[0146] Alternative implementation methods

[0147] Without altering the core tissue pattern aggregation and scoring process of this invention, the method can also be applied to other stained images capable of displaying collagen or fibrosis-related tissue structures with distinguishable signals; for different staining methods, the color space, staining vector estimation, target channel determination, and fiber candidate threshold should be replaced accordingly. The preferred embodiment remains a Masson-stained whole-section image of lung tissue.

[0148] The pre-trained pathological image encoder in this invention is not limited to PLIP, but can also be other basic pathological models, visual language models, general image models, or self-supervised pre-trained models. As long as the model can output fixed-length image representations and be used as a frozen feature extractor in this method, it can be used as an alternative implementation to the deep representation module.

[0149] The dynamic clustering algorithm in this invention is not limited to K-means clustering, spectral clustering, and hierarchical clustering, but may also include Gaussian mixture models, DBSCAN, HDBSCAN, Birch, mean shift, or other clustering algorithms. The internal validity metrics are not limited to silhouette coefficients, Calinski-Harabasz index, and Davies-Bouldin index, but may further include Gap Statistic, Dunn index, stability metrics, or task-related validation metrics.

[0150] The spatial positioning region in this invention is not limited to the largest connected region. It can also output multiple candidate connected regions, connected regions filtered by area threshold, regions weighted by prediction scores, or boundary regions refined by multi-scale segmentation.

[0151] The method of this invention can be used in non-diagnostic and non-therapeutic scenarios such as research samples, animal models, drug efficacy evaluation, and quantitative studies of pathological images. If used for clinical auxiliary analysis, it should be combined with relevant regulations, ethical review, clinical validation, and manual verification processes.

[0152] Electronic devices and computer-readable storage media

[0153] The present invention also provides an electronic device 200, including a processor 201 and a memory 202. The memory 202 stores a computer program 203. When the computer program 203 is executed by the processor 201, the electronic device 200 performs the above-described method. The electronic device 200 may further include an input / output interface 204 for receiving Masson stained lung tissue WSI images and an output interface for outputting WSI grade scores, Ashcroft graded heatmaps, solid regions, and reports. The electronic device 200 may be at least one of a workstation, a server, or a cloud computing node.

[0154] The present invention also provides a computer-readable storage medium 206, wherein a computer program 203 is stored in the computer-readable storage medium 206, and the computer program 203, when executed by a processor, implements the above-described method.

[0155] The present invention also provides a computer program product, the computer program product comprising a computer program or computer instructions; when the computer program or computer instructions are executed by a processor, they complete at least the steps defined by the above methods in the following: whole-slice image input, tissue detection and image block extraction, staining normalization, fiber representation generation, hybrid feature extraction, feature screening and dimensionality reduction, dynamic clustering, cluster-level scoring, whole-slice image-level scoring aggregation, fibrosis grading heatmap generation, and region localization.

[0156] The above description is merely a preferred embodiment of the present invention and is not intended to limit the scope of protection of the present invention. It should be understood that those skilled in the art can make various modifications, substitutions, or variations to the above embodiments without departing from the spirit and essence of the present invention, and all such modifications, substitutions, or variations should fall within the scope of protection defined by the claims of this application.

Claims

1. A method for quantitative assessment and spatial localization of pulmonary fibrosis based on weakly supervised tissue pattern aggregation of whole-slice images, characterized in that, Includes the following steps: A whole-slice image of lung tissue is acquired, multiple image blocks are extracted from the whole-slice image and the spatial coordinates of each image block are recorded, wherein only the whole-slice level reference fibrosis score is used as a supervision signal during the training phase; Extract image patch-level features from each image patch; Within each full-slice image, multiple candidate organization pattern partitioning schemes are compared based on the image block-level features. The optimal organization pattern partitioning scheme for the full-slice image is selected independently based on the internal effectiveness index, resulting in multiple organization pattern clusters for the full-slice image. The number of organization pattern clusters for different full-slice images is adaptively determined. For each tissue pattern cluster, the mean vector of image patch-level features of the image patches within the tissue pattern cluster is calculated, and the cluster-level fiber score of the tissue pattern cluster is predicted using a regression model trained with the full slice-level reference fiber score as the supervision signal. The cluster-level fibrosis score of each tissue pattern cluster is assigned to each image patch within that tissue pattern cluster, and the cluster-level fibrosis score is weighted and aggregated according to the number of image patches contained in each tissue pattern cluster to obtain a full-slice level quantitative score for pulmonary fibrosis. A heatmap of the spatial distribution of fiber is generated based on the spatial coordinates of each image patch and the cluster-level fiberization score assigned to it.

2. The method for quantitative assessment and spatial localization of pulmonary fibrosis based on weakly supervised tissue pattern aggregation of whole-slice images according to claim 1, characterized in that: Extracting multiple image patches from the whole slice image includes: Tissue region detection is performed on the downsampled image of the full slice image to obtain a tissue region mask; Candidate image patches are extracted from the full slice image according to a preset window size; Image blocks whose center is located within the tissue area and whose white background pixel ratio is lower than a preset threshold are retained as valid image blocks.

3. The method for quantitative assessment and spatial localization of pulmonary fibrosis based on weakly supervised tissue pattern aggregation of whole-slice images according to claim 1, characterized in that: Extracting image patch-level features from each image patch includes: Stain normalization was performed on the tissue regions in each image block; Generate a collagen fiber-related representation, wherein the collagen fiber-related representation includes at least one of a fiber binary map, a fiber grayscale map, and a fiber color map; Handcrafted fibrosis features are extracted from each image patch, and deep representation features are extracted through a frozen pre-trained pathological image encoder. The two types of features are then fused to form image patch-level fused features.

4. The method for quantitative assessment and spatial localization of pulmonary fibrosis based on weakly supervised tissue pattern aggregation of whole-slice images according to claim 3, characterized in that: It also includes feature engineering steps: The image block-level fusion features are subjected to dimensionality reduction processing to obtain a low-dimensional clustering representation for organizing pattern segmentation; Based on the cross-slice variability of candidate features, their correlation with the low-dimensional clustering representation, and their correlation with the full-slice level reference fiberization score, a set of scoring features with a fixed order is selected. The organizational pattern division is based on the low-dimensional clustering representation, and the cluster-level fiberization score prediction is based on the intra-cluster mean vector of the score feature set.

5. The method for quantitative assessment and spatial localization of pulmonary fibrosis based on weakly supervised tissue pattern aggregation of whole-slice images according to claim 1, characterized in that: Comparing multiple candidate organizational model partitioning schemes and selecting the optimal organizational model partitioning scheme includes: Within a preset clustering number range, the clustering results of multiple candidate clustering algorithms under different clustering numbers are compared to obtain multiple candidate organizational pattern partitioning schemes; For each candidate organizational pattern partitioning scheme, an internal validity index is calculated, which includes at least two of the silhouette coefficient, Calinski-Harabasz index, and Davies-Bouldin index. After normalizing each internal effectiveness index in the same direction, the weighted sum is obtained, and the oversegmentation penalty term related to the number of clusters is subtracted to obtain the comprehensive score. The candidate organizational model partitioning scheme with the highest comprehensive score is selected as the optimal organizational model partitioning scheme.

6. The method for quantitative assessment and spatial localization of pulmonary fibrosis based on weakly supervised tissue pattern aggregation of whole-slice images according to claim 1, characterized in that: The regression model is a ridge regression model, and its regularization coefficient is selected from the candidate set through cross-validation. The cluster-level fiberization score is calculated as follows: the mean vector of image block-level features of image blocks within the cluster is standardized according to the standardized parameters saved during the training phase, and the predicted value is obtained by calculating the regression coefficient and intercept, and the predicted value is limited to a preset score range.

7. The method for quantitative assessment and spatial localization of pulmonary fibrosis based on weakly supervised tissue pattern aggregation of whole-slice images according to claim 1, characterized in that: It also includes the real-variable area location step: Image patches that have been assigned a cluster-level fiberization score that reaches a preset high-level threshold are selected; Based on spatial adjacency, connected component analysis is performed on the selected image blocks, and the connected component with the largest number of image blocks is selected. The region corresponding to the selected connected component is identified as the consolidation region of pulmonary fibrosis and output.

8. A quantitative assessment and spatial localization system for pulmonary fibrosis based on weakly supervised tissue pattern aggregation of whole-slice images, characterized in that, include: The image input module is used to receive whole-slice images of lung tissue, wherein only whole-slice-level reference fibrosis scores are used as supervision signals during the training phase; An image patch extraction module is used to extract multiple image patches from the whole slice image and record the spatial coordinates of each image patch. The feature extraction module is used to extract image patch-level features from each image patch; The dynamic organization pattern discovery module is used to compare multiple candidate organization pattern partitioning schemes within each full-slice image, independently select the optimal organization pattern partitioning scheme for the full-slice image based on the internal effectiveness index, and obtain multiple organization pattern clusters for the full-slice image. The number of organization pattern clusters for different full-slice images is adaptively determined. The cluster-level scoring module is used to calculate the mean vector of image block-level features of image blocks within each tissue pattern cluster, predict the cluster-level fiber score of the tissue pattern cluster using a regression model trained with the full slice-level reference fiber score as a supervision signal, and assign the cluster-level fiber score to each image block within the tissue pattern cluster. The aggregation scoring module is used to aggregate the cluster-level fiberization scores of each tissue pattern cluster according to the number of image patches contained in each tissue pattern cluster, so as to obtain a full-slice level quantitative score. The spatial output module is used to generate a heatmap of the spatial distribution of fiber based on the spatial coordinates of each image patch and the cluster-level fiberization score it is assigned.

9. An electronic device, characterized in that, The device includes a processor and a memory, wherein the memory stores a computer program that, when executed by the processor, causes the electronic device to perform the method of any one of claims 1 to 7.

10. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the method of any one of claims 1 to 7.

Citation Information

Patent Citations

  • Method and system for evaluating fibrosis in tissue samples

    CN112514001B

  • Deep learning-based kidney fibrosis grading method, electronic device, and storage medium

    CN117408954B

  • A liver biopsy slice basic lesion evaluation method based on multi-scale feature extraction

    CN118587483B

  • Histopathological image analysis method without manual annotation

    CN119478503A

  • Kidney pathological section fibrosis degree image quantitative evaluation method and system

    CN122089696A