Evidence deep learning method based on double-layer dynamic uncertainty calibration of meta-strategy
By introducing a two-layer optimized architecture for evidence-based deep learning, and using a state-aware policy network to dynamically adjust hyperparameters, the static setting problem of existing evidence-based deep learning methods in high-risk scenarios is solved, thereby improving the reliability and security of the model in complex tasks.
Patent Information
- Application Number
- CN202511554984.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-10-29
- Publication Date
- 2026-01-27
- Estimated Expiration
- 2045-10-29
AI Technical Summary
Existing evidence-based deep learning methods suffer from problems such as static hyperparameter settings, insufficient generalization ability, high parameter tuning costs, and insufficient uncertainty quality in high-risk scenarios, resulting in insufficient predictive reliability of the model in complex tasks.
A two-layer dynamic uncertainty calibration method based on meta-policy is adopted. The inner layer uses an evidence-based deep learning model for learning, while the outer layer introduces a state-aware policy network to monitor the training dynamics in real time and adaptively generate dynamic loss function configuration parameters. By periodically evaluating model performance and optimizing the policy network, closed-loop adaptive control of uncertainty calibration is achieved.
It effectively improves the reliability and security of the model in complex scenarios, can flexibly balance prediction accuracy and uncertainty quality, and enhances the application value of the model in high-risk scenarios.
Smart Images

Figure CN121031725B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of artificial intelligence and uncertainty quantification technology, specifically relating to an evidence-based deep learning method for two-layer dynamic uncertainty calibration based on meta-policy. It is particularly suitable for improving model reliability and adjusting dynamic uncertainty in high-risk scenarios. This invention can be widely applied to fields requiring high-confidence prediction, such as medical image segmentation, autonomous driving, and industrial inspection. Background Technology
[0002] With the rapid development of artificial intelligence technology, deep learning models have been widely used in high-risk fields such as medical diagnosis, autonomous driving, and financial risk control. However, in these practical applications, the reliability and security of model predictions have become critical issues. In addition to pursuing higher prediction accuracy, accurately assessing the model's confidence in its own predictions—that is, uncertainty quantification (UQ)—has also become crucial.
[0003] Effective uncertainty quantification not only enhances model interpretability, helping developers and users understand the basis of model decisions, but also provides strong support for risk avoidance and decision-making, thus laying the foundation for the overall safety of the system and the credibility of decisions. Particularly in medical diagnosis, uncertainty quantification can help doctors assess the reliability of AI-assisted diagnostic results; in autonomous driving, it can provide risk warnings to the system, thereby avoiding potential accidents.
[0004] Currently, mainstream methods for uncertainty quantification include Bayesian deep learning, ensemble learning, and Monte Carlo Dropout. For example, Bayesian deep learning estimates uncertainty by probabilistically modeling model parameters, but its computational cost is extremely high, making it difficult to meet the needs of practical applications. Monte Carlo Dropout approximates uncertainty by performing inference through multiple random samplings, but it also suffers from low inference efficiency. Furthermore, these methods exhibit insufficient adaptability when facing complex scenarios such as distribution drift, task transfer, or long-tailed distributions.
[0005] In recent years, Evidential Deep Learning (EDL) has attracted widespread attention as an efficient method for uncertainty quantification. EDL models the class prediction probability by introducing a Dirichlet distribution, enabling the model to simultaneously output the classification result and the corresponding uncertainty estimate in a single forward propagation. This method significantly improves inference efficiency and demonstrates good performance on multiple tasks. However, existing Evidential Deep Learning methods still have the following shortcomings:
[0006] 1. Static Hyperparameter Setting Issues: Existing EDL methods typically rely on static hyperparameter settings, such as KL regularization coefficients and Dirichlet prior parameters. The optimal values of these hyperparameters are highly dependent on dataset characteristics, task nature, and the training phase, making dynamic adjustment difficult in complex tasks. Static settings can easily lead to model uncertainty estimates that do not match reality, affecting model reliability.
[0007] 2. Insufficient generalization ability: In scenarios such as distribution drift or task migration, the static regularization configuration of existing methods cannot adapt to the dynamic changes in data distribution, resulting in a decrease in the model's uncertainty quantification ability, which further affects the prediction accuracy and risk identification ability.
[0008] 3. High hyperparameter tuning cost: Existing methods require extensive manual tuning to determine hyperparameter values in practical applications. This trial-and-error tuning process is not only time-consuming and labor-intensive, but also places high demands on the user's professional knowledge, increasing the difficulty of model deployment.
[0009] 4. Insufficient Uncertainty Quality: Traditional EDL methods often fail to simultaneously consider classification accuracy and uncertainty calibration when quantifying uncertainty, resulting in insufficient prediction reliability in high-risk scenarios. For example, in medical image segmentation tasks, the model may not accurately estimate the uncertainty of boundary regions, thus affecting the final segmentation result. Summary of the Invention
[0010] This invention discloses an evidence-based deep learning method for high-risk decision-making tasks, employing a meta-policy-based two-layer dynamic uncertainty calibration approach. The invention proposes an innovative two-layer optimization framework: the inner layer uses an evidence-based deep learning model to learn the target task (e.g., segmentation, classification) and explicitly models the uncertainty of category prediction based on a Dirichlet distribution; the outer layer introduces a state-aware policy network that monitors the training dynamics of the inner layer model in real time and adaptively generates dynamic loss function configuration parameters to guide the training of the inner layer model, specifically including the weight coefficients of the KL divergence regularization term. and the parameters of the Dirichlet prior distribution By periodically evaluating the model's overall performance on the validation set (including accuracy, calibration error, misclassification uncertainty, etc.) and converting the evaluation results into reward signals to optimize the outer policy network, this invention achieves closed-loop adaptive control of the uncertainty calibration process. This dynamic adjustment mechanism enables the model to flexibly balance prediction accuracy and uncertainty quality based on real-time feedback, effectively improving the model's reliability and safety in complex scenarios.
[0011] Specifically, the steps include the following:
[0012] Obtain training samples and their corresponding labels. The training samples can be images, text, or other structured data, and the labels can be category annotations or pixel-level annotations. This dataset is denoted as [dataset name missing]. , where N is the total number of samples. Each sample Typically high-dimensional tensors (such as those in medical imaging) Training samples can be obtained through public datasets, actual business data collection, or data synthesis. Label information must be consistent with the task objective. Samples can undergo preprocessing operations such as normalization, augmentation, and pruning before being input into the model to ensure data quality and consistency with model input.
[0013] Based on the training samples and corresponding labels, an evidence deep learning model is trained. This evidence deep learning model is a neural network structure capable of outputting evidence vectors through forward propagation. The evidence vector, after being incremented by 1, serves as the Dirichlet distribution parameter, i.e. :
[0014]
[0015] in, is the Dirichlet distribution parameter for the i-th sample, with all components being positive. The Dirichlet distribution is used to model the predicted probability and uncertainty of each category, effectively reflecting the strength of evidence and confidence interval of the model's predictions for each category.
[0016] The core approach involves selecting an evidence-based deep learning backbone network. This employs a deep neural network structure (parameter set w), such as mature segmentation architectures like U-Net and DeepLabV3+. Taking U-Net as an example, it includes a symmetrical encoder (convolution, activation, pooling to extract high-level features) and a decoder (upsampling, convolution, activation to restore resolution), fusing multi-scale features through skip connections.
[0017] More specifically, the encoder gradually reduces spatial resolution and increases the number of channels through convolutional blocks and pooling layers to extract hierarchical semantic features.
[0018] Accordingly, the decoder restores spatial resolution through upsampling and convolutional blocks, and fuses features from the corresponding level of the encoder to preserve details.
[0019] Finally, the output layer (usually a 1x1 convolution) adjusts the number of feature map channels to C, directly outputting the raw evidence value without using softmax, followed by a non-negative activation function. The model input is x∈X^', and the output is a pixel-level evidence vector. .
[0020] Then, a state-aware policy network is constructed. This policy network is a multilayer perceptron structure, and its input is a training state vector. The training state vector includes at least one of the following: current batch accuracy, average evidence, loss value, training epochs, historical KL regularization coefficients, and validation set accuracy. By perceiving dynamic information during the training process, the policy network outputs dynamic KL regularization coefficients. and category-adaptive Dirichlet prior parameters This is used to configure the training loss function. Further, the KL regularization coefficients output by the policy network... Mapped to a preset interval using the Sigmoid function. The prior parameters Mapping to the interval by adding a constant 1 to the Sigmoid function. This ensures the numerical validity and stability of the prior parameters. Through this policy network, fine-grained dynamic adjustment of the model's ability to model uncertainty can be achieved.
[0021] Specifically, the policy network (parameter set) The structure is clearly designed as follows:
[0022] Receive training state vectors of dimension K As input, the number of nodes in this layer is equal to the dimension K of the state vector, and its function is to receive real-time state information that has been normalized or standardized.
[0023] Specifically, the policy network contains two fully connected (FC) hidden layers to learn and extract meaningful feature representations from the state vector for subsequent decision-making.
[0024] The first hidden layer linearly transforms the K-dimensional input vector into a 128-dimensional intermediate representation. Specifically, this is done through a weight matrix. and bias vector Perform affine transformation
[0025]
[0026] Subsequently, Each element is applied a nonlinear activation function, the modified linear unit (ReLU).
[0027]
[0028] Or its variants such as LeakyReLU or GELU. The introduction of activation functions enables policy networks to learn complex nonlinear dependencies between state vectors and output parameters. The output is a 128-dimensional activation vector. .
[0029] Second hidden layer: The 128-dimensional activation vector output from the first hidden layer. This is further transformed into a 64-dimensional representation. Similarly, through the weight matrix... and bias vector Perform affine transformation
[0030]
[0031] Then apply the same nonlinear activation function. This yields the final 64-dimensional hidden state representation. These two hidden layers gradually refine the state information, forming a more abstract internal representation of the current training state that is more suitable for generating control parameters.
[0032] Finally, from 64 dimensions Two independent output heads are introduced, each generating a control parameter:
[0033] KL regularization coefficient ( Output header: through a fully connected layer (weights) bias Hiding the 64-dimensional representation Mapped to a single scalar value:
[0034]
[0035] Input the scalar value into the Sigmoid activation function
[0036]
[0037] The values are smoothly compressed to the open interval (0,1). The final output result is... It is directly used as the weight of the KL divergence term, and the regularization strength is dynamically adjusted.
[0038] Through another separate fully connected layer (weight) bias Hiding the 64-dimensional representation Mapped to an O-dimensional vector
[0039]
[0040] The vector is first passed through the Sigmoid function, then incremented by 1 to ensure the output... Each component is greater than or equal to 1 (falling on...) (Interval). This provides efficient and dynamically adjustable prior distribution parameters for KL divergence, which, if in vector form, allow the policy network to set different priors for different classes based on the state;
[0041] The evidence deep learning model updates its parameters based on a dynamic loss function. The dynamic loss function L includes a cross-entropy loss term and a KL regularization term based on the dynamic KL regularization coefficient and the class-adaptive Dirichlet prior parameters, specifically defined as follows:
[0042]
[0043] in, For cross-entropy loss, For model prediction, For real labels, The dynamic KL regularization coefficients output by the policy network are... The Dirichlet parameters output by the model. The class-adaptive Dirichlet prior parameters output by the policy network are given.
[0044] Furthermore, the KL divergence between the Dirichlet distributions The calculation formula is:
[0045]
[0046]
[0047] in For the Gamma function, Here, is the Digamma function, and C is the total number of classes. The weights and prior parameters in the loss function are dynamically generated by the policy network, thus enabling adaptive adjustment during the main model training process.
[0048] At its core, a two-tiered optimization process is implemented. This includes:
[0049] Inner loop optimization: fixed , , Gradient descent methods (such as Adam and SGD) are used to update the main model parameters based on the loss L. The goal is to optimize the main model under the current strategy.
[0050] Outer loop optimization: Periodically (e.g., after each epoch), optimize the policy network parameters based on the reward signal R obtained from the validation set (see S5). The goal is to adjust the policy network to generate better... , The sequence guides the main model to achieve better final performance.
[0051] More specifically, the main model parameters use the Adam optimizer with a learning rate of [missing information]. Gradient descent optimization is performed. After each round of main model parameter update, the outer loop updates the policy network parameters based on the reward signal R. The learning rate of the policy network optimizer is... Simultaneously, gradient clipping and stability control are applied. In the inner and outer layer optimization, norm clipping or value clipping is applied to the gradient to prevent gradient explosion / vanishing and ensure the stability and convergence of the training process.
[0052] The classification accuracy, expected calibration error, and misclassification uncertainty error of the model on the validation set are periodically evaluated. The evaluation results are input as a reward signal into the policy network to optimize its parameters. The reward signal R is defined as:
[0053]
[0054] in, This represents the change in accuracy. The expected change in calibration error. This represents the change in error due to misclassification uncertainty. , where is the weight coefficient. This reward R is used to drive the outer layer optimization in the two-layer optimization framework described in S4, specifically by updating the policy network parameters through the policy gradient method. .
[0055] More specifically, its goal is to maximize the expected cumulative reward:
[0056]
[0057] in It represents a training segment (such as an epoch or several batches). This is the total reward for this segment (based on the periodically calculated reward R). The policy parameters are updated following the gradient ascent direction:
[0058]
[0059] Where gradient The gradient is typically estimated using Monte Carlo sampling and can be approximated as:
[0060]
[0061] in Is the policy network in state The action to be taken (the output parameters). It is the probability of that action. It is the accumulated (discounted) reward starting from time step t. To further improve training stability and policy performance, a baseline is introduced to reduce the variance of gradient estimation, and a delayed update mechanism is adopted so that the update of the policy network does not depend entirely on the instantaneous reward signal, but considers the longer-term effects.
[0062] Specifically, the expected calibration error (ECE) is used to measure the deviation between the model's output probability and the true accuracy, and is calculated using the following formula:
[0063]
[0064] in, Let n be the sample set for the m-th confidence interval, and n be the total number of samples. This represents the accuracy of the samples within the interval. This represents the average confidence level of the samples within the interval.
[0065] The misclassification uncertainty error (MUE) is used to measure the uncertainty distribution of the model for misclassified samples, and is calculated using the following formula:
[0066]
[0067] in, To correctly classify the sample set, For the misclassified sample set, Let represent the uncertainty of the i-th sample. For uncertainty threshold, This serves as the indicator function. Through the joint feedback of the above multi-dimensional indicators, the policy network can more comprehensively perceive the model performance and uncertainty, and thus adaptively adjust the regularization strategy.
[0068] Finally, the test samples are input into the trained evidence deep learning model, which outputs a class prediction and an uncertainty estimate. The model dynamically outputs the class probability and the corresponding uncertainty quantification result based on the optimal strategy learned during training. For each test sample, the evidence vector output by the model is first calculated. Thus, the Dirichlet distribution parameters are obtained:
[0069]
[0070] Expectation tensor of class probabilities The calculation formula is:
[0071]
[0072] in, C represents the total number of categories. The formula for calculating the segmentation evidence uncertainty test is:
[0073]
[0074] Where C represents the total number of categories. This is the sum of the parameters of the Dirichlet distribution. Finally, let the class with the highest probability be the predicted class, i.e.
[0075]
[0076] The model not only outputs high-precision prediction results, but also provides a corresponding uncertainty measure for each prediction result, which facilitates risk control, sample rejection and decision support in practical applications.
[0077] Furthermore, the method of this invention is applicable to high-risk task scenarios such as medical image segmentation, out-of-distribution detection, multi-task learning, and long-tail distribution recognition, and can be widely applied in fields such as medical diagnosis, autonomous driving, and financial risk control. For medical image segmentation tasks, the model can output the category probability and uncertainty of each pixel, effectively assisting clinical decision-making. For out-of-distribution detection and long-tail distribution recognition, the dynamic regularization mechanism can improve the model's ability to identify rare categories and the risk identification ability of abnormal samples. The method can also be extended to multi-task learning scenarios, and the policy network can adaptively adjust the regularization weights and prior parameters for different tasks or category distributions, possessing good versatility and practical application value.
[0078] In summary, this invention discloses an evidence-based deep learning method for dynamic uncertainty calibration based on a meta-policy, belonging to the fields of deep learning and uncertainty quantification, aiming to improve the reliability of model predictions and the quality of uncertainty quantification. This method employs a two-layer optimization architecture: the inner layer optimizes an evidence-based deep learning model to perform pixel-level segmentation tasks and estimate uncertainty; the outer layer optimizes a state-aware meta-policy network. The meta-policy network receives state information reflecting the training dynamics in real time and dynamically generates key hyperparameters for configuring the loss function of the inner layer model, specifically including the weight coefficients of the evidence regularization term (such as KL divergence) and the parameters of the prior distribution (such as Dirichlet distribution) used for this regularization term. The loss function of the inner layer model includes a data fitting term and a regularization term dynamically configured by the meta-policy network. By periodically evaluating the model's performance on the validation set in terms of prediction accuracy, calibration error, and misclassification uncertainty, a multi-objective reward signal is formed. This reward signal guides the optimization of the outer policy network, enabling it to learn and generate a better sequence of hyperparameters. This invention overcomes the limitations of traditional methods that rely on static settings by introducing a state-aware meta-strategy for dynamic adaptive adjustment of hyperparameters. It can better balance prediction accuracy and uncertainty calibration, and significantly improve the reliability and generalization ability of deep learning models in high-risk application scenarios (such as medical image analysis).
[0079] Specifically, the advantages of this invention are reflected in the following aspects:
[0080] (1) This invention realizes the dynamic adaptive adjustment of KL regularization coefficient and Dirichlet prior parameter, which can flexibly adjust the regularization strength and prior hypothesis according to the training state and data distribution changes, effectively improving the model's uncertainty modeling ability and generalization ability under different training stages and different data distributions.
[0081] (2) The multi-objective reward mechanism proposed in this invention can simultaneously take into account classification accuracy, calibration error and misclassification uncertainty, organically combining the practicality and safety of the model, and significantly improving the application value of the model in actual high-risk tasks.
[0082] (3) The strategy network structure adopted in this invention is lightweight, has a small number of parameters, low computational overhead, is easy to integrate into existing deep learning frameworks, has high deployment and inference efficiency, and is suitable for large-scale practical applications.
[0083] (4) By automatically adjusting the regularization parameters, this invention greatly reduces the cost of manual intervention and trial and error, and improves the efficiency of model deployment and the convenience of engineering implementation.
[0084] (5) The present invention has theoretical convergence guarantee, satisfies the sublinear regret bound of online convex optimization, and can ensure that the average performance during long-term training approaches the optimal static configuration, and has a good theoretical basis and engineering controllability. Attached Figure Description
[0085] The accompanying drawings, which are provided to further illustrate this application and form part of this application, illustrate exemplary embodiments of this application and are used to explain this application, but do not constitute an undue limitation of this application.
[0086] Figure 1 This is an overall structural diagram of the method of the present invention;
[0087] Figure 2 This is a flowchart of the model training process of the present invention;
[0088] Figure 3 This is a schematic diagram of the model structure of the strategy network of this invention;
[0089] Figure 4 This is a comparison diagram of the effects of the medical image segmentation method of this invention with other medical image segmentation methods;
[0090] Figure 5 This is a structural block diagram of a computer device according to an embodiment of the present invention. Detailed Implementation
[0091] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. The described embodiments are only a part of the embodiments of the present invention, and not all of them. Unless otherwise specified, the embodiments and features in the embodiments of this application can be combined with each other. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0092] like Figure 1 As shown, an evidence-based deep learning method based on meta-policy and two-layer dynamic uncertainty calibration is applied to medical image segmentation tasks, including the following steps:
[0093] S1. Obtain training samples and their corresponding labels. Specifically, the steps in S1 are as follows:
[0094] S11. The training samples are multidimensional tensor data from the medical image dataset, with a total of N training samples. Each training sample is represented in tensor form, denoted as . , where i is the sample index, ranging from 1 to N. The structure of each tensor is as follows: , Here, H represents the number of input channels, H represents the image height, and W represents the image width. The spatial resolution of all samples is unified to a predetermined standard through spatial resampling, and the number of channels is kept consistent through channel completion or cropping. For channels with missing data, zero-padding, mean-padding, or interpolation completion methods are used. All training samples should be collected from diverse sources (patients, devices, parameters, lesion features) to improve generalization ability and undergo necessary preprocessing such as denoising and artifact removal. Data is uniformly saved in a standard format (e.g., ...). , At the same time, a detailed metadata index must be established to record the source of each sample (such as hospital, research project), collection parameters (such as scan sequence, slice thickness, pixel spacing), patient anonymization information (such as age range, gender), and relevant clinical information (such as diagnosis results, if any), so as to facilitate subsequent data management and on-demand filtering.
[0095] S12. Specifically, each training sample is accompanied by a pixel-level label annotated by a corresponding expert (such as a radiologist), and the label is expressed as a two-dimensional tensor. The structure is as follows: Each pixel value corresponds to a category number, and the category number belongs to the category set. C represents the total number of categories. All labels, after one-hot encoding, are transformed into a three-dimensional tensor structure with dimensions [missing information]. The label data has undergone integrity verification, and missing labeled areas are masked off during subsequent loss function calculations.
[0096] S13. Simultaneously, preprocess the medical image samples. This step aims to standardize the input, increase diversity, and improve robustness. This preprocessing step specifically includes:
[0097] D1. Apply Norm methods such as max-min normalization, Z-score normalization, or instance normalization. ) Norm ( This operation unifies the pixel intensity range. For applications such as MRI, bias field correction may be required.
[0098] D2. Unify the isotropic / anisotropic voxel spacing by resampling (e.g., using linear or cubic spline interpolation), and then adjust the image to the fixed input size required by the network by cropping or padding (e.g., ...). or Label map resampling requires nearest neighbor interpolation.
[0099] D3. Application Operations include geometric transformations (random flipping, rotation, translation, scaling, elastic deformation) and intensity transformations (random noise, brightness / contrast adjustment, gamma correction, etc.). Geometric transformations must be applied synchronously to the label image. The final training sample set is .
[0100] S14. Finally, perform batch loading and efficient caching. The processed samples... and tags Organize by batch (batch size is determined by GPU memory and model). Use a high-performance data loader (such as PyTorch DataLoader) to optimize data provisioning with multi-process pre-fetching, memory / disk caching, and asynchronous data transfer (if supported) to maximize GPU utilization.
[0101] S2. Based on the training samples and corresponding labels, train an evidence deep learning model, and the model outputs an evidence vector. For example... Figure 2 As shown, specifically, S2 can be subdivided into the following contents:
[0102] S21. Constructing the evidence deep learning model structure. This is the core computational unit. First, select the backbone network. A deep neural network structure (parameter set) is adopted. Mature segmentation architectures such as U-Net and DeepLabV3+ are available. Taking U-Net as an example, it includes a symmetrical encoder (convolution, activation, pooling to extract high-level features) and a decoder (upsampling, convolution, activation to restore resolution), and fuses multi-scale features through skip connections.
[0103] D1. More specifically, the encoder gradually reduces spatial resolution and increases the number of channels through convolutional blocks and pooling layers to extract hierarchical semantic features.
[0104] D2. Accordingly, the decoder restores spatial resolution through upsampling and convolutional blocks, and fuses features from the corresponding level of the encoder to preserve details.
[0105] D3. Finally, the output layer (usually a 1x1 convolution) adjusts the number of feature map channels to C. C It directly outputs the raw evidence values without using softmax, followed by a non-negative activation function. Model input. Output pixel-level evidence vectors .
[0106] S22. Next, define the evidence vector. For each pixel... Model output 3D real vector Activation function via Softplus Ensure all evidence is weighted . Representative model for pixels Category The strength of supporting evidence.
[0107] S23. Next, the evidence vector is transformed into Dirichlet distribution parameters. The evidence vector... The parameters are converted to a Dirichlet distribution by adding 1. :
[0108]
[0109] Right now This guarantees all parameters It satisfies the Dirichlet distribution requirement and can be regarded as giving each category a basic prior belief.
[0110] S24. Then, define the Dirichlet distribution used to model the uncertainty. Each pixel Class probability vector Distribution by Dirichlet Modeling. Its probability density function is:
[0111]
[0112] in
[0113] ,
[0114] It is the normalization constant ( (This is a Gamma function). The expectation of this distribution is used as the predicted probability:
[0115]
[0116] At the same time, the uncertainty of the prediction can be obtained:
[0117]
[0118] in It is the Dirichlet intensity.
[0119] S25. Furthermore, the entire training process supports batch parallelization and GPU acceleration. Forward and backward propagation of the model is performed using GPU parallel computing and optimization libraries such as cuDNN. Multi-GPU data parallelism or model parallel training is supported, with automatic handling of gradient synchronization and parameter aggregation for efficient training of large-scale models and data.
[0120] S3. Construct a state-aware policy network as the outer layer of the two-layer optimization framework. This network dynamically adjusts the loss function configuration based on the training state. Specifically, such as... Figure 3 As shown, step S3 is as follows:
[0121] S31. First, define the training state vector. The policy network input is the state vector st, which is updated in real time. st ( A 3D real number array captures training dynamics. Its components may include: current batch performance (average accuracy, training loss), model output statistics (average evidence quantity), training progress (current epoch number), historical policies (historical mean of KL coefficients), validation set performance (validation set average accuracy), etc. State components need to be normalized or standardized before input.
[0122] S32. Next, design the specific structure and function of the policy network. This network aims to intelligently manage the real-time training state. This is transformed into dynamic configuration parameters for the loss function of the main model. This embodiment uses a multilayer perceptron (MLP) as the policy network (parameter set). Its structure is clearly designed as follows:
[0123] D1. The receiving dimension is Training state vector As input. The number of nodes in this layer is equal to the dimension of the state vector. Its function is to receive real-time status information from S31 that has been normalized or standardized.
[0124] D2. Specifically, the policy network contains two fully connected (FC) hidden layers to learn and extract meaningful feature representations from the state vector for subsequent decision-making.
[0125] D21. First Hidden Layer: [The rest of the text appears to be incomplete and requires further context.] The 128-dimensional input vector is linearly transformed into a 128-dimensional intermediate representation. Specifically, this is achieved through a weight matrix. and bias vector Perform affine transformation
[0126]
[0127] Subsequently, Each element is applied a nonlinear activation function, the modified linear unit (ReLU).
[0128]
[0129] Or its variants such as LeakyReLU or GELU. The introduction of activation functions enables policy networks to learn complex nonlinear dependencies between state vectors and output parameters. The output is a 128-dimensional activation vector. .
[0130] D22. Second hidden layer: The 128-dimensional activation vector output from the first hidden layer. This is further transformed into a 64-dimensional representation. Similarly, through the weight matrix... and bias vector Perform affine transformation
[0131]
[0132] Then apply the same nonlinear activation function. f This yields the final 64-dimensional hidden state representation. These two hidden layers gradually refine the state information, forming a more abstract internal representation of the current training state that is more suitable for generating control parameters.
[0133] D3. Finally, from 64 dimensions Two independent output heads are introduced, each generating a control parameter:
[0134] D31. KL regularization coefficient ( Output header: through a fully connected layer (weights) bias Hiding the 64-dimensional representation Mapped to a single scalar value:
[0135]
[0136] Input the scalar value into the Sigmoid activation function
[0137]
[0138] Smoothly compress the values to Within the open interval. Output the final result. It is directly used as the weight of the KL divergence term in S41, and the regularization strength is dynamically adjusted.
[0139] D32. Through another independent fully connected layer (weights) bias Hiding the 64-dimensional representation Mapped to a dimensional vector
[0140]
[0141] The vector is first passed through the Sigmoid function, then incremented by 1 to ensure the output... Each component is greater than or equal to 1 (falling on...) (Interval). This provides efficient and dynamically adjustable prior distribution parameters for KL divergence, which, if in vector form, allow the policy network to set different priors for different classes based on the state.
[0142] S33. Next, initialize and optimize the policy network parameters. Parameters Xavier initialization is used. The reward signal based on S5 is optimized. Use optimizers such as Adam (learning rate) Update in the outer loop Output smoothing (such as moving average) can be applied to enhance stability.
[0143] S4. Define the dynamic loss function Inner loop optimizes main model parameters. At this time, minimize the loss configured by the policy network. Specifically, step S4 is as follows:
[0144] S41. Specifically, define the dynamic loss function. Inner loop optimizes main model parameters. At that time, minimize the loss configured by the policy network:
[0145] D1. Among them, It uses standard pixel-level cross-entropy loss, and the model is used to predict probabilities. and real one-hot tags Calculations drive the model to fit the data.
[0146] D2. Furthermore, It is the model output posterior Dirichlet distribution. With the dynamic prior distribution provided by the policy network The KL divergence between them. This constraint on the model output improves uncertainty calibration.
[0147] D3. In addition, the weight of the KL term. and the parameters of the prior distribution Dynamically generated by the policy network, it allows prior beliefs and weights to change with training states and supports class adaptation.
[0148] S42. Further, calculate the KL divergence. The calculation involves the Gamma function. and Digamma function :
[0149]
[0150] This computation can be efficiently implemented within deep learning frameworks.
[0151] More specifically, the Gamma function for:
[0152]
[0153] Digamma function for:
[0154]
[0155] S43. At its core, a two-tier optimization process is executed. This includes:
[0156] D1. Inner loop optimization: fixed Gradient descent methods (such as Adam, SGD) are used based on loss. Update main model parameters : The goal is to optimize the main model under the current strategy.
[0157] D2. Outer Loop Optimization: Periodically (e.g., after each epoch), evaluate the reward signal obtained from the validation set. (See S5) Optimize strategy network parameters The goal is to adjust the policy network to generate better... The sequence guides the main model to achieve better final performance.
[0158] S44. More specifically, the main model parameters use the Adam optimizer with a learning rate of... Gradient descent optimization is performed. After each round of main model parameter update, the outer loop updates the policy network parameters based on the reward signal R. The learning rate of the policy network optimizer is... Simultaneously, gradient clipping and stability control are applied. In the inner and outer layer optimization, norm clipping or value clipping is applied to the gradient to prevent gradient explosion / vanishing and ensure the stability and convergence of the training process.
[0159] S5. Periodically evaluate the model's classification accuracy, expected calibration error, and misclassification uncertainty error on the validation set, and convert the evaluation results into reward signals to optimize the policy network. Specifically, the steps in S5 are as follows:
[0160] S51. Specifically, perform validation set evaluation. Periodically evaluate on the independent validation set. The current master model is evaluated. Performance, key performance indicators:
[0161] D1. Classification Accuracy (ACC) or Segmentation Metric (such as Dice coefficient, IoU): Measures how well the model's predictions match the true labels. Formula (using ACC as an example):
[0162]
[0163] in, To determine the number of samples in the validation set, The image height and width, For the model to sample Medium pixel Prediction categories, Label it with its true category. This is an indicator function.
[0164] D2. Expected Calibration Error (ECE): Measures the consistency between predicted confidence and actual accuracy. Confidence levels are binned ( (each box), calculate:
[0165]
[0166] in, For the first The prediction set of the box, For its size, Total predicted number ( ), For in-box accuracy, The average confidence level within the bin is given.
[0167] D3. Misclassification uncertainty error ( (): Measures the model's ability to distinguish between correct and incorrect predictions based on uncertainty metrics. (as defined in S63) and threshold calculate:
[0168]
[0169] in, These are sets of pixels classified as correct / incorrect. Its size. This metric aims to assess whether the model can assign high uncertainty to misclassified samples. This assigns low uncertainty to correctly classified samples. ).
[0170] S52. Next, define the reward signal. Reward signals are used to guide the policy network. Optimization is typically based on changes in validation set metrics ( ) or other combinations:
[0171]
[0172] Weight This reward is used to balance different optimization objectives (such as accuracy vs. calibration). This is used to drive the outer layer optimization in the two-layer optimization framework described in S4, specifically by updating the policy network parameters through the policy gradient method. .
[0173] More specifically, its goal is to maximize the expected cumulative reward:
[0174]
[0175] in It represents a training segment (such as an epoch or several batches). It is the total reward for that segment (based on periodically calculated rewards). The policy parameters are updated following the gradient ascent direction:
[0176]
[0177] Where gradient The gradient is typically estimated using Monte Carlo sampling and can be approximated as:
[0178]
[0179] here, Is the policy network in state The action to be taken (the output parameters). It is the probability of that action. From time step Initial cumulative (discounted) rewards. To further improve training stability and policy performance, a baseline is introduced to reduce the variance of gradient estimation, and a delayed update mechanism is adopted so that the policy network update does not depend entirely on the instantaneous reward signal, but considers the longer-term effects.
[0180] S6. Input the test samples into the trained evidence deep learning model, and output the category prediction and uncertainty estimate. Specifically, S6 can be further divided into the following:
[0181] S61. First, complete test medical images. Perform standard preprocessing, including applying intensity normalization and spatial scaling identical to those used in the training phase. Ensure that no random data augmentation is used at this stage. Subsequently, the entire preprocessed test image is fed into a pre-trained, fixed-parameter evidence-based deep learning model. In this process, the model performs one forward propagation to obtain the original evidence vector covering all pixels of the entire image. .
[0182] S62. Next, the evidence information is transformed into Dirichlet parameters. This involves converting the evidence vector output by the model for each pixel. By applying a unified transformation rule, the corresponding Dirichlet distribution parameters are calculated. The predicted Dirichlet parameters of all pixels are merged to generate a Dirichlet parameter field with the same size as the input image. .
[0183] S63. Subsequently, based on pixel-level Dirichlet parameters... Calculate the prediction probability and uncertainty for each pixel in the image. Using the formula
[0184]
[0185] (in ) Calculate which category it belongs to. The predicted probability. Simultaneously, using the formula...
[0186]
[0187] Calculate the evidence uncertainty for this pixel; this value reflects the model's confidence in the prediction based on the collected evidence.
[0188] S64. Finally, generate the final segmentation map and output the result. Based on the pixel-level predicted probabilities calculated in S63, select the one with the highest probability ( (Operation) Determine the final category assignment for each pixel: Thus, a complete segmentation prediction map is constructed. Compare this segmentation map with the uncertainty map obtained from simultaneous calculation. As the final output, it is usually saved in a standard medical image file format (such as NIfTI) and can be used for subsequent visualization analysis or quantitative assessment.
[0189] like Figure 4 As shown, the method of this invention can better capture complex boundary details and reduce the error between the segmentation result and the true value, especially in edge regions. Compared with other methods, the difference map generated by the method of this invention shows less segmentation error, indicating its higher prediction accuracy. Furthermore, the method of this invention also demonstrates stronger capabilities in predicting uncertainty metrics. The distribution of uncertainty regions not only highly matches the segmentation prediction results but also significantly reduces the gap with the true value. This indicates that the model of this invention can effectively identify high-risk regions in segmentation tasks. This capability is particularly important for organ boundary segmentation tasks in medical image analysis, as boundary regions are often key to diagnosis and treatment. The method of this invention also outperforms other methods in terms of the integrity and detail preservation of organ morphology. In contrast, other methods may exhibit damage or blurring in edge regions, while the method of this invention better preserves the true morphology of the organ.
[0190] In another aspect, the present invention also discloses a computer-readable storage medium storing a computer program, which, when executed by a processor, causes the processor to perform the steps of the method described above.
[0191] On the other hand, such as Figure 5 As shown, the present invention also discloses a computer device, including a memory and a processor, wherein the memory stores a computer program, and when the computer program is executed by the processor, the processor performs the steps of the method described above.
[0192] It is understood that the systems, devices, and storage media provided in the embodiments of the present invention correspond to the methods provided in the embodiments of the present invention, and the explanations, examples, and beneficial effects of the relevant content can be referred to the corresponding parts of the above methods.
[0193] In the above embodiments, implementation can be achieved entirely or partially through software, hardware, firmware, or any combination thereof. When implemented using software, it can be implemented entirely or partially as a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, all or part of the processes or functions described in the embodiments of this application are generated. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, the computer instructions can be transmitted from one website, computer, server, or data center to another website, computer, server, or data center via wired (e.g., coaxial cable, fiber optic, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that integrates one or more available media. The available medium can be a magnetic medium (e.g., floppy disk, hard disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium (e.g., solid state disk (SSD)).
[0194] It should be noted that, in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.
[0195] The various embodiments in this specification are described in a related manner. Similar or identical parts between embodiments can be referred to mutually. Each embodiment focuses on describing the differences from other embodiments. In particular, the system embodiments are basically similar to the method embodiments, so the description is relatively simple; relevant parts can be referred to the descriptions of the method embodiments.
[0196] The above embodiments are only used to illustrate the technical solutions of the present invention, and are not intended to limit it. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A deep learning method for evidence-based two-layer dynamic uncertainty calibration based on meta-policy, used for medical image analysis, characterized in that, Includes the following steps: S1. Acquire and preprocess medical image training samples and corresponding labels. The preprocessing includes intensity normalization, spatial size adjustment and data augmentation to form batch training data. S2. Construct and train an evidence deep learning model, taking the preprocessed training samples as input, outputting pixel-level evidence vectors, and converting the evidence vectors to Dirichlet distribution parameters by incrementing them by 1. Calculate the prediction probability based on the Dirichlet distribution and uncertainty ; S3. Based on step S2, construct a state-aware policy network, wherein the policy network uses a vector containing current training state information. As input, the dynamic output consists of hyperparameters used to configure the loss function of the evidence deep learning model, including the KL divergence coefficient. Dirichlet prior parameters ; S4. Based on step S3, define and use the loss function L, which is dynamically configured by the policy network, to perform inner-layer optimization on the evidence deep learning model. The loss function L includes features based on prediction probabilities. Data fitting terms calculated with labels And the KL divergence coefficient Weighted, measure model output posterior Dirichlet distribution With dynamic prior distribution KL divergence term of the difference between ; S5. Based on step S4, periodically evaluate the performance metrics of the evidence deep learning model on the validation set, including segmentation accuracy, expected calibration error (ECE), and misclassification uncertainty error (MUE). Calculate the reward signal R based on the changes in the performance metrics, and use the reward signal R to optimize the outer policy network through the policy gradient method. S6. Input the test sample into the evidence deep learning model trained in step S5, and output the prediction result and the corresponding uncertainty estimate. In step S3, the state vector It includes current batch performance, model output statistics, training progress information, historical strategy information, and validation set performance information; The policy network adopts a multilayer perceptron (MLP) structure, containing at least two hidden layers and two independent output heads; the first output head generates KL divergence coefficients through a sigmoid activation function. The second output header is activated by the Sigmoid function and then incremented by 1 to generate the Dirichlet prior parameters. To ensure the Dirichlet prior parameters Each component is greater than or equal to 1, and Dirichlet prior parameters are allowed. A category-specific vector form; The policy network specifically includes a K-dimensional input layer, a 128-dimensional first hidden layer using the ReLU activation function, a 64-dimensional second hidden layer using the ReLU activation function, and KL divergence coefficients derived from the second hidden layer. Dirichlet prior parameters The output header.
2. The evidence deep learning method based on meta-policy for two-layer dynamic uncertainty calibration according to claim 1, characterized in that, In step S1, the training samples obtained are medical image tensors containing metadata indexes, and the corresponding labels are pixel-level two-dimensional tensors annotated by experts, which are processed by one-hot encoding. The preprocessing specifically includes The operation involves intensity standardization, resampling, and cropping / filling operations to unify spatial dimensions, and... Data augmentation is performed by performing geometric and intensity transformations.
3. The evidence deep learning method based on meta-policy for two-layer dynamic uncertainty calibration according to claim 1, characterized in that, In step S2, the evidence deep learning model uses a deep neural network structure containing an encoder, decoder, and skip connections as the backbone network; the evidence vector output by the model... The Softplus activation function ensures non-negativity in the calculation of the corresponding Dirichlet distribution parameters. Dirichlet strength Used to calculate prediction probability and uncertainty : The Dirichlet distribution parameters for each category, This represents the total number of categories.
4. The evidence deep learning method for bilayer dynamic uncertainty calibration based on meta-policy as described in claim 1, characterized in that, In step S4, the data fitting term L CE The loss is pixel-level cross-entropy; the KL divergence The calculation involves the Gamma function. and Digamma function ; The inner layer optimization uses gradient descent to update the parameters of the evidence deep learning model. The outer optimization periodically updates the policy network parameters based on the reward signal R. This constitutes a two-timescale optimization framework.
5. The evidence deep learning method for bilayer dynamic uncertainty calibration based on meta-policy according to claim 1, characterized in that, In step S5, the reward signal R is defined as: in , , These represent the changes in segmentation accuracy, expected calibration error, and misclassification uncertainty error relative to the previous evaluation time point, respectively. and These are preset weighting coefficients.
6. The evidence deep learning method for bilayer dynamic uncertainty calibration based on meta-policy as described in claim 1 or 5, characterized in that, In step S5, the policy gradient method aims to maximize the expected cumulative reward. Its gradient Estimated through Monte Carlo sampling, with optional baseline inclusion. To reduce variance, the REINFORCE algorithm or its variants are used for parameter updates.
7. The evidence deep learning method for bilayer dynamic uncertainty calibration based on meta-policy according to claim 1, characterized in that, In step S6, the test samples undergo intensity normalization and spatial size adjustment preprocessing consistent with the training phase before being input into the model; based on the Dirichlet parameters output by the model... Calculate pixel-level prediction probability and uncertainty By analyzing the predicted probability application The operation generates the final segmentation image.
8. The evidence deep learning method for bilayer dynamic uncertainty calibration based on meta-policy according to claim 1, characterized in that, The Dirichlet prior parameters It is learnable and adaptive, dynamically generated by the policy network based on the current training state, rather than being fixed.
Citation Information
Patent Citations
Air-ground network optimization method and system based on MEC and digital twinning
CN119255263A
Trusted medical image segmentation method and equipment progressively guided by evidence uncertainty
CN119625319A