Tensor feature hallucination for few-shot learning

Michalis Lazarou, Tania Stathaki, Yannis Avrithis

Abstract

Deep learning models typically require vast amounts of labeled data, making few-shot learning (FSL) a significant challenge. One effective strategy is "hallucination," where generative models create synthetic data to augment small training sets. This paper presents Tensor Feature Hallucination (TFH), a novel approach that generates synthetic 3D tensor features instead of standard 1D vectors. By operating on tensors before spatial dimensions are collapsed, TFH preserves vital structural information. Our results demonstrate that a simple architecture using Mean Squared Error (MSE) loss can outperform complex generative frameworks, setting new benchmarks in FSL.

Introduction

The primary hurdle in few-shot learning is the scarcity of labeled examples, which often leads to overfitting in high-capacity deep networks. While data augmentation through hallucination has shown promise, existing methods often rely on generating 1D feature vectors. These vectors are typically the result of Global Average Pooling (GAP), which discards spatial relationships crucial for fine-grained classification. TFH addresses this by hallucinating 3D tensors, maintaining the "where" and "what" of feature representations.

Methodology

The TFH framework consists of a backbone feature extractor and a hallucination module comprising a conditioner and a generator.

The Tensor Feature Hallucination (TFH) pipeline overview.

1. Conditioner ($h$)

The conditioner takes a "prototype" tensor—the mean feature map of the available support samples—and maps it to a class-conditional vector. This vector serves as the context for the generation process.

2. Generator ($g$)

The generator combines the class-conditional vector with a random noise vector ($z$) sampled from a normal distribution. It then "hallucinates" new, diverse 3D tensor features ($d \times h \times w$). Unlike complex GANs, TFH uses a simple Mean Squared Error (MSE) reconstruction loss, which provides greater stability in low-data regimes.

3. Training and Augmentation

The backbone is pre-trained using self-distillation to ensure robust initial representations. During the few-shot task, the hallucinated tensors are combined with real support tensors to train the final classifier.

Key Insights

The Importance of Spatial Information

A core finding of this work is that 3D tensors contain significantly more reconstructible information than 1D vectors. When features are pooled into 1D vectors, structural details are lost.

Visual comparison of image reconstructions from 3D tensors (middle row) versus 1D vectors (bottom row).

As shown in the figure above, images reconstructed from 3D tensors (middle row) clearly resemble the original birds, whereas reconstructions from 1D vectors (bottom row) result in indistinct, blurry blobs. This visual evidence confirms that maintaining spatial dimensions is critical for effective feature hallucination.

Simplicity and Generalization

In few-shot scenarios, overly sophisticated generative models (e.g., Wasserstein GANs) are prone to instability and overfitting. The authors found that a straightforward conditioner-generator architecture with MSE loss generalizes better to unseen classes. Diversity is introduced through latent noise, creating a "cloud" of synthetic features that improves classifier robustness.

Experimental Results

TFH was evaluated on several standard benchmarks, achieving state-of-the-art (SOTA) results:

  • miniImageNet: Achieved 65.07% accuracy in 1-shot tasks, a ~3% improvement over previous hallucination methods.
  • CUB (Caltech-UCSD Birds): Reached 75.76% in 1-shot tasks, highlighting its effectiveness in fine-grained scenarios.
  • Cross-Domain Robustness: When trained on miniImageNet and tested on CUB, TFH outperformed baselines, demonstrating strong generalization across domain shifts.

Ablation studies further revealed that generating even a small number of synthetic features per class (1 or 2) provides a substantial performance boost (~4%) compared to no hallucination.

Conclusion

Tensor Feature Hallucination offers a powerful yet simple alternative to traditional vector-based augmentation in few-shot learning. By preserving spatial information through 3D tensors and utilizing a stable MSE-based generation process, TFH achieves superior performance across diverse benchmarks. Future work will explore more advanced tensor-manipulation architectures and the application of TFH to long-tailed and incremental learning tasks.

Summary updated

BibTeX
@inproceedings{lazarou2022tensor,
  author = {Michalis Lazarou and Tania Stathaki and Yannis Avrithis},
  title = {{Tensor feature hallucination for few-shot learning}},
  booktitle = {IEEE/CVF Winter Conference on Applications of Computer Vision},
  year = {2022},
  doi = {10.1109/wacv51458.2022.00211},
}
Figure