Multi-Attention Based Visual-Semantic Interaction for Few-Shot Learning

Peng Zhao, Yin Wang, Wei Wang, Jie Mu, Huiting Liu, Cong Wang, Xiaochun CaoIJCAI 2024

Abstract

Few-Shot Learning (FSL) aims to train a model that can generalize to recognize new classes, with each new class having only very limited training samples. Since extracting discriminative features for new classes with few samples is challenging, existing FSL methods leverage visual and semantic prior knowledge to guide discriminative feature learning. However, for meta-learning purposes, the semantic knowledge of the query set is unavailable, so their features lack discriminability. To address this problem, we propose a novel Multi-Attention based Visual-Semantic Interaction (MAVSI) approach for FSL. Specifically, we utilize spatial and channel attention mechanisms to effectively select discriminative visual features for the support set based on its ground-truth semantics while using all the support set semantics for each query set sample. Then, a relation module with class prototypes of the support set is employed to supervise and select discriminative visual features for the query set. To further enhance the discriminability of the support set, we introduce a visual-semantic contrastive learning module to promote the similarity between visual features and their corresponding semantic features. Extensive experiments on four benchmark datasets demonstrate that our proposed MAVSI could outperform existing state-of-the-art FSL methods.

Introduction

Few-Shot Learning (FSL) remains a significant challenge in computer vision, primarily due to the difficulty of learning discriminative features from extremely limited data. When presented with only one or five examples of a new category, standard deep learning models often struggle to distinguish between relevant object features and irrelevant background noise. Humans, by contrast, utilize prior semantic knowledge to guide their visual perception—knowing the definition of a specific bird species helps us focus on its unique plumage or beak shape.

Overview of the MAVSI framework using semantic guidance to refine visual features and improve classification scores.

The MAVSI (Multi-Attention based Visual-Semantic Interaction) framework addresses this by treating semantic information (such as category names) as a dynamic filter. As shown in the figure above, integrating semantic knowledge allows the feature extractor to produce heatmaps that focus more accurately on the object of interest, leading to higher confidence scores in the relation module.

Methodology

The MAVSI architecture is built upon three core pillars designed to align visual representations with semantic embeddings (typically generated via pre-trained models like Glove).

The complete MAVSI architecture, illustrating the flow from image/label input through multi-attention interaction and contrastive learning to the final relation score.

1. Spatial Cross-Attention Visual-Semantic Interaction (SCAVSI)

This module performs multi-head cross-attention between visual feature maps and semantic embeddings. It identifies which spatial regions of an image are most relevant to the class semantics, effectively suppressing background noise and highlighting the object's most discriminative parts.

2. Channel Attention Visual-Semantic Interaction (CAVSI)

Beyond spatial location, specific feature channels may be more indicative of certain classes. CAVSI utilizes an MLP-based generator to produce channel-wise weights based on semantic input, further refining the feature representation by emphasizing the most informative channels for a given category.

3. Visual-Semantic Contrastive Learning (VSCL)

To ensure robust alignment, the VSCL module introduces a contrastive loss. This forces the model to maximize the similarity between an image's visual features and its corresponding ground-truth semantic embedding while minimizing similarity to embeddings of other classes. This alignment ensures that the visual features are semantically meaningful.

Handling the Query Set

A unique challenge in FSL is that query (test) labels are unknown during inference. MAVSI overcomes this by generating multiple versions of the query features—one for each candidate class in the support set. A Relation Module then compares these refined query features against class prototypes to determine the final classification score.

Experimental Results

The MAVSI model was evaluated on four standard FSL benchmarks: miniImageNet, tieredImageNet, CUB-2011, and CIFAR-FS. Key findings include:

  • State-of-the-Art Performance: MAVSI achieved SOTA results across all datasets. Notably, on tieredImageNet, it reached 74.61% in the 1-shot setting, a 2.43% improvement over previous benchmarks.
  • Fine-Grained Success: On the CUB-2011 bird dataset, MAVSI reached 85.21% (1-shot), demonstrating that semantic guidance is particularly powerful for distinguishing between visually similar species.
  • Ablation Studies: Experiments confirmed that SCAVSI, CAVSI, and VSCL are all essential; removing any single component resulted in a measurable drop in accuracy.

Conclusion

MAVSI demonstrates that semantic information is a powerful tool for denoising visual features in few-shot scenarios. By leveraging both spatial and channel-level attention guided by class semantics, the model learns to focus on what truly matters. Future work may involve integrating even more powerful vision-language models like CLIP to provide richer semantic priors and exploring cross-domain FSL where the distribution shift between training and testing is more extreme.

Summary updated

BibTeX
@inproceedings{zhao2024multi,
  author = {Peng Zhao and Yin Wang and Wei Wang and Jie Mu and Huiting Liu and Cong Wang and Xiaochun Cao},
  title = {{Multi-Attention Based Visual-Semantic Interaction for Few-Shot Learning}},
  booktitle = {International Joint Conference on Artificial Intelligence},
  year = {2024},
  url = {https://openreview.net/forum?id=CIkPMnd0Bf},
}
Figure