NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

ZooD: Exploiting Model Zoo for Out-of-Distribution Generalization

Qishi Dong, Muhammad Awais, Fengwei Zhou, Chuanlong Xie, Tianyang Hu, Yongxin Yang, Sung-Ho Bae, Zhenguo Li · DOI

Introduction

In modern machine learning, the Independent and Identically Distributed (IID) assumption—where training and testing data are drawn from the same distribution—is frequently violated in real-world deployments. Out-of-Distribution (OoD) generalization remains a critical challenge, as models often fail when encountering shifts in lighting, background, or environmental context. While the proliferation of large-scale Pre-Trained Models (PTMs) like ResNets, Vision Transformers (ViTs), and CLIP offers a potential solution, navigating this "model zoo" presents two significant hurdles: the prohibitive computational cost of fine-tuning every candidate and the unreliability of standard IID validation metrics in predicting OoD performance.

This paper introduces ZooD, a framework designed to efficiently identify and combine the most effective PTMs for specific OoD tasks. By prioritizing feature stability across domains and employing a selective ensembling strategy, ZooD achieves state-of-the-art performance with a fraction of the computational overhead required by traditional methods.

The ZooD Framework

ZooD operates through a two-stage paradigm: model ranking followed by selective ensembling.

1. Model Ranking: Identifying Domain-Invariant Features

The first stage addresses the "selection" problem. Rather than relying on simple accuracy metrics, ZooD ranks models based on their ability to extract features that are both discriminative and stable across different environments. This is achieved through a "leave-one-domain-out" cross-validation approach, evaluating two primary components:

  • Inter-class Discriminability: This measures how effectively a model separates different categories within the feature space.
  • Inter-domain Stability: This quantifies the consistency of features when the model processes data from different training domains.

By combining these metrics, ZooD identifies models that focus on fundamental object characteristics rather than "spurious correlations" (e.g., a specific background) that are likely to change in unseen domains. Crucially, this ranking is performed on fixed feature extractors, avoiding the need for expensive weight updates during the selection process.

2. Selective Ensembling: The Variational EM Approach

Once the top-performing models are identified, the next challenge is combining them without introducing excessive noise—a phenomenon known as the "noise accumulation trap." Simply concatenating features from multiple models can lead to a high-dimensional space where irrelevant features degrade the final classifier's performance.

ZooD treats the ensemble process as a Bayesian variable selection problem. It utilizes a Variational Expectation-Maximization (EM) algorithm to apply "latent masks" over the extracted features. This mechanism effectively "mutes" noisy or redundant features while preserving the most informative ones. The result is a lean, robust ensemble that leverages the complementary strengths of various PTMs.

Experimental Evaluation

The authors evaluated ZooD using a diverse zoo of 35 PTMs across seven major OoD benchmarks, including PACS, VLCS, Office-Home, TerraIncognita, DomainNet, and the NICO datasets.

Performance and Efficiency

The results demonstrate that ZooD is not only accurate but exceptionally efficient:

  • Computational Speedup: ZooD is up to 9,859x faster than brute-force fine-tuning. On the PACS dataset, the selection and training process took only 0.27 GPU hours, compared to the 2,662 hours required to fine-tune every model in the zoo.
  • Accuracy Gains: On the challenging DomainNet benchmark, which features six domains and 345 classes, ZooD improved state-of-the-art accuracy from 46.5% to 50.6%.
  • Metric Reliability: The ZooD ranking metric showed a significantly higher correlation with actual fine-tuned performance than existing metrics like LogME or H-Score, particularly on datasets with significant real-world shifts like TerraIncognita.

Discussion and Limitations

While ZooD represents a significant advancement in model selection for OoD generalization, certain limitations remain. The current ranking metric assumes a linear relationship between features and labels. While this assumption facilitates extreme efficiency, it may overlook complex non-linear relationships that a fully fine-tuned deep network might exploit. Additionally, the ranking is performed on fixed backbones; while the paper demonstrates the effectiveness of this approach, it does not account for potential feature evolution during full-parameter fine-tuning.

Conclusion

ZooD provides a scalable and robust solution for leveraging the vast landscape of pre-trained models for Out-of-Distribution tasks. By focusing on inter-domain stability and employing selective ensembling via Variational EM, it bridges the gap between the availability of powerful models and the practical constraints of deploying them in unpredictable environments. The release of the authors' testbed, containing features and results for 35 PTMs, serves as a valuable resource for the research community to further explore efficient OoD generalization.

Summary updated

BibTeX
@inproceedings{dong2022zood,
  author = {Qishi Dong and Muhammad Awais and Fengwei Zhou and Chuanlong Xie and Tianyang Hu and Yongxin Yang and Sung-Ho Bae and Zhenguo Li},
  title = {{ZooD: Exploiting Model Zoo for Out-of-Distribution Generalization}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2022},
  url = {https://openreview.net/forum?id=xhQ843mPaRA},
}
Figure