GithubHelp home page GithubHelp logo

junghyup-lee / dkd Goto Github PK

View Code? Open in Web Editor NEW

This project forked from cvlab-yonsei/dkd

0.0 0.0 0.0 745 KB

An official implementation of "Decomposed Knowledge Distillation for Class-incremental Semantic Segmentation" (NeurIPS 2022) in PyTorch.

License: GNU General Public License v3.0

Shell 5.29% Python 94.71%

dkd's Introduction

Decomposed Knowledge Distillation for Class-Incremental Semantic Segmentation

This is an official implementation of the paper "Decomposed Knowledge Distillation for Class-Incremental Semantic Segmentation", accepted to NeurIPS 2022.

For more information, please checkout the project site [website] and our paper [arXiv].

Pre-requisites

This repository uses the following libraries:

  • Python (3.6)
  • Pytorch (1.8.1)

Getting Started

Datasets

PASCAL VOC 2012

We use augmented 10,582 training samples and 1,449 validation samples for PASCAL VOC 2012. To train our model with augmented samples, please download labels of augmented samples ('SegmentationClassAug') and file names ('train_aug.txt'). The structure of data path should be organized as follows:

└── /dataset/VOC2012
    ├── Annotations
    ├── ImageSets
    │   └── Segmentation
    │       ├── train_aug.txt
    │       └── val.txt
    ├── JPEGImages
    ├── SegmentationClass
    └── SegmentationClassAug

ADE20K

The structure of data path should be organized as follows:

└── /dataset/ADEChallengeData2016
    ├── annotations
    ├── images
    ├── objectInfo150.txt
    └── sceneCategories.txt

Training

PASCAL VOC 2012

# An example srcipt for 15-5 overlapped setting of PASCAL VOC

GPU=0,1,2,3
BS=8  # Total 32
SAVEDIR='saved_voc'

TASKSETTING='overlap'  # or 'disjoint'
TASKNAME='15-5' # or ['15-1', '19-1', '10-1', '5-3']
EPOCH=60
INIT_LR=0.001
LR=0.0001
INIT_POSWEIGHT=2
MEMORY_SIZE=0  # 100 for DKD-M

NAME='DKD'
python train_voc.py -c configs/config_voc.json \
-d ${GPU} --multiprocessing_distributed --save_dir ${SAVEDIR} --name ${NAME} \
--task_name ${TASKNAME} --task_setting ${TASKSETTING} --task_step 0 --lr ${INIT_LR} --bs ${BS} --pos_weight ${INIT_POSWEIGHT}

python train_voc.py -c configs/config_voc.json \
-d ${GPU} --multiprocessing_distributed --save_dir ${SAVEDIR} --name ${NAME} \
--task_name ${TASKNAME} --task_setting ${TASKSETTING} --task_step 1 --lr ${LR} --bs ${BS} --freeze_bn --mem_size ${MEMORY_SIZE}

ADE20K

# An example srcipt for 50-50 overlapped setting of ADE20K

GPU=0,1,2,3
BS=6  # Total 24
SAVEDIR='saved_ade'

TASKSETTING='overlap'
TASKNAME='50-50' # or ['100-10', '100-50']
EPOCH=100
INIT_LR=0.0025
LR=0.00025
MEMORY_SIZE=0 # 300 for DKD-M

NAME='DKD'
python train_ade.py -c configs/config_ade.json \
-d ${GPU} --multiprocessing_distributed --save_dir ${SAVEDIR} --name ${NAME} \
--task_name ${TASKNAME} --task_setting ${TASKSETTING} --task_step 0 --lr ${INIT_LR} --bs ${BS}

python train_ade.py -c configs/config_ade.json \
-d ${GPU} --multiprocessing_distributed --save_dir ${SAVEDIR} --name ${NAME} \
--task_name ${TASKNAME} --task_setting ${TASKSETTING} --task_step 1 --lr ${LR} --bs ${BS} --freeze_bn --mem_size ${MEMORY_SIZE}

python train_ade.py -c configs/config_ade.json \
-d ${GPU} --multiprocessing_distributed --save_dir ${SAVEDIR} --name ${NAME} \
--task_name ${TASKNAME} --task_setting ${TASKSETTING} --task_step 2 --lr ${LR} --bs ${BS} --freeze_bn --mem_size ${MEMORY_SIZE}

Testing

PASCAL VOC 2012

python eval_voc.py -d 0 -r path/to/weight.pth

We provide pretrained weights and configuration files. The results should be:

Method
(Overlapped)
VOC 19-1
(2 steps)
$\text{hIoU}$ / $\text{mIoU}_{\text{all}}$
VOC 15-5
(2 steps)
$\text{hIoU}$ / $\text{mIoU}_{\text{all}}$
VOC 15-1
(6 steps)
$\text{hIoU}$ / $\text{mIoU}_{\text{all}}$
VOC 10-1
(11 steps)
$\text{hIoU}$ / $\text{mIoU}_{\text{all}}$
VOC 5-3
(6 steps)
$\text{hIoU}$ / $\text{mIoU}_{\text{all}}$
DKD 56.95 / 76.13 67.17 / 73.95 57.46 / 70.50 57.21 / 60.43 61.32 / 58.98
DKD-M 68.14 / 77.04 68.96 / 74.84 64.09 / 72.95 64.89 / 66.20 65.02 / 63.32
Method
(Disjoint)
VOC 19-1
(2 steps)
$\text{hIoU}$ / $\text{mIoU}_{\text{all}}$
VOC 15-5
(2 steps)
$\text{hIoU}$ / $\text{mIoU}_{\text{all}}$
VOC 15-1
(6 steps)
$\text{hIoU}$ / $\text{mIoU}_{\text{all}}$
DKD 57.98 / 75.90 64.35 / 72.21 54.21 / 68.48
DKD-M 67.12 / 76.84 65.04 / 72.53 60.32 / 70.78

ADE20K

python eval_ade.py -d 0 -r path/to/weight.pth

We provide pretrained weights and configuration files. The results should be:

Method ADE 100-50
(2 steps)
$\text{hIoU}$ / $\text{mIoU}_{\text{all}}$
ADE 100-10
(6 steps)
$\text{hIoU}$ / $\text{mIoU}_{\text{all}}$
ADE 50-50
(3 steps)
$\text{hIoU}$ / $\text{mIoU}_{\text{all}}$
DKD 29.42 / 35.55 26.79 / 34.53 34.77 / 34.39
DKD-M 29.45 / 35.58 27.44 / 34.83 34.78 / 34.39

Acknowledgements

dkd's People

Contributors

dh-baek avatar

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.