Domain-Agnostic Mutual Prompting for Unsupervised Domain Adaptation

Zhekai Du, Xinyao Li, Fengling Li, Ke Lu, Lei Zhu, Jingjing Li

Introduction

Unsupervised Domain Adaptation (UDA) remains a critical challenge in machine learning, particularly when models must generalize from a labeled "source" domain (e.g., synthetic data) to an unlabeled "target" domain (e.g., real-world imagery). While large-scale Vision-Language Models (VLMs) like CLIP provide a robust foundation, they often struggle with the domain gap. Existing prompt-based adaptation methods typically learn domain-specific prompts or focus solely on the textual branch, failing to capture the shared underlying features across domains or the specific nuances of individual instances.

The DAMP Framework

To address these limitations, we propose Domain-Agnostic Mutual Prompting (DAMP). Unlike previous approaches that treat vision and language branches in isolation, DAMP facilitates a bidirectional dialogue between modalities to extract domain-invariant features.

Mutual Prompting Mechanism

At the core of DAMP is a shared cross-attention module ($G$) that enables mutual prompting. Textual embeddings guide the vision branch to prioritize relevant semantic features, while spatial image context is simultaneously used to prompt the text branch. This synergy ensures that both modalities are aligned toward a common, domain-agnostic representation.

The DAMP architecture illustrates the flow of information through the Mutual Prompting module, aligning CLIP embeddings via cross-attention.

Instance-Conditioned and Domain-Agnostic Design

DAMP shifts the focus from domain-specific tuning to universal alignment. Prompts are shared across all domains to emphasize commonalities. Furthermore, these prompts are conditioned on specific instances; for example, the textual prompt for a "chair" is dynamically adjusted based on the visual features of the specific chair being processed. This instance-level granularity leads to significantly tighter alignment in the embedding space.

To further refine the model, we employ auxiliary regularizations:

  • Instance-Discrimination Contrastive Loss: Encourages the model to focus on unique object characteristics rather than domain-wide noise.
  • Semantic-Consistency Regularization: Utilizes a consistency-based approach (similar to FixMatch) to ensure stable classifications across various image augmentations.

Experimental Evaluation

We evaluated DAMP on three major UDA benchmarks: Office-Home, VisDA-17, and Mini-DomainNet. DAMP consistently outperformed state-of-the-art methods while maintaining high parameter efficiency.

Key Results

  • Office-Home: DAMP achieved 78.2% accuracy with a ResNet-50 backbone, a 3.7% improvement over the previous best prompt-based method, DAPrompt.
  • Mini-DomainNet: The framework set a new benchmark with 87.6% accuracy using a ViT-B backbone.
  • Efficiency: DAMP achieves these results by tuning only a small fraction of parameters—approximately 11.9% of the tunable parameters required by comparable methods like PADCLIP—while keeping the primary CLIP encoders frozen.

Qualitative Analysis

Visualizations using t-SNE confirm that DAMP successfully bridges the domain gap. After mutual prompting, clusters representing different domains overlap almost perfectly, indicating that the model has learned to ignore domain-specific styles (like textures or artistic filters) in favor of the underlying semantic object.

t-SNE visualizations show that DAMP effectively aligns visual and textual embeddings, creating overlapping clusters across different domains.

Conclusion and Future Work

DAMP demonstrates that mutual interaction between vision and language modalities is key to effective domain adaptation. By leveraging domain-agnostic, instance-conditioned prompts, the framework achieves superior generalization with minimal parameter updates. Future research will explore balancing the update magnitudes between modalities automatically and extending the framework to handle open-world scenarios where category sets may differ between domains.

Summary updated

Abstract

Conventional Unsupervised Domain Adaptation (UDA) strives to minimize distribution discrepancy between do-mains, which neglects to harness rich semantics from data and struggles to handle complex domain shifts. A promising technique is to leverage the knowledge of large-scale pretrained vision-language models for more guided adaptation. Despite some endeavors, current methods often learn textual prompts to embed domain semantics for source and target domains separately and perform classification within each domain, limiting cross-domain knowledge transfer. Moreover, prompting only the language branch lacks flex-ibility to adapt both modalities dynamically. To bridge this gap, we propose Domain-Agnostic Mutual Prompting (DAMP) to exploit domain-invariant semantics by mutually aligning visual and textual embeddings. Specifically, the image contextual information is utilized to prompt the language branch in a domain-agnostic and instance-conditioned way. Meanwhile, visual prompts are im-posed based on the domain-agnostic textual prompt to elicit domain-invariant visual embeddings. These two branches of prompts are learned mutually with a cross-attention module and regularized with a semantic-consistency loss and an instance-discrimination contrastive loss. Experiments on three UDA benchmarks demonstrate the superiority of DAMP over state-of-the-art approaches 1.
BibTeX
@misc{du2024domain,
  author = {Zhekai Du and Xinyao Li and Fengling Li and Ke Lu and Lei Zhu and Jingjing Li},
  title = {{Domain-Agnostic Mutual Prompting for Unsupervised Domain Adaptation}},
  year = {2024},
  eprint = {2403.02899},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2403.02899},
}
Figure