Information Robust Dirichlet Networks for Predictive Uncertainty Estimation

  • 2020-02-13 18:44:49
  • Theodoros Tsiligkaridis
  • 0

Abstract

Precise estimation of uncertainty in predictions for AI systems is a criticalfactor in ensuring trust and safety. Deep neural networks trained with aconventional method are prone to over-confident predictions. In contrast toBayesian neural networks that learn approximate distributions on weights toinfer prediction confidence, we propose a novel method, Information RobustDirichlet networks, that learn an explicit Dirichlet prior distribution onpredictive distributions by minimizing the expected $L_p$ norm of theprediction error and penalizing information flow associated with incorrectoutcomes. Properties of the new cost function are derived to indicate howimproved uncertainty estimation is achieved. Experiments using real datasetsshow that our technique outperforms by a large margin state-of-the-art neuralnetworks for estimating within-distribution and out-of-distributionuncertainty, and detecting adversarial examples.

 

Quick Read (beta)

Information Robust Dirichlet Networks for Predictive Uncertainty Estimation

Theodoros Tsiligkaridis MIT Lincoln Laboratory
Lexington, MA 02421
Email: [email protected]
Abstract

Precise estimation of uncertainty in predictions for AI systems is a critical factor in ensuring trust and safety. Deep neural networks trained with a conventional method are prone to over-confident predictions. In contrast to Bayesian neural networks that learn approximate distributions on weights to infer prediction confidence, we propose a novel method, Information Robust Dirichlet networks, that learn an explicit Dirichlet prior distribution on predictive distributions by minimizing the expected Lp norm of the prediction error and penalizing information flow associated with incorrect outcomes. Properties of the new cost function are derived to indicate how improved uncertainty estimation is achieved. Experiments using real datasets show that our technique outperforms by a large margin state-of-the-art neural networks for estimating within-distribution and out-of-distribution uncertainty, and detecting adversarial examples.

DISTRIBUTION STATEMENT A. Approved for public release. Distribution is unlimited. This material is based upon work supported by the Under Secretary of Defense for Research and Engineering under Air Force Contract No. FA8702-15-D-0001. Any opinions, findings, conclusions or recommendations expressed in this material are those of the author(s) and do not necessarily reflect the views of the Under Secretary of Defense for Research and Engineering.

I Introduction

Deep learning systems have achieved state-of-the-art performance in various domains [1]. The first successful applications of deep learning include large-scale object recognition [2] and machine translation [3, 4]. While further advances have achieved strong performance and often surpass human-level ability in computer vision [5, 6, 7], speech recognition [8, 9], medicine [10], bioinformatics [11], other aspects of deep learning are less well understood. Conventional neural networks (NNs) are overconfident in their predictions [12] and provide inaccurate predictive uncertainty [13]. NNs have to be accurate, but also provide an indicator of when an error is likely to be made. Intepretability, robustness, and safety are becoming increasingly important as deep learning is deployed across various industries including healthcare, autonomous driving and cybersecurity.

Uncertainty modeling in deep learning is a crucial aspect that has been the topic of various Bayesian neural network (BNN) research studies [14, 15, 16, 17]. BNNs capture parameter uncertainty of the network by learning distributions on weights and estimate a posterior predictive distribution by approximate integration over these parameters. The non-linearities embedded in deep neural networks make the weight posterior intractable and several tractable approximations have been proposed and trained using variational inference [14, 15, 17, 16, 18], the Laplace approximation [19, 20], expectation propagation [21, 22], and Hamiltonian Monte Carlo [23]. The success of approximate BNN methods depends on how well the approximate weight distributions match their true counterparts, and their computational complexity is determined by the degree of approximation. Most BNNs take more effort to implement and are harder to train in comparison to conventional NNs. Furthermore, approximate integration over the parameter uncertainties increases the test time due to posterior sampling, and yields an approximate predictive distribution using stochastic averaging. Thus, it is of interest to develop methods that provide good uncertainty estimates while reusing the training pipeline and maintaining scalability. To this end, a simple approach was proposed that combines NN ensembles with adversarial training to improve predictive uncertainty estimates in a non-Bayesian manner [24], but is copmutationally expensive. It is also known that deterministic NNs are brittle to adversarial attacks [25, 26]. Predictive uncertainty can be used to reason about neural network predictions and detect when a network is likely to make an error, identify anomalous examples, and detect adversarial attacks.

In this paper, we propose Information Robust Dirichlet (IRD) networks that deliver more accurate predictive uncertainty than other state-of-the-art methods by learning how likely class probability assignments are. Our method modifies the output layer of neural networks and the training loss, therefore maintaining computational efficiency and ease of implementation. The contributions are as follows. First, a new training loss based on minimizing the expected Lp norm of the prediction error is proposed under which the prediction probabilities follow a Dirichlet distribution. A closed-form approximation to this loss is derived, under which a neural network is trained to infer the parameters of a Dirichlet distribution, effectively teaching neural networks to learn distributions over class probability vectors. Second, a regularization loss is used to align the Dirichlet distribution parameters to an information direction that minimizes information flow towards incorrect classes. Third, an analysis is provided that shows how properties of the new loss improve uncertainty estimation. Finally, we demonstrate on real datasets that our technique obtains unmatched success in terms of uncertainty estimation for correct and incorrect predictions, detection of out-of-distribution queries and adversarial attacks.

I-A Related Work

Recently, in [27, 28] the Dirichlet distribution was used to model distributions of class compositions and its parameters were learned by training deterministic neural networks. This approach yields closed-form predictive distributions and outperforms BNNs in uncertainty quantification for out-of-distribution and adversarial queries. However, uncertainty estimation performance for within-distribution queries was not studied and out-of-distribution and adversarial query uncertainty can be improved. The authors in [27] provide a limited analysis of their loss, and [28] lacks analysis that relates the Dirichlet concentration parameters with their loss and further proposes to use OOD data for learning what is anomalous biasing the predictive uncertainty of the models.

In contrast, we provide a more thorough analysis of our loss function that yields insights into how neural networks shape Dirichlet distributions on the simplex. Furthermore, our method assigns higher uncertainties to errors while maintaining high confidence for correct predictions, and improves upon uncertainty quantification for OOD and adversarial data.

II Learning Distributions on the Probability Simplex

II-A Probabilistic Framework

Given dataset 𝒟={(𝐱i,𝐲i)}, we model the class probability vectors for sample i given by 𝐩i as random vectors drawn from a Dirichlet distribution conditioned on the input 𝐱i and weights 𝜽. A neural network with input 𝐱i and output 𝜶i is trained to learn multinomial opinions using the Dirichlet distribution f(𝐩i|𝐱i;𝜽)=f(𝐩i;𝜶i) (see (1)). This model can also be interpreted as an explicit prior over class probability distributions [28].

The predictive uncertainty of a classification model trained over this dataset can be expressed as:

P(y=j|𝐱*,𝒟)=P(y=j|𝐱*,𝜽)p(𝜽|𝒟)d𝜽
=P(y=j|𝐩)f(𝐩|𝐱*,𝜽)d𝐩p(𝜽|𝒟)d𝜽
=P(y=j|𝐩)f(𝐩|𝐱*,𝒟)d𝐩

The terms above represent data uncertainty, P(y=j|𝐩), distribution uncertainty, f(𝐩|𝐱*,𝜽), and model uncertainty, p(𝜽|𝒟). The Bayesian hierarchy implies that model uncertainty affects distributional uncertainty, which as a result influence the data uncertainty estimates. In our framework, the additional level of distributional uncertainty is incorporated to control the information spread over the simplex by learning f(𝐩|𝐱*,𝜽) in a robust manner during the training procedure. This in turn regularizes the density f(𝐩|𝐱*,𝒟) to produce improved predictive uncertainty estimates.

Since the posterior p(𝜽|𝒟) is intractable, approximate variational inference methods may be used in similar spirit to [14, 16] to estimate it. In addition, ensemble approaches are computationally expensive. For clarity in this paper, we assume a point-estimate of the weight parameters is sufficient given a large training set and proper regularization control, which yields f(𝐩|𝐱*,𝒟)f(𝐩|𝐱*,𝜽¯). This simplifying approximation was also made in recent works [27, 28].

Conventional NNs for classification trained with a cross-entropy loss with a softmax output layer provide a point estimate of the predictive class probabilities of each example and do not have a handle on the underlying uncertainty. Cross-entropy training can be probabilistically interpreted as maximum likelihood estimation, which cannot infer predictive distribution variance. The softmax layer also tends to inflate the predicted class likelihood due to the exponentiation involved and this tyep of training tends to produce overconfident wrong predictions.

II-B Dirichlet Distribution

Outputs of neural networks for classification tasks are probability vectors over classes. The basis of our approach lies in an explicit model of distributional uncertainty that controls the distribution of such probability vectors using the Dirichlet distribution [29, 30]. Given the probability simplex as 𝒮={(p1,,pK):pi0,ipi=1}, the Dirichlet distribution is a probability density function on vectors 𝐩𝒮 given by

f(𝐩;𝜶)=1B(𝜶)j=1Kpjαj-1 (1)

where B(𝜶)=j=1KΓ(αj)/Γ(α0) is the multivariate Beta function. It is characterized by concentration parameters 𝜶=(α1,,αK) here assumed to be larger than unity 11 1 The reason for this constraint is that the Dirichlet distribution becomes inverted for αj<1 concentrating in the corners of the simplex and along its boundaries.. The concentration parameter may be interpreted as how likely a class is relative to others. In the special case of the all-ones 𝜶 vector, the distribution becomes uniform over the probability simplex (see Fig. 1(d)). The mean of the proportions is given by p^j=αj/α0, where α0=jαj is the Dirichlet strength.

The Dirichlet distribution is conjugate to the multinomial distribution with posterior parameters updated as αj=αj+yj for a multinomial sample 𝐲=(y1,,yK). For a single sample, yj=I{j=c}, where c is the index of the correct class. Marginals of the Dirichlet distribution are Beta random variables, pjBeta(αj,α0-αj) with support on [0,1]. The q-th moment of the Beta distribution Beta(a,b) is given by

𝔼[pq]=01pqpa-1(1-p)b-1Bu(a,b)𝑑p=Bu(a+q,b)Bu(a,b) (2)

where Bu(a,b)=Γ(a)Γ(b)/Γ(a+b) is the univariate Beta function. A Dirichlet neural network’s output layer parametrizes the simplex distribution representing the spread of class assignment probabilities. The softmax classification layer is replaced by a softplus activation layer that outputs non-negative continuous values, obtaining

𝜶=gα(𝐱*;𝜽¯)+1

that parametrize the density f(𝐩|𝐱*,𝜽¯)=f(𝐩;𝜶). The posterior distribution P(y|𝐱*,𝜽¯) is given by:

P(y=j|𝐱*;𝜽¯)=𝔼f(𝐩|𝐱*;𝜽¯)[P(y=j|𝐩)]=αjα0

The concentration parameters determine the shape of the Dirichlet distribution on the probability simplex, as is visualized in Fig. 1 for K=3. Fig. 1(a) shows a confident prediction characterized by low entropy, (b) shows a more challenging prediction that has higher uncertainty, (c) shows a prediction characterized by high data uncertainty due to class overlap, and (d) shows a flat Dirichlet distribution that arises for an out-of-distribution example.

Fig. 1: Illustration of Dirichlet distribution over categorical class probability distributions.

Predictive entropy measures total uncertainty and may be decomposed into epistemic (or knowledge) uncertainty (arises due to model’s difficulty in understanding inputs) and aleatoric (or data) uncertainty (arises due to class-overlap and noise) [28], given by:

H(P(y|𝐱*,𝜽¯))=H(𝔼f(𝐩|𝐱*;𝜽¯)[P(y|𝐩)])=-jαjα0logαjα0

The mutual information between the labels y and the class probability vector p, I(y,𝐩|𝐱*;𝜽¯), captures epistemic uncertainty, and can be calculated by subtracting the expected data uncertainty from the total uncertainty:

I (y,𝐩|𝐱*;𝜽¯)=H(𝔼f(𝐩|𝐱*;𝜽¯)[P(y|𝐩)])-𝔼f(𝐩|𝐱*,𝜽¯)[H(P(y|𝐩))]
=-jαjα0(logαjα0-ψ(αj+1)+ψ(α0+1))

This metric explicitly captures the spread due to distributional uncertainty and is particularly useful for detection of out-of-distribution and adversarial examples. A variation of it was used in the context of active learning [31].

II-C Classification Loss

Available are one-hot encoded labels 𝐲i of examples 𝐱i with correct class ci. Treating the Dirichlet distribution f𝜶i(𝐩i) as a prior on the multinomial likelihood function kpikyik, one can minimize the negated log-marginal likelihood:

-log(𝔼[kpikyik])=-(log(αi,ci)-log(jαij))

or the Bayes risk of the cross-entropy loss:

𝔼 [-kyiklogpik]=-kyik𝒮logpikf(𝐩i;𝜶i)𝑑𝐩i
=-(ψ(αi,ci)-ψ(jαij))

where ψ() is the digamma function. It was observed in [27] that these loss functions generate excessively high belief masses for classes hurting quantification of uncertainty and are less stable than minimizing the sum of squares of prediction errors instead. This can be attributed to the nature of these loss functions encouraging the maximization of correct class likelihoods.

Unlike conventional cross-entropy training that only seeks to maximize the correct class likelihood, we propose a distance-based objective that minimizes the expected prediction error capturing errors across all classes simultaneously by learning the appropriate Dirichlet concentration parameters that govern the spread of class probability vectors. We propose to minimize the Bayes risk of the prediction error in Lp space for p1, which is approximated using Jensen’s inequality as

𝔼 𝐲i-𝐩ip(𝔼[𝐲i-𝐩ipp])1/p
=(𝔼[(1-pi,ci)p]+jci𝔼[pijp])1/p=:i(w)

This loss can interpolate between L1 to L norms, and as p grows large we minimize an approximation to the maximum prediction error, e.g., 𝔼[maxk|yik-pik|], which is difficult to directly optimize. Jensen’s inequality yields a tractable upper bound for all values of p, and the Lp loss encompasses higher-order moments of the Dirichlet experiment generated by the NN as opposed to just the bias and variance for the L2 case. In practice, p is chosen to strike a balance between the correct prediction confidence and uncertainties of errors/out-of-distribution queries.

To calculate each term in i(w), we note 1-pi,ci has a distribution Beta(αi,0-αi,ci,αi,ci) due to mirror symmetry, and pij has distribution Beta(αi,j,αi,0-αi,j). Using the moment expression (2) for Beta random variables:

i(w)=(Bu(αi,0-αi,ci+p,αi,ci)Bu(αi,0-αi,ci,αi,ci)
  +jciBu(αi,j+p,αi,0-αi,j)Bu(αi,j,αi,0-αi,j))1p
=(Γ(α0)Γ(α0+p))1p(Γ(kcαk+p)Γ(kcαk)+kcΓ(αk+p)Γ(αk))1p

The following theorem shows that the loss function i has the correct behavior as the information flow increases towards the correct class which is consistent when an image sample of that class is observed in a Bayesian Dirichlet experiment and hyperparameters are incremented (see Sec. II-B).

Theorem 1.

For a given sample xi with correct label c, the loss function Fi is strictly convex and decreases as αc increases (and increases when αc decreases).

Theorem 1 shows that our objective function encourages the learned distribution of probability vectors to concentrate towards the correct class, consistent with Dirichlet sampling experiments. While increasing information flow towards the correct class reduces the loss, it is also important for the loss to capture elements of incorrect classes. It is expected that increasing information flow towards incorrect classes increases uncertainty. The next result shows that through our loss function the model avoids assigning high concentration parameters to incorrect classes as the model cannot explain observations that are assigned incorrect outcomes.

Theorem 2.

For a given sample xi with correct label c, the loss function Fi is increasing in αj for any jc as αj grows.

Theorem 2 implies that our loss function leads the model to push the distribution of class probability vectors away from incorrect classes.

II-D Information Regularization Loss

The classification loss can discover interesting patterns in the data to achieve high classification accuracy. However, the network may learn that certain patterns lead to strong information flow towards incorrect classes, e.g., a common pattern of one correct class might contribute to a large αj associated with an incorrect class. While for accuracy this might not be an issue as long as αc is larger than the incorrect αj, it does affect its predictive uncertainty. Thus, it is of interest to minimize the contributions of concentration parameters associated with incorrect outcomes.

Given the auxiliary vector 𝜶~i=(1-𝐲i)𝜶i+𝐲i formed by nulling out the correct class concentration parameter αci, we minimize the following distance function that aligns the concentration parameter vector 𝜶~ towards unity:

i =def12(𝜶~i-𝟏)Tdiag(J(𝜶~i))(𝜶~i-𝟏)
=12jci(αij-1)2(ψ(1)(αij)-ψ(1)(α~i0)) (3)

where ψ(1)(z)=ddzψ(z) is the polygamma function of order 1, and J(𝜶~) denotes the Fisher information matrix 𝔼[logf(𝐩;𝜶~)logf(𝐩;𝜶~)T]=-𝔼[2logf(𝐩;𝜶~)]. We remark that (3) is not a quadratic function in αij due to the nonlinearity of the polygamma functions and the fact that terms are tied together through the constraint α~i0=1+jcαij. This regularization is related to a local approximation of the Rényi information divergence [32, 33] of the Dirichlet distribution f(𝐩;𝜶~) from the uniform Dirichlet f(𝐩;𝟏) given by

DuR(f(𝐩;𝜶~)f(𝐩;𝟏))u2(𝜶~-𝟏)TJ(𝜶~)(𝜶~-𝟏)
=u2[jc(αj-1)2(ψ(1)(αj)-ψ(1)(α~0))
-ψ(1)(α~0)ij,ic,jc(αi-1)(αj-1)]

in the local regime 𝜶~-𝟏22=jc(αj-1)20. This approximation follows from [34] (p. 2472) after using the second-order Taylor’s expansion and substituting the Fisher information matrix J(𝜶~)=diag({ψ(1)(α~i)}i=1K)-ψ(1)(α~0)1K×K. The next theorem shows a desirable monotonicity property of the information regularization loss (3).

Theorem 3.

The information regularization loss R(α) given in (3) is increasing in αj for jc.

The total loss to be minimized, per example, is:

𝒢i=i+λi

where λ is a nonnegative parameter controlling the tradeoff between minimizing the approximate Bayes risk and the information regularization penalty. The total loss is summed over a batch of training samples 𝒢(𝜽)=i=1N𝒢i(𝜽). Training is performed using minibatches with λ increasing using an annealing schedule, e.g., λt=λmin{t-T0T,1} for t>T0 for rate parameter (e.g. T=60) and λt=0 for tT0. The parameter T0 should be chosen large enough to allow the network to learn interesting features useful for classification and avoid incorporating the regularization effect too early which may lead to learning difficulties.

Theorem 3 combined with Theorem 2 imply that the strength of concentration parameters associated with misleading outcomes is expected to decrease during training. This preferable behavior of our objective function leads to higher uncertainties for misclassifications as the concentration parameters are all aimed to be minimized instead of allowing one to be much larger than others.

III Experimental Results

All experiments are implemented in Tensorflow [35] and the Adam [36] optimizer was used for training. As recent prior works [27, 28] have shown Dirichlet NNs outperform BNNs on several benchmark image datasets, we mainly focus on comparing our method with these Dirichlet NNs trained with different loss functions. Comparisons are made with the following methods: (a) L2 corresponds to deterministic neural network with softmax output and weight decay, (b) Dropout is the uncertainty estimation method of [16], (c) EDL is the evidential approach of [27], (d) RKLPN is the reverse KL divergence-based prior network method of [28], and (e) IRD is our proposed technique.

III-A Fashion-MNIST Dataset

The LeNet CNN architecture with 20 and 50 filters of size 5×5 is used for the Fashion-MNIST dataset [37] with 500 hidden units at the dense layer. The training set contains 60,000 digits and the testing set contains 10,000. The results were generated with λ=0.5,p=4. Table I shows the test accuracy on MNIST for these methods; IRD is shown to be competitive assigning low uncertainty to correct predictions and high uncertainty to errors. In general, a small accuracy loss is expected as the NN is trained so that data examples near the decision boundary (likely errors) lie in a high-uncertainty region that might affect predictions of nearby data; this can be mitigated by adjusting λ or p. However, our results show that accuracy loss is not significant and OOD/adversarial uncertainty quantification improves upon prior methods while maintaining low uncertainty on correct predictions.

TABLE I: Fashion-MNIST Dataset: Test accuracy (%), median % max-entropy for correct and misclassified examples for various deep learning methods.

Method Accuracy Median %Max-Entropy: Correct Median %Max-Entropy: Errors
L2 91.4 1 29
Dropout 91.4 7 40
RKLPN 92.5 21 52
EDL 91.6 25 65
IRD 90.1 9 100

To measure within-distribution uncertainty, Fig. 2 shows the distribution of entropies of predictive distributions for correct and misclassified examples across competing methods. The overconfidence of conventional L2 NNs is evident since the distribution mass of correct and wrong predictions is concentrated on lower uncertainties. The Dirichlet-based methods, EDL and RKLPN, tend to sacrifice correct class confidence for providing higher uncertainties on misclassified examples. IRD offers a drastic improvement over all methods with 63% of the misclassified samples falling within 95% of the max-entropy (log102.3), as opposed to 3% and 4% of the misclassified samples of the RKLPN and EDL methods respectively.

Fig. 2: Empirical CDF of predictive distribution entropy on Fashion-MNIST dataset.

To evaluate out-of-distribution uncertainty quantification, the trained model on Fashion-MNIST is tested with image data from different datasets. Specifically, IRD is tested on notMNIST [38] which contains only English letters, and OmniGlot [39] which contains characters from multiple alphabets, serving as out-of-distribution data. The uncertainty is expected to be high for all such images as they do not fit into any trained category. Figures 3 and 4 shows the empirical CDF of the predictive entropy and mutual information. CDF curves close to the bottom right are more desirable as higher entropy is desired for all predictions. IRD is much more tightly concentrated towards higher entropy values; for notMNIST/OmniGlot, an impressive 60%/72% of images have entropy larger than 95% of the max-entropy, while EDL and PN have 5%/10% and 9%/14% approximately.

Fig. 3: Empirical CDF of predictive distribution entropy (left) and mutual information (right) on notMNIST dataset.
Fig. 4: Empirical CDF of predictive distribution entropy (left) and mutual information (right) on OmniGlot dataset.

Adversarial uncertainty quantification on Fashion-MNIST was also evaluated. Fig. 5 shows the adversarial performance when each model is evaluated using adversarial examples generated with the Fast Gradient Sign method (FGSM) [25] for different noise values ϵ, i.e., 𝐱adv=𝐱+ϵsgn(𝐱(𝐱,y,w)). We observe that IRD achieves higher entropy on adversarial examples as ϵ increases than other methods while achieving a lower average predictive entropy for ϵ=0 due to the higher confidence of correct predictions. Interestingly, a large entropy is assigned to misclassified samples as Fig. 2 shows.

Fig. 5: Test accuracy (left), predictive entropy (middle) and mutual information (right) for FGSM adversarial examples as a function of adversarial noise ϵ on Fashion-MNIST dataset.

III-B CIFAR-10 Dataset

A VGG-based CNN architecture consisting of three filter blocks with 64,128,256 filters respectively with filter sizes 3×3 was used for the CIFAR-10 dataset [40] with 256 hidden units at the dense layer. The training/testing set is made up of 60,000/10,000 training examples. Regularization parameter λ=0.3 was adopted with p=4. Data augmentation, dropout and batch-normalization was used for all methods to mitigate overfitting. Table II shows the test accuracy on CIFAR-10 for these methods; IRD is shown to be competitive assigning low uncertainty to correct predictions and high uncertainty to errors.

TABLE II: CIFAR-10 Dataset: Test accuracy (%), median % max-entropy for correct and misclassified examples for various deep learning methods.

Method Accuracy Median %Max-Entropy: Correct Median %Max-Entropy: Errors
L2 85.2 1 36
Dropout 86.7 6 48
RKLPN 85.1 18 51
EDL 87.8 24 55
IRD 85.6 12 66

Within-distribution uncertainty quantification is evaluated in Fig. 6 which shows the distribution of entropies of predictive distributions for correct and misclassified examples across competing methods. Similar to the previous set of results, conventional L2 NNs yield overconfident predictions and EDL and RKLPN sacrifice correct class confidence for providing higher uncertainties on misclassified examples. IRD offers an improvement over all methods as the tail of the distribution of predictive entropies associated with misclassified examples is more heavily concentrated on higher values, while maintaining an improved correct prediction confidence over other Dirichlet neural networks.

Fig. 6: Empirical CDF of predictive distribution entropy on CIFAR-10 dataset.

For out-of-distribution testing, IRD is tested on Tiny-ImageNet [41] which contains a small subset of ILSVRC spanning 200 image classes, and SVHN [42] which contains street view house numbers. The uncertainty is expected to be high for all such images as they do not fit into any trained category. Figures 7 and 8 show the empirical CDF of the predictive entropy and mutual information. IRD is shown to improve upon competing methods as it concentrates more heavily towards higher entropy and mutual information values. The benefit is observed for both uncertainty metrics.

Fig. 7: Empirical CDF of predictive distribution entropy (left) and mutual information (right) on Tiny-ImageNet dataset.
Fig. 8: Empirical CDF of predictive distribution entropy (left) and mutual information (right) on SVHN dataset.

The adversarial performance for CIFAR-10 is shown in Fig. 9 under FGSM adversarial attacks as a function of noise ϵ. It is observed that IRD starts at low predictive entropy/mutual information and quickly increases its uncertainty as more adversarial noise is added in the system and the image moves farther away from the data manifold.

Fig. 9: Test accuracy (left), predictive entropy (middle) and mutual information (right) for FGSM adversarial examples as a function of adversarial noise ϵ on CIFAR-10 dataset.

IV Conclusion

In this work, we presented a new method for training Dirichlet neural networks that are aware of the uncertainty associated with predictions. Our training objective fits predictive distributions to data using a classification loss that minimizes the expected prediction error measured in Lp space, and an information regularization loss that penalizes information flow towards incorrect classes. We derived closed-form expressions for our training loss and desirable properties on how improved uncertainty estimation is achieved. Experimental results were shown on image classification tasks, highlighting improvements in predictive uncertainty estimation for within-distribution, out-of-distribution and adversarial queries made by our method over conventional neural networks with weight decay, Bayesian neural networks, and other recent Dirichlet networks trained with different loss functions.

Appendix

We make use of the following lemmas in the proofs.

Lemma 1.

Consider the digamma function ψ. Assuming x1>x2>1 and p>0, the following inequality strictly holds:

0<ψ(x1+p)-ψ(x2+p)<ψ(x1)-ψ(x2)

Furthermore, we have limxψ(x+p)-ψ(x)=0.

Proof.

Since x1>x2>1, we can write x1=s1+1 and x2=s2+1 for some s1>s2. Upon substitution of the Gauss integral representation ψ(z+1)=-γ+01(1-tz1-t)𝑑t (here γ is the Euler-Mascheroni constant), we have:

ψ(x1)-ψ(x2)=01(ts2-ts11-t)𝑑t

which is strictly positive since the integrand is positive for t(0,1). Using the integral representation again, the inequality ψ(x1+p)-ψ(x2+p)<ψ(x1)-ψ(x2) is equivalent to:

01((1-tp)(ts2-ts1)1-t)>0

which holds since the integrand is positive due to tp<1 an ts1<ts2. The limit of ψ(x+p)-ψ(x) follows from the asymptotic expansion ψ(x)=log(x)-12x+O(1x2), which yields ψ(x+p)-ψ(x)log(1+p/x)-12(x+p)+12x0 as x. This concludes the proof. ∎

Lemma 2.

Consider the polygamma function of order 1 ψ(1)(z)=ddzψ(z). Assuming x1>x2>1 and p>0, the following inequality strictly holds:

ψ(1)(x1)-ψ(1)(x2)<ψ(1)(x1+p)-ψ(1)(x2+p)<0
Proof.

Proceeding similarly as in the Proof of Lemma 1, we write x1=s1+1 and x2=s2+1 for some s1>s2. Upon substitution of the integral representation ψ(1)(z+1)=01(tz1-tln(1t))𝑑t, we have:

ψ(1)(x1)-ψ(1)(x2)=01(ts1-ts21-tln(1t))𝑑t

which is strictly negative since the integrand is negative for t(0,1). Using the integral representation again, the inequality ψ(1)(x1)-ψ(1)(x2)<ψ(1)(x1+p)-ψ(1)(x2+p) is equivalent to:

01((1-tp)(ts1-ts2)1-tln(1t))<0

which holds true since ln(1/t)>0 for t(0,1). This concludes the proof. ∎

Proof of Theorem 1

Proof.

Taking the logarithm of i, we have:

logi =1plog(Γ(α0)Γ(α0+p))
+1plog(Γ(kcαk+p)Γ(kcαk)+jcΓ(αj+p)Γ(αj))

where the second term is independent of αc. Letting the first term be denoted as g(αc):=1plog(Γ(α0)Γ(α0+p)), it suffices to show f(αc):=exp(g(αc)) is strictly convex and decreasing in αc.

Differentiating g(αc) twice we obtain:

g(αc) =1p(ψ(α0)-ψ(α0+p))
g′′(αc) =1p(ψ(1)(α0)-ψ(1)(α0+p))

Lemmas 1 and 2 then yield that g(αc)<0 and g′′(αc)>0 respectively. Differentiating f(αc) twice, we have:

f(αc) =eg(αc)g(αc)
f′′(αc) =eg(αc)(g′′(αc)+(g(αc))2)

Using the inequalities above and the positivity of eg(αc), it follows that f(αc)<0 and f′′(αc)>0. Thus, f(αc) is a strictly convex decreasing function in αc. This concludes the proof. ∎

Proof of Theorem 2

Proof.

Consider a concentration parameter αj corresponding to an incorrect class, i.e., jc. Define the ratio of Gamma functions as:

μ(α)=defΓ(α+p)Γ(α)

This function is positive, increasing and convex with derivative given by:

μ(α) =-Γ(α+p)Γ(α)Γ(α)2+Γ(α+p)Γ(α)
=-Γ(α+p)ψ(α)Γ(α)+Γ(α+p)ψ(α+p)Γ(α)
=μ(α)(ψ(α+p)-ψ(α))
=μ(α)ν(α) (4)

where we used the relation Γ(z)=Γ(z)ψ(z) and defined

ν(α)=defψ(α+p)-ψ(α).

From Lemma 1, it follows that ν(α)>0 which implies μ(α) is increasing.

Since ()1/p is a continuous increasing function, it suffices to show the objective 𝒢=ip is increasing, given by 𝒢(αj)=(μ(lcαl)+lcμ(αl))/μ(α0). The derivative is then calculated as:

𝒢(αj) =μ(lcαl)+μ(αj)μ(α0)
-μ(α0)[μ(lcαl)+lcμ(αl)]μ(α0)

The condition 𝒢(αj)>0 is equivalent to:

μ(lcαl)+μ(αj)μ(α0)>μ(lcαl)+lcμ(αl)μ(α0)=𝒢

Upon substituting the expression (4), this condition becomes:

μ(lcαl)ν(lcαl)+μ(αj)ν(αj)
>[μ(lcαl)+lcμ(αl)]ν(α0) (5)

From Lemma 1, it follows that ν(lcαl)>ν(α0) and ν(αj)>ν(α0). In addition, the functions μ(lcαl)ν(lcαl) and μ(αj)ν(αj) are both increasing as αj grows. Using these results and the fact that [lc,jμ(αl)]ν(α0)0 as αj grows (due to Lemma 1), it follows that the inequality (5) holds true for large αj. Thus, we conclude that the loss function is increasing as αj gets large. The proof is complete. ∎

An illustration of Theorem 2 is shown in Fig. 10 below. An approximate loss function is also shown due to limαΓ(α+p)Γ(α)αp=1, from which we obtain the approximation μ(α)αp. This approximation to the loss behaves similarly. Despite the initial dip, the loss is increasing as αj increases. We remark that the loss is neither convex nor concave in αj.

Fig. 10: Illustrative example for Theorem 2. Here, the loss function i is plotted as a function of αj, jc. Parameters p=2 and a random 𝜶 vector were used for K=10 classes with αc small relative to other concentration parameters. As Theorem 2 shows, the loss is increasing for large αj.

Proof of Theorem 3

Proof.

Consider (αk) as a function of αk for some kc. Then, it may be decomposed as (αk)=k(αk)+k(αk) where

k(αk) =12(αk-1)2(ψ(1)(αk)-ψ(1)(α~0))
k(αk) =12jc,jk(αj-1)2(ψ(1)(αj)-ψ(1)(α~0))

The first term is an increasing function since q(α)=(α-1)2(ψ(1)(α)-ψ(1)(α+z)) is increasing for any z>1. The second term is also increasing since

k(αk)αk =-ψ(2)(α~0)2jc,jk(αj-1)20

which follows from the integral representation ψ(2)(x)=-0t2e-tx1-e-t𝑑t0. ∎

References

  • [1] Y. LeCun, Y. Bengio, and G. Hinton, “Deep Learning,” Nature, vol. 521, no. 7533, pp. 436–444, 2015.
  • [2] A. Krizhevsky, I. Sutskever, and G. E. Hinton, “ImageNet classification with deep convolutional neural networks,” in Advances in Neural Information Processing Systems (NIPS), 2012.
  • [3] I. Sutskever, O. Vinyals, and Q. V. Le, “Sequence to sequence learning with neural networks,” in Advances in Neural Information Processing Systems, 2014.
  • [4] Y. Wu et al., “Google‘s neural machine translation system: Bridging the gap between human and machine translation,” Tech. Rep., 2016, arXiv:1609.08144.
  • [5] R. Geirhos, C. R. M. Temme, J. Rauber, M. Bethge, and F. A. Wichmann, “Generalization in humans and deep neural networks,” in Advances in Neural Information Processing Systems, 2018.
  • [6] K. He, X. Zhang, S. Ren, and J. Sun, “Delving Deep into Rectifiers: Surpassing Human-level Performance on ImageNet classification,” in IEEE International Conference on Computer Vision (ICCV), December 2015.
  • [7] D. C. Ciresan, U. Meier, J. Masci, and J. Schmidhuber, “Multi-column deep neural network for traffic sign classification,” Neural Networks, vol. 32, pp. 333–338, 2012.
  • [8] W. Xiong, J. Droppo, X. Huang, F. Seide, M. L. Seltzer, A. Stolcke, D. Yu, and G. Zweig, “Toward Human Parity in Conversational Speech Recognition,” IEEE Transactions on Audio, Speech, and Language Processing, vol. 25, no. 12, pp. 2410–2423, December 2017.
  • [9] G. Hinton, L. Deng et al., “Deep neural networks for acoustic modeling in speech recognition: The shared views of four research groups,” IEEE Signal Processing Magazine, vol. 29, no. 6, pp. 82–97, 2012.
  • [10] D. Wang, A. Khosla, R. Gargeya, H. Irshad, and A. H. Beck, “Deep Learning for Identifying Metastatic Breast Cancer,” Tech. Rep., June 2016, arXiv:1606.05718.
  • [11] B. Alipanahi, A. Delong, M. T. Weirauch, and B. J. Frey, “Predicting the sequence specificities of DNA-and RNA-binding proteins by deep learning,” Nature biotechnology, vol. 33, no. 8, pp. 831–838, 2015.
  • [12] C. Guo, G. Pleiss, Y. Sun, and K. Q. Weinberger, “On Calibration of Modern Neural Networks,” in International Conference on Machine Learning, 2017.
  • [13] C. Louizos and M. Welling, “Multiplicative Normalizing Flows for Variational Bayesian Neural Networks,” in International Conference on Machine Learning (ICML), 2017.
  • [14] C. Blundell, J. Cornebise, K. Kavukcuoglu, and D. Wierstra, “Weight Uncertainty in Neural Networks,” in International Conference on Machine Learning (ICML), 2015.
  • [15] D. P. Kingma, T. Salimans, and M. Welling, “Variational dropout and the local reparameterization trick,” in Advances in Neural Information Processing (NIPS), 2015.
  • [16] Y. Gal and Z. Ghahramani, “Dropout as a Bayesian Approximation: Representing Model Uncertainty in Deep Learning,” in International Conference on Machine Learning (ICML), 2016.
  • [17] D. Molchanov, A. Ashukha, and D. Vetrov, “Variational dropout sparsifies deep neural networks,” in International Conference on Machine Learning (ICML), 2017.
  • [18] Y. Li and Y. Gal, “Dropout inference in Bayesian neural networks with alpha-divergences,” in International Conference on Machine Learning, 2017.
  • [19] D. J. MacKay, “A practical Bayesian framework for backpropagation networks,” Neural Computation, vol. 4, no. 3, pp. 448–472, 1992.
  • [20] H. Ritter, A. Botev, and D. Barber, “A Scalable Laplace Approximation for Neural Networks,” in International Conference on Learning Representations, 2018.
  • [21] J. M. Hernandez-Lobato and R. P. Adams, “Probabilistic backpropagation for scalable learning of bayesian neural networks,” in International Conference on Machine Learning, 2015.
  • [22] S. Sun, C. Chen, and L. Carin, “Learning Structured Weight Uncertainty in Bayesian Neural Networks,” in International Conference on Artificial Intelligence and Statistics (AISTATS), 2017.
  • [23] T. Chen, E. Fox, and C. Guestrin, “Stochastic Gradient Hamiltonian Monte Carlo,” in International Conference on Machine Learning, 2014.
  • [24] B. Lakshminarayanan, A. Pritzel, and C. Blundell, “Simple and Scalable Predictive Uncertainty Estimation using Deep Ensembles,” in Advances in Neural Information Processing Systems, 2017.
  • [25] I. J. Goodfellow, J. Shlens, and C. Szegedy, “Explaining and Harnessing Adversarial Examples,” in International Conference for Learning Representations, 2014.
  • [26] A. Kurakin, I. J. Goodfellow, and S. Bengio, “Adversarial Machine Learning at Scale,” in International Conference for Learning Representations, 2017.
  • [27] M. Sensoy, L. Kaplan, and M. Kandemir, “Evidential Deep Learning to Quantify Classification Uncertainty,” in Advances in Neural Information Processing Systems (NIPS) 31, 2018.
  • [28] A. Malinin and M. Gales, “Reverse KL-Divergence Training of Prior Networks: Improved Uncertainty and Adversarial Robustness,” Tech. Rep., 2019, arXiv:1905.13472.
  • [29] J. G. Mauldon, “A generalization of the Beta-distributions,” Annals of Mathematical Statistics, vol. 30, pp. 502–520, 1959.
  • [30] J. E. Mosimann, “On the compound multinomial distribution, the multivariate beta-distribution, and correlations among proportions,” Biometrika, vol. 49, pp. 65–82, 1962.
  • [31] N. Houlsby, F. Huszar, Z. Ghahramani, and M. Lengyel, “Bayesian Active Learning for Classification and Preference Learning,” Tech. Rep., 2011, arXiv:1112.5745.
  • [32] A. Rényi, “On measures of entropy and information,” in Fourth Berkeley Symposium on Mathematical Statistics and Probability, Volume 1: Contributions to the Theory of Statistics, 1961, pp. 547–561.
  • [33] T. V. Erven and P. Harremos, “Rényi divergence and Kullback-Leibler divergence,” IEEE Transactions on Information Theory, vol. 60, no. 7, pp. 3797–3820, 2014.
  • [34] D. Haussler and M. Opper, “Mutual Information, Metric Entropy and Cumulative Relative Entropy Risk,” The Annals of Statistics, vol. 25, no. 6, pp. 2451–2492, 1997.
  • [35] M. Abadi, P. Barham, J. Chen, Z. Chen, A. Davis, J. Dean, M. Devin, S. Ghemawat, G. Irving, M. Isard, M. Kudlur, J. Levenberg, R. Monga, S. Moore, D. G. Murray, B. Steiner, P. Tucker, V. Vasudevan, P. Warden, M. Wicke, Y. Yu, and X. Zheng, “Tensorflow: A system for large-scale machine learning,” in Proceedings of the 12th USENIX Conference on Operating Systems Design and Implementation, ser. OSDI’16.   Berkeley, CA, USA: USENIX Association, 2016, pp. 265–283. [Online]. Available: http://dl.acm.org/citation.cfm?id=3026877.3026899
  • [36] D. P. Kingma and J. Ba, “Adam: A Method for Stochastic Optimization,” in International Conference for Learning Representations, 2015.
  • [37] H. Xiao, K. Rasul, and R. Vollgraf. (2017) Fashion-mnist: a novel image dataset for benchmarking machine learning algorithms.
  • [38] Y. Bulatov. (2011) notMNIST dataset. [Online]. Available: http://yaroslavvb.com/upload/notMNIST/
  • [39] B. Lake, R. Salakhutdinov, and J. B. Tenenbaum. (2015) OmniGlot dataset. [Online]. Available: https://github.com/brendenlake/omniglot
  • [40] A. Krizhevsky. The CIFAR-10 Dataset. [Online]. Available: https://www.cs.toronto.edu/~kriz/cifar.html
  • [41] F.-F. Li, J. Johnson, and S. Yeung. (2017) Tiny ImageNet. [Online]. Available: http://cs231n.stanford.edu/tiny-imagenet-200.zip
  • [42] Y. Netzer, T. Wang, A. Coates, A. Bissacco, B. Wu, and A. Y. Ng. (2011) Reading Digits in Natural Images with Unsupervised Feature Learning. [Online]. Available: http://ufldl.stanford.edu/housenumbers/