A Unified Framework for Robustness on Diverse Sampling Errors

Myeongho Jeon, Myungjoo Kang, Joonseok Lee

Introduction

In machine learning, the assumption that training data perfectly represents the real-world distribution is rarely met. Instead, models frequently encounter "sampling errors" that lead to significant performance degradation during deployment. Researchers from Seoul National University have identified that these errors typically manifest in two distinct ways: Domain Generalization (DG) and Unbiased Learning (UBL). While existing research often treats these as separate problems, this paper introduces a unified framework called Instance-wise Adaptive Inference (IAI) to address both simultaneously by dynamically adapting to distribution shifts at test time.

The Challenge of Sampling Errors

Sampling errors generally fall into two categories:

  1. Single Domain Generalization (SDG): This occurs when a model is trained on one domain (e.g., photos) but must generalize to unseen domains (e.g., sketches or cartoons) where the visual style differs significantly.
  2. Unbiased Learning (UBL): This occurs when a model learns spurious correlations present in the training data. For instance, if a dataset primarily features young women and old men, a gender classifier might incorrectly learn to associate age-related features (like wrinkles) with the male class.
Illustration of Domain Shift and Biased Datasets as forms of sampling errors.

Most current solutions are over-optimized for one specific type of error. A model designed to be invariant to image style (SDG) often fails to ignore biased attributes (UBL), and vice versa. The authors argue that because the specific nature of the distribution shift is often unknown at deployment, a more flexible, conservative approach is required.

Proposed Methodology: Instance-wise Adaptive Inference (IAI)

The IAI framework employs a three-step strategy to achieve unified robustness:

1. Widening the Feature Space

To prevent the model from over-relying on the narrow set of features present in the source data, the framework uses a style generation module ($G$). This module creates diversely stylized versions of the training images, forcing the model to consider a broader range of potential semantic features.

2. Feature Disentanglement

The model utilizes a Disentangling Module ($F_b$) and a cosine similarity loss to ensure that different sub-networks learn independent semantic representations. By separating features like texture, shape, and color into distinct modules, the system can later adjust their relative importance.

3. Instance-wise Adaptive Inference

This is the core innovation. At test time, the model monitors the activation levels of each disentangled feature module for a specific input. If a feature that was less prominent during training (e.g., "shape") becomes highly activated for a target image, the model infers that this feature is likely more reliable for that specific instance and increases its weight in the final prediction.

Experimental Evaluation

The framework was evaluated on several benchmarks:

  • PACS & DG-CIFAR: Benchmarks for Single Domain Generalization involving Photo, Art, Cartoon, and Sketch domains.
  • B-CIFAR & IMDB: Datasets designed to test Unbiased Learning, where B-CIFAR contains synthetic biases and IMDB features real-world gender classification biased by age.

Key Results

IAI demonstrated superior consistency and generalization across all tasks:

  • PACS (SDG): IAI achieved 57.40% average accuracy, significantly outperforming the baseline (33.38%) and specialized SDG models like ADA (50.85%).
  • IMDB (UBL): IAI reached 81.03% accuracy, surpassing specialized unbiased learning models such as LfF (77.09%) and UBNet (79.66%).
Performance comparison across various benchmarks for domain generalization and unbiased learning.

Conclusion

The primary insight of this work is that specialization breeds fragility. By focusing on feature disentanglement and test-time activation as a proxy for feature importance, the IAI framework provides a robust defense against diverse sampling errors. While the authors note that adaptive re-weighting is less effective when distribution shifts are minimal, the framework represents a significant step toward models that can safely navigate the unpredictable shifts of real-world data deployment.

Summary updated

Abstract

Recent studies have substantiated that machine learning algorithms including convolutional neural networks often suffer from unreliable generalizations when there is a significant gap between the source and target data distributions. To mitigate this issue, a predetermined distribution shift has been addressed independently (e.g., single domain generalization, de-biasing). However, a distribution mismatch cannot be clearly estimated because the target distribution is unknown at training. Therefore, a conservative approach robust on unexpected diverse distributions is more desirable in practice. Our work starts from a motivation to allow adaptive inference once we know the target, since it is accessible only at testing. Instead of assuming and fixing the target distribution at training, our proposed approach allows adjusting the feature space the model refers to at every prediction, i.e., instance-wise adaptive inference. The extensive evaluation demonstrates our method is effective for generalization on diverse distributions.
BibTeX
@inproceedings{jeon2023unified,
  author = {Myeongho Jeon and Myungjoo Kang and Joonseok Lee},
  title = {{A Unified Framework for Robustness on Diverse Sampling Errors}},
  booktitle = {IEEE/CVF International Conference on Computer Vision},
  year = {2023},
  doi = {10.1109/iccv51070.2023.00141},
}
Figure