Abstract
Model reprogramming adapts pretrained models to downstream tasks by modifying only the input and output spaces. Visual reprogramming (VR) is one instance for vision tasks that adds a trainable noise pattern (i.e., a visual prompt) to input images to facilitate downstream classification. The existing VR approaches for CLIP train a single visual prompt using all descriptions of different downstream classes. However, the limited learning capacity may result in (1) a failure to capture diverse aspects of the descriptions (e.g., shape, color, and texture), and (2) a possible bias toward less informative attributes that do not help distinguish between classes. In this paper, we introduce a decoupling-and-reweighting framework. Our decoupled visual prompts (DVP) are optimized using descriptions grouped by explicit causes (DVP-cse) or unsupervised clusters (DVP-cls). Then, we integrate the outputs of these visual prompts with a probabilistic reweighting matrix (PRM) that measures their contributions to each downstream class. Theoretically, DVP lowers the empirical risk bound. Experimentally, DVP outperforms baselines on average across 11 downstream datasets. Notably, the DVP-PRM integration enables insights into how individual visual prompts influence classification decisions, providing a probabilistic framework for understanding reprogramming.
Introduction: The Bottleneck in Visual Reprogramming
Model Reprogramming (VR) is a technique to repurpose large, pre-trained models like CLIP for specific downstream tasks without modifying the model's internal weights. This is achieved by adding a trainable "noise" pattern—a visual prompt—to the input image, aligning it with textual descriptions of the target classes.
However, current VR methods typically rely on a single visual prompt trained against all available descriptions for a class. This approach suffers from two primary issues:
- Capacity Limits: A single prompt struggles to simultaneously capture diverse semantic aspects, such as shape, color, and texture.
- Description Bias: The training process often over-emphasizes "easy" but uninformative features that fail to distinguish between similar classes.
Methodology: Decoupled Visual Prompts (DVP)
To address these limitations, we propose a decoupling-and-reweighting framework. Instead of a single prompt, we train a set of distinct prompts specialized for different semantic groups.
1. Partitioning Descriptions
We partition class descriptions into specialized groups using two strategies:
- DVP-cse (Semantic Causes): Utilizes an LLM (e.g., GPT-4) to identify primary classification "causes" (e.g., "wing shape" for aircraft). Each prompt specializes in one cause.
- DVP-cls (Unsupervised Clusters): Uses K-means to cluster attribute embeddings into groups when explicit semantic labels are unavailable.
2. Probabilistic Reweighting Matrix (PRM)
To aggregate the outputs of these specialized prompts, we introduce the Probabilistic Reweighting Matrix (PRM). The PRM measures the contribution of each description to a specific class label. Unlike simple averaging, the PRM is estimated via Maximum Likelihood Estimation (MLE) during training, allowing the model to learn which attributes are most discriminative for the task.
Experimental Evaluation
We evaluated DVP across 11 diverse datasets, including fine-grained objects (OxfordFlowers, FGVCAircraft), general scenes (SUN397), and specialized domains (EuroSAT, DTD). Tests were conducted across four CLIP backbones: ResNet-50, ResNet-101, ViT-B/32, and ViT-B/16.
Key Results
- Superior Accuracy: DVP-cse achieved an average accuracy of 80.1% across 11 datasets (ViT-B/16), outperforming the previous state-of-the-art AttrVR (78.5%).
- Architecture Robustness: Performance gains were consistent across all backbones, with notable improvements on smaller encoders like ResNet-50.
- Prompt Independence: Statistical analysis using the Hilbert-Schmidt Independence Criterion (HSIC) confirmed that decoupled prompts learn distinct, independent features.
Discussion and Insights
- Specialization vs. Generalization: Allowing prompts to specialize avoids the "alienation" effect, where optimizing for one feature (e.g., color) inadvertently degrades another (e.g., shape).
- Interpretability: The PRM weights provide transparency, showing which semantic causes (like "petal shape") dominated a classification decision.
- Theoretical Grounding: We prove that DVP provides a lower empirical risk bound compared to standard VR, as the increased capacity allows for a tighter fit to training data.
- Parameter Efficiency (DVPlite): Gains can be achieved without increasing parameters by dividing a single prompt's spatial area into segments assigned to different causes.
Limitations
The PRM's reliance on MLE makes it less effective in "ultra-low-shot" scenarios (1-shot or 4-shot), where data is insufficient to reliably estimate weights. Additionally, training multiple prompts increases computational overhead, though this can be mitigated through parallelization. Future work may explore learnable spatial assignments for prompts to further optimize feature capture.
Summary updated