Uncertainty-Aware Out-of-Distribution Detection with Gaussian Processes

Yang Chen, School of Computer Science, Carnegie Mellon University · 2024

Read Uncertainty-Aware Out-of-Distribution Detection with Gaussian Processes by Yang Chen, School of Computer Science, Carnegie Mellon University (2024) in the Tower of Babel, a free online library of public-domain works preserved in clean, searchable text. No sign-up. The full text is served as a plain-text file at a predictable URL, where text is present: https://antarctic-labs.com/tower-of-babel/arxiv-2412-20918.txt.

Description

A 2024 arXiv research paper by Yang Chen, School of Computer Science, Carnegie Mellon University. Deep neural networks (DNNs) are often constructed under the closed-world assumption, which may fail to generalize to the out-of-distribution (OOD) data. This leads to DNNs producing overconfident wrong predictions and can result in disastrous consequences in safety-critical applications. Existing OOD detection methods mainly rely on curating a set of OOD data for model training or hyper-parameter tuning to distinguish OOD data from training data (also known as in-distribution data or InD data).

Catalog record

CREATORYang Chen, School of Computer Science, Carnegie Mellon University
YEAR2024
COLLECTIONPAPERS
FORMATTXT
FILE SIZE49 KB
VERSION1.0
LICENSEhttp://creativecommons.org/licenses/by/4.0/
RIGHTSCC BY
SOURCEarXiv

Source: https://arxiv.org/abs/2412-20918

Browse the full library · About the Tower of Babel

Full text

The opening of the work, from the library's hosted text:

Uncertainty-Aware Out-of-Distribution Detection with Gaussian Processes Yang Chen, School of Computer Science, Carnegie Mellon University Abstract Deep neural networks (DNNs) are often constructed under the closed-world assumption, which may fail to generalize to the out-of-distribution (OOD) data. This leads to DNNs producing overconfident wrong predictions and can result in disastrous consequences in safety-critical applications. Existing OOD detection methods mainly rely on curating a set of OOD data for model training or hyper-parameter tuning to distinguish OOD data from training data (also known as in-distribution data or InD data). However, OOD samples are not always available during the training phase in real-world applications, hindering the OOD detection accuracy. To overcome this limitation, we propose a Gaussian-process-based OOD detection method to establish a decision boundary based on InD data only. The basic idea is to perform uncertainty quantification of the unconstrained softmax scores of a DNN via a multi-class Gaussian process (GP), and then define a score function to separate InD and potential OOD data based on their fundamental differences in the posterior predictive distribution from the GP. Two case studies on conventional image classification datasets and real-world image datasets are conducted to demonstrate that the proposed method outperforms the state-of-the-art OOD detection methods when OOD samples are not observed in the training phase. 1 Introduction In recent years, deep neural networks (DNNs) have been widely used in various fields due to their exceptional performance in classification tasks. However, the performance of DNNs can deteriorate significantly when tested on out-of-distribution (OOD) data, which refers to data comes from a different distribution than the training (In-distribution or InD) data distribution. This happens because DNNs tend to classify test data to a known InD data class with high certainty, no matter if it comes from an InD image group or not. The presence of OOD data can lead to poor reliability of DNNs. However, in real-life scenarios, OOD data is common, such as in autonomous driving ( Henriksson et al.,, 2023 ) and medical diagnosis ( Hong et al.,, 2024 ) . Thus, there is a critical need for a DNN to detect OOD data before making predictions. The necessity of detecting OOD data in DNNs was first discussed by Nguyen et al., (2015) and has gained increasing attention since then. The current literature on OOD detection have three main categories. The first category is score-based OOD detection, which mainly utilizes pre-defined score functions to project InD and OOD data to different extrema in the score continuum. For example, Lee et al., (2018) used a confidence threshold on the last layer of the DNN to identify OOD data. Liang et al., (2018) introduced uncertainty to the penultimate layer of the DMM and added perturbations to the input data using a gradient-based method. Liu et al., (2020) developed the energy score of samples to separate OOD data from InD data. Van Amersfoort et al., (2020) leveraged RBF networks to define a score function that quantifies the prediction uncertainty. With a well-trained score function, these methods can perform OOD detection on pre-trained DNNs by simply adding an additional module without the need for re-training. The second category is retraining-based OOD detection, which enables OOD detection through retraining DNNs. Hendrycks and Lee, (2019) added an auxiliary network to the original model and trained it using self-supervised learning to improve the model’s robustness and uncertainty. Chen et al., (2021) modified the empirical loss function of the DNN to assign a high entropy on each OOD sample, and hence identified OOD data. These methods often achieve higher OOD detection accuracies compared to the score-based methods. However, methods in the first two categories rely on hyper-parameters which are required to be tuned using OOD data. In real-world scenarios, OOD data are not always observable, making these methods fail to generalize to detect potential OOD samples. The third category of OOD detection methods emerged with the development of generative models. These methods regularize the training loss using virtual OOD data generated based on InD data distribution. For instance, Du et al., (2022) sampled virtual OOD data from the tail of Gaussian distribution which InD data was assumed to follow. Tao et al., (2023) generated virtual OOD data around the boundary InD samples identified from the nearest neighbor method and then established a decision boundary between InD and OOD data. However, these generative approaches either result in poor generalization performance or require hyper-parameter tuning for the temperature scaling and input perturbation magnitudes. Theoretical guarantees are also not provided in this category of methods. In this paper, we aim to develop an OOD detection method that does not require OOD data for model training or hyper-parameter tuning. The proposed method is motivated by Statistical Quality Control ( Montgomery,, 2020 ) , that is, to quantify a specific monitoring feature of InD data and generate alarms for incoming data whose features lie out of the control limit. In particular, we leverage the Gaussian process (GP) ( Rasmussen and Williams,, 2006 ; Gramacy,, 2020 ) to produce high prediction uncertainty at OOD data due to the fact that GP shows poor extrapolation performance. A score function is then defined to capture the discrepancy in predictive distribution at InD and OOD samples. The contributions of the paper are three fold: (i) The OOD detection model training does not rely on any OOD data; (ii) The proposed method is compatible with most existing DNN architectures; (iii) Statistical theories are developed for OOD detection performance. The remainder of the paper is organized as follows. In Section 2 , we will describe the notation, formulation, and objective. In Section 3 , the proposed method is elaborated for OOD detection. Section 4 demonstrates the effectiveness of the method by using two different setups in image classification tasks. The paper then ends with conclusions and discussions in Section 5 . 2 Notation, Formulation, and Objective The paper focuses on OOD detection in classification tasks. Let \mathcal{X}_{\text{InD}} and \mathcal{X}_{\text{OOD}} represent the spaces of InD and OOD data, respectively. Let \mathcal{Y}_{\text{InD}} denote the set of labels for the InD data, where \left|\mathcal{Y}_{\text{InD}}\right|=K corresponds to the number of class labels. In conventional DNN classification, a neural network \mathbf{f} maps a d -dimensional input \mathbf{x}\in\mathcal{X}_{\text{InD}}\cup\mathcal{X}_{\text{OOD}}:=\mathcal{X}\subseteq\mathbb{R}^{d} to a vector of length K , \mathbf{f}(\mathbf{x}):=(f_{1}(\mathbf{x}),\ldots,f_{K}(\mathbf{x})) , and predicts the class label of \mathbf{x} as k^{*}=\text{arg}\,\max_{k}{f}_{k}(\mathbf{x}). Typically, the activation function of the last layer is chosen as the Softmax function, so that the last layer reflects the probability of \mathbf{x} belonging to the k -th class. In this work, we use the unconstrained version of the Softmax function for \mathbf{f}(\mathbf{x}) to avoid the potential non-smoothness introduced by normalization, which could adversely affect subsequent modeling steps. In OOD detection, for an input \mathbf{x}\in\mathcal{X}_{\text{OOD}} , a conventional DNN tends to classify \mathbf{x} into a known class with a high confidence, i.e., producing a \mathbf{f}(\mathbf{x}) close to a one-hot vector whose k -th element is one while others are zeros. Consequently, \mathbf{x} may be mistakenly treated as an InD sample from class k . To address this issue, it is essential to introduce an OOD detection function g to identify OOD samples before making classification decisions with \mathbf{f} , where g is defined as: g(\mathbf{x})=\left\{\begin{array}[]{l}1,\text{ if }\mathbf{x}\in\mathcal{X}_{\text{OOD}}\\ 0,\text{ if }\mathbf{x}\in\mathcal{X}_{\text{InD}}\end{array}\right. The

Read the complete text