SOTAVerified

Soft Prompt Generation for Domain Generalization

2024-04-30Code Available1· sign in to hype

Shuanghao Bai, Yuedi Zhang, Wanqi Zhou, Zhirong Luan, Badong Chen

Code Available — Be the first to reproduce this paper.

Reproduce

Code

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.

Tasks

Benchmark Results

DatasetModelMetricClaimedVerifiedStatus
DomainNetSPG (CLIP, ViT-B/16)Average Accuracy60.1Unverified
DomainNetSPG (CLIP, ResNet-50)Average Accuracy50.1Unverified
Office-HomeSPG (CLIP, ViT-B/16)Average Accuracy83.6Unverified
Office-HomeSPG (CLIP, ResNet-50)Average Accuracy73.8Unverified
PACSSPG (CLIP, ViT-B/16)Average Accuracy97Unverified
PACSSPG (CLIP, ResNet-50)Average Accuracy92.8Unverified
TerraIncognitaSPG (CLIP, ViT-B/16)Average Accuracy50.2Unverified
VLCSSPG (CLIP, ViT-B/16)Average Accuracy82.4Unverified
VLCSSPG (CLIP, ResNet-50)Average Accuracy84Unverified

Reproductions