Sitelet https://github.com/TonyPod/RethinkingClassOrder
Skip to content

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Latest commit

 

History

3 Commits

Folders and files

Repository files navigation

Rethinking Class Orders and Transferability in Class Incremental Learning

This is the official repository for the paper Rethinking Class Orders and Transferability in Class Incremental Learning. [Main Paper][Supp]

1. Requirements

The code is implemented in Python 3.6.

As for CUDA, we use CUDA 10.1 and cuDNN 7.6.

For requirements for the Python modules, you can simply run (note that pip version should be >19.0 (or >20.3 for macOS)):

pip install -r requirements.txt

2. Datasets

For Group ImageNet, download the ImageNet64x64 ([Google Drive] [百度网盘 (提取码:nqi7)] dataset first and change data_path in imagenet64x64.py to your folder path. ImageNet64x64 is a downsampled ImageNet according to https://patrykchrabaszcz.github.io/Imagenet32/.

For iNaturalist, download the iNaturalist64x64 ([Google Drive] [百度网盘 (提取码:aksa)] dataset first and change TRAIN_DIR/TEST_DIR in inaturalist64x64.py to your folder path. iNaturalist64x64 is a cropped and resized version according to the bounding box annotations provided by iNaturalist.

3. Usage

3.1 Comparisons between the Even and Group class orders

After downloading the datasets and changing the dataset paths, simply run the following scripts for Group ImageNet and Group iNaturalist respectively (some configurations in the script should be set in advance, e.g. LD_LIBRARY_PATH):

bash scripts/imagenet64x64_order_even.sh

bash scripts/imagenet64x64_order_group.sh

bash scripts/inat_order_even.sh

bash scripts/inat_order_group.sh

By default it will run 5 different class orders, and it may take too much time to finish training. For acceleration, you can simply change the for i in {1..5} to for i in {1..1} to reduce the number of class orders.

After running the previous scripts, you can reproduce the first two columns in Table 1 by running the following script:

bash scripts/imagenet64x64_display_accs.sh

And Table 1 in the supplementary material by:

bash scripts/inat_display_accs.sh

3.2 Transferability of Even and Group

For Group ImageNet, first calculate transferability:

bash scripts/calc_transferability_imagenet.sh

then display transferability:

python utils/display_trans.py

For Group iNaturalist, first calculate transferability:

bash scripts/calc_transferability_inat.sh

then display transferability:

python utils/display_trans.py --dataset inat64x64

3.3 Greedy order obtained by COSA

For Group ImageNet, run COSA by:

bash scripts/imagenet64x64_cosa.sh

From the console output, the estimated transferability of the greedy class order is shown in something like

MD-LED (Sup.) - Total trans: 32701.340912

which corresponds to Table 2 in the main paper.

For Group iNaturalist, run COSA by:

bash scripts/inat_cosa.sh

Citation

If you use these codes or find anything that inspires your works, please cite our paper:

@article{he2022rethinking,
  title={Rethinking class orders and transferability in class incremental learning},
  author={He, Chen and Wang, Ruiping and Chen, Xilin},
  journal={Pattern Recognition Letters},
  volume={161},
  pages={67--73},
  year={2022},
  publisher={Elsevier}
}

Contact

If you have any questions when running our code, feel free to contact chen.he@vipl.ict.ac.cn

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages