Whole field pathological section tissue boundary extraction method and device based on multi-source organization evidence protection and edge artifact phased inhibition and medium
Patent Information
- Application Number
- CN202611317661.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2026-08-28
- Publication Date
- 2026-10-27
- Estimated Expiration
- 2046-08-28
AI Technical Summary
[0006]本发明实施例提供了一种基于多源组织证据保护和边缘伪影分阶段抑制的全视野病理切片组织边界提取方法、装置及介质,针对现有技术采用单一阈值或简单的形态学腐蚀与面积过滤,难以兼顾淡染真实组织的召回与粘连边缘伪影的剥离,且前后处理阶段判定依据不一致极易造成组织结构破坏、误删以及伪影的整块误恢复等问题
[0018]本发明的主要贡献和创新点如下:
Smart Images

Figure CN122820924B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of digital pathological image processing technology, and in particular to a method, apparatus and medium for extracting tissue boundaries of full-view pathological sections based on multi-source tissue evidence protection and staged suppression of edge artifacts. Background Technology
[0002] Whole-slide images (WSI) typically have a data scale of billions of pixels. To reduce the computational burden of subsequent pathological analysis, AI inference, slide navigation, and structured annotation, the effective tissue regions in the slides are usually extracted first at a low-resolution scale or at the thumbnail layer level, and then the obtained tissue boundaries are mapped back to the original highest-resolution layer zero coordinates. Existing conventional methods mostly use grayscale thresholding, fixed color thresholding, or Otsu's method for binarization segmentation, classifying darker areas as tissue and brighter areas as background.
[0003] However, pathological sections commonly suffer from complex interferences during slide preparation and digital scanning, including inconsistent staining depth, uneven tissue thickness, lightly stained mucus areas, fat vacuoles, slide edges, coverslip refraction, tape residue, slide cracks, black edges during scanning, and grayish-brown background impurities. Simply increasing the segmentation threshold can improve the detection of lightly stained tissue, but it easily incorporates near-white background and edge artifacts into the mask over a large area; tightening the threshold can lead to the missed detection of large areas of lightly stained real tissue. Especially when real tissue is close to the slide edge or adheres to scanning artifacts, conventional connected region area filtering cannot achieve effective separation; directly deleting the edge area easily leads to the accidental deletion of real tissue, while uniformly performing global morphological erosion will destroy narrow tissues and internal cavity structures.
[0004] Furthermore, the criteria for each stage in the existing serial processing flow are isolated from each other, which can easily lead to the artifacts that were mistakenly deleted being fully restored in the subsequent recovery stage and forming false evidence on their own. Moreover, due to the lack of strict combination of the original physical resolution of the slice and the image scale transformation during coordinate mapping, geometric misalignment and overstepping of the output boundary and the zero image of the layer can easily occur.
[0005] Therefore, there is an urgent need for a method, device, and medium for extracting the boundaries of full-field pathological sections based on the protection of multi-source tissue evidence and the staged suppression of edge artifacts, in order to solve the problems existing in the current technology. Summary of the Invention
[0006] This invention provides a method, device, and medium for extracting tissue boundaries from full-view pathological sections based on multi-source tissue evidence protection and staged suppression of edge artifacts. This addresses the shortcomings of existing technologies that use a single threshold or simple morphological erosion and area filtering, which are difficult to simultaneously recall lightly stained real tissue and remove adhesion edge artifacts. Furthermore, inconsistent judgment criteria at the pre- and post-processing stages can easily lead to problems such as tissue structure damage, accidental deletion, and erroneous restoration of entire artifact blocks.
[0007] The core technology of this invention is to construct a multi-source tissue evidence chain that runs through the entire process. Based on the positive offset loose initial segmentation, the invention sequentially performs edge artifact restricted growth stripping blocked by tissue evidence, outer band iterative pruning under tissue anchor defense, and finite geodesic expansion recovery and self-protection independent verification based on the differential loss set. The perimeter adaptive simplified contour is independently mapped to the hierarchical zero pixel coordinates.
[0008] In a first aspect, the present invention provides a method for extracting the tissue boundary of a full-field pathological section based on multi-source tissue evidence protection and staged suppression of edge artifacts, the method comprising the following steps: Acquire full-view pathological slices and generate scale-adaptive processed images based on the zero original physical resolution of the full-view pathological slices, the preset target physical resolution, and the tile scale. Multi-source features are calculated for the scale-adaptive processing image. These features include gray intensity, saturation, color space channels that characterize tissue staining properties, white-background distance from a pixel to a white background, and color channel dispersion. These multi-source features serve as the shared criterion for subsequent optimization processing stages. The baseline threshold is obtained based on gray intensity using the Otsu method, and a preset positive offset is applied to the baseline threshold to obtain the effective segmentation threshold. A loose initial tissue candidate mask is generated based on the effective segmentation threshold and the color channel dispersion. Based on multi-source features, tissue evidence anchors and a set of light-colored tissue candidates are constructed. A phased optimization process is then performed on the loose initial tissue candidate mask to obtain an optimized tissue mask. The phased optimization process includes: locating artifact seeds from the image edge band, allowing them to grow in a restricted manner within the mask to remove edge artifacts, with the growth process blocked by the tissue evidence anchors and the set of light-colored tissue candidates; using distance transformation to determine the single-round outer layer of the current mask, and iteratively trimming low-chroma or near-background pixels within the outer layer outside the protected area constructed by the tissue evidence anchors; based on the difference loss set of the mask before and after trimming, within the candidate region of the mask after distance trimming with a preset spatial distance envelope and excluding hard artifacts, limited geodesic expansion is performed starting from the stable tissue anchors for replenishment, and only the newly replenished region is independently checked for weak artifacts. Closed contours are extracted from the optimized tissue mask. Based on the perimeter of the closed contour, the polygon simplification tolerance is adaptively determined and the contour is approximated by polyline. The coordinates of the simplified contour points are mapped to the hierarchical zero-pixel coordinates of the full-view pathological slice through independent horizontal and vertical scaling ratios to generate closed tissue boundaries.
[0009] Furthermore, based on the zero original physical resolution of the full-view pathological slides, the preset target physical resolution, and the tile scale, a scale-adaptive processed image is generated, including: Obtaining zero-width slices at the full field of view Zero-height hierarchy and the zero original physical resolution of the hierarchy ; Based on the preset target physical resolution Block scale and positive integer oversampling factor Calculate the width of the pre-pooling image using the following formula. and height : ; ; When the sampling multiple First, a mask is generated on the scale-adaptive processing map, then... The final mask is obtained by voting pooling the pixel blocks; when Skip the pooling step; The simplified contour point coordinates are mapped to the hierarchical zero-pixel coordinates of the full-field pathological slide using independent horizontal and vertical scaling, including: Let the coordinates of the simplified contour points in the final mask be... The final mask width is Height is Map to the zero pixel coordinate of the layer according to the following formula. : ; .
[0010] Furthermore, artifact seeds are located from image edge bands, and their growth is restricted within a mask to remove edge artifacts. This growth process is blocked by tissue evidence anchors and a set of pale tissue candidates, including: The wide edge band is determined using the first edge bandwidth, where the first edge bandwidth is... The proportion of tissue features is calculated for the connected regions of the contact wide edge band, and the connected regions are deleted in whole when there is insufficient tissue evidence; and low-saturation and low-pink-tendency pixels that do not hit the pink tissue evidence set and the light tissue candidate set are deleted within the wide edge band. The narrow seed band is determined using the second edge bandwidth, where the second edge bandwidth is... Strictly artifact seeds were extracted within a narrow seed band. Starting from a strict artifact seed, restricted dilation is performed within the current tissue candidate mask and in a region that is outside the tissue protection zone and meets the low chromaticity accessibility condition. Growth terminates when dilation encounters a set of pink tissue evidence or a set of light-colored tissue candidates, and reachable regions are deleted when the iteration limit is reached or the region no longer changes.
[0011] Furthermore, after removing edge artifacts and before determining the single-cycle outer band of the current mask using distance transformation, the staged optimization process also includes: Rescue of light-colored tissues by applying connectivity constraints: The joint graph is obtained by taking the union of the mask after removing edge artifacts and the set of light-colored tissue candidates. Connectivity analysis is performed on the joint graph to select target connected regions whose area is not less than a preset area threshold and whose internal area contains not less than a preset number of seed pixels for the mask after stripping edge artifacts. The target connected regions are then incorporated into the current mask as the rescued regions.
[0012] Furthermore, the single-round outer band of the current mask is determined using distance transformation, and low-chroma or near-background pixels within the outer band are iteratively pruned outside the protected area constructed by the tissue evidence anchors, including: Strong tissue anchors and weak light tissue candidates are extracted based on multi-source features; low color intensity rejection conditions and near white background rejection conditions are applied to weak light tissue candidates; weak light tissue candidates that pass the rejection and are located within the preset expansion neighborhood of strong tissue anchors or whose connected domain contains a preset number and proportion of strong tissue anchors are identified as protection seeds; neighborhood expansion is performed on the protection seeds to construct the final protected area. Perform a distance transformation on the current mask to ensure that the distance from the pixel to the background satisfies The area is defined as the outer layer of a single wheel, where The outer layer width is preset to pixels; Within the outer layer of the single wheel and outside the final protected area, delete pixels that meet the low chromaticity condition of the color space channel that satisfies the saturation and characterization of tissue staining characteristics, or the white background distance and saturation close to the background condition. After each round of pixel deletion, the distance transformation and outer band are recalculated, and the process is iterated until the preset maximum number of iterations is reached or no pixels are deleted in a single round.
[0013] Furthermore, based on the difference loss set of the masks before and after trimming, within the candidate region that is within the preset spatial distance envelope of the trimmed mask and excludes hard artifacts, limited geodesic expansion and restoration are performed starting from the stable tissue anchor point. Only the newly restored region undergoes independent verification for weak artifacts, including: Pre-trimming mask With post-trimming mask The difference set is defined as the missing set. ; Will fill in the candidate area Defined as a lost set The distance to the mask after trimming should not exceed the upper limit of spatial distance. Satisfying the conditions for multiple sources of light tissue color and excluding hard artifact sets The intersection of complements; where the set of hard artifacts is located. This includes pixels that meet the near-white refraction condition and pixels that meet the low pink tendency and low chromaticity condition; Stable anchor points are constructed using reliable tissue pixels retained in the trimmed mask, and the neighborhoods of these stable anchor points, after being expanded through a preset number of rounds, are used to fill in candidate regions. The intersection of these regions is used as the seed for filling in the candidate regions. Perform geodesic expansion for a limited number of rounds, and incorporate connected components containing more than a preset number of replacement seeds as replacement results into the mask; Using stable anchor points in the pruned mask as evidence sources, independent weak artifact verification is performed only on the newly added patched areas. When the tissue evidence features of the connected region are below the preset threshold and exhibit weak color or near-background features, the connected region is deleted.
[0014] Furthermore, the method also includes at least one of the following: (1) Configurable optimization and mask transfer mechanism: Based on the staining type of the slice, organ type, scanning equipment type, batch identifier, thumbnail statistical characteristics or quality control results, determine the start and stop combination and corresponding parameter group of each processing module in the phased optimization process; when a certain processing module is not enabled, its input mask is directly transferred to the next enabled module. (2) Isolated artifact removal: Before extracting the closed contour, isolated small connected regions in the mask with an area lower than the preset small area threshold and a multi-source feature mean lower than the preset threshold are deleted; non-maximum main isolated connected regions with an area lower than the preset non-maximum area threshold and a multi-source feature mean lower than the preset threshold are deleted. (3) Templated and structured output: After generating the closed organizational boundary, deeply copy the preset business interface JSON template, recursively clean up the old tags in the template grouping tree, locate or create the target ROI group, encapsulate the hierarchical zero coordinate sequence corresponding to the closed organizational boundary into a boundary label object according to the contour traversal order and write it into the target ROI group; and execute the breakpoint resume skip when the JSON file, mask image and boundary overlay image corresponding to the slice identifier already exist.
[0015] Secondly, the present invention provides a full-field pathological section tissue boundary extraction device based on multi-source tissue evidence protection and staged suppression of edge artifacts, comprising: The scale generation module is used to acquire full-field pathological slices and generate scale-adaptive processed images based on the zero original physical resolution of the full-field pathological slices, the preset target physical resolution, and the tile scale. The multi-source feature and candidate segmentation module is used to calculate multi-source features for scale-adaptive processing maps, including gray intensity, saturation, color space channels characterizing tissue staining properties, white-background distance, and color channel dispersion. These multi-source features serve as the shared judgment criteria for subsequent optimization processing stages. Based on gray intensity, a baseline threshold is obtained using the Otsu method, and a preset positive offset is applied to obtain an effective segmentation threshold. A loose initial tissue candidate mask is generated based on the effective segmentation threshold and color channel dispersion. A configurable mask optimization module is used to construct tissue evidence anchors and a set of light-colored tissue candidates based on multi-source features, and to perform phased optimization processing on a loose initial tissue candidate mask according to a preset module configuration to obtain an optimized tissue mask. The phased optimization processing includes: locating artifact seeds from the image edge band and restricting their growth within the mask to remove edge artifacts, with the growth process blocked by tissue evidence anchors and the set of light-colored tissue candidates; determining the outer band of a single round using distance transformation and iteratively trimming low-chroma or near-background pixels within the outer band outside the anchor protection zone; based on the difference loss set of the mask before and after trimming, performing limited geodesic expansion and filling in the candidate region within the preset spatial distance envelope of the mask after distance trimming and excluding hard artifacts, starting from the stable tissue anchors, and performing weak artifact independent verification only on the newly filled region; and directly passing the input mask to the subsequent enabled steps for processing steps that are not enabled. The contour extraction and coordinate mapping module is used to extract closed contours from the optimized tissue mask. Based on the perimeter of the closed contour, the polygon simplification tolerance is adaptively determined and the contour is approximated by polyline. The coordinates of the simplified contour points are mapped to the hierarchical zero-pixel coordinates of the full-view pathological slice through independent horizontal and vertical scaling ratios to generate closed tissue boundaries.
[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 perform the above-described method for extracting the boundaries of full-field pathological sections based on multi-source tissue evidence protection and phased suppression of edge artifacts.
[0017] Fourthly, the present invention provides a readable storage medium storing a computer program, which, when executed by a processor, implements the above-described method for extracting the boundaries of full-view pathological sections based on multi-source tissue evidence protection and phased suppression of edge artifacts.
[0018] The main contributions and innovations of this invention are as follows: 1. By using an effective segmentation threshold with a positive offset to generate a loose initial tissue candidate mask, the detection capability of weakly stained real tissues such as lightly stained mucus areas and fat vacuole edges is significantly improved. At the same time, by combining multi-source features such as gray intensity, saturation, color space channels that characterize tissue staining characteristics, white background distance, and channel dispersion, the erroneous introduction of pure white slide background and uniform scanning background color is suppressed from the source.
[0019] 2. By dividing the slide into two levels of adaptive regions, namely a wide edge band and a narrow seed band, artifact stripping is restricted to grow only from the high-confidence seeds at the edge inwards. The growth process is blocked by the physical barrier formed by pink tissue evidence and pale tissue candidates, which completely solves the technical problem of difficulty in separating the slide edge refraction, tape and scanning frame from the real tissue at the edge, and easy to cause whole-block accidental deletion.
[0020] 3. A final protected area is constructed through a multi-level defense mechanism of strong tissue anchors and weak light tissue candidates. The pruning range is strictly limited to the outer layer of a single round by using distance transformation. Only pixels outside the protected area that appear to be low in color or close to the background are pruned in round-by-round iterations. This avoids the damage to internal pores, narrow connection parts and healthy edge structures caused by traditional global morphological erosion.
[0021] 4. Based on the differential loss set of the masks before and after trimming, the candidates for restoration are strictly limited to the intersection of the preset spatial distance envelope from the stable mask, the light tissue color condition, and the set of hard artifacts. Only a limited number of geodesic expansions are performed starting from the stable anchor point. After restoration, only the newly added area is independently checked for weak artifacts based on the stable mask before restoration. This completely cuts off the technical path of artifacts forming supporting evidence on their own after restoration, and achieves accurate recovery of small, accidentally deleted tissues.
[0022] 5. A scale-adaptive processing map is established based on the original physical resolution and target resolution of the slices. A dynamic tolerance proportional to the perimeter of the outline is used for polygon approximation. Combined with independent horizontal and vertical scaling and boundary clipping, coordinate drift and out-of-bounds errors caused by size rounding are eliminated. At the same time, it supports the on-demand start and stop of the staged enhancement module and direct mask transmission, which significantly improves the batch processing robustness and system compatibility for different staining depths, scanning devices and tissue types.
[0023] 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
[0024] 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 module architecture diagram of the batch tissue boundary extraction system of the present invention; Figure 2 This is a flowchart illustrating the overall process of extracting tissue boundaries from full-view pathological sections according to the present invention. Figure 3 This is a schematic diagram illustrating the evidence consistency processing chain for tissue preservation and artifact suppression in this invention; Figure 4 This is a schematic diagram of the hardware structure of an electronic device according to an embodiment of the present invention. Detailed Implementation
[0025] 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.
[0026] 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.
[0027] To facilitate understanding of the technical solution of this invention, the technical terms used in this specification are first uniformly defined as follows: Whole Slide Image (WSI): refers to a multi-resolution digital slide image obtained by a pathology slide scanner. WSI has a pyramid-like multi-level resolution structure, where Level 0 is the highest resolution layer, and the coordinates of Level 0 are the pixel coordinates of the original highest resolution image.
[0028] Tissue candidate mask: refers to a binary matrix representing tissue candidate regions at a low-resolution processing scale, with tissue pixels set to 1 or 255 and background pixels set to 0.
[0029] Saturation S: refers to the saturation component obtained after converting an RGB image to the HSV color space, representing the vividness of pixel colors.
[0030] Color space channels characterizing tissue staining properties: These are color feature channels that can reflect the enrichment of specific staining components in pathological sections. In the preferred embodiment of hematoxylin-eosin staining, they are specifically represented by the a-channel component of the LAB color space (also known as pink tendency A), which provides positive evidence for pink or purplish-red eosinophilic tissue structures. In alternative embodiments, they encompass optical density spatial components, color deconvolution channels, or functionally equivalent color space feature channels.
[0031] White background distance D: refers to the Euclidean distance between the pixel's RGB color vector and the pure white vector (255,255,255), used to quantify the degree of color deviation of a pixel from a pure white background.
[0032] Channel dispersion σ: refers to the overall standard deviation of the red, green and blue channel values of the same pixel, used to characterize the channel differences, texture details and color richness within a pixel.
[0033] Organizational evidence anchors: refer to high-confidence organizational pixels that meet strict joint threshold conditions of pink tendency, saturation, white background distance, and channel dispersion.
[0034] Light-colored tissue candidates: refers to weakly stained tissue pixels that are lightly stained but still meet the conditions of minimum white background distance, pink tendency, saturation and dispersion.
[0035] Edge artifacts: refer to non-organic background interference such as slide reflections, coverslip refractions, sealing tape, slide cracks, and black edges in scanning that are close to or connected to the edge of the image.
[0036] Hard artifacts: refer to the set of unorganized backgrounds consisting of pixels that meet the near-white refractive index condition (D<35 and S<16 and σ<5) and pixels that meet the low pink and low chromaticity condition (A<130 and S<16 and σ<5).
[0037] The input to the method of this invention includes at least one full-field pathological slide file. The slide supports multiple digital slide formats such as SVS, TIF / TIFF, SDPC, and KFB. Optional inputs include slide physical resolution, target physical resolution, tile scale, oversampling factor, connected component threshold, contour simplification ratio, and structured label template.
[0038] The output of the method of the present invention includes at least one or more closed tissue contours in the hierarchical zero coordinate system. Preferably, the output also includes a binarized tissue mask image, the original thumbnail, a boundary overlay image, a structured label file, and a batch processing summary table.
[0039] Example 1 This invention aims to propose a method for extracting tissue boundaries from full-field pathological sections based on multi-source tissue evidence protection and staged suppression of edge artifacts. Specifically, as follows: Figure 2As shown, the method of the present invention includes the following steps. Steps S1 to S3 and S9 to S10 constitute the basic processing chain, while steps S4 to S8 are optional enhanced processing steps. The threshold values are used to illustrate preferred embodiments and do not constitute a limitation on the scope of protection.
[0040] Step S1: Read the slices and generate a scale-adaptive processing map Read the full-field pathological slide file and parse it to obtain its zero-width layer. ,high and the zero original physical resolution of the hierarchy Let the user-defined target physical resolution be... (Unit: micrometers / pixel), tile scale is (Unit: pixels), oversampling factor is a positive integer. Rounding is performed first, then multiplication is performed. Calculate the preprocessing graph size in the order of pooling: ; ; when When >1, the system first... × Processing maps and masks are generated on high sampling densities, where and These represent the width and height of the pre-pooling image (in pixels), respectively. Subsequent processing... × Block voting pooling yields the final mask size. = / , = / ,in and These are the width and height of the final mask, respectively (in mask pixels); when When =1, pooling is not performed, and the final mask size is the same as the processing map size, i.e. = , = If the slice metadata is missing If a verified alternative physical resolution is used, the slice processing will be terminated and the failure status recorded if no alternative value is configured, and subsequent slice processing will continue.
[0041] The technical purpose of this step is to ensure that the scale of the low-resolution processed image is strictly aligned with the physical properties of the slice, eliminate the impact of differences between the image scale and physical resolution on subsequent tissue localization, and lay the foundation for high-precision hierarchical zero mapping.
[0042] Step S2: Constructing multi-source color and texture evidence Gaussian smoothing filtering is applied to the RGB image to eliminate local high-frequency noise. Let any pixel in the processed image... The red, green, and blue channel values are R, G, and B, respectively, all being 8-bit unsigned integers within the range of 0 to 255. Subsequently, the following five-dimensional features are extracted: 1. Grayscale intensity map : Obtained by conversion from RGB image processing, using This is to indicate a strict distinction from the green channel G.
[0043] 2. Saturation S: The saturation component is obtained after converting the RGB image to the HSV color space, and the value range is mapped to 0~255.
[0044] 3. Pink Tendency A: After converting the RGB image to the LAB color space, the a channel component is obtained and used to characterize the pink or purplish-red features in HE staining.
[0045] 4. White background distance D: The Euclidean distance between the pixel color vector (R,G,B) and the pure white background vector (255,255,255) is calculated using the following formula, where D is the white background distance, and R, G, and B are the red, green, and blue channel values of the pixel, respectively: ; 5. Channel dispersion σ: The overall standard deviation of the R, G, and B channel values of the same pixel is calculated using the following formula: ; The technical role of this step is to comprehensively characterize pixels from five dimensions: brightness, color saturation, specific coloring tendency, background contrast, and color dispersion. All features serve as a unified chain of evidence for subsequent optimization stages, eliminating conflicts in judgment criteria between stages.
[0046] Step S3: Generate a loose initial tissue candidate mask After excluding pure white pixels, the grayscale image The baseline segmentation threshold is obtained by applying the Otsu method. To fully incorporate lightly stained tissue, an effective segmentation threshold was set. Set to (where The final effective segmentation threshold, The upper limit of the threshold, As the baseline segmentation threshold, (Positive offset of threshold) ; in, It is a positive offset (preferably Δt=33). upper limit of threshold (preferred) =250). Gray intensity ≤ The pixels are initially included in the tissue candidate, and flat, uniform background pixels with no color difference and channel dispersion σ below the minimum dispersion threshold (such as σ<3) are removed to generate a loose initial tissue candidate mask.
[0047] The technical role of this step is to significantly improve the recall rate of weakly stained, lightly stained mucus areas and fat vacuoles by using positive threshold shift, while using color dispersion to remove flat backgrounds from the source, providing a high-quality initial base map for subsequent phased optimization.
[0048] Step S4 (optional): Suppress artifact seeds before recovering pale tissue This step is a configurable enhancement process. To address interference from slide edges, refractive reflections, sealing tape, and scanning borders, this step suppresses artifact seeds before recovering pale tissue.
[0049] First, construct a set of evidence related to the pink organization. With pale tissue candidate set .in, Preferably, A ≥ 130, S ≥ 5, D ≥ 18, and σ ≥ 3, where A collection of evidence related to the pink organization; Determined by the following combined conditions, where For the candidate set of light-colored tissues, , , , Pixels Saturation, white background distance, LAB-a channel value, and channel dispersion. The corresponding judgment threshold is: ; The preferred threshold configuration is as follows: =6、 =20、 =130、 =3. During artifact removal, for hits and Pixels are protected in advance.
[0050] The following processes are then executed in sequence: 1. Two-level adaptive edgeband construction: using wide edge bandwidth Define a wide edge band to limit artifact search to edge-related regions and prevent accidental damage to internal tissues; use a narrow seed bandwidth. Define a strict artifact seed band to tighten the artifact growth start point near the edge.
[0051] 2. Edge-fitting connected component filtering: For connected components with wide contact edges, statistically analyze the proportion of pink and light-colored candidates within them. Quantity and proportion, average A value and average S value; the entire connected region is deleted only when there is insufficient pink evidence, the overall color is weak and there is also insufficient evidence of light-colored tissue.
[0052] 3. Low pink pixel filtering at the edges: Within the wide edge band, directly delete pixels that do not belong to the pink pixel range. It does not belong to And both A and S are low-chroma pixels below the preset threshold.
[0053] 4. Filtering of light and dark linear artifacts: Pixels are located based on light refraction conditions with low S, low A, and relatively small D, and dark linear scanning border conditions with low S, low A, and relatively large D, and are deleted after excluding tissue protection sets.
[0054] 5. Edge-restricted growth stripping: A strict artifact seed is located within a narrow seed band; starting from this seed, dilation is performed only within the current mask, in unprotected areas, and within regions meeting low-chromaticity passability conditions (preferably using 3×3 elliptical structural elements, with a maximum of 25 iterations); when the dilation front encounters... or Growth terminates when a physical blocking layer is formed, and stops when the iteration limit is reached or the region no longer changes, deleting all reachable artifact regions.
[0055] The technical function of this step is to limit artifact search to the edge zone, strictly start artifact stripping from the real artifact seed at the edge, and block inward propagation by tissue evidence, thus solving the problem that adhesion artifacts cannot be stripped and are prone to accidental deletion of real tissue at the edge.
[0056] Step S5 (optional): Perform connection constraint recovery of light-colored tissue This step is a configurable enhancement process. It involves comparing the rigorous mask processed in step S4 with the candidate set of light-colored tissues. The union of the candidate joint graphs is obtained, and eight-neighbor connectivity analysis is performed on the joint graphs. The rescue results are included in the mask only if the connected components simultaneously meet the following conditions: 1. The area of the connected components is not less than a preset area threshold (preferably not less than 10 processed image pixels); 2. The connected region contains no less than a preset number of seed pixels derived from the strict mask in step S4 (preferably no less than 5 seed pixels).
[0057] The technical function of this step is to restore only the light-colored areas that are physically connected to the identified real tissue, to avoid isolated light-colored background artifacts being mistakenly recovered due to color similarity, and to achieve evidence synergy with the early protection mechanism in step S4.
[0058] Step S6 (optional): Perform tissue anchor point protected outer edge trimming This step is a configurable enhancement process. It involves constructing a strong tissue anchor defense system on the recovered tissue mask. 1. Definition of strong tissue anchors: including pink high confidence anchors (A≥134 and S≥10 and D≥28 and σ≥3), used to construct the basic anchor layer of multi-level defense zones; high saturation staining anchors (A≥145 and S≥12 and D≥20 and σ≥3), used to enhance the protection of high confidence tissue regions; and extremely high saturation tissue anchors (A≥135 and S≥55 and σ≥3), used to cover the protection needs of high saturation staining regions.
[0059] 2. Weak Color Candidate and Double Rejection Mechanism: Weak candidate pixels are extracted (A≥133, S≥8, D≥25, and σ≥3). Low color saturation rejection (if A<138, S<16, and σ<7) and near-white background rejection (if D<45, S<18, and σ<8) are applied to them. After rejection, weak candidate pixels are only considered protected seeds if they are located within the 3×3 neighborhood expansion range of a strong tissue anchor point, or if their connected region contains at least 80 strong anchor points or the proportion of strong anchor points is not less than 0.006. The protected seeds undergo another round of expansion to form the final protected area. The technical function of the low color saturation rejection condition (A<138, S<16, σ<7) and the near-white background rejection condition (D<45, S<18, σ<8) is to construct a multi-level defense zone to prevent weak background pixels from obtaining tissue protection.
[0060] 3. Distance Transformation Outer Layer Dynamic Trimming: Perform an Euclidean distance transformation on the current mask to calculate the shortest distance (dist) from the foreground pixel to the background boundary. This will satisfy... The area is defined as the outer layer of a single wheel (preferred). =7 processed image pixels), of which This represents the width of the outer band in a single round. Within the outer band of a single round but outside the protected area, pixels that meet the low chromaticity condition (S<28 and A<140) or the near-background condition (D<90 and S<26) are deleted. After each round of deletion, the distance transform and outer band are recalculated, and this process is repeated iteratively (up to 6 rounds) until no pixels can be deleted. The trimming condition (S<28 and A<140, or D<90 and S<26) is combined with... =7. The technical function of a maximum of 6 iterations is to trim only the outer low-saturation or near-background bands, thus protecting the integrity of the internal structure.
[0061] The technical function of this step is to strictly limit the pruning force to the outer surface by using distance transformation, peeling away the low-color edges round by round from the outside to the inside, protecting the internal pores, narrow connections and protected light-colored tissue structures.
[0062] Step S7 (optional): Perform limited restoration and verification of the mistakenly deleted areas during trimming. This step is a configurable enhancement process. For example... Figure 3 As shown, let the mask before outer layer trimming be... The mask after trimming is Define the differential loss set ,in For trimming the pre-mask, For post-trimming masking, This is the missing set.
[0063] Define the candidate region for filling in the gaps For the lost set Spatial distance envelope, light tissue multi-source color conditions and hard artifact set The intersection of complements, where To fill in the candidate region, This represents the upper limit of spatial distance. For hard artifact collection: ; in, Upper limit of spatial distance (preferred) =3 processed image pixels); Hard artifact set Defined as: ; The technical function of the hard artifact rejection condition H=(D<35 and S<16 and σ<5)∪(A<130 and S<16 and σ<5) is to prevent near-white refraction and low pink artifacts from re-entering the mask.
[0064] The specific procedures for resubmission and independent review are as follows: 1. =3 is used to limit the spatial envelope of the candidate region for replenishment. Anchor point expansion for 3 rounds and geodesic expansion for 1 round are used to control the actual number of propagation steps for replenishment. Its technical function is to only restore the erroneously deleted light tissues that are adjacent to stable tissues and to strictly limit the number of propagation steps for replenishment.
[0065] 2. Constrained geodesic restoration: using a pruned, stabilized mask Reliable organized pixels in the model are used to construct stable anchor points. The neighborhood and region obtained by expanding the stable anchor points through 3×3 structuring elements for 3 rounds are then compared with the model. The intersection of the regions is used as the replacement seed; in the region Internally, perform one round of geodesic expansion, retaining connected domains containing at least two replenished seeds and incorporating them into the mask.
[0066] 3. Independent weak artifact verification: Only the newly added and restored pixel areas are used as the verification range, and the stable mask before restoration is used. As the sole source of anchor points, calculate the proportion of neighboring anchor points, the proportion of pink, and the mean of each feature for connected components within the verification area; delete the connected component when the organizational evidence is insufficient and it presents weak color or near-background features.
[0067] The technical purpose of this step is: to... By limiting the candidate envelope and using one round of geodesic expansion to limit the actual propagation steps, the true faint tissue adjacent to stable tissues is accurately restored; at the same time, the verification is only for newly added areas and the anchor point originates from the pre-mask replenishment, cutting off the technical path for artifacts to form supporting evidence on their own.
[0068] Step S8 (optional): Remove weak and weak large isolated artifacts and perform pooling. This step is a configurable enhancement process.
[0069] 1. Isolated artifact cleanup: Perform eight-neighbor connectivity statistics on the mask.
[0070] For small isolated regions: if the area is ≤5000 pixels or the area ratio is ≤3% of the largest connected region, and the pink ratio is <3%, and at least one of the following conditions is met: average A <145, average S <55, or average σ <12, then it is deleted. The technical function of the filtering conditions for small isolated regions (area ≤5000 or ≤3% of the largest connected region, pink ratio <3%, and average A <145, average S <55, or average σ <12) is to remove small, detached artifacts that are separated from the main body and lack evidence.
[0071] For larger isolated areas that are not the largest subject: if the area is ≤ 35% of the area of the largest subject, and the proportion of pink evidence is < 1.5%, the proportion of rescue evidence is < 3%, the proportion of strong evidence is < 0.5%, and the average A is < 136, the average S is < 35, and the average σ is < 10, then it is deleted; the technical function of the filtering conditions for larger non-largest areas (area ≤ 35% of the largest subject, pink evidence < 1.5%, and average A < 136, average S < 35, average σ < 10) is to: remove larger artifacts that are separated from the subject and lack evidence, while the largest subject is always retained.
[0072] 2. Oversampling Block Voting Pooling: When k>1, the oversampling mask is divided into k×k pixel blocks, and the number of foreground pixels within each block is counted. When the number is not lower than a preset voting threshold (e.g., when k=2, at least 3 out of 4 pixels are foreground), the corresponding foreground pixels are output in the final mask. When k=1, the pooling step is skipped, and the original scale mask is output directly. The technical effect of skipping pooling when k=1 and retaining at least 3 out of 4 pixels as foreground when k=2 is to suppress scattered noise and jagged edges, thereby improving mask stability.
[0073] Step S9: Extract the contour and map it to the hierarchical zero coordinate. Extract the closed outer contour from the final binary mask, and filter out tiny contours with an area lower than a preset threshold (such as 30 mask pixels).
[0074] For each contour, based on its perimeter in the final mask coordinates Adaptive calculation of polygon approximation tolerance ,in For polygon approximation tolerance, The proportionality constant is a dimensionless approximation. The perimeter of the contour in the final mask coordinates: ; in, The technical function of parameter configuration is to strictly control geometric deviations and reduce the amount of redundant coordinate data.
[0075] in For dimensionless approximation simplification of the proportionality coefficient, the preferred method is... =0.0003. A polygon approximation algorithm is used to simplify the contour using polylines, retaining polygons with at least 3 vertices and arranging them in descending order of area.
[0076] Let the coordinates of the simplified mask contour points be... (in (The pixel coordinates in the final mask coordinate system) are mapped to the WSI level zero pixel coordinates through independent horizontal and vertical scaling. (in (Assuming the mapped layer zero-pixel coordinates), and then performing boundary range clipping: ; ; The technical function of this step is to compress the amount of contour data under the premise of strictly controlling geometric errors. Independent horizontal and vertical scaling and cropping operations eliminate the risk of coordinate drift and out-of-bounds caused by size rounding.
[0077] Step S10: Generate templated structured output and batch processing records The system deeply replicates the preset business interface JSON template (such as the AI_Service_Ihc_v1 class template), fully preserving the top-level field Version (default V2.0), the root group GroupModel, and its sub-group tree structure; it recursively cleans up the historical labels Labels in the group tree and sets the historical quantitative field IHCResult to null; then it recursively searches for the target group named ROI, and if it does not exist, it is automatically created under the root group.
[0078] Its complete minimum schema is as follows: Top-level object: contains Version (string), GroupModel (root grouping object), ClassifyRoot, RedBloodCellQualitativeInfos, and IHCResult (all can be null).
[0079] Grouping object: Contains Color (string), Groups (array of subgroups), Labels (array of labels), and Name (group name). The root group's Name is root, and the target group's Name is ROI by default.
[0080] Boundary label object: contains Area (floating-point compatible field), Coordinates (coordinate array arranged in outline order), FillBackgroundColor, FontColor, LineColor (color string), FontSize, LineWidth, Opacity (numeric), ID (integer), Name (string), PartOfGroup (group name), Tag (string or null value), and Type (label type, preferably btn_brush).
[0081] Coordinate elements: The output is a "x, y" string with two decimal places; compatible implementations can also use coordinate objects containing X and Y numeric fields, but maintain the same representation within the same output file. All coordinates are WSI level zero-pixel coordinates.
[0082] Each contour corresponds to a label object, which is appended to the Labels array of the target group. Preferred display parameters include LineColor=#FF0000FF, FillBackgroundColor=#FF0000FF, FontColor=#FFFF0000, LineWidth=2.0, FontSize=12.0, Opacity=0.3, Area=0.171, and Tag=add; these fields ensure compatibility with image viewing software and do not participate in organizational boundary calculations.
[0083] Simultaneously save the final mask image, the original thumbnail, and the boundary overlay image. The batch processing module captures exceptions and closes handles one slice at a time; when the JSON file, mask PNG, and boundary overlay PNG corresponding to the same slice identifier all exist, it is marked as skipped_existing to enable breakpoint resumption; missing... If no backup value is available, the system records "failed" and continues processing subsequent slices, ultimately generating a batch processing summary table containing slice identifiers, status, output paths, outline counts, point counts, and size information.
[0084] The technical role of this step is to decouple the algorithm kernel from the specific image viewing software template, and to provide engineering-level breakpoint resume and fault isolation capabilities.
[0085] The following are specific implementation examples of the present invention: Example 1: Batch boundary extraction of hematoxylin-eosin stained full-field sections This embodiment processes batches of HE-stained pathological slides containing SVS, TIF / TIFF, SDPC, or KFB format files.
[0086] 1. The slice input module recursively searches the slice files in the input directory and reads the original physical resolution of the slice to be processed. and hierarchical zero size ( ).
[0087] 2. Set the tile scale P=112, the user-defined target physical resolution mpp=0.5 micrometers / pixel, and the oversampling factor k=2. The input pixel's R, G, and B values are all 8-bit unsigned channel values in the range of 0–255. The scale generation module calculates the size of the pre-pooling image based on the size conversion formula. And generate a thumbnail-processed image.
[0088] 3. Calculate the multi-source feature map after Gaussian smoothing. S, A, D, σ. The Otsu method obtains the baseline threshold after excluding pure white backgrounds. ,set up Calculate the effective threshold , combined σ ≥3 generates a loose initial tissue candidate mask.
[0089] 4. Execute the complete enhancement and optimization processing chain from steps S4 to S8 in sequence.
[0090] 5. Perform 2×2 block voting pooling on the optimized mask to obtain the final mask (size). ).
[0091] 6. Extract the outer contour with an area of at least 30 mask pixels, using 0.0003 times the contour perimeter as a simplification tolerance. A simplified approximation using a broken line is performed.
[0092] 7. Set the coordinates of the polygon vertices ( Substitute the values into the independent mapping formula to map back to the hierarchical zero-pixel coordinate system, write the ROI grouping in the JSON template, and simultaneously output the mask image, original thumbnail, and overlay effect image. If a slice is missing... If no backup value is configured, the failure information is recorded and the remaining slices are processed.
[0093] Example 2: Extraction of lightly stained tissue located at the edge of a glass slide In a certain lightly stained tissue section, the main body of the lightly stained tissue was directly close to the edge of the slide, and locally connected to the low-saturation refractive area.
[0094] 1. The initial loose segmentation incorporates lightly stained tissues and adjacent low-saturation refractive regions into the candidate mask.
[0095] 2. Upon proceeding to step S4, the system calculates the light-colored candidate colors within the connected components along the edges. The proportion and quantity of (S≥6, D≥20, A≥130, σ≥3); due to reaching the preset protection threshold, the system rejects the traditional whole-block edge deletion operation.
[0096] 3. Strict artifact seeding starts from the colorless refractive edge within a narrow seed band and expands inward along the low-chromaticity passable area inside the mask; when growth progresses to the boundary of the lightly stained tissue, the lightly stained tissue pixels hit the target. The aggregate forms a blocking layer, and artifact growth immediately terminates.
[0097] 4. The system deletes the reachable refractive area and in the subsequent step S6, only the unprotected outer layer is trimmed, thereby preserving the main body of the tissue with lightly stained edges while eliminating adjacent refractive artifacts.
[0098] Example 3: Limited geodesic restoration and independent verification after outer layer pruning of tissue When performing step S6 outer band trimming on the edge of a narrow tissue, some weakly stained edge pixels were mistakenly deleted.
[0099] 1. The system compares the masks before and after trimming to obtain the differential loss set. .
[0100] 2. Construct a rigorous candidate region for filling in gaps Select only Pixels that satisfy the condition of having a stable mask distance of ≤3 processed image pixels after trimming, and A≥128, S≥4, D≥15, σ≥2, while excluding hard artifact sets. (Near-white refraction and low pink and low color saturation pixels).
[0101] 3. After expanding the high-confidence anchor points in the stable mask three times, and then... Intersection yields a replacement seed; in the candidate region An internal geodesic expansion is performed to accurately restore the accidentally deleted faded edge pixels.
[0102] 4. Subsequently, only the newly added pixels are sent to the verification module to be used with the trimmed stable mask. The anchor point support rate was calculated, and the newly added pixels were successfully confirmed as real organizational structures, preventing the background artifacts at the outer edge from self-reconstructing by the compensation mechanism.
[0103] Example 4: Decoupling output of structured JSON templates from business systems When the pathology analysis platform provides a custom JSON annotation template: 1. The templated output module deeply copies the template file, retaining its top-level field Version (e.g., V2.0) and root group GroupModel.
[0104] 2. Recursively traverse and clear any remaining historical labels in the original template, and reset the IHCResult field to empty.
[0105] 3. Retrieve the subgroup array Groups and locate the target group named ROI; if it does not exist, create a new group object named ROI under the root group.
[0106] 4. For each extracted hierarchical zero contour, construct a label object: set ID to an incrementing integer, Name to ROI, PartOfGroup to ROI, Type to btn_brush, Opacity to 0.3, and LineColor to #FF0000FF. Then, format the hierarchical zero coordinates as a string array in traversal order and write it to the Coordinates field for seamless adaptation to the parsing and rendering of pathology slide reading software. If no template is provided, generate the minimum valid structure containing the above fields.
[0107] Example 5: Dynamic adjustment of configurable modules for batches prone to accidental deletion When processing a special batch of slides that are lightly stained or have extremely thin fragments, to prevent excessive cleaning of small fragments: 1. Configure and load conservative parameter groups in the batch processing module, set the enable flag of the strict edge-constrained stripping module in step S8 (isolated artifact cleanup) and step S4 to False, while keeping step S6 (outer layer trimming) and step S7 (constrained patching) enabled.
[0108] 2. In the processing flow, when the closed steps S4 and S8 are executed, the system directly transmits the input mask to the next enabled module without modification.
[0109] 3. This configurable mechanism flexibly balances artifact removal intensity and weak tissue recall without modifying the basic candidate segmentation, coordinate mapping, and output interface, thereby improving the system's adaptability to different scanning batches and staining differences.
[0110] Example 2 Based on the same concept, this invention also proposes a full-field pathological section tissue boundary extraction device based on multi-source tissue evidence protection and staged suppression of edge artifacts, such as... Figure 1 As shown, it includes the following modules: Slice Input Module: Receives slice file paths and format lists, reads slice data in formats such as SVS, TIF / TIFF, SDPC, and KFB, and parses to obtain the original zero-level dimension. ) and original physical resolution .
[0111] Scale generation module: Receives tile size, tile scale P, target physical resolution mpp, and base physical resolution. Given the oversampling factor k, calculate the width and height dimensions of the processed image before and after pooling and generate a scale-adaptive thumbnail.
[0112] Multi-source feature module: Receives RGB thumbnail processed images and generates grayscale intensity. The five-dimensional feature map, including saturation S, pink tendency A (LAB-a channel), white background distance D, and channel dispersion σ, serves as a shared criterion for subsequent optimization stages.
[0113] Candidate segmentation module: Receives grayscale intensity image and threshold parameters, performs Gaussian smoothing filtering, adaptive positive offset threshold segmentation and uniform background suppression, and generates a loose initial tissue candidate mask.
[0114] Configurable mask optimization module: Receives initial tissue candidate masks, multi-source features, and module configuration switches, selectively performing enhancement processing such as artifact seed filtering, tissue anchor point protection, edge-restricted growth stripping, light-colored tissue connectivity recovery, outer band trimming, restricted geodesic repair, independent verification of newly added regions, and isolated weak artifact removal. Inactive enhancement processing modules do not change the current mask; they directly pass the input mask through to subsequently enabled modules.
[0115] Contour and Coordinates Module: Receives optimized masks and hierarchical zero dimensions, extracts closed outer contours, performs area filtering, perimeter adaptive polyline approximation simplification, and independent horizontal and vertical scaling and coordinate validity clipping.
[0116] Templated output module: Receives contour data, business JSON templates and display parameters, cleans up old labels, locates or creates target ROI groups, writes boundary labels and outputs structured files and visualization images.
[0117] Configuration and batch processing module: Receives input directory, recursive scan switch and breakpoint resume skip switch, loads batch parameter group, and performs fault isolation on slice by slice in the slice set to ensure that abnormal processing of a single slice does not affect the entire batch task.
[0118] Besides the basic processing chain consisting of slide reading, candidate mask generation, contour extraction, and result output, configurable enhancement processing modules include artifact seed filtering, light-colored tissue recovery, edge adhesion artifact removal, outer band trimming, erroneous tissue restoration, weak artifact verification after restoration, and isolated artifact cleanup. The system sets independent or grouped start / stop flags for these enhancement processing modules and can load different module combinations and parameter groups for different staining types, organs, scanning devices, or slide batches. When a module is closed, the current mask is directly passed to the subsequently enabled module; for modules that require preceding differential regions or stable anchor points as input, they can be closed along with their preceding modules or automatically skipped when no valid input exists.
[0119] Example 3 This embodiment also provides an electronic device, see reference. Figure 4 It includes a memory 402 and a processor 401, the memory 402 storing a computer program and the processor 401 being configured to run the computer program to perform the steps in any of the above method embodiments.
[0120] Specifically, the processor 401 may include a central processing unit (CPU), an application specific integrated circuit (ASIC), or one or more integrated circuits that can be configured to implement the embodiments of the present invention.
[0121] The memory 402 may include a mass storage device for data or instructions. For example, and not limitingly, the memory 402 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, the memory 402 may include removable or non-removable (or fixed) media. Where appropriate, the memory 402 may be internal or external to a data processing device. In a particular embodiment, the memory 402 is non-volatile memory. In a particular embodiment, the memory 402 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.
[0122] The memory 402 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 401.
[0123] The processor 401 reads and executes computer program instructions stored in the memory 402 to implement any of the full-view pathological section tissue boundary extraction methods based on multi-source tissue evidence protection and phased suppression of edge artifacts in the above embodiments.
[0124] Optionally, the electronic device may further include a transmission device 403 and an input / output device 404, wherein the transmission device 403 is connected to the processor 401 and the input / output device 404 is connected to the processor 401.
[0125] The transmission device 403 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 403 may be a Radio Frequency (RF) module used for wireless communication with the Internet.
[0126] Input / output device 404 is used for inputting or outputting information. It can be a speaker, microphone, monitor, or keyboard.
[0127] Example 4 This embodiment also provides a readable storage medium storing a computer program. When the computer program is executed by a processor, it implements the method for extracting the boundaries of full-view pathological sections based on multi-source tissue evidence protection and phased suppression of edge artifacts, as described in Embodiment 1.
[0128] 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.
[0129] 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.
[0130] 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. A computer program product may include one or more computer-executable components configured to perform embodiments when the program is run. One or more computer-executable components may be at least one piece of software code or a portion thereof. Additionally, it should be noted that any block in the logical flow of the figures may represent a program step, or interconnected logical circuitry, blocks and functions, or a combination of program steps and logical circuitry, blocks and functions. The software may 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, for example, DVDs and their data variants, CDs, etc. The physical medium is a non-transient medium.
[0131] 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.
[0132] Without departing from the core technical essence of this invention, those skilled in the art can adopt the following equivalent alternatives: 1. The color space can be replaced or supplemented by HSV and LAB to HSL, YCbCr, LUV, optical density space, hematoxylin or eosin channels after color deconvolution, or staining probability maps generated by the learning model, which are used to characterize tissue staining characteristics.
[0133] 2. Initial segmentation can employ adaptive local thresholding, quantile thresholding, Gaussian mixture model, clustering, region growing, graph cut, or lightweight semantic segmentation network, with their outputs serving as initial candidates for subsequent evidence-constrained optimization.
[0134] 3. Organizational evidence anchors can be generated by fixed thresholds, statistical quantiles, sample adaptive thresholds, rule fusion scoring, or pixel-level confidence obtained through training.
[0135] 4. Edge artifact tracing can be achieved using morphological reconstruction, geodesic dilatation, breadth-first search, shortest path, fast travel method, or constrained connected component propagation.
[0136] 5. The outer band can be obtained from the inner band by Euclidean distance transformation, chessboard distance, erosion difference, multi-scale morphological gradient or contour method.
[0137] 6. Constrained recovery can be achieved through finite-round expansion, region growing with distance cost, anchor-based morphological reconstruction, or conditional random field optimization.
[0138] 7. Connectivity can be achieved using four-neighborhood, eight-neighborhood, or three-dimensional or multi-level neighborhood; component criteria can be any combination of area, perimeter, rectangle fill rate, slenderness, roundness, boundary contact rate, and color statistics.
[0139] 8. Contours can be output as JSON, GeoJSON, XML, binary annotation format, database records, or digital pathology standard objects; coordinates can be hierarchical zero-pixel coordinates, physical coordinates, or normalized coordinates.
[0140] 9. Parameter groups and module start / stop combinations can be maintained separately for different staining, organs, scanners or batches, and the modules to be activated can be determined based on thumbnail statistics, quality control results or manual selection; the parameter and module combination optimization process can also be incorporated into the system.
[0141] 10. Batch processing can be replaced with multi-process, distributed task, or message queue execution, while maintaining fault isolation and idempotency of single slices.
[0142] 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 extracting tissue boundaries from full-field pathological sections based on multi-source tissue evidence protection and staged suppression of edge artifacts, characterized in that, Includes the following steps: Obtain full-view pathological slices and generate scale-adaptive processed images based on the zero original physical resolution of the full-view pathological slices, the preset target physical resolution, and the tile scale. Multi-source features are calculated for the scale-adaptive processed image. These multi-source features include grayscale intensity, saturation, color space channels characterizing tissue staining properties, white background distance from a pixel to a white background, and color channel dispersion. These multi-source features serve as the judgment criteria shared by each subsequent optimization processing stage. A baseline threshold is obtained based on the gray intensity using the Otsu method, and a preset positive offset is applied to the baseline threshold to obtain an effective segmentation threshold. A loose initial tissue candidate mask is generated based on the effective segmentation threshold and the color channel dispersion. Based on the multi-source features, tissue evidence anchors and a set of light-colored tissue candidates are constructed, and a phased optimization process is performed on the loose initial tissue candidate mask to obtain an optimized tissue mask. The phased optimization process includes: locating artifact seeds from the image edge band, restricting their growth within the mask to remove edge artifacts, and the growth process is blocked by the tissue evidence anchors and the set of light-colored tissue candidates; using distance transformation to determine the single-round outer layer of the current mask, and iteratively trimming low-chroma or near-background pixels in the outer layer outside the protected area constructed by the tissue evidence anchors; based on the difference loss set of the mask before and after trimming, within the candidate region of the mask after distance trimming with a preset spatial distance envelope and excluding hard artifacts, limited geodesic expansion is performed from the stable tissue anchors for replenishment, and only the newly replenished region is independently checked for weak artifacts. The closed contour is extracted from the optimized tissue mask. Based on the perimeter of the closed contour, the polygon simplification tolerance is adaptively determined and the contour is approximated by polyline. The coordinates of the simplified contour points are mapped to the hierarchical zero-pixel coordinates of the full-view pathological slice through independent horizontal and vertical scaling ratios to generate the closed tissue boundary.
2. The method for extracting the tissue boundary of a full-view pathological section as described in claim 1, characterized in that, Based on the zero original physical resolution of the full-view pathological slide, the preset target physical resolution, and the tile scale, a scale-adaptive processed image is generated, including: Obtain the zero-width layer of the full-view pathological section. Zero-height hierarchy and the zero original physical resolution of the hierarchy ; Based on the preset target physical resolution Plot Scale and positive integer oversampling factor Calculate the width of the pre-pooling image using the following formula. and height : ; ; When the sampling multiple At that time, a mask is first generated on the scale-adaptive processing map, and then... The final mask is obtained by voting pooling the pixel blocks; when Skip the pooling step; The step of mapping the simplified contour point coordinates to the hierarchical zero-pixel coordinates of the full-view pathological slice by independent horizontal and vertical scaling ratios includes: Let the coordinates of the simplified contour points in the final mask be... The final mask width is Height is Map to the zero pixel coordinate of the layer according to the following formula. : ; 。 3. The method for extracting the tissue boundary of a full-view pathological section as described in claim 1, characterized in that, Artifact seeds are located from image edge bands, grown in a restricted manner within a mask to remove edge artifacts, and the growth process is blocked by the tissue evidence anchors and the set of light-colored tissue candidates, including: The wide edge band is determined using a first edge bandwidth, where the first edge bandwidth is... The proportion of tissue features is calculated for the connected regions that contact the wide edge band, and the connected regions are deleted in whole when there is insufficient tissue evidence; and low-saturation and low-pink-tendency pixels that do not match the set of pink tissue evidence and the set of light-colored tissue candidates are deleted within the wide edge band. The narrow seed band is determined using a second edge bandwidth, where the second edge bandwidth is... Strict artifact seeds are extracted within the narrow seed band; Starting from the strict artifact seed, restricted dilation is performed within the current tissue candidate mask and in a region that is in a non-tissue protection zone and meets the low chromaticity accessibility condition. Growth terminates when the dilation encounters the set of pink tissue evidence or the set of light-colored tissue candidates, and reachable regions are deleted when the iteration limit is reached or the region no longer changes.
4. The method for extracting the tissue boundary of a full-view pathological section as described in claim 1, characterized in that, After the removal of edge artifacts and before the determination of the single-wheel outer layer band of the current mask using distance transformation, the staged optimization process further includes: Rescue of light-colored tissues by performing connectivity constraints: The joint graph is obtained by taking the union of the mask after removing edge artifacts and the set of light-colored tissue candidates; Connectivity analysis is performed on the joint graph to select target connected regions whose area is not less than a preset area threshold and whose internal area contains not less than a preset number of mask seed pixels after stripping edge artifacts. The target connected regions are then incorporated into the current mask as rescue regions.
5. The method for extracting the tissue boundary of a full-view pathological section as described in claim 1, characterized in that, The outermost band of the current mask is determined using distance transformation, and low-chroma or near-background pixels within the outermost band are iteratively pruned outside the protected area constructed by the tissue evidence anchor points, including: Strong tissue anchors and weak pale tissue candidates are extracted based on the multi-source features; low chromaticity rejection conditions and near-white background rejection conditions are applied to the weak pale tissue candidates; weak pale tissue candidates that pass the rejection and are located within the preset expansion neighborhood of the strong tissue anchor or whose connected domain contains a preset number and proportion of strong tissue anchors are determined as protection seeds; neighborhood expansion is performed on the protection seeds to construct the final protection zone. Perform a distance transformation on the current mask to ensure that the distance from the pixel to the background satisfies The area is defined as the outer layer of a single wheel, where The outer layer width is preset to pixels; Within the outer layer of the single wheel and outside the final protected area, delete pixels that satisfy the low chromaticity condition of the color space channel characterizing tissue staining characteristics or the white background distance and saturation close to the background condition. After each round of pixel deletion, the distance transformation and outer band are recalculated, and the process is iterated until the preset maximum number of iterations is reached or no pixels are deleted in a single round.
6. The method for extracting the tissue boundary of a full-view pathological section as described in claim 1, characterized in that, Based on the difference loss set of the masks before and after trimming, within the candidate region that is within the preset spatial distance envelope of the post-trimmed mask and excludes hard artifacts, a limited geodesic expansion repair is performed starting from the stable tissue anchor point, and only the newly repaired region is independently checked for weak artifacts, including: Pre-trimming mask With post-trimming mask The difference set is defined as the missing set. ; Will fill in the candidate area Defined as the lost set The distance to the mask after trimming should not exceed the upper limit of spatial distance. Satisfying the conditions for multiple sources of light tissue color and excluding hard artifact sets The intersection of the complements; wherein the set of hard artifacts This includes pixels that meet the near-white refraction condition and pixels that meet the low pink tendency and low chromaticity condition; Stable anchor points are constructed using reliable tissue pixels retained in the trimmed mask, and the neighborhood of the stable anchor points after being expanded by a preset number of rounds is compared with the candidate regions for filling in the gaps. The intersection of the two regions is used as the seed for the completion of the candidate regions. Perform geodesic expansion for a limited number of rounds, and incorporate connected components containing more than a preset number of replacement seeds as replacement results into the mask; Using stable anchor points in the pruned mask as evidence sources, independent weak artifact verification is performed only on the newly added patched areas. When the tissue evidence features of a connected region are below a preset threshold and exhibit weak color or near-background features, the connected region is deleted.
7. The method for extracting the tissue boundary of a full-field pathological section as described in any one of claims 1 to 6, characterized in that, The method further includes at least one of the following: (1) Configurable optimization and mask transfer mechanism: Based on the staining type of the slice, organ type, scanning equipment type, batch identifier, thumbnail statistical characteristics or quality control results, determine the start / stop combination and corresponding parameter group of each processing module in the phased optimization process; when a certain processing module is not enabled, its input mask is directly transferred to the next enabled module. (2) Isolated artifact removal: Before extracting the closed contour, isolated small connected regions in the mask with an area lower than the preset small area threshold and a multi-source feature mean lower than the preset threshold are deleted; non-maximum main isolated connected regions with an area lower than the preset non-maximum area threshold and a multi-source feature mean lower than the preset threshold are deleted. (3) Templated and structured output: After generating the closed organizational boundary, deeply copy the preset business interface JSON template, recursively clean up the old tags in the template grouping tree, locate or create the target ROI group, and encapsulate the hierarchical zero coordinate sequence corresponding to the closed organizational boundary into a boundary label object according to the contour traversal order and write it into the target ROI group; And if the JSON file, mask image and boundary overlay image corresponding to the slice identifier already exist, the breakpoint resume will be executed to skip.
8. A device for extracting the boundaries of full-field pathological sections based on multi-source tissue evidence protection and staged suppression of edge artifacts, characterized in that, include: The scale generation module is used to acquire full-view pathological slices and generate scale-adaptive processed images based on the zero original physical resolution of the full-view pathological slices, the preset target physical resolution, and the tile scale. The multi-source feature and candidate segmentation module is used to calculate multi-source features for the scale-adaptive processing image, including gray intensity, saturation, color space channels characterizing tissue staining characteristics, white-background distance, and color channel dispersion. These multi-source features serve as the judgment criteria shared by each subsequent optimization processing stage. Based on the gray intensity, a baseline threshold is obtained by the Otsu method and a preset positive offset is applied to obtain an effective segmentation threshold. A loose initial tissue candidate mask is generated according to the effective segmentation threshold and the color channel dispersion. A configurable mask optimization module is used to construct tissue evidence anchors and a set of light-colored tissue candidates based on the multi-source features, and to perform phased optimization processing on the loose initial tissue candidate mask according to a preset module configuration to obtain an optimized tissue mask. The phased optimization processing includes: locating artifact seeds from the image edge band and allowing them to grow in a restricted manner within the mask to remove edge artifacts, the growth process being blocked by the tissue evidence anchors and the set of light-colored tissue candidates; determining a single-round outer band using distance transformation and iteratively trimming low-chroma or near-background pixels within the outer band outside the anchor point protection zone; based on the difference loss set of the masks before and after trimming, performing limited geodesic expansion and replenishment from stable tissue anchors within the candidate region of the mask after trimming, which is within a preset spatial distance envelope and excludes hard artifacts, and performing independent weak artifact verification only on the newly replenished region; and directly passing the input mask to subsequent enabled steps for processing steps that are not enabled. The contour extraction and coordinate mapping module is used to extract closed contours from the optimized tissue mask, adaptively determine the polygon simplification tolerance based on the perimeter of the closed contour and perform contour polyline approximation, and map the coordinates of the simplified contour points to the hierarchical zero-pixel coordinates of the full-view pathological slice through independent horizontal and vertical scaling ratios to generate closed tissue boundaries.
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 full-view pathological section tissue boundary extraction 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 for extracting the boundaries of full-view pathological sections as described in any one of claims 1 to 7.
Citation Information
Patent Citations
Pathological image segmentation method and device based on deep learning and readable storage medium thereof
CN120031899A
Method and system for matching images of different staining pathological sections
CN121213511A