Intra-Task Mutual Attention-Based Vision Transformer for Few-Shot Learning

Wei Jiang, Chang Liu, Kun HeIEEE TCSVT 2024

Introduction

Few-Shot Learning (FSL) seeks to enable models to recognize new concepts from a minimal number of examples, mirroring human cognitive abilities. A persistent challenge in this field is "supervision collapse," where models overfit to task-specific noise, such as backgrounds, rather than learning robust semantic features. While Vision Transformers (ViTs) have shown promise, traditional approaches process support and query sets independently, missing opportunities to identify shared discriminative features.

The IMAformer Framework

The Intra-task Mutual Attention based Vision Transformer (IMAformer) addresses this by introducing a mechanism for support and query images to interact during feature extraction.

Architecture and Token Swapping

IMAformer utilizes a ViT backbone pre-trained with Masked Image Modeling (MAE), providing a rich semantic foundation. The core innovation lies in the Intra-task Mutual Attention mechanism. In a standard ViT, images are represented by patch tokens (local features) and a CLS token (global feature). IMAformer swaps these tokens: the CLS token from the query image is combined with patch tokens from the support images, and vice versa.

The IMAformer architecture illustrating the token-swapping mechanism between support and query sets.

This "crossed" interaction, typically applied in the final Transformer layer, forces the global representation of one set to attend to the local details of the other. This process helps the model focus on shared semantic content relevant to the specific few-shot task.

Efficient Fine-Tuning

To maintain efficiency and prevent overfitting to small datasets, IMAformer employs a meta-learning strategy that fine-tunes only the final layers and the CLS token modules. This preserves the general visual knowledge captured during self-supervised pre-training while adapting the model to the nuances of few-shot classification.

Experimental Evaluation

The model was rigorously tested on five major benchmarks: miniImageNet, tieredImageNet, CIFAR-FS, FC100, and the fine-grained CUB-200-2011. These datasets cover a range of image resolutions and classification difficulties.

Performance Highlights

IMAformer achieved significant performance gains over previous state-of-the-art methods such as HCTransformer and FewTURE. Notably, on the miniImageNet 1-shot task, the ViT-Base version of IMAformer reached an accuracy of 85.68%, representing a substantial improvement over existing baselines.

Comparative results on miniImageNet and tieredImageNet benchmarks.

The model also excelled in fine-grained classification on the CUB dataset, achieving 89.30% (1-shot) and 95.80% (5-shot) accuracy. This demonstrates that mutual attention effectively captures the subtle differences required for distinguishing closely related classes.

Discussion and Conclusion

The success of IMAformer underscores the importance of task-specific context in feature extraction. By allowing support and query sets to "talk" to each other, the model dynamically prioritizes relevant features.

However, the research also identified a trade-off regarding fine-tuning depth; modifying too many layers can lead to a loss of generalizable knowledge. Additionally, while the fine-tuning process is efficient, the computational requirements of the ViT-Base backbone remain a consideration for resource-constrained environments. Future work may explore extending this mutual attention framework to other few-shot tasks such as object detection and segmentation.

Summary updated

BibTeX
@misc{jiang2024intra,
  author = {Wei Jiang and Chang Liu and Kun He},
  title = {{Intra-Task Mutual Attention-Based Vision Transformer for Few-Shot Learning}},
  year = {2024},
  eprint = {2405.03109},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2405.03109},
}
Figure