Bag of Tricks for Out-of-Distribution Generalization

Zining Chen, Weiqiu Wang, Zhicheng Zhao, Aidong Men, Hong Chen · DOI

Abstract

Deep learning models typically operate under the assumption that training and test data are Independent and Identically Distributed (IID). In real-world scenarios, however, distribution shifts—such as changes in lighting, background, or camera angles—frequently cause performance to plummet. This paper details the winning approach for the NICOchallenge-2022 Domain Generalization track, developed by researchers from BUPT and China Mobile. Rather than relying on complex, specialized architectures, the authors propose a "bag of tricks" framework. By integrating multi-objective learning, cyclic multi-scale training, and robust inference strategies, the framework achieved 1st place, demonstrating that well-tuned heuristics can outperform complex state-of-the-art algorithms in Out-of-Distribution (OOD) generalization.

Introduction

The core challenge of Domain Generalization (DG) lies in creating models that remain robust when the test distribution differs from the training distribution. While many researchers have proposed mathematically intensive algorithms to solve DG, these methods are often "brittle," performing well on specific benchmarks but failing to scale or generalize to diverse datasets.

The authors sought to build a simple, memory-efficient, and easily-equipped framework capable of handling the massive scale of the NICO++ dataset. Their findings suggest that the key to OOD performance lies not in specialized DG modules, but in a combination of robust training heuristics and effective data utilization.

Methodology

The proposed framework relies on four primary pillars designed to enhance feature robustness and model stability.

1. Multi-objective Framework Design

To encourage the backbone to learn more robust, hierarchical features, the authors implemented a multi-objective learning strategy. In addition to the standard classification head for the 60 specific classes, they added a "coarse-grained" head. The 60 classes were manually grouped into four broad categories: plant, animal, vehicle, and object. Training the model to simultaneously recognize both the specific class and the broad category forces the model to capture fundamental structural features rather than just superficial patterns.

2. Strategic Data Augmentation

Data diversity is critical for generalization. Through empirical testing, the authors identified a specific combination of Random Augmentation, Cutmix, Mixup, and Label Smoothing as the most effective suite for preventing overfitting. This combination proved more effective than any single method, significantly increasing the model's exposure to varied data distributions during training.

3. Cyclic Multi-scale Training

Standard multi-scale training, which changes input resolution every batch, can be computationally expensive and memory-intensive. The authors introduced Cyclic Multi-scale Training, where the input size is changed every five epochs. This approach allows the model to learn to recognize objects at various scales while remaining memory-efficient, making it suitable for large-scale datasets and limited GPU resources.

4. Robust Inference Strategies

During the test phase, the authors employed two primary strategies to boost performance:

  • Test-Time Augmentation (TTA): Applying various transformations to the test images and averaging the results.
  • Weighted Top-5 Voting: An ensemble method that assigns weights to predictions based on their rank (e.g., the 1st place prediction receives a weight of 1, the 2nd receives 1/2, etc.). This allows multiple models to contribute to the final classification in a way that prioritizes high-confidence consensus.

Dataset: NICO++

The study focuses on the NICO++ dataset, a large-scale benchmark for OOD generalization. The dataset contains 232,400 images across 80 categories, featuring 10 common domains and 10 unique domains for each category. For the NICOchallenge-2022 (Track 1), the data was organized into 88,866 training samples and approximately 50,000 test samples across 60 categories. The dataset is characterized by "hard samples" involving significant occlusions, multi-target scenes, and extreme camera angles.

Key Insights and Results

Heuristics vs. Specialized Algorithms

In a surprising result, the authors compared their "bag of tricks" against several state-of-the-art DG methods, including CORAL, SWAD, and StableNet. All of these specialized algorithms actually decreased performance on the NICO++ dataset compared to the authors' heuristic approach. This suggests that many current DG algorithms may be over-tuned for smaller, specific benchmarks and lack the flexibility required for large-scale, real-world distribution shifts.

The Distraction of Domain Labels

Interestingly, the authors found that using the provided domain labels as auxiliary training targets worsened performance. They hypothesized that domain labels often focus on background or context, which can distract the model from learning the actual foreground object—the primary goal of the classification task.

Quantitative Performance

The framework's effectiveness was validated by its competition results:

  • Top-1 Accuracy: 88.16% on the public test set and 75.65% on the private test set.
  • Ablation Studies: Adding Cutmix and Mixup alone provided a 12.19% boost in accuracy over the baseline. The multi-objective framework added an additional 1% accuracy with virtually zero computational overhead.

Conclusion

The success of the "bag of tricks" approach in the NICOchallenge-2022 highlights a shift in OOD generalization research. By prioritizing efficient backbones (like eca-nfnet-l0 and efficientnet-b4) and focusing on robust training and inference strategies, the authors demonstrated that simplicity and well-tuned heuristics can outperform complex, specialized architectures. Future work will explore more efficient self-supervised learning tasks and Class Activation Map (CAM) based features to further improve handling of occlusions and multi-target images.

Summary updated

BibTeX
@inproceedings{chen2022bag,
  author = {Zining Chen and Weiqiu Wang and Zhicheng Zhao and Aidong Men and Hong Chen},
  title = {{Bag of Tricks for Out-of-Distribution Generalization}},
  booktitle = {Workshops @ ECCV},
  year = {2022},
  doi = {10.1007/978-3-031-25075-0\_31},
}
Figure