Title: Adaptive Uncertainty Estimation via High-Dimensional Testing on Latent Representations
Venue: NeurIPS 2023
Accepted: yes
Keywords: Bayesian deep learning

high-dimensional testing

uncertainty estimation

out-of-distribution detection
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.

Adaptive Uncertainty Estimation via High-Dimensional Testing on Latent Representations

Abstract

Uncertainty estimation aims to evaluate the confidence of a trained deep neural network. However, existing uncertainty estimation approaches rely on lowdimensional 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 require seeing the outof-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 .

1 Introduction

Deep neural networks (DNNs) have demonstrated state-of-the-art (SOTA) performances on many problem domains, such as computer vision [30, 31], medical diagnosis [24, 16, 38, 2], and recommendation systems [1, 3]. Despite their successes, most of the existing DNN designs can only recognize in-distribution samples (i.e., samples from training distributions) but cannot measure the confidence level (i.e., the uncertainties) in the prediction, especially for out-of-distribution (OOD) samples. Estimation of prediction uncertainties plays an important role in many machine learning applications [25, 37]. For instance, uncertainty estimation can help to detect OOD samples in the data and inspect anomalies in the system. Further, the uncertainty estimates can indicate the distributional shifts in the environment and thus facilitate learning in a non-stationary environment.

In response to the high demand, several attempts have been made to obtain a better estimate of the uncertainty, which can be roughly divided into two categories - Bayesian and non-Bayesian methods. Bayesian methods [4, 19] mainly operate with a Bayesian neural network (BNN), which introduces a probability distribution (e.g., multivariate Gaussian) to the neural network weights. This enables the model to address model-wise (i.e., epistemic) uncertainty by drawing samples from the posterior distribution. Non-Bayesian methods [32, 27, 10], on the other hand, assume a distribution on the model outputs (e.g., classification probabilities). The uncertainty scores can be obtained by evaluating a pre-determined metric (e.g., classification entropy) on the derived distribution.

However, most of the aforementioned methods are subject to several drawbacks: (1) They rely on strong assumptions (e.g., parametric models) on low-dimensional features and thus suffer from the curse of high dimensionality, leading to poor performance when the dimension of the output is high. (2) They are limited to classification problems, and existing methods explicitly make assumptions about the classification probabilities. This leads to poor generalizability in uncertainty estimation for other tasks, such as regression and representation learning. (3) Their performances heavily rely upon the feature encoder, which can be compromised when the features are of poor quality (e.g., the number of samples used to train the encoder is small). (4) They require a modification of the training loss, and thus additional training is needed when applying the methods to a new problem. Pretrained features cannot be directly applied to the OOD tasks without retraining for their proposed loss.

Observing the above limitations, we propose a new framework for uncertainty estimation. Our framework comprises two key components: one Bayesian deep learning encoding module and one uncertainty estimation module using the adaptable regularized Hotelling T 2 (ARHT) [26]. Our contributions are summarized as: (1) We formulate uncertainty estimation as a multiple highdimensional hypothesis testing problem, and adopt a Bayesian deep learning module to better address the aleatoric and epistemic uncertainties when learning feature distributions. (2) We propose using the ARHT test statistic for measuring uncertainty and demonstrate the advantages of ARHT over the existing uncertainty measures, including its consistency and robustness properties. This enables us to design a data-adaptive detection method so that each individual data point can be assigned an optimal hyperparameter. Because it relaxes the strong assumptions on latent feature distributions, ARHT less sensitive to the feature quality. As result, our method can be interpreted as a post-hoc method as it works on feature distributions generated by any encoder (e.g., a pre-trained encoder). (3) We adopt the family-wise testing procedure to determine the optimal threshold of OOD detection, which minimizes the false discovery rate (FDR). (4) We perform extensive experiments on standard and medical image datasets to validate our method on OOD detection and image classification tasks compared to SOTA methods. Our proposed method does not require prior knowledge of the OOD data, while it yields satisfactory performance even when the training samples are limited.

2 Preliminaries

Deep Neural Network : A deep neural network (DNN) with L layers can be defined as

where ϕ is a nonlinearity activation function, x is the input, D l -1 is the dimension of the input, b l ∈ R D l is a vector of bias parameters for layer l , and W l ∈ R D l × D l -1 is the matrix of weight parameters. Let w l = { W l , b l } denote the weight and bias parameters of layer l , and the entire trainable network parameters are denoted as θ = { w l } L l =1 .

Bayesian neural network (BNN) : A BNN specifies a prior π ( θ ) on the trainable parameters θ . Given the dataset D = { x i , y i } N i =1 of N pairs of observations and responses, we aim to estimate the posterior distribution of θ , p ( θ |D ) = π ( θ ) ∏ N i =1 p ( y i | f ( x i ; θ )) /p ( D ) , where p ( y i | f ( x i ; θ )) is the likelihood function and p ( D ) is the normalization term.

Pooled Sample Covariance Matrix: Let { X 1 j } n 1 j =1 be the p -dimensional embeddings from the training images and { X 2 j } n 2 j =1 be the p -dimensional embeddings from the testing images. The pooled sample covariance is defined as

where n = n 1 + n 2 , n k is the sample size and ¯ X k is the sample mean of the k -th set ( k = 1 , 2) .

High-Dimensional Test Statistics: The Hotelling T 2 test statistic [15] is given by

The Hotelling T 2 test assumes T ∼ F ( p, n -p ) under the null hypothesis. To resolve the potential singularity of the covariance matrix, the regularized Hotelling T 2 (RHT) test statistic [5] loads an identity matrix I p to T ,

where λ is a tuning parameter. The ARHT test statistic, which will be formally introduced by Eq. 4 in Section 3.3, standardizes the RHT and addresses the skewness of Hotelling's T 2 when the feature dimension is high.

3 Methodology

Our uncertainty estimation framework comprises a Bayesian neural network encoder and an OOD testing module with ARHT as the uncertainty measure. Figure 1 provides an overview of our proposed framework, with the detailed algorithm given in the appendix. Ablation studies on key components of our framework are provided in Section 5.

3.1 Problem Definition and Test Hypothesis

Suppose that we have a set of samples { I 1 , . . . , I n } as the training set, and a set of testing samples I ′ 1 , . . . , I ′ n } containing both in-distribution and OOD data. We aim to develop an uncertainty estimation framework that can accurately classify the test samples as either in-distribution or OOD, without seeing the OOD data during the training. Moreover, the framework can still perform well on its predictive task (e.g., classification) without sacrifice in uncertainty estimation. We set the null hypothesis H 0 : µ 1 = µ 2 and the alternative hypothesis as H 1 : µ 1 = µ 2 , where µ 1 and µ 2 are the mean representations of the training and the testing samples, respectively.

3.2 Bayesian Neural Network as Encoder

We adopt a BNN encoder and train it with stochastic variational inference (SVI) [29] to learn the representation of the input. In SVI, a posterior distribution p ( θ | y ) is approximated by a distribution q selected from a candidate set Q by maximizing an evidence lower bound (ELBO): max q ∈Q E θ ∼ q [ log p ( y | θ )] -KL ( q ∥ π ) , where KL ( q ∥ π ) is the Kullback-Leibler divergence between the variational posterior distribution q and the prior distribution π , p ( y | θ ) is the likelihood, and E θ ∼ q [ log p ( y | θ )] represents the learning objective. This can be supervised (e.g., cross-entropy loss) or unsupervised (e.g., contrastive learning loss) learning. The KL divergence of two multi-variate Gaussian distributions is provided in the appendix. We use gradient descent to optimize the ELBO, i.e., to minimize the distance between prior and variational posterior distributions. We obtain the trained BNN encoder once the optimization step is completed. Since BNNs operate on an ensemble

̸

Training Data

(In-distribution)

OOD

Training

Testing

BNN

𝝅 𝜽 ~𝒩(𝟎,𝑰)

BNN Encoder

ഥ

𝑿𝟏

𝚺𝟏

ഥ

𝑿𝟐

𝚺𝟐

Testing data

In-

Distr.

ARHT

𝓛𝐨𝐛𝐣

𝑲𝑳(𝒒 ∥ 𝝅)

ELBO

∑

Back-propagate

In-distribution

Embeddings

Testing

Embeddings

Fixed after

training

In-distribution

OOD

OOD Detection

of posterior model weights, they can capture the epistemic uncertainties in the posterior predictive distribution p ( y |D ) . Hence, using BNNs instead of frequentist architectures can better approximate the posterior distribution of the feature embeddings.

To obtain the uncertainty scores, we need to compute the sample means ¯ X 1 , ¯ X 2 and covariance matrices Σ 1 , Σ 2 for the training data (containing in-distribution data only) and the testing data (containing both in-distribution and OOD data). First, we sample s weights for every data point in the training data, and generate representations for each data point using the sampled weights. In total, n 1 representations are generated from the training data. We can compute the mean ¯ X 1 and covariance matrix Σ 1 of the training data using these n 1 representations. For each testing data point x t , we sample n 2 weights from the variational posterior distribution, and generate n 2 representations { ˆ x tj = f ( x t ; θ j ) } n 2 j =1 , where θ j is the j -th weight sample drawn from the trained posterior distribution p ( θ |D ) . We obtain the mean ¯ X 2 = ∑ n 2 j =1 ˆ x tj /n 2 and the covariance matrix Σ 2 = ∑ n 2 j =1 (ˆ x tj -¯ X 2 )(ˆ x tj -¯ X 2 ) ⊤ /n 2 . Hence, we can compute the pooled covariance matrix S n by Eq. (1).

3.3 High-Dimensional Testing as Uncertainty Measure

With the pooled sample covariance matrix, we can compute the ARHT test statistics by Eq. (3) and Eq. (4), where ¯ X 1 is the mean of training samples and ¯ X 2 is the mean of n 2 embeddings of each testing sample. To solve the skew F distribution of RHT when n ≫ p for large n and p (as shown in Figure 2), we adopt the ARHT statistic to perform a two-sample test which has robust regularization of the covariance matrix [26]. In particular, the ARHT is given by

As a result, we have ARHT ( λ ) ∼ N (0 , 1) [26], which prevents the catastrophic skewness of F -distribution in high dimensions (see Figure 2) and yields smoother uncertainty scores. The ARHT can

be interpreted as a more robust distance measure on embedding distributions compared to existing metrics such as Mahalanobis distance.

We select λ from a predefined set using a data-adaptive method [26]. The set for grid search is chosen as { λ 0 , 5 λ 0 , 10 λ 0 } given the hyperparameter λ 0 . For a testing data point x t , we compute Q ( λ, γ ; ξ ) = ∑ 2 k =0 ξ k ˆ ρ k ( -λ, γ ) / { γ ˆ Θ 2 ( λ, γ ) } 1 / 2 , for each λ in the candidate set, where ξ = ( ξ 0 , ξ 1 , ξ 2 ) ∈ R 3 is a pre-specified weight vector set as ξ = (0 , 1 , 0) , ˆ ρ 0 ( -λ, γ ) = m F ( -λ ) , ˆ ρ 1 ( -λ, γ ) = ˆ Θ 1 ( λ, γ ) , and ˆ ρ 2 ( -λ, γ ) = { 1+ γ ˆ Θ 1 ( λ, γ ) }{ p -1 tr { S n }-λ ˆ ρ 1 ( -λ, γ ) } . The optimal λ is then selected by maximizing the Q function, i.e., arg max λ Q ( λ, γ ; ξ ). For each testing data point, we can proceed with the above selection process to determine the optimal λ for the individual input. This makes the determination of uncertainty scores more flexible and data-adaptive.

3.4 Optimal Threshold Adjusting for Family-Wise Discovery Error

We obtain the area under the receiver operating characteristic curve (AUROC) and the area under the precision-recall curve (AUPR) using different thresholds. To determine the optimal threshold, we adopt a family-wise testing procedure to compute the p -values.

It is necessary to balance the tradeoff between the power and the type I error rate of the test. We adopt the Benjamini-Hochberg (BH) procedure [35] procedure to adjust for multiple tests. The threshold of p -values is calibrated by the BH procedure, and we have a rejection set ˆ R of indices to the samples whose p -values are below the threshold, ˆ R = { i ∈ I : ˆ p i ≤ α ˆ k/ ( mH m ) } , where ˆ k = max { k ∈ I : ˆ p i ≤ αk ( mH m ) } , I = { 1 , . . . , m } is the set of indices corresponding to the m tests, and H m = ∑ m j =1 1 /j . The samples in the rejection set are then classified as the OOD sample. The BH procedure is shown to achieve a more powerful hypothesis testing performance [13].

4 Experiments

4.1 Datasets and Experiment Setting

We design OOD detection tasks on both standard and medical image datasets to demonstrate the application of our framework. We also evaluate our framework on the image classification

F(10,10)

F(1000,1000)

0.7

6

0.6

5

0.5

4

0.4

3

0.3

2

0.2

0.1

1

0.0

0

-1

0

1

2

3

-1

0

1

2

3

task in comparison with the baseline methods to show that our framework does not sacrifice classification performance. For the image classification task, we benchmark the classification performance of the encoder trained on a holdout set of the in-distribution dataset (i.e., MNIST).

For the OOD detection task, we treat CIFAR 10 and MNIST as the in-distribution datasets, and Fashion-MNIST, OMNIGLOT, and SVHN as the OOD datasets. To validate the advantage of BNN encoding on limited observations, we compose a medical image benchmark using samples from the Diabetes Retinopathy Detection (DRD) dataset [8], with samples shown in Figure 3. We treat healthy

samples as in-distribution data and unhealthy samples as OOD data. Distinct from the settings in some existing works [27] which include OOD data in the training, we exclude the OOD data when training the feature encoder. We use the AUROC and AUPR as the evaluation metrics for OOD detection tasks, and adopt accuracy and the macro F1-score to evaluate the classification performance. Detailed definitions of the evaluation metrics and further descriptions of the datasets can be found in the appendix.

4.2 Competitive Methods

We compare our proposed framework, named as BNN-ARHT, with seven competitors (1) Deep ensembles [21]: an ensemble of neural networks to address the epistemic uncertainties, and the number of models in the ensemble is set as 5; (2) MC Dropout [10]: a non-Bayesian method using dropout on trained weights to produce Monte Carlo weight samples [27]; (3) Kendall and Gal [19] : the first work addressing the aleatoric and epistemic uncertainties in deep learning; (4) EDL [32] : it estimates uncertainty by collecting evidence from outputs of neural network classifiers by assuming a Dirichlet distribution on the class probabilities; (5) DPN [27] : it assumes a prior network with Dirichlet distributions on the classification outputs; (6) PostNet [4] : it uses normalizing flow to predict an individual closed-form posterior distribution over predicted class probabilities; (7) Detectron [12] : it detects the change in distribution with the discordance between an ensemble of classifiers trained to agree on training data and disagree on testing data. Since Detectron operates on small samples from each dataset for OOD detection (e.g., 50 over 60,000 for CIFAR 10), we use a larger number of runs (i.e., 100) for a fair comparison. Five-fold cross-validation is applied to each of the competitive methods. We report the means and standard deviations over the runs for each metric.

4.3 Predictive and Uncertainty Estimation Performance

Verify Uncertainty Quality by OOD Detection. Tables 1 and 2 present the OOD detection results of our method compared with competitors on different pairs of datasets. We observe that existing methods, which assume having seen OOD data in the training, perform poorly in our settings, especially when the training observations are limited. Detectron [12] yields larger standard errors than other methods since it operates on small samples of the datasets. This validates the argument that existing methods heavily rely upon the availability of OOD data during the training. We also observe that our framework outperforms all the baselines on almost all OOD detection tasks, which demonstrates its satisfactory performance. In particular, our method shows a great improvement on the DRD dataset in which the number of samples is small, indicating the advantage of using a BNN encoder. As the MNIST dataset has dense feature representations, the OOD features can be easily distinguished. Hence, the OOD performance of the methods is relatively better on MNIST than on CIFAR10.

Predictive Performance Is Preserved. As shown in Table 3, we also perform image classification to demonstrate the benefits of the post-hoc method (i.e., without modifying the original objective). We fix the neural network architecture as LeNet. For Kendall and Gal [19] and our method, we use the Bayesian counterpart of LeNet to perform the experiment. We observe that without modifying the original learning objective, the predictive performance of the encoder can be preserved and outperforms other methods. The BNN may underperform its frequentist counterpart due to the introduction of the KL regularization. Hence, in practice, a (pre-trained) frequentist encoder can be used to replace the BNN encoder if predictive performance is the focus. Section 5 shows the sacrifice in the OOD detection performance if a frequentist architecture is used.

Visualization of Uncertainty Scores. To better understand the uncertainty scores of indistribution and OOD data under different uncertainty measures, Figure 4 presents the distributions of the ARHT uncertainty scores of in-distribution data (MNIST) and OOD data (Fashion-MNIST), respectively. We observe that the distributions of ARHT are of different shapes for in-distribution data and OOD data. This demonstrates the effectiveness of ARHT in identifying the unique characteristics of the distributions of the datasets.

5 Ablation Studies

Different Neural Network Architectures. We compare the performance with encoders under different architectures. We choose the standard CNN used in Malinin and Gales [27], LeNet [22], Alexnet [20], and ResNet18 [14] as the SOTA examples in encoding image features. For ResNet18, as the variance increases drastically with the increasing depth of the architecture, it is not feasible to replace all the layers with their Bayesian counterparts. Therefore, we replace only the last fully-connected layer and the second last convolutional layer with their Bayesian versions. Table 4 presents the comparison of OOD

in

1750

poo

1500

1250

1000

750

500

250

0

2000

4000

6000

8000

10000

detection of our method with the competitors under different neural network architectures. We observe that our method is able to obtain satisfactory performance over the competitors when the neural network architecture changes.

Effects of Key Hyperparameters. We evaluate our method with a range of hyperparameters to assess their impacts on our method. Figure 5 presents the OOD detection performance with different values of λ 0 , n 2 , and p . (1) Initial loading value λ 0 : we observe that the performance of our model is robust to changes in λ 0 . Since the ARHT relaxes the Gaussian assumption of embeddings, the change in the magnitude of the loading matrix would not heavily affect the covariance structure of the testing embeddings. Hence we can safely load λ to the covariance matrix to resolve the singularity problem, with no concern about the decrease in performance; (2) Number of training weight samples n 1 :

0.98

0.982

0.984

0.986

0.988

0.99

0.992

0.994

0.996

0.998

1

0.0001

0.001

0.01

0.1

1

AUCROC

AUPR

Performance by

𝝀𝟎

𝝀𝟎

Performance by

𝒏𝟐

𝒏𝟐

0.98

0.982

0.984

0.986

0.988

0.99

0.992

0.994

0.996

0.998

1

5

10

20

50

100

200

500

1000

AUCROC

AUPR

Performance by

𝒑

𝒑

0.3

0.4

0.5

0.6

0.7

0.8

0.9

1

8

16

32

64

128

AUCROC

AUPR

The size n 1 is controlled by the hyperparameter s in our framework. We have conducted experiments with s ranging from 1 to 5 (Figure 6). The pattern shows that the performance decreases when s increases (i.e., more embedding samples from the in-distribution dataset). This demonstrates that the covariance structure affects ARHT more as s increases, and the contribution of testing embeddings is less weighed, which leads to slightly decreasing performance. (3) Number of testing weight samples n 2 : The number of testing weight samples n 2 is a key to approximate the testing embedding distributions. Since the approximation of the testing distribution is crucial to the performance of our method, we tune the hyper-parameter n 2 to determine the optimal number of testing embeddings to choose for each task. We observe that even if the number of testing samples is small (e.g., 5), ARHT can still capture the distributional difference between the in-distribution and OOD data. This leads to a consistent performance as n 2 varies. (4) Embedding dimension p : we also evaluate the OOD detection performance of our method with respect to the change in embedding dimensions ( p = 8 , 16 , 32 , 64 , 128 ).

We observe that our method is robust to changes in feature dimensions. This enables our framework to perform OOD detection on the representation level with customized embedding dimensions, relaxing the constraint on classification problems.

Feature Learning Objectives. One key component of our framework is the BNN encoder, which is trained by supervision (i.e., cross-entropy loss for image classification) on standard datasets. We evaluate the robustness of our method when the encoder is trained with different objectives (i.e., unsupervised contrastive learning loss). We select the margin of

contrastive learning loss as 0.2. The performance in AUROC on the OOD detection task decreases slightly from 99.98 to 98.42 (for MNIST vs. OMNIGLOT OOD detection). This shows that our framework is sensitive to the quality of the encoder, and a supervised learning objective is preferred to improve the encoding performance.

6 Discussion: Impacts and Limitations of BNN and ARHT

We discuss why a BNN encoder is preferred for our framework, with Figure 7 illustrating the difference between features generated by BNN and frequentist DNN. A frequentist DNN gives one feature embedding to every input data point, and the uncertainty estimate ignores the covariance structure of the distribution because only the point estimate is provided. However, a BNN estimates the posterior embedding distribution for every data point, and the covariance structure can be incorporated to obtain a more accurate uncertainty estimate. Although some recent non-Bayesian method [32, 27] places parametric distributions on posterior embeddings (e.g., Dirichlet distribution on class probabilities), these parametric distributions are less accurate in approximating the posterior distributions than BNNs because the strong parametric assumption limits their capabilities in searching the candidate distributions.

To demonstrate why ARHT is preferred as an uncertainty metric, we further evaluate its performance over an array of uncertainty measures, including the maximum probability, entropy, and

differential entropy proposed by Malinin and Gales [27]. Detailed definitions of these metrics are presented in the appendix. We also include the frequently used Mahalanobis distance which possesses stronger assumptions on the Gaussianity of the embeddings. We fix the model architecture to be LeNet and compare its Bayesian and frequentist designs. Table 5 presents the summary of the comparison. We observe that using ARHT as the uncertainty score can achieve the best OOD detection performance than existing uncertainty measures when a BNN encoder is used.

Our method achieves a better performance using features generated by BNNs than those generated by frequentist counterparts, which demonstrates the advantage of using Bayesian encoders in our framework. However, BNN encoders require drawing n 2 samples of weights for posterior inference, which requires higher time complexity than the frequentist counterparts. Further, BNNs are limited by the scalability constraints [11], which makes them difficult to have deeper structures. How to make BNNs deep remains a challenging topic [11, 36, 7, 29].

Support of Single-Sample Uncertainty. As the training set (as the indistribution set) is available (at least for

Frequentist

DNN

Feature

Distribution

From Testing

Samples

From Normal

Samples

BNN Posterior

Predictive

Distribution

Estimated Uncertainty

Feature

Distribution of

Normal

Samples

(by DNN/BNN)

training or fine-tuning the encoder) in most of the problems, one can use samples from training sets and the testing samples to compute ARHT. One exception is the zero-shot case where we only have the pre-trained encoder but no original data (i.e., in-distribution samples). In this case, most of the uncertainty estimation methods cannot work since they require at least in-distribution data to fit their parametric assumptions (e.g., concentration rates of the Dirichlet distributions in classification problems). However, one may still obtain ARHT as an uncertainty estimate using methods to reconstruct/generate pseudo-training data from the pre-trained models, which is not the focus of our work but warrants future research.

7 Related Works

Uncertainty Estimation. Estimating uncertainty in neural networks has become an increasingly important topic in deep learning. Existing uncertainty estimation methods can be divided into two classes: Bayesian methods [19, 23] and non-Bayesian methods [32, 27, 21, 4, 9, 10]. Bayesian methods address the model-wise (i.e., epistemic) uncertainties by learning a posterior distribution of weights. The uncertainties in neural networks can be approximated by the predictions given by the weights sampled from the posterior distributions.

Despite the success of these methods, most works only focus on classification uncertainties and rely upon arbitrary distributional assumptions on the class probabilities. For instance, DPN [27] assumes that the classification probabilities follow a Dirichlet distribution and train the OOD detector based on the KL divergence of the prior and posterior Dirichlet distributions. These methods are not generalizable to tasks other than classification. Furthermore, most existing methods [32, 27, 10] assume that the samples from the target domain are available when training the OOD detector, which is unrealistic in most applications.

Hypothesis Testing in High Dimension. The task of uncertainty estimation can be redefined as a high-dimensional hypothesis testing problem. We report the detection of OOD samples if we reject the null hypothesis at significance level α . The Hotelling T 2 test [15, 18] in Eq. (2) assumes T ∼ F ( p, n -p ) under the null hypothesis. The unnormalized version of T in Eq. (2) is known

as Mahalanobis distance. However, the Hotelling test statistic suffers from poor robustness and consistency when n and p are large and even becomes undefined when p > n or when S n is singular [26]. This results in all test statistics (as uncertainty scores) concentrating on the singular point leading to trivial estimation of uncertainties. Figure 2 presents an example of comparisons of F (10 , 10) and F (1000 , 1000) to N (0 , 1) . Chen et al. [5] attempt to overcome this issue by proposing the RHT statistic, which resolves the singularity issue of the covariance matrix but yet the inconsistency and poor performance of Hotelling's T 2 statistic under the regime p/n → γ . Li et al. [26] propose adaptable RHT and design an adaptive selection procedure for the loading parameter λ based on the work of Chen et al. [5], which resolves the inconsistency of Hotelling's T 2 .

Bayesian Deep Learning. SOTA DNN architectures [33, 14, 34] demonstrate significant success in tasks from different domains. Their designs enable them to mine high-dimensional features into low-dimensional representations and address the aleatoric uncertainties. Despite the success, the DNNs typically only yield maximum likelihood estimates of weights under the frequentist framework and cannot address epistemic uncertainties [19]. Existing works of BNN assign prior distributions to the neural network weights so as to obtain the posterior distributions of weights given the observed data [36, 11, 29, 17]. This enables BNN to provide a more accurate approximation to the target distribution and address epistemic uncertainties. Particularly when the training observations are limited, using a BNN can prevent overfitting and generate more representative feature distributions.

8 Conclusion

We propose a novel uncertainty estimation framework by introducing high-dimensional hypothesis testing to feature representations. We introduce the ARHT as the uncertainty measure which is adaptable to individual data point and robust compared to existing uncertainty measures. Our proposed uncertainty measure operates on latent features and hence can be generalized to any other tasks beyond image classification (e.g., regression or feature representation learning). Empirical evaluations on OOD detection and image classification tasks validate the satisfactory performance of our method over the SOTAs. Ablation studies on key components of the proposed framework validate the robustness and generalizability of our method to variations. One of the best potential applications of our framework is continual learning, where the proposed method can accurately measure the uncertainty as the domain shifts when encountering non-stationary environments. Our framework can be potentially applied to various settings where distributional shifts and OOD detection are vital, such as medical imaging, computational histopathology, and reinforcement learning.

Acknowledgement. We thank the anonymous reviewers, the area chair, and the program chair for their insightful comments on our manuscript. This work was partially supported by the Research Grants Council of Hong Kong (17308321), the Theme-based Research Scheme (T45-401/22-N), and the National Natural Science Fund (62201483).

References

Xuheng Cai, Chao Huang, Lianghao Xia, and Xubin Ren. Lightgcl: Simple yet effective graph contrastive learning for recommendation. In The Eleventh International Conference on Learning Representations , 2023.

Tsai Hor Chan, Fernando Julio Cendra, Lan Ma, Guosheng Yin, and Lequan Yu. Histopathology whole slide image analysis with heterogeneous graph representation learning. In Proceedings of the IEEE conference on computer vision and pattern recognition , 2023.

Tsai Hor Chan, Chi Ho Wong, Jiajun Shen, and Guosheng Yin. Source-aware embedding training on heterogeneous information networks. Data Intelligence , pages 1-14, 2023.

Bertrand Charpentier, Daniel Zügner, and Stephan Günnemann. Posterior network: Uncertainty estimation without ood samples via density-based pseudo-counts. Advances in Neural Information Processing Systems , 33:1356-1367, 2020.

Lin S Chen, Debashis Paul, Ross L Prentice, and Pei Wang. A regularized hotelling's t 2 test for pathway analysis in proteomic studies. Journal of the American Statistical Association , 106 (496):1345-1360, 2011.

Danruo Deng, Guangyong Chen, Yang Yu, Furui Liu, and Pheng-Ann Heng. Uncertainty estimation by fisher information-based evidential deep learning. arXiv preprint arXiv:2303.02045 , 2023.

Michael Dusenberry, Ghassen Jerfel, Yeming Wen, Yian Ma, Jasper Snoek, Katherine Heller, Balaji Lakshminarayanan, and Dustin Tran. Efficient and scalable bayesian neural nets with rank-1 factors. In International conference on machine learning , pages 2782-2792. PMLR, 2020.

Angelos Filos, Sebastian Farquhar, Aidan N Gomez, Tim GJ Rudner, Zachary Kenton, Lewis Smith, Milad Alizadeh, Arnoud de Kroon, and Yarin Gal. A systematic comparison of bayesian deep learning robustness in diabetic retinopathy tasks. arXiv preprint arXiv:1912.10481 , 2019.

Vincent Fortuin, Adrià Garriga-Alonso, Florian Wenzel, Gunnar Rätsch, Richard E Turner, Mark van der Wilk, and Laurence Aitchison. Bayesian neural network priors revisited. s.l., 2020-12-12. NeurIPS. 1st I Can't Believe It's Not Better Workshop (ICBINB@NeurIPS 2020); Conference Location: Online; Conference Date: December 12, 2020; Conference lecture on 12 December 2020.

Yarin Gal and Zoubin Ghahramani. Dropout as a bayesian approximation: Representing model uncertainty in deep learning. In international conference on machine learning , pages 1050-1059. PMLR, 2016.

Soumya Ghosh, Jiayu Yao, and Finale Doshi-Velez. Model selection in bayesian neural networks via horseshoe priors. J. Mach. Learn. Res. , 20(182):1-46, 2019.

Tom Ginsberg, Zhongyuan Liang, and Rahul G Krishnan. A learning based hypothesis test for harmful covariate shift. arXiv preprint arXiv:2212.02742 , 2022.

Christophe Giraud. Introduction to high-dimensional statistics . CRC Press, 2021.

Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Deep residual learning for image recognition. In Proceedings of the IEEE conference on computer vision and pattern recognition , pages 770-778, 2016.

Harold Hotelling. The generalization of student's ratio. In Breakthroughs in statistics , pages 54-65. Springer, 1992.

Maximilian Ilse, Jakub Tomczak, and Max Welling. Attention-based deep multiple instance learning. In International conference on machine learning , pages 2127-2136. PMLR, 2018.

Laurent Valentin Jospin. Hands-on bayesian neural networks-a tutorial for deep learning users. 2020.

Tapas Kanungo and Robert M Haralick. Multivariate hypothesis testing for gaussian data: Theory and software. Technical Report ISL Tech. Report: ISL-TR-95-05 , 1995.

Alex Kendall and Yarin Gal. What uncertainties do we need in bayesian deep learning for computer vision? Advances in neural information processing systems , 30, 2017.

Alex Krizhevsky, Ilya Sutskever, and Geoffrey E Hinton. Imagenet classification with deep convolutional neural networks. Advances in neural information processing systems , 25, 2012.

Balaji Lakshminarayanan, Alexander Pritzel, and Charles Blundell. Simple and scalable predictive uncertainty estimation using deep ensembles. Advances in neural information processing systems , 30, 2017.

Yann LeCun, Bernhard Boser, John Denker, Donnie Henderson, Richard Howard, Wayne Hubbard, and Lawrence Jackel. Handwritten digit recognition with a back-propagation network. Advances in neural information processing systems , 2, 1989.

Kimin Lee, Honglak Lee, Kibok Lee, and Jinwoo Shin. Training confidence-calibrated classifiers for detecting out-of-distribution samples. In 6th International Conference on Learning Representations, ICLR 2018 , 2018.

Bin Li, Yin Li, and Kevin W Eliceiri. Dual-stream multiple instance learning network for whole slide image classification with self-supervised contrastive learning. In Proceedings of the IEEE/CVF conference on computer vision and pattern recognition , pages 14318-14328, 2021.

Chun-Liang Li, Kihyuk Sohn, Jinsung Yoon, and Tomas Pfister. Cutpaste: Self-supervised learning for anomaly detection and localization. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition , pages 9664-9674, 2021.

Haoran Li, Alexander Aue, Debashis Paul, Jie Peng, and Pei Wang. An adaptable generalization of hotelling's t 2 test in high dimension. The Annals of Statistics , 48(3):1815-1847, 2020.

Andrey Malinin and Mark Gales. Predictive uncertainty estimation via prior networks. Advances in neural information processing systems , 31, 2018.

Andrey Malinin and Mark Gales. Reverse kl-divergence training of prior networks: Improved uncertainty and adversarial robustness. Advances in Neural Information Processing Systems , 32, 2019.

Eric Thomas Nalisnick. On priors for Bayesian neural networks . University of California, Irvine, 2018.

Charles R Qi, Hao Su, Kaichun Mo, and Leonidas J Guibas. Pointnet: Deep learning on point sets for 3d classification and segmentation. In Proceedings of the IEEE conference on computer vision and pattern recognition , pages 652-660, 2017.

Charles Ruizhongtai Qi, Li Yi, Hao Su, and Leonidas J Guibas. Pointnet++: Deep hierarchical feature learning on point sets in a metric space. Advances in neural information processing systems , 30, 2017.

Murat Sensoy, Lance Kaplan, and Melih Kandemir. Evidential deep learning to quantify classification uncertainty. Advances in neural information processing systems , 31, 2018.

Christian Szegedy, Wei Liu, Yangqing Jia, Pierre Sermanet, Scott Reed, Dragomir Anguelov, Dumitru Erhan, Vincent Vanhoucke, and Andrew Rabinovich. Going deeper with convolutions. In Proceedings of the IEEE conference on computer vision and pattern recognition , pages 1-9, 2015.

Mingxing Tan and Quoc Le. Efficientnet: Rethinking model scaling for convolutional neural networks. In International Conference on Machine Learning , pages 6105-6114. PMLR, 2019.

David Thissen, Lynne Steinberg, and Daniel Kuang. Quick and easy implementation of the benjamini-hochberg procedure for controlling the false positive rate in multiple comparisons. Journal of educational and behavioral statistics , 27(1):77-83, 2002.

Ba-Hien Tran, Simone Rossi, Dimitrios Milios, and Maurizio Filippone. All you need is a good functional prior for bayesian deep learning. Journal of Machine Learning Research , 23(74): 1-56, 2022.

Shenzhi Wang, Liwei Wu, Lei Cui, and Yujun Shen. Glancing at the patch: Anomaly localization with global and local feature comparison. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition , pages 254-263, 2021.

Shujun Wang, Yaxi Zhu, Lequan Yu, Hao Chen, Huangjing Lin, Xiangbo Wan, Xinjuan Fan, and Pheng-Ann Heng. Rmdl: Recalibrated multi-instance deep learning for whole slide gastric image classification. Medical image analysis , 58:101549, 2019.

Overview. In the appendix, we first provide more explanations on the ARHT test statistic in Section A. We then present a detailed summary of the datasets in Section B. Additional experiment results and analysis are reported in Section C Detailed descriptions of distributions used for BNN training are provided in Section D. We further present the implementation settings, hyperparameters and settings of baseline methods in Section E. We give the definitions of uncertainty measures used for comparison in Section F, together with an algorithm of our framework (Algorithm 1).

A Additional Discussion on ARHT

Why using ARHT? One of our motivations is to formulate uncertainty estimation as a hypothesis testing problem, where we interpret high-dimensional test statistics as distance measures. The ARHT can be viewed as a distance measure between each testing sample and the in-distribution sample, where a larger ARHT indicates the sample is more likely to be OOD. The detection of OOD is then determined by a threshold, while the optimal threshold can be obtained by the Benjamini-Hochberg (BH) procedure. One advantage of ARHT is that it directly operates on the sampling distributions of the latent features, and hence it does not require parametric assumptions on the latent features or logits (e.g., assuming a Dirichlet distribution on class probabilities), which makes it a more robust metric for uncertainty estimation.

Motivation of loading λ I p : This is a standard way to ensure the covariance matrix to be positive definite (and thus invertible) and hence improve the numerical stability.

Why does ARHT follow the standard normal distribution? : The major part of Li et al. [26] is to prove why ARHT ( λ ) follows the standard Gaussian distribution. The proof is complex and hence is not focused in this paper. Intuitively, ARHT ( λ ) can be viewed as a 'standardized' version of RHT (i.e., known as Mahalanobis distance) by its theoretical mean and SD, for which the derivations are detailed in Li et al. [26]

Intuitive explanation and detailed derivation of the BH procedure: Although the BH procedure may not be intuitive to the general audience, it is well-known in the statistics community due to multiple testing issues. Intuitively, we consider the OOD detection procedure for each testing image as a hypothesis testing problem. Then, such a procedure for the whole testing set can be viewed as a multiple-testing problem (i.e., conducting a large number of tests). However, applying a universal threshold for all tests (e.g., α = 0 . 05 ) is too conservative and leads to many false discoveries. Hence, the BH procedure is applied to assign a threshold adaptable to each sample according to the p -values of all tests such that the false discovery rate (FDR) can be minimized.

B Additional Information on Datasets

Table 6 presents a summary of the datasets used for the experiments. We use eight image datasets to evaluate our method, including natural images and medical images.

Diabetes Retinopathy Detection (DRD). For this experiment, we define in-distribution samples as healthy (no DR; with label 0), and OOD samples as DR (mild, moderate, severe, or proliferative DR; corresponding to labels 1-4). We select 50 healthy images to train the encoder, and compute µ 1 and

Σ 1 from these samples using the trained encoder. For testing, we select 50 images as in-distribution data and 50 images as the OOD data. All images are resized to 64 × 64 for computational convenience. We train the encoder with a task to classify whether the input image is the left eye or right eye. The examples of healthy and DR are presented in Figure 8.

ooo

(a) Healthy samples, y = 0.

(b) Unhealthy samples, y = 1.

C Additional Experiment Results

We first present the OOD detection results on a more realistic dataset (i.e., TinyImageNet), with a more realistic architecture (e.g., ResNet50). We also include more baseline methods for comparison. Additionally, to study the effect of the encoder quality on OOD detection performance, we use the training accuracy at different epochs to measure the quality of the encoder, and assess how the OOD detection performance changes accordingly.

C.1 More Realistic Datasets.

We have conducted additional experiments on OOD detection, with CIFAR10 as the in-distribution dataset and TinyImageNet as the OOD dataset. The results are presented in Tables 7 and 8, which show that the uncertainty estimation still performs satisfactorily when being generalized to larger datasets.

C.2 Scalability

We aim to use the Bayesian counterpart of a smaller architecture to demonstrate the capability of BNNs to generate latent feature distributions (for details see the discussion section in the main text). One can generate ideal feature distributions using very large frequentist vision models (e.g., ViT), which however induces enormous complexity in training and inference.

A related ablation experiment comparing the frequentist and Bayesian architecture is presented in the main text. We additionally conduct an experiment with the Bayesian model architecture scaled up to ResNet50. We further conduct an experiment using the frequentist ResNet50 (the hypothesis test reduces to a one-sample test) and the testing AUROC is 72.77. These results validate the scalability of our method to large and modern vision architectures.

C.3 Encoder Quality

To assess the effect of the encoder quality, we fix the encoder (e.g., LeNet) when comparing our framework with the current SOTA methods. Since the baseline methods are trained on classification problems (e.g., the CIFAR 10 image classification and DRD auxiliary task), we use the training accuracy at different epochs to measure the quality of the encoder. We observe that the OOD detection performance is monotonously improved with the increase in the training accuracy (i.e., the encoder quality). Figure 9 presents an example of the OOD detection experiment on CIFAR10 and TinyImageNet.

C.4 Influence of n 2 .

Figure 11 presents the OOD detection results under a more complex setting (In-distribution: CIFAR10, OOD: SVHN). We observe a similar pattern to that in Figure 5 in the main text. This shows that the sample covariance is more influenced by the n 1 training/in-distribution samples, making the test statistics reflect more the training distribution (hence the overall consistent pattern). Future work on variance-adjusted test statistics may put more weight on the feature distributions of testing samples, so that we would more easily observe performance improvement as n 2 increases in this case.

C.5 Under the Regression Setting.

We choose OOD as the benchmark task since it is the most common benchmark for uncertainty estimation. We additionally construct a regression setting with two multivariate Gaussian distributions of different means and variances indicating different distributions. Most of the uncertainty estimation frameworks cannot be applied to this setting because they only work under the classification settings.

ValidationAuC

BLeNet_ARHT_CIFAR10_ImageNet

0.64

0.62

0.6

0.58

0.56

0.54

0.52

Train Accuracy

0.2

0.3

0.4

0.5

0.6

Performancebys

Performance by n_2

100

100

90

90

80

80

70

70

60

60

50

50

40

40

30

30

20

20

10

10

2

3

4

5

5

10

20

50

100

200

500

1000

S

n_2

■AUCROC

■AUPR

■AUCROC

AUPR

The results in Table 10 show that our method also achieves satisfactory performance under the regression settings, demonstrating its generalizability to other tasks.

C.6 Comparison with More Baselines

More baselines on uncertainty estimation are added for comparison: (1) I-EDL [6]: use the Fisher information matrix to measure the informativeness of evidence carried by each sample; and (2) RKLPN [28]: prior networks trained with the reverse KL divergence. Table 11 presents the additional results, from which we observe that our method still achieve the state-of-the-art performance with more baselines included.

D Multivariate Gaussian Distribution

The multivariate Gaussian distribution is crucial for the approximation of a vanilla BNN [17]. We provide the formal definition and its important properties in this section. The density of a multivariate

Gaussian distribution is defined as

where µ ∈ R p is a p -dimensional mean vector and Σ ∈ R p × p is the covariance matrix. The KL divergence between two multivariate normal distributions N ( µ 1 , Σ 1 ) and N ( µ 2 , Σ 2 ) is given by

E Baseline Methods and Implementation Details

Implementation Details. We present additional implementation details and hyperparameter settings. We first provide the key settings and adaptations applied to the baseline methods for reproducibility. We follow the default settings for other fine-grained parameters (e.g., learning rates).

The proposed method is implemented in Python with Pytorch library on a server equipped with four NVIDIA TESLA V100 GPUs. The dropout ratio of each dropout layer is selected as 0.2. All models are trained with 100 epochs with possible early stopping. We use the Adam optimizer to optimize the model with a learning rate of 5 × 10 -5 and a weight decay of 1 × 10 -5 . Data augmentations such as color jittering and random cropping and flipping are applied as a regularization measure.

Hyperparameter Settings. The hyperparameter settings for BNN training and ARHT testing are given as follows:

Prior mean of weights - sampled from N ( -3 , 0 . 01)

s = 5

n 2 = 300

λ 0 = 0 . 01

Additional Settings of Baseline Methods. We further introduce the experimental settings of baseline methods:

Deep ensembles [21]: Set the number of ensembles as 5.

MCDropout [10]: Set the dropout ratio as 0.2 for both training and inference.

Kendall and Gal: Set the number of inference weight samples as 20.

Detectron [12]: Set the number of runs as 100.

PostNet [4]: Because the original codes operate on the features extracted from the standard datasets, this method cannot be generalized to new datasets (e.g., SVHN) due to unavailability of the data processing codes.

F Uncertainty Measures

We describe the uncertainty measures used in the OOD misclassification task in this section. These definitions are well-known and summarized in Malinin and Gales [27],

Entropy:

Differential entropy:

where P ( w c |D ) is the predictive probability of class c , and K is the number of classes for classification.

Maximum probability: we take the maximum predicted probability P from all classes as the confidence score,

where S K -1 is the supporting set, and µ is the predictive class probability assumed to follow a Dirichlet distribution.

Accuracy: the fraction of correct predictions to the total number of ground truth labels.

F-1 score: The F-1 score for each class is defined as

where 'recall' is the fraction of correct predictions to the total number of ground truths in each class and 'precision' is the fraction of correct predictions to the total number of predictions in each class.

AUROC: the area under the receiver operating curve (ROC) which is the plot of the true positive rate (TPR/Recall) against the false positive rate (FPR).

AUPR: the area under the precision-recall curve. Note that the AUPR for binary classification is sensitive to the distribution of positive and negative classes. Hence, the higher AUPR does not necessarily imply a better model performance.

G Algorithm

Algorithm 1 gives the detailed workflow of our proposed uncertainty estimation framework.

Algorithm 1 Our proposed uncertainty estimation framework

Peer reviews:
{"IS_META_REVIEW": false, "comments": "SUMMARY:\nThe paper presents a new framework for uncertainty estimation in baysian neural networks. The core contribution is formulating uncertainty estimation as multiple high-dimensional hypothesis testing problem and deriving the test statistics necessary. The paper then present multiple empirical results, showing good performance in well established benchmarks and a excellent ablation study of relevant hyperparameters of their proposed method.\n\nSTRENGTHS:\nOriginality: \nThe core idea of the paper of formulating uncertainty estimation as hypothesis testing seems novel. The paper essentially combines already established methods, BNNs with hypothesis testing (both which are well know), into a new exiting direction for this line of work. \n\nQuality:\nThe paper is of high quality, both in outlining the method and their experimental section. For example, it is nice to see standard deviations added for nearly all results and a lot of relevant baselines to compare against. The inclusion of DRD datset, to test the method on a more \"real-life\" dataset is also a welcome addition and really shows the that the methods does not only work on benchmark datasets.\n\nClarity:\nThe paper is well written and easy to follow.\n\nSignificance:\nThe paper does open a new sub-direction within uncertainty estimation, regarding the use of hypothesis testing. Only time will tell how influential this will be. I am not truly convinced that the ARHT testing size is the correct way to go as it still involves an assumption of sub-Gaussuanity on its input.\n\nThe core strength of the paper is its section 5 regarding the ablation studies. The framework presented in the paper includes a lot of \"moving parts\" and therefore without a thoroughly investigation on which parts of this many layered method, it would be impossible to say which had a significant impact on the performance of the framework. The ablation study does a good job highlighting how each component feeds into the framework.  \n\nAlso, thanks to the authors for providing anonymised code, helped understand parts of the paper.\n\nWEAKNESSES:\nIn L56-58 the authors claims that \"We formulate uncertainty estimation as a multiple high-dimensional hypothesis testing problem, and propose a Bayesian deep learning module to address better the aleatoric and epistemic uncertainties when learning feature distributions.\". While I agree with the first part of the sentence, I would say the second part is not a contribution as too my knowledge the BNN framework used in the paper is not novel, which there is nothing wrong with, but should not be listed as a contribution. \nIn that regard I think the authors could make it more explicit that the first part of their framework is not unique in any sense, and therefore could be any BNN. Regarding results, similarly the authors should be more honest about their results. L206-206 state that their method is \"superior\", however if accounting for standard deviations the results only seems significant in a single case.\nThus overall, authors should adjust the claims in their paper to better reflect the work presented. \n\nA small correction/question: From L130-139, the authors provide a bunch of equations, where the choice of parenthesises seems very arbitrarily. Sometimes {} is used, sometimes [] is used. sometimes () is used. It is confusing. Additionally in L139 there seems to be missing a \"/\" between what I assume is the nominator and denominator in a fraction.\n\nQUESTIONS:\n* Have the authors any thoughts on the influence of n_1, e.g. the size of the training set? For all datasets tested in the paper this is fixed, but the number of samples in the training distribution compared to the test distribution seems to be important for this method to work.\n\n* Regarding Figure 5: Have the authors tried out this kind of ablation studies on other dataset combinations to see if they experience similar pattern? Mnist-FMnist is one of the easier cases for OOD and I wonder if this has something to do with the observed robustness of the method.\n\n* Regarding Figure 5: The results from varying n_2 is strange to me. I would assume as we sample more test datapoints we get more certain about the test distribution making it easier to distinguish for the test distribution, however this does not seem to be the case. Does the authors have an explanation for this?\n\nLIMITATIONS:\nAs the authors state in L300-302, BNNs are still hard to scale which seems to be the main limitation this line of work. That said, assuming that in future this gets solved this method seems very easy to apply.\n\nAnother limitation of the method, seems to be that it is limited to OOD, or at least tasks where distributions are compared. OOD is an important tasks, however just estimating the predictive uncertainty of a single sample is similarly important, which the framework does not seem to support.", "TITLE": "Official Review", "RECOMMENDATION": 6, "REVIEWER_CONFIDENCE": 4, "SOUNDNESS_CORRECTNESS": 4, "DATE": "2023-06-26"}

{"IS_META_REVIEW": false, "comments": "SUMMARY:\nThis paper proposes a framework to detect out-of-distribution (OOD) data via high-dimensional testing on latent representations.\n\nThe proposed framework consists of:\n- a Bayesian Neural Network that, for any input, can produce an ensemble of latent presentations by sampling the posterior of the weights\n- a hypothesis testing procedure that computes the adaptable regularized Hotelling's $T^2$ score (ARHT) as a measure of uncertainty, and classifies the input as OOD when the ARHT score is larger than a threshold calibrated by the Benjamini-Hochberg (BH) procedure\n\nThe paper demonstrates the superior performance of the proposed framework on standard OOD detection benchmarks and a medical image dataset.\n\nSTRENGTHS:\n- The idea of using Bayesian NN to generate an ensemble of latent representations, and then leveraging the ARHT score as a measure of uncertainty is novel, interesting, and useful for many practical applications\n\n- The paper is generally well written and easy to follow.\n\nWEAKNESSES:\n- A major weakness of this paper is that, for readers who do not have a statistical background, the ARHT score, i.e., equations (1)-(4), appear to come from nowhere. Particularly, I think the paper will be much easier to appreciate if comments and explanation could be made about:\n    - What is the intuitive explanation of the Hotelling's $T^2$ test statistic $T$? Why should we believe it is a good metric for separating in-distribution and OOD samples?\n    - What is the motivation of loading a scaled identity matrix to $T$? In the related work section (which appears at the end of the paper) you seem to state that was due to the potential singularity of the matrix $S_n$. I believe you should state this earlier when you present the equation (2) and (3).\n    - Why the ARHT score $T(\\lambda)$ satisfies a Gaussian distribution $\\mathcal{N}(0,1)$? This claim seems to come from reference [24]. I believe you need to briefly explain this to the reader.\n\n- Section 3.4 describes the B-H procedure without intuitive explanation and detailed derivation. I think more contents are need to explain this, at least in the supplementary materials.\n\n- There are many typos in the manuscript. The authors should carefully review the grammar if the paper was accepted.\n\nQUESTIONS:\n- The paper says that $T(\\lambda) \\sim \\mathcal{N}(0,1)$, but looking at Figure 4, the scores do not appear to be Gaussian, and the scale of the scores grows to several thousands. Is my understanding about Fig. 4 wrong, or there is some mistake in plotting the figure?\n\n- To computer $RHT(\\lambda)$ in equation (3), one needs to invert the matrix $S_n + \\lambda I_p$, which has size $p$ that is the dimension of the latent representation. What if $p$ grows to, say one million? Would it still be possible to compute the score? Also the paper does not seem to clearly state the runtime of the proposed algorithm.\n\nLIMITATIONS:\nN/A", "TITLE": "Official Review", "RECOMMENDATION": 6, "REVIEWER_CONFIDENCE": 4, "SOUNDNESS_CORRECTNESS": 3, "DATE": "2023-06-30"}

{"IS_META_REVIEW": false, "comments": "SUMMARY:\nThe paper proposes BNN-ARHT, which introduces a uncertainty estimation framework that uses high dimensional hypothesis testing in the feature space of a network. The key idea is to use ARHT to determine in vs outliers in a feature space, and so it is generic and broadly applicable to any kind of task and network type trained with supervised or unsupervised objectives. In particular, the paper relies on a Bayesian encoder to compute the ARHT on train and test data, that is trained with Stochastic Variational Inference (SVI). The testing statistic is the Hotelling’s $T^2$ test statistic, of which the adaptable and regularized version is used. The threshold $\\lambda$ is tuned from a pre-defined set for each sample, and for each task separately which is argued to produce the best results\n\nSTRENGTHS:\n* ARHT seems to be a interesting and novel statistic from the uncertainty estimation point of view.\n* An appealing aspect of the proposed approach is that it can work in arbitrary feature spaces, which vastly expands its applicability. This is also relatively under studied as compared to most approaches that compute uncertainty in the output space. \n* Predictive performance on the networks tested is preserved, while retaining benefits of OOD detection. Good ablation studies are performed to understand the characteristics of the method. \n* The finding that the method can be used with a encoder trained with supervised or unsupervised architecture is very interesting, and raises several intriguing questions. This can be studied in more detail — perhaps a related work is \"Predictive Inference with Feature Conformal Prediction” from ICLR 2023. https://arxiv.org/abs/2210.00173\n\nWEAKNESSES:\n* The paper only compares with few uncertainty estimation methods for the OOD detection setup — whereas i think it should compare more comprehensively with the wide range of state of the art techniques that have achieved high performance on all the benchmarks considered here. \n* The lack of more realistic OOD benchmarks is a limitation. The experiments are only done on CIFAR10/MNIST with simple networks (ResNet18) whereas it is essential to validate these interesting claims on more realistic benchmarks. \n* The generality of the approach needs to be rigorously evaluated — UQ for regression, and tasks other than classification can be evaluated and compared against existing methods. \n* On UQ -- why is OOD the only application considered? OOD benchmarks are often artificial and can have a lot of artifacts which can aid in detection (See for e.g. Semantically Coherent Out-of-Distribution Detection, ICCV '21). Tasks like Bayesian function optimization can shed more light on the quality of uncertainties, and its performance on regression. \n* Scalability needs to be addressed — a big limitation is the scalability of the proposed approach to bigger and more realistic datasets and networks. Even for ResNet18 considered here, the only a single layer is replaced with its BNN equivalent. it’s unclear why the last layer is optimal, or how this choice can be made in other settings. Further, the threshold needs to be identified each time for each task, which is a computational burden, that other competing methods do not have.\n\nQUESTIONS:\nMy main concerns are regarding the lack of more comprehensive evaluation for OOD detection. Using better baselines, large scale benchmarks and more modern architectures.\n\nLIMITATIONS:\nYes", "TITLE": "Official Review", "RECOMMENDATION": 6, "REVIEWER_CONFIDENCE": 4, "SOUNDNESS_CORRECTNESS": 3, "DATE": "2023-07-02"}

{"IS_META_REVIEW": false, "comments": "SUMMARY:\nThis paper proposes an OOD detection procedure by applying adaptable regularized Hotelling’s T-square (ARHT) test [24] on the feature representation of learned BNN networks. Authors introduced the application o ARHT on BNN encoder, and proposed a procedure to adaptively calibrate detection threshold based on Benjamini–Hochberg (BH) procedure. On a suite of low-dimensional image experiments (CIFAR, MNIST, OMNIGLOT, SVHN) and a medical image benchmark (DRD) and using small architectures (e.g., LeNet, AlexNet, ResNet18), authors illustrates that the proposed method clearly outperforms previous methods in terms of OOD AUC. Thorough ablation study is conducted.\n\nSTRENGTHS:\n* An novel approach to OOD detection leveraging multivariate tests and associated calibration procedures.\n* Authors conducted thorough experiment on academic benchmarks to show the advantage of the approach.\n\nWEAKNESSES:\n* Some description of previous literature may be incorrect. For example, in line 43-48, authors mentions that (1) BNNs perform poorly when the dimension of the output is high. (2) BNN are limited to classification problems. I am not sure if either of these are true for modern BNNs. For example, [rank-1 BNN](https://arxiv.org/pdf/2005.07186.pdf) outperforms their deterministic counterparts on ImageNet, and regression is a rather standard BNN task (e.g., conducted on UCI benchmarks).\n\n* The experiments are done on rather simplistic architectures and benchmarks.  Therefore the generalization of this approach (either in terms of quality and computational feasibility) to more realistic data setting (e.g., ImageNet) and nontrival modern large models is less clear. \n\n* I find that the point \"our framework is sensitive to the quality of the encoder\" (line 260-266) to be rather important. Three suggestions regarding this point: \n\n   * this seems to contradict the paper's claim that ARHT is superior to traditional BNN whose \"performances heavily rely on the feature encoder and are poor when the features are of poor quality\" (line 48). As it seems ARHT suffer a similar issue but to a lesser extent. I recommend adjust the descriptions in 48-50 correspondingly so it is not misleading (maybe refocus (3) in terms of sample efficiency). \n  * It would be interesting to have a more thorough investigation on the relationship between encoder quality v.s. OOD detection performance, where encoder quality can be quantified in terms of standard representation learning metric such as linear probing accuracy.  This can be done via a scaling study of different sample sizes and / or architectures. I think a study like this can possibly show ARHT performance is associated with encoder quality, but can achieve a stronger OOD performance when compared to other method under the same accuracy.\n  * Please consider discussing this in the limitation section.\n\nQUESTIONS:\nSee Weakness.\n\nLIMITATIONS:\nSee Weakness.", "TITLE": "Official Review", "RECOMMENDATION": 6, "REVIEWER_CONFIDENCE": 3, "SOUNDNESS_CORRECTNESS": 3, "DATE": "2023-07-10"}