Manuscript Offprint

arXiv:2610.25349

Predicted Class Correction: Conformal Thresholds for Classes with No Calibration Data

One Octadion, Novanto Yudistira, Yuta Nakashima

Abstract

Class-conditional conformal prediction calibrates a separate score threshold for every class and therefore requires labelled calibration examples of every class. In long-tailed deployments these examples are precisely what is missing, as most rare classes are consumed by training and are left with few or no held-out examples. Existing class-conditional methods are then either undefined for such a class or fall back to the shared marginal threshold. We ask whether the per-class correction can instead be predicted from descriptors of the class that require no labels at all. We propose Predicted Class Correction (PCC), which regresses the offset between the per-class and the marginal conformal quantile on geometric descriptors of the classifier head, shrinks the prediction by a scalar selected on the labelled classes, and refits a single marginal offset. The descriptors are functions of the model's weights, so a class with zero calibration examples still receives a threshold specific to it, and only one scalar is calibrated, so split conformal's marginal guarantee is retained on the label space it is calibrated on (Prop. 2). On ImageNet, PCC improves worst-class coverage on such classes by 0.058 [0.006, 0.110] at matched average set size, 42% of an oracle that observes the test labels. Of eight baselines run on the same splits, six change the statistic by exactly zero and the best reaches 0.016 with an interval containing zero, so PCC is the only one whose improvement is distinguishable from none; two of the eight are undefined on all 300 classes. The improvement persists with only 100 labelled classes out of 1000. A second finding concerns how such methods are evaluated. Worst-class coverage becomes unmeasurable before it becomes unachievable: below roughly 35 test examples per class no improvement can be demonstrated even for an oracle given the test labels, so a null result there is a property of the evaluation set rather than of the method. Most classes of both long-tailed benchmarks sit below it, and restricting evaluation above it recovers a significant improvement on

held out, ny=0n_{y}=0

its three nearest rows in the head

Figure

radio

cassette player

tape player

loudspeaker

φ(y)\varphi(y) from the head weights →gθ→λδ^y=+0.013\rightarrow g_{\theta} \rightarrow \lambda \hat{\delta}_{y} = +0.013

threshold q^=0.9657→0.9812\hat{q}=0.9657 \rightarrow 0.9812

Figure

coverage of class 754, radio

Figure 1. A class with no calibration example still receives a threshold of its own. ImageNet class 754 is held out, so ny=0n_y = 0: every classwise method either leaves it undefined or hands it the shared marginal threshold. Its descriptor φ(y)\varphi(y) is read from the classifier head, whose three nearest rows to it are other audio equipment, and the fitted regression turns that geometry into an offset. The threshold moves from q^=0.9657\hat{q} = 0.9657 to 0.9812 and coverage of the class from 0.658 to 0.750, against 0.803 for an oracle given the test labels. The class shown is the held-out class with the lowest coverage under the marginal threshold, fixed by that rule before any image was looked at.

Pl@ntNet-300K, where the effect had appeared absent.

1. Introduction

A prediction set replaces one fallible prediction with a short list that is likely to contain the true label. Conformal prediction turns any trained classifier into such a procedure, with a finite-sample coverage guarantee and no assumptions on the data distribution [1, 39, 46].

The guarantee that comes for free is marginal: aver-

∗^{*}Corresponding author.

aged over all inputs, the set contains the true label with probability at least 1−α1 - \alpha. Since marginal coverage is a prevalence-weighted average of the class-conditional coverages, it is dominated by the frequent classes, and a single shared threshold systematically under-covers the hard and rare ones, and coverage conditional on every input is unattainable in finite samples without further assumptions [4, 27]. In biodiversity monitoring and in diagnosis the rare classes are often the ones that matter most, so the label a user most needs to see is the one the set most often omits. Recovering per-class control requires calibrating a separate threshold for each class, which is what classwise conformal prediction [38, 45, 46] and its successors [11, 12, 41] do.

Those methods all require labelled calibration examples of the class whose threshold they are setting. In long-tailed deployments [47] most rare classes are consumed by model training, which, as Ding et al. [12] note, leaves them with “few or zero holdout examples to use for calibrating uncertainty quantification methods.” The zero case is common: the median class has three held-out examples on Pl@ntNet-300K [16] and two on iNaturalist-2018 [44]. What existing methods do with such a class is summarised in Tab. S1 of the supplementary material. CLASSWISE CP and RC3P return an infinite threshold, so the set becomes the entire label space; CLUSTERED CP falls back to the shared marginal threshold; and the kernel-weighted method of Ding et al. [12] embeds each class by its own calibration scores, so classes with none collapse to a single point and share one threshold. None of this is unreasonable, since with no labelled example of a class there is nothing to condition on.

Objective. Something about a class is nevertheless known without any of its labels. A trained classifier already places every class somewhere in its output geometry: the row of the classifier head that scores class y has a norm and a bias, and it sits at some set of distances from the rows of competing classes. Crowded rows correspond to classes that are easily confused and therefore hard to cover. These quantities are available for a class with zero calibration examples, since they are determined by the model's parameters and do not involve any sample. Our goal is to use them to assign such a class a threshold that is specific to it, while keeping the marginal coverage guarantee that split conformal prediction provides. Figure 1 shows one such class.

Our approach. Predicted Class Correction (PCC) proceeds in three steps (Algorithm 1). On the classes that do have calibration data we observe the offset δy\delta_{y} between the per-class conformal quantile and the marginal one, and fit a ridge regression of δy\delta_{y} on the descriptors φ(y)\varphi(y). We then apply the fitted regression to every class, including those with no data, and shrink its output by a factor λ\lambda chosen on the labelled classes only. Finally we refit one scalar offset so that marginal coverage returns to its target. The shrinkage step does substantial work here, since worst-class coverage is governed by the largest error in the predicted offset, which its average error does not control, so applying the raw prediction at full strength is harmful (Tab. 2).

Summary of findings. We evaluate on ImageNet [37], two long-tailed datasets [16, 44], three backbones, four score functions and 15 corruption types [22], for a total of 412 configurations. (i) On ImageNet classes with zero calibration examples, PCC improves worst-class coverage by 0.058 [0.006, 0.110] at matched average set size and is the only one of nine methods whose interval excludes zero; six of the eight baselines change the statistic by exactly zero (Tab. 1). (ii) Few classes need to be labelled for this to work: holding out 90% of classes, which leaves 100 labelled classes out of 1000, still yields 0.052 with a confidence interval excluding zero, and our protocol's floor is p+2p + 2 labelled classes for p descriptors (Figure 2b). (iii) Below roughly 35 evaluation examples per class, an oracle that observes the test labels cannot improve worst-class coverage either, so what disappears there is the room to improve and not the ability to take it (Figure 2a). This one axis accounts for all four settings in which the method initially appeared to fail, and restricting evaluation above the threshold recovers a significant improvement on Pl@ntNet-300K, though not on iNaturalist-2018.

References (45)