项目作者: khurramjaved96

项目描述 :
Pytorch implementation of ACCV18 paper "Revisiting Distillation and Incremental Classifier Learning."
高级语言: Python
项目地址: git://github.com/khurramjaved96/incremental-learning.git
创建时间: 2018-01-25T06:15:02Z
项目社区:https://github.com/khurramjaved96/incremental-learning

开源协议:

下载


Revisiting Distillation and Incremental Classifier Learning

Accepted at ACCV18. Pre-print is available at : http://arxiv.org/abs/1807.02802

Citing the paper :

  1. @inproceedings{javed2018revisiting,
  2. title={Revisiting distillation and incremental classifier learning},
  3. author={Javed, Khurram and Shafait, Faisal},
  4. booktitle={Asian Conference on Computer Vision},
  5. pages={3--17},
  6. year={2018},
  7. organization={Springer}
  8. }

Interface to Run Experiments

  1. usage: runExperiment.py [-h] [--batch-size N] [--lr LR]
  2. [--schedule SCHEDULE [SCHEDULE ...]]
  3. [--gammas GAMMAS [GAMMAS ...]] [--momentum M]
  4. [--no-cuda] [--random-init] [--no-distill]
  5. [--distill-only-exemplars] [--no-random]
  6. [--no-herding] [--seeds SEEDS [SEEDS ...]]
  7. [--log-interval N] [--model-type MODEL_TYPE]
  8. [--name NAME] [--outputDir OUTPUTDIR] [--upsampling]
  9. [--pp] [--distill-step] [--hs]
  10. [--unstructured-size UNSTRUCTURED_SIZE]
  11. [--alphas ALPHAS [ALPHAS ...]] [--decay DECAY]
  12. [--alpha-increment ALPHA_INCREMENT] [--l1 L1]
  13. [--step-size STEP_SIZE] [--T T]
  14. [--memory-budgets MEMORY_BUDGETS [MEMORY_BUDGETS ...]]
  15. [--epochs-class EPOCHS_CLASS] [--dataset DATASET]
  16. [--lwf] [--no-nl] [--rand] [--adversarial]

Default configurations can be used to run with same parameters as used by iCaRL.
Simply run:

  1. python run_experiment.py

Dependencies

  1. Pytorch 0.3.0.post4
  2. Python 3.6
  3. torchnet (https://github.com/pytorch/tnt)
  4. tqdm (pip install tqdm)

Please see requirements.txt for a complete list.

Setting up enviroment

The easiest way to install the required dependencies is to use conda package manager.

  1. Install Anaconda with Python 3
  2. Install pytorch and torchnet
  3. Install tqdm (pip install progressbar2)
    Done.

Branches

  1. iCaRL + Dynamic Threshold Moving is implemented in “Autoencoders” branch.

=======

Selected Results

Removing Bias by Dynamic Threshold Moving

alt text
Result of threshold moving with T = 2 and 5. Note that different scale is used for
the y axis, and using higher temperature in general results in less bias.

Confusion Matrix with and without Dynamic Threshold Moving

alt text
Confusion matrix of results of the classifier with (right) and without (left) threshold
moving with T=2. We removed the first five classes of MNIST from the train set and only
distilled the knowledge of these classes using a network trained on all classes. Without
threshold moving the model struggled on the older classes. With threshold moving, however,
not only was it able to classify unseen classes nearly perfectly, but also its performance did
not deteriorate on new classes

FAQs

How do I implement more models?

A. Add the model in model/ModelFactory and make sure the forward method of the model satisfy the API of model/resnet32.py

How do I add a new dataset?

A. Add the new dataset in DatasetFactory and specify the details in the dataHandler/dataset.py class. Make sure the dataset implements all the variables set by other datasets.

References

[1] Geoffrey Hinton, Oriol Vinyals, and Jeff Dean. Distilling the knowledge in a neural network. arXiv preprint arXiv:1503.02531, 2015

[2] Sylvestre-Alvise Rebuffi, Alexander Kolesnikov, Georg Sperl, and Christoph H Lampert. Icarl: Incremental classifier and representation learning. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 2001–2010, 2017.

[3] Zhizhong Li and Derek Hoiem. Learning without forgetting. IEEE Transactions on Pattern Analysis and Machine Intelligence, 2017.