Tensor feature hallucination for few-shot learning

Michalis Lazarou, Yannis Avrithis, Tania Stathaki

Abstract

Few-shot learning addresses the challenge of learning how to address novel tasks given not just limited supervision but limited data as well. An attractive solution is synthetic data generation. However, most such methods are overly sophisticated, focusing on high-quality, realistic data in the input space. It is unclear whether adapting them to the few-shot regime and using them for the downstream task of classification is the right approach. Previous works on synthetic data generation for few-shot classification focus on exploiting complex models, e.g. a Wasserstein GAN with multiple regularizers or a network that transfers latent diversities from known to novel classes. We follow a different approach and investigate how a simple and straightforward synthetic data generation method can be used effectively. We make two contributions, namely we show that: (1) using a simple loss function is more than enough for training a feature generator in the few-shot setting; and (2) learning to generate tensor features instead of vector features is superior. Extensive experiments on miniImagenet, CUB and CIFAR-FS datasets show that our method sets a new state of the art, outperforming more sophisticated few-shot data augmentation methods.

Introduction

Deep learning models are notoriously data-hungry, but in many real-world scenarios—like identifying rare species—we only have a handful of labeled examples. This is the few-shot learning (FSL) challenge. One popular way to address this is "data hallucination": using a generative model to create synthetic data to "fill in" the gaps in the training set. However, most existing methods focus on two things that might be counterproductive: image-space realism (which is computationally expensive) and vector-space hallucination (generating 1D features after Global Average Pooling).

The authors argue that by collapsing a 3D feature map into a 1D vector, we throw away the spatial and structural details necessary to model the underlying data distribution effectively.

Methodology: Tensor Feature Hallucination

The authors propose a "less is more" approach. Instead of complex adversarial setups (like GANs) or variational inference (VAEs), they use a straightforward Conditioner-Generator architecture to hallucinate 3D tensor features.

Overview of the Tensor Feature Hallucination (TFH) pipeline.

The pipeline consists of several key stages:

  1. Feature Extraction: A backbone (like ResNet-18) is pre-trained to extract high-quality tensor features.
  2. Conditioner ($h$): Maps a "prototype" tensor (the average feature map of the few available real samples) to a class-conditional vector.
  3. Generator ($g$): Takes the class vector plus random noise to "hallucinate" a new 3D tensor ($d \times h \times w$).
  4. Simple Loss: Unlike the complex regularizers used in previous work, TFH uses a simple Mean Squared Error (MSE) loss to make generated tensors look like the class prototype.
  5. Augmentation and Classification: At inference, synthetic tensors are combined with real ones to train a simple classifier (e.g., Prototypical Classifier, SVM).

Key Insights and Results

The core "aha moment" of this research is that spatial structure matters significantly for feature generation. The authors demonstrated this by training image reconstructors to visualize what information is preserved in different feature formats.

Visual comparison of reconstructions from (top) original images, (middle) 3D tensor features, and (bottom) 1D vector features.

As seen in Figure 1, images reconstructed from 3D tensors retain recognizable object structures, whereas those from 1D vectors appear as blurry blobs. This preservation of spatial information allows a simple generator to outperform much more complex models.

Performance Benchmarks

TFH consistently outperformed more sophisticated methods across standard benchmarks:

  • miniImageNet (1-shot): Achieved 64.49% accuracy, outperforming the previous best hallucination method (AFHN) by over 2%.
  • CUB (1-shot): Reached 75.66%, highlighting its strength in fine-grained tasks where spatial details (like the shape of a bird's beak) are crucial.
  • Ablation Study: Comparing TFH to a version that only generates vectors (VFH) showed a nearly 3% improvement on miniImageNet, confirming that the 3D structure is the "secret sauce."

Conclusion

TFH demonstrates that for few-shot classification, utility in the feature space is more important than visual realism in the image space. By moving from vectors to tensors, the authors found they didn't need the "bells and whistles" of modern generative training. A simple MSE loss was enough to set new state-of-the-art records. Future work may explore applying this "tensor hallucination" concept to other domains like long-tailed recognition or incremental learning.

Summary updated

BibTeX
@inproceedings{lazarou2022tensor,
  author = {Michalis Lazarou and Yannis Avrithis and Tania Stathaki},
  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