Method and device for detecting folds of histopathological sections, storage medium and computer device
By preprocessing histopathological slide images and refining the segmentation using a lightweight segmentation model, the problem of balancing detection accuracy and efficiency in existing technologies is solved, achieving high adaptability and high accuracy detection for complex fold morphologies.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- MOTIC XIAMEN MEDICAL DIAGNOSTICS SYST
- Filing Date
- 2026-03-20
- Publication Date
- 2026-06-19
Smart Images

Figure CN122243958A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of tissue section quality control technology, and in particular to a method, apparatus, storage medium and computer equipment for detecting wrinkles in histopathological tissue sections. Background Technology
[0002] Currently, artifacts such as wrinkles and folds are easily generated during the preparation of histopathological slides. These artifacts typically manifest as overlapping local tissue structures, reduced translucency, darkened color, or a banded "ridge" shape. In severe cases, they can obscure critical diagnostic structures and affect subsequent algorithmic analysis. Therefore, accurately detecting wrinkles and folds is of great significance for the quality control of whole histopathological slides.
[0003] Current technologies for detecting wrinkles in histopathological sections mainly rely on rule-based detection of optical density or color anomalies, traditional algorithms based on texture, edge, or multi-scale contrast, or deep learning-based artifact recognition or segmentation algorithms. These methods generally suffer from insufficient adaptability to complex wrinkle morphologies, susceptibility to uneven staining or tissue edge interference, and difficulty in balancing detection accuracy and efficiency. Summary of the Invention
[0004] The purpose of this application is to at least solve one of the above-mentioned technical defects, in particular the technical defects of existing methods for detecting wrinkles in histopathological sections, such as insufficient adaptability to complex wrinkle morphology, susceptibility to uneven staining or tissue edge interference, and difficulty in balancing detection accuracy and efficiency.
[0005] This application provides a method for detecting wrinkles in histopathological sections, the method comprising: Obtain the original pathological slide image to be examined; The original pathological slide image is preprocessed to obtain an intermediate pathological slide image suitable for coarse wrinkle detection. Based on a preset image processing algorithm, a coarse detection is performed on the intermediate pathological slide image to obtain a coarse cue mask for the candidate wrinkle region; The coarse cue mask is input as cue information into a preset lightweight segmentation base model to obtain a refined segmentation mask and wrinkle classification results output by the lightweight segmentation base model.
[0006] Optionally, the preprocessing of the original pathological slide image to obtain an intermediate pathological slide image suitable for coarse wrinkle detection includes: The original pathological slide images are subjected to staining type adaptation processing to obtain adapted images; The adapted image is stained, separated, and characterized by optical density to obtain a single-channel response image, which is then used as the intermediate pathological section image.
[0007] Optionally, the original pathological slide image is an HE slide image, and the staining type adaptation processing of the original pathological slide image to obtain an adapted image includes: The HE slice image is used directly as the adaptation image.
[0008] Optionally, the original pathological slide image is an IHC slide image, and the staining type adaptation processing of the original pathological slide image to obtain an adapted image includes: The IHC slice image is subjected to color gamut unification processing so that the color statistical distribution of the processed IHC slice image approximates the color statistical distribution of the reference HE slice image, thus obtaining the adapted image.
[0009] Optionally, the step of performing color gamut unification processing on the IHC slice image to make the color statistical distribution of the processed IHC slice image approximate the color statistical distribution of the reference HE slice image includes: Select one or more images from historical high-quality HE slice images as reference HE slice images; Tissue regions were extracted from both the IHC slice image and the reference HE slice image, and background regions were removed. Based on the extracted tissue regions, color histogram matching is performed on the IHC slice image to make the color statistical distribution of the IHC slice image approximate the color statistical distribution of the reference HE slice image.
[0010] Optionally, the step of performing color histogram matching on the IHC slice image based on the extracted tissue region includes: In the RGB or Lab color space, establish a cumulative distribution function (CDF) mapping for each color channel; Based on the CDF mapping, a color mapping lookup table (LUT) is generated; The color mapping lookup table (LUT) is used to map the color distribution of the IHC slice image to the reference HE slice image.
[0011] Optionally, the step of performing staining separation and optical density characterization on the adapted image to obtain a single-channel response image includes: The adapted image is converted from pixel space to optical density space to obtain an optical density image; The optical density image is stained and separated using a preset projection matrix to obtain a multi-channel image containing H component, D component and residual component; The H component and the D component are added together, and then converted back to pixel space through exponential operation to obtain a single-channel response image.
[0012] Optionally, the coarse detection of the intermediate pathological slide image based on a preset image processing algorithm to obtain a coarse cue mask for the candidate wrinkle region includes: Median filtering is applied to the intermediate pathological slide image to obtain a denoised image; The denoised image is then subjected to Gaussian smoothing to obtain a smoothed image; Calculate the difference image between the denoised image and the smoothed image to obtain the difference response image of the enhanced wrinkled structure; Threshold segmentation is performed on the differential response image to obtain a binary coarse mask; The binary coarse mask is post-processed to obtain a coarse hint mask for the candidate wrinkle region.
[0013] Optionally, the training process of the lightweight segmentation base model includes: Obtain classification labels for the original sample pathological slide images, wherein the classification labels are used to indicate whether the original sample pathological slide images contain wrinkled regions; Obtain the refined pseudo-true value mask of the original sample pathological section image; Based on the refined pseudo-truth mask and the classification label, the lightweight segmentation base model is jointly trained, so that the lightweight segmentation base model outputs wrinkle classification results and refined segmentation mask simultaneously during the inference stage.
[0014] Optionally, obtaining the refined pseudo-real value mask of the original sample pathological slide image includes: Obtain intermediate sample pathological section images and sample coarse hint masks from the original sample pathological section images; The sample coarse cue mask is used as cue information and input into the cue encoder of the preset large parameter segmentation base model to obtain the output of the cue encoder. The intermediate sample pathological slide image is input into the image encoder of the large parameter segmentation basic model to obtain the output of the image encoder; The output of the prompt encoder and the output of the image encoder are input together into the mask decoder of the large parameter segmentation basic model to obtain the refined pseudo-real value mask output by the large parameter segmentation basic model.
[0015] Optionally, the joint training of the lightweight segmentation base model based on the refined pseudo-ground mask and the classification label includes: The original sample pathological section image is preprocessed to obtain an intermediate sample pathological section image suitable for coarse wrinkle detection. The intermediate sample pathological slice image is input into the initial lightweight segmentation base model to obtain the predicted refined mask and global semantic features. In this model, a class token is added to the token sequence of the mask decoder to generate global semantic features. The global semantic features are input into the lightweight classification head to obtain the predicted wrinkle classification result; Using the refined pseudo-real value mask as the segmentation supervision signal and the classification label as the classification supervision signal, a multi-task loss function is constructed based on the segmentation supervision signal, the prediction refined mask, the classification supervision signal, and the prediction wrinkle classification result. The initial lightweight segmentation base model is jointly optimized using the multi-task loss function.
[0016] Optionally, the method further includes: When the classification label indicates that the original sample pathological slide image is a normal image, the refined pseudo-true value mask is set to an all-zero mask for the correction of the segmentation supervision signal.
[0017] This application also provides a device for detecting wrinkles in histopathological sections, comprising: The image acquisition module is used to acquire the original pathological slide images to be detected; The preprocessing module is used to preprocess the original pathological slide image to obtain an intermediate pathological slide image suitable for coarse wrinkle detection. The coarse detection module is used to perform coarse detection on the intermediate pathological slice image based on a preset image processing algorithm to obtain a coarse hint mask for candidate wrinkle regions. The refinement module is used to input the coarse prompt mask as prompt information into a preset lightweight segmentation base model to obtain the refined segmentation mask and wrinkle classification results output by the lightweight segmentation base model.
[0018] This application also provides a computer-readable storage medium storing computer-readable instructions that, when executed by one or more processors, cause the one or more processors to perform the steps of the histopathological section wrinkle detection method as described in any of the above embodiments.
[0019] This application also provides a computer device, including: one or more processors, and memory; The memory stores computer-readable instructions, which, when executed by the one or more processors, perform the steps of the histopathological section wrinkle detection method as described in any of the above embodiments.
[0020] As can be seen from the above technical solutions, the embodiments of this application have the following advantages: This application provides a method, apparatus, storage medium, and computer device for detecting wrinkles in histopathological sections. The method acquires and preprocesses the original histopathological section image to obtain an intermediate histopathological section image. A pre-defined image processing algorithm is used to perform coarse detection on the intermediate histopathological section image, resulting in a coarse cue mask. This coarse cue mask is then input as cue information into a lightweight segmentation model to obtain a refined segmentation mask and wrinkle classification results. This method enhances wrinkle features through preprocessing and combines coarse detection using traditional image processing with refinement using a deep learning model. This effectively improves adaptability to complex wrinkle morphologies, reduces interference from uneven staining or tissue edges, and achieves a balance between detection accuracy and efficiency. Furthermore, the use of a lightweight segmentation model for classification and segmentation during the refinement stage not only reduces computational load but also further improves detection efficiency. Attached Figure Description
[0021] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0022] Figure 1 A flowchart of a wrinkle detection method based on image differencing and thresholding provided for existing technologies; Figure 2 A schematic diagram of an image detected by a deep learning-based wrinkle detection method provided by existing technology; Figure 3 A schematic flowchart illustrating a method for detecting wrinkles in a histopathological section provided in this application embodiment; Figure 4 This is an overall flowchart of the histopathological section wrinkle detection provided in the embodiments of this application; Figure 5 This is a schematic diagram of the color histogram matching process for IHC slice images provided in an embodiment of this application; Figure 6 A schematic diagram of a wrinkle and fold region detection algorithm based on staining separation and Gaussian difference provided in an embodiment of this application; Figure 7 A schematic diagram illustrating the process of generating a refined mask from the segmentation base model provided in the embodiments of this application; Figure 8 A schematic diagram of a tissue pathology section wrinkle detection device provided in this application embodiment; Figure 9This is a schematic diagram of the internal structure of a computer device provided in an embodiment of this application. Detailed Implementation
[0023] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0024] Currently, artifacts such as wrinkles and folds are easily generated during the preparation of histopathological slides. These artifacts typically manifest as overlapping local tissue structures, reduced translucency, darkened color, or a banded "ridge" shape. In severe cases, they can obscure critical diagnostic structures and affect subsequent algorithmic analysis. Therefore, accurate detection of wrinkles and folds is of great significance for the quality control of whole histopathological slides. The existing wrinkle detection and quality control solutions most similar to this application mainly include the following categories: (1) Rule-based detection based on optical density or color anomalies: Wrinkled areas are treated as "high optical density or dark color" areas, and candidate wrinkled areas are output through steps such as staining separation, brightness or optical density threshold segmentation, and morphological connected component screening. This type of method is simple and fast to implement, and is often used as the first screening step in quality control systems. However, it lacks the ability to distinguish deeply stained areas of the tissue itself (such as areas with dense inflammatory cells, necrotic areas, hemorrhage areas, etc.), and is prone to false alarms. Figure 1 As shown, Figure 1 The flowchart presents a prior art method for wrinkle detection based on image difference and thresholding. This method first uses median filtering to remove noise from the original color image and converts it to grayscale. Then, it calculates the difference between the grayscale image and the Gaussian-blurred grayscale image. Since folds and wrinkles are typically darker, their grayscale values in the difference image are often larger, allowing for subsequent detection via thresholding. However, this method is prone to misjudging other normal, darkly colored areas.
[0025] (2) Traditional algorithms based on texture, edge, or multi-scale contrast: These algorithms enhance the features of wrinkled strips through color space transformation, gradient, edge density, frequency domain response, and multi-scale filtering difference, and then combine this with thresholding for localization. This type of method can alleviate false alarms caused by simple "dark thresholding" to some extent, but it is highly parameter-dependent. The threshold and scale parameters often need to be readjusted for different tissue types, different scanners, or different batches of staining, resulting in high engineering maintenance costs. This method first converts the original color image to HSV space, and then enhances the original image using the difference between the S channel and the V channel to highlight the wrinkled areas. After these operations, the wrinkled areas in the original color image are significantly enhanced compared to other areas, thus enabling better detection through thresholding. However, this method requires parameter tuning for different tissues to make the wrinkled parts of the corresponding tissues more significantly enhanced; and the differences between IHC slices and HE slices are large, making it difficult for this method to handle domain shifts caused by different staining modes.
[0026] (3) Artifact recognition or segmentation based on deep learning: Wrinkle detection is modeled as an image classification, object detection, or semantic segmentation task, and the neural network is trained to output the category and its spatial location. The specific process is as follows: Figure 2 As shown, Figure 2 This image illustrates a wrinkle detection method based on deep learning, a method provided by existing technology. This method first collects data and then trains a deep learning model for classification, detection, or segmentation. Such methods can achieve high accuracy when labeled data is sufficient and the data distribution is fixed, but they typically rely on a large number of pixel-level annotations or fine-grained bounding box annotations, resulting in significant computational overhead for training and inference. Furthermore, if the training data is primarily HE-stained, directly transferring it to IHC staining can easily lead to issues such as… Figure 2 The domain offset shown leads to a decrease in generalization performance.
[0027] In summary, existing technologies typically strike a balance between "high recall but high false alarm rate of traditional image processing methods" and "high accuracy of deep learning methods but high annotation and computational costs, and weak cross-staining generalization." There is a lack of a comprehensive solution for HE and IHC dual-staining scenarios that can achieve high recall screening and high precision detection while reducing domain variability, and also consider deployment efficiency and interpretability. To address this technical problem, this application proposes the following technical solution, as detailed below: In one embodiment, such as Figure 3 As shown, Figure 3 A flowchart illustrating a method for detecting wrinkles in a histopathological section provided in this application embodiment; this application provides a method for detecting wrinkles in a histopathological section, the method including: S110: Obtain the original pathological slide image to be tested.
[0028] In this step, the original pathological slide image can be a digital image obtained by scanning tissue pathological slides with a pathological slide scanner, such as a whole slide image (WSI). WSI images contain complete information about the tissue slide, typically have high resolution, and can clearly present the microstructure of the tissue. The image can be obtained from the hospital's Picture Archiving and Communication System (PACS) or directly acquired in real-time by the scanner; the specific method can be set according to the actual situation and is not limited here.
[0029] S120: Preprocess the original pathological slide image to obtain an intermediate pathological slide image suitable for coarse wrinkle detection.
[0030] In this step, after obtaining the original pathological slide image to be detected through S110, this application can preprocess the original pathological slide image to obtain an intermediate pathological slide image suitable for coarse detection of folds.
[0031] Understandably, the original pathological slide images may suffer from uneven lighting, noise interference, and color deviation during scanning, which directly affect the accuracy of subsequent wrinkle detection. Therefore, the core objective of the preprocessing step is to eliminate or reduce these interfering factors while enhancing the features of the wrinkled areas, providing higher-quality image data for subsequent coarse detection.
[0032] Specifically, the preprocessing process in this application includes, but is not limited to, the following operations: First, for salt-and-pepper noise or Gaussian noise that may exist in the image, denoising algorithms such as median filtering or Gaussian filtering are used to process the image, smoothing it while preserving the edge information of the folds; Second, considering that different pathological sections may have uneven color distribution due to differences in staining concentration, scanning equipment parameters, etc., color standardization processing can be performed, for example, by adjusting the brightness and contrast of the image, or by using histogram equalization, to make the overall tone and brightness distribution of the image more uniform and reduce detection deviation caused by color differences; In addition, for ultra-high resolution images such as whole-slice images (WSI), in order to improve processing efficiency, appropriate image scaling or block processing can be performed in the preprocessing stage, but it must be ensured that the scaling or block operation will not lose the key details of the folds.
[0033] Through the above preprocessing operations, the original pathological slide image is transformed into an intermediate pathological slide image with moderate contrast, less noise, uniform color, and highlighting potential fold structures, thus providing ideal input for the subsequent coarse detection module.
[0034] S130: Based on a preset image processing algorithm, perform coarse detection on the intermediate pathological slide image to obtain a coarse hint mask for the candidate fold region.
[0035] In this step, after preprocessing the original pathological slide image through S120 to obtain an intermediate pathological slide image suitable for coarse detection of folds, this application can perform coarse detection on the intermediate pathological slide image based on a preset image processing algorithm in order to obtain a coarse cue mask for the candidate fold region.
[0036] The preset image processing algorithm can be an existing wrinkle detection algorithm or a combination algorithm combining multi-scale edge detection and morphological analysis. For example, this application first performs multi-scale Gaussian filtering on the intermediate pathological slice image to suppress noise at different scales and enhance wrinkle edges of different widths; then, the Canny edge detection operator is used to extract edge information in the image to obtain a preliminary edge response map; next, morphological dilation and erosion operations are performed on the edge response map to connect broken wrinkle edges and remove isolated noise points; then, by calculating the gradient direction consistency and curvature features of the edge region, candidate regions that conform to the "strip-like" or "ridge-like" morphological features of wrinkles are selected; finally, the pixel positions of these candidate regions are marked as 1, and the remaining regions are marked as 0, thereby generating a binary coarse cue mask. This mask can roughly outline the contour range of the potential wrinkle region, providing key spatial location cues for the subsequent refinement module.
[0037] It should be noted that the coarse cue mask for the candidate wrinkle region mentioned above is not the final accurate detection result. Its main function is to provide "prior knowledge" for the subsequent lightweight segmentation base model, that is, to narrow down the possible range of wrinkles, guiding the model to concentrate computational resources on these high-probability areas, thereby improving inference efficiency while ensuring detection accuracy. Compared with deep learning segmentation of the entire image directly, the coarse cue mask introduced in this application can effectively reduce the model's invalid computation on background areas, which can effectively reduce the risk of false detection, especially suitable for images containing a large number of normal tissue areas, such as histopathological sections. For example, in a full-section image, the real wrinkle region may only account for 1% - 5% of the total image area. The coarse cue mask obtained by coarse detection can focus the model's attention on this part of the image, avoiding interference from large areas of normal tissue texture, thereby improving the targeting and accuracy of wrinkle detection.
[0038] S140: Input the coarse cue mask as cue information into the preset lightweight segmentation base model to obtain the refined segmentation mask and wrinkle classification results output by the lightweight segmentation base model.
[0039] In this step, after obtaining the coarse cue mask of the candidate fold region through S130, this application can input the coarse cue mask as cue information into the preset lightweight segmentation base model, and then obtain the refined segmentation mask and fold classification result output by the lightweight segmentation base model.
[0040] The segmentation base model of this application can adopt a lightweight semantic segmentation network architecture such as U-Net or SegNet. Its core lies in extracting features from intermediate pathological slice images through an encoder, while incorporating coarse cue masks into different levels of the decoder through skip connections or attention mechanisms, so that the model can focus on the candidate regions indicated by the coarse cue masks for fine feature learning.
[0041] Specifically, during the model training phase, this application can input intermediate sample pathological slide images along with corresponding coarse cue masks (as auxiliary inputs) into the segmentation base model. To reduce the burden of manual annotation, this application additionally uses a large-parameter segmentation base model pre-trained on large-scale pathological image data to generate refined wrinkle masks as pseudo-labels, serving as supervision signals for segmentation training. Furthermore, this application can also manually observe the regional images of intermediate sample pathological slide images and assign category labels to these regional images to classify samples into normal and wrinkle classes, obtaining classification labels y∈{0,1}. By optimizing the model parameters through backpropagation, the model learns the ability to distinguish between real wrinkled and non-wrinkled regions from the coarse cue regions, and the ability to determine whether intermediate sample pathological slide images contain wrinkled regions. During the inference phase, the segmentation base model can receive intermediate pathological slice images and coarse cue masks. The output fold classification results can clearly indicate whether the image contains folded regions. The refined segmentation mask can more accurately delineate the boundary contours of folds, including the starting point, ending point, width variation, and branching of folds. Compared with the coarse cue mask, its pixel-level positioning accuracy is significantly improved, which can effectively eliminate non-folded interference areas that may be introduced in the coarse detection phase, such as natural curling of tissue edges or artifacts formed by staining deposits.
[0042] Furthermore, after obtaining the refined segmentation mask, this application can perform post-processing operations on the refined segmentation mask, such as filling the tiny holes in the mask through morphological closing operations and filtering out isolated noise regions with excessively small areas using area thresholding, to further optimize the integrity and accuracy of the mask. Subsequently, based on the pixel coordinates of the folded regions marked in the refined segmentation mask, corresponding bounding boxes or contour lines are drawn on the original pathological slide image, and quantitative parameters such as the area, perimeter, and maximum width of the folded regions can be calculated. Finally, this information is integrated into a structured detection result, including the number of folds, their location coordinates, morphological parameters, and corresponding confidence scores, so that subsequent pathological quality control systems or physicians can perform further analysis and judgment.
[0043] In the above embodiments, an intermediate pathological slide image is obtained by acquiring the original pathological slide image and performing preprocessing; a coarse detection is performed on the intermediate pathological slide image based on a preset image processing algorithm to obtain a coarse cue mask; the coarse cue mask is used as cue information and input into a lightweight segmentation base model to obtain a refined segmentation mask and wrinkle classification results. This method enhances wrinkle features through preprocessing, and combines coarse detection from traditional image processing with refinement from a deep learning model, effectively improving adaptability to complex wrinkle morphologies, reducing interference from uneven staining or tissue edges, and achieving a balance between detection accuracy and efficiency. Furthermore, this application uses a lightweight segmentation base model for classification and segmentation in the refinement stage, which not only reduces computational load but also further improves detection efficiency.
[0044] In one embodiment, preprocessing the original pathological slide image in step S120 to obtain an intermediate pathological slide image suitable for coarse wrinkle detection may include: S121: Perform staining type adaptation processing on the original pathological slide image to obtain an adapted image.
[0045] S122: The adapted image is stained, separated, and characterized by optical density to obtain a single-channel response image, and the single-channel response image is used as the intermediate pathological slice image.
[0046] In this embodiment, when preprocessing the original pathological slide images, differential processing can first be performed for different staining types (such as HE staining and IHC staining). For HE-stained slides, since they mainly contain hematoxylin (blue) and eosin (red) dyes, adaptation processing can enhance the contrast of the red and blue channels and suppress background noise through color space conversion (such as from RGB to LAB or HED space). For IHC-stained slides, the chromogenic agent is usually DAB (brown), and adaptation processing focuses on enhancing the signal of the brown channel. Positive staining areas can be initially separated from the background through multi-threshold segmentation, laying the foundation for subsequent staining separation. The core of adaptation processing is to dynamically adjust the channel weights of the image according to the optical properties of the staining agent, ensuring that the wrinkle features of different staining types can be effectively highlighted in subsequent processing.
[0047] Subsequently, this application can perform staining separation and optical density characterization on the adapted image. Specifically, this application can employ a staining separation algorithm based on a physical model (such as the Macenko algorithm or the Ruifrok algorithm) to decompose the adapted image into component images of each individual staining agent. For example, HE staining is decomposed into hematoxylin and eosin components, and IHC staining is decomposed into DAB and hematoxylin counterstain components. Next, optical density conversion is performed on the separated target staining components (such as the hematoxylin component in HE staining, which is more strongly associated with the dark features of wrinkles; and the DAB component in IHC staining, where wrinkled areas often show abnormal aggregation of this component). That is, the RGB values of the pixels are converted into optical density values (OD values). The formula for calculating the OD value is OD = -log10(I / I0), where I is the pixel intensity and I0 is the reference light intensity. Optical density characterization not only more accurately reflects the light absorption characteristics of tissues and enhances the grayscale difference between folded areas and normal tissues, but also eliminates the influence of uneven illumination to a certain extent. The resulting single-channel response image (i.e., the optical density image of the target staining component) serves as an intermediate pathological section image, providing high-contrast, low-interference feature input for subsequent coarse detection.
[0048] In one embodiment, such as Figure 4 As shown, Figure 4 This is an overall flowchart of the histopathological section wrinkle detection provided in this application embodiment; the original pathological section image is an HE section image, and in S121, the original pathological section image is subjected to staining type adaptation processing to obtain an adapted image, which may include: The HE slice image is used directly as the adaptation image.
[0049] In this embodiment, as Figure 4 As shown, when the original pathological slide image is an HE slide image, since its staining components and structural features can be well captured by existing algorithms in the conventional preprocessing process, there is no need for additional complex staining type adaptation adjustments. The HE slide image can be directly used as the input for subsequent staining separation and optical density characterization steps; that is, the adaptation image is the HE slide image itself. This processing method simplifies the preprocessing process in HE staining scenarios and improves the overall processing efficiency while ensuring that wrinkle features are not lost.
[0050] In one embodiment, the original pathological slide image is an IHC slide image. S121 involves performing staining type adaptation processing on the original pathological slide image to obtain an adapted image, which may include: S1211: Perform color gamut unification processing on the IHC slice image to make the color statistical distribution of the processed IHC slice image approximate the color statistical distribution of the reference HE slice image, thereby obtaining an adapted image.
[0051] In this embodiment, as Figure 4 As shown, when the original pathological slide image is an IHC slide image, the color expression of its staining agent (such as DAB chromogenic agent) differs significantly from that of HE slides. Furthermore, different laboratories' IHC staining procedures may lead to large fluctuations in color distribution. Directly applying the same preprocessing procedure as HE slides may not effectively highlight the wrinkle features. Therefore, this application first performs color gamut unification processing on the IHC slide image.
[0052] Specifically, this application selects a typical, well-stained, and clearly defined hematoxylin and eosin (HE) slice image as a reference image. A color distribution model is constructed by calculating the mean, variance, and other statistical parameters of the reference HE slice image in a specific color space (such as LAB). Subsequently, color transfer is performed on the IHC slice image. Histogram matching or a deep learning color conversion model (such as CycleGAN) is used to adjust the color channel values of the IHC slice image so that its statistical distribution in LAB or other color spaces approximates the color statistical distribution of the reference HE slice image as closely as possible. For example, the brown areas stained with DAB in the IHC slice are adjusted to be close to the blue hue stained with hematoxylin in the HE slice, while maintaining the relative positions of the tissue structures.
[0053] This color gamut unification process not only eliminates color differences caused by different staining types, but also makes the feature distribution of the IHC slice image match the input requirements of the subsequent coarse detection algorithm (which may be trained and optimized on the HE slice dataset). This ensures that the wrinkle features are effectively enhanced in the preprocessing stage, providing a more consistent image basis for subsequent staining separation and optical density characterization.
[0054] In one embodiment, such as Figure 5 As shown, Figure 5 This is a schematic diagram of the color histogram matching process for the IHC slice image provided in the embodiments of this application; S1211 performs color gamut unification processing on the IHC slice image to make the color statistical distribution of the processed IHC slice image approximate the color statistical distribution of the reference HE slice image, which may include: S12111: Select one or more images from historical high-quality HE slice images as reference HE slice images.
[0055] S12112: Extract tissue regions from the IHC slice image and the reference HE slice image respectively, and remove background regions.
[0056] S12113: Based on the extracted tissue regions, perform color histogram matching on the IHC slice image to make the color statistical distribution of the IHC slice image approximate the color statistical distribution of the reference HE slice image.
[0057] In this embodiment, when performing color gamut unification processing on IHC slide images, it is first necessary to ensure the quality and representativeness of the reference HE slide image. Therefore, when selecting from historical high-quality HE slide images, high-quality HE slide images refer to sample images with uniform staining, clear tissue structure, no obvious artifacts, and typical wrinkle features, in order to ensure the reliability of the reference color distribution.
[0058] Next, as Figure 5 As shown, this application can extract tissue regions from both the IHC slice image and the reference HE slice image. Specifically, it can identify and retain tissue regions in the image by using threshold-based Otsu segmentation or edge detection combined with a region growing algorithm, while removing irrelevant areas such as blank background and slide edges to avoid interference from background pixels on color statistics. Subsequently, based on the extracted tissue regions, color histograms of the tissue regions in the IHC slice image and the reference HE slice image are calculated in a selected color space (such as the L, A, and B channels of the LAB space).
[0059] This application uses a histogram matching algorithm to adjust the pixel value distribution of each channel in an IHC slice image, so that the shape of the color histogram of the tissue region is as similar as possible to the shape of the color histogram of the tissue region in a reference HE slice image. For example, the color of the brownish tissue region in the IHC slice is adjusted to the bluish hue in the reference HE slice, while ensuring that the texture details and structural relationships inside the tissue are not destroyed. Finally, an adapted image with a color statistical distribution that approximates the reference HE slice image is obtained.
[0060] In one embodiment, performing color histogram matching on the IHC slice image based on the extracted tissue region in step S12113 may include: S121131: In the RGB or Lab color space, establish a cumulative distribution function (CDF) mapping for each color channel.
[0061] S121132: Based on the CDF mapping, generate a color mapping lookup table (LUT).
[0062] S121133: Using the color mapping lookup table (LUT), map the color distribution of the IHC slice image to the reference HE slice image.
[0063] In this embodiment, when performing color histogram matching on the IHC slice image, the cumulative distribution function (CDF) of the pixel values can be calculated for each color channel (such as the R, G, B channels of RGB, or the L, a, b channels of Lab) for the tissue regions of the IHC slice image and the reference HE slice image in the RGB color space or Lab color space.
[0064] Specifically, for a given color channel, this application first counts the grayscale frequencies of all tissue region pixels within that channel, then calculates the cumulative frequency to obtain the CDF for that channel. For example, for channel 'a' in Lab color space, the CDF for the tissue region of the IHC slice image is CDF_IHC_a, and the CDF for the tissue region of the reference HE slice image is CDF_HE_a. Next, a mapping relationship is established from the CDFs of each channel in the IHC slice image to the corresponding channel CDFs in the reference HE slice image. For any pixel value x in a certain channel of the IHC slice image, the probability value p corresponding to CDF_IHC_a(x) is found, and then the pixel value y corresponding to the probability value p is found in CDF_HE_a, thus establishing the mapping from x to y.
[0065] Based on this CDF mapping relationship, this application can generate a Color Map Lookup Table (LUT) for each color channel. This LUT is essentially a one-dimensional array, where the array index corresponds to the original pixel value of the IHC slice image, and the array value is the mapped pixel value of the reference HE slice image. Finally, using the generated color map lookup table (LUT), for each pixel of the IHC slice image, a lookup operation is performed on its corresponding color channel, replacing the original pixel value with the corresponding mapped value in the LUT. By performing this operation on all color channels, the overall color statistical distribution of the IHC slice image can be adjusted to approximate the color statistical distribution of the reference HE slice image, thus completing the color gamut unification process.
[0066] This method, based on CDF mapping and LUT, can accurately adjust the color distribution of an image while preserving its spatial structure and detail information, providing a more consistent image input for subsequent staining separation and wrinkle detection.
[0067] In one embodiment, the process of performing staining separation and optical density characterization on the adapted image in S122 to obtain a single-channel response image may include: S1221: Convert the adapted image from pixel space to optical density space to obtain an optical density image.
[0068] S1222: The optical density image is stained and separated using a preset projection matrix to obtain a multi-channel image containing H component, D component and residual component.
[0069] S1223: Add the H component and the D component, and convert them back to pixel space through exponential operation to obtain a single-channel response image.
[0070] In this embodiment, when performing staining separation and optical density characterization on the adaptation image, the adaptation image can first be converted from pixel space to optical density space. Pixel space images are usually represented by RGB values, which are related to the intensity of light reflection, while optical density (OD) better reflects the light absorption characteristics of tissue and is closely related to the chemical composition and structure of the tissue. The conversion process follows the following OD value calculation formula:
[0071] in, Indicates the optical density value. Represents pixel value, Represents coordinates, Indicates a channel.
[0072] Through the above conversion process, the image is transformed from pixel values that reflect light reflection to optical density values that reflect light absorption, so that the differences in staining depth of tissues are more linearly represented in optical density space, providing a more suitable numerical basis for subsequent staining and separation.
[0073] Next, this application can perform staining separation on the optical density image using a preset projection matrix. This projection matrix is constructed based on the spectral characteristics analysis of common pathological stains (such as hematoxylin H, eosin E, DAB, etc.). This application can multiply the projection matrix with the optical density value calculated above, and normalize each channel in the multiplied image using an HE reference template to obtain a multi-channel image containing H components, D components, and residual components.
[0074] Taking HE staining and IHC staining after color gamut unification as examples, the preset projection matrix can decompose the optical density image into component images corresponding to different staining agents. Specifically, for the HE staining adaptation image, after separation, the H component (hematoxylin component), E component (eosin component), and residual component can be obtained; for the IHC adaptation image that has been converted to a similar HE color distribution, after separation, the H component (simulated hematoxylin component, corresponding to the counterstaining component in the original IHC), D component (simulated DAB component, corresponding to the chromogenic component in the original IHC), and residual component can be obtained. The residual component mainly contains noise, staining that has not been effectively separated, or other non-target signals. Through this process, the complex multicolor image is decomposed into component images of a single staining agent, making the specific staining signals related to folds stand out.
[0075] Finally, this application allows the H and D components to be added together and converted back to pixel space via exponential operation to obtain a single-channel response image. In many pathological sections, folded areas often affect not only the distribution of one staining agent but may also cause signal abnormalities in both the H and D components (or E components, depending on the specific staining type), such as color intensification or aggregation. Adding the H and D components integrates these two staining signals closely related to tissue structure, enhancing the overall response of the folded areas. The resulting composite optical density image is then processed via exponential operation (i.e., I = I0). The image is converted back to pixel space using 10^(-OD) to obtain the final single-channel response image. This single-channel image incorporates the optical density information of the target stained components, has high contrast, and can clearly present the difference between the wrinkled area and normal tissue, providing ideal input for subsequent coarse detection steps.
[0076] In one embodiment, such as Figure 6 As shown, Figure 6 This is a schematic diagram of a wrinkle and fold region detection algorithm based on staining separation and Gaussian difference provided in an embodiment of this application; S130 performs coarse detection on the intermediate pathological slide image based on a preset image processing algorithm to obtain a coarse hint mask for candidate wrinkle regions, which may include: S131: Perform median filtering on the intermediate pathological slice image to obtain a denoised image.
[0077] S132: Perform Gaussian smoothing on the denoised image to obtain a smoothed image.
[0078] S133: Calculate the difference image between the denoised image and the smoothed image to obtain the difference response image of the enhanced wrinkled structure.
[0079] S134: Perform threshold segmentation on the differential response image to obtain a binary coarse mask.
[0080] S135: Post-process the binary coarse mask to obtain a coarse hint mask for the candidate wrinkle region.
[0081] In this embodiment, when performing coarse detection on the intermediate pathological slide image, this application first uses median filtering to denoise the image. Median filtering can effectively suppress salt-and-pepper noise and isolated noise points in the image, while preserving the edge information of the image well, avoiding blurring of details such as wrinkles during the denoising process. Specifically, a 3×3 or 5×5 median filter kernel can be used. For each pixel in the image, the median value of its neighboring pixels is used to replace the pixel value, thereby smoothing noise interference and obtaining a denoised image.
[0082] Next, this application can perform Gaussian smoothing on the denoised image. The purpose of Gaussian smoothing is to further reduce high-frequency noise in the image and simulate the human visual system's perception of blur in an image, preparing for subsequent difference operations. This application can select an appropriate Gaussian kernel size and standard deviation (e.g., a 3×3 Gaussian kernel, standard deviation σ=1.0) and smooth the denoised image through convolution operations to generate a smooth image. The size and standard deviation of the Gaussian kernel can be adjusted according to the noise level and scale of the wrinkled structure of the actual image to ensure that texture fluctuations in non-target areas are smoothed to the maximum extent while preserving the main wrinkle contours.
[0083] Then, this application can calculate the difference image between the denoised image and the smoothed image, that is, by subtracting the smoothed image from the denoised image, a difference response image that enhances the wrinkled structure is obtained. Since the wrinkled region usually exhibits abrupt changes in local gray levels, the denoised image retains the original detailed information, while the smoothed image blurs these high-frequency changes. After subtracting the two, the gray level difference in the wrinkled region is significantly amplified, while the normal tissue region with gradual gray level changes is suppressed, thereby highlighting the edges and structural features of the wrinkles.
[0084] Subsequently, this application can perform thresholding on the differential response image to obtain a binary coarse mask. By setting an appropriate grayscale threshold (which can be the Otsu automatic thresholding method or an empirical threshold based on sample statistics), pixels in the differential response image with grayscale values higher than the threshold are identified as potential wrinkled regions (marked as 1), and pixels with grayscale values lower than the threshold are identified as background or normal tissue regions (marked as 0). This step converts the continuous grayscale image into a binary image, initially screening out candidate regions that may contain wrinkles.
[0085] Finally, this application can post-process the binary coarse mask to obtain a coarse cue mask for the candidate folded regions. The post-processing operations mainly include morphological operations and region filtering. For example, an erosion operation is first performed to remove small noise regions (such as isolated noise points) from the binary mask, and then a dilation operation is performed to connect potentially segmented folded fragments and fill small holes within the folded regions. Afterwards, by calculating the area, perimeter, and circularity of connected regions, connected components that are too small or whose shapes do not conform to folded characteristics (such as overly long or irregular regions) are filtered out, ultimately obtaining a coarse cue mask that accurately reflects the location and extent of the candidate folded regions. This coarse cue mask will serve as input for subsequent fine detection steps to guide more precise fold localization and boundary delineation.
[0086] In one embodiment, such as Figure 7 As shown, Figure 7 A schematic diagram illustrating the training process of the lightweight segmentation base model provided in this application embodiment; the training process of the lightweight segmentation base model may include: S141: Obtain the classification label of the original sample pathological slide image. The classification label is used to indicate whether the original sample pathological slide image contains a wrinkled area. S142: Obtain a refined pseudo-true value mask for the original sample pathological slide image.
[0087] S143: Based on refined pseudo-truth masks and classification labels, the lightweight segmentation base model is jointly trained, so that the lightweight segmentation base model can output wrinkle classification results and refined segmentation masks simultaneously during the inference stage.
[0088] In this embodiment, when training the lightweight segmentation base model, the first step is to obtain the classification labels of the original sample pathological slide images. These classification labels are generated through manual annotation or automatic pre-screening, explicitly indicating whether there are wrinkled regions in each original sample pathological slide image. For example, for an image containing obvious wrinkled structures, the classification label is "contains wrinkles"; for an image with smooth tissue structures and no wrinkles, the classification label is "no wrinkles". Obtaining the classification labels provides the model with image-level supervision information, helping the model learn to distinguish the overall features of pathological slide images with and without wrinkles.
[0089] Next, a refined pseudo-ground truth mask is obtained from the original sample pathological slide image. Considering the high cost of large-scale manual annotation of refined masks, this application can use a semi-supervised or weakly supervised approach to generate pseudo-ground truth masks. Specifically, the original sample pathological slide image can first be processed using the aforementioned coarse detection algorithm to obtain preliminary coarse masks of candidate wrinkled regions. Then, combined with the experience and knowledge of medical experts, these coarse masks are manually corrected and optimized, such as adjusting the boundaries of wrinkled regions, removing falsely detected non-wrinkled regions, and supplementing missed small wrinkles, thereby obtaining a refined pseudo-ground truth mask with higher accuracy. This mask can accurately delineate the contours and extent of wrinkled regions, providing pixel-level supervision information for the model.
[0090] Finally, the lightweight segmentation base model is jointly trained based on refined pseudo-ground truth masks and classification labels. During training, the model's loss function consists of two parts: one is a segmentation loss based on refined pseudo-ground truth masks, such as Dice loss or Intersection over Union (IoU) loss, used to supervise the model's pixel-level segmentation accuracy of folded regions; the other is a classification loss based on classification labels, such as cross-entropy loss, used to supervise the model's overall ability to determine whether an image contains folds. Through this joint training approach, the lightweight segmentation base model can simultaneously learn both the local detail features of folds and global image features. During the inference phase, the model not only outputs the classification result of whether the input pathological slide image contains folds, but also generates accurate refined segmentation masks, clearly marking the specific location and morphology of folded regions in the image, providing strong support for subsequent pathological analysis and diagnosis.
[0091] In one embodiment, obtaining the refined pseudo-true value mask of the original sample pathological slide image in S142 may include: S1421: Obtain the intermediate sample pathological section image and sample coarse hint mask of the original sample pathological section image.
[0092] S1422: The sample coarse cue mask is used as cue information and input into the cue encoder of the preset large parameter segmentation basic model to obtain the output of the cue encoder.
[0093] S1423: Input the intermediate sample pathological slice image into the image encoder of the large parameter segmentation basic model to obtain the output of the image encoder.
[0094] S1424: Input the output of the prompt encoder and the output of the image encoder together into the mask decoder of the large parameter segmentation basic model to obtain the refined pseudo-true value mask output by the large parameter segmentation basic model.
[0095] In this embodiment, when obtaining the refined pseudo-ground value mask of the original sample pathological slide image, this application can first obtain the intermediate sample pathological slide image obtained after the aforementioned color domain unification processing and staining separation steps, as well as the sample coarse cue mask generated by the coarse detection algorithm. The intermediate sample pathological slide image is a single-channel response image that has undergone color normalization and staining signal enhancement, which can clearly present the structural features related to folds; the sample coarse cue mask initially outlines the potential fold candidate regions, providing regional guidance for subsequent refined segmentation.
[0096] Next, this application can input the sample coarse cue mask as cue information into the cue encoder of a pre-defined large-parameter segmentation base model. The cue encoder typically employs a convolutional neural network or Transformer structure, and its function is to extract and encode features from the coarse cue mask, transforming it into feature vectors or feature maps with semantic information. These feature vectors or feature maps can characterize the prior information such as the position and shape of the candidate region indicated by the coarse cue mask, guiding the model to focus on regions in the image that may contain wrinkles.
[0097] Furthermore, this application can also input intermediate sample pathological slide images into the image encoder of a high-parameter segmentation base model. The image encoder typically consists of multiple convolutional layers, pooling layers, and activation functions, enabling multi-scale, deep feature extraction of the input image, capturing rich visual information such as texture, edges, and regions. The high-dimensional feature map output by the image encoder contains semantic information from low to high levels, providing a solid feature foundation for subsequent mask decoding.
[0098] Subsequently, this application allows the cue features output by the cue encoder and the image features output by the image encoder to be jointly input into the mask decoder of the large-parameter segmentation base model. The mask decoder effectively fuses the cue features and image features through a cross-attention mechanism or feature fusion module, enabling the model to combine prior information from the coarse cue mask with detailed image features to accurately locate the boundaries of wrinkled regions and perform pixel-level classification. The mask decoder typically upsamples the feature map progressively and refines the segmentation results through a multi-layer decoding network, ultimately outputting a refined pseudo-ground truth mask with the same size as the input image. This mask accurately delineates the subtle contours of wrinkled regions and distinguishes the boundaries between wrinkles and normal tissue, achieving a much higher accuracy than the initial coarse cue mask. It can serve as high-quality pixel-level supervisory data for training lightweight segmentation base models.
[0099] In one embodiment, the joint training of the lightweight segmentation base model based on the refined pseudo-ground mask and the classification label in S143 may include: S1431: Preprocess the original sample pathological section image to obtain an intermediate sample pathological section image suitable for coarse wrinkle detection.
[0100] S1432: Input the intermediate sample pathological slice image into the initial lightweight segmentation base model to obtain the predicted refined mask and global semantic features, wherein a class token is added to the token sequence of the mask decoder of the initial lightweight segmentation base model to generate global semantic features.
[0101] S1433: Input the global semantic features into the lightweight classification head to obtain the predicted wrinkle classification result.
[0102] S1434: Using the refined pseudo-true value mask as the segmentation supervision signal and the classification label as the classification supervision signal, a multi-task loss function is constructed based on the segmentation supervision signal, the prediction refined mask, the classification supervision signal, and the prediction wrinkle classification result.
[0103] S1435: The initial lightweight segmentation base model is jointly optimized using the multi-task loss function.
[0104] In this embodiment, when jointly training the lightweight segmentation base model, the original sample pathological slide images first need to be preprocessed to obtain intermediate sample pathological slide images suitable for coarse wrinkle detection. This preprocessing process is consistent with the aforementioned intermediate pathological slide image generation process, including color domain unification processing and staining separation operations. By converting the image to a standard color space and separating the staining components closely related to the tissue structure (such as H and D components), and converting them back to pixel space through row addition and exponential operations, a single-channel response image that integrates the optical density information of the target staining components is obtained, providing high-quality input data for model training.
[0105] Next, this application can input the preprocessed intermediate sample pathological slide image into the initial lightweight segmentation base model. This lightweight segmentation base model has been structurally designed, for example, by adding a class token to the token sequence of its mask decoder. After feature extraction of the intermediate sample pathological slide image through the model's image encoder, the generated image features are input into the mask decoder along with the class token. When processing this information, the mask decoder generates a refined predictive mask for pixel-level segmentation based on the image features and the class token. Furthermore, the class token captures the global semantic information of the image, forming global semantic features.
[0106] Then, this application can input the obtained global semantic features into a lightweight classification head. This lightweight classification head typically consists of a small number of fully connected layers and activation functions, and its function is to further process and classify the global semantic features, ultimately outputting the predicted fold classification result, that is, to determine whether the input intermediate sample pathological slice image contains fold regions.
[0107] Next, a multi-task loss function is constructed using the refined pseudo-ground truth mask as the segmentation supervision signal and the classification label as the classification supervision signal. The multi-task loss function aims to comprehensively consider the training objectives of both the segmentation and classification tasks. Specifically, the segmentation loss can employ Dice loss or Intersection over Union (IoU) loss, quantifying the model's pixel-level segmentation error by comparing the difference between the predicted refined mask and the refined pseudo-ground truth mask; the classification loss can employ cross-entropy loss, measuring the gap between the predicted wrinkle classification result and the true classification label. The segmentation loss and classification loss are then weighted and summed according to a certain weight ratio (e.g., dynamically adjusted based on task importance or training difficulty) to form the multi-task loss function.
[0108] Finally, this application utilizes a constructed multi-task loss function to jointly optimize the initial lightweight segmentation base model. During training, the gradient of the loss function with respect to the parameters of each model layer is calculated using the backpropagation algorithm, and optimizers such as stochastic gradient descent (SGD) and Adam are used to update the model parameters, minimizing both segmentation and classification losses simultaneously. Through this joint optimization approach, the lightweight segmentation base model can learn to accurately segment detailed features of wrinkled regions while enhancing its ability to determine whether wrinkles exist in the overall image, thereby achieving accurate detection and fine segmentation of wrinkles in pathological slides during the inference stage.
[0109] In one embodiment, the method may further include: When the classification label indicates that the original sample pathological slide image is a normal image, the refined pseudo-true value mask is set to an all-zero mask for the correction of the segmentation supervision signal.
[0110] In this embodiment, it is considered that in the training dataset, some original pathological slide images may be labeled as "normal images" (i.e., not containing wrinkled regions). However, due to labeling errors or the presence of extremely small, difficult-to-discern wrinkles in the images, the refined pseudo-ground truth mask generated through the aforementioned steps is not an all-zero mask (i.e., it contains non-zero pixel regions). This situation will interfere with the model's training, causing the model to receive contradictory supervision signals during the learning process: the classification label indicates no wrinkles, while the segmentation label (refined pseudo-ground truth mask) indicates wrinkles.
[0111] To address this issue, this application proposes forcing the corresponding refined pseudo-ground truth mask to an all-zero mask when the classification label explicitly indicates that the original pathological slide image is a normal image. An all-zero mask means that there are no wrinkled regions in the image, perfectly consistent with the classification label of "normal image." This method effectively corrects the segmentation supervision signal, ensuring that the supervision information for classification and segmentation tasks is unified and consistent during model training. This helps the model learn the feature differences between normal tissue regions and wrinkled regions more accurately, avoiding biases in model parameter learning caused by labeled noise or abnormal samples. This improves the model's classification accuracy and segmentation precision in practical applications, especially for truly normal images, effectively reducing the probability of them being misclassified as containing wrinkles.
[0112] The following describes the tissue pathology slide wrinkle detection device provided in the embodiments of this application. The tissue pathology slide wrinkle detection device described below can be referred to in correspondence with the tissue pathology slide wrinkle detection method described above.
[0113] In one embodiment, such as Figure 8 As shown, Figure 8 This is a schematic diagram of a tissue pathology slide wrinkle detection device provided in an embodiment of this application; this application also provides a tissue pathology slide wrinkle detection device, which may include an image acquisition module 210, a preprocessing module 220, a coarse detection module 230, and a fine-tuning module 240, specifically including the following: Image acquisition module 210 is used to acquire the original pathological slide image to be detected.
[0114] The preprocessing module 220 is used to preprocess the original pathological slide image to obtain an intermediate pathological slide image suitable for coarse wrinkle detection.
[0115] The coarse detection module 230 is used to perform coarse detection on the intermediate pathological slice image based on a preset image processing algorithm to obtain a coarse hint mask for the candidate wrinkle region.
[0116] The refinement module 240 is used to input the coarse prompt mask as prompt information into a preset lightweight segmentation base model to obtain the refined segmentation mask and wrinkle classification results output by the lightweight segmentation base model.
[0117] In the above embodiments, an intermediate pathological slide image is obtained by acquiring the original pathological slide image and performing preprocessing; a coarse detection is performed on the intermediate pathological slide image based on a preset image processing algorithm to obtain a coarse cue mask; the coarse cue mask is used as cue information and input into a lightweight segmentation base model to obtain a refined segmentation mask and wrinkle classification results. This method enhances wrinkle features through preprocessing, and combines coarse detection from traditional image processing with refinement from a deep learning model, effectively improving adaptability to complex wrinkle morphologies, reducing interference from uneven staining or tissue edges, and achieving a balance between detection accuracy and efficiency. Furthermore, this application uses a lightweight segmentation base model for classification and segmentation in the refinement stage, which not only reduces computational load but also further improves detection efficiency.
[0118] In one embodiment, this application also provides a computer-readable storage medium storing computer-readable instructions that, when executed by one or more processors, cause the one or more processors to perform the steps of the histopathological section wrinkle detection method as described in any of the above embodiments.
[0119] In one embodiment, this application also provides a computer device, including: one or more processors, and memory.
[0120] The memory stores computer-readable instructions, which, when executed by the one or more processors, perform the steps of the histopathological section wrinkle detection method as described in any of the above embodiments.
[0121] Indicatively, such as Figure 9 As shown, Figure 9 This is a schematic diagram of the internal structure of a computer device 300 provided in an embodiment of this application. The computer device 300 can be provided as a server. (Refer to...) Figure 9 The computer device 300 includes a processing component 302, which further includes one or more processors, and memory resources represented by memory 301 for storing instructions executable by the processing component 302, such as application programs. The application programs stored in memory 301 may include one or more modules, each corresponding to a set of instructions. Furthermore, the processing component 302 is configured to execute instructions to perform the histopathological section wrinkle detection method of any of the above embodiments.
[0122] The computer device 300 may also include a power supply component 303 configured to perform power management of the computer device 300, a wired or wireless network interface 304 configured to connect the computer device 300 to a network, and an input / output (I / O) interface 305. The computer device 300 may operate on an operating system stored in memory 301, such as Windows Server™, Mac OS X™, Unix™, Linux™, Free BSD™, or similar.
[0123] Those skilled in the art will understand that Figure 9 The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device to which the present application is applied. Specific computer devices may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.
[0124] Finally, it should be noted that in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.
[0125] The various embodiments in this specification are described in a progressive manner. Each embodiment focuses on the differences from other embodiments. The various embodiments can be combined as needed, and the same or similar parts can be referred to each other.
[0126] The above description of the disclosed embodiments enables those skilled in the art to make or use this application. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of this application. Therefore, this application is not to be limited to the embodiments shown herein, but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. A method for detecting wrinkles in histopathological sections, characterized in that, The method includes: Obtain the original pathological slide image to be examined; The original pathological slide image is preprocessed to obtain an intermediate pathological slide image suitable for coarse wrinkle detection. Based on a preset image processing algorithm, a coarse detection is performed on the intermediate pathological slide image to obtain a coarse cue mask for the candidate wrinkle region; The coarse cue mask is input as cue information into a preset lightweight segmentation base model to obtain a refined segmentation mask and wrinkle classification results output by the lightweight segmentation base model.
2. The method according to claim 1, characterized in that, The preprocessing of the original pathological slide image to obtain an intermediate pathological slide image suitable for coarse wrinkle detection includes: The original pathological slide images are subjected to staining type adaptation processing to obtain adapted images; The adapted image is stained, separated, and characterized by optical density to obtain a single-channel response image, which is then used as the intermediate pathological section image.
3. The method according to claim 2, characterized in that, The original pathological slide image is an HE slide image. The staining type adaptation processing of the original pathological slide image to obtain an adapted image includes: The HE slice image is used directly as the adaptation image.
4. The method according to claim 2, characterized in that, The original pathological slide image is an IHC slide image. The staining type adaptation processing of the original pathological slide image to obtain an adapted image includes: The IHC slice image is subjected to color gamut unification processing so that the color statistical distribution of the processed IHC slice image approximates the color statistical distribution of the reference HE slice image, thus obtaining the adapted image.
5. The method according to claim 4, characterized in that, The step of performing color gamut unification processing on the IHC slice image to make the color statistical distribution of the processed IHC slice image approximate the color statistical distribution of the reference HE slice image includes: Select one or more images from historical high-quality HE slice images as reference HE slice images; Tissue regions were extracted from both the IHC slice image and the reference HE slice image, and background regions were removed. Based on the extracted tissue regions, color histogram matching is performed on the IHC slice image to make the color statistical distribution of the IHC slice image approximate the color statistical distribution of the reference HE slice image.
6. The method according to claim 5, characterized in that, The step of performing color histogram matching on the IHC slice image based on the extracted tissue region includes: In the RGB or Lab color space, establish a cumulative distribution function (CDF) mapping for each color channel; Based on the CDF mapping, a color mapping lookup table (LUT) is generated; The color mapping lookup table (LUT) is used to map the color distribution of the IHC slice image to the reference HE slice image.
7. The method according to claim 2, characterized in that, The process of performing staining separation and optical density characterization on the adapted image to obtain a single-channel response image includes: The adapted image is converted from pixel space to optical density space to obtain an optical density image; The optical density image is stained and separated using a preset projection matrix to obtain a multi-channel image containing H component, D component and residual component; The H component and the D component are added together, and then converted back to pixel space through exponential operation to obtain a single-channel response image.
8. The method according to claim 1, characterized in that, The method of performing coarse detection on the intermediate pathological slide image based on a preset image processing algorithm to obtain a coarse cue mask for candidate wrinkle regions includes: Median filtering is applied to the intermediate pathological slide image to obtain a denoised image; The denoised image is then subjected to Gaussian smoothing to obtain a smoothed image; Calculate the difference image between the denoised image and the smoothed image to obtain the difference response image of the enhanced wrinkled structure; Threshold segmentation is performed on the differential response image to obtain a binary coarse mask; The binary coarse mask is post-processed to obtain a coarse hint mask for the candidate wrinkle region.
9. The method according to claim 1, characterized in that, The training process of the lightweight segmentation base model includes: Obtain classification labels for the original sample pathological slide images, wherein the classification labels are used to indicate whether the original sample pathological slide images contain wrinkled regions; Obtain the refined pseudo-true value mask of the original sample pathological section image; Based on the refined pseudo-truth mask and the classification label, the lightweight segmentation base model is jointly trained, so that the lightweight segmentation base model outputs wrinkle classification results and refined segmentation mask simultaneously during the inference stage.
10. The method according to claim 9, characterized in that, The process of obtaining the refined pseudo-real value mask of the original sample pathological slide image includes: Obtain intermediate sample pathological section images and sample coarse hint masks from the original sample pathological section images; The sample coarse cue mask is used as cue information and input into the cue encoder of the preset large parameter segmentation base model to obtain the output of the cue encoder. The intermediate sample pathological slide image is input into the image encoder of the large parameter segmentation basic model to obtain the output of the image encoder; The output of the prompt encoder and the output of the image encoder are input together into the mask decoder of the large parameter segmentation basic model to obtain the refined pseudo-real value mask output by the large parameter segmentation basic model.
11. The method according to claim 9, characterized in that, The joint training of the lightweight segmentation base model based on the refined pseudo-ground mask and the classification label includes: The original sample pathological section image is preprocessed to obtain an intermediate sample pathological section image suitable for coarse wrinkle detection. The intermediate sample pathological slice image is input into the initial lightweight segmentation base model to obtain the predicted refined mask and global semantic features. In this model, a class token is added to the token sequence of the mask decoder to generate global semantic features. The global semantic features are input into the lightweight classification head to obtain the predicted wrinkle classification result; Using the refined pseudo-real value mask as the segmentation supervision signal and the classification label as the classification supervision signal, a multi-task loss function is constructed based on the segmentation supervision signal, the prediction refined mask, the classification supervision signal, and the prediction wrinkle classification result. The initial lightweight segmentation base model is jointly optimized using the multi-task loss function.
12. The method according to claim 11, characterized in that, The method further includes: When the classification label indicates that the original sample pathological slide image is a normal image, the refined pseudo-true value mask is set to an all-zero mask for the correction of the segmentation supervision signal.
13. A device for detecting wrinkles in histopathological sections, characterized in that, include: The image acquisition module is used to acquire the original pathological slide images to be detected; The preprocessing module is used to preprocess the original pathological slide image to obtain an intermediate pathological slide image suitable for coarse wrinkle detection. The coarse detection module is used to perform coarse detection on the intermediate pathological slice image based on a preset image processing algorithm to obtain a coarse hint mask for candidate wrinkle regions. The refinement module is used to input the coarse prompt mask as prompt information into a preset lightweight segmentation base model to obtain the refined segmentation mask and wrinkle classification results output by the lightweight segmentation base model.
14. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer-readable instructions that, when executed by one or more processors, cause the one or more processors to perform the steps of the method for detecting wrinkles in histopathological sections as described in any one of claims 1 to 12.
15. A computer device, characterized in that, include: One or more processors, and memory; The memory stores computer-readable instructions that, when executed by the one or more processors, perform the steps of the method for detecting wrinkles in histopathological sections as described in any one of claims 1 to 12.