Selective Classification Under Distribution Shifts
Authors: Hengyue Liang
Le Peng
Ju Sun
Venue: Accepted by TMLR ()

Abstract: In selective classification (SC), a classifier abstains from making predictions that are likely to be wrong to avoid excessive errors. To deploy imperfect classifiers---imperfect either due to intrinsic statistical noise of data or for robustness issue of the classifier or beyond---in high-stakes scenarios, SC appears to be an attractive and necessary path to follow. Despite decades of research in SC, most previous SC methods still focus on the ideal statistical setting only, i.e., the data distribution at deployment is the same as that of training, although practical data can come from the wild. To bridge this gap, in this paper, we propose an SC framework that takes into account distribution shifts, termed generalized selective classification, that covers label-shifted (or out-of-distribution) and covariate-shifted samples, in addition to typical in-distribution samples, the first of its kind in the SC literature. We focus on non-training-based confidence-score functions for generalized SC on deep learning (DL) classifiers and propose two novel margin-based score functions. Through extensive analysis and experiments, we show that our proposed score functions are more effective and reliable than the existing ones for generalized SC on a variety of classification tasks and DL classifiers.

Published in Transactions on Machine Learning Research (10/2024)
Selective Classification Under Distribution Shifts
Hongyue Liang
kang656 Swrmnnnm6wwmmmcooo edu
Deportment of Electrical and Computer Engineering University of Minnesota
Le Peng
peng0947@umn edu
Department of Computer Science and Engineering University of Minnesola
Ju Sun
jusun Grmmn edu
Department of Computer Science and Engineering
University of Minnesola
Reviewed OpenReview:
https:
httpe://openrevieu openreview........ net/ formm???? id= dmzMGW6.J77
Abstract
In selective classification (SC), classifier abstains from making prodictions that are likely to be wrong to avoid excessive errors. To deploy imperfect classifiers either due to intrinsic statistical noise of data for robustness issue of the classifier beyond-in high-stakes scenarios, SC appears to be an attractive and necessary path to follow. Despite decades of research in SC, most previons SC methods still focus on the ideal statistical setting only, i.e., the data distribution at deployment. is the same as that of training, although practical data can come from the wild. To bridge this gap, in this paper, we propose an SC framework that lakes inlo account distribution shifts, termed generulized selective classification, that covers label-shifted (or out-of-distribution distribution samples, the first of its kind in the SC literature. We focus non-training- based confidence-score functions for generalized SC on deep learning (DL) classifiers, and propose two novel margin-based score functions. Through extensive analysis and experiments, we show that our proposed score functions are more effective and reliable than the existing oncs for generalized SC on a variety of classification tasks and DL classifiers. The code is available at hattps://gitee com/ suun-uuuuunsceee with distshift,
and covariate-shifted samples, in addition to typical in-
1 Introduction
In practice, classifiers almost never have perfect accuracy. Although modern classifiers powered by deep neural networks (DNNs) typically achieve higher accuracy than the classical ones, they known to be unrobust: perturbations of inputs that are inconsoquential to human decision making can easily alter DNN classifiers' predictions (Carlini et al. 2019 Croce et al.) 2020 Hendrycks & Dietterich [0188] Liang et al. 2023), and more generally, shifts in data distribution in deployment from that in training often cause sys- tematic classification errors. These classification errors, regardless of their source, are rarely acceptable for high-stakes applications, such as discase diagnosis hcalthcare.
To achieve minimal and controllable levels of classification error that imperfect and unrobust classifiers be deployed for high-stakes applications, promising approach is selective classification (SC): samples that are likely to be misclassified are selected, excluded from prediction, and deferred to human decision makers, so that the classification performance on the remaining samples reaches the desired level (Chow 1970 Franc et al. 2023a Geifman & El- Yaniv 2017). For example, by flagging and passing uncertain patient cases that tends to mistake on to human doctors, an intelligent medical agent can make confident and correct diagnoses for the rest. This "conservative" classification framework not only saves doctors' efforts, but also avoids liability due to the agent's 's mistakes.

---

Published in Transactions on Machine Learning Research (10/2024)
Consider multiclass classification problem with imput space X' E R", label space y = fl....,K), K}, and training distribution Dx.y on &' x y. For any classifier ʃ X' + y there are many potential causes of classification errors. In this paper, we focus on three types of errors that are commonly encountered in practice and are studied extensively, but mostly separately, in the literature.
Type errors:
errors made on in-distribution (In-D) samples, i.e., those samples drawn from Dx.y- These are classification errors discussed in typical statistical learning frameworks (Mohri et al. 2018);
Type B errors: errors made on label-shifted samples, i.., those samples with groundtruth labels not from
y. Since f assigns labels from y only, it always errs these samples;
Type C errors: errors made on covariate-shifted samples, i.c., samples drawn from a different input distribution D'x where D'x # Dx but with groundtruth labels from V
It is clear that in practical deployment of classifiers, samples can come from the wild, and hence Type A, Type B and Type errors can cocxist. In order to ensure the reliable deployment of classifiers in high-stakes applications, we must control the three types of errors, jointly. Unfortunately, previous research falls short of unified treatment of these errors. Classical SC (Chow) 1970) focuses on rejecting samples that cause In-D
errors (Type A), whereas the current out-of-distributua
(OOD) detection research (Yang et al. 2021 Park
ct al. 2023 focuses on detecting label-shifted samples (Type B). Although Hendrycks & Gimpel (2016);
Granese et al. b: Xia & Bouganis] (2022); Kim et al. (2023) have advocated the simultaneous detection of samples that cause Type A and Type B errors, their approaches still treat the problem as consisting of two separate tasks, reflected in their sepurate and independent performance evaluation on OOD detection and SC. Regarding the challenge posed by Type errors, existing work (Hendrycks & Dietterich 2018 Croce et al. 2020) focuses primarily on obtaining classifiers that are more robust covariate shifts, not on rejecting potentially misclassified samples due to covariate shifts the latter, to the best of our knowledge, has not yet been explicitly considered, not to mention joint rejection together with Type A and Type B errors.
In this paper, our goal is to close the gap and consider, for the first time, rejecting all three types of errors in a unified framework. For brevity, we use the umbrella term distribution shifts to cover both label shifts and covariate shifts, which are perhaps the most commonly seen types of distribution shifts, with the caveat that practical distribution shifts can also be induced by other sources. So, we call the unified framework considered in this paper selective classification under distribution shiftss, generalized selective classification. Another key desideratum is practicality. With the increasing popularily of foundation models and associated downstream few-shot learners (Brown et al.) 2020 Radford et al. 2021 Yuan et al. 2021), accessing massive original training data becomes increasingly more difficult. Moreover, there are numerous high-stakes domains where training data are typically protected due to privacy concerns, such as healthcare and finance. These applied scenarios call for SC strategies that can work with given pretrained classifiers and do not require access to the training data, which will be our focus in this paper. Our contributions include:
We advocate new SC framework, generalized selective classification, which rejects samples that could cause Type A, Type B and Type C errors jointly, to improve classification performance over the non- rejected samples. With careful review and reasoning, we argue that generalized SC covers and unifics the scope of the existing OOD detection and SC, if the gool is lo achieve reliable classification on the selected samples. (Sections 2.3 and 2.4)
Focused on non- non-training- trrininng-bsod (or post-hoc) SC scttings, we identify a critical scalo-scnsitivity issuc of several SC confidence scores based on softmax responses (Section 3.1) which are popularly used and reported to be the state-of-the--rt. (SOTA) methods in the existing SC literature (Geifman & Eanianiy 2017 Feng et al. 2023).
We propose two confidence scores based on the raw logits (v.s. the normalized logits, i.c., softmax re- sponses), inspired by the notion of margins (Section 3.2h. Through careful analysis (Section 3.3) and extensive experiments (Section 4), we show that our margin- based confidence scores are more reliable for generalized SC on various datasee--lassifier combinations, even under moderate distribution shifts.
2

---

Published in Transactions on Machine Learning Research (10/2024)
2
Technical background and related work
2.1 Selective classification (SC)
Consider a multiclass classification problem with imput space X' E R", label space y {,...., K}. and data distribution Dx,y on X' x y) A selective classifier (f.g) consists of predictor f X - RRK and selector X' + {0,1) } and works as follows:
f(x)
if gf = 1
(f)))
(1)
abstain
if g())
for any input X. Typical selectors g take the form:
9s,7 (xr) = 1 (s(xr) >>>> 7],
(2)
where s(x) is confidence-score function, and is tunable threshold for selection.
2.2 Prior work in SC
For given selective classifier (f, (..9,)); its SC performance is often characterized by two quantities:
(coverage) Φan7 ED [nnn (x)); (selection risk) Ra,y = Edx (fff(())))),,.. (x))))))))))))))))))))))) (x))/
(higher the better), (lower the better),
Because a high coverage typically comes with a high selection risk, there is always need for risk-coverage tradeoff in SC. Most of the existing work considers é to be the standard 0/1 classification loss (Chow 1970
El- Yaniv et al. 2010; Geilman et al., (018), and we also follow this convention in this paper. A classical cost-based formulation is optimize the risk-coverage (RC) tradeoff (Chow 1970
minf.a.. EDx, [[(((]]((())))) y)g.,, E.D,, v 9s,7 min Re,
where E [0, 1] the cost making rejection. The optimal selective classifier for this formulation is (Coo 1970 Franc al. 2023a]:
arg min Ene p(ylz) v). and g" = ='=1[-minn [1-minn Pley > -e).
(5)
where f is the Bayes optimal classifier and depends on the posterior probabilities p(y|æ) for all y E y, which are hard to obtain in practice. Moreover, solutions to two constrained formulations for the RC tradeoff,
min RA,7: s. 6,,7 and max P8,7s s.t. Re, SA
(6)
also depend on the posterior probabilities Piietraszek 2005 Geifman Fl Yaniv 2017 Franc et al. 2023a
El- El-Yaniv al. 2010).
bradd scores Due the intractability of true posterior probabilities practice, many previous methods focus on learning effective confidence-score functions from training data. They require access training data and learn parametric score functions, often under cost-based/constte /cossrriine formulations and their variants for the RC tradeoff. This learning problem be formulated together with (Chow 1970
Pictraszek 2005
Grandvalet et al.
2008
El-Yaniv ct al.) 2010
Cortes et al. 2016 Geifman & El- Yaniv
2019 Liu el al. 2019 Huang el al.
2022 Gal & Ghahramani 2016
Lakshmnnaaaaaaaa et al.
2017 Geilman
et al. 2018 Maddox et al.] 2019 Dusenberry et al. 2020 Lei
2014
Villmann et al. 2016
Corbiere et al.
2019 or separately from training the classifier (Jiang al.
2018
Fisch
al. 2022 Franc al. 2023a
However, Feng et al. (2023) has recently shown that these training based scores do outperform simple non-training-basse scores described below.
3

---

Published in Transactions on Machine Learning Research (10/2024)
Algorithm Non-training- based selective classification
Require: A pretrained classifier f; a score function small calibration dataset Z miid Dx.
1: V(r, E Zoali compute s(x;) and {(f(z,),)) 1/)
2: Determine threshold 7 according to the coverage or selection-risk target
3: Deploy the selector 96.7 based on Eq. (2)
Manually designed (non-training-basel) scores This family works with any given classifier and does not assume access to the training set. This is particularly attractive when it comes to modern pretrained large DNN models, e.g., CLIP (Radford et al. 2021). Florence (Yuan et al. 2021), and GPTs (Brown et al. 2020j, for which obtaining the original training data and performing retraining are prohibitively expensive, if not impossible, to typical users. [Algorithm shows a typical use case of SC with non-training- scores. Different confidence scores have been proposed in the literature. For example, for support vector machines (SVMs), confidence margin (the difference of the top two logits) has been used confidence score (Fumera & Roli, 2002 Franc et al.) 2023a); see also Section 3.2 For DNN models, which is our focus, confidence scores are popularly defined over the softmar responses (SRs). Assume that E RRK contains the raw logits (RLs) and a is the softmax activation. The following three confidence-score functions
S A maxo(2;), SRdoctor a 1- 1-11||((=)]
(2) _
Σ, o(2) log (2)),
(7)
are popularly used in recent work, e.g., Feng et al. Although simple, SR can easily beat existing training based methods (Feng et al. 2023). On the other hand, these SR-based score functions generally follow the plug-in in principle by assuming that SRs approximate posterior probabilitics well (Franc et al.) 2023ap. Unfortunately, this assumption often does not hold in practice, and bridging this approximation gap is a major challenge for confidence calibration (Guo el al. 2017 Nixon al.) 2019). However, Zhu al. (2022) reveals that recent calibration methods may even degrade SC performance.
2023 Granese et al. (202] |
Xia & Bouganis 2022
2.3 SC under distribution shifts: generalized SC
In this paper, we consider SC under distribution shifts, or generalized selective classification. Shifts between training and deployment distributions are common practice and can often cause performance drops deployment (Quinonero-Candel) et al.] [2008] Rabanser et al.) 2019 Koh et al.) (021),, raising reliability concerns for high-stakes applications in the real world. In this paper, use the term distribution shifts to cover both covariate and label shifts-periieee beginning of [Section 1 for their definitions)-jon jointly. Although the basic set-up for our generalized SC framework remains the same as that Eqs. (1) and (2) we need to modify the definitions for selection risk and coverage in Eq. (3) to take into account potential distribution shifts:
the most prevalent forms of distribution shifts (see the
(coverage) Dary = Ep, y (9o, and (selection risk) Re, = ED, [((f(()) (x)l//
(8)
where y is the original data distribution, D'y,y is the shifted distribution y" may not be the same as y due to potential label shifts
Out-of- distribution (OOD) detection as weak form of generalized SC The goal of OOD detection
is to detect and exclude OOD samples Yangg et al. 2021 An ideal OOD detector G(æ)) should perfectly separate In-D and OOD samples:
G(x) = 0 (i.e., excluded) (i.e., kept)
x DOOD if x Dx
which is often realized as G(æ) = 1 ((00D(()) > 7]. (9)
We assume outliers generalized SC samples that do not follow any specific statistical patterns during deployment, Le., they are already detected and removed after separate data preprocessing steps. This allows properly define the coverage and selection risk.
4

---

Published in Transactions on Machine Learning Research (10/2024)
Algorithm 2 Typical OOD detection pipeline (c.g.. Sun et al. (2021))
Require: An OOD score function SOOD; an In-D calibration dataset X add Dx and an OOD calibration
dataset Xood wid DDOD
1: Va, E x and Vx, E =xood, compute (2;) and $0oD(æ;).
2: Compute a threshold FOOD using Eq. (9) by problem-specific target requirements, c.g., a target TPR
(true positive rale) value.
Deploy the OOD detector according to Eq. 9
Here, s-OD(-) is a confidence-score function indicating the likelihood that the input is In-D sample, and y is again tunable cutoff threshold. Although by the literal meaning of OOD both covariate and label shifts are covered by DDOD, the literature on OOD detection focuses mainly on detecting label-shifled samples.
2021 Wang et al. 2022 Sun ctt al. 2022). OOD detection is commonly motivated as an approach to achieving reliable predictions: under the assumption that DOOD induced by label shifts only, any OOD samples will cause misclassification and hence should be exchuded-clearp aligned with the goal of SC. Algorithm shows the typical use case of OOD (label-shift) detectors, and its similarity to SC shown in Algorithm 1 is self-evident. However, OOD detection clearly aims for less than generalized SC in that: (1) even if the OOD detection is perfect, misclassified samples-eite either as In-D or due to distribution shifts by imperfect classifiers are not rejected, and (2) practical OOD detectors may fail to perfectly separate In-D and OOD samples, OOD detected but correctly classified In-D samples are still rejected, hurting the classification performance on the selected samples; see [Appendix C for an illustrative example. Therefore, we are to achieve reliable predictions by excluding samples that are likely to cause errors, we should diroctly follow the generalized SC instead of the OOD detection formulation.
i.e., covariate-shifted DOOD induced by label shifts (Liu et al. 2020 Sun et al.
Other related concepts Besides OOD detection, OOD generalization focuses correctly classifying In-D and covariale-shifled samples, with- out considering prediction confidence and selection to improve prediction reliability; open-set recognition (OSR) focuses on correctly classifying In- D samples, as well as flagging label-shifted samples; see Geng et al. (2020)
1.0
RC Curve
α
Selective Risk
for a comprehensive review. In contrast, generalized SC covers all In-D, label-shifed,, and covariate-shifted samples, the widest coverage compared to these related concepts, and targets the most practical and pragmatic metric-classifiattinn classification performance on the selected samples.
0.5
Prior work on SC with distribution shifts Although the existing literature on SC is rich (Zhang et al., 2023), research work that considers SC with potential distribution shifts is very recent and focuses only on label shifts: Xia& & Bouganis (2022): Kim et al. (223)) perform In-D SC and OOD (label detection together with a confidence score that combines SC score and an OOD score, but they still evaluate the performance of In-D SC and OOD detection separately. Müller et al. (2023 Cattelan & Silva] empirically show that existing OOD scores are not good enough
Coverage
Figure 1: Visualization of the normalized AURC-a the area in blue divided by the coverage value a.
for SC tasks with the help of additional datasets to optimize performance. Franc et al. (2024) provides thcorotical insights on SC with In-D and label-shifted samples. In contrast, we focus on identifying better confidence scores for generalized SC that covers both Tn-D and covariate/label-shifte samples and maximizes the utility of the classifier, and unify the evaluation protocol (see Section 2.4)
seiiiattellab--ssiffee samples; Cattelan & Silva proposes ways to refine these scores with
2.4 Evaluation of generalized SC
Since the goal of generalized SC is to identify and exclude misclassified samples, for performance evaluation at a fixed cutoff threshold 7, it is natural to report the coverage the portion of samples accepted, and the corresponding selection "akc""ccrracy" (taken broadly) accepted samples. It. is clear from Eqs.
5

---

Published in Transactions on Machine Learning Research (10/2024)
and (2) that for a given pair of classifier f and confidence-score function s, the threshold y can be adjusted to achieve different. risk-coverage (RC) tradeoffs. By continuously varying 7 we can plot a risk-coverage (RC) curve EI- Yaniv et al. (2010); Franc et al. (2023a) to profile the SC performance of (f,s) throughout the entire coverage range 0, E [0, 1|: see Fig. 1 for an example. Generally, the lower the RC curve, the better the SC performance. To oblain a summarizing metric, it is natural to use the area under the RC curve (AURC) (El-Yaniv et al., 2010 Franc et al.] 2023a). We note that the RC curve and the AURC are also the most widely used evaluation metries for classical SC which is not surprising, as the goal of classical SC aligns with that of generalized SC, although generalized SC also allows distribution shifts.
For typical high-stakes applications, such medical diagnosis, low selection risks are often prioritized over high coverage levels. So, in addition to RC curves and AURC, we also report several partial AURCs to account for potential different needs nords-norrmlized AURC-a, where a specifies the coverage level, and we normalize the partial area-under-the-curee by the corresponding a so that different partial levels can be cross-compared; see Fig. 1 for illustration.
Note that RC curves, and hence the associated AURCs and normalized AURC-& also, depend the (f, s) pair. So, if the purpose is to compure different confidence-scon functions, f should be fixed. Feng et al. (2023) has recently pointed out the abuse of this crucial point in recent training- based SC methods. Thus, it is worth stressing that we always lake and fir pretrained f 's when making the comparison between different. score functions.
2.5
Few words on implementing Algorithm 1
in practice
In the practical implementation of generalized SC for high-stakes applications after Algorithm 1, it is nec- essary to select a cutoff threshold y based on a calibration set to meet the larget coverage, or more likely the target risk level. However, in this paper, we follow most existing work on SC and do not touch on issues such as how the calibration set should be constructed and how the threshold should be selectod- leave these for future work. Our evaluation here, again, as most existing SC work, is only about the potential of specific confidence-score functions for generalized SC, measured by the RC curve, AUPC, and normalized AURC-a's, directly on test sets that consist of In-D, OOD, and sovariate-shifted samples.
3 Our method-margin as confidence scores for generalized SC
Our goal is to design effective confidenco-score functions for generalized SC. Again, our focus is non- training- based scores that can work on any pretrained classifier ʃ without access to the training data.
3.1 Scale sensitivity of SR-based scores
As discussed in iSnction 2.2 most manually designed confidence scores focus DNN models and are based on softmax responses (SRs), assuming that SRs closely approximate true posterior probabilities -acaaiiiiiis-looiing such approximation gaps is the goal of confidence calibration. However, effective confidence calibration remains elusive (Guo et al. 2017: Nixon et al., 2019), and the performance of SR- based score functions is sensitive to the scale of raw logits and hence that of SRs, as explained below.
A quick numerical experiment Consider a 4-component of distribution with means w: = =[v2/2, 2 u2 = 1222/2, v wn = - w4 = 212/// equal variance 0.15 x I, and equal weight 1/4. If we treat each component of the mixture as a class and consider the resulting 4-class classification problem, it is easy to see that the optimal 4-class linear classifier is f(x) [w1, W2, W3, W2, with the decision rule arg m w. see Fig. 2 (a) for visualization of the data distribution and decision boundarics (i.c., the lines I1 = 0 and optimal classifier as well as the maximun a posterior (MAP) classifier, for our particular problem here. Now, given any input x, we consider scaled raw logits (x() for different scale factors À = 0.1, 1,2, 4 and plot the resulting RC curves for SRmax, S SRooocor and SR respectively; see Fig. (db)- For reference, we also inchude the RC curves based on the true posterior probabilities (denoted as Spoet), which are available for our simple data model here. We observe that, for SR-based functions (SRaax, SReacctor and S Rent):
O). Morcover, this f(x) is also a Bayes
6

---

Published in Transactions on Machine Learning Research (10/2024)
0.1
4.0
2
1.0
RLozet-Xt
1.0
Rlzoor -
1.0
2.0
Spoat
2.0
Spost
2.0
RLoust
Salarrive Risk
Selecrive Rikk
0.08
0.08
0.08
0
Solective
0.00
0.00
0.00
-2
0.0
0.5
1.0
0.0
0.5 Coverage
1.0
0.0
0.5
1.0
-2 0 2
Coverage
Ozverage
(a) Data and classifier visualization
(b) Hmax
(c) S Hanetor
(d) S
Figure 2: RC curves for (b) S.max (c) Sdoctor and (d) SRent, calculated based on scaled (by factor 0.1, 1.0, 2.0, and 4.0, respectively) raw logits from the optimal 4-class lincar classifier using data shown in (a). The RC curves for RLcout-M and Spost are also plotted for reference, where RL is one of our proposed confidence-score functions.
their RC curves and hence the associated AURC's vary as changes, and these curves approach a common curve (RIconf-M, which we will explain below) as X becomes large.
Why it happens? The above observations are not incidental. To see why the curves change with respect to X, note that for given test set {æ:) and a fixed classifier f, the RC curve for any score function 8 is fully determined by the ordering of s(x;)'s (Franc et al. 2023a). But this ordering is sensitive to the scale of the raw logits for all three SR-based score functions: SRmax. SRdoctor: and S Take s = SRmax as an example and consider any sample æ with its corresponding raw logits z sorted in descending order (i.e., 21) 2 2(2) 2...) without loss of generality. Then for any scale factor À > 0 applied to 2, we have the score
S.max & eZ)20) / ed =1/E, ee 200) exp exp(( (-log E, e c(fa6)-a!!))
(10)
This means that the score is determined by all the scaled logil gaps A(z0) - =2(0)'s. Moreover, due to the inner exponential function, small gaps gain more emphasis as À increases, and all gaps receive increasingly more emphasis as Ả decreascs. Such shifted emphasis can casily change the order of scores for two data samples, depending on how different. their raw logits are distributed. Clearly, eda(1) / eee0) = 1/K as A = 0. We can also make similar arguments for SRaocttor and SRent. Next, for the common asymptotic curve as + 0o, we can show the following (proof is deferred to Appendix By:
Lemma 3.1. Consider the raw logils 2, and without loss of generality assume that they are ordered in descending order without any ties, i.e., 2(1) 2() > We have that as X 4 00,
SRmax (Az) ~ exp -xp(--Ma*0==")
SRtocror (Az) ~ 1- e-epp (20 (20M100))01))) SRem (Az) -c
where means asymptotic equivalence. In particular, all the asymptotic functions increase monotonically with respect to 2(1) 2(2)
This implies that the asymptotic RC curve as X + co for all three score functions is fully determined by the score function z(1) - 2())
Implications The sensitivity of the RC curves, and hence of the performance, of these SR-based scores to the scale of raw logits is disturbing. It implies that one can simply change the overall scale of the raw snils-whiihh does not alter the classificntion accuracy ilself-to to claim better or worse performance of an SR- based confidence-score function for selective classification, making the comparison of different SR-based scores shaky. Unfortunately, between the limiting cases À + and + oo, there is no canonical scaling,
3.2 Our method: margin- based confidence scores
To avoid the scale sensitivity caused by the softmax nonlinearity, is natural to consider designing score functions directly over the raw logits. To this end, we revisit. ideas in support vector machines (SVMs).
7

---

Published in Transactions on Machine Learning Research (10/2024)
Margins in SVMs In linear SVMs for binary classification, the classifier takes the form f(z) sign(m) (wT + b) and the confidence in classifying a sample can be assessed by its distance from the support- ing hyperplane (Fumera & Roli 2002 Frane et al., 2023a |wT + bl/|| which is called the geometric margin; see Appendix A] for a detailed review. We can extend the idea to K-class lincar SVMs. Follow- ing the popular joint, multiclass SVM formulation (Crammer Singer 2001 ,, we consider a linear classifier (() = WTx+b. b. Here, W and induce K hyperplanes, and we can define the signed distance of any sample x the i-th hyperplane as: (w + bx)///w:ll (w; denotes the i-th column of W and the i-th element of b), generalizing the definition for the binary case. However, single signed distance makes little sense for assessing the classification confidence in multiclass cases, given the typical argmax decision rule-e.g. e.g. the largest signed distance can be negative. Instead, comparing the distances to all decision hyperplanes seemns more reasonable. Thus, we can consider the following geometric margin as a confidence-score function:
(w + by / ////,rl12 max,e(l,....)V (w]x b,) b,)/
(11)
where y' E arg JE(1.,( .y (w]. - + by)/ /////////ll///////// In other words, it is the difference between the top two signed distances of x to all K hyperplanes. Intuitively, the larger the geometric margin, the more confident the classifier is in classifying the sample following the largest signed distance trust. Although the interpretation is intuitive, the geometric margin is not popularly used in multiclass SVM formulations, likely due to its non-convexity. Instead, a popular proxy for the geometric margin the convex confidence margin:
clearer winner eams more
[w] x + by) - (L.., (w. + bi),
(12)
with the decision rule y' E arg (l.., KK = + by: see Appendix A Despite its numerical convenience, the confidence margin loses geometric interpretability compared to the geometric margin, and it can be sensitive to the scaling of wy. We study both margins in this paper.
Margins in DNNs To extend the idea of margins to DNN classifier fa parametorized by 0, we view all but the final linear layer as a feature extractor, denoted as fg- So, for each sample æ, the logit oulput takes the form z WT fz(r)) + b, and thus the signed distance of the representation fa()) to each decision hyperplane in the representation space is: d, = (w) (ax) + b/)/[lu, l2
Vj E (l,..., K}. Assume sorted
signed distances and logits, i.e., d((1) > d(2) 2 .... (k) and 21)) 2 (2) 2 ... 2 2(K), The geometric margin
and the confidence margin are defined as
RLgeo-M A d0))_ 22)) and RLconf-M - (1) (2) respectively.
(13)
Note that both Rigso-M and RLcoufMM are computed using the raw logits without softmar normalization; 2's and d's may not have the same ordering due to the scale of ||w]|l2- In fact, RL is applied in LeCun lt al.] (1989) to formulate an empirical rejection rule for a handwritten recognition system, although no detailed analysis or discussion is given on why it is effective. Despite the simplicity of these two notions of margins, we have not found prior work that considers them for SC except for LeCun et al. (1899..
Scale-invariance property An attractive property of margin-based based score functions that their SC per- formance is invariant w.r.t. the scale of raw logits. This is because changing the overall scale of the raw logits does not change the order of scores assigned by either the geometric or the confidence margin. In this regard, margin-based score functions are much more preferred and reliable than SR-based scores for SC. Another interesting point is that the limiting curve depicted in Fig. 2(b))(d) is induced by the confidence margin, as is clear from Lemma 3.1 and the discussion following it.
3.3 Analysis of rejection patterns
We continue with the toy example in Section 3.1 to show another major difference between the SR-based and the masein- score functions they have different rejection patterns for given coverage levels. We will see that margin-basod score functions induce favorable rejection patterns and can hence be used for reliable rejection even under moderate covariate shifts. For comparison, we also consider the maximum raw logit (denoted as R.max) to show that single logit in multiclass classification is not a sensible confidence score.
8

---

Published in Transactions on Machine Learning Research (10/2024)
Case
SRarx
SRuuccor Rlo M
Algeo
2
SRaut
Rejacted points
Rejected, points
RLmax
Sport
60
Alovor
0.06
SAea
SRa
0.00
SRusmw
-2
-2
Coverage
-2
-2
0
(a-1)
(b-1)
(c-1)
(d-1)
Case 2
SReae
Rl.gno
SRent
gegeo-
Rejected points
Rejected points
0.15
RLmax
Sport
AL.n
SRimax
Selective
5R
0.00
0.5
-2
-2
Coverage
-2
0
-2
0
1
2
(a-2)
(b-2)
(c-2)
(d-2)
Case 3
SRabstor
RLgeo
SRan
Alges
Rejected points
Rejected points
RLmar
Spost
2
Rl
Selective
0.4
0
SR max
SAew
-2
-2
0.0
60
SRuwwtrr
0.0
0.5
1.0
Coverage
-2 0
2
-2
0
2
1
(a-3)
(b-3)
(c-3)
(d-3)
Casc 1, Case 2, and Case 3 correspond to the original dataset in Section 3.1 the dataset after small perturbations, and the dataset after substantial perturbations, respectively. Here, (a-)'s are the RC curves achieved by different selection scores; (b-)'s s are visualizations of the samples (one color per class), decision boundaries (dashed blue line) and the rejected samples (black crosses) at coverage 0.8 by RLgeo-M; (c-)'s 's visualize the rejected samples (black crosses) coverage 0.8 by Smmax and (d-)'s present the histogram of the robustness radius of the selected samples in by all score functions.
Figure 3: Further analysis of the numerical example in Section 3.1
Case 1: We use the same setup as in the numerical experiment in Section 3.1 (see also Fig. 2). and plot in Fig. 3 (a-1) the RC curves induced by the varions confidence-score functions? is clear that RLgeo- performs the best. To better understand the difference between RLgeeoM and other score functions, we study their rejection patterns: we visualize in Fig. (b-1)&(c-1) the samples rejected at 0.8 coverage for R.gee-M and SRmaa, respectively; see visualization of other score functions in Appendix D whose rejection patterns similar to that of SR An iconic feature of RLLee- is that it prioritizes rejecting samples closer to decision boundaries, whereas SR-based scores priorilize rejecling samples close to the origin. Conceptually, the former rejection pattern is favorable, as the goal of SC is exactly to reject uncertain samples on which classifier's decisions can be shaky. More precisely, the difference in rejection
For the classifier consideblue, REgoodd and RIcoontM have the SC performance as ||w]||

---

Published in Transactions on Machine Learning Research (10/2024)
patterns implics at least two things: (1) R. RLggeoM could be advantageous when most classification errors occur near the decision boundaries; (2) RI .gooM may be superior even when test samples have a moderate level of distribution shifts with respect to training. For example, when the test set has a slightly different Drpy than the training set (sec Cases 2 & 3 below), mistaken samples due to the shift tend to be close to the decision boundaries and thus can be successfully rejected. Fig. 3 (d-1) plots the histograms of the robustness radäi (i.c., the &z distance of a sample to the closest decision boundary) of selected samples at 0.8 coverage, where the robustness radius quantitatively captures the extent of Dx1y shift SC can tolerate: while the selected samples using RLg uniformly have nonzero robust radii, all other score functions lead to zero robustness radii for the worst samples, implying sensitivity to Dxiy shifts
Case 2: We keep the same setup as Case 1, except that small perturbations are added on all samples. The perturbations are drawn from a uniform distribution within the interval [-0.5,0.3 on each dimension of IR?2 see Fig. 3 (b-2), where more samples of different classes are intermingled than before the perturbations are added. Although some misclassified samples have moved far into the bulks of other classcs, most of them are still close to the decision boundaries. Therefore, RLyeo-M M still outperforms other SR-based score functions, as in Fig. 3 (a-2).
Case 3: We continue to increase the magnitudes of perturbations and Fig. 3 (b-3) illustrates the case where the perturbations are drawn from uniform distribution within the interval [-2, Now that samples from different classes are well mixed in the 2D space, RLgoo-M is no longer superior when the coverage level is high, as shown in Fig. 3 (a-3). However, we argue that Case 3 is less concerning in practice we probably will never consider deploying a classifier that does not work well at all before SC; see the risk achieved coverage level 1. Instead of relying on an SC strategy, it is more urgent to improve the base classifier in this case.
Using the above examples, we have shown that our proposed margin-based score functions are not sensitive to the scale of the raw logits. When the base classifier is reasonable in classifying in-distribution data samples (i.e., achieving low risks at full coverage), margin-based scores are expected to result in good SC performance, even when test samples have low or moderate distribution shifts, as we show empirically in Sect 4 below.
Summary:
4 Experiments
In this section, we experiment with varions multiclass classification tasks and recent DNN classifiers to verify the effectiveness of our margin-based score functions for generalized SC.
4.1 Comparison with nontraining based score functions using pretrained models
Setups We take different pretrained DNN models in various classification tasks and evaluate SC perfor- mance on test datasets composed of In-D and distributiionssiiteed jainlesjointly.. Specifically, our evaluation tasks include (i) ImageNet (Russakovsky et al. 2013), the most widely used testbed for image classification, with a covariate-shitted version ImageNet-C CC (Hendryeks & Dietterich,
2018) composed of synthetic pertur- bations, and OpenImage-O (Wang al., 2022) composed of natural images similar to ImageNet but with
disjoint labels, i.c., label-shifted samples; (ii) 1WIldCam (Beery et al. 2020 test set provides two subsets of animal images taken at different geo-locations, where one is the same as the training set serving as In-D and the other at different locations as natural covariate-shifted version; (iii) Amazon (Ni et al. 2019 test set provides two subsets of review comments by different users, producing Tn-D and natural covariato-shifted test samples for a language sentiment classification task; (iv) CIFAR-10 (Krizhevsky et al. 2009). a small image classification dalasel commonly used in previous training- basedd SC works, logether with CIFAR-10-C (perturbed CIFAR-10) and CIFAR-100 (with disjoint labels from CIFAR-10), popularly used covariate-shifted and label-shifted versions of CIFAR-10. Tables 1 and 2 summarize the pretrained models and datascts.
Confidenco-score functions for comparison In addition to Spmax; SRdactur and SRent introduced in Eq. and our proposed margin-based scores Rl and RLcoof-M in Eq. (13) also consider several
The intuition on why our notions of margins work for Type B errors different: there since assumes label outside the known set, we expect no clear winner the raw logits.
10

---

Published in Transactions on Machine Learning Research (10/2024)
recent post-hoc OOD detection score: 4 (i) RLmax: the maximum raw logit (Hendryeks et al. 2019 (ii)
Energy: log-sum-eeponential aggregation (i.e., smooth approximation to the maximum raw logit) of the raw logits (Liu et al., 2020); (iii) KNN; a score composed of the distances from a test data point to the k nearest neighbors of the training set in the raw logit space (Sun et al.] 2022 ; (iv) ViM-a score composed of the residual of a lest. sample from the principal components estimated in the feature space prior to the raw logits using training data (Wang et al. 2022); and (v) STRC-a a composite score of the softmax response and OOD detection scores Xiia & Bouganis 2022). p We note that KNN, ViM, and SIRC all contain hyperparameters that are determined by the training data. To minimize the gap with our 'nontraining- based' setup, we randomly sample small number of data points from the In-D test set to tune their hyperparameters, respectively. Also, note that KNN has an additional hyperparameter k that is independent of the statistics of the dataset. Empirically, we find KNN's performance is very sensitive to the choice of k, the task, and the classifier. Therefore, in this paper, we use = 2 (the empirical best) by default for KNN and provide an ablation analysis for KNN for each experiment Appendix H.
Table 1: Summary of the protrained classifiers used for the various classification tasks Note
Task
Model Name
Source
EVA
Fang et al.
2023
Top-1 scc. 88.76 %
ImageNett
ConvNext
Liu et
2122
Top-1 acc. 86.25 %
VOLO
Yuan et al.
2222
Top-1 acc. 85.56 %
ResNext
Xie et al.
2017
Top-1 acc. 85.54 %
iWildCam
FL.YP
Goyal
2023
Official source code
Ranked 1a WILDS (Koh al. 2021
Amazon
LISA
Yao et al.
2022
Official source code
Ranked 1" WILDS
CIPAR & Imagelett
ScNet
[Geifman & El- Yaniv,
2019
PyTorch re-impleenntation
Training-bssed SC.
Table 2: Summary of In-D and distribution-shifted datasets used for our SC evaluation In-D (split)
Task
classes samples
Shift-Cov
samples
Shiet-Label
samples
Inageliet
ILSVRC-2012 ('val')
1000 50,000
ImageNat--C (severity 3)
50,000 19
OpenInage-0
17,256
*All types of corruptions
iWildCam
iWildCan [ess')
178 8154
iWildCan (ood__tett]
42791
N/A
N/A
Amazon
Amazon ('d__test)
5 46,950
Amazon ("test')
100,050
N/A
N/A
CIFAR
CIFAR-10 ('val)
10 10,000
CIFAR-10-C (severity 3)
10,000
19
CIFAR-100
10,000
*All types of corruptions
Evaluation motrics We report both the RC curves and the AURC-a where a E (0.1, 0.5, 1} as discussed in /eccionn 2.4 Note that when plotting the RC curves, we omit Sdooctor because it almost overlaps with Rmax which also observed by Xia & Bouganis (2022).
Results on ImageNett We show in Fig. 4 the RC curves of the various score functions on the pretrained model EVA, for different combinations of subsots of test data, as summarized in Table 3 The most striking is in Fig. 4c),, which collects the results for evaluation on mixup of In-D and label-shifted samples: except for R.goo-M; R..cof. M and KNN, the selection risks of other score functions do not follow a monotonic decreasing trend as coverage decreases. As coverage approaches zero, their selection risks spike up, almost to the risk level at full coverage (i.e., error rate on the whole set). This is because the other score functions do not indicate prediction confidence well in this setting and hence fail to sufficiently separate right and wrong
'In OOD detection, scores are usually dependent on the training data, However, these post-hou scores can also be applied as nontraining- based SC scores as Algorithm 1| by replacing Dx and D DOOD in Algorithm with Deati We do not sample live points per class, as in practice the
'Five times the number of classes in each task from Table 2 calibration set Dent may be imbalancod.
6Se Table 6 in Appendix E for the model card information to retrieve these timm models.
httpp:///githbb http:///htuub.cooocccssseaao com/Locuslaa/FLYY
git
Seaetttrrr--SSeeeeeeeeeee SelectiveNet
11

---

Published in Transactions on Machine Learning Research (10/2024)
predictions-dae during rejection, both right and wrong predictions rejected indiscriminately. On the other hand, RIggon-M Rh-confM are better than KNN in separating correct and wrong predictions when there are no label-shifted samples, as shown in Fig. 4 (a)&(b). As a result, RLggooM and RLconf-M have the best overall performance when In-D, corariate-shifted and label-shifted samples coexist, as shown Fig. 4 (d). Also, see Table 3 for numerical confirmation of the above observations, where in all cases RligeoMM and Ro-con--M are the bost or comparable the best-performing among all score functions. We present the SC results of other ImageNet models in Appendix G our margin- based score functions still stand the best-performing among all.
Energy KINN Vin
knergy KNYI Vin
Energy K04 Vim
Energy
Rlaee
SRei
Rlan SBC
SRew PL
Rlay
SRce
Rlart
SRat Rlewr
KNW
SBRC
RLeur
FLom
Von
0.34
Sclection Rixt
selection Rix
Selection fiak
Selectton Ris
0.06
0.09
0.37
0.10
0.0
0.5 Coverage
1.0
0.0
0.5
1.0
0.0
0.5
1.0
0.0
0,5
1.0
Coverage
Coverage
Coverage
(a) In-D (ImageNet)
(b) In-D Shift (Cov)
(c) In-D Shift (Label)
(d) In-D Shift (both)
Figure 4: RC curves of different confiddenc--score functions the model EVA for ImageNet. (a)-(d) are RC curves evaluated using samples from (a) In-D samples only, (b) In-D and covariate-shifted samples only, (c) In-D and label-shifted samples only, and (d) all samples, respectively. We group the curves by whether they are originally proposed for SC setups (solid lines) or for OOD detection (dashed lines).
the 10-2 scale the lower, the better. The score functions proposed for SC are highlighted in gray, and the rest are originally for OOD detection. The best AURC numbers for each coverage level are highlighted in bold, and the 2nd and 3rd best scores are underlined. ImageNet EVA
Table 3: Summary of AURC-a for Fig, The AURC numbers
In-D
In-D + Shift (Cov)
In-D Shift (Label)
In-D + Shift (both)
0.1
0.5
0.1
0.5
0.1
0.5
0.1
0.5
1
RLcontMM
0.16
0.53
2.39
0.24
0.96
4.77
1.04
3.34
11.7
0.34
1.20
5.43
RLgeo-M
0.27
0.59
2.43
0.37
1.02
4.78
1.20
3.35
11.6
0.48
1.26
5.43
SIRC
2.23
2.07
3.36
3.71
3.06
5.83
15.8
8.88
13.7
4.61
3.53
6.52
SRmax
3.20
2.36
3.38
4.52
3.66
5.93
13.1
7.52
12.6
5.21
3.75
6.56
S Reent
4.28
3.13
4.04
6.24
4.66
7.00
16.0
9.19
13.4
7.04
5.10
7.61
R
3.22
2.38
3.40
4.55
3.40
13.2
7.55
5.24
3.78
6.61
RLmaxx
5.53
4.05
4.57
8.48
6.04
7.64
21.1
11.9
14.9
9.53
6.59
8.33
Energy
8.13
6,60
6.90
12.8
10.3
11.1
27.3
16.6
18.1
14.1
11.0
11.8
KNN
0.99
2.27
4.58
1.22
2.89
6.78
1.18
3.23
10.8
1.24
2.98
7.16
VIM
5.48
7.11
8.31
5.31
8.05
10.4
5.83
7.89
13.4
5.35
8.12
10.7
Results on iWildCam & Amazon We report in Fig. 5 and Table the SC performance of different score functions on iWildCam and Amazon. Similar to the ImageNet experiment above, scores designed for OOD detection (RImax, Energy, KNN and ViM) do not have satisfactory performance in SC. By contrast, existing SR-based scores (SIRC, SR SRent and SRaoctor) all demonstrate better SC potential than OOD score functions, and our margin-based score functions (RLConEM and RLgoo.M) perform on par with the SR-based scores.
4.2 Comparison with training- based confidence-score function
We also compare with a training- based method, ScNet (Geifman & El- Yaniv 2019 ScNet consists of a
selection network and classifier that are structurally decoupled and trained herether, allowing to perform
12

---

Published in Transactions on Machine Learning Research (10/2024)
1WildCam FYLP
Amazon LISA
A Rige
SRam SRe
Energy
Inergy KIaI VM
SReue
Inergy
SRem SR
Energy
KTNN
RLag
SR
Ri
SRow
KXN VMM
ALaeo
KYW
VM
VM
Senddonn
0.15
0:15
0.55
Coverage
Ooverage
Cowerage
Covelage
(a) In-D
(b) In-D
Shift (Cov)
(c) In-D
(d) In-D + Shift (Cov)
Figure 5: RC curves of different confidence-score functions the model FLYP for iWildCam and the model LISA for Amazon. (c) are RC curves evaluated using In-D samples only and (b) are RC curves evaluated using both In-D and covariate-shifted samples.
The AURC numbers are on the 10-2 scale- the lower, the better. The score functions proposed for SC are highlighted in gray, and the rest are originally for OOD detection. The best AURC numbers for each coverage level are highlighted bold, and the 2nd and 3rd best scores are underlined.
Table 4: Summary of AURC-a for Fig. 5.
iMildCan- FYLP
Amazon
LISA
In-D
In-D + Shift (Cov)
In-D
In-D + Shift (Cov)
a
0.1
0.5
0.1
0.5
0.1
0.5
0.1
0.5
RLCoon-M
1.63
3.88
10.2
1.84
3.21
10.0
1.11
5.31
12.5
1.83
6.91
14.2
R
1.63
3.88
10.1
1.84
3.21
10.0
1.13
5.51
12.8
1.86
7.15
14.6
SIRC
1.45
3.72
9.84
1.38
3.5
9.94
1.14
5.09
12.2
1.88
6.66
13.9
SRmax
1.45
3.87
10.0
1.38
3.61
10.1
1.14
5.13
12.3
1.88
6.70
14.0
S
1.46
4.03
10.6
1.34
3.94
10.6
1.15
5.06
12.1
1.89
6.61
13.8
S Raooctor
1.45
3.87
10.1
1.38
3.62
10.1
1.14
5.13
12.2
1.88
6.70
13.9
R.maax
29.1
21.4
24.7
25.5
24.8
27.9
1.26
5.21
12.5
1.98
6.88
14.4
Energy
35.2
28.3
29.9
36.1
33.2
34.4
1.26
5.37
12.8
1.98
6.88
14.4
KNN
6.40
11.1
15.3
8.16
5.10
10.7
12.1
14.3
18.2
16.1
16.5
20.1
VIM
13.4
10.7
15.7
6.98
6.47
12.2
2.33
8.72
15.0
3.55
10.4
16.7
As shown above, score functions designed for OOD detection perform poorly for generalized SC, so here we focus on comparing our margin-basod and SR-based score functions with ScNet. We first train ScNet using the training set of CIFAR-10 and ImageNet, respectively; see [ppendix F] for training details. After training, and the selection heads and compute the scores and selection risks using the test setup shown in Table (i) the ScNet selection score is taken directly from the selection head, and (ii) the scores are computed using the classification head.
faithful comparison of selection scores with a fixed classifie 10
fix both the classification
based and SR-based
Results We show in Fig. 6 the RC curves achieved using ScNet, SR-based, and margin- margin-based scores. For the CIFAR experiment shown in Fig. 6 (a)&(b), ScNet and RLcont-M perform comparably and are better than S.maxx and SIRC, whereas for the ImageNet experiment in Fig. 6 (c)) RLcoutM RLggooMM SRmax and SIRC perform comparably and are better than ScNet. Surprisingly, ScNet does not always lead to the best
WeWe do not consider brasning-basod score functions such Liu et al. 2211 Huang al. (022) due to the ambiguity in calculating their SR responses. During their training, virtual class "abstention" is added and the softmax normalization is applied on all logits- including that of the virtual class, is unfair either simply dropping the abstention logit during test for score calculation or keeping the abstention logit but modifying the score calculation procedure. Retraining classifier with the settings but without the abstention logit also unfair due to the requirenent of fixed classifier. Purthermore, [eng effective they claim. Existing training-based SC works so far have only reported SC (In-D) pertormance CIFAR-10 dataset and have not experimented with ImageNet using the full training set. Our results on CIFAR-10 dataset faithfully reproduce the result originally reported in Geifman & Fl--aniv 2019).
ct al. (023) reports that the above selection methods (Liu ct al. 2019 Huang et al. 2022
13

---

Published in Transactions on Machine Learning Research (10/2024)
CIFAR- ScNot
ImageNet ScNet
MM
SMAC
SIC SR
RI Mlae--
SICC
Schett
SPC
Schiet
Riger
SR
FLay
Rlgo
SRo
ALaoo
0.24
0.27
0,70
Selection Risk
Salection Rukk
0.04
0.13
0.35
0.0
0.5
1.0
0.0
0.5
1,0
Coverage
Ooverage
Coverage
Coverage
(a) In-D
(b) In-D + Shift (Both)
(c) In-D
(d) In-D + Shift (Both)
Figure 6: RC curves of different confidence-score functions on the model ScNet for CIFAR and ImageNet. (c) are RC curves evaluated using In-D samples only and (b)& are RC curves evaluated using both In-D and covariate-shifted samples.
performance, even if it has access to training data. However, our margin-based scores consistently exhibit good SC performance.
4.3 Summary of experimental results
From all above experiments, can conclude that (i) existing nontraining-basee score functions for OOD detection do not perform well for generalized SC, not helping achieve reliable classification performance after rejecting low-confidence samples, and (ii) our proposed margin-based score functions RI and R. consistently perform comparably to or better than existing SR-based scores on all DL models we have tested, especially in the low-risk regime, which is particular interest for high-stakes problems. These confirm the superiority of RI and R..comfMM as effective confidence-score functions for SC even under moderate distribution shifts for risk-sensitive applications.
In most of our experiments, RLgeo-M and RLCouf-M perform similarly; only in rare cases, e.g. Fig. (a) and
Fig. 6 (b), RI slightly outperforms Rigeo-M- However, we do not think it is sufficient to conclude that RLconf-M is better than RLgeo-M, or visc versa. Recall how RLConf-M and RLgeo-M are defined in Eqs. (11)
and (12) and their associated decision rules, the current practice of training DL classifiers is in favor of R.eoof-M Thus, understanding the difference in behavior of RLgeo-M and R.Ccof-M is likely to also involve investigation of the training process, which we will leave for future work.
5 Conclusion and discussion
In this paper, we have proposed generalized selective classificalion, a new selective classification (SC) frame- work that allows distribution shifts. This is motivated by the pressing need to achieve reliable classification for real-world, risk-scnsitive applications where data can come from the wild in deployment. Generalized SC covers and unifies existing selective classification and out-of-distribution (OOD) delection, and we have proposed two margin- based score functions for generalized SC, RLgoo-M and RLCoof- which are not based on training: they are compatible for any given pretrained classifiers. Through our extensive analysis and experiments, have shown the superiority of RLgee-M and RLecof-M over mumerous recently proposed non- training- based score functions for SC and OOD detection. As the first work that touches on generalized SC, our paper can inspire several lines of future research, including at least: (i) to further improve the SC performance, one can try to align the training objective with our SC confidence-score functions here, i.c.,
The cross-entropy loss is the most commonly used and minimizing it can be viewed as approximating maximizing the confidence margin. To see this, without loss of generality, assume that the magnitudes of the raw logits are ordered 21 > 22 ... =K and that the true label of the current sample is class 1. Then the cross-entropy loss for the current sample is
log (et/E, cz)) = log E, 0- log + e4-21) so min log (o2) (,t//,,, ex) = min log 1+ Enzg -4--21 =
min Exsge* e -11, where the last minimization problem can be approximated by min =2 min(22 =1) max(s2 - 21):
Le., maximixing the confidence margin, when 022-11 >> Eigget 691-11
14

---

Published in Transactions on Machine Learning Research (10/2024)
promoting large margins; (ii) in this paper, only consider the case where all classes are treated equally, while practical generalized SC might entail different rejection weights and costs for different classes, e.g. medical diagnosis of diseases with different levels of health implications; (ii)) last but not least, finding better confidenco-score functions. We hope that our small step here stimulates further research on generalized SC, bridging the widespread gaps between exploratory AT development and reliable AT deployment for practical high-stakes applications.
Acknowledgments
Liang H. and Sun J. are partially supported by NIH fund ROINS131314. Peng L. and Sun J. are partially supported by NIH fund R01CA287413. The authors acknowledge the Minnesota Supercomputing Institute (MSI) at the University Minnesota for providing resources that contributed to the research results reported in this article. The content is solely the responsibility of the authors and does not necessarily represent the official views of the National Institutes of Health. This research is also part of AI-CLIMATE: "AT Institute for Climate-Land Interactions, Mitigation, Adaptation, Tradeoffs and Economy," " and is supported by USDA National Institute of Food and Agriculture (NIFA) and the National Science Foundation (NSF) National AI Research Institutes Competitive Award no. 2023-67021-39629.
References
Sara Beery, Eljjah Cole, and Arvi Gjoka. The iwildcam 2020 competition dataset. ar preprint arXiv:2004.10340, 2020.
Tom B. Brown, Benjamin Mann, Nick Ryder, Melanie Subbiah, Jared Kaplan, Prafulla Dhariwal, Arvind Neclakantan, Pranav Shyam, Girish Sastry, Amanda Askell, Sandhini Agarwal, Ariel Herbert- Voss, Gretchen Krueger, Tom Henighan, Rewon Child, Aditya Ramesh, Daniel M. Ziegler, Jeffrey Wu, Clemens Winter, Christopher Hesse, Mark Chen, Eric Sigler, Mateusz Litwin, Scott Gray, Benjamin Chess, Jack Clark, Christopher Berner, Sam McCandlish, Alec Radford, llya Sutskever, and Dario Amodei. Language models are few-shot learners. arXiv preprint arXiv:2005. 14165, 2020.
Nicholas Carlini, Anish Athalye, Nicolas Papernot, Wieland Brendel, Jonas Rauber, Dimitris Tsipras, lan Goodfellow, Aleksander Madry, and Alexey Kurakin. On evaluating adversarial robustness. orXiv preprinl arXiv:1902.067 06705, 2019.
Laís Felipe Prates Cattelan and Danilo Silva. On selective classification under distribution shift. In NeurIPS 2023 Workshop Distribution Shifts: New Frontiers with Foundation Models.
C Chow. On optimum recognition error and reject tradeoff. IEEE Transactions on information theory, 16 (1):41-46, 1970.
Charles Corbière, Nicolas Thome, Avner Bar-Hen, Matthicu Cord, and Patrick Pérez. Addressing failure prediction by learning model confidence. Advances in Newral Information Processing Syslems, 32, 2019.
Corinna Cortes, Giulia DeSalvo, and Mehryar Mohri. Boosting with abstention. Advances in Newral Infor- mation Processing Systems, 29, 2016.
Koby Crammer and Yoram Singer. On the algorithmic implementation of multiclass kernel-based vector machines. Journal of machine leorning research, 2(Dec):265 292, 2001.
Francesco Croce, Maksym Andriushchenko, Vikash Sehwag, Edoardo Debenedetti, Nicolas Flammarion, Mung Chiang, Pratock Mittal, and Matthias Hein. Robustbench: a standardized adversarial robustness benchmark. Xrv preprint Xrx:220000.0 09670, 2020.
Jesse Davis and Mark Goadrich. The relationship between precision-recall and roc curves. In Proceedings of the 23nd international conference on Machine learning, pp. 233-240, 2006.
Andrija Djurisic, Nebojsa Bozanic, Arjun Ashok, and Rosanne Liu. Extremely simple activation shaping for out-of-distribution detection. Xiv preprint ar Xiw:2209.09858 2022.
15

---

Published in Transactions on Machine Learning Research (10/2024)
Michael Dusenberry, Ghassen Jerfel, Yeming Wen, Yian Ma, Jasper Snock, Katherine Heller, Balaji Lak- shminarayanan, and Dustin Tran. Efficient and scalable bayesian neural nets with rank-1 factors. Tn International conference on machine learning, pp. 2782 2792. PMLR, 2020.
Ran El- Yaniv al. On the foundations of noise-free free selective classification. Journal of Machine Learning Research, 15)) 2010.
Yuxin Fang, Wen Wang, Binhui Xie, Quan Sun, Ledell Wu, Xinggang Wang, Tiejun Huang, Xinlong Wang, and Yue Cao. Eva: Exploring the limits of masked visual representation learning scale. In Proceedings of the IEEE/CVF Conference on Compuler Vision and Pallern Recognition, pp. 19358 19369, 2023.
Leo Feng, Mohamed Osama Ahmed, Hossein Hajimirsadeghi, and Amir H Abdi. Towards better selective classification. In The Eleventh International Conference on Learning Representations, 2023.
Adam Fisch, Tommi S Jaakkola, and Regina Barzilay. Calibrated selective classification. Transactions on Machine Learning Research, 2022.
Vaclav Voracek Vojtech Franc, Daniel Prusa, and Vaclav Voracek. Optimal strategies for reject option classifiers. Journal of Machine Learning Research, 24(11):1-49, 2023a.
Vojtech Franc, Daniel Prusa, and Jakub Paplham. Reject option models comprising out-of-distribution detection. Xiv preprint arXiv:2307.01100 2023b.
Vojtech Franc, Jakub Paplham, and Daniel Prusa. Scod: From heuristics to theory. ar preprinl arXiv:2403. 16916, 2024.
Giorgio Fumera and Fabio Roli. Support vector machines with embedded reject option. In Pattern Recog- nition with Support Vector Machines: First International Workshop, SVM 2002 Niagara Falls, Canada, August 10, 2002 Proceedings, pp. 68-82. Springer, 2002.
Yarin Gal and Zoubin Ghahramani. Dropout bayesian approximation: Representing model uncertainty in deep learning. In indernational conference machine learning, pp. 1050 1059. PMLR, 2016.
Yonatan Geifman and Ran El-Yaniv Selective classification for deep neural networks. Advonces in neural information processing systems, 30, 2017.
Yonatan Geifman and Ran El- Yaniv. Selectivenet: deep neural network with an integrated reject option. In International conference on machine learning, pp. 2151-2159. PMLR, 2019.
Yonatan Geifman, Guy Uzicl, and Ran El-Yaniv. Bias-reducod uncertainty cstimation for deep neural classifiers. Xrxiv preprint 18v: 800.00600. 2018.
Chuanxing Geng, Sheng-jun Huang, and Songcan Chen. Recent advances in open set recognition: A survey. IEFE Imnsactions on paltern analysis and machine intelligence, 43(10):3614 3613-333333 2020.
Sachin Goyal, Ananya Kumar, Sankalp Garg, Zico Kolter, and Aditi Raghunathan. Finetune like you pretrain: Improved finetuning of zero-shot vision models. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 19338 19344, 2023.
Yves Grandvalet, Alain Rakotomamonjy, Joseph Keshet, and Stéphane Canu. Support vector machines with a reject option. Advances in neural information processing systems, 21, 2008.
Federica Granese, Marco Romanelli, Daniele Gorla, Catuscia Palamidessi, and Pablo Piantanida. Doctor: A simple method for detecting misclassificatiin errors. Advonces in Newral Information Processing Systems, 34:5669-5681, 2021.
Chuan Guo, Gcoff Pleiss, Yu Sun, and Kilian Q Weinberger. On calibration of modern neural networks. In International conference on machine learning, pp. 1321-1330. PMLR, 2017.
Dan Hendryeks and Thomas Dietterich. Benchmarking neural network robustness to common corruptions and perturbations. In International Conference on Learning Represenlations, 2018.
16

---

Published in Transactions on Machine Learning Research (10/2024)
Dan Hendryeks and Kevin Gimpel. A baseline for detecting misclassified and out-of-distribttion examples in neural networks. arxiv preprint #xXx:1610.02133 2016.
Dan Hendrycks, Steven Basart, Mantas Mazeika, Andy Zou, Joe Kwon, Mohammadreza Mostajabi, Jacob Steinhardt, and Dawn Song. Scaling out-of-distribution detection for real-world settings. arXiv preprint arXiv:1911.11192, 2019.
Lang Huang, Chao Zhang, and Hongyang Zhang. Self-adaptive training: Bridging supervised and self- supervised learning. IEEE Transactions on Pottern Analysis and Machine Intelligence, 2022.
Heinrich Jiang, Been Kim, Melody Guan, and Maya Gupta. To trust not to trust classifier. Advances in neural information processing systems, 31, 2018.
Jihyo Kim, Jiin Koo, and Sangheum Hwang. A unified benchmark for the unknown detection capability of deep neural networks. Expert Systems with Applications, 229:120461, 2023.
Pang Wei Koh, Shiori Sagawa, Henrik Marklund, Sang Michael Xie, Marvin Zhang, Akshay Balsubramani, Weihua Hu, Michíhiro Yasunaga, Richard Lanas Phillips, Irena Gao, et al. Wilds: A benchmark of in- the-wild distribution shifts. In International Conference on Machine Learning, pp. 5637 5664. PMLR, 2021.
Alex Krizhevsky, Geoffrey Hinton, al. Learning multiple layers of features from tiny images. 2009.
Balaji Lakshninarayanan, Alexander Pritzel, and Charles Blundell. Simple and scalable predictive uncer- lainty estimation using deep ensembles. Advances in neural information processing systems,, 30, 2017.
Yann LeCun, Bernhard Boser, John Denker, Donnie Henderson, Richard Howard, Wayne Hubbard, and Lawrence Jackel. Handwritten digit recognition with a back-propagation network. Advances in neural information processing systems, 2, 1989.
Jing Lei. Classification with confidence. Biometrika, 141(4):755 769, 2014.
Hengyue Liang, Buyun Liang, Le Peng, Ying Cui, Tim Mitchell, and Ju Sun. Optimization and optimizers for adversarial robustness. ai preprint (tti::2303.144000 2023.
Shiyu Liang, Yixuan Li, and Rayadurgam Srikant. Enhancing the reliability of out-of-distribution image detection in neural networks. arXiv preprint arXiv: (al::700.02000 020600 2017.
Weitang Liu, Xiaoyun Wang, John Owens, and Yixuan Li. Energy-based out-of-distribution detection. Advances in neural information processing systems, 33:21464-21475 2020.
Zhuang Liu, Hanzi Mao, Chao-Yuan Wu, Christoph Feichtenhofer, Trevor Darrell, and Saining Xie. A convnet for the 2020s. In Proceedings of the LEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 11976-11986, 2022.
Ziyin Liu, Zhikang Wang, Paul Pu Liang, Russ R Salakhutdinov, Louis-Philippe Morency, and Masahito Ueda. Deep gamblers: Learning to abstain with portfolio theory. Advances in Neural Information Pro- cessing Systems, 32, 2019.
Wesley J Maddox, Pavel Izmailov, Timur Garipov, Dmitry P Vetrov, and Andrew Gordon Wilson. A simple baseline for bayesian uncertainty in deep learning. Advances in neural information processing systems, 32, 2019.
Mehryar Mohri, Afshin Rostamizadeh, and Ameet Talwalkar. Foundations of machine learning. MIT press, 2018.
Jens Müller, Stefan T Radev, Robert Schmier, Felix Draxler, Carsten Rother, and Ullrich Köthe. Finding competence regions in domain generalization. ar Xio preprint ar (xXii:2303.09988 2023.
17

---

Published in Transactions on Machine Learning Research (10/2024)
Jianmo Ni, Jiacheng Li, and Julian McAuley. Justifying recommendattons using distantly-labelee reviews and fine-grained aspects. In Proceedings of the 2019 Conference on Empirical Methods in Natural Language Pro- cessing and the 9th International Joint Conference on Natural Language Processing (EMNLP-IJCNLP), 2019.
Jeremy Nixon, Michael W Dusenberry, Linchuan Zhang, Ghassen Jerfel, and Dustin Tran. Measuring calibration in deep learning, In CVPR workshops, volume 2, 2019.
Jaewoo Park, Yoon Gyo Jung, and Andrew Beng Jin Teoh. Nearest neighbor guidance for out-of-distribution detection. In Proceedings of the IEEE/CVE International Conference on Computer Vision, pp. 1686-1695, 2023.
Tadeusz Pietraszek. Optimizing abstaining classifiers using roc analysis. In Proceedings of the 22nd inter- national conference on Machine learning, pp. 665-666566 665-672, 2005.
Joaquin Chinonero-Candeel Masashi Sugiyama, Anton Schwaighofer, and Neil D Lawrence. Dataset shift in machine learning. Mit Press, 2008.
Stephan Rabanser, Stephan Günnemann, and Zachary Lipton. Failing loudly: An empirical study of methods for detecting dataset shift. Advances in Neural Information Processing Systems, 32, 2019.
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, pp. 8748 8763. PMLR, 2021.
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. Internaiional journal of computer vision, 115:211 252, 2015.
Takaya Saito and Mare Rehmsmeier. The precision-recall plot is more informative than the roc plot when evaluating binary classifiers imbalanced datasets. PloS one, 10(3):=011843)) 2015.
Yiyou Sun, Chuan Guo, and Yixuan Li. React: Out-of-distribution detection with rectified activations. Advances in Newral Information Processing Systems, 34:144-157, 2021.
Yiyou Sun, Yifei Ming, Xiaojin Zhu, and Yixuan Li. Out-of-disttrbuttinn detection with deep nearest neigh- PMLR, 2022.
bors. In International Conference on Machine Learning, pp.
Thomas Villmann, Marika Kaden, Andrea Bohnsack, J-M Villmann, T Drogies, Sascha Saralajew, and Barbara Hammer. Self-adjusting reject options in prototype based classification. In Advances in Self- Organizing Maps and Learning Vector Quantization: Proceedings of the 11th International Workshop WSOM 2016, Houston, Tezos, USA, January 6-8, 2016, pp. 269-279. Springer, 2016.
Haoqi Wang, Zhizhong Li, Litong Feng, and Wayne Zhang, Vim: Out-of-distribution with virtual-logit matching. In Proceedings of the IEEE/CVF conference on computer vision and pattern recognition, pp. 4921-4930, 2022.
Ross Wightman. Pytorch image models. http:p///ghhhhaoc.oooggghhaaaaar
2019.
Guoxuan Xia and Christos-Savwar Bouganis. Augmenting softmax information for selective classification with out-o--dist data. In Proceedings of the Asian Conference Computer Vision, pp. 1995- 2012, 2022.
Saining Xie, Ross Girshick, Piotr Dollár, Zhuowen Tu, and Kaiming He. Aggregated residual transforma- tions for deep neural networks. In Proceedings of the IEFE conference on computer vision and pattern recognition, pp.
2017.
Jingkang Yang, Kaiyang Zhou, Yixuan Li, and Ziwei Liu. Generalized distri-dis detection: A survey. Xiv preprint arXiv:21 10. 1 11334, 2021.
18

---

Published in Transactions on Machine Learning Research (10/2024)
Jingkang Yang, Pengyun Wang, Dejian Zou, Zitang Zhou, Kunyuan Ding, Wenxuan Peng, Haoqi Wang, Guangyao Chen, Bo Li, Yiyou Sun, et al. Openood: Benchmarking generalized out-of-distribution detec- tion. Advances in Neural Information Processing Systems, 35:32598 32611, 2022.
Huaxiu Yao, Yu Wang, Sai Li, Linjum Zhang, Weixin Liang, James Zou, and Chelsea Finn. Improving out- of-distribution robustness via selective augmentation. In International Conference on Machine Learning, pp. 75407-254377 PMLR, 2022.
Li Yuan, Qibin Hou, Zihang Jiang, Jiashi Feng, and Shuicheng Yan. Volo: Vision outlooker for visual recognition. IEFE Transactions on Pottern Analysis and Machine Intelligence, 2022.
Lu Yuan, Dongdong Chen, Yi-Ling Chen, Noel Codella, Xiyang Dai, Jianfeng Gao, Houdong Hu, Xuedong Huang, Boxin Li, Chunyuan Li, et al. Florence: A new foundation model for computer vision. arXiv preprint ar Kic:2111.11403 2021.
Xu-Yao Zhang, Guo-Sen Xie, Xiuli Li, Tao Mei, and Cheng-Lin Liu. A survey on learning to reject. Pro- ceedlings of the IEEE, 121(2))185 215, 2023.
Fei Zhu, Zhen Cheng, Xu-Yao Zhang, and Cheng-Lin Liu. Rethinking confidence calibration for failure prediction. In Computer Vision-ECCV ECCV 2022: 17th European Conference, Tel Aviv, Israel, October 23-20 27, 2022, Proceedings, Part XXV, pp. 518-536. Springer, 2022.
A Linear SVM and margins
([N) (1,..., NN), where y; E {+1,-1} and for notational simplicity, we assume that an extra 1 has been appended to the original feature vectors so that we only need to consider the homogeneous form of the predictor: f(x) = wTx. The basic idea of SVM is to maximize the worst signed geometric margin, which makes sense no matter whether the dala are separable or not:
We first consider binary classification. Assume training set {( y:) NEIM
max min yowTx; xz FE(N] |
(14)
Note that the problem is non-convex due to the fractional form yow Moreover, w.w is invariant to |
| the rescaling of w, which is bad for numerical computation (as this implics that there exist global solutions arbitrarily close 0 and oo).
If the training set is scparable, i.c., there exists a w such that yow 2 20 [N]. there also exists so that min, y x. = liii [N] by simple rescaling argument. Then Eq. (14) becomes
yow w
max min w
8. min yow s; 101e [N]
(15)
N
|
max |
t. min y x2 1 [N]
(16)
min |
t. yow x 1 [N].
(17)
where Eq. (17) our textbook hard-margin SVM (except for the squared norm often used in the objective).
A problem with Eq. (17]is is that the constraint set is infcasible for inseparable training data. To fix this issuc. can allow slight violations in the constraint and penalize these violations in the objective of Eq. (17)
arriving at
min w 2 + w
Σ & s.t. yow 2 111--, E 2 20V1 [N], *E[N]
(18)
which is textbook soft-margin SVM.
19

---

Published in Transactions on Machine Learning Research (10/2024)
Now for multiclass classification, let us assume the data space: X x 3 = R2 x fI....,K) with K 2 3. The classifier takes the form [(): WTw, where W E R We note that from binary SVM, people create the notion of confidence margin:
ConfMargin(2;, w) = y,w 2/
(19)
which for the binary case is simply the signed geometric margin rescaled by ||w]|- The standard multiclass decision rule E3
arg max w..
(20)
jE[K]
where wy is the j-th column of W. To correctly classify all points, we need
ViE [N], y1- arg max w/ - Vie w az yEVi((a))
max w w...
(21)
jE[K]
This motivates the multielass hard-margin SVM, separability assumed:
min jE(K]
|
s. t. wT J. z₁
max wJa: 2 1, ViE [N], (v))
(22)
where terms w., x. ma waaa: can be viewed mulliclass confidence margins, natural generaliza- tions of confidence margins for the binary case. The corresponding soft-margin version is
min
E + JE[K]
Σ E. s. w. max wja: 2 &, & 2 OViE [N]. VE(N]
(23)
VE
Both hard- and soft-margin versions are convex and thus more convenient. for numerical optimization.
On the other hand, if we strictly follow the geometric margin interpretation, it seems more natural to formulate multiclass SVM as follows. Consider the decision rule:
w.2 x
arg max jE[K] |wy||
(24)
which would classify all points correctly provided that there exists a W E RR satisfying
Wt æ; (
wJ.: max BEr
ViE [N].
(25)
|wyll
B
This motivates an optimization problem on the worst geometric margins:
wTa ||yl||
max min W NEN
max v
(26)
However, this problem is non-convex and thus not popularly adopted.
B Asymptotic behaviors of S S and S
Recall from mathematical analysis that two functions f() and g(x) are asymptotically equivalent as x + co, written as f(x) ~ g(x) as x + 00, if and only if f(z) = g(x) + o(1) as x + co, where o(.) is the standard small-o notation. Note that [(x) ~ g(x) + g(x) f(x).
Lemma B.1. Consider the raw logils z, and without loss of generulity assume that they are ordered in descending order without any ties, i.e,, z(1) (2) > We have that as X + 00.
SRmax (Az) ~ exp exp(-cMee0==
SR (Aze) 1 exp (20 -e")) SRont (Az) ~ (() 20))
Moreover, all of the asymptotic functions are monotonically increasing with respect to 211) (2))
13e decision rule for the binary case arg max Vc (41,-11 ywu Therefore, do need worry about the wiss scaling.
20

---

Published in Transactions on Machine Learning Research (10/2024)
Proof. First, for Rmax: we have
edo(1)
Σ, ed2(0) =log Σ (d(a(0)-20)) ~ -log(1 + ((660)-2(0))
log S Rmax (Az) = log
(27)
as X + 00, because Σ1z3 (((0)))=011)) /11 + ed(o(0) +0 as d - 00. Moreover, as À + 00,
e +0 +0= = log 1 (++000))==011 -c((=l1)-21))
(28)
88 log(1 + x) ~ x. when - 0. So we conclude that
S RRma((22) ~ exp (-eM(:B0)(11)) as A + 00.
(29)
Now consider SRaoctor Applying a similar argument as above, we have
log [[x())] log Σ edotiinz = log 2((1)))
22
-200 Σ (((((()-s"))) + log Σ c2o(0())
(30)
~ -2log (1 + ed(cs() - + log [ e27(x
(31)
-20d(=10) (21(=(0)
(32)
(33)
as A + 00, where Eq. (33) holds as 22A(x(0)_z()) is lower order than 2) when 2(2) -1)) < 0 so
that e (1)) < 1. Therefore, as \ + 00,
SRacctor (Az) = 11 - 1 1- - exp (201((00==111))
(34)
Finally, for SReat, we have that when A + oC,
ed2
ed2(1))
(x(x())-0))
(7(=11)-2(1))
SRent (Az) = Σ E, edaU0
log Σ, ed200
- log Σ, c2(2())=(1)
(35)
E, (d(2(()) 2013
Σ -
A(2(0) - -20 - -log Σ (d(26)==00)
(36)
Σ, x(11
1
E
M(2(0) - =2a]]
(37)
E, E,e((66))=100
(as log Σ A(666) -1 /()(2(0) 2((((()2(1))) E o(1) when \ + oo)
Σ, e - zayy ( \22(2) -
1
X 12(2) =
(38)
E -12g)/(6(0 x(2(0) - -00 - =00)
where Eq. (38) holds
because
Ei>g A== (=="0>1)) (2()) - -211)/ (z(2)_
(2(2) - 20(1) E o(1) as A
Continuing the above argument, we
further have that as A + 00,
log(- Tog(-SRenl (Az)) ~ -log Σ (2(26))=21) + x22 - -00) + log (-X(=10)-
(39)
21

---

Published in Transactions on Machine Learning Research (10/2024)
The last two terms in Eq. (39) can be re-written -r + log(z). Since limg-+oo log(z) 0, we thus have -I + log(x) -x(1 (1)) as x + co, and hense -z x log(ar - by the
Let's write _
definition of the asymptotic equivalence. Therefore, we have:
log(-S (Az)) ~ - -log 1 + e =(()))) +x22(0)
- -2(1)
(40)
- + +(= 1(=(0)==0)) ~ M(x(2) - -0(1).
(41)
So we conclude that
SReat ~ exx - (1600~=011) as -
(42)
completing the proof.
0
C Evaluation metrics for OOD detection vs. evaluation metrics for generalized SC
The commonly used evaluation metrics for OOD delection do not reflect the classification performance (Franc et al. 2023b Here we provide a quantitative supporting example, in com- parison with the RC curve for generalized SC.
Table 5: Evaluation of 81 and 82 using pop- ular OOD metrics. The better numbers are highlighted bold.
OOD (mostly label-shift) detection formulated in Eq. (9) can be viewed binary classification problem: selected and jected samples form the two classes. So pioneer work on OOD
OOD metric
$1
82
AUROC (f)
0.765
0.944
detection, such as Henddrycks & Gimpel (2016), proposes to evaluate OOD detection in manner similar to that of binary classification, e.g., using the Area Under the Receiver Operat- ing Characteristic (AUROC) curve (Davis & Goadrich (2006) and Area Under the Precision Mecisiion-Realll Recall curve (AUPR) (Saito & Rehmsmeier 2015) to measure the scparability of In-D and OOD samples [T]] However, two important aspects are missing in OOD detection, and hence also its performance evaluation, if we are to focus on the performance on the accepted samples:
AUPR (t)
0.987
0.997
FPR@TPR=0.95 (1)
0.816
0.279
1. Pretrained classifiers do not always make wrong predictions on label-shifted samples, and honce these OOD samples should not be blindly rejected;
2. Tn-D samples that might have been correctly classified can be rejected due to poor separation of In-D and OOD) samples, leading to worse classification performance on the selected part.
To demonstrate our points quantitatively, we take the pretrained model EVA 15 from timm (Wightman 2019 that achieves > 88% top accuracy on the ImageNet validation set. We then mix ImageNet validation set (In-D samples) with ImageNet-O (OOD samples, label shifted) (Heudrycks & Dietterich 2018), and evaluate two score functions s and s: using both generalized SC formulation (via RC curves) and OOD detection (via AUROC and AUPR).
According to Table 5] $2 is considered superior to 81 by all metrics for OOD detection. Correspondingly, from Fig. 7 a) and (b), we observe that the scores of the label-shifted samples (green) and those of the In-D samples (blue and orange) are more separated by 82 than by $1. However, we also quickly notice one issue: In-D samples are not completely separated from OOD samples-a threshold intended to reject label-shifted samples will inevitably reject a portion of In-D samples at the same time, even though a large portion of In-D samples have been correctly classified (blue); In-D samples that can be correctly classified (blue) are less separated from those misclassified ones (orange) by 82 than by 81. This problem cannot revealed by the OOD metrics in Table 5 but is captured by the RC curves in Fig. 7(c) where the selection risk of 82 (blue) increases
OOD samples are rejected (TPR from 0.95 to 0.1 as indicated by the
14A singlo-point metric, False Pusitive Rate (FPR) 0.95 True Positive Rate (TPR), is also popularly used compan-
ion (Liang al. 2017 Wang ct al. 2022 Liu al. 2020 Djurisic al. 2022 Sun ct 2022 Yang et
See Appendix model Information.
model used experiments Section
16 31 our proposed RTcont-M and 82 VIM.
22

---

Published in Transactions on Machine Learning Research (10/2024)
TPR=0010
TPR=0
In-D mistake
OOD TPR-0.50
In-D mistake
OOD TPR=0
OnD
O0D TPR 96
000
oon TPR-D 95
0.47
TPR-0.10
TPR-0.50
TPR-q 96
10
10
Selection Rik
0.24
13'
0.1
0.9
Low
High
Low
High
Coverage
(a) 81 score distributions
(b) score distributions
(c) RC curves
Figure 7: Score distributions of $1 and 82 (a)-(b) and their RC curves (c). In (a) and (b), In-D samples that are correctly classified by EVA are shown in blue, while In-D samples that are incorrectly classified are shown in orange; OOD samples (label-shifted) are shown in green. The vertical dashed lines in (a)-(c) corresponds to different True-Positive-Raal cutofis in the AUROC metric in OOD detection.
vertical dashed lines). In contrast, the more samples rejected by 81 (smaller coverage), the lower the selection risk, implying that serves SC better.
Rejection patterns of different score functions
We plot in Fig. 8 the heatmap of the score values for each score function. During SC, samples located in the darker areas (with low score values) will be rejected before those located in the brighter areas (with high score values).
Decison boundary
Decison boundary
(a) REgooMM
(a) S.Rax
(b) SRan
(c) SRatctor
(d) RLmax
Figure 8: Heatmaps of rejection patterns (distribution of scores). Note that because we rescale the scores for good visualization, the colors are not cross-comparable between different, score functions.
E
Timm model cards
Table 6: Names of model cards in library timm to retrieve the models for ImageNet Model name
Dataset
Model card name
Top-1 Acc. (% )
EVA (VIT)
eva giant patch14 224.clip ft inlk
88.76
ImageNet
ConvNext
convnextv2 femae ft in22k inlk
86.25
VOLO
volo d4 224. sail inlk
85.56
ResNext
seresnextaal01d 32x8d.sw in12k ft inlk
85.94
Table shows the names of the model cards used retrieve the pretrained models for ImageNet from the timm library. Our considerations for choosing these models follows: (i) the models should cover
23

---

Published in Transactions on Machine Learning Research (10/2024)
wide range of recent and popular architectures, and (ii) they should achieve high top-1 accuracy to represent recent, advances of image classification.
F
Training details for ScNet
We use the unofficial PyTorch implementation 17 of the original SelectiveNet (Geifman & El- Sl-Yaniv 2019 due to the out-of-date Keras environment of the original repository [8] The PyTorch implementation follows the training method proposed in Geifman & El- Yaniv (2019) and faithfully reproduces the results of CIFAR-10
experiment reported in the original paper. We add the ImageNet experiment on top the PyTorch code, as it is not included in the original code or the paper. Table summarizes the koy hyperparamcters produce the results reported in this paper.
Table 7: Key hyperparameters for the ScNet training used in this paper Batch size
Dataset
Model architecture Dropout prob.
Target coverage
Total epochs
Lr (base)
Scheduler
CIFAR-10
VGG
0.3
0.7
128
300
0.1
StepLR
Inaegllet-1k
resnet34
N/A
CosineAmeelingL.
G Additional ImageNet experiments
We report in Fig. the RC curves of different score functions on models ConvNext, ResNext, and VOLO for ImageNett, and summarize their AURC statistics in Table
H Ablation experiments for the KNN score
We show in ig. 10 the SC performance of the KNN score on models EVA, ConvNext, ResNext, and VOLO, respectively, on ImageNet with all In-D and distribution-shiftee samples. We can observe that (i) the SC performance KNN is sensitive to the choice of hyperparamoter k, and (ii) our selection achieves the best SC performance for KNN score on our ImageNet task.
24

---

Published in Transactions on Machine Learning Research (10/2024)
Imagellet CovNext
Ri
RLyec-M QURC
Sh Alow
Alac-N
SR
SICC
Vin
SIC
Ploce
SRAC
Alewr
0.25
0.38
0.29
Selecton
0.0
0.5
1.0
0.0
0.5 Coverage
10
0,0
0.5 Goverage
10
0.0
0.5 Coverage
1,0
Coverage
ImageNet ResNext
SRew
RI
SReus
SRew
Anerg Vim
Al.
SR
Energy
SBRC
Rlowe
Vin
SICC
Vin
SPAC
SANC
Rlew
0.14
0,26
0.37
0.29
Selectin Rizk
Selection Rick
Selection Bick
Selection RICK
0.07
0.14
0.18
0.15
0.0
0.0
0.0
0.0
1.0
Coverage
Coverage
Coverage
Coverage
ImageNet VOLO
Rl
SRam
Ri
SReus
Rl
SRew PLax
Energy Vim
SR...
Rlgec
SR
Rla
RLas
SR
SRRC
RLewe
SWC
Vin
SPAC
SIRC
Rlew
0.14
0,29
0.37
0.31
Sclection Rixk
Selectin RIC
Selecioo Bick
Selectoo RISk
0.07
0.15
0.18
0.15
0.0
0.5 Coverage
0.0
1.0
0.0
1.0
0.0
1.0
Coverage
Coverage
Coverage
In-D (ImageNet)
In-D + Shift (Cov)
In-D + Shift (Label)
In-D + Shift (both)
Figure 9: RC curves of different confidence-score functions on models ConvNext, ResNext and VOLO from for ImageNet. The four columns are RC curves evaluated using samples from In-D only, In-D and covariate-shifted only, In-D and label-shifted only, and all, respectively. We group the curves by whether they are originally proposed for SC (solid lines) for OOD detection (dashed lines).
EVA
ConvNext
ReeNext ==
VOLO
km1
kmb
2mb
20
km
20
2-2
1=10
2-2
2-10
k=2
10
k-2
k=10
Solection RIX
Selection RIX
Solection Bua
Selection Rick
0,27
0.0
0.5
1.0
0.0
1.0
0.0
1.0
0.5 Coverage
1.0
Coverage
Coverage
Coverage
Figure 10: RC curves achieved by the KNN score with different & on ImageNet
25

---

Published in Transactions on Machine Learning Research (10/2024)
The AURC numbers are the 10-2 scale-the lower, the better. The score functions proposed for SC are highlighted in gray, and the rest are originally for OOD detection. The best AURC numbers for each coverage level are highlighted in bold, and the 2nd and 3rd best scores are underlined, Imageliet Noxy
Table 8: Summary of AURC-o for Fig. 9
In-D
In-D + Shift (Cov)
In-D Shift (Label)
In-D Shift (both)
0.1
0.5
0.1
0.5
0.1
0.5
0.1
0.5
RIconfMM
0.10
0.53
3.02
0.26
1.76
8.20
0.58
2.51
11.8
0.34
1.99
8.88
RlgooMM SIRC
0.15
0.59
3.10
0.31
1.75
8.14
0.75
2.51
11.8
0.38
1.97
8.81
1.96
1.70
3.59
3.44
3.23
8.60
5.94
1.03
11.3
3.76
3.46
9.18
SRmax
2.26
1.86
3.66
3.73
3.40
8.70
5.86
4.05
11.4
4.04
3.62
9.26
SRem.
2.77
2.44
4.19
4.78
4.33
9.54
6.83
4.85
11.6
5.13
4.56
10.1
S Ratontor
2.26
1.86
3.67
3.73
3.41
8.74
5.86
4.06
11.3
4.04
3.63
9.29
Rlmaax
5.43
4.77
5.81
9.05
7.89
11.6
10.5
7.73
13.2
9.45
8.13
12.1
Energy
6.66
6.70
7.54
10.9
10.7
13.9
11.9
9.78
14.6
11.3
10.9
14.3
KNN
1.01
2.37
5.72
1.29
4.54
1TI1
3.66
12.0
1.31
4.59
VIM
15.1
9.84
9.49
16.2
11.9
14.3
14.1
9.57
14.5
16.2
11.9
14.7
InageNet ResNext
R.oonf-MM
0.12
0.59
3.17
0.29
2.15
9.38
0.59
3.22
12.8
0.38
2.50
10.2
R.ggo-M
0.17
3.18
0.34
2.14
9.33
0.65
3.16
12.7
2.49
10.1
SIRC
1.71
1.91
3.91
3.96
4.18
9.99
7.77
5.88
13.1
4.47
4.57
10.7
R
2.28
2.26
4.11
4.88
4.69
10.3
7.44
5.88
12.9
5.36
5.06
11.0
S.
3.38
3.42
5.37
6.92
6.94
12.2
9.46
7.70
13.9
7.47
7.36
12.8
Rdoctor
2.29
2.28
4.17
4.92
4.75
10.4
7.47
5.92
12.8
5.39
5.12
11.1
RLmax
1.57
2.34
4.79
2.98
4.82
10.9
2.37
3.83
11.9
3.06
5.00
11.4
Energy
3.08
3.90
6.17
5.13
7.20
12.7
3.68
5.34
13.2
5.19
7.37
13.2
KNN
3.23
4.84
7,61
4.12
7.65
13.6
3.40
5,85
13.5
4.14
7.77
14.0
VIM
4.68
6.13
7.79
6.18
8.81
13.6
5.09
6.82
13.6
6.23
8.92
14.1
Imagelet VOLO
R.cootMM
0.31
0.79
3.44
0.46
2.24
9.72
1.30
3.79
13.3
0.68
2.67
10.6
Rlgeo
0.37
3.46
2.23
9.73
0.94
3.56
SIRC
1.27
1.44
3.74
1.35
2.82
9.56
2.68
3.97
12.9
1.90
3.37
10.5
S R.aax
1.31
1.42
3.72
1.33
2.82
9.59
2.54
3.78
12.7
1.86
3.36
10.5
SRent
1.47
1.59
3.83
1.58
3.13
9.72
2.71
3.87
12.4
2.13
3.69
10.6
SRaoctor
1.31
1.42
3.71
1.33
2.82
9.55
2.54
3.78
12.7
3.36
R.maxx
4.92
4.51
6.18
6.32
7.13
12.5
6.37
6.82
13.8
7.07
7.84
13.4
Energy
5.21
4.99
6.84
6.88
8.24
13.5
6.70
7.37
14.3
7.62
8.95
14.4
KNN
2.18
3.29
6.23
2.10
5.03
11.7
2.27
4.85
13.7
2.15
5.26
12.3
ViM
9.38
10.7
11.9
9.04
12.0
16.5
10.4
13.5
21.1
9.22
12.4
17.3
26


Reviews:
[{"review_id": "7fnejxjzVi", "reviewer": "Reviewer_YPt5", "summary": "", "questions": "", "limitations": "", "rating": null, "confidence": null, "soundness": null, "presentation": null, "contribution": null, "strengths": "", "weaknesses": "", "quality": null, "clarity": null, "significance": null, "originality": null, "strengths_and_weaknesses": "This work's main asset is the relevance of the problem setting considered in this work for the community. Moving beyond the same train and test setting is important to make ML methods work in practice. That being said, this work is very hard to follow. It is very unclear what the actual contribution is. The problem description is somewhat meandering. I am not sure if this work is proposing new algorithms, new metrics, or how are these metrics used to improve algorithmic performance. This may be just a matter of better writing.", "was_revised": false, "final_justification": "", "rebuttal": "", "claims_and_evidence": "Yes", "methods_and_evaluation_criteria": "", "theoretical_claims": "", "experimental_designs_or_analyses": "", "relation_to_broader_scientific_literature": "", "essential_references_not_discussed": "", "other_strengths_and_weaknesses": "", "other_comments_or_suggestions": "", "questions_for_authors": "", "summary_of_paper": "", "summary_of_recommendation": "", "technical_quality": "", "clarity_of_presentation": "", "potential_impact": "", "robotics_focus": "", "quality_of_limitations": "", "questions_for_rebuttal": "", "reasons_to_accept": "", "reasons_to_reject": "", "questions_to_authors": "", "paper_topic_and_main_contributions": "", "excitement": null, "reproducibility": null, "ethical_concerns": "", "main_review": "", "summary_of_the_paper": "", "summary_of_the_review": "", "strength_and_weaknesses": "", "limitations_and_societal_impact": "", "review_text": "", "summary_of_contributions": "This work introduces the concept of generalized selective classification where the objective is to build a classifier and a filtering rule to ensure the best performance tradeoff between classifier accuracy over selected samples and sample coverage. The twist in this work is the authors instead consider a domain adaptation scenario where the objective is to trade off these possibly competing objectives in a test set that may come from a different distribution than training. The considered domain shifts are both at the level of label shift (possibly interacting with a larger label set than during train) or covariate shift. Apparently the main contributions of this work is to introduce two score functions for this setting, $RL_{geo-M}$ and $RL_{conf-M}$ inspired by margin based classification ideas showing existing nontraining-based score functions for OOD detection do not perform well for generalized SC in comparison with these metrics. The authors then support these claims via an extensive experimental evaluation.", "claims_and_evidence_yn": "Yes", "claims_explanation": "", "audience_yn": "Yes", "audience_explanation": "", "requested_changes": "I would strongly suggest the authors to improve the writing in their manuscript. As is, it is very hard to understand what are the contributions of this work. I understand one of the objectives is to introduce generalized selective classification. It is not clear to me what is the downstream objective here, as it stands it seems to be to select a threshold (or other kind of filtering rule) to ensure the best tradeoff between filtering probability and accuracy. Because of this I don't fully understand the role of the RC curves in all this analysis. If these things could be made clearer I would be more supportive of this paper. I think the contributions may be sufficient to warrant a TMLR publication but I would like to see my concerns addressed.", "broader_impact_concerns": "No broader impact concern", "additional_comments": "", "extra_scores": {}, "extra_text": {}}, {"review_id": "LMv3eS5wCU", "reviewer": "Reviewer_HfXr", "summary": "", "questions": "", "limitations": "", "rating": null, "confidence": null, "soundness": null, "presentation": null, "contribution": null, "strengths": "", "weaknesses": "", "quality": null, "clarity": null, "significance": null, "originality": null, "strengths_and_weaknesses": "Strengths:\n\n* The authors choose to address an important, practically beneficial, and seemingly underexplored setting for selective classification, where we do not assume that samples are necessarily in-distribution.\n* The experiments span a variety of model architectures, as well as two data modalities, which instills confidence in the proposed approaches' generality.\n* The proposed methods are applied post-training, which allows for easier adoption \n\n\nWeaknesses:\n* I am not convinced of the authors' claim of novelty. A **[NeurIPS workshop paper](https://openreview.net/forum?id=FiqXqKR26c)** from 2023 seems to have notable overlap, though the submitted work is much wider in scope.\n* Limited explanation and analysis of the empirical results. Many unanswered questions about differences in different SC methods' performances across different tasks/datasets and potential impact of aspects of overall task \"difficulty\"", "was_revised": false, "final_justification": "", "rebuttal": "", "claims_and_evidence": "Yes", "methods_and_evaluation_criteria": "", "theoretical_claims": "", "experimental_designs_or_analyses": "", "relation_to_broader_scientific_literature": "", "essential_references_not_discussed": "", "other_strengths_and_weaknesses": "", "other_comments_or_suggestions": "", "questions_for_authors": "", "summary_of_paper": "", "summary_of_recommendation": "", "technical_quality": "", "clarity_of_presentation": "", "potential_impact": "", "robotics_focus": "", "quality_of_limitations": "", "questions_for_rebuttal": "", "reasons_to_accept": "", "reasons_to_reject": "", "questions_to_authors": "", "paper_topic_and_main_contributions": "", "excitement": null, "reproducibility": null, "ethical_concerns": "", "main_review": "", "summary_of_the_paper": "", "summary_of_the_review": "", "strength_and_weaknesses": "", "limitations_and_societal_impact": "", "review_text": "", "summary_of_contributions": "The authors present a method for selective classification (SC) under distribution shifts based on confidence-score functions applied post-training on raw logits in DNN models. Their proposed method for SC uses notions of a confidence margin for selecting samples to reject, and is intended to cover not only in-distribution examples but also label-shifted and covariate-shifted samples. The authors analyze rejection patterns in a toy example which they also use to show that their proposed method does not suffer from the scale invariance issues seen in softmax response-based scores. Empirical performance is also shown on various multiclass classification tasks (mostly image classification as well as one text classification task) and across multiple pre-trained model architectures. Overall, the geometric margin and confidence margin scores they propose are shown to perform comparably or better than existing softmax response-based scores.", "claims_and_evidence_yn": "Yes", "claims_explanation": "", "audience_yn": "Yes", "audience_explanation": "", "requested_changes": "* Figure 3 and its integration with the text could be greatly revised for clarity. The current arrangement seems to be mostly for space efficiency (?). One suggestion -- color-coding different groups of subfigures and matching them with relevant tags in caption and body text could help, if allowed by the journal. I do feel quite strongly about this one, but am willing to be vetoed if others feel this is not a critical change\n* Addressing the weaknesses above: I feel the first is quite critical. \n* The second weakness is also important to me, but I would be happy with partial coverage. I am especially interested in seeing discussion explicitly addressing the seemingly dramatic differences between ImageNet and non-ImageNet results, where only ImageNet very clearly benefits from the proposed methods", "broader_impact_concerns": "General broader impacts are already described in intro, but it would be good to also discuss implications relating to https://arxiv.org/abs/2010.14134", "additional_comments": "", "extra_scores": {}, "extra_text": {}}, {"review_id": "f0SpnxIqJ0", "reviewer": "Reviewer_rQhf", "summary": "", "questions": "", "limitations": "", "rating": null, "confidence": null, "soundness": null, "presentation": null, "contribution": null, "strengths": "", "weaknesses": "", "quality": null, "clarity": null, "significance": null, "originality": null, "strengths_and_weaknesses": "##Strengths\n- Considering both label-shifted and covariate-shifted samples in the selective classification (SC) problem is practical, and this paper is the first to address this.\n- The proposed margin-based score functions are shown to be effective for rejection purposes and are insensitive to the scaling factor.\n- The paper is well-written with clear logical organization.\n##Weaknesses\n- Analyzing the scaling sensitivity of previous score functions is trivial, as this is widely known. A more important question is why scaling sensitivity is crucial for the SC problem. In practice, we often use a standard softmax classifier in deep networks without further scaling.\n- When introducing the new setting to SC, it is unclear why rejecting covariate-shifted samples is appropriate, as there are cases where correct classification despite covariate shift is necessary. The differences between generalized SC, open-set recognition, and out-of-distribution (OOD) detection should be clarified.\n- On Page 20, Equation (39), $\\log(-\\lambda(z^{(2)}-z^{(1)}))$ appears to approach $\\infty$ as $\\lambda \\rightarrow \\infty$. How is Equation (40) derived from this?", "was_revised": false, "final_justification": "", "rebuttal": "", "claims_and_evidence": "Yes", "methods_and_evaluation_criteria": "", "theoretical_claims": "", "experimental_designs_or_analyses": "", "relation_to_broader_scientific_literature": "", "essential_references_not_discussed": "", "other_strengths_and_weaknesses": "", "other_comments_or_suggestions": "", "questions_for_authors": "", "summary_of_paper": "", "summary_of_recommendation": "", "technical_quality": "", "clarity_of_presentation": "", "potential_impact": "", "robotics_focus": "", "quality_of_limitations": "", "questions_for_rebuttal": "", "reasons_to_accept": "", "reasons_to_reject": "", "questions_to_authors": "", "paper_topic_and_main_contributions": "", "excitement": null, "reproducibility": null, "ethical_concerns": "", "main_review": "", "summary_of_the_paper": "", "summary_of_the_review": "", "strength_and_weaknesses": "", "limitations_and_societal_impact": "", "review_text": "", "summary_of_contributions": "This paper introduces a novel framework for selective classification, termed generalized selective classification, which encompasses both label-shifted and covariate-shifted samples. Additionally, the paper presents two margin-based score functions tailored for this task, demonstrating their advantages in experiments compared to previously used score functions.", "claims_and_evidence_yn": "Yes", "claims_explanation": "", "audience_yn": "Yes", "audience_explanation": "", "requested_changes": "1. Clearly define the learning setting of generalized SC and provide a comparison to related problems such as OOD detection, OOD generalization, and open-set recognition.\n2. Explain why the scaling factor is crucial for the SC problem.\n3. Carefully review the paper for mathematical proofs and typos.", "broader_impact_concerns": "No.", "additional_comments": "", "extra_scores": {}, "extra_text": {}}]

Author rebuttal:

Meta-review: The primary concerns revolve around issues of presentation -- writing, clarifying contributions, explaining results, revising figures.  Otherwise, two of three reviewers (the more engaged reviewers) lean in favor of acceptance so these revisions can be verified.
Decision: Accept (poster)