Abstract
Domain generalization (DG) is an important problem that learns a model which generalizes to unseen test domains leveraging one or more source domains, under the assumption of shared label spaces. However, most DG methods assume access to abundant source data in the target label space, a requirement that proves overly stringent for numerous real-world applications, where acquiring the same label space as the target task is prohibitively expensive. For this setting, we tackle the multimodal version of the unsupervised domain generalization (MUDG) problem, which uses a large task-agnostic unlabeled source dataset during finetuning. Our framework does not explicitly assume any relationship between the source dataset and target task. Instead, it relies only on the premise that the source dataset can be accurately and efficiently searched in a joint vision-language space. We make three contributions in the MUDG setting. Firstly, we show theoretically that cross-modal approximate nearest neighbor search suffers from low recall due to the large distance between text queries and the image centroids used for coarse quantization. Accordingly, we propose paired k-means, a simple clustering algorithm that improves nearest neighbor recall by storing centroids in query space instead of image space. Secondly, we propose an adaptive text augmentation scheme for target labels designed to improve zero-shot accuracy and diversify retrieved image data. Lastly, we present two simple but effective components to further improve downstream target accuracy. We compare against state-of-the-art name-only transfer, source-free DG and zero-shot (ZS) methods on their respective benchmarks and show consistent improvement in accuracy on 20 diverse datasets.
The Challenge of Unsupervised Generalization
Traditional Domain Generalization (DG) aims to create models that work on unseen test data—for instance, recognizing a "sketch" of a dog when only trained on "photos." However, most DG methods assume the existence of a perfectly curated, labeled dataset for the specific task at hand. In real-world scenarios, we often have a target task (e.g., classifying specific industrial parts) and a massive pile of unlabeled data (the internet), but no task-specific training set.
This paper addresses Multimodal Unsupervised Domain Generalization (MUDG). In this setting, the goal is to leverage a large, "task-agnostic" unlabeled source dataset (like LAION-2B) to improve performance on a specific target task using only the names of the target classes. The primary hurdle is retrieval quality: the "modality gap" between text and image representations in models like CLIP causes standard search algorithms to fail, leading to low-quality or non-diverse training data.
Methodology
The authors propose a three-pronged approach to build a high-quality, task-specific training set from unlabeled web-scale data:
- Paired k-means: Standard large-scale search uses clusters centered around images. Due to the modality gap, text queries often land far from these centers, causing poor search recall. Paired k-means solves this by storing centroids in the query (text) space, significantly improving the probability of finding relevant nearest neighbors.
- Adaptive Text Augmentation: To avoid overfitting on near-identical images, the system requires diverse queries. The authors developed an unsupervised heuristic that selects text prompts preserving the variance between different classes, ensuring that retrieved images for "cat" and "dog" remain distinct.
- Sample Selection & Diversity Preserving Loss: After retrieval, k-means clustering is used to de-duplicate images. During finetuning, a specialized loss function prevents the model from "forgetting" the broad knowledge already contained in the original CLIP model.
Experimental Results
The framework was evaluated on a battery of 20 datasets, using LAION-2B-en as the task-agnostic source. The benchmarks included general classification (ImageNet-1K), fine-grained tasks (Oxford-Pets), and robustness tests (ImageNet-Sketch).
- Consistent Gains: The MUDG framework consistently outperformed Zero-Shot CLIP and state-of-the-art "name-only transfer" methods (like SuS-X).
- Accuracy Boost: On a suite of 11 diverse datasets, the method improved average accuracy from 65.2% (Zero-Shot) to 71.1% using a ViT-B/16 model.
- Robustness: The method showed strong gains on out-of-distribution datasets like ImageNet-Sketch (improving from 46.6% to 50.4%) and DomainNet (from 57.6% to 61.2%), proving that retrieving real-world variety helps models generalize to artistic or unusual domains.
Conclusion
By treating the modality gap as a retrieval hurdle rather than just a representation issue, the MUDG framework effectively mines web-scale data to improve task-specific generalization without manual labeling. While the method relies on target concepts being present in the source dataset, it offers a powerful data-centric path for generalizing models to niche domains where labeled data is scarce.
Summary updated