Method for intelligent segmentation of reticulin staining pathological images and application thereof

By constructing an appearance-structure dual-stream cross-attention network and a boundary-aware dynamic loss mechanism, the problem of insufficient fiber topology modeling in the segmentation of reticular fiber stained pathological images in existing technologies is solved, achieving high-precision tumor invasion boundary recognition and improving diagnostic efficiency.

CN122176704APending Publication Date: 2026-06-09SHENZHEN SHENGQIANG TECH

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
SHENZHEN SHENGQIANG TECH
Filing Date
2026-05-11
Publication Date
2026-06-09

AI Technical Summary

Technical Problem

Existing technologies cannot explicitly model the fiber network topology in the segmentation of stained pathological images, resulting in insufficient accuracy in identifying tumor invasion boundaries. Furthermore, they cannot balance global continuity and microscopic boundary quality when processing ultra-high resolution images.

Method used

A dual-stream cross-attention network based on appearance and structure is constructed. By combining boundary-aware dynamic loss and counterintuitive graph model, and through multi-stage pre-classification filtering and physical scale-driven boundary awareness mechanism, the accurate capture and boundary optimization of fiber topology are achieved.

Benefits of technology

It improves the accuracy of tumor invasion boundary recognition, generates segmentation results with high clinical sharpness and spatial closure, reduces computational costs, improves diagnostic efficiency, and eliminates stitching artifacts.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122176704A_ABST
    Figure CN122176704A_ABST
Patent Text Reader

Abstract

This invention proposes an intelligent segmentation method for reticular fiber stained pathological images and its application. Addressing the limitations of existing technologies in identifying reticular fiber structure disruptions to define tumor boundaries and artifacts caused by sliding windows, this invention employs adaptive sliding window segmentation and multi-stage pre-filtering to extract effective image blocks. The input is a dual-stream network, where structural and visual flows are fused through cross-attention based on tissue physical size mapping receptive fields to achieve collaborative verification of visual abnormalities and structural disruptions. Model training utilizes a dynamic boundary-aware loss term with physical scale constraints for joint optimization. Finally, a spatial weight fusion mechanism combined with a graph model incorporating physical priors eliminates breakage artifacts and smooths global boundaries. This invention is primarily used for high-fidelity lesion segmentation of pituitary neuroendocrine tumors.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the fields of medical image processing and artificial intelligence, and in particular to an intelligent segmentation method for reticular fiber staining pathological images based on dual-stream feature synergy and boundary refinement optimization, and its application, which is especially suitable for the accurate identification of the invasion boundary of pituitary neuroendocrine tumors. Background Technology

[0002] Reticulum fiber staining is an important auxiliary tool for assessing the invasiveness and prognosis of pituitary neuroendocrine tumors. Its physical essence lies in specifically displaying type III collagen in the extracellular matrix. In normal pituitary tissue, glandular cells are tightly wrapped by reticular fibers, forming a regular, continuous reticular septum structure. However, when tumor cells proliferate and invade, they disrupt this normal reticular fiber framework, manifesting as breakage, thinning, disorder, or abnormal proliferation of reticular fibers. Therefore, the core logic of pathology diagnosis essentially involves visually identifying patterns of reticular fiber network disruption in local areas to define tumor boundaries and invasiveness.

[0003] Currently, clinical evaluation is typically performed manually by pathologists under a microscope, or with the assistance of general image analysis software. However, existing computer-aided analysis techniques have fundamental limitations when applied to whole-section images stained with reticular fibers. Whether using traditional image processing methods, such as threshold-based or morphological manipulation-based approaches, or mainstream deep learning models, such as semantic segmentation networks based on U-Net and its variants, their feature extraction logic primarily targets the morphological features of cells under conventional staining, treating the image as a combination of regions of different colors or brightness, rather than explicitly modeling the network topology of reticular fibers. This general-purpose feature extractor lacks the ability to specifically perceive fiber continuity, density, and damage patterns. When distinguishing between background connective tissue and tumor invasion areas, it is highly prone to misclassifying normal areas rich in fiber structure as lesions, or missing early microinvasive lesions with slight damage to the fiber structure. In addition, existing pixel-level segmentation loss functions, such as cross-entropy loss and focus loss, focus more on global classification accuracy or sample learning difficulty, and lack effective means to optimize the segmentation quality of lesion boundary regions, resulting in blurred, jagged or discontinuous segmentation boundaries, which are difficult to meet the stringent clinical requirements for precise delineation of invasion boundaries.

[0004] Therefore, there is an urgent need for an intelligent segmentation method for pathological images stained with reticulated fibers and its application to solve the problems existing in the current technology. Summary of the Invention

[0005] This invention provides an intelligent segmentation method for stained pathological images of reticulated fibers and its application. It addresses the problems of existing technologies, such as the lack of explicit modeling of the destruction patterns of the reticulated fiber network topology and the inability to balance global continuity and microscopic boundary quality when processing ultra-high resolution images, resulting in insufficient accuracy in identifying tumor invasion boundaries.

[0006] The core technology of this invention is to construct an appearance-structure dual-stream cross-attention network to collaboratively analyze tissue appearance anomalies and fiber structure damage, and to introduce a boundary-aware dynamic loss based on physical scale and a counterintuitive graph model post-processing mechanism to achieve accurate capture of fiber topological structure damage and fine-grained boundary optimization.

[0007] In a first aspect, the present invention provides an intelligent segmentation method for stained pathological images of reticulated fibers, the method comprising the following steps:

[0008] Obtain the whole-section pathological image to be processed and its associated annotation information; Based on the boundary-adaptive overlapping sliding window strategy, the whole-slice pathological image is divided into a set of image blocks with spatial overlap, and multi-stage pre-classification filtering is performed using annotation information and image statistical features of the image blocks to extract the effective set of image blocks. The effective set of image patches is input into a pre-trained dual-stream segmentation network. The appearance flow encoder and the local structure flow encoder, which are configured in parallel, extract tissue appearance features and fiber topology features respectively. The appearance features and structural features are fused together using a cross-attention mechanism to output the pixel-level segmentation result of each image patch. The receptive field configuration of the local structure flow encoder is determined based on the physical size mapping of the fiber tissue to be detected in order to force the learning of fiber topology patterns. The training process of the two-stream segmentation network includes: optimization using a joint loss function, which includes a class balancing loss term based on inverse frequency weighting, and a boundary-aware loss term based on physical scale constraints to extract boundary regions from the annotations and apply dynamic enhancements. The segmentation results of all image patches are obtained, and the overlapping regions are arbitrated through a spatial location-based weight fusion strategy to reconstruct the initial global segmentation map. The initial global segmentation map and the whole-slice pathological image are input into the image model post-processing module. The physical prior features of the original image are used to smooth and optimize the segmentation boundary to generate the final lesion segmentation map.

[0009] Furthermore, performing multi-stage pre-classification filtering includes: In the first stage, a set of prior polygons is constructed using the annotation information. It is then determined whether the spatial bounding box of the image patch intersects with any prior polygon. If they intersect, they are marked as annotation organization classes. In the second stage, for image blocks that have not been labeled, the proportion of dark pixel area after grayscale is calculated. If the proportion reaches a preset threshold, it is marked as a potential tissue class. Among them, the labeled organization class and the potential organization class constitute the effective image patch set, and an asymmetric dynamic confidence gating strategy is used for post-processing of the two types of image patches during the inference stage.

[0010] Furthermore, the receptive field window size of the local structural flow encoder is set based on the mapping relationship between the typical physical spacing of the mesh fiber grid and the scanning resolution of the whole-slice pathological image, so that a single attention window completely wraps a standard fiber mesh unit.

[0011] Furthermore, the local structure flow encoder embeds a fiber structure enhancement module in its first layer of feature extraction. The fiber structure enhancement module initializes the weights by simulating the response functions of physical filters in multiple principal directions to extract local directional gradient features.

[0012] Furthermore, during the computation process, the cross-attention mechanism uses appearance flow features as queries and structural flow features as keys and values, and explicitly introduces a structural break penalty term based on fiber topological continuity. When there is a fiber topological break in the query region, the attention score of that region is reduced through the structural break penalty term, thereby achieving structural continuity suppression.

[0013] Furthermore, the construction of the boundary-aware loss term includes: Morphological erosion and dilation operations are used to extract lesion boundary masks from real label images. The erosion radius is associated with the physical size of the cell nuclei inside the target tissue, and the dilation radius is associated with the physical scale of the tumor cell nests to be covered and the fibrous reaction transition zone on its outer side, so that the lesion boundary mask physically corresponds to the tumor invasion transition zone. In each training iteration, the boundary enhancement factor is dynamically calculated based on the ratio of the average predicted gradient of pixels inside the lesion boundary mask to the average predicted gradient of pixels inside the lesion boundary mask, so as to dynamically maintain the optimization intensity of the boundary region at a preset target multiple of the inner region.

[0014] Furthermore, the physical prior features of the original image are used to optimize the smoothing and continuity of the segmentation boundary, including: constructing an energy function with a fully connected conditional random field as the core; the binary potential energy of the energy function is used to suppress erroneous smoothing caused by color homogeneity by setting the color smoothing hyperparameter to a minimum value; and the spatial smoothing hyperparameter is set to a microscale to eliminate mechanical breakage artifacts generated by sliding window stitching.

[0015] Secondly, the present invention provides an intelligent segmentation device for stained pathological images of reticulated fibers, comprising: The spatial reference and annotation resolution module is used to obtain the whole-slice pathological image to be processed and the associated annotation information; A multi-stage pre-filtering module is used to divide the whole-slice pathological image into a set of spatially overlapping image blocks based on the boundary adaptive overlapping sliding window strategy, and to perform multi-stage pre-classification filtering using annotation information and image statistical features of the image blocks to extract the effective set of image blocks. The dual-stream collaborative segmentation module is used to input the effective image patch set into a pre-trained dual-stream segmentation network. The appearance stream encoder and the local structure stream encoder, which are configured in parallel, extract tissue appearance features and fiber topology features respectively. The appearance features and structural features are collaboratively fused using a cross-attention mechanism to output the pixel-level segmentation result of each image patch. The receptive field configuration of the local structure stream encoder is determined based on the physical size mapping of the fiber tissue to be detected. The boundary-aware loss optimization module is used to optimize the training process of the two-stream segmentation network using a joint loss function. The joint loss function includes a class balance loss term based on inverse frequency weighting and a boundary-aware loss term based on physical scale constraints to extract boundary regions from the annotations and apply dynamic enhancements. The global reconstruction and graph model refinement module is used to obtain the segmentation results of all image blocks. It uses a spatial location-based weight fusion strategy to arbitrate conflicts in overlapping areas, reconstructs the initial global segmentation map, and inputs the initial global segmentation map and the whole-slice pathological image into the graph model post-processing module. It uses the physical prior features of the original image to smooth and optimize the segmentation boundaries, generating the final lesion segmentation map.

[0016] Thirdly, the present invention provides an electronic device including a memory and a processor, wherein the memory stores a computer program and the processor is configured to run the computer program to execute the above-described intelligent segmentation method for stained pathological images of reticulated fibers.

[0017] Fourthly, the present invention provides a readable storage medium storing a computer program, the computer program including program code for controlling a process to execute the process, the process including the above-described intelligent segmentation method for stained pathological images of reticulated fibers.

[0018] The main contributions and innovations of this invention are as follows: 1. This invention simulates the collaborative diagnostic logic of a pathologist "observing tissue appearance and verifying fiber damage" by constructing a dual-stream encoder with parallel configuration of appearance flow and structural flow. The receptive field of the local structural flow is rigidly constrained based on the physical spacing of the reticular fibers, enabling the model to focus on learning fiber topological patterns from the underlying logic. This effectively solves the "structural color blindness" problem of general models when facing homogeneous stained regions, and improves the sensitivity of identifying microinvasive lesions.

[0019] 2. This invention innovatively introduces a physical scale-driven targeted boundary supervision mechanism. By binding the morphological mask radius of the loss function to the physical diameter of the tumor cell nucleus and cell nest, the model can accurately focus on the key spatial region of the "tumor invasion transition zone" during training. Combined with a dynamic gradient tension balancing algorithm, the model is strongly induced to optimize the classification performance of the boundary region, thereby obtaining segmentation results with high clinical sharpness and spatial closure.

[0020] 3. This invention employs a multi-stage pre-processing hard filtering strategy, utilizing geometric collision interception and visual perception grayscale statistics to eliminate the vast majority of worthless background regions without requiring deep model inference. This strategy significantly reduces the computational cost in processing ultra-large-scale data, concentrating computational resources on high-value lesion regions and greatly improving the overall efficiency of clinical diagnosis.

[0021] 4. This invention employs a conflict arbitration technique based on Gaussian distance weighting and a graph model post-processing technique with "counterintuitive" parameter customization during the global reconstruction stage. Mathematical mechanisms suppress distorted predictions of slice edges, and the underlying gradient prior of the original image is used to "weld" the mechanical fracture gaps generated by the sliding window. This design effectively eliminates stitching artifacts, ensures the morphological topological continuity of the global segmentation map, and provides a reliable quantitative analysis basis for precision medicine.

[0022] Details of one or more embodiments of the present invention are set forth in the following drawings and description, so that other features, objects and advantages of the invention will be more readily understood. Attached Figure Description

[0023] The accompanying drawings, which are included to provide a further understanding of the invention and form part of this invention, illustrate exemplary embodiments of the invention and are used to explain the invention, but do not constitute an undue limitation of the invention. In the drawings: Figure 1 This is a flowchart of an intelligent segmentation method for stained pathological images of reticulated fibers according to an embodiment of the present invention; Figure 2 This is a comparison diagram of the segmentation effect of stained pathological images of reticulated fibers according to an embodiment of the present invention; Figure 3 This is a schematic diagram of the hardware structure of an electronic device according to an embodiment of the present invention. Detailed Implementation

[0024] 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 numerals in different drawings denote the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with one or more embodiments of this specification. Rather, they are merely examples of apparatuses and methods consistent with some aspects of one or more embodiments of this specification as detailed in the appended claims.

[0025] It should be noted that the steps of the corresponding methods are not necessarily performed in the order shown and described in this specification in other embodiments. In some other embodiments, the methods may include more or fewer steps than described in this specification. Furthermore, a single step described in this specification may be broken down into multiple steps in other embodiments; and multiple steps described in this specification may be combined into a single step in other embodiments.

[0026] This embodiment provides an intelligent segmentation method for pathological images stained with reticular fibers based on dual-flow feature synergy and boundary refinement optimization. The physical essence of reticular fiber staining (such as silver staining) is the specific visualization of type III collagen in the extracellular matrix. In normal pituitary tissue, glandular cells are tightly wrapped by reticular fibers, forming a regular structure; however, tumor invasion disrupts this framework, resulting in the breakage, sparseness, and disorder of the reticular fibers. This method achieves high-fidelity lesion boundary segmentation by simulating the collaborative diagnostic logic of a pathologist who "observes external abnormalities and verifies structural damage."

[0027] Example 1 like Figure 1 As shown, the method of the present invention specifically includes the following steps: S1. Acquisition and analysis of whole-section pathological images and annotation information.

[0028] First, the pyramid-shaped hierarchical structure encapsulated within the whole-slice pathological image (WSI) file is read, and the physical size information of layer 0 (i.e., the highest resolution base layer) is extracted to obtain the total width of the image. With total height This serves as the coordinate system benchmark for all subsequent spatial calculations. Next, the annotation data file associated with the WSI file path is parsed to extract the coordinate sequence of the outer ring vertices of the polygons representing the region of interest (ROI) manually drawn by the pathologist. To ensure computational reliability, the boundary validity of each extracted polygon vertex coordinate needs to be verified, filtering out out-of-bounds annotations caused by annotation errors or format conversion mistakes. The mathematical expression of this verification process is as follows:

[0029] That is, for the set of vertex coordinates of a polygon For any vertex (x, y) in the array, if and only if it satisfies and At that time, the annotation was deemed to be spatially valid and was retained.

[0030] S2. Generation of overlapping sliding window slices based on boundary adaptation.

[0031] At the basic level, the ultra-large-scale WSI is decomposed into a set of spatially overlapping local slices. The core of this approach lies in adaptive boundary calculation and step size control to ensure lossless coverage of image edge regions.

[0032] Preset fixed slice size (e.g., 512 pixels) and sliding window step size And must meet To generate overlap. Based on this, the limit boundary coordinates of the starting points of the horizontal and vertical slices are adaptively calculated:

[0033]

[0034] This calculation ensures that when the sliding window is in position At that time, the bottom right corner of the slice was aligned with the bottom right edge of the image.

[0035] After determining the limit boundary, the system uses a step size To perform a gridded traversal in two-dimensional space at intervals, a set of tile coordinates covering the entire image is generated. :

[0036] any coordinate satisfy , , and The index is a non-negative integer starting from zero, up to the limit boundary. Because The slices generated by adjacent coordinates have a width of [missing information] in physical space. The overlapping bands effectively eliminate the risk of mechanically cutting off the microscopic pathological structures at the edge of a single slice, ensuring the continuity of subsequent feature extraction.

[0037] S3. Multi-stage pre-classification filtering based on prior labeling and grayscale statistics.

[0038] This step constructs a fast "two-stage funnel" filter that does not require deep learning inference, eliminating the vast majority of blank background slices with extremely low computational cost.

[0039] The first stage is geometric priority interception. For any slice c in the slice set, its spatial location information is extracted to construct a two-dimensional rectangular bounding box. The bounding box is then compared with the prior polygon set retained in step S1. Perform a spatial intersection determination. The determination logic can be expressed by the following Boolean function:

[0040] Where m is the total number of labeled polygons. For spatial intersection operators, V represents the logical OR operation. Indicates the first One effective physician-annotated polygon ( ).like If true, meaning the slice intersects with any labeled polygon, the system marks it as a labeled organization class and skips all subsequent image reading and calculation processes.

[0041] The second stage is grayscale separation. If a slice does not match any annotations, the system extracts its RGB pixel matrix and, based on the characteristics of human visual perception, reduces its dimensionality to a single-channel grayscale matrix. :

[0042] Where (u,v) are the two-dimensional coordinates of the pixel within the slice. Represents the two-dimensional spatial coordinates of a pixel within a slice. This represents the converted grayscale value. , , These represent the intensity of the point in the red, green, and blue channels, respectively. , , These are visual weighting coefficients, with typical values ​​of 0.299, 0.587, and 0.114, used to simulate the physiological characteristic of the human eye being most sensitive to green.

[0043] Given the physical characteristics of bright backgrounds and dark tissues in pathological staining images, a grayscale discrimination threshold is introduced. Based on the physical cliff characteristics of dyeing web fibers, The grayscale value was set within a fixed range of [15, 35] because the grayscale value of any real tissue area covered by silver grain deposition consistently falls below this range. The percentage of dark pixel area within the slice was statistically determined using an indicator function. :

[0044] in, This is an indicator function; it returns 1 if the condition is true and 0 otherwise. The denominator is... This represents the total number of pixels in the slice.

[0045] Ultimately, according to Compared with the preset ratio threshold (For example, setting it to 0.05, since any slice containing effective tissue will necessarily have a higher proportion of dark pixels than this value) compares and outputs a classification decision: if If it is not a background class (Class_0), it is identified as a background class and removed; otherwise, it is marked as a potential organization class and retained (Class_2).

[0046] Specifically, an asymmetric dynamic gating strategy is employed for the two types of slices entering the subsequent inference (S4) stage. Both are input into the same two-stream segmentation network to maintain model generalization, but when outputting the final segmentation mask, a lower confidence threshold (e.g., 0.3) is used for slices from the "labeled tissue class" to maximize the retention of suspicious micro-infiltration boundary pixels; a stricter confidence threshold (e.g., 0.7) is used for slices from the "potential tissue class" to hard filter potential isolated noise points, achieving an optimal match between computational resources and diagnostic risk.

[0047] S4. Deep feature extraction and collaborative segmentation based on appearance-structure dual-stream cross-attention.

[0048] The valid slices selected in step S3 are input into a pre-built dual-stream segmentation network. This network consists of a parallel appearance stream encoder and a local structure stream encoder, as well as a cross-attention fusion module.

[0049] The appearance stream encoder receives the raw RGB slice image and is responsible for extracting the global appearance semantic features of the tissue, such as cell density and staining intensity distribution patterns.

[0050] The local structure flow encoder is the core solution to "structure color blindness." It receives the exact same raw RGB slice image, but its design goal is specifically to extract network topology pattern features from the mesh fibers. First, to ensure that the structure flow's first layer captures robust directional information, a "fiber structure enhancement convolutional block" is embedded at its front end. This module consists of three 3×3 convolutional kernels in parallel, whose weights are initialized to simulate the response functions of a classic Gabor filter in the three principal directions of 0°, 45°, and 90°. During end-to-end network training, these weights participate in gradient updates.

[0051] Secondly, the main architecture of the local structured flow encoder adopts the SwinTransformer architecture based on a local window attention mechanism. Its key feature is the size of the attention window. Unlike general tasks where settings are arbitrary, this is derived through a rigorous pixel-level reverse mapping based on the pathological physical dimensions of the reticular fibers. In this embodiment, a standard 20x objective lens was used for scanning (resolution approximately 0.5 μm / pixel). The typical physical spacing of the reticular fiber mesh surrounding normal pituitary acini is approximately 15 μm to 20 μm. Mapping this spacing to pixel space yields approximately 30 to 40 pixels. Therefore, [the following is a separate, unrelated sentence:] The resolution is forced to be 32×32 pixels. This design ensures that the physical receptive field of a single attention window can completely encompass a standard fibrous mesh, thereby forcing the flow to learn the fiber continuity and density patterns within the mesh at the algorithm's underlying level.

[0052] The cross-attention fusion module is located in the decoder stage and executes a collaborative verification mechanism that includes topological breakage penalties. Its core computational definition is as follows:

[0053] Where Q represents the appearance feature sequence output by the appearance stream encoder, used as a query; K and V represent the key and value of the structural feature sequence output by the local structure stream encoder; is the dimension of the key vector, used to scale the dot product to prevent gradient vanishing; This is the preset topological breakage penalty coefficient.

[0054] The core of this formula lies in the penalty term. It is not a static value, but rather dynamically generated by a "structure tensor coherence estimation head" integrated into the attention layer of each window in the structure flow encoder. This estimation head, within a 32×32 local window, simulates the feature mapping of the local structure tensor through learnable convolutional layers and outputs a coherence score map with a value range of [0, 1] via a sigmoid activation function. When the fibers are aligned, Approaching 1; when fibers break and their orientation becomes disordered, Approaching 0. The final penalty term is determined by... The calculation yielded the result.

[0055] This mechanism produces a "structural continuity suppression" effect. When querying structural feature K using appearance feature Q, if the corresponding region has continuous fibers ( Attention score remains unchanged; if topological breaks exist ( (If the value is large), the attention score at that location will be severely reduced. Thus, the network achieves pixel-by-pixel collaborative verification of "appearance abnormalities" and "structural damage," effectively distinguishing between background connective tissue and the actual tumor invasion area. Upsampling the fused features allows for the output of pixel-level fine-grained segmentation results for each slice.

[0056] S5. Joint loss optimization based on boundary awareness and inverse frequency weighting.

[0057] This step describes the joint loss function used to train the aforementioned two-stream segmentation network, which aims to address extreme class imbalance and precisely anchor optimization resources to the tumor invasion boundary regions of greatest clinical concern.

[0058] First, lesion boundary masks are extracted from the ground truth label image Y of the training samples using morphological operations. :

[0059] Where Y represents the true label graph, and D(Y) and E(Y) represent the results of dilation and erosion operations on the label graph, respectively. This is a logical XOR operation.

[0060] In this embodiment, the morphological operation radius is differentiated as follows: Corrosion radius The diameter of pituitary chromophobe nuclei was set to an equivalent pixel radius of 5 μm to accurately eliminate densely packed areas of nuclei within the tumor that lack boundary information. Expansion radius Based on the diameter of the tumor cell nest and the width of its outer fibrous reactive transition zone, a pixel radius equivalent to 25 μm was set. The resulting boundary mask... Physically, it precisely corresponds to the microscopic boundary zone of tumor invasion.

[0061] Secondly, construct the joint loss function L:

[0062] Where N is the total number of pixels in the slice; The inverse frequency weight is calculated based on the reciprocal of the frequency of occurrence of pixels in each category and is used for macro-level category balancing. The value of the boundary mask at pixel i (0 or 1); This represents the probability predicted by the model.

[0063] The key parameter in the formula is the dynamic enhancement factor. It is not a fixed empirical value, but rather calculated in real time based on a "gradient tension balancing" mechanism. In each training iteration, the average absolute value of the gradient of all pixels within the boundary mask in the current batch with respect to the predicted logits is calculated and denoted as... And the average of the absolute values ​​of the gradients of pixels inside the non-boundary area, denoted as A target tension coefficient K is set (K=5 in this embodiment, based on the fact that the learning difficulty of boundary regions in pathological images is naturally 5 to 8 times that of the interior). Calculated dynamically using the following formula:

[0064] This mechanism ensures that at any stage of training, the optimization intensity of the boundary region is dynamically and forcibly maintained at K times that of the interior region, thereby guiding the network to generate high-quality segmentation results with sharp and continuous boundaries.

[0065] S6. Global segmentation graph reconstruction and boundary refinement based on graph model optimization.

[0066] This step aims to eliminate boundary breakage artifacts caused by sliding window stitching and to use underlying physical priors of the image for final boundary refinement.

[0067] First, an initial global segmentation map mapping and conflict arbitration are performed. The segmentation probability maps predicted by all valid slices are stitched together into the global coordinate system through coordinate mapping. Due to the overlapping bands generated in step S2, the same pixel in the global coordinate system may be covered by predictions from multiple slices. To resolve conflicts, a spatially based Gaussian kernel weighted fusion strategy is introduced:

[0068] Where K is the total number of slices covering this coordinate (global coordinate (x,y)). This represents the predicted probability of the k-th slice. Weighting function. Let Gaussian function be defined with the center of the slice as the origin, and its hyperparameters be... Based on slice size An adaptive derivation is performed to ensure that the weights decay smoothly from the slice center to the edge, approaching zero at the seam. The specific derivation formula is as follows: This mechanism mathematically guarantees that reliable predictions in the central region of the slice dominate the fusion decision, while unreliable predictions at the edges are smoothly suppressed, completely eliminating seam tearing and label jump artifacts.

[0069] Preferably, the weighting function The definition is as follows:

[0070] In the formula, ( , ) represents the coordinates of the center point of the k-th slice, and σ is a hyperparameter that controls the decay rate. σ determines the rate at which the confidence of the prediction result decays from the center of the slice to the edge.

[0071] Secondly, boundary refinement based on a fully connected conditional random field (CRF) is performed. The initial global probability map obtained through the above fusion is then compared with the original high-resolution WSI image. Common input graph model. Construct a model containing univariate potential energy. and dual potential energy The energy function E(x):

[0072] Among them, the univariate potential energy is determined by the initial prediction probability, i.e. The specific form of dual potential energy is:

[0073] in, , The spatial coordinates of the pixel. , This is the RGB color vector of the pixel in the original WSI. For tag compatibility functions, , as well as , , These are all hyperparameters that control the smoothness.

[0074] In particular, addressing the contradiction of highly homogeneous (both deep black) but structurally heterogeneous lesions and background colors in the dyeing of reticulated fibers, this method employs counterintuitive hyperparameter settings. Color smoothing hyperparameter It is forced to be set to a minimum value (e.g., 5) to mathematically reduce the contribution of color similarity to the smoothing effect, preventing CRF from incorrectly smoothing out the true tumor boundaries due to staining consistency. Simultaneously, the spatial smoothing hyperparameter... and Set to a microscale corresponding to a distance of 1 to 2 pixels, its sole purpose is to "weld" the mechanically broken gaps, only pixels wide, remaining from sliding window stitching, without affecting the real tissue boundaries at a distance. By minimizing this energy function, a high-fidelity lesion segmentation mask with continuous boundaries and a complete structural topology is obtained.

[0075] like Figure 2 As shown, the left image displays the original stained image of the woven fibers and the predefined boundaries of the lesion region; the middle image displays the mask image generated by the model after the output of the dual-stream segmentation network of this invention and global stitching reconstruction; the right image displays the final high-fidelity lesion segmentation effect image with the mask attached to the original image, fully demonstrating the intuitive technical effect of graph model post-processing technology in eliminating overlapping sliding window stitching artifacts, achieving boundary refinement and smooth topological continuity.

[0076] Example 2 Based on the same concept, this invention also proposes an intelligent segmentation device for stained pathological images of reticulated fibers, which corresponds completely to the above method and includes: The Spatial Datum and Annotation Resolution Module is used to execute step S1, obtain WSI base level dimensions and annotation coordinates, and perform validity verification. The multi-stage pre-filtering module is used to execute steps S2 and S3, generate a set of image patches through adaptive overlapping sliding windows, and complete multi-stage pre-classification filtering by using geometric interception and grayscale statistics. The dual-stream collaborative segmentation module is used to perform the S4 step. It is equipped with an appearance stream encoder and a local structure stream encoder with physical size-driven receptive field, as well as a cross-attention fusion module containing a topology breakage penalty term, and outputs a local fine segmentation mask. The boundary-aware loss optimization module is used to perform step S5 during the training phase, construct a boundary mask based on cell physical scale mapping, and calculate a dynamic enhancement factor based on gradient tension ratio to form a joint loss function to optimize the network. The Global Reconstruction and Graph Model Refinement module is used to execute the S6 step. It reconstructs the initial global graph through a size-adaptive Gaussian weighted fusion strategy and uses a fully connected conditional random field with counterintuitive parameters to perform boundary smoothing and continuity optimization, generating the final segmentation graph.

[0077] Example 3 This embodiment also provides an electronic device, see reference. Figure 2 It includes a memory 404 and a processor 402, wherein the memory 404 stores a computer program and the processor 402 is configured to run the computer program to perform the steps in any of the above method embodiments.

[0078] Specifically, the processor 402 may include a central processing unit (CPU), or an application-specific integrated circuit (ASIC), or one or more integrated circuits that can be configured to implement embodiments of the present invention.

[0079] Memory 404 may include a mass storage device for data or instructions. For example, and not limitingly, memory 404 may include a hard disk drive (HDD), a floppy disk drive, a solid-state drive (SSD), flash memory, an optical disk drive, a magneto-optical disk drive, magnetic tape, or a Universal Serial Bus (USB) drive, or a combination of two or more of these. Where appropriate, memory 404 may include removable or non-removable (or fixed) media. Where appropriate, memory 404 may be internal or external to a data processing device. In a particular embodiment, memory 404 is non-volatile memory. In a particular embodiment, memory 404 includes read-only memory (ROM) and random access memory (RAM). Where appropriate, the ROM may be a mask-programmed ROM, a programmable read-only memory (PROM), an erasable read-only memory (EPROM), an electrically erasable read-only memory (EEPROM), an electrically alterable read-only memory (EAROM), or flash memory, or a combination of two or more of these. Where appropriate, the RAM can be Static Random-Access Memory (SRAM) or Dynamic Random-Access Memory (DRAM). DRAM can be Fast Page Mode Dynamic Random-Access Memory (FPMDRAM), Extended Data Out Dynamic Random-Access Memory (EDODRAM), Synchronous Dynamic Random-Access Memory (SDRAM), etc.

[0080] The memory 404 can be used to store or cache various data files that need to be processed and / or communicated, as well as possible computer program instructions executed by the processor 402.

[0081] The processor 402 reads and executes computer program instructions stored in the memory 404 to implement any of the intelligent segmentation methods for stained pathological images of reticulated fibers in the above embodiments.

[0082] Optionally, the electronic device may further include a transmission device 406 and an input / output device 408, wherein the transmission device 406 is connected to the processor 402, and the input / output device 408 is connected to the processor 402.

[0083] The transmission device 406 can be used to receive or send data via a network. Specific examples of the network described above may include wired or wireless networks provided by the communication provider of the electronic device. In one example, the transmission device includes a Network Interface Controller (NIC), which can connect to other network devices via a base station to communicate with the Internet. In another example, the transmission device 406 may be a Radio Frequency (RF) module used for wireless communication with the Internet.

[0084] Input / output device 408 is used to input or output information.

[0085] Example 4 This embodiment also provides a readable storage medium storing a computer program, the computer program including program code for controlling a process to execute the process, the process including the intelligent segmentation method for stained pathological images of reticulated fibers according to Embodiment 1.

[0086] It should be noted that the specific examples in this embodiment can refer to the examples described in the above embodiments and optional implementations, and will not be repeated here.

[0087] Generally, various embodiments can be implemented in hardware or dedicated circuitry, software, logic, or any combination thereof. Some aspects of the invention can be implemented in hardware, while others can be implemented by firmware or software executed by a controller, microprocessor, or other computing device, but the invention is not limited thereto. Although various aspects of the invention may be shown and described as block diagrams, flowcharts, or using some other graphical representation, it should be understood that, by way of non-limiting example, these blocks, apparatuses, systems, techniques, or methods described herein can be implemented in hardware, software, firmware, dedicated circuitry or logic, general-purpose hardware or controllers or other computing devices, or some combination thereof.

[0088] Embodiments of the present invention can be implemented by computer software, which may be executable by a data processor of a mobile device, such as a processor entity, or by hardware, or by a combination of software and hardware. Computer software or programs (also referred to as program products) including software routines, applets, and / or macros can be stored in any device-readable data storage medium, and they include program instructions for performing specific tasks. The computer program product may include one or more computer-executable components configured to perform the embodiments when the program is run. The one or more computer-executable components may be at least one piece of software code or a portion thereof. Additionally, it should be noted in this respect that, as Figure 1 Any box in the logical flow can represent a program step, or interconnected logic circuits, boxes and functions, or a combination of program steps and logic circuits, boxes and functions. Software can be stored on physical media such as memory chips or blocks of storage implemented within a processor, magnetic media such as hard disks or floppy disks, and optical media such as DVDs and their data variants, CDs, etc. The physical medium is a non-transient medium.

[0089] Those skilled in the art should understand that the technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments have been described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0090] The above embodiments are merely illustrative of several implementations of the present invention, and their descriptions are relatively specific and detailed, but they should not be construed as limiting the scope of the present invention. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of the present invention, and these all fall within the protection scope of the present invention. Therefore, the protection scope of the present invention should be determined by the appended claims.

Claims

1. A method for intelligent segmentation of stained pathological images of reticulated fibers, characterized in that, Includes the following steps: Obtain the whole-section pathological image to be processed and its associated annotation information; Based on the boundary-adaptive overlapping sliding window strategy, the whole-slice pathological image is divided into a set of image blocks with spatial overlap, and multi-stage pre-classification filtering is performed using the annotation information and image statistical features of the image blocks to extract the effective set of image blocks. The effective image patch set is input into a pre-trained dual-stream segmentation network. The appearance flow encoder and the local structure flow encoder, configured in parallel, extract tissue appearance features and fiber topology features respectively. The appearance features and the structural features are then fused together using a cross-attention mechanism to output pixel-level segmentation results for each image patch. The receptive field configuration of the local structure flow encoder is determined based on the physical size mapping of the fiber tissue to be detected, in order to force the learning of fiber topology patterns. The training process of the dual-stream segmentation network includes: optimization using a joint loss function, which includes a class balancing loss term based on inverse frequency weighting and a boundary-aware loss term based on physical scale constraints to extract boundary regions from the annotations and apply dynamic enhancements. The segmentation results of all image patches are obtained, and the overlapping regions are arbitrated through a spatial location-based weight fusion strategy to reconstruct the initial global segmentation map. The initial global segmentation map and the whole-slice pathological image are input into the image model post-processing module. The physical prior features of the original image are used to smooth and optimize the segmentation boundary to generate the final lesion segmentation map.

2. The method according to claim 1, characterized in that, Performing multi-stage pre-classification filtering includes: In the first stage, a prior polygon set is constructed using the annotation information, and it is determined whether the spatial bounding box of the image patch intersects with any prior polygon. If they intersect, they are marked as annotation organization classes. In the second stage, for image blocks that have not been labeled, the proportion of dark pixel area after grayscale is calculated. If the proportion reaches a preset threshold, it is marked as a potential tissue class. The labeled organization class and the potential organization class constitute the effective image block set, and an asymmetric dynamic confidence gating strategy is used for post-processing of the two types of image blocks during the inference phase.

3. The method according to claim 1, characterized in that, The receptive field window size of the local structure flow encoder is set based on the mapping relationship between the typical physical spacing of the mesh fiber grid and the scanning resolution of the whole-slice pathological image, so that a single attention window completely wraps a standard fiber mesh unit.

4. The method according to claim 1, characterized in that, The local structure flow encoder embeds a fiber structure enhancement module in its first feature extraction layer. The fiber structure enhancement module initializes the weights by simulating the response functions of physical filters in multiple principal directions to extract local directional gradient features.

5. The method according to claim 1, characterized in that, The cross-attention mechanism uses appearance flow features as queries and structural flow features as keys and values ​​during the calculation process, and explicitly introduces a structural fracture penalty term based on fiber topological continuity. When a fiber topological break exists in the query region, the attention score of that region is reduced by the structural break penalty term to achieve structural continuity suppression.

6. The method according to claim 1, characterized in that, The construction of the boundary-aware loss term includes: A lesion boundary mask is extracted from a real label image using morphological erosion and dilation operations. The erosion radius is associated with the physical size of the cell nuclei inside the target tissue, and the dilation radius is associated with the physical scale of the tumor cell nests to be covered and the fibrous reaction transition zone on its outer side, so that the lesion boundary mask physically corresponds to the tumor invasion transition zone. In each training iteration, the boundary enhancement factor is dynamically calculated based on the ratio of the average predicted gradient of pixels within the lesion boundary mask to the average predicted gradient of pixels outside the lesion boundary mask, so as to dynamically maintain the optimization intensity of the boundary region at a preset target multiple of the inner region.

7. The method according to claim 1, characterized in that, The segmentation boundary is smoothed and its continuity is optimized by utilizing the physical prior features of the original image. This includes: constructing an energy function with a fully connected conditional random field as its core. The binary potential energy of the energy function is used to suppress erroneous smoothing caused by color homogeneity by setting the color smoothing hyperparameter to a minimum value, and to eliminate mechanical breakage artifacts caused by sliding window stitching by setting the spatial smoothing hyperparameter to a microscale.

8. A smart segmentation device for pathological images stained with woven fibers, characterized in that, include: The spatial reference and annotation resolution module is used to obtain the whole-slice pathological image to be processed and the associated annotation information; A multi-stage pre-filtering module is used to divide the whole-slice pathological image into a set of spatially overlapping image blocks based on a boundary-adaptive overlapping sliding window strategy, and to perform multi-stage pre-classification filtering using the annotation information and image statistical features of the image blocks to extract the effective set of image blocks. The dual-stream collaborative segmentation module is used to input the effective image patch set into a pre-trained dual-stream segmentation network, extract tissue appearance features and fiber topology features respectively through a parallel configured appearance stream encoder and local structure stream encoder, and use a cross-attention mechanism to collaboratively fuse the appearance features and the structural features to output the pixel-level segmentation result of each image patch; wherein, the receptive field configuration of the local structure stream encoder is determined based on the physical size mapping of the fiber tissue to be detected; The boundary-aware loss optimization module is used to optimize the training process of the two-stream segmentation network using a joint loss function. The joint loss function includes a class balance loss term based on inverse frequency weighting and a boundary-aware loss term based on physical scale constraints to extract boundary regions from the annotations and apply dynamic enhancements. The global reconstruction and graph model refinement module is used to obtain the segmentation results of all image blocks. It uses a spatial location-based weight fusion strategy to arbitrate conflicts in overlapping areas, reconstructs the initial global segmentation map, and inputs the initial global segmentation map and the whole-slice pathological image into the graph model post-processing module. It uses the physical prior features of the original image to smooth and optimize the segmentation boundaries, generating the final lesion segmentation map.

9. An electronic device comprising a memory and a processor, characterized in that, The memory stores a computer program, and the processor is configured to run the computer program to perform the method according to any one of claims 1 to 7.

10. A readable storage medium, characterized in that, The readable storage medium stores a computer program that, when executed by a processor, implements the method described in any one of claims 1 to 7.