# An Improved Normed-Deformable Convolution
for Crowd Counting

Xin Zhong, Zhaoyi Yan, Jing Qin, Wangmeng Zuo and Weigang Lu Xin Zhong is with
the Department of Educational Technology, Ocean University of China, Qingdao,
266000, China. (zhongxin@stu.ouc.edu.cn). Zhaoyi Yan is with the School of
Computer Science and Technology, Harbin Institute of Technology, Harbin,
150001, China. (yanzhaoyi@outlook.com). Jing Qin is with the Department of
Educational Technology, Ocean University of China, Qingdao, 266000, China.
(qinjing@stu.ouc.edu.cn). Wangmeng Zuo is with the School of Computer Science
and Technology, Harbin Institute of Technology, Harbin, 150001, China.
(cswmzuo@hit.edu.cn). Weigang Lu is with the Department of Educational
Technology, Ocean University of China, Qingdao, 266000, China.
(luweigang@ouc.edu.cn). *Correspondence should be addressed to Weigang Lu;
<EMAIL_ADDRESS>
###### Abstract

In recent years, crowd counting has become an important issue in computer
vision. In most methods, the density maps are generated by convolving with a
Gaussian kernel from the ground-truth dot maps which are marked around the
center of human heads. Due to the fixed geometric structures in CNNs and
indistinct head-scale information, the head features are obtained
incompletely. Deformable convolution is proposed to exploit the scale-adaptive
capabilities for CNN features in the heads. By learning the coordinate offsets
of the sampling points, it is tractable to improve the ability to adjust the
receptive field. However, the heads are not uniformly covered by the sampling
points in the deformable convolution, resulting in loss of head information.
To handle the non-uniformed sampling, an improved Normed-Deformable
Convolution (i.e.,NDConv) implemented by Normed-Deformable loss (i.e.,NDloss)
is proposed in this paper. The offsets of the sampling points which are
constrained by NDloss tend to be more even. Then, the features in the heads
are obtained more completely, leading to better performance. Especially, the
proposed NDConv is a light-weight module which shares similar computation
burden with Deformable Convolution. In the extensive experiments, our method
outperforms state-of-the-art methods on ShanghaiTech A, ShanghaiTech B,
UCF_QNRF, and UCF_CC_50 dataset, achieving 61.4, 7.8, 91.2, and 167.2 MAE,
respectively. The code is available at
https://github.com/bingshuangzhuzi/NDConv.

###### Index Terms:

crowd counting, Normed-Deformable Convolution, constrained offsets, uniform
sampling

##  I Introduction

Due to the expansion of worldwide population and the acceleration of
urbanization, the probability of crowd massing has increased in recent years.
In some scenarios, stampedes and large-scale events pose a hazard to public
safety that should be prevented all the time. In order to keep the public
safety, crowd counting gains considerable attention in the field of computer
vision. Furthermore, the foundation of hardware for crowd counting is provided
by the advancement of remote-distance intellectualized cameras [5, 6, 7],[38,
39, 40, 41]. Therefore, there are many researches based on crowd counting[1,
2, 3] which estimate the amount of crowd in campuses, shopping malls, and
train stations accurately.

Currently, the previous crowd counting algorithms can be classified into three
categories: tracking-based

Figure 1: Visualization of the offsets and density maps predicted from models
trained with DConv. (a) is one of the input images in ShanghaiTech B dataset,
(b) is the ground_truth, the offsets are visualized in (c), and the estimated
density map is shown in (d). Due to the sampling points are uniformed in (c),
(d) shows less regular Gaussian blobs.

methods[8, 9], feature-based regression methods[10, 11], and CNN-based
methods[12, 13, 14]. By comparison, CNN-based methods show their superiority
in higher accuracy, efficiency, and robustness. Although great progress has
been made in prior works of crowd counting implemented by convolutional neural
networks (CNNs), the inability of CNNs adapting to alterations of head-
scale[35, 36, 37] is still a barrier, restricting the enhancement of counting
accuracy. The methods[15, 16] based on multi-scale feature fusion attempt to
address above-mentioned problems. However, there are also some obstacles.
Firstly, due to the limitation that parameters of network and computational
time balloon along with the increase of the scales of features, the training
time is unbearable. In addition, only a few works pay attention on the
mechanisms to handle geometric transformations.

To address the above-mentioned problems, a module called Deformable
Convolution(i.e.,DConv)[17, 18] is proposed to enhance the CNNs’ capability of
modeling geometric transformations by adding additional offsets. However, as
shown in the Fig. 1 , it is still non-trivial to sample the head features
correctly and uniformly due to the uncontrollable offsets of sampling points
in the above-mentioned versions. Based on the preceding discussion, we argue
that it is difficult to sample uniformly by simply integrating Deformable
Convolution into the network. Therefore, in this work, we attempt to address
the problem of non-uniform sampling with extra loss.

Since the offsets are not constrained in DConv, the sampling region is
irregular, making it difficult to sample the features of heads uniformly.
Thus, a novel Normed-Deformable Convolution (i.e.,NDConv) which is implemented
by Normed-Deformable loss (i.e.,NDloss) is proposed to address the
forementioned problem. The offsets of sampling points are controlled by
NDloss. As a result, the features in the heads are captured more completely,
leading to better performance. In our implementation, CSRNet[19] is adopted as
the backbone. As the baseline, the last dilated convolution layer is replaced
with Deformable Convolution which is denoted as CSRNet$\star$. Without bells
and whistles, by replacing the Deformable Convolution in CSRNet$\star$ with
the proposed NDConv, we achieve better performance (i.e., $5.5\%$, $13.3\%$,
$4.5\%$ and $4.2\%$ improvement in MAE(Mean Absolute Error) on ShanghaiTech A,
ShanghaiTech B, UCF_QRNF, and UCF_CC_50.)

In summary, the main contributions of this paper are three-fold.

  * 1)

Comparing with conventional Deformable Convolution, a novel Normed-Deformable
Convolution (i.e.,NDConv) is proposed in which the sampling points tend to be
more uniformly spread over the head, resulting in more adequate feature
aggregation.

  * 2)

Our NDconv encourages more thoughts that shape priors should be intergrated
into the Deformable Convolution by constraining the sampling offsets.

  * 3)

Based on the proposed NDConv, better performance is achieved on several crowd
counting datasets than the state-of-the-art methods.

##  II Proposed Method

In this section, the definition and principles of Normed-Deformable Loss are
described firstly, and then the architecture of the training network is
presented.

###  II-A Normed-Deformable Loss

Given a convolution of kernel size $3\times 3$ for example, the standard nine
sampling points respectively denoted as $a,b,c,d,e,f,g,h,i$ lie strictly on
the grid. For Deformable Convolution, due to the existence of sampling
offsets, the sampling points $a,b,c,d,e,f,g,h,i$ move to $A,B,C,D,E,F,G,H,I$,
respectively. In this case, the offsets are two-dimensional and are recorded
as $(\Delta A_{x},\Delta A_{y}),\cdots,(\Delta I_{x},\Delta I_{y})$, where we
have $\mathrm{\it A}=\Delta{\it A}+{\it a},\cdots,\mathrm{\it I}=\Delta{\it
I}+{\it i}$.

Fig. 2(a) visualizes a typical case of sampling points in DConv, the sampling
points travel almost randomly due to no explicit constraints applied on the
corresponding offsets. Obviously, the sampling positions fail to evenly cover
the head region, leading to inadequate feature aggregation. By considering the
prior that the head tends to be in the shape of ellipse, an intuitive thought
is constraining the offsets of sampling points to be in accordance with the
prior, making the feature aggregation more sufficient.

Here, we make a simplification on the prior. Specifically, the ellipse is
decoupled into four parallelograms, i.e.,$ABED$, $CBEF$, $GHED$, $IHEF$,
depicted in Fig. 2(b). Before we build the corresponding loss for these
parallelograms, three restrictions should be constructed to make the whole
sampling points more reasonable. (i) The central sampling point $E$ should be
close to $e$, which is intuitive. (ii) $D$ and $F$ share the same distance
away from $e$, and both $D$ and $F$ should be close to $x$-axis. (iii)
Similarly, $B$ and $H$ should be the same distance away from $e$, and both $B$
and $H$ should be close to $y$-axis.

For restriction (i), we have:

$\mathcal{L}_{e}=\left\|\Delta E_{x}\right\|_{2}^{2}+\left\|\Delta
E_{y}\right\|_{2}^{2}\\\ $ (1)

For restriction (ii), we have:

$\mathcal{L}_{hor}=\left\|\Delta D_{x}+\Delta
F_{x}\right\|_{2}^{2}+\left\|\Delta D_{y}\right\|_{2}^{2}+\left\|\Delta
F_{y}\right\|_{2}^{2}$ (2)

And for restriction (iii), we have:

$\mathcal{L}_{vec}=\left\|\Delta B_{y}+\Delta
H_{y}\right\|_{2}^{2}+\left\|\Delta B_{x}\right\|_{2}^{2}+\left\|\Delta
H_{x}\right\|_{2}^{2}$ (3)

Finally, we constrian the four diagnoal points $A$, $C$, $G$, $I$, making them
close to the four parallelograms, i.e.,$ABED$, $CBEF$, $GHED$, $IHEF$:

Figure 2: Illustrations of conventional DConv and our NDConv, as demonstrated
in (a) and (b). The sampling points are represented by the balls. Among them,
the pink balls represent the sampling points of the conventional convolution
(indicated by lowercase letters, a-i), the red balls represent the actual
sampling points (indicated by uppercase letters A-I), and the offsets are
represented by the dark purple arrows.

$\displaystyle\mathcal{L}_{A}=\|(d+\Delta D)+(b+\Delta B)-(e+\Delta
E)-a\|_{2}^{2}$ (4) $\displaystyle\mathcal{L}_{C}=\|(f+\Delta F)+(b+\Delta
B)-(e+\Delta E)-c\|_{2}^{2}$ $\displaystyle\mathcal{L}_{G}=\|(d+\Delta
D)+(h+\Delta H)-(e+\Delta E)-g\|_{2}^{2}$
$\displaystyle\mathcal{L}_{I}=\|(f+\Delta F)+(h+\Delta H)-(e+\Delta
E)-i\|_{2}^{2}$

Thus, NDloss can be presented as Eq.(5):

$\mathcal{L}_{\text{nd}}=\mathcal{L}_{e}+\mathcal{L}_{\text{hor
}}+\mathcal{L}_{\text{vec
}}+\mathcal{L}_{A}+\mathcal{L}_{C}+\mathcal{L}_{G}+\mathcal{L}_{I}$ (5)

Then, the loss of density estimation is:

$\mathcal{L}_{den}=\min_{\Phi}\frac{1}{2N}\left\|P\left(I_{i};\boldsymbol{\Phi}\right)-Y_{i}\right\|_{2}^{2}$
(6)

Yi is the density map of ground_truth, $\boldsymbol{\Phi}$ denotes the
parameters of the network, $P\left(I_{i};\boldsymbol{\Phi}\right)$ represents
the estimation of density map, and $N$ is the batch size. The final loss is:

$\mathcal{L}_{all}=\mathcal{L}_{den}+\lambda\mathcal{L}_{nd}$ (7)

where $\lambda$ is the super-parameter to balance the two losses.

###  II-B Net Architecture

The architecture of the network is illustrated in Fig. 3. CSRNet[19] is
adopted as the backbone network, specifically, we add Batch Normalziation

Figure 3: The architecture of the proposed NDConv network. We adopt
CSRNet$\star$ as our backbone, where the last layer of dilated convolution is
replaced with NDConv to constrain the sampling points.

layer after each convolution layer to enhance the robustness of training with
cropped images. After that, the last layer of dilated convolution is replaced
with DConv or NDConv, denoted as CSRNet$\star$ and CSRNet (NDConv),
respectively. In the next section, the effectiveness of our NDConv is
verified.

##  III Experimental results

In this section, four datasets are adopted in our experiments, including
ShanghaiTech A, ShanghaiTech B[4], UCF-QRNF[20], and UCF_CC_50[21]. Firstly,
the evaluation metric and datasets are introduced, and then the implementation
details are described. Subsequently, the proposed NDconv is compared with
state-of-the-art methods on the four above-mentioned datasets. Finally, the
ablation study is conducted to explain the meaning of parameters in
experiments.

###  III-A Datasets and Implementation Details

####  III-A1 Datasets

On four popular datasets, ShanghaiTech Part A, ShanghaiTech Part B, UCF-QNRF,
and UCF_CC_50, the proposed NDConv and other state-of-the-art approaches are
evaluated.

ShanghaiTech[4]. It is composed of part A and part B. For Part A, the images
are obtained from the web, and the images in Part B are views of Shanghai
streets. Part A contains $482$ crowd images. Different from Part A, there are
more high-resolution images in Part B. It contains $716$ images, while the
counts of crowd in per image is from $9$ to $578$.

UCF-QNRF[20]. Compared with ShanghaiTech, this is a larger crowd counting
dataset that contains $1,535$ high-resolution images and $1.25$ million head
annotations. In this dataset, there are $1,201$ images of extremely congested
scenes for training and the rest are test images. The maximum count of an
image is $12,865$.

UCF_CC_50[21]. In our experiment, there is also a challenging dataset called
UCF_CC_50 which contains $50$ images. Although the number of images is small,
the count in per image varies drastically from $94$ to $4,543$. Following the
setting in [21], we divide the dataset into five subsets, and then $5$-fold
cross-validation is performed.

####  III-A2 Evaluation Metric

Mean Absolute Error (MAE) and Mean Square Error (MSE) are adopted as the
evaluation metrics, same as the previous works [22, 23, 24].

####  III-A3 Implementation Details

To improve the robustness of training with cropped images, the backbone of
CSRNet[19] is replaced with VGG16-BN and we insert Batch-Normalization[42]
layer after each dilated convolution. Then, the last layer of dilated
convolution is replaced with DConv. After these changes, the model is termed
as CSRNet$\star$ and is the baseline of experiments. Subsequently, the last
layer of DConv is replaced with NDconv, denoted as Ours (NDConv).

In the experiments, we use a fixed $\\!7\times\\!7$ Gaussian kernel to
generate density maps and Adam[25] optimizer is used with a learning rate of
$1$e-$4$. All images are resized to $\\!400\times\\!400$. The batch size and
parameter $\lambda$ are set to $4$ and $0.001$. We train $400$ epochs in two
days.

###  III-B Evaluations and Comparisons

The results of experiments on ShanghaiTech A and B are shown in Table I.

TABLE I: Comparisons on Shanghaitech A and B Methods | Venue&Year | ShanghaiTechA | ShanghaiTechB
---|---|---|---
MAE | MSE | MAE | MSE
CSRNet[19] | CVPR2018 | $68.2$ | $115.0$ | $10.6$ | $16.0$
SANet[28] | CVPR2018 | $67.0$ | $104.5$ | $8.4$ | $13.6$
TEDnet[29] | CVPR2019 | $64.2$ | $109.1$ | $8.2$ | $12.8$
ADCrowdNet[24] | CVPR2019 | $63.2$ | $98.9$ | $8.2$ | $15.7$
PSDDN[30] | CVPR2019 | $65.9$ | $112.3$ | $9.1$ | $14.2$
HA-CNN[26] | TIP2019 | $62.9$ | 94.9 | $8.1$ | $13.4$
LSC-CNN[27] | TPAMI2020 | $66.4$ | $117.0$ | $8.1$ | 12.7
DensityCNN[31] | TMM2020 | $63.1$ | $106.3$ | $9.1$ | $16.3$
DENet[32] | TMM2020 | $65.5$ | $101.2$ | $9.6$ | $15.4$
CSRNet$\star$(Baseline) | - | $65.0$ | $102.63$ | $9.0$ | $15.3$
Ours(NDConv) | - | 61.4 | $104.18$ | 7.8 | $13.8$

Compared with state-of-the-art, our method performs the best, indicating the
advantages of constrained offsets in deform convolution. For ShanghaiTech A,
our method achieves the best $61.4$ MAE with $2.5$ performance improvement
against the baseline CSRNet$\star$. The result of evaluation on ShanghaiTech B
has also lived up to expectations, our method achieves $7.8$ MAE and $13.3$
relative MAE decrease with the baseline.

TABLE II: Comparisons on UCF-QNRF and UCF_CC_50 Methods | Venue&Year | UCF-QNRF | UCF_CC_50
---|---|---|---
MAE | MSE | MAE | MSE
CSRNet[19] | CVPR2018 | - | - | $266.1$ | $397.5$
SANet[28] | CVPR2018 | - | - | $258.4$ | $334.9$
TEDnet[29] | CVPR2019 | $113$ | $188$ | $294.4$ | $354.5$
ADCrowdNet[24] | CVPR2019 | - | - | $257.1$ | $363.5$
PSDDN[30] | CVPR2019 | - | - | $359.4$ | $514.8$
HA-CCN[26] | TIP2019 | $118.1$ | $180.4$ | $256.2$ | $348.4$
LSC-CNN[27] | TPAMI2020 | $120.5$ | $218.2$ | $225.6$ | $302.7$
DensityCNN[31] | TMM2020 | $101.5$ | $186.9$ | $244.6$ | $341.8$
DENet[32] | TMM2020 | - | - | $241.9$ | $345.4$
DS-CNN[43] | AJSE2021 | $115.2$ | $175.7$ | $229.4$ | $325.6$
SDIH-DDM[44] | TVCJ2020 | $112$ | $173$ | - | -
CSRNet$\star$(Baseline) | - | $95.5$ | 165.3 | $174.6$ | 237.0
Ours(NDConv) | - | 91.2 | $165.6$ | 167.2 | $240.6$

For the datasets, UCF-QNRF and UCF_ CC_50, the comparison between our methods
and state-of-the-arts is recorded in Table II. Compared with the baseline
CSRNet$\star$, our method achieves significant gain on MAE. Respectively,
$91.2$ and $167.2$ MAE are achieved on datasets UCF-QNRF and UCF_CC_50, with
$4.5$%, $4.2$% performance improving. In particular, on the premise of great
performance improvement on CSRNet$\star$, our method further reduces MAE,
indicating the effectiveness of the constrained offsets in the dense scene.

###  III-C Ablation Study

In this section, the influence of the number of deformable layers in our
network is demonstrated firstly. On the other hand, visualization of the
constrained offsets is shown in Fig. 4 and the validity of NDloss is verified.
Finally, the extensibility of NDConv on another backbone is indicated.

####  III-C1 Influence of the number of deformable layers

There are $6$ layers of dilated convolution integrated into the architecture
of CSRNet. Each layer of dilated convolution is changed into Deformable
Convolution gradually. Then, each layer of Deformable Convolution is replaced
with NDConv. The performance is shown in Table III. While the number of
deformable layers is increased, the performance of the above-mentioned
experiment is decreased. The peak values of baseline are from $172.9$ to
$187.4$ MAE, while the trend in performance of NDConv is similar, which is
from $167.2$ to $184.6$ MAE on UCF_CC_50. Thus, the effectiveness is better by
only replacing the last layer of dilated convolution with DConv and NDConv
respectively in the network.

TABLE III: Effects of the number of deformable layers on UCF_CC_50 Deformable Layers |  CSRNet$\star$ | Ours(NDConv)
---|---|---
MAE | MSE | MAE | MSE
1 | $174.6$ | $237.0$ | 167.2 | $240.6$
2 | 172.9 | $268.3$ | $185.0$ | $296.1$
3 | $175.4$ | 233.3 | $168.2$ | 235.4
4 | $182.7$ | $271.2$ | $177.2$ | $245.9$
5 | $187.4$ | $266.5$ | $177.6$ | $235.7$
6 | $174.9$ | $256.2$ | $184.6$ | $263.3$

####  III-C2 Visualization of offsets

Experiments have shown that our NDConv surpasses Deformable Convolution and
the visualization of the offsets in Fig. 4 as previous work[34] also validates
our hypothesis. Fig. 4(c) and Fig. 4(f) demonstrate the sampling points of
DConv and our proposed NDConv. It is obvious that the sampling points of
NDConv tend to be spread more uniformly over the heads, leading to more
sufficient feature aggregation. Accordingly, Fig. 4(e) shows more regular
Gaussian blobs than Fig. 4(d), which further verifies the reasonableness of
our NDConv.

Figure 4: Visualization of an example from ShanghaiTech B dataset. (a) is the
input image; (b) is the ground_truth; (c) and (f) are the visualization of
offsets in DConv and NDConv; the predicted density map in DConv and NDConv are
shown in (d) and (e).

####  III-C3 Extensibility to Another Backbone

A new baseline consisted of ResNet-50[33] is built to verify the extensibility
of NDConv. Firstly, ResNet-50 (backbone) with the four dilated convolutions is
not changed. Then, the last layer of dilated convolutions is replaced with
Deformable Convolution as the new baseline called ResNet-50 (DConv). Finally,
the layer of Deformable Convolution is replaced with NDConv in ResNet-50
(NDConv). The comparisons of results on UCF_QNRF and UCF_CC_50 are shown in
Table IV. For ResNet-50 (backbone), we get $99.3$ and $227.6$ MAE on UCF_QNRF
and UCF_CC_50, respectively. When the last layer of convolution is replaced
with Deformable Convolution, the baseline delivers $98.0$ and $231.3$ MAE.
Particularly, if the layer of Deformable Convolution is replaced by NDConv, a
better performance is achieved $95.4$ and $222.4$ MAE. The extensibility and
effectiveness of NDConv on another backbone are indicated by the results of
the experiment.

TABLE IV: Comparisons on the ResNet-50 backbone Methods |  | UCF_QNRF
---
| UCF_CC_50
---
MAE | MSE | MAE | MSE
ResNet-50(backbone) | $99.3$ | $181.5$ | $227.6$ | 307.6
ResNet-50(DConv) | $98.0$ | 178.0 | $231.3$ | $317.0$
ResNet-50(NDConv) | 95.9 | $182.4$ | 222.4 | $315.4$

####  III-C4 The effects of $\mathcal{L}_{nd}$

The final loss consists of $\mathcal{L}_{nd}$ and $\mathcal{L}_{den}$. In this
section, the effect of super-parameter $\lambda$ is investigated. The
performance varies with the values of $\mathcal{L}_{nd}$. By conducting the
ablation study, it is verified that when the weight of the super-parameter
$\lambda$ is $1$e-$3$, the better performance is achieved. The experimental
data is shown in Table V.

TABLE V: Effects of the weight of $\mathcal{L}_{nd}$ on UCF-QNRF and UCF_CC_50 Datasets | Metrics |  $\lambda$(super-parameter)
---|---|---
$1$e-$1$ |  $1$e-$2$ |  $1$e-$3$ |  $1$e-$4$ | $0$
UCF-QNRF[20] | MAE | $94.8$ | $95.6$ | 91.2 | $93.8$ | $95.5$
MSE | $167.4$ | 165.2 | $165.6$ | $167.2$ | $165.3$
UCF_CC_50[21] | MAE | $189.5$ | $182.4$ | 167.2 | $175.2$ | $174.6$
MSE | $264.2$ | $285.1$ | $240.6$ | $238.7$ | 237.0

##  IV Conclusion

Normed-Deformable Convolution(NDConv) is proposed in this paper, which shows
its specificity in the constrained sampling offsets via NDloss. NDloss is
designed under the guidance of the shape of head, so as to enhance the
effectiveness of feature aggregation. Experiments show that our proposed
NDConv surpasses the conventional Deformable Convolution over four popular
datasets with little extra computational burden.

## Acknowledgements

This work has been supported by the Natural Science Foundation of Shandong
Province (No. ZR2021MF011).

## References

  * [1] Q. Wang, J. Gao, and W. Lin, “NWPU-Crowd: A Large-Scale Benchmark for Crowd Counting and Localization,” in IEEE Transactions on Pattern Analysis and Machine Intelligence, 2020: 3013269.
  * [2] P. L. Mazzeo, R. Contino, and P. Spagnolo, “MH-MetroNet-A Multi-Head CNN for Passenger-Crowd Attendance Estimation,” in Journal of Imaging, vol. 6, no. 7, pp. 62, 2020.
  * [3] V. A. Sindagi and V. M. Patel, “Generating high-quality crowd density maps using contextual pyramid cnns,” in Proceedings of the IEEE International Conference on Computer Vision(ICCV), pp. 1879-1888, 2017.
  * [4] Y. Zhang, D. Zhou, S. Chen, S. Gao, and Y. Ma, “Single-image crowd counting via multi-column convolutional neural network,” in Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition(CVPR), pp. 589-597, 2016.
  * [5] R. S. Feris, B. Siddiquie, and J. Petterson, “Large-Scale Vehicle Detection, Indexing, and Search in Urban Surveillance Videos,” in IEEE Transactions on Multimedia, vol. 14, no. 1, pp. 28-42, 2012.
  * [6] G. Wang, B. Li, Y. Zhang, and J. Yang, “Background modeling and referencing for moving cameras-captured surveillance video coding in hevc,” in IEEE Transactions on Multimedia, vol. 20, no. 11, pp. 2921-2934, 2018.
  * [7] E. Ran and Y. Moses, “Tracking in a Dense Crowd Using Multiple Cameras,” in International Journal of Computer Vision, vol. 88, no. 1, pp. 129-143, 2010.
  * [8] G. J. Brostow and R. Cipolla, “Unsupervised bayesian detection of independent motion in crowds,” in Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition(CVPR), vol. 1, pp. 594-601, 2006.
  * [9] V. Rabaud and S. Belongie, “Counting crowded moving objects,” in Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition(CVPR), vol. 1, pp. 705-711, 2006.
  * [10] A. B. Chan and N. Vasconcelos, “Bayesian poisson regression for crowd counting,” in IEEE International Conference on Computer Vision(ICCV), pp. 545-551, 2010.
  * [11] K. Chen, C. C. Loy, S. G. Gong, and T. Xiang, “Feature mining for localised crowd counting,” in British Machine Vision Conference(BMVC), vol. 1, p. 3, 2012.
  * [12] M. S. Zitouni, H. Bhaskar, J. Dias, and M. E. AlMualla, “Advances and trends in visual crowd analysis: A systematic survey and evaluation of crowd modelling techniques,” in Neurocomputing, vol. 186, pp. 139-159, 2016.
  * [13] V. A. Sindagi and V. M. Patel, “A survey of recent advances in cnn-based single image crowd counting and density estimation,” in Pattern Recognition Letters, vol. 107, pp. 3-16, 2017.
  * [14] C. Shang, H. Ai, and B. Bai, “End-to-end crowd counting via joint learning local and global count,” in IEEE International Conference on Image Processing(ICIP), pp. 1215-1219, 2016.
  * [15] F. Yu and V. Koltun, “Multi-scale context aggregation by dilated convolutions,” in International Conference on Learning Representations(ICLR), 2016: 9321067.
  * [16] D. B. Sam, S. Surya, and R. V. Babu, “Switching convolutional neural network for crowd counting,” in Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition(CVPR), pp. 4031-4039, 2017.
  * [17] J. Dai, H. Qi, and Y. Xiong, “Deformable Convolutional Networks,” in Proceedings of the IEEE International Conference on Computer Vision(ICCV), pp. 764-773, 2017.
  * [18] X. Zhu, H. Hu, and S. Lin, “Deformable ConvNets V2: More Deformable, Better Results,” in Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition(CVPR), 2019: 00953.
  * [19] Y. Li, X. Zhang, and D. Chen, “CSRNet: Dilated Convolutional Neural Networks for Understanding the Highly Congested Scenes,” in Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition(CVPR), 2018: 00120.
  * [20] H. Idrees, M. Tayyab, K. Athrey, D. Zhang, S. AlMaadeed, N. Rajpoot, and M. Shah, “Composition loss for counting, density map estimation and localization in dense crowds,” in Lecture Notes in Computer Science , pp. 532-546, 2018.
  * [21] H. Idrees, I. Saleemi, C. Seibert, and M. Shah, “Multi-source multi- scale counting in extremely dense crowd images,” in Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition(CVPR), pp. 2547-2554, 2013.
  * [22] Y. Yang, G. Li, and D. Du, “Embedding Perspective Analysis Into Multi-Column Convolutional Neural Network for Crowd Counting,” in IEEE Transactions on Image Processing, no. 30, pp. 1395-1407, 2021.
  * [23] Z. Yan, Y. Yuan, and W. Zuo, “Perspective-Guided Convolution Networks for Crowd Counting,” in Proceedings of the IEEE International Conference on Computer Vision(ICCV), 2019: 00104.
  * [24] N. Liu, Y. Long, and C. Zou, “ADCrowdNet: An Attention-Injective Deformable Convolutional Network for Crowd Understanding,” in Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition(CVPR), pp. 3220-3229, 2019.
  * [25] D. Kingma and J. Ba, “Adam: A Method for Stochastic Optimization,” in Computer Science, pp. 273-297, 2014.
  * [26] V. A. Sindagi and V. M. Patel, “Ha-ccn: Hierarchical attention-based crowd counting network,” in IEEE Transactions on Image Processing, vol. 29, pp. 323-335, 2019.
  * [27] D. B. Sam, S. V. Peri, M. N. Sundararaman, A. Kamath, and V. B. Radhakrishnan, “Locate, size and count: Accurately resolving people in dense crowds via detection,” in IEEE Transactions on Pattern Analysis and Machine Intelligence, vol. 43, no. 8, pp. 2739-2751, 2021.
  * [28] X. Cao, Z. Wang, Y. Zhao, and F. Su, “Scale aggregation network for accurate and efficient crowd counting,” in Lecture Notes in Computer Science, pp. 734-750, 2018.
  * [29] X. Jiang, Z. Xiao, B. Zhang, X. Zhen, X. Cao, D. Doermann, and L. Shao, “Crowd counting and density estimation by trellis encoder- decoder networks,” in Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition(CVPR), pp. 6133-6142, 2019.
  * [30] Y. Liu, M. Shi, Q. Zhao, and X. Wang, “Point in, box out: Beyond counting persons in crowds,” in Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition(CVPR), pp. 6469-6478, 2019.
  * [31] X. Jiang, L. Zhang, T. Zhang, P. Lv, B. Zhou, Y. Pang, M. Xu, and C. Xu, “Density-aware multi-task learning for crowd counting,” in IEEE Transactions on Multimedia, 2020: 2980945.
  * [32] L. Liu, W. Jia, J. Jiang, S. Amirgholipour, Y. Wang, M. Zeibots, and X. He, “Denet: A universal network for counting crowd with varying densities and scales,” in IEEE Transactions on Multimedia, 2020: 2992979.
  * [33] K. He, X. Zhang, and S. Ren, “Deep Residual Learning for Image Recognition,” in Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition(CVPR), pp. 770-778, 2016.
  * [34] Z. Yan, R. Zhang, H. Zhang, Q. Zhang, and W. Zuo. “Crowd Counting via Perspective-Guided Fractional-Dilation Convolution,” in IEEE Transactions on Multimedia, 2021: 3086709.
  * [35] Q. Song, C. Wang, Y. Wang, Y. Tai, C. Wang, and J. Li, “To Choose or to Fuse Scale Selection for Crowd Counting,” in Proceedings of the AAAI Conference on Artificial Intelligence, vol.35, pp. 2576-2583, 2021.
  * [36] J. Wan, “A Generalized Loss Function for Crowd Counting and Localization,” in Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition(CVPR), pp. 1974-1983, 2021.
  * [37] B. Yang, W. Zhan, N. Wang, X. Liu, and J. Lv, “Counting crowds using a scale-distribution-aware network and adaptive human-shaped kernel,” in Neurocomputing, vol. 390, pp. 207-216, 2020.
  * [38] Y. Fang, B. Zhan, W. Cai, S. Gao, and B. Hu, “Locality-constrained spatial transformer network for video crowd counting,” in Proceedings IEEE International Conference on Multimedia and Expo(ICME), vol. 2019-July, pp. 814-819, 2019.
  * [39] F. Xiong, X. Shi, and D. Yeung, “Spatiotemporal Modeling for Crowd Counting in Videos,” in Proceedings of the IEEE International Conference on Computer Vision(ICCV), vol. 2017-October, pp. 5161-5169, 2017.
  * [40] Y. Ma, H. Shuai, and W. Cheng, “Spatiotemporal Dilated Convolution with Uncertain Matching for Video-based Crowd Estimation,” in IEEE Transactions on Multimedia, 2021: 3050059.
  * [41] Y. Fang, S. Gao, J. Li, W. Luo, L. He, and B. Hu, “Multi-level feature fusion based Locality-Constrained Spatial Transformer network for video crowd counting,” in Neurocomputing, vol. 392, pp. 98-107, 2020.
  * [42] S. Ioffe and C. Szegedy, “Batch normalization: Accelerating deep network training by reducing internal covariate shift,” in 32nd International Conference on Machine Learning(ICML), vol. 1, pp. 448-456, 2015.
  * [43] S. D. Khan, and S. Basalamah, “Sparse to Dense Scale Prediction for Crowd Counting in High Density Crowds,” in Arabian Journal for Science and Engineering, vol. 46, no. 4, pp. 3051-3065, 2021.
  * [44] S. D. Khan, and S. Basalamah, “Scale and density invariant head detection deep model for crowd counting in pedestrian crowds,” in The Visual Computer, vol. 37, no. 8, pp. 2127-2137, 2020.


* Yeh (1998) I-C Yeh.  Modeling of Strength of High-Performance Concrete using Artificial Neural Networks.  _Cement and Concrete research_ , 28(12):1797–1808, 1998.
  * Yu et al. (2015) Fisher Yu, Ari Seff, Yinda Zhang, Shuran Song, Thomas Funkhouser, and Jianxiong Xiao.  LSUN: Construction of a Large-Scale Image Dataset using Deep Learning with Humans in the Loop.  _arXiv preprint arXiv:1506.03365_ , 2015.
  * Yu et al. (2019) Fuxun Yu, Zhuwei Qin, Chenchen Liu, Liang Zhao, Yanzhi Wang, and Xiang Chen.  Interpreting and Evaluating Neural Network Robustness.  In _Proceedings of the Twenty-Eighth International Joint Conference on Artificial Intelligence, IJCAI 2019, Macao, China, August 10-16, 2019_ , pp. 4199–4205. ijcai.org, 2019.
  * Zerva et al. (2022) Chrysoula Zerva, Taisiya Glushkova, Ricardo Rei, and André F. T. Martins.  "Disentangling Uncertainty in Machine Translation Evaluation".  In _Proceedings of the 2022 Conference on Empirical Methods in Natural Language Processing_ , pp. 8622–8641, Abu Dhabi, United Arab Emirates, December 2022. Association for Computational Linguistics.
  * Zhao et al. (2019) Xujiang Zhao, Yuzhe Ou, Lance Kaplan, Feng Chen, and Jin-Hee Cho.  Quantifying Classification Uncertainty Using Regularized Evidential Neural Networks.  _arXiv preprint arXiv:1910.06864_ , 2019.
  * Zhao et al. (2020) Xujiang Zhao, Feng Chen, Shu Hu, and Jin-Hee Cho.  Uncertainty Aware Semi-Supervised Learning on Graph Data.  In _Advances in Neural Information Processing Systems 33: Annual Conference on Neural Information Processing Systems 2020, NeurIPS 2020, December 6-12, 2020, virtual_ , 2020.

##  Appendix A Code Appendix

###  A.1 Iris Example Training Details

The code used to produce Figure 2 is available online.161616Code will be made
available upon acceptance. All models use three layers with $100$ hidden units
and ReLU activations each. We furthermore optimized all of the models with a
learning rate of $0.001$ using the Adam optimizer (Kingma & Ba, 2015) with its
default parameter settings. We also regularize the ensemble and MC Dropout
model with a dropout probability of $0.1$ each.

##### Prior Network specifics

We choose the expected $l_{2}$ loss by Sensoy et al. (2018) and regularize the
network using the KL divergence w.r.t. to a uniform Dirichlet as in Sensoy et
al. (2018). In the regularization term, we do not use the original
concentration parameters $\bm{\alpha}$, but a version in which the
concentration of the parameter $\alpha_{k}$ corresponding to the correct class
is removed using a one-hot label encoding $\mathbf{y}$ by
$\tilde{\bm{\alpha}}=(1-\bm{\alpha})\odot\bm{\alpha}+\mathbf{y}\odot\bm{\alpha}$,
where $\odot$ denotes point-wise multiplication. The regularization term is
added to the loss using a weighting factor of $0.05$.

###  A.2 Code Availability

Table 4: Overview over code repositories of surveyed works.

Paper | Code Repository
---|---
Prior network (Malinin & Gales, 2018) | https://github.com/KaosEngineer/PriorNetworks-OLD
Prior networks (Malinin & Gales, 2019) | https://github.com/KaosEngineer/PriorNetworks
Dirichlet via Function Decomposition (Biloš et al., 2019) | https://github.com/sharpenb/Uncertainty-Event-Prediction
Prior network with PAC Regularization (Haussmann et al., 2019) | https://github.com/manuelhaussmann/bedl
Prior networks with representation gap (Nandy et al., 2020) | https://github.com/jayjaynandy/maximize-representation-gap
Graph-based Kernel Dirichlet distribution estimation (GKDE) (Zhao et al., 2020) | https://github.com/zxj32/uncertainty-GNN
Evidential Deep Learning (Sensoy et al., 2018) | https://muratsensoy.github.io/uncertainty.html
WGAN–ENN (Hu et al., 2021) | https://github.com/snowood1/wenn
Belief Matching (Joo et al., 2020) | https://github.com/tjoo512/belief-matching-framework
Posterior Networks (Charpentier et al., 2020) | https://github.com/sharpenb/Posterior-Network
Graph Posterior Networks (Stadler et al., 2021) | https://github.com/stadlmax/Graph-Posterior-Network
Generative Evidential Neural Networks (Sensoy et al., 2020) | https://muratsensoy.github.io/gen.html
Deep Evidential Regression with Multi-task Learning (Oh & Shin, 2022) | https://github.com/deargen/MT-ENet
Multivariate Deep Evidential Regression (Meinert & Lavin, 2021) | https://github.com/avitase/mder/
Regression Prior Network (Malinin et al., 2020a) | https://github.com/JanRocketMan/regression-prior-networks
Natural Posterior Network (Charpentier et al., 2022) | https://github.com/borchero/natural-posterior-network

We list the available code repositories for surveyed works in Table 4. Works
for which no official implementation could be found are not listed.

##  Appendix B Datasets & Evaluation Techniques Appendix

Table 5: Overview over uncertainty evaluation techniques and datasets. (∗)
indicates that a dataset was used as an OOD dataset for evaluation purposes,
while (⋄) signifies that it was used as an in-distribution or out-of-
distribution dataset. (†) means that a dataset was modified to create ID and
OOD splits (for instance by removing some classes for evaluation or corrupting
samples with noise).

|  | Data Modality
---|---|---
Method |  Uncertainty Evaluation | Images | Tabular | Other
Prior network (Malinin & Gales, 2018) |  OOD Detection, Misclassification Detection |  MNIST, CIFAR-10, Omniglot(∗), SVHN(∗), LSUN(∗), TIM(∗) | ✗ | Clusters (Synthetic)
Prior networks (Malinin & Gales, 2019) |  OOD Detection, Adversarial Attack Detection |  MNIST, CIFAR-10/100, SVHN(∗), LSUN(∗), TIM(∗) | ✗ | Clusters (Synthetic)
Information Robust Dirichlet Networks (Tsiligkaridis, 2019) |  OOD Detection, Adversarial Attack Detection |  MNIST, FashionMNIST(∗) notMNIST(∗), Omniglot(∗) CIFAR-10, TIM(∗), SVHN(∗) | ✗ | ✗
Dirichlet via Function Decomposition (Biloš et al., 2019) | OOD Detection | ✗ |  Erdős-Rényi Graph (Synthetic), Stack Exchange, Smart Home, Car Indicators | ✗
Prior network with PAC Regularization (Haussmann et al., 2019) | OOD Detection |  MNIST, FashionMNIST(∗) CIFAR-10(†) | ✗ | ✗
Ensemble Distribution Distillation (Malinin et al., 2020b) |  OOD Detection, Misclassification Detection, Calibration |  CIFAR-10, CIFAR-100(⋄) TIM(⋄), LSUN(∗) | ✗ | Spirals (Synthetic)
Self-Distribution Distillation (Fathullah & Gales, 2022) |  OOD Detection, Calibration |  CIFAR-100 SVHN(∗), LSUN(∗) | ✗ | ✗
Prior networks with representation gap (Nandy et al., 2020) | OOD Detection |  CIFAR-10(⋄), CIFAR-100(⋄) TIM, ImageNet(∗) | ✗ | Clusters (Synthetic)
Prior RNN (Shen et al., 2020) | New Concept Extraction | ✗ | ✗ |  Concept Learning(⋄), Snips(⋄), ATIS(⋄) (Language)
Graph-based Kernel Dirichlet distribution estimation (GKDE) (Zhao et al., 2020) |  OOD Detection Misclassification Detection | ✗ | ✗ |  Coauthors Physics(⋄), Amazon Computer(⋄) Amazon Photo(⋄) (Graph)
Evidential Deep Learning (Sensoy et al., 2018) |  OOD Detection, Adversarial Attack Detection |  MNIST, notMNIST(∗), CIFAR-10(†) | ✗ | ✗
Regularized ENN Zhao et al. (2019) | OOD Detection |  CIFAR-10(†) | ✗ | Clusters (Synthetic)
WGAN–ENN (Hu et al., 2021) |  OOD Detection, Adversarial Attack Detection |  MNIST, notMNIST(∗), CIFAR-10(†) | ✗ | Clusters (Synthetic)
Variational Dirichlet (Chen et al., 2018) |  OOD Detection, Adversarial Attack Detection |  MNIST, CIFAR-10/100, iSUN(∗), LSUN(∗), SVHN(∗), TIM(∗) | ✗ | ✗
Dirichlet Meta-Model (Shen et al., 2022) |  OOD Detection Misclassification Detection |  MNIST(⋄,†), CIFAR-10(⋄,†), CIFAR-100(⋄), Omniglot(∗), FashionMNIST(∗), K-MNIST(∗), SVHN(∗), LSUN(∗), TIM(∗) | ✗ | ✗
Belief Matching (Joo et al., 2020) |  OOD Detection, Calibration |  CIFAR-10/100, SVHN(∗) | ✗ | ✗
Posterior Networks (Charpentier et al., 2020) |  OOD Detection, Misclassification Detection, Calibration |  MNIST, FashionMNIST(∗), K-MNIST(∗), CIFAR-10, SVHN(∗) |  Segment(†), Sensorless Drive(†) | Clusters (Synthetic)
Graph Posterior Networks (Stadler et al., 2021) |  OOD Detection, Misclassification Detection, Calibration | ✗ | ✗ |  Amazon Computer(⋄), Amazon Photo(⋄) CoraML(⋄), CiteSeerCoraML(⋄), PubMed(⋄), Coauthors Physics(⋄), CoauthorsCS(⋄), OBGN Arxiv(⋄) (Graph)
Deep Evidential Regression (Amini et al., 2020) |  OOD Detection, Misclassification Detection, Adversarial Attack Detection Calibration |  NYU Depth v2 ApolloScape∗ (Depth Estimation) |  UCI Regression Benchmark | Univariate Regression (Synthetic)
Deep Evidential Regression with Multi-task Learning (Oh & Shin, 2022) |  OOD Detection, Calibration | ✗ |  Davis, Kiba(†), BindingDB, PubChem(∗) (Drug discovery), UCI Regression Benchmark | Univariate Regression (Synthetic)
Multivariate Deep Evidential Regression Meinert & Lavin (2021) | Qualitative Evaluation | ✗ | ✗ | Multivariate Regression (Synthetic)
Regression Prior Network (Malinin et al., 2020a) | OOD Detection |  NYU Depth v2⋄, KITTI⋄ (Depth Estimation) |  UCI Regression Benchmark | Univariate Regression (Synthetic)
Natural Posterior Network (Charpentier et al., 2022) |  OOD Detection, Calibration |  NYU Depth v2, KITTI∗, LSUN(∗) (Depth Estimation), MNIST, FashionMNIST(∗), K-MNIST(∗), CIFAR-10(†), SVHN(∗), CelebA(∗) |  UCI Regression Benchmark(†), Sensorless Drive(†), Bike Sharing(†) |  Clusters (Synthetic), Univariate Regression (Synthetic))

This section contains a discussion of the used datasets, methods to evaluate
the quality of uncertainty evaluation, as well as a direct of available models
based on the reported results to determine the most useful choices for
practitioners. An overview over the differences between the surveyed works is
given in Table 5.

##### Datasets

Most models are applied to image classification problems, where popular
choices involve the MNIST dataset (LeCun, 1998), using as OOD datasets
Fashion-MNIST (Xiao et al., 2017), notMNIST (Bulatov, 2011) containing English
letters, K-MNIST (Clanuwat et al., 2018) with ancient Japanese Kuzushiji
characters, and the Omniglot dataset (Lake et al., 2015), featuring
handwritten characters from more than 50 alphabets. Other choices involve
different versions of the CIFAR-10 object recognition dataset (LeCun et al.,
1998; Krizhevsky et al., 2009) for training purposes and SVHN (Goodfellow et
al., 2014), iSUN (Xiao et al., 2010), LSUN (Yu et al., 2015), CelebA (Liu et
al., 2015), ImageNet (Deng et al., 2009) and TinyImagenet (Bastidas, 2017) for
OOD samples. Regression image datasets include for instance the NYU Depth
Estimation v2 dataset (Silberman et al., 2012), using ApolloScape (Huang et
al., 2018) or KITTI (Menze & Geiger, 2015) as an OOD dataset. Many authors
also illustrate model uncertainty on synthetic data, for instance by
simulating clusters of data points using Gaussians (Malinin & Gales, 2018;
2019; Nandy et al., 2020; Zhao et al., 2019; Hu et al., 2020; Charpentier et
al., 2020; 2022), spiral data (Malinin et al., 2020b) or polynomials for
regression (Amini et al., 2020; Oh & Shin, 2022; Meinert & Lavin, 2021;
Malinin et al., 2020a; Charpentier et al., 2022). Tabular datasets include the
Segment dataset, predicting image segments based on pixel features (Dua et
al., 2017), and the sensorless drive dataset (Dua et al., 2017; Paschke et
al., 2013), describing the maintenance state of electric current drives as
well as popular regression datasets included in the UCI regression benchmark
used by Hernández-Lobato & Adams (2015); Gal & Ghahramani (2016): Boston house
prices (Harrison Jr & Rubinfeld, 1978), concrete compression strength (Yeh,
1998), energy efficiency of buildings (Tsanas & Xifara, 2012), forward
kinematics of an eight link robot arm (Corke, 1996), maintenance of naval
propulsion systems (Coraddu et al., 2016), properties of protein tertiary
stuctures, wine quality (Cortez et al., 2009), and yacht hydrodynamics
(Gerritsma et al., 1981). Furthermore, Oh & Shin (2022) use a number of drug
discovery datasets, such as Davis (Davis et al., 2011), Kiba (Tang et al.,
2014), BindingDB (Liu et al., 2007) and PubChem (Kim et al., 2019). Biloš et
al. (2019) are the only authors working on asynchronous time even prediction,
and supply their own data in the form of processed stack exchange postings,
smart home data, and car indicators. Shen et al. (2020) provide the sole
method on language data, and use three different concept learning datasets,
i.e. Concept Learning (Jia et al., 2017), Snips (Coucke et al., 2018) and ATIS
(Hemphill et al., 1990), which contains new OOD concepts to be learned by
design. For graph neural networks, Zhao et al. (2020) and Stadler et al.
(2021) select data from the co-purchase datasets Amazon Computer, Amazon
Photos (McAuley et al., 2015) and the CoraML (McCallum et al., 2000), CiteSeer
(Giles et al., 1998) and PubMed (Namata et al., 2012), Coauthors Physics
(Shchur et al., 2018), CoauthorCS (Namata et al., 2012) and OGBN Arxiv (Hu et
al., 2020) citation datasets. Lastly, Charpentier et al. (2022) use a single
count prediction dataset concerned with predicting the number of bike rentals
(Fanaee-T & Gama, 2014).

##### Uncertainty Evaluation Methods

There usually are no gold labels for uncertainty estimates, which is why the
efficacy of proposed solutions has to be evaluated in a different way. One
such way used by almost all the surveyed works is using uncertainty estimates
in a proxy OOD detection task: Since the model is underspecified on unseen
samples from another distribution, it should be more uncertain. By labelling
OOD samples as the positive and ID inputs as the negative class, we can
measure the performance of uncertainty estimates using the area under the
receiver-operator characteristic (AUROC) or the area under the precision-
recall curve (AUPR). We can thereby characterize the usage of data from
another dataset as a form of covariate shift, while using left-out classes for
testing can be seen as a kind of concept shift (Moreno-Torres et al., 2012).
Instead of using OOD data, another approach is to use adversarial examples
(Malinin & Gales, 2019; Tsiligkaridis, 2019; Sensoy et al., 2018; Hu et al.,
2021; Chen et al., 2018; Amini et al., 2020), checking if they can be
identified through uncertainty. In the case of Shen et al. (2020), OOD
detection or new concept extraction is the actual and not a proxy task, and
thus can be evaluated using classical metrics such as the $F_{1}$ score.
Another way is misclassification detection: In general, we would desire the
model to be more uncertain about inputs it incurs a higher loss on, i.e., what
it is more wrong about. For this purpose, some works (Malinin & Gales, 2018;
Zhao et al., 2020; Charpentier et al., 2020) measure whether let
missclassified inputs be the positive class in another binary proxy
classification test, and again measure AUROC and AUPR. Alternatively, Malinin
et al. (2020b); Stadler et al. (2021); Amini et al. (2020) show or measure the
area under the prediction / rejection curve, graphing how task performance
varies as predictions on increasingly uncertain inputs is suspended. Lastly,
some authors look at a model’s calibration (Guo et al., 2017): While this does
not allow to judge the quality of uncertainty estimates themselves, quantities
like the expected calibration error quantify to what extent the output
distribution of a classifier corresponds to the true label distribution, and
thus whether aleatoric uncertainty is accurately reflected.

##  Appendix C Fundamental Derivations Appendix

This appendix section walks the reader through generalized versions of
recurring theoretical results using Dirichlet distributions in a Machine
Learning context, such as their expectation in Section C.1, their entropy in
Section C.2 and the Kullback-Leibler divergence between two Dirichlets in
Section D.3.

###  C.1 Expectation of a Dirichlet

Here, we show results for the quantities $\mathbb{E}_{#1}[\pi_{k}]$ and
$\mathbb{E}_{#1}[\log\pi_{k}]$. For the first, we follow the derivation by
Miller (2011). Another proof is given by Lin (2016).

$\displaystyle\mathbb{E}_{#1}[\pi_{k}]$
$\displaystyle=\int\cdots\int\pi_{k}\frac{\Gamma(\alpha_{0})}{\prod_{k^{\prime}=1}^{K}\Gamma(\alpha_{k}^{\prime})}\prod_{k^{\prime}=1}^{K}\pi_{k^{\prime}}^{\alpha_{k^{\prime}}-1}d\pi_{1}\ldots
d\pi_{K}$ (30) Moving $\pi_{k}^{\alpha_{k}-1}$ out of the product:
$\displaystyle=\int\cdots\int\frac{\Gamma(\alpha_{0})}{\prod_{k^{\prime}=1}^{K}\Gamma(\alpha_{k^{\prime}})}\pi_{k}^{\alpha_{k}-1+1}\prod_{k^{\prime}\neq
k}\pi_{k^{\prime}}^{\alpha_{k^{\prime}}-1}d\pi_{1}\ldots d\pi_{K}$ (31) For
the next step, we define a new set of Dirichlet parameters with
$\beta_{k}=\alpha_{k}+1$ and $\forall k^{\prime}\neq
k:\beta_{k^{\prime}}=\alpha_{k^{\prime}}$. For those new parameters,
$\beta_{0}=\sum_{k}\beta_{k}=1+\alpha_{0}$. So by virtue of the Gamma
function’s property that
$\Gamma(\beta_{0})=\Gamma(\alpha_{0}+1)=\alpha_{0}\Gamma(\alpha_{0})$,
replacing all terms in the normalization factor yields
$\displaystyle=\int\cdots\int\frac{\alpha_{k}}{\alpha_{0}}\frac{\Gamma(\beta_{0})}{\prod_{k^{\prime}=1}^{K}\Gamma(\beta_{k^{\prime}})}\prod_{k^{\prime}=1}^{K}\pi_{k^{\prime}}^{\beta_{k^{\prime}}-1}d\pi_{1}\ldots
d\pi_{K}=\frac{\alpha_{k}}{\alpha_{0}}$ (32)

where in the last step we obtain the final result, since the Dirichlet with
new parameters $\beta_{k}$ must nevertheless integrate to $1$, and the
integrals do not regard $\alpha_{k}$ or $\alpha_{0}$. For the expectation
$\mathbb{E}_{#1}[\log\pi_{k}]$, we first rephrase the Dirichlet distribution
in terms of the exponential family (Kupperman, 1964). The exponential family
encompasses many commonly-used distributions, such as the normal, exponential,
Beta or Poisson, which all follow the form

$p(\mathbf{x};\bm{\eta})=h(\mathbf{x})\exp\big{(}\bm{\eta}^{T}u(\mathbf{x})-A(\bm{\eta})\big{)}$
(33)

with _natural parameters_ $\bm{\eta}$, _sufficient statistic_ $u(\mathbf{x})$,
and _log-partition function_ $A(\bm{\eta})$. For the Dirichlet distribution,
Winn (2004) provides the sufficient statistic as
$u(\bm{\pi})=[\log\bm{\pi}_{1},\ldots,\bm{\pi}_{K}]^{T}$ and the log-partition
function

$A(\bm{\alpha})=\sum_{k=1}^{K}\log\Gamma(\alpha_{k})-\log\Gamma(\alpha_{o})$
(34)

By Mao (2019), we also find that by the moment-generating function that for
the sufficient statistic, its expectation can be derived by

$\mathbb{E}_{#1}[u(\mathbf{x})_{k}]=\frac{\partial
A(\bm{\eta})}{\partial\eta_{k}}$ (35)

Therefore we can evaluate the expected value of $\log\pi_{k}$ (i.e. the
sufficient statistic) by inserting the definition of the log-partition
function in Equation 34 into Equation 35:

$\displaystyle\mathbb{E}_{#1}[\log\pi_{k}]=\frac{\partial}{\partial\alpha_{k}}\sum_{k=1}^{K}\log\Gamma(\alpha_{k})-\log\Gamma(\alpha_{0})=\psi(\alpha_{k})-\psi(\alpha_{0})$
(36)

which corresponds precisely to the definition of the digamma function as
$\psi(x)=\frac{d}{dx}\log\Gamma(x)$.

###  C.2 Entropy of Dirichlet

The following derivation is adapted from Lin (2016), with the result stated in
Charpentier et al. (2020) as well.

$\displaystyle H[\bm{\pi}]$ $\displaystyle=-\mathbb{E}_{#1}[\log
p(\bm{\pi}|\bm{\alpha})]$ (37)
$\displaystyle=-\mathbb{E}_{#1}\bigg{[}\log\Big{(}\frac{1}{B(\bm{\alpha})}\prod_{k=1}^{K}\pi_{k}^{\alpha_{k}-1}\Big{)}\bigg{]}$
(38) $\displaystyle=-\mathbb{E}_{#1}\bigg{[}-\log
B(\bm{\alpha})+\sum_{k=1}^{K}(\alpha_{k}-1)\log\pi_{k}\bigg{]}$ (39)
$\displaystyle=\log
B(\bm{\alpha})-\sum_{k=1}^{K}(\alpha_{k}-1)\mathbb{E}_{#1}[\log\pi_{k}]$ (40)
Using Equation 36: $\displaystyle=\log
B(\bm{\alpha})-\sum_{k=1}^{K}(\alpha_{k}-1)\big{(}\psi(\alpha_{k})-\psi(\alpha_{0})\big{)}$
(41) $\displaystyle=\log
B(\bm{\alpha})+\sum_{k=1}^{K}(\alpha_{k}-1)\psi(\alpha_{0})-\sum_{k=1}^{K}(\alpha_{k}-1)\psi(\alpha_{k})$
(42) $\displaystyle=\log
B(\bm{\alpha})+(\alpha_{0}-K)\psi(\alpha_{0})-\sum_{k=1}^{K}(\alpha_{k}-1)\psi(\alpha_{k})$
(43)

###  C.3 Kullback-Leibler Divergence between two Dirichlets

The following result is presented using an adapted derivation by Lin (2016)
and appears in Chen et al. (2018) and Joo et al. (2020) as a starting point
for their variational objective (see Section D.7). In the following we use
$\text{Dir}(\bm{\pi};\bm{\alpha})$ to denote the optimized distribution, and
$\text{Dir}(\bm{\pi};\bm{\gamma})$ the reference or target distribution.

$\displaystyle\text{KL}\Big{[}p(\bm{\pi}|\bm{\alpha})\Big{|}\Big{|}p(\bm{\pi}|\bm{\gamma})\Big{]}=$
$\displaystyle\mathbb{E}_{#1}\bigg{[}\log\frac{p(\bm{\pi}|\bm{\alpha})}{p(\bm{\pi}|\bm{\gamma})}\bigg{]}=\mathbb{E}_{#1}\bigg{[}\log
p(\bm{\pi}|\bm{\alpha})\bigg{]}-\mathbb{E}_{#1}\bigg{[}\log
p(\bm{\pi}|\bm{\gamma})\bigg{]}$ (44) $\displaystyle=$
$\displaystyle\mathbb{E}_{#1}\bigg{[}-\log
B(\bm{\alpha})+\sum_{k=1}^{K}(\alpha_{k}-1)\log\pi_{k}\bigg{]}$
$\displaystyle-$ $\displaystyle\mathbb{E}_{#1}\bigg{[}-\log
B(\bm{\gamma})+\sum_{k=1}^{K}(\gamma_{k}-1)\log\pi_{k}\bigg{]}$ (45)
Distributing and pulling out $B(\bm{\alpha})$ and $B(\bm{\gamma})$ out of the
expectation (they don’t depend on $\bm{\pi}$): $\displaystyle=$
$\displaystyle-\log\frac{B(\bm{\gamma})}{B(\bm{\alpha})}+\mathbb{E}_{#1}\bigg{[}\sum_{k=1}^{K}(\alpha_{k}-1)\log\pi_{k}-(\gamma_{k}-1)\log\pi_{k}\bigg{]}$
(46) $\displaystyle=$
$\displaystyle-\log\frac{B(\bm{\gamma})}{B(\bm{\alpha})}+\mathbb{E}_{#1}\bigg{[}\sum_{k=1}^{K}(\alpha_{k}-\gamma_{k})\log\pi_{k}\bigg{]}$
(47) Moving the expectation inward and using the identity
$\mathbb{E}_{#1}[\pi_{k}]=\psi(\alpha_{k})-\psi(\alpha_{0})$ from Section C.1:
$\displaystyle=$
$\displaystyle-\log\frac{B(\bm{\gamma})}{B(\bm{\alpha})}+\sum_{k=1}^{K}(\alpha_{k}-\gamma_{k})\big{(}\psi(\alpha_{k})-\psi(\alpha_{0})\big{)}$
(48)

The KL divergence is also used by some works as regularizer by penalizing the
distance to a uniform Dirichlet with $\bm{\gamma}=\mathbf{1}$ (Sensoy et al.,
2018). In this case, the result above can be derived to be

$\text{KL}\Big{[}p(\bm{\pi}|\bm{\alpha})\Big{|}\Big{|}p(\bm{\pi}|\bm{1})\Big{]}=\log\frac{\Gamma(K)}{B(\bm{\alpha})}+\sum_{k=1}^{K}(\alpha_{k}-1)\big{(}\psi(\alpha_{k})-\psi(\alpha_{0})\big{)}$
(49)

where the $\log\Gamma(K)$ term can also be omitted for optimization purposes,
since it does not depend on $\bm{\alpha}$.

##  Appendix D Additional Derivations Appendix

In this appendix we present relevant results in a Machine Learning context,
including from some of the surveyed works, featuring as unified notation and
annotated derivation steps. These include derivations of expected entropy
(Section D.1) and mutual information (Section D.2) as uncertainty metrics for
Dirichlet networks. Also, we derive a multitude of loss functions, including
the $l_{\infty}$ norm loss of a Dirichlet w.r.t. a one-hot encoded class label
in Section D.3, the $l_{2}$ norm loss in Section D.4, as well as the reverse
KL loss by Malinin & Gales (2019), the UCE objective Biloš et al. (2019);
Charpentier et al. (2020) and ELBO Shen et al. (2020); Chen et al. (2018) as
training objectives (Sections D.5, D.6 and D.7).

###  D.1 Derivation of Expected Entropy

The following derivation is adapted from Malinin & Gales (2018) appendix
section C.4. In the following, we assume that $\forall
k\in\mathbb{K}:\pi_{k}>0$:

$\displaystyle\mathbb{E}_{#1}\bigg{[}H\Big{[}P(y|\bm{\pi})\Big{]}\bigg{]}=\int
p(\bm{\pi}|\mathbf{x},\hat{\bm{\theta}})\bigg{(}-\sum_{k=1}^{K}\pi_{k}\log\pi_{k}\bigg{)}d\bm{\pi}$
(50) $\displaystyle=-\sum_{k=1}^{K}\int
p(\bm{\pi}|\mathbf{x},\hat{\bm{\theta}})\Big{(}\pi_{k}\log\pi_{k}\Big{)}d\bm{\pi}$
(51) Inserting the definition of
$p(\bm{\pi}|\mathbf{x},\hat{\bm{\theta}})\approx
p(\bm{\pi}|\mathbf{x},\mathbb{D})$:
$\displaystyle=-\sum_{k=1}^{K}\Bigg{(}\frac{\Gamma(\alpha_{0})}{\prod_{k^{\prime}=1}^{K}\Gamma(\alpha_{k^{\prime}})}\int\pi_{k}\log\pi_{k}\prod_{k^{\prime}=1}^{K}\pi_{k^{\prime}}^{\alpha_{k^{\prime}}-1}d\bm{\pi}\Bigg{)}$
(52) Singling out the factor $\pi_{k}$:
$\displaystyle=-\sum_{k=1}^{K}\Bigg{(}\frac{\Gamma(\alpha_{0})}{\Gamma(\alpha_{k})\prod_{k^{\prime}\neq
k}\Gamma(\alpha_{k^{\prime}})}\pi_{k}^{\alpha_{k}-1}\int\pi_{k}\log\pi_{k}\prod_{k^{\prime}\neq
k}\pi_{k^{\prime}}^{\alpha_{k^{\prime}}-1}d\bm{\pi}\Bigg{)}$ (53) Adjusting
the normalizing constant (this is the same trick used in Section C.1):
$\displaystyle=-\sum_{k=1}^{K}\Bigg{(}\frac{\alpha_{k}}{\alpha_{0}}\int\frac{\Gamma(\alpha_{0}+1)}{\Gamma(\alpha_{k}+1)\prod_{k^{\prime}\neq
k}\Gamma(\alpha_{k^{\prime}})}\pi_{k}^{\alpha_{k}-1}\log\pi_{k}\prod_{k^{\prime}\neq
k}\pi_{k^{\prime}}^{\alpha_{k^{\prime}}-1}d\bm{\pi}\Bigg{)}$ (54) Using the
identity $\mathbb{E}_{#1}[\log\pi_{k}]=\psi(\alpha_{k})-\psi(\alpha_{0})$
(Equation 36). Since the expectation here is w.r.t to a Dirichlet with
concentration parameters $\alpha_{k}+1$, we obtain
$\displaystyle=-\sum_{k=1}^{K}\frac{\alpha_{k}}{\alpha_{0}}\bigg{(}\psi(\alpha_{k}+1)-\psi(\alpha_{0}+1)\bigg{)}$
(55)

###  D.2 Derivation of Mutual Information

We start from the expression in Equation 13:

$\displaystyle I\Big{[}y,\bm{\pi}\Big{|}\mathbf{x},\mathbb{D}\Big{]}$
$\displaystyle=H\bigg{[}\mathbb{E}_{#1}\Big{[}P(y|\bm{\pi})\Big{]}\bigg{]}-\mathbb{E}_{#1}\bigg{[}H\Big{[}P(y|\bm{\pi})\Big{]}\bigg{]}$
(56) Given that $\mathbb{E}_{#1}[\pi_{k}]=\frac{\alpha_{k}}{\alpha_{0}}$
(Section C.1) and assuming that point estimate
$p(\bm{\pi}|\mathbf{x},\mathbb{D})\approx
p(\bm{\pi}|\mathbf{x},\hat{\bm{\theta}})$ is sufficient (Malinin & Gales,
2018), we can identify the first term as the Shannon entropy
$-\sum_{k=1}^{K}\pi_{k}\log\pi_{k}=-\sum_{k=1}^{K}\frac{\alpha_{k}}{\alpha_{0}}\log\frac{\alpha_{k}}{\alpha_{0}}$.
Furthermore, the second part we already derived in Section D.1 and thus we
obtain:
$\displaystyle=-\sum_{k=1}^{K}\frac{\alpha_{k}}{\alpha_{0}}\log\frac{\alpha_{k}}{\alpha_{0}}+\sum_{k=1}^{K}\frac{\alpha_{k}}{\alpha_{0}}\bigg{(}\psi(\alpha_{k}+1)-\psi(\alpha_{0}+1)\bigg{)}$
(57)
$\displaystyle=-\sum_{k=1}^{K}\frac{\alpha_{k}}{\alpha_{0}}\bigg{(}\log\frac{\alpha_{k}}{\alpha_{0}}-\psi(\alpha_{k}+1)+\psi(\alpha_{0}+1)\bigg{)}$
(58)

###  D.3 $l_{\infty}$ Norm Derivation

In this section we elaborate on the derivation of Tsiligkaridis (2019)
deriving a generalized $l_{p}$ loss, upper-bounding the $l_{\infty}$ loss.
This in turn allows us to easily derive the $l_{2}$ loss used by Sensoy et al.
(2018); Zhao et al. (2020). Here we assume the classification target $y$ is
provided in the form of a one-hot encoded label
$\mathbf{y}=[\mathbf{1}_{y=1},\ldots,\mathbf{1}_{y=K}]^{T}$.

$\displaystyle\mathbb{E}_{#1}\big{[}||\mathbf{y}-\bm{\pi}||_{\infty}\big{]}$
$\displaystyle\leq\mathbb{E}_{#1}\big{[}||\mathbf{y}-\bm{\pi}||_{p}\big{]}$
(59) Using Jensen’s inequality
$\displaystyle\leq\Big{(}\mathbb{E}_{#1}\big{[}||\mathbf{y}-\bm{\pi}||_{p}^{p}\big{]}\Big{)}^{1/p}$
(60) Evaluating the expression with $\forall k\neq y:\mathbf{y}_{k}=0$:
$\displaystyle=\Big{(}\mathbb{E}_{#1}[(1-\pi_{y})^{p}]+\sum_{k\neq
y}\mathbb{E}_{#1}[\pi_{k}^{p}]\Big{)}^{1/p}$ (61)

In order to compute the expression above, we first realize that all components
of $\pi$ are distributed according to a Beta distribution
$\text{Beta}(\alpha,\beta)$ (since the Dirichlet is a multivariate
generalization of the beta distribution) for which the moment-generating
function is given as follows:

$\mathbb{E}_{#1}[\pi^{p}]=\frac{\Gamma(\alpha+p)\Gamma(\beta)\Gamma(\alpha+\beta)}{\Gamma(\alpha+p+\beta)\Gamma(\alpha)\Gamma(\beta)}=\frac{\Gamma(\alpha+p)\Gamma(\alpha+\beta)}{\Gamma(\alpha+p+\beta)\Gamma(\alpha)}$
(62)

Given that the first term in Equation 59 is characterized by
$\text{Beta}(\alpha_{0}-\alpha_{y},\alpha_{y})$ and the second one by
$\text{Beta}(\alpha_{k},\alpha_{0}-\alpha_{k})$, we can evaluate the result in
Equation 59 using the moment generating function:

$\displaystyle\mathbb{E}_{#1}\Big{[}||\mathbf{y}-\bm{\pi}||_{\infty}\Big{]}$
$\displaystyle\leq\Bigg{(}\frac{\Gamma(\alpha_{0}-\alpha_{y}+p)\Gamma(\alpha_{0}-\cancel{\alpha_{y}}+\cancel{\alpha_{y}})}{\Gamma(\alpha_{0}-\cancel{\alpha_{y}}+p+\cancel{\alpha_{y})}\Gamma(\alpha_{0}-\alpha_{y})}+\sum_{k\neq
y}\frac{\Gamma(\alpha_{k}+p)\Gamma(\cancel{\alpha_{k}}+\alpha_{0}-\cancel{\alpha_{k}})}{\Gamma(\cancel{\alpha_{k}}+p+\alpha_{0}-\cancel{\alpha_{k}})\Gamma(\alpha_{k})}\Bigg{)}^{\frac{1}{p}}$
(63)
$\displaystyle=\Bigg{(}\frac{\Gamma(\alpha_{0}-\alpha_{y}+p)\Gamma(\alpha_{0})}{\Gamma(\alpha_{0}+p)\Gamma(\alpha_{0}-\alpha_{y})}+\sum_{k\neq
y}\frac{\Gamma(\alpha_{k}+p)\Gamma(\alpha_{0})}{\Gamma(p+\alpha_{0})\Gamma(\alpha_{k})}\Bigg{)}^{\frac{1}{p}}$
(64) Factoring out common terms:
$\displaystyle=\bBigg@{4}(\frac{\Gamma(\alpha_{0})}{\Gamma(\alpha_{0}+p)}\bBigg@{4}(\frac{\Gamma(\alpha_{0}-\alpha_{y}+p)}{\Gamma(\alpha_{0}-\alpha_{y})}+\sum_{k\neq
y}\frac{\Gamma(\alpha_{k}+p)}{\Gamma(\alpha_{k})}\bBigg@{4})\bBigg@{4})^{\frac{1}{p}}$
(65) Expressing $\alpha_{0}-\alpha_{k}=\sum_{k\neq y}\alpha_{k}$:
$\displaystyle=\bigg{(}\frac{\Gamma(\alpha_{0})}{\Gamma(\alpha_{0}+p)}\bigg{)}^{\frac{1}{p}}\bBigg@{4}(\frac{\Gamma\Big{(}\sum_{k\neq
y}\alpha_{k}+p\Big{)}}{\Gamma\Big{(}\sum_{k\neq
y}\alpha_{k}\Big{)}}+\sum_{k\neq
y}\frac{\Gamma(\alpha_{k}+p)}{\Gamma(\alpha_{k})}\bBigg@{4})^{\frac{1}{p}}$
(66)

###  D.4 $l_{2}$ Norm Loss Derivation

Here we present an adapted derivation by Sensoy et al. (2018) for the
$l_{2}$-norm loss to train Dirichlet networks. Here we again use a one-hot
vector for a label with
$\mathbf{y}=[\mathbf{1}_{y=1},\ldots,\mathbf{1}_{y=K}]^{T}$.

$\displaystyle\mathbb{E}_{#1}\Big{[}||\mathbf{y}-\bm{\pi}||_{2}^{2}\Big{]}$
$\displaystyle=\mathbb{E}_{#1}\bigg{[}\sum_{k=1}^{K}(\mathbf{1}_{y=k}-\pi_{k})^{2}\bigg{]}$
(67)
$\displaystyle=\mathbb{E}_{#1}\bigg{[}\sum_{k=1}^{K}\mathbf{1}_{y=k}^{2}-2\pi_{k}\mathbf{1}_{y=k}+\pi_{k}^{2}\bigg{]}$
(68)
$\displaystyle=\sum_{k=1}^{K}\mathbf{1}_{y=k}^{2}-2\mathbb{E}_{#1}[\pi_{k}]\mathbf{1}_{y=k}+\mathbb{E}_{#1}[\pi_{k}^{2}]$
(69) Using the identity that
$\mathbb{E}_{#1}[\pi_{k}^{2}]=\mathbb{E}_{#1}[\pi_{k}]^{2}+\text{Var}(\pi_{k})$:
$\displaystyle=\sum_{k=1}^{K}\mathbf{1}_{y=k}^{2}-2\mathbb{E}_{#1}[\pi_{k}]\mathbf{1}_{y=k}+\mathbb{E}_{#1}[\pi_{k}]^{2}+\text{Var}(\pi_{k})$
(70)
$\displaystyle=\sum_{k=1}^{K}\Big{(}\mathbf{1}_{y=k}-\mathbb{E}_{#1}[\pi_{k}]\Big{)}^{2}+\text{Var}(\pi_{k})$
(71) Finally, we use the result from Section C.1 and the result that
$\displaystyle\text{Var}(\pi_{k})=\frac{\alpha_{k}(\alpha_{0}-\alpha_{k})}{\alpha_{0}^{2}(\alpha_{0}+1)}$
(see Lin, 2016):
$\displaystyle=\sum_{k=1}^{K}\Big{(}\mathbf{1}_{y=k}-\frac{\alpha_{k}}{\alpha_{0}}\Big{)}^{2}+\frac{\alpha_{k}(\alpha_{0}-\alpha_{k})}{\alpha_{0}^{2}(\alpha_{0}+1)}$
(72)

###  D.5 Derivation of Reverse KL loss

Here we re-state and annotate the derivation of reverse KL loss by Malinin &
Gales (2019) in more detail, starting from the forward KL loss by Malinin &
Gales (2018). Note that here, $\hat{\bm{\alpha}}$ contains a dependence on
$k$, since Malinin & Gales (2018) let
$\hat{\alpha}_{k}=\hat{\pi_{k}}\hat{\alpha}_{0}$ with $\hat{\alpha}_{0}$ being
a hyperparameter and
$\hat{\pi}_{k}=\mathbf{1}_{k=y}+(-\mathbf{1}_{k=y}K+1)\varepsilon$ and
$\varepsilon$ being a small number.

$\displaystyle\quad\
\mathbb{E}_{#1}\bigg{[}\sum_{k=1}^{K}\mathbf{1}_{y=k}\text{KL}\Big{[}p(\bm{\pi}|\hat{\bm{\alpha}})\Big{|}\Big{|}p(\bm{\pi}|\mathbf{x},\bm{\theta})\Big{]}\bigg{]}$
(73) $\displaystyle=\mathbb{E}_{#1}\bigg{[}\sum_{k=1}^{K}\mathbf{1}_{y=k}\int
p(\bm{\pi}|\hat{\bm{\alpha}})\log\frac{p(\bm{\pi}|\hat{\bm{\alpha}})}{p(\bm{\pi}|\mathbf{x},\bm{\theta})}d\bm{\pi}\bigg{]}$
(74) Writing the expectation explicitly:
$\displaystyle=\int\sum_{k=1}^{K}p(y=k,\mathbf{x})\sum_{k=1}^{K}\mathbf{1}_{y=k}\int
p(\bm{\pi}|\hat{\bm{\alpha}})\log\frac{p(\bm{\pi}|\hat{\bm{\alpha}})}{p(\bm{\pi}|\mathbf{x},\bm{\theta})}d\bm{\pi}d\mathbf{x}$
(75)
$\displaystyle=\int\sum_{k=1}^{K}p(\mathbf{x})P(y=k|\mathbf{x})\sum_{k=1}^{K}\mathbf{1}_{y=k}\int
p(\bm{\pi}|\hat{\bm{\alpha}})\log\frac{p(\bm{\pi}|\hat{\bm{\alpha}})}{p(\bm{\pi}|\mathbf{x},\bm{\theta})}d\bm{\pi}d\mathbf{x}$
(76)
$\displaystyle=\mathbb{E}_{#1}\Bigg{[}\sum_{k=1}^{K}P(y=k|\mathbf{x})\sum_{k=1}^{K}\mathbf{1}_{y=k}\int
p(\bm{\pi}|\hat{\bm{\alpha}})\log\frac{p(\bm{\pi}|\hat{\bm{\alpha}})}{p(\bm{\pi}|\mathbf{x},\bm{\theta})}d\bm{\pi}\Bigg{]}$
(77) Adding factor in log, collapsing double sum:
$\displaystyle=\mathbb{E}_{#1}\Bigg{[}\sum_{k=1}^{K}P(y=k|\mathbf{x})\int
p(\bm{\pi}|\hat{\bm{\alpha}})\log\Bigg{(}\frac{p(\bm{\pi}|\hat{\bm{\alpha}})\sum_{k=1}^{K}P(y=k|\mathbf{x})}{p(\bm{\pi}|\mathbf{x},\bm{\theta})\sum_{k=1}^{K}P(y=k|\mathbf{x})}\Bigg{)}d\bm{\pi}\Bigg{]}$
(78) Reordering, separating constant factor from log:
$\displaystyle=\mathbb{E}_{p(\mathbf{x})}\Bigg{[}\int\sum_{k=1}^{K}P(y=k|\mathbf{x})p(\bm{\pi}|\hat{\bm{\alpha}})\Bigg{(}\log\bigg{(}\frac{\sum_{k=1}^{K}P(y=k|\mathbf{x})p(\bm{\pi}|\hat{\bm{\alpha}})}{p(\bm{\pi}|\mathbf{x},\bm{\theta})}\bigg{)}$
(79)
$\displaystyle-\underbrace{\log\Big{(}\sum_{k=1}^{K}P(y=k|\mathbf{x})\Big{)}}_{=0}\Bigg{)}d\bm{\pi}\Bigg{]}$
(80)
$\displaystyle=\mathbb{E}_{#1}\Bigg{[}\text{KL}\bigg{[}\underbrace{\sum_{k=1}^{K}P(y=k|\mathbf{x})p(\bm{\pi}|\hat{\alpha})}_{\text{Mixture
of }K\text{
Dirichlets}}\Big{|}\Big{|}p(\bm{\pi}|\mathbf{x},\bm{\theta})\bigg{]}\Bigg{]}$
(81)

where we can see that this objective actually tries to minimizes the
divergence towards a mixture of $K$ Dirichlet distributions. In the case of
high data uncertainty, this is claimed incentivize the model to distribute
mass around each of the corners of the simplex, instead of the desired
behavior shown in Figure 4(c). Therefore, Malinin & Gales (2019) propose to
swap the order of arguments in the KL-divergence, resulting in the following:

$\displaystyle\quad\
\mathbb{E}_{#1}\bigg{[}\sum_{k=1}^{K}P(y=k|\mathbf{x})\cdot\text{KL}\Big{[}p(\bm{\pi}|\mathbf{x},\bm{\theta})\Big{|}\Big{|}p(\bm{\pi}|\hat{\bm{\alpha}})\Big{]}\bigg{]}$
(82)
$\displaystyle=\mathbb{E}_{#1}\bigg{[}\sum_{k=1}^{K}p(y=k|\mathbf{x})\cdot\int
p(\bm{\pi}|\mathbf{x},\bm{\theta})\log\frac{p(\bm{\pi}|\mathbf{x},\bm{\theta})}{p(\bm{\pi}|\hat{\bm{\alpha}})}d\bm{\pi}\bigg{]}$
(83) Reordering: $\displaystyle=\mathbb{E}_{#1}\bigg{[}\int
p(\bm{\pi}|\mathbf{x},\bm{\theta})\sum_{k=1}^{K}P(y=k|\mathbf{x})\log\frac{p(\bm{\pi}|\mathbf{x},\bm{\theta})}{p(\bm{\pi}|\hat{\bm{\alpha}})}d\bm{\pi}\bigg{]}$
(84)
$\displaystyle=\mathbb{E}_{#1}\Bigg{[}\mathbb{E}_{#1}\bigg{[}\sum_{k=1}^{K}P(y=k|\mathbf{x})\log
p(\bm{\pi}|\mathbf{x},\bm{\theta})-\sum_{k=1}^{K}P(y=k|\mathbf{x})\log
p(\bm{\pi}|\hat{\bm{\alpha}})\bigg{]}\bigg{]}$ (85)
$\displaystyle=\mathbb{E}_{#1}\Bigg{[}\int
p(\bm{\pi}|\mathbf{x},\bm{\theta})\bigg{(}\log\bigg{(}\prod_{k=1}^{K}p(\bm{\pi}|\mathbf{x},\bm{\theta})^{P(y=k|\mathbf{x})}\bigg{)}-\log\bigg{(}\prod_{k=1}^{K}p(\bm{\pi}|\hat{\bm{\alpha}})^{P(y=k|\mathbf{x})}\bigg{)}\bigg{)}d\bm{\pi}\Bigg{]}$
(86) $\displaystyle=\mathbb{E}_{p(\mathbf{x})}\Bigg{[}\int
p(\bm{\pi}|\mathbf{x},\bm{\theta})\bigg{(}\log\bigg{(}p(\bm{\pi}|\mathbf{x},\bm{\theta})^{\sum_{k=1}^{K}P(y=k|\mathbf{x})}\bigg{)}-\log\bigg{(}\prod_{k=1}^{K}\Big{(}\frac{1}{B(\bm{\alpha})}\prod_{k^{\prime}=1}^{K}\pi_{k^{\prime}}^{\alpha_{k^{\prime}}-1}\Big{)}^{p(y=k|\mathbf{x})}\bigg{)}\bigg{)}d\bm{\pi}\bigg{]}$
(87) $\displaystyle=\mathbb{E}_{#1}\Bigg{[}\int
p(\bm{\pi}|\mathbf{x},\bm{\theta})\bigg{(}\log\big{(}p(\bm{\pi}|\mathbf{x},\bm{\theta})\big{)}-\log\bigg{(}\prod_{k=1}^{K}\Big{(}\frac{1}{B(\bm{\alpha})}\prod_{k^{\prime}=1}^{K}\pi_{k^{\prime}}^{\alpha_{k^{\prime}}-1}\Big{)}^{P(y=k|\mathbf{x})}\bigg{)}d\bm{\pi}\Bigg{]}$
(88) $\displaystyle=\mathbb{E}_{#1}\Bigg{[}\int
p(\bm{\pi}|\mathbf{x},\bm{\theta})\bigg{(}\log\big{(}p(\bm{\pi}|\mathbf{x},\bm{\theta})\big{)}-\log\bigg{(}\frac{1}{B(\bm{\alpha})}\prod_{k^{\prime}=1}^{K}\pi_{k^{\prime}}^{\sum_{k=1}^{K}P(y=k|\mathbf{x})\alpha_{k^{\prime}}-1}\bigg{)}d\bm{\pi}\Bigg{]}$
(89)
$\displaystyle=\mathbb{E}_{#1}\Bigg{[}\text{KL}\Big{[}p(\bm{\pi}|\mathbf{x},\bm{\theta})||p(\bm{\pi}|\bar{\bm{\alpha}})\Big{]}\Bigg{]}\quad\text{where}\quad\bar{\bm{\alpha}}=\sum_{k=1}^{K}p(y=k|\mathbf{x})\alpha_{k^{\prime}}$
(90)

Therefore, instead of a mixture of Dirichlet distribution, we obtain a single
distribution whose _parameters are a mixture_ of the concentrations of each
class.

###  D.6 Uncertainty-aware Cross-Entropy Loss

The uncertainty-aware cross-entropy loss in Biloš et al. (2019); Charpentier
et al. (2020) has the form

$\mathcal{L}_{\text{UCE}}=\mathbb{E}_{#1}[\log
p(y|\bm{\pi})]=\mathbb{E}_{#1}[\log\pi_{y}]=\psi(\alpha_{y})-\psi(\alpha_{0})$
(91)

as $p(y|\bm{\pi})$ is given by the true label in form of a delta distribution,
we can apply the result from Section C.1.

###  D.7 Evidence-Lower Bound For Dirichlet Posterior Estimation

The evidence lower bound is a well-known objective to optimize the KL-
divergence between an approximate proposal and target distribution (Jordan et
al., 1999; Kingma & Welling, 2014). We derive it based on Chen et al. (2018)
in the following for the Dirichlet case with a proposal distribution
$p(\bm{\pi}|\mathbf{x},\bm{\theta})$ to the target distribution
$p(\bm{\pi}|y)$. For the first part of the derivation, we omit the dependence
on $\bm{\beta}$ for clarity.

$\displaystyle\text{KL}\big{[}p(\bm{\pi}|\mathbf{x},\bm{\theta})\big{|}\big{|}p(\bm{\pi}|y)\big{]}$
$\displaystyle=\mathbb{E}_{#1}\bigg{[}\log\frac{p(\bm{\pi}|\mathbf{x},\bm{\theta})}{p(\bm{\pi}|y)}\bigg{]}=\mathbb{E}_{#1}\bigg{[}\log\frac{p(\bm{\pi}|\mathbf{x},\bm{\theta})p(y)}{p(\bm{\pi},y)}\bigg{]}$
(92) Factorizing $p(\bm{\pi},y)=P(y|\bm{\pi})p(\bm{\pi})$, pulling out $p(y)$
as it doesn’t depend on $\pi$:
$\displaystyle=\mathbb{E}_{#1}\bigg{[}\log\frac{p(\bm{\pi}|\mathbf{x},\bm{\theta})}{P(y|\bm{\pi})p(\bm{\pi})}\bigg{]}+p(y)$
(93)
$\displaystyle=\mathbb{E}_{#1}\bigg{[}\log\frac{p(\bm{\pi}|\mathbf{x},\bm{\theta})}{p(\bm{\pi})}\bigg{]}-\mathbb{E}_{#1}\big{[}\log
P(y|\bm{\pi})\big{]}+p(y)$ (94)
$\displaystyle\leq\text{KL}\big{[}p(\bm{\pi}|\mathbf{x},\bm{\theta})\big{|}\big{|}p(\bm{\pi})\big{]}-\mathbb{E}_{#1}\big{[}\log
P(y|\bm{\pi})\big{]}$ (95)

Now note that the second part of the result is the uncertainty-aware cross-
entropy loss from Section D.6 and re-adding the dependence of $p(\pi)$ on
$\bm{\gamma}$, we can re-use our result regarding the KL-divergence between
two Dirichlets in Section C.3 and thus obtain:

$\displaystyle\mathcal{L}_{\text{ELBO}}$
$\displaystyle=\psi(\beta_{y})-\psi(\beta_{0})-\log\frac{B(\bm{\beta})}{B(\bm{\gamma})}+\sum_{k=1}^{K}(\beta_{k}-\gamma_{k})\big{(}\psi(\beta_{k})-\psi(\beta_{0})\big{)}$
(96)

which is exactly the solution obtained by both Chen et al. (2018) and Joo et
al. (2020).

##  Appendix E Overview over Loss Functions Appendix

In Tables 6 and 7, we compare the forms of the loss function used by
Evidential Deep Learning methods for classification, using the consistent
notation from the paper. Most of the presented results can be found in the
previous Appendix C and Appendix D. We refer to the original work for details
about the objective of Nandy et al. (2020).

Table 6: Overview over objectives used by prior networks for classification.

Method | Loss function | Regularizer | Comment
---|---|---|---
Prior networks (Malinin & Gales, 2018) | $\log\frac{B(\hat{\bm{\alpha}})}{B(\bm{\alpha})}+\sum_{k=1}^{K}(\alpha_{k}-\hat{\alpha}_{k})\big{(}\psi(\alpha_{k})-\psi(\alpha_{0})\big{)}$ | $-\log\frac{\Gamma(K)}{B(\bm{\alpha})}+\sum_{k=1}^{K}(\alpha_{k}-1)(\psi(\alpha_{k})-\psi(\alpha_{0}))$ |  Target concentration parameters $\hat{\bm{\alpha}}$ are created using a label smoothing approach, i.e. $\hat{\pi}_{k}=\begin{cases}1-(K-1)\varepsilon&\quad\text{if }y=k\\\ \varepsilon&\quad\text{if }y\neq k\end{cases}$. Together with setting $\hat{\alpha}_{0}$ as a hyperparameter, $\hat{\alpha_{k}}=\hat{\pi_{k}}\hat{\alpha_{0}}$
Prior networks (Malinin & Gales, 2019) | $\log\frac{B(\hat{\bm{\alpha}})}{B(\bm{\alpha})}+\sum_{k=1}^{K}(\alpha_{k}-\hat{\alpha}_{k})\big{(}\psi(\alpha_{k})-\psi(\alpha_{0})\big{)}$ | $\log\frac{B(\bar{\bm{\alpha}})}{B(\bm{\alpha})}+\sum_{k=1}^{K}(\alpha_{k}-\bar{\alpha}_{k})\big{(}\psi(\alpha_{k})-\psi(\alpha_{0})\big{)}$ |  Similar to above, $\hat{\alpha}_{c}^{(k)}=\mathbf{1}_{c=k}\alpha_{\text{in}}+1$ for in-distribution and $\bar{\alpha}_{c}^{(k)}=\mathbf{1}_{c=k}\alpha_{\text{out}}+1$ where we have hyperparameters set to $\alpha_{\text{in}}=0.01$ and $\alpha_{\text{out}}=0$. Then finally, $\hat{\bm{\alpha}}=\sum_{k=1}^{K}p(y=k|\mathbf{x})\hat{\alpha}_{k}$ and $\bar{\bm{\alpha}}=\sum_{k=1}^{K}p(y=k|\mathbf{x})\bar{\alpha}_{k}$.
Information Robust Dirichlet Networks (Tsiligkaridis, 2019) | $\bigg{(}\frac{\Gamma(\alpha_{0})}{\Gamma(\alpha_{0}+p)}\bigg{)}^{\frac{1}{p}}\bBigg@{4}(\frac{\Gamma\Big{(}\sum_{k\neq y}\alpha_{k}+p\Big{)}}{\Gamma\Big{(}\sum_{k\neq y}\alpha_{k}\Big{)}}+\sum_{k\neq y}\frac{\Gamma(\alpha_{k}+p)}{\Gamma(\alpha_{k})}\bBigg@{4})^{\frac{1}{p}}$ | $\frac{1}{2}\sum_{k\neq y}(\alpha_{k}-1)^{2}(\psi^{(1)}(\alpha_{k})-\psi^{(1)})(\alpha_{0}))$ |  $\psi^{(1)}$ is the polygamma function defined as $\psi^{(1)}(x)=\frac{d}{dx}\psi(x)$.
Dirichlet via Function Decomposition (Biloš et al., 2019) | $\psi(\alpha_{y})-\psi(\alpha_{0})$ | $\lambda_{1}\int_{0}^{T}\pi_{k}(\tau)^{2}d\tau+\lambda_{2}\int_{0}^{T}(\nu-\sigma^{2}(\tau))^{2}d\tau$ |  Factors $\lambda_{1}$ and $\lambda_{2}$ that are treated as hyperparameters that weigh first term pushing the for logit $k$ to zero, while pushing the variance in the first term to $\nu$.
Prior network with PAC Reg. (Haussmann et al., 2019) | $-\log\mathbb{E}_{#1}\bigg{[}\prod_{k=1}^{K}\bigg{(}\frac{\alpha_{k}}{\alpha_{0}}\bigg{)}^{\mathbf{1}_{k=y}}\bigg{]}$ | $\sqrt{\frac{\text{KL}\big{[}p(\bm{\pi}|\bm{\alpha})\big{|}\big{|}p(\bm{\pi}|\mathbf{1})\big{]}-\log\delta}{N}-1}$ |  The expectation in the loss function is evaluated using parameter samples from a weight distribution. $\delta\in[0,1]$.
Ensemble Distribution Distillation (Malinin et al., 2020b) |  $\psi(\alpha_{0})-\sum_{k=1}^{K}\psi(\alpha_{k})+\frac{1}{M}\sum_{m=1}^{M}\sum_{k=1}^{K}(\alpha_{k}-1)$ $\log p(y=k|\mathbf{x},\bm{\theta}^{(m)})$ | - |  The objective uses predictions from a trained ensemble with parameters $\bm{\theta}_{1},\ldots,\bm{\theta}_{M}$.
Prior networks with representation gap (Nandy et al., 2020) | $-\log\pi_{y}-\frac{\lambda_{\text{in}}}{K}\sum_{k=1}^{K}\sigma(\alpha_{k})$ | $-\sum_{k=1}\frac{1}{K}\log\pi_{k}-\frac{\lambda_{\text{out}}}{K}\sum_{k=1}^{K}\sigma(\alpha_{k})$ |  The main objective is being optimized on in-distribution, the regularizer on out-of-distribution data. $\lambda_{\text{in}}$ and $\lambda_{\text{out}}$ weighing terms and $\sigma$ denotes the sigmoid function.
Prior RNN (Shen et al., 2020) | $\sum_{k=1}\mathbf{1}_{k=y}\log\pi_{k}$ | $-\log B(\tilde{\bm{\alpha})}+(\hat{\alpha}_{0}-K)\psi(\hat{\alpha}_{0})-\sum_{k=1}^{K}(\hat{\alpha}_{k}-1)\psi(\hat{\alpha}_{k})$ |  Here, the entropy regularizer operates on a scaled version of the concentration parameters $\tilde{\bm{\alpha}}=(\mathbf{I}_{K}-\mathbf{W})\bm{\alpha}$, where $\mathbf{W}$ is learned.
Graph-based Kernel Dirichlet dist. est. (GKDE) (Zhao et al., 2020) | $\sum_{k=1}^{K}\Big{(}\mathbf{1}_{y=k}-\frac{\alpha_{k}}{\alpha_{0}}\Big{)}^{2}+\frac{\alpha_{k}(\alpha_{0}-\alpha_{k})}{\alpha_{0}^{2}(\alpha_{0}+1)}$ | $-\log\frac{B(\bm{\alpha})}{B(\hat{\bm{\alpha}})}+\sum_{k=1}^{K}(\alpha_{k}-\hat{\alpha}_{k})\big{(}\psi(\alpha_{k})-\psi(\alpha_{0})\big{)}$ |  $\hat{\bm{\alpha}}$ here corresponds to a uniform prior including some information about the local graph structure. The authors also use an additional knowledge distillation objective, which was omitted here since it doesn’t related to the Dirichlet.

Table 7: Overview over objectives used by posterior networks for
classification.

Method | Loss function | Regularizer | Comment
---|---|---|---
Evidential Deep Learning (Sensoy et al., 2018) | $\sum_{k=1}^{K}\Big{(}\mathbf{1}_{y=k}-\frac{\beta_{k}}{\beta_{0}}\Big{)}^{2}+\frac{\beta_{k}(\beta_{0}-\beta_{k})}{\beta_{0}^{2}(\beta_{0}+1)}$ | $-\log\frac{\Gamma(K)}{B(\bm{\beta})}+\sum_{k=1}^{K}(\beta_{k}-1)(\psi(\beta_{k})-\psi(\beta_{0}))$ |
Variational Dirichlet (Chen et al., 2018) | $\psi(\beta_{y})-\psi(\beta_{0})$ | $-\log\frac{B(\bm{\beta})}{B(\bm{\gamma})}+\sum_{k=1}^{K}(\beta_{k}-\gamma_{k})\big{(}\psi(\beta_{k})-\psi(\beta_{0})\big{)}$ |
Regularized ENN Zhao et al. (2019) | $\sum_{k=1}^{K}\Big{(}\mathbf{1}_{y=k}-\frac{\beta_{k}}{\beta_{0}}\Big{)}^{2}+\frac{\beta_{k}(\beta_{0}-\beta_{k})}{\beta_{0}^{2}(\beta_{0}+1)}$ | $-\lambda_{1}\mathbb{E}_{#1}\Big{[}\frac{\alpha_{y}}{\alpha_{0}}\Big{]}-\lambda_{2}\mathbb{E}_{#1}\Bigg{[}\sum_{k=1}^{K}\bigg{(}\frac{\beta_{k}\sum_{k^{\prime}\neq k}\beta_{k^{\prime}}\big{(}1-\frac{|\beta_{k^{\prime}}-\beta_{k}|}{\beta_{k^{\prime}}+\beta_{k}}\big{)}}{\sum_{k^{\prime}\neq k}\beta_{k^{\prime}}}\bigg{)}\Bigg{]}$ |  The first term represents _vacuity_ , i.e. the lack of evidence and is optimized using OOD examples. The second term stands for _dissonance_ , and is computed using points with neighborhoods with different classes from their own. $\lambda_{1},\lambda_{2}$ are hyperparameters.
WGAN–ENN (Hu et al., 2021) | $\sum_{k=1}^{K}\Big{(}\mathbf{1}_{y=k}-\frac{\beta_{k}}{\beta_{0}}\Big{)}^{2}+\frac{\beta_{k}(\beta_{0}-\beta_{k})}{\beta_{0}^{2}(\beta_{0}+1)}$ | $-\lambda\mathbb{E}_{#1}\Big{[}\frac{\alpha_{y}}{\alpha_{0}}\Big{]}$ |
Belief Matching (Joo et al., 2020) | $\psi(\beta_{y})-\psi(\beta_{0})$ | $-\log\frac{B(\bm{\beta})}{B(\bm{\gamma})}+\sum_{k=1}^{K}(\beta_{k}-\gamma_{k})\big{(}\psi(\beta_{k})-\psi(\beta_{0})\big{)}$ |
Posterior networks (Charpentier et al., 2020) | $\psi(\beta_{y})-\psi(\beta_{0})$ | $-\log B(\bm{\beta})+(\beta_{0}-K)\psi(\beta_{0})-\sum_{k=1}^{K}(\beta_{k}-1)\psi(\beta_{k})$ |
Graph Posterior Networks (Stadler et al., 2021) | $\psi(\beta_{y})-\psi(\beta_{0})$ | $-\log B(\bm{\beta})+(\beta_{0}-K)\psi(\beta_{0})-\sum_{k=1}^{K}(\beta_{k}-1)\psi(\beta_{k})$ |
Generative Evidential Neural Network (Sensoy et al., 2020) | $-\sum_{k=1}^{K}\bigg{(}\mathbb{E}_{#1}\big{[}\log(\sigma(f_{\bm{\theta}}(\mathbf{x})))\big{]}+\mathbb{E}_{#1}\big{[}\log(1-\sigma(f_{\bm{\theta}}(\mathbf{x})))\big{]}\bigg{)}$ | $-\log\frac{\Gamma(K)}{B(\bm{\beta}_{-y})}+\sum_{k\neq y}(\beta_{k}-1)(\psi(\beta_{k})-\psi(\beta_{0}))$ |  The main loss is a discriminative loss using ID and OOD samples, generated by a VAE. The regularizer is taken over all classes _excluding_ the true class $y$ (also indicated by $\bm{\beta}_{-y}$).