On the Practicality of Deterministic Epistemic Uncertainty

1 INTRODUCTION . Despite the dramatic enhancement of predictive performance of deep learning ( DL ) , its adoption remains limited due to unpredictable failure on out-of-distribution ( OOD ) samples ( 1 ; 2 ) and adversarial attacks ( 3 ) . Uncertainty estimation techniques aim at bridging this gap by providing accurate confidence levels on a model ’ s output , allowing for a safe deployment of neural networks ( NNs ) in safety-critical tasks , e.g . autonomous driving or medical applications . While Bayesian Neural Networks ( BNNs ) represent the predominant holistic solution for quantifying uncertainty ( 4 ; 5 ) , exactly modelling their full posterior is often intractable , and scalable versions usually require expensive variational approximations ( 6 ; 7 ; 8 ; 9 ; 10 ) . Moreover , it has recently been shown that true Bayes posterior can also lead to poor uncertainty ( 11 ) . Thus , efficient approaches to uncertainty estimation largely remain an open problem , limiting the adoption within real-time applications under strict memory , time and safety requirements . Recently , a promising line of work emerged estimating epistemic uncertainty in deterministic NNs with a single forward pass . By regularizing the hidden representations of a model , these methods represent an efficient and scalable solution to epistemic uncertainty estimation and to the related OOD detection problem . Compared to traditional uncertainty estimation techniques , Deterministic Uncertainty Methods ( DUMs ) quantify epistemic uncertainty by measuring distances ( 12 ; 13 ) or estimating the distribution of latent representations ( 14 ; 15 ; 16 ; 17 ; 18 ; 19 ; 20 ; 21 ) . While OOD detection is a prerequisite for a safe deployment of DL in previously unseen scenarios , the calibration - i.e . how well uncertainty correlates with model performance - of such methods under continuous distributional shifts is equally important . Measuring the calibration of an epistemic uncertainty estimate on shifted data investigates whether it entails information about the predictive performance of the model . This an essential requirement for uncertainty and , unlike OOD detection , and evaluation that is not model-agnostic - i.e . one can not perform well without taking the predictive model into account . Nonetheless , previous work falls short of investigating calibration , and solely focuses on OOD detection ( 12 ; 13 ; 16 ; 18 ; 19 ) . Further , DUMs have thus far only been evaluated on toy datasets for binary classification , small-scale image classification tasks ( 13 ; 19 ) and toy prediction problems in natural language processing ( 15 ) . Despite claiming to solve practical issues of traditional uncertainty estimation approaches , the practicality of DUMs remains to be assessed on more challenging tasks . This work investigates the most crucial questions on the safety of DUMs in practical applications and addresses their shortcomings . In particular : ( i ) we provide the first analysis of the calibration of DUMs under continuous distributional shifts ; ( ii ) we evaluate the sensitivity of DUMs to their regularization strength ; ( iii ) we scale DUMs to dense prediction tasks , e.g . semantic segmentation , and evaluate them under synthetic and realistic continuous distributional shift ; ( iv ) we find that the practicality of many DUMs is undermined by their poor calibration under both synthetic and realistic distributional shifts . 2 RELATED WORK . Sources of Uncertainty . Uncertainty in a model ’ s predictions can arise from two different sources ( 22 ; 23 ) . While aleatoric uncertainty encompasses the noise inherent in the data and is consequently irreducible ( 22 ) , epistemic uncertainty quantifies the uncertainty associated with choosing the model parameters based on limited information , and vanishes - in principle - in the limit of infinite data . This work distinguishes two properties of epistemic uncertainty - its performance on detecting OOD samples and its calibration ( i.e . its correlation with model performance under distributional shifts ) . While the latter has been explored in the case of probabilistic approaches to uncertainty estimation ( 24 ) we are the first to investigate the behaviour of DUMs in this scenario . Notably , ( 25 ) evaluates prominent scalable epistemic uncertainty estimates on semantic segmentation . However , they investigate calibration only on in-distribution data . Further , although ( 15 ) evaluates the calibration of their approach , they do so exclusively on in-distribution data . BNNs ( 26 ; 5 ) represent a principled way of measuring uncertainty . However , their intractable posterior distribution requires approximate inference methods , such as Markov Chain Monte-Carlo ( 26 ) or Variational Inference ( VI ) ( 4 ) . While these methods traditionally struggle with large datasets and architectures , a variety of scalable approaches - often based on VI - have recently emerged . Deep Ensembles , which typically consist of identical models trained from different initializations , have been introduced to the deep learning community by Lakshminarayanan et al . ( 27 ) and extended by ( 28 ; 29 ) . While deep ensembles are widely regarded as a strong baseline for estimating epistemic uncertainty , they come with high computational as well as memory costs . Efficient Approaches . Recently , approaches based on stochastic regularization have been developed ( 6 ; 7 ; 8 ; 30 ; 31 ) . By keeping stochasticity at inference time , they estimate uncertainty using multiple forward passes . Another line of work estimates the posterior using the Laplaceapproximation ( 32 ; 33 ; 34 ) Moreover , efficient ensemble methods were proposed producing predictions using a single model ( 35 ; 29 ; 28 ; 36 ; 37 ) . Despite promising results on large-scale tasks while being parameter-efficient , these methods still require sampling through the model , which can render them impractical given limited compute . To estimate uncertainty in real-time and resource-demanding tasks , recent work has focused on providing uncertainty estimates with a single forward pass . One line of work proposes a principled approach for variance propagation in NNs ( 9 ; 38 ; 10 ) . Notably , another line of work proposes efficient approaches to estimate aleatoric uncertainty ( 39 ; 40 ; 41 ) . Recently , DUMs showed promising results on OOD detection . By leveraging distances and densities in the feature space of a NN , these methods provide confidence estimates while adding negligible computational cost . Since they are united in their deterministic treatment of the weights , we term them Deterministic Uncertainty Methods ( DUMs ) . The next section provides a taxonomy of DUMs . 3 TAXONOMY FOR DETERMINISTIC UNCERTAINTY QUANTIFICATION . This section categorizes existing DUMs . To quantify epistemic uncertainty deterministically , the distribution of the hidden representations of a NN needs to be sensitive to the input distribution . However , discriminative models suffer from the fundamental problem of feature collapse ( 13 ; 19 ) . Thus , we firstly categorize DUMs according to the regularization method used to counteract feature collapse ( Sec . 3.1 ) . Moreover , we cluster DUMs according to the method used for uncertainty estimation ( Sec . 3.2 ) . Tab . 1 shows an overview of the resulting taxonomy . Feature Collapse . Discriminative models can learn to discard large part of their input information , as exploiting spurious correlations may lead to better performance on the training data distribution ( 46 ; 47 ) . Such invariant representations learned may be blind to distributional shifts , resulting in a collapse of OOD embeddings to in-distribution features This problem is known as feature collapse ( 13 ) , and it makes OOD detection based on high-level representations impossible . 3.1 REGULARIZATION OF HIDDEN REPRESENTATIONS . We group DUMs according to how feature collapse is tackled . We identify two main paradigms - distance awareness and informative representations - which we discuss in Sec . 3.1.1 and Sec . 3.1.2 . 3.1.1 DISTANCE AWARENESS . Essentially , distance-aware hidden representations avoid feature collapse by relating distances between latent representations to distances in the input space . Therefore , one constrains the bi-Lipschitz constant , as it enforces a lower and an upper bound to expansion and contraction performed by a model . A lower bound enforces that different inputs are mapped to distinct representations and , thus , provides a solution to feature collapse . The upper bound enforces smoothness , i.e . small changes in the input do not result in large changes in the latent space . While there exist other approaches , e.g . ( 48 ) , recent proposals have primarily adopted two methods to impose the bi-Lipschitz constraint . The two-sided Gradient Penalty relates changes in the input to changes in feature space by directly constraining the gradient of the input ( 13 ) . Spectral Normalization ( SN ) ( 49 ) is a less computationally-demanding alternative . SN is applicable to residual layers and normalizes the weights W of each layer using their spectral norm sn ( W ) to constrain the bi-Lipschitz constant . Various DUMs - SNGP ( 15 ) , DUE ( 18 ) and DDU ( 19 ) - rely on SN to enforce distance-awareness of hidden representations . More details on gradient penalty and SN can be found in the supplement . Note that the Lipschitz constraint is defined with respect to a fix distance measure , which can be difficult to choose for many high-dimensional data distributions . A popular choice , e.g . ( 13 ; 15 ; 18 ) , is the L2 distance . Moreover , principled approaches to provide exact singular values in convolutional layers ( 50 ) result in prohibitive computational complexity ; the spectral normalization approximations typically adopted by the methods previously described have been found to be sub-optimal ( 51 ) , and its interaction with losses , architecture and optimization is yet to be fully understood ( 52 ) . 3.1.2 INFORMATIVE REPRESENTATIONS . While distance-awareness achieves remarkable performance on OOD detection , it does not explicitly preserve sample-specific information . Thus , depending on the underlying distance metric it may discard useful information about the input or act overly sensitive . An alternative line of work avoids feature collapse by learning informative representations ( 14 ; 16 ; 20 ; 44 ; 43 ; 45 ) , thus forcing discriminative models to preserve information in its hidden representations beyond what is required to solve a task independent of the choice of an underlying distance metric . Notably , while representations that are aware of distances in the input space are also informative , both categories remain fundamentally different in their approach to feature collapse . While distance-awareness is based on the choice of a specific distance metric tying together input and latent space , informative representations incentivize a NN to store more information about the input using an auxiliary task ( 20 ; 16 ) or forbid information loss by construction ( 43 ; 44 ; 45 ) . We identify three distinct families of approaches . Contrastive learning ( 53 ) has emerged as an approach for learning representations that are both informative and discriminative . This is utilized by Wu et al . ( 16 ) and Winkens et al . ( 42 ) , who apply SimCLR ( 54 ) to regularize hidden representations for a discriminative task by using a contrastive loss for pretraining and fine-tuning to force representations to discriminate between individual instances . Reconstruction regularization ( 20 ) instead forces the intermediate activations to fully represent the input . This is achieved by adding a decoder branch fed with the activations of a given layer to reconstruct the input . We term it MIR ( Maximally Informative Representations ) . Entropy regularization . PostNet ( 17 ) learns the class-conditional distribution of hidden representations end-to-end using a Normalizing Flow ( NF ) parameterizing a Dirichlet distribution . This allows them to enforce informative representations by implicitly encouraging large entropy of the NF during training . We refer to the supplement for details . Invertible Neural Networkss ( INNs ) ( 55 ; 43 ; 44 ; 45 ) , built via a cascade of homeomorphic layers , can not discard information except at the final classification stage . Consequently , the mutual information between input and hidden representation is maximized by construction . Interestingly , Behrmann et al . ( 56 ) showed that a ResNet is invertible if its Lipschitz constant is lower than 1 , meaning that invertible ResNets both possess highly-informative representations and satisfy distance-awareness . However , note that this is not a necessary condition for invertibility , and thus information preservation .

Summary: This paper mainly summarizes and evaluates the existing methods for estimating epistemic uncertainty through a single pass of the neural networks. The authors categorize deterministic uncertainty methods (DUMs) based on how latent representation is learned under regularization and how uncertainty is quantified. For evaluating DUMs, they provide some analyses on the uncertainty calibration performance under different-level distribution shifts for image classification and semantic segmentation. Specifically, they demonstrate that DUMs cannot generate well-calibrated uncertainty under distribution shifts compared to the MC-dropout and Ensemble methods.