Target contour uncertainty error quantification method based on conditional constraint probability generation
By introducing a conditional constrained probability generation model in medical image segmentation, using the visual Transformer encoder and Unet network, the uncertainty of segmentation results is quantified, and the problem that existing models cannot learn multi-bit annotation and cannot quantify segmentation uncertainty is solved, achieving higher diagnostic credibility and interpretability.
Patent Information
- Application Number
- CN202510641998.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-19
- Publication Date
- 2025-06-24
- Estimated Expiration
- 2045-05-19
AI Technical Summary
The existing deep learning segmentation model is difficult to learn labels from multiple experts, and it is impossible to effectively quantify the uncertainty of segmentation results, resulting in high risks in medical diagnosis.
A method of quantifying the uncertainty error of the target profile generated based on conditional constraint probability is proposed. By constructing a prior network, a posterior network and a target profile segmentation network, the KL divergence and cross entropy loss are calculated using the pre-trained visual Transformer encoder and Unet network, and the confidence of the target profile is generated.
It realizes the precise segmentation of lesions in ultrasound images and outputs uncertainty quantitative information of segmentation results, which improves the interpretability of the model and its application value in medical scenarios.
Smart Images

Figure CN120198654A_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the technical fields of computer vision, artificial intelligence, medical image processing, etc., and particularly relates to a method for quantifying the uncertainty error of an object contour generated based on conditional constraint probability. Background Art
[0002] Medical image segmentation plays a crucial role in medical diagnosis and treatment. By accurately segmenting organs or tissues, etc., it provides strong auxiliary support for doctors, thereby improving the diagnosis efficiency and saving medical resources. Compared with natural images, the segmentation targets of medical images usually have characteristics such as complex shapes, blurred edges, tissue variability, etc., and the noise and artifacts in medical images further increase the difficulty of segmentation. Therefore, medical image segmentation is usually more challenging. In addition, medical images often do not have a unique label like natural images. Due to the differences in anatomical knowledge, diagnostic experience, and interpretation criteria among different doctors, different annotation results may be given for the same case. In clinical practice, pooling the views of multiple experts can improve the diagnostic level and help enhance the reliability and accuracy of diagnosis. However, most current deep learning segmentation models often cannot learn the annotations from multiple experts and can only give a single segmentation result in the form of a "black box". Incorrect segmentation results may lead to serious consequences. Therefore, it is particularly important to be able to estimate the uncertainty of the segmentation result, which can not only effectively help doctors evaluate the confidence level of the model in the segmentation result, but also help identify high-risk areas, improve the interpretability of the model, make the application of the method in the medical scenario more transparent and credible, and thus better meet the actual clinical needs. Summary of the Invention
[0003] The purpose of this case is to propose a method for quantifying the uncertainty error of an object contour generated based on conditional constraint probability through this research, which can effectively achieve the segmentation of lesions in ultrasound images, output the uncertainty quantification information of its own segmentation result, and visually display this uncertainty information, so as to effectively help doctors evaluate the reliability of the segmentation result and identify high-risk areas, enhance the interpretability of the method, and have important application value in the field of computer-aided diagnosis.
[0004] In the first aspect, this case proposes a method for quantifying the uncertainty error of the target contour generated based on conditional constrained probability. The steps of the method include: constructing a prior network based on a pre-trained first Vision Transformer encoder, constructing a posterior network using a second Vision Transformer encoder with the same structural parameters as the first Vision Transformer encoder, and constructing a target contour segmentation network based on the Unet network; inputting the nodular ultrasound image samples into the prior network respectively to obtain the prior distribution, concatenating the nodular ultrasound image sample and its corresponding label, reducing the dimension through convolution, and then inputting it into the posterior network to obtain the posterior distribution, and calculating the KL divergence based on the prior distribution and the posterior distribution. Input the nodular ultrasound image sample and the prior distribution into the target contour segmentation network, output the prediction result, and calculate the cross-entropy loss between the prediction result and the true value. Input the nodular ultrasound image sample and the posterior distribution into the target contour segmentation network, output the prediction result, and calculate the cross-entropy loss between the prediction result and the true value. Calculate the total training loss. , Input the nodular ultrasound image to be segmented into the trained prior network to obtain the prior distribution, input the obtained prior distribution and the corresponding nodular ultrasound image to be segmented into the trained target contour segmentation network, output the segmentation result of the nodular ultrasound image, and then obtain the target contour confidence.
[0005] In an implementation of the above technical solution, the pre-training is to divide the nodular ultrasound image into image patches, and use the Vision Transformer encoder to achieve self-supervised learning through masking and reconstruction.
[0006] In an implementation of the above technical solution, the target contour segmentation network takes the nodular ultrasound image as the input of its encoder and injects the latent variable into the bottleneck layer; the latent variable is sampled from the prior distribution or the posterior distribution during training, and when the trained model is applied, it is sampled from the prior distribution; the injection is to expand the latent variable to the same dimension as the bottleneck layer feature, then concatenate it with the feature output by the encoder, and then reduce the dimension and pass it to the decoder.
[0007] In an implementation of the above technical solution, both the prior distribution and the posterior distribution are Gaussian distributions.
[0008] In an implementation of the above technical solution, the target contour confidence is the standard deviation of each pixel point.
[0009] In an implementation of the above technical solution, the method visualizes the target contour confidence through color.
[0010] In a second aspect, the present case provides a computer-readable storage medium storing a computer program that can be loaded and executed by a processor to perform any of the above methods.
[0011] In a third aspect, a target contour segmentation system includes a prior network, a posterior network, and a target contour segmentation network. Specifically: The prior network is configured to obtain first encoded features of a nodule ultrasound image using a pre-trained first vision Transformer encoder and obtain a prior distribution corresponding to the first encoded features. The target contour segmentation network is configured to obtain a nodule segmentation result using a Unet network based on the nodule ultrasound image and its corresponding probability distribution, and then obtain a target contour confidence level. The probability distribution is a prior distribution or a posterior distribution. The posterior network is configured to be used during training to obtain second encoded features of the nodule ultrasound image using a pre-trained second vision Transformer encoder, and at the same time use the expert-annotated label as a conditional variable, based on the conditional variable and the posterior distribution corresponding to the second encoded features. The loss calculation during the training of the system is , , which is the KL divergence between the posterior network and the prior network; which is the cross-entropy loss based on the prediction result corresponding to the posterior network and the ground truth; which is the cross-entropy loss based on the prediction result corresponding to the prior network and the ground truth. When the trained system is applied, the nodule ultrasound image to be segmented is used as the input of the prior network to obtain a prior distribution, and then the obtained prior distribution and the corresponding nodule ultrasound image to be segmented are input into the trained target contour segmentation network to output the segmentation result of the nodule ultrasound image, and then obtain the target contour confidence level.
[0012] In an implementation of the above technical solution, the system further includes a calculation module. The calculation module is configured to calculate the target contour confidence level based on the segmentation result of the nodule ultrasound image to be segmented.
[0013] Beneficial technical effects of this case: (1) By introducing a pre-training strategy of image masking and reconstruction, and using a vision Transformer encoder to enhance the global image representation ability of the method, combined with an object contour segmentation network, accurate segmentation of ultrasound nodule images is achieved, providing a reliable auxiliary diagnosis plan for clinical diagnosis and treatment; (2) By introducing the annotation distribution of multiple experts as a condition, and then using a probability generation model based on conditional constraints to learn the probability distribution of data, the method can generate multiple predicted segmentation results that conform to the real data distribution, thereby obtaining the uncertainty quantification result of the method, providing a quantitative basis for doctors to evaluate the reliability of the model segmentation results, helping to identify high-risk areas, and effectively improving the interpretability of the model and its application value in medical scenarios. Brief Description of the Drawings
[0014] To more clearly illustrate the technical solutions in the embodiments of the present application, the following will briefly introduce the drawings required for the description of the embodiments. Obviously, the drawings in the following description are only some embodiments of the present application. For those of ordinary skill in the art, without creative efforts, other drawings can be obtained based on these drawings.
[0015] Figure 1 Schematic diagram of the structure of an ultrasound object contour uncertainty error quantification method based on conditional constraint probability generation in one implementation.
[0016] Figure 2 Schematic diagram of the visualization effect of the segmentation result of the thyroid ultrasound image nodule lesion in one implementation.
[0017] Figure 3 Schematic diagram of the visualization of the thyroid ultrasound image object contour uncertainty error quantification in one implementation. Detailed Implementation Manner
[0018] Based on the medical image analysis process and the knowledge of ultrasound diagnosis guidelines, this case uses image processing technologies such as pre-training, feature extraction, and uncertainty error quantification to establish a method for quantifying object contour uncertainty error based on conditional constraint probability generation, which has important application value and application prospects for 2D ultrasound image segmentation and auxiliary clinical diagnosis. The uncertainty error quantification refers to outputting the confidence map of the method for the predicted segmentation result, quantifying the confidence level of the method for the segmentation result.
[0019] The following will clearly and completely describe how to implement the technical solutions of this case in combination with the drawings. Obviously, the described implementation manners are only part of the implementation manners of this case, rather than all the implementation manners. Based on the implementation manners in this case, all other implementation manners obtained by those of ordinary skill in the art without creative efforts belong to the scope protected by this application.
[0020] (1) Extraction of nodule ultrasound image features In this case, a pre-trained Vision Transformer encoder is used to extract features from nodule ultrasound images.
[0021] Pre-training is achieved through masking and reconstruction to complete self-supervised learning. The pre-trained Vision Transformer encoder can be transferred to a variety of downstream tasks and perform well, and can effectively improve the training speed and accuracy of the entire method in downstream tasks.
[0022] Specifically, in the pre-training stage, assuming that the original input nodule ultrasound image is , it is divided into image patches: . Through random masking operation, the image is randomly divided into a visible patch set and a masked patch set , with a masking rate .
[0023] Use the Vision Transformer encoder as the encoder , and only process the visible patches . Since the Vision Transformer encoder itself does not have the ability to process the order or spatial position of input data, in order to restore the position information, a linear projection is applied to add position embeddings to the visible image patches: , is the embedded position information. The image patches embedded with position information are input into the Vision Transformer encoder for encoding, and the corresponding feature representations are output , .
[0024] In one implementation, the Vision Transformer encoder specifically includes 12 Transformer layers, and each Transformer layer includes the following two sub-layers: Multi-Head Self-Attention (MHSA):
[0025] where are the query, key, and value obtained from through linear transformation.
[0026] Feed-Forward Network (FFN):
[0027] Among them , is the weight matrix, , is the bias, is the activation function.
[0028] Residual connections and layer normalization (LayerNorm) are used between the layers of each Transformer layer:
[0029] In the above formula, is the output of the th layer, is the intermediate result after applying MHSA and residual connections, is the th layer output.
[0030] The pre-training architecture based on the image mask is an asymmetric encoder-decoder architecture. Its decoder is only used to perform the image reconstruction task during pre-training, but not for downstream tasks.
[0031] The decoder uses 4 Transformer blocks. Through this asymmetric design, the entire method architecture is made lighter, which can greatly reduce the pre-training time.
[0032] Decoder receives the output of the encoder and the learnable mask token placed at the mask block position , and reconstructs the original image block : .
[0033] The decoder does not reconstruct the entire image, but only predicts the reconstruction of the masked image blocks, which has been proven to obtain better results. The goal of reconstruction is to minimize the difference between the intermediate image and the original image, usually using the mean squared error loss (L2 loss):
[0034] Among them, is the masked block in the original image, is the reconstructed block output by the decoder, is the number of mask blocks.
[0035] Since the output of the encoder is used to reconstruct the complete image, this network design encourages the encoder to understand and extract global features from partial image information, thereby improving the performance in image reconstruction and downstream tasks. The weights of the above encoder will be passed to the training stage.
[0036] By reconstructing the masked image, the network is encouraged to aggregate information from the context to infer the masked target. Since the context information is crucial for medical image analysis, introducing a pre-training architecture based on image masking into medical image segmentation can effectively improve the accuracy.
[0037] In this case, a pre-training architecture based on image masking is introduced into the technical solution to learn the global features of the image faster and more accurately through the pre-training strategy. In the pre-training architecture based on image masking, the self-attention mechanism of the Vision Transformer encoder is used to directly model the global dependencies between image patches.
[0038] Thus, the next uncertainty module can learn a distribution that better conforms to the data characteristics, thereby generating more valuable samples.
[0039] (2) Quantification of the target contour uncertainty error The quantification of the target contour uncertainty error is achieved through a Vision Transformer encoder and a conditional constraint-based probability generative model. The Vision Transformer encoder is used to obtain image features, and the probability generative model encodes the image features into a distribution in the latent space.
[0040] Before introducing the conditional constraint-based probability generative model, the probability generative model based on variational inference is introduced first.
[0041] The probability generative model based on variational inference is a generative model. Its core idea is to encode the image features obtained by the Vision Transformer encoder into a probability distribution in the latent space instead of a single point, so as to be able to generate meaningful new data.
[0042] The training process of the probability generative model based on variational inference is as follows: First, the image features obtained by the Vision Transformer encoder are encoded into a distribution in the latent space, then a latent variable is sampled from this distribution, and then the latent variable is input into the decoder to reconstruct the input data.
[0043] The training loss function of the probability generative model based on variational inference includes minimizing the KL divergence between the encoding distribution and the standard normal distribution and the reconstruction error, that is, maximizing the variational lower bound (ELBO), so that the latent space has good regularity and is close to the standard normal distribution, and the points randomly sampled from the latent space can be decoded into meaningful new data. The formula of ELBO is expressed as:
[0044] Among them, is the input data, is the latent variable, is the encoder network (i.e., the posterior distribution), is the decoder network, is the prior distribution (usually a normal distribution), represents the KL divergence.
[0045] The probability generative model based on conditional constraints introduces conditional variables on the basis of the probability generative model based on variational inference, enabling the model to generate data under given conditions. The conditional variables can be labels, features, or other auxiliary information.
[0046] During the training process of the probability generative model based on conditional constraints, the original data and the conditional variables are jointly input into the encoder to generate the posterior distribution, and a latent variable is sampled from the posterior distribution and input into the decoder to obtain the reconstruction result. At the same time, the original data is separately input into the encoder with the same architecture to generate the prior distribution. During the inference process, only the prior distribution is used, and the data is input into the prior encoder and encoded, sampled, and decoded to obtain the result.
[0047] The training objective of the probability generative model based on conditional constraints is also to maximize the variational lower bound. By minimizing the KL divergence between the prior distribution and the posterior distribution and the reconstruction error, the two distributions are made as similar as possible, and useful data can be sampled from the prior distribution during inference.
[0048] The optimization objective of the probability generative model based on conditional constraints can be expressed as:
[0049] where, is the conditional variable, is the posterior encoder, is the prior encoder.
[0050] In this case, two vision Transformer encoders with the same architecture and the same pre-trained weights and the encoder are respectively used to construct the prior network and the posterior network.
[0051] The prior network is configured to obtain the first encoded feature of the nodular ultrasound image by using the pre-trained first vision Transformer encoder and obtain the prior distribution corresponding to the first encoded feature.
[0052] In the prior network, all patches of the image are input into to obtain the first image encoded feature: , and the first image encoded feature is mapped to the prior distribution , and the prior distribution is a standard Gaussian distribution: 。
[0053] The posterior network is configured to be used in training to assist in the training of the prior network. It uses a pre-trained second Vision Transformer encoder to obtain the second encoded features of the nodule ultrasound image, and at the same time takes the expert-annotated label as a conditional variable. Based on the posterior distribution corresponding to the conditional variable and the second encoded features, the posterior distribution and its corresponding nodule ultrasound image are input into the target contour segmentation network to obtain the segmentation result of the nodule ultrasound image.
[0054] In the posterior network, the label is used as a conditional variable to guide data generation. After splicing the image patch and the label, they are input into the posterior network to obtain the second image encoded features: and map the second image encoded features onto the posterior distribution The posterior distribution is a Gaussian distribution with a mean of and a standard deviation of .
[0055] During the training process, a latent variable is sampled from the posterior distribution , and the reparameterization trick needs to be used in this process to enable the gradient to propagate and avoid directly sampling from a complex distribution:
[0056] where is the noise sampled from the standard normal distribution.
[0057] In this case, the prior network is constructed based on the Vision Transformer encoder framework, which can not only better learn the representation of the image, but also obtain a distribution more in line with the data characteristics, thus providing more valuable sampled data. To enable the prior network to generate a more accurate feature distribution, it is assisted in training by the posterior network. The posterior network is constructed based on the Vision Transformer encoder with the same structure and parameters, and the expert-annotated label is introduced as a conditional variable to better capture the correlation information between the input data and the label. When there is a one-to-many relationship, that is, one image corresponds to multiple ground truths, it can better learn the distribution of the ground truths, making the samples generated in the latent space more in line with the distribution of the ground truths. Moreover, the introduction of the conditional variable can increase the diversity of the generated samples and improve the overall performance and effect of the generation model.
[0058] (III) Segmentation of the target contour In this case, the Unet model is used as the target contour segmentation network. The Unet model is a multi-layer segmentation network model with an encoder-decoder structure by itself, and the encoder and decoder are connected through a bottleneck layer. The Unet model gradually extracts and reduces the feature dimensions through multiple convolutional and pooling layers, and then restores the feature map to the resolution of the original input image through transposed convolutional layers and skip connections. The skip connections help to retain the feature information at different levels, improving the segmentation accuracy and the ability to retain details.
[0059] In one implementation, the encoder in the target contour segmentation network includes 4 layers of operations, and each layer includes a double convolution and a downsampling operation for extracting feature representations at different scales. Let the input image be , and the operation after passing through the th layer of the encoder is:
[0060] where, is the feature map of the th layer, and is the max pooling operation.
[0061] The decoder gradually restores the original resolution through upsampling operations and concatenates with the features of the corresponding layer of the encoder. The operation of the th layer of the decoder is:
[0062] where, is the feature map of the th layer of the decoder, is the concatenated feature map, and is the transposed convolution operation.
[0063] Finally, the output of the last layer of the decoder is adjusted to the number of classes through a convolutional layer with channels, and the prediction result is obtained through operation:
[0064] In this case, the original input image is input into the target contour segmentation network, and the latent variable is upsampled from the posterior distribution , and Inject it into the bottleneck layer of the target contour segmentation network. Specifically, expand z to the same dimension as the features of the bottleneck layer, then concatenate them, and perform dimensionality reduction through one layer of Conv and one layer of ReLU. Since the bottleneck layer highly abstracts and compresses the features and passes the features to the decoder stage, injecting the latent variable into this layer can enhance the diversity of the model's generation results.
[0065] (4) Training Train the prior network, posterior network, and target contour segmentation network. The training loss function consists of three parts.
[0066] First, calculate the KL divergence between the posterior distribution and the prior distribution:
[0067] Second, the latent variable sampled from the posterior distribution is injected into the target contour segmentation network to obtain the cross-entropy loss between the prediction result and the ground truth:
[0068] Finally, to enhance the prediction ability of the prior distribution, sample from the prior distribution and inject it into the target contour segmentation network to obtain the predicted value and calculate the cross-entropy loss .
[0069] Therefore, the overall loss function is:
[0070] (5) Prediction and Inference Stage Only the prior network is used in the inference stage for prediction. The image is input into the prior network, encoded, sampled, and injected into the target contour segmentation network, and finally the predicted image is obtained.
[0071] The number of samplings in this case is configurable. Denote the prediction result each time as , and first calculate the average value of the prediction results:
[0072] Then calculate the standard deviation of each pixel point as the confidence:
[0073] The larger the standard deviation, the higher the uncertainty of the prediction result at that point, and vice versa.
[0074] The above method is used for the segmentation of nodular lesions in thyroid ultrasound images. For the visualization effect of the segmentation results, see Figure 2, where the top left cell is the original image, the second column is the true segmentation label marked by the doctor, and the number of sampling times , and the second and third rows are the segmentation results obtained by sampling 10 times with the method. It can be seen that the segmentation results basically conform to the true values and can show a certain degree of diversity. For the visualization effect of the contour confidence of the segmentation results, see Figure 3 , which shows two cases on the thyroid ultrasound dataset. The first column shows the ultrasound image and the true value, the second column shows the result of sampling once, and the uncertainty quantification obtained by calculating the variance of the segmentation result. The closer the color is to red, the higher the uncertainty, and the closer the color is to blue, the lower the uncertainty. It can be seen that the case on the left gives a segmentation result close to the true value, and the overall uncertainty is relatively low, only the uncertainty at the edge position is slightly higher. While the case on the right gives a poor segmentation result, but the uncertainty of the mis-segmented area is very high, indicating that the model performs poorly in segmenting this area.
[0075] In summary, it shows that the proposed method can segment lesions in medical images and output the uncertainty quantification of its own prediction results, improving the interpretability of the method and helping doctors identify high-risk areas.
[0076] Through the description of the above implementation manners, those skilled in the art can clearly understand that the present disclosure proposes a method for quantifying the uncertainty error of the target contour generated based on conditional constraint probability, and the method includes a target contour segmentation network training method and a target contour uncertainty quantification method; wherein: The target contour segmentation network training method includes the following steps: Construct a prior network based on a pre-trained first Vision Transformer encoder, construct a posterior network using a second Vision Transformer encoder having the same structural parameters as the first Vision Transformer encoder, and construct a target contour segmentation network based on the Unet network; Input the nodule ultrasound image samples into the prior network respectively to obtain the prior distribution, splice the nodule ultrasound image sample and its corresponding label, input them into the posterior network after convolution and dimensionality reduction to obtain the posterior distribution, and calculate the KL divergence based on the prior distribution and the posterior distribution ; Input the nodule ultrasound image sample and the prior distribution into the target contour segmentation network, output the prediction result, and calculate the cross-entropy loss between the prediction result and the true value ; Input the nodule ultrasound image sample and the posterior distribution into the target contour segmentation network, output the prediction result, and calculate the cross-entropy loss between the prediction result and the true value ; Calculate the total training loss , 。
[0077] The method for quantifying the uncertainty of the target contour includes the following steps: Input the ultrasound image of the nodule to be segmented into the trained prior network to obtain the prior distribution. Input the obtained prior distribution and the corresponding ultrasound image of the nodule to be segmented into the trained target contour segmentation network, and output the segmentation result of the ultrasound image of the nodule, so as to obtain the target contour confidence.
[0078] Through the description of the above embodiments, those skilled in the art can clearly understand that according to the method of the present disclosure, a method for training a target contour segmentation network can be obtained. The method includes the following steps: Construct a prior network based on a pre-trained first Vision Transformer encoder, construct a posterior network with a second Vision Transformer encoder having the same structural parameters as the first Vision Transformer encoder, and construct a target contour segmentation network based on the Unet network; Input the ultrasound image samples of the nodules into the prior network respectively to obtain the prior distribution. Concatenate the ultrasound image samples of the nodules and their corresponding labels, and input them into the posterior network after convolution and dimensionality reduction to obtain the posterior distribution. Calculate the KL divergence based on the prior distribution and the posterior distribution ; Input the ultrasound image samples of the nodules and the prior distribution into the target contour segmentation network, output the prediction result, and calculate the cross-entropy loss between the prediction result and the true value ; Input the ultrasound image samples of the nodules and the posterior distribution into the target contour segmentation network, output the prediction result, and calculate the cross-entropy loss between the prediction result and the true value ; Calculate the total loss , 。
[0079] Through the description of the above embodiments, those skilled in the art can clearly understand that the present disclosure proposes a target contour segmentation system, which includes a prior network, a posterior network, and a target contour segmentation network; wherein: the prior network is configured to obtain the first encoded feature of the nodule ultrasound image by using a pre-trained first vision Transformer encoder, and obtain the prior distribution corresponding to the first encoded feature; the target contour segmentation network is configured to obtain the nodule segmentation result by using a Unet network based on the nodule ultrasound image and its corresponding probability distribution, and further obtain the target contour confidence, where the probability distribution is a prior distribution or a posterior distribution; the posterior network is configured to be used in training, obtain the second encoded feature of the nodule ultrasound image by using a pre-trained second vision Transformer encoder, and at the same time use the expert-annotated label as a conditional variable, based on the conditional variable and the posterior distribution corresponding to the second encoded feature; the loss calculation of the system during training is , , is the KL divergence between the posterior network and the prior network; is the cross-entropy loss between the prediction result corresponding to the posterior network and the true value; is the cross-entropy loss between the prediction result corresponding to the prior network and the true value; when the trained system is applied, the nodule ultrasound image to be segmented is used as the input of the prior network to obtain the prior distribution, and then the obtained prior distribution and the corresponding nodule ultrasound image to be segmented are input into the trained target contour segmentation network to output the segmentation result of the nodule ultrasound image. In some embodiments, the system further includes a calculation module; the calculation module is configured to calculate the target contour confidence based on the segmentation result of the nodule ultrasound image to be segmented.
[0080] Through the description of the above embodiments, those skilled in the art can clearly understand that a method for quantifying the target contour uncertainty error based on conditional constraint probability according to the present disclosure is implemented as a system for quantifying the target contour uncertainty error based on conditional constraint probability, and the method steps are implemented through programs or program modules in the system.
[0081] Through the description of the above embodiments, those skilled in the art can clearly understand that the method or system of the present disclosure can be implemented by means of software plus necessary general hardware. Of course, it can also be implemented by dedicated hardware including application-specific integrated circuits, dedicated CPUs, dedicated memories, dedicated components, etc. Generally, functions accomplished by computer programs can be easily implemented by corresponding hardware, and the specific hardware structures for implementing the same function can also be diverse, such as analog circuits, digital circuits or dedicated circuits, etc. However, for the present disclosure, in more cases, software program implementation is a better embodiment. Therefore, those skilled in the art can implement a method for quantifying the uncertainty error of the target contour generated based on conditional constraint probability. When implemented by a software program (computer program), the software program can be stored in a storage medium and recorded and executed in a processor.
[0082] Although the embodiments of the present disclosure have been described above in conjunction with the accompanying drawings, the present disclosure is not limited to the above specific embodiments and application fields. The above specific embodiments are merely illustrative and guiding, rather than restrictive. Those of ordinary skill in the art can also make many forms under the inspiration of this specification and without departing from the scope protected by the claims of the present disclosure, and all of these fall within the scope of protection of the present disclosure.
Claims
1. A method for quantifying target contour uncertainty error based on conditional constraint probability generation, characterized in that: The method comprises the following steps: A priori network is constructed based on the pre-trained first visual Transformer encoder, a posterior network is constructed using the second visual Transformer encoder with the same structural parameters as the first visual Transformer encoder, and a target contour segmentation network is constructed based on the Unet network; The nodule ultrasound image samples are input into the prior network to obtain the prior distribution. The nodule ultrasound image samples and their corresponding labels are concatenated and input into the posterior network after convolutional dimension reduction to obtain the posterior distribution. The KL divergence is calculated based on the prior distribution and the posterior distribution. ; The nodule ultrasound image sample and prior distribution are input into the target contour segmentation network, the prediction result is output, and the cross entropy loss between the prediction result and the true value is calculated. ; The nodule ultrasound image sample and posterior distribution are input into the target contour segmentation network, the prediction result is output, and the cross entropy loss between the prediction result and the true value is calculated. ; Calculate the total training loss , ; The ultrasonic image of the nodule to be segmented is input into the trained prior network to obtain the prior distribution, the obtained prior distribution and the corresponding ultrasonic image of the nodule to be segmented are input into the trained target contour segmentation network, the segmentation result of the nodule ultrasonic image is output, and then the target contour confidence is obtained.
2. The method according to claim 1, characterized in that: The pre-training is to divide the nodule ultrasound image into image blocks, and use the visual Transformer encoder to achieve self-supervised learning through masking and reconstruction.
3. The method according to claim 1, characterized in that: The target contour segmentation network uses the nodule ultrasound image as the input of its encoder and injects the latent variable into the bottleneck layer; The hidden variable is sampled from the prior distribution or the posterior distribution during training, and is sampled from the prior distribution after training the application; The injection is to expand the latent variable to the same dimension as the bottleneck layer feature, then concatenate it with the feature output by the encoder, and then pass it to the decoder after dimensionality reduction.
4. The method according to claim 1, characterized in that: The target contour confidence is the standard deviation of each pixel.
5. The method according to claim 1, characterized in that The prior distribution and the posterior distribution are both Gaussian distributions.
6. The method according to claim 1, characterized in that The method visualizes the target contour confidence through color.
7. A computer-readable storage medium, characterized in that: A computer program is stored which can be loaded by a processor and execute the method according to any one of claims 1 to 6.
8. A target contour segmentation system, characterized in that: The system includes a priori network, a posteriori network, and a target contour segmentation network; wherein: The prior network is configured to obtain a first encoding feature of the nodule ultrasound image using a pre-trained first visual Transformer encoder, and obtain a prior distribution corresponding to the first encoding feature; The target contour segmentation network is configured to obtain a nodule segmentation result based on the nodule ultrasound image and its corresponding probability distribution using a Unet network, and then obtain a target contour confidence, wherein the probability distribution is a prior distribution or a posterior distribution; The posterior network is configured to be used in training, using a pre-trained second visual Transformer encoder to obtain a second encoding feature of the ultrasound image of the nodule, and using the label annotated by the expert as a conditional variable, based on the posterior distribution corresponding to the conditional variable and the second encoding feature; The loss of the system during training is calculated as , , is the KL divergence of the posterior network and the prior network; is the cross entropy loss between the predicted result and the true value based on the posterior network; is the cross entropy loss between the predicted result and the true value based on the prior network; When the trained system is used, the ultrasound image of the nodule to be segmented is used as the input of the prior network to obtain the prior distribution, and then the obtained prior distribution and the corresponding ultrasound image of the nodule to be segmented are input into the trained target contour segmentation network to output the segmentation result of the ultrasound image of the nodule.
9. The system according to claim 8, characterized in that The target contour segmentation network uses the nodule ultrasound image as the input of its encoder and injects the latent variable into the bottleneck layer; The hidden variable is sampled from the prior distribution or the posterior distribution during training, and is sampled from the prior distribution after training the application; The injection is to expand the latent variable to the same dimension as the bottleneck layer feature, then concatenate it with the feature output by the encoder, and then pass it to the decoder after dimensionality reduction.
10. The system according to claim 8, characterized in that The system also includes a calculation module; the calculation module is configured to calculate the target contour confidence based on the segmentation result of the ultrasound image of the nodule to be segmented.
Citation Information
Patent Citations
Multi-modal MR image segmentation method based on prior-posterior probability encoder
CN114972231A
License plate image generation method and system based on adaptive diffusion prior variational auto-encoder
CN115223158A
Ultrasonic nodule interpretability identification method, computer equipment and storage medium
CN116664543A
Diversified image description method based on conditional variation Transform and introspection adversarial learning
CN116824584A
Systems and methods for image segmentation
US20210397966A1