Abstract
We propose a framework for learning calibrated uncertainties under domain shifts, where the source (training) distribution differs from the target (test) distribution. We detect such domain shifts via a differentiable density ratio estimator and train it together with the task network, composing an adjusted softmax predictive form concerning domain shift. In particular, the density ratio estimation reflects the closeness of a target (test) sample to the source (training) distribution. We employ it to adjust the uncertainty of prediction in the task network. This idea of using the density ratio is based on the distributionally robust learning (DRL) framework, which accounts for the domain shift by adversarial risk minimization. We show that our proposed method generates calibrated uncertainties that benefit downstream tasks, such as unsupervised domain adaptation (UDA) and semi-supervised learning (SSL). On these tasks, methods like self-training and FixMatch use uncertainties to select confident pseudo-labels for re-training. Our experiments show that the introduction of DRL leads to significant improvements in cross-domain performance. We also show that the estimated density ratios align with human selection frequencies, suggesting a positive correlation with a proxy of human perceived uncertainties.
Introduction
Deep learning models are notoriously overconfident, often making incorrect predictions with high certainty. This issue is exacerbated during domain shift—when the target (test) distribution differs from the source (training) distribution. For instance, a model trained on synthetic images may struggle when deployed on real-world photos. This overconfidence is a significant barrier for unsupervised domain adaptation (UDA) techniques like self-training, where models generate "pseudo-labels" for unlabeled data. If a model is overconfident about an incorrect prediction, it injects noise into the training process, leading to a cycle of error propagation.
Methodology: Distributionally Robust Learning (DRL)
To address this, the authors propose a Distributionally Robust Learning (DRL) framework. Instead of standard empirical risk minimization, they frame the problem as a minimax game between a predictor and an adversary.
The Density Ratio Estimator
The core of the framework is a differentiable density ratio estimator that calculates the ratio $P_s(x) / P_t(x)$, where $P_s$ is the source density and $P_t$ is the target density.
- High Ratio: If a target sample is common in the source domain, the ratio is high, and the model maintains its confidence.
- Low Ratio: If a sample is rare or unseen relative to the source, the ratio is low. This mathematically "flattens" the softmax output, effectively increasing the model's uncertainty for unfamiliar data.
End-to-End Training and Regularization
Unlike previous DRL methods that required pre-calculating ratios, this framework trains a differentiable domain classifier alongside the main task network. This allows for dynamic learning of the overlap between domains. Additionally, a class-regularized DRL term acts as sample-wise temperature scaling, smoothing predictions based on the degree of domain shift.
Experimental Results
The framework was evaluated on several benchmarks, including Office31, Office-Home, and the large-scale VisDA2017 synthetic-to-real challenge.
Improved Calibration and Accuracy
The DRL approach achieved significantly lower Expected Calibration Error (ECE) and Brier scores compared to standard temperature scaling and other adaptation methods like VADA. By being more conservative with its confidence, the model selects higher-quality pseudo-labels, preventing training set "poisoning."
Key performance gains include:
- UDA: The proposed DRST (Distributionally Robust Self-Training) method outperformed state-of-the-art on VisDA-2017, showing a 6% improvement specifically on "hard" examples.
- SSL: Integrating DRL into FixMatch (DRSSL) resulted in a 17% relative increase in accuracy for cross-domain semi-supervised learning (e.g., CIFAR10 to STL10).
Conclusion
The DRL framework provides a robust mechanism for calibrating uncertainty under domain shift. By using density ratios as a proxy for distributional distance, models can recognize when they are "out of their element," leading to more reliable pseudo-labeling and improved performance in real-world applications. Future work will explore handling more complex distribution shifts where the relationship between features and labels may also change.
Summary updated