Simple and Scalable Predictive Uncertainty Estimation using Deep Ensembles

Balaji Lakshminarayanan, Alexander Pritzel, Charles Blundell

Introduction

While deep neural networks (NNs) have revolutionized fields like computer vision and natural language processing, they suffer from a critical flaw: they often do not know when they are wrong. Standard NNs tend to produce overconfident predictions, even when the input falls far outside their training distribution. In high-stakes applications such as medical diagnosis or autonomous driving, a model that is confidently incorrect poses a significant danger.

The traditional "gold standard" for quantifying predictive uncertainty is Bayesian Neural Networks (BNNs), which learn a distribution over network weights. However, BNNs are notoriously difficult to implement, computationally expensive, and often require substantial modifications to standard training procedures. To address this, researchers propose a "general-purpose" alternative: Deep Ensembles. This approach provides high-quality uncertainty estimates without the Bayesian overhead, proving to be simple, highly scalable, and easy to integrate into existing deep learning pipelines.

The Deep Ensemble Methodology

The authors propose a straightforward, multi-pronged recipe for constructing Deep Ensembles:

  1. Probabilistic Neural Networks: Instead of outputting a single point estimate, the network is modified to output the parameters of a probability distribution. For example, in a regression task, the network outputs both a predicted mean ($\mu$) and a predicted variance ($\sigma^2$).
  2. Proper Scoring Rules: The models are trained using Negative Log-Likelihood (NLL) rather than standard Mean Squared Error (MSE). NLL acts as a "proper scoring rule," specifically rewarding models that are well-calibrated—meaning their predicted probabilities closely match the actual frequencies of outcomes.
  3. Adversarial Training: To improve robustness, the authors utilize the Fast Gradient Sign Method (FGSM) to generate adversarial examples (inputs slightly perturbed to maximize loss). Training on these examples smooths the predictive distributions, making the model less susceptible to small, noisy changes in the input space.
  4. Ensembling: Finally, the method trains $M$ independent versions of these networks, each with a different random initialization. At test time, the predictions are aggregated. For classification, this means averaging the predicted probabilities; for regression, it involves combining the means and variances of all ensemble members into a Gaussian mixture.
Predictive uncertainty on a 1D toy regression dataset.

Interestingly, the authors found that traditional "bagging" (training on different subsets of data) actually degraded the performance of deep NNs. Instead, they recommend training each ensemble member on the entire dataset, relying solely on random weight initialization and data shuffling to provide the necessary model diversity.

Experimental Validation

The researchers evaluated Deep Ensembles across a wide range of benchmarks, including 1D toy datasets for visualization, 10 UCI regression datasets, and image classification tasks (MNIST, SVHN, and ImageNet). Crucially, they also performed Out-of-Distribution (OOD) evaluations to test if the models "know what they don't know" by evaluating MNIST-trained models on NotMNIST (letters) and SVHN-trained models on CIFAR-10.

Key Insights and Results

  • Ensembles Outperform BNN Approximations: One of the most striking findings is that a simple ensemble of non-Bayesian networks consistently matches or outperforms sophisticated approximate Bayesian methods, such as MC-dropout or Probabilistic Backpropagation.
  • The Importance of Variance: Learning to predict heteroscedastic uncertainty (variance) is critical. Training to minimize NLL leads to vastly superior uncertainty estimates compared to simply calculating the empirical variance of a standard, non-probabilistic ensemble.
  • Adversarial Smoothing: Adversarial training serves as a powerful regularizer. It not only defends against malicious attacks but also improves the quality of uncertainty estimates by encouraging the model to remain "smooth" around the training data manifold.
Classification error comparison showing Ensembles outperforming MC dropout.
  • Robustness to Dataset Shift: In OOD tests, Deep Ensembles were far more reliable at signaling high uncertainty when presented with unfamiliar data. In contrast, methods like MC-dropout frequently remained overconfident on these unknown examples.
  • Scalability: Unlike many Bayesian methods that struggle to scale, Deep Ensembles are "embarrassingly parallel." The authors demonstrated that as the ensemble size ($M$) increases, both accuracy and NLL on massive datasets like ImageNet improve significantly. Even a small ensemble ($M=5$) provides a substantial performance boost.

Limitations and Future Directions

The primary drawback of Deep Ensembles is the linear increase in computational cost; running $M$ models requires $M$ times the memory and compute during both training and inference.

To mitigate this, the authors suggest that large ensembles could potentially be "distilled" into a single, smaller model that retains the ensemble's uncertainty characteristics, making it viable for memory-constrained applications like mobile devices. Additionally, while random initialization provides sufficient diversity, explicitly de-correlating ensemble members or exploring adaptive weighting schemes ("stacking") represent promising avenues for future research.

Summary updated

BibTeX
@inproceedings{lakshminarayanan2017simple,
  author = {Balaji Lakshminarayanan and Alexander Pritzel and Charles Blundell},
  title = {{Simple and Scalable Predictive Uncertainty Estimation using Deep Ensembles}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2017},
  url = {https://openreview.net/forum?id=SkNLeFZ_-r},
}
Figure