Adaptive Uncertainty Estimation via High-Dimensional Testing on Latent Representations

Tsai Hor Chan, Kin Wai Lau, Jiajun Shen, Guosheng Yin, Lequan Yu

Abstract: Uncertainty estimation aims to evaluate the confidence of a trained deep neural network. However, existing uncertainty estimation approaches rely on low-dimensional distributional assumptions and thus suffer from the high dimensionality of latent features. Existing approaches tend to focus on uncertainty on discrete classification probabilities, which leads to poor generalizability to uncertainty estimation for other tasks. Moreover, most of the literature requires seeing the out-of-distribution (OOD) data in the training for better estimation of uncertainty, which limits the uncertainty estimation performance in practice because the OOD data are typically unseen. To overcome these limitations, we propose a new framework using data-adaptive high-dimensional hypothesis testing for uncertainty estimation, which leverages the statistical properties of the feature representations. Our method directly operates on latent representations and thus does not require retraining the feature encoder under a modified objective. The test statistic relaxes the feature distribution assumptions to high dimensionality, and it is more discriminative to uncertainties in the latent representations. We demonstrate that encoding features with Bayesian neural networks can enhance testing performance and lead to more accurate uncertainty estimation. We further introduce a family-wise testing procedure to determine the optimal threshold of OOD detection, which minimizes the false discovery rate (FDR). Extensive experiments validate the satisfactory performance of our framework on uncertainty estimation and task-specific prediction over a variety of competitors. The experiments on the OOD detection task also show satisfactory performance of our method when the OOD data are unseen in the training.

1. Introduction

Deep neural networks (DNNs) are notoriously overconfident, often assigning high probabilities to incorrect predictions or entirely novel inputs. Quantifying this uncertainty is vital for safety-critical domains such as medical imaging and autonomous systems. Current uncertainty estimation methods face three primary hurdles: the "curse of dimensionality," where standard statistical tools fail in sparse high-dimensional latent spaces; a dependency on seeing out-of-distribution (OOD) data during training; and a lack of generalizability across different tasks like regression or representation learning.

2. Methodology

This paper introduces a novel framework that treats uncertainty estimation as a high-dimensional hypothesis testing problem. The approach combines Bayesian Neural Networks (BNNs) with an adaptable statistical test performed directly on latent representations.

Overall framework of the BNN-ARHT uncertainty estimation system.

The framework utilizes a BNN encoder to produce a distribution of latent representations for every input. While a standard frequentist model provides a single point-estimate, the BNN provides a "cloud" of samples that captures epistemic uncertainty—the model’s doubt regarding its own parameters.

The core of the detection mechanism is the Adaptable Regularized Hotelling $T^2$ (ARHT) test. It formulates OOD detection as a hypothesis test: whether the feature distribution of a new sample significantly deviates from the training distribution. Unlike traditional tests that break down when the number of features exceeds the number of samples ($p > n$), ARHT incorporates an adaptive regularization term ($\lambda$) to stabilize the covariance matrix. This makes the test statistic more discriminative in high-dimensional spaces. Finally, the Benjamini–Hochberg procedure is applied to control the False Discovery Rate (FDR), ensuring reliable thresholding for OOD detection.

3. Experimental Results

The framework was validated across various benchmarks, ranging from standard natural image datasets like MNIST and CIFAR to real-world medical imaging tasks using the Diabetes Retinopathy Detection (DRD) dataset.

Distribution of uncertainty scores for in-distribution vs. OOD data.

As illustrated in the score distributions, the BNN-ARHT method achieves clear separation between in-distribution and OOD samples. On the MNIST vs. Fashion-MNIST task, the method achieved a state-of-the-art AUROC of 99.51%, outperforming popular baselines like MC Dropout and Deep Ensembles. In the challenging DRD medical dataset, it reached an AUROC of 93.44%, a significant improvement over the next best competitor (91.06%) and vastly superior to Deep Ensembles (59.67%). Crucially, the method maintains high classification accuracy (e.g., 99.26% on MNIST), demonstrating that robust uncertainty estimation does not require sacrificing primary task performance.

4. Discussion and Conclusion

By operating on latent features rather than final softmax probabilities, the BNN-ARHT framework captures richer structural information, making it more robust to the skewness often found in high-dimensional data. Its post-hoc nature allows it to be integrated with various pre-trained architectures without modifying the original training objectives.

While the computational cost of drawing multiple BNN samples (e.g., $n_2=300$) is higher than a single forward pass, the gains in reliability and the ability to detect unseen OOD data are substantial. Future research directions include scaling these methods to deeper BNN architectures and applying the framework to continual learning and reinforcement learning, where detecting distributional shifts is essential for triggering adaptive learning phases.

Summary updated

Abstract

Uncertainty estimation aims to evaluate the confidence of a trained deep neural network. However, existing uncertainty estimation approaches rely on low-dimensional distributional assumptions and thus suffer from the high dimensionality of latent features. Existing approaches tend to focus on uncertainty on discrete classification probabilities, which leads to poor generalizability to uncertainty estimation for other tasks. Moreover, most of the literature requires seeing the out-of-distribution (OOD) data in the training for better estimation of uncertainty, which limits the uncertainty estimation performance in practice because the OOD data are typically unseen. To overcome these limitations, we propose a new framework using data-adaptive high-dimensional hypothesis testing for uncertainty estimation, which leverages the statistical properties of the feature representations. Our method directly operates on latent representations and thus does not require retraining the feature encoder under a modified objective. The test statistic relaxes the feature distribution assumptions to high dimensionality, and it is more discriminative to uncertainties in the latent representations. We demonstrate that encoding features with Bayesian neural networks can enhance testing performance and lead to more accurate uncertainty estimation. We further introduce a family-wise testing procedure to determine the optimal threshold of OOD detection, which minimizes the false discovery rate (FDR). Extensive experiments validate the satisfactory performance of our framework on uncertainty estimation and task-specific prediction over a variety of competitors. The experiments on the OOD detection task also show satisfactory performance of our method when the OOD data are unseen in the training. Codes are available at https://github.com/HKU-MedAI/bnn_uncertainty.
BibTeX
@inproceedings{chan2023adaptive,
  author = {Tsai Hor Chan and Kin Wai Lau and Jiajun Shen and Guosheng Yin and Lequan Yu},
  title = {{Adaptive Uncertainty Estimation via High-Dimensional Testing on Latent Representations}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2023},
  url = {https://openreview.net/forum?id=0DpKUzl1Se},
}
Figure