Self-Supervised Prototypical Transfer Learning for Few-Shot Classification

Carlos Medina, Arnout Devos, Matthias GrossglauserarXiv 2020

Abstract

Few-shot classification (FSC) traditionally relies on large labeled datasets for meta-learning. However, label scarcity and domain shift remain significant challenges in real-world applications. We present ProtoTransfer, a novel self-supervised framework that eliminates the need for labels during pre-training. By integrating contrastive learning with prototypical fine-tuning, ProtoTransfer outperforms existing unsupervised meta-learning methods and achieves competitive performance with supervised models, particularly in challenging cross-domain scenarios.

Introduction

Few-shot classification aims to train models that can recognize novel categories from just a handful of examples. Standard approaches require massive "base" datasets with labels to train a robust feature extractor. This paradigm faces two major hurdles: label scarcity, where expert labeling is costly or unavailable (e.g., medical imaging), and domain shift, where models fail when test data distributions differ significantly from training data (e.g., transitioning from ImageNet to satellite imagery).

While unsupervised meta-learning has been proposed to address label scarcity, it often suffers from a substantial performance gap compared to supervised counterparts. ProtoTransfer bridges this gap by leveraging self-supervised transfer learning—learning general features from unlabeled data and then adapting them to specific tasks.

Methods

ProtoTransfer consists of a two-stage pipeline designed to learn and then refine feature representations:

  1. ProtoCLR (Self-Supervised Pre-training): This stage treats every image in an unlabeled set as a unique "class." Using contrastive learning principles, the model learns an embedding space where an image and its various augmentations (crops, color jitters) cluster around a central prototype, while pushing other images away. Unlike standard meta-learning, this does not require artificial task sampling during training.
  2. ProtoTune (Prototypical Fine-tuning): For a new few-shot task, the model calculates a prototype (mean vector) for each provided labeled example. It initializes a classification layer with these prototypes and performs rapid fine-tuning to sharpen decision boundaries for the target task.
Overview of the ProtoTransfer framework: (a) self-supervised pre-training via ProtoCLR and (b) prototypical fine-tuning and inference.

Experimental Setup

The framework was evaluated across several benchmarks to test both in-domain and cross-domain robustness:

  • In-Domain: mini-ImageNet and Omniglot.
  • Cross-Domain (CDFSL Benchmark): Transferring from mini-ImageNet to CropDiseases (plant leaves), EuroSAT (satellite imagery), ISIC2018 (skin lesions), and ChestX (X-rays).
  • Ablation Study: Using the CUB dataset to assess performance under conditions of low class diversity in the training set.

Key Insights and Results

ProtoTransfer demonstrates several advantages over traditional unsupervised and supervised methods:

  • Scaling with Data and Diversity: Performance improves significantly with larger batch sizes and total training images. Increasing batch size from 5 to 50 yielded a 5-9% performance boost. Interestingly, ProtoTransfer remains effective even when training data has low class diversity, as it treats every image as a unique entity rather than relying on class-level labels.
  • Generalization: Self-supervised features are often more general than those learned via supervised training on specific classes. ProtoTransfer exhibits a smaller "generalization gap" between training and testing classes compared to supervised Prototypical Networks.
  • Impact of Fine-tuning: While nearest-neighbor classification is often sufficient for 1-shot tasks, the "ProtoTune" step provides up to a 13% accuracy boost for 5-shot and 20-shot scenarios.
Accuracy trends as a function of training set size (left) and class diversity (right).

In benchmark tests, ProtoTransfer outperformed unsupervised peers (such as CACTUs and UMTRA) by 4-8% on mini-ImageNet. In the challenging ChestX cross-domain task, it surpassed all other methods, including fully supervised ones, highlighting the robustness of self-supervised features across disparate domains.

Conclusion and Future Work

ProtoTransfer offers a powerful alternative to supervised meta-learning, especially when labeled data is unavailable or significant domain shifts are expected. While it slightly trails supervised methods in perfectly matched domains, its cross-domain excellence marks a significant step forward for practical few-shot learning. Future work may explore more complex backbone architectures and advanced fine-tuning strategies to further close the gap with supervised learning.

Summary updated

BibTeX
@misc{medina2020self,
  author = {Carlos Medina and Arnout Devos and Matthias Grossglauser},
  title = {{Self-Supervised Prototypical Transfer Learning for Few-Shot Classification}},
  year = {2020},
  eprint = {2006.11325},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2006.11325},
}
Figure