Standardization methods for cell nucleus segmentation and staining style in histopathological images
By employing a semi-supervised multi-task approach and generating pseudo-labels using strongly labeled data, combined with attention mechanisms and cycle consistency loss, the problem of inconsistent staining styles and insufficient labeling in histopathological slide images is solved, achieving high-precision cell nucleus segmentation and staining style standardization.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-10-14
- Publication Date
- 2026-03-13
AI Technical Summary
In existing technologies, the inconsistent staining styles and insufficient annotations in histopathological slide images lead to insufficient accuracy in cell nucleus segmentation.
A semi-supervised multi-task approach is adopted, which constructs a multi-task teacher model and a student model, generates pseudo-labeled data using strongly labeled data, and combines attention mechanism and cycle consistency loss to achieve staining style normalization and cell nucleus segmentation.
It improved the accuracy of cell nucleus segmentation, standardized staining styles, reduced computational load, and improved the efficiency of pathological image analysis.
Smart Images

Figure CN115587985B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of intelligent assisted diagnosis, specifically involving a method for cell nucleus segmentation and staining style standardization in histopathological images. Background Technology
[0002] Histopathology based on hematoxylin and eosin (H&E) staining is the foundation and gold standard for most current clinical diagnoses. Automated analysis of digital pathology images is a crucial part of medical image analysis. Cellular-level analysis of pathology images is extremely challenging for several reasons, including: variations in staining techniques leading to differences in staining styles; the large amount of information contained in pathology images that is difficult to quantify; and the time-consuming and laborious nature of pixel-level annotation.
[0003] Staining style inconsistencies are one of the most significant problems in cell-level intelligent analysis. Pathologists primarily diagnose diseases by examining the distribution of tissue components, cell proportions, and spatial composition. Histochemical staining imparts different stains to different tissues and reveals underlying cellular structures. Hematoxylin-eosin staining is one of the most commonly used histopathological staining methods. Due to operational differences during the staining process, stained tissue sections often exhibit different colors, especially in the shading of cell nuclei. This not only leads to inconsistencies in the visual diagnosis of pathologists but also becomes an obstacle to automated computational pathological analysis, particularly in tasks such as cell segmentation and cell classification. Over the past decade, the importance of staining style normalization for automated cell-level analysis has been increasingly recognized. Generative Adversarial Networks (GANs), as an important component of deep learning, are widely used for data augmentation and style transfer. CycleGAN and its variants have been successfully applied to image style transfer because they do not require paired data. However, due to unpaired training data, they are also prone to generating structures not present in the original images.
[0004] The lack of pixel-level annotation is a major bottleneck in the automatic segmentation of cell nuclei in pathological images, hindering the development of cell-level pathological image analysis. The main deep learning models for digital pathological image analysis include Convolutional Neural Networks (CNNs) and Vision Transformers (VITs). Unet[] and its variants belong to the CNN group and are the most widely used cell nucleus segmentation models. Due to their superior performance, ViT[] and its derivative models have received more attention than CNNs in cell nucleus segmentation tasks in recent years. CNN-based segmentation networks typically require a large number of pixel annotations to achieve robust segmentation models. Furthermore, due to its larger network capacity and more complex structure than CNNs, ViT requires more annotated data. Because obtaining pixel-level labels for kernels is time-consuming and laborious, fully supervised segmentation methods are increasingly constrained, and cell nucleus segmentation based on semi-supervised learning frameworks is gaining increasing importance. Summary of the Invention
[0005] The purpose of this invention is to provide a semi-supervised multi-task method for cell nucleus segmentation and staining style standardization in histopathological images, which aims to effectively solve the problem of insufficient cell nucleus segmentation accuracy caused by inconsistent staining styles and insufficient annotations during the preparation of histopathological slide images in cell-level pathological analysis.
[0006] According to the present invention, a method for cell nucleus segmentation and staining style normalization of histopathological images is characterized by the following steps: Step S1, preprocessing the full-field digital slides to obtain image blocks, which consist of strongly labeled image blocks with strong cell nucleus annotations and unlabeled image blocks without cell nucleus annotations; Step S2, using the strongly labeled image blocks as input to a multi-task teacher model to train the multi-task teacher model, and further inputting the unlabeled image blocks into the trained multi-task teacher model to obtain cell nucleus segmentation results inferred and selected by the multi-task teacher model as pseudo-annotations; Step S3, using a mixture of strongly labeled image blocks and image blocks with pseudo-annotations as a training set for a student model to train a multi-task student model; Step S4, inputting the histopathological digital slide image blocks to be segmented into the trained multi-task student model to obtain segmentation and staining style normalization results.
[0007] The method for cell nucleus segmentation and staining style normalization of histopathological images provided by the present invention may also have the following technical features: strongly labeled image blocks are divided into a source domain training set X with image blocks of multiple staining styles and a target domain training set Y with image blocks of only one staining style. Step S2 includes: Step S21, defining two generators G. X2Y G Y2X and two discriminators D X D Y Generator G X2Y and generator G Y2X Each consists of one encoder and two decoders: a coloring style normalization decoder and a segmentation decoder. The generator G... X2Y Used to transfer the style of an X source domain image to a Y target domain image style. Discriminator D Y Used for judgment Whether the generator G's style closely resembles the real Y target domain image is considered realistic. Y2X Used to transfer the style of the Y target domain image to the X source domain image style, and by discriminator D X To determine the authenticity, Input generator G Y2X From And use cycle consistency loss to constrain To ensure that the style of the X source domain image is transformed to the Y target domain image style while the texture and structural features of the pathological image remain unchanged; step S22, the attention gate is set to the generator G. X2Y G Y2X In step S23, an attention mechanism is used to make the generator pay more attention to the cell nucleus region. The strongly labeled image patches are then fed into a multi-task teacher model for training. The trained model is then used to predict unlabeled image patches, and the prediction results are filtered to obtain cell nucleus segmentation results that meet the quality requirements as pseudo-labels. The quality of the pseudo-labels is determined by calculating the softmax value of each pixel in each segmentation result. If the average softmax value of all pixels in the image is greater than a set threshold, then the quality requirement is met.
[0008]
[0009] Where k represents the number of outputs or categories of the neural network, and v is the output vector. j Let i be the value of the j-th output or category in v, and let i represent the category that needs to be calculated.
[0010] The method for cell nucleus segmentation and staining style normalization of histopathological images provided by the present invention may also have the following technical features: In step S21: the staining style normalization decoder utilizes cycle consistency loss L Cyc and countermeasures against losses L GAN To achieve the task of standardizing coloring styles:
[0011]
[0012]
[0013] L Cyc (G X2Y G Y2X )
[0014] =E x~X [||G Y2X (G X2Y (x)-x||1]
[0015] +E y~Y [||G X2Y (G Y2X (y)-y||1]
[0016] The segmentation decoder uses the BCE loss function as the loss function L for cell segmentation. Seg To achieve the task of segmenting the cell nucleus:
[0017]
[0018] The generator's total loss function is:
[0019] L(G′ X2Y ,G′ Y2X D Y D X ,X label )
[0020] =[λ X2Y L GAN (G′ X2Y )+L GAN (D Y )+L GAN (G′ Y2X )+L GAN (D X )]
[0021] +λ Cyc L Cyc (G′ X2Y ,G′ Y2X )+λ Seg L Seg (X,X label )
[0022] The method for cell nucleus segmentation and staining style normalization of histopathological images provided by the present invention may also have the following technical features, wherein the output of the segmentation decoder is set to 256*256*1, and the output of the staining style normalization decoder is set to 256*256*3.
[0023] The method for cell nucleus segmentation and staining style normalization of histopathological images provided by the present invention may also have the following technical feature: in step S22, the output of the attention gate is the input feature map. and attention coefficient The product of x, where x l This represents a high-dimensional image representation, where i and c represent the spatial and channel dimensions, respectively.
[0024]
[0025] Each pixel i uses The gating vector is used to determine the region of interest, F g Corresponding to the number of feature maps in layer g, the gate vector contains contextual information for pruning lower-level feature responses. The gate coefficients are obtained through additional attention, as shown in the following formula:
[0026]
[0027]
[0028] In the formula, σ1 represents the ReLU activation function, and σ2(x i,c )=1 / 1+exp(-x i,c Corresponding to the Sigmoid activation function, the attention gate is characterized by a set of parameters θ. att Includes: linear transformations and bias term b ψ ∈R, The linear transformation is calculated using a 1×1×1 convolution of the input tensor's channels.
[0029] The method for cell nucleus segmentation and staining style standardization of histopathological images provided by the present invention may also have the following technical features: Step S3 includes: Step S31, defining two generators G′ X2Y G′ Y2X and two discriminators D′ X 、D′ Y Generator G′ X2Y G′ Y2X Each module consists of one encoder and two decoders: a staining style normalization decoder and a segmentation decoder. The staining style normalization decoder and the segmentation decoder utilize cycle consistency loss to perform staining style normalization and cell nucleus segmentation tasks, respectively. The generator G′... X2Y Used to transfer the style of an X source domain image to a Y target domain image style. Discriminator D′ Y Used for judgment Whether the generator G′ is similar in style to the real Y target domain image in terms of realism. Y2X Used to transfer the style of the Y target domain image to the X source domain image style, and by the discriminator D′ X To determine the authenticity, Input generator G′ Y2X From And use cycle consistency loss to constrain To ensure that the style of the X source domain image is transformed to the Y target domain image style while the texture and structural features of the pathological image remain unchanged; in step S32, the ResNet-50 and Transformer are cascaded to form a multi-task student model generator G′. X2Y G′ Y2X The encoder; Step S33, the strongly labeled image patch used in step S23 and the pseudo-labels predicted and selected by the multi-task teacher model are mixed as the training set of the multi-task student model, and the multi-task student model is trained.
[0030] Invention Function and Effect
[0031] The present invention provides a method for cell nucleus segmentation and staining style normalization in histopathological images. By preprocessing image patches to obtain data that is easily processed by computers, the method effectively addresses the problem of excessive computational load in digital pathological slides. Furthermore, a teacher-student semi-supervised framework is proposed. A multi-task teacher model trained with strongly labeled data generates pseudo-labeled data, and the dataset of the multi-task student model is expanded, achieving more accurate segmentation and normalization. The constructed multi-task teacher model AttCycle and multi-task student model TransCycle effectively solve the problem of low accuracy in cell nucleus segmentation due to staining differences in cellular pathological analysis, improving cell nucleus segmentation accuracy while achieving staining style normalization. Attached Figure Description
[0032] Figure 1 A flowchart illustrating the method for cell nucleus segmentation and staining style standardization in histopathological images provided in this embodiment of the invention. Detailed Implementation
[0033] To make the technical means, creative features, objectives and effects of this invention easier to understand, the following describes in detail the method for cell nucleus segmentation and staining style standardization of histopathological images of this invention in conjunction with embodiments and accompanying drawings.
[0034] The technical terms involved in this invention will be introduced.
[0035] Semi-supervised: Due to the lack of pixel-level annotations, the performance of deep learning in cell-level analysis of histopathological images is often limited. To mitigate the adverse effects of missing pixel-level annotations, semi-supervised methods have been proposed, using pseudo-annotated data as additional training data for the model. Multi-task: Multi-task refers to a system that simultaneously performs two tasks: staining style normalization and cell nucleus segmentation. This strategy improves the quality of image style conversion while achieving more accurate cell nucleus segmentation. Staining style normalization: During the preparation of histopathological sections, variations in staining styles can occur due to factors such as staining reagent brand, staining time, and operational procedures. These variations negatively impact clinical diagnosis and automated computer analysis. Therefore, unifying multiple staining styles to a style conducive to diagnosis and analysis is called staining style normalization.
[0036] <Example>
[0037] Figure 1 A flowchart illustrating the method for cell nucleus segmentation and staining style standardization in histopathological images provided in this embodiment of the invention is shown below. Figure 1 As shown, the method specifically includes the following steps S1 to S4.
[0038] Step S1: Perform data preprocessing on the full-view digital slice to obtain image blocks.
[0039] Step S1 specifically includes: under a field of view magnified 20x, selecting an area ranging from 2000*2000 to 8000*8000 pixels, and cutting it into 256*256 image blocks. A small portion of these image blocks are sent to pathologists for cell nucleus annotation, resulting in image blocks with strongly annotated cell nuclei, known as strongly annotated image blocks. The remaining large number of image blocks are unannotated image blocks without cell nucleus annotations. Simultaneously, according to different staining styles, the strongly annotated image blocks are divided into two training sets, X and Y, with different staining styles. Image blocks in group X have multiple staining styles and are called the source domain training set, while image blocks in group Y have only one staining style and are called the target domain training set.
[0040] In this embodiment, 210 image patches with different staining styles were selected from the cut image patches as the X-domain training set for manual pixel-level cell nucleus annotation. Another 210 image patches with consistent staining styles and easy diagnostic analysis were selected as the Y-domain training set for manual pixel-level cell nucleus annotation. Then, 140 image patches with different staining styles were selected and divided into two sets, serving as the validation set and the test set respectively, and manually labeled with cell nucleus at the same level. The ratio of training set:validation set:test set was 3:1:1.
[0041] Step S2: The strongly labeled image patches (i.e., the X-domain training set and the Y-domain training set) are used as input to train the multi-task teacher model. Then, the unlabeled image patches are input to the trained multi-task teacher model to obtain the cell nucleus segmentation results inferred and selected by the multi-task teacher model as pseudo-labels.
[0042] In step S2 of this embodiment, the multi-task teacher model AttCycle specifically includes:
[0043] Step S21, define two generators G X2Y G Y2X and two discriminators D X D Y Generator G X2Y and generator G Y2X Each consists of one encoder and two decoders. The two decoders are a coloring style normalization decoder and a segmentation decoder. The output of the segmentation decoder is set to 256*256*1, and the output of the coloring style normalization decoder is set to 256*256*3.
[0044] The coloring style normalization decoder utilizes cycle consistency loss L Cyc and countermeasures against losses L GAN To achieve the task of standardizing coloring styles:
[0045]
[0046]
[0047] L Cyc (G X2Y G Y2X )
[0048] =E x~X [||G Y2X (G X2Y (x)-x||1]
[0049] +E y~Y [||G X2Y (G Y2X (y)-y||1]
[0050] In the formula, E x~X For each sample x in the training set of domain X, after passing through generator G X2Y After generating the normalized staining results, they are passed through the discriminator D. Y Output the expected value E after the second norm. y~Y For each sample y in the training set of the Y domain, after passing through the generator G Y2X After generating the normalized staining results, they are passed through the discriminator D. X Output the expected value after the second norm. For the discriminator D Y Generate adversarial loss, and the smaller the loss value, the better. For generator G X2Y Generative adversarial loss, and the smaller the loss value, the better, D Y (G X2Y (x) represents the result of each sample x in the training set of the X domain after passing through the generator G. X2Y After generating the normalized staining results, they are passed through the discriminator D. Y The output, D Y (y) represents the result of each sample y in the training set of the Y domain after passing through the generator G. Y2X After generating the normalized staining results, they are passed through the discriminator D. X The output.
[0051] Meanwhile, the segmentation decoder uses the BCE loss function as the loss function L for cell segmentation. Seg To achieve the task of segmenting the cell nucleus:
[0052]
[0053] In the formula, To calculate the segmentation result x and its corresponding label x label The expected value of the cross-entropy, x label loge (x)+(1-x label log e (1-x) represents the segmentation result x and its corresponding label x. label The cross-entropy, where e is the natural logarithm.
[0054] The generator's total loss function is:
[0055] L(G X2Y G Y2X D Y D X ,X label )
[0056] =[λ X2Y L GAN (G X2Y )+L GAN (D Y )+L GAN (G Y2X )+L GAN (D X )]
[0057] +λ Cyc L Cyc (G X2Y G Y2X )+λ Seg L Seg (X,X label )
[0058] In the formula, X represents the network segmentation result. label For the label corresponding to X, L GAN (G X2Y ) is the generator G X2Y The losses inflicted by the confrontation, L GAN (G Y2X ) is the generator G Y2X The losses inflicted by the confrontation, L GAN (D Y ) is the discriminator D Y The losses inflicted by the confrontation, L GAN (D X ) is the discriminator D X The counter-loss, λ X2Y For generator G X2Y The loss weight, λ Cyc For the cyclic consistent loss L Cyc The loss weight, λ Seg L for cell nucleus segmentation loss Seg The loss weight.
[0059] Generator G X2Y Used to transfer the style of an X source domain image to a Y target domain image style. Discriminator D Y Used for judgment Does it closely resemble the style of a real Y-target domain image? Similarly, the generator G... Y2X Used to transfer the style of the Y target domain image to the X source domain image style, and by discriminator D X Determine the degree of authenticity.
[0060] Will Input generator G Y2X From And use cycle consistency loss to constrain This method ensures that the texture and structural features of pathological images remain unchanged while the style of the source domain image (X) is transferred to the target domain image (Y). Since the training set prepared in step S1 contains multiple staining styles in the X domain and only one staining style in the Y domain, this achieves the effect of normalizing the staining style of pathological images.
[0061] Step S22: Set the attention gates (AG) to the generator G. X2Y G Y2X In this study, an attention mechanism is used to make the generator pay more attention to the cell nucleus region, thereby improving the standardization quality and segmentation accuracy.
[0062] The output of AG is the input feature map. and attention coefficient The product of x, where x l This represents a high-dimensional image representation, where i and c represent the spatial and channel dimensions, respectively.
[0063]
[0064] In the formula, This is the input feature map of the l-th feature layer of the Attention-Gates. is the attention coefficient of the l-th layer of the feature layer.
[0065] Each pixel i uses The gating vector is used to determine the region of interest, F g This corresponds to the number of feature maps in layer g. The gating vector contains contextual information for pruning lower-level feature responses, and the gating coefficients are obtained through additional attention. The formula is as follows:
[0066]
[0067]
[0068] in, σl represents the additional attention coefficient of the l-th feature layer, σ1 represents the ReLU activation function, and σ2(x) represents the additional attention coefficient of the l-th feature layer.i,c )=1 / 1+exp(-x i,c This corresponds to the Sigmoid activation function. The features of Attention-Gates are a set of parameters θ. att Includes: linear transformations Linear transformation Linear transformation coefficients and bias term b ψ ∈R, The above linear transformation W x W g It is calculated using a 1×1×1 convolution of the input tensor channels. In the formula, The dimension is F l ×F int A real matrix, The dimension is F g ×F int A real matrix, F l F is the number of feature maps in feature layer l. g F is the number of feature maps in layer g. int for The number of dimensions.
[0069] Step S23: The strongly labeled image patches are fed into the multi-task teacher model for training. The trained model predicts unlabeled data and filters pseudo-labeled data that meets the quality threshold. The quality of the generated pseudo-labels is determined by calculating the softmax value of each pixel in each segmentation result. If the average softmax value of all pixels in the image is greater than the set threshold, it meets the quality requirements.
[0070]
[0071] Where k represents the number of outputs or categories of the neural network, and v is the output vector. j Let i be the value of the j-th output or category in v, and let i represent the category that needs to be calculated.
[0072] In this embodiment, 5,000 high-quality cell nucleus segmentation results, predicted and selected by the multi-task teacher model, are used as pseudo-labels, and the normalized results corresponding to these 5,000 are used as pseudo-Y domain images.
[0073] Step S3: Use a mixture of strongly labeled image patches and pseudo-labeled image patches as the training set for the student model to train the multi-task student model.
[0074] In step S3 of this embodiment, the 210 Y-domain images and corresponding manually labeled cell nuclei from step one, along with the 5000 pseudo-Y-domain image blocks and 5000 pseudo-cell nuclei labeled image blocks obtained in step three, are combined as the Y-domain training set for the multi-task student model. The X-domain training set consists of 210 manually labeled image blocks and another 5000 image blocks with different staining styles.
[0075] The multi-task student model TransCycle specifically includes:
[0076] Step S31, define two generators G′ X2Y G′ Y2X and two discriminators D′ X 、D′ Y Generator G′ X2Y G′ Y2X Each algorithm consists of one encoder and two decoders: a staining style normalization decoder and a segmentation decoder. The output of the segmentation decoder is set to 256*256*1, and the output of the staining style normalization decoder is set to 256*256*3. The staining style normalization task is achieved using cycle consistency loss. Simultaneously, accurate segmentation of cell nuclei is achieved.
[0077] Generator G′ X2Y Used to transfer the style of an X source domain image to a Y target domain image style. Discriminator D′ Y Used for judgment Does it closely resemble the style of the real Y target domain image? Similarly, the generator G′... Y2X Used to transfer the style of the Y target domain image to the X source domain image style, and by the discriminator D′ X Determine the degree of authenticity.
[0078] Will Input generator G′ Y2X From And use cycle consistency loss to constrain This method ensures that the texture and structural features of pathological images remain unchanged while the style of the source domain image (X) is transferred to the target domain image (Y). Since the training set prepared in step S1 contains multiple staining styles in the X domain and only one staining style in the Y domain, this achieves the effect of normalizing the staining style of pathological images.
[0079] Step S32: Concatenate ResNet-50 with Transformer to form a multi-task student model generator G′ X2Y G′ Y2X The encoder.
[0080] Step S33: Mix the strongly labeled image patches used in step S23 with the pseudo-labels predicted and selected by the multi-task teacher model as the training set for the multi-task student model, and train the multi-task student model.
[0081] In steps S2 and S3, the training process for the multi-task teacher model AttCycle and the multi-task student model TransCycle is performed 200 times in this embodiment, and the round with the best evaluation index of the validation set segmentation result is selected as the final training result.
[0082] Step S4: Input the digital slice image block of histopathology to be segmented into the trained multi-task student model to obtain the segmentation and staining style normalization results.
[0083] In this embodiment, the digital slide image blocks of histopathology to be segmented are input into a trained multi-task student model to obtain segmentation and staining style normalization results. The segmentation results are evaluated using F1-score, AJI, and mIOU on an independent test set, and the staining style normalization results are evaluated using MAE, RMSE, and SSIM. The relevant formulas are as follows:
[0084]
[0085]
[0086]
[0087]
[0088]
[0089]
[0090] Where TP stands for False Negative, representing the probability that a positive sample is classified as a negative sample; FP stands for False Positive, representing the probability that a negative sample is classified as a positive sample; TN stands for True Negative, representing the probability that a negative sample is correctly classified; and TP stands for True Positive, representing the probability that a positive sample is correctly classified. k is the number of classes (excluding the background class), and N is the number of cell nuclei in an image patch. This refers to the connected components of the generated mask, G. i It refers to The set of connected components that intersect with the labeled cell nucleus. U refers to the set of connected components that do not intersect with the labeled cell nucleus. F This refers to a member of U. X u Y Let σ represent the mean of image X and Y, respectively.X σ Y σ represents the standard deviation of image X and Y, respectively. XY This represents the covariance of the X and Y graphs. C1, C2, and C3 are constants to avoid having a denominator of 0.
[0091] The results are analyzed as follows:
[0092] Table 1 presents the evaluation metrics for cell nucleus segmentation and staining style normalization of the multi-task teacher model AttCycle and the multi-task student model TransCycle on manually labeled datasets and on a mixed dataset of manually labeled and pseudo-labeled datasets.
[0093] Table 1. Results of AtCycle and TransCycle on different datasets
[0094]
[0095] It can be seen that the semi-supervised multi-task histopathological image cell nucleus segmentation and staining style normalization system proposed in this invention can achieve an F1 score of 0.8140, while the normalization index RMSE is further reduced to 0.1598 and SSIM is improved to 0.8224.
[0096] Functions and effects of the embodiments
[0097] The method for cell nucleus segmentation and staining style normalization of histopathological images provided in this embodiment effectively solves the problem of excessive computational load in digital pathological slides by preprocessing to obtain image blocks that are easy for computers to process. Furthermore, a teacher-student semi-supervised framework is proposed, using a multi-task teacher model trained with strongly labeled data to generate pseudo-labeled data, thus expanding the dataset of the multi-task student model and achieving more accurate segmentation and normalization. The constructed multi-task teacher model AttCycle and multi-task student model TransCycle effectively address the problem of low cell nucleus segmentation accuracy due to staining differences in cellular pathological analysis, improving cell nucleus segmentation accuracy while achieving staining style normalization.
[0098] In addition, in this embodiment, AttCycle utilizes Attention-gate to enhance attention to the cell nucleus, thus effectively improving the accuracy of cell nucleus segmentation.
[0099] In addition, in this embodiment, TransCycle introduces ResNet50 and Transformer into the encoder of the generator, which effectively improves the ability to extract features under a large amount of data, further enhancing the performance of the multi-task student model in segmentation and normalization tasks.
[0100] The above embodiments are only used to illustrate specific implementations of the present invention, and the present invention is not limited to the scope of the description of the above embodiments.
Claims
1. A method for cell nucleus segmentation and staining style standardization in histopathological images, characterized in that, Includes the following steps: Step S1: Perform data preprocessing on the full-view digital slice to obtain image patches. The image patches consist of strongly labeled image patches with strong cell nucleus annotations and unlabeled image patches without cell nucleus annotations. Step S2: The strongly labeled image patch is used as input to train the multi-task teacher model. Then, the unlabeled image patch is input to the trained multi-task teacher model to obtain the cell nucleus segmentation result inferred and selected by the multi-task teacher model as a pseudo-label. Step S3: Use the strongly labeled image patch and the image patch with the pseudo-label as the training set for the student model to train the multi-task student model; Step S4: Input the digital histopathological slide image block to be segmented into the trained multi-task student model to obtain the segmentation and staining style normalization results. The strongly labeled image patches are divided into a source domain training set X with image patches of multiple coloring styles and a target domain training set Y with image patches of only one coloring style. Step S2 includes: Step S21, define two generators , and two discriminators , The generator and generator Each consists of one encoder and two decoders, namely a coloring style normalization decoder and a segmentation decoder. The generator Used to transfer the style of an X source domain image to a Y target domain image style. The discriminator Used for judgment Whether it closely resembles the style of a real Y-target domain image in terms of realism. The generator Used to transfer the style of the Y target domain image to the X source domain image style, and by the discriminator To determine authenticity, Will Input the generator From And use cycle consistency loss to constrain This is used to ensure that the texture and structural features of pathological images remain unchanged while the style of X source domain images is converted to the style of Y target domain images. Step S22, set the attention gate to the generator. , In this process, an attention mechanism is used to make the generator pay more attention to the cell nucleus region; Step S23: The strongly labeled image patch is fed into the multi-task teacher model for training. The trained multi-task teacher model is then used to predict unlabeled image patches. The predicted results are then filtered to obtain cell nucleus segmentation results that meet the quality requirements, which are then used as the pseudo-labels. The quality of the pseudo-labels is determined by calculating the softmax value for each pixel in each segmentation result. If the average softmax value of all pixels in the image is greater than a set threshold, then the quality requirement is met. , Where k represents the number of outputs or categories of the neural network, and v is the output vector. Let i be the value of the j-th output or category in v, and let i represent the category that needs to be calculated.
2. The method for cell nucleus segmentation and staining style standardization of histopathological images according to claim 1, characterized in that, In step S21: The coloring style normalization decoder utilizes cycle consistency loss. and combat losses To achieve the task of standardizing coloring styles: , , , In the formula, For each sample x in the training set of domain X, after passing through the generator... After generating the normalized staining results, they are passed through a discriminator. Output the expected value after the second norm. For each sample y in the Y-domain training set, after passing through the generator... After generating the normalized staining results, they are passed through a discriminator. Output the expected value after the second norm. For the discriminator Generate adversarial loss, and the smaller the loss value, the better. For generator Generate adversarial loss, and the smaller the loss value, the better. For each sample x in the training set of domain X, after passing through the generator... After generating the normalized staining results, they are passed through a discriminator. The output, For each sample y in the Y-domain training set, after passing through the generator... After generating the normalized staining results, they are passed through a discriminator. The output, The segmentation decoder uses the BCE loss function as the loss function for cell segmentation. To achieve the task of segmenting the cell nucleus: In the formula, To calculate the segmentation results Corresponding annotations The expected value of the cross-entropy, For the segmentation result Corresponding annotations The cross-entropy, where e is the natural logarithm. The total loss function of the generator is: , ), In the formula, For network segmentation results, for The corresponding annotations For generator The losses in the fight, For generator The losses in the fight, For the discriminator The losses in the fight, For the discriminator The losses in the fight, For generator loss weights, Cyclic consistent loss loss weights, Loss due to cell nucleus segmentation The loss weight.
3. The method for cell nucleus segmentation and staining style standardization of histopathological images according to claim 2, characterized in that: in, The output of the segmentation decoder is set to 256*256*1, and the output of the coloring style normalization decoder is set to 256*256*3.
4. The method for cell nucleus segmentation and staining style standardization of histopathological images according to claim 1, characterized in that, In step S22: The output of the attention gate is the input feature map. and attention coefficient The product of, where This represents a high-dimensional image representation, where i and c represent the spatial and channel dimensions, respectively. , In the formula, The attention gate of the first The input feature map of the feature layer, For the feature layer Attention coefficient of the layer Each pixel i uses The gating vector is used to determine the region of interest. Corresponding to the number of feature maps in layer g, The gate vector contains contextual information for pruning lower-level feature responses, and the gate coefficients are obtained through additional attention, as shown in the following formula: , , In the formula, Indicates the feature layer number 1 Additional attention coefficient of the layer, Represents the ReLU activation function. Corresponding to the Sigmoid activation function, The attention gate is characterized by a set of parameters. Includes: linear transformations linear transformation Linear transformation coefficients and bias terms , The linear transformation is calculated using a 1×1×1 convolution of the input tensor channels.
5. The method for cell nucleus segmentation and staining style standardization of histopathological images according to claim 1, characterized in that, Step S3 includes: Step S31, define two generators , and two discriminators , The generator , Each consists of one encoder and two decoders, namely a coloring style normalization decoder and a segmentation decoder. The staining style normalization decoder and the segmentation decoder respectively utilize cycle consistency loss to achieve the staining style normalization task and the cell nucleus segmentation task: The generator Used to transfer the style of an X source domain image to a Y target domain image style. The discriminator Used for judgment Whether it closely resembles the style of a real Y-target domain image in terms of realism. The generator Used to transfer the style of the Y target domain image to the X source domain image style, and by the discriminator To determine authenticity, Will Input the generator From And use cycle consistency loss to constrain This is used to ensure that the texture and structural features of pathological images remain unchanged while the style of X source domain images is converted to the style of Y target domain images. Step S32: Concatenate ResNet-50 and Transformer to form the generator of the multi-task student model. , The encoder; Step S33: The strongly labeled image patch used in step S23 and the pseudo-labels predicted and selected by the multi-task teacher model are mixed as the training set of the multi-task student model, and the multi-task student model is trained.