Enhancing the Robustness of Prior Network in Out-of-Distribution Detection

Wenhu Chen, Yilin Shen, Xin Wang, William Yang WangarXiv 2018 · arXiv · OpenReview

Abstract

With the recently rapid development in deep learning, deep neural networks have been widely adopted in many real-life applications. However, deep neural networks are also known to have very little control over its uncertainty for unseen examples, which potentially causes very harmful and annoying consequences in practical scenarios. In this paper, we are particularly interested in designing a higher-order uncertainty metric for deep neural networks and investigate its effectiveness under the out-of-distribution detection task proposed by~\cite{hendrycks2016baseline}. Our method first assumes there exists an underlying higher-order distribution $\mathbb{P}(z)$, which controls label-wise categorical distribution $\mathbb{P}(y)$ over classes on the K-dimension simplex, and then approximate such higher-order distribution via parameterized posterior function $p_{\theta}(z|x)$ under variational inference framework, finally we use the entropy of learned posterior distribution $p_{\theta}(z|x)$ as uncertainty measure to detect out-of-distribution examples. Further, we propose an auxiliary objective function to discriminate against synthesized adversarial examples to further increase the robustness of the proposed uncertainty measure. Through comprehensive experiments on various datasets, our proposed framework is demonstrated to consistently outperform competing algorithms.

1. Introduction

Deep neural networks (DNNs) are notoriously overconfident. When presented with out-of-distribution (OOD) data—inputs far from the training manifold—standard models often assign high-probability labels to known classes. This failure to "know what they don't know" stems from the conflation of two types of uncertainty: Aleatoric Uncertainty (natural noise or overlap in data) and Epistemic Uncertainty (model ignorance due to lack of data). This paper introduces a Variational Dirichlet Framework to explicitly model higher-order uncertainty, enabling robust OOD detection without sacrificing classification performance.

2. Methodology

2.1 Variational Dirichlet Framework

Instead of predicting a single categorical distribution (the standard softmax output), the proposed framework treats that distribution itself as a random variable $z$ lying on a $K$-dimensional simplex. We assume an underlying higher-order distribution $P(z)$ controls the label-wise categorical distribution. This is approximated using a neural network that outputs the parameters ($\alpha$) of a Dirichlet distribution.

Visualization of higher-order (Dirichlet) vs. lower-order (Categorical) uncertainty on the simplex.

By modeling the distribution over the simplex, the model can represent "I don't know because the classes overlap" (points in the middle of the simplex with low higher-order uncertainty) differently from "I don't know because I've never seen this" (a flat, broad distribution over the entire simplex with high higher-order uncertainty).

2.2 Training and Auxiliary Objective

The model is optimized by maximizing the Variational Evidence Lower Bound (ELBO), minimizing the KL-divergence between the predicted Dirichlet posterior and a ground-truth-informed posterior. To further sharpen the boundary between in-distribution and OOD data, we introduce an auxiliary discriminative objective.

The proposed training pipeline combining Bayesian inference with an adversarial auxiliary objective.

As shown in the pipeline above, we utilize the Fast Gradient Sign Method (FGSM) to generate adversarial "boundary" examples during training. An additional loss term $L^D(\theta)$ explicitly pushes the model to assign high uncertainty to these synthesized examples, significantly boosting the robustness of the entropy-based uncertainty measure.

3. Experimental Results

The framework was evaluated across standard benchmarks including CIFAR-10/100 (In-Distribution) and iSUN, LSUN, and SVHN (OOD). The method was tested on various backbones, including VGG13, ResNet, and WideResNet.

  • Detection Performance: On CIFAR-10/iSUN using VGG13, the method achieved an AUROC of 97.7%, reducing the False Positive Rate (FPR) at 95% TPR to 10.7% (down from 43.8% in the baseline). On the more difficult CIFAR-100 task, the framework achieved an AUROC of 95.5% for iSUN detection on WideResNet.
  • Accuracy Preservation: The Dirichlet framework maintains classification accuracy on par with standard cross-entropy training (e.g., 93.1% vs 93.3% on CIFAR-10), ensuring that robustness does not come at the cost of utility.
  • Prior Selection: Ablation studies revealed that "ground-truth preserving" priors—which allow the model more freedom in the dimension corresponding to the correct label—consistently outperform simple uniform priors.

4. Conclusion

This work demonstrates that modeling higher-order uncertainty via a Variational Dirichlet Framework provides a principled and effective solution for OOD detection. By combining variational inference with an adversarial auxiliary objective, the proposed method achieves state-of-the-art results while maintaining high classification accuracy. Future work will explore scaling this approach to larger datasets like ImageNet and evaluating its robustness against more complex multi-step adversarial attacks.

Summary updated

Abstract

With the recently rapid development in deep learning, deep neural networks have been widely adopted in many real-life applications. However, deep neural networks are also known to have very little control over its uncertainty for unseen examples, which potentially causes very harmful and annoying consequences in practical scenarios. In this paper, we are particularly interested in designing a higher-order uncertainty metric for deep neural networks and investigate its effectiveness under the out-of-distribution detection task proposed by~\cite{hendrycks2016baseline}. Our method first assumes there exists an underlying higher-order distribution $\mathbb{P}(z)$, which controls label-wise categorical distribution $\mathbb{P}(y)$ over classes on the K-dimension simplex, and then approximate such higher-order distribution via parameterized posterior function $p_{\theta}(z|x)$ under variational inference framework, finally we use the entropy of learned posterior distribution $p_{\theta}(z|x)$ as uncertainty measure to detect out-of-distribution examples. Further, we propose an auxiliary objective function to discriminate against synthesized adversarial examples to further increase the robustness of the proposed uncertainty measure. Through comprehensive experiments on various datasets, our proposed framework is demonstrated to consistently outperform competing algorithms.
BibTeX
@misc{chen2018enhancing,
  author = {Wenhu Chen and Yilin Shen and Xin Wang and William Yang Wang},
  title = {{Enhancing the Robustness of Prior Network in Out-of-Distribution Detection}},
  year = {2018},
  eprint = {1811.07308},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/1811.07308},
}
Figure