Home

Awesome

FeTrIL

This is the official code for FeTrIL (WACV2023): Feature Translation for Exemplar-Free Class-Incremental Learning

<p align="center"> <img src="medias/teaser.png" /> </p>

Abstract

Exemplar-free class-incremental learning is very challenging due to the negative effect of catastrophic forgetting. A balance between stability and plasticity of the incremental process is needed in order to obtain good accuracy for past as well as new classes. Existing exemplar-free class-incremental methods focus either on successive fine tuning of the model, thus favoring plasticity, or on using a feature extractor fixed after the initial incremental state, thus favoring stability. We introduce a method which combines a fixed feature extractor and a pseudo-features generator to improve the stability-plasticity balance. The generator uses a simple yet effective geometric translation of new class features to create representations of past classes, made of pseudo-features. The translation of features only requires the storage of the centroid representations of past classes to produce their pseudo-features. Actual features of new classes and pseudo-features of past classes are fed into a linear classifier which is trained incrementally to discriminate between all classes. The incremental process is much faster with the proposed method compared to mainstream ones which update the entire deep model. Experiments are performed with three challenging datasets, and different incremental settings. A comparison with ten existing methods shows that our method outperforms the others in most cases.

Results

For the following results T denominates the number of incremental states. The first, non-incremental, state contains half of the classes, excepted the T=20 and T=60 setups for the 100-classes datasets, where it accounts for 40 classes. Whenever available, results of compared methods marked with ∗ are reproduced either from their initial paper or from SSRE for EFCIL. The other results are recomputed using the original configurations of the methods.

CIFAR-100

CIL MethodT=5T=10T=20T=60
EWC* (PNAS'17)24.521.215.9x
LwF-MC* (CVPR'17)45.927.420.1x
DeeSIL (ECCVW'18)60.050.638.1x
LUCIR (CVPR'19)51.241.125.2x
MUC* (ECCV'20)49.430.221.3x
SDC* (CVPR'20)56.857.058.9x
ABD* (ICCV'21)63.862.557.4x
PASS* (CVPR'21)63.561.858.1x
IL2A* (NeurIPS'21)<ins>66.0</ins>60.357.9x
SSRE* (CVPR'22)65.9<ins>65.0</ins>61.7x
FeTrIL<sup>fc</sup> (WACV'23)64.763.457.4<ins>50.8</ins>
FeTrIL (WACV'23)66.365.2<ins>61.5</ins>59.8

Average top-1 incremental accuracy in EFCIL with different numbers of incremental steps. FeTrIL results are reported with pseudo-features translated from the most similar new class. "-" cells indicate that results were not available. "x" cells indicate that the configuration is impossible for that method.

Tiny-ImageNet

CIL MethodT=5T=10T=20T=100
EWC* (PNAS'17)18.815.812.4x
LwF-MC* (CVPR'17)29.123.117.4x
DeeSIL (ECCVW'18)49.843.934.1x
LUCIR (CVPR'19)41.728.118.9x
MUC* (ECCV'20)32.626.621.9x
PASS* (CVPR'21)49.647.342.1x
IL2A* (NeurIPS'21)47.344.740.0x
SSRE* (CVPR'22)50.448.948.2x
FeTrIL<sup>fc</sup> (WACV'23)<ins>52.9</ins><ins>51.7</ins><ins>49.7</ins><ins>41.9</ins>
FeTrIL (WACV'23)54.853.152.250.2

Average top-1 incremental accuracy in EFCIL with different numbers of incremental steps. FeTrIL results are reported with pseudo-features translated from the most similar new class. "-" cells indicate that results were not available. "x" cells indicate that the configuration is impossible for that method.

ImageNet-Subset

CIL MethodT=5T=10T=20T=60
EWC* (PNAS'17)-20.4-x
LwF-MC* (CVPR'17)-31.2-x
DeeSIL (ECCVW'18)67.960.150.5x
LUCIR (CVPR'19)56.841.428.5x
MUC* (ECCV'20)-35.1-x
SDC* (CVPR'20)-61.2-x
PASS* (CVPR'21)64.461.851.3x
SSRE* (CVPR'22)-67.7-x
FeTrIL<sup>fc</sup> (WACV'23)<ins>69.6</ins><ins>68.9</ins><ins>62.5</ins><ins>58.9</ins>
FeTrIL (WACV'23)72.271.267.165.4

Average top-1 incremental accuracy in EFCIL with different numbers of incremental steps. FeTrIL results are reported with pseudo-features translated from the most similar new class. "-" cells indicate that results were not available. "x" cells indicate that the configuration is impossible for that method.

ImageNet

CIL MethodT=5T=10T=20
DeeSIL (ECCVW'18)61.954.645.8
LUCIR (CVPR'19)47.437.226.6
FeTrIL<sup>fc</sup> (WACV'23)<ins>65.6</ins><ins>64.4</ins><ins>63.4</ins>
FeTrIL (WACV'23)66.165.063.8

Average top-1 incremental accuracy in EFCIL with different numbers of incremental steps. FeTrIL results are reported with pseudo-features translated from the most similar new class. "-" cells indicate that results were not available. "x" cells indicate that the configuration is impossible for that method.

Installation

Environment

To install the required packages, please run the following command (conda is required), using fetril.yml file:

conda env create -f fetril.yml

If the installation fails, please try to install the packages manually with the following command:

conda create -n fetril python=3.7
conda activate fetril
conda install pytorch torchvision torchaudio pytorch-cuda=11.6 -c pytorch -c nvidia
pip install typing-extensions --upgrade
conda install pandas
pip install -U scikit-learn scipy matplotlib

Dependencies

The code depends on the repository utilsCIL which contains the code for the datasets and the incremental learning process. Please clone the repository on your home (FeTrIL code will find it) or add it to your PYTHONPATH:

git clone git@github.com:GregoirePetit/utilsCIL.git

Usage

Configuration

Using the configs/cifar100_b50_t10.cf file, you can prepare your experiment. You can change the following parameters:

Experiments

Once the configuration file is ready, you can run the following command to launch the experiment:

Train the first model and extract the features:

python codes/scratch.py configs/cifar100_b50_t10.cf

Compute the pseudo-features according to the FeTrIL method:

python codes/compute_distances.py configs/cifar100_b50_t10.cf

Format the pseudo-features to be used by the dataloader:

python codes/prepare_train.py configs/cifar100_b50_t10.cf

Train the classifiers:

python codes/train_classifiers.py configs/cifar100_b50_t10.cf

Clean the pseudo-features used by the dataloader to train the classifiers:

python codes/clean_train.py configs/cifar100_b50_t10.cf

Compute the predictions on the test set:

python codes/compute_predictions.py configs/cifar100_b50_t10.cf

Compute the accuracy on the test set:

python codes/eval.py configs/cifar100_b50_t10.cf

Citation

If you find this code useful for your research, please cite our paper:

@InProceedings{Petit_2023_WACV,
    author    = {Petit, Gr\'egoire and Popescu, Adrian and Schindler, Hugo and Picard, David and Delezoide, Bertrand},
    title     = {FeTrIL: Feature Translation for Exemplar-Free Class-Incremental Learning},
    booktitle = {Proceedings of the IEEE/CVF Winter Conference on Applications of Computer Vision (WACV)},
    month     = {January},
    year      = {2023},
    pages     = {3911-3920}
}