MCPcopy Index your code
hub / github.com/GT-RIPL/AlwaysBeDreaming-DFCIL

github.com/GT-RIPL/AlwaysBeDreaming-DFCIL @main

Chat with this repo
repository ↗ · DeepWiki ↗ · + Follow
207 symbols 620 edges 18 files 18 documented · 9% updated 3y ago★ 621 open issues
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

Always Be Dreaming: A New Approach for Data-Free Class-Incremental Learning

PyTorch code for the ICCV 2021 paper:\ Always Be Dreaming: A New Approach for Data-Free Class-Incremental Learning\ James Smith, Yen-Chang Hsu, Jonathan Balloch, Yilin Shen, Hongxia Jin, Zsolt Kira\ International Conference on Computer Vision (ICCV), 2021\ [[arXiv]] [[pdf]] [[project]]

Abstract

Modern computer vision applications suffer from catastrophic forgetting when incrementally learning new concepts over time. The most successful approaches to alleviate this forgetting require extensive replay of previously seen data, which is problematic when memory constraints or data legality concerns exist. In this work, we consider the high-impact problem of Data-Free Class-Incremental Learning (DFCIL), where an incremental learning agent must learn new concepts over time without storing generators or training data from past tasks. One approach for DFCIL is to replay synthetic images produced by inverting a frozen copy of the learner's classification model, but we show this approach fails for common class-incremental benchmarks when using standard distillation strategies. We diagnose the cause of this failure and propose a novel incremental distillation strategy for DFCIL, contributing a modified cross-entropy training and importance-weighted feature distillation, and show that our method results in up to a 25.1% increase in final task accuracy (absolute difference) compared to SOTA DFCIL methods for common class-incremental benchmarks. Our method even outperforms several standard replay based methods which store a coreset of images.

Installation

Prerequisites

  • python == 3.6
  • torch == 1.0.1
  • torchvision >= 0.2.1

Setup

  • Install anaconda: https://www.anaconda.com/distribution/
  • set up conda environmet w/ python 3.6, ex: conda create --name py36 python=3.6
  • conda activate py36
  • sh install_requirements.sh

Datasets

Download/Extract the following datasets to the dataset folder under the project root directory. * For CIFAR-10 and CIFAR-100, download the python version dataset here.

Training

All commands should be run under the project root directory.

sh experiments/cifar100-fivetask.sh # tables 1,2
sh experiments/cifar100-tentask.sh # tables 1,2
sh experiments/cifar100-twentytask.sh # tables 1,2

Results

Results are generated for various task sizes. See the main text for full details. Numbers represent final accuracy in three runs (higher the better).

CIFAR-100 (no coreset)

tasks 5 10 20
UB 69.9 ± 0.2 69.9 ± 0.2 69.9 ± 0.2
Base 16.4 ± 0.4 8.8 ± 0.1 4.4 ± 0.3
LwF 17.0 ± 0.1 9.2 ± 0.0 4.7 ± 0.1
LwF.MC 32.5 ± 1.0 17.1 ± 0.1 7.7 ± 0.5
DGR 14.4 ± 0.4 8.1 ± 0.1 4.1 ± 0.3
DeepInversion 18.8 ± 0.3 10.9 ± 0.6 5.7 ± 0.3
Ours 43.9 ± 0.9 33.7 ± 1.2 20.0 ± 1.4

CIFAR-100 (with 2000 image coreset)

tasks 5 10 20
UB 69.9 ± 0.2 69.9 ± 0.2 69.9 ± 0.2
Naive Rehearsal 34.0 ± 0.2 24.0 ± 1.0 14.9 ± 0.7
LwF 39.4 ± 0.3 27.4 ± 0.8 16.6 ± 0.4
E2E 47.4 ± 0.8 38.4 ± 1.3 32.7 ± 1.9
BiC 53.7 ± 0.4 45.9 ± 1.8 37.5 ± 3.2
Ours (no coreset) 43.9 ± 0.9 33.7 ± 1.2 20.0 ± 1.4

Acknowledgement

This work is supported by Samsung Research America.

Citation

If you found our work useful for your research, please cite our work:

@article{smith2021always,
  author    = {Smith, James and Hsu, Yen-Chang and Balloch, Jonathan and Shen, Yilin and Jin, Hongxia and Kira, Zsolt},
  title     = {Always Be Dreaming: A New Approach for Data-Free Class-Incremental Learning},
  booktitle = {Proceedings of the IEEE/CVF International Conference on Computer Vision (ICCV)},
  month     = {October},
  year      = {2021},
  pages     = {9374-9384}
}

Core symbols most depended-on inside this repo

cuda
called by 53
learners/default.py
update
called by 29
utils/metric.py
train
called by 22
trainer.py
tic
called by 18
utils/metric.py
validation
called by 18
learners/default.py
forward
called by 15
learners/kd.py
criterion
called by 13
learners/default.py
accumulate_acc
called by 11
learners/default.py

Shape

Method 156
Class 32
Function 19

Languages

Python100%

Modules by API surface

dataloaders/loader.py30 symbols
learners/default.py29 symbols
learners/kd.py25 symbols
learners/datafree.py20 symbols
models/resnet.py17 symbols
models/generator.py15 symbols
models/autoencoder.py14 symbols
learners/datafree_helper.py13 symbols
utils/metric.py12 symbols
learners/dgr.py12 symbols
trainer.py6 symbols
run_dfcil.py6 symbols

For agents

$ claude mcp add AlwaysBeDreaming-DFCIL \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact