B EYOND CALIBRATION : ESTIMATING THE GROUPING LOSS OF MODERN NEURAL NETWORKS
Anonymous authors
Paper under double-blind review
A BSTRACT
Good decision making requires machine-learning models to provide trustworthy conﬁdence scores.
To this end, recent work has focused on miscalibration, i.e, the over or under conﬁdence of model scores.
Yet, contrary to widespread belief, calibration is not enough: even a classiﬁer with the best possible accuracy and perfect calibration can have conﬁdence scores far from the true posterior probabilities.
This is due to the grouping loss, created by samples with the same conﬁdence scores but different true posterior probabilities.
Proper scoring rule theory shows that given the calibration loss, the missing piece to characterize individual errors is the grouping loss .
While there are many estimators of the calibration loss, none exists for the grouping loss in standard settings.
Here, we propose an estimator to approximate the grouping loss.
We use it to study modern neural network architectures in vision and NLP.
We ﬁnd that the grouping loss varies markedly across architectures, and that it is a key model-comparison factor across the most accurate, calibrated, models.
We also show that distribution shifts lead to high grouping loss.
I NTRODUCTION
Classiﬁcation problems can be broken down into two stages: an inference step during which a classiﬁer is learned to obtain class-wise conﬁdence scores, and a decision step: making an optimal decision given the appropriate scores and the misclassiﬁcation costs.
Decisions are made by applying a threshold on the conﬁdence scores to enforce the desired cost-beneﬁt tradeoffs.
If a cancer-risk model gives a score of 0.1 for cancer versus 0.9 for no cancer , it may still be relevant to predict cancer to reﬂect the relative high cost of missing the diagnosis compared to the nuisance of a biopsy (Vickers et al., 2016).
Similarly, self-driving cars should adapt their speed to the certainty of their computer-vision model, erring on the side of caution if there is even a small chance of a pedestrian being identiﬁed, or if the road seems wet.
Many situations call for conﬁdence scores beyond a discriminant classiﬁer.
Conﬁdence scores are needed when the context of model deployment is unknown at training time, when the decision is left to a human decision maker, when the model should avoid making decisions when it is too uncertain, etc.
But these conﬁdence scores must be trustworthy: they must capture the actual uncertainty of the prediction.
To evaluate probabilistic predictions, statistics and decision theory have put forward proper scoring rules , such as the Brier or the log-loss (Gneiting et al., 2007).
They have the desirable property of being minimized when a model outputs the true posterior probabilities.
However, they come with an irreducible term and cannot be interpreted as an error rate.
Machine learning has focused on calibration, a sub-component of proper scores, with error rates easy to measure (Bröcker, 2009).
Calibration characterizes when classiﬁers are systematically over or under-conﬁdent.
Platt (1999) and
Zadrozny & Elkan (2001) introduced simple post-hoc recalibration methods that rescale a continuous output of a classiﬁer so that it matches the empirical error rate; and Niculescu-Mizil & Caruana (2005) noted that, with such recalibration, classiﬁers scores approached true posterior probabilities on simulated data.
More recently, Guo et al.
(2017) showed that very large neural networks are often poorly calibrated.
A few years later, Minderer et al.
(2021) showed that further improvements in architectures improved not only accuracy but also calibration.
Calibration is however an incomplete characterization of predictive uncertainty.
It is a control at the group level: among all samples to which a calibrated classiﬁer gave the same conﬁdence score, on average, a fraction equal to the conﬁdence score is positive.
It is not a control at the individual level.
Among a group of individuals to which a calibrated cancer-risk classiﬁer assigns a probability of 0.6, a fraction of 60% actually has cancer.
But a subgroup of them could be composed of 100% cancer patients while another would only contain 20% of cancer patients.
In order to fully characterize uncertainty, we study here the remaining term measuring the discrepancy between the calibrated probabilities and the unknown true posterior probabilities (Kull & Flach, 2015), i.e the grouping loss, for which no estimation procedure exists to date.
In particular:
• We highlight a common confusion that an accurate and calibrated classiﬁer approaches the true posterior probabilities (Section 2).
• We provide a new decomposition of the grouping loss into explained and residual components, together with a debiased estimator of the explained component as a lower bound (Section 4).
• We demonstrate on simulations that the proposed estimator can provide tight lower-bounds on the grouping loss (Section 5.1).
• We evidence for the ﬁrst time the presence of grouping loss on vision and language architectures, notably in distribution shifts settings (Section 5.2).
C ALIBRATION IS NOT ENOUGH
Calibration can be understood with a broad conceptual meaning of alignment of measures and statistical estimates (Osborne, 1991).
However, in the context of decision theory or classiﬁers, the following deﬁnitions are used (Foster & Vohra, 1998;
Gneiting et al., 2007; Kull & Flach, 2015):
True posterior probabilities Q: Q :=
P ( Y = 1 | X ) ,
Conﬁdence scores S: S := f ( X ) score output by a classiﬁer,
Calibrated scores C: C :=
E [ Q ( X ) | S ] , average true posterior probabilities for a score S .
Confusion about calibration A common confusion is to mistake conﬁdence scores of a calibrated classiﬁer with true posterior probabilities and think that a calibrated classiﬁer outputs true posterior probabilities, which is false.
We identiﬁed three main sources of confusion in the literature –see
Appendix A for speciﬁc quotes.
First, the vocabulary used sometimes leaves room for ambiguity, e.g., posterior probabilities may refer to conﬁdence scores or to the true posterior probabilities without further speciﬁcations.
Second, plain-English deﬁnitions of calibration are sometimes incorrect, deﬁning calibrated scores as the true posterior probabilities.
Lastly, even when everything is correctly deﬁned, it is sometimes implicitly supposed that true posterior probabilities are close to the calibrated scores.
While it may be true in some cases, equating the two induces misconceptions.
Calibration with good accuracy does not imply good individual conﬁdences It is tempting to think that a calibrated classiﬁer with optimal accuracy should provide conﬁdence scores
[Figure]
close to the true posterior probabilities.
However, caution is necessary: Figure 1 shows a simple counterexample.
The classiﬁer presented gives an optimal accuracy as its conﬁdence scores are always on the same side of the decision threshold as the true posterior probabilities.
It is moreover calibrated, as for a given score s (either 0.2 or 0.7 here), the expectation of Q over the region where the conﬁdence score is s is actually equal to s .
Yet, the conﬁdence scores are not equal to Q as Q displays variance over regions of constant scores.
This variance can be made as large as desired as long as both Q and S stay on the same side of the decision threshold to preserve accuracy.
The ﬂaws of a perfectly calibrated classiﬁer that always predicts the same score are typically due to variations of the true posterior probabilities over constant conﬁdence scores.
As we formalize below, such variations are captured by the grouping loss (Kull & Flach, 2015) .
In Appendix B, we provide a more realistic example based on the output of a neural network that also builds on this key idea.
T HEORETICAL BACKGROUND
Notations Let ( X, Y ) ∈
X
× Y be jointly distributed random variables describing the features and labels of a K-class classiﬁcation task.
Let e k be the one-hot vector of size K with its k th entry equal to one.
The label space Y = { e 1 , . . .
, e K } is the set of all one-hot vectors of size K .
We assume that labels are drawn according to the true posterior distribution Q
=
( Q 1 , . . .
, Q K ) ∈
∆ K where Q k :=
P ( Y =
e k | X ) and ∆ K is the probability simplex ∆ K
= (cid:110) ( p 1 , . .
. , p K ) ∈ [0 , 1] K : (cid:80) k
p k =(cid:111) .
We consider a probabilistic classiﬁer f giving scores S = f ( X ) with S =
( S 1 , . . .
, S K ) ∈ ∆ K .
Note that S and Q are random vectors since they depend on X .
This section introduces the formal deﬁnition of the grouping loss, which uses the concepts of calibrated scores as well as scoring rules.
3. C ALIBRATION IN A MULTI - CLASS SETTING
In multi-class settings various deﬁnitions of calibration give different trade offs between control stringency and practical utility (Vaicenavicius et al., 2019; Kull et al., 2019).
The strongest deﬁnition controls the proportion of positives for groups of samples with the same vector of scores S .
Deﬁnition 3.1.
A probabilistic classiﬁer giving scores s = ( s 1 , . . .
, s k ) is jointly calibrated if among all instances getting score s , the class probabilities are actually equal to s :
Calibration
[Equation]
The score S being a vector of size K the number of classes, estimating the probability of Y conditioned on S is a difﬁcult task that requires many samples.
A weaker notion of multi-class calibration, introduced in Zadrozny & Elkan (2002), requires calibration for each class marginally:
Deﬁnition 3.2.
A probabilistic classiﬁer giving scores s = ( s 1 , . . .
, s k ) is classwise-calibrated if among all instances getting score s k , the probability of class k is actually equal to s k :
Classwise calibration
[Equation]
As classwise calibration can still be challenging to estimate when the number of samples per class is too small, an even weaker deﬁnition is used in the machine learning community (Guo et al., 2017).
Deﬁnition 3.3.
A probabilistic classiﬁer giving scores s = ( s 1 , . . .
, s k ) is top-label-calibrated if among all instances for which the conﬁdence score of the predicted class is s , the probability that the predicted class is the correct one is s :
Top-
label calibration
[Equation]
Top-label calibration simpliﬁes the problem by reducing it to a binary problem.
However, it has an important limitation (Vaicenavicius et al., 2019): as it only accounts for the conﬁdence of the predicted class, it does not tell whether smaller probabilities are also calibrated.
3. P ROPER SCORING RULES AND THEIR DECOMPOSITION
Scoring rules Scoring rules measure how well an estimated probability vector S explains the observed labels Y .
The two most widely used scoring rules are the log-loss and Brier score:
Log-loss :
[Equation]
Scoring rules are deﬁned per sample, and the score over a dataset is obtained by averaging over samples.
More generally, the expected score for rule φ of the estimated probability vector S with regards to the class label Y drawn according to Q is given by s φ ( S, Q ) :
=
E Y ∼ Q [ φ ( S, Y )] .
Proper scoring rules decompositions have been introduced in terms of their divergences rather than their scores.
The divergence between probability vectors S and Q is then deﬁned as d φ ( S, Q ) :
= s φ ( S, Q ) − s φ ( Q, Q ) .
The divergences for the Brier score and the Log-loss read:
Log-loss :
[Equation]
Minimizing the Brier score in expectation thus amounts to minimizing the mean squared error between S and the unknown Q .
A scoring rule is said strictly proper if its divergence is non-negative and d φ ( S, Q ) = 0 implies S = Q .
Both the Log-loss and Brier score are strictly proper.
Scoring rules decomposition Let C be the calibrated scores in the sense of Deﬁnition 3.1, the strongest one i.e., C k
= P
( Y =
e k | S = s ) for k = 1 , . . .
, K .
The divergence of strictly proper scoring rules can be decomposed as (Kull & Flach, 2015):
[Equation]
where the expectation is taken over Y ∼ Q and X .
CL is the calibration loss .
IL is the irreducible loss which stems from the fact that one point may not have a deterministic label, making perfect predictions impossible.
GL is the grouping loss .
Intuitively, while the calibration loss captures the deviation of the expected score in a bin vs the expected posterior probabilities, the grouping loss captures variations of the true posterior probabilities around their expectation.
The scoring rule decomposition (6) trivially holds for top-label calibration (Deﬁnition 3.3) as it can be reduced to a binary problem.
In the case of classwise calibration, the extension is not straightforward in the general case but we prove in Proposition C.3 that it holds for the Brier score and the Log-loss.
C HARACTERIZATION OF THE GROUPING LOSS
In this section, we focus for simplicity on all settings where the calibrated scores can be expressed as
C k = E
[ Y k | S ] , which includes binary classiﬁcation as well as the multi-class setting with joint or top-label calibration.
For classwise calibration, Appendix C.9 shows that all the results presented in this section also hold for the Brier score and Log-loss.
4. R EWRITING THE GROUPING LOSS AS A FORM OF VARIANCE
To shed light on the grouping loss, we rewrite it using f -variances:
Deﬁnition 4.1 ( f -variance) .
Let U, V : Ω → R d be two random variables deﬁned on the same probability space, and function f : R d → R .
Assuming the required expectations exist, the f -variance of U given V is:
[Equation]
The f -variance corresponds to the Jensen gap.
It is positive by Jensen’s inequality when f is convex.
Beyond positivity, it can be seen as an extension of the variance as using the square function for f recovers the traditional notion of variance.
Lemma 4.1 (The grouping loss as an h -variance) .
Let h : p (cid:55)→ − s φ ( p, p ) be the negative entropy of the scoring rule φ .
The grouping loss GL of the classiﬁer S with calibrated scores C = E
[ Q | S ] and scoring rule φ writes:
[Equation]
The proof is given in Appendix C.1.
In other words, the grouping loss associated to a scoring rule φ is an h -variance of the true posterior probability Q around the average scores C on groups of same level conﬁdence S (Equation 7).
In particular for the Brier score, the h -variance is a classical variance.
It measures discrepancy between Q and C with a squared norm: V h
[ Q | S ]
= E
[Equation]
For the Log-loss, it is a Kullback-Leibler divergence: V
[Equation]
These expression highlight two challenges in estimating the grouping loss.
First, it relies on the true posterior probabilities Q , which we do not have access to.
Second, it involves a conditioning on the conﬁdence scores S , which are difﬁcult to estimate for continuous scores.
4. G ROUPING LOSS DECOMPOSITION AND LOWER - BOUND
As an h -variance of Q given S , evaluating the grouping loss requires access to Q ( X ) for any point
X .
Unfortunately Q ( X ) is difﬁcult to estimate, except in special settings – e.g. multiple labels per sample as in Mimori et al.
In fact, the scores S of a classiﬁer are generally one’s best estimate of Q , and the whole point of the grouping loss is to quantify how far this best estimate is from the unknown oracle Q .
We show that it is nevertheless possible to estimate a lower bound on the grouping loss.
On the level set where a classiﬁer score is S , it is indeed possible to estimate the average of Q on regions of the feature space.
Since by deﬁnition Q is non-constant on the level set of a classiﬁer which we expect from a calibrated classiﬁer.
However, a partition of the level set into 2 regions R 1 and R 2 reveals that E [ Q | S, R 1 ] = 0 .
6 while E [ Q | S, R 2 ] = suggesting a high h [
| S, R 1 ]
V h
[ Q | S, R uncaptured
E [ Q | S
[Figure]
=
[Figure]
E [ Q | S, R 1 ] =
[Figure]
E [ Q | S, R 2 ] = 0 .
R R
X
Level set S = 0 .0.
Q with non-zero grouping loss, it allows to capture part of the grouping loss (Figure 2).
Intra-region variance remains uncaptured but can be reduced by choosing smarter and more numerous regions in the partition of the feature space.
Theorem 4.1 formalizes this intuition:
Theorem 4.1 (Grouping loss decomposition) .
Let R : X → N be a partition of the feature space.
It holds that:
[Equation]
Moreover if the scoring rule is proper, then:
[Equation]
Appendix C.2 gives the proof by showing that the law of total variance is also valid for the h -variance, which allows to decompose the grouping loss into explained and residual terms.
GL explained quantiﬁes the h -variance captured through the partition R , i.e. coarse-grained h -variance reﬂecting betweenregion variations of Q , while GL residual captures the remaining intra-region h -variance.
Due to the positivity of GL residual , GL explained is a lower-bound of the grouping loss that ranges between 0 and GL depending on how much h -variance the partition captures.
Importantly, while V h [ Q | S, R ] cannot be estimated because the oracle Q is unknown, it is possible to estimate E [ Q | S, R ] and thus GL explained .
4. C ONTROLLING THE GROUPING LOSS INDUCED BY BINNING CLASSIFIER SCORES S
The grouping loss as well as GL explained involve a conditioning on the conﬁdence scores S , which cannot be estimated by mere counting when the scores are continuous.
To overcome this difﬁculty, standard practice in calibration approximates the conditional expectation using a binning strategy: the classiﬁer scores are binned into a ﬁnite number of values (Deﬁnition 4.2).
[Figure]
Deﬁnition 4.2 (Binned classiﬁer) .
Let S : X → ∆ K be a classiﬁer.
Let
B :=
{B j } 1 ≤ j ≤ J be a partition of ∆ K .
The binned version of S outputs the average of S on each bin:
[Equation]
where B j is the bin S ( x ) falls into.
[Equation]
The binned calibrated scores are deﬁned by:
[Equation]
This is the approach taken by the popular Expected Calibration Error (ECE) (Naeini et al., 2015).
However, the loss estimated for a binned classiﬁer deviates from that of the original one.
In particular, binning biases the calibration loss downwards (Kumar et al., 2019).
Here we show that on the contrary it creates an upwards bias for the grouping loss.
Binning a classiﬁer S into S B boils down to merging the level sets S into a ﬁnite number of larger level sets of conﬁdence score S B .
For example in
Figure 3, all level sets with S ∈ [0 . 5 , 1] are merged into one level set of conﬁdence S B = 0 .
75 , which artiﬁcially inﬂates the variance of Q in each bin.
This intuition is formalized in Proposition 4.
Proposition 4.1 (Binning-induced grouping loss) .
The grouping loss of the binned classiﬁer GL( S B ) deviates from that of the original classiﬁer GL( S ) by an induced grouping loss GL induced ( S, S B ) :
[Equation]
Moreover, if the scoring rule is proper:
[Equation]
The proof is given in Appendix C.3.
Proposition 4.1 shows that the difference between the grouping loss of the binned and original classiﬁer is given by the h -variance of the original calibrated scores in a bin.
This result provides an expression for GL induced which can then be estimated as shown in
Section 4.4.
Remark 1.
Interestingly, the binning-induced grouping and calibration losses partly compensate each other (Corollary C.1 in Appendix C.8).
Applying the decomposition of Theorem 4.1 to the binned classiﬁer S B and accounting for binning using Proposition 4.1, we obtain a new decomposition of the grouping loss:
Proposition 4.2 (Explained grouping loss accounting for binning) .
[Equation]
If the scoring rule is proper, then:
[Equation]
The proof is given in Appendix C.4.
Importantly, contrary to the grouping loss, both terms in the lower-bound (Equation 13) can be estimated.
In the remainder of this paper, we will be interested in the estimation and optimization of the lower bound GL LB ( S, S B ) .
4. G ROUPING LOSS ESTIMATION
We now derive a grouping-loss estimation procedure by focusing on each of its components in turn:
GL explained ( S B ) and GL induced ( S, S B ) .
A debiased estimator for the explained grouping loss GL explained ( S B )
The most natural estimator for the explained grouping loss is a plugin estimator, replacing E [ Q | S, R ] by the empirical means of Y over each region.
It is nonetheless generally biased.
We show below that in the case of the
Brier scoring rule, a direct empirical estimation of GL explained on the partition is biased upwards (cf
Appendix C.6), and propose a debiased estimator.
Proposition 4.3 (Debiased estimator for the Brier score) .
For all class k ∈ { 1 , . . .
, K } and bin s ∈ S , let n ( s,k ) (resp.
n ( s,k ) j ) be the number of samples belonging to level set R ( s ) (resp.
region
R ( s ) j ).
We deﬁne the empirical average of Y over these regions as:
[Equation]
and
[Equation]
The debiased estimator of GL explained is:
[Equation]
s
[Equation]
k ) explained ( S B ) with:
[Equation]
GL ( s,k ) explained ( S B ) =
J
[Equation]
plugin estimator (cid:99) GL plugin
[Equation]
bias estimation (cid:99) GL bias (cid:19)
Appendix C.5 gives the proof, with a debiasing logic similar to Bröcker (2012) .
The leftmost term corresponds to the plugin estimate, that is the estimator of the explained grouping loss Theorem 4.
with sample estimators for the quantities of interest.
The two rightmost terms represent the variance in estimating expectations over regions with a ﬁnite number of samples.
Together they correct the upwards bias of the plugin estimate.
Estimation of the grouping loss induced by binning classiﬁer scores.
GL induced ( S, S B ) involves the h -variance of the calibrated scores C inside each bin, thus its estimation requires C .
A solution is to estimate a continous calibration curve ˆ C , which amounts to a one-dimensional problem for which various methods are available.
In our experiments, we use a kernel-based method ( e.g LOWESS).
It is then easy to compute the h -variance of ˆ C inside each bin by evaluating ˆ C for all available samples.
The resulting expression of the estimator (cid:99)
GL induced is given in Appendix C.7.
A partition to minimize GL residual
In order to achieve the best possible lower-bound, we choose partitions in Theorem 4.1 to minimize GL residual .
For this, we work in the output space of the penultimate layer of the network.
We use a decision tree with a loss corresponding to the scoring rule –squared loss for Brier score or Log-loss– on the labels Y to deﬁne regions that minimize the loss on a given level set of S .
As this approach relies on Y , a train-test split is used to control for overﬁtting: a partitioning of the feature space is deﬁned using the leaves of the tree ﬁtted on one part, then the empirical means used in (cid:99)
GL explained are estimated on the other part given this partitioning.
E XPERIMENTAL STUDY 5. S IMULATIONS : FINER PARTITIONS GIVE A TIGHT GROUPING - LOSS LOWER BOUND
Here we investigate the behavior of our estimation procedure with respect to the number of bins and number of regions on simulated data with known grouping loss.
The importance of both corrections - the binning-induced grouping loss (Proposition C.1) and the debiasing (Proposition 4.3) - is also evaluated.
For this, data Y ∈ { 0 , 1 } is drawn according to a known true posterior probability Q and we consider a calibrated logistic regression classiﬁer for the scores S (details in Appendix B.2 and
Figure 11).
The estimation procedures are then applied according to two different scenarios.
First we vary the number of samples per region ( e.g region ratio) while the number of bins is ﬁxed (Figure 4a.).
Then we vary the number of bins while the region ratio is ﬁxed (Figure 4b.).
[Figure]
(cid:99) GL LB on a simulated problem (Ap-
For a ﬁne-enough partition (a large number of regions, and hence a small region ratio), (cid:99)
GL LB provides a tight lower bound to the true grouping loss GL .
If the average number of samples per region becomes too small, some regions have less than two samples, which breaks the estimate (grayed out area in Figure 4a.).
Conversely, the naive plugin estimate (cid:99)
GL plugin substantially overestimates the true grouping loss as it does not include the corrections (cid:99)
GL induced and (cid:99)
GL bias .
Figure 4b.
shows that to control the GL induced due to binning, a reasonably large number of bins is needed, e.g 15 as typical to compute ECE.
Given these bins, we suggest to use a tree to divide them in as many regions as possible while controlling the probability of regions ending up with less than two samples, typically targeting a region ratio of a dozen, to obtain the best possible lower bound (cid:99)
GL LB .
5. M ODERN NEURAL NETWORKS DISPLAY GROUPING LOSS
The grouping diagram: visualization of the grouping loss In a binary setting, calibration curves display the calibrated scores C versus the conﬁdence scores S of the positive class.
To visualize the heterogeneity among region scores in a level set, we add to this representation the estimated region scores ˆ µ j , i.e the fraction of positives in each region obtained from the partitioning of level sets (Figure 5).
The further apart the region scores are, the greater the grouping loss.
Vision We evaluate 15 vision models (listed on Figure 7) pre-trained on the training set of ImageNet1K (Deng et al., 2009).
Here we report evaluation on ImageNet-R
(Hendrycks et al., 2021), an
ImageNet variant with 15 different renditions: paintings, toys, tattoos, origami...
The dataset contains 30 000 images and 200 ImageNet classes.
Appendix D reports evaluation on the validation set of
ImageNet-1K and ImageNet-C (Hendrycks & Dietterich, 2019), an ImageNet variant with corrupted versions of ImageNet images.
As often with many classes, the small number of samples per class (50) does not allow to study the classwise calibration and grouping loss.
Hence, following common practice, we consider top-label versions (Deﬁnition 3.3).
Appendix D gives experimental details.
[Figure]
We ﬁnd substantial grouping loss inside level sets for most networks on ImageNet-R (ConvNeXt Tiny and ViT L-16 in Figure 6, others in Appendix D.1), even after post-hoc recalibration (Figure 6 right).
For instance, while ConvNext + Isotonic is calibrated (third graph), it is strongly over-conﬁdent in one part of the feature space and under-conﬁdent in the other, creating a high grouping loss.
Figure 7 shows that the grouping loss varies across architectures, even with comparable accuracy.
For example, ViT has a slightly better accuracy than ConvNeXt, but a lower estimated grouping loss.
Post-hoc recalibration does not affect the grouping loss (Figure 6 right and Figure 7 right), leading to the same conclusions.
We observe the same effects on ImageNet-C (Appendix D.2), but little or none on ImageNet-1K (Appendix D.3).
This suggests that stronger grouping loss arises in out-of-distribution settings.
Visual inspection of the images suggests that the partitions capture heterogeneity coming from how realistic an image is, or the different rendition types (Appendix D.1).
[Figure]
C o rr ec t p r e d i c ti on s ( % )
Sizes  0.
Confidence score
Sizes  0.
Confidence score
Sizes with isotonic recalibration 0.
Confidence score
Sizes with isotonic recalibration
.0 .c
GL LB
+ c
CL
[Table]
AlexNet
No recalibration c
GL LB c
CL
[Table]
[Equation] [Table]
[Figure]
F r ac ti on o f po s iti v e s ( % )
Sizes  0.
Confidence score
Sizes  0.
Confidence score
Sizes with isotonic recalibration 0.
Confidence score
Sizes with isotonic recalibration
NLP We evaluate the grouping loss on BART Large (Lewis et al., 2019) pre-trained on the MultiGenre Natural Language Inference dataset (Williams et al., 2018).
We consider zero-shot topic classiﬁcation on the Yahoo Answers Topics dataset, composed of questions and topic labels.
There are 60 000 test samples and 10 topics.
The model is ﬁne-tuned on 5 out of the 10 topics of the training set, totaling 700 000 samples.
Given a question title and a hypothesis ( e.g “This text is about Science & Mathematics”), the model outputs its conﬁdence in the hypothesis to be true.
The classiﬁcation being zero-shot, the hypothesis can be about an unseen topic.
We evaluate the model separately on the 5 unseen topics and the 5 seen topics of the test set.
Both results in a binary classiﬁcation task on whether the hypothesis is correct or not.
Appendix E gives experimental details.
The partitioning reveals grouping loss in the out-of-distribution setting both before and after recalibration (Figure 8b.
and d.).
However, we found no evidence of grouping loss in the in-distribution setting.
As in vision, this suggests that out-of-distribution settings lead to stronger grouping loss.
D ISCUSSION AND CONCLUSION
A working estimator of grouping loss While calibrated scores can be estimated by solving a onedimensional problem, the grouping loss is much harder to estimate: it measures the discrepancy to the true posterior probabilities, which are unknown.
We show that combining debiased partition-based estimators with an optimized partition captures the grouping loss well .
This procedure allows us to characterize the grouping loss of popular neural networks for the ﬁrst time.
We ﬁnd that in vision and
NLP, models can be calibrated –if needed via post-hoc recalibration– but signiﬁcant heterogeneity of errors remains, e.g convnext has larger grouping loss than calibration loss.
Several avenues could be explored to better capture the grouping loss.
Complex level sets may not be approximated well with the partitioning deﬁned by a tree, leaving a large residual in th. 4.1.
In this case, the estimated grouping loss may only be a rather loose lower bound.
Such a lower bound is nevertheless useful to reject models with high grouping loss.
In addition, we apply the tree on the last layer of neural networks, where class boundaries are simpliﬁed.
Finally, complementing the proposed lower bound with an upper bound would also allow to identify models without grouping loss.
We need to talk about grouping loss Model should be evaluated not only on aggregate measures, but also on their individual predictions, using grouping loss.
The presence of grouping loss means that the model is systematically under-conﬁdent for certain groups of individuals and over-conﬁdent for others, questioning the use of such models for individual decision making.
The presence of grouping loss also means that downstream tasks relying on conﬁdence scores can be hindered, such as causal inference with propensity scores or simulation-based inference.
Finally, this heterogeneity raises fairness concerns.
In fact, the grouping loss and our lower bound are fundamentally related to fairness (See Barocas et al., 2019, chap 2, notion of “Group calibration”).
We hope that our demonstration that grouping loss can be estimated will spur new research in this area.
R EPRODUCIBILITY STATEMENT
All datasets are publicly available (ImageNet-R, ImageNet-C, ImageNet-1K, Yahoo Answers Topics) and all models involved are pretrained and publicly available on PyTorch and HuggingFace.
Simulated examples are described in Appendix B. Detailed experimental methods are given in Appendix D and E.
Proofs of all theoretical results are listed in Appendix C.
The source code for the implementation of the algorithm, experiments, simulations and ﬁgures is given as a zip archive on OpenReview
Proofs
C.1 Lemma 4. [Table] h [Table]
C. [Table]
[Table]
C. [Table] [Table] [Table]
[Table]
[Table] [Table] [Table] [Table]
D [Table]
D.
[Table]
ImageNet-R . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
D.
[Table]
ImageNet
-C . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
[Table]
1K
[Table]
set . . . . . . . . . . . . . . . . . . . . . . . . . . . .
[Table]
ImageNet-R . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
ImageNet-C . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
ImageNet-1K . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
A E XAMPLES OF CONFUSING STATEMENTS ON CALIBRATION
Here we detail speciﬁc examples of confusing statements on calibration in the literature.
We choose most of these examples in well-cited and well regarded works.
• Kuhn & Johnson (2013): “ We desire that the estimated class probabilities are reﬂective of the true underlying probability of the sample.
That is, the predicted class probability (or probability-like value) needs to be well-calibrated.
To be well-calibrated, the probabilities must effectively reﬂect the true likelihood of the event of interest. ”
The authors write that it is desirable to have conﬁdence scores S reﬂective of the true posterior probabilities Q , which is indeed desirable as discussed in Section 1.
However, they write this is obtained through calibration.
Although post-hoc recalibration makes the conﬁdence scores closer to Q in some sense, there is an implicit shortcut.
As pointed out in Section 2 and Appendix B, calibration, even with optimal accuracy, does not guarantee conﬁdence scores S to be close to the true posterior probabilities Q .
• (Gupta et al., 2020): “ A classiﬁer is said to be calibrated if the probability values it associates with the class labels match the true probabilities of correct class assignments. ”
The authors write that calibration is matching the conﬁdence scores S of a classiﬁer to the true posterior probabilities Q .
In fact, calibration is matching the conﬁdence scores S to the calibrated scores C , which can be far from the true posterior probabilities Q as pointed out in Section 2 and Appendix B. • Garcin & Stéphan (2021): “ Ideally, we would like machine learning models to output accurate probabilities in the sense that they reﬂect the real unobserved probabilities.
This is exactly the purpose of calibration techniques, which aim to map the predicted probabilities to the true ones in order to reduce the probability distribution error of the model. ”
The authors write that calibration is outputting conﬁdence scores S that are true posterior probabilities Q .
As in the previous citations, calibration is outputting calibrated scores C , which can be far from Q (Section 2 and Appendix B).
• Flach (2016): “ A probabilistic classiﬁer is well calibrated if, among the instances receiving a predicted probability vector p, the class distribution is approximately distributed as p. Hence, the classiﬁer approximates, in some sense, the class posterior. ”
“ The main point is that knowing the true class posterior allows the classiﬁer to make optimal decisions.
It therefore makes sense for a classiﬁer to (approximately) learn the true class posterior. ”
Here, calibration is rightly deﬁned as outputting conﬁdence scores S that are equal to the calibrated scores C .
However, by writing that conﬁdence scores S of a calibrated classiﬁer approximate the true class posterior Q , the author makes an implicit assumption that the calibrated scores C are close to the true posterior probabilities Q , which is not guaranteed in theory as pointed out in Section 2 and
Appendix B.
B E XAMPLES OF ACCURATE AND CALIBRATED CLASSIFIERS WITH HIGH GROUPING LOSS
Here we build simple binary classiﬁcation examples of calibrated classiﬁers with optimal accuracy having their conﬁdence scores far from the true posterior probabilities.
In Appendix B.1 we build examples with an arbitrary link between true posterior probabilities Q and conﬁdence scores S (up to a limit to keep the classiﬁer’s accuracy optimal).
In Appendix B.2 we build a more realistic example based on the output of a neural network.
B. A RBITRARY LINK BETWEEN TRUE POSTERIOR PROBABILITIES Q AND CONFIDENCE SCORES S
To show that calibration, even combined with optimal accuracy, does not impose strong constraints on how close the true posterior probabilities Q should be from the classiﬁers’ conﬁdence scores S , we build examples in which Q and S have an arbitrary link.
For simplicity we consider binary examples with a one-dimensional feature space X .
These can be extended to multiple dimensions by projecting onto a vector ω (via x (cid:55)→ ω T x ).
h : s (cid:55)→ − s
+ 2 s h : s (cid:55)→ min(2 s, 1)
X
S ( X ) Q ( X )
X
Confidence score S
T r u e p r ob a b ilit y Q
NegativePositive
X
S ( X ) Q ( X )
X
Confidence score S
T r u e p r ob a b ilit y Q
NegativePositive
The idea is to build a classiﬁer that outputs conﬁdence scores having at most two antecedents each.
One antecedent should have its true posterior probability Q at an arbitrary distance +∆ from the associated conﬁdence score S , while the other has a distance − ∆ .
Scores with only one antecedent should have Q = S .
This combined with an equal density weight of X onto the two antecedents guarantees calibration: E [ Q | S ] = S .
To maintain the classiﬁer’s accuracy optimal, the offset ∆ is constrained to keep Q and S on the same side of the decision threshold.
To achieve this, we cut the one-dimensional feature space X into three parts: R (cid:63) + , R (cid:63) − and { 0 } .
As a classiﬁer, we take an even function S ( X ) with S − 1 ( { 0 } ) reduced to a singleton so that each conﬁdence score has either two antecedents (one in R (cid:63) + and one in R (cid:63) − ) or one antecedent in { 0 } .
To assign an equal weight to each antecedent, we choose a symmetric distribution for X , e.g a standard normal distribution centered on 0 .
We build the true posterior probabilities Q from deviations h : [0 , 1] → [0 , 1] and g : [0 , 1] → [0 , 1] of the conﬁdence scores S in R (cid:63) + and R (cid:63) − :
[Equation]
For S to be calibrated, deviations must average to identity, i.e ∀ s ∈ S ( R ) , 12 ( h ( s ) + g ( s ))
=
s .
A proof of this statement is given below:
Proof.
[Equation]
0) since P ( X > 0 | S ( X )) =
P ( X < 0 | S ( X ))
= 12 1 S ( X ) (cid:54) =
S (0) .
Hence, S ( X ) calibrated ⇔ E [ Q ( X ) | S ( X )]
= S ( X ) ⇔ 12 ( h ( S ( X ))
+ g ( S ( X )))
=
S ( X ) .
From here, we choose h : [0 , 1] → [0 , 1] and deﬁne g : s (cid:55)→ 2 s − h ( s ) .
Note that to keep g ( s ) ∈ [0 , 1] , h is constrained by: ∀ s ∈ S ( R ) , 2 s − 1 ≤ h ( s ) ≤ 2 s .
At this point of the procedure, classiﬁers S may not have an optimal accuracy.
Figure 9 shows two examples of links h , one of which saturates the constraint h ( s ) <
= min(2 s, 1) .
To make the classiﬁers accurate, the deviations h ( s ) − s should be small enough to keep S and Q on the same side of the decision threshold.
This adds two constraints on h : ∀ s ∈ S ( R ) ∩ [0 , 1 / 2 [ , h ( s ) <and ∀ s ∈ S ( R ) ∩ [ 1 / 2 , 1] , h ( s ) ≥ 12 (with the convention that a score of exactly 12 predicts the positive class).
Figure 10 (left) shows a classiﬁer built following the above procedure.
Figure 10 (right) shows that we can release the constraint 1 / 2 ( h ( s ) + g ( s ))
=
s if we tweak the distribution of X to adapt the weights between the two antecedents accordingly (and take e.g g ( s )
=
1 h ( s ) <s ) .
h : s (cid:55)→ max(min(2 s, 12 )) , 2 s − 1) h : s (cid:55)→ 12 1 0 <
s< 1 + 1 s =
X
S ( X ) Q ( X )
X
Confidence score S
T r u e p r ob a b ilit y Q
NegativePositive
X
S ( X ) Q ( X )
X
Confidence score S
T r u e p r ob a b ilit y Q
NegativePositive
B. R EALISTIC EXAMPLE BASED ON NEURAL NETWORK ’ S OUTPUT
The examples of Appendix B.1, while proving our point, are quite unusual in practice especially in the choice of classiﬁer S .
In this section we build a more realistic example based on the output of a neural network.
We focus on a binary classiﬁcation setting with a feature space X being at least two-dimensional.
The classiﬁer is taken as a sigmoid of ω T X (akin to the last layer of a neural network predicting the conﬁdence score of the positive class).
Based on this choice of model, we build a class of calibrated and accurate classiﬁers with conﬁdence scores S far from the true posterior probabilities Q .
The idea is to create heterogeneity in the blind spot of calibration, i.e orthogonally to ω .
The perturbations creating heterogeneity must balance each other out to keep the classiﬁer calibrated.
To achieve this, we deﬁne:
• d ≥ 2 the dimension of the feature space X .
• ω ∈ R d , the last layer’s weights.
• ϕ : R → [0 , 1] the link function mapping ω T x to conﬁdence scores, e.g a sigmoid.
• S : x ∈ R d (cid:55)→ ϕ ( ω T x ) ∈ [0 , 1] the classiﬁer’s conﬁdence scores of the positive class.
• ω ⊥ ∈ R d
such that ω T ω ⊥ = 0 , the direction in which heterogeneity will be introduced.
• ψ : R → [ − 1 , 1] an odd perturbation introducing balanced heterogeneity along ω ⊥ .
• ∆ max : x (cid:55)→ min(1 − S ( x ) , S ( x )) modulating the range of the perturbation to keep Q ∈ [0 , 1] .
• Q : x ∈ R d (cid:55)→ S ( x ) + ψ ( ω T ⊥ x )∆ max ( x ) ∈ [0 , 1] the constructed true posterior probabilities.
• X ∼ N (0 , Σ) the data distribution, with Σ ∈ R d × d having ω and ω ⊥ among its eigenvectors.
With the above construction, the classiﬁer S is calibrated.
Indeed,
[Equation]
since ∆ max ( X ) is a function of S ( X ) .
We have E
[Equation]
= 0 by construction: ψ is odd and the distribution of X has a symmetric weight along ω ⊥ since Σ is aligned on ω and ω ⊥ .
Hence
E [ Q ( X ) | S ( X )]
= S ( X ) .
Figure 11 shows two examples generated with this procedure.
However, it is not yet accurate.
As in Appendix B.1, the perturbation should be constrained to keep Q and S on the same side of the decision threshold to keep the accuracy optimal.
This is simply achieved by deﬁning ∆ max : x (cid:55)→ min(1 − S ( x ) , S ( x ) , | 1 2 − S ( x ) | ) .
[Figure] [Figure]
S ( X ) =
(1 + exp(
[Equation]
X ))
−
X X
S ( X )=
( T X )
S =  1 S ( X )
[Figure]
. Perturbation ψ
[Figure]
z )
[Figure]
−
[Figure]
X
X( X )=
( T [Equation] ) max
[Equation]
X )
T X =   12 ( X ) 2 X
Q ( X )=
S ( X )+ ( X )
S ( X )=  1 Q ( X )
Confidence score S
T r u e p r ob a b ilit y Q
NegativePositive
[Figure]
. Perturbation
[Figure]
<
[Figure]
X
X( X )=
( T X ) max ( X )
T X =   12 ( X ) 2 X
Q ( X )=
S ( X )+ ( X )
S ( X )=  1 Q ( X )
Confidence score S
T r u e p r ob a b ilit y Q
NegativePositive
[Figure]
S ( X ) =
(1 + exp( − ω T X )) −
X
X
S ( X )=
( T X )
S =  1 S ( X )
[Figure] [Figure]
ψ
[Figure]
[Figure]
2(1 + exp( − z )) − 1 −
X
X( X )=
( T X ) max ( X )
T X =
14 ( X ) 2 X
Q ( X )=
S ( X )+ ( X )
S ( X )=  1 Q ( X )
Confidence score S
T r u e p r ob a b ilit y Q
NegativePositive
[Figure]
) =
[Figure]
z> 0 − 1 z<
X
X( X )=
( T X ) max ( X )
T X =
14 ( X ) 2 X
Q ( X )=
S ( X )+ ( X )
S ( X )=  1 Q ( X )
Confidence score S
T r u e p r ob a b ilit y Q
NegativePositive
C
P ROOFS
C.
L EMMA 4.1: THE GROUPING LOSS AS AN H - VARIANCE
Lemma 4.1 (The grouping loss as an h -variance) .
Let h : p (cid:55)→ − s φ ( p, p ) be the negative entropy of the scoring rule φ .
The grouping loss GL of the classiﬁer S with calibrated scores C = E
[ Q | S ] and scoring rule φ writes:
[Equation]
Proof of Lemma 4.1.
Let φ be a scoring rule, h : p (cid:55)→ − s φ ( p, p ) and C
= E
[ Q | S ] .
[Equation]
Deﬁnition of divergence
[Equation]
[Equation]
Deﬁnition of h
[Equation]
[Equation]
Deﬁnition of expected score
[Equation]
[Equation]
Law of total expectation
[Equation]
[Equation]
Linearity of expectation
[Equation] [Equation]
φ
[Equation]
measurable
[Equation]
Deﬁnition of h
[Equation]
Deﬁnition of
[Equation]
C. T HEOREM 4.1: G ROUPING LOSS DECOMPOSITION
Lemma C.1 (Law of total h -variance) .
Let X, Y, Z : Ω → R d be random variables deﬁned on the same probability space and a function f : R d → R .
The law of total variance holds for the f -variance:
[Equation]
Proof.
[Equation]
Law of total expectation
[Equation]
Deﬁnition of V f
[ Y | X ]
[Equation]
Law of total expectation
[Equation]
Deﬁnition of
[Equation]
E
[Equation]
The same proof holds when the expectations and h -variances are conditioned on Z .
Theorem 4.1 (Grouping loss decomposition) .
Let R : X → N be a partition of the feature space.
It holds that:
[Equation]
Moreover if the scoring rule is proper, then:
[Equation]
Proof of Theorem 4.1.
Applying Lemma C.1 with ( R , Q, S ) as ( X, Y, Z ) gives the decomposition.
Proper scoring rules have a convex negative entropy h (see Gneiting & Raftery, 2007, th. 1).
Note that depending on the convention (maximization or minimization of scoring rules), one may ﬁnd in the litterature that the entropy is either convex or concave.
In the convention taken by this article (minimization of scoring rules), the entropy is concave and the negative entropy is convex.
Using
Jensen’s inequality, we thus have V h
[ Q | S, R ] ≥ 0 .
Hence both GL explained and GL residual are positive, which gives GL ≥ GL explained .
C. P ROPOSITION 4.1: B INNING - INDUCED GROUPING LOSS
Proposition 4.1 (Binning-induced grouping loss) .
The grouping loss of the binned classiﬁer GL( S B ) deviates from that of the original classiﬁer GL( S ) by an induced grouping loss GL induced ( S, S B ) :
[Equation]
Moreover, if the scoring rule is proper:
[Equation]
Proof of Proposition 4.1.
V
[Equation]
[ Q
[Equation]
S
[Equation]
] =
E [ V h
[ Q | S, S B ] | S B ]
+ V h
[ E [ Q | S, S B ] | S B ] Law of total h -variance (Lemma C.1) =
E [ V h
[ Q | S ] | S B ] + V h
[ E [ Q | S ] | S B
[Equation]
S B is S -measurable
[Equation]
E [ V h
[ Q
[Equation]
S B ]]
[Equation]
S ]]
[Equation]
Law of total expectation
GL
[Equation]
) =
GL
[Equation]
+
[Equation]
Lemma 4.1 and deﬁnition of GL induced
Remark: this proposition does not require S B to be the average scores on the bins E
[ S | S ∈ B j ] .
C
P ROPOSITION
: E XPLAINED GROUPING LOSS ACCOUNTING FOR BINNING
Proposition 4.2 (Explained grouping loss accounting for binning) .
[Equation]
If the scoring rule is proper, then:
[Equation]
Proof of Proposition 4.2.
[Equation]
Propostion 4.
[Equation]
S
[Equation]
Theorem 4.1 on GL( S B )
For proper scoring rules, Theorem 4.1 gives GL residual ( S B ) ≥ 0 which completes the proof.
C.
P ROPOSITION 4.3: DEBIASED ESTIMATOR FOR THE B RIER SCORE
Proposition 4.3 (Debiased estimator for the Brier score) .
For all class k ∈ { 1 , . . .
, K } and bin s ∈ S , let n ( s,k ) (resp.
n ( s,k ) j ) be the number of samples belonging to level set R ( s ) (resp.
region
R ( s ) j ).
We deﬁne the empirical average of Y over these regions as:
[Equation]
k
[Equation]
:= n ( s,k ) j (cid:88)
i : X ( i ) ∈R ( s )
j
Y ( i ) k and ˆ c ( s,k ) =
n ( s,k ) (cid:88)
i : X ( i ) ∈R ( s )
Y ( i ) k
The debiased estimator of GL explained is:
[Equation]
with:
[Equation]
Proof.
Let s ∈ S ( k ) and k ∈ { 1 , K }
[Equation]
and deﬁne ˆ p ( s,k ) j := n ( s,k ) j n ( s,k ) .
We now compute the bias of the plugin estimator for (cid:99)
GL ( s,k ) explained .
To ease calculations
[Equation]
we start by rewriting the plugin estimate:
[Equation] [Equation]
From now on, we omit the exponent ( s, k ) to lighten notations.
We now take the expectation of both terms in the lower-bound.
[Equation]
where we made use of Lemma C.2 for equation 32.
Similarly,
[Equation]
When n j = 0 (or equivalently ˆ p j = 0 ), which happens with probability ν j = (1 − p j ) n , ˆ µ j as well as the right term in equation 34 are undeﬁned.
The problem disappears when multiplying by ˆ p j , and agreeing that ˆ µ j = 0 whenever n j = 0 .
[Equation]
Putting together equations 32 and
[Equation]
we get:
[Equation]
In practice ν j , which gives the probability that no sample falls in component j
[Equation]
is very close tounless p j and n are very small.
Hence
[Equation]
we will approximate ν j ≈ 0 .
More importantly, the expression of the bias given in 40 depends on oracle quantities µ j and c , which are unavailable.
Therefore, we resort to debiasing the plugin estimate of the lower-bound using sample estimates of the bias
[Equation]
which gives:
[Equation]
where we used a Bessel correction for the estimation of population variances.
Finally, a debiased estimator of GL explained is obtained by summing over the debiased estimators for all k ∈ { 1 , K } and all s ∈ S k .
Lemma C.2.
Deﬁne ˆ µ ( s,k ) j and ˆ c ( s,k ) as in Proposition 4.3.
Then:
E
[Equation]
and V ar
[Equation]
Similarly,
E
[Equation]
and V ar
[Equation]
The labels Y ( i ) k are by deﬁnition drawn from a Bernoulli distribution with probability
P ( Y ( i ) k
| X ( i ) )
=
Q ( i ) k , i.e, for each sample i , the probability of the Bernoulli changes.
This lemma shows that despite these varying Bernoulli probabilities, the empirical average of labels
Y k over a given subspace has the same expectation and variance as a binomial variable that would be drawn with a probability equal to the expectation of Q k over this subspace.
Proof of Lemma C.2.
Below we write the proof for the case of ˆ µ ( s,k ) j (equation 42) as the one for ˆ c ( s,k ) (equation 43) follows exactly the same lines.
Let I ( s )
j
[Equation]
i : X ( i
) ∈
R ( s ) j (cid:111)
[Equation]
where we used the law of total expectation in eq 45, the deﬁnition of Q k in eq 46, and the deﬁnition of µ ( s,k ) j in eq 47.
Var
[Equation]
− (cid:16) µ ( s,k ) j (cid:17) (50) = (cid:16) n ( s,k ) j (cid:17) 2 E   (cid:88) i ∈I ( s ) j
Y ( i ) (cid:88) l ∈I ( s )
j
Y ( l ) k (cid:12)(cid:12)(cid:12)(cid:12)(cid:12)(cid:12)(cid:12)
S k
= s, R
( X ( i ) )
=
j   − (cid:16) µ ( s,k ) j (cid:17) (51) =
(cid:16) n ( s,k ) j (cid:17) 2 E   (cid:88) i ∈I ( s )
j
Y ( i ) k
+ (cid:88) i (cid:54) =
l i,l ∈I ( s ) j
Y ( i ) k Y ( l ) k
(cid:12)(cid:12)(cid:12)(cid:12)(cid:12)(cid:12)(cid:12)(cid:12)(cid:12)
S k
= s, R
( X ( i ) )
=
j   − (cid:16) µ ( s,k ) j (cid:17) (52) = (cid:16) n ( s,k ) j (cid:17) 2    (cid:88) i ∈I ( s ) j µ ( s,k ) j
+ (cid:88) i (cid:54) =
l i,l ∈I ( s ) j (cid:16) µ ( s,k ) j (cid:17) 2    − (cid:16) µ ( s,k ) j (cid:17) (53) = (cid:16) n ( s,k ) j (cid:17) 2 (cid:18)
[Equation]
) where we used the fact that Y ( i ) k and Y ( l ) k are independent when i (cid:54)
=
l in eq 52.
C. T HE PLUGIN ESTIMATOR FOR THE GROUPING LOSS LOWER BOUND IS BIASED UPWARDS .
Analytical evaluation of the sign of the bias Let k ∈ { 1 , . .
, K } and s ∈ S .
The bias of the plugin estimate
[Equation]
GL
[Equation]
) is given by (40): bias
[Equation]
By convexity of the function x (cid:55)→ ( x − E [ x ]) 2 , we have:
[Equation] [Equation]
Using the fact that ˆ c ( s,k ) =
[Equation]
and taking the expectation of both sides, we get:
[Equation]
Finally, using Lemma C.2, we get:
[Equation] [Equation]
Hence, we have: bias
[Equation]
Because of the term involving ν ( s,k ) j , this inequality does not prove that the bias is always positive.
However in practice ν ( s,k )
j
[Equation]
n
[Equation]
s,k ) , which represents the probability that no point belongs to region j , is very close to 0 unless p ( s,k ) j is very small or the total number of points n ( s,k ) is small.
Hence, equality 60 shows that the bias can only be ’slightly’ negative.
In the simulations below, the upwards bias of the plugin estimate appears clearly.
C. E STIMATOR FOR THE INDUCED GROUPING LOSS
Proposition C.1 (Estimator for the induced grouping loss) .
Let ˆ C be an estimator of C .
An estimator of C B is ˆ C B ( s )
= 1 n ( s )
[Equation]
i : S B ( X ( i ) )
=
s ˆ C ( S ( X ( i ) )) with n ( s ) the number of sample in the level set s .
An estimator of the grouping loss induced by the binning of S into S B is:
[Equation]
C. A NALYSIS OF BINNING - INDUCED ERRORS FOR THE B RIER SCORE
It is well known that binning can induce error in estimating calibration loss, leading to underestimating it (Bröcker, 2012; Kumar et al., 2019; Roelofs et al., 2022).
Proposition 4.1 shows that it also leads to errors on the grouping loss, overestimating it.
Here we characterize the errors on the calibration and grouping loss for the Brier score and show that they partly compensate each other and the error on the sum of both can be bounded.
Proposition C.2 gives the deviation term induced by the binning for the calibration loss with the Brier scoring rule.
Proposition C.2 (Calibration loss decomposition) .
Let h be the negative entropy of the Brier scoring rule and C
= E
[ Q | S ] .
The binned calibration loss CL( S B ) deviates from the calibration loss CL( S ) by a negative induced calibration loss CL induced ( S, S B ) :
[Equation]
CL
[Equation]
The calibration loss induced by the binning, CL induced ( S, S B ) , is always negative.
CL( S B ) is thus biased downward, which is already known from Kumar et al.
; Roelofs et al.
Conversely, the grouping loss induced by the binning, GL induced ( S, S B ) , is always positive.
GL( S B ) is thus biased upward.
The mere effect of binning artiﬁcially creates grouping loss and artiﬁcially reduces calibration error.
For calibrated continuous classiﬁers, CL induced = 0 and induced grouping loss is small: with N equal-width bins, GL induced ≤ 1 4 N 2 .
If in addition the scores are uniform on the bins: GL induced =
[Equation]
N 2 (Lemma C.3).
Both induced calibration and grouping losses can be large since V [ C | S B ] can be large.
High GL induced expresses strong miscalibrations within the bin.
However interestingly, both induced losses compensate.
In a binary setting, the sum of induced calibration and grouping losses is contained as showed by Theorem C.1, and can be bounded by estimable quantities (Corollary C.1).
While measuring CL( S B ) and GL( S B ) separately can lead to high binning-induced bias, measuring CL( S B ) + GL( S B ) through
[Equation]
explained ( S B ) enables reducing binning-induced errors and minorizing MSE(S , Q) (Corollary C.2).
Theorem C.
(Bounds on induced calibration and grouping losses) .
In a binary setting, the calibration and grouping losses induced by the binning of classiﬁer S into S B sums to:
[Equation]
which is bounded by:
[Equation]
Suppose that [
[Equation]
1] is divided in N equal-width bins.
Then:
[Equation]
Corollary C.1.
−
[Equation]
With N equal-width bins:
[Equation]
Corollary C.2.
The mean square error (MSE) between continuous S and Q is lower bounded by:
[Equation]
V [ S | S B ] (cid:16) (cid:112)
V [ C | S B ] − (cid:112)
V [ S | S B ] (cid:17)(cid:105) ≥ (cid:96) 2 - ECE B + L GL B − E (cid:104)(cid:112)
V [ S | S B ] (cid:16) (cid:112)
C B (1 − C B ) − (cid:112)
V [ S | S B ] (cid:17)(cid:105) With N equal bins: ≥ (cid:96) 2 - ECE B + L GL B − 1 N E (cid:104) (cid:112)
C B (1 − C B ) (cid:105) where (cid:96) 2 - ECE B is the (cid:96) 2 Expected Calibration Error of the binned classiﬁer S B and L GL B is the grouping loss lower bound of S B .
P ROOFS
Proof of Proposition C.2.
Let h the negative entropy of the Brier scoring rule.
[Equation]
Linearity of expectation
[Equation]
Deﬁnition of
[Equation]
Law of total expectation
Lemma C.3.
In a binary setting, suppose that [0 , 1] is divided in N equal-width bins.
Then:
[Equation]
If in addition, scores S are uniform:
[Equation]
Proof of Lemma C.3.
Without loss of generality, consider the ﬁrst bin [0 , 1 N ] with binned score s 1 .
[Equation]
Deﬁnition of the variance
[Equation]
Max when N E [ S | S B = s 1 ] =
For uniform scores: S | S B = s 1 ∼ U ([0 , 1 N ]) .
Hence V [ S | S B = s 1 ] = 112 ( 1 N − 0)
= 1 12 N 2 .
Other bins have same variance as V [ S | S B = s 1 ] (variance is translation-invariant).
Remark: this proves that GL induced ≤ 1 4 N 2 for S calibrated ( S =
C ⇒ V
[ C | S B ] =
V [ S | S B ] ).
Proof of Theorem C.1.
In a binary setting for the Brier scoring rule, we have V h
= V .
Hence:
[Equation]
Propositons 4.1 and C.
[Equation]
[ S, C
[Equation]
S B
[Equation]
−
[Equation]
S
[Equation]
S B ]]
Expansion of V [ S − C | S B ] 2Cov[ S, C | S B ] − V
[Equation]
S
[Equation]
S
[Equation]
≤
[Equation]
Cauchy-Schwarz 2Cov
[ S, C | S B ] − V
[ S | S B ] ≥ − 2 | Cov[ S, C | S B ] | − V
[ S | S B ] ≥ −
[Equation]
V
[Equation]
S
[Equation]
S
[Equation]
C
[Equation]
[ S
[Equation]
S
[Equation]
] Cauchy-Schwarz
With N equal-width bins: 2Cov
[Equation]
Positivity of the variance
[Equation]
2Cov
[Equation]
C
[Equation]
S
[Equation]
C.
E XTENSION TO CLASSWISE CALIBRATION C.9. P ROPER SCORING RULES DECOMPOSITION
We show below that the proper scoring rules decomposition of Kull & Flach (2015) holds for classwise-calibration (Deﬁnition 3.2) for the Brier score and the Log-loss.
Proposition C.3 (Brier and Log-loss classwise decomposition) .
For the Brier score as well as the
Log-loss, the decomposition into calibration, grouping, and irreducible losses (Equation 6) holds when replacing the calibrated scores by the classwise-calibrated scores (Deﬁnition 3.2).
Proof of Proposition C.3.
For all k ∈ { 1 , . . .
, K } , let C k
= E
[ Y k | S k ] be the classwise-calibrated scores (Deﬁnition 3.2).
Brier Score Given any two probability vectors P and Q , the divergence associated to the Brier score reads:
[Equation]
For all k ∈ { 1 , . . .
, K } , let d k : P k , Q k
(cid:55)→ ( P k − Q k ) 2 .
[Equation]
Taking the expectation on both sides conditional on X :
[Equation]
since S k and Q k are function of X , C k is a function of S k and thus of X , and E [ Y k
| X ] = Q k .
Then taking the expectation conditional on S k :
[Equation]
where we use the fact that C k is a function of S k , that E [ Q k | S k ]
=
C k , and the property according to which for two random variables U and V and a function h , E [ E [ V | U ] | h ( U )]
=
[Equation] [Equation]
| h
[Equation]
U )] .
Finally, taking the expectation over S k we get:
[Equation]
The desired decomposition is then obtained by summing over the K classes on both sides.
log-loss Given any two probability vectors P and Q , the divergence associated to the log loss reads:
[Equation]
For all k ∈ { 1 , . . .
, K } , let d k : P k , Q k
(cid:55)→ Q k log
[Equation]
d k ( S k , Y k
[Equation]
Y k
[Equation] [Equation]
[Equation] [Equation]
E
[Equation]
where we have used the same properties as those described for the proof of the Brier score classwise decomposition above.
The desired decomposition is then obtained by taking the expectation over S k and summing over the K classes.
The proper scoring rule decomposition holds for top-label calibration.
Unlike classwise calibration, top-label calibration does not deﬁne a vector C ∈ R K of calibrated probabilities.
Instead, it deﬁnes a notion of calibration for a simpler binary problem in which labels indicate whether the classiﬁer predicts the correct class for a given X .
More precisely, the labels for this binary problem are given by Y (cid:48) :
= 1 Y = e argmax( S ) .
Since S is a function of X , the random variable Y (cid:48) is a function of Y and X .
Deﬁne now the scores associated to this binary problem as S (cid:48) :
= max( S ) ∈ R .
Reformulated in terms of these notations, top-label calibration states that S (cid:48) is well calibrated if for all s, P ( Y (cid:48)
= 1 | S (cid:48) =
s )
= s .
Thus, as for a classical binary problem, we can deﬁne C (cid:48) :
= E [ Y (cid:48) | S (cid:48) ] and Q (cid:48) =
E [ Y (cid:48) | X ] .
C (cid:48) (resp Q (cid:48) ) gives the probability that the classiﬁer predicts the correct class for a given score S (cid:48) (resp.
a given input X ).
As the quantities S (cid:48) , C (cid:48) , Q (cid:48) and Y (cid:48) deﬁne a classical binary problem, the decomposition (6) into calibration, grouping, and irreducible loss holds for this problem.
Compared to the classwise deﬁnition of calibration and grouping, here the calibration loss measures whether on average over all points scored S across all classes , the proportion of correctly predicted points in actually S .
In this setting, the grouping loss also measures to what extent there exist over-conﬁdent scores for certain classes that compensate under-conﬁdent scores for other classes.
C.9. R ESULTS HOLD FOR B RIER AND L OG - LOSS IN CLASSWISE SETTING
Appendix C.9.1 proves the scoring rule decomposition (6) in a classwise setting for Brier and Log-loss scoring rules, which is necessary for the other results to hold.
However, the proof of Lemma 4.
does not readily apply to classwise calibration.
Equation 22 uses a conditioning on the full vector of joint conﬁences S to move φ ( C, e k ) outside of the conditional expectation on S and turn Q k into C k in expectation.
In classwise calibration the conditioning is on each marginal S k instead of the joint S .
As a result, in the general case, φ ( C, e k ) cannot be moved outside of the conditional expectation given S k since C depends on all marginals of C , not just C k .
However for some scoring rules, φ ( p, e k ) depends only on p k and the proof can be adapted.
This is the case of the Log-loss for which φ LL ( p, e k ) =
− log( p k ) .
Lemma C.4 (Adaptation of Lemma 4.1 for classwise calibration) .
Suppose there exists g : R K → R such that for all k in { 1 , . .
, K } and x in R K , φ ( x, e k ) =
g ( x k ) .
Deﬁne h
k : p (cid:55)→ − φ ( p, e k ) p k , the k th component of the negative entropy of the scoring rule φ .
The grouping loss GL of the classiﬁer S with calibrated scores C k
= E
[ Q k | S k ] and scoring rule φ writes:
[Equation]
Proof of Lemma C.4.
Deﬁne the vector C with C k = E
[ Q k | S k ] for all k in { 1 , . . .
, K } .
Let φ be a scoring rule, h : p (cid:55)→ − s φ ( p, p ) .
Suppose for all k in { 1 , . .
, K } , φ ( x, e k ) =
g ( x k ) with g : R K
→ R .
Then:
[Equation]
Deﬁnition of d φ
[Equation] [Equation]
Deﬁnition of
[Equation]
Linearity of expectation
[Equation]
Hypothesis on φ
[Equation]
[Equation]
Law of total expectation
[Equation]
Deﬁnition of C k
[Equation]
[Equation]
Deﬁnition of V h k
[Equation]
Theorem C.2 (Results in classwise setting) .
Suppose Equation 78 is satisﬁed for the scoring rule φ .
For all k ∈ { 1 , . . .
, K } , let R k : X → N be a partition of the feature space.
It holds that:
[Equation]
Moreover, if h k is convex, then:
[Equation]
Proof of Theorem C.2.
Applying the law of total variance (Lemma C.1) on each of the V h k
[ Q k | S k ] with R k as conditioning variable proves Equation 87.
Similarly, applying the law of total variance on each of the V h k
[ Q k | S B k ] with S k as conditioning variable proves Equation 88.
The proof for Equation 89 is the same as Proposition 4.2.
Using Jensen’s inequality, if h k is convex, then V h k ≥ 0 , which proves Equation 90, 91 and 92.
For the Log-loss scoring rule, we have φ LL ( p, e k )
= − log( p k ) and h k ( p ) =
log( p k ) p k wich is convex.
Thus, Theorem C.2 holds for the Log-loss.
Unfortunately the Brier score does not satisfy the assumptions of Lemma C.4 since φ BS ( p, e k ) is not a function of p k .
But a forumlation similar to
Equation 78 holds for the Brier score:
[Equation]
Deﬁnition of
[Equation] [Equation]
Deﬁnition of
[Equation]
φ
[Equation]
[Equation]
[Equation]
Linearity of expectation
[Equation]
[Equation]
Law of total expectation
[Equation]
[Equation]
Deﬁnition of the variance
[Equation]
[Equation]
[Equation]
[Equation]
Law of total expectation
[Equation]
[Equation]
a
[Equation]
of
[Equation]
k
[Equation]
[Equation]
Deﬁnition of C k
[Equation]
[Equation] [Equation]
Since V = V f with f : x (cid:55)→ x 2 Equation 78 is satisﬁed for the Brier score.
Since f is convex,
Theorem C.2 holds for the Brier score.
To conclude, Theorem C.2 holds for the Brier score and the Log-loss in a classwise setting.
It is likely that some other proper scoring rules satisfy Equation 78 and Theorem C.2.
C.9. Impact of recalibration on the grouping loss
Lemma C.5.
Let ˆ c be a recalibration mapping and S (cid:48)
=
ˆ c ( S ) the classiﬁer recalibrated with that mapping.
The grouping loss of the recalibrated classiﬁer GL( S (cid:48) ) deviates from that of the original classiﬁer GL( S ) as follows: [Equation] If the mapping is perfect ( i.e S (cid:48) = C ) or invertible, then GL( S (cid:48) ) =
GL( S ) .
Proof of Lemma C.5.
[Equation]
Deﬁnition of GL
[Equation]
] Law of total h -variance on S
[Equation]
Lemma C.1 )
[Equation]
S (cid:48) is a function of S
[Equation]
Deﬁnition of GL( S ) and C
If S (cid:48)
=
C , then V h
[ C | S (cid:48) ]
= 0 , hence GL( S (cid:48) )
=
GL( S ) .
If the mapping ˆ c is invertible, then knowing S (cid:48) is knowing S .
Hence V h
[ C | S (cid:48) ]
=
V h
[ C | S ] = 0 since C a function of S .
Hence
GL( S (cid:48) ) = GL( S ) . D I MAGE N ET ImageNet-1K (ILSVRC2012) (Deng et al., 2009) is a classiﬁcation dataset for computer vision with 1 000 classes.
Networks studied in this article are pre-trained on the training set of ImageNet-1K, comprising 1.2 million samples.
Models’ architectures and weights are available on PyTorch v0.
(Paszke et al., 2019).
We evaluated the networks on ImageNet variants’ ImageNet-R and ImageNet-C (Appendix D.1, D.2) as well as the validation set of ImageNet-1K (Appendix D.3).
For each of ImageNet-R, ImageNet-C and the validation set of ImageNet, we plot the grouping diagrams of each network with and without post-hoc recalibration, obtained with a balanced decision stump.
For each network, if several versions are available, we study both the smallest and the best performing one on the validation set of ImageNet-1K (usually the largest version).
For ImageNet-R we also provide the grouping diagrams obtained with a 2-cluster k -means.
Each experiment is detailed in Appendix D.1, D.2 and D.3.
Detailed experimental method First, we forward each sample of the evaluation dataset (ImageNetR, ImageNet-C or the validation set of ImageNet-1K) through the studied network.
We build conﬁdence scores by applying a softmax to the output logits.
We extract a representation of the input images in the high-level feature space of the network ( i.e the input space of the last linear layer).
Since there is not enough samples per class (50), we restrict our study to the top-label problem (Deﬁnition 3.3).
For each sample, the class with the highest conﬁdence is predicted.
The label is 1 if the network predicted a correct class (0 otherwise) and the associated conﬁdence score is the one of the predicted class.
We divide the samples of the evaluation set in half making sure that the conﬁdence score distribution is the same in both resulting subsets.
On one set, we train the isotonic regression for calibration and calibrate the conﬁdence scores of both sets.
If no post-hoc recalibration is used, we skip this step.
Then, we create groups of same-level conﬁdences by binning the conﬁdence scores with 15 equal-width bins in [0 , 1] .
We partition each of the 15 level sets independently.
For each of them, we create the partition by training the partitioning method on the training samples of the isotonic regression.
We then evaluate region scores on the remaining samples to avoid overﬁtting.
For the grouping diagrams, we mainly use a balanced decision stump with 2 clusters ( e.g using scikit-learn’s DecisionTreeRegressor with min_samples_leaf taken as half the samples in the bin), resulting in one split along one of the axis of the high-level feature space.
For comparison, we also used k -means with 2 clusters.
Constraining the partitioning methods to 2 regions is a choice to provide visually informative grouping diagrams rather than to maximize the lower bound (cid:99)
GL [Table]
When optimizing the lower bound, (Figure 7 and Figure 14), we increase the number of allowed regions in the partition by setting a region ratio: the number of training samples in the bin over the number of allowed regions in the bin.
Fixing a region ratio prevents from having regions with too few samples.
In our experiments, we ﬁx the region ratio to 30.
D. I MAGE N ET -R
ImageNet-R (Hendrycks et al., 2021) is a variant of ImageNet containing renditions of the ImageNet classes.
Example of renditions are: paintings, toys, tattoos and origami.
There are 15 rendition types in total listed in Figure 13.
The dataset contains 30 000 images and is limited to 200 of the
ImageNet classes.
Figure 14a.
compares estimated grouping loss lower bound and calibration errors of all networks (small and best versions) on ImageNet-R. Overall, we observe a strong grouping loss in most of the networks, especially those with highest accuracy.
The estimated debiased lower bound remains high after post-hoc recalibration.
Grouping diagrams of all networks are available at:
• Section D.1.1: ImageNet-R – No post-hoc recalibration, small versions.
• Section D.1.2: ImageNet-R – No post-hoc recalibration, small versions, k-means.
• Section D.1.3: ImageNet-R – No post-hoc recalibration, best versions.
• Section D.1.4:
ImageNet-R – Isotonic calibration, small versions.
• Section D.1.5: ImageNet-R – Isotonic calibration, best versions.
We also investigate whether there is heterogeneity among renditions.
In Figure 13 we observe that some renditions are better predicted than average ( e.g deviant art, sketch or art) while some others are predicted worse than average ( e.g embroidery, cartoon, tattoo).
These considerations would be useful in a fairness setting.
Also, Figure 13 highlights that if we could build regions out of renditions ( i.e renditions are well separated in the feature space), this would result in a high grouping loss lower bound. =-
D. I MAGE N ET -C
ImageNet-C is a variant of ImageNet containing corrupted versions of ImageNet images.
Examples of corruptions are: blur, noise, saturate, contrast, brightness and compression.
There are 19 corruption types in total.
Each corruption has a severity ranging from 1 to 5.
The dataset contains the 50images of the validation set of ImageNet, each of them being applied 19 corruptions with 5 severity levels each.
We built a merged version of ImageNet-C by randomly sampling one corruption for each image.
We also study one corruption only (snow).
For both the merged version and the snow version, we study the maximum severity of the corruption (5).
Figure 14b.
and c. compare estimated grouping loss lower bound and calibration errors of all networks (small and best versions) on ImageNet-C merged and snow.
Overall, we observe similar effect than on ImageNet-R.
However, when all samples have the same corruption (snow), we exhibit more grouping loss among the networks than when the 19 corruptions are randomly applied on the dataset (merged) (Figure 14c.).
An intuition is that heterogeneity created by one corruption is canceled out by another one having heterogeneity in the opposite direction, leading to region scores closer to the average.
Grouping diagrams of all networks are available at:
• Section D.2.1: ImageNet-C – No post-hoc recalibration, small versions.
• Section D.2.2: ImageNet-C – No post-hoc recalibration, best versions.
• Section D.2.3: ImageNet-C – Isotonic calibration, small versions.
• Section D.2.4: ImageNet-C – Isotonic calibration, best versions. [Figure] R e nd iti on s [Figure]
[Table]
before ( (cid:99) CL and (cid:99) GL LB ) and after ( (cid:99) CL (cid:48) and (cid:99) GL (cid:48) LB ) isotonic recalibration.
D. I MAGE N ET -1K VALIDATION SET
The validation set of ImageNet-1K comprises 50 000 samples for 1 000 classes.
Figure 14d.
compares estimated grouping loss lower bound and calibration errors of all networks (small and best versions) on the validation set of ImageNet-1K. Conversely to ImageNet-R and ImageNet-C, we cannot exhibit substantial grouping loss on any of the networks.
The grouping diagrams (Figure 24) show however that ConvNeXt Tiny displays more heterogeneity than the other networks on this dataset.
Grouping diagrams are available in:
• Section D.3.1: ImageNet-1K – No post-hoc recalibration, small versions.
• Section D.3.2: ImageNet-1K – No post-hoc recalibration, best versions.
• Section D.3.3: ImageNet-1K – Isotonic recalibration, small versions.
• Section D.3.4: ImageNet-1K – Isotonic recalibration, best versions.
E NLP
We use BART Large (Lewis et al., 2019) pre-trained on the Multi-Genre Natural Language Inference dataset (Williams et al., 2018) and ﬁne-tuned on the Yahoo Answers Topics dataset for zero-shot topic classiﬁcation.
The ﬁne-tuned model is available on HuggingFace at https://huggingface.
co/joeddav/bart-large-mnli-yahoo-answers .
Yahoo Answers Topics is composed of question titles and bodies and topic labels.
There are 1 400 000 training samples, 60 000 test samples and 10 topics.
The dataset is available at https://huggingface.co/datasets/ yahoo_answers_topics .
The model is ﬁne-tuned on 5 out of the 10 topics of the training set, totalizing 700 000 samples.
Given a question title and a hypothesis ( e.g “This text is about Science &
Mathematics”)
, the model outputs its conﬁdence in the hypothesis to be true for the given question.
The classiﬁcation being zero-shot, the hypothesis can be about an unseen topic.
We evaluate the model separately on the 5 unseen topics and the 5 seen topics of the test set ( i.e seen topics but unseen samples).
This results in a binary classiﬁcation task in which each sample is composed of a question title and a hypothesis and each label is 1 or 0 whether the hypothesis is correct or not.
As for the clustering and calibration procedure, we used a balanced decision stump in the same way as described in Section D: “Detailed experimental method”. a. ImageNet-R b. ImageNet-C (merged) [Table] [Table]
[Equation]
[Table] c [Equation] CL
[Table]
[Figure]
Isotonic
[Table]
[Table]
[Table]
[Table]
c. ImageNet-C (snow) d. ImageNet-1K (validation set)
[Table]
ConvNeXt
[Table]
ResNet
[Table]
Inception 0.
[Table]
[Table]
[Table]
[Table]
82.1 ViT B0.
81.1 RegNet y_32gf 0.
80.9 ViT L0.
79.7 ResNeXt0.
Wide ResNet0.
78.8 Wide ResNet0.
78.5 ResNet0.
78.3 EfﬁcientNet-B 0.
77.7 ResNeXt0.
77.6 DenseNet0.
77.1 DenseNet0.
74.4 VGG-19 BN 0.
74.2 RegNet y_400mf 0.
74.0 MobileNet V3L 0.
74.0 EfﬁcientNet-B 0.
73.9 MNASNet 1.
73.5 MobileNet V 0.
71.9 GoogLeNet 0.
[Table]
D.1.
I
MAGE N ET -R – N O POST - HOC RECALIBRATION , SMALL VERSIONS
AlexNet
VGG
ResNet
DenseNet
[Figure]
C o rr ec t p r e d i c ti on s
Sizes
[Figure]
Sizes
[Figure]
Sizes
[Figure]
Sizes
Inception
GoogleNet
ShufﬂeNet V2 x0.
MobileNet V
[Figure]
rr ec t p r e d i c ti
[Figure]
Sizes
[Figure]
Sizes
[Figure]
Sizes
[Figure]
Sizes
ResNext
WideResNet
MNASNet 0.
EfﬁcientNet B
[Figure]
ec
[Figure]
p r e d i c ti
[Figure]
Sizes
[Figure]
Sizes
[Figure]
Sizes
[Figure]
Sizes
RegNet y_400mf
ViT BConvNeXt Tiny
[Figure]
split strategy.
D.1.
I MAGE N ET -R – N O POST - HOC RECALIBRATION , SMALL VERSIONS , K - MEANS
AlexNet
VGG
ResNet
DenseNet
[Figure]
C o rr ec t p r e d i c ti on s
Sizes
[Figure]
Sizes
[Figure]
Sizes
[Figure]
Sizes
Inception
GoogleNet
ShufﬂeNet V2 x0.
MobileNet V
[Figure]
t p r e d i c ti
[Figure]
Sizes
[Figure]
Sizes
[Figure]
Sizes
[Figure]
Sizes
ResNext
WideResNet
MNASNet 0.
EfﬁcientNet B
[Figure]
Sizes
RegNet y_400mf
ViT BConvNeXt Tiny
[Figure]
D.1.
I MAGE N ET -
R
– N O POST - HOC RECALIBRATION , BEST VERSIONS
VGG 19 BN
ResNet
DenseNet
ShufﬂeNet V2 x1.
[Figure]
rr ec t p r e d i c ti on s Sizes
[Figure]
Sizes
[Figure]
Sizes
[Figure]
Sizes
MobileNet V3 Large
ResNext
WideResNet
MNASNet 1.
[Figure]
i
[Figure]
Sizes
[Figure]
RegNet y
[Figure]
32gf
ViT LConvNeXt Large
[Figure]
D.1.
I MAGE N ET -R – I SOTONIC
AlexNet
VGG
ResNet
DenseNet
[Figure]
C o rr ec t p r e d i c ti on s
Sizes
[Figure]
Sizes
[Figure]
Confidence
[Figure]
Sizes
[Figure]
Sizes
Inception
GoogleNet
ShufﬂeNet V2 x0.
MobileNet V
[Figure]
rr ec t p r e d i c ti
[Figure]
Sizes
[Figure]
Sizes
[Figure]
Sizes
[Figure]
Sizes
ResNext
WideResNet
MNASNet 0.
EfﬁcientNet B
[Figure]
Sizes
[Figure]
Sizes
[Figure]
Sizes
[Figure]
Sizes
RegNet y_400mf
ViT BConvNeXt Tiny
[Figure]
D.1. I MAGE N ET -R – I SOTONIC CALIBRATION , BEST VERSIONS
VGG 19 BN
ResNet
DenseNet
ShufﬂeNet V2 x1.
[Figure]
C o rr ec t p r e d i c ti on s
Sizes
[Figure]
Sizes  1 Confidence score Sizes  1 Confidence
[Figure]
Sizes
MobileNet V3 Large
ResNext
WideResNet
MNASNet 1.
[Figure]
ec t p r e
[Figure]
i
[Figure]
ti
[Figure]
Sizes
[Figure]
Sizes
[Figure]
Sizes
[Figure]
Sizes
EfﬁcientNet B
RegNet y_32gf
ViT LConvNeXt Large
[Figure]
Sizes
[Figure]
Sizes
[Figure]
Sizes
[Figure]
Sizes
D.2. I MAGE N ET -C – N O POST - HOC RECALIBRATION , SMALL VERSIONS
AlexNet
VGG
ResNet
DenseNet
[Figure]
C o rr ec t p r e d i c ti on s
Sizes
[Figure]
Sizes
[Figure]
Sizes
[Figure]
Sizes
Inception
GoogleNet
ShufﬂeNet V2 x0.
MobileNet V
[Figure]
o rr ec t p r e d i c ti on s
Sizes
[Figure]
Sizes
[Figure]
Sizes
[Figure]
Sizes
ResNext
WideResNet
MNASNet 0.
EfﬁcientNet B
[Figure]
rr ec t p r e d i c ti
[Figure]
Sizes
[Figure]
Sizes
[Figure]
Sizes
[Figure]
Sizes
RegNet y_400mf
ViT BConvNeXt Tiny
[Figure]
t
[Figure]
i c ti
[Figure]
[Table] [Table]
D.2.
I MAGE N ET -C – N O POST - HOC RECALIBRATION , BEST VERSIONS
VGG 19 BN
ResNet
DenseNet
ShufﬂeNet V2 x1.
[Figure]
C o rr ec t p r e d i c ti on s
Sizes
[Figure]
Sizes
[Figure]
Sizes
[Figure]
Sizes
MobileNet V3 Large
ResNext
WideResNet
MNASNet 1.
[Figure]
ec t p r e d i c ti
[Figure]
Sizes
[Figure]
Sizes
[Figure]
Sizes
EfﬁcientNet B
RegNet y_32gf
ViT LConvNeXt Large
[Figure]
Sizes
[Figure]
Sizes
[Figure]
Sizes
[Figure]
Sizes
D.
I
AlexNet
VGG
ResNet
DenseNet
[Figure]
C o rr ec t p r e d i c ti on s
Sizes
[Figure]
Sizes
[Figure]
Sizes
[Figure]
Sizes
Inception
GoogleNet
ShufﬂeNet V2 x0.
MobileNet V
[Figure]
rr ec t p r e d i c ti
[Figure]
Sizes
[Figure]
Sizes
[Figure]
Sizes
[Figure]
Sizes
ResNext
WideResNet
MNASNet 0.
EfﬁcientNet B
[Figure]
e
[Figure]
i
[Figure]
Sizes
[Figure]
Sizes
[Figure]
Sizes
RegNet y_400mf
ViT BConvNeXt Tiny
[Figure]
D.2. I MAGE N ET -C – I SOTONIC CALIBRATION , BEST VERSIONS
VGG 19 BN
ResNet
DenseNet
ShufﬂeNet V2 x1.
[Figure]
C o rr ec t p r e d i c ti on s
Sizes
[Figure]
Sizes
[Figure]
Sizes
[Figure]
Sizes
MobileNet V3 Large
ResNext
WideResNet
MNASNet 1.
[Figure]
t p r e d i c ti
[Figure]
Sizes
[Figure]
Sizes
[Figure]
Sizes
[Figure]
Sizes
EfﬁcientNet B
RegNet y
[Figure]
32gf
ViT LConvNeXt Large
[Figure]
Sizes
[Figure]
Sizes
[Figure]
Sizes
[Figure]
Sizes
D.3. I MAGE N ET -1K – N O POST - HOC RECALIBRATION , SMALL VERSIONS
AlexNet
VGG
ResNet
DenseNet
[Figure]
C o rr ec t p r e d i c ti on s
Sizes
[Figure]
Sizes
[Figure]
Sizes
[Figure]
Sizes
Inception
GoogleNet
ShufﬂeNet V2 x0.
MobileNet V
[Figure]
rr ec t p r e d i c ti
[Figure]
Sizes
[Figure]
Sizes
[Figure]
Sizes
[Figure] Sizes ResNext
WideResNet
MNASNet 0.
EfﬁcientNet B
[Figure]
rr ec t p r e d i c ti
[Figure]
Sizes
[Figure]
Sizes
[Figure]
Sizes
[Figure]
Sizes
RegNet y_400mf
ViT BConvNeXt Tiny
[Figure]
[Table] [Table]
D.3.
I MAGE N ET -1K – N O POST - HOC RECALIBRATION , BEST VERSIONS
VGG 19 BN
ResNet
DenseNet
ShufﬂeNet V2 x1.
[Figure]
C o rr ec t p r e d i c ti on s
Sizes
[Figure]
Sizes
[Figure]
Sizes
[Figure]
Sizes
MobileNet V3 Large
ResNext
WideResNet
MNASNet 1.
[Figure]
ec t p r e d i c ti on s
Sizes
[Figure]
Sizes
[Figure]
Sizes
[Figure]
Sizes
EfﬁcientNet B
RegNet y_32gf
ViT LConvNeXt Large
[Figure]
Sizes
[Figure]
Sizes
[Figure]
Sizes
[Figure]
Sizes
D.
I
AlexNet
VGG
ResNet
DenseNet
[Figure]
C o rr ec t p r e d i c ti on s
Sizes
[Figure]
Sizes
[Figure]
Sizes
[Figure]
Sizes
Inception
GoogleNet
ShufﬂeNet V2 x0.
MobileNet V
[Figure]
ec t p r e d i c ti
[Figure]
Sizes
[Figure]
Sizes
[Figure]
Sizes
[Figure]
Sizes
ResNext
WideResNet
MNASNet 0.
EfﬁcientNet B
[Figure]
Sizes
[Figure]
Sizes
[Figure]
Sizes
[Figure]
Sizes
RegNet y_400mf
ViT BConvNeXt Tiny
[Figure]
test split strategy.
D.3. I
MAGE N
ET
1K – I SOTONIC RECALIBRATION
BEST
VERSIONS
VGG 19 BN
ResNet
DenseNet
ShufﬂeNet V2 x1.
[Figure]
o rr ec t p r e d i c ti on s
Sizes
[Figure]
Sizes
[Figure]
Sizes
[Figure]
Sizes
MobileNet V3 Large
ResNext
WideResNet
MNASNet 1.
[Figure]
t p r e d i c ti
[Figure]
Sizes
[Figure]
Sizes
[Figure]
RegNet y
[Figure]
32gf
ViT LConvNeXt Large
[Figure]