czjghost / AFS

Official implementation of the paper [New Insights on Relieving Task-Recency Bias for Online Class Incremental Learning]
6 stars 1 forks source link

AFS (Adaptive Focus Shifting algorithm)

Official implementation of the paper [New Insights on Relieving Task-Recency Bias for Online Class Incremental Learning] (TCSVT 2023).

The backbone of project mainly refers to online-continual-learning.

Requirements

Create a virtual enviroment

virtualenv online-cl

Activating a virtual environment

source online-cl/bin/activate

Installing packages

pip install -r requirements.txt

Datasets

Online Class Incremental

Data preparation

Compared methods

Except our implementation code, you could easily find other implementation results from SCR, DVC, ER-ACE and OCM.

Tricks

Run commands

Detailed descriptions of options can be found in general_main.py.

Command for duplicate results

You can run python file "run_cifar10.py", "run_cifar100.py" and "run_mini.py" to reimplement our paper results, for example:

  python run_mini.py

Detailed commands are as follows:

CIFAR-10

Memory = 0.2k

  python general_main.py --agent er --loss rfocal --classify max --data cifar10 --eps_mem_batch 100 --mem_size 200 --review_trick True --kd_trick True --kd_lamda 0.05 --cor_prob 0.99 --T 20.0 --fix_order True

Memory = 0.5k

  python general_main.py --agent er --loss rfocal --classify max --data cifar10 --eps_mem_batch 100 --mem_size 500 --review_trick True --kd_trick True --kd_lamda 0.05 --cor_prob 0.99 --T 20.0 --fix_order True

Memory = 1k

  python general_main.py --agent er --loss rfocal --classify max --data cifar10 --eps_mem_batch 100 --mem_size 1000 --review_trick True --kd_trick True --kd_lamda 0.1 --cor_prob 0.99 --T 20.0 --fix_order True

CIFAR-100

Memory = 1k

  python general_main.py --agent er --loss rfocal --classify max --data cifar100 --eps_mem_batch 100 --mem_size 1000 --review_trick True --kd_trick True --kd_lamda 0.15 --cor_prob 0.99 --T 20.0 --fix_order True

Memory = 2k

  python general_main.py --agent er --loss rfocal --classify max --data cifar100 --eps_mem_batch 100 --mem_size 2000 --review_trick True --kd_trick True --kd_lamda 0.05 --cor_prob 0.99 --T 20.0 --fix_order True

Memory = 5k

  python general_main.py --agent er --loss rfocal --classify max --data cifar100 --eps_mem_batch 100 --mem_size 5000 --review_trick True --kd_trick True --kd_lamda 0.1 --cor_prob 0.99 --T 20.0 --fix_order True

Mini-Imagenet

Memory = 1k

  python general_main.py --agent er --loss rfocal --classify max --data mini_imagenet --eps_mem_batch 100 --mem_size 1000 --review_trick True --kd_trick True --kd_lamda 0.05 --cor_prob 0.99 --T 20.0 --fix_order True

Memory = 2k

  python general_main.py --agent er --loss rfocal --classify max --data mini_imagenet --eps_mem_batch 100 --mem_size 2000 --review_trick True --kd_trick True --kd_lamda 0.1 --cor_prob 0.99 --T 20.0 --fix_order True

Memory = 5k

  python general_main.py --agent er --loss rfocal --classify max --data mini_imagenet --eps_mem_batch 100 --mem_size 5000 --review_trick True --kd_trick True --kd_lamda 0.05 --cor_prob 0.99 --T 20.0 --fix_order True

Citation

If you use this paper/code in your research, please consider citing us:

New Insights on Relieving Task-Recency Bias for Online Class Incremental Learning

Accepted at TCSVT2023.

@ARTICLE{10287323,
  author={Liang, Guoqiang and Chen, Zhaojie and Chen, Zhaoqiang and Ji, Shiyu and Zhang, Yanning},
  journal={IEEE Transactions on Circuits and Systems for Video Technology}, 
  title={New Insights on Relieving Task-Recency Bias for Online Class Incremental Learning}, 
  year={2023},
  volume={},
  number={},
  pages={1-1},
  doi={10.1109/TCSVT.2023.3325651}}

Other traditional papers we encourage you to cite can be found in RaptorMai.

Reference

Thanks RaptorMai for selflessly sharing his implementation about recent state-of-the-art methods.