Home

Awesome

CLOM

This is the official repository of Continual Learning Based on OOD Detection and Task Masking (CLOM) (CVPRW 2022)

Note

Check out our related papers.

Environments

The code has been tested on two different machines with

  1. 2x GTX 1080
  1. 1x RTX 3090

Please install the necessary packages

Training

Please run train_DATASET.sh for a single gpu machine or train_DATASET_multigpu.sh for multi gpu. e.g.

bash train_cifar10.sh

or

bash train_cifar10_multigpu.sh

For mixed precision, use --amp

Evaluation using pre-trained models

Please download the pre-trained models and calibration parameters by running download_pretrained_models.py or download manually from link. The models and calibration parameters need to be saved under ./logs/DATASET/linear_task_TASK_ID, where DATASET are one of [mnist, cifar10, cifar100_10t, cifar100_20t, tinyImagenet_5t, tinyImageNet_10t] and TASK_ID is the last task id in the experiment (e.g. 9 for cifar100_10t).

For CIL of exemplar-free method CLOM(-c), run the following line

python eval.py --mode cil --dataset cifar10 --model resnet18 --cil_task 4 --printfn 'cil.txt' --all_dataset --disable_cal

For CIL of memory buffer method CLOM, run the following line

python eval.py --mode cil --dataset cifar10 --model resnet18 --cil_task 4 --printfn 'cil.txt' --all_dataset

For TIL, run the following line

python eval.py --mode test_marginalized_acc --dataset cifar10 --model resnet18 --t 4 --all_dataset --printfn 'til.txt'

You may change --dataset, --cil_task for other experiments

Results

The provided pre-trained models give the following results

CIL

MNISTCIFAR10CIFAR100-10TCIFAR100-20tT-ImageNet-5TT-ImageNet-10T
CLOM(-c)94.7388.7562.8254.7445.7447.40
CLOM96.5088.6265.2158.1452.5347.76

TIL

MNISTCIFAR10CIFAR100-10TCIFAR100-20tT-ImageNet-5TT-ImageNet-10T
CLOM(-c)99.9298.6691.8894.4168.4072.20

CLOM and CLOM(-c) are the same as calibration does not affect TIL performance.

Cite

If you found our paper useful, please cite it!

@InProceedings{Kim_2022_CVPR,
    author    = {Kim, Gyuhak and Esmaeilpour, Sepideh and Xiao, Changnan and Liu, Bing},
    title     = {Continual Learning Based on OOD Detection and Task Masking},
    booktitle = {Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR) Workshops},
    month     = {June},
    year      = {2022},
    pages     = {3856-3866}
}

Acknowledgement

The code uses the source code from CSI and HAT.