Home

Awesome

Elastic Feature Consolidation For Cold Start Exemplar-Free Incremental Learning

This repository contains all code needed to reproduce the experimental results for the paper:
Elastic Feature Consolidation For Cold Start Exemplar-Free Incremental Learning
Simone Magistri, Tomaso Trinci, Albin Soutif, Joost van de Weijer, Andrew D. Bagdanov
(ICLR2024) (arXiv)

Cite

If this code is useful in your research, please cite it as follows:

@inproceedings{
magistri2024elastic,
title={Elastic Feature Consolidation For Cold Start Exemplar-Free Incremental Learning},
author={Simone Magistri and Tomaso Trinci and Albin Soutif and Joost van de Weijer and Andrew D. Bagdanov},
booktitle={The Twelfth International Conference on Learning Representations},
year={2024},
url={https://openreview.net/forum?id=7D9X2cFnt1}
}

Setting up the Conda environment

To run the EFC code you must create an Anaconda environment from the environment.yml file and activate it:

conda env create -n EFC -f environment.yml 
conda activate EFC

Project Description

This codebase is inspired by FACIL and is structured as follows:

Incremental Learning Modules:

Utility Modules:

Analyzing the Results

The results are stored in the path specified by the -op flag. A file named summary.csv will be generated, which contains the following performance metrics:

Main Command-Line Arguments

Use the following command-line arguments to configure the behavior of the code:

Running the code for CIFAR-100 experiments - Warm-Start (WS)

The default hyperparameters are the ones used to compute the Table 1 in the main paper.

  1. 10 Step
python -u   main.py -op ./ws_cifar100_10step --dataset cifar100 --n_task 11 --n_class_first_task 50 --approach efc --nw 12 --seed 0 --epochs_first_task 100  --epochs_next_task 100

  1. 20 Step
python -u   main.py -op ./ws_cifar100_20step --dataset cifar100 --n_task 21 --n_class_first_task 40 --approach efc  --nw 12 --seed 0 --epochs_first_task 100  --epochs_next_task 100

Running the code for CIFAR-100 experiments - Cold-Start (CS)

The default hyperparameters are the ones used to compute the Table 1 in the main paper.

  1. 10 Step
python -u   main.py -op ./cs_cifar100_10step --dataset cifar100 --n_task 10 --n_class_first_task 10 --data_path ./cl_data --approach efc  --nw 12 --seed 0 --epochs_first_task 100  --epochs_next_task 100

  1. 20 Step
python -u   main.py -op ./cs_cifar100_20step   --dataset cifar100 --n_task 20 --n_class_first_task 5 --data_path ./cl_data --approach efc  --nw 12 --seed 0 --epochs_first_task 100  --epochs_next_task 100

Running the Tiny-Imagenet and ImageNet-Subset experiments

The commands are similar, with the only difference being the data-folder "cl_data," where both datasets are downloaded, should be specified.

Here the 10-step and 20-step scenario Warm Start (WS) for Tiny-ImageNet and ImageNet-Subset.

python -u   main.py -op ./ws_tinyimagenet_10step  --dataset tiny-imagenet  --n_task 11  --n_class_first_task 100 --data_path ./cl_data --approach efc   --nw 12 --seed 0 --epochs_first_task 100  --epochs_next_task 100
python -u   main.py -op ./ws_imagenetsubset_10task --dataset imagenet-subset --n_task 11 --n_class_first_task 50 --data_path ./cl_data --approach efc --nw 12 --seed 0 --epochs_first_task 160  --epochs_next_task 100
python -u   main.py -op ./ws_tinyimagenet_20step  --dataset tiny-imagenet  --n_task 21 --n_class_first_task 100 --data_path ./cl_data --approach efc  --nw 12 --seed 0 --epochs_first_task 100  --epochs_next_task 100
python -u   main.py -op ./ws_imagenetsubset_20task --dataset imagenet-subset --n_task 21 --n_class_first_task 40 --data_path ./cl_data --approach efc --nw 12 --seed 0 --epochs_first_task 160  --epochs_next_task 100

Here the 10-step and 20-step scenario Cold Start (CS) for Tiny-ImageNet and ImageNet-Subset.

python -u   main.py -op ./cs_tinyimagenet_10step  --dataset tiny-imagenet  --n_task 10  --n_class_first_task 20 --data_path ./cl_data --approach efc  --nw 12 --seed 0 --epochs_first_task 100  --epochs_next_task 100
python -u   main.py -op ./cs_imagenetsubset_10step --dataset imagenet-subset --n_task 10 --n_class_first_task 10 --data_path ./cl_data --approach efc  --nw 12 --seed 0 --epochs_first_task 160  --epochs_next_task 100
python -u   main.py -op ./cs_tinyimagenet_20step  --dataset tiny-imagenet  --n_task 20 --n_class_first_task 10  --data_path ./cl_data --approach efc  --nw 12 --seed 0 --epochs_first_task 100  --epochs_next_task 100
python -u   main.py -op ./cs_imagenetsubset_20step --dataset imagenet-subset --n_task 20 --n_class_first_task 5 --data_path ./cl_data --approach efc  --nw 12 --seed 0 --epochs_first_task 160  --epochs_next_task 100

In the bash file experiments.sh all the experiments for all the scenarios can be run.

License

Please check the MIT license that is listed in this repository.