Skip to main content
QUICK REVIEW

[Paper Review] The Hidden Uncertainty in a Neural Networks Activations

Janis Postels, Hermann Blum|arXiv (Cornell University)|Dec 5, 2020
Adversarial Robustness in Machine LearningComputer Science59 references12 citations
TL;DR

This paper proposes using the density of neural network activations as a proxy for both epistemic and aleatoric uncertainty, enabling efficient uncertainty estimation without retraining. It shows that deeper layer representations yield uncertainty estimates closely matching computationally expensive methods like Monte Carlo dropout and deep ensembles, while simple regularization further improves OOD detection with minimal training overhead.

ABSTRACT

The distribution of a neural network's latent representations has been successfully used to detect out-of-distribution (OOD) data. This work investigates whether this distribution moreover correlates with a model's epistemic uncertainty, thus indicates its ability to generalise to novel inputs. We first empirically verify that epistemic uncertainty can be identified with the surprise, thus the negative log-likelihood, of observing a particular latent representation. Moreover, we demonstrate that the output-conditional distribution of hidden representations also allows quantifying aleatoric uncertainty via the entropy of the predictive distribution. We analyse epistemic and aleatoric uncertainty inferred from the representations of different layers and conclude that deeper layers lead to uncertainty with similar behaviour as established - but computationally more expensive - methods (e.g. deep ensembles). While our approach does not require modifying the training process, we follow prior work and experiment with an additional regularising loss that increases the information in the latent representations. We find that this leads to improved OOD detection of epistemic uncertainty at the cost of ambiguous calibration close to the data distribution. We verify our findings on both classification and regression models.

Motivation & Objective

  • To investigate whether the distribution of neural network activations correlates with epistemic uncertainty, i.e., the model's ability to generalize to novel inputs.
  • To determine if hidden representations can also quantify aleatoric uncertainty through output-conditional density estimation.
  • To evaluate whether uncertainty derived from latent representations matches the performance of established, computationally costly methods like deep ensembles and MC dropout.
  • To assess the impact of training-time regularization on the quality of uncertainty estimates and OOD detection.
  • To provide a practical, post-training framework for uncertainty estimation applicable to both classification and regression models.

Proposed method

  • Estimate epistemic uncertainty via the negative log-likelihood (surprise) of latent representations, treating low-density regions as indicative of out-of-distribution inputs.
  • Quantify aleatoric uncertainty using the entropy of the predictive distribution conditioned on the latent representation, enabling uncertainty estimation for regression tasks.
  • Train standard neural networks without architectural modifications, then extract uncertainty from pre-trained hidden activations.
  • Apply a reconstruction-based regularizing loss during training to increase information content in the latent space, improving uncertainty quality.
  • Use Gaussian Mixture Models (GMMs) or Normalizing Flows (NFs) to model the density of hidden representations for uncertainty estimation.
  • Evaluate uncertainty performance using AUROC on OOD detection and correlation with prediction error for aleatoric uncertainty.

Experimental results

Research questions

  • RQ1Can the density of hidden activations serve as a reliable proxy for epistemic uncertainty, indicating a model’s generalization capability?
  • RQ2Can the output-conditional distribution of hidden representations also estimate aleatoric uncertainty, particularly in regression tasks?
  • RQ3How do uncertainty estimates from different network depths compare to established methods like MC dropout and deep ensembles?
  • RQ4Does adding a reconstruction loss during training improve OOD detection performance, and what are the trade-offs in calibration near the data distribution?
  • RQ5Can uncertainty estimation be effectively applied post-training without modifying the model or retraining?

Key findings

  • The density of deeper layer activations produces epistemic uncertainty estimates that closely mirror those of MC dropout and deep ensembles, despite being computationally cheaper.
  • Shallow layer representations yield more conservative OOD detection, outperforming deep ensembles on several OOD benchmarks without additional training.
  • Adding a reconstruction loss during training significantly boosts OOD detection performance, but leads to ambiguous calibration near the training data distribution.
  • Aleatoric uncertainty estimated from deeper layers shows calibration behavior similar to established methods, validating its reliability.
  • The method enables uncertainty estimation post-training with no architectural changes, offering a scalable and practical solution for real-world deployment.
  • The choice of regularization weight is critical: different weights yield identical accuracy but vastly different AUROC curves near the data distribution, complicating optimal hyperparameter selection.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.