Abstract
Domain adaptation has been vastly investigated in computer vision but still requires access to target images at train time, which might be intractable in some uncommon conditions. In this paper, we propose the task of ‘Prompt-driven Zero-shot Domain Adaptation’, where we adapt a model trained on a source domain using only a general description in natural language of the target domain, i.e., a prompt. First, we leverage a pretrained contrastive vision-language model (CLIP) to optimize affine transformations of source features, steering them towards the target text embedding while preserving their content and semantics. To achieve this, we propose Prompt-driven Instance Normalization (PIN). Second, we show that these prompt-driven augmentations can be used to perform zero-shot domain adaptation for semantic segmentation. Experiments demonstrate that our method significantly outperforms CLIP-based style transfer baselines on several datasets for the downstream task at hand, even surpassing one-shot unsupervised domain adaptation. A similar boost is observed on object detection and image classification. The code is available at https://github.com/astra-vision/PODA.
Introduction: The Challenge of Domain Shift
Deep learning models are notoriously brittle when they encounter "domain shift." For instance, a semantic segmentation model trained on sunny streets in Germany (using the Cityscapes dataset) will likely fail when deployed on a rainy night in Tokyo. The standard solution to this problem is Unsupervised Domain Adaptation (UDA), which requires a large collection of unlabeled images from the target environment to bridge the gap.
However, what if those images don't exist yet? Collecting data for rare or dangerous conditions—such as driving through a forest fire, a massive sandstorm, or extreme weather events—is difficult, expensive, and sometimes impossible. While recent "one-shot" methods attempt to adapt using just a single target image, even that requirement can be a bottleneck in rapidly changing or unique environments.
PØDA (Prompt-driven Zero-shot Domain Adaptation) addresses this challenge by enabling models to adapt to a new domain using only a natural language description (e.g., "driving in a sandstorm"). This "zero-shot" approach requires no target domain images during the adaptation process.
Methodology: Steering Features with CLIP
The core innovation of PØDA is the integration of task-specific models (like DeepLabv3+) with the multi-modal power of CLIP (Contrastive Vision-Language Pre-training). Instead of generating new images, PØDA operates directly on the model's internal feature representations.
Prompt-driven Instance Normalization (PIN)
Taking inspiration from style transfer techniques like AdaIN, the authors developed Prompt-driven Instance Normalization (PIN). In traditional style transfer, style is transferred from a reference image. In contrast, PIN treats the mean and standard deviation of low-level features as optimizable variables that can be adjusted to match a textual description.
Style Mining via CLIP
For a given source image, PØDA runs an optimization loop. It adjusts the PIN parameters so that the resulting "stylized" features, when passed through CLIP’s image encoder, align closely with the embedding of the target text prompt (e.g., "driving at night"). This process "steers" the internal features toward the target domain while preserving the original scene's content and semantics.
Feature-Level Augmentation and Fine-tuning
Operating in the feature space rather than the pixel space offers two major advantages:
- Efficiency: It is significantly faster than pixel-level style transfer. Augmenting a feature map takes approximately 0.3 seconds, compared to over a minute for generating a new image.
- Stability: It avoids visual artifacts common in generative models that can confuse downstream classifiers.
Once these "target-style" features are mined, the model's classification head is fine-tuned on them. Since the underlying geometry and labels of the source image are preserved, the model learns to recognize objects under the new "style" defined by the prompt.
Experimental Results
The authors evaluated PØDA across several challenging benchmarks, including the ACDC dataset (Rain, Fog, Night, Snow) and synthetic-to-real shifts (GTA5 to Cityscapes).
- Semantic Segmentation: On the ACDC "Night" set, PØDA improved the baseline mean Intersection over Union (mIoU) from 18.31% to 25.03%.
- Surpassing One-Shot Methods: Remarkably, PØDA—which sees zero target images—outperformed state-of-the-art one-shot methods (like SM-PPM) in several scenarios, including Night and Snow conditions.
- Versatility: Beyond driving, the method showed significant gains in object detection (e.g., foggy scenes) and image classification (e.g., adapting bird classifiers to artistic styles).
Key Insights and Limitations
A critical finding of the study is that initialization acts as regularization. By starting the optimization from the source image's original statistics, the adapted features stay within a neighborhood that preserves the original scene's structure. Furthermore, the method proved robust to prompt phrasing; whether using "driving at night" or "operating a vehicle after sunset," the performance gains remained consistent.
However, PØDA's success is inherently tied to the knowledge present in the pre-trained CLIP model. If CLIP has not encountered a specific concept during its training, PØDA will struggle to adapt to it. Additionally, while the method works well with a frozen backbone, finding ways to safely fine-tune the entire model without losing generalization remains an area for future research.
Conclusion
PØDA represents a significant advancement in domain adaptation, providing a path for computer vision models to prepare for environments they have never physically encountered. By leveraging the bridge between language and vision, PØDA makes AI systems more robust and adaptable to the unpredictable nature of the real world.
Summary updated