Diversity-Aware Meta Visual Prompting

Qidong Huang, Xiaoyi Dong, Dongdong Chen, Weiming Zhang, Feifei Wang, Gang Hua, Nenghai Yu · DOI

Abstract

We present Diversity-Aware Meta Visual Prompting (DAM-VP), an efficient and effective prompting method for transferring pre-trained models to downstream tasks with a frozen backbone. A challenging issue in visual prompting is that image datasets sometimes have a large data diversity, whereas a per-dataset generic prompt can hardly handle the complex distribution shift toward the original pretraining data distribution properly. To address this issue, we propose a dataset Diversity-Aware prompting strategy whose initialization is realized by a Meta-prompt. Specifically, we cluster the downstream dataset into small homogeneity subsets in a diversity-adaptive way, with each subset having its own prompt optimized separately. Such a divide-and-conquer design reduces the optimization difficulty greatly and significantly boosts the prompting performance. Furthermore, all the prompts are initialized with a meta-prompt, which is learned across several datasets. It is a bootstrapped paradigm, with the key observation that the prompting knowledge learned from previous datasets could help the prompt to converge faster and perform better on a new dataset. During inference, we dynamically select a proper prompt for each input, based on the feature distance between the input and each subset. Through extensive experiments, our DAM-VP demonstrates superior efficiency and effectiveness, clearly surpassing previous prompting methods in a series of downstream datasets for different pretraining models.

Introduction

The standard "pretrain-then-finetune" paradigm is becoming computationally prohibitive as models grow to billions of parameters. Visual Prompting (VP) emerged as a parameter-efficient solution: keep the large backbone model frozen and only learn a small set of parameters (a "prompt") added to the input. However, current methods usually learn a single generic prompt for an entire dataset. While this works for simple, uniform datasets, it fails on diverse datasets like ImageNet or SUN397.

Correlation between dataset diversity and Top-1 accuracy gain for VP and VPT.

As illustrated in Figure 1, the performance gain of traditional prompting drops sharply as dataset diversity increases. A single prompt simply cannot bridge the gap for a wide variety of image distributions simultaneously.

Methodology

DAM-VP addresses data diversity through a two-pronged strategy:

  1. Diversity-Adaptive Partitioning: Instead of one prompt for all, DAM-VP uses a "divide-and-conquer" approach. It clusters a downstream dataset into small, homogeneous subsets using an unsupervised method. The number of clusters is determined automatically based on the dataset's inherent diversity. Each subset then receives its own optimized visual prompt.
  2. Meta-Prompt Initialization: Rather than starting from random noise, all prompts are initialized with a "Meta-prompt." This meta-prompt is pre-trained across several auxiliary datasets using the Reptile meta-learning algorithm. This captures general "prompting knowledge"—the ability to shift distributions—allowing the model to converge much faster on new tasks.
The DAM-VP pipeline featuring data partitioning and meta-prompting.

During inference, the system extracts a feature from the input image, identifies the closest cluster "prototype," and applies the corresponding prompt dynamically, as shown in the pipeline in Figure 2.

Experimental Results

The researchers evaluated DAM-VP across 16 image datasets, ranging from uniform digits (SVHN) to complex scenes (SUN397).

  • Superior Accuracy: On the diverse DTD (textures) dataset using a ViT-B backbone, DAM-VP achieved 73.1% accuracy, outperforming standard VP by 13.6% and Visual Prompt Tuning (VPT) by 7.3%.
  • Extreme Efficiency: DAM-VP is remarkably fast. With only 10 epochs of tuning, it achieved an average accuracy of 85.7% across 10 datasets. In contrast, previous state-of-the-art methods like VPT required 100 epochs to reach a similar 85.5%.
  • Versatility: The method proved effective across various architectures, including Vision Transformers (ViT, Swin) and traditional Convolutional Neural Networks (ResNet).

Conclusion

DAM-VP demonstrates that homogeneity is key to effective prompting. By partitioning diverse data and utilizing meta-learned initializations, DAM-VP achieves state-of-the-art results in just 10% of the training time required by previous methods. This framework provides a robust and scalable path for adapting large-scale frozen models to specialized downstream tasks.

Summary updated

BibTeX
@inproceedings{huang2023diversity,
  author = {Qidong Huang and Xiaoyi Dong and Dongdong Chen and Weiming Zhang and Feifei Wang and Gang Hua and Nenghai Yu},
  title = {{Diversity-Aware Meta Visual Prompting}},
  booktitle = {IEEE/CVF Conference on Computer Vision and Pattern Recognition},
  year = {2023},
  doi = {10.1109/cvpr52729.2023.01047},
}
Figure