Confidence Estimates That Stay Honest When the Detector Drifts

A classifier's softmax score is a poor guide to whether a particular prediction is wrong. A useful fix is to train a second, small network to predict the true class probability: the probability the classifier assigned to the correct label. This number is low exactly when the classifier is wrong. In precision science, though, the data a classifier sees at deployment differ from its training simulation by nuisance parameters: continuous, imperfectly known knobs such as pileup level, calibration offsets, or background modeling choices. The classifier's error rate genuinely changes as these knobs turn. We propose to train the confidence network so that its error estimates remain correct at every setting of the nuisance parameter, even though that setting is never observed at test time. Concretely, among events assigned confidence $c$, the actual correctness should match $c$ whether the nuisance is low or high.

The obvious move at this intersection is to borrow adversarial "pivoting" from physics and make the confidence score statistically independent of the nuisance. We argue this is the wrong target, and we plan to show it empirically. If high pileup really causes more mistakes, a confidence score that ignores pileup is wrong by construction. The right requirement is weaker and different. The gap between the true class probability and the predicted confidence should carry no information about the nuisance. This constraint does not collapse to a constant score, it permits legitimate nuisance dependence, and the adversary's leftover success becomes a direct, reportable estimate of the residual systematic uncertainty on predicted error counts.

Core Claim

Let $f$ be a frozen classifier and $c(x)$ an auxiliary confidence network trained to regress $\mathrm{TCP}(x)=f(x)_{y^*}$, the classifier's probability on the true label $y^*$. Let $Z$ be a continuous nuisance parameter that is varied in simulation but unknown in real data. Pivoting would demand $c(X)\perp Z$. We instead demand nuisance-conditional calibration of the residual:

$$\mathbb{E}\left[\mathrm{TCP}(X)-c(X)\mid c(X),Z=z\right]=0 \quad \text{for all } z \text{ in the nuisance range}.$$

We enforce this with an adversary $a(c,z)$ that sees the confidence value and the true nuisance and tries to predict the residual $\mathrm{TCP}-c$. The confidence network is penalized by how much the adversary beats a zero prediction in mean squared error. A constant $c$ cannot satisfy this whenever accuracy varies with $Z$, because the adversary would then predict the residual from $z$ alone. Unlike the pivot, the constraint therefore pushes $c$ to absorb the nuisance-driven part of the error signal through features of $x$, rather than to discard it. The adversary's residual gain at convergence, maximized over the nuisance prior range, gives a measured envelope on how far the sum of predicted errors in a selected sample can be off when $Z$ is unknown. In particle physics, this sum is essentially a mistag-rate estimate.

Relation to Prior Work

ConfidNet (Addressing Failure Prediction by Learning Model Confidence, extended in Confidence Estimation via Auxiliary Models) supplies the method we build on. It regresses the true class probability with a frozen classifier and squared-error loss, and it beats the softmax maximum on failure ranking. Its extension, ConDA, adds an adversary that aligns confidence maps between a source and a target domain. That adversary handles a binary domain label and aims for distributional similarity. We handle a continuous nuisance and aim for conditional calibration, which permits the confidence distribution to differ across $z$.

The pivot work of Learning to Pivot with Adversarial Networks and Decorrelated jet substructure tagging using adversarial neural networks supplies the adversarial machinery and the motivating evidence that robustness to systematics improves discovery power. Both enforce full independence of the classifier score from $Z$. They are also the source of our main design constraint: the pivot paper notes that independence destroys power when $Z$ is truly tied to the target. For a failure predictor, $Z$ is typically tied to the target, since the error rate depends on pileup.

Two failure-prediction papers constrain how we evaluate. Rethinking Confidence Calibration for Failure Prediction and Revisiting Confidence Estimation: Towards Reliable Failure Prediction show that global calibration tricks can hurt failure ranking. We therefore report ranking and calibration separately and treat any ranking loss as a cost.

Frequentist Uncertainties on Neural Density Ratios with wifi Ensembles motivates the goal of turning model misspecification into a quantified error bar. It does this for statistical uncertainty on density ratios. We do it for the systematic part of a per-event error estimate.

Research Program

The work has three parts.

The first part is the training recipe. The classifier is trained and frozen, with or without its own pivot. The confidence network is trained on held-out simulation generated across the nuisance range. This choice also eases the known scarcity of training errors: shifted nuisance settings produce many more misclassified examples than the classifier's own near-perfect training set. The adversary $a(c,z)$ is a small network. Because it regresses a bounded scalar residual rather than a full nuisance distribution, we expect it to be easier to balance than the mixture-density adversary of the pivot paper. We will test that expectation, not assume it. The penalty weight is swept, and a held-out selection rule is fixed in advance.

The second part is analysis. We characterize when the constraint is satisfiable without ranking loss. Our hypothesis is that it is satisfiable whenever the nuisance's effect on errors is recoverable from $x$, which holds for measured-correlated quantities like pileup. It should be costly when $Z$ is a pure simulation-mismodeling knob with no visible signature. For that second case we test whether the reported residual envelope correctly widens instead of silently failing.

The third part is the downstream readout. For any selection threshold, the predicted error count is the sum of $1-c$ over selected events. We compare this prediction, and its residual envelope, against the true count at each nuisance value.

Baselines

The naive reference point is the classifier's maximum softmax probability, used directly as confidence. On CIFAR-100 with VGG-16, the ConfidNet paper reports AUPR-Error of 71.99% for this score, against 73.68% for ConfidNet. Temperature scaling of this score is included for calibration metrics only, since it cannot change rankings.

The strongest existing method is ConfidNet trained on nuisance-varied held-out simulation with no adversary. This "augmentation-only" baseline is the most dangerous competitor. It sees exactly the same data and nuisance coverage as our method and differs only in the penalty. It gets the same architecture, data, and hyperparameter budget, and its checkpoint is chosen by the same held-out rule. To count as beating it, our method must lower worst-nuisance-slice calibration error and predicted-error-count bias at the extremes of the nuisance range, while losing no more than about one AUPR-Error point on pooled ranking. No reported result was found on Lacuna for nuisance-sliced calibration of any confidence estimator, so these baseline numbers will be produced here.

A second strong competitor is the pivoted confidence network: the obvious idea, an adversary predicting $Z$ from $c(x)$ in the Louppe et al. style, given the same budget. We expect it to lose on per-slice calibration whenever accuracy depends on $Z$.

The flat-minima method of Rethinking Confidence Calibration for Failure Prediction is the strongest ranking-only baseline. It reports CIFAR-10 ResNet-110 AUROC of 93.76% against 90.76% for the baseline. We run it with the same backbone to check whether better ranking alone fixes nuisance bias.

An oracle confidence network that receives $Z$ as an input gives an upper bound for cases where the nuisance is measurable. The key ablation swaps the residual adversary for the independence adversary while holding everything else fixed. This isolates the choice of constraint.

Why not just…?

Why not just calibrate the softmax score with temperature scaling? Temperature scaling is a single monotone map, so it cannot change failure rankings. Fitted on pooled simulation, it gives one correction for all nuisance values, so it cannot track an error rate that moves with $Z$. The failure-prediction literature also shows that stronger calibration methods such as label smoothing reduced CIFAR-10 failure AUROC by over 9% (Rethinking Confidence Calibration for Failure Prediction). We include it as a baseline and expect it to show the largest slice bias.

Why not just train ConfidNet on simulation spanning all nuisance values? This is the real threat. Augmentation alone may achieve marginal calibration, and if the network sees enough of the nuisance range it may also achieve conditional calibration. Our argument is only that squared-error training on pooled data puts little weight on sparse extremes of $Z$, where residuals can hide. The augmentation-only baseline settles this directly. If its worst-slice bias matches ours within seed variance across all three benchmarks, the adversary is unnecessary and we will report that as the finding.

Why not just make the confidence score a pivot, as physicists do for classifiers? Independence from $Z$ forbids the confidence from tracking a real, nuisance-driven change in error rate. The pivot paper itself warns that enforcing independence fails when $Z$ is correlated with the target (Learning to Pivot with Adversarial Networks). The matched ablation tests this. In settings where errors do not depend on $Z$, the pivot and our constraint should agree, and that agreement is our sanity check.

Why not just use deep ensembles or split conformal prediction? Under distribution and physics shifts, Calibrated Physics-Informed Uncertainty Quantification reports that ensemble and dropout coverage fell from a 90–95% target to 30–40%. The wifi paper finds that naive ensembles under-cover. Split conformal guarantees only marginal coverage averaged over the calibration mix, not coverage at each nuisance value. We run a five-member ensemble at matched compute as a further baseline.

Proposed Experiments

We start with the synthetic 2D Gaussian with a continuous nuisance shift from the pivot paper, regenerated so that the classifier's accuracy depends on $Z$ by a controllable amount. A zero-dependence variant serves as the control. There, the residual-free target can be computed exactly, so we can verify the constraint and the residual envelope against ground truth.

We then move to the W-jet versus QCD task under pileup from the same paper, where the reported AMS is about 7.8 for the pivoted classifier and about 7.0 for the standard one. We use both a standard and a pivoted frozen classifier, since the pivot lowers accuracy and so creates more errors to flag. We add the resonance tagging setting with jet mass as nuisance from Decorrelated jet substructure tagging using adversarial neural networks, which reports 3.67σ against 2.82σ for adversarial versus standard taggers. To test transfer outside physics, we use CIFAR-100 with VGG-16, the setting of ConfidNet's 73.68% AUPR-Error. On CIFAR-100 we apply a continuous corruption severity of our own construction as the nuisance.

Metrics are AUPR-Error and AUROC, both pooled and per nuisance slice, and a worst-slice expected calibration error of $c$ against correctness. For physics tasks we add the relative bias of predicted versus true error counts above fixed selection thresholds as a function of $Z$, and whether the reported residual envelope covers that bias. Training uses a grid of nuisance values. Testing includes held-out interior values and, separately, values slightly beyond the training range, which we treat as an expected-failure regime.

The decisive outcomes are four. First, the independence-adversary ablation must show worse per-slice calibration than ours on the dependent toy, and the two must agree on the control. Second, we must beat augmentation-only on worst-slice count bias on at least the two physics tasks without a ranking loss beyond one point; otherwise we report the negative result. Third, the residual envelope must widen, rather than stay misleadingly small, when $Z$ is made invisible in $x$. Fourth, gains must persist when the frozen classifier is itself pivoted, which is the regime where per-event failure flags matter most.