UCDR-Adapter: Exploring Adaptation of Pre-Trained Vision-Language Models for Universal Cross-Domain Retrieval

Haoyu Jiang, Zhi-Qi Cheng, Gabriel Moreira, Jiawen Zhu, Jingdong Sun, Bukun Ren, Jun-Yan He, Qi Dai, Xian-Sheng Hua · DOI

TL;DR

This paper introduces UCDR-Adapter, a novel framework that enhances pre-trained vision-language models for Universal Cross-Domain Retrieval (UCDR). By employing a two-phase training strategy involving adapter modules and dynamic prompt generation, UCDR-Adapter achieves robust generalization to unseen domains and classes without relying on textual inputs during inference, outperforming existing state-of-the-art methods.

What Problem Does This Paper Address?

The core challenge addressed is Universal Cross-Domain Retrieval (UCDR). UCDR aims to retrieve relevant images from domains and categories that the model has never seen during training. This is a crucial problem for real-world applications where data distributions constantly shift and new content emerges. Traditional methods often rely on pre-trained vision-language models (VLMs) and prompt tuning. However, these approaches are limited by static prompts, which struggle to adapt to the dynamic nature of unseen data. This leads to a performance bottleneck, as the model's ability to generalize is constrained by its fixed understanding of prompts. UCDR-Adapter seeks to overcome this by enabling models to dynamically adapt to these evolving data distributions, thereby improving both flexibility and generalization.

Methods

UCDR-Adapter proposes a two-phase training strategy to adapt pre-trained VLMs:

  • Phase 1: Source Adapter Learning: This phase focuses on integrating class semantics with domain-specific visual knowledge.
  • Learnable Textual Semantic Template: A template like "A photo of {class} from the {domain} domain" is used, where the class is a specific string and the domain is represented by learnable vectors. This template helps the model understand both what an object is and where it comes from.
  • Domain and Class Prompts: Learnable prompt matrices for domains and classes are introduced. These prompts are dynamically applied to the input image features to guide the vision encoder, enhancing its ability to discriminate between specific domains and classes.
  • Momentum Updated Prompts: To improve sample diversity and representation learning, momentum-based updates (inspired by MoCo) are used for prompts. This allows for a larger effective dictionary of samples.
  • Dual Loss Functions: A combination of a Triplet Loss (to improve inter-class discrepancy and intra-class similarity) and ITC Loss (contrastive loss to align image and text features) is used to achieve robust multimodal alignment.
  • Phase 2: Target Prompt Generation: This phase simulates adaptation to unseen domains and classes.
  • Masked Source Prompts: Prompts learned in Phase 1 are masked to simulate the absence of knowledge about target domains and classes.
  • Dynamic Prompt Generation: An attention mechanism is used to generate target prompts by attending over these masked source prompts. This allows the model to create adapted prompts that are relevant to the unseen data.

During inference, only the image branch and the generated target prompts are used, eliminating the need for textual inputs, which significantly boosts efficiency.

Datasets

The paper evaluates UCDR-Adapter on three widely used datasets for UCDR tasks:

  • DomainNet: Used for UCDR, UdCDR, and U°CDR experiments. It contains a large number of images across various domains (real, sketch, quickdraw, infograph, clipart, painting) and classes.
  • Sketchy: Used for U°CDR experiments.
  • TU-Berlin: Used for U°CDR experiments.

The experimental setup follows established benchmarks for these datasets, with specific splits for training, validation, and testing, ensuring unseen domains and classes during evaluation.

Key Insights and Ideas

  • Dynamic Prompts are Key: The core insight is that static prompts are insufficient for robust UCDR. UCDR-Adapter's dynamic prompt generation, especially through the Target Prompt Generation module, is crucial for adapting to unseen data.
  • Adapters for Efficient Adaptation: Using adapter modules instead of fine-tuning the entire pre-trained VLM is computationally efficient and avoids catastrophic forgetting of pre-trained knowledge.
  • Leveraging Both Domain and Class Information: The learnable semantic template and dedicated domain/class prompts effectively combine semantic knowledge with visual features, leading to better generalization.
  • Momentum and Triplet Loss for Robustness: The use of momentum encoders and triplet loss enhances the diversity and discriminative power of learned representations, making the model more robust to domain shifts.
  • Inference Efficiency: Eliminating textual inputs during inference is a significant advantage for practical deployment.

Key Results

  • Superior Performance: UCDR-Adapter consistently outperforms state-of-the-art methods like SASA and ProS across UCDR, UdCDR, and U°CDR settings on the DomainNet, Sketchy, and TU-Berlin datasets.
  • Significant Gains: For example, on DomainNet for UCDR, UCDR-Adapter improves mAP@200 over SASA by +16.84% and +17.2% on different gallery settings. It also shows substantial gains over Zero-Shot CLIP.
  • Improved Feature Discrimination: t-SNE visualizations show that UCDR-Adapter leads to better inter-class separation and intra-class clustering compared to standard CLIP, indicating enhanced discrimination of unseen classes.
  • Efficiency: The adapter-based approach is computationally efficient, with a significantly smaller number of trainable parameters compared to full fine-tuning.

Limitations and Future Work

  • Limitations: While UCDR-Adapter shows strong performance, the paper notes that in some cases, errors can occur due to background similarities (e.g., incorrect lightning retrieval). The performance can also be affected by the distinctiveness of features in different domains (e.g., Sketchy vs. Painting).
  • Future Work: The paper suggests that the UCDR-Adapter framework can be extended to other cross-domain tasks, offering a promising direction for generalized visual retrieval. The authors also highlight the potential for further improvements by exploring more sophisticated prompt generation strategies and adapter designs.

Summary updated

BibTeX
@inproceedings{jiang2025ucdr,
  author = {Haoyu Jiang and Zhi-Qi Cheng and Gabriel Moreira and Jiawen Zhu and Jingdong Sun and Bukun Ren and Jun-Yan He and Qi Dai and Xian-Sheng Hua},
  title = {{UCDR-Adapter: Exploring Adaptation of Pre-Trained Vision-Language Models for Universal Cross-Domain Retrieval}},
  booktitle = {IEEE/CVF Winter Conference on Applications of Computer Vision},
  year = {2025},
  doi = {10.1109/wacv61041.2025.00530},
}
Figure