Few-shot Image Classification: Just Use a Library of Pre-trained Feature Extractors and a Simple Classifier

Arkabandhu Chowdhury, Mingchao Jiang, Swarat Chaudhuri, Chris Jermaine · DOI

TL;DR

This paper proposes a surprisingly simple yet highly effective approach to few-shot image classification: leverage a diverse library of pre-trained deep neural networks as feature extractors and train a simple classifier on top. This "library-based" method significantly outperforms state-of-the-art meta-learning algorithms, demonstrating that diversity in pre-trained features is more crucial than model size or sophisticated meta-learning strategies for cross-domain few-shot tasks.

What Problem Does This Paper Address?

Few-shot image classification (FSIC) is a challenging problem where a model must learn to classify new categories with very few labeled examples (e.g., one or five per class). This is particularly difficult in "cross-domain" FSIC, where the new categories are unrelated to the data the model was initially trained on. Traditional approaches often involve complex meta-learning techniques designed to "learn to learn." However, recent work suggests that transfer learning from large, pre-trained models might be more effective. This paper explores this hypothesis by asking: can we achieve state-of-the-art FSIC performance simply by using a collection of high-quality, pre-trained feature extractors and a basic classifier, without resorting to complex meta-learning?

Methods

The core idea is to treat pre-trained deep convolutional neural networks (CNNs) as off-the-shelf feature extractors. The authors take several well-established, pre-trained CNN architectures (like ResNets and DenseNets) trained on the large-scale ILSVRC2012 dataset. For each pre-trained CNN, they remove the final classification layer, leaving a feature extractor that maps an image to a high-dimensional embedding.

To build a few-shot learner, they then train a simple feed-forward neural network (a multi-layer perceptron with one hidden layer and a softmax output) on top of these extracted features. Crucially, they use L2 regularization to prevent overfitting, especially when dealing with very few training examples.

The paper explores two main strategies:

  1. Single Library Learner: Using a single pre-trained CNN as a feature extractor.
  2. Full Library Learner: Ensembling the features from multiple pre-trained CNNs. This is achieved by concatenating the feature vectors from several CNNs and then training a single MLP on this combined feature space.

Hyperparameter tuning (learning rate, epochs, regularization strength, etc.) was performed using a dedicated validation set (Caltech-UCSD Birds 200) to ensure a fair "out-of-the-box" evaluation on unseen test datasets.

Datasets

The primary dataset used for training the feature extractors is ILSVRC2012.

For evaluation, the authors use a diverse set of eight benchmark datasets:

  • FGVC-Aircraft
  • FC100
  • Omniglot
  • Texture
  • Traffic Sign
  • FGCVx Fungi
  • Quick Draw
  • VGG Flower

The Caltech-UCSD Birds 200 dataset was used exclusively for hyperparameter validation.

Key Insights and Ideas

  • Diversity Trumps Size (and Complexity): The most significant finding is that an ensemble of diverse, high-quality, pre-trained feature extractors (even if trained on a smaller dataset like ILSVRC2012) consistently outperforms single, larger models (like Google's "Big Transfer" models trained on the full ImageNet) and sophisticated meta-learning algorithms.
  • Simplicity is Powerful: A straightforward approach of using pre-trained features with a simple MLP and L2 regularization is remarkably effective for cross-domain few-shot learning, challenging the notion that complex meta-learning is always necessary.
  • Feature Importance is Task-Dependent: The analysis of feature importance suggests that different datasets and tasks rely on different subsets of features. This highlights why a diverse library of feature extractors is beneficial, as it increases the probability of having relevant features for any given task.
  • Few-Shot Fine-Tuning is Surprisingly Easy: The paper provides evidence that even with very few data points, the learned weights in a few-shot setting show high correlation with weights learned from full data, suggesting that the core feature representations are robust and easily adaptable.

Key Results

  • The "Full Library" approach (combining features from nine ILSVRC2012-trained CNNs) consistently outperformed all other methods, including state-of-the-art meta-learning algorithms like MAML, MatchingNet, and ProtoNet, across various "m-way n-shot" settings (e.g., 5-way 1-shot, 20-way 5-shot).
  • For example, on the 20-way, 5-shot problem, the best library-based learner achieved accuracies significantly higher than competitive methods. For instance, on the Texture dataset, the best library-based learner achieved 83.4% accuracy, while MAML achieved only 27.0%.
  • The "Full Library" method also outperformed Google's "Big Transfer" models (trained on the full ImageNet) on several datasets, particularly for the 40-way task, where it achieved an average of 11% higher accuracy.
  • The paper demonstrates that even a single, well-chosen pre-trained CNN from the library can often outperform complex meta-learning methods.

Limitations and Future Work

  • Computational Cost: While effective, using an ensemble of nine deep CNNs for feature extraction can be computationally expensive during inference. Future work could explore methods to reduce this cost.
  • Library Size: The paper conjectures that increasing the size of the library of pre-trained CNNs might further improve performance, but this was not extensively tested.
  • Simpler MLP: The paper uses a simple MLP. Future work could investigate if more complex classifiers on top of the extracted features would yield further improvements.
  • Alternative Transfer Methods: The paper focuses on using pre-trained CNNs as fixed feature extractors. Exploring other transfer learning techniques or fine-tuning strategies could be a direction for future research.

Summary updated

BibTeX
@inproceedings{chowdhury2021few,
  author = {Arkabandhu Chowdhury and Mingchao Jiang and Swarat Chaudhuri and Chris Jermaine},
  title = {{Few-shot Image Classification: Just Use a Library of Pre-trained Feature Extractors and a Simple Classifier}},
  booktitle = {IEEE/CVF International Conference on Computer Vision},
  year = {2021},
  doi = {10.1109/iccv48922.2021.00931},
}
Figure