Calibration Regularized Training of Deep Neural Networks using Kernel Density Estimation
Authors: Teodora Popordanoska
Raphael Sayer
Matthew B. Blaschko
Venue: ICLR 2022 Submitted (2022)
Keywords: calibration
dirichlet kernel density estimation

Abstract: Calibrated probabilistic classifiers are models whose predicted probabilities can directly be interpreted as uncertainty estimates. This property is particularly important in safety-critical applications such as medical diagnosis or autonomous driving. However, it has been shown recently that deep neural networks are poorly calibrated and tend to output overconfident predictions. As a remedy, we propose a trainable calibration error estimator based on Dirichlet kernel density estimates, which asymptotically converges to the true Lp calibration error. This novel estimator enables us to achieve the strongest notion of multiclass calibration, called canonical calibration, while other common calibration methods only allow for top-label and marginal calibration. The empirical results show that our estimator is competitive with the state-of-the-art, consistently yielding tradeoffs between calibration error and accuracy that are (near) Pareto optimal across a range of network architectures.  The computational complexity of our estimator is O(n^2), matching that of the kernel maximum mean discrepancy, used in a previously considered trainable calibration estimator. By contrast, the proposed method has a natural choice of kernel, and can be used to generate consistent estimates of other quantities based on conditional expectation, such as the sharpness of an estimator.

Under review as a conference paper at ICLR 2022
CALIBRATION REGULARIZED TRAINING OF DEEP NEURAL NETWORKS USING DIRICHLET KERNEL DENSITY ESTIMATION
Anonymous authors Paper under double-bling review
ABSTRACT
Calibrated probabilistic classifiers are models whose predicted probabilities can directly be interpreted as uncertainty estimates. This property is particularly im- portant safety-critical applications such as medical diagnosis or autonomous driving. However, it has been shown recently that deep neural networks calibrated and tend to output overconfident predictions. As a remedy, we propose trainable calibration error estimator based Dirichlet kernel density estimates, which asymptotically converges to the true Lp calibration error. This novel esti- mator enables
poorly
achieve the strongest notion of multiclass calibration, called canonical calibration, while other common calibration methods only allow for top- label and marginal calibration. The empirical results show that our estimator is competitive with the state-of-ther of-the--rt aate consistently yielding tradeoffss between cali- bration error and accuracy that are (near) Pareto optimal across range of network architectures. The computational complexity of our estimator is (nn)), matching that of the kernel maximum mean discrepancy, used trainable calibration estimator (Kumar et al.) 2018). By contrast, the proposed method has a natural choice of kernel, and can be used to generate consistent esti- mates of other quantities based conditional expectation, such as the sharpness an estimator.
previously considered
INTRODUCTION
Deep neural networks have shown tremendous success in classification tasks, being regularly the best performing models in terms of accuracy. However, they are also known to make overconfident predictions (Guo et al. 2017), which is particularly problematic in safety-critical applications such as medical diagnosis or autonomous driving. Therefore, in many real world applications we do not just care about the predictive performance, but also about the trustworthiness of that prediction, that is, we are interested in accurate predictions with robust uncertainty estimates. To this end, we want our models be uncertainty calibrated which means that, for instance, among all cells that have been predicted with a probability of 0.8 to be cancerous, in fact fraction of 80 % belong to malignant tumor.
Being calibrated, however, does not imply that the classifier achieves good accuracy. For instance, classifier that always predicts the marginal distribution of the target class calibrated, but will not be very useful in practice. Likewise, good predictive performance does not ensure calibration. In particular, for a broad class of loss functions, risk minimization leads to asymptotically Bayes optimal classifiers (Bartlett et al.] 2006). However, there is no guarantee that they are calibrated, even the aysmptotic limit. Therefore, we consider minimizing the risk plus term that penalizes miscalibration, i.c., Risk + CalibrationError. For parameter values À 0, this will push the classifier towards a calibrated model, while maintaining similar accuracy. The existence of such a
0 is suggested by the fact that there always exists at least one Bayes optimal classifier that is calibrated, namely P)(y|z).
To optimize the risk and the calibration error jointly, we propose differentiable and consistent esti- mator of the expected Lp calibration error based on kernel density estimates (KDEs). In particular, Beta kernel in binary classification tasks and Dirichlet kernel in the multiclass setting.

---

Under review as a conference paper at ICLR 2022
as these kernels are the natural choices to model density estimation over a probability simplex. Our Dirichlet kernel based estimator allows for the estimation of canonical calibration, which is the strongest notion of multiclass calibration as it implies the calibration of the whole probability vector (Bröcker) 2009; Appice et al., 2015, Vaicenavicius et al. 2019). By contrast, most other state-of- the-art methods only achieve weaker versions of multiclass lass calibration, namely top-label (Guo al.) 2017) and marginal or class-wise calibration (Kull et al. 2019). The top-label calibration only con- siders the scores for the predictied class, while for marginal calibration the multiclass problem is split up into K one-vs-all binary ones, each of which is required to be calibrated according to the definition of binary calibration. In many applications marginal and canonical calibration are prefer- able to top-label calibration, since we often care about having reliable uncertainty estimates for more than just one class per prediction. For instance, in medical diagnosis we do not just care about the most likely disease certain patient might have but also about the probabilities of other diseases.
Our contributions can be summarized as follows:
1. We develop trainable calibration error objective using Dirichlet kernel density estimates, which can be minimized alongside any loss function the existing batch stochastic gradi- ent descent framework.
2. We propose to use our estimator to evaluate canonical calibration. Due to the scaling properties of Dirichlet kernel density estimation, and the tendency for probabilities to be concentrated in a relatively small number of classes, this becomes feasible in cases that cannot be estimated using a binned estimator.
3. We show on variety of network architectures and two datasets that DNNs trained along- side an estimator of the calibration error achieve competitive results both on existing met- rics and on the proposed measure of canonical calibration.
2 RELATED WORK
Calibration of probabilistic predictors has long been studied in many fields. This topic gained at- tention in the deep learning community following the observation in Guo al. (2017) that modern neural networks are poorly calibrated and tend to give overconfident predictions due to overfitting on the NLL loss. The surge of interest resulted in many calibration strategies that can be split in two general categories, which we discuss subsequently. Post-hoc calibration strategies learn a calibra- tion map of the predictions from trained predictor in a post-hoc manner. For instance, Platt scaling (Platt 1999) fits a logistic regression model on top of the logit outputs of the model. A special case of Platt scaling that fits single scalar, called temperature, has been popularized by Guo et al. (2017) as an eecuracy-preserve
easy to implement and effective method to improve calibration. However, has the undesired consequence that clamps the high confidence scores of accurate pre- dictions (Kumar et al., 2018). Other approaches for post-hoc calibration include: histogram binning (Zarrozyy & Elkan 2001), isotonic regression (Zadrozny & Elkan 2002), and Bayesian binning into quantiles (Nacini & Cooper 2015). Trainable calibration strategies integrate differentiable calibration measure into the training objective. One of the carliest approaches is regularization by penalizing low entropy predictions (Pereyra et al., 2017). Similarly temperature scaling, it has been shown that entropy regularization needlessly suppresses high confidence scores of correct pre- dictions (Kumar al. (2018). Another popular strategy is MMCE (Maxmimum Mcan Calibration Error) (Kumar et al. 2018)) where the entropy regularizer is replaced by kernel-based surrogate for the calibration error that can be optimized alongside NLL. It has been shown that label smoothing (Szegedy et al.) 2015 Müller et al. 2020), i.e. training models with a weighted mixture of the labels instead of hot vectors, also improves model calibration. [Liang et al. (2020) propose to add the difference between predicted confidence and accuracy as auxiliary term to the cross-entropy loss. Focal loss (Mukhoti et al., 20200 Lin et al. 2018) has recently been empirically shown to produce better calibrated models than many of the alternatives, but does not estimate clear quantity related to calibration error.
Kernel density estimation (Parzen 1962 Rosenblau 1956) is parammeraetic method to estimate
a probability density function from a finite sample. Zhang et al. (2200) propose a KDE- estima- tor of the calibration emror for measuring calibration performance. However, they use the triweight kernel, which has a limited support interval and is therefore applicable to binary classification, but does not have natural extension higher dimensional simplexes, in contrast the Dirichlet kernel
2

---

Under review as a conference paper at ICLR 2022
that we consider here. As result, they consider unnatural proxy to marginal calibration error, which does not result in a consistent estimator.
METHODS
The most commonly used loss functions are designed achieve consistency in the sense of Bayes optimality under risk minimization, however, they do not guarantee calibration neither for finite samples nor in the asymptotic limit. Since we interested in models / that are both accurate and calibrated, we consider the following optimization problem bounding the calibration error CE(f):
= arg min (fs, s.t. CE()) S B fEF
(1)
for some B > 0, and its associated Lagrangian
f arg JEF
arg min
[Rik(()) + X CE(S)).
(2)
We measure the (mis-)calibration in terms of the Lp calibration error. To this end, let (2, A, P)
be a probability space, let X' = R . = {0, 1... K.. K}. Let x : Ω - X and y : Ω + y be
random variables while realizations are denoted with subscripts. Furthermore, let f X - A k be a decision function, where A denotes the K dimensional simplex as is achieved e.g. from the output of final softmax layer in neural network.
Definition 3.1 (Calibration error, (Nacini et al. 2015 Kumar et al. 2019 Wenger et al. 2020 The Lp calibration error of is:
CEp(1) = E [B|| (1
[(x)] ((0))) ;
We note that we consider multielass calibration, and that f(x)) and the conditional expectation in Equation 3 therefore map to points on probability simplex. We say that a classifier / is perfectly Kumar al. (2018) have also considered minimization problem similar to Equation 2 Instead of using the CE,, they use a metric called maximum mean calibration error (MMCE) that 0 if and only if CIEp- = O. However, is unclear how MMCE relates the canonical multiclass setting or to the norm parameter for non-zero CEp.
calibrated if CEE, (f)
In order to optimize Definition 3.1 directly, we need perform density estimation over the prob- ability simplex in order to empirically compute the conditional expectation. In binary setting, this has traditionally been done with binned estimates (Naeini et al. 2015) Guo al. 2017 Kumar et al. 2019). However, this is not differentiable w.r.t. the function J. and cannot be incorporated into a gradient based training procedure. Furthermore, binned estimates suffer from the curse of dimensionality and do not have practical extension to multiclass settings. A natural choice for differentiable kernel density estimator in the binary case is a kernel based on the Beta distribution and the extension to the multiclass case is given by the Dirichlet distribution. Hence, consider an estimator for the CEp based on Beta and Dirichlet kernel density estimates in the binary and multiclass setting, respectively. We require that this estimator is consistent and differentiable such This estimator is given by:
that we can train it according to Equation 2
CE
= va Σ
1
BE [(x)) ((mm) ((wa))
where Ely f(x)]]
denotes Ely f()) evaluated at f(x) = f(xn). If PA, has a probability
f(x)
density Px, with respect to the product of the Lebesgue and counting measure, we can define: Pz.n (1t, vi) = Pulz=z, (yi) Pa (2x). Then we define the estimator of the conditional expectation as
follows:
Eyier (f(())
Uk Pa.y (f(z). v6)
Ely [f(x))= = Σ yk Pyle= Po)o=
(5)
Σ - k(f(x); f(z))) Ely f(z)
(6)
E
k(f(x); f(x))
where l is the kernel of kernel density estimate evaluated point 2;-
3

---

Under review as a conference paper at ICLR 2022
Proposition 3.2. Ely [x)) is a pointwise consistent estimator of Ely [())], that is:
lim En k(f(z); EmEy Uk Pz,y (f()),
D {(J(z):((.))
Pr (f()))
Proof. By the consistency of kernel density estimators (Silverman 1986 Chen 1999.
Ouimet
& Tolosaaa-Deelgdoo 2021). for all ((x)
(0, Ei= K (x); (x))))
Eney (f()) ya) and v Σ ((x)) ~0 p=(J(x)). The fact that the ratio of two convergent sequences converges against the ratio of their limits shows the result.
Mean squared error in binary classification As first instantiation of our framework we con- sider binary classification setting. with the mean squared error MSE(f) = [f((() - y) as the risk function, jointly optimized with the L2 calibration error CE2. Following Murphy (1973: De-
groot & Fienberg (1983); Kuleshov & Liang (2015): Nguyen & O'Connor (2155) we decompose (full derivation Appendix Ab the MSE as:
MSE(F) CE2 =E(11 (1-1b) Ely f(x))) Bly f(x)] 2 0.
(8)
Similar to Equation
we consider the optimization problem for some À > 0:
f arg min JEF
MSS(S)+ ACCA())))))
Using Equation 8 we rewrite:
MSE()) + ACE2 =(1 + MSE(S) 2 (MSE(F) - (F)
(10)
=(1+ ((L+A) A) AE (1- (1~ [(x)) Bly f()))
(11)
Rescaling Equation 11
by a factor of (1 + A) and a variable substitution y i E 10,1)
MSE(F) - - ( (1-Ely Ely [f())) Ely f())]
f -arg min fEF
MSE(F)) CEE2(f)) arg min
fEF
(12)
MSE(J) + +E Ely {()))))
arggmnn min FEF
(13)
For optimization we wish to find an estimator for E[E f(x)]²). Building upon Equation 6 partially debiased estimator can be written as
(Eien k(f(za):
Eisn (k(((zn);
E Bly f(x))2
(14)
(Eien k(f(z)) f(x))) Eifa (
h=1
In binary setting, the kernels k(.,-) are Beta distributions, i.e. denoting 2; := fx;; for short, then:
kBeeta (2, 23) a0 20 2) [(a; + (.)
(15)
I(a.) I'(3)'
with 3o +1 and B; 1- Chen 1999 Bouezmarni & Rolin 2003 Zhang & Karunamuni 2010), where a bandwidth parameter in the kernel density estimate that goes to O as n - cc. We note that the computational complexity of this estimator is O(z²). Within the gradient descent training procedure, the density is estimated using a mini-bateh and therefore the O(n)) complexity w.r.t. mini-batch, not the entire dataset.
The estimator in Equation 14 is a ratio of two second order U-statistics that converge as n -1/2 [erguson 2005). Therefore, the overall convergence will be n -1/2, Empirical covergence rates are calculated Appendix D.3 and shown to be close to the theoretically expected value.
Wee have debiased the numerator and denominator individually (Ferguson 2005 plicity have corrected for the fact that we are estimating ratio (Scott & Wu 1981
Section 2), but for sim-
4

---

Under review as a conference paper at ICLR 2022
Multiclass calibration with Dirichlet kernel density estimates There multiple definitions regarding multiclass calibration that differ in the strictness regarding the calibration of the proba- bility vector f(x). The weakest notion is top label calibration, which, the name suggests, only cares about calibrating the entry with the highest predicted probability, which reduces to binary calibration problem again (Guo al., 2017). Marginal or class-wise calibration (Kull et al.) 2019) is the most commonly used definition of multiclass calibration and stronger version of top label calibration. Here, the problem split into K one-vs-all binary calibration setting, such that each class has to be calibrated against the other K 1 classes:
K
MCE,(f)
=
E
B = f(())) f(())a
(16)
An estimator for this calibration error is:
Eies BBet (x)))x f (ay)) Eips BBaa (f (z))a: R5 (xx)))
(17)
k=1
J=1
The strongest notion of multiclass calibration, and the that we want to consider in this paper, is called canonical calibration (Bröcker) 2009) Appice et al. 2015 Vaicenavicius et al.) (019). Here it is required that the whole probability vector [(xx) calibrated. The definition is exactly the one Its estimator is:
from Definition 3.1
CE,(F) _ Σ
Eie ADi (f f(a,)
(18)
Eiss &Di (f(z)); f(xi)
where kDi a Dirichlet kernel defined as:
(2, 21)
r 1=1 T== [(as)
0:)
K
2
ap--
(19)
with a; a;= = 2i/h (Ouimet Golosana-Delgadde 2021 As before, the computational complexity is On²²) irrespective of p.
This estimator is differentiable and furthermore, the following proposition holds:
Proposition 3.3. The Dirichlet kernel based CE estimator is consistent, that
(f(x) f(zz)
Ely f(x)] f(x)) | (20)
lim 11000
iボj kDi ( f(x)))
Proof. Dirichlet kernel estimators are consistent (Ouimet & Golosana-Delgadon 2021). conse- quently, by Proposition 3.2 the term inside the norm is consistent for any fixed / (æz) (note, that summing over # j ensures that the ratio of the KDE's does not depend on the outer summation). Moreover, for any convergent sequence also the norm of that sequence converges against the norm of its limit. Ultimately, the outer sum is merely the sample mean of consistent summands, which again is consistent.
EMPIRICAL SETUP
We trained ResNet (He et al. 2015). ResNet with stochastic depth (SD) (Huang et al. 2016),
DenseNet (Huang al., 2018) and WideResNet (Zagoruyko & Komodakis (016) networks on CIFAR-10 and CIFAR- 100 (Krizhevsky 2009). We use 45000 images for training. The code will be released upon acceptance.
Baselines Cross-entropy: The first baseline model trained using cross-entropy with the data preprocessing, training procedure and hyperparameters described in the corresponding paper for the architecture. Trainable calibration strategies MMCE (Kumar et al. 2018 is a differentiable measure of calibration with property that it is minimized at perfect calibration. It is used as a regulariser alongside NLL, with the strength of regularization parameterized by A. Focal loss Mukhoti et al. 2020) is an alternative the popular cross-entropy loss, defined L, -(1
5

---

Under review as a conference paper at ICLR 2022
f(y log(f(ylz)), where is hyperparameter and f(y(=) is the probability score that neural network f outputs for a class y on an imput z. Their best-performing approach is the sample- dependent FL-53 where y 5 for f(y(x)) E [0, 0.2) and 3 otherwise, followed by the method with fixed 7 = 3. Post-hoc calibration strategies Guo et al. (2117) investigated the performance of several post-hoc calibration methods and found temperature scaling be a strong baseline, which we use as representative of this group. It works by scaling the logits with a scalar T > O, typically learned on a validation set by minimizing NLL. Following Kumar et al. (2018); Mukhoti et al. 2020), we also use temperature scaling as post- post-processing step for our method.
Metrics The most widely-used metric for expected calibration error (ECE) is a binned estimator (Nacini et al., 2015). which divides the interval [0, 1] into bins of equal width and then calculates a weighted average of the absolute difference between accuracy and confidence for each bin. A better binning scheme involves determining the bin sizes so that an equal number of samples fall into each bin (Nguyen & O' O'Connor, 2015 Mukhoti et al. 2020). We report the ECE (%) with 15 bins calculated according the latter, so-called adaptive binning procedure. We compute the 95% confidence intervals using 100 bootstrap samples as in Kumar et al. (2019). We consider multiple versions of the ECE metric based on the Lp norm and the type of calibration (top-label, marginal, canonical). Top-label calibration error only considers the probability of the predicted class, marginal requires per-class calibration and the canonical is the highest form of calibration which requires the entire probability vector to be calibrated. We report L1 and L2 ECE in the marginal and canonical case. Additional experiments with top-label and marginal calibration on both CIFAR-10 10 and CIFAR- 100 can be found in Appendix B
Hyperparameters A crucial parameter for KDE is the bandwidth, positive number that defines the smoothness of the density plot. Poorly chosen bandwidth may lead to undersmoothing (small bandwidth) oversmoothing (large bandwidth). A commonly used non- non-parametric bandwidth lector is maximum likelihood cross validation (Duin 1976.. For our experiments we choose the bandwidth from list of possible values by maximizing the leave-one-out likelihood. The À param- eter for weighting the calibration error w.r.t the loss is typically chosen via cross-validation or using holdout validation set. The p parameter is chosen depending on the desired Lp calibration error and the corresponding theoretical guarantees.
5 RESULTS AND DISCUSSION
5.1 BINARY CLASSIFICATION
We construct binary experiment by splitting the CIFAR-10 classes into 2 classes: vehicles (plane, automobile, ship, truck) and animals (bird, cat, deer, dog, frog, horse). Figure Ta shows how the choice of the bandwidth parameter influences the shape of the estimate.
0.040
KB5-VE
KOE
8.005
HSE
Fistagee an flom Iumpiia
6.1
51011
80005
18.4
6/80
0.37
MS2
(a) Effect of the bandwidth b
(b) Effect of
Figure 1: Calibration regularized training using MSE loss and CF22
Figure lb shows the effect of the regularization parameter on the performance of ResNet-110 model. The orange point represents a model trained with MSE loss, and the blue points IKDE-MSB correspond to models trained with regularized MSE loss by L2 calibration enror for different values of y. As expected, the calibration regularized training decreases the L2 calibration error at the cost of slightly increased error.

---

Under review as a conference paper at ICLR 2022
5.2 EVALUATING CANONICAL CALIBRATION
Accurately evaluating the calibration error is another crucial step towards designing trustworthy models that can be used in high-cost settings. In spite of its numerous flaws discussed in Vaicenavi- cius et al. (2019) Ding al. (2020) Ashukha et al. 202T. such its sensitivity the binning scheme, the histogram-based estimator remains the most widely used metric for evaluating miscal- ibration. Another downside of the binned estimator its inability capture canonical calibration due to the curse of dimensionality, as the number of bins grows exponentially with the number of classes. Therefore, because of its favourable scaling properties, we propose using our Dirichlet kernel density estimate as an alternative metric (KDE-ECK to measure calibration.
To investigate its relationship with the commonly used binned estimator, we first introduce an exten- sion of the top-label binned estimator the probability simplex the three class setting. We start by partitioning the probability simplex into equally-sized, triangle-shaped bins and assign the prob- ability scores the corresponding bin, as shown Figure Then, we define the binned estimate of canonical calibration error as follows:
CFP = [IHT((()) - S(>1
((((=))) [
(21)
where Hxx())) is the histogram estimate, shown in Figure 2b The surface of the corresponding Dirichlet KDE is presented in Figure 2c In Figure 3 we show that the KDE-ECE estimates of the three types calibration closely correspond to the their histogram- based approximations. Each point in the plot represents ResNet-56 model trained on a different subset of three classes from CIFAR-10. See Appendix C for another example of the binned estimator and Dirichlet KDE on CIFAR-10 10 and an experiment with varying number of points used for the density estimation.
(a) Splitting the simplex in 16 bins
(b) Histogram
(c) Dirichlet KDE
Extension of the binned estimator the probability simplex, compared with the KDE- ECE. The KDE-ECE achieves a better approximation to the finite sample, and accurately models fact that samples tend to be concentrated near low dimensional faces the simplex.
Figure 2:
E.A
1.50
sox
12a
tae urde caa ucn. 3191 10o 41/6 E22
0222
013
1M
200 5m1
0.20
0101 5.0 3.
(a) Canonical
(b) Marginal
Top-label
Figure 3: Relationship between the KDE- estimates and their corresponding binned approxima- tions on the three types calibration. Each point represents ResNet-56 model trained on a subset of three classes from CIFAR-10. The 3000 probability scores of the test set are assigned in 25 bins with adaptive width for the binned estimate. A bandwidth of 0.001 is used for KDE-ECE.

---

Under review as a conference paper at ICLR 2022
5.3 MULTICLASS CLASSIHICATION
In this section we evaluate our proposed KDE-based ECE estimator that jointly trained with cross entropy loss (KDE-CRE) against other baselines in multiclass setting on CIFAR-10 and CIFAR-100. We found that for KDE-CRE, values of X E [0.01, 0.1] provide good trade-off in terms of accuracy and calibration error. Table ! summarizes the accuracy and marginal 1,1 HCE% (computed using 15 bins), measured across multiple architectures. For MMCE, we report the results with À = and for KDE-CRE we use X = 0.01. An analogous table measuring marginal L2 ECE given Appendix B
Table 1: Accuracy and marginal L1 ECE (%) computed with 15 bins for different loss functions and architectures, both trained from scratch (Pre T) and after temperature scaling on a validation set (Post T). Best results are marked in bold.
CIFAR-10
CIFAR-100
Loss
Metric
ResNet
ResNet (SD)
Wide-ResNet
DenseNet
ResNet
ResNet (SD)
Wide-ResNel
DenseNet
HCE
Pre T Post
0.119
0.357
0.241
0,236
0.165
0.114
0,129
0,100
0.086
0.105
0,090
CRE
Pre T
0.925
0.926
0.957
0.947
0,700
0.728
0,803
0.756
Acc
Past T
0.927
0,925
0,957
0.947
0.700
0.729
0.801
0.758
ECE
Pre
0.250
0.390
0.265
0,193
0.143
0.100
0.120
0.123
MMCE
Post T
0,361
0,308
0.911
0.235
0.121
0.083
0.109
0.124
Pre
0.925
0.944
0.693
0.748
Acc
Post T
0.926
0.926
0.949
0.945
0.691
0.722
0,770
0.743
Pre
0,103
0.259
0.145
FL-53
Post T
0.272
0.267
0.437
0.220
0.124
0.107
0.106
0
Aoc
Post
Pre T
0,922
0,920
0.919
0.936
0.948
0.695
0.693
0,711
0,760
0.752
0.753
L, KDE-CRE
8CB
Post T
Pre
0.182
0.363
0.338
0,220
0.289
0,226
0.296
0.248
0.104
0.128
0.095
0.096
0.092
1.108
0.085
0,099
Pre
0.926
0.925
0.953
0.943
0.697
0.725
0.796
0.757
Ase
Post T
0.927
0,925
0.953
0.944
0.698
0,730
0.793
0,759
We notice that for both pre and post temperature scaling, KDE- achieves very competitive ECE scores. Another encouraging observation is that the improvement of calibration error comes at al- most no cost in accuracy. An important advantage of our KDE-based method is the ability to directly train and evaluate canonical calibration. In Figure 4 we show a scatter plot with confidence intervals of the L, and L2 KDE-CRE models for canonical calibration and the other baselines on CIFAR-10. We measure the canonical calibration using our KDE-ECE metric from section 5.2 In three of the architectures, both Lı and L2 KDE-CRE either dominate (CRE). Similarly, Figure]]shove shows a scatter plot of L2 and L2 KDE-CRE models trained to minimize marginal calibration error. In this case, we measure L2 marginal ECE with the standard binned esti- mator. In most cases, our methods Pareto dominate the other baselines. A general observation can be made, however, that the models trained with cross-entropy have surprisingly low marginal calibra- tion error, contrary to previous findings that show poor calibration when considering only the most confident prediction (top-label calibration). An additional experiment comparing the CRE baseline with KDE-CRE for canonical calibration on benchmark dataset of histological images of human colorectal cancer is given in Appendix [.2] which clearly illustrates the superior performance of our method, both in terms of accuracy and calibration error in this context.
statistically tied with cross-entropy
To summarize, the experiments show that our estimator is consistently producing competitive cal- ibration errors with other state-of-the the-t-t approaches, while maintaining accuracy and keeping the computational complexity at O(z²). We evaluate the computational overhead of CRE and KDE- CRE and summarize the results in a table in Appendix [..I which shows that the added cost less than couple percent. There are several limitations in the current work: A larger scale bench- marking will be beneficial for exploring the limits of canonical calibration using Dirichlet kernels. Furthermore, while we showed consistency of our estimator, we did not fully derive and implement its debiasing. Due to space constraints, this was not the focus of the paper and is left for future work.
6 CONCLUSION
In this paper, we proposed consistent and differentiable estimator of an Lp calibration error using Dirichlet kernels. The KDE-based estimate can be directly optimized alongside any loss function in the existing batch stochastic gradient descent framework. Furthermore, we propose using it as mea-
8

---

Under review as a conference paper at ICLR 2022
sure of the highest form of calibration which requires the entire probability vector to be calibrated.
We showed empirically on a range of neural architectures that the performance of our estimator in terms of accuracy and calibration error is competitive against the current state-of-the-art, while having superior properties as a consistent estimator of canonical calibration error.
403.
MMCC
MMccc HOG CRE
0.15
0.80
42
000
0.3
5.22
ACE
AC2
(a) 100
(b) ResNet-110 (SD)
2.11
GRE
0.12
N00 CnE
11
Khe rIVe
0.80
0.2
221
0.2
0:01
0.22
0.4
0.05
3.02
0.4
(c) Wide-ResNNet28-100
(d) DenseNet-40
Figure 4: Canonical calibration on CIFAR-10
42
MMCC
HOC-CIE die
2.5
.2
2011
1.5
1.3
MVCE:
1.9
K2E-0R
0.5
0.5
0.67
0.08
3.50
0.72
3.71
054
5.5
OFF
9.70
0.72
EN
(a) ResNet- 110
(b) ResNet- 110 (SD)
14.6
16-6
GRE
ong
20
2.3
2.5
1.0
1.5
0.
0.
8.70
0.7
0.75
5.00
032
022
5.24
0.55
676
A00
(c) Wide-ResNet-28-10
(d) DenseNet-40
Figure 5: Marginal calibration CIFAR-100
9

---

Under review as a conference paper at ICLR 2022
REFERENCES
A. Appice, P. Rodrigues, V. S. Costa, C. Soares, João Gama, and A. Jorge. Novel decompositions of proper scoring rules for classification Score adjustment as precursor calibration. 2015.
Arsenii Ashukha, Alexander Lyzhov, Dmitry Molchanov, and Dmitry Vetrov. Pitfalls of in-domain uncertainty estimation and ensembling in deep learning, 2021.
Peter L. Bartlett, Michael I. Jordan, and Jon D. Mcauliffe. Convexity, classification, and risk bounds. Journal of the American Statistical Association, 101(473):138-15) 156, 2006.
Taoufik Bouezmarni and Jean-Marie Rolin. Consistency of the beta kernel density function esti- mator. The Canadian Journal of Statistics / La Revue Canadienne de Statistique, 31(1):89-98, 2003.
Jochen Bröcker. Reliability, sufficiency, and the decomposition of proper scores. Quarterly Journal of the Royal Meteorological Society, 135(643):1512-1519, Jul 2009.
Song Xi Chen. Beta kernel estimators for density functions. Computational Statistics Data Analysis, 31:131-145, 1999.
M. Degroot and S. Fienberg. The comparison and evaluation of forecasters. The Statistician, 32: 12-22, 1983.
Yukun Ding, Jinglan Liu, Jinjun Xiong, and Yiyu Shi. Revisiting the evaluation of uncertainty esti- mation and its application to explore model complexity-uncertan trade-off. 1XXiv:9933002050 2020.
Robert Duin. On the choice of smoothing parameters for parzen estimators of probability density functions. IEEE Transactions Computers, C-25(11):1175-1179) 1976.
Thomas S. Ferguson. U-statistics. In Notes for Statistics 200C. UCLA, 2005.
Chuan Guo, Geoff Pleiss, Yu Sun, and Kilian Q. Weinberger. On calibration of modern neural networks, 2017.
Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Deep residual learning for image recog- nition. arXiv:1512.03385, 2015.
Gao Huang, Yu Sun, Zhuang Liu, Daniel Sedra, and Kilian Weinberger. Deep networks with stochas- tic depth. MtXiv:1603.09382. 2016.
Gao Huang, Zhuang Liu, Laurens van der Maaten, and Kilian Q. Weinberger. Densely connected convolutional networks, 2018.
Jakob Kather, Cleo-Aron Weis, Francesco Bianconi, Susanne Melchers, Lothar Schad, Timo Gaiser, Alexander Marx, and Frank Zöllner. Multi-class texture analysis in colorectal cancer histology. Scientific Reports, 6:27988, 06 2016. doi: 10. 10.1038/srep27988.
Alex Krizhevsky. Learning multiple layers of features from tiny images. Technical report, University of Toronto, 2009.
Volodymyr Kuleshov and Percy S Liang. Calibrated structured prediction. In C. Cortes, N. Lawrence, D. Lee, M. Sugiyama, and R. Garnett (eds.). Advances in Neural Information Pro- cessing Systems, volume 28. Curran Associates, Inc., 2015.
Meelis Kull, Miquel Perello-Nieto, Markus Kängsepp, Telmo Silva Filho, Hao Song, and Pe- ter Flach. Beyond temperature scaling: Obtaining cell-calibrated multiclass probabilities with Dirichlet calibration. arXiv:1910.1 12656, 2019.
Ananya Kumar, Percy S Liang, and Tengyu Ma. Verified uncertainty calibration. In H. Wallach, H. Larochelle, A. Beygelzimer, d'Alché-Bus Fox, and R. Garnett (eds.), Advances Neural Information Processing Systems 32, pp. 3792-3803. 2019.
10

---

Under review as a conference paper at ICLR 2022
Aviral Kumar, Sunita Sarawagi, and Ujjwal Jain. Trainable calibration measures for neural networks from kernel mean embeddings. In /CML, 2018.
Gongbo Liang, Yu Zhang, Xiaogin Wang, and Nathan Jacobs. Improved trainable calibration method for neural networks on medical imaging classification. In British Machine Vision Conference, 2020.
Tsung- Yi Lin, Priya Goyal, Ross Girshick, Kaiming He, and Piotr Dollár. Focal loss for dense object detection. arXiv: 170., 02002, 2018.
Jishnu Mukhoti, Viveka Kulharia, Amartya Sanyal, Stuart Golodetz, Philiip H. S. Torr, and Puneet K. Dokania. Calibrating deep neural networks using focal loss. arXiv:2002.09437 2020.
A. Murphy. new vector partition of the probability score. Journal of Applied Meteorology, 12:
595-600, 1973.
Rafael Müller, Simon Kornblith, and Geoffrey Hinton. arXiv:1906.02629, 2020.
When does label smoothing help?
Mahdi Pakdaman Naeini and Gregory F. Cooper. Binary classifier calibration using ensemble of near isotonic regression models. arXiv:1511.05191 2015.
Mahdi Pakdaman Naeini, Gregory F. Cooper, and Milos Hauskrecht. Obtaining well calibrated probabilities using Bayesian binning. In Proceedings of the Twenty-Ninth AAAI Conference on Artificial Intelligence, pp. 2901-2907.2000
Khanh Nguyen and Brendan O'Connor. Posterior calibration and exploratory analysis for natural language processing models. DeXiv:1508.05155 2015.
Frédéric Ouimet and Raimon Tolosana-Delgee Delgado. Asymptotic properties of dirichlet kernel density
estimators. arXiv:2002.06956, 2021.
Emanuel Parzen. On estimation of a probability density function and mode. The Annals of Mathe- matical Statistics, 33(3):1065-1076, 1962.
Gabriel Pereyra, George Tucker, Jan Chorowski, Eukasz Kaiser, and Geoffrey Hinton. Regularizing neural networks by penalizing confident output distributions. urXiv:1701 71770005445 2017.
John C. Platt. Probabilistic outputs for support vector machines and comparisons regularized likelihood methods. In Advances in Large Margin Classifiers, pp. 61-74. MIT Press, 1999.
Murray Rosenblatt. Remarks some nonparametric estimates of density function. The Annals of Mathematical Statistics, 27(3):832 - 837, 1956.
Alastair Scott and Chien-Fu Wu. On the asymptotic distribution of ratio and regression estimators. Journal of the American Statistical Association, 76(373))98-102, 1981.
B. W. Silverman. Density Estimation for Statistics and Data Analysis. Chapman & Hall, 1986.
Christian Szegedy, Vincent Vanhoucke, Sergey loffe, Jonathon Shlens, and Zbigniew Wojna. Re- thinking the inception architecture for computer vision. arXiv:1512.00567, 2015.
Juozas Vaicenavicius, David Widmann, Carl Andersson, Fredrik Lindsten, Jacob Roll, and Thomas B. Schön. Evaluating model calibration in classification. arXiv:1902.06997., 2019.
Jonathan Wenger, Hedvig Kjellström, and Rudolph Triebel. Non-parametris calibration for classifi- cation. In International Conference Artificial Intelligence and Statistics, pp. 178-190. 2020.
B. Zadrozny and Elkan. Transforming classifier scores into accurate multiclass probability esti- mates. Proceedings of the eighth ACM SIGKDD international conference on Knowledge discov- ery and data mining, 2002.
Bianca Zadrozny and Charles Elkan. Obtaining calibrated probability estimates from decision trees and naive bayesian classifiers. /CML. 1, 05 2001.

---

Under review as a conference paper at ICLR 2022
Sergey Zagoruyko and Nikos Komodakis. Wide residual networks. In British Machine Vision Conference, 2016.
Jize Zhang, Bhavya Kailkhura, and T. Yong-Jin Han. Mix-n-match: Ensemble and compositional methods for uncertainty calibration in deep learning. In International Conference on Machine Learning. 2020.
Shunpu Zhang and Rohana Karunamuni. Boundary performance of the beta kernel estimators. Journal of Nonparametric Statistics, 22:81-104, 01 2010.
A DERIVATION OF THE MSE DECOMPOSITION
Definition A.1 (Mean Squared Error (MSE)). The mean squared ervor of an estimator is
MSE B[([()) - -
(22)
Proposition A.2. MSE(f)= 2 (f)
Proof.
MSE( -)) -[((())) [x))) + (Ely [())] - u))²
(23)
= =[(((=) - Ely [(=))))) [[x)] - -
(24)
=CE3
+ 2x(((()) - Ely [(x))) f(x)] v)1
which implies
MSE(f) - (F2 =E((Ey -()))
(25)
+ 2B[[[(x) - -Ey 1yy (())) [(x)] v)
E[(Ely = (B(() f())]
(26)
[(=)]u]]
f(z))y)
(27)
+ +2B((f(2)Bly (E)
-2818/1 [())]=]
Ely])+ - (
(28)
-E[EE[y | [
= -[((/(x)) - EEy [(=))) [sx))) vl
(29)
([(((()))))(B)))))
[(=)] v)1
(30)
+ +[[[((x=) - BBV [ f(x)] - v)].
By the law of total expectation, we will write the above as
MSE(f) - CE2(f)² [[][[(()) - (Ely f(z)] - y)
(31)
+ (f())) Ely (=)) f(=)] v) [(()]]]
Focusing on the inner conditional expectation, we have that
B[(f(z) - (Bly [ - y) + (f - Ely f()) | - -) f(x)
-Fly I (()))[((=)
f()] 1) |[)]) -)
(()))
+ Ely [(=)]([((=) - -Byy [() [(x)]
+ (1 - Ely f()))) Ely [( f())]
(32)
=(1 - Ely [()))) [[x)) 20 Vf(x)
(33)
and therefore
MSE(F) - CE2 = E(( - Ely [())) | f())] 2 0.
(34)
The expectation in Equation 34 is over variances of Bernoulli random variables with probabilities Ely fx))).
12

---

Under review as a conference paper at ICLR 2022
B RESULTS
Table 2 summarizes the marginal L2
ECE and accuracy for the two datasets across multiple archi- tectures and training loss functions. The scatter plots in Figures 7 L1 and L2 ECE, for top-label and marginal calibration on CIFAR-I0 and CIFAR-100, respectively. KDE-CRE is trained by directly minimizing the metric that evaluated, e.g., in the first column we minimize marginal L1 calibration error and in the last column we optimize the L2 top label calibra- tion error. Other methods do not have the flexibilityy of choosing the type of calibration and the Lp norm.
the accuracy and both
Table 2: Accuracy and marginal L2 ECE (%) computed with 15 bins for different approaches, trained from scratch (Pre T) and after temperature scaling (Post T).
CIFAR-10
Loss
Metric
ResNet
ResNet (SD)
Vide-ReNNel
DemseNet
ResNet
ResNet (SD)
Wide-ResNel
DanseNet
CRE
BCE
Phe T Post (NLL)
0.07
0.000
0.009
0.005
0.08
0.077
0.04
0.088
0.002
0.002
0.001
0.002
0.001
0.001
0.001
0.001
Post (NLL)
0.27
0,925
0.30
0.477
0,700
0.729
0.794
0.758
мМCK
BCE
Post (NLL)
Pie T
0.09
0.055
0.009
0.04
0.002
0.083
0.001
0.001
0,033
0.002
0.003
0.005
0.767
0.748
Acc
Post (NLL)
0.926
0.926
0.949
0.945
0.691
0.722
0.770
0.743
Pre T
0013
0.020
0.026
0.055
0,003
0.002
0.003
0.002
(NL1)
0.002
0.002
0.001
Ace
Pre T Post T (NLL)
0.922
0.923
0.920
0.919
0.936
0.936
0.948
0.919
0.693
0.695
0.711
0.712
0.760
0.763
0.252
0.753
T
0.055
0,002
0.002
0.001
0.001
(NLL)
0.002
0.001
T
0.930
0.922
0.950
0.943
0.207
0.213
0.297
0.257
Acc
Post T (NLL)
0.930
0.921
0.930
0.944
0.707
0.717
0.794
0.755
C RELATIONSHIP BETWEEN THE BINNED ESTIMATOR AND THE KERNEL DENSITY ESTIMATOR
Figure shows example of the binned estimator in three-class setting CIFAR-10. The points are mostly concentrated at the edges of the histogram, as can be seen from Figure 8h The surface of the corresponding Dirichlet KDE is given in 8c
Figure shows the relationship between the binned estimator and KDE-ECE metric. The points represent a trained Resnet-56 model on a subset of three classes from CIFAR-10. In every row, a differnt number of points was used to estimate the KDE-ECE.
D EXPERIMENTS FOR REBUTTAL
D.1 TRAINING TIME MEASUREMENTS
In Table 3 we summarize the running time per epoch for training with (KDE-CRE) and without (CRE) regularization for the two datasets and four architectures. KDE-CRE does not create an overhead of more than couple percent over the CRE baseline.
D.2 CANONICAL CALIBRATION IN A MEDICAL APPLICATION
An additional experiment with a medical application, where the canonical calibration is of particular interest, was performed on the -vailale Kather dataset (Kather of 5000 histological images of human colorectal cancer. The data has eight different classes of tissue. Figure[Osshow shows a comparison in performance of the CRE baseline with our KDE-CRI method. The canonical L, (left) and L2 (right) calibration is measured using our KDE-ECE metric. The results clearly illustrate that our method significantly outperforms the cross-entropy baseline, both in terms of accuracy and calibration error, for several choices of the regularization parameter.
2016), which consists
D.3 BIAS AND CONVERGENCE RATES
Figure II shows comparison the groud truth, computed from 3000 test points with KDE- ECE against KDE-ECE and binned ECE estimated with varying number of points used for the estima-
13

---

Under review as a conference paper at ICLR 2022
050
g
0100
094
Figure 6: Top-label and marginal calibration CIFAR-10.
Table Training time [sec] per epoch for Cross-Entropy and KDE-CE methods for different models and datasets.
Dataset
Model
CRE
L1 KDE-CRE
ResNet-110
51.8
53
ResNet-1100 (SD)
45
46
CIFAR- 10
Wide-ResNet-28-10
152.9
154.9
DenseNet-40
103.2
106.8
ResNet-110
90
92.9
ResNet- 110 (SD)
78.2
80.7
CIFAR-100
Wide-ResNet-28-10
150.5
155.3
DenseNet-40
101
105.5
tion. The used model is ResNet-56, trained subset of three classes from CIFAR-10. The figure shows that the two estimates are comparable and both are doing a reasonable job. [ the absolute difference between the ground truth and estimated ECE using our KDE estimator and binned estimator with varying number of points used for estimation. The results
14

---

Under review as a conference paper at ICLR 2022
Naya www.aaaaeeeeoooooooooooooo EENC
2000
0009
Mog
1009
Figure 7: Top-label and marginal calibration CIFAR-100
(a) Splitting the simplex in 16 bins
(b) Corresponding histogram
(c) Corresponding Dirichlet KDE
Figure 8: An example of simplex binned estimator and kernel-density estimator for CIFAR-10
averaged over 120 ResNet-56 models trained subset of three classes from CIFAR-10. Both estimators are biased and have some variance, and the plot shows that the combination of the two is in the same order of magnitude. The empirical convergence rates (slope of the log-log plot) given in the legend and is shown to be close to the theoretically expected value of -0.5.
D.4 CHOICE OF THE BATCH SIZE
In Figure 1 we investigate the choice of the batch size on CIFAR-10. To this end, we use two differently shuffled dataloaders that draw random batches from the same training set. The first dataloader provides batches to the loss term (CRE) while the second dataloader provides the batches for the regularization (KDE). The batch size for the loss term is fixed in all experiments, while the
15

---

Under review as a conference paper at ICLR 2022
Canorias, poira, aim. 0.001 bandwith
Mtrgins 100 points, bandwith
Top rop-ibel 27 6:011 bardwil
635
0.13
339
3.09
0:1
932
8.02
3.9
1.00
100 DCC
ICE DCC
KIC DCC
Canorical usng poins 25 bins, 6.0 bandwldn
Mogiell using 200 points, 25 bine, 0.001 handsoch
Top-abel Lsing 500 point, 20 0.011 bandwich
1.00
6.34
3.54
0.57
0.5
1.55
912
122
1.91
339
330
Concrntcl cuing 1000 puetta 25 Lea 0.001 bunstvith
Magindd Lany 1000 porta 25 bams, 8001 burdweh
Toplabd using 1902 para. 25 brma 2.001 barowdh
5.5
0.55
8.05
5.54
3.44
6.90
1.55
535
031
233
333
330
030
3.55
0.15
920
0.11
0.03
0.34
353
024
0.08
025
50E
106
Figure 9: Relationship between the ECE metric based on binning and kernel density estimation (KDE-ECE) for the three types of calibration: canonical, marginal and top-label. In every row, different number of points are used to approximate the KDE-ECE.
10.01
10.01
CRE 4 KDE-CRE
0.40
Lg KDE-CRE CREC 4 KDE CRE
4; KDE-CRE
L02
4.11
0.18
40.1
10.9
40.01
10.5
40.01
10.3
40.3
0.12
0.84
0.80
0.68
0.80
0.84
0:85
0.88
0.90
ACC
ACC
Figure 10: Canonical calibration Kather using Resnet-50 model
batch size for the regularization varies. The orange point is our normal experimental set-up with just one dataloader (i.e. the same points are used for loss and KDE-ECE computation) as a comparison. The plot shows that our chosen batch size of 128 is appropriate for our purposes.
16

---

Under review as a conference paper at ICLR 2022
Grandiss
0.26
Ground SuB
0/06
Goare
0:20
Birnee
0:23
0.04
0.00
0.15
600
0.55
6.01
210
E50 1003 135
6/8
200
A33
230
4.0
10:0
(a) Canonical
(b) Marginal
(c) Top-label
Figure 11: KDE-ECE estimates and their corresponding binned approximations the three types of calibration for varying number of points used for the estimation. The ground truth is calculated using 3000 probability scores of the test set. For the binned estimate, the points assigned in 25 bins with adaptive width. A bandwidth of 0.001 is used for KDE-ECE.
4x10
Giyphe 3:30
Cipp Rec
slope
50lghr 0..3
2412
chipe
4x12
12
12'
(a) Canonical
(b) Marginal
(c) Top-label
Figure 12:
Absolute difference between ground truth and estimated ECE for varying number of points used for the estimation. The ground truth calculated using 3000 probability scores of the test set. For the binned estimate, the points are assigned in 25 bins with adaptive width. A bandwidth of 0.001 is used for EDE-ECE. Note that the axes are on a log scale.
17

---

Under review as a conference paper at ICLR 2022
2 KDE-CRE KDE-CRE
I, KDE-CRI
3.0055
KDE-CRE
3.0050
0.00025
256
ECE
128
0.0033
0.00015
5112
0.00030
0.915
0.520
0.925
0.530
0.535
0.940
0.915
0.920
0.925
0.930
0.935
0.540
ACC
ACC
KDE CRE
1 KDE-CRE
0.045
512
0.040
256
228
0.004
128
0.030
0.003
0.940
ACC
ACC
Figure 13: Training with different batches for loss and regularization (2 KDE-CRE), where the batch size for the loss is fixed and the batch size for the regularization varies. The orange point shows usual experimental set-up where we train with only one batch (KDE-CRE). Upper row: marginal, lower row: tabelabel.
18


Reviews:
[{"review_id": "rDfuhYRXnz", "reviewer": "Reviewer_HhAZ", "summary": "", "questions": "", "limitations": "", "rating": 5, "confidence": 4, "soundness": null, "presentation": null, "contribution": null, "strengths": "", "weaknesses": "", "quality": null, "clarity": null, "significance": null, "originality": null, "strengths_and_weaknesses": "", "was_revised": false, "final_justification": "", "rebuttal": "", "claims_and_evidence": "", "methods_and_evaluation_criteria": "", "theoretical_claims": "", "experimental_designs_or_analyses": "", "relation_to_broader_scientific_literature": "", "essential_references_not_discussed": "", "other_strengths_and_weaknesses": "", "other_comments_or_suggestions": "", "questions_for_authors": "", "summary_of_paper": "", "summary_of_recommendation": "", "technical_quality": "", "clarity_of_presentation": "", "potential_impact": "", "robotics_focus": "", "quality_of_limitations": "", "questions_for_rebuttal": "", "reasons_to_accept": "", "reasons_to_reject": "", "questions_to_authors": "", "main_review": "I found parts of this paper, particularly the exposition to be quite clear.  I also find the proposed method to be appealing in its simplicity and how easy it would be to apply to generic classification tasks (e.g., regardless of architecture).  I do find the results to be a bit lackluster (improvements seem marginal compared to existing methods) and some of the results are a bit cursory (e.g., the authors mention the application to any method that uses stochastic gradient descent, but the penalty requires looking at a large number of data points to estimate the density, and there is no guidance on how to set batch size or whether to use the whole dataset.  Does using smaller batches incur more bias? Is the bias large enough to be a concern for reasonable sample sizes?  The authors leave this for future work.) Otherwise, I have a number of mostly minor comments below.\n\nMinor Comments:\n- It would have been nice to go into depth about how to choose the various hyperparameters introduced by this method.  The authors describe a method for choosing the kernel bandwidth, but do not discuss how to choose $p$ in the $MCE_p$ regularization term, or how to set $\\lambda$.  I suppose $p$ should be chosen based on which canonical calibration you want, and $\\lambda$ might be chosen using cross-validation, but it would be good to provide users some guidance.\n- Given that histogram density estimators are also consistent estimators of densities (given that the number of bins grows as sample size grows) Figures like Figure 2, Figure 3, Figure 8 and Figure 9 are statements about whether the Dirichlet KDE or the histogram is a more sensible estimator for a particular finite sample.  While it seems totally reasonable that the Dirichlet KDE should do much better (it's visually striking in Figures 2 and 8), Figures 3 and 9 are a bit difficult to interpret.  It's clear that the two estimates are highly correlated, but it's not obvious that one is better than the other.  One easy way to visualize this, would be to compare the estimates from using different numbers of points (as in Figure 9) but compare large samples to small samples: given the consistency of the KDE ECE, one could take the KDE ECE from 1000 points are being close to the ground truth, and then by plotting either the Binned ECE from 100 points or the KDE ECE using 100 points against this \"ground truth\" and see which estimator is better able to match the large sample size result with a smaller sample size.\n- From a writing standpoint, I did find the overall organization of the paper to be a bit lacking which made it hard to follow the main thread -- for instance section 5.2 is interesting, and a nice use case of the Dirichlet KDE, but then it's not mentioned or used again (e.g., in the Tables etc...) and does not really belong in the \"Results and Discussions\" section.  Section 5.2 also serves to separate the details of the empirical exploration, from the results, making the paper feel disjointed.  Lastly, the \"Mean squared error in binary classification\" section is nice, but given that some \"tricks\" are used to reformulate the optimization problem, it feels a bit disconnected from the framework presented at the beginning of Section 3. \n\nTypos:\n- I believe that in the top paragraph on p. 6, $f(x) \\in [0, 0.2)$ should be $f(y | x) \\in [0, 0.2)$ of perhaps $f( \\cdot | x) \\in [0, 0.2)$.\n- The abbreviation \"ECE\" is used in the last paragraph on p. 2, but is not defined until the section \"Metrics\" on p. 6.", "summary_of_the_paper": "In this paper the authors address the problem of calibration in classification tasks, proposing to use kernel density estimation methods to estimate calibration, and then add a penalty during model training to regularize the model toward having better calibration.  They apply this technique to CIFAR-10 and CIFAR-100 and consider several measures of calibration.   ", "summary_of_the_review": "The paper presents a conceptually simple approach to improving the calibration of classification models.  The paper is interesting, but could use some restructuring.  It is not totally clear how to use the method in practice (especially on large datasets where $O(N^2)$ would be prohibitive) and it is not clear if the proposed methodology substantially improves calibration over existing approaches.", "strength_and_weaknesses": "", "limitations_and_societal_impact": "", "review_text": "", "extra_scores": {"correctness": "3: Some of the paper’s claims have minor issues. A few statements are not well-supported, or require small changes to be made correct.", "technical_novelty_and_significance": "3: The contributions are significant and somewhat new. Aspects of the contributions exist in prior work.", "empirical_novelty_and_significance": "2: The contributions are only marginally significant or novel."}, "extra_text": {}}, {"review_id": "Wz33wBraEVq", "reviewer": "Reviewer_6Gih", "summary": "", "questions": "", "limitations": "", "rating": 5, "confidence": 5, "soundness": null, "presentation": null, "contribution": null, "strengths": "", "weaknesses": "", "quality": null, "clarity": null, "significance": null, "originality": null, "strengths_and_weaknesses": "", "was_revised": false, "final_justification": "", "rebuttal": "", "claims_and_evidence": "", "methods_and_evaluation_criteria": "", "theoretical_claims": "", "experimental_designs_or_analyses": "", "relation_to_broader_scientific_literature": "", "essential_references_not_discussed": "", "other_strengths_and_weaknesses": "", "other_comments_or_suggestions": "", "questions_for_authors": "", "summary_of_paper": "", "summary_of_recommendation": "", "technical_quality": "", "clarity_of_presentation": "", "potential_impact": "", "robotics_focus": "", "quality_of_limitations": "", "questions_for_rebuttal": "", "reasons_to_accept": "", "reasons_to_reject": "", "questions_to_authors": "", "main_review": "This is an easy-to-follow paper and the proposed kernel estimator is simple to implement. The main idea is not very technically novel, but the introduction of beta/dirichlet kernels for classification is interesting, since they are differentiable and fit into the probability simplex.\n\nMain concern:\nThe idea of differentiable ECE is not entirely new. Although histogram ECE are non-differentiable, some work have proposed remedy for this issue [1], and the kernel density ECE proposed in [2] also requires trivial change to be differentiable (has been explored by [3]). Considering this, I recommend the authors to discuss and compare with those approaches in this work.\n\nAs for the experimental results, I'm also not convinced that the proposed KDE-regularized training significantly outperformed the cross-entropy baseline (Table 1-2), as it seems that on many NN architectures the CE one obtained comparable or even better ECE. A major contribution of this paper is the introduction of Dirichlet kernels, but the authors missed an opportunity to demonstrate the benefit of using Dirichlet kernels over existing kernel density ECE method [2,3] or advanced histogram estimators (such as [4]) in the experimental section, such as their better capability to handle the multi-class cases, other than showing that they are \"closely correspond to\" the histogram ones. I believe this can be improved.  \n\n1. Bohdal O, Yang Y, Hospedales T. Meta-Calibration: Meta-Learning of Model Calibration Using Differentiable Expected Calibration Error[J]. arXiv preprint arXiv:2106.09613, 2021.\n\n2. Zhang, Jize, Bhavya Kailkhura, and T. Yong-Jin Han. \"Mix-n-match: Ensemble and compositional methods for uncertainty calibration in deep learning.\" International Conference on Machine Learning. PMLR, 2020.\n\n3. Ma, Chunwei, Ziyun Huang, Jiayi Xian, Mingchen Gao, and Jinhui Xu. \"Improving Uncertainty Calibration of Deep Neural Networks via Truth Discovery and Geometric Optimization.\" arXiv preprint arXiv:2106.14662 (2021).\n\n4. Kumar, Ananya, Percy Liang, and Tengyu Ma. \"Verified uncertainty calibration.\" arXiv preprint arXiv:1909.10155 (2019).", "summary_of_the_paper": "In this paper, the authors proposed  the Beta/Dirichlet kernel density estimator, which is differentiable (trainable) and asymptotically converges to the true Lp calibration error. Empirical results demonstrated that such estimator is beneficial for both training and evaluation tasks. ", "summary_of_the_review": "Overall, I think this is an interesting paper, but not ready to publish in ICLR in its present form. I hope that the authors can improve the empirical aspects for this paper. ", "strength_and_weaknesses": "", "limitations_and_societal_impact": "", "review_text": "", "extra_scores": {"correctness": "3: Some of the paper’s claims have minor issues. A few statements are not well-supported, or require small changes to be made correct.", "technical_novelty_and_significance": "2: The contributions are only marginally significant or novel.", "empirical_novelty_and_significance": "2: The contributions are only marginally significant or novel."}, "extra_text": {}}, {"review_id": "AnJPzA9rhNX", "reviewer": "Reviewer_qGbY", "summary": "", "questions": "", "limitations": "", "rating": 8, "confidence": 3, "soundness": null, "presentation": null, "contribution": null, "strengths": "", "weaknesses": "", "quality": null, "clarity": null, "significance": null, "originality": null, "strengths_and_weaknesses": "", "was_revised": false, "final_justification": "", "rebuttal": "", "claims_and_evidence": "", "methods_and_evaluation_criteria": "", "theoretical_claims": "", "experimental_designs_or_analyses": "", "relation_to_broader_scientific_literature": "", "essential_references_not_discussed": "", "other_strengths_and_weaknesses": "", "other_comments_or_suggestions": "", "questions_for_authors": "", "summary_of_paper": "", "summary_of_recommendation": "", "technical_quality": "", "clarity_of_presentation": "", "potential_impact": "", "robotics_focus": "", "quality_of_limitations": "", "questions_for_rebuttal": "", "reasons_to_accept": "", "reasons_to_reject": "", "questions_to_authors": "", "main_review": "Strengths:\n\n1. A novel and technically sound approach for regularizing neural networks in terms of the canonical calibration error is proposed with competitive empirical performance.\n\n2. The use of the Dirchlet Kernel Density Estimate to measure the calibration error is an interesting side benefit of the approach.\n\nWeaknesses:\n\n1. The technical novelty is a bit limited since it mainly consists of directly plugging in the expression for the Dirichlet/Beta Kernels into the regularized loss functions. The consistency results are a good starting point but without a discussion on convergence rates they are not very useful in practice.\n\n2. The  approach seems a bit computationally expensive especially since the simple CRE approach has competitive marginal L1 ECE performance (both pre and post T) and is much less expensive. I would suggest either exploring a more computationally efficient version of the approach (For eg. using approximations to speed up the kernel computations) or including an application (in experiments) where the canonical L1 ECE is more important (such as the medical diagnosis application mentioned in the introduction) so as to clearly illustrate a setting where the proposed approach would be preferrable to CRE. Also given the difference in computation cost I would like to see inference time measurements to exactly illustrate the overhead w.r.t the CRE baseline.\n\nAdditional questions:\n\n1. Is it possible to consider f-divergences instead of the Lp error in CE under your approach? If yes, have you already looked into it?\n\n2. I think there is some issue with the subscripts in (19). If $z_i$ is a softmax output (vector) then shouldn't the individula $\\alpha$'s be labeled as $alpha_{ij}$?\n\n3. Why are values of $\\lambda$ different fro MMCE and KDE-CRE? Does the $\\lambda$ in MMCE correspond to the value used in the original paper?", "summary_of_the_paper": "The paper proposes a new approach for calibrating neural network outputs. The idea is to train the neural network with a regularized loss function that is a linear combination of prediction and calibration errors. The calibration error is measured as the Lp norm of the difference between predicted class probabilities and the expected true class probabilities given the predicted class probabilities where the latter term is computed using a kernel density estimate with a Dirichlet Kernel. The approach is evaluated in terms of accuracy and expected calibration error on CIFAR-10 and CIFAR-100.", "summary_of_the_review": "I am leaning towards accepting the paper because the approach is technically sound and the results are competitive. However I would like to see more of a discussion on the comparison of the proposed approach with the less expensive CRE baseline (see my recommendations above) to be completely convinced.\n\nComments after rebuttal: I am satisfied by the additions made to the paper. The experiments on the Kather (medical) dataset do illustrate the superior L1 ECE (canonical) of the proposed approach, and the time measurements show that the overhead introduced by the proposed approach is not significant. I am therefore increasing my score to reflect the same.", "strength_and_weaknesses": "", "limitations_and_societal_impact": "", "review_text": "", "extra_scores": {"correctness": "3: Some of the paper’s claims have minor issues. A few statements are not well-supported, or require small changes to be made correct.", "technical_novelty_and_significance": "3: The contributions are significant and somewhat new. Aspects of the contributions exist in prior work.", "empirical_novelty_and_significance": "3: The contributions are significant and somewhat new. Aspects of the contributions exist in prior work."}, "extra_text": {}}, {"review_id": "0-TMRvqfFY", "reviewer": "Reviewer_JEjT", "summary": "", "questions": "", "limitations": "", "rating": 5, "confidence": 3, "soundness": null, "presentation": null, "contribution": null, "strengths": "", "weaknesses": "", "quality": null, "clarity": null, "significance": null, "originality": null, "strengths_and_weaknesses": "", "was_revised": false, "final_justification": "", "rebuttal": "", "claims_and_evidence": "", "methods_and_evaluation_criteria": "", "theoretical_claims": "", "experimental_designs_or_analyses": "", "relation_to_broader_scientific_literature": "", "essential_references_not_discussed": "", "other_strengths_and_weaknesses": "", "other_comments_or_suggestions": "", "questions_for_authors": "", "summary_of_paper": "", "summary_of_recommendation": "", "technical_quality": "", "clarity_of_presentation": "", "potential_impact": "", "robotics_focus": "", "quality_of_limitations": "", "questions_for_rebuttal": "", "reasons_to_accept": "", "reasons_to_reject": "", "questions_to_authors": "", "main_review": "Strengths:\n-  Idea is conceptually simple\n- The work focuses on the stronger notion of calibration (canonical)\n\nWeaknesses:\n- The method claims to be well suited for differentiable training. Yet, these are mostly deep learning scenarios with large datasets. The scalability of the O(n^2) estimator can be a challenge. The paper does not provide any data on training times. A breakdown of \"training without CE term\" vs \"training with CE term\" would be very helpful in assessing the utility of this method, especially in evaluating whether the improvement in calibration error relative to other methods is worth the additional computational budget.", "summary_of_the_paper": "The paper proposes a regularization term to augment loss functions, where the regularization term effectively minimizes the calibration error of the model. The term itself is a kernel density estimator over the K-simplex space (hence Dirichlet kernel is the natural choice).\n\nThe authors claim the estimator is consistent (but not unbiased, though they partially debias it) and empirically verify that their method yields tradeoff between accuracy and calibration that is near Pareto optimal.", "summary_of_the_review": "Justification of the recommendation is based on the strengths and weaknesses stated above.", "strength_and_weaknesses": "", "limitations_and_societal_impact": "", "review_text": "", "extra_scores": {"correctness": "4: All of the claims and statements are well-supported and correct.", "technical_novelty_and_significance": "3: The contributions are significant and somewhat new. Aspects of the contributions exist in prior work.", "empirical_novelty_and_significance": "2: The contributions are only marginally significant or novel."}, "extra_text": {}}]

Author rebuttal:

Meta-review: Thank you for your submission to ICLR.  The paper proposes a simple method for improving calibration performance using a loss based upon a Dirichlet KDE.  The method is appealing in its simplicity, but several reviewers (and myself) have concerns simply about the fact that the method ultimately seemed to give rather marginal improvement over the standard cross-entropy baseline.  The authors attempted to address this point in the rebuttal, with their additional example on the Kather domain.  And while this is a nice addition, I'm still not fully convinced that the improvement here is _that_ significant, to the point where I think it would be important to consider much broader sweeps of hyperparameters, etc, for all methods (which I believe should be reasonable here given the data set sizes).  I believe this has the potential to be a nice contribution, and its simplicity can be a positive, but ultimately I think a bit of additional effort is required to show the full empirical advantages of the method.
Decision: Reject