Learning Sample Difficulty from Pre-trained Models for Reliable Prediction
Authors: Peng Cui
Dan Zhang
Zhijie Deng
Yinpeng Dong
Jun Zhu
Venue: NeurIPS 2023 poster (2023)
Keywords: uncertainty calibration
sample difficulty
reliable prediction
TL;DR: We propose to utilize large-scale pre-trained models to guide downstream model training with sample difficulty-aware entropy regularization to improve accuracy and uncertainty calibration

Abstract: Large-scale pre-trained models have achieved remarkable success in many applications, but how to leverage them to improve the prediction reliability of downstream models is undesirably under-explored. Moreover, modern neural networks have been found to be poorly calibrated and make overconfident predictions regardless of inherent sample difficulty and data uncertainty. To address this issue, we propose to utilize large-scale pre-trained models to guide downstream model training with sample difficulty-aware entropy regularization. Pre-trained models that have been exposed to large-scale datasets and do not overfit the downstream training classes enable us to measure each training sample’s difficulty via feature-space Gaussian modeling and relative Mahalanobis distance computation. Importantly, by adaptively penalizing overconfident prediction based on the sample difficulty, we simultaneously improve accuracy and uncertainty calibration across challenging benchmarks (e.g., +0.55% ACC and −3.7% ECE on ImageNet1k using ResNet34), consistently surpassing competitive baselines for reliable prediction. The improved uncertainty estimate further improves selective classification (abstaining from erroneous predictions) and out-of-distribution detection.

Learning Sample Difficulty from Pre-trained Models for Reliable Prediction
Peng Cuil Dan Zhang??, Zhijie Deng": Yinpeng Dong' 15 Jun Zhu 'Dept. of Comp. Sci. & Tech., Institute for AI, BNRist Center, THBI Lab, Tsinghua-Bosd Bosch Joint ML Center, Tsinghua University, Beijing, 100084 China
Bosch Center for Artificial Intelligence University of Tübingen *Qing Yuan Research Institute, Shanghai Jiao Tong University 'RealAI xpeng, cui @gmail. com, dan zhang20de. bosch. com, zhij chijied@sjtu edu, cn dongyinpeng@tsingee edu. en, dcszj@tsinghua, edu, cn
Abstract
Large-scale pre-trained models have achieved remarkable success in many applica- tions, but how to leverage them improve the prediction reliability downstream models is undesirably under-explored. Moreover, modern neural networks have been found be poorly calibrated and make overconfident predictions regardless of inherent sample difficulty and data uncertainty. To address this issue, we pro- pose to utilize large-scale pre-trained models to guide downstream model training entropy regularization. Pre-trained models that have been exposed to large-scale datasets and do not overfit the downstream training classes enable us to measure each training sample's 's difficulty via feature- space Gaussian modeling and relative Mahalanobis distance computation. Importantly, by adaptively penalizing overconfident prediction based the sample difficulty, we simultaneously improve accuracy and uncertainty calibration across challenging benchmarks (e.g., +0.55% ACC and 7% ECE on ImageNetlk using ResNet34), consistently surpassing competitive baselines for reliable prediction. The improved uncertainty estimate further improves selective classification (abstaining from erroneous predictions) and our-of-distribution detection.
with sample difficulty-
1 Introduction
Large-scale pre- pre-training has witnessed pragmatic success in diverse scenarios and pre-trained models becoming increasingly accessible 99 1 44). The community has reached consensus that by exploiting big data, pre-trained models can learn to encode rich data semantics that is promised to be generally beneficial for broad spectrum of applications, e.g., warming up the learning on downstream tasks with limited data [45], improving domain generalization 24 or model robustness [19] and
enabling zero-shot transfer [54]
This paper investigates on a new application - leveraging pre-trained models to improve the calibration and the quality of uncertainty quantification of downstream models, both of which are erucial for
reliable model deployment in the wild (20, 13 28 32). Model training on the task dataset often encounters ambiguous even distorted samples. These samples difficult to learn from directly enforcing the model to fit them (i.e., matching the label with 100% confidence) may cause undesirable memorization and overconfidence. This issue comes from loss formulation and data annotation, thus using pre-trained models for finetuning or knowledge distillation with the cross-entropy loss will not solve the problem. That said, it is necessary to subtly adapt the training objective for each sample according to its sample difficulty for better generalization and uncertainty quantification. We exploit
"Corresponding authors.
37th Conference on Neural Information Processing Systems (NcurIPS 2023).

---

Label:
Tusker
Tusker
Tusker
Tusker
Label:
Tirkker
Tisker
Tosker
Tinker
Label:
Tusker
Tusker
Tusker
Tusker
Label:
Tiosker
Afrticn elephunt
Daging
Airplane
KMD:
-155
-154 -155 -153
RMD:
-155
-112 209 680
(b) The sample difficulty score (RMD) increases pro- portionally with the corruption and label noise severity. Figure Visualization training samples with low (high) sample difficulty that is scored by CLIP-ViT-B 44 using the derived relative Mahalanobis distance (RMD).
(a) Training samples from ImageNet class Tusker and ranked as hardest/easiest by CLIP-VIT-B.
pre-trained models to measure the difficulty each sample in the downstream training set and use this extra data annotation to modify the training loss. Although sample difficulty has been shown be beneficial to improve training efficiency 333 and neural scaling laws [49 its effectiveness for ameliorating model reliability is largely under-explored.
Pre-trained models aid in scoring sample difficulty by shifting the problem from the raw data space to task- and model-agnostic feature space, where simple distance measures suffice to represent similarities. Besides, large-scale multi-modal datasets and self-supervised learning principles enable the pre-trained models (see those in Table 1 generate features that sufficiently preserve high- level concepts behind the data and avoid overfitting to specific data or classes. light of this, we perform sample difficulty estimation in the feature space of pre-trained models and cast it as density estimation problem since samples with typical discriminative features are easier to learn and typical features shall reappear. We advocate using Gaussian models represent the training data distribution in the feature space of pre-trained models and derive the relative Mahalanobis distance (RMD) as As shown in Fig. there high-level agreement sample difficulty between RMD and human cognition.
sample difficulty
Equipped with the knowledge of sample difficulty, further propose to it for regularizing the prediction confidence. The standard cross entropy loss with single ground truth label would encourage the model to predict all instances in Fig. Ig a) the class Tusker with 100% confidence. However, such high confidence is definitely unjustified for the hard samples. Thus, we modify the training loss by adding entropic regularizer with an mastance-wise adaptive weighting in proportion to the sample difficulty. Profiting from the high-quality sample difficulty measure and the effective entropic regularizer, develop strong, scalable, and easy-to-implement approach improving both the predictive accuracy and calibration of the model.
Our method successfully improves the model's performance and consistently outperforms competitive baselines on various image classification benchmarks, ranging from the i.i.d. setting to corruption robustness, selective classification, and
detection. Importantly, unlike previous works that compromise accuracy [22 31 or suffer from expensive computational overhead (26). method can improve predictive performance and uncertainty quantification concurrently in computationally efficient way. The consistent gains across architectures demonstrate that our sample difficulty measure valuable characteristic of the dataset for training.
2 Related Works
Uncertainty regularization. A surge of research has focused on uncertainty regularization to alleviate the overfitting and overconfidence of deep neural networks. Lp Norm [22] and entropy regularization (ER) [42] explicitly enforce small norm of the logits or a high predictive entropy. Label smoothing (LS) 36 interpolates the ground-truth one-hot label vector with an all-one vector,
thus penalizing 100% confident predictions. (35) showed that focal loss (FL) 30 is effectively an
upper bound to ER. Correctness ranking loss (CRL) 34 regularizes the confidence based on the
frequency of correct predictions during the training losses.

---

LS, Lp Norm, FL and ER do not adjust prediction confidence based on the sample difficulty. The frequency of correct predictions was interpreted as sample difficulty measure [50]. However, CRI. only concerns pair-wise ranking in the same batch. Compared to the prior art, we weight the overconfidence penalty according to the sample difficulty, which proves to be more effective at jointly improving accuracy and uncertainty quantification. Importantly, the sample difficulty is derived from a data distribution perspective, and remains constant over training.
Sample difficulty measurement. Prior works measure the sample difficulty by only considering
the task-specific data distribution and training model, e.g., [50] 21 40, 2 I 41l 49 I 33). As deep neural networks are prone to overfitting, they often require careful selection of training epochs, checkpoints, data splits and ensembling strategies. Leveraging the measurement for data pruning, [49] showed existing work still underperforms on large datasets, e.g., ImageNetlk, The top solution used self--uper model and scored the sample difficulty via K-means clustering.
We explore pre-trained models that have been exposed to large-scale datasets and do not overfit the downstream training set. Their witness of diverse data serves as informative prior knowledge for ranking downstream training samples. Furthermore, the attained sample difficulty can be readily used for different downstream tasks and models. In this work, we focus on improving prediction reliability, which is an under-explored application of large-scale pre-trained models. The derived relative Mahalanobis distance (RMD) outperforms Mahalanobis distance (MD) and K-means clustering for sample difficulty quantification.
3 Sample Difficulty Quantification
Due to the ubiquity of data uncertainty in the dataset collected from the open world 23 6 the sample difficulty quantification (i.e.. characterizing the hardness and noisiness of samples) is pivotal for reliable learning of the model. For measuring training sample difficulty, we propose to model the data distribution in the feature space of a pre-trained model and derive relative Mahalanobis distance (RMD). A small RMD implies that 1) the sample typical and carries disermmiiiee features (close to the class-specific mean mode but far away from the class-agnostic mean mode). and 2) there exist many similar samples (high-density area) in the training set. Such a sample represents an easy case to learn, i.e., small RMD ++ low sample difficulty, see Fig.
3.1 Large-scale pre-trained models
Large-scale image and image-text data have led to high-quality pre-trained vision models for down- stream tasks. Instead of using them as the backbone network for downstream tasks, we propose new use case, i.e., scoring the sample difficulty in the training set of the downstream task. There is no rigorously defined notion of sample difficulty. Intuitively, easy-to-learn samples shall reappear in the form of showing similar patterns. Repetitive patterns specific to each class are valuable cues for classification. Moreover, they contain neither confusing nor conflicting information. Single-label images containing multiple salient objects belonging to different classes or having wrong labels would be hard samples.
To quantify the difficulty of each sample, we propose to model the training data distribution in the feature space of large-scale pre-trained models. In the pixel space, data distribution modeling is prone to overfitting low-level features, e.g., an outlier sample with smoother local correlation can have higher probability than an inlier sample 48) On the other hand, pre-trained models generally trained to ignore low-level information, e.g., semantic supervision from natural language or class labels. In the case of self-supervised learning, the proxy task and loss are also formulated to learn holistic understanding of the input images beyond low-level image statistics, e.g., the masking strategy designed in MAE (14] prevents reconstruction via exploiting local correlation. Furthermore, as modern pre-trained models are trained on large-scale datasets with high sample diversities in many dimensions, they learn to preserve and structure richer semantic features of the training samples than models only exposed to the training set that is commonly used at smaller scale. In the feature space of pre-trained models, we expect easy-to-learn samples will be closely crowded together. Hard-to-learn ones are far away from the population and even sparsely spread due to missing consistently repetitive patterns. From a data distribution perspective, the easy (hard)-to-learn samples should have high (low) probability values.
3

---

3.2 Measuring sample difficulty
While not limited to it, we choose the Gaussian distribution to model the training data distribution in the feature space of pre-trained models, and find it simple and effective. We further derive relative Mahalanobis distance (RMD) from as the sample difficulty score.
Class-conditional and agnostic Gaussian distributions. The downstream training set D {(z,, yt 1 is a collection of image-label pairs, with 2, E R2 and yi E 21, K} as the image and its label, respectively. We model the feature distribution of {æt} with and without conditioning on the class information. Let G(-) denote the penultimate layer output of the pre-trained model G. The consiiondii distribution is modelled by fitting a Gaussian model to the feature vectors (G(z;)) belonging to the same class yi
P(G(z) 1- k) = -N I PR, E) PR 1 Σ G(t), NE
(1)
Σ -=NZ 1 E E-NDE (G(zz) - (G(a)) MN)T,
(2)
where the mean vector μa is class-specific, the covariance matrix Σ is averaged over all classes to avoid under-fitting following (46] 27), and N2 is the number of training samples with the label y/ k. The class-agnostic distribution is obtained by fitting to all feature vectors regardless of their classes
P(G(z)) =N (G(x)
Magn: Eaga),
(3)
1 Paga
1
N EG(E,, Dagn
E (G(())) Maga (G(xs) Maga) Magu) N
(4)
Relative Mahalanobis distance (RMD). For scoring sample difficulty, we propose to use the difference between the Mahalanobis distances respectively induced by the class-specific and class- agnostic Gaussian distribution in t and B). and boiling down to
RMM vs) M (mi, Wi) Magg(
(5)
M(x; ys) = - (G(z:) (yy.))
Σ (G(zz) - Myi)
(6)
Magn (xr)) = (G(xr) - Magn) Eng (G(zz) Magn)
(7)
Previous work [46 utilized RMD for OOD detection at test time, yet we explore it rank each sample and measure the sample difficulty in the training set.
A small class- cansicoondii MD M(I,, y.) indicates that the sample exhibits typical features of the sub polullooutiion (training samples from the same class). However, some features may not be unique to the aub-population, i.e., common features across classes, yielding small class-agnostic MD) Mag()x;). Since discriminative features are more valuable for classification, an easier-to-learn sample should have small class-conditional MD but large class-agnostic MD. The derived RMD is thus an improvement over the classcconditional MD for measuring the sample difficulty, especially when we use pre-trained models that have direct supervision for downstream classification. We refer to Appendix A for detailed comparisons.
How well RMD scores the sample difficulty. Qualitatively, Fig. la shows a high-level agreement between human visual perception and RMD-based sample difficulty, and see Appendix [foor more visual examples. As shown, hard samples tend be challenging to classify, as they miss the relevant information or contain ambiguous information. Furthermore, prior works [5] 6 also show that data uncertainty [ should increase on poor-quality images. We manipulate the sample difficulty by corrupting the input image or alternating the label. Fig. showed that the RMD score increases proportionally with the severity of corruption and label noise, which further shows the effectiveness of RRD in characterizing the hardness and noisiness of samples.
As there is no ground-truth annotation of sample difficulty, we construct the following proxy test for quantitative evaluation. Hard samples are more likely to be misclassified. We therefore use RMD to sort each ImageNetlk validation sample in the descending order of the sample difficulty and group them into subsets of equal size. Fig. [ig.Zisha shows that an off-the-shelf ImageNetlk classifier (ResNet34 and standard training procedure) performed worst on the hardest data split, and its performance gradually improves as the data split difficulty reduces. This observation indicates an agreement between ResNet34 and RMD regarding what samples are hard and easy. Such an observation also holds for different architectures, see Fig. 7 in Appendix B

---

Table 1:
Pre-trained Models. We list two variants of CLIP [4 that use ResNet-50
13
and ViT-
Base 10] as the image encoder respectively.
Model
Pre-trained dataset
CLIP- ViT-B
400M image-caption data
CLIP-R50
ViT-B
14M ImageNet21k (w. labels)
MAE-ViT-B 1.3M ImageNetl k (w./o. labels)
DINOv2
142M image data [38]
Fig. also compares four large-scale pre-trained models listed in Table [ for computing RMD. Interestingly, while MAE-ViTE ViT-B [4] is only trained on ImageNetlk (not seeing more data than the downstream classification task), it performs better than ViT-B [TO] trained ImageNet2IK. We hypothesize that self-supervised learning (MAE- ViT-B) plays positive role compared supervised learning (ViT-B), as it does not overfit the training classes and instead learn a holistic understanding of the input images beyond low-level image statistics aided by a well-designed loss (e.g.. the masking and reconstructing strategy in MAE). (9 also reported that a self- supervised model on ImageNetlk (i.e., SwAV) outperforms supervised models in selecting easy samples to prune for improved training effi ciency. Nevertheless, the best-performing model in Fig. is CLIP. The error rate of ResNet34 on the hardest data split rated by CLIP is close to 90%. CLIP learned rich visual concepts from language supervision (cross-modality and large amount of data. Thus, noticeably outperforms the others, which have only seen ImageNet-like data.
CLIP-VIT-B
MAE-VIT-B
VIT-B
0.500
500-000
1000-2240
2500-2000 2000-2000 2000-3030
Top-K hardest samples Figure 2: Error rate achieved by ResNet34 (trained on ImageNetlk) the validation subsets, which respectively contain 500 samples ranked from the ath to hardest. Four different pre-trained models are used for computing RMDs and ranking.
4 Difficulty-awarr Uncertainty Regularization
While we can clearly observe that a dataset often consists of samples with diverse difficulty levels (e.g.. Fig. La), the standard training loss formulation is sample difficulty agnostic. In this section, propose a sample difficulty-aware entropy regularization to improve the training loss, which will be shown to yield more reliable predictions.
Let Se denote the classifier parameterized by a deep neural network, which outputs a conditional probability distribution ps(3) (z) Typically, train fe by minimizing the cross-entrops loss on the training set
= = (.) ) log (fe (x.) [xx])
(8)
where fo(x;)[yx] refers to the predictive probability of the ground-trus ttunt label y:-
is well known that deep neural networks trained with cross-entropy loss tend make overconfident predictions. Besides the overfitting reason, it is also because the ground-truth label is typically one-hot vector which represents the highest confidence regardless the sample difficulty. Although different regularization-ball based methods (36 22 35 have been proposed to address the issue, they all ignore the difference between easy and hard samples and may assign an inappropriate regularizer for some samples. In view of this, we propose to regularize the cross-entropy loss with sample difficulty-aware entropic regularizer
= E ( log (fe (æ+) [y.] as(a,, y. H[f (x:)]).
where a is a hyper-parameter used to control the global strength of entropy regularization and the value range is generally in (0, 0.5). s(2;, E (0, is normalized sample-specific weighting derived from the RMD-based sample difficulty score (5)
exp (RM 3T)
5(14, y.)
(10)
(xx W:).TTTTT
5

---

As the entropic regularizer encourages uncertain predictions, the sample-adaptive weighting s(r; Bs). ranging from 0 to I. is positively proportional the sample difficulty score R., y:). where the parameter equals to small constant (e.g., le-3) ensuring the value range (0. 1). The parameter T
adjustable to control the relative importance among all training data, Fig. 10 Appendix shows the distribution of s(-) under different T.
Implementation details of sample difficulty score. Because the difficulty level of sample may vary depending on how data augmentation is applied, we conduct five random runs to fit Gaussian distributions to eliminate the potential effect. Moreover, we check how the standard augmentation affects the score in Eq. [00] where the numerator can be computed based on each sample with randomly chosen data augmentation, and denominator can be obtained by taking the maximum from the dataset we created to fit the Gaussians in the first step. We do not find data augmentation changes the score too much. Therefore, we can calculate per-sample difficulty score once before training for the sake of saving computing overhead and then incorporate it into the model training using Eq. 9
5 Experiment
We thoroughly compare related uncertainty regularization techniques and sample difficulty measures on various image classification benchmarks. We also verify if our sample difficulty measure conveys important information about the dataset useful different downstream models. Besides accuracy and uncertainty calibration, the quality of uncertainty estimates is further evaluated on two proxy tasks, i.e,, selective classification and out-of-distribution detection.
Datasets. CIFAR-10/100 25 and ImageNet1k 7 are used for multi-class classification training and evaluation. ImageNet-C C 17 is used for evaluating calibration under distribution shifts, including blur, noise, and weather-related 16 types of corruptions, at five levels of severity for each type. For OOD detection, in addition to CIFAR-100 vs. CIFAR-IO, we use iNaturalist [5]] as the near OOD data of ImageNetlk.
Implementation details. We use standard data augmentation (i.c., random horizontal flipping and cropping) and SGD with weight decay of le-4 and momentum of 0.9 for classification training, and report averaged results from five random runs. The default image classifier architecture is ResNet34 [15]. For the baselines, we use the same
setting as recommended in in our training loss (9), we set a as 0.3 and 0.2 for CIFARs and ImageNet1 respectively, where T equals 0.7 for all datasets. CLIP-ViT-B 44 is utilized as the default pre-trained model for scoring the sample difficulty.
[52] For the hyper-paramette
Evaluation metries. To measure the prediction quality, we report accuracy and expected calibration error (ECE) [37] (cqual-mass binning and 15 bin intervals) of the Top-1 prediction. For selective classification and OOD detection, we use three metries: (1) False positive rate at 95% true positive rate (FPR-95%); (2) Area under the receiver operating characteristic curve (AUROC); (3) Area under the precision-recall curve (AUPR).
5.1 Classification accuracy and calibration
Reliable prediction concerns not only the correctness of each prediction but also if the prediction confidence matches the ground-trute -ruth accuracy, i.e., calibration of Top-1 prediction.
ILD.. setting. Table both accuracy and ECE on the dataset CIFAR- 10/100 and ImageNet1 k where the training and evaluation data follow the same distribution. Our method considerably improves both accuracy and ECE over all baselines. It is worth noting that except ER and our method, the others cannot simultaneously improve both ECE and accuracy, trading accuracy for calibration or vice versa. Compared conventional ER with constant weighting, instance-wir -wie weighting leads to much more pronounced gains, e.g., reducing ECE more than 50% on ImageNetlk with accuracy increase of +0.43%. Furthermore, also compare with PolyLoss 29], a recent state-of- of-te--o-th-ann the-art classification loss. reformulates the CE loss as a linear combination of polynomial functions and additionally allows flexibly adjusting the polynomial coefficients. In order to improve the accuracy, it has to encourage confident predictions, thus compromising ECE, After introducing the sample difficulty awareness, we avoid facing such trade-off.
sample difficulty

---

Table 2: The comparison of predictive Top-1 accuracy (%) and ECE (%) on CIFAR-10/-Ie and ImageNetlk using ResNet-34. The six baseline methods respectively use the standard cross entropy (CE) loss, CE with label smoothing (I.S) [36], focal loss (FL.) [35, CE with L, Norm-based
regualarization (22), CE with entropy regularization (ER) 42 and PolyLoss (Poly) 29 In contrast
to our method, all these baseline losses are sample lifficulty-agnostic
CE
LS
FL
L1 Norm
ER
Poly
Proposed
CIFAR-10
ACC
93.79
94.47
93.82
94.51
94.34
94.66
95.67=0.16
ECE
3,980
3.816
3.520
3.542
3.198
5,283
1.212::0.11
CIFAR-100
ACC
76.79
76.48
76.74
74.32
77.32
77.39
78.58-10.11
ECE
7.251
6.363
4.110
6.232
4.092
8.554
3.410-10.23
ImageNetlk
ACC
73.56
73.69
72.82
73.21
73.68
74.02
74.11=0.110
ECE
5.301
3.994
4.901
2.625
3.720
7.882
1.002-0.11
CE
80
ER
264
Proposed
82
17.51
Accuracy
Exterted Gattratinn Enee
150
80
10.3
14
Shift Intens
Percent of data rejected by entropy
Figure 3: Box plot: ECEs of different methods on ImageNet-C under all types of corruptions with 5 levels of shift intensity. Each box shows a summary the results of 16 types of shifts.
Figure 4: Accuracy vs. rejection rate, us- ing the predictive entropy the uncer- tainty measure to reject predictions on Ima- geNetlk.
Improvements across classification models. If our sample difficulty measure carries useful infor- mation about the dataset, it should lead to consistent gains across different classifier architectures (e.g., ResNet, Wide-ResNet and DenseNet). Table Appendix positively confirms that it benefits the training of small and large models.
Under distributional shift. [39 has shown that the quality of predictive uncertainty degrades under distribution shifts, which however are often inevitable in real-world applications. We further evaluate the calibration performance achieved by the ImageNet classifier on ImageNet-C [17]. Specifically, Fig. 3 plots the ECE of each method across 16 different types of corruptions five severity levels, which ranges from the lowest level one to the highest level five. prominent that the proposed method surpasses other methods for ECE at various levels of skew. In particular, the gain becomes even larger as the shift intensity increases.
5.2 Selective classification
While we do not have the ground-truth predictive uncertainty annotation for each sample, it is natural expect that application of calibrated predictions to make the model aware of what it does not know. Next, we validate such expectations via selective classification. Namely, the uncertainty measure is used to detect misclassification via thresholding. Rejecting every prediction whose uncertainty measure is above a threshold, then evaluate the achieved accuracy on the remaining predictions. A high- quality uncertainty measure should improve the accuracy by rejecting misclassification but also ensure coverage (not trivially rejecting every prediction).
uncertain prediction should be more likely to be wrong. A critical real-world
Misclassification detection. Table 3 reports the threshold-free metrics, i.e., FPR, AUROC and AUPR, that quantify the success rate of detecting misclassifications based on two uncertainty mea-

---

sures, i.e., maxinum softmax probability (MSP) [8] and entropy. The proposed regularizer is obviously the top-pen pop-perfrnning one in all metries on both CIFARI00 and ImageNetlk. The gains are particularly pronounced in FPRs, indicating that the proposed method does not overly trade coverage for accuracy. This further confirmed in Fig.
Interestingly, our method also reduces the performance gap between the two uncertainty measures, i.e., entropy can deliver similar performance as MSP. Both are scalar measures derived from the same predictive distribution over all classes but carry different statistical properties. While we cannot directly assess the predictive distribution, the fact that different statistics derived from it are all useful is a positive indication.
Accuracy vs. Coverage. Fig. plots the accuracy vs. rejection rate on ImageNetlk. Compared to the cross entropy loss (CE) and entropy regularization (ER) with constant weighting (which the best baseline in Table 3. our proposal offers much higher selective classification accuracy at the same rejection rate. Moreover, the gain (orange area) increases along with the rejection rate, indicating the effectiveness of our method. Without sample difficulty- aware weighting, the accuracy gain of ER over CE vanishes on ImageNetlk.
In Appendix [ we also compare the predictive entropy and confidence of different methods for wrong predictions, see Fig I1 The proposed method achieves the lowest predictive confidence and highest entropy among all methods for misclassified samples, which further verifies the reliable uncertainty estimation of the proposed regularizer.
Table 3: The comparison of misclassification de- Table 4: The comparison of near OOD detection performance (%).
tection performance (%).
Dataset
Method
FPR-95%
AUROC
AUPR 1
Din/Dout Method FPR-95%
A
AUPR 1
MSP/ Entropy
MaxLogit Entropy
CB
45.21/47.44
86 29/86.58
94.70995.47
CE
60.19/60.10 78.42/78.91
79.02/80.19
49.19/49.71 86.00885.82
94.31/94.19
LS
69.51/70.08 77.14/7.31
75.92/75.89
C100
FL
47.30/48.84
85.90/84.72
94.90/94.50
CIOCCI0
FL
61.02/61.33
78.79/79.36
80.22/80.22
L1
48.11/48.40 85.52/85.31
94.05/93.90
L
61.58/6160 606 76.52/76.58
79.19/79.21
45.40/46.88
86.32/85.09
95.26/95.20
ER
59.52/59.92 79.22/79.46
81.01/81.22
CRL
44.80/46.08 86.67/85.99 98 95 95.55/95.49
CRL
58.13/5H.54 79.91/80.13
81.75/81.89
Ours
42.71/43.22
87.50/87.03
96.10/6.02
Ours
55.48/5.600
80,20/80.72
82,51/82,84
CB
46.93/48.94 86.03/85.02 94.22/93.75
CB
36.06/40.33
89.82/89.02
97.61/97.40
1.5
52.12/61.52 52
85.28 11.28/11.0 1.00 93.86/91.98
L.S
37.56/41.22
89. 10/89.35
97. 12/97.33
ImageNetlk
48.54/51.10
85.67/83.05
94.08/93.03
ImageNet1k/ iNaturalist
FL
36.50/36.32
90.03/90.55
97.76/9.800
47.19/48.55 58
86. 19/89.84558
94.39/93.82
I,
38. 38.32/46.03
88 88.90/88.29
97.53/97.27
FR
46.98/48.85
86. 15/184441
19
94.38/93.82
ER
36.00/35.1 II
89. 89.86/90.04
97,75/97.43
CRL
46.03/48.01
86.11/84.33
94.41/93.89
CRL
35.07/34.65
90.11/90.32
97.96/97881
Ours
45.69/46.72
86.53/85.23 94.76/94.31
Ours
32.17/34.19
91.03/90.65
98.03/97.99
5.3 Out-of-distrbbution detection (OOD)
In open- world context, test samples can be drawn from any distribution. A reliable uncertainty estimate should be high on test samples when they deviate from the training distribution. In light of this, we verify the performance of the proposed method on near OOD detection (i.e., CIFAR-100 vs CIFAR-10 and ImageNet vs iNaturalist). which is a more difficult setting than far OOD tasks (e.g.. CIFARI00 vs SVHN and CIFARIO vs MNIST) [12]
As our goal is to evaluate the quality of uncertainty rather than specifically solving the OOD detection task, we leverage MaxLogit and predictive entropy as the OOD score. [16] showed MaxLogit to be more effective than MSP for OOD detection when dealing with a large number of training classes, e.g., ImageNetlk. Table improvements in OOD detection, indicating its effectiveness for reliable predictions.
4 shows that the uncertainty measures improved by method lead to
5.4 The robustness of hyperparameter a
We analyze the effects of hyper-parameters: a in ER and the proposed method on the predictive performance, and Table reports the comparison results of different a ImageNetIk. Compared to ER, the proposed method is less sensitive to the choice of owing to sample adaptive weighting, whereas ER penalizes confident predictions regardless of easy or hard samples. Oftentimes, large
8

---

Table 5: The comparison for ACC and ECE under different a on ImageNetIk, Bold indicates the results from the chosen hyperparameter.
0.05
0.10
0.15
0.20
0.25
0.30
ER
ACC
73.56
73.59
73.68
73.76
73.78
73.81
73.88
ECE
5.301
3.308
3.720
10.19
15.24
25.22
33.26
Proposed
ACC
73.56
73.89
73.91
74.08
74.11
74.13
73.98
ECE
5.301
1.855
1.851
1.596
1.602
1.612
1.667
portion of data is not difficult to classify, but the equal penalty on every sample results in the model becoming underconfident, resulting to poor ECEs.
5.5 Comparison of different sample difficulty measures
Finally, we compare different sample difficulty measures for reliable prediction, showing the superi- ority of using large-scale pre-trained models and the derived RMD score.
CLIP is the top-performing model for sample difficulty quantification. In addition to Fig. 2 Table [6] compares the pre-trained models listed in Table in terms accuracy and ECE. All pre-trained models improve the baseline (using the standard CE loss), especially in ECE. CLIP outperforms ViT-B/MAE-ViT-B. thanks to a large amount of diverse multi-modal pre-trained data (i.e., learning the visual concept from language supervision). Additionally, the performance of using recent DINOv2
38 as a pre-trained model to quantify sample difficulty also surpasses ViT- B/MAE-ViT-B. While ImageNet21k is larger than ImageNetik, self-supervised learning adopted by MAE-ViT-B reduces overfitting the training classes, thus resulting in better performance than ViT-B (which is trained supervisedly).
Table 6: The comparison of different pre-trained models for accuracy and ECE on ImageNetIk.
ViT-B MAE-ViT-B DINOv2 CLIP-R50 CLIP-ViT-B
ACC 73.59
73.81
74.01
74.05
74.11
ECE J. 2.701
1.925
1.773
1.882
1.602
CLIP outperforms supervised models on the task dataset. To further confirm the benefits from large-scale pre-training models, we compare them with supervised models on the task dataset (i.e., ImageNetlk). We use three models (i.e., ResNe(34/50/101) trained with 90 epochs on ImageNetIk to measure the sample difficulty. We did not find it beneficial to use carlier-terminated models. The classifier model is always ResNet34-based. Besides RMD, we also exploit training loss of each sample for sample difficulty quantification. Table 10 Appendix shows that they all lead to better ECÉs than ER with constant weighting (see Table 2}. Compared to the pre-trained models in Table 6 they slightly worse than ViT-B in ECE. Without exposure to the Ik classes, MAE-VE ViT-B achieves a noticeably better ECE. The pronounced improvements in both accuracy and ECE shown in the last column of Table 10 are enabled by CLIP.
Effectiveness of RMD. We resorted to density estimation for quantifying sample difficulty and derived the RMD score. Alternatively, (50) proposed to use the frequency of correct predictions during training epochs. Based on that, 34 proposed new loss termed correctness ranking loss (CRL). It aims to ensure that the confidence-based ranking between the two samples should be consistent with their frequency- datasets. Our RMD score is derived from the whole data distribution, thus considering all samples at once rather than random pair at each iteration. The ranking between the two samples also changes over training, while RMD is constant, thus ensuring a stable training objective.
ranking. Table 7 shows method scales better with larger
Next, we compare different distance measures in the feature space of CLIP-VVT-B, i.e., K-means, MD and RMD. Tablee& confirms the superiority of RMD measuring the sample difficulty and ranking the training samples.

---

Table 7: The comparison of RMD and correctness ranking loss (CRL) 3 diction confidence.
Table 8: The comparison of different sample diffi- culty measures for predictive Top-1 accuracy (%) and ECE (%) on ImageNetlk.
in regularizing the pre-
Method
C10 C100 ImageNetIk
K-means MD RMD
CRL
ACC 1 94.06 76.71
73.60
ACC
73.78
73.71
74.11
ECE | 0.957 3,877
2.272
ECE
2.241
2.125 1.613
Proposed ACC 1 95.67 78.58
74.11
ECE | 1.212 3.410
1.602
6 Conclusions
This work introduced a new application of pre-trained models, exploiting them to improve the calibration and quality of uncertainty quantification of the downstream model. Profiting from rich large-scale (or even multi-modal) datasets and self-supervised learning for pre-training, pre-trained models do not overfit the downstream training data. Hence, derive relative Mahalanobis distance (RMD) via the Gaussian modeling in the feature space of pre-trained models to measure the sample difficulty and leverage such information to penalize overconfident predictions adaptively. We perform extensive experiments to verify our method's 's effectiveness, showing that the proposed method can improve prediction performance and uncertainty quantification simultancously.
In the future, the proposed method may promote more approaches to explore the potential of large- scale pre-trained models and exploit them to enhance the reliability and robustness of the downstream model. For example, for the medical domain, MedCLIP [53] can be an interesting alternative to CLIP/DINOv2 for practicing our method. Besides, conjoining accuracy and calibration is vital for the practical deployment of the model, so we hope our method could bridge this gap. Furthermore, many new large-scale models (including CLIP already) have text-language alignment. In method, we do not explore the language part yet, however, it would be interesting to use the text encoder to "explain" the hard/easy samples in human language. One step further, if the pre-trained models can also synthesize (here CLIPs cannot), we can augment the training with additional easy or hard samples to further boost the performance.
Potential Limitations. Pre-trained models may have their own limitations. For example, CLIP is not straightforwardly suitable for medical domain data, as medical images can be OOD (out-of- distribution) to CLIP. targeting chest x-rays, we need switch from CLIP to MedCLIP [53 as a pre-trained model to compute the sample difficulty. In this work, CLIP is the chosen pre-trained model, as it is well-suited for handling natural images, which are the basis of the targeted benchmarks. Besides, the calculation of sample difficulty introduces an additional computational overhead although we find very affordable.
Acknowledgments
This work was supported by NSFC Projects (Nos. 6206113600 92248303, 62106123, 61972224), Natural Science Foundation of Shanghai (No. 23ZR 142770)) and the Key Research and Development Program of Shandong Province, China (No. 2023CXGC0101 12), Tsinghua Institute for Guo Qiang. and the High Performance Computing Center, Tsinghua University. J.Z is also supported by the XPlorer Prize.
References
[1] Chirag Agarwal, Daniel D' souza, and Sara Hooker. Estimating example difficulty using variance of gradients. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), pages 10368-10378 June 2022.
[2] Robert John Nicholas Baldock, Hartmut Maennel, and Behnam Neyshabur. Deep learning through the lens of example difficulty. A. Beygelzimer, Dauphin, P. Liang, and J. Wortman Vaughan, editors, Advances in Neural Information Processing Systems, 2021.
10

---

[3] Hangbo Bao, Li Dong, and Furu Wei. Beit: Bert pre-training of image transformers. arXiv preprint arXiv:2106.08254, 2021.
[4] Tom Brown, Benjamin Mann, Nick Ryder, Melanie Subbiah, Jared D Kaplan, Prafulla Dhariwal, Arvind Neelakantan, Pranav Shyam, Girish Sastry, Amanda Askell, et al. Language models are few-shot learners. Advances in neural information processing systems, 33:1877-1901, 2020.
[5] Jie Chang. Zhonghao Lan, Changmao Cheng, and Yichen Wei. Data uncertainty learning in face recognition. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 5710-5719, 2020.
[6] Peng Cui, Yang Yue, Zhijie Deng, and Jun Zhu. Confidence-based reliable learning under dual noises. In Advances in Neural Information Processing Systems, 2022.
[7] Jia Deng, Wei Dong, Richard Socher, Li-Jia Li, Kai Li, and Li Fei-Fei. Imagenet: A large- scale hierarchical image database. In 2009 IEEE conference on computer vision and pattern recognition, pages 248-255. leee, 2009.
[8] Stefan Depeweg, Jose-Miguel Hernandez-Lohato, Finale Doshi- and Steffen Udluft. Decomposition of uncertainty in bayesian deep learning for efficient and risk-sensitive learning. In International Conference on Machine Learning, pages 1184-1193, PMLR, 2018.
[9] Jacob Devlin, Ming- Ming-Wei Chang, Kenton Lee, and Kristina Toutanova. Bert: Pre-training of deep bidirectional transformers for language understanding. arXiv preprint arXiv:1810.04805, 2018.
[10] Alexey Dosovitskiy, Lucas Beyer, Alexander Kolesnikov, Dirk Weissenborn, Xiaohua Zhai, Thomas Unterthiner, Mostafa Dehghani, Matthias Minderer, Georg Heigold, Sylvain Gelly, et al. An image is worth 16x16 words: Transformers for image recognition at scale. arXiv preprint arXiv:2010.11929, 2020.
[11] Kawin Ethayarajh, Yejin Choi, and Swabha Swayamdipta. Understanding dataset difficulty with V-usable information. In Proceedings of the 39th International Conference on Machine Learning, pages 5988-6008 6008. PMLR, July 2022.
[12] Stanislav Fort, Jie Ren, and Balaji Lakshminarayanan. Exploring the limits of disttr--distibuution detection. Advances in Neural Information Processing Systems, 34:7068-7081, 2021.
[13] Zoubin Ghahramani. Probabilistic machine learning and artificial intelligence.
Nature,
521(7553)4452-459 2015.
[14] Kaiming He, Xinlei Chen, Saining Xie, Yanghao Li, Piotr Dollár, and Ross Girshick. Masked autoencoders are scalable vision learners. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 16000-16009, 2022.
[15) Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Deep residual learning for image recognition. In Proceedings of the IEEE conference on computer vision and pattern recognition, pages 770-778, 2016.
[16] Dan Hendrycks, Steven Basart, Mantas Mazeika, Andy Zou, Joseph Kwon, Mohammadreza Mostajabi, Jacob Steinhardt, and Dawn Song. Scaling -uitt---isti detection for real- world settings. In Kamalika Chaudhuri. Stefanie Jegelka, Le Song, Csaba Szepesvári, Gang Niu, and Sivan Sabato, editors, International Conference on Machine Learning. ICML 2022, 17-23 July 2022, Baltimore, Maryland, USA, volume 162 of Proceedings of Machine Learning Research, pages 8779-8773. PMLR, 2022.
[17] Dan Hendrycks and Thomas Dietterich. Benchmarking neural network robustness to common corruptions and perturbations. In International Conference on Learning Representations, 2018.
[18] Dan Hendrycks and Kevin Gimpel. A baseline for detecting misclassified and -istr--iisttiuution examples in neural networks. In International Conference Learning Representations, 2016.
[19] Dan Hendryeks, Kimin Lee, and Mantas Mazeika. Using pre-training can improve model robustness and uncertainty. In International Conference on Machine Learning, pages 2712- 2721. PMLR, 2019.

---

[20] Xiaoqian Jiang, Melanie Osl, Jihoon Kim, and Lucila Ohno- MatnoMoa Calibrating predictive model estimates support personalized medicine. Journal of the American Medical Informaties Association, 19(2):263-22) 2012.
[21] Ziheng Jiang, Chiyuan Zhang. Kunal Talwar, and Michael C Mozer. Characterizing struc- tural regularities of labeled data in overparameterized models. In Proceedings of the 38th International Conference on Machine Learning, pages 5034-5044, July 2021.
[22] Taejong Joo and Uijung Chung. Revisiting explicit regularization in neural networks for well-calibrated predictive uncertainty. arXiv preprint orXiv:2006. (6039, 2020.
[23] Alex Kendall and Yarin Gal. What uncertainties do we need in bayesian deep learning for com- puter vision? In Guyon, U. Von Luxburg, Bengio, H. Wallach, Fergus, S. Vishwanathan, and R. Garnett, editors, Advances in Neural Information Processing Systems, volume 30. Curran Associates, Inc., 2017.
[24] Donghyun Kim, Kaihong Wang, Stan Sclaroff, and Kate Saenko. A broad study of pre-training for domain generalization and adaptation. arXiv preprint arXiv:2203. / 1119, 2022.
[25] Alex Krizhevsky. Learning multiple layers of features from tiny images. Technical report, 2009.
[26] Balaji Lakshminarayanan, Alexander Pritzel, and Charles Blundell. Simple and scalable predictive uncertainty estimation using deep ensembles. Advances in neural information processing systems, pages (402-6413, 2017.
[27] Kimin Lee, Kibok Lee, Honglak Lee, and Jinwoo Shin. A simple unified framework for detecting outtt--distiiuutiinn samples and adversarial attacks. In Proceedings of the 32nd International Conference on Neural Information Processing Systems, pages 7167-7177, 2018.
[28] Christian Leibig, Vaneeda Allken, Murat Seçkin Ayhan, Philipp Berens, and Siegfried Wahl. Leveraging uncertainty information from deep neural networks for disease detection. Scientific reports, 7-1):1114, 2017.
[29] Zhaoqi Leng, Mingxing Tan, Chenxi Liu, Ekin Dogus Cubuk, Jay Shi, Shuyang Cheng, and Dragomir Anguelov. Polyloss: A polynomial expansion perspective of classification loss functions. In The Tenth International Conference on Learning Representations, ICLR 2022, Virtual Event, April 25-29, 2022, 2022.
[30] Tsung- Yi Lin, Priya Goyal, Ross Girshick, Kaiming He, and Piotr Dollár. Focal loss for dense object detection. 20/7 IEEE International Conference on Computer Vision (ICCV), pages 2999-3007, 2017.
[31] Jeremiah Zhe Liu, Zi Lin, Shreyas Padhy, Dustin Tran, Tania Bedrax- Weiss, and Balaji Laksh- minarayanan. Simple and principled uncertainty estimation with deterministic deep learning via distance awareness. Advances in Neural Information Processing Systems, 33, 2020.
[32] Rhiannon Michelmore, Matthew Wicker, Luca Laurenti, Luca Cardelli, Yarin Gal, and Marta Kwiatkowska. Uncertainty quantification with statistical guarantees in end-to-aaee autonomous driving control. In International Conference on Robotics and Automation, 2020.
[33] Sören Mindermann, Jan M Brauner, Muhammed T Razzak, Mrinank Sharma, Andreas Kirsch, Winnie Xu, Benedikt Höltgen, Aidan N Gomez, Adrien Morisot, Sebastian Farquhar, and Yarin Gal. Prioritized training on points that are learnable, worth learning, and not yet learnt. In Proceedings of the 39th International Conference on Machine Learning, pages 15600-15649, July 2022.
[34] Jooyoung Moon, Jihyo Kim, Younghak Shin, and Sangheum Hwang. Confidence-aware learning for deep neural networks. In International Conference on Machine Learning, 2020.
[35] Jishnu Mukhoti, Viveka Kulharia, Amartya Sanyal, Stuart Golodetz, Philip Torr, and Puneet Dokania. Calibrating deep neural networks using focal loss. Advances in Neural Information Processing Systems,
2020.
12

---

[36] Rafael Müller, Simon Korbliihh, and Geoffrey E Hinton. When does label smoothing help? Advances neural information processing systems, 32, 2019.
[37] Mahdi Pakdaman Nacini, Gregory Cooper, and Milos Hauskrecht. Obtaining well calibrated probabilities using bayesian binning. In Tiwent-Ninth AAAI Conference on Artificial Intelligence, 2015.
[38] Maxime Oquab, Timothée Darcet, Theo Moutakanni, Huy V. Vo. Marc Szafraniec, Vasil Khalidov, Pierre Fernandez. Daniel Haziza, Francisco Massa, Alaaeldin El-Nouby, Russell Howes, Po-Yao Huang, Hu Xu, Vasu Sharma, Shang-Wen Li, Wojeiech Galuba, Mike Rabbat, Mido Assran, Nicolas Ballas, Gabriel Synnaeve, Ishan Misra, Herve Jegou, Julien Mairal, Patrick Labatut, Armand Joulin, and Piotr Bojanowski. Dinov2: Learning robust visual features without supervision, 2023.
[39] Yaniv Ovadia, Emily Fertig, Jie Ren, Zachary Nado, D. Sculley, Sebastian Nowozin, Joshua Dillon, Balaji Lakshminarayanan, and Jasper Snoek. Can you trust your model's uncertainty? evaluating predictive uncertainty under dataset shift. In Advances in Neural Information Processing Systems, 2019.
[40] Mansheej Paul, Surya Ganguli, and Gintare Karolina Dziugaite. Deep learning on data diet: Finding important examples early in training, Advances in Neural Information Processing Systems, 34:20596-20607, 2021.
[41] Bohua Peng, Mobarakol Islam, and Mei Tu. Angular gap: Reducing the uncertainty of image difficulty through model calibration. In Proceedings of the 30th ACM International Conference on Multimedia, page 979-987, New York, NY, USA, 2022.
[42] Gabriel Pereyra, George Tucker, Jan Chorowski, Lukasz Kaiser, and Geoffrey Hinton. Reg- ularizing neural networks by penalizing confident output distributions. arXiv preprini wxXiv:1701.06544 2017.
[43] Hieu Pham, Zihang Dai, Golnaz Ghiasi, Hanxiao Liu, Adams Wei Yu, Minh-Thang Luong, Mingxing Tan, and Quoc V Le. Combined scaling for zero-shot transfer learning. arXiv preprint arXiv:2111.10050 2021.
[44] Alec Radford, Jong Wook Kim, Chris Hallacy, Aditya Ramesh, Gabriel Goh, Sandhini Agarwal, Girish Sastry, Amanda Askell, Pamela Mishkin, Jack Clark, et al. Learning transferable visual models from natural language supervision. In International Conference on Machine Learning, pages 8748-8763. PMLR, 2021.
[45] Colin Raffel, Noam Shazeer, Adam Roberts, Katherine Lee, Sharan Narang, Michael Matena, Yanqi Zhou, Wei Li, Peter J Liu, al. Exploring the limits of transfer learning with unified text-to-text transformer. J. Mach. Learn. Res., 21(140):1677, 2020.
[46] Jie Ren, Stanislav Fort, Jeremiah Liu, Abhijit Guha Roy, Shreyas Padhy, and Balaji Lakshmi- narayanan. A simple fix to Mahalanobis distance for improving near-OOD detection. arXiv preprint arXiv:2106.09002. 090222, 2021.
[47] Olga Russakovsky, Jia Deng, Hao Su, Jonathan Krause, Sanjeev Satheesh, Sean Ma. Zhiheng Huang, Andrej Karpathy, Aditya Khosla, Michael Bernstein, et al. Imagenet large scale visual recognition challenge. International Journal of Computer Vision, 115(3):211-255 2015.
[48] Robin Schirmeister, Yuxuan Zhou, Tonio Ball, and Dan Zhang. Understanding anomaly detection with deep invertible networks through hierarchies of distributions and features. In H. Larochelle, M. Ranzato, R. Hadsell, M.F. Balcan, and H. Lin, editors, Advances in Neural Information Processing Systems, pages 21038 21038-21049, 2020.
[49] Ben Sorscher, Robert Geirhos, Shashank Shekhar, Surya Ganguli, and Ari S Morcos. Beyond neural scaling laws: beating power law scaling via data pruning. In Advances in Neural Information Processing Systems, 2022.
[50] Mariya Toneva, Alessandro Sordoni, Remi Tachet des Combes, Adam Trischler, Yoshua Bengio, and Geoffrey J Gordon. An empirical study of example forgetting during deep neural network learning. In International Conference Learning Representations, 2018.
13

---

[51] Grant Van Horn, Oisin Mac Aodha, Yang Song, Yin Cui, Chen Sun, Alex Shepard. Hartwig Adam, Pietro Perona, and Serge Belongie. The inaturalist species classification and detection dataset. In Proceedings of the IEEE conference computer vision and pattern recognition, pages 8769-8778, 2018.
[52] Deng-Bar Bao Wang, Lei Feng, and Min-Ling Zhang. Rethinking calibration of deep neural networks: Do not be afraid of overconfidence. Advances in Neural Information Processing Systems, 34:1 11800, 2021.
[53] Zifeng Wang, Zhenbang Wu, Dinesh Agarwal, and Jimeng Sun. Medclip: Contrastive learning from unpaired medical images and text. In Proceedings of the 2022 Conference on Empirical Methods in Natural Language Processing, pages 3876-3887, 2022.
[54] Xiaohua Zhai, Xiao Wang, Basil Mustafa, Andreas Steiner, Daniel Keysers, Alexander Kolesnikov, and Lucas Beyer. Lit: Zero-shot transfer with locked-image text tuning. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 18123-18133 2022.
14

---

A
The comparison of MD and RMD for measuring the sample difficulty
(a) Visualization Top-8 hardest samples (top row) Top-8 easiest samples (bottom row) in ImageNet
(class Tusker) which are ranked by means of the CLIP-VIT-B --ased RMD score.
payarr
(b) Visualization of the Top-8 8 hardest samples (top row) and Top-8 easiest samples (bottom row) in ImageNet (class Tusker) which are ranked by means of the CLIP-VIT B B-based MD score.
Figure 5: Visualization of the Top-k hardest and easiest samples in ImageNet (class Tusker) which are ranked by RMD and MD scores. In contrast to the MD score, the easy and hard samples measured by RMD are more accurate than those by MD.
RMD
RMD
Error tabe
Error
0.4
59K-000
20043900
1506-209 JEWKO00K
259000
58000000 2009-349
1500-309
24000000
25RAXC0
Top-k handest samples under ResNet18
Top KC hardest samples under ResMet34
(a) Error rate achioved by ResNet18 (trained on Ima- geNet) the validation subsets, which respectively contain 500 samples ranked from the ath to 6th hard- est.
(b) Error rate achieved by ResNet34 (trained on Ima- geNet) the validation subsets, which respectively contain 500 samples ranked from the ath 6th hard- est.
Figure 6: The performance comparison of RMD and MD for characterizing Top-K K hardest samples.
In Fig. 5] we further compare Top-k hardest and easiest samples that ranked by RMD (Fig. Sa and MD (Fig. (b)) scores respectively. We can see that hard and easy samples characterized by RMD are more accurate than those characterized by MD, and there is a high-level agreement between human visual perception and RMD- based sample difficulty. Moreover, we quantitatively compare the performance of RMD and MD for characterizing Top-K hardest samples in Fig ( We can observe that the error rate of ResNet18 and ResNet34 on the hardest data split rated by RMD is close to 90%, which significantly suppresses the performance MD. Therefore, the derived RMD in this paper an improvement over the class-conditional MD for measuring the sample difficulty.
15

---

B Additional comparisons for different pre-trained models
0.7
Error rate
0.6
CLIP-ViT-B
CLIP-R50
MAE-ViT-B
0.3
VIT=B
0-500
500-1000
1000-1500
1500-2000
2000-2500
2500-3000
Top-K hardest samples
Figure 7: Error rate achieved by DenseNet121 (trained on ImageNet) on the validation subsets, which respectively contain 500 samples ranked from the ath 6th hardest. Four different pre-trained models are used for computing RMDs and ranking. They all show the same trend, i.e., the error rate reduces along with the sample difficulty. However, VTT-B supervisedly trained on ImageNe121 k performed much worse than the others.
C More hard and easy samples ranked by RMD
hurdet
Figure 8: Visualization of the Top-8 hardest samples (top row) and Top-8 easiest samples (bottom row) in ImageNet (class indigo bird) which ranked by means of the CLIP-VIT HuP-VIT---basedd RMD score.
Figure 9: Visualization of the Top-8 hardest samples (top row) and Top-8 easiest samples (bottom row) in ImageNet (class echidna) which are ranked by means of the LLLP--VT-B-baseee RMD score.
16

---

T-0.5
T=0,5
1.75
T-0.7
T=0.7
T-1
T=1
T-5
0.
T=5
1.25
Counts
Counts
0.5
0.75
04
02
0.25
Sample-adaptive weighting s(x.y)
Sample-adaptive weighting s(x.y)
(a) ImageNetlk.
(b) CIFARI00.
Figure 10: Histograms of s Ms) different T'
D More experimental results
Vanilla Resnet34
Vanilla Resnet34
2.0
ER
ER
Ours
0.7
Ours
0.6
1.5
Confidence
Entropy
0.5
1.0
0.3
0.5
0.1
0.0
0.0
CIFAR 10
CIFAR 100
ImageNet
CIFAR-10
CIFAR-100
ImageNet
(a) Predictive entropy of misclassified samples on FAR and ImageNet datasets.
(b) Predictive confidence of misclassified samples on CIFAR and ImageNct datasets.
Figure 11: Predictive entropy and confidence of misclassified samples for different methods on CIEAR and ImageNet datasets.
17

---

Conet
CO
04:30
LBYB
HINK ITIVE
10
Test samples with predictions corresponding to the Top-100 relative Mahalanobis distance. The text box ("x-x"") with green shade represents misclassification. The first number indicates the label class, and the second number indicates the predictive class.
Figure 12:
Table 9: The comparison of various architectures for predictive Top-1 accuracy (%) and ECE (%) on ImageNetlk.
Arch.
CE
ER
Proposed
ResNet18
ACC
70.46
70.59
70.82
ECE |
4.354
2.773
1.554
ResNet34
ACC
73.56
73.68
74.11
ECE 4
5.301
3.720
1.602
ResNet50
ACC
76.08
76.11
76.59
ECE +
3.661
3.212
1.671
DenseNet121
ACC f
75.60
75.73
75.99
ECE |
3.963
3.010
1.613
WRN50x2
ACC
76.79
76.81
77.23
ECE
4.754
2.957
1.855
18

---

Table 10: The comparison of different model-based measures for predictive Top-1 accuracy (%) and ECE (%) ImageNetlk. Compared to the three ResNets, "A" denotes the averaged gain achieved by CLIP-ViT-B in 6
Measures
ResNet34
ResNet50
ResNet101
RMD
ACC 1
73.73
73.78
73.88
+0.31
ECE |
3.298
2.996
2.882
-1.44
Loss
ACC 1
73.58
73.61
73.75
+0.46
ECE 4
3.624
2.997
2.783
-1.52
19


Reviews:
[{"review_id": "tXMixH3DNI", "reviewer": "Reviewer_FmxN", "summary": "In settings where deep neural networks are used for critical tasks, it is crucial to ensure that they are calibrated and capable of reliable predictions. It is desirable to have the ability to measure the confidence of the model's predictions and reject those that have high uncertainty. To achieve this, the authors suggest using neural networks that have been pre-trained on large and diverse datasets as calibration auxiliaries for downstream tasks. \n\nThrough extensive experimentation on benchmarking datasets such as ImageNet, the authors demonstrate that using pre-trained models such as CLIP to define the relative Mahalanobis Distance in feature space is a valid measure of sample difficulty. Additionally, they introduce a novel regularization term that accounts for the difficulty of individual samples. In section 5, they provide an extensive evaluation of their proposed learning objective in comparison to other standard regularizers. While difficulty-aware regularization can be somewhat costly, it ultimately reduces the expected calibration error.", "questions": "1. The authors explore example difficulty in the context of classification tasks. Can similar measures be extended to dense-prediction tasks?", "limitations": "It's important to mention that measuring the difficulty of samples adds extra computing workload. To provide clarity to readers, the authors are encouraged to discuss this topic and any potential limitations of their proposed work.", "rating": 6, "confidence": 4, "soundness": 3, "presentation": 3, "contribution": 2, "strengths": "Some strengths of the work:\n**Originality**: Researchers are actively studying how to measure the difficulty of individual instances in machine learning to improve its reliability. The authors have introduced and proven the effectiveness of RMD as a reliable method for measuring this difficulty.  \n\n**Clarity**: I found the paper well-written and straightforward to understand. The authors have provided ample empirical evidence to support their idea of sample difficulty, and they have included a comprehensive discussion while comparing it to relevant baselines.\n\n**Quality**: Understanding the limitations of existing algorithms on complex problems requires measuring sample difficulty. This research introduces innovative regularizers that enhance the models' calibration in downstream training.\n\n**Significance**: Alongside establishing robust benchmarks and regularizers for calibrated training, the authors also find that self-supervised learning algorithms (such as MAE) learn richer representations that better estimate hardness. ", "weaknesses": "1. When it comes to measuring sample difficulty, the effectiveness of using large-scale pretrained datasets depends on the degree of domain/distribution shift in the downstream task. For example, it remains uncertain whether the same measures can be applied to medical imaging tasks as compared to natural image classification.", "quality": null, "clarity": null, "significance": null, "originality": null, "strengths_and_weaknesses": "", "was_revised": false, "final_justification": "", "rebuttal": "We thank you for finding our work innovative, well-written and straightforward to understand, and showing convincing validation, as well as providing valuable comments. We answer the specific questions below. We hope you will find our response satisfactory and raise your score accordingly.\n\n**Q1: It remains uncertain whether the same measures can be applied to medical imaging tasks as compared to natural image classification:** We understand the concern may arise from the fact that CLIP may be inadequate for the medical domain, as medical images can be OOD (out-of-distribution) to CLIP. Nevertheless, we would like to note that our procedure of deriving sample difficulty is compatible with other pre-trained models. For instance, we add a new experiment to demonstrate that our method is plug-and-play to switch from CLIP to DINO v2 [*1], delivering comparable gains as on the natural image classification benchmarks (See Table II in the attached rebuttal PDF in our global response). For the medical domain, MedCLIP [*2] can be a more interesting alternative than CLIP/DINO v2 for practicing our method. We will include this discussion in the final version. \n\nReference:\n\n[*1] DINOv2: Learning Robust Visual Features without Supervision, Oquab et al., arXiv:2304.07193\n\n[*2] MedCLIP: Contrastive Learning from Unpaired Medical Images and Text, Wang et al., EMNLP 2022.\n\n\n**Q2: Can sample difficulty measures be extended to dense-prediction tasks?** It is an interesting perspective. The challenge for dense-prediction tasks lies in multiple objects' coexistence in one image. To use our measure, getting the feature per object instance is important. Taking object detection as an example, a natural way to use our method would be to use the ground-truth bounding boxes of the training samples to extract the features per object instance (e.g., using ROI align) before scoring the sample difficulty of the training set. The sample difficulty can then be used for regularizing the classification head, which is also on each object instance level. We will include such discussion in the final version.\n\n**Q3: Mention the computation overhead and discuss potential limitations of their proposed work:** We will add the computation overhead into the implementation details. Briefly, we can calculate per-sample difficulty score once before training to save computing overhead (as stated in line 213), so training and inference overhead is basically the same as other methods. Overall, we find the computation overhead very affordable, not being a limiting factor of our method. As for a general limitation discussion, we have included some in the conclusion in the form of future extensions of our method. Upon revision, we will incorporate the discussion in Q1 as well. \n"}, {"review_id": "b5YV2HwCnZ", "reviewer": "Reviewer_Ye8r", "summary": "This paper proposes a difficulty-aware uncertainty regularization approach, which first pre-defines the difficulty of each training sample and then differently regularizes training samples during training. To quantify the sample difficulty, the authors utilize pre-trained large models like CLIP to extract feature vectors, and the relative Mahalanobis distance is computed on a collection of these feature vectors.", "questions": "1. The overall scheme that a pre-trained model provides supervision for a given data reminds the knowledge distillation. However, the authors stated \"knowledge distillation will not solve the problem\" in lines 29-30. Could you make an additional statement on this?\n2. The reason for the absence of the CRL as a baseline in the main tables, specifically Tables 2 and 3, is unclear or not readily apparent.\n3. Is there a specific justification for not including C10 in the misclassification detection experiment?\n\nMiscellaneous:\n1. Section 5.4. \"roubustness\" should be \"robustness.\"\n2. Table 4. \"under different on ImageNet1k\" should be \"under different $\\alpha$ on ImageNet1k.\"\n3. It would be nice to update the figures in the paper to utilize colors that are accessible for individuals with color blindness. Specifically, figures 4, 7, and 11 might pose challenges for individuals with red-green color blindness.", "limitations": "The authors did not address the limitations.", "rating": 5, "confidence": 3, "soundness": 2, "presentation": 3, "contribution": 2, "strengths": "1. The paper is well-written and exhibits clarity in its presentation. The visual results help to comprehend the concept of sample difficulty.\n2. The effectiveness of considering sample difficulty in classification tasks has been empirically verified against other uncertainty regularization methods. In particular, the ablation study conducted on the regularizing strength hyperparameter $\\alpha$ in Section 5.4 clearly demonstrates that the proposed sample-specific regularization approach outperforms ER, which performs global regularization.", "weaknesses": "1. The current version of the paper solely presents the average value obtained from five trials without including information about the standard deviation. It is highly recommended to include error bars.\n2. The proposed methodology heavily depends on CLIP as a key component. Specifically, when using ViT-B and MAE-ViT-B, the accuracies achieved in Table 5 are 73.59% and 73.81%, respectively, which are lower than the accuracy of 74.02% achieved by the Poly baseline presented in Table 1. At this stage, it is challenging to assert that the proposed method can be applied universally to any large-scale pre-trained models.", "quality": null, "clarity": null, "significance": null, "originality": null, "strengths_and_weaknesses": "", "was_revised": false, "final_justification": "", "rebuttal": "We thank you for finding our work clearly motivated and clarified, as well as providing valuable suggestions to further improve our paper. We address the detailed concerns below, by including the suggested standard deviation, a new experiment to further demonstrate the applicability beyond CLIP, and clarification on various points. We hope that you may find our response satisfactory and raise your score accordingly.\n\n**Q1: No standard deviation (error bars) about experimental results:**  We agree this is important. Our reported numbers are the mean values based on 5 runs for CIFARs and 3 runs for ImageNet1k. We will also add ``std'' in the final version. At this point, we first report std of ACC and ECE for CE, ER and our method in Table Ⅰ of the attached rebuttal PDF in our global response. We can observe that the proposed method is still performing the best within the standard deviation, and our std is generally comparable to other methods.\n\n**Q2: It is challenging to assert that the proposed method can be applied universally to any large-scale pre-trained models:** We disagree with our highest respect. In fact, while VIT-B and MAE-VIT-B in Tab. 5 are not as good as CLIP, they both provide convincing improvements in ECE. Then, among methods in Tab. 1 that achieve similar ECEs as them, they are better in terms of ACC. It is true that they both underperform PolyLoss in ACC. However, PolyLoss severely compromises ECE for the gain, whereas our method combined with different pre-trained models does not suffer from such a tradeoff, and improves both metrics over the baseline \"CE\". Furthermore, we perform a new experiment, using recent DINOv2 [*1] as a pre-trained model to quantify sample difficulty, and report ACC and ECE on CIFAR-10/100 in Table Ⅱ of the attached rebuttal PDF in our global response. While both CLIP and DINOv2 were trained on large-scale datasets, they took different training procedures. As shown, our method based on DINOv2 outperforms all baselines in Tab. 1 (including PolyLoss). The achieved gains are similar to that of using CLIP. Hence, our method itself can work with other pre-trained models. \n\nReference:\n\n[*1] DINOv2: Learning Robust Visual Features without Supervision, Oquab et al., arXiv:2304.07193\n\n**Q3: More elaboration on the statement on \"knowledge distillation will not solve the problem\" in lines 29-30:** Sample difficulty measure can be regarded as a type of data annotation complementary to the ground-truth label. Solely relying on the ground-truth label, the cross entropy loss essentially induces the model to overfit the 0/1 loss, i.e., matching the label with 100% confidence. This is also the case when people use the cross entropy loss to train the teacher model as well as the student model with the feature matching with the trained teacher model. Therefore, this overfitting issue does not simply go away with knowledge distillation. Our method tries to address the issue by adding additional annotation to each sample, and modifying the training loss with instance-adaptive entropy regularization. \n\nFurthermore, we do not intend to make sure the \"student\" (i.e., the actual classifier) mimics the \"teacher\", neither in the feature space nor the logit space. Behaving like the teacher does not necessarily lead to better \"uncertainty\", where knowledge distillation solutions primarily focus on accuracy. It is an interesting venue that requires dedicated investigation, which however is beyond the scope of our work. We will improve our wording upon revision.\n\n**Q4: The reason for the absence of the CRL as a baseline in the main tables, specifically Tables 2 and 3:** We took CLR as an approach that exploits sample difficulty measures for uncertainty in ablation studies, thus we primarily compared them among methods based on sample difficulty, i.e., Sec. 5.5 for comparison of different sample difficulty measures. Of course, we are happy to provide results about misclassification and OOD detection for CRL. As shown in Tab. A and Tab. B below, our method still outperforms CRL regarding misclassification and OOD detection. We will add detailed results in the final version.\n\nTab.A: The comparison of misclassification detection performance (%) for CRL and our method.\n| Dataset    | Method   | FPR-95\\%$\\downarrow$ | AUROC $\\uparrow$     | AUPR $\\uparrow$      |\n|------------|----------|----------------------|----------------------|----------------------|\n|            |          |       | MSP / Entropy  |                      \n| C100  | CRL      | 44.80/46.08   | 86.67/85.98    | 95.55/95.49 |\n|            | Proposed | **42.71/43.22** | **87.50/87.03** | **96.10/96.02** |\n| ImageNet1k | CRL | 46.03/48.01   | 86.11/84.33  | 94.41/93.89  |\n|            | Proposed | **45.69/46.72** | **86.53/85.23** | **94.76/94.31** |\n\nTab.B: The comparison of near OOD detection performance (%) for CRL and our method.\n|$D_{in}$ /$D_{out}$    | Method   | FPR-95\\%$\\downarrow$ | AUROC  $\\uparrow$ | AUPR  $\\uparrow$  |\n|------------|----------|----------------------|----------------------|----------------------|\n|   |    |     | MaxLogit / Entropy   |                      \n| C100/C10   | CRL      | 58.13/58.54   | 79.91/80.13  | 81.75/81.89  |\n|            | Proposed | **55.48/55.60** | **80.20/80.72** | **82.51/82.84** |\n| ImageNet1k /iNaturalist | CRL | 35.07/34.65  | 90.11/90.32  | 97.96/97.81  |\n|            | Proposed | **32.17/34.19** | **91.03/90.65** | **98.03/97.99** |\n\n**Q5: Is there a specific justification for not including C10 in the misclassification detection experiment?** Misclassification detection is more relevant for scenarios with low classification accuracy, whereas the accuracy of C10 has already reached about 95\\%. Therefore, we focused on C100 and ImageNet1k, which are more interesting/challenging benchmarks for misclassification detection.\n\n**Q6: Editing errors and colors in figures 4, 7, and 11:** Thank you for your suggestions, and we will update them in the final version."}, {"review_id": "cOp0sM3wkR", "reviewer": "Reviewer_YeMZ", "summary": "The authors propose to improve model calibration by leveraging information about a sample's difficulty. To do this, they cluster samples using embeddings obtained from large, pre-trained models, and then use a sample's distance to samples from the same class as proxy for difficulty. They show improvements on imagenet in calibration and slight improvements on accuracy.", "questions": "* Why take the maximum over i in Eq. 10? \n\n* Table4: misses a description of what the columns represent. The text says that they are different regularization strenghts, but this should also be made explicit in the table itself.\n\n* Authors state that all results are averages, but never talk about the variances between runs. It would be nice to know if error bars overlap.\n\n* What is the runtime of calculating RMD? It would be nice to know if this method is applicable in practice or is prohibitively expensive.\n\n* How well does the Gaussian assumption fit? An exploration of how well the RMD describes the actual representation space would be interesting.", "limitations": "Authors do not adress limitations of their approach, and I'd encourage them to add a discussion of those!", "rating": 6, "confidence": 4, "soundness": 3, "presentation": 3, "contribution": 3, "strengths": "Originality: The approach is effectively a form of adaptive entropy regularization. The novelty is that the strength of the regularization depends on the \"difficulty\" of the samples. The approach makes sense and is (to the best of my knowlege) novel.\n\nQuality: Theoretical analysis is a bit lacking. Empirical results make sense and show a decent improvement in calibration scores. As such, the method does make sense.\n\nClarity: Some choices the paper makes are unclear to me, both in terms of overall method design (why focus so much on RMD?) and in details (e.g. formulation of Eq. 10). See \"details\" for more. As far as language use goes, the paper is easily understandable.\n\nSignificance: Results show that the idea works. ECE decreases, and the qualitative examples shown in the figures/supplementary make sense to me. ", "weaknesses": "* The main idea of the paper (estimate difficulty of samples on large pre-trained model, weight regularization with that) is a bit obscured by the fact that the authors make a big fuzz about using the \"Relative Mahaloni Distance\" (RMD), even though Table 7 shows that even doing simple K-Means clustering works as well (even better than normal Entropy Regularization, if one compares with Table 4). The paper's main idea would be much more obvious if the paper first established that the idea works even using a simple clustering like K-Means, and then shows that RMD is a sensible improvement upon this.  As such, I don't really understand why RMD was chosen: The paper also never goes into explaining WHY RMD beats K-Means, or why doing Mahaloni Distance (MD) does not work as well. The authors merely say that RMD worked well for near-OOD detection.\n", "quality": null, "clarity": null, "significance": null, "originality": null, "strengths_and_weaknesses": "", "was_revised": false, "final_justification": "", "rebuttal": "We thank you for finding our work novel and clarifying empirical results. We address the detailed concerns below. We hope that you may find our response satisfactory and raise your score accordingly.\n\n**Q1-a: a big fuzz about using the RMD, even though simple K-means clustering already helps** It is true that K-means clustering can already reveal the benefit of using our proposal. As the reviewer already pointed out, our main idea is not limited to one specific sample difficulty measure. The fact that different reasonable measures provided gains is a positive evidence to our idea. Nevertheless, we believe it is still of technical interest to present RMD (see our next answer). We will definitely consider reviewer's suggestion on improving the presentation of sample difficulty measuring method.\n\n**Q1-b: why is RMD a better measure of sample difficulty than K-Means and MD?** These three metrics are all based on the Gaussian assumption in the feature space. The key difference between RMD and K-means/MD lies in the relative distance calculation. Both K-means/MD scores the sample difficulty based on the distance towards the mean mode, whereas RMD examines the relative distances towards two properly chosen mean modes, i.e., class-agnostic and class-specific mean. The relative distance reflects not only if the feature is typical (close to the class-specific mean), but also if it is discriminative (far from the class-agnostic mean). Both K-means and MD mostly concern the first aspect, thus perform worse than RMD, esp. when taking care of fine-grained classification benchmarks such as ImageNet1k. In ImageNet1k, many classes could share some common features, e.g., there are many sub-classes of elephants in ImageNet1k and they all look alike in some aspects. To confidently classify one elephant as Tusker, it must have typical features that are also discriminative enough from the rest of the classes. The metrical difference using RMD can filter out the influence from shared typical features, i.e., features close to the class-agnostic mean mode. We will make it clearer in the next version. We also add an illustrative example in Figure I of the attached rebuttal PDF in our global response, which hopefully visualizes well the above description.\n\n**Q2: Why do you take the maximum over i in Eq. 10?** By taking the maximum over \"i\", we make the score $s(x,y)$ upper-bounded by one. Overall, the score is constrained to the value range between 0 and 1, which is normalized and avoids potential numerical issues.\n\n**Q3: Table 4: misses a description of what the columns represent:** Thanks for pointing this out. Each column is associated with a value for the hyper-parameter $\\alpha$. We will add this information upon revision.\n\n**Q4: Error bars (variance) of experimental results:** Thanks for the suggestion. We will add ``std'' of experimental results upon revision. At this point, we first report std of ACC and ECE for CE, ER and our method in Table Ⅰ of the attached rebuttal PDF in our global response. We can observe that the proposed method is still performing the best within the standard deviation. Our std is generally comparable to other methods.\n\n**Q5: What is the runtime of calculating RMD?** We can calculate RMD of each sample once before training to save computing overhead (as stated in line 213), so training and inference overhead is basically the same as other methods. As for the running time of calculating RMD of all training samples before training, we report results in Table A. It should be noted that we only need to calculate RMD once for a specific downstream task.\n\nTab. A: The running time of calculating RMD of the entire training dataset.\n| Dataset          | CIFAR-10/100 | ImageNet-1k |\n|------------------|--------------|-------------|\n| Running time (s) | 94s          | 2068s       |\n\n**Q6: How well does the Gaussian assumption fit?** We chose the Gaussian assumption based on the following considerations. First, it leads to a simple distance measure for quantifying the sample difficulty, i.e., examining mean and variance. Second, it has several empirical supports from other tasks. For instance, to assess the image synthesis quality, the standard metric: FID essentially measures the difference between the real and synthetic data distributions based on multivariate Gaussian modeling in the feature space of Inception v3 or CLIP. Another example is the use of Gaussian assumption for deriving the OOD detection metric, e.g., in [*1]. \n\nWe would further note that our method is not limited by Gaussian assumption. We contributed the idea of modeling the feature distribution for sample difficulty quantification. Gaussian assumption is an example, which led to convincing gains. Nevertheless, one may resort to more sophisticated modellings for further improvements. \n\nReference:\n\n[*1] Contrastive Training for Improved Out-of-Distribution Detection, Jim et al., arXiv:2007.05566"}, {"review_id": "lZKRAC1cA1", "reviewer": "Reviewer_Lxfs", "summary": "To address the over-confidence problem of the uncertainty estimation in deep learning, this paper for the first time proposes to use the pre-trained large models to estimate the learning difficulty of each sample. Then, the estimated sample difficulty information is embedded in the final loss for training deep models. The authors evaluate the proposed framework on different datasets and with different model architectures, showing that it improves uncertainty calibration on both ID and OOD settings.", "questions": "1. If no theoretic support could be added, could you explain more about why RMD is better than MD.\n\n2. Maybe experiments of hyperparameter study can be added for the second weakness.\n", "limitations": "N/A.", "rating": 6, "confidence": 4, "soundness": 3, "presentation": 4, "contribution": 3, "strengths": "1. The studied problem namely uncertainty calibration is important in modern deep learning. The presentation of this paper is good and the paper is easy to follow.\n\n2. Different from some previous works that use pre-trained large models as the base models to fine-tune, this paper proposes to use large models as the tools to estimate sample difficulty, which makes the training process flexible since any model architecture can be used in the training.\n\n3. I like the idea of using sample difficulty as a metric to guide the modeling of uncertainty. And based on the authors' observation, large models (especially the models learned with cross-modality) seems give more accurate estimation of sample difficulty.", "weaknesses": "1. The proposed distance metric RMD in Eq. (5) is shown useful than MD in Fig. 6, but backs of the theoretic supports.  \n\n2. Two new hyperparameters ($\\alpha$ and T) are induced in the final loss function (9), used as the weighting factors of the entropy penalty term, which act like the factor used in label smoothing and may reduce the robustness of the proposed method.  \n\n3. I wonder if the large model necessary for the estimation of sample difficulty? There must be some other metrics for sample difficulty, so if other metrics also yield good performance with the regularization-based loss function (9). Maybe some ablation studies can be conducted for this point.\n", "quality": null, "clarity": null, "significance": null, "originality": null, "strengths_and_weaknesses": "", "was_revised": false, "final_justification": "", "rebuttal": "Thank you for appreciating our essential problems and new contributions and providing valuable comments. We address the detailed concerns below. We hope that you may find our response satisfactory and raise your score accordingly.\n\n**Q1: why RMD is better than MD?** The key difference between RMD and MD lies in the relative distance calculation. MD scores the sample difficulty based on the distance towards the class-specific mean mode, whereas RMD examines the relative distances towards two properly chosen mean modes, i.e., class-agnostic and class-specific mean. The relative distance reflects not only if the feature is typical (close to the class-specific mean), but also if it is discriminative (far from the class-agnostic mean). MD mostly concerns the first aspect, thus performs worse than RMD, esp. when taking care of fine-grained classification benchmarks such as ImageNet1k. In ImageNet1k, many classes could share some common features, e.g., there are many sub-classes of elephants in ImageNet1k and they all look alike in some aspects. To confidently classify one elephant as Tusker, it must have typical features that are also discriminative enough from the rest of the classes. The metrical difference using RMD can filter out the influence from shared typical features, i.e., features close to the class-agnostic mean mode. We will make it clearer in the next version. We also add an illustrative example in Figure I of the attached rebuttal PDF in our global response, which hopefully visualizes well the above description.\n\n**Q2: Robustness of hyperparameter $\\alpha$ and $T$, ablation results:** In our experiments, we did not experience hard tuning scenarios. Being part of our ablation study on ImageNet1k classification, we selected the weighting coefficient $\\alpha$ from { 0.05, 0.10, 0.15, 0.20, 0.25, 0.30 }. As shown in Table 4, the proposed method is less sensitive to the choice of $\\alpha$ than the baseline ER, owing to our sample adaptive weighting. As for the temperature $T$, it is set to 0.7 for all datasets. Hence, the proposed method does not rely on time-consuming hyper-parameters tuning.\n\n**Q3: Is the large model necessary to estimate sample difficulty? Ablation studies about different metrics for sample difficulty:** To verify the benefit of using large models, we compared them with smaller ResNet34/50/101 models that were trained on the task dataset in Table 10 in Appendix. We find large models beneficial to estimate the sample difficulty. As they were trained on large-scale datasets with high sample diversities in many dimensions, they can learn to preserve and structure richer semantic features of the training samples than models only exposed to the training set that is commonly used at a smaller scale. Hence, large pre-trained models have a representative feature space, which can be used to quantify more accurate sample difficulty scores. Besides CLIP, we additionally use DINOv2 [*1] during the rebuttal, which is also a large-scale pre-trained model. The ACC and ECE gains are comparable with CLIP, significantly outperforming the baselines.\n\nMoreover, we have compared different metrics (K-means and MD) for sample difficulty in Table 7, which confirms the superiority of RMD in measuring the sample difficulty. We also compared our method and CRL (a baseline that uses the frequency of correct predictions during training epochs as a sample difficulty metric) in Table 6, and we can see that large pre-trained models still perform better.\n\nReference:\n\n[*1] DINOv2: Learning Robust Visual Features without Supervision, Oquab et al., arXiv:2304.07193 "}, {"review_id": "bFQiMiCHLi", "reviewer": "Reviewer_93FC", "summary": "It is known that state-of-art deep-network based machine learning models are poorly calibrated. It is also somewhat widely known that the poor calibration is because we do not model data uncertainty while training.\nThis work proposes to use CLIP pretrained model for estimating the sample difficulty, which when further used for modeling data uncertainty is shown to yield better calibrated models.\n\nRelative Maholonibis distance and leveraging a multimodal pretrained model such as CLIP for estimating the sample difficulty is the core contribution of this work.", "questions": "- Is the base model used for training on downstream models (which is mentioned as ResNet34) is pretrained?\n- What happens when CLIP itself is used as the base model?\n- Can some justification be provided on why we see better corruption robustness in ECE in Fig. 3? \n\nI would also appreciate if the authors can respond, if they can, to the weaknesses. \n\n*Minor comments*.  \n- L171-182. I found the writing somewhat superfluous since we only care to see that the error rate dips as we move towards right in Fig 2. Perhaps there is no need to comment about why ViT is the best etc. Also, there seems to be some confusion between the text and Fig.2. Text interprets the y axis as accuracy while it is error rate in the figure.\n- L310: last sentence seems incomplete.\n", "limitations": "Yes.\n\nEdit after rebuttal: Please see my comment in the thread below. ", "rating": 7, "confidence": 4, "soundness": 3, "presentation": 3, "contribution": 3, "strengths": "- Convincing experimental study. All the components of their proposed method: CLIP, RMD, alpha (hyperparameter) are well argued.\n- Strong evaluation. The proposed method is evaluated with positive results on various downstream applications: outlier detection, selective classification, ECE on OOD.\n- Writing is easy to follow. ", "weaknesses": "*Limited originality*: I enjoyed reading the paper but it cuts very close to the existing work.\nAs mentioned in the paper, several previous methods attempted example weighting during training [39] based on their difficulty, and RMD is proposed and used earlier for outlier detection [45] (citation numbers from their paper).\nAs I see it, the originality of the paper lies in using RMD and pretrained models for sample weighting. Although the paper is technically strong, I am somewhat unimpressed by its originality.\n\n*Universality of CLIP*. The proposed measure of sample difficulty is in essence how well CLIP can identify different classes.\nAlthough CLIP may have been trained on large and diverse data, it surely has its limits.\nWe may then also need an additional measure that informs how difficult it is for the CLIP to provide a sample diffcilty for an example.\nFor instance, the proposed measure most likely cannot be useful on a chest xray dataset for a downstream task of classifying pneumonia or normal.\nComments on how such scenarios can be addressed are missing from the paper. ", "quality": null, "clarity": null, "significance": null, "originality": null, "strengths_and_weaknesses": "", "was_revised": false, "final_justification": "", "rebuttal": "Thank you for appreciating our convincing experimental study and strong evaluation. We address the detailed concerns below. We hope that you may find our response satisfactory and raise your score accordingly.\n\n**Q1: Limited originality, such as example weighting and RMD:** We understand your viewpoint. Although our method builds upon the established concepts of ER and RMD, it makes a simple modification that greatly improves upon classical regularization techniques. Furthermore, our work is the first to leverage pre-trained models for sample difficulty annotation and demonstrate an effective way to use sample difficulty for reliable prediction (i.e., simultaneously improving accuracy and uncertainty calibration). We believe the simplicity of the proposed approach will make it more likely that this work is adopted or studied in the community.\n\n**Q2: Limits of CLIP itself, e.g., cannot be useful on a chest xray dataset, and the need of a usability indicator:** Yes, CLIP has its own limits. It is likely that CLIP is not straightforwardly suitable for medical domain data. Nevertheless, our method itself can work with different pre-trained models. For instance, if targeting chest xray, our method can be practiced as computing RMD in the feature space of MedCLIP [*1] for measuring the sample difficulty. In this work, CLIP is the chosen pre-trained model, as it is well-suited for handling natural images, which are the basis of the targeted benchmarks. We perform a new experiment during the rebuttal, using recent DINOv2 [*2] as a pre-trained model to quantify sample difficulty, and report ACC and ECE on CIFAR-10/100 in Table Ⅱ of the attached rebuttal PDF in our global response. As shown, our method based on DINOv2 also shows superior performance similar to CLIP and significantly outperforms the baselines, confirming the compatibility of our method with different pre-trained models.\n\nMoreover, a simple way to assess the effectiveness of a pre-trained model within a specific domain can be achieved by examining the zero-shot classification performance. For instance, if CLIP cannot deliver strong zero-shot generalization on a chest xray classification, then we should choose a different pre-trained model or adapt CLIP for that domain first. \n\nThank you for your suggestion. We will include the above discussion upon revision.\n\nReference:\n\n[*1] MedCLIP: Contrastive Learning from Unpaired Medical Images and Text, Wang et al., EMNLP 2022\n\n[*2] DINOv2: Learning Robust Visual Features without Supervision, Oquab et al., arXiv:2304.07193\n\n**Q3: Is the base model used for training on downstream models (which is mentioned as ResNet34) is pre-trained?** We understand here your 'base model' refers to the model that is used for training the classifier, e.g., ResNet34. If this understanding is correct, then the base model is randomly initialized and trained from scratch on downstream tasks. For the models that are used for sample difficulty measurement, they are pre-trained with the datasets documented in Table 8 in Appendix.\n\n**Q4: What happens when CLIP itself is used as the base model?** Using CLIP as the base model, fine-tuning it on the downstream dataset is necessary to boost the accuracy. However, fine-tuning has the forgetting issue, as the downstream dataset is usually smaller than the pre-training dataset. Furthermore, relying on the single ground-truth label, fine-tuning would still lead to over-confident predictions. Therefore, there is no obvious evidence that it has the potential to outperform our method. Plus, our method is applicable to any base model architecture, whereas fine-tuning CLIP is limited to a small set of architectures.\n\nBesides, we also report ACC and ECE of CLIP-RN50 fine-tuned with a linear classifier (i.e., only fine-tuning the last linear layer to alleviate the forgetting/overfitting issue and save computational cost) on CIFAR10/100 in Table A. It is prominent that fine-tuned CLIP achieves comparable accuracy but exhibits poor calibration performance (i.e., higher ECE) .\n\nTab.A: The comparison of fine-tuned CLIP and our method on CIFAR-10/100.\n| Method |     | CIFAR-10 | CIFAR-100 |\n|-------------------|-----|----------|-----------|\n| Fine-tuned CLIP   | ACC | 94.32    | 77.16     |\n|                   | ECE | 3.812    | 6.358     |\n| Ours              | ACC | **95.67**    | **78.58**     |\n|                   | ECE | **1.212**    | **3.410**     |\n\n**Q5: Can some justification be provided on why we see better corruption robustness in ECE in Fig. 3?** Our method can alleviate overconfidence and improve uncertainty calibration (lower ECE) owing to the proposed sample adaptive weighting. Therefore, the proposed method has the ability to make conservative predictions (low ECE) for OOD inputs (i.e., images under different levels of corruption). It has also been observed in the literature, e.g., [*2], that models with good uncertainty estimation quality are also more robust under data shifts, e.g., image corruptions. \n\nReference:\n\n[*3] Can You Trust Your Model's Uncertainty? Evaluating Predictive Uncertainty Under Dataset Shift, Yaniv et al., NeurIPS 2019\n\n**Q6: Editing or writing errors:** Thank you for pointing out the editing error, and we will correct it upon revision.\n"}]

Author rebuttal:
Firstly, we would like to express our gratitude for the thoughtful reviews, which help to further improve our paper. We are pleased that the reviewers found our paper to be **novel (innovative)** (Reviewers FmxN, YeMZ, Lxfs), **well-written and convincing** (All), **straightforward to understand** (Reviewer FmxN), the studied problem is **important** and the training process is **flexible** (Reviewer Lxfs), and our experiments to be **strong and convincing** (Reviewer 93FC). 

Secondly, for some common concerns, 1) **no standard deviation (error bars) about experimental results**, we provide Table Ⅰ in the uploaded rebuttal PDF, which shows the std is on a par with other methods; 2) **Why is RMD a better measure of sample difficulty than K-Means and MD**, we provide detailed explanations to reviewers individually. In addition, we also add an illustrative example in Figure A of the uploaded rebuttal PDF, which hopefully visualizes well the benefit of using relative distance; 3) **Whether our method can be applied to other large-scale pre-training models**, we perform a new experiment, using recent DINOv2 as a pre-trained model to quantify sample difficulty, and report ACC and ECE on CIFAR-10/100 in Table Ⅱ of the uploaded rebuttal PDF. While both CLIP and DINOv2 were trained on large-scale datasets, They took different training procedures. As shown, our method based on DINOv2 also improves over the baselines in both ACC and ECE, delivering superior performance similar to CLIP. Hence, our method itself is not CLIP-specific, and can work with other pre-trained models.

We hope this message provides a good summary of the reviews and our responses. We further address the comments of each reviewer individually.


Meta-review: After extensive discussion with the authors, the reviewers all agree that this is a solid contribution that should be accepted. I look forward to seeing the final version with the reviewers' suggestions incorporated.
Decision: Accept (poster)