Rich Semantics Improve Few-shot Learning

Mohamed Afham, Salman H. Khan, Muhammad Haris Khan, Muzammal Naseer, Fahad Shahbaz KhanBMVC 2021

Introduction: The Semantic Gap in Few-Shot Learning

Traditional few-shot learning (FSL) models are typically trained to map images to numerical class IDs (e.g., "Class 42"). While effective for standard classification, this approach ignores the rich semantic context humans utilize. When learning a new concept, humans often rely on descriptions—for example, identifying a "Goldfinch" by its "yellow body and black wings."

Numerical labels provide no information about the relationships between classes or the specific attributes that define them. This creates a "semantic gap" where models may overfit to non-essential visual noise rather than learning meaningful features. The authors of "Rich Semantics for Few-Shot Learning" (RS-FSL) argue that by incorporating class-level language descriptions, models can better disambiguate visually similar categories and generalize to unseen classes.

The RS-FSL Framework

The proposed RS-FSL framework introduces a generative auxiliary task during training: predicting the natural language description of the object class. The architecture consists of two primary branches:

  1. Classification Branch: A standard visual backbone (e.g., ResNet-12) extracts features and uses a Prototypical Network to classify query images based on their distance to a class "prototype."
  2. Language Branch: This branch forces the model to extract shared, semantically relevant features. It utilizes "Hybrid Prototypes"—averaging features from both support and query images—which are then decoded into text descriptions.
The RS-FSL architecture featuring the Classification and Language branches.

A key innovation is the Bidirectional Transformer Decoder, which decodes the hybrid prototype in both forward (left-to-right) and backward (right-to-left) directions. This approach helps the model capture long-range dependencies in language and relate visual cues to specific descriptive tokens. During inference, the language branch is discarded, allowing the model to perform standard classification while benefiting from the enriched visual features learned during training.

Experimental Evaluation

The researchers evaluated RS-FSL across several benchmarks, including CUB-Birds, VGG-Flowers, miniImageNet, and ShapeWorld. The results demonstrate that forcing the model to "explain" classes in words acts as a powerful regularizer, pushing the visual backbone toward semantically meaningful attributes like beak shape or wing color.

Performance comparison of RS-FSL against state-of-the-art baselines on miniImageNet and CUB datasets.

As shown in the results, RS-FSL achieved significant improvements over state-of-the-art baselines. On the fine-grained CUB-Birds dataset, it achieved 65.66% accuracy, a 6.36% improvement over the Meta-Baseline. On miniImageNet, it reached 65.33% accuracy, outperforming the baseline by 2.16%. The method proved to be "plug-and-play," providing gains regardless of whether the underlying backbone was a simple Conv-4 or a more complex ResNet-12.

Key Insights and Limitations

The study highlights that language serves as an effective "human prior," aligning internal representations with human descriptions and making features more transferable. Furthermore, the generative branch provides a level of interpretability; if a model fails, the generated description can reveal which visual attribute caused the confusion.

However, the method's dependency on class-level descriptions remains a limitation. While lower-cost than per-image captions, these still require manual effort or external data. The performance variation between datasets suggests that the model is sensitive to the quality and diversity of the provided text descriptions. Future work may explore integrating these descriptions more actively during inference or using self-supervised objectives to further refine visual-semantic alignment.

Summary updated

BibTeX
@misc{afham2021rich,
  author = {Mohamed Afham and Salman H. Khan and Muhammad Haris Khan and Muzammal Naseer and Fahad Shahbaz Khan},
  title = {{Rich Semantics Improve Few-shot Learning}},
  year = {2021},
  eprint = {2104.12709},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2104.12709},
}
Figure