Paper commentary
What Uncertainties Do We Need in Bayesian Deep Learning for Computer Vision?
- Problem Vision models give point predictions with no sense of doubt, and a single kind of uncertainty misses part of the picture. Aleatoric noise cannot be reduced with more data, while epistemic uncertainty can, so each needs its own treatment.
- Method The authors combine Monte Carlo dropout for epistemic uncertainty with a head that predicts a per-pixel variance for aleatoric uncertainty. The loss weights each residual by its predicted variance, so noisy pixels count for less.
- Results Combining both uncertainties reached 67.5 IoU on CamVid, against 67.1 for the baseline. On NYUv2 40-class it reached 37.3 IoU, against 36.5.
Two kinds of doubt in vision models
Deep networks map high-dimensional images to outputs, and those outputs are usually taken at face value even when the model is wrong. The authors cite a fatal assisted-driving failure and a misclassification that raised concerns of racial discrimination as cases where a reported uncertainty could have changed the outcome. The paper separates two sources of doubt.
Aleatoric uncertainty is noise inherent in the observations, and it cannot be reduced by collecting more data. Epistemic uncertainty concerns the model parameters, and it shrinks as the amount of data grows.
The central argument is that large image datasets reduce epistemic uncertainty, so for data-rich vision tasks the aleatoric part carries most of the useful information. Aleatoric uncertainty alone, however, cannot identify out-of-data examples, and this is the role that epistemic uncertainty plays. Aleatoric uncertainty can also depend on the input.
In depth regression, a richly textured image should yield confident predictions, while a featureless wall should yield high uncertainty, so a constant noise level would miss this.
Heteroscedastic regression with a split head
The network is a Bayesian convolutional network whose weights carry a dropout variational distribution. A single trunk feeds a head that outputs both a predicted mean and a predicted variance for each pixel. Training uses a Gaussian likelihood. The per-pixel loss is averaged over the D output pixels of an image, and the loss also contains weight decay, which the paper leaves out for brevity.
The network is trained to predict the log variance \(s_i = \log \hat{\sigma}_i^2\), which the paper uses in place of the variance because it is more numerically stable, since it avoids a division by zero. The per-pixel term is \( \frac{1}{D}\sum_i \left[\tfrac{1}{2}\exp(-s_i)\lVert y_i-\hat{y}_i\rVert^2+\tfrac{1}{2}s_i\right] \). The exponential maps an unconstrained output to a positive weight on the residual, so the predicted variance is always valid.
The residual term is scaled by \(\exp(-s_i)\), and the \(\tfrac{1}{2}s_i\) term keeps the network from declaring infinite uncertainty for every point.
No uncertainty labels are needed. The variance is learned implicitly, because only the regression targets supervise the training. At test time, the network is sampled T times with dropout active. The predictive variance combines the spread of the sampled means, which carries the epistemic part, with the average of the predicted variances, which carries the aleatoric part, as in \( \mathrm{Var}(y)\approx\frac{1}{T}\sum_t \hat{y}_t^2-\left(\frac{1}{T}\sum_t \hat{y}_t\right)^2+\frac{1}{T}\sum_t \hat{\sigma}_t^2 \).
Why the predicted variance acts as a loss weight
Because the residual is multiplied by \(\exp(-s_i)\), a pixel with high predicted variance contributes less to the loss. The network can therefore reduce the effect of erroneous labels on the regression, in the way a robust regression function would. The network is not free to predict high uncertainty everywhere. The log-variance term grows with the predicted uncertainty and penalises it, and a very low variance on a point with large residual is also penalised, because the residual then dominates the loss.
Adding the same idea to classification
A classifier predicts a vector of unaries for each pixel. The method places a Gaussian over that logit vector, with the network predicting a mean and a diagonal variance per logit, and then applies the softmax to the noisy logits. The expected log likelihood under this Gaussian has no known closed form, so it is approximated by Monte Carlo sampling.
The logits are sampled once from the already computed network outputs, which costs only a small fraction of the network's compute.
The paper rewrites the sampling as \( \hat{x}_{i,t}=f_i^{W}+\sigma_i^{W}\epsilon_t \) with \( \epsilon_t\sim\mathcal{N}(0,I) \), and obtains a numerically stable stochastic objective in which the sampled logits are passed through a log-sum-exp normalisation and averaged over the samples. Epistemic uncertainty for classification is handled separately, by averaging T softmax outputs from dropout samples and summarising the resulting probability vector with its entropy.
Training and evaluation settings
The DenseNet architecture, adapted for dense prediction, is used with the authors' own TensorFlow implementation. Dropout with p = 0.2 is placed after each convolutional layer, and epistemic uncertainty is estimated from 50 Monte Carlo dropout samples. Aleatoric uncertainty is trained with MAP inference, and the loss is derived with a Laplacian prior, which gives an L1 distance on the residuals.
The authors report that this typically outperforms L2 loss for regression tasks in vision.
Segmentation results on CamVid and NYUv2
On CamVid, the authors' DenseNet implementation reached 67.1 IoU. Adding aleatoric uncertainty gave 67.4, adding epistemic uncertainty gave 67.2, and combining both gave 67.5. The aleatoric variant gives the larger single gain, and the combination improves on both. The authors read this as evidence that aleatoric uncertainty matters more in this large-data setting, where epistemic uncertainty is largely explained away.
On NYUv2 40-class, the DeepLabLargeFOV baseline reached 36.5 IoU at 70.1 accuracy. Aleatoric uncertainty gave 37.1 IoU, epistemic uncertainty gave 36.7, and the combination gave 37.3 IoU at 70.6 accuracy. NYUv2 contains 1449 images of 640 × 480 resolution from 464 indoor scenes, with 40 semantic classes. The authors attribute the larger effect on this set to the greater difficulty of the dataset, with less structure than street scenes and more classes.
Depth regression results on Make3D and NYUv2
Make3D has 400 training and 134 testing images, and the authors resize them to 345 × 460 pixels and evaluate only pixels with depth less than 70m. On Make3D, the DenseNet baseline reached 0.167 rel, and the aleatoric and combined variants both reached 0.149, while the epistemic variant reached 0.162. The rms column does not move in the same direction.
The baseline has 3.92, the aleatoric variant 3.93 and the combined variant 4.08, so lower rel does not come with a lower rms on this set.
The authors describe aleatoric uncertainty as high for large depths, reflective surfaces and occlusion boundaries, and epistemic uncertainty as high for objects rare in the training data. Make3D provides no labels beyond 70m, so those distances dominate the epistemic signal.
Whether the uncertainty tracks errors
Precision-recall curves are built by removing pixels above a series of uncertainty percentile thresholds. Precision falls as more uncertain pixels are kept, and the curves are strictly decreasing for both uncertainty types. The aleatoric and epistemic curves look very similar. The authors suggest that when only one uncertainty is modelled, it compensates for the missing one where possible.
Calibration plots compare predicted probabilities with observed frequencies, and perfect calibration lies on the line y = x. On CamVid classification, the combined model reached a calibration MSE of 0.00214, against 0.00501 for the non-Bayesian model, with 0.00272 for aleatoric alone and 0.007 for epistemic alone. On Make3D regression, the calibration MSE is 0.031 for aleatoric uncertainty and 0.00364 for epistemic uncertainty.
The two regression numbers are not on the same scale as the classification ones, so they are not compared with them.
Training-set size and out-of-distribution data
Models were trained on the full Make3D set and on reduced subsets. The Make3D test aleatoric variance stays between 0.485 and 0.521, while the epistemic variance is 7.73 with a quarter of the training data, 4.38 with a half, and 2.78 with all of it. The RMS error on Make3D is 5.76 with a quarter of the training data, 4.62 with a half and 3.87 with the full set.
Epistemic uncertainty therefore falls as the training set grows, and aleatoric uncertainty does not.
Testing a Make3D-trained model on NYUv2 gives epistemic variance 4.87 against 2.78 on Make3D test data, and aleatoric variance 0.461 against 0.485. With a quarter of the Make3D training data, the NYUv2 epistemic variance is 15.0. The authors read these numbers as showing that epistemic uncertainty can be explained away with data but still signals inputs unlike the training set.
The out-of-distribution test in this table uses only the Make3D and NYUv2 pair.
Inference cost of the two uncertainty types
The cost of sampling depends on where the dropout sits. Models such as ResNet, where only the last few layers contain dropout, can afford it, but DenseNet needs the whole architecture sampled, which is hard to parallelise and gives about a 50× slowdown for 50 Monte Carlo samples.
Limitations
The uncertainty benefits are measured on CamVid, NYUv2 and Make3D. The out-of-distribution analysis uses only Make3D and NYUv2 with reduced training sets. Real-time epistemic uncertainty is left open: the paper leaves finding a method for it as future work, after noting that Monte Carlo sampling on DenseNet is costly. The claim that aleatoric uncertainty alone cannot identify out-of-data examples is a conceptual argument in the paper, and the tables do not test a segmentation case of it.
Paper info
- Authors
- Kendall, Alex, Gal, Yarin
- Venue
- arXiv · Preprint
- First published
- 2017-3-15
- Added
- 2026-11-12
- Updated
- 2017-10-5
- Version
- v2
- arXiv
- 1703.04977
- Category
- cs.CV
- Original paper terms
- arXiv non-exclusive 1.0
- What we show
- Paper info and commentary
AI commentary is a separate explanation from the original paper and may contain errors. The original paper and figures follow each source's terms of use and any rights noted separately.
Quote from the paper
Kendall, Alex, Gal, Yarin (2017). What Uncertainties Do We Need in Bayesian Deep Learning for Computer Vision?. arXiv:1703.04977v2. https://arxiv.org/abs/1703.04977v2
BibTeX
@misc{alex2017what,
title = {{What Uncertainties Do We Need in Bayesian Deep Learning for Computer Vision?}},
author = {Kendall, Alex and Gal, Yarin},
year = {2017},
eprint = {1703.04977},
archivePrefix = {arXiv},
url = {https://arxiv.org/abs/1703.04977v2}
}