Random-Set Neural Networks (RS-NN)
Machine learning is increasingly deployed in safety-critical domains where
robustness against adversarial attacks is crucial and erroneous predictions
could lead to potentially catastrophic consequences. This highlights the need
for learning systems to be equipped with the means to determine a model's
confidence in its prediction and the epistemic uncertainty associated with it,
'to know when a model does not know'. In this paper, we propose a novel
Random-Set Neural Network (RS-NN) for classification. RS-NN predicts belief
functions rather than probability vectors over a set of classes using the
mathematics of random sets, i.e., distributions over the power set of the
sample space. RS-NN encodes the 'epistemic' uncertainty induced in machine
learning by limited training sets via the size of the credal sets associated
with the predicted belief functions. Our approach outperforms state-of-the-art
Bayesian (LB-BNN, BNN-R) and Ensemble (ENN) methods in a classical evaluation
setting in terms of performance, uncertainty estimation and out-of-distribution
(OoD) detection on several benchmarks (CIFAR-10 vs SVHN/Intel-Image, MNIST vs
FMNIST/KMNIST, ImageNet vs ImageNet-O) and scales effectively to large-scale
architectures such as WideResNet-28-10, VGG16, Inception V3, EfficientNetB2,
and ViT-Base.
Shireen Kudukkil Manchingal, Muhammad Mubashar, Kaizheng Wang, Keivan Shariatmadar, Fabio Cuzzolin
# Random-Set Convolutional Neural Network (RS-CNN)

###### Abstract

Machine learning is increasingly deployed in safety-critical domains where robustness against adversarial attacks is crucial and erroneous predictions could lead to potentially catastrophic consequences. This highlights the need for learning systems to be equipped with the means to determine a model's confidence in its prediction and the epistemic uncertainty associated with it, 'to know when a model does not know'. In this paper, we propose a novel Random-Set Convolutional Neural Network (RS-CNN) for classification which predicts belief functions rather than probability vectors over the set of classes, using the mathematics of _random sets_, i.e., distributions over the power set of the sample space. Based on the epistemic deep learning approach, random-set models are capable of representing the 'epistemic' uncertainty induced in machine learning by limited training sets. We estimate epistemic uncertainty by approximating the size of credal sets associated with the predicted belief functions, and experimentally demonstrate how our approach outperforms competing uncertainty-aware approaches in a classical evaluation setting. The performance of RS-CNN is best demonstrated on OOD samples where it manages to capture the true prediction while standard CNNs fail.

## 1 Introduction

Despite its recent rise in popularity, in its current form, artificial intelligence (AI) cannot confidently make predictions robust enough to stand the test of data generated by processes different from those studied at training time, even by tiny details, as shown by 'adversarial' results able to fool deep neural networks [66]. While recognising this issue under different names (e.g. _overfitting_[68] or _model adaptation_[52]), traditional machine learning seems unable to address it at a fundamental level. As a result, AI systems suffer from brittle behaviour, and find it hard to operate in new situations. A major cause of this problem is the widespread presence of _epistemic uncertainty_, i.e., uncertainty about the process generating the data itself. In machine learning, this derives from the limited representativeness of the available training sets, in terms of both quantity and quality. As few samples are collected in specific domain distributions, the learnt models have no way to effectively model domain variation.

The machine learning community recognises the problem. This has given rise to several proposals for estimating the uncertainty associated with network predictions, including Bayesian Dropout [35], distance-aware priors [28] and the use of random fuzzy sets [27]. An "evidential" deep learning method [70] for uncertainty quantification in classification using Dirichlet distribution and, more recently, epistemic neural networks [63] as a generalisation of Bayesian neural networks have been proposed. None of these methods, however, fully, explicitly capture the epistemic uncertainty stemming from the data issue. Some of them rely on prior knowledge [32], whereas others require setting a desired threshold on the metrics [2]. It has been argued by some that classical probability
theory is, in fact, not equipped to model "second-level" uncertainty on the probabilities themselves. This has led in the past to the formulation of numerous (epistemic) uncertainty calculi [18], starting from de Finetti's pioneering work on subjective probability [21], and including possibility theory [30], probability intervals [39], credal sets [51], random sets [61] and imprecise probability [85].

In this paper, we propose to model epistemic uncertainty using a _random set_ representation [57]. As we focus on finite target spaces in a classification setting, we will model uncertainty using _belief functions_[71], the finite incarnation of random sets [17]. The theory of belief functions or theory of evidence [71] is a generalisation of Bayesian inference [79] since classical (discrete) probabilities are simply special belief functions and Bayes' rule is a special case of Dempster's rule of combination. Crucially, in the theory of evidence, priors are not needed to start the inference process, avoiding the selection bias risks that can seriously condition Bayesian reasoning [33]. An interesting geometric approach to uncertainty measures, and belief functions in particular, has been proposed by one of us [19; 10; 11; 16; 15].

To model uncertainty using belief functions, we propose a novel Random-set Convolutional Neural Network based on the principles of the epistemic deep learning concept. Epistemic deep learning [55] argues that a deep neural network producing an outcome for (selected) subsets of the target space is an intrinsically more faithful representation of the epistemic uncertainty associated with the limited quantity and quality of the training data. As they assign probability values to sets of outcomes directly, they naturally model the fact that observations almost invariably come in the form of sets. In an image classification setting, this could be interpreted as a test image being mapped to a _set_ of classes, rather than a single class, when there is uncertainty about the true class. By representing classes as sets, set-valued classification can handle imprecise data more effectively and provide a richer understanding of the underlying uncertainty. It enables the classification model to capture multiple possible interpretations or predictions for each instance, allowing for more robust decision-making and improved performance in scenarios where precise labels may not be available or appropriate.

**Contributions** The following are the key contributions of our paper:

* A novel _Random-set Convolutional Neural Network_ (RS-CNN) classifier for uncertainty estimation based on the principle of epistemic deep learning, outputting Belief or Mass predictions for sets of classes, training using suitable loss functions generalising classical cross-entropy.
* A method for selecting a fixed budget of focal sets (sets with non-zero probability, associated with the network's output neurons) from the power set of classes, thus ensuring scalability.
* A method for estimating the epistemic uncertainty of the prediction in terms of the size of the credal set (set of probability vectors) consistent with a predicted belief function.
* Experimental validation demonstrating the RS-CNN model outperform other uncertainty-aware models and exhibit superior accuracy on out-of-distribution (OOD) samples compared to the standard CNN.

## 2 Related Work

Researchers have recently taken some tentative steps to model uncertainty in machine learning and artificial intelligence. Scientists have adopted measures of epistemic uncertainty [43] to refuse or delay making a decision [36], take actions specifically directed at reducing uncertainty (as in active learning [1]), or exclude highly-uncertain data at decision making time [43]. Networks which abstain from making predictions [36] or the use of Gaussian processes [42] have been proposed [18].

Epistemic learning relates to both approaches which learn sets of models [7] (although differing in its rationale and the mathematics involved) and to approaches in domain adaptation which employ minimax optimisation to learn models adapted to data generated by any probability distribution within a "safe" family [92]. The Naive Credal Classifier (NCC) extends the naive Bayes classifier with imprecise probabilities represented as class sets [90; 9]. Other methods include \(\epsilon\)-contamination [73; 74], non-probabilistic uncertainty [72], and imprecise decision theory [75; 76]. Rough set-based classification approaches have also been proposed [82; 24; 31]. The use of belief functions in uncertainty estimation has been explored previously in several evidential clustering methods such as evidential c-means (ECM) [56] and neural-network based evidential clustering (NN-EVCLUS) [26], in classification fusion [53], and in evidential neural networks for classification [81] and regression [25]. These attempts to introduce concepts from uncertainty theory into machine learning have so far achieved limited impact, possibly because of the lack of a solid underlying principle.
Bayesian approaches, pioneered by [6; 54; 59], have established a link between Bayesian neural networks and Gaussian processes. Approximations of full Bayesian inference have been sought using MCMC [58; 37], variational inference [38] and dropout VI [34]. Recent work has addressed challenges such as computational cost, model priors, and tractable function-space variational inference [40; 89; 20; 83; 69]. Bayesian models have been deployed in various domains, including multi-task learning in autonomous vehicles [44], histopathological image classification [67] for cancer diagnostics and medical image segmentation [87]. However, they still pose some challenges since Bayesian models assume that the true data-generating process lies within the model's hypothesis space. If the model prior is misspecified and fails to capture the true underlying process adequately, the estimated epistemic uncertainty may not be reliable. Our approach, on the other hand, does not require sampling during inference nor it requires us to choose a prior, thereby reducing the computational complexity of the model when compared to Bayesian inference and avoiding bias.

## 3 Random-set Convolutional Neural Network

Based on the principles of epistemic deep learning [55] mentioned in Sec. 1, we propose the following architecture and training objectives for a novel class of models called _Random-Set convolutional neural networks_ (RS-CNN) that can be trained to output scores for sets of outcomes, and to encode the epistemic uncertainty associated with the prediction in the random set framework.

### Random sets and Belief functions

Let us denote by \(\Omega\) and \(\Theta\) the sets of outcomes of two different but related problems \(Q_{1}\) and \(Q_{2}\), respectively. Given a probability measure \(P\) on \(\Omega\), we want to derive a 'degree of belief' \(Bel(A)\) that \(A\subset\Theta\) contains the correct response to \(Q_{2}\). If we call \(\Gamma(\omega)\) the subset of outcomes of \(Q_{2}\) compatible with \(\omega\in\Omega\), \(\omega\) tells us that the answer to \(Q_{2}\) is in \(A\) whenever \(\Gamma(\omega)\subset A\).

The _degree of belief_\(Bel(A)\) of an event \(A\subset\Theta\) is then the total probability (in \(\Omega\)) of all the outcomes \(\omega\) of \(Q_{1}\) that satisfy the above condition [22]:

\[Bel(A)=P(\{\omega|\Gamma(\omega)\subset A\})=\sum_{\omega\in\Omega:\Gamma( \omega)\subset A}P(\{\omega\}). \tag{1}\]

The mapping \(\Gamma:\Omega\to 2^{\Theta}=\{A\subseteq\Theta\}\) is called a _multivalued mapping_ from \(\Omega\) to \(\Theta\). Such a mapping, together with a probability measure \(P\) on \(\Omega\), induces a _belief function_ on \(2^{\Theta}\). In Dempster's original formulation, then, belief functions are objects induced by a source probability measure in a decision space for which we do not have a probability, as long as there exists a 1-many mapping between the two.

Belief functions can also be defined axiomatically on the domain of interest (_frame of discernent_) \(\Theta\), without making reference to multivalued mappings. A _basic probability assignment_ (BPA) [71] is a set function [23; 29]\(m:2^{\Theta}\rightarrow[0,1]\) s.t. \(m(\emptyset)=0\) and \(\sum_{A\subset\Theta}m(A)=1\). In Dempster's interpretation, the'mass' \(m(A)\) assigned to \(A\) is in fact the probability \(P(\{\omega\in\Omega:\Gamma(\omega)=A\})\). Shafer and Smets [77], amongst others, have supported a view of mass functions as independently defined on \(\Theta\). Subsets of \(\Theta\) whose mass values are non-zero are called _focal elements_ of \(m\).

### Architecture of Random-Set Convolutional Neural Networks

Consider a simple classification neural network. A classifier \(e\) is a mapping from an input space \(X\) to a categorical target space \(Y=[N]\), where \(N\) denotes the number of classes, \(e:X\rightarrow[N]\).

In set-valued classification, on the other hand, \(e\) is a mapping from \(X\) to the set of all subsets of \([N]\), the powerset \(\mathbb{P}(N)\), \(e:X\to 2^{[N]}\rightarrow\mathbb{P}(N)\). As shown in Figure 1, a Random-set CNN predicts a mass/belief function for each input data point, rather than softmax probabilities as in a traditional CNN. For \(N\) classes, a random-set CNN will have \(2^{N}\) outputs, which is not computationally feasible for large values of \(N\) due to the exponential complexity. Therefore, instead of using all the \(2^{N}\) subsets as outputs, only \(K\) relevant subsets (\(A_{K}\) focal sets) are chosen out of the \(2^{N}\) subsets available.

**Budget**. To obtain these \(K\) focal subsets, given a training set, we extract a feature vector for each training sample from the penultimate layer of a trained standard CNN with \(N\) outputs in the last layer. The t-SNE (t-Distributed Stochastic Neighbor Embedding) [84] algorithm is used to reduce the
dimensionality of the feature vectors to 3 dimensions. Then, a Gaussian Mixture Model (GMM) is fit to the reduced feature vectors of each class. Note that our approach is agnostic, as t-SNE could be replaced with any other dimensionality reduction technique, including autoencoders. For each class \(c\), we define an ellipsoid [80] which covers 95% data from that class \(c\) using the eigenvectors and eigenvalues of the covariance matrix \(\Sigma_{c}\) and the mean vector \(\mu_{c}\), \(\forall c\in N\)\(P_{c}\sim\mathcal{N}(x_{c};\mu_{c},\Sigma_{c})\) obtained from the GMM. The class ellipsoids are plotted in a 3-dimensional space and the overlap of each subset in the power set of \(N\) is computed. As it is computationally infeasible to compute overlap for all \(2^{N}\) subsets, we start doing so from cardinality 2 and use early stopping when increasing the cardinality further does not alter the list of most-overlapping sets of classes. We choose the top-\(K\) subsets (\(A_{K}\)) with the highest overlapping ratio, computed as the intersection over union for each subset \(A\) in \(\mathbb{P}(N)\), \(overlap(A)=\cap_{i\in A}A_{i}/\cup_{i\in A}A_{i}\,,\ A\in\mathbb{P}(N)\). These \(K\) non-singleton focal sets, along with the \(N\) singleton sets associated with the original classes, form our new set of classes.

**Encoding**. Set-valued observations for random-set CNNs can be defined in two ways: (i) by encoding the belief value \(Bel(A)\) for each subset \(A\) in the power set \(\mathbb{P}(N)\) of \(N\) classes: \(\hat{y}=Bel(A),A\in\mathbb{P}(N)\), or (ii) by encoding its mass value: \(\hat{y}=m(A),A\in\mathbb{P}(N)\). In the belief value encoding, the ground truth vector is \(GT_{Bel}=\{Bel_{1},Bel_{2},\ldots,Bel_{2^{N}}\}\), where \(Bel_{i}\) is the belief value for \(i\in\mathbb{P}(N)\). In the mass value encoding, the ground truth becomes \(GT_{m}=\{m_{1},m_{2},\ldots,m_{2^{N}}\}\), where \(m_{i}\) is the mass value for \(i\in\mathbb{P}(N)\). Note that the trained random-set CNN outputs a mass/belief score for focal sets in \(A_{K}\) only.

In this paper, we focus primarily on the Belief RS-CNN (B-RS-CNN) on precise data, as the belief value encoding has a more complex structure and the potential to "teach" the network the set structure. Unlike the Mass RS-CNN (M-RS-CNN), where a mass value is considered "true" when only the true class in contained in subset \(A\), the belief value \(Bel(A)\) is deemed "true" for all instances where the true class is present in subset \(A\). Consequently, the mass value encoding resembles a padded version of the original target vector in traditional CNN, with zeros introduced for all non-singleton sets. The full potential of M-RS-CNN can be demonstrated only in an imprecise data setting, where we have ambigous ground truth. We briefly report the accuracies for M-RS-CNN in Table 1 and provide the formulation of generalisation of Kullback-Leibler(KL) divergence to mass functions as loss to M-RS-CNN (proof in Appendix A.1). For the remainder of this paper, we refer to belief random-set CNN as RS-CNN.

#### 3.2.1 Belief Random-Set Convolutional Neural Network

The belief random-set CNN is trained on the belief-encoded ground truth representation for \(A_{K}\) subsets, where a belief value \(Bel(A)\) is 1 iff the true class is contained in the subset \(A\). This corresponds to full certainty that the element belongs to that set and there is complete confidence in this proposition. Since the belief RS-CNN mimics the structure of a multi-label classification problem, with respect to the ground truth alone, Binary Cross-Entropy (BCE) (Eq.2) is used as loss function with sigmoid activation to get independent belief functions for each subset \(A_{K}\in\mathbb{P}(N)\),

\[\mathcal{L}_{BCE}=ylog(\hat{y}_{Bel})+(1-y)log(1-\hat{y}_{Bel}). \tag{2}\]

Figure 1: Model architecture for random-set CNNs. This figure shows the architecture for a belief RS-CNN model that takes as input \(N\) classes, selects the top \(K\) relevant subsets \(A_{K}\) from the powerset \(\mathcal{P}(N)\), and passes the belief encoded ground truth to predict a belief function for each input data point. Mass values and pignistic probability estimates are computed from the predicted belief function. Uncertainty is estimated using the methods described in Sec. 4.
The prediction of valid belief functions is facilitated by incorporating a specific term in the loss function that enforces the non-negativity of the mass functions computed using the Moebius inversion formula (Eq. 3). This term ensures that the model only learns valid belief functions, as any predicted belief function \(\hat{Bel}(A)\) with negative mass \(m(A)\) is considered invalid. The Moebius inversion formula to compute masses from belief functions is,

\[m(A)=\sum_{B\subseteq A}(-1)^{|A\setminus B|}\hat{Bel}(B). \tag{3}\]

Belief functions assign non-negative masses to subsets of a frame of discernment, where the sum of masses over all subsets equals \(1\). A mass sum term \(M_{s}\) and a mass regularization term \(M_{r}\) (Eq. 4),

\[M_{s}=\max\left(0,\frac{1}{b_{size}}\sum_{i=1}^{b_{size}}\sum_{A}m_{i}(A)-1 \right)\,\ \ M_{r}=\frac{1}{b_{size}}\sum_{i=1}^{b_{size}}\sum_{A}\max(0,-m_{i}(A)) \tag{4}\]

are thus added to \(\mathcal{L}_{BCE}\). \(M_{r}\) and \(M_{s}\) ensure that the loss function only penalizes the model for predictions with negative mass values, effectively encouraging the model to have positive mass values, and the sum of all masses computed from predicted belief functions is less than or equal to 1, respectively. Positive masses are added over the batch size in \(M_{r}\) (Eq. 4). Additionally, hyperparameters \(\alpha\) and \(\beta\) are added to the binary cross-entropy loss to control the relative importance of the BCE with respect to \(M_{r}\) and \(M_{s}\). The final loss for belief RS-CNN the becomes,

\[\mathcal{L}_{B-RS}=\mathcal{L}_{BCE}+\alpha M_{r}+\beta M_{s}. \tag{5}\]

## 4 Uncertainty estimation in Random-Set CNN

**Pignistic prediction**. A prediction in the form of a precise probability vector can be obtained by computing Smet's pignistic probability transform (Eq.6) [78] for each class \(c\) using the predicted masses of the focal sets in the budget. The pignistic probability, \(BetP\), of each class \(c\) is computed as the sum of the mass of the focal sets \(A\) that contain \(c\) divided by their cardinality. This transformation redistributes the mass values to assign a probability measures to each class \(c\).

\[BetP(c)=\sum_{c\in\mathcal{A}}\frac{m(A)}{|A|}. \tag{6}\]

The most likely class can then be extracted from the pignistic prediction, and accuracy can be calculated in the standard way.

**Entropy of pignistic probability**. The Shannon entropy of the pignistic probability estimate \(BetP\) for each class \(c\) can then be used to assess the uncertainty associated with the predictions. A higher entropy value (Eq. 7) indicates greater uncertainty in the model's predictions.

\[H_{RS}=-\sum_{c\in N}BetP(c)\log BetP(c). \tag{7}\]

**Size of credal set**. A random-set CNN predicts a belief function (a finite random set) on the target space. A belief function, in turn, is associated with a convex set of probability distributions (a _credal set_[51, 91, 14, 3, 4, 12]) on the space of classes. The size of this credal set thus measures the extent of the epistemic uncertainty associated with the prediction. When the model is confident, the credal set will approach a single, precise probability. When uncertainty is high, the credal set will be wide.

Any probability distribution \(P\) such that \(P(A)\geq Bel(A)\ \forall A\subset\Theta\), is said to be _consistent_ with \(Bel\)[49]. Each belief function \(Bel\) thus uniquely identifies a set of probabilities consistent with it, \(\mathcal{P}[Bel]=\{P\in\mathcal{P}|P(A)\geq Bel(A)\}\), where \(\mathcal{P}\) is the set of all probabilities one can define on \(\Theta\). Not all credal sets are consistent with a belief function. credal sets associated with BFs have as vertices all the distributions \(P^{\pi}\) induced by a permutation \(\pi=\{x_{\pi(1)},\ldots,x_{\pi(|\Theta|)}\}\) of the singletons of \(\Theta=\{x_{1},\ldots,x_{n}\}\) of the form [8, 13]

\[P^{\pi}[Bel](x_{\pi(i)})=\sum_{A\ni x_{\pi(i)};\ A\ni x_{\pi(j)}\ \forall j<i}m(A). \tag{8}\]

Such an extremal probability (8) assigns to a singleton element put in position \(\pi(i)\) by the permutation \(\pi\) the mass of all the focal elements containing it, but not containing any elements preceding it in
the permutation order [86]. Eq. (8) analytically derives the finite set of vertices which identify a random-set prediction. For class \(c\), the size of the credal set is approximated by calculating the minimum and maximum (Eq. 9) of the extremal probabilities,

\[P^{\pi}_{min}=\min_{P^{\pi}[Bel](x_{\pi(i)})}P^{\pi}[Bel](x_{\pi(i)})_{y_{c}}, \hskip 14.226378ptP^{\pi}_{max}=\max_{P^{\pi}[Bel](x_{\pi(i)})}P^{\pi}[Bel](x_{ \pi(i)})_{y_{c}} \tag{9}\]

where \(y_{c}\) is the index of class \(c\). These minimum and maximum extremal probabilities are the upper and lower bounds of the estimated probability for class \(c\). The predicted pignistic probability estimate \(BetP\) falls within the interval of these upper and lower bounds which indicates the epistemic uncertainty associated with the prediction. Credal set width, measured as the difference between \(P^{\pi}_{max}\) and \(P^{\pi}_{min}\), is the epistemic uncertainty estimate associated with a prediction.

## 5 Experiments

**Performance.** We evaluate the performance of random-set convolutional neural networks (RS-CNN) with experiments on multi-class image classification datasets MNIST [50], CIFAR10 [48], Intel Image [5] and CIFAR-100 [47], compare against state-of-the-art Bayesian and Evidential classifiers for uncertainty estimation (see Table 1). **CNN** is a standard deterministic neural network, the only model that does not include uncertainty estimation, **MCDropout**[35], **R-BNN**[46], **F-BNN**[88], **LB-BNN**[41] are Bayesian models with Monte-Carlo dropout approximation, Variational inference with Local Reparameterization Trick [45], Flipout estimation[88] and Laplace Bayesian posterior approximation respectively. **ENN**[64] is an epistemic NN classifier based on a generalisation of Bayesian method, and **EDL** is the Evidential deep classifier [70] for uncertainty estimation based on evidence theory. **M-RS-CNN** and **B-RS-CNN** are our mass and belief random-set convolutional neural networks. For fair comparison, we have used the same model architecture as RS-CNN to test all these methods. Their test accuracies are reported in Table 1. While we included Bayesian and Evidential learning models, it is important to note that comparing our models directly with methods like ensembles and Bayesian models that use priors may not be entirely appropriate.

**Model architecture.** The RS-CNN architecture consists of three convolutional layers: the first layer has 32 filters of size 3x3, and the second and third layers have 64 filters of size 3x3. ReLU activation is used in all three layers. Max pooling with a pool size of (2, 2) follows the first and third convolutional layers. A dropout layer with a rate of 25% is added before the final two layers. The fully connected layer has 100 hidden units with ReLU activation, and the output layer has the same number of units as the number of focal sets, using the sigmoid activation function.

In the first step, we train the RS-CNN model using the Adam optimizer with categorical cross-entropy loss over 15 epochs with learning rate \(0.001\) and batch size of 64. The feature vector \(f\) is extracted from the penultimate layer. We apply t-SNE for dimensionality reduction and map the class features to a 3D space. To expedite computation, we utilize all available CPU cores for parallel processing, which takes \(\approx\)7 minutes for CIFAR10 with 10 classes. The remaining computations are performed on a GPU (NVIDIA GeForce GTX 1080 Ti). Clusters or elliptical regions representing the 10 classes are calculated using mean, standard deviation, and eigenvectors obtained by fitting individual Gaussian Mixture Models (GMMs) to the embedded features of each class. For CIFAR10 with 10 classes (\(N=10\)), we have a total of 1024 sets of classes (\(2^{N}\)). Due to the exponential complexity of computing predictions for all 1024 sets, we select the top K most-relevant subsets, additional to

\begin{table}
\begin{tabular}{l l l l l} \hline \hline Datasets & MNIST & CIFAR10 & INTEL-IMAGE & CIFAR100 \\ \hline CNN & \(99.33\pm 0.05\) & \(75.29\pm 0.42\) & \(79.62\pm 0.41\) & \(\mathbf{42.88\pm 0.74}\) \\ MCDropout [35] & \(98.79\pm 0.15\) & \(62.95\pm 0.50\) & \(66.60\pm 1.13\) & \(38.42\pm 0.88\) \\ R-BNN [46, 45] & \(97.96\pm 0.07\) & \(53.28\pm 0.24\) & \(57.47\pm 0.83\) & \(27.10\pm 0.65\) \\ F-BNN [88] & \(98.27\pm 0.04\) & \(55.16\pm 0.52\) & \(60.77\pm 0.32\) & \(29.97\pm 0.98\) \\ LB-BNN [41] & \(99.25\pm 0.06\) & \(74.24\pm 0.60\) & \(79.66\pm 0.78\) & \(40.30\pm 0.44\) \\ EDL [70] & \(98.61\pm 0.77\) & \(75.87\pm 0.41\) & \(79.97\pm 0.09\) & \(37.33\pm 0.40\) \\ ENN [64] & \(99.14\pm 0.11\) & \(72.60\pm 0.50\) & \(77.93\pm 0.95\) & \(40.72\pm 0.30\) \\
**M-RS-CNN** & \(99.39\pm 0.07\) & \(75.98\pm 0.20\) & \(79.55\pm 0.37\) & \(41.50\pm 0.40\) \\
**B-RS-CNN** & \(\mathbf{99.39\pm 0.08}\) & \(\mathbf{77.63\pm 0.42}\) & \(\mathbf{81.59\pm 0.47}\) & \(39.80\pm 0.06\) \\ \hline \hline \end{tabular}
\end{table}
Table 1: Comparison of test accuracies (%) of uncertainty estimation classifiers with RS-CNN over 5 consecutive runs. The average and standard deviation are shown for each experiment.
singletons. The overlapping ratio is estimated between all classes, and we choose K subsets with the highest overlapping ratios (Sec. 3.2). In our experiment, we set K to 20, excluding the empty set and N singletons. For example, in CIFAR10, the selected non-singleton focal sets include combinations such as {'cat', 'dog'}, {'horse', 'deer'}, {'bird', 'airplane'}, and {'cat', 'horse', 'dog'}. These 20 focal sets, along with the 10 singletons, form our new set of classes \(A\in\mathbb{P}(N)\). The belief function \(Bel(A)\) is considered "true" if the true class is present in the set. For instance, for the class 'bird', the belief functions for subsets {'bird'} and {'bird', 'airplane'} are set to 1. The model is trained using the BCE-M loss function (Eq. 5) over 50 epochs and a batch size of 64. Our experiments use \(\alpha=1\) and \(\beta=1\).

The predicted belief function \(\hat{Bel}(A)\) gives the belief values for a list of classes including singletons and non-singleton focal subsets. We compute mass values from the predicted \(\hat{Bel}(A)\) using Eq. 3. The sum of predicted masses should be around 1 depending on the rate with which the model has learnt the belief values. We compute the pignistic probabilities (Sec. 4) for each original class \(N=10\) using Eq. 6. Table 2 shows the predicted belief functions, masses, and pignistic predictions for the samples. The test accuracy is calculated by comparing the pignistic prediction with the true labels. The test accuracy for Belief RS-CNN for MNIST, CIFAR10, CIFAR100 and Intel Image Classification datasets are \(99.39\%\), \(77.63\%\), \(39.80\%\) and \(81.59\%\).

**Uncertainty estimation.** We calculate the predicted belief, mass and pignistic probability for both in-distribution and out-of-distribution(OOD) samples of the test data, noisy (random noise added to test set) and rotated (random degrees of rotation between -30 and 180). RS-CNN has significantly higher test accuracy than a standard CNN for noisy out-of-distribution MNIST data. Table 4 shows the test accuracies for standard CNN and RS-CNN at different scales of random noise. Table 3 shows an example of an OOD rotated MNIST image with a true label "8". The standard CNN makes a wrong prediction ("6") with \(99.95\%\) confidence and a low entropy of 0.0061. The CNN fails to perform well on OOD samples, whereas the RS-CNN predicts the belief functions for top 5 subsets {'6', '4', '8'}, {'6', '8', '1'}, {'6', '8'}, {'9', '8'}, and {'8', '3'}. It is clear from the belief prediction alone that the true element is contained in most, if not all of the subsets. We compute the mass values using Eq. 3, and the pignistic probabilities using Eq. 6. The highest pignistic probability estimate gives us a correct prediction of class "8" with a pignistic probability of 49.7% and an entropy of 2.1626. This

\begin{table}
\begin{tabular}{l l l l l l l} \hline \hline \multicolumn{2}{c}{**True Label = \(\text{\text
demonstrates how RS-CNNs predict even the true class with a lower confidence in uncertain cases, in contrast to the standard CNN that provide incorrect classifications with high confidence.

A distribution of confidence scores for belief random-set CNN are shown in Fig. 1(a) for both incorrectly classified and correctly classified samples. In Fig. 1(b), we show how a standard CNN has high confidence for incorrectly classified samples whereas RS-CNN exhibits lower confidence and higher entropy (Fig. 1(c)) for incorrectly classified samples. Fig. 1(c) displays the entropy distribution for correctly and incorrectly classified samples of CIFAR10, including in-distribution, noisy, and rotated images. Higher entropy is observed for incorrectly classified predictions across all three cases.

Fig. 3(a) shows entropy-based uncertainty estimation for rotated OOD samples of the MNIST digit '\(3\)'. The RS-CNN model accurately predicts the true class at \(-30\), \(0\), and \(30\) degrees, indicating low uncertainty. As the rotation angle increases, all models predict the wrong class, with the RS-CNN showing higher entropy than LB-BNN. ENN, an ensemble method, also exhibits higher entropy. Overall, RS-CNN provides a better measure of uncertainty.

To estimate the epistemic uncertainty of a prediction, we approximate the extremal probabilities that define the vertices of the associated credal set. Instead of calculating the exact vertices, which is computationally expensive due to a large number of permutations, we calculate the upper and lower bounds of the credal set using Eq. 9. This approximation allows us to visualize the uncertainty by plotting the upper and lower bounds in Fig. 3 for a subset of CIFAR10 samples. The pignistic probability estimate, \(BetP\), falls within this credal set, and the distance between the upper (\(P_{max}^{\pi}\)) and lower (\(P_{min}^{\pi}\)) bounds represents the epistemic uncertainty. Fig. 3(b) displays the estimated credal width for both correctly and incorrectly classified samples. The length of the lines reflect the epistemic uncertainty. Incorrect classifications exhibit high credal set widths, indicating higher associated uncertainty.

**Choice of model architecture** We verify our approach on larger model architectures, specifically, Resnet-50 (see Table 5) and observe a higher test accuracy of 83.13% on CIFAR10, while predicting uncertainty, compared to a test accuracy of 84.21% for a standard Resnet-50. Both models were trained for 200 epochs with a varying learning rate. With better model architectures, we can achieve higher test accuracies than reported in Table 1.

\begin{table}
\begin{tabular}{l l l l l l l l} \hline \hline Noise (scale) & 0.2 & 0.3 & 0.4 & 0.5 & 0.6 & 0.7 & 0.8 \\ \hline Standard CNN & 93.40\% & 79.08\% & 79.15\% & 58.33\% & 40.19\% & 28.15\% & 28.59\% \\ RS-CNN & 96.90\% & 85.36\% & 85.91\% & 68.33\% & 51.46\% & 37.18\% & 38.05\% \\ \hline \hline \end{tabular}
\end{table}
Table 4: Test accuracies(%) for RS-CNN and standard CNN on Noisy MNIST out-of-distribution (OOD) samples. ’Scale’ represents the standard deviation of the normal distribution from which random numbers are being generated for random noise.

Figure 2: (a) Confidence scores for RS-CNN on CIFAR10, Noisy CIFAR10, and Rotated CIFAR10 (b) Confidence scores of _Incorrectly Classified samples_ for RS-CNN and CNN. (c) Entropy distribution for RS-CNN on CIFAR10, Noisy CIFAR10, and Rotated CIFAR10.
## 6 Limitations

A limitation of our approach is the selection of different subsets during each budgetting run. These subsets may vary across different runs, but there is some consistency with non-singleton focal sets where subsets such as {'bird', 'airplane'}, {'cat', 'dog'}, {'automobile', 'truck'}, repeat over multiple runs. Fine-tuning can be employed to mitigate the need for separate feature extraction and training stages. Our approach has potential applications in the safety-critical domain that require uncertainty estimation such as medical diagnostics, autonomous driving, and other tasks involving image classification and analysis since it is particularly effective for predicting out-of-distribution samples and would perform better with imprecise data than precise.

## 7 Conclusion

This paper proposes a random-set convolutional neural network for uncertainty estimation in classification using belief functions. We compute masses and pignistic probabilities from predicted belief functions and estimate uncertainty using credal set width and entropy. Our method achieves superior test accuracy compared to state-of-the-art uncertainty estimation networks and performs comparably to traditional networks without uncertainty estimation. We provide an example illustrating how our model predicts uncertainty in rotated digits. In this paper we only discussed the target-level representation of random-set CNNs (RS-CNNs). Future work involves parameter-level representation of random-set neural networks and the extension of this concept from classification to detection tasks. Detection networks have additional heads which take care of regressing bounding box coordinates in addition to labels: the research problem then becomes one of formulating suitable localisation losses in keeping with the epistemic uncertainty principle. Moreover, applying both mass and belief random-set CNNs to imprecise data shows promise for improved performance.

Figure 4: Uncertainty estimates for RS-CNN, (a) Uncertainty (entropy) of MNIST digit ’3’ rotated between -90 and 90 degrees. The blue line indicates RS-CNN estimates low uncertainty between -30 to 30, and high uncertainty for further rotations. (b) Credal set width of each prediction, the width for incorrectly classified samples (orange) is larger when compared to correct classifications (blue) indicating high uncertainty for incorrect classifications.

Figure 3: Upper (\(P^{\pi}_{max}\)) and lower (\(P^{\pi}_{min}\)) bounds (dotted red) of the credal set consistent with belief functions predicted for 100 samples of CIFAR10. The pignistic probability estimate for each belief prediction is shown in solid red and the shaded region is the associated epistemic uncertainty.

\begin{table}
\begin{tabular}{l c c|c c c c} \hline \hline  & \multicolumn{2}{c|}{Parameters (million)} & \multicolumn{4}{c}{Test Accuracy (\%)} \\ \hline Resnet50 & \(\approx 23.608\) & B-RS Resnet50 & \(\approx 23.649\) & Resnet50 & \(84.21\) & B-RS Resnet50 & \(83.13\) \\ \hline \hline \end{tabular}
\end{table}
Table 5: Performance of Resnet50-RS-CNN model architecture on CIFAR10