[Paper Review] LibFewShot: A Comprehensive Library for Few-shot Learning
LibFewShot is a unified PyTorch library that re-implements 18 state-of-the-art few-shot learning methods with consistent training protocols, backbones, and data augmentation to enable fair comparisons. It demonstrates that episodic/meta-training remains essential, especially when combined with pre-training, and reveals that techniques like data augmentation, self-supervision, and proper normalization significantly boost performance across models.
Few-shot learning, especially few-shot image classification, has received increasing attention and witnessed significant advances in recent years. Some recent studies implicitly show that many generic techniques or ``tricks'', such as data augmentation, pre-training, knowledge distillation, and self-supervision, may greatly boost the performance of a few-shot learning method. Moreover, different works may employ different software platforms, backbone architectures and input image sizes, making fair comparisons difficult and practitioners struggle with reproducibility. To address these situations, we propose a comprehensive library for few-shot learning (LibFewShot) by re-implementing eighteen state-of-the-art few-shot learning methods in a unified framework with the same single codebase in PyTorch. Furthermore, based on LibFewShot, we provide comprehensive evaluations on multiple benchmarks with various backbone architectures to evaluate common pitfalls and effects of different training tricks. In addition, with respect to the recent doubts on the necessity of meta- or episodic-training mechanism, our evaluation results confirm that such a mechanism is still necessary especially when combined with pre-training. We hope our work can not only lower the barriers for beginners to enter the area of few-shot learning but also elucidate the effects of nontrivial tricks to facilitate intrinsic research on few-shot learning. The source code is available from https://github.com/RL-VIG/LibFewShot.
Motivation & Objective
- To address the lack of fair comparison in few-shot learning due to inconsistent implementations, backbones, and training tricks across methods.
- To provide a unified framework that re-implements 18 SOTA few-shot learning methods with identical codebase and hyperparameters.
- To empirically evaluate the impact of common deep learning techniques—such as data augmentation, knowledge distillation, and self-supervision—on few-shot performance.
- To investigate whether meta- or episodic-training is still necessary in the era of strong pre-training.
- To assess the transferability of few-shot models across domains, especially under large domain shifts.
Proposed method
- Re-implement 18 state-of-the-art few-shot learning methods in a single PyTorch-based unified framework with consistent hyperparameters and training protocols.
- Use the same backbone architectures (e.g., ResNet12, Swin-T) and input image sizes (224×224) across all methods to ensure fair comparison.
- Apply standardized data augmentation (RandAugment, mixup, cutmix), normalization, and optimization (AdamW) to isolate the effect of architectural and training choices.
- Conduct extensive evaluations on miniImageNet and tieredImageNet using both 1-shot and 5-shot settings across multiple backbones.
- Evaluate cross-domain generalization by training on source domains (e.g., miniImageNet) and testing on target domains (e.g., Stanford Dogs, CUB Birds) with varying domain shifts.
- Systematically ablate the effects of key training tricks—such as label smoothing, DropBlock, and self-supervision—on model performance.
Experimental results
Research questions
- RQ1Is the episodic/meta-training mechanism still necessary for few-shot learning when strong pre-training is used?
- RQ2How do common deep learning techniques—like data augmentation, knowledge distillation, and self-supervision—affect few-shot learning performance across different models?
- RQ3To what extent do model architectures like Vision Transformers (Swin-T) generalize to few-shot learning compared to CNNs (ResNet12)?
- RQ4How well do few-shot models generalize across domains with large domain shifts, such as from miniImageNet to Stanford Cars?
- RQ5Does test-time fine-tuning provide significant gains in few-shot classification, or are strong feature representations and normalization more critical?
Key findings
- The episodic/meta-training mechanism remains essential for few-shot learning, especially when combined with pre-training, as it enables effective adaptation to novel tasks.
- Pre-training combined with episodic training yields significantly better performance than non-episodic baselines, even when the latter use test-time fine-tuning.
- Data augmentation techniques such as RandAugment, mixup, and cutmix consistently improve performance across all models and benchmarks.
- Swin-T, despite being data-hungry, achieves competitive results on tieredImageNet, especially when combined with ProtoNet or DN4, indicating strong potential for transformers in FSL.
- Test-time fine-tuning provides limited gains in few-shot settings; instead, high-quality feature embeddings and ℓ₂ normalization are more critical for performance.
- Cross-domain generalization performance drops significantly on large domain shifts (e.g., miniImageNet → Stanford Cars), indicating current FSL methods struggle with domain shift beyond small shifts.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.