Beyond probability partitions: Calibrating neural networks with semantic aware grouping
Authors: Jia-Qi Yang
De-Chuan Zhan
Le Gan
Venue: NeurIPS 2023 poster (2023)
Keywords: Uncertainty calibration
Deep neural networks

Abstract: Research has shown that deep networks tend to be overly optimistic about their predictions, leading to an underestimation of prediction errors. Due to the limited nature of data, existing studies have proposed various methods based on model prediction probabilities to bin the data and evaluate calibration error. We propose a more generalized definition of calibration error called Partitioned Calibration Error (PCE), revealing that the key difference among these calibration error metrics lies in how the data space is partitioned. We put forth an intuitive proposition that an accurate model should be calibrated across any partition, suggesting that the input space partitioning can extend beyond just the partitioning of prediction probabilities, and include partitions directly related to the input. Through semantic-related partitioning functions, we demonstrate that the relationship between model accuracy and calibration lies in the granularity of the partitioning function. This highlights the importance of partitioning criteria for training a calibrated and accurate model. To validate the aforementioned analysis, we propose a method that involves jointly learning a semantic aware grouping function based on deep model features and logits to partition the data space into subsets. Subsequently, a separate calibration function is learned for each subset. Experimental results demonstrate that our approach achieves significant performance improvements across multiple datasets and network architectures, thus highlighting the importance of the partitioning function for calibration.

Beyond Probability Partitions: Calibrating Neural Networks with Semantic Aware Grouping
Jia-Qi Yang De-Chuan Zhan" Le Gan
State Key Laboratory for Novel Software Technology Nanjing University, Nanjing, 210023, China yangjq0l amda..aammmm.mm..m .nj. edu. cn, z eddu edu. ganle@nju edu.
Abstract
Research has shown that deep networks tend to be overly optimistic about their predictions, leading an underestimation of prediction errors. Due to the limited nature of data, existing studies have proposed various methods based on model prediction probabilities to bin the data and evaluate calibration error. We propose a more generalized definition of calibration error called Partitioned Calibration Error (PCE), revealing that the key difference among these calibration error metrics lies in how the data space is partitioned. We put forth an intuitive proposition that an accurate model should be calibrated across any partition, suggesting that the imput space partitioning can extend beyond just the partitioning of prediction probabilities, and include partitions directly related the input. Through semantic- related partitioning functions, we demonstrate that the relationship between model accuracy and calibration lies in the granularity of the partitioning function. This highlights the importance of partitioning criteria for training a calibrated and accurate model. To validate the aforementioned analysis, we propose method that involves jointly learning semantic aware grouping function based on deep model features and logits to partition the data space into subsets. Subsequently, a separate calibration function is learned for each subset. Experimental results demonstrate that our approach achieves significant performance improvements across multiple datasets and network architectures, thus highlighting the importance the partitioning function for calibration.
1 Introduction
With the advancements in deep learning technology. deep learning models have achieved, and in some cases even surpassed, human-level accuracy in various domains [ (). In safety-critical applications(3] 4 such self-driving and disease d high accuracy from models but also to have their predicted probabilities reflect the true likelihood of correctness. For instance, if a model predicts a probability of 0.9 for a particular class, we expect the actual probability of being correct to be close to 0.9. This is known probability calibration. However, recent research has indicated that while deep models have improved in accuracy, their probability calibration has declined (7-9). Typically, deep models tend to overestimate the probabilities of correct predictions, leading to overconfidence. This discrepancy between accuracy and calibration has made model calibration crucial research direction. [7] 19
not only desirable to have
Defining an evaluation method for assessing the degree of calibration crucial to calibrating a model. Currently, most evaluation methods are based on binning model prediction probabilities, followed by analyzing the distribution of true labels within each bin 7 12 20 21 The calibration error then estimated by measuring the difference between the predicted probabilities and the empirical
DeeCChun Zhan is the corresponding author.
37th Conference on Neural Information Processing Systems (NcurIPS 2023).

---

1.0
1.0
1.0
1.0
Gop
Gap
Gap
0.8
Accuracy
0.8
Accuracy
0.8
Accuracy
0.8
Accuracy
0.5
0.5
0.6
0.6
0.4
0.4
0.4
0.4
0.2
0.2
0.2
0.2
0.0
0.25
0.50
0.75
1.00
0.00
0.50
0.75
1.00
0
8..00
0.25
1.00
0.00
0.50
1.00
(a) No calibration
(b) Calibrated with IR
(c) Underconfidenee in G₁ (d) Overconfidence in Gz
We reconstruct CIFARIO into binary classification problem (0 4] as positíves, [5-9) as negatives) and train a 52 ot Initially. the predicted probabilities are severely uncalibrated, as shown in (a). Then we train an Isotonic regression (IR) model (with the test labels) to calibrate outputs, which leads to nearly perfect calibration in (b). However, the partitions defined by original labels may reveal underlining miscalibration. For example, let G1 {0, 1, 5, 6, 7), G2 = (3. 4, 8, 9). The outputs of turned out to be significantly underconfident on G1 and overconfident on G2-
Figure 1:
distribution. However, such estimation of calibration error fails to reflect the model's accuracy [22].
For instance, consider binary classification problem where both classes distributed uniformly, and the model consistently outputs a probability of 0.5 for all inputs. Even using the strictest evaluation method for calibration error, this classifier would appear perfectly calibrated (22). In reality, as long as the evaluation of calibration error is solely based on prediction probabilities, a classifier with fixed output marginal distribution p(y) would always be perfectly calibrated but useless. This type of calibration error definition may also be counterintuitive to some extent. For example, recommendation model may be overconfident in one user group and underconfident in another, yet still be considered calibrated overall. However, no user would perceive the model's 's output probabilities as accurate in such cases. To illustrate this issue, we present a constructed experiment in Figure. D which demonstrates the existence of such situations.
For calibrating trained model, existing methods mainly rely transforming the model's predicted probabilities or logits (inputs to the softmax layer) [ [2] 23 For example, histogram binning[7] involves binning the predicted probabilities and calibrating the probabilities within each bin separately. However, as discussed earlier regarding calibration error analysis, if a calibration method relies solely the model's output probabilities for calibration, it cannot achieve calibration across different semantic contexts (x) because the calibration model itself is completely unaware of semantics. Some studies have analyzed calibration across different categories and proposed corresponding calibration methods. For instance, the Dirichlet calibration method[12] models multiclass probabilities as Dirichlet distributions and transforms the uncalibrated probabilities into calibrated ones. These methods incorporate category information, allowing for calibration across different categories. However, this category information may not be directly available, or the known categories may not be the divisions we are interested in. For example, in a recommendation system, we may want the model be calibrated across various skin color groups, even if we may not have access to the corresponding category information.
Contribution. The analysis above has inspired us propose that perfectly calibrated model should be calibrated across any data space partition. We present the Partitioned Calibration Error (PCE) as a comprehensive framework for defining semantic-aware calibration errors. By illustrating that various common calibration error metrics are specific instances of PCE under distinct partition functions, we establish a direct correlation between calibration error and model accuracy: PCE converges to accurate score functions of data uncertainty through bijective grouping function. To discover more effective partition rules, we introduce technique that incorporates a linear layer onto the deep model's 's features, enabling the modeling of the partition function. By employing softmax to generate a soft partition, we achieve end-to-end optimization. By generating diverse partition functions, our approach facilitates calibration across different semantic domains, thereby enhancing overall calibration performance without losing accuracy. Experimental results across multiple datasets and network architectures consistently demonstrate the efficacy of our method in improving calibration.

---

2
Partitioned calibration error and grouping-based calibration
We first present our formulation of PCE, which serves as the foundation for our calibration approach.
2.1 Measuring calibration with partitions
We start by defining the partition by grouping function as follows.
Definition (Grouping function and input space partition). A grouping, function g is mapping from an input group indicator g(z)
G. with the following three properties:
Vo E 3G g, =G
(1)
Vz1, 22, ((1) # g(22) + 21 +
(2)
Y& E 3, D, g =
The group indicator G' is also used to denote the induced subset (xlg(x) G}. Lemma 1. partition of the input space is defined by P {(>]g(<) GHC e 9).
Proof. By definition, the subsets in P are (1) non-overlapping (by Eq. 2), (2) non-emply (by Eq.
(.) (3) the union of all the groups is equal to the universe set(by Eq. which guarantees being valid partition on set D of all valid x.
We use x E and g(z) G interchangeably, and (z. y) E G ++ g(z) G. With the partition defined above, we can now define the partitioned calibration error.
Definition (Partitioned calibration error (PCE)).
ICE(S.g, f.f.D
P(P)
E E(GGE(S(()) GEP
(4)
PEP
Where P is the set all concerned partitions, p(P) is the probability of choosing partition P. p(G) -( p(2, y) is the probability of observing data sample belonging group G, S(-) is a specific statistical magnitude that can be calculated on a group. A straightforward definition of S(.) is the average function S(G) Jz.,y (a( y)y, and S(f(G) = -sn.y PC(x, f)f(z) where y is the one-hot label with y = 1 if E th class and y 0 otherwise. f(x), is the predicted probability of x being äth class. L(.;) -) measures the difference between S(G) and S(f(G). pa (z, y) is the normalized probability density function of x G, that is,
[0. pla.y) P(G)
if G i
(a v)
(5)
We will write Pa (z, y) as PG in the following contents for simplicity. In summary, the aforementioned Eq. { defines PCE, which quantifies the expected disparity between the predicted probabilities and the true probabilities within each subgroup, after randomly selecting a partition.
Example 1 (Expected calibration error (ECE) (23). With g(x) = Bin( of (z)), where Bin(-) returns the corresponding Bin ID, L(a, b) la bl. and keep S the average function.
PCE = Σ [(CCE(((())SSUUC))) = Σ E(( / paf(2) -
-f payl
(6)
Jay
GEP
GEP
and its empirical estimation is
PCE
Σ E
Σ
G
[(z) - Σ
v
G
(a.y)eG
(w.y)e
which is exactly the ECE estimator defined in (23) E..3.
Note that in the above ECE, there only one partition. We provide an example of using multiple partitions in the following example.
3

---

Example 2 (Class-wise ECE(12). There are M partitions corresponding to M classes. The partition of class u denoted by Pa. the corresponding grouping function is defined by gu (z) Bf (z)..)
Classwise- ECE-
Σ Pa
[(x) G
Σ
yl
(8)
M
GEP
(x.a)eG
(a.y)EG
which is exactly the same Eq. 4 in 122).
Example 3 (Top-label calibration error (TCE) 25)).
With g(x) Bin(maxi f(r).), S(G)
T E = arg max; f(x);), and S(f(G) = [ EGay) max; f(x), Resulting in the Top-
label calibration error defined in (25).
From the above examples. it can be observed that the sole distinction among the aforementioned calibration metrics lies in the employed grouping function. Hereinafter, we shall delve into two distinctive scenarios of PCE shed light on the intricate interplay between calibration and accuracy.
Example 4 (One-to-one grouping function). If the grouping function g(-) is a bijection, then every different x belongs to different groups, which corresponds to point-wise accuracy.
/ ((y x.
PCE EP(P) Σ ((G) PEP
GEP
= Minimizing this PCE with bijective grouping function will converge to = p(y|z) if proper score function L (e.g., cross- cross-entropy Brier score (6)) is used with unlimited data. The uncer- tainty reflected by 2()] is called aleatoric uncertainty [27] and is the best a model can achieve corresponding to Bayes error 29).
Example 5 (Constant grouping function). If the grouping functtio g is constant function with Vxi, 22, ((1) = g(x2), then every different x belongs to single group.
(
[
PCE =
p(.. p(a.))f(m),
p(x, 8'1
(10)
which is minimized by the model outputs the marginal distribution [(x)) = ((r.))) p(a,, u)y ply).
We provide proofs and further discussion about Example. (4p and Example. (5) in the supplementary materials. The constant grouping function captures the vanilla uncertainty that we do not have any knowledge about x, and we only know the marginal distribution of y.
The above analysis demonstrates that by employing finer partitions, PCE becomes a closer approx- imation to the measure of accuracy. Conversely, coarser partitions align more closely with the traditional calibration metries utilized in prior research. Since neither extreme partitioning approach applies to practical calibration, selecting an appropriate partitioning method is crucial for calibration performance.
2.2 Calibration with sematic-aware partitions
Calibration methods can be designed from the perspective of minimizing the corresponding PCE. For instance, histogram binning ( adjusts the predicted probabilities within each bin to the mean of the true probabilities in that bin. On the other hand, Bayesian Binning into Quantiles (BBQ) calibration involves setting multiple distinct bin counts and then obtaining a weighted average of the predictions from histogram binning for each bin count, effectively encompassing scenarios with multiple partitions in the PCE. However, existing methods rely binning and calibration based solely on model output probabilities. Our proposed PCE suggests that the partitioning approach can depend not only the predicted probabilities but also on the information in input itself. This would significantly enhance the flexibility of the partitions.
To facilitate implementation, we begin by imposing certain constraints on the range of outputs from the grouping function. We denote the number of partitions by U = |P] (each partition corresponds to specific grouping function as defined in Definition []. and we assume that all data can be partitioned into K groups. The output of the grouping function g takes the form of one-hot encoding, where if belongs to the i-th group, g(z); 1,0 < i < K, while all other g(z), 0. + i. And

---

G = {=]g(>), 1} is the i-th group. Under these conditions, the expression for PCE can be formulated as follows:
K G.l DJ (ls(G)).
PCE = Σ
(11)
From the above equation, is evident that for each group G;, we can learn calibration function fc. specific to that group, which aims to minimize the calibration error within the group G,.
In this paper, we employ the temperature scaling method as the learning approach for the calibration function within each group. Specifically, temperature scaling involves adding learnable temperature parameter 7 to the logits o(z) (i.e., the imput to the softmax function) of the model and applying it to a group, resulting in the following form of grouping loss:
oiry T
Egroup
log
(12)
Gi
ota)y
I.EEG.
Σ E
where the temperature parameter 7; is specific group G,. Note that Cgroup is not direct es- timation of L(S(G;), S(fa, (G.))). Specifically, if we choose S to the average function, so the empirical estimation of S(G.) c Ex,ecc, V, and the empirical estimation of S(Ja, (G.))
TclT Enaver; (1). Then, we choose the difference measure L to be the log-likelihood (cross entropy) S(s
= E, S(G:), log S(fc, (Gi)); where j is the class index. The Lgroun will be minimized by (a,(x) = y, which will also minimize ((S(G)), S(Sa, (G.)). Thus, Eq. 12 is stronger constraint compared with minimizing L(S(G,), S(fa, (G.))) directly. Our choice of this objective is motivated by two reasons: First, Eq. 12 is able to provide more signals during training since each label y can guide corresponding fc, (z) directly. On the contrary, if we optimize L(S(G)), S(fc, (G,))) directly, the labels and predictions are mixed and much label information is lost. Secondly, optimizing Eq. (12) aligns well with the calibration method (TS and ETS) to be used, which leads to better calibration performance.
In the aforementioned equation Eq. 12 we assume that the groups G3 are known. In order to optimize the partition, we incorporate the grouping function g()) into the loss function. By summing the above equation over all groups according to Eq. we can obtain the final optimization objective.
ofsly
LGCHTS =
Σ log Σ g(x);
(13)
D
o(2)
2,EED
Eje
When the output of g(x) in the form of one-hot encoding, the above equation represents standard grouping loss function. To optimize g. we introduce a smoothing technique that transforms its output into a probability value. Specifically, we add linear layer on top of the neural network's features and follow it with a softmax function as the grouping function which takes the following form:
go(x)= = g'((2(x)) = softmax(2(())d.. + (b))
(14)
where = E Di]],,, ow E Rd, cb E B1xk The features z(x) are fixed, which aligns with the post-calibration setting. The above loss function is the combination of grouping and temperature scaling, which is denoted as Grouping Calibration + Temperature Scaling (GC+TS).
Training (x).. The parameters & of grouping function g is trained jointly with the calibration function fo on the validation dataset Deat (used in early stopping when training deep models). In the GC+TS method, the trainable parameters of f is 0 )r.)- In more intuitive sense, equation Eq. (13) necessitates that the grouping function identifies the optimal partitioning, where adjusting т; within each subgroup G; minimizes the cross-entropy loss. Furthermore, due the non-uniqueness of the optimal grouping function that satisfies the aforementioned objective function, we can generate multiple distinct partitions by optimizing with different initial values through multiple iterations. To mitigate the potential overfitting caused by the high flexibility of the grouping function g. we have introduced an additional regularization term, and the overall training loss of training Is is LoC+Ts A11
Training fo) After training of go. we simply apply calibration method to each group. We can also use temperature scaling in this phase while using hard grouping in Eq. (13 Any other
5

---

calibration methods are also applicable, for example, we also adopt Ensemble Temperature Scaling (ETS) [23] method obtain GC+ETS our experiments. The calibration function fo trained on the holdout training dataset DEo. while keeping the grouping function fixed. Then the calibration function f used on each group of the testing dataset. The overall training and predicting procedure is summarized in Algorithm. [
Calibrating with trained partitions. After training, we partition the input space into different partitions. In each partition, an input x corresponds to a unique group G and a calibration function fo()), which results in calibrated probability p(y] G). Since there are many different partitions. the groups can be treated as sampled from distribution p(G|ær. We ensemble the calibrated probabilities as the final prediction, which is indeed an Monte-Carlo's 's estimation of p(yla) Eg P(yl ())) This ensemble approach is described in Line 5-11 of Algorithm,
Algorithm Train group calibration with temperature scaling (GC+TS)
Input: Deol = { (Zrat, Oval, Yeat J Dho = {Zhos Ohos Yho Drest = (Zrest, Otest K,K,A X
Output: Calibrated Yrest
1: for <- 0 U 1 do
2: Randomly initialize 6u and 0n
3: Optimize e.,, and 0g Des minimize Eq. 13 with L-BFGS
4: Optimize Ous on Dho to minimize Eq. (II) with base calibration method(e.g, TS)
5: Calculate partition Pu {Gui] with grouping function go. on Dtest
6: for i + 0 to K - do
7: Calibrate Gui with fe... (-) to obtain Yui
8: end for
9: Merge predicts different groups Y, {Yae}
10: end for
11:
Ensemble predicts in different partitions Veest = t En 8n
On the usage of Dval and Dro- Guo et al. 7 explicitly states that the validation dataset Deat used for early stopping can used for calibration, while most researchers use hold-out dataset Dho that is not used during training for calibration 12 23 25 Experimentally, we found that calibrating with Deat is significantly worse than Dho for existing calibration methods. Interestingly, the grouping function trained on the D can transfer to Dro for improving performance, which means the training of gø does not require additional data. We investigate this problem in the supplementary in detail.
An essential characteristic of calibration methods is their ability to preserve accuracy 233, ensuring that the classes with the highest probabilities remain unchanged after the calibration process.
Theorem preeerrcyy of group calibration). Group calibration with any group-wiss accuracy-preserving base calibration method is also accurucy-preservinng
Proof Sketch. Since the groups are disjoint, group- siiup--ieeeae accuracy-preserving preserving remains overall securacy-preservvee Ensembles of securacy-preservvee predictions are also securacy-preserving O
The Theorem. ggaaranttes our group calibration method remains eecuracy-preservvee with accuracy- preserving base methods such as temperature scaling(7) ensemble temperature scaling 23
3 Experiments
To evaluate the performance of our method under various circumstances, we selected three datasets: CIFAR10, CIFAR 100(31), and Imagenet[]]. We employed different models for each dataset reflect our approach's calibration capability across various model accuracy level The models used in our experiments include Resnet[].. VGG[2). Densenet 33 SWIN
34 and ShuffieNet
We randomly partitioned a validation set Deot from the standard training set: CIFAR IO and CIFAR 100 adopted 10% of the data for validation, while Imagenet utilized 5%. Additionally, we randomly sampled 10% of the hold-out data Dro from the standard test set for calibration. We performed 100 different test set splits for each dataset-model combination to obtain reliable results and reported
"Code and Appendix available at htttp:////gtthb.b..////xxxxaa/er

---

the average performance over 100 trials for each method. We conduct paired t-test 33 to measure the static significance the improvements. The hyperparameters of the comparative methods were tuned based on the corresponding literature with 5-fold cross-validation on the CIFARIO- 10-AROO-Reee (00-Reseet15 52 dataset. We fixed the number of groups at K 2 and the number of partitions 20 is not necessarily the optimal value. The strength of regularization was set to À = 0.1, following similar tuning approach as the comparative methods.
= 20, although
3.1 Experimental comparison
Table Comparison of accuracy accuracy-preserving calibration methods. We utilized bold font to highlight the statistically superior (p < 0.01) results.
Dataset
Model
Uncal
TS
ETS
IRM(AP)
GC+TS(ours)
GC+ETS(ous)
CIFARIO
Resnet152
0.0249
0.0086
0.0101
0.0115
0.0079
0.0089
CIFARIO
Shufffenet
0.0464
0.0107
0.0103
0.0146
0.0099
0.0093
CIFARIO
VGG11
0.0473
0.0125
0.0135
0.0157
0.0120
0.0122
CIFARI00
Densenet121
0.0558
0.0418
0.0289
0.0415
0.0411
0.0280
CIFARIO0
Resnet50
0.0580
0,0435
0.0292
0.0424
0.0427
0.0269
CIFAR100
VGG19
0.1668
0.0485
0.0472
0.0476
0.0414
0.0360
Imagenet
R8
0.0279
0.0178
0.0104
0.0188
0.0173
0.0100
Imagenet
Resnet50
0.0382
0.0182
0.0102
0.0218
0.0174
0.0103
Imagenet Swin
0.0266
0.0367
0.0218
0.0140
0.0366
0.0193
Average improvements
-5.03%
-8.92%
Accuracy preserving methods. We compared approach with methods that offer accuracy assurance, including uncalibrated (Uncal), temperature scaling (T)) Ensemble Temperature Scaling (ETS) (23,, and multi-class isotonic regression with accuracy-pree accuracy-preservingg (IRM(AP)) 23 methods. We report the top-label ECE[5]. From Table. ( it can be observed that our method achieves the best performance on the majority of datasets, and the improvement is statistically significant. Another noteworthy aspect is the enhancement our method demonstrates when compared to the base methods without partitioning, namely GC+TS compared to TS, and GS+ETS compared to ETS. We have provided the average improvement relative to the corresponding base methods the last row of Table Specifically, GC+TS shows an average improvement of 5.03% over TS, while GC+ETS demonstrates an average improvement of 8. 8,92% over ETS. This indicates that employing better partitioning strategies can enhance calibration performance.
Table 2: Comparison of non-accuuracy-preserving calibration methods.
Dataset
Model
Hist.
BBQ
DirODIR
GPC:
IRM(NAP)
GC+ETS (ours)
CIFARIO
Resnet152
0.0172
0.0095
0.0097
0.0101
0.0189
0,0087
-0.079%
0.0089
CIFARTO
Shufflenet
0.0322
0.0137
0.0139
0.0158
0.0341
0,0119
-0.050%
0.0093
CIFARIO
VGGHI
0.0279
0.0150
0.0137
0.0156
0.0376
0.0119
-0.129%
0.0122
CIFAR1O0
D1
0.0632
0.0520
0.0307
0.0533
0.0306
-0.149%
0.0280
CIFARI00
Resnet50
0.0618
0.0550
0,0334
0.0553
0.0346
0.0422
-3,686%
0.0269
CIFARI00
VGG19
0.0453
0.0642
0.0446
0.0932
0.1406
0.0470
-5.046%
0.0360
Imagenet
Resnet18
0.0714
0.0690
0.0483
0.0386
0.0119
-0.027%
0.0100
Imagenet
Resnet50
0.0502
0.0707
0.0482
0.0326
0.0107
-0.006%
0.0103
Imagenet
Swin
0.0335
0.0629
0.0478
0.0148
0.0110
-0.060%
0.0193
GPC failed to converge within a day Imagenet datasets.
Non-accuracy preserving methods. We also compared our method with calibration approaches that do not guarantee accuracy, including Histogram Binning(Histt.))))) Beta Calibration (Beta) (10), Bayesian Binning into Quantiles (IB)) Dirichlet calibration with ODIR regularisation (DirODIR) multi-class isotonic regression without eccuracy-preserving (IRM(NAP)) 23) and Gaussian process calibration (24)) The comparative results are presented in Table. (2). It
can be observed that our method achieves improved calibration performance while maintaining the
We found that IRM with e & 1 is indeed not accuracy preserving, we use = 10-3 in IRM(AP) and 10 in IRM(N We discuss this problem in the supplementary material in detail.
7

---

same predictive accuracy. On the majority of datasets, our method either meets surpasses the pecurracy-reseeviing best non-accuracy- preserving methods. We have also included in Table. (2) the influence of the waaaccuuracc-preeeeviie
method with the lowest ECF on predictive accuracy. It is evident that these methods generally have a noticeable negative impact on model accuracy. In contrast, our proposed method preserves the predictive results, ensuring that the predictive accuracy remains unchanged. We provide all the details and codes of the experiments in the supplementary material, as well as a few additional evaluation metrics (NLL, Birer score) and methods (vector scaling, isotonic regression, IZ] which also supports that our method performs best.
1000
3000
802
Number in group
Number in each group
600
402
420
200
200
Abplane
Astoriabiig
669
h9g
Shep
ARd
DAR
D39
209
HOuM
Ship
Figure 2: Visualization of learned grouping function on CIFARIO.
3.2 Verifying effects of grouping functions
Quantitative analysis. We conduct experiments the constructed setting described in Figure. I with TS and our GC+TS method. TS has ECE=0.01557 and GC+TS has ECE=0.0118, We calculate the PCE with the partitions learned by our GC method, and PCE of TS=0.0174, PCE of GC+TS=0.011 which indicates that GC+TS does improve the overall calibration performance by minimizing PCE.
Visualization of learned partitions. To explore the partition functions learned by our method, we visualized the output results the grouping function on the CIFAR 10-Resnet122 dataset. Specifically, calculated the proportion of each class within each group and visualized two representative partitions in Figure. 2 In the left figure, group primarily consists of airplanes, cars, birds, frogs, ships, and trucks. These classes may share certain visual characteristics like blue sky and water, which implies that the model's predictions might exhibit systematic overconfidence or underconfidence within these categories. Applying group-specific calibration function this group can help mitigate miscalibration issues. the right figure, group mainly comprises cats, deer, and dogs, which also share some visual features. To conclude, our proposed method can implicitly uncover meaningful partitions from the data despite not directly defining a partitioning approach.
3.3 Ablation study
We conducted experiments on the CIFARIO-Resnette dataset to investigate the impact of three hyperparameters in our method: the number of partitions, the number of groups within each par- tition, and the regularization strength used in the grouping function. The results are presented in Figure. 3 We observed that as the number of groups decreases, both NLL (negative log- likelihood) and ECE generally exhibit monotonic increase. We attribute this trend to the fact that increasing the number of groups leads to fewer data points within each group, exacerbat- ing model overfitting. On the other hand, as the number of partitions increases, the calibration performance consistently improves. This finding suggests that training on multiple distinct par- titions can enhance the model's performance across various partitions, thereby improving the model's 's overall performance. This can be viewed as incorporating prior knowledge into the model,

---

01146
0.381
003825
0,0081
0,00805
0.0081
0.3449
0.245
0.08055
0.1405
0.148
NLL ECE
0.3488
NIL ECE
0,0079
0,079
0.03785
0,00785
0.144
0.0778
011485
0,0078
(a) Number of groups
(b) Number of partitions
Figure 3: The influence of the number of partitions and the number of groups in each partition.
indicating that the model's predictions should be well-
calibrated across any partition. The influence of the reg-
0.0083
ularization strength hyperparameter in the grouping func-
0.1454
tion is depicted in Figure. can be observed that when the regularization strength is too high (i.e., value of I),
0.0082
0.0082
0.0881
0.1450
the calibration performance is poorer. This suggests that in such cases, the expressive power of the grouping func- tion insufficient to learn meaningful groups that aid in calibration. Conversely, when the regularization strength too low, the performance also deteriorates because the grouping function's expressive power excessive, leading to the learning of partition functions that are specific to the training set and lack generalization.
0.0081
0.148
0.0050
0.0080
01166
NLL
ECE
0.0079
0.0079
0.146
0.0078
1.F400 1.-02 1.F-6 1.F-05 1.7-66
Figure 4: Influence of
Related Work
We provide concise overview of recent academic research on the definition, evaluation, and advancements calibration methods.
Measures of calibration. In safety-critica applications 3 and tasks involving probability estimation (37 is crucial to ensure that models not only deliver high accuracy but also provide predicted probabilities that accurately represent the genuine likelihood of correctness. As discussed in Section. 2. calibration, being a collective concept without direct labels, typically evaluated by binning the predicted probabilities using different binning approaches. Various studies have proposed different binning methods, each focusing on a different aspect. For example, Kumar et al.
255 proposed binning based the maximum predicted probability, Kull al. [12] introduced binning using probabilities for all classes, and Zhang et al. (23,, Popordanoska et al. [43], Kumar et al. [44] proposed kernel methods, which can be seen smoothed binning approach. In framework, these methods can be considered as applying different grouping functions, where the grouping functions solely utilize the predicted probabilities. Additionally, other studies have explored alternative characteristics
calibration. For instance, Vaicenavicius et al. [22) and Gupta et al. [4] proposed hypothesis testing methods to assess whether the predicted probabilities approximate calibration, which is still defined solely on the predicted probabilities. Proper scoring rules such as likelihoods and Brier scores are also used evaluate calibration 26 45 which typically used as a training loss to improve calibration.
The calibration considering fairness [46] 47 is also highly related to this work, where the calibration within different populations is considered. Perez-Lebet al. 488 established an explained component as metric that lower-bounds the grouping loss in the proper scoring rule theory. However, our work concentrates on learning a better grouping function to improve holistic calibration performance, rather than calibrating some given groups[47) (47).
Improving calibration of deep models. The calibration of deep models can be categorized into two main directions. The first direction involves calibrating the model during the training phase by
modifying the training process itself 23 26 51). This may include using specialized loss functions
tailored for calibration (5), employing ensemble methods [66] (33,, data augmentation (54)) etc.

---

However, such approaches require modifications to the training phase and may entail relatively higher computational costs.
The second direction focuses on calibrating the model during the prediction phase. These methods highly related to the definition of calibration metrics, which involves minimizing the discrepaney between model predictions and aggregated statistics within each bin. The simplest method is histogram binning 37, where predicted probabilities are directly adjusted to match the actual class proportions within each bin. BBQ further proposes an ensemble approach that calibrates results obtained with different numbers of bins. The transformation functions applied to predictions can also be improved beyond averaging within bins. For example, Beta distribution can fit the probability transformation for binary classification [[O], while Dirichlet distribution can be employed for multi-class transformation [2]. New families of transformation functions have been proposed to preserve the ordering of predicted probabilities while improving calibration performance [3] 23]. Our method is orthogonal to these calibration methods since the underlying motivation of existing methods minimize the calibration error within a single group, while our method offers greater flexibility as we can employ different calibration functions for different groups.
Some recent work also proposed calibration with given groups. Multicalibration [55] proposes an algorithm for learning a multi-calibrated predictor with respect to any given subpopulation class. Durfee et al. [56] proposed to group the feature space with decision trees, then apply Platt scaling within each group, which concentrates on calibration ranking metrics (AUC), while our work concentrates on PCE metries and proper scoring rules Ligg-Likeihooo), Yüksekgönül et [57] and Xiong et al. [58] propose heuristic grouping functions and apply specific calibration method within each group, while we aim to propose learning- based method that can generate partitions in an end-to-end manner.
5 Conclusion and limitations
This paper proposes a novel approach to define model uncertainty calibration from the perspective of partitioning the input space, thereby unifying previous binning-based calibration metrics within single framework. Additionally, allowing it to be defined on semantically relevant partitions. We establish a connection between calibration and accuracy metrics using semantically relevant partitions. Furthermore, our analysis inspires introducing a method based on learning grouping functions to discover improved partitioning patterns, thus aiding in learning the calibration function. Our framework holds substantial potential for further development, such as optimizing subset selection methods and refining model design, which will be our future work.
extend the notion of calibration beyond output probabilities,
Limitations. Increasing the number of partitions or employing more complex grouping models will result in higher computational complexity, which is limitation of our method. Nevertheless, when compared to other Bayesian methods [1
MiR 22 24], our method demonstrates notably faster speed. We present analysis and experimental comparisons of computational complexities in the supplementary material. Due to the reliance of our method on the features extracted from deep models, it is not applicable for calibrating non-deep models such tree models 59 and SVMs 12 60].
Acknowledgements
This work is supported by the National Key R&D Program of China (2022ZD0114805),
References
[1] Olga Russakovsky, Jia Deng. Hao Su, Jonathan Krause, Sanjeev Satheesh, Sean Ma. Zhiheng Huang, Andrej Karpathy, Aditya Khosla, Michael S. Bernstein, Alexander C. Berg, and Li Fei- Fei. Imagenet large scale visual recognition challenge. Int. J. Comput. Vis., 115(3):11-2522 2015.
[2] Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Deep residual learning for image recognition. In CVPR, 2016.
10

---

[3] Dario Amodei, Chris Olah, Jacob Steinhardt, Paul F. Christiano, John Schulman, and Dan Mané. Concrete problems in Al safety. CoRR, abs/1606.06560 2016.
[4] Zoubin Ghahramani. Probabilistic machine learning and artificial intelligence. Nature, 521 (7553):452 459, 2015.
[5] Mariusz Bojarski, Davide Del Testa, Daniel Dworakowski, Bernhard Firner, Beat Flepp, Prasoon Goyal, Lawrence Jackel, Mathew Monfort, Urs Muller, Jiakai Zhang. Xin Zhang, Jake Zhao, and Karol Zieba. End to end learning for self-driving cars. CoRR, abs/1604.073lk 2016.
[6] Andre Esteva, Brett Kuprel, Roberto A Novoa, Justin Ko, Susan M Swetter, Helen M Blau, and Sebastian Thrun. Dermatologist-level classification of skin cancer with deep neural networks. nature, 542(7639): 15-118, 2017.
[7] Chuan Guo, Geoff Pleiss, Yu Sun, and Kilian Q. Weinberger. On calibration of modern neural networks. ICML., 2017.
[8] Jakob Gawlikowski, Cedrique Rovile Njieutcheu Tassi, Mohsin Ali, Jongseok Lee, Matthias Humt, Jianxiang Feng, Anna M. Kruspe, Rudolph Triebel, Peter Jung, Ribana Roscher, Muham- mad Shahzad, Wen Yang, Richard Bamler, and Xiao Xiang Zhu. A survey of uncertainty in deep neural networks. CoRR, abs/2107.0333 2021.
[9] Moloud Abdar, Farhad Pourpanah, Sadiq Hussain, Dana Rezazadegan, Li Liu, Mohammad Ghavamzadeh, Paul W. Fieguth, Xiaochun Cao, Abbas Khosravi, U. Rajendra Acharya, Vladimir Makarenkov, and Saeid Nahavandi. A review of uncertainty quantification in deep learning: Techniques, applications and challenges. Inf. Fusion, 76:243-297, 2021.
[10] Meelis Kull, Telmo de Menezes Silva Filho, and Peter Flach. Beta calibration: well- founded and easily implemented improvement on logistic calibration for binary classifiers. In AISTATS, 2017.
[11] Mahdi Pakdaman Naeini, Gregory F. Cooper, and Milos Hauskrecht. Obtaining well calibrated probabilities using bayesian binning. In AAAI, 2015.
[12] Meelis Kull, Miquel Perello Nieto, Markus Kängsepp, Telmo Silva Filho, Hao Song, and Peter Flach. Beyond temperature scaling: Obtaining well-calibrated multi-class probabilities with dirichlet calibration. In NeurIPS, 2019.
[13] Amir Rahimi, Amirreza Shaban, Ching-An Cheng, Richard Hartley, and Byron Boots. Intra order-preserving functions for calibration of multi-class neural networks. In NeurIPS, 2020.
[14] Kartik Gupta, Amir Rahimi, Thalaiyasingam Ajanthan, Thomas Mensink, Cristian Sminchis- escu, and Richard Hartley. Calibration of neural networks using splines. In ICLR, 2021.
[15] Yu Bai, Song Mei, Huan Wang, and Caiming Xiong. Don't just blame over-parametrization for over-confidence: Theoretical analysis of calibration in binary classification. In ICMI,, 2021.
[16] Christian Tomani and Florian Buettner. Towards trustworthy predictions from deep neural networks with fast adversarial calibration. In AAAI, 2021.
[17] Muhammad Akhtar Munir, Muhammad Haris Khan, M. Saquib Sarfraz, and Mohsen Ali. Towards improving calibration in object detection under domain shift. In NeurIPS, 2022.
[18) Rajeev Verma and Eric T. Nalisnick. Calibrated learning to defer with one-vs-all classifiers. In ICML., 2022.
[19] Volodymyr Kuleshov, Nathan Fenner, and Stefano Ermon. Accurate uncertainties for deep learning using calibrated regression. ICML, 2018.
[20] Matthias Minderer, Josip Djolonga, Rob Romijnders, Frances Hubis, Xiaohua Zhai Neil Houlsby, Dustin Tran, and Mario Lucic. Revisiting the calibration of modern neural networks. In NewrIPS, 2021.
[21] Bianca Zadrozny and Charles Elkan. Transforming classifier scores into accurate multiclass probability estimates. In KDD, 2002.

---

[22] Juozas Vaicenavicius, David Widmann, Carl R. Andersson, Fredrik Lindsten, Jacob Roll, and Thomas B. Schön. Evaluating model calibration classification. In AISTASS, 2019.
[23] Jize Zhang, Bhavya Kailkhura, and Thomas Yong-Jin Han. Mix-n-match. Ensemble and compositional methods for uncertainty calibration in deep learning. 202,,,2000
[24] Jonathan Wenger, Hedvig Kjellström, and Rudolph Triebel. Non-parametric calibration for classification. In AISTATS, 2020.
[25] Ananya Kumar, Perey Liang, and Tengyu Ma. Verified uncertainty calibration. In NeurIPS, 2019.
[26] Balaji Lakshminarayanan, Alexander Pritzel, and Charles Blundell. Simple and scalable predictive uncertainty estimation using deep ensembles. In NIPS, 2017.
[27] Eyke Hüllermeier and Willem Waegeman. Aleatoric and epistemic uncertainty in machine learning: an introduction to concepts and methods. Mach. Learn., 110(3)457-506, 2021.
[28] Thomas M. Cover and Peter E. Hart. Nearest neighbor pattern classification. IEEE Trans. Inf. Theory, 13(1):21-22) 27, 1967.
[29] Takashi Ishida, Ikko Yamane, Nontawat Charoenphakdee, Gang Niu, and Masashi Sugiyama. Is the performance of my deep network too good to be true? direct approach to estimating the bayes error in binary classification. In ICLR, 2023.
[30] Raghu Bollapragada, Dheevatsa Mudigere, Jorge Nocedal, Hao-Jun Michael Shi, and Ping Tak Peter Tang. progressive batching L-BFGS method for machine learning. In ICML, 2018.
[31] Alex Krizhevsky, Geoffrey Hinton, et al. Learning multiple layers of features from tiny images.
2009.
[32] Karen Simonyan and Andrew Zisserman. Very deep convolutional networks for large-scale image recognition. In ICLR, 2015.
[33] Gao Huang, Zhuang Liu, Laurens van der Maaten, and Kilian Q Weinberger. Densely connected convolutional networks. In CVPR, 2017.
[34] Ze Liu, Yutong Lin, Yue Cao, Han Hu, Yixuan Wei, Zheng Zhang, Stephen Lin, and Baining Guo. Swin transformer: Hierarchical vision transformer using shifted windows. In ICCV, 2021.
[35] Xiangyu Zhang, Xinyu Zhou, Mengxiao Lin, and Jian Sun. Shufflenet: An extremely efficient convolutional neural network for mobile devices. In CVPR, 2018
[36] Amanda Ross and Victor L Willson. Basic and advanced statistical tests: Writing results sections and creating tables and figures. Springer, 2018
[37] Sheng Liu, Aakash Kaku, Weicheng Zhu, Matan Leibovich, Sreyas Mohan, Boyang Yu, Haoxi- ang Huang, Laure Zanna, Narges Jonathan,Jonaahann Jonathan Niee,,Weed, and Carlos Fernandez-Granda Deep probability estimation. ICML, 2022.
[38] Jia-Qi Yang and De-Chuan Zhan. Generalized delayed feedback model with post-click informa- tion in recommender systems. In NewrlPS, 2022.
[39] Jia-Qi Yang, Ke-Bin Fan, Hao Ma, and De-Chuan Zhan. Rid-noise: Towards robust inverse design under noisy environments. In AAAI, 2022.
[40] Nengjun Zhu, Jian Cao, Yanchi Liu, Yang Yang, Haochao Ying, and Hui Xiong. Sequential modeling of hierarchical user intention and preference for next-item recommendation. In WSDM, 2020.
[41] Yang Yang, Jia-Qi Yang, Ran Bao, De-Chuan Zhan, Hengshu Zhu, Xiaoru Gao, Hui Xiong, and Jian Yang. Corporate relative valuation using heterogeneous multi-modal graph neural network. IEEE Trans. Knowl. Data Eng., 35(1):211-224, 2023.
12

---

[42] Da-Wei Zhou, Yang Yang, and De- De-Chuan Zhan. Learning to classify with incremental new class, IEEE Trans. Neural Networks Learn. Syst., 33(6):2429-2443, 2022.
[43] Teodora Popordanoska, Raphael Sayer, and Matthew B. Blaschko. A consistent and differen- tiable Ip canonical calibration error estimator. In NeurIPS, 2022.
[44] Aviral Kumar, Sunita Sarawagi, and Ujjwal Jain. Trainable calibration measures for neural networks from kernel mean embeddings. JCML, 2018.
[45] Sebastian Gruber and Florian Buettner. Better uncertainty calibration via proper scores for classification and beyond. In NeurIPS, 2022.
[46] Ninareh Mehrabi, Fred Morstatter, Nripsuta Saxena, Kristina Lerman, and Aram Galstyan. A survey on bias and fairness in machine learning. ACM Comput. Surv., 54(6::15:11115:35 2022.
[47] Geoff Pleiss, Manish Raghavan, Felix Wu, Jon M. Kleinberg, and Kilian Q. Weinberger. On fairness and calibration. In NeurIPS, 2017.
[48] Alexandre Perez-Lebel, Marine Le Morvan, and Gaël Varoquaux. Beyond calibration: estimat- ing the grouping loss of modern neural networks. In ICLR, 2023.
[49] Jiacheng Cheng and Nuno Vasconcelos. Calibrating deep neural networks by pairwise con- straints, In CVPR, 2022.
[50] Wesley J. Maddox, Pavel Izmailov. Timur Garipov, Dmitry Vetrov, and Andrew Gordon Wilson. A simple baseline for bayesian uncertainty in deep learning. In NeurlPS, 2019.
[51] Ranganath Krishnan and Omesh Tickoo. Improving model calibration with accuracy versus uncertainty optimization. In NeurIPS, 2020.
[52] Jishnu Mukhoti, Viveka Kulharia, Amartya Sanyal, Stuart Golodetz, Philip H. S. Torr, and Puneet K. Dokania. Calibrating deep neural networks using focal loss. In NeurIPS, 2020.
[53] Andrew Gordon Wilson and Pavel Izmailov. Bayesian deep learning and a probabilistic perspective of generalization. In NewrIPS, 2020.
[54] Sunil Thulasidasan, Gopinath Chennupati. Jeff A. Bilmes, Tanmoy Bhattacharya, and Sarah Michalak. On mixup training: Improved calibration and predictive uncertainty for deep neural networks. In NeurlPS, 2019.
[55] Úrsula Hébert-Johnson, Michael P. Kim, Omer Reingold, and Guy N. Rothblum. Multicalibra- tion: Calibration for the (omppuatonnaly-ddntffbbbbl masses. In ICML, volume 80, pages 1943-1953, 2018.
[56] David Durfee, Aman Gupta, and Kinjal Basu. Heterogeneous calibration: A post-hoc model- agnostic framework for improved generalization. CoRR, abs/2202.04837, 2022.
[57] Mert Yükkekgönüil, Linjun Zhang, James Zou, and Carlos Guestrin. Beyond confidence: Reliable models should also consider atypicality. CoRR, abs/2305.1826. 2023.
[58] Miao Xiong, Ailin Deng, Pang Wei Koh, Jiaying Wu, Shen Li, Jianqing Xu, and Bryan Hooi. Proximity-informel calibration for deep neural networks. CoRR, abs/2306.04590, 2023.
[59] Bianca Zadrozny and Charles Elkan. Obtaining calibrated probability estimates from decision trees and naive bayesian classifiers. ICML, 2001.
[60] John Platt et al. Probabilistic outputs for support vector machines and comparisons to regularized likelihood methods. Advances large margin classifiers, 10(3):61-74, 1999.
13


Reviews:
[{"review_id": "KCR2AYSziK", "reviewer": "Reviewer_KvC9", "summary": "This paper proposes a generic form of a calibration error metric. Partitioned Calibration Error (PCE) evaluates calibration errors across the group of partitions to alleviate data uncertainty. Furthermore, the paper presents experimental results on CIFAR-10, CIFAR-100, and ImageNet using several backbone models. Interestingly, the learned partitions make visually similar groups.", "questions": "- As the learned partitions produce visually similar groups, are the features in their space proximity to each other?\n- Will the performance be negatively affected if the partition function creates groups without any visual similarity?\n- Does selection of hold-out data affect the performance?", "limitations": "Yes.", "rating": 6, "confidence": 3, "soundness": 2, "presentation": 3, "contribution": 2, "strengths": "- Paper is easy to follow.\n- The authors propose a unified framework to evaluate confidence calibration error.\n\n", "weaknesses": "- The confidence calibration performance is on par with ETS.\n- It would be more informative if the authors presented effects of poor partition functions for confidence calibration.\n- Only vision applications are considered in this paper. \n- The meaning of semantically relevance is somewhat vague.", "quality": null, "clarity": null, "significance": null, "originality": null, "strengths_and_weaknesses": "", "was_revised": false, "final_justification": "", "rebuttal": "I extend my gratitude for the queries and suggestions you've raised. We will duly enhance the relevant sections in the revised version of the article.\n\n**Q1**: The confidence calibration performance is on par with ETS.\n\n**A1**: *Our method has achieved statistically significant performance improvements in both TS and ETS*. As we primarily focus on accuracy-preserving calibration and have limited data for calibration, achieving perfect generalization calibration performance becomes challenging. With the development of calibration methods, the room for improvement in the ECE metric becomes increasingly limited, making further enhancements more difficult. In this context, our method has demonstrated statistically significant performance (with $p < 0.01$) improvements compared to baseline methods on multiple different datasets and models. Our approach not only enhances the ECE metric but also improves proper score rules, such as log-likelihood (Table 2 in rebuttal PDF), indicating that it not only improves model calibration (epistemic uncertainty)  performance but also accuracy performance concerning aleatoric uncertainty. Additionally, our method significantly improves calibration performance without compromising accuracy.\n\n**Q2**: It would be more informative if the authors presented effects of poor partition functions for confidence calibration.\n\n**A2**: This is an excellent question. *In our paper, we discuss the roles of two extreme partitioning functions and connect them using PCE*. Specifically, if we group all samples into one group, the model will predict the prior distribution for all samples, resulting in a high classification error rate but nearly perfect calibration error. On the other hand, if we use a one-to-one mapping as the partitioning function, each sample will be mapped to a different group, leading to our optimization objective degenerating into a standard log-likelihood, which is equivalent to direct fine-tuning and resulting in significant miscalibration.\n\nEfficient calibration methods proposed in prior research lie between these two extreme cases, allowing for improvements in calibration metrics. For general partitioning functions, it is challenging to intuitively evaluate which one is better. For instance, we have also attempted to use sample features for clustering (see A1 to Reviewer BrmR), but our experimental results indicate that using k-means clustering as the partitioning function leads to a decrease in calibration performance (compared to TS and ETS). This suggests that the clusters generated by the clustering may not serve as effective partitioning functions.\n\n\n**Q3**: Only vision applications are considered in this paper.\n\n**A3**: *We conducted experiments on multiple image datasets and network architectures*. We selected CIFAR10, CIFAR100, and Imagenet as the datasets, along with various network structures to cover different accuracy scenarios. For each combination of dataset and network structure, we performed 100 experiments and conducted significance testing. Exploring the calibration performance on other tasks and models is a future direction of our research.\n\n**Q4**: The meaning of semantically relevance is somewhat vague.\n\n**A4**: *In this article, our core idea is that using only probability information to construct the partitioning function is insufficient to capture information beyond the predefined classes*. However, if the partitioning function can be defined over $x$, we can learn it based on other information apart from class probabilities. In this context, semantic information emphasizes utilizing information from $x$ (beyond class probabilities) to construct the partitioning function. We acknowledge that this might lead to some misunderstanding, as class probabilities themselves can also be considered as a form of semantic information. Therefore, we will modify the wording of this part in the paper.\n\n**Q5**: As the learned partitions produce visually similar groups, are the features in their space proximity to each other?\n\n**A5**: Indeed, we added a linear layer after the features to predict the corresponding group. This can be seen as a linear partitioning of the sample space, where each group's sample features are closely located in the space. Due to the randomness in the samples and network initialization parameters, optimizing the objective function multiple times results in different partitions, thereby achieving ensemble diversity and enhancing calibration performance.\n\n**Q6**: Will the performance be negatively affected if the partition function creates groups without any visual similarity?\n\n**A6**:   As mentioned in A5, the partitions generated by our method are always close in the feature space. However, this does not imply that visually similar partitioning methods will necessarily improve performance. For example, clustering methods may produce visually similar partitions, but they might lead to worse calibration results. On the other hand, visually dissimilar partitions may not necessarily result in worse performance. For instance, if the model is overly optimistic in both class \"a\" and class \"b\" (where \"a\" and \"b\" are visually unrelated), grouping them together could help mitigate overall miscalibration issues. Thus, whether a partitioning function can improve calibration performance may be related to whether there is consistent overconfidence or underconfidence within each partition.\n\n**Q7**: Does selection of hold-out data affect the performance?\n\n**A7**: Indeed, the hold-out (HO) data significantly influences calibration performance. To ensure that the performance differences between different methods are not caused by the dataset, we randomly split the HO data and test data 100 times for each dataset-model pair. This approach allows us to conduct paired t-tests to evaluate the significance of the performance differences."}, {"review_id": "B0wASOozXA", "reviewer": "Reviewer_BrmR", "summary": "In this paper, the authors address the model calibration problem and propose a generalized definition of calibration error called Partitioned Calibration Error (PCE). Previous calibration methods mainly bin the data by the prediction probabilities, while PCE utilizes groups and partition functions to partition the data and requires the model to be calibrated on all partitions. The proposed calibration method jointly learns the partition function and scaling parameters to obtain the optimal calibration error. Experiment results show that the proposed method achieves significant performance improvements across multiple datasets and network architectures.", "questions": "See the weaknesses part.", "limitations": "The method may be limited by the computational complexity when the partition or group number is large.", "rating": 7, "confidence": 4, "soundness": 3, "presentation": 3, "contribution": 3, "strengths": "1, The proposed Partition Calibration Error provides a generalized framework for calibration error evaluation. It bridges the gap between overall accuracy and point accuracy by data partitioning. Besides, previous evaluation methods like ECE/class-wise ECE are also included in PCE, which proves that PCE is a powerful framework.\n2, Based on PCE, the proposed partition calibration method is reasonable and effective. Benefiting from the generalization ability of PCE, group calibration can be applied to other calibration methods easily. The experiment results also show that group calibration can improve the performance of temperature scaling.\n3, The presentation of the paper is well organized. The PCE and PC+TS are clearly introduced and important ablations are provided.", "weaknesses": "1, For the grouping function, it is parameterized as a set of weights and biases, which is claimed as semantic-aware. However, there might be a lot of ways to partition a set of data, such as deep feature-based clustering. The author may consider providing the reason why they choose to model the partition function as in equation (13). \n2, In the experiment part, the paper only provides the results of partition calibration + (ensemble) temperature scaling. It would be helpful to test more calibration methods with partition calibration, which will demonstrate the generalization ability of partition calibration.\n3, In the ablation part, the explanation of Figure 3 (a) is not sufficient. When the group number increases, the NLL and ECE also increase. The authors ascribe it to overfitting, but it might be alleviated by the proposed regularization. It would be beneficial to provide a more reasonable and insightful explanation for this result.", "quality": null, "clarity": null, "significance": null, "originality": null, "strengths_and_weaknesses": "", "was_revised": false, "final_justification": "", "rebuttal": "I express gratitude for the valuable suggestions you have offered to elevate the quality of our manuscript. We shall duly incorporate the corresponding modifications into the article.\n\n**Q1**: For the grouping function, it is parameterized as a set of weights and biases, which is claimed as semantic-aware. However, there might be a lot of ways to partition a set of data, such as deep feature-based clustering. The author may consider providing the reason why they choose to model the partition function as in equation (13).\n\n**A1**:   Initially, we attempted to employ k-means as the partitioning function generation approach; however, its performance showed a decline compared to TS and ETS. We attribute this observation to two potential reasons. Firstly, clustering methods inherently optimize unsupervised objectives, resulting in partitions that may not enhance performance in terms of classification and calibration metrics. In contrast, our method learns the partitioning function by utilizing log-likelihood and optimizing with validation set labels, leading to partitions directly beneficial for calibration. Secondly, during experimentation, we noticed that although k-means can generate different clustering results by setting random initial cluster centers, the final outcomes often exhibit high similarity, diminishing the performance gain from increasing the number of partitions (ensemble learning necessitates diverse predictive results). Our approach, however, introduces superior diversity.\n\n**Q2**: In the experiment part, the paper only provides the results of partition calibration + (ensemble) temperature scaling. It would be helpful to test more calibration methods with partition calibration, which will demonstrate the generalization ability of partition calibration.\n\n**A2**: The primary strength of our approach lies in enhancing the performance of accuracy-preserving calibration methods. We also conducted experiments with IRM (non-accuracy-preserving) and observed that GC+IRM did not yield performance improvements compared to IRM alone. We posit that the diminished performance of GC on IRM is primarily attributed to IRM's necessity to learn a monotonic function across all samples. With grouping, IRM can only ensure monotonicity within each group, relinquishing this property across distinct groups, which can substantially undermine its performance. Conversely, TS and ETS do not hinge on the monotonicity of predicted values, allowing them to attain better performance after grouping.\nAdditionally, other methods were not accuracy-preserving and did not demonstrate any advantages in calibration metrics compared to TS and ETS, thus we did not explore them further. We acknowledge that performance improvements in the non-accuracy-preserving methods are indeed meaningful, and we intend to explore this avenue in future research.\n\n**Q3**: In the ablation part, the explanation of Figure 3 (a) is not sufficient. When the group number increases, the NLL and ECE also increase. The authors ascribe it to overfitting, but it might be alleviated by the proposed regularization. It would be beneficial to provide a more reasonable and insightful explanation for this result.\n\n**A3**: Apologies for any confusion. The concept of overfitting we mentioned here differs slightly from the general sense. In typical problems, overfitting occurs when the model's capacity is too strong, and regularization can mitigate such issues. However, in our specific problem, increasing the number of groups leads to a decrease in the number of samples within each group. As each group utilizes different model parameters, it also effectively enhances the model's capacity. While employing stronger regularization might weaken the model's capacity, we experimentally found that it is insufficient to counterbalance the negative impact caused by reduced data, resulting in models on each group tending to overfit the data within their respective groups and consequently reducing the overall generalization performance."}, {"review_id": "cMDyQWU40G", "reviewer": "Reviewer_yhZK", "summary": "This paper proposes a method to calibrate neural networks more effectively. It introduces a general framework called PCE, which aims to provide an explanation for existing calibration methods. The proposed method partitions the input space into groups and minimizes the discrepancy between the predicted probability and the true value within each group, on average. Experimental results demonstrate that this method outperforms standard approaches like temperature scaling (TS).", "questions": "- How can we interpret the mechanism of the proposed method that achieves a better calibration? See also Weaknesses.\n- Is it sufficient to evaluate only ECE? What about class-wise ECE?\n- Table 1 shows that for Swin, the original model (uncalibrated) achieves better calibration than TS/GC+TS. Calibration leads to a worse calibration. Why?\n", "limitations": "There is no serious issue regarding the limitations of this study.", "rating": 5, "confidence": 5, "soundness": 3, "presentation": 2, "contribution": 3, "strengths": "- PCE, the framework introduced, offers a unified formulation for existing calibration methods. This may allow for a comprehensive understanding of these methods. \n- The effectiveness of the proposed method is supported by experimental results.\n", "weaknesses": "The paper is not easy to read. I believe there is much room for improving readability. \n- The term ETS is used without definition (l171)\n-\tIt took some time to understand that \"the number of partitions\" is distinct from the number of groups. The study uses ‘partitions’ to mean an ensemble of multiple models. This is confusing and could be improved. \n-\tI could not understand how (11) is derived. How is S() determined?\n-\tIt is difficult to interpret what g_\\phi(x) learns. Suppose K=2 as in the experiments. It appears that g_\\phi(x) learns binary classification using the pen-ultimate layer feature, which is also employed for the original classification task. However, the purpose and underlying explanation of this process are not clearly explained. \n-\tBased on my understanding, g_\\phi(x) learns to partition the input space into groups that are the most uncalibrated by minimizing equation (11). Subsequently, performing temperature scaling within each of these groups and aggregating the predictions over different partitions results in improved calibration. \n-\tIt is crucial to provide a similar, high-level explanation of how the method achieves better calibration, irrespective of whether above understanding is true or not.\n-\tThere is no explanation what Table 1 etc. report. I assume they are top-level ECE^1 defined in [23]. \n\nAnother issue is that the improvements the proposed method brings are not substantial, despite the technical complexity involved.", "quality": null, "clarity": null, "significance": null, "originality": null, "strengths_and_weaknesses": "", "was_revised": false, "final_justification": "", "rebuttal": "\nI express gratitude for the insightful suggestions you've provided. We will improve the paper based on your suggestions.\n\n**Q1**: The term ETS is used without definition (l171)\n\n**A1**: We will add the full name of ETS(Ensemble Temperature Scaling) and corresponding reference.\n\n**Q2**: It took some time to understand that \"the number of partitions\" is distinct from the number of groups. \n\n**A2**: Sorry for the confusion. Generally, a partition corresponds to a method that splits the data space into disjoint sets, while groups refer to the sets produced by a partition. We will add explanations in the revised paper accordingly.\n\n**Q3**: I could not understand how equation (11) is derived. How is S() determined?\n\n**A3**: Sorry for the confusion caused by Equation (11). *Equation (11) describes the loss used by the temperature scaling method within each group, which is not a direct estimation of PCE*. Specifically, if we choose $S$ to the average function, so the empirical estimation of $S(G_i)=\\frac{1}{|G_i|}\\sum_{x, y \\in G_i} y$, and the empirical estimation of $S(f_{G_i}(G_i))=\\frac{1}{|G_i|} \\sum_{x, y \\in G_i} f_{G_i}(x)$. Then, we choose the difference measure $\\mathcal{L}$ to be the log-likelihood (cross entropy) $\\mathcal{L}(S(G\\_i), S(f\\_{G\\_i}(G\\_i)))=\\sum\\_{j} S(G\\_i)\\_j \\log S(f\\_{G\\_i}(G\\_i))\\_j$, where $j$ is the class index. The Equation (11) will be minimized by $f_{G_i}(x)=y$, which will also minimize $\\mathcal{L}(S(G_i), S(f_{G_i}(G_i)))$. Thus, Equation (11) is a stronger constraint compared with minimizing PCE ($\\mathcal{L}(S(G_i), S(f_{G_i}(G_i)))$) directly. Our choice of this objective is motivated by two reasons: First, Equation (11) is able to provide more signals during training since each label $y$ can guide corresponding $f_{G_i}(x)$ directly. On the contrary, if we optimize $\\mathcal{L}(S(G_i), S(f_{G_i}(G_i)))$ directly, the labels and predictions are mixed and much label information is lost. Secondly, optimizing Equation (11) aligns well with the calibration method to be used. As we analyzed in A4 to Reviewer yhZK, an objective that aligns with the calibration method may lead to better calibration performance.   \nIn the revised paper, we shall provide a comprehensive explanation for Equation (11) to enhance clarity regarding this distinction.\n\n**Q4**: It is crucial to provide a high-level explanation of how the method achieves better calibration.\n\n**A4**: Thanks for your valuable advice. Since different groups are calibrated with different parameters, the grouping functions should find the partitions that can improve the calibrated performance with the calibration method applied within each group. We agree with Reviewer yhZK that \"partition the input space into groups that are the most uncalibrated\" is an intuitive and reasonable interpretation. We think a more comprehensive interpretation is that $g_{\\phi}(x)$ should learn to generate partitions that best suit the calibrating methods to be used. For example, if a group has only a few elements, this group may be significantly miscalibrated (with a high ECE because of lacking of data). However, the calibration parameters (e.g., $\\tau$) are prone to overfitting on this small group and result in significant miscalibration when testing. By joint training of the grouping function $g_{\\phi}$ and the calibration method (temperature scaling) on the validation dataset, the grouping function is optimized to improve the overall calibration metrics (PCE), which is less likely to generate extreme partitions that may hurt\n generalization.\n\n**Q5**: There is no explanation what Table 1 etc. report.\n\n**A5**: We report top-label ECE.\n\n**Q6**: What about class-wise ECE?\n\n**A6**: Thanks for your advice. We report class-wise ECE in the rebuttal PDF file. We can observe significant improvements on CIFAR10 and CIFAR100, while the differences on Imagenet are small. We think the reason for the performance on Imagenet is because the number of classes (1000) is significantly large than the number of partitions and groups that we have used in experiments (20 partitions and 2 groups). We have to mention that we achieve such improvements on class-wise ECE without optimizing the class-wise ECE explicitly, which shows the potential of improving calibration metrics within unknown partitions.\n\n**Q7**: Table 1 shows that for Swin, the original model (uncalibrated) achieves better calibration than TS/GC+TS. Calibration leads to a worse calibration. Why?\n\n**A7**: This is a good question that may reveal the source of performance improvements of ETS compared with TS. We visualize and compare the top-label confidence calibration of TS and ETS in Figure 1 in the rebuttal PDF. We can observe that Resnet18 tends to be overconfident and Swin tends to be underconfidence, and the top-label ECE of Resnet18 and Swin are similar. When we use TS to calibrate Resnet18, the optimal $\\tau\\approx 1.07$ in Resnet18 is larger than 1, which reduces overconfidence. When we apply TS to calibrate Swin, the optimal $\\tau \\approx 0.89$ is small than 1, which results in overconfidence in calibrated results. We may expect that the performance on Swin should improve since underconfidence is reduced. However, overconfidence is generally more dangerous for calibration metrics. For example, a predictor that always predicts a uniform distribution among all the classes will be calibrated, which corresponds to $\\tau=\\infty$. Generally, using a larger $\\tau >1$ will push the prediction towards uniform prediction and will be more likely to reduce calibration error (regardless of overfitting). On the contrary, a $\\tau<1$ that is smaller than the ground-truth $\\tau^*$ may harm calibration metrics significantly which makes it even worse than uncalibrated. The main reason that ETS works much better on Swin is that ETS introduced a uniform component that can enlarge the (effective) value of$\\tau$, which can reduce the potential of underestimating $\\tau$ significantly."}, {"review_id": "ShZ93jBn0R", "reviewer": "Reviewer_TM5v", "summary": "This work focuses on improving calibration (e.g., measured with Expected Calibration Error) using partitions of the feature space. This contrasts with most well-established recalibration techniques (isotonic regression, histogram binning, temperature scaling...) that solely use the estimated probabilities of the classifier. Partitions are learned during training with an extra linear layer + softmax on the features extracted by the deep model. Each part of the partition is recalibrated by the accuracy-preserving existing calibration techniques such as temperature scaling or ensembling temperature scaling. This ensures that the proposed method is also accuracy-preserving. The method is benchmarked on 3 datasets (CIFAR10, CIFAR100, ImageNet) and 3 networks on each dataset. The method is compared to 9 existing calibration techniques, such as temperature scaling, isotonic regression, and histogram binning.", "questions": "* Could you confirm that ECE is the metric plotted in Tables 1 & 2? It is not indicated.\n* Could you develop on the statistical test used for assessing the significance of the results? What are the p-values obtained with the test? Do you correct for multiple comparisons?", "limitations": "The authors highlight the following limitations:\n* The method is restricted to deep networks since it works in the extracted feature space. It thus cannot be applied to tree models, for example.\n* Increasing the number of partitions and using more complex grouping models increased the computational complexity of the method.", "rating": 5, "confidence": 5, "soundness": 1, "presentation": 2, "contribution": 2, "strengths": "* Learning the partitions using an extra linear layer + softmax is valuable since it is differentiable and enables end-to-end learning jointly with the network. This contrasts with existing works that use hard partitions by thresholding quantiles on a proximity metric [4-5] or by using decision trees [2-3].", "weaknesses": "* Positioning in literature: It misses related works that share strong conceptual links with the proposed work. Those works could have been compared either in related work or in experiments.\n  * It is not compared to multicalibration [1], which proposes an algorithm for learning a multicalibrated predictor with respect to any subpopulation class.\n  * The idea of partitioning the network feature space to find local miscalibration has been used before [3-4]. [3] shows that strong local miscalibration arises in modern neural networks and proposes an estimator based on feature space partitions to evaluate them. [4] links this local miscalibration to atypicality.\n  * [5] also links local miscalibration to proximity and proposes an algorithm to recalibrate those subgroups. NB: [5] was released after the NeurIPS submission deadline. I put it for information.\n* Framing:\n  * The valuable part of finding local miscalibration and correcting them, as it is done in the proposed work, is not to improve calibration but rather to improve estimated individual posterior probabilities (i.e., reducing the epistemic loss) as pointed out in [3], or improving fairness metrics as done in [1]. The problem is that the proposed work is entirely focused on improving calibration, which is blind to local miscalibration.\n  * In addition to the missing related work, the discrepancy between the current framing and the potential of the proposed method can be felt on several levels. In the introduction: \"A perfectly calibrated model should be calibrated across any data space partition\" (L61). This is false since a perfectly calibrated model in the standard definition of calibration (e.g., in [6] eq. (1)) just needs to be calibrated on level sets of the same predicted confidence (i.e., satisfy $\\mathbb{P}(Y=\\hat{Y}|\\hat{\\mathbb{P}} = p) = p$). However, a perfect probabilistic classifier, that is, a classifier that outputs the true individual posterior probabilities $\\mathbb{P}(Y=\\hat{Y}|X)$, should be calibrated on any data space partition. The exposition of the results focuses on improving ECE (Table 1 & 2).\n* The improvement in calibration is marginal.\n  * For example, in Table 1, the proposed method GC+TS improves on Temperature Scaling (TS) by absolute differences ranging from 1e-4 to 1e-3 in Expected Calibration Error (ECE), which is an extremely small scale for ECE. Similarly, the proposed method GC+ETS improves on Ensembling Temperature Scaling (ETS) by absolute differences ranging from 1e-4 to 1e-3.\n\n\nIn summary, the proposed method has the potential to improve individual posterior probabilities and fairness metrics. Unfortunately, this potential is not exploited in the current framing since it focuses on improving calibration instead. On improving calibration, the proposed method has a too marginal effect.\n\n## References\n\n[1] Hebert-Johnson, U., Kim, M., Reingold, O., & Rothblum, G. (2018). Multicalibration: Calibration for the (Computationally-Identifiable) Masses. In Proceedings of the 35th International Conference on Machine Learning (pp. 1939–1948). PMLR.\n\n[2] David Durfee, Aman Gupta, & Kinjal Basu. (2022). Heterogeneous Calibration: A post-hoc model-agnostic framework for improved generalization.\n\n[3] Alexandre Perez-Lebel, Marine Le Morvan, & Gaël Varoquaux. (2023). Beyond calibration: estimating the grouping loss of modern neural networks. ICLR.  \n(First released on 8 Oct 2022).\n\n[4] Mert Yuksekgonul, Linjun Zhang, James Zou, & Carlos Guestrin. (2023). Beyond Confidence: Reliable Models Should Also Consider Atypicality.  \n(First released on 04 Mar 2023, https://openreview.net/forum?id=nPOKJCCvlLF)\n\n[5] Miao Xiong, Ailin Deng, Pang Wei Koh, Jiaying Wu, Shen Li, Jianqing Xu, & Bryan Hooi. (2023). Proximity-Informed Calibration for Deep Neural Networks.  \n(First released on 7 Jun 2023).\n\n[6] Chuan Guo, Geoff Pleiss, Yu Sun, & Kilian Q. Weinberger. (2017). On Calibration of Modern Neural Networks.", "quality": null, "clarity": null, "significance": null, "originality": null, "strengths_and_weaknesses": "", "was_revised": false, "final_justification": "", "rebuttal": "I appreciate your provision of recent relevant research. Below, we will expound on the distinctions between our approach and these methods. Moreover, we intend to incorporate an analysis of these references in the revised version of the paper.\n\n**Q1**: [1] also proposes an algorithm for learning a multicalibrated predictor with respect to any subpopulation class.\n\n**A1**:  \n\n1. Although [1] proposed an algorithm to calibrate subpopulation classes, it assumes that the subpopulations are given. While our work proposes a practical method to generate useful partitions in a machine-learning manner. \n\n2. [1] also suggests calibrating on \"every subpopulation that can be identified\", however, it did not reveal the underlying relationship between calibration and accuracy with the definition in [1] (which is different from ours). Since the one-to-one grouping function is a special case of \"any grouping function\", our example Example 4 revealed that calibrating on any grouping function is equivalent to the perfect prediction that produces groud-truth $p(y|x)$, which is generally impossible with finite data. Thus, a practical method to find a good grouping function that can improve calibration accuracy is critical, which is our core contribution.  \n\n3. [1] did not conduct any practical experiments, while the effectiveness of our method is validated in many real-world datasets and deep models.\n\n**Q2**: Comparison with [2].\n\n**A2**:  [2] proposed to group the feature space with decision trees, then apply Platt scaling within each group.  1. [2] concentrates on calibration ranking metrics (AUC), while our work concentrates on PCE metrics (ECE) and proper scoring rules (Log-Likelihood). 2. We revealed the connection between calibration and accuracy as discussed in A1.2, which is lacking in [2].\n\n**Q3**: Comparison with [3].\n\n**A3**: [3] estabilish a explained component as a metric that lower-bounding the grouping loss in the proper scoring rule theory, and conducted many experiments to validate their metric. While our work concentrates on improving the calibration and accuracy metrics. (ECE and NLL).\n\n**Q4**: Comparison with [4-5].\n\n**A4**: In the view of our framework, both [4] and [5] propose a heuristic grouping function, and apply a specific calibration method within each group. While we agree that manuually designed grouping functions may be more interpretable and may lead to better performance in some specific cases (long-tail data), we aim to propose a learning-based method that can generate partitions in an end-to-end manner.\n\n**Q5**: The problem is that the proposed work is entirely focused on improving calibration, which is blind to local miscalibration.\n\n**A5**: Sorry for the confusion. As pointed out in our paper, PCE connects calibration and accuray with grouping functions. Since the grouping functions learned by our method is neither solely probability-based (measures calibration) nor one-to-one (measures accuracy), we expected to see improvements in both view. So we report the (top-label) ECE in our paper, and NLL in the appendix Tabble 5 because of the page limit. Our method achieved statisticlly significant improvements in both ECE and NLL. We are not quite sure what is \"lcoal miscalibration\" mentioned by Reviewer TM5V. Experimentally, our method groups similar data, howerver, the PCE does not require such \"local\" grouping as discussed in response to A6 to Reviewer KvC9.\n\n**Q6**: In the introduction: \"A perfectly calibrated model should be calibrated across any data space partition\" (L61). This is false since a perfectly calibrated model in the standard definition of calibration (e.g., in [6] eq. (1)) just needs to be calibrated on level sets of the same predicted confidence (i.e., satisfy). However, a perfect probabilistic classifier, that is, a classifier that outputs the true individual posterior probabilities, should be calibrated on any data space partition.\n\n**A6**: [6] eq. (1) does not involve any data space parition so the definition in [6] \"just needs to be calibrated on level sets of the same predicted confidence\". However, when we define calibration with data space paritions, it will become different. What if each group contains $x$ with exactly the same value? The expect $y$ within each group will be exactly $p(y|x)$, which is the core idea of our Example 4. If we measure ECE within such a group, there should be only one level-set with predicted probability $q(y|x)$, and the ECE will be minimized iff. $q(y|x)=p(y|x)$.\n\n**Q7**: Could you confirm that ECE is the metric plotted in Tables 1 & 2? It is not indicated.\n\n**A7**: We report top-label ECE.\n\n**Q8**: Could you develop on the statistical test used for assessing the significance of the results? What are the p-values obtained with the test? Do you correct for multiple comparisons?\n\n**A8**: We conducted pairred t-test with 100 runs on different data splits. As reported in the paper (Table 1), following common practice, the differences with $p<0.01$ is considered to be significant.\n\n\n[1] Hebert-Johnson, U., Kim, M., Reingold, O., & Rothblum, G. (2018). Multicalibration: Calibration for the (Computationally-Identifiable) Masses. In Proceedings of the 35th International Conference on Machine Learning (pp. 1939–1948). PMLR.\n\n[2] David Durfee, Aman Gupta, & Kinjal Basu. (2022). Heterogeneous Calibration: A post-hoc model-agnostic framework for improved generalization.\n\n[3] Alexandre Perez-Lebel, Marine Le Morvan, & Gaël Varoquaux. (2023). Beyond calibration: estimating the grouping loss of modern neural networks. ICLR. (First released on 8 Oct 2022).\n\n[4] Mert Yuksekgonul, Linjun Zhang, James Zou, & Carlos Guestrin. (2023). Beyond Confidence: Reliable Models Should Also Consider Atypicality. (First released on 04 Mar 2023,  \n\n[5] Miao Xiong, Ailin Deng, Pang Wei Koh, Jiaying Wu, Shen Li, Jianqing Xu, & Bryan Hooi. (2023). Proximity-Informed Calibration for Deep Neural Networks. (First released on 7 Jun 2023)."}, {"review_id": "fjAJkQc3aL", "reviewer": "Reviewer_mMe6", "summary": "The paper proposes a novel method for dealing with the well-known problem of miscalibration in deep learning models (and machine learning models more generally). The proposed approach is to partition the input space and fit a calibration function to each set. The paper shows that the idea of partitioning the input space generalizes two special cases --- one-to-one grouping and constant grouping. Experiments are conducted for image classification on the CIFAR10, CIFAR100 and ImageNet datasets.", "questions": "Please respond to the concerns raised in Weaknesses above.", "limitations": "Yes.", "rating": 5, "confidence": 4, "soundness": 1, "presentation": 2, "contribution": 2, "strengths": "I really like what the paper is trying to do. Unfortunately the mathematical presentation contains many technical errors and I have concerns about the theoretical underpinning of the proposed approach as discussed below.", "weaknesses": "I have two main concerns about the paper. First, the mathematical presentation contains many technical errors:\n\n1. For Lemma 1 to be correct we need the additional assumption that\n$\\forall x \\in {\\cal D}, \\exists G \\in {\\cal G} \\text{ s.t. } g(x) = G.$\nThis should be explicitly stated.\n\n2. In Definition 2 (Lines 84--90) there appears to be inconsistencies in the definition of a group G. On Line 84 we have $(x, y) \\in G$, on Line 90 we have $x \\in G$, and on Line 78 we have $g(x) = G$. I understand that the authors may be overloading the notation here so that $x \\in G$ implies $g(x) = G$, but it remains to define what $(x, y) \\in G$ means. The paper should be rigorous in its mathematical definitions and notation.\n\n3. Equation 13, $g_\\phi(x) = g_\\phi(z(x))$ makes no sense unless $z$ is the identity mapping (or $g_\\phi$ is constant). Moreover, $z$ is defined to be a matrix and given its dimensionality, $|D| \\times d_z$, it is unclear what $z(x)$ actually does.\n\nI am also concerned about the correctness of the theoretical idea that underpins the approach. Specifically, we can think of the neural network classifier as computing $p(y \\mid x)$, which we wish to be calibrated. By partitioning the input space into groups, the method effectively calibrates $p(y \\mid x, G)$. However, $p(y \\mid x) \\neq p(y \\mid x, G)$, in general. Rather $p(y \\mid x) = \\sum_G p(y \\mid x, G) p(G \\mid x)$.\n", "quality": null, "clarity": null, "significance": null, "originality": null, "strengths_and_weaknesses": "", "was_revised": false, "final_justification": "", "rebuttal": "\nWe express our gratitude to the Reviewer mMe6 for conducting a careful evaluation of our paper and offering valuable suggestions concerning the representation of formulas. We agree with the reviewers' perspectives, acknowledging that in certain equations, we have overloaded symbols without providing intuitive explanations, which may lead to possible misunderstandings. \n\n**Q1**: For Lemma 1 to be correct we need the additional assumption.\n\n**A1**: *We agree that although this condition is implicitly implied in our statements, a formal definition will be more intuitive and rigorous*. In Definition 1, we defined that \"A grouping function $g$ is a mapping from an input $x$ to a group indicator $g(x) = G \\in \\mathcal{G}$\". This definition implicitly requires that the function $g(x)$ is defined on any valid $x$, which is equivalent to $\\forall x \\in \\mathcal{D},\\exists G \\in \\mathcal{G}, s.t.  g(x)=G$. We also stated this definition explicitly in our proof of Lemma 1 in the Appendix (Line 11: \"The grouping function is defined on all $x \\in \\mathcal{D}$\"). We agree that providing an explicit formulation is more rigorous and intuitive. And we will modify this definition accordingly.\n\n**Q2**: In Definition 2 (Lines 84--90) there appears to be inconsistencies in the definition of a group G. \n\n**A2**: *Thanks for your advice and sorry for the confusion on the definition of $g(x)=G$, $x\\in G$ and $(x, y)\\in G$*. We use $x \\in G$ and $g(x)=G$ interchangeably, that is, $x \\in G \\iff g(x)=G$. And the group of a labeled data $(x, y)$ is defined by the group of $x$, that is, $(x, y) \\in G$ where $G=g(x)$. We clarify the definition of these symbols in our revised paper.\n\n**Q3**: Equation 13, makes no sense unless $z$ is the identity mapping (or $g$ is constant). \n\n**A3**: *We aim to introduce our implementation of $g_{\\phi}(x)$ in Equation (13)*. The equation $g_{\\phi}(x)=g_{\\phi}(z(x))$ is meant to indicate that in our implementation, the grouping function depends on the deep feature $z(x)$ rather than raw $x$, which is a more restricted function family. Then we introduce the parameterization of $g_{\\phi}(z(x))=\\operatorname{softmax}(z(x)\\phi_{w} +\\phi_b)$. We agree that $g_{\\phi}(x)=g_{\\phi}(z(x))$ is an inaccurate expression and failed to reflect the difference between $g_{\\phi}(x)$ and $g_{\\phi}(z(x))$. We will modify Equation (13) to $g_{\\phi}(x)=g^\\prime_{\\phi}(z(x))=\\operatorname{softmax}(z(x)\\phi_{w} +\\phi_b)$ to highlight the difference between $g_{\\phi}(\\cdot)$ and $g^\\prime_{\\phi}(\\cdot)$.\n\n**Q4**: Concerned about the correctness of the theoretical idea that underpins the approach...\n\n**A4**: *$p(y|x)=\\sum_{G}p(y|x, G) p(G|x)$ is exactly how we calculate the calibrated probabilities*. As pointed out by Reviewer mMe6, by partitioning the input space into groups, the method effectively calibrates $p(y|x,G)$, which corresponds to $\\hat{Y}\\_{ui}$ in Algorithm 1: Line 7. Here $u$ denotes the $u$-th partition and $i$ denotes the $i$-th group in partition $u$. $\\hat{Y}\\_{ui}$ denotes the set of group-wisely calibrated probabilities within the group $G\\_{ui}$. Then, all the group-wisely calibrated results are gathered in Algorithm 1: Line 9 to obtain calibrated results $\\hat{Y}\\_u$ with the $u$-th partition. All the calibrated $\\hat{Y}\\_u$ are averaged to obtain the final prediction $\\hat{Y}\\_{test}=\\frac{1}{U}\\sum\\_u \\hat{Y}\\_u$. This is effectively a Monte Carlo estimation of $p(y|x)=\\sum\\_{G}p(y|x,G) p(G|x)$. \n\nIn the revised version of the paper, we will optimize the expression of the mentioned formulas as per the reviewers' guidance and incorporate appropriate clarifications. Furthermore, we will thoroughly scrutinize all other equations in the paper to ensure the rigor and comprehensibility of all theoretical definitions and results."}]

Author rebuttal:
The support information of A6 and A7 to Reviewer yhZK (performance on class-wise ECE, and the reason of performance drop of TS in SWIN model), and performance measured by NLL are in the PDF file.

Meta-review: The paper proposed a more generalized definition of calibration error called Partitioned Calibration Error (PCE), revealing that the key difference among these calibration error metrics lies in how the data space is partitioned. The paper was reviewed by 5 experts in the community. The authors provided detailed rebuttal and there had been extensive discussions, where most the initial major concerns have been resolved. Afterward, the paper received relatively consistent reviews as 1X "Weak Accept", 1X"Accept" and 3X"Borderline Accept".

The reviewers are conistent on the contributions of the paper while providing very important comments in how to improve the paper. The authors are requsted to revise the paper accordingly.
Decision: Accept (poster)