Few-Shot Learning with Visual Distribution Calibration and Cross-Modal Distribution Alignment

Runqi Wang, Hao Zheng, Xiaoyue Duan, Jianzhuang Liu, Yuning Lu, Tian Wang, Songcen Xu, Baochang Zhang · DOI

Introduction

Adapting massive vision-language models (VLMs) like CLIP to specific downstream tasks typically requires substantial labeled datasets. However, in many real-world scenarios, only a handful of examples per category are available. This paper introduces SADA (Selective Attack and Distribution Alignment), a framework designed to fine-tune CLIP for few-shot learning by addressing two fundamental challenges: visual noise and the misalignment between image and text representations.

The Challenges of Few-Shot Learning in VLMs

Pre-trained models like CLIP are exceptionally powerful, yet they encounter two major hurdles when applied to few-shot scenarios (ranging from 1 to 16 training images):

  1. Visual Distraction: With limited samples, models often overfit to class-irrelevant information. For instance, if every training image of a "bird" features a blue sky, the model may incorrectly associate the sky with the class label rather than the bird itself.
  2. The Modality Gap: Although CLIP is trained on image-text pairs, the distribution of visual features and textual features for the same class often lack perfect alignment. In low-data regimes, this gap leads to inaccurate similarity calculations and degraded predictive performance.

The SADA Framework

SADA addresses these issues through three interconnected strategies: Selective Attack, Cross-Modal Distribution Alignment, and a Diverse Augmentation Strategy.

Selective Attack (SA)

The Selective Attack module acts as a sophisticated regularizer. Instead of applying standard data augmentation to the entire image, SA uses trainable adapters to generate a spatial attention map. This map identifies "class-irrelevant" areas—such as cluttered or repetitive backgrounds—and applies Gaussian perturbations (noise) to them. By intentionally degrading the background, the framework forces the model to focus on the stable, critical features of the actual object to maintain classification accuracy, effectively calibrating the visual distribution.

Cross-Modal Distribution Alignment (CMDA)

To bridge the modality gap, the authors introduce Vision-Language Prototypes (VLPs). Alignment is treated as a distribution problem rather than a simple point-to-point comparison. SADA utilizes the Earth Mover’s Distance (EMD)—a metric that measures the cost of transforming one distribution into another—to minimize the distance between visual and textual representations. To ensure computational efficiency, the authors derived a mathematical upper bound for EMD, reducing its complexity from $O(D^3 \log D)$ to $O(D)$, making it feasible for rapid fine-tuning.

Diverse Augmentation Strategy

To further improve robustness, SADA employs a strategy that divides text prompts into groups and pairs them with specific image augmentations (such as flipping or color jittering). This prevents the model from simply memorizing a single "soft prompt" and instead encourages it to learn a robust distribution of meanings across different visual contexts.

Experimental Evaluation

The researchers evaluated SADA across 11 standard classification benchmarks, spanning various domains:

  • General Classification: ImageNet-1k, CIFAR10, CIFAR100, STL-10.
  • Fine-grained Recognition: Oxford-IIIT Pets, Food101, Stanford Cars, FGVC Aircraft.
  • Specialized Tasks: Caltech-101 (objects), DTD (textures), and UCF-101 (action recognition).

Key Results

SADA achieved state-of-the-art results across the board:

  • Consistent Superiority: SADA outperformed previous leading methods, including ProDA, CoOp, and CLIP-Adapter, on all 11 datasets.
  • Significant 1-Shot Gains: On the challenging CIFAR10 dataset, SADA improved 1-shot accuracy by 3.36% over the previous best-performing model (ProDA).
  • Robustness Across Scales: Whether provided with 1, 2, 4, 8, or 16 shots, SADA maintained a significant performance lead, demonstrating its versatility regardless of the specific task or data volume.

Conclusion and Future Work

SADA demonstrates that by combining targeted visual regularization with geometric distribution alignment, VLMs can be significantly more effective in data-scarce environments. While the current work focuses on image classification, the authors suggest that the principles of Selective Attack and CMDA could be extended to more complex tasks such as object detection and semantic segmentation. Future research may also focus on dynamically learning the distribution calibration ratio to further optimize performance without manual hyper-parameter tuning.

Summary updated

BibTeX
@misc{wang2023few,
  author = {Runqi Wang and Hao ZHENG and Xiaoyue Duan and Jianzhuang Liu and Yuning Lu and Tian Wang and Songcen Xu and Baochang Zhang},
  title = {{Few-Shot Learning with Visual Distribution Calibration and Cross-Modal Distribution Alignment}},
  year = {2023},
  eprint = {2305.11439},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2305.11439},
}
Figure