Bayesian-guided Label Mapping for Visual Reprogramming

Chengyi Cai, Zesheng Ye, Lei Feng, Jianzhong Qi, Feng Liu

Introduction

Visual Reprogramming (VR), also known as adversarial reprogramming, has emerged as a resource-efficient alternative to full-parameter fine-tuning. By keeping a large pretrained model fixed and learning only a small input interface (e.g., a noise pattern) and an output label mapping, VR can repurpose models for diverse downstream tasks. However, traditional VR often relies on a rigid one-to-one label mapping (LM) that forces a single pretrained category to represent a downstream class. This approach ignores complex semantic relationships and often results in suboptimal "greedy" assignments where logical mappings are blocked by earlier assignments.

To address these bottlenecks, this paper introduces Bayesian-guided Label Mapping (BLM), a probabilistic many-to-many mapping strategy that leverages the joint distribution of model predictions and ground-truth labels to optimize the output interface.

Methodology

The BLM Framework

Unlike hard binary mappings, BLM constructs a probabilistic mapping matrix where each element represents the conditional probability of a downstream label given a pretrained label. This relationship is derived from the model's predictive behavior on the downstream dataset.

The BLM learning strategy: input images with VR patterns are processed by a fixed model to obtain logits, which are then used to estimate the probabilistic mapping matrix via Bayesian principles.

The process follows an iterative four-step cycle:

  1. Inference: Downstream images with current VR patterns are fed into the fixed model.
  2. Statistics: The joint distribution of predicted pretrained labels and ground-truth downstream labels is calculated.
  3. Mapping Estimation: The Bayesian-guided mapping matrix is updated based on these statistics.
  4. Backpropagation: The input VR pattern is updated to better align with the new mapping.

BLM+: Accounting for Uncertainty

The authors further refine this into BLM+, which aggregates the top-K predicted probabilities rather than just the single most likely label. This allows the model to exploit information from multiple semantically related pretrained categories simultaneously (e.g., mapping "Edamame" to both "Green snake" and "Artichoke" based on visual features).

Experimental Evaluation

The researchers evaluated BLM and BLM+ across 12 diverse downstream datasets, including general objects (CIFAR10/100), fine-grained classification (OxfordPets, StanfordCars), and specialized tasks like satellite imagery (EuroSAT) and action recognition (UCF101). These were tested using pretrained ResNet-18, ResNeXt-101, and the vision-language model CLIP.

Key Results

BLM+ consistently outperformed existing gradient-free mapping methods (RLM, FLM, and ILM) across nearly all benchmarks. As shown in the table below, BLM+ achieved significant accuracy gains over the previous state-of-the-art (ILM).

Performance comparison for padding-based VR. BLM+ demonstrates superior accuracy across almost all datasets and model architectures compared to baseline methods.

Major findings include:

  • ResNet-18 (Padding): BLM+ achieved an average accuracy of 46.7%, a 6.1% improvement over ILM.
  • ResNeXt-101 (Padding): BLM+ reached 53.8% average accuracy, outperforming ILM by 3.8%.
  • Vision-Language Models: Applied to CLIP, BLM+ reached 79.3% average accuracy, demonstrating strong generalization beyond standard CNNs.

Discussion and Interpretability

A primary advantage of BLM is its interpretability. Unlike deep-learning-based output layers that act as "black boxes," the BLM matrix explicitly shows which pretrained classes contribute to a downstream prediction. This provides a principled bridge for understanding how source domain knowledge is repurposed for target tasks.

However, the authors note limitations in tasks with very few classes (e.g., SVHN), where one-to-one mapping is already near-optimal. Additionally, BLM cannot overcome a fundamental domain mismatch if the pretrained model lacks relevant features for the downstream task (e.g., using ImageNet for highly specialized car model classification). Future work may focus on explicitly modeling hierarchical structures between label spaces to further enhance performance and transparency.

Summary updated

BibTeX
@inproceedings{cai2024bayesian,
  author = {Chengyi Cai and Zesheng Ye and Lei Feng and Jianzhong Qi and Feng Liu},
  title = {{Bayesian-guided Label Mapping for Visual Reprogramming}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2024},
  url = {https://openreview.net/forum?id=135eKqDoRR},
}
Figure