What Uncertainties Do We Need in Bayesian Deep Learning for Computer Vision?

Alex Kendall, Yarin Gal

TL;DR

This paper introduces a unified Bayesian deep learning framework that simultaneously models both aleatoric (data-inherent) and epistemic (model-inherent) uncertainty for computer vision tasks like semantic segmentation and depth regression. By explicitly formulating input-dependent aleatoric uncertainty, the authors derive a novel loss function that acts as a "learned loss attenuation," making training robust to noisy data and achieving state-of-the-art performance.

What Problem Does This Paper Address?

Standard deep learning models excel at mapping high-dimensional inputs to predictions but are notoriously overconfident, even when completely wrong. In safety-critical applications like autonomous driving or medical imaging, "not knowing what you don't know" can lead to catastrophic failures.

While Bayesian neural networks offer a path forward, computer vision has historically struggled to separate two distinct types of uncertainty:

  1. Epistemic uncertainty: Uncertainty regarding the model parameters, which reflects a lack of training data and can be "explained away" given enough observations.
  2. Aleatoric uncertainty: Inherent noise in the observations (such as sensor noise, motion blur, or ambiguous object boundaries) which cannot be reduced by collecting more data.

This paper addresses how to effectively model, combine, and leverage both types of uncertainty for dense, pixel-wise vision tasks.

Methods

The authors propose a unified framework combining:

  • Epistemic Uncertainty: Captured using Monte Carlo (MC) Dropout at test time. By keeping dropout active during inference and performing multiple forward passes, they sample from the approximate posterior distribution of the network weights.
  • Aleatoric Uncertainty: Modeled by modifying the network architecture to split its final layer into two heads—one predicting the target output ($\hat{y}$) and the other predicting an input-dependent variance ($\hat{\sigma}^2$).

For regression tasks, this leads to a loss function that dynamically down-weights residuals with high predicted variance, balanced by a log-regularization term to prevent the network from simply guessing infinite uncertainty for every pixel. For classification, they introduce a heteroscedastic classification NN that places a Gaussian distribution over the logit space, using Monte Carlo integration to approximate a stochastically attenuated loss function.

Datasets

The framework is evaluated on dense prediction tasks across four benchmark datasets:

  • Semantic Segmentation: CamVid (road scene understanding) and NYUv2 40-class (indoor scene segmentation).
  • Monocular Depth Regression: Make3D (outdoor depth) and NYUv2 Depth (indoor depth).

Key Insights and Ideas

  • Learned Loss Attenuation: The explicit formulation of aleatoric uncertainty acts as an automatic, robust regression function. The network learns to ignore noisy data or ambiguous pixels by assigning them high uncertainty, reducing their impact on the loss during training.
  • Distinct Visual Signatures: Aleatoric uncertainty consistently spikes at object boundaries and distant, poorly defined objects. Epistemic uncertainty, conversely, spikes on visually or semantically challenging pixels and rare concepts that were sparse in the training set.
Figure 1: Illustrating the difference between aleatoric and epistemic uncertainty for semantic segmentation on the CamVid dataset [8]. Aleatoric uncertainty captures noise inherent in the observations. In (d) our model exhibits increased aleatoric uncertainty on object boundaries and for objects far from the camera. Epistemic uncertainty accounts for our ignorance about which model generated our collected data. This is a notably different measure of uncertainty and in (e) our model exhibits increased epistemic uncertainty for semantically and visually challenging pixels. The bottom row shows a failure case of the segmentation model when the model fails to segment the footpath due to increased epistemic uncertainty, but not aleatoric uncertainty.
  • Data Regimes: In large-data regimes, epistemic uncertainty is mostly explained away, meaning that modeling aleatoric uncertainty yields a larger direct boost to model accuracy. However, epistemic uncertainty remains indispensable for safety-critical out-of-distribution detection.
  • Computational Trade-offs: Predicting aleatoric uncertainty adds negligible computational overhead at inference time because it only requires a single forward pass. Conversely, epistemic uncertainty requires expensive MC sampling (e.g., 50 forward passes), creating a significant real-time bottleneck.

Key Results

  • Performance Boost: Combining both uncertainties consistently improved performance by 1–3% over non-Bayesian baselines across all tasks, demonstrating that uncertainty representation helps networks learn better representations.
  • Semantic Segmentation: Set a new state-of-the-art mean Intersection over Union (IoU) of 67.5% on CamVid and 37.3% on NYUv2 40-class.
  • Depth Regression: Achieved state-of-the-art performance on Make3D and NYUv2 Depth benchmarks, proving particularly effective at handling inherently noisy depth boundaries.

Limitations and Future Work

The primary limitation is the computational cost of epistemic uncertainty estimation. While aleatoric uncertainty is practically free to compute, evaluating epistemic uncertainty via Monte Carlo dropout requires multiple forward passes. For architectures like DenseNet, where dropout is applied throughout the network, this results in an approximate 50× slowdown, making real-time deployment on autonomous vehicles challenging.

The authors conclude that finding a method for efficient, real-time epistemic uncertainty estimation is a critical direction for future deep learning research.

Summary updated

BibTeX
@inproceedings{kendall2017what,
  author = {Alex Kendall and Yarin Gal},
  title = {{What Uncertainties Do We Need in Bayesian Deep Learning for Computer Vision?}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2017},
  url = {https://openreview.net/forum?id=Hkbgfd-uWH},
}
Figure