2. Epistemic uncertainty: Uncertainty in the model parameters that is reduced with more train-
ing examples.c
Practically, OoD data should consist of inputs for which the neural network has high epistemic
uncertainty, because epistemic uncertainty could have been reduced by including the OoD data
inside the training set [3].
Bayesian neural networks (BNNs) are a variant of DNNs where the parameters are random
variables rather than fixed values. Training BNNs involves using Bayes’ theorem to infer probability
distributions over their parameters based on observed training data and prior knowledge. BNNs
can provide better calibrated uncertainty estimates than conventional DNNs, and by representing
weights as random variables, BNNs are capable of quantifying epistemic uncertainty. Aleatoric
uncertainty can also be estimated with BNNs: this uncertainty is typically obtained by training a
BNN to explicitly predict the aleatoric uncertainty rather than relying on the stochasticity of the
model parameters themselves [4]. The ability of BNNs to predict both types of uncertainties has
made BNNs attractive for UQ, and more specifically they have been studied for the problem of
OoD detection.
Some previous literature in OoD detection with BNNs has studied this problem using the
framework of Gaussian processes (GPs), because infinite-width BNNs with Gaussian priors over
the weights are equivalent to GPs for this problem [5]. The paper [6] tackles OoD detection using
Neural Linear Models (NLMs) and an augmentation of the data with additional points lying on
the periphery of the training data and connects this with OoD detection with GPs and BNNs. The
reference [7] shows how BNNs can be used for OoD detection using the max probability, entropy,
mutual information, and differential entropy from the output vector of the DNN and shows that
the BNNs outperform DNNs trained for the same task. Others have criticized the use of BNNs
for OoD detection, arguing that OoD detection with BNNs is sensitive to the choice of prior over
the weights and may have a trade-off with generalization [8]. In this paper, we expand upon these
results by examining the problem of OoD detection with BNNs under a simplistic framework where
inputs are marked as in-distribution or out-of-distribution based upon previously seen values of
epistemic uncertainty in a validation dataset. Instead of using max probability, entropy, mutual
information, or differential entropy for OoD detection as in [7], we base our discriminator on
epistemic uncertainty as introduced in [9] for a simple regression setting.
We train BNNs for regression on a dataset of event images with a well-defined, parameterized
generating function. The BNNs are tested on OoD test inputs that are formed by corrupting in-
distribution (iD) images with noise that is uncharacteristic of the training set, or by superimposing
iD images with images from a different dataset. We compare the OoD detection capability of
BNNs to that of Generative Adversarial Networks (GANs). The discriminator network in a GAN
is rewarded for detecting the outputs of a generator network as OoD, while the generator network
is rewarded for fooling the discriminator. The GAN is therefore naturally suited to the task of OoD
detection and is a useful comparison point for BNN-based OoD detection, despite the difference in
the detection mechanism.
This paper begins with a brief review of Bayesian statistical methods and BNNs in Section 3.
Section 4introduces the dataset of event images with well-defined properties that are used to train
the networks in this study. Section 5relates aleatoric and epistemic uncertainty to qualitative dif-
ferences in various images from the motivating dataset. Section 6.5 demonstrates that the epistemic
uncertainty predicted by BNNs can be used to detect OoD inputs and compares the approach to
OoD detection using the discriminator network in a GAN. Overall, we find that the BNN epistemic
uncertainty approach to OoD detection has similar sensitivity to the GAN approach. The advan-
tage of the BNN is that the OoD detection capability is built into the same model that is trained
2