Deep learning uncertainty measurement system based on Bayesian segmentation network
Through a deep learning uncertainty measurement system based on Bayesian segmented network, the problem of difficulty in effectively quantifying the uncertainty of deep learning models in the prior art is solved, and the higher credibility and interpretability of intelligent software systems are achieved.
Patent Information
- Application Number
- CN202510058392.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-15
- Publication Date
- 2025-04-08
AI Technical Summary
The prior art is difficult to effectively quantify the uncertainty of deep learning models in tasks such as image segmentation and object detection in industrial applications, resulting in insufficient credibility and interpretability of intelligent software systems.
Using a deep learning uncertainty measurement system based on Bayesian segmentation network, the intelligent model uncertainty is modeled through the convolutional encoder-decoder module, and the variance of the softmax sample is calculated to obtain the model uncertainty for each category.
It improves the credibility and interpretability of the intelligent model, enhances the robustness and stability of the model, and ensures the reliability of the predicted output of the intelligent software system.
Smart Images

Figure CN119785155A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of intelligent software testing, and in particular to a deep learning uncertainty measurement system based on a Bayesian segmentation network. Background Art
[0002] Intelligent models such as deep learning have been widely used in safety-critical equipment such as military, aerospace, and medical diagnosis to achieve functions such as intelligent perception and autonomous decision-making. However, the prediction output of the deep learning model is a distribution. Due to the distribution bias of the data set and the imperfection of the model itself, the intelligent system may sometimes give wrong prediction results. The uncertainty of these prediction results may have a serious impact on the credibility of the intelligent equipment system and may even affect the stable operation of the entire system.
[0003] In recent years, the research on uncertainty in intelligent software has been a hot topic, mainly distributed in data uncertainty and model uncertainty. In terms of data uncertainty, Alex Kendall and Yarin Gal explored how to quantify the data uncertainty of Bayesian deep learning in computer vision tasks and applied it to different tasks; Balaji Lakshminarayanan et al. proposed a simple integration method as an alternative to Bayesian NN to accurately represent data uncertainty; Stanislav Fort et al. explored the advantages of deep integration methods in dealing with data uncertainty from the perspective of loss functions; Andrey Malinin and Mark Gales proposed a priori network (PN) to explicitly model model uncertainty and try to separate it from data uncertainty in order to accurately represent data uncertainty. Research in the field of model uncertainty is already quite rich. In terms of model uncertainty, Yarin Gal and Zoubin Ghahramani proposed using dropout technology as an approximate method of Bayesian reasoning to represent model uncertainty in deep learning; Yarin Gal et al. extended the aforementioned dropout technology and proposed a concrete dropout method, which better estimates model uncertainty by optimizing the dropout rate; Riashat Islam et al. explored deep Bayesian active learning methods, focusing on how to use model uncertainty to select the most informative data for labeling, so as to improve the learning efficiency and accuracy of the model.
[0004] Although there have been many related works, uncertainty measurement methods are still in the theoretical research stage and have not yet been applied in industry. The main reason is that the uncertainty of intelligent tasks such as semantic segmentation, image classification, and object detection, which are widely used in industrial scenarios, has only been analyzed at a shallow level, and most of these methods require retraining the network, which has the problems of low efficiency and poor effectiveness.
[0005] Therefore, it is necessary to propose efficient uncertainty quantification methods and systems with generalization capability and high executability for typical tasks such as image segmentation and target detection in safety-critical intelligent software, with a focus on improving the credibility and interpretability of safety-critical intelligent software systems and ensuring the reliability of their predictive outputs.
[0006] Therefore, in view of this, the existing structural deficiencies are studied and improved, and a deep learning uncertainty measurement system based on Bayesian segmentation network is proposed. Summary of the invention
[0007] The purpose of the present invention is to provide a deep learning uncertainty measurement system based on a Bayesian segmentation network to solve the problems raised in the above background technology.
[0008] To achieve the above object, the present invention provides the following technical solution: a deep learning uncertainty measurement system based on a Bayesian segmentation network, step 1, data input module: input the deep learning model to be tested and the test data set: (1) Deep learning model to be tested Type: Deep learning model, designed for image segmentation tasks; Function: The model is trained to receive image input and output the corresponding segmentation result, which is a matrix of the same size as the input image, where each element represents the category label of the pixel at the corresponding position in the input image; Format: exists in the form of a model object in the deep learning framework and contains all weights and parameters; (2) Test Dataset Type: A collection of images used to evaluate the performance of the deep learning model under test. Content: The test dataset contains a series of images to be segmented, but should not contain images that have appeared in the training set. The images in the test dataset should cover all categories that the model needs to segment and include some challenging situations. Format: The test dataset is provided in the form of a folder, a list of image files, or an image data loader. Each image file should contain image data and possible metadata. The image data is raw pixel values, preprocessed pixel values, or any other form suitable for model input. (3) Input processing Before passing the input to the module, a preprocessing step is required to ensure that the input meets the model's requirements. The image size needs to be resized to match the model's input size, the image needs to be converted to the format required by the model, or data augmentation techniques need to be applied to improve the model's generalization ability. Step 2, convolutional encoder-decoder module: This module models the uncertainty of the intelligent model under test through the convolutional encoder-decoder method, performs distributed inference on the weights of the model under test, and provides a probabilistic interpretation for the model under test, thereby providing a basis for uncertainty analysis of the predicted output of the model under test; The modular encoder is based on 13 convolutional layers of the VGG-16 neural network, including convolutional layers, pooling layers, and RELU function layers. The decoder arranges these layers in reverse order. The encoder unit contains one or more convolutional layers followed by a maximum pooling layer, and the decoder unit contains one or more convolutional layers followed by an upsampling layer. Bayesian encoder dropout is used after each encoder unit, Bayesian decoder dropout is used after each decoder unit, Bayesian encoder-decoder dropout is used after each encoder and decoder unit, and Bayesian center dropout is used after the deepest encoder and before the decoder stage. The probability output is obtained from the Monte Carlo sample of the model by applying dropout at test time. The variance of these softmax samples is used as the model uncertainty for each category in subsequent steps; In the lower layers of the convolutional network, features are extracted. Applying Bayesian weights on these layers does not lead to better performance. Low-level features are consistent in the model distribution and are suitable for modeling with deterministic weights. However, higher-level features formed in deeper layers are more suitable for modeling with Bayesian weights. Step 3, uncertainty analysis module, the uncertainty measure of the model under test comes from the probability output of the encoder-decoder, which is obtained from the Monte Carlo samples of the model by applying dropout at test time, that is, the variance of these softmax samples is used as the model uncertainty of each category; Step 4: Result visualization module. This module is used to present the uncertainty analysis results of the model to be tested in an intuitive and easy-to-understand chart format. The core function of this module is to transform complex data analysis results into clear visual presentations, helping to quickly grasp the key indicators and potential problems of model performance. The result visualization module receives these analysis results as input and converts them into visual output using chart drawing technology. The charts include bar charts, line charts, scatter plots, and heat maps. Each type is suitable for displaying different types of analysis results.
[0009] Furthermore, in step 2, the module will first build a Bayesian semantic segmentation model. When using the Bayesian semantic segmentation model for probabilistic segmentation, its posterior distribution is obtained based on the given training data X and label Y, and the convolution weight W.
[0010] Furthermore, during the model construction process, the Monte Carlo dropout technique was used to train the model, and the posterior distribution on the weights was sampled by dropout during testing to obtain the posterior distribution of the softmax category probability.
[0011] Furthermore, dropout is used during training to model the sparseness of the neural network for regularization, and the distribution q(W) on the model weights is obtained by minimizing the Kullback-Leibler (KL) divergence between the approximate distribution and the full posterior distribution. KL(q(W)││p(W│X,Y)) For each convolutional layer i, its unit is , for all units j, its approximate variational distribution q(W) is defined by a Bernoulli distribution random variable and a variational parameter: Bernoulli (pi), if each layer has infinite units, the approximate model will be close to the Gaussian process, and the dropout probability pi will be fixed to the baseline probability of 50%, that is, pi=0.5.
[0012] Furthermore, in step 3, during testing, we sample the posterior distribution on the weights through dropout to obtain the posterior distribution of the softmax category probabilities. We take the mean of these sampled values to make segmentation predictions and use the variance to output the model uncertainty for each category. The mean of the variance measurements for each category is used as the overall measure of model uncertainty.
[0013] Furthermore, in step 4, when the model to be tested is run on the test data set, a series of analysis results on the model uncertainty will be generated, including but not limited to: the uncertainty distribution of the model for different categories of predictions, the trend of uncertainty changing with image features, and the uncertainty performance of the model in the scene or category.
[0014] Furthermore, the uncertainty in step 4 includes whether the segmentation prediction is smooth, whether the segmentation around the object boundary is clear, and when the model predicts an incorrect label, the uncertainty classification will be highlighted.
[0015] Furthermore, in step 4, the bar chart is used to show the mean or median of the model's uncertainty for different categories of predictions; the line chart is used to show the trend of uncertainty changing with a continuous variable; and the scatter plot is suitable for showing the correlation between uncertainty and other performance indicators.
[0016] The present invention provides a deep learning uncertainty measurement system based on a Bayesian segmentation network, which has the following beneficial effects: the present invention models the uncertainty of the intelligent model in the form of a convolutional encoder-decoder, and obtains the uncertainty of the prediction output of each category by calculating the variance of the softmax sample. In decision-making scenarios that require high trust, the uncertainty information provided by the system can be used as an important reference to help make more reliable choices, especially in tasks such as semantic segmentation. It can more accurately identify target boundaries in images and improve segmentation accuracy. It can also improve the credibility and interpretability of intelligent models, optimize model training and deployment, and enhance the robustness and stability of intelligent models, providing a strong guarantee for the reliability and security of intelligent software. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] Figure 1 It is a flow chart of the deep learning uncertainty measurement system based on the Bayesian segmentation network of the present invention; Figure 2 This is a framework diagram of the deep learning uncertainty measurement system based on the Bayesian segmentation network of the present invention. DETAILED DESCRIPTION
[0018] The following embodiments of the present invention are described in further detail in conjunction with the accompanying drawings and examples. The following examples are used to illustrate the present invention, but are not intended to limit the scope of the present invention.
[0019] like Figure 1-Figure 2 As shown in FIG. 1 , a deep learning uncertainty measurement system based on a Bayesian segmentation network includes step 1, a data input module, and a deep learning model to be tested and a test data set (i.e., a set of images to be segmented).
[0020] (1) Deep learning model to be tested Type: Deep learning models, especially those designed for image segmentation tasks.
[0021] Function: The model has been trained to receive image input and output the corresponding segmentation result. The segmentation result is usually a matrix (or tensor) of the same size as the input image, where each element represents the category label of the pixel at the corresponding position in the input image.
[0022] Format: The model can be pre-trained or user-defined and trained. It usually exists in the form of a model object in a deep learning framework (such as TensorFlow, PyTorch, etc.) and contains all weights and parameters.
[0023] (2) Test Dataset Type: A collection of images used to evaluate the performance of the deep learning model under test.
[0024] Content: The test dataset contains a series of images to be segmented, but should not contain images that have appeared in the training set. The images in the test dataset should cover all categories that the model needs to segment and may contain some challenging situations (such as occlusion, lighting changes, complex background, etc.).
[0025] Format: The test dataset is provided in the form of a folder, a list of image files, or an image dataloader. Each image file should contain image data and possible metadata (such as file name, image size, category label, etc.). Image data can be raw pixel values, pre-processed pixel values (such as normalization, enhancement, etc.), or any other form suitable for model input.
[0026] (3) Input processing Before passing the input to the module, some preprocessing steps are required to ensure that the input meets the model's requirements. You may need to resize the image to match the model's input size, convert the image to the format required by the model (such as RGB to grayscale), or apply data augmentation techniques to improve the model's generalization ability.
[0027] Step 2: Convolutional encoder-decoder module. This module models the uncertainty of the intelligent model under test through the convolutional encoder-decoder method, performs distributed inference on the weights of the model under test, and provides a probabilistic explanation for the model under test, thereby providing a basis for uncertainty analysis of the predicted output of the model under test.
[0028] like Figure 2 As shown in the figure, the encoder of this module is based on 13 convolutional layers of the VGG-16 neural network, including convolutional layers, pooling layers, RELU function layers, etc., while the decoder arranges these layers in the opposite order. The encoder unit contains one or more convolutional layers followed by a maximum pooling layer. The decoder unit contains one or more convolutional layers followed by an upsampling layer. Bayesian encoder dropout is used after each encoder unit, Bayesian decoder dropout is used after each decoder unit, Bayesian encoder-decoder dropout is used after each encoder and decoder unit, and Bayesian center dropout is used after the deepest encoder and before the decoder stage. The probability output is obtained from the Monte Carlo samples of the model by applying dropout at test time, and the variance of these softmax samples is used as the model uncertainty for each category in the subsequent steps.
[0029] In the lower layers of the convolutional network, features such as edges and corners are extracted. Applying Bayesian weights on these layers does not lead to better performance because these low-level features are consistent in the model distribution, so they are more suitable for modeling with deterministic weights. However, higher-level features formed in deeper layers (such as shape and contextual relationships) are more suitable for modeling with Bayesian weights.
[0030] Specifically, this module will first build a Bayesian semantic segmentation model. When using the Bayesian semantic segmentation model for probabilistic segmentation, based on the given training data X and label Y, and convolution weight W, its posterior distribution is obtained.
[0031] p(W│X,Y)
[0032] During the model construction process, the Monte Carlo dropout technique is used to train the model, and the posterior distribution on the weights is sampled by dropout during testing to obtain the posterior distribution of the softmax category probability. Specifically, dropout is used during training to sparsely model the neural network for regularization. The distribution q(W) on the model weights is obtained by minimizing the Kullback-Leibler (KL) divergence between the approximate distribution and the complete posterior distribution. KL(q(W)││p(W│X,Y)) For each convolutional layer i, its unit is , for all units j, its approximate variational distribution q(W) is defined by a Bernoulli distribution random variable and a variational parameter: Bernoulli (pi), if each layer has infinite units, the approximate model will be close to the Gaussian process, and the dropout probability pi will be fixed to the baseline probability of 50%, that is, pi=0.5.
[0033] Step 3, Uncertainty Analysis Module: The uncertainty measure of the model under test is derived from the probability output of the encoder-decoder, which is obtained from the Monte Carlo samples of the model by applying dropout at test time, that is, the variance of these softmax samples is used as the model uncertainty for each category.
[0034] Specifically, at test time, we sample the posterior distribution on the weights via dropout to obtain the posterior distribution of the softmax class probabilities. We take the mean of these sampled values to make segmentation predictions and use the variance to output the model uncertainty for each class. We take the mean of the variance measurements for each class as the overall measure of model uncertainty.
[0035] These samples provide us with rich information. We first take their mean as the basis for segmentation prediction. Then we calculate the variance of these samples and regard it as an important indicator to measure the uncertainty of each category model. The size of the variance intuitively reflects the degree of uncertainty of the model when predicting the category: the larger the variance, the more unstable the model's prediction on the category and the higher the uncertainty; conversely, the smaller the variance, the more stable the prediction and the lower the uncertainty.
[0036] Step 4: Result visualization module. This module is a component specially designed to display the uncertainty analysis results of the model to be tested in an intuitive and easy-to-understand chart form. The core function of this module is to convert complex data analysis results into clear visual presentation, so as to help quickly grasp the key indicators and potential problems of model performance.
[0037] Specifically, when the model to be tested is run on the test data set, a series of analysis results about the model uncertainty will be generated. These results may include but are not limited to: the distribution of uncertainty of the model for different categories of predictions, the trend of uncertainty changes with image features (such as lighting conditions, object occlusion, etc.), and the uncertainty performance of the model in scenes or categories, such as whether the segmentation prediction is smooth and whether the segmentation around the object boundary is clear. In addition, when the model predicts an incorrect label, the uncertainty classification will be highlighted.
[0038] The result visualization module receives these analysis results as input and converts them into visual output using chart drawing technology. These charts include bar charts, line charts, scatter plots, and heat maps, each of which is suitable for displaying different types of analysis results. Bar charts can be used to display the average or median of the uncertainty of the model for different categories of predictions; line charts can be used to display the trend of uncertainty with a continuous variable (such as image brightness); scatter plots are suitable for displaying the correlation between uncertainty and other performance indicators (such as classification accuracy).
[0039] The embodiments of the present invention are given for the purpose of illustration and description, and are not intended to be exhaustive or to limit the invention to the disclosed forms. Many modifications and variations will be apparent to those of ordinary skill in the art. The embodiments are selected and described in order to better illustrate the principles and practical applications of the present invention and to enable those of ordinary skill in the art to understand the present invention and thereby design various embodiments with various modifications suitable for specific uses.
Claims
1. A deep learning uncertainty measurement system based on Bayesian segmentation network, characterized by: Step 1, data input module: input the deep learning model to be tested and the test data set: (1) Deep learning model to be tested Type: Deep learning model, designed for image segmentation tasks; Function: The model is trained to receive image input and output the corresponding segmentation result, which is a matrix of the same size as the input image, where each element represents the category label of the pixel at the corresponding position in the input image; Format: exists in the form of a model object in the deep learning framework and contains all weights and parameters; (2) Test Dataset Type: A collection of images used to evaluate the performance of the deep learning model under test. Content: The test dataset contains a series of images to be segmented, but should not contain images that have appeared in the training set. The images in the test dataset should cover all categories that the model needs to segment and include some challenging situations. Format: The test dataset is provided in the form of a folder, a list of image files, or an image data loader. Each image file should contain image data and possible metadata. The image data is raw pixel values, preprocessed pixel values, or any other form suitable for model input. (3) Input processing Before passing the input to the module, a preprocessing step is required to ensure that the input meets the model's requirements. The image size needs to be resized to match the model's input size, the image needs to be converted to the format required by the model, or data augmentation techniques need to be applied to improve the model's generalization ability. Step 2, convolutional encoder-decoder module: This module models the uncertainty of the intelligent model under test through the convolutional encoder-decoder method, performs distributed inference on the weights of the model under test, and provides a probabilistic interpretation for the model under test, thereby providing a basis for uncertainty analysis of the predicted output of the model under test; The modular encoder is based on 13 convolutional layers of the VGG-16 neural network, including convolutional layers, pooling layers, and RELU function layers. The decoder arranges these layers in reverse order. The encoder unit contains one or more convolutional layers followed by a maximum pooling layer, and the decoder unit contains one or more convolutional layers followed by an upsampling layer. Bayesian encoder dropout is used after each encoder unit, Bayesian decoder dropout is used after each decoder unit, Bayesian encoder-decoder dropout is used after each encoder and decoder unit, and Bayesian center dropout is used after the deepest encoder and before the decoder stage. The probability output is obtained from the Monte Carlo sample of the model by applying dropout at test time. The variance of these softmax samples is used as the model uncertainty for each category in subsequent steps; In the lower layers of the convolutional network, features are extracted. Applying Bayesian weights on these layers does not lead to better performance. Low-level features are consistent in the model distribution and are suitable for modeling with deterministic weights. However, higher-level features formed in deeper layers are more suitable for modeling with Bayesian weights. Step 3, uncertainty analysis module, the uncertainty measure of the model under test comes from the probability output of the encoder-decoder, which is obtained from the Monte Carlo samples of the model by applying dropout at test time, that is, the variance of these softmax samples is used as the model uncertainty of each category; Step 4: Result visualization module. This module is used to present the uncertainty analysis results of the model to be tested in an intuitive and easy-to-understand chart format. The core function of this module is to transform complex data analysis results into clear visual presentations, helping to quickly grasp the key indicators and potential problems of model performance. The result visualization module receives these analysis results as input and converts them into visual output using chart drawing technology. The charts include bar charts, line charts, scatter plots, and heat maps. Each type is suitable for displaying different types of analysis results.
2. The deep learning uncertainty measurement system based on Bayesian segmentation network according to claim 1, characterized in that: In step 2, the module will first build a Bayesian semantic segmentation model. When using the Bayesian semantic segmentation model for probabilistic segmentation, its posterior distribution is obtained based on the given training data X and label Y, and convolution weight W.
3. A system for the deep learning uncertainty measurement system based on Bayesian segmentation network according to claim 2, characterized in that: During the model construction process, the Monte Carlo dropout technique is used to train the model, and the posterior distribution on the weights is sampled by dropout during testing to obtain the posterior distribution of the softmax category probability.
4. The system of the deep learning uncertainty measurement system based on the Bayesian segmentation network according to claim 3, characterized in that: Dropout is used during training to model the sparseness of the neural network for regularization, by minimizing the Kullback-Leibler (KL) divergence between the approximate distribution and the full posterior distribution to obtain the distribution q(W) over the model weights. KL(q(W)││p(W│X,Y)) For each convolutional layer i, its unit is , for all units j, its approximate variational distribution q(W) is defined by a Bernoulli distribution random variable and a variational parameter: Bernoulli (pi), if each layer has infinite units, the approximate model will be close to a Gaussian process, and the dropout probability pi will be fixed to the baseline probability of 50%, that is, pi=0.
5.
5. The system of the deep learning uncertainty measurement system based on the Bayesian segmentation network according to claim 4, characterized in that: In step 3, during testing, we sample the posterior distribution on the weights through dropout to obtain the posterior distribution of the softmax category probabilities. We take the mean of these sampled values to make segmentation predictions and use the variance to output the model uncertainty for each category. The mean of the variance measurements for each category is used as the overall measure of model uncertainty.
6. The system of the deep learning uncertainty measurement system based on the Bayesian segmentation network according to claim 5, characterized in that: In step 4, when the model to be tested is run on the test data set, a series of analysis results on model uncertainty will be generated, including but not limited to: the uncertainty distribution of the model for different categories of predictions, the trend of uncertainty changing with image features, and the uncertainty performance of the model in different scenarios or categories.
7. The system of the deep learning uncertainty measurement system based on Bayesian segmentation network according to claim 6, characterized in that: The uncertainty in step 4 includes whether the segmentation prediction is smooth, whether the segmentation around the object boundary is clear, and when the model predicts an incorrect label, the uncertainty classification will be highlighted.
8. The system of the deep learning uncertainty measurement system based on Bayesian segmentation network according to claim 7, characterized in that: In step 4, the bar chart is used to show the mean or median of the model's uncertainty for different categories of predictions; the line chart is used to show the trend of uncertainty changing with a continuous variable; and the scatter plot is suitable for showing the correlation between uncertainty and other performance indicators.
Citation Information
Patent Citations
Satellite anomaly detection method based on Bayesian neural network
CN110751199A
Uncertainty estimation method of remote sensing image building recognition model
CN113326759A
Gastric cancer pathological section image segmentation prediction method based on OfficientNet
CN114862763A
Semantic segmentation and depth prediction method based on Bayesian depth multi-task learning
CN114913328A
Cited By
Distribution line hidden danger diagnosis system and method fusing visible light and infrared images
CN120598943A
Training method and application of variation data uncertainty analysis model of weak asymmetric visual stimulation
CN120687763A
Training method and application of variation data uncertainty analysis model of weak asymmetric visual stimulation
CN120687763B
Double-branch deep neural network uncertainty evaluation method
CN121388517A