# Credal Wrapper of Model Averaging for Uncertainty Estimation on Out-Of-
Distribution Detection

Kaizheng Wang∗Fabio Cuzzolin†Keivan Shariatmadar‡David Moens‡Hans Hallez ∗
∗M-Group and DistriNet Division, Department of Computer Science, KU Leuven,
Belgium
‡LMSD Division, Department of Mechanical Engineering, KU Leuven, Belgium
†Visual Artificial Intelligence Laboratory, Oxford Brookes University, UK
{kaizheng.wang, keivan.shariatmadar, david.moens<EMAIL_ADDRESS>
<EMAIL_ADDRESS>
###### Abstract

This paper presents an innovative approach, called _credal wrapper_ , to
formulating a credal set representation of model averaging for Bayesian neural
networks (BNNs) and deep ensembles, capable of improving uncertainty
estimation in classification tasks. Given a finite collection of single
distributions derived from BNNs or deep ensembles, the proposed approach
extracts an upper and a lower probability bound per class, acknowledging the
epistemic uncertainty due to the availability of a limited amount of sampled
predictive distributions. Such probability intervals over classes can be
mapped on a convex set of probabilities (a ‘credal set’) from which, in turn,
a unique prediction can be obtained using a transformation called
‘intersection probability transformation’. In this article, we conduct
extensive experiments on multiple out-of-distribution (OOD) detection
benchmarks, encompassing various dataset pairs (CIFAR10/100 vs SVHN/Tiny-
ImageNet, CIFAR10 vs CIFAR10-C, CIFAR100 vs CIFAR100-C and ImageNet vs
ImageNet-O) and using different network architectures (such as VGG16,
Res18/50, EfficientNet B2, and ViT Base). Compared to BNN and deep ensemble
baselines, the proposed credal representation methodology exhibits superior
performance in uncertainty estimation and achieves lower expected calibration
error on OOD samples.

##  1 Introduction

Despite their success in various scientific and industrial areas, deep neural
networks often generate inaccurate and overly confident predictions when faced
with uncertainties induced by, e.g. out-of-distribution (OOD) samples, natural
fluctuations or adversarial disruptions 58; 76; 34; 29. Properly estimating
the uncertainty associated with their predictions is key to improve the
reliability and robustness of neural networks 62; 37; 61.

Researchers in the field of uncertainty theory commonly distinguish two types
of uncertainty in the context of neural networks (and machine learning models
in general). Aleatoric Uncertainty, also known as ‘data’ uncertainty, arises
from inherent randomness such as data noise and is irreducible. Epistemic
Uncertainty stems from the lack of knowledge of the data generation process
and can be reduced with increased availability of training data 34. The
distinction between AU and EU can be beneficial in applications such as active
learning or OOD detection, particularly in safety-critical and practical
fields such as autonomous driving 77 and medical diagnosis 44. For instance,
in active learning, the objective is to avoid inputs that exhibit high
aleatoric uncertainty but low epistemic uncertainty. Similarly, an effective
EU estimation can prevent the misclassification of ambiguous in-distribution
(ID) examples as OOD instances 53.

In this paper, we propose a new method for accurate uncertainty estimation and
compare this with widely used methods, such as Bayesian Neural Networks and
Deep ensembles.

The Bayesian neural network (BNN) framework is a prominent method for
uncertainty estimation 5; 21; 41; 50. BNNs learn the posterior distributions
of a network’s weights, and thus predict a ‘second-order’ distribution (a
distribution of distributions 34) over the target space of the network. While
BNNs are straightforward to construct, their practical training presents a
significant challenge due to inherent computational complexity. Consequently,
several approximation algorithms, such as sampling methods 54; 32; 31; 14; 67;
59 and variational inference approaches 5; 21, have been developed 36. As
computing the exact ‘second-order’ distribution generated by full Bayesian
inference at prediction time is of prohibitive complexity, Bayesian model
averaging (BMA) is often applied in practice 21. The latter entails sampling a
finite set of deterministic weight values from the posterior (obtained after
training) to generate a range of single (softmax) distributions via the
network. BMA averages such distributions taken as the final prediction. Still,
in practice, BNNs are challenging to scale to large datasets and architectures
due to high computational complexity 53, so a limited number of samples is
often employed prior to BMA to reduce complexity at inference time.

Deep ensembles, an established alternative approach for quantifying
uncertainty, have been recently serving as the state-of-the-art uncertainty
estimation baseline in deep learning 43; 57; 25; 1. Deep ensembles marginalize
multiple deterministic models to obtain a predictive distribution instead of
explicitly inferring a distribution over the parameters like BNNs 43; 4. At
prediction time, deep ensembles average a finite set of single probability
distributions to derive a predictive distribution for classification 4.
Despite their successes in uncertainty quantification, a recent study has
shown that the EU estimates of deep ensembles may demonstrate relatively low
quality 1. They have also been criticized due to their substantial demand for
memory resources and computational power 47; 8; 26.

Two issues are commonly associated with model averaging for BNNs and deep
ensembles at prediction time. Firstly, the number of single distributions
generated for approximating the exact predictive distribution is quite limited
(e.g., most papers use up to five), due to computational complexity and memory
constraints 43; 36. Secondly, model averaging can result in an overly
confident and erroneous prediction when the sampled distributions exhibit a
conflict opinion regarding the class and a minority of the individual
distributions ‘lead’ to the correct decision.

Numerous mathematical theories, including subjective probability 16,
possibility theory 74; 20, credal sets 42; 46, probability intervals 66; 15,
random sets 55, and imprecise probability theory 69, have been devised in
response to the challenge posed by the limited availability of in-domain
training data (in our case, a limited number of sample precise distributions).
These theories state that the exact probability distribution is inaccessible
and that the available evidence should instead be used to impose specific
constraints on the ‘unknown’ distribution.

Probability intervals represent one of the simplest approaches and have
garnered significant interest among researchers 73; 24; 70; 13. Instead of
providing point-valued probabilities, probability intervals assume that the
probability values $p(y)$ of the elements (e.g., the classes) of the target
space (e.g., the set of classes) belong to an interval
$p_{L}(y)\\!\leq\\!p(y)\\!\leq\\!p_{U}(y)$, delimited by a lower probability
bound $p_{L}(y)$ and an upper probability bound $p_{U}(y)$. Researchers have
claimed that probability intervals may express uncertainty more appropriately
than single probabilities 15; 6; 24, particularly in situations in which: (i)
limited information is available for estimating the unknown and exact
probabilities; (ii) individual pieces of information are in conflict: e.g.,
when three predictors for the weather condition (rainy, sunny, or cloudy)
predict probability vectors $(0.2,0.6,0.2)$, (0.1, 0.2, 0.7), and (0.7, 0.1,
0.2), respectively. Such undesirable scenarios can arise when employing BNN
model averaging or deep ensembles using a limited number of predictive
samples, as we discuss here.

Novelty and Contribution This paper presents an innovative methodology for
formulating a credal set representation for both Bayesian Model Averaging in
BNNs and deep ensembles, capable of improving these models’ uncertainty
estimation in classification tasks, which we term _credal wrapper_. Given a
limited collection of single distributions derived at prediction time from
either BNNs or deep ensembles, the proposed approach computes a lower and an
upper probability bound per class, to acknowledge the ‘epistemic’ uncertainty
about the sought exact predictive distribution due to limited information
availability. Such lower and upper bounds on each class’ probability induce,
in turn, a convex set of probabilities, known as a _credal set_ 46; 15; 13.
From such a credal prediction (the output of our credal wrapper), a precise
predictive distribution can be derived using a transform called _intersection
probability_ 13, in whose favor theoretical arguments exist as the natural way
of mapping a credal set to a single probability 11.

Extensive experiments are performed on several OOD detection benchmarks
including different dataset pairs (CIFAR10/100 vs SVHN/Tiny-ImageNet, CIFAR10
vs CIFAR10-C, CIFAR100 vs CIFAR100-C, and ImageNet vs ImageNet-O) and
utilizing various network architectures (VGG16, Res18/50, EfficientNet B2 and
ViT Base). Compared to BNN and deep ensemble baselines, the proposed credal
representation approach demonstrates improved uncertainty estimation and lower
expected calibration error on the corrupted OOD samples when using the
intersection probability.

Other Related Work Credal sets have attracted increasing attention of late, as
shown by research efforts within the broader field of machine learning for
uncertainty quantification 75; 10; 9; 48; 34; 63; 60. The advantage of
adopting credal sets is the integration of notions of set and probability
distribution in a single, unified framework. Using credal sets, rather than
individual distributions, arguably allows models to more naturally express
epistemic uncertainty 9; 34. Concerning deep neural networks, ‘imprecise’ BNNs
7 modeling the network weights and predictions as credal sets have been
proposed. Despite demonstrating robustness, the computational complexity of
imprecise BNNs is comparable to that of the ensemble of BNNs, posing
significant challenges for their widespread application. In addition, a recent
work 35 has proposed a method for predicting credal sets from training data
labeled by probability distributions in the conformal learning framework.

Paper Outline The paper is structured as follows. Section 2 presents how
uncertainty estimation works in different model classes. Section 3 introduces
our credal wrapper in full detail. Section 4 describes validation and results.
Section 5 summarizes our conclusions and future work. Appendices report
additional experiments in §A and implementation details in §B, respectively.

##  2 Uncertainty Estimation in Different Model Classes

Bayesian Neural Networks BNNs model network parameters, i.e., weights and
biases, as probability distributions. The resulting predictive distributions
can thus be seen as ‘second-order’ distributions, i.e., probability
distributions of distributions 34. As mentioned, for computational reasons,
BMA is often applied for BNN inference 21. Namely, in a classification
context, we obtain:

$\tilde{{\bm{p}}}\\!=\\!\frac{1}{N_{p}}\sum\nolimits_{i=1}^{N_{p}}{\bm{p}}_{i}\\!=\\!\frac{1}{N_{p}}\sum\nolimits_{i=1}^{N_{p}}h_{\text{bnn}}^{\bm{\omega}_{i}}(\bm{x}),$
(1)

where ${\bm{p}}_{i}$ is the sampled prediction from the deterministic model
($h_{\text{bnn}}^{\bm{\omega}_{i}}$) parametrized by $\bm{\omega}_{i}$,
${N_{p}}$ is the number of sample predictions, and $\tilde{{\bm{p}}}$ is the
averaged probability vector. The vector of parameters $\bm{\omega}_{i}$ is
obtained as the $i$-th sampling instance of the parameter posterior
distribution of the BNN 36.

Employing Shannon entropy as the uncertainty measure, the _total uncertainty_
(TU) and AU in BNNs can be approximately quantified by calculating the entropy
of the averaged prediction and averaging the entropy of each sampled
prediction 34, respectively, as follows:

$\text{TU}\\!:=\\!H(\tilde{{\bm{p}}})\\!=\\!-\\!\\!\sum\nolimits_{k}^{C}\\!\\!\tilde{q}_{k}\\!\log_{2}\\!{\tilde{q}_{k}},\
\text{AU}\\!:=\\!\tilde{H}({\bm{p}})\\!=\\!\frac{1}{N_{p}}\\!\\!\sum\nolimits_{i=1}^{N_{p}}\\!\\!H({\bm{p}}_{i})\\!=\\!-\frac{1}{N_{p}}\\!\\!\sum\nolimits_{i=1}^{N_{p}}\\!\\!\sum\nolimits_{k}^{C}\\!\\!p_{i_{k}}\\!\\!\log_{2}\\!{p_{i_{k}}},$
(2)

where $\tilde{q}_{k}$ and $p_{i_{k}}$ are the $k$-th elements of the
probability vectors $\tilde{{\bm{p}}}$ and ${\bm{p}}_{i}$ across the $C$
classes, respectively. An estimate of epistemic uncertainty can then be
derived as $\text{EU}\\!:=\\!H(\tilde{{\bm{p}}})\\!-\\!\tilde{H}({\bm{p}})$
18, which can be interpreted as an approximation of ‘mutual information’ 33;
34.

Deep Ensembles Deep ensembles generate a prediction from a set of $M$
individually-trained standard neural networks, as follows:

$\tilde{{\bm{p}}}\\!=\\!\frac{1}{M}\\!\sum\nolimits_{m=1}^{M}\\!h_{m}(\bm{x})\\!=\\!\\!\frac{1}{M}\\!\sum\nolimits_{m}^{M}\\!{\bm{p}}_{m},$
(3)

where ${\bm{p}}_{m}$ denotes the single probability vector provided by the
$m^{\text{th}}$ member $h_{m}$ of the ensemble. Considered by some an
approximation of BMA 72; 1, DEs also quantify TU, AU, and EU as in Eq. (2),
where the sampled single probability vector ${\bm{p}}_{i}$ is replaced by
${\bm{p}}_{m}$.

Credal Sets Uncertainty quantification for credal sets is an active research
subject 34; 60. To that extent, researchers have developed the concepts of
generalized entropy 2 and generalized Hartley (GH) measure 3; 33. Applying the
GH measure in practice, however, is challenging due to the high computational
cost of solving constrained optimization problems involving $2^{C}$ subsets
34; 33, particularly when the number of classes $C$ is large (e.g., $C=100$).
Probability interval width has also been proposed as a measure of EU 33, but
is only applicable to binary classification. As a result, in this paper we opt
for generalized entropy. Given a credal set prediction, denoted by
${\mathbb{P}}$, its upper and lower entropy $\overline{H}({\mathbb{P}})$ and
$\underline{H}({\mathbb{P}})$ can be calculated as a generalization of the
classical Shannon entropy, allowing us to estimate the TU and AU for the
credal prediction 2, as follows:

$\color[rgb]{0,0,0}\text{TU}\\!:=\\!\overline{H}({\mathbb{P}})\\!=\\!\max_{{\bm{p}}\in{\mathbb{P}}}\\!H({\bm{p}}),\quad\text{AU}\\!:=\\!\underline{H}({\mathbb{P}})\\!=\\!\min_{{\bm{p}}\in{\mathbb{P}}}\\!H({\bm{p}}).$
(4)

Such measures capture the maximal and the minimal Shannon entropy within the
credal set, respectively. The level of EU can then be measured by their
difference, namely
$\text{EU}\\!:=\\!\overline{H}({\mathbb{P}})\\!-\\!\underline{H}({\mathbb{P}})$.

##  3 Methodology

As previously stated, providing a probability interval rather than a single
probability value is more informative when the probabilities are uncertain,
due to limited or conflicting evidence 15; 6; 24. Studies on the combination,
marginalization, conditioning or decision-making with interval probabilities
69; 15; 6; 13 often assume that such intervals are known, or provided by
experts. Inspired by the use of probability intervals for decision-making 73;
24, we propose to build probability intervals by extracting the upper and
lower bound per class from the given set of limited (categorical) probability
distributions, validating this choice via extensive experiments (Section 4).
E.g., consider again the task of predicting weather conditions (rainy, sunny,
or cloudy). When receiving three probability values for the _rainy_ condition,
e.g., $0.2$, $0.1$, and $0.7$, using probability intervals we model the
uncertainty on the probability of the rainy condition as $[0.1,0.7]$.

Each probability interval determines a convex set of probabilities over the
set of classes, i.e., a credal set. Such a credal set is a more natural model
than individual distributions for representing the epistemic uncertainty
encoded by the prediction, as it amounts to constraints on the unknown exact
distribution 34; 63; 60. Nevertheless, a precise predictive distribution,
termed _intersection probability_ , can still be derived from a credal set to
generate a unique class prediction for classification purposes. Our credal
wrapper framework is depicted in Figure 1.

The remainder of the section discusses the credal representation approach, a
method for computational complexity reduction of uncertainty quantification,
and the intersection probability, in this order.

Figure 1: Credal wrapper framework for a three-class (A, B, D) classification
task. Given a set of individual probability distributions (denoted as single
dots) in the simplex (triangle) of probability distributions of the classes,
probability intervals (parallel lines) are derived by extracting the upper and
lower probability bounds per class, using Eq. (5). Such lower and upper
probability intervals induce a convex set of probabilities on {A, B, D}, known
as a credal set (${\mathbb{P}}$, light blue convex hull in the triangle). A
precise single intersection probability is computed from the credal set using
the transform in Eq. (5). Uncertainty is estimated in the mathematical
framework of credal sets.

Credal Representation Approach Given a set of $N$ individual distributions
from BNNs or deep ensembles, an upper and a lower probability bound for $k$-th
class element, denoted as $p_{U_{k}}$ and $p_{L_{k}}$, respectively, can be
obtained from

$p_{U_{k}}\\!=\\!\operatorname*{max}_{n=1,..,N}{p_{n,k}},\quad
p_{L_{k}}\\!=\\!\operatorname*{min}_{n=1,..,N}{p_{n,k}},$ (5)

where $p_{n,k}$ denotes the $k$-th element of the $n$-th single probability
vector ${\bm{p}}_{n}$. Such probability intervals over $C$ classes determine a
non-empty credal set ${\mathbb{P}}$, as follows 52; 15:

${\mathbb{P}}\\!=\\!\\{{\bm{p}}\\!\mid p_{k}\\!\in\\![p_{L_{k}},p_{U_{k}}],\
\forall k\\!=\\!1,2,...,C\\}\ \ \text{s.t.}\
\sum\nolimits_{k=1}^{C}p_{L_{k}}\leq
1\\!\leq\\!\sum\nolimits_{k=1}^{C}p_{U_{k}}.$ (6)

Individual probabilities in the credal set satisfy the normalization
condition, and their probability value per class is constrained to belong to
the given probability interval.

It can be readily proven that the probability intervals in Eq. (5) meet the
above condition, as follows:

$\sum\nolimits_{k}^{C}\\!p_{L_{k}}\\!=\\!\sum\nolimits_{k}^{C}\\!\operatorname*{min}_{n=1,..,N}{p_{n,k}}\\!\leq\\!\sum\nolimits_{k}^{C}\\!{{p_{n^{*},k}}}\\!=\\!1\\!\leq\\!\sum\nolimits_{k}^{C}\operatorname*{max}_{n=1,..,N}{p_{n,k}}\\!=\\!\sum\nolimits_{k}^{C}p_{U_{k}},$
(7)

where $n^{*}$ is any index in $1,\ldots,N$. Computing
$\overline{H}({\mathbb{P}})$ and $\underline{H}({\mathbb{P}})$ in Eq. (4) for
uncertainty estimation, on the other hand, requires solving the following
optimization problems:

$\begin{aligned}
\overline{H}({\mathbb{P}})\\!&=\\!\operatorname*{maximize}\\!\sum\nolimits_{k}^{C}\\!\\!\\!-p_{k}\\!\cdot\\!\log_{2}p_{k}\\\
\underline{H}({\mathbb{P}})\\!&=\\!\operatorname*{minimize}\\!\sum\nolimits_{k}^{C}\\!\\!\\!-p_{k}\\!\cdot\\!\log_{2}p_{k}\\\
\end{aligned}\text{s.t.}\sum\nolimits_{k}^{C}\\!p_{k}\\!=\\!1\ \text{and}\
p_{k}\\!\in\\![p_{L_{k}},p_{U_{k}}],\ \forall k,$ (8)

which can be addressed by using a standard solver, such as the SciPy
optimization package 68.

Computational Complexity Reduction Method The convex optimization problem in
Eq. (8) may present a computational challenge for a large value of $C$ (e.g.,
$C\\!=\\!1000$). To mitigate this issue we propose an approach, termed
_Probability Interval Approximation_ (PIA), in Algorithm 1. The PIA method
initially identifies the top $J-1$ relevant classes by sorting the probability
values of the intersection probability ${\bm{p}}^{*}$ (detailed in Eq. (9)
below) in descending order. Then, the remaining elements are merged into a
single class whose upper and lower probability are computed. As a result, the
dimension of the approximate probability interval is reduced from $C$ to $J$.

Input: $[p_{L_{k}},p_{U_{k}}]$ for $k\\!=\\!1,..C$; Intersection probability
${\bm{p}}^{*}$; Chosen number of classes $J$

Output: Approximated probability intervals $[r_{L_{j}},r_{U_{j}}]$ for
$k\\!=\\!1,..J$

$\\#$ Index vector for sorting ${\bm{p}}^{*}$ in descending order

${\bm{m}}\\!\leftarrow\\!\operatorname*{argsort}({\bm{p}}^{*})$

$\\#$ Upper and lower probability per selected class

$r_{L_{j}}\\!\leftarrow\\!p_{L_{m_{j}}},r_{U_{j}}\\!\leftarrow\\!p_{U_{m_{j}}}$
for $j\\!=\\!1,...,J\\!-\\!1$

$\\#$ Upper and lower probability for deselected classes

$r_{L_{J}}\\!\leftarrow\\!\max(1\\!-\\!\sum_{i=m_{J}}^{m_{C}}\\!p_{U_{i}},\sum_{j=1}^{J-1}\\!r_{L_{j}})$;
$r_{U_{J}}\\!\leftarrow\\!\min(1\\!-\\!\sum_{i=m_{J}}^{m_{C}}\\!p_{L_{i}},\sum_{j=1}^{J-1}\\!r_{U_{j}})$

Algorithm 1 Probability Interval Approximation

Intersection Probability In classification tasks, it is desirable to
eventually map a credal set to a single probability prediction, in order to
make a unique class prediction. A rational criterion for doing so is provided
by the _intersection probability_ 13. Given the probability interval system
defined in Eq. (5), the criterion is that, when computing the single
predictive probability, the probability interval for each class should be
treated in the same way, as we have no grounds for distinguishing one class
from another 13. Mathematically, this translates into seeking the single
probability vector ${\bm{p}}^{*}$ such that

$p^{*}_{k}\\!=\\!p_{L_{k}}+\alpha\cdot(p_{U_{k}}\\!-\\!p_{L_{k}})\quad\forall
k\\!=\\!1,...,C$ (9)

where $p^{*}_{k}$ is the $k$-th element of ${\bm{p}}^{*}$, under the constant
value $\alpha\\!\in\\![0,1]$.

The concept of intersection probability is pictorially illustrated in Figure
2.

Figure 2: An illustration of the intersection probability for a probability
interval system of three classes {A, B, D} 13; 12.

By definition, Eq. (9) belongs to the probability interval for any
$\alpha\in[0,1]$. The unique $\alpha$ that satisfies the normalization
constraint (making ${\bm{p}}^{*}$ a proper probability distribution) can be
computed as 13:

$\alpha\\!=\\!\bigg{(}1-\sum\nolimits_{k}^{C}p_{L_{k}}\bigg{)}/\bigg{(}{\sum\nolimits_{k}^{C}(p_{U_{k}}\\!-\\!p_{L_{k}})}\bigg{)}.$
(10)

The intersection probability transform follows clear rationale principles and
does not suffer from the drawbacks of other potential transforms. Let us see
this in detail. Taking (i) the average probability value of the original
sampled distributions produces a valid probability vector that falls within
the probability interval system. However, such a transform does not leverage
the probability bounds, thus violating the semantics of probability intervals
24; 6 (while also exhibiting inferior performance, see Section 4.2). Selecting
(ii) the midpoint of each probability interval $[p_{L},p_{U}]$, instead, does
not generally result in a valid normalized probability vector. Finally, (iii)
normalizing the lower or the upper probability vectors, i.e., taking
$\hat{p}_{U_{k}}\\!=\\!p_{U_{k}}/\sum\nolimits_{k}^{C}p_{U_{k}}$ or
$\hat{p}_{L_{k}}\\!=\\!p_{L_{k}}/\sum\nolimits_{k}^{C}p_{L_{k}}$, yields a
probability that is not guaranteed to be consistent with the interval system
12.

##  4 Experimental Validation

###  4.1 Uncertainty Estimation Evaluation via OOD Detection

The OOD detection task is a widely applied benchmark for EU quantification
assessment 53. In OOD detection, a model is expected to exhibit high EU
estimates on OOD samples in comparison to in-domain (ID) instances.
Consequently, superior OOD detection performance provides evidence of enhanced
uncertainty estimation quality. To assess OOD detection performance, we use
the AUROC (Area Under the Receiver Operating Characteristic curve) and AUPRC
(Area Under the Precision-Recall curve) scores. Greater scores indicate a
higher quality of uncertainty estimation. In addition, we also evaluate TU
estimation in this setting, as TU estimates are widely employed for OOD
detection within BNNs and deep ensembles 43; 53.

####  4.1.1 Evaluation using Small-Scale Datasets

Setup For this first experiment, we use dataset pairings of the type (ID
samples vs OOD data), including CIFAR10 40 vs SVHN 30/Tiny-ImageNet 45 and
CIFAR10 vs CIFAR10-C 28. As BNN baselines, we choose two standardized
variational BNNs: BNNR (Auto-Encoding variational Bayes 38 with the local
reparameterization trick 51) and BNNF (Flipout gradient estimator with the
negative evidence lower bound loss 71). We do not consider BNNs using sampling
approaches because of their generally high computational resource requirements
22; 36. As for deep ensembles, our baselines, denoted as DEs-5, aggregates
five SNNs trained using distinct random seeds. All models are implemented on
the established VGG16 64 and Res18 27 architectures using the CIFAR10 dataset.
The number of sample predictions for BNNs is set to ${N_{p}\\!=\\!5}$. More
implementation details are given in Appendix §B.

Results Table 1 reports the OOD detection performance of BNNR, BNNF, and
DEs-5, as measured in the CIFAR10 (ID) vs SVHN and Tiny-ImageNet (OOD)
settings, based on VGG16 and Res18 backbones. Regarding the CIFAR10-C dataset,
which applies 15 corruption modes to the CIFAR10 instances, with 5 intensities
per corruption type, Figure 3 shows the OOD detection results of CIFAR10 vs
CIFAR10-C against increased corruption intensity. The results over the 15
corruption types are averaged. The consistently enhanced OOD detection
performance on diverse data pairs and distinct baselines across different
backbones provides strong evidence that our proposed credal wrapper method
does indeed improve EU and TU estimation in a model averaging framework.

Table 1: OOD detection AUROC and AUPRC performance (%) comparison between classical and credal set representation of BNNs and deep ensembles-5 using EU (left) and TU (right) as uncertainty metrics. All models are implemented on VGG16/Res18 backbones and tested on CIFAR10 (ID) vs SVHN (OOD) and Tiny-ImageNet (OOD). The results are from 15 runs. The best scores per uncertainty metric are in bold. |  |  | SVHN | Tiny-ImageNet |  | SVHN | Tiny-ImageNet
---|---|---|---|---|---|---|---
| Model | EU | AUROC | AUPRC | AUROC | AUPRC | TU | AUROC | AUPRC | AUROC | AUPRC
|  | Baseline | $H(\tilde{{\bm{p}}})\\!-\\!\tilde{H}({\bm{p}})$ |  86.65±1.26 |  90.61±0.88 |  84.62±0.28 |  80.06±0.40 | $H(\tilde{{\bm{p}}})$ |  88.57±1.47 |  93.26±1.08 |  85.50±0.31 |  82.60±0.41
| BNNR | Ours | $\overline{H}({\mathbb{P}})\\!-\\!\underline{H}({\mathbb{P}})$ | 87.85±1.45 | 92.32±1.05 | 85.55±0.30 | 82.76±0.46 | $\overline{H}({\mathbb{P}})$ | 88.79±1.57 | 93.44±1.14 | 85.89±0.31 | 83.53±0.43
|  | Baseline | $H(\tilde{{\bm{p}}})\\!-\\!\tilde{H}({\bm{p}})$ |  86.79±0.47 |  90.76±0.55 |  84.54±0.20 |  79.91±0.35 | $H(\tilde{{\bm{p}}})$ |  88.32±0.50 |  93.06±0.51 |  85.30±0.20 |  82.32±0.30
| BNNF | Ours | $\overline{H}({\mathbb{P}})\\!-\\!\underline{H}({\mathbb{P}})$ | 87.66±0.50 | 92.26±0.51 | 85.26±0.20 | 82.33±0.30 | $\overline{H}({\mathbb{P}})$ | 88.47±0.52 | 93.27±0.52 | 85.62±0.20 | 83.23±0.28
|  | Baseline | $H(\tilde{{\bm{p}}})\\!-\\!\tilde{H}({\bm{p}})$ |  89.74±1.31 |  93.58±0.97 |  88.49±0.17 |  85.79±0.35 | $H(\tilde{{\bm{p}}})$ |  91.20±1.29 |  94.87±0.78 |  89.55±0.08 |  87.89±0.14
VGG16 | DEs-5 | Ours | $\overline{H}({\mathbb{P}})\\!-\\!\underline{H}({\mathbb{P}})$ | 91.96±1.33 | 95.24±0.79 | 89.80±0.08 | 87.99±0.16 | $\overline{H}({\mathbb{P}})$ | 92.12±1.32 | 95.41±0.75 | 90.00±0.07 | 88.49±0.17
|  | Baseline | $H(\tilde{{\bm{p}}})\\!-\\!\tilde{H}({\bm{p}})$ |  88.32±1.22 |  93.03±0.74 |  85.83±0.25 |  81.43±0.51 | $H(\tilde{{\bm{p}}})$ |  88.18±1.30 |  92.68±0.86 |  86.40±0.24 |  83.16±0.40
| BNNR | Ours | $\overline{H}({\mathbb{P}})\\!-\\!\underline{H}({\mathbb{P}})$ | 88.40±1.25 | 93.16±0.79 | 85.99±0.20 | 82.51±0.39 | $\overline{H}({\mathbb{P}})$ | 88.36±1.30 | 92.95±0.87 | 86.52±0.22 | 83.66±0.38
|  | Baseline | $H(\tilde{{\bm{p}}})\\!-\\!\tilde{H}({\bm{p}})$ |  88.62±0.80 |  93.26±0.52 |  85.94±0.30 |  81.64±0.34 | $H(\tilde{{\bm{p}}})$ |  88.43±0.83 |  92.90±0.51 |  86.45±0.33 |  83.22±0.33
| BNNF | Ours | $\overline{H}({\mathbb{P}})\\!-\\!\underline{H}({\mathbb{P}})$ | 88.71±0.81 | 93.41±0.51 | 86.06±0.31 | 82.69±0.27 | $\overline{H}({\mathbb{P}})$ | 88.65±0.81 | 93.19±0.51 | 86.58±0.32 | 83.75±0.31
|  | Baseline | $H(\tilde{{\bm{p}}})\\!-\\!\tilde{H}({\bm{p}})$ |  87.40±0.68 |  91.82±0.51 |  87.94±0.15 |  84.86±0.24 | $H(\tilde{{\bm{p}}})$ |  88.47±0.80 |  92.82±0.64 |  88.96±0.14 |  87.22±0.18
Res18 | DEs-5 | Ours | $\overline{H}({\mathbb{P}})\\!-\\!\underline{H}({\mathbb{P}})$ | 88.63±0.80 | 92.76±0.64 | 89.16±0.15 | 87.41±0.19 | $\overline{H}({\mathbb{P}})$ | 88.98±0.86 | 93.13±0.70 | 89.53±0.14 | 88.23±0.17
Figure 3: OOD detection on CIFAR10 vs CIFAR10-C of BNNs and deep ensembles
against increased corruption intensity, using VGG16 and Res18 as backbones.
The metrics include EU and TU.

####  4.1.2 Evaluation using Large-Scale Datasets

Setup In this second experiment, we exclusively employ deep ensembles (DEs-5)
to assess the quality of uncertainty estimation of our proposed method on
large-scale datasets and architectures. This is because, in practice, BNNs are
typically unable to scale to large datasets and model architectures due to the
high computational complexity 53. For instance, training a Res50-based BNNs on
CIFAR-10 (resized to (224, 224, 3)) failed in our experiment due to exceeding
the memory capacity of a single A100 GPU. The dataset pairs (ID vs OOD)
considered include CIFAR10/CIFAR100 39 vs SVHN/Tiny-ImageNet, ImageNet 17 vs
ImageNet-O 30, CIFAR10 vs CIFAR10-C, and CIFAR100 vs CIFAR100-C 28. DEs-5 are
implemented on the well-established Res50 27. All data samples have a shape of
(224, 224, 3). More training details are given in Appendix §B. The PIA
algorithm (Algorithm 1) is applied using the settings $J\\!=\\!20$ and
$J\\!=\\!50$ to calculate the generalized entropy
($\overline{H}({\mathbb{P}})$ and $\underline{H}({\mathbb{P}})$) on dataset
pairs involving CIFAR100 and ImageNet, respectively.

Results Compared to vanilla model averaging applied to deep ensembles, our
wrapper’s enhanced OOD detection performance on diverse data pairs shown in
Table 2 provides compelling evidence that our proposed method can indeed
improve EU and TU estimation.

Table 2: OOD detection AUROC and AUPRC performance (%) of the classical and credal set representation of DEs-5 using EU (left) and TU (right) as uncertainty metrics. The results are from 15 runs, based on the Res50 backbone. Best scores per uncertainty metric in bold. Uncertain Metrics | CIFAR10 (ID) | CIFAR100 (ID) | ImageNet (ID)
---|---|---|---
|  |  | SVHN (OOD) | Tiny-ImageNet (OOD) | SVHN (OOD) | Tiny-ImageNet (OOD) | ImageNet-O (OOD)
|  |  | AUROC | AUPRC | AUROC | AUPRC | AUROC | AUPRC | AUROC | AUPRC | AUROC | AUPRC
| Baseline | $H(\tilde{{\bm{p}}})$ |  94.80±0.43 |  97.26±0.29 |  88.80±0.19 |  87.21±0.29 |  78.53±1.94 |  88.83±1.01 |  80.75±0.15 |  77.65±0.19 |  50.20±0.07 |  50.44±0.06
TU | Ours | $\overline{H}({\mathbb{P}})$ | 95.44±0.37 | 97.57±0.23 | 89.30±0.17 | 87.97±0.25 | 80.71±1.96 | 89.97±0.99 | 81.46±0.14 | 78.29±0.17 | 54.87±0.08 | 52.27±0.05
| Baseline | $H(\tilde{{\bm{p}}})\\!-\\!\tilde{H}({\bm{p}})$ |  89.58±0.93 |  92.29±1.00 |  86.87±0.20 |  83.02±0.16 |  73.83±1.97 |  84.96±1.25 |  78.80±0.20 |  74.68±0.27 |  65.70±0.41 |  63.20±0.35
EU | Ours | $\overline{H}({\mathbb{P}})\\!-\\!\underline{H}({\mathbb{P}})$ | 93.77±0.60 | 96.06±0.46 | 88.78±0.15 | 86.83±0.23 | 80.22±1.96 | 89.40±1.03 | 81.00±0.16 | 77.16±0.23 | 66.20±0.38 | 63.23±0.34

####  4.1.3 Ablation Study on Network Architectures

Setup We also perform an ablation study using EfficientNetB2 (EffB2) 65 and
Virtual Transformer Base (ViT-B) 19 as architecture backbones, involving
CIFAR10/100 vs SVHN and Tiny-ImageNet, CIFAR10 vs CIFAR10-C, and CIFA100 vs
CIFAR100-C.

Results The key findings, presented in Table 3 and Figure 4, demonstrate that
the proposed credal representation approach significantly enhances the EU and
TU estimation quality of deep ensembles, and is robust against both the
dataset pairs and the architecture backbones. In Table 3, a 0.1% drop in AUPRC
using the TU metric (EffB2 backbone, CIFAR100 vs Tiny-ImageNet) is observed.
TU ($\overline{{\mathbb{P}}}$) is computed by solving a constrained
optimization problem (Eq. 8) using a numerical solver from SciPy. The slight
performance decrease is likely due to numerical errors during the optimization
process.

Table 3: OOD detection AUROC and AUPRC performance (%) of the classical and credal set representation of DEs-5 using EU (left) and TU (right) as metrics. Results are from 15 runs, based on EffB2 and ViT-B backbones. Best scores per uncertainty metric in bold. |  |  | SVHN (OOD) | Tiny-ImageNet (OOD) |  | SVHN (ID) | Tiny-ImageNet (OOD)
---|---|---|---|---|---|---|---
ID | Backbone | EU | AUROC | AUPRC | AUROC | AUPRC | TU | AUROC | AUPRC | AUROC | AUPRC
|  | Baseline | $H(\tilde{{\bm{p}}})\\!-\\!\tilde{H}({\bm{p}})$ |  95.76±0.59 |  97.43±0.47 |  92.32±0.14 |  90.72±0.22 | $H(\tilde{{\bm{p}}})$ |  97.55±0.27 |  98.78±0.16 |  93.41±0.15 |  93.01±0.17
| EffB2 | Ours | $\overline{H}({\mathbb{P}})\\!-\\!\underline{H}({\mathbb{P}})$ | 97.60±0.25 | 98.74±0.14 | 93.55±0.15 | 93.17±0.16 | $\overline{H}({\mathbb{P}})$ | 97.91±0.21 | 98.98±0.10 | 93.74±0.15 | 93.55±0.16
|  | Baseline | $H(\tilde{{\bm{p}}})\\!-\\!\tilde{H}({\bm{p}})$ |  77.71±1.67 |  85.82±1.14 |  82.27±0.79 |  78.85±0.81 | $H(\tilde{{\bm{p}}})$ |  79.80±1.75 |  87.97±1.17 |  83.81±0.81 |  81.67±0.89
CIFAR10 | ViT-B | Ours | $\overline{H}({\mathbb{P}})\\!-\\!\underline{H}({\mathbb{P}})$ | 80.71±1.83 | 88.43±1.26 | 84.28±0.76 | 82.82±0.85 | $\overline{H}({\mathbb{P}})$ | 81.08±1.82 | 88.48±1.48 | 84.62±0.75 | 82.82±0.85
|  | Baseline | $H(\tilde{{\bm{p}}})\\!-\\!\tilde{H}({\bm{p}})$ |  87.52±1.52 |  93.81±0.80 |  85.29±0.15 |  82.98±0.24 | $H(\tilde{{\bm{p}}})$ |  88.46±1.33 |  94.40±0.59 |  86.45±0.10 | 84.88±0.14
| EffB2 | Ours | $\overline{H}({\mathbb{P}})\\!-\\!\underline{H}({\mathbb{P}})$ | 89.20±1.19 | 94.58±0.56 | 86.23±0.10 | 83.69±0.21 | $\overline{H}({\mathbb{P}})$ | 89.35±1.20 | 94.83±0.52 | 86.61±0.09 | 84.87±0.12
|  | Baseline | $H(\tilde{{\bm{p}}})\\!-\\!\tilde{H}({\bm{p}})$ |  81.41±1.33 |  89.00±0.96 |  81.18±0.31 |  77.46±0.49 | $H(\tilde{{\bm{p}}})$ |  84.10±1.12 |  91.41±0.72 |  82.64±0.28 |  79.94±0.43
CIFAR100 | ViT-B | Ours | $\overline{H}({\mathbb{P}})\\!-\\!\underline{H}({\mathbb{P}})$ | 84.87±1.06 | 91.40±0.67 | 82.53±0.32 | 79.04±0.39 | $\overline{H}({\mathbb{P}})$ | 85.40±1.05 | 92.02±0.70 | 83.06±0.29 | 80.34±0.41
Figure 4: OOD detection on CIFAR10/100 vs CIFAR10-C/100-C of deep ensembles
against increased corruption intensity, using Res50, EffB2, and ViT-B as
backbones. The metrics include EU and TU.

###  4.2 ECE Performance Evaluation

Setup  _Expected calibration error_ (ECE) 23; 56 is an indicator for measuring
the model calibration performance. A lower ECE value signifies a closer
alignment between the model’s confidence scores and the true probabilities of
the events. The OOD samples CIFAR10-C and CIFAR100-C have the same target
space (set of class labels) as in the CIFAR10 and CIFAR100 datasets,
respectively. This allows us to evaluate ECE performance in the case of facing
corrupted data, using both the proposed intersection probability and the
average consensus probability as the final model prediction.

Results Figure 6 reports the ECE values of BNNR, BNNF, and DEs-5 on the
CIFAR10-C dataset against the increased corruption intensity, using VGG16 and
Res18 backbones. Furthermore, Figure 6 shows the ECE values of deep ensembles
on both CIFAR10-C and CIFAR100-C datasets, using Res50, EffB2, and Vit-B
backbones. The findings indicate that adopting the intersection probability as
the final prediction, with its strong rationality foundations, can indeed
empirically improve calibration performance (lower ECE) on the corrupted
samples.

Figure 5: ECE values of BNNR, BNNF, and DEs-5 on CIFAR10-C against increased
corruption intensity, using the averaged probability (Prob.) and our proposed
intersection probability (Prob.). VGG16 and Res18 are backbones. Results are
from 15 runs.

Figure 6: ECE values of DEs-5 on CIFAR10-C and CIFAR100-C against increased
corruption intensity, using the averaged probability (Prob.) and our proposed
intersection probability (Prob.). Res50, EffB2, and ViT-B are backbones.
Results are from 15 runs.

###  4.3 Additional Results

Appendix §A.1 performs an ablation study on the number $N$ of probability
distributions sampled at prediction time, using Res50-based deep ensembles on
the OOD benchmark (CIFAR10 vs CIFAR10-C/SVHN/TinyImageNet). It demonstrates
that our credal wrapper approach consistently achieves the higher quality of
EU and TU estimation and lower ECE (using the intersection probability). A
larger $N$ results in better uncertainty estimation and lower ECE values.
Appendix §A.2 analyzes the effect of the hyperparameter $J$ of the PIA
algorithm 1. The findings suggest that increasing the value of $J$ improves
the OOD detection performance, but may lead to an increase in execution time.

##  5 Conclusion and Future Work

Conclusion This paper presents an innovative approach, called a _credal
wrapper_ , to formulating a credal set representation for model averaging in
BNNs and deep ensembles, capable of improving their uncertainty estimation in
classification tasks. Given a limited collection of single distributions
derived at prediction time from either BNNs or deep ensembles, the proposed
approach computes a lower and an upper probability bound per class, to
acknowledge the epistemic uncertainty about the sought exact predictive
distribution due to limited information availability. Such lower and upper
probability bounds on each class induce a credal set. From such a credal
prediction (the output of our wrapper), an intersection probability
distribution can be derived, for which there are theoretical arguments that it
is the natural way to map a credal set to a single probability.

Extensive experiments are performed on several OOD detection benchmarks
including CIFAR10/100 vs SVHN/Tiny-ImageNet, CIFAR10/100 vs CIFAR10/100-C, and
ImageNet vs ImageNet-O and utilizing various network architectures (VGG16,
Res18/50, EfficientNet B2 and ViT Base). Compared to BNN and deep ensemble
baselines, the proposed credal wrapper approach demonstrates improved
uncertainty estimation and lower expected calibration error on corrupted OOD
samples.

Limitation and Future work Despite the evident efficacy of our credal wrapper
approach, uncertainty quantification in the credal set framework requires a
greater computational investment, as shown in Appendix §A.2. As a result, if
there are limitations on memory usage and computational resources, the
proposed approach might not be the optimal solution. A primary objective of
our forthcoming research is to apply and benchmark our approach on real-world
applications, such as medical image analysis.

## Acknowledgments

This work was supported by granted H2020 FETOPEN-2018-2019-2020-01 European
project, _Epistemic AI_ under grant agreement No. 964505 (E-pi).

## References

  * [1] Taiga Abe, Estefany Kelly Buchanan, Geoff Pleiss, Richard Zemel, and John P Cunningham.  Deep ensembles work, but are they necessary?  Advances in Neural Information Processing Systems, 35:33646–33660, 2022.
  * [2] Joaquín Abellán, George J Klir, and Serafín Moral.  Disaggregated total uncertainty measure for credal sets.  International Journal of General Systems, 35(1):29–44, 2006.
  * [3] Joaquín Abellán and Serafín Moral.  A non-specificity measure for convex sets of probability distributions.  International journal of uncertainty, fuzziness and knowledge-based systems, 8(03):357–367, 2000.
  * [4] Neil Band, Tim GJ Rudner, Qixuan Feng, Angelos Filos, Zachary Nado, Michael W Dusenberry, Ghassen Jerfel, Dustin Tran, and Yarin Gal.  Benchmarking Bayesian deep learning on diabetic retinopathy detection tasks.  In Proceedings of Conference on Neural Information Processing Systems Datasets and Benchmarks Track (Round 2), 2021.
  * [5] Charles Blundell, Julien Cornebise, Koray Kavukcuoglu, and Daan Wierstra.  Weight uncertainty in neural network.  In Proceedings of the International Conference on Machine Learning, pages 1613–1622. PMLR, 2015.
  * [6] Andrés Cano and Serafin Moral.  Using probability trees to compute marginals with imprecise probabilities.  International Journal of Approximate Reasoning, 29(1):1–46, 2002\.
  * [7] Michele Caprio, Souradeep Dutta, Kuk Jin Jang, Vivian Lin, Radoslav Ivanov, Oleg Sokolsky, and Insup Lee.  Imprecise Bayesian neural networks.  arXiv preprint arXiv:2302.09656, 2023.
  * [8] Kamil Ciosek, Vincent Fortuin, Ryota Tomioka, Katja Hofmann, and Richard Turner.  Conservative uncertainty estimation by fitting prior networks.  In International Conference on Learning Representations, 2019.
  * [9] Giorgio Corani, Alessandro Antonucci, and Marco Zaffalon.  Bayesian networks with imprecise probabilities: Theory and application to classification.  Data Mining: Foundations and Intelligent Paradigms: Volume 1: Clustering, Association and Classification, pages 49–93, 2012.
  * [10] Giorgio Corani and Marco Zaffalon.  Learning reliable classifiers from small or incomplete data sets: The naive credal classifier 2.  Journal of Machine Learning Research, 9(4), 2008.
  * [11] Fabio Cuzzolin.  Credal semantics of bayesian transformations in terms of probability intervals.  IEEE Transactions on Systems, Man, and Cybernetics, Part B (Cybernetics), 40(2):421–432, 2009.
  * [12] Fabio Cuzzolin.  The geometry of uncertainty: The geometry of imprecise probabilities.  Springer Nature, 2020.
  * [13] Fabio Cuzzolin.  The intersection probability: betting with probability intervals.  arXiv preprint arXiv:2201.01729, 2022.
  * [14] Erik Daxberger, Agustinus Kristiadi, Alexander Immer, Runa Eschenhagen, Matthias Bauer, and Philipp Hennig.  Laplace Redux - Effortless Bayesian Deep Learning.  In M. Ranzato, A. Beygelzimer, Y. Dauphin, P.S. Liang, and J. Wortman Vaughan, editors, Advances in Neural Information Processing Systems, volume 34, pages 20089–20103. Curran Associates, Inc., 2021.
  * [15] Luis M. De Campos, Juan F. Huete, and Serafin Moral.  Probability intervals: A tool for uncertain reasoning.  International Journal of Uncertainty, Fuzziness and Knowledge-Based Systems, 02:167–196, June 1994.
  * [16] Bruno De Finetti.  Theory of probability: A critical introductory treatment, volume 6.  John Wiley & Sons, 2017.
  * [17] Jia Deng, Wei Dong, Richard Socher, Li-Jia Li, Kai Li, and Li Fei-Fei.  Imagenet: A large-scale hierarchical image database.  In 2009 IEEE conference on computer vision and pattern recognition, pages 248–255. Ieee, 2009.
  * [18] Stefan Depeweg, Jose-Miguel Hernandez-Lobato, Finale Doshi-Velez, and Steffen Udluft.  Decomposition of uncertainty in Bayesian deep learning for efficient and risk-sensitive learning.  In International Conference on Machine Learning, pages 1184–1193. PMLR, 2018.
  * [19] Alexey Dosovitskiy, Lucas Beyer, Alexander Kolesnikov, Dirk Weissenborn, Xiaohua Zhai, Thomas Unterthiner, Mostafa Dehghani, Matthias Minderer, Georg Heigold, Sylvain Gelly, et al.  An image is worth 16x16 words: Transformers for image recognition at scale.  arXiv preprint arXiv:2010.11929, 2020.
  * [20] Didier Dubois and Henri Prade.  Consonant approximations of belief functions.  International Journal of Approximate Reasoning, 4(5-6):419–449, 1990.
  * [21] Yarin Gal and Zoubin Ghahramani.  Dropout as a Bayesian approximation: Representing model uncertainty in deep learning.  In Proceedings of the International Conference on Machine Learning, pages 1050–1059. PMLR, 2016.
  * [22] Jakob Gawlikowski, Cedrique Rovile Njieutcheu Tassi, Mohsin Ali, Jongseok Lee, Matthias Humt, Jianxiang Feng, Anna Kruspe, Rudolph Triebel, Peter Jung, Ribana Roscher, et al.  A survey of uncertainty in deep neural networks.  ArXiv Preprint ArXiv:2107.03342, 2021.
  * [23] Chuan Guo, Geoff Pleiss, Yu Sun, and Kilian Q Weinberger.  On calibration of modern neural networks.  In International conference on machine learning, pages 1321–1330. PMLR, 2017.
  * [24] Peijun Guo and Hideo Tanaka.  Decision making with interval probabilities.  European Journal of Operational Research, 203(2):444–454, 2010\.
  * [25] Fredrik K Gustafsson, Martin Danelljan, and Thomas B Schon.  Evaluating scalable Bayesian deep learning methods for robust computer vision.  In Proceedings of the IEEE/CVF conference on computer vision and pattern recognition workshops, pages 318–319, 2020.
  * [26] Bobby He, Balaji Lakshminarayanan, and Yee Whye Teh.  Bayesian deep ensembles via the neural tangent kernel.  Advances in neural information processing systems, 33:1010–1022, 2020.
  * [27] 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.
  * [28] Dan Hendrycks and Thomas Dietterich.  Benchmarking neural network robustness to common corruptions and perturbations.  Proceedings of the International Conference on Learning Representations, 2019.
  * [29] Dan Hendrycks and Kevin Gimpel.  A baseline for detecting misclassified and out-of-distribution examples in neural networks.  arXiv preprint arXiv:1610.02136, 2016.
  * [30] Dan Hendrycks, Kevin Zhao, Steven Basart, Jacob Steinhardt, and Dawn Song.  Natural adversarial examples.  In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 15262–15271, 2021.
  * [31] Marius Hobbhahn, Agustinus Kristiadi, and Philipp Hennig.  Fast predictive uncertainty for classification with Bayesian deep networks.  In James Cussens and Kun Zhang, editors, Proceedings of the Thirty-Eighth Conference on Uncertainty in Artificial Intelligence, volume 180 of Proceedings of Machine Learning Research, pages 822–832. PMLR, 01–05 Aug 2022.
  * [32] Matthew D Hoffman, Andrew Gelman, et al.  The No-U-Turn sampler: adaptively setting path lengths in Hamiltonian Monte Carlo.  J. Mach. Learn. Res., 15(1):1593–1623, 2014.
  * [33] Eyke Hüllermeier, Sébastien Destercke, and Mohammad Hossein Shaker.  Quantification of credal uncertainty in machine learning: A critical analysis and empirical comparison.  In Proceedings of the Uncertainty in Artificial Intelligence, pages 548–557. PMLR, 2022.
  * [34] Eyke Hüllermeier and Willem Waegeman.  Aleatoric and epistemic uncertainty in machine learning: An introduction to concepts and methods.  Machine Learning, 110(3):457–506, 2021.
  * [35] Alireza Javanmardi, David Stutz, and Eyke Hüllermeier.  Conformalized credal set predictors.  arXiv preprint arXiv:2402.10723, 2024.
  * [36] Laurent Valentin Jospin, Hamid Laga, Farid Boussaid, Wray Buntine, and Mohammed Bennamoun.  Hands-on Bayesian neural networks—A tutorial for deep learning users.  IEEE Computational Intelligence Magazine, 17(2):29–48, 2022.
  * [37] 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.
  * [38] Diederik P Kingma and Max Welling.  Auto-encoding variational Bayes.  arXiv preprint arXiv:1312.6114, 2013.
  * [39] Alex Krizhevsky.  Learning multiple layers of features from tiny images.  University of Toronto, 05 2012.
  * [40] Alex Krizhevsky, Vinod Nair, and Geoffrey Hinton.  CIFAR-10 (Canadian Institute For Advanced Research).  Technical report, CIFAR, 2009.
  * [41] David Krueger, Chin-Wei Huang, Riashat Islam, Ryan Turner, Alexandre Lacoste, and Aaron Courville.  Bayesian hypernetworks.  ArXiv Preprint ArXiv:1710.04759, 2017.
  * [42] Henry E Kyburg Jr.  Bayesian and non-bayesian evidential updating.  Artificial intelligence, 31(3):271–293, 1987.
  * [43] Balaji Lakshminarayanan, Alexander Pritzel, and Charles Blundell.  Simple and scalable predictive uncertainty estimation using deep ensembles.  Advances in Neural Information Processing Systems, 30, 2017.
  * [44] Antonis Lambrou, Harris Papadopoulos, and Alex Gammerman.  Reliable confidence measures for medical diagnosis with evolutionary algorithms.  IEEE Transactions on Information Technology in Biomedicine, 15(1):93–99, 2010.
  * [45] Ya Le and Xuan Yang.  Tiny imagenet visual recognition challenge.  CS 231N, 7(7):3, 2015.
  * [46] Isaac Levi.  The enterprise of knowledge: An essay on knowledge, credal probability, and chance.  MIT press, 1980.
  * [47] Jeremiah Liu, Zi Lin, Shreyas Padhy, Dustin Tran, Tania Bedrax Weiss, and Balaji Lakshminarayanan.  Simple and principled uncertainty estimation with deterministic deep learning via distance awareness.  Advances in Neural Information Processing Systems, 33:7498–7512, 2020.
  * [48] Denis D Mauá, Fabio G Cozman, Diarmaid Conaty, and Cassio P Campos.  Credal sum-product networks.  In Proceedings of the Tenth International Symposium on Imprecise Probability: Theories and Applications, pages 205–216. PMLR, 2017.
  * [49] Hendrik A Mehrtens, Alexander Kurz, Tabea-Clara Bucher, and Titus J Brinker.  Benchmarking common uncertainty estimation methods with histopathological images under domain shift and label noise.  Medical Image Analysis, 89:102914, 2023.
  * [50] Aryan Mobiny, Pengyu Yuan, Supratik K Moulik, Naveen Garg, Carol C Wu, and Hien Van Nguyen.  Dropconnect is effective in modeling uncertainty of Bayesian deep networks.  Scientific Reports, 11(1):1–14, 2021.
  * [51] Dmitry Molchanov, Arsenii Ashukha, and Dmitry Vetrov.  Variational dropout sparsifies deep neural networks.  In Proceedings of the International Conference on Machine Learning, pages 2498–2507. PMLR, 2017.
  * [52] Serafín Moral-García and Joaquín Abellán.  Credal sets representable by reachable probability intervals and belief functions.  International Journal of Approximate Reasoning, 129:84–102, 2021\.
  * [53] Jishnu Mukhoti, Andreas Kirsch, Joost van Amersfoort, Philip HS Torr, and Yarin Gal.  Deep deterministic uncertainty: A new simple baseline.  In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 24384–24394, 2023.
  * [54] Radford M Neal et al.  MCMC using Hamiltonian dynamics.  Handbook of Markov Chain Monte Carlo, 2(11):2, 2011.
  * [55] Hung T Nguyen.  On random sets and belief functions.  Journal of Mathematical Analysis and Applications, 65(3):531–542, 1978.
  * [56] Jeremy Nixon, Michael W Dusenberry, Linchuan Zhang, Ghassen Jerfel, and Dustin Tran.  Measuring calibration in deep learning.  In CVPR workshops, volume 2, 2019.
  * [57] Yaniv Ovadia, Emily Fertig, Jie Ren, Zachary Nado, David Sculley, Sebastian Nowozin, Joshua Dillon, Balaji Lakshminarayanan, and Jasper Snoek.  Can you trust your model’s uncertainty? evaluating predictive uncertainty under dataset shift.  Advances in neural information processing systems, 32, 2019.
  * [58] Nicolas Papernot, Patrick McDaniel, Somesh Jha, Matt Fredrikson, Z Berkay Celik, and Ananthram Swami.  The limitations of deep learning in adversarial settings.  In 2016 IEEE European symposium on security and privacy (EuroS&P), pages 372–387. IEEE, 2016.
  * [59] Tim GJ Rudner, Zonghao Chen, Yee Whye Teh, and Yarin Gal.  Tractable function-space variational inference in bayesian neural networks.  Advances in Neural Information Processing Systems, 35:22686–22698, 2022.
  * [60] Yusuf Sale, Michele Caprio, and Eyke Höllermeier.  Is the volume of a credal set a good measure for epistemic uncertainty?  In Uncertainty in Artificial Intelligence, pages 1795–1804. PMLR, 2023.
  * [61] Yusuf Sale, Michele Caprio, and Eyke Hüllermeier.  Is the volume of a credal set a good measure for epistemic uncertainty?  In Accepted for Conference on Uncertainty in Artificial Intelligence (UAI 2023), pages 0–12, 2023.
  * [62] Robin Senge, Stefan Bösner, Krzysztof Dembczyński, Jörg Haasenritter, Oliver Hirsch, Norbert Donner-Banzhoff, and Eyke Hüllermeier.  Reliable classification: Learning classifiers that distinguish aleatoric and epistemic uncertainty.  Information Sciences, 255:16–29, 2014.
  * [63] Mohammad Hossein Shaker and Eyke Hüllermeier.  Ensemble-based uncertainty quantification: Bayesian versus credal inference.  In PROCEEDINGS 31. WORKSHOP COMPUTATIONAL INTELLIGENCE, volume 25, page 63, 2021.
  * [64] K Simonyan and A Zisserman.  Very deep convolutional networks for large-scale image recognition.  In 3rd International Conference on Learning Representations (ICLR 2015). Computational and Biological Learning Society, 2015.
  * [65] Mingxing Tan and Quoc Le.  Efficientnetv2: Smaller models and faster training.  In Marina Meila and Tong Zhang, editors, Proceedings of the 38th International Conference on Machine Learning, volume 139 of Proceedings of Machine Learning Research, pages 10096–10106. PMLR, 18–24 Jul 2021.
  * [66] Bjørnar Tessem.  Interval probability propagation.  International Journal of Approximate Reasoning, 7(3-4):95–120, 1992\.
  * [67] Ba-Hien Tran, Simone Rossi, Dimitrios Milios, and Maurizio Filippone.  All you need is a good functional prior for Bayesian deep learning.  ArXiv Preprint ArXiv:2011.12829, 2020.
  * [68] Pauli Virtanen, Ralf Gommers, Travis E. Oliphant, Matt Haberland, Tyler Reddy, David Cournapeau, Evgeni Burovski, Pearu Peterson, Warren Weckesser, Jonathan Bright, Stéfan J. van der Walt, Matthew Brett, Joshua Wilson, K. Jarrod Millman, Nikolay Mayorov, Andrew R. J. Nelson, Eric Jones, Robert Kern, Eric Larson, C J Carey, İlhan Polat, Yu Feng, Eric W. Moore, Jake VanderPlas, Denis Laxalde, Josef Perktold, Robert Cimrman, Ian Henriksen, E. A. Quintero, Charles R. Harris, Anne M. Archibald, Antônio H. Ribeiro, Fabian Pedregosa, Paul van Mulbregt, and SciPy 1.0 Contributors.  SciPy 1.0: Fundamental Algorithms for Scientific Computing in Python.  Nature Methods, 17:261–272, 2020.
  * [69] Peter Walley.  Statistical reasoning with imprecise probabilities.  1991\.
  * [70] Tonghui Wei, Wenjie Zuo, Hongwei Zheng, and Feng Li.  Slope hybrid reliability analysis considering the uncertainty of probability-interval using three-parameter weibull distribution.  Natural Hazards, 105:565–586, 2021.
  * [71] Yeming Wen, Paul Vicol, Jimmy Ba, Dustin Tran, and Roger Grosse.  Flipout: Efficient pseudo-independent weight perturbations on mini-batches.  In Proceedings of the International Conference on Learning Representations, 2018.
  * [72] Andrew G Wilson and Pavel Izmailov.  Bayesian deep learning and a probabilistic perspective of generalization.  Advances in neural information processing systems, 33:4697–4708, 2020.
  * [73] Ronald R Yager and Vladik Kreinovich.  Decision making under interval probabilities.  International Journal of Approximate Reasoning, 22(3):195–215, 1999\.
  * [74] Lotfi Asker Zadeh.  Fuzzy sets as a basis for a theory of possibility.  Fuzzy sets and systems, 1(1):3–28, 1978.
  * [75] Marco Zaffalon.  The naive credal classifier.  Journal of statistical planning and inference, 105(1):5–21, 2002\.
  * [76] Jindi Zhang, Yang Lou, Jianping Wang, Kui Wu, Kejie Lu, and Xiaohua Jia.  Evaluating adversarial attacks on driving safety in vision-based autonomous vehicles.  IEEE Internet of Things Journal, 9(5):3443–3456, 2021.
  * [77] Dengyong Zhou, Sumit Basu, Yi Mao, and John Platt.  Learning from the wisdom of crowds by minimax entropy.  Advances in Neural Information Processing Systems, 25, 2012.

##  Appendix A Additional Experiments

###  A.1 Ablation Study on Numbers of Predictive Samples

In this experiment, we train 30 Res50-based SNNs individually using the
CIFAR10 dataset and under different random seeds. Then, we construct deep
ensembles using the different numbers of ensemble members
$N\\!=\\!3,5,10,15,20,25$. Each type of deep ensemble includes 15 instances
using distinct seed combinations.

Tables 4 and 5 report the OOD detection performance comparison under different
numbers of samples and using the EU and TU estimates as the metrics,
respectively. The findings suggest that

  * •

Increasing the number of samples can improve the EU and TU estimation of our
proposed credal wrapper approach.

  * •

Compared to classical MBA of deep ensembles, our method consistently shows
superior performance on EU and TU quantification, robust against the number of
samples.

Figure 7 shows the ECE performance evaluation using the different number of
samples on the CIFAR10-C samples. We can observe that

  * •

Increasing the number of samples overall can lead to a lower ECE value.

  * •

Compared to the classical averaged probability of deep ensembles, our
intersection probability consistently achieves the lower ECE value on the
corrupted instances.

Table 4: OOD detection AUROC and AUPRC performance (%) comparison between classical and credal set representation of DEs-5 using EU as the uncertainty metrics, involving CIFAR10 (ID) vs SVHN (OOD) and Tiny-ImageNet (OOD). The results are from 15 runs and the best scores per uncertainty metric are in bold. | CIFAR10 vs SVHN | CIFAR10 vs Tiny-ImageNet
---|---|---
| AUROC | AUPRC | AUROC | AUPRC
$N$ | Baseline | Ours | Baseline | Ours | Baseline | Ours | Baseline | Ours
3 |  89.64±1.16 | 91.97±1.38 |  92.13±1.12 | 94.91±1.08 |  86.31±0.24 | 87.57±0.25 |  81.76±0.40 | 85.02±0.32
5 |  89.26±1.02 | 93.50±0.79 |  91.96±0.97 | 95.79±0.70 |  86.83±0.25 | 88.65±0.25 |  83.12±0.38 | 86.77±0.37
10 |  90.54±0.72 | 95.03±0.40 |  93.22±0.70 | 96.80±0.35 |  87.75±0.13 | 89.62±0.14 |  84.99±0.25 | 88.04±0.20
15 |  90.78±0.68 | 95.31±0.47 |  93.23±0.62 | 96.91±0.43 |  88.10±0.10 | 89.94±0.10 |  85.59±0.16 | 88.44±0.13
20 |  91.09±0.50 | 95.69±0.34 |  93.49±0.48 | 97.15±0.30 |  88.33±0.08 | 90.11±0.08 |  85.96±0.11 | 88.59±0.10
25 |  91.31±0.27 | 95.84±0.15 |  93.62±0.24 | 97.24±0.12 |  88.46±0.04 | 90.22±0.05 |  86.17±0.08 | 88.72±0.07
Table 5: OOD detection AUROC and AUPRC performance (%) comparison between classical and credal set representation of DEs-5 using TU as uncertainty metrics, involving CIFAR10 (ID) vs SVHN (OOD) and Tiny-ImageNet (OOD). The results are from 15 runs. The best scores per uncertainty metric are in bold. | CIFAR10 vs SVHN | CIFAR10 vs Tiny-ImageNet
---|---|---
| AUROC | AUPRC | AUROC | AUPRC
$N$ | Baseline | Ours | Baseline | Ours | Baseline | Ours | Baseline | Ours
3 |  94.30±0.99 | 94.68±1.01 |  97.03±0.62 | 97.21±0.65 |  88.24±0.23 | 88.54±0.23 |  86.46±0.33 | 86.98±0.32
5 |  94.78±0.54 | 95.40±0.55 |  97.19±0.38 | 97.49±0.40 |  88.71±0.25 | 89.17±0.26 |  87.10±0.37 | 87.86±0.37
10 |  95.47±0.34 | 96.18±0.31 |  97.61±0.23 | 97.91±0.23 |  89.27±0.13 | 89.86±0.14 |  87.90±0.19 | 88.63±0.19
15 |  95.55±0.32 | 96.25±0.37 |  97.63±0.23 | 97.88±0.29 |  89.48±0.08 | 90.11±0.10 |  88.19±0.12 | 88.87±0.12
20 |  95.72±0.23 | 96.46±0.26 |  97.74±0.15 | 97.98±0.23 |  89.60±0.07 | 90.24±0.08 |  88.34±0.09 | 88.95±0.11
25 |  95.80±0.12 | 96.53±0.12 |  97.78±0.08 | 98.01±0.10 |  89.67±0.04 | 90.32±0.05 |  88.42±0.05 | 89.01±0.07
Figure 7: ECE values of deep ensembles with various numbers of samples ($N$)
on CIFAR10-C against increased corruption intensity, using the averaged
probability and our proposed intersection probability.

###  A.2 Ablation Study on Hyperparameter of PIA Algorithm

In this experiment, we investigate the effect of the hyperparameter $J$ of the
PIA algorithm 1. The OOD detection tasks include CIFAR100 (ID) vs SVHN (OOD)
and Tiny-ImageNet (OOD) and deep ensembles are implemented on the Res50
backbone. Table 6 shows OOD detection performance and the time cost for
uncertainty quantification per sample, using different settings of $J$ for the
PIA algorithm. The findings suggest that increasing the value of $J$ improves
the OOD detection performance, but can lead to an increase in execution time.
This is because solving the constrained optimization problem in Eq. (8)
involves more variables and constraints.

Computational Cost The reported time in Table 6 cost is measured on a single
Intel Xeon Gold 8358<EMAIL_ADDRESS>GHz, without optimization in the calculation
process. As a reference, the time cost of the classical method for uncertainty
quantification per sample is 0.007 ± 0.001s. We believe a more efficient code
implementation of our approach could significantly mitigate the computational
cost.

Table 6: OOD detection AUROC and AUPRC performance (%) of credal set representation of DEs-5 using EU (left) and TU (right) as uncertainty metrics, and the time cost, using different setting of $J$ of PIA algorithm. The OOD detection involves CIFAR100 (ID) vs SVHN (OOD) and Tiny-ImageNet (OOD). The results are from 15 runs, based on the Res50 backbone. $J$ | EU as Metrics | TU as Metrics |  Time Cost per Sample (s)
---|---|---|---
SVHN | Tiny-ImageNet | SVHN | Tiny-ImageNet
AUROC | AUPRC | AUROC | AUPRC | AUROC | AUPRC | AUROC | AUPRC
10 |  78.81±1.87 |  87.96±1.09 |  80.17±0.19 |  75.25±0.26 |  80.05±1.92 |  89.30±0.97 |  81.24±0.14 |  77.60±0.18 |  7.182±0.087
20 |  80.22±1.96 |  89.40±1.03 |  81.00±0.16 |  77.16±0.23 |  80.71±1.96 |  89.97±0.99 |  81.46±0.14 |  78.29±0.17 |  11.346±0.038
100 |  80.55±1.99 |  89.68±1.04 |  81.16±0.16 |  77.76±0.21 |  80.90±1.98 |  90.07±1.00 |  81.52±0.14 |  78.50±0.15 |  109.469±1.330

##  Appendix B Experimental Implementation Details

###  B.1 Training Details

In terms of the evaluation using the small-scale datasets in Section 4.1.1,
all models are implemented on the established VGG16 and Res18 architectures
using the CIFAR10 dataset. The Adam optimizer is applied with a learning rate
scheduler, initialized at 0.001, and subjected to a 0.1 reduction at epochs 80
and 120. Standard neural networks and BNNs are trained for 100 and 150 epochs,
respectively. Standard data augmentation is uniformly implemented across all
methodologies to enhance the training performance quality of training data and
training performance. The training batch size is set as 128. The device is a
single Tesla P100-SXM2-16GB GPU. The standard data split is applied.

In terms of the evaluation using the large-scale datasets and the ablation
study in Sections 4.1.2 and 4.1.3, We mainly use two Tesla P100-SXM2-16GB GPUs
as devices to contract deep ensembles by independently training 15 standard
neural networks (SNNs) under different random seeds. The input shape of the
networks is (224, 224, 3). The Adam optimizer is employed, with a learning
rate scheduler set at 0.001 and reduced to 0.0001 during the final 5 training
epochs. Concerning the CIFAR10 dataset, SNNs are trained using 15, 15, and 25
epochs for Res50, EffB2, and ViT-B backbones, respectively. As for the
CIFAR100 dataset, SNNs are trained using 20, 20, and 25 epochs for Res50,
EffB2, and ViT-B backbones, respectively. Note that models based on ViT-B
backbones are trained on one single NVIDIA A100-SXM4-40GB GPU. In the ImageNet
experiments, we employ one single NVIDIA A100-SXM4-40GB GPU to retrain SNNs
based on a pre-trained Res50 model for 3 epochs, using the Adam optimizer with
an initialized learning rate of $1e^{-6}$, under different random seeds.
Standard data split is applied to all training processes.

The experiment codes are provided in the supplementary files.

###  B.2 OOD Detection Process

In this paper, the OOD detection process is treated as a binary
classification. We label ID and OOD samples as 0 and 1, respectively. The
model’s uncertainty estimation (using the EU or TU) for each sample is the
‘prediction’ for the detection. In terms of performance indicators, the
applied AUROC quantifies the rates of true and false positives. The AUPRC
evaluates precision and recall trade-offs, providing valuable insights into
the model’s effectiveness across different confidence levels.

The detailed implementation for OOD detection is shown in Algorithm 2.

Input: Uncertainty estimates for ID and OOD samples, namely
$\bm{u}_{\text{ID}}$, $\bm{u}_{\text{OOD}}$

Output: AUROC and AUPRC scores

$\\#$ Set labels ($\bm{b}_{\text{ID}}$) as 0 for ID samples

$\bm{b}_{\text{ID}}\leftarrow\text{zeros}(\text{shape of }\bm{u}_{\text{ID}})$

$\\#$ Set labels ($\bm{b}_{\text{OOD}}$) as 1 for OOD samples

$\bm{b}_{\text{OOD}}\leftarrow\text{ones}(\text{shape of
}\bm{u}_{\text{OOD}})$

$\bm{b}\leftarrow\text{concatenate}(\bm{b}_{\text{ID}},\bm{b}_{\text{OOD}})$

$\\#$ Concatenate uncertainty estimates as “predictions”

$\bm{u}\leftarrow\text{concatenate}(\bm{u}_{\text{ID}},\bm{u}_{\text{OOD}})$

$\\#$ Compute AUROC and AUPRC

$\text{AUROC}\leftarrow\text{roc\\_auc\\_score}(\bm{b},\bm{u})$

$\text{AUPRC}\leftarrow\text{average\\_precision\\_score}(\bm{b},\bm{u})$

Algorithm 2 AUROC and AUPRC Scores for OOD Detection

###  B.3 ECE Evaluation Process

In the context of ECE, a ‘well-calibrated’ prediction is expected to have a
confidence value of 80% and be correct in approximately 80% of the test cases.
In ECE calculation, predictions are split into a predetermined number $Q$ of
bins $B$ of equal confidence range. The ECE is then calculated by summing the
absolute difference between the average accuracy and confidence within each
bin [49]:

$\text{ECE}\\!:=\\!\sum\nolimits_{g=1}^{G}\frac{|B_{g}|}{n}\bigg{|}\text{acc}(B_{g})-\text{conf}(B_{g})\bigg{|},$
(11)

where $|B_{g}|$ is the number of samples in the $g$-th bin and $n$ is the
total number of samples.