HyperAIHyperAI

Command Palette

Search for a command to run...

3 months ago

Soft Prompt Generation for Domain Generalization

Shuanghao Bai Yuedi Zhang Wanqi Zhou Zhirong Luan Badong Chen

Soft Prompt Generation for Domain Generalization

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.

Code Repositories

renytek13/soft-prompt-generation-with-cgan
Official
pytorch
Mentioned in GitHub

Benchmarks

BenchmarkMethodologyMetrics
domain-generalization-on-domainnetSPG (CLIP, ViT-B/16)
Average Accuracy: 60.1
domain-generalization-on-domainnetSPG (CLIP, ResNet-50)
Average Accuracy: 50.1
domain-generalization-on-office-homeSPG (CLIP, ResNet-50)
Average Accuracy: 73.8
domain-generalization-on-office-homeSPG (CLIP, ViT-B/16)
Average Accuracy: 83.6
domain-generalization-on-pacs-2SPG (CLIP, ViT-B/16)
Average Accuracy: 97.0
domain-generalization-on-pacs-2SPG (CLIP, ResNet-50)
Average Accuracy: 92.8
domain-generalization-on-terraincognitaSPG (CLIP, ViT-B/16)
Average Accuracy: 50.2
domain-generalization-on-vlcsSPG (CLIP, ResNet-50)
Average Accuracy: 84.0
domain-generalization-on-vlcsSPG (CLIP, ViT-B/16)
Average Accuracy: 82.4

Build AI with AI

From idea to launch — accelerate your AI development with free AI co-coding, out-of-the-box environment and best price of GPUs.

AI Co-coding
Ready-to-use GPUs
Best Pricing
Get Started

Hyper Newsletters

Subscribe to our latest updates
We will deliver the latest updates of the week to your inbox at nine o'clock every Monday morning
Powered by MailChimp
Soft Prompt Generation for Domain Generalization | Papers | HyperAI