Giter VIP home page Giter VIP logo

iccv2019-inc's Introduction

Introduction

This repository implements Lee et al. Overcoming Catastrophic Forgetting with Unlabeled Data in the Wild. In ICCV, 2019 in PyTorch.

@inproceedings{lee2019overcoming,
  title={Overcoming Catastrophic Forgetting with Unlabeled Data in the Wild},
  author={Lee, Kibok and Lee, Kimin and Shin, Jinwoo and Lee, Honglak},
  booktitle={ICCV},
  year={2019}
}

This implementation also includes the state-of-the-art distillation-based methods for class-incremental learning (a.k.a. single-head continual learning):

Please see [training recipes] for replicating them.

Dependencies

  • Python 3.6.8
  • NumPy 1.16.2
  • PyTorch 0.4.1
  • torchvision 0.2.1
  • h5py 2.7.1
  • tqdm 4.25.0
  • tensorboardx 1.4
  • SciPy 1.1.0 for sample_tiny.py
  • matplotlib 2.2.2 for plotter.py
  • seaborn 0.9.0 for plotter.py
  • pandas 0.23.0 for plotter.py

Data

You may either generate datasets by yourself or download h5 files in the following links. You may not download external data if you don't want to use them. All data are assumed to be in data/{dataset}/. ({dataset} = cifar100, tiny, imagenet)

CIFAR-100 (Training data)

This will be automatically downloaded.

TinyImages (External data)

ImageNet (Training and external data)

  • DIY
    • Download [ImageNet ILSVRC 2012 train (154.6GB)] and place them in data/imagenet/ilsvrc2012.
    • Run the following command. This takes a long time.
      python image_resizer_imagenet.py -i 'imagenet/ilsvrc2012' -o 'imagenet/ilsvrc2012_resized' -s 32 -a box -r -j 16
      
    • Download [ImageNet 2011 Fall (1.3TB)] and place them in data/imagenet/fall11_whole.
    • Run the following command. This takes a long time.
      python image_resizer_imagenet.py -i 'imagenet/fall11_whole' -o 'imagenet/fall11_whole_resized' -s 32 -a box -r -j 16
      
    • Run python sample_imagenet.py -s {seed}. {seed} corresponds to the stage number in incremental learning.
      • Training and test data will be generated at seed=0.
      • This takes a long time, so running in parallel is recommended.
  • Don't DIY

Task splits

  • DIY
    • Run python shuffle_task.py.
  • Don't DIY
    • Task splits are already in split/.

Train and test

  • Run python main.py -h to see the general usage.
  • With --ex-static, only 0-th external dataset is used for all stages.
  • Please see [training recipes] for replicating the models compared in our paper.
  • Examples on CIFAR-100, task size 10, seed 0, gpu 0:
    • GD (Ours) without external data
      python main.py --gpu 0 --seed 0 -d cifar100 -s res -t 10 10 -r PC  -b dw -f cls
      
    • GD (Ours) with external data
      python main.py --gpu 0 --seed 0 -d cifar100 -e tiny -s res -t 10 10 -r PCQ -b dw -f cls
      

Evaluation

  • Run python plotter.py -h to see the general usage. bar and time replicate Figure 2(a,b) and (c,d), and the others replicate tables.
  • Examples:
    • Replicate CIFAR100 with task size 10 in Table 1
      python plotter.py -d cifar100 -e tiny -s res -t 10 10 --exp t1
      
    • Replicate bar graphs in Figure 2(a,b)
      python plotter.py -d cifar100 -e tiny -s res --exp bar
      
    • Compare arbitrary models you want
      python plotter.py --exp custom
      

Note

  • image_resizer_imagenet.py is adapted from [here]
  • models is adapted from [here]
  • datasets is adapted from [here]

iccv2019-inc's People

Contributors

kibok90 avatar trellixvulnteam avatar

Stargazers

Srishti Yadav avatar qvelard avatar Lee Chungpa avatar  avatar Zacks avatar Jacob A Rose avatar Alzayat Saleh avatar Zhuang Shao avatar Qi-Wei Wang avatar datar001 avatar SeventhHeaven avatar Xingxun Jiang avatar  avatar Kai Zhu avatar  avatar  avatar LMM avatar Surbhi Mittal avatar Sujit Kumar Ojha avatar Qin Wang avatar  avatar Soumya Banerjee avatar Panagiotis Filntisis avatar  avatar Andy Jeong avatar  avatar Weixia Zhang avatar zhongyu zhang avatar Phu Ninh avatar Vicky Chen avatar  avatar  avatar Bhuwan avatar Tsingwaa Tsang avatar chinmay Das avatar Tyler Hayes avatar Yipeng Zhang avatar Dian-Shan Chen avatar mllx01161110 avatar IronMan avatar Yaoyao Liu avatar  avatar  avatar  avatar Mohammad Hadi Salari avatar  avatar Hans Lee avatar ruima avatar  avatar Pranay Modukuru avatar Giang Nguyen avatar Zifan Shi avatar  avatar  avatar  avatar Yup avatar  avatar Arthur Douillard avatar kenneth avatar  avatar Xiangde Luo avatar An-Chieh Cheng avatar  avatar Howard H. Tang avatar 爱可可-爱生活 avatar Linchao Zhu avatar Kyuhyoung Choi avatar Xinyang Zhang avatar  avatar Chenhao Zhu avatar Kimin Lee avatar  avatar Thilo Hofmeister avatar Umberto Michieli avatar  avatar Mennatullah Siam avatar Purvanshi Mehta avatar Timothée Lesort avatar Joseph K J avatar

Watchers

Joseph K J avatar Yup avatar Kyuhyoung Choi avatar  avatar  avatar IronMan avatar paper2code - bot avatar

iccv2019-inc's Issues

Trained model for CIFAR 100

I really liked the proposed method. Could you please share the weights of the model trained on CIFAR-100.

How to proceed if we use our own dataset?

I saw that for cifar-100, a lot of custom code is written. I have already went through another issue where the author recommend to use H5dataset part of code. But still I have doubts, is there a specific manner in which the data have to be used ?

Will I have to write that custom code for my dataset also ? Any clue or directions will be very helpful.

Also, I am asking for main Dataset input, not about unlabeled dataset.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.