A Feature Generator for Few-Shot Learning

Heethanjan Kanagalingam, Thenukan Pathmanathan, Navaneethan Ketheeswaran, Mokeeshan Vathanakumar, Mohamed Afham, Ranga Rodrigo

TL;DR

This paper introduces a novel feature generator that boosts Few-Shot Learning (FSL) performance by synthesizing visual features from class-level textual descriptions. By training a conditional generator with a triple-loss objective—classifier, discriminator, and cosine distance—the authors effectively double the available data in low-shot scenarios, leading to accuracy gains of up to 10% in 1-shot tasks.

What Problem Does This Paper Address?

Few-Shot Learning (FSL) is the "holy grail" of efficient AI: training a model to recognize a new category (like a specific rare bird) using only one or five examples. The primary challenge is that with so few images, the resulting "embeddings" (the mathematical representations of the images) are often inaccurate or unrepresentative of the class as a whole.

While many researchers have tried to solve this using meta-learning or simple data augmentation, there is a persistent gap in how we use multimodal information. Specifically, humans don't just look at a picture; we use descriptions (e.g., "a bird with a long yellow beak") to help us categorize. This paper tackles the scarcity of visual data by "hallucinating" new, high-quality visual features derived from these semantic textual descriptions.

Methods

The authors propose a Feature Generator architecture that acts as a plug-in module for existing FSL baselines.

  1. Semantic Extraction: They use a pre-trained CLIP encoder to turn class-level textual descriptions into semantic features.
  2. The Generator: A conditional generator (comprising three fully connected layers) takes these semantic features and produces synthetic visual features.
  3. The Triple-Loss Strategy: This is the core innovation. To ensure the generated features are both realistic and class-accurate, they optimize three losses simultaneously:
  4. Classifier Loss ($L_c$): Ensures the generated feature is recognizable as the correct class by a pre-trained classifier.
  5. Discriminator Loss ($L_d$): A standard GAN-style loss where a discriminator tries to tell "real" image features from "fake" generated ones.
  6. Cosine Distance Loss ($L_\theta$): Forces the generated features to align closely with the "true class embedding" (the mean of all real features for that class).
  7. Data Augmentation: During inference, these synthetic features are added to the real support set, effectively transforming an $n$-shot problem into a $2n$-shot problem.

Datasets

The model was evaluated on two gold-standard benchmarks for few-shot classification:

  • miniImageNet: A subset of ImageNet with 100 classes (600 images each), split into 64 base, 16 validation, and 20 novel classes.
  • tieredImageNet: A larger, more complex subset with 608 classes sampled from a hierarchical structure, providing a more rigorous test of generalization.

Key Insights and Ideas

  • Text as a Prior: The "aha moment" here is that textual descriptions provide a stable anchor. While a single image might be an outlier (e.g., a dog partially hidden by a tree), a description like "golden retriever with long fur" describes the prototype of the class.
  • The Power of the Mean: By using the "true class embedding" (the average of all features in a class) as a target for the distance loss, the generator learns to produce features that gravitate toward the center of the class distribution rather than the noisy fringes.
  • Plug-and-Play Utility: The generator isn't a standalone model; it’s a module. The authors demonstrated this by plugging it into two different baselines (Meta-Baseline and Free Lunch), seeing significant improvements in both.

Key Results

The quantitative jumps are impressive, particularly in the most difficult 1-shot scenarios:

  • 1-Shot Performance: On miniImageNet, adding the generator to the Meta-Baseline improved accuracy from 63.17% to 74.62%—a massive ~11% absolute gain.
  • 5-Shot Performance: Improvements were smaller but still significant, around 1.2% to 5% across different datasets and baselines.
  • Ablation Success: The authors showed that using both visual and textual features to guide the generator (Visual + Textual Generator) outperformed using visual features alone, proving that semantic descriptions contain unique, discriminative information that pixels alone might miss.

Limitations and Future Work

While the results are strong, the paper notes a few areas for growth:

  • Description Quality: The method relies on high-quality textual descriptions. If the descriptions are vague or inaccurate, the generated features might mislead the model.
  • Scalability: While tested on tieredImageNet, the authors suggest that testing on even more diverse and massive datasets is necessary to confirm the approach's robustness in "in-the-wild" applications.
  • Refining the Generation: Future work will look at more sophisticated ways to incorporate semantic information beyond simple concatenation or averaging.

Summary updated

BibTeX
@inproceedings{kanagalingam2024feature,
  author = {Heethanjan Kanagalingam and Thenukan Pathmanathan and Navaneethan Ketheeswaran and Mokeeshan Vathanakumar and Mohamed Afham and Ranga Rodrigo},
  title = {{A Feature Generator for Few-Shot Learning}},
  booktitle = {Accv},
  year = {2024},
  doi = {10.1007/978-981-96-0885-0\_17},
}
Figure