English

Soft Prompt Generation for Domain Generalization

Computer Vision and Pattern Recognition 2024-07-15 v2

Abstract

Large pre-trained vision language models (VLMs) have shown impressive zero-shot ability on downstream tasks with manually designed prompt. To further adapt VLMs to downstream tasks, soft prompt is proposed to replace manually designed prompt, which undergoes fine-tuning based on specific domain data. Prior prompt learning methods primarily learn a fixed prompt or residuled prompt from training samples. However, the learned prompts lack diversity and ignore information about unseen domains. In this paper, we reframe the prompt learning framework from a generative perspective and propose a simple yet efficient method for the Domain Generalization (DG) task, namely Soft Prompt Generation (SPG). Specifically, SPG consists of a two-stage training phase and an inference phase. During the training phase, we introduce soft prompt label for each domain, aiming to incorporate the generative model domain knowledge. During the inference phase, the generator of the generative model is employed to obtain instance-specific soft prompts for the unseen target domain. Extensive experiments on five domain generalization benchmarks of three DG tasks demonstrate that SPG achieves state-of-the-art performance. The code is available at https://github.com/renytek13/Soft-Prompt-Generation-with-CGAN.

Keywords

Cite

@article{arxiv.2404.19286,
  title  = {Soft Prompt Generation for Domain Generalization},
  author = {Shuanghao Bai and Yuedi Zhang and Wanqi Zhou and Zhirong Luan and Badong Chen},
  journal= {arXiv preprint arXiv:2404.19286},
  year   = {2024}
}

Comments

25 pages, 4 figures, accepted by ECCV 2024

R2 v1 2026-06-28T16:10:47.168Z