Introduction
In real-world machine learning deployments, models frequently encounter data distributions that differ significantly from their training sets. Two primary challenges characterize these shifts: Label Shift, where the relative proportions of known classes change, and Open Set Recognition, where the model encounters "Out-of-Distribution" (OOD) samples that do not belong to any training category.
While Closed Set Label Shift (CSLS) is a well-documented problem, it assumes the set of classes remains constant. This paper addresses the more complex and realistic scenario of Open Set Label Shift (OSLS). In OSLS, the proportions of known classes shift, and a previously unseen "unknown" class appears at test time. The authors propose a three-stage framework to estimate these shifts and correct classifier predictions without requiring any retraining or fine-tuning of the original models.
The OSLS Framework
The proposed method treats the "unknown" category as an additional $(K+1)$-th class. By leveraging a frozen classifier and a pre-trained OOD detector, the framework operates in three distinct stages:
1. Source Ratio Retrieval
The process begins by using a pre-trained OOD detector $h(x)$ to estimate the initial ratio of In-Distribution (ID) to OOD data in the source domain. This provides a baseline for how the detector behaves on known versus unknown data.
2. The EM Algorithm
At the heart of the framework is an Expectation-Maximization (EM) algorithm designed for both Maximum Likelihood (MLE) and Maximum a Posteriori (MAP) estimation. This algorithm iteratively processes unlabeled test data to find the most likely target class proportions ($\pi$) and the target ID/OOD ratio ($\rho_t$). By mapping the OSLS problem onto the mathematics of CSLS, the authors adapt powerful solvers to account for the new unknown class.
3. Target Ratio Correction
Recognizing that OOD detectors are rarely perfect—often "leaking" ID data into the OOD category—the authors introduce a correction model based on Theorem 4.4. This step adjusts the estimated ratios by accounting for the expected error rates of the detector, ensuring the final proportions are closer to the ground truth.
The "Secret Sauce": OOD Reference Data
A critical requirement for this method is an "OOD Reference Dataset" at test time. A significant finding of this research is that if real OOD data is unavailable, pseudo-OOD data can be generated by adding Gaussian noise to known ID samples. This proxy for the "unknown" class is sufficient for the EM algorithm to converge effectively, making the approach highly practical for scenarios where the nature of future unknowns is unpredictable.
Experimental Evaluation
The researchers evaluated the framework using standard image classification benchmarks, including CIFAR-10, CIFAR-100, and ImageNet-200. These were tested against various OOD datasets such as SVHN, MNIST, and iNaturalist. The study considered two types of shifts:
- Dirichlet Shift: Randomly sampled class proportions.
- Ordered Long-Tailed Shift: Simulating real-world imbalances where some classes are significantly more frequent than others.
Key Results
- Estimation Accuracy: The OSLS-MAP model significantly outperformed existing SOTA closed-set models (like MLLS and BBSE). In CIFAR-100 and ImageNet-200 experiments, it reduced the Mean Squared Error (MSE) of class proportion estimation by over 50%.
- Classification Performance: By correcting the classifier's inherent bias toward the source distribution, the framework achieved higher Top-1 accuracy on shifted target sets.
- Efficiency: The algorithm is computationally lightweight. Estimation takes less than 1 second for CIFAR datasets and less than 5 seconds for ImageNet-200, allowing for real-time test-time adaptation.
- Model Agnostic: The framework is "pluggable," meaning it can be used with any off-the-shelf ID classifier and OOD detector (e.g., OpenMax, ReAct, or Ash) without modifying their weights.
Discussion and Limitations
The method relies on the assumption of invariant conditionals, meaning $p(x|y)$ remains constant. While the framework handles changes in class proportions, it is not designed to handle covariate shifts where the appearance of the classes themselves changes (e.g., new styles of the same object). Additionally, while the correction model mitigates detector errors, the overall performance remains partially dependent on the underlying OOD detector's ability to distinguish ID from OOD data.
Conclusion
This work provides a robust mathematical and practical bridge between label shift and open set recognition. By treating the unknown as an additional class and utilizing an EM-based correction framework, the authors demonstrate that it is possible to maintain high classification accuracy in dynamic, open-world environments using entirely frozen, pre-trained models.
Summary updated