Home

Awesome

Few-Shot Class-Incremental Learning by Sampling Multi-Phase Tasks (LIMIT)

The code repository for "Few-Shot Class-Incremental Learning by Sampling Multi-Phase Tasks" (TPAMI 2023) in PyTorch. If you use any content of this repo for your work, please cite the following bib entry:

   @ARTICLE{zhou2023few,
   author={Zhou, Da-Wei and Ye, Han-Jia and Ma, Liang and Xie, Di and Pu, Shiliang and Zhan, De-Chuan},
   journal={IEEE Transactions on Pattern Analysis and Machine Intelligence}, 
   title={Few-Shot Class-Incremental Learning by Sampling Multi-Phase Tasks}, 
   year={2023},
   volume={45},
   number={11},
   pages={12816-12831},
   doi={10.1109/TPAMI.2022.3200865}
   }

Few-Shot Class-Incremental Learning by Sampling Multi-Phase Tasks

New classes arise frequently in our ever-changing world, e.g., emerging topics in social media and new types of products in e-commerce. A model should recognize new classes and meanwhile maintain discriminability over old classes. Under severe circumstances, only limited novel instances are available to incrementally update the model. The task of recognizing few-shot new classes without forgetting old classes is called few-shot class-incremental learning (FSCIL). In this work, we propose a new paradigm for FSCIL based on meta-learning by LearnIng Multi-phase Incremental Tasks (LIMIT), which synthesizes fake FSCIL tasks from the base dataset. The data format of fake tasks is consistent with the ‘real’ incremental tasks, and we can build a generalizable feature space for the unseen tasks through meta-learning. Besides, LIMIT also constructs a calibration module based on transformer, which calibrates the old class classifiers and new class prototypes into the same scale and fills in the semantic gap. The calibration module also adaptively contextualizes the instance-specific embedding with a set-to-set function. LIMIT efficiently adapts to new classes and meanwhile resists forgetting over old classes. Experiments on three benchmark datasets (CIFAR100, miniImageNet, and CUB200) and large-scale dataset, i.e., ImageNet ILSVRC2012 validate that LIMIT achieves state-of-the-art performance.

<img src='imgs/teaser.png' width='1000' height='300'>

Results

<img src='imgs/result.png' width='900' height='778'>

Please refer to our paper for detailed values.

Prerequisites

The following packages are required to run the scripts:

Dataset

We provide the source code on three benchmark datasets, i.e., CIFAR100, CUB200 and miniImageNet. Please follow the guidelines in CEC to prepare them.

The split of ImageNet100/1000 is availabel at Google Drive.

Code Structures

There are four parts in the code.

Training scripts

Remember to change YOURDATAROOT into your own data root, or you will encounter errors.

Using the definitely same scripts above, you are supposed to reproduce the results in cifar.txt, cub.txt, and mini.txt.

Acknowledgment

We thank the following repos providing helpful components/functions in our work.

Contact

If there are any questions, please feel free to contact with the author: Da-Wei Zhou (zhoudw@lamda.nju.edu.cn). Enjoy the code.