Abstract
Modern image classifiers are very accurate, but the predictions come without uncertainty estimates. Conformal predictors provide uncertainty estimates by computing a set of classes containing the correct class with a user-specified probability based on the classifier's probability estimates. To provide such sets, conformal predictors often estimate a cutoff threshold for the probability estimates based on a calibration set. Conformal predictors guarantee reliability only when the calibration set is from the same distribution as the test set. Therefore, conformal predictors need to be recalibrated for new distributions. However, in practice, labeled data from new distributions is rarely available, making calibration infeasible. In this work, we consider the problem of predicting the cutoff threshold for a new distribution based on unlabeled examples. While it is impossible in general to guarantee reliability when calibrating based on unlabeled examples, we propose a method that provides excellent uncertainty estimates under natural distribution shifts, and provably works for a specific model of a distribution shift.
Introduction
Modern deep learning classifiers often suffer from overconfidence, assigning high probabilities to incorrect classes. Conformal Prediction (CP) addresses this by generating a prediction set guaranteed to contain the true label with a user-defined probability (e.g., 90%). However, this guarantee relies on the assumption that the test data follows the same distribution as the labeled calibration set. When a distribution shift occurs—such as moving from clean laboratory images to real-world sketches—this guarantee often fails. In many practical scenarios, we have access to unlabeled data from the new distribution but lack the ground truth labels required for standard recalibration.
The QTC Method
The proposed solution, Quantile Thresholded Confidence (QTC), recalibrates conformal predictors using only unlabeled examples from the target domain. QTC operates on the principle that while labels are missing, the distribution of the model's confidence scores (softmax outputs) provides a signal about the shift.
The QTC workflow involves two primary steps:
- Estimating an auxiliary parameter (β): QTC estimates a value β, representing the coverage level required on the source data to achieve the target coverage on the new distribution. This is done by aggregating two estimators: QTC-Target (based on target score quantiles) and QTC-Source (based on the proportion of target samples below a source-derived threshold).
- Recalibration: Using the estimated β, a new threshold is derived from the original labeled calibration set.
Experimental Evaluation
The effectiveness of QTC was evaluated across several benchmarks representing different types of shifts:
- ImageNet Variants: ImageNetV2, ImageNet-Sketch, and ImageNet-R.
- BREEDS: Testing subpopulation shifts (e.g., training on domestic cats, testing on wild cats).
The results demonstrate that QTC significantly closes the coverage gap. For instance, on ImageNet-Sketch, standard CP coverage dropped to 38%, while QTC restored it to 84%. On the BREEDS "Living-17" dataset, coverage improved from 55% to 93%, nearly matching the performance of an "Oracle" with access to labels.
Discussion and Conclusion
The success of QTC stems from the observation that the relationship between confidence scores and accuracy is often preserved across natural shifts. By tracking score quantiles and using a robust aggregation of estimators, QTC provides a "safety net" against neural network overconfidence. While no method can guarantee reliability for arbitrary shifts without labels, QTC offers a practical and effective solution for many real-world distribution shifts where the model's confidence remains informative.
Reference: Yilmaz, F. F., & Heckel, R. (2023). Test-time recalibration of conformal predictors under distribution shift based on unlabeled examples. arXiv:2210.04166v2 [cs.LG].
Summary updated