Improving Visual Prompt Tuning by Gaussian Neighborhood Minimization for Long-Tailed Visual Recognition

Mengke Li, Ye Liu, Yang Lu, Yiqun Zhang, Yiu-ming Cheung, Hui Huang

TL;DR

This paper introduces Gaussian Neighborhood Minimization Prompt Tuning (GNM-PT), a novel optimization strategy that flattens the loss landscape to improve visual recognition on long-tailed datasets. By minimizing the average loss within a random parameter neighborhood, GNM-PT achieves better generalization than existing methods like SAM, with reduced computational overhead.

What Problem Does This Paper Address?

Real-world datasets often exhibit a "long-tail" distribution, meaning a few classes have many samples (head classes), while most classes have very few (tail classes). This imbalance severely hinders model performance, especially on those rare tail classes, even when using powerful pre-trained models and techniques like Visual Prompt Tuning (VPT). While methods like Sharpness-Aware Minimization (SAM) can improve generalization by finding "flat" minima in the loss landscape, they are computationally expensive (requiring two gradient computations per step) and can still be biased towards head classes. This paper aims to address the dual challenge of improving tail-class performance and reducing computational cost in long-tailed visual recognition.

Methods

The core contribution is Gaussian Neighborhood Minimization Prompt Tuning (GNM-PT). Instead of SAM's approach of finding the maximum loss within a parameter neighborhood, GNM-PT minimizes the average loss within a random neighborhood defined by Gaussian noise. This is achieved by introducing a novel Gaussian Neighborhood Loss (LGN). This method is applied to Visual Prompt Tuning (VPT), a parameter-efficient fine-tuning technique.

Key aspects of GNM-PT:

  • Random Perturbation: Uses random noise sampled from a Gaussian distribution to explore the parameter neighborhood, making it less dependent on head-class gradients.
  • Single Gradient Computation: Requires only one gradient computation per step, significantly reducing computational overhead compared to SAM.
  • Theoretical Foundation: The paper provides theoretical justification for why minimizing the average loss in a neighborhood leads to a tighter upper bound and better generalization.
  • Merge Prompt (MP) Technique: An additional technique is proposed where the learned prompt tokens are merged with the class token to better leverage learned information.

Datasets

The paper evaluates GNM-PT on three standard long-tailed visual recognition benchmarks:

  • CIFAR100-LT: A version of CIFAR100 with artificially created long-tailed distributions, using imbalance ratios (IR) of 200, 100, 50, and 10.
  • iNaturalist2018: A real-world dataset with an inherent long-tailed distribution, featuring over 8,000 species and an imbalance ratio of 512.
  • Places-LT: A subset of Places365, also artificially truncated to create a long-tailed distribution with an imbalance ratio of 996.

Key Insights and Ideas

  • GNM's Advantage over SAM: Minimizing the average loss in a neighborhood (GNM) is theoretically and empirically shown to be more effective for generalization than minimizing the maximum loss (SAM), especially for long-tailed data.
  • Sample-Independent Perturbation: The random Gaussian perturbation in GNM makes it less susceptible to the bias introduced by head classes, which dominate gradients in sample-dependent methods like SAM.
  • Computational Efficiency: The single-step gradient computation of GNM offers a significant speedup over SAM, making it more practical for large-scale training.
  • Flattened Loss Landscape: GNM-PT demonstrably creates a flatter loss landscape, which is crucial for better model generalization, particularly for tail classes.
  • Prompt Tuning Synergy: GNM-PT effectively complements Visual Prompt Tuning, enhancing its ability to handle imbalanced data.

Key Results

GNM-PT achieves state-of-the-art results on the tested datasets:

  • CIFAR100-LT (IR=100): 90.3% Top-1 accuracy, outperforming previous methods like LPT by over 1%.
  • iNaturalist2018: 76.5% Top-1 accuracy, comparable to methods using supplementary data, despite fewer training epochs.
  • Places-LT: 50.1% Top-1 accuracy.

In terms of computational efficiency, GNM incurs only a negligible increase in computation time per epoch compared to SAM, which takes over 1.8 times longer.

Limitations and Future Work

  • Classifier Re-balancing: The paper acknowledges that while GNM-PT improves overall generalization, further re-balancing of the classifier might be needed. The current re-balancing strategy (DRW) can sometimes degrade head-class performance.
  • Hyperparameter Tuning: The paper investigates the effect of hyperparameters like the variance of the Gaussian distribution, suggesting that further study into optimal settings is warranted.
  • Future Directions: The authors plan to investigate more effective optimization strategies that simultaneously improve feature representation and classifier performance, while also enhancing generalization across all classes. They also aim to explore optimal parameter selection for re-balancing strategies like DRW.

Summary updated

Abstract

Long-tail learning has garnered widespread attention and achieved significant progress in recent times. However, even with pre-trained prior knowledge, models still exhibit weaker generalization performance on tail classes. The promising Sharpness-Aware Minimization (SAM) can effectively improve the generalization capability of models by seeking out flat minima in the loss landscape, which, however, comes at the cost of doubling the computational time. Since the update rule of SAM necessitates two consecutive (non-parallelizable) forward and backpropagation at each step. To address this issue, we propose a novel method called Random SAM prompt tuning (RSAM-PT) to improve the model generalization, requiring only one-step gradient computation at each step. Specifically, we search for the gradient descent direction within a random neighborhood of the parameters during each gradient update. To amplify the impact of tail-class samples and avoid overfitting, we employ the deferred re-weight scheme to increase the significance of tail-class samples. The classification accuracy of long-tailed data can be significantly improved by the proposed RSAM-PT, particularly for tail classes. RSAM-PT achieves the state-of-the-art performance of 90.3\%, 76.5\%, and 50.1\% on benchmark datasets CIFAR100-LT (IF 100), iNaturalist 2018, and Places-LT, respectively. The source code is temporarily available at https://github.com/Keke921/GNM-PT.
BibTeX
@inproceedings{li2024improving,
  author = {Mengke Li and Ye Liu and Yang Lu and Yiqun Zhang and Yiu-ming Cheung and Hui Huang},
  title = {{Improving Visual Prompt Tuning by Gaussian Neighborhood Minimization for Long-Tailed Visual Recognition}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2024},
  url = {https://openreview.net/forum?id=7lMN6xoBjb},
}
Figure