Source-linked AI summary

Predictive Uncertainty Estimation via Prior Networks

Andrey Malinin, Mark Gales

arXiv:1802.10501v4stat.MLcs.LG

TL;DR

Predictive uncertainty arises from model parameters, data complexity, and mismatch between training and test distributions, but existing methods can conflate these sources. The paper introduces Prior Networks, which explicitly model distributions over predictive distributions, and shows that they separate data from distributional uncertainty while improving OOD and misclassification detection.

  • Problem

    Existing uncertainty methods do not reliably distinguish model, data, and distributional uncertainty, despite the importance of their different sources for safety-critical predictions.

  • Method

    Prior Networks parameterize a prior distribution over predictive distributions; for classification, Dirichlet Prior Networks are trained toward sharp in-domain and flat out-of-domain targets.

  • Results

    Prior Networks distinguish data from distributional uncertainty and outperform previous methods on OOD sample identification and misclassification detection across MNIST and CIFAR-10.

  • Takeaways & Limitations

    Explicitly modeling distributional uncertainty provides a probabilistically interpretable way to treat it separately from data and model uncertainty.

  • Takeaways & Limitations

    Training requires out-of-domain samples, although the true out-of-domain distribution is unknown and must be approximated synthetically or with another dataset.

Abstract

from arXiv · show

Estimating how uncertain an AI system is in its predictions is important to improve the safety of such systems. Uncertainty in predictive can result from uncertainty in model parameters, irreducible data uncertainty and uncertainty due to distributional mismatch between the test and training data distributions. Different actions might be taken depending on the source of the uncertainty so it is important to be able to distinguish between them. Recently, baseline tasks and metrics have been defined and several practical methods to estimate uncertainty developed. These methods, however, attempt to model uncertainty due to distributional mismatch either implicitly through model uncertainty or as data uncertainty. This work proposes a new framework for modeling predictive uncertainty called Prior Networks (PNs) which explicitly models distributional uncertainty. PNs do this by parameterizing a prior distribution over predictive distributions. This work focuses on uncertainty for classification and evaluates PNs on the tasks of identifying out-of-distribution (OOD) samples and detecting misclassification on the MNIST dataset, where they are found to outperform previous methods. Experiments on synthetic and MNIST and CIFAR-10 data show that unlike previous non-Bayesian methods PNs are able to distinguish between data and distributional uncertainty.

1 Introduction

Predictive uncertainty matters for safety, but existing methods struggle to distinguish model, data, and distributional uncertainty. Prior Networks are proposed to model distributional uncertainty explicitly and outperform previous methods on classification benchmarks.

  • Neural networks often make over-confident predictions, making uncertainty estimates important for high-cost applications such as autonomous vehicles and medical decisions.
  • Bayesian approaches can be computationally demanding and depend on the chosen parameter prior and approximation.
  • Some non-Bayesian methods explicitly train models to produce high-entropy predictions for out-of-distribution inputs, improving test-time efficiency.
  • Predictive uncertainty has three sources: model uncertainty, irreducible data uncertainty, and distributional uncertainty from training–test mismatch.Model uncertainty can decrease with more data, whereas data uncertainty is irreducible and distributional uncertainty reflects unfamiliar test inputs.
  • Prior Networks explicitly separate distributional uncertainty from model and data uncertainty within a probabilistically interpretable framework.
  • Experiments show that Prior Networks distinguish data from distributional uncertainty and outperform previous methods on OOD detection and misclassification detection using MNIST and CIFAR-10.

2 Current Approaches to Uncertainty Estimation

Existing uncertainty methods represent predictive uncertainty through class posteriors or parameter ensembles, but their outputs can confound data and distributional uncertainty. Bayesian ensembles provide additional spread measures, although constructing them with desired properties is difficult and expensive.

  • Bayesian predictive uncertainty combines data uncertainty from class-label distributions with model uncertainty from parameter distributions.
  • Bayesian inference for neural networks is generally intractable and is approximated using methods such as Monte Carlo dropout, Langevin dynamics, or ensembling.
  • For inputs near training data, Bayesian ensembles aim to be concentrated on simplex corners; for distant inputs, they aim to become diverse across the simplex.
  • Entropy of the expected predictive distribution cannot by itself distinguish high data uncertainty from distributional uncertainty.Measures of ensemble spread, such as mutual information, are needed to assess model uncertainty and determine uncertainty sources.
  • For deep black-box networks, selecting priors and inference schemes that induce the desired distributions is difficult, and ensemble construction can be computationally expensive.
  • Non-Bayesian methods are easy to train and cheap at inference, but high-entropy class posteriors can reflect either difficult in-distribution inputs or out-of-distribution inputs.

3 Prior Networks

Prior Networks explicitly parameterize a distribution over predictive distributions so data, distributional, and model uncertainty can be represented separately. For classification, Dirichlet Prior Networks are trained toward sharp in-domain or flat out-of-domain distributions, using surrogate out-of-domain data when necessary.

  • Prior Networks explicitly parameterize p(µ|x*, θ), a distribution over categorical distributions on the simplex, rather than inducing it implicitly through model parameters.
  • Prior Networks target sharp corner-centered distributions for confident inputs, sharp center-focused distributions for noisy or overlapping data, and flat distributions for out-of-distribution inputs.
  • The framework assigns separate terms to data, distributional, and model uncertainty, with model uncertainty affecting distributional estimates and distributional uncertainty affecting data-uncertainty estimates.
  • Marginalizing the distribution over categorical probabilities loses whether it was sharp or flat, so the resulting predictive uncertainty cannot identify its source without ensemble-spread measures.
  • Dirichlet Prior Networks generate concentration parameters α, whose sum α_0 controls the sharpness of the Dirichlet distribution.
  • DPN training minimizes KL divergence to sharp in-domain Dirichlet targets and flat out-of-domain targets, using smoothed in-domain means to ease optimization.
  • The training objective requires out-of-domain samples, which are approximated using synthetic boundary points or a different real dataset because the true distribution is unknown.

4 Uncertainty Measures

The paper organizes predictive uncertainty measures by how the predictive distribution is marginalized, distinguishing total, model, data, and distributional uncertainty. Measures include maximum probability, entropy, mutual information, and differential entropy.

  • Uncertainty measures are grouped into four classes according to how the predictive-distribution decomposition is marginalized.The framework applies these measures to trained DNNs, DPNs, and Bayesian MC ensembles.
  • Maximum probability measures confidence in the predicted class using the expected predictive categorical distribution.It is also called the mode probability and is computed by taking the largest class probability.
  • Entropy measures uncertainty across the entire expected predictive distribution and behaves similarly to maximum probability.Maximum probability and entropy of the expected distribution measure total predictive uncertainty.
  • Mutual information between labels and model parameters measures uncertainty from model uncertainty while implicitly capturing distributional uncertainty.It equals total uncertainty minus expected data uncertainty for ensemble predictions.
  • Mutual information between labels and predictive distributions measures distributional uncertainty explicitly rather than model uncertainty.This measure is obtained by marginalizing out the model parameters.
  • Differential entropy of a DPN is maximized when its Dirichlet prior is flat and categorical distributions are equiprobable.It can indicate distributional uncertainty even when the expected categorical distribution has high entropy.

5 Experiments

Experiments evaluate DPNs against DNN and MC-dropout baselines for misclassification and OOD detection, including synthetic data and noisy MNIST. Across these settings, DPNs generally perform better and differential entropy is especially useful when data uncertainty is high.

  • Experimental setup: The experiments compare DPNs with DNNs and MC-dropout ensembles on synthetic data, MNIST, and CIFAR-10 uncertainty-detection tasks.The tasks are misclassification detection and out-of-distribution detection.
  • Synthetic experiment: Synthetic results show that predictive entropy and DPN differential entropy behave similarly for distinct classes but diverge when class overlap is large.With overlapping classes, entropy is high inside the data region, whereas differential entropy can distinguish in-domain from out-of-domain regions.
  • Misclassification detection: DPNs consistently outperform DNNs and MC-dropout ensembles for misclassification detection, with only a negligible accuracy decrease.Max probability performs best, followed closely by predictive entropy; the difference is more pronounced for AUPR.
  • OOD detection: DPNs consistently outperform baselines for OOD detection on MNIST and CIFAR-10, including the more similar TinyImageNet dataset.On MNIST, max probability, entropy, and differential entropy perfectly classify the evaluated samples.
  • Noisy-data experiment: Under strong input noise, entropy and mutual information fail to discriminate OOD samples, while differential-entropy performance barely declines.The noisy evaluation adds zero-mean isotropic Gaussian noise with σ = 3 during training and evaluation.

6 Conclusion

The conclusion presents Prior Networks as a framework that separates distributional uncertainty from data and model uncertainty. DPNs outperform established baselines on OOD and misclassification detection, while different uncertainty measures are suited to different tasks.

  • Conclusion: Prior Networks treat OOD inputs as a distinct source of distributional uncertainty within a probabilistically interpretable framework.Dirichlet Prior Networks apply this framework to classification.
  • Conclusion: DPNs yield more accurate distributional-uncertainty estimates than MC Dropout and standard DNNs for MNIST and CIFAR-10 OOD detection.They also outperform other methods on misclassification detection.
  • Conclusion: Max probability performs best for misclassification detection, whereas DPN differential entropy performs best for OOD detection when classes are less distinct.The conclusion links uncertainty measures to the types of uncertainty they assess.

Appendix A Experimental Setup and Datasets

The experiments use standard image datasets, additional OOD datasets, VGG-based networks, and dataset-specific training configurations. Additional experiments extend evaluation to SVHN and CIFAR-10.

  • Datasets: Models were trained on MNIST, SVHN, and CIFAR datasets, with OMNIGLOT, SEMEION, LSUN, and TinyImagenet used for OOD detection.Only test sets were used for the additional OOD datasets.
  • Preprocessing: Inputs were rescaled to -1.0 and 1.0; CIFAR-10 additionally used random flips, ±4-pixel shifts, and ±15-degree rotations.
  • Architectures: All experiments used VGG variants for image classification and TensorFlow implementations, with dropout applied differently to convolutional and fully connected layers.
  • Training: Training used NADAM, with exponentially decaying learning rates for MNIST and 1-Cycle learning rates for SVHN and CIFAR-10.
  • OOD-data synthesis: MNIST DPN OOD data were synthesized with factor analysis using a 50-dimensional latent space and increased latent variance.
  • Additional experiments: Further experiments evaluated MNIST models on additional OOD datasets and trained DPNs on SVHN and CIFAR-10 for misclassification and OOD detection.

B.1 Additional MNIST experiments

Additional MNIST experiments test OOD detection across datasets with varying similarity to MNIST. DPN performance is strongest on dissimilar data and weakest on the most similar dataset.

  • Results: DPN outperforms the baselines on SEMEION, SVHN, and CIFAR-10 OOD detection experiments.
  • Dataset similarity: OOD detection is hardest on SEMEION and easiest on CIFAR-10 as the datasets become less similar to MNIST.SEMEION contains greyscale handwritten digits, SVHN contains digits in street signs, and CIFAR-10 contains real objects.
  • Evaluation: AUPR is preferred over AUROC for the SEMEION experiment because its small size prevents a balanced MNIST-SEMEION set.

B.2 SVHN Experiments

SVHN experiments evaluate misclassification and OOD detection using CIFAR-10 as DPN noise data. DPN results vary by task, outperforming baselines on AUPR for misclassification and consistently leading OOD detection comparisons.

  • Setup: The SVHN DPN uses CIFAR-10 as its noise dataset rather than a generative model.
  • Misclassification detection: DPN misclassification detection outperforms baselines in AUPR but underperforms them in AUROC across all measures.All models achieve comparable classification error of 4.3-5.1%.
  • OOD detection: DPN achieves the highest OOD detection performance across CIFAR-10, CIFAR-100, LSUN, and TinyImageNet comparisons.Near-perfect performance on held-out CIFAR-10 is expected because CIFAR-10 was used as training OOD data.

B.3 CIFAR-10 Experiments

CIFAR-10 experiments compare OOD detection across four datasets. DPNs achieve the best performance, while TinyImageNet is the most challenging OOD dataset and Bayesian baselines weaken on this complex setting.

  • OOD detection: CIFAR-10 DPNs achieve the best OOD detection performance against CIFAR-100, SVHN, LSUN, and TinyImageNet.They outperform baselines by a larger margin than in the earlier experiments.
  • Dataset similarity: TinyImageNet is the most challenging OOD task because it is the most similar dataset to CIFAR-10 apart from CIFAR-100.
  • Baseline behavior: Baseline performance is noticeably lower than before, especially for MCDP mutual information, indicating difficulty controlling Bayesian distributions over distributions on complex tasks.
  • Conclusion: Prior Networks perform well on datasets more difficult than MNIST and outperform previously proposed Bayesian and non-Bayesian approaches.

Appendix C Derivations for Uncertainty Measures and KL divergence

The appendix derives uncertainty measures for DNN/DPNs and Bayesian Monte-Carlo Ensembles, including entropy, mutual information, and KL divergence between Dirichlet distributions.

  • The appendix explains how to calculate uncertainty measures for DNN/DPNs and Bayesian Monte-Carlo Ensembles.It also covers KL divergence between two Dirichlet distributions.
  • Bayesian MC Ensemble predictive entropy is derived using a result from Yarin Gal’s PhD thesis.The Dirichlet differential-entropy expression uses concentration parameters αc, the digamma function ψ, and the Gamma function.
  • For Bayesian MC Ensembles, mutual information between class labels and parameters is obtained through an entropy-based derivation.The derivation separates model uncertainty from expected data uncertainty.
  • For DPNs, mutual information between labels and categorical µ equals the entropy of the expected distribution minus expected distribution entropy.The associated decomposition distinguishes distributional, total, and expected data uncertainty.
  • The expected entropy term requires a non-standard Dirichlet expectation.It accounts for the extra factor µc by adding 1 to the associated concentration parameter αc and applying the appropriate normalizing factor α0.
  • The KL divergence between Dirichlet distributions p(µ|α) and p(µ|β) is available in closed form.
Loading 1802.10501v4…