Home

Awesome

A Comprehensive Overhaul of Feature Distillation

Accepted at ICCV 2019

Official PyTorch implementation of "A Comprehensive Overhaul of Feature Distillation" | paper | project page | blog

Byeongho Heo, Jeesoo Kim, Sangdoo Yun, Hyojin Park, Nojun Kwak, Jin Young Choi

Clova AI Research, NAVER Corp.
Seoul National University

Requirements

Updates

19 Nov 2019 Segmentation released

10 Sep 2019 Initial upload

CIFAR-100

Settings

We provide the code of the experimental settings specified in the paper.

SetupCompression typeTeacherStudentTeacher sizeStudent sizeSize ratio
(a)DepthWRN 28-4WRN 16-45.87M2.77M47.2%
(b)ChannelWRN 28-4WRN 28-25.87M1.47M25.0%
(c)Depth & channelWRN 28-4WRN 16-25.87M0.70M11.9%
(d)ArchitectureWRN 28-4ResNet 565.87M0.86M14.7%
(e)ArchitecturePyramid-200WRN 28-426.84M5.87M21.9%
(f)ArchitecturePyramid-200Pyramid-11026.84M3.91M14.6%

Teacher models

Download following pre-trained teacher network and put them into ./data directory

Training

Run CIFAR-100/train_with_distillation.py with setting alphabet (a - f)

cd CIFAR-100
python train_with_distillation.py \
--setting a \
--epochs 200 \
--batch_size 128 \
--lr 0.1 \
--momentum 0.9 \
--weight_decay 5e-4

For pyramid teacher (e, f), we used batch-size 64 to save gpu memory.

cd CIFAR-100
python train_with_distillation.py \
--setting e \
--epochs 200 \
--batch_size 64 \
--lr 0.1 \
--momentum 0.9 \
--weight_decay 5e-4

Experimental results

Performance measure is classification error rate (%)

SetupTeacherStudentOriginalProposedImprovement
(a)WRN 28-4WRN 16-422.72%20.89%1.83%
(b)WRN 28-4WRN 28-224.88%21.98%2.90%
(c)WRN 28-4WRN 16-227.32%24.08%3.24%
(d)WRN 28-4ResNet 5627.68%24.44%3.24%
(f)Pyramid-200WRN 28-421.09%17.80%3.29%
(g)Pyramid-200Pyramid-11022.58%18.89%3.69%

ImageNet

Settings

SetupCompression typeTeacherStudentTeacher sizeStudent sizeSize ratio
(a)DepthResNet 152ResNet 5060.19M25.56M42.47%
(b)ArchitectureResNet 50MobileNet25.56M4.23M16.55%

In case of ImageNet, teacher model will be automatically downloaded from PyTorch sites.

Training

cd ImageNet
python train_with_distillation.py \
--data_path your/path/to/ImageNet \
--net_type resnet \
--epochs 100 \
--lr 0.1 \
--batch_size 256
cd ImageNet
python train_with_distillation.py \
--data_path your/path/to/ImageNet \
--net_type mobilenet \
--epochs 100 \
--lr 0.1 \
--batch_size 256

Experimental results

NetworkMethodTop1-errorTop5-error
ResNet 152Teacher21.695.95
ResNet 50Original23.726.97
ResNet 50Proposed21.655.83
NetworkMethodTop1-errorTop5-error
ResNet 50Teacher23.847.14
MobilenetOriginal31.1311.24
MobilenetProposed28.759.66

Segmentation - Pascal VOC

Our segmentation code is based on pytorch-deeplab-xception.

Additional requirements

Settings

TeacherStudentTeacher sizeStudent sizeSize ratio
ResNet 101ResNet 1859.3M16.628.0%
ResNet 101MobileNetV259.3M5.8M9.8%

Teacher models

Download following pre-trained teacher network and put it into ./Segmentation/pretrained directory

We used pre-trained model in pytorch-deeplab-xception for teacher network.

Training

Experimental results

This numbers are based validation performance of our code.

NetworkMethodmIOU
ResNet 101Teacher77.89
ResNet 18Original72.07
ResNet 18Proposed73.98
NetworkMethodmIOU
ResNet 101Teacher77.89
MobileNetV2Original68.46
MobileNetV2Proposed71.19

In the paper, we reported performance on the test set, but our code measures the performance on the val set. Therefore, the performance on code is not same as the paper. If you want accurate measure, please measure performance on test set with Pascal VOC evaluation server.

Citation

@inproceedings{heo2019overhaul,
  title={A Comprehensive Overhaul of Feature Distillation},
  author={Heo, Byeongho and Kim, Jeesoo and Yun, Sangdoo and Park, Hyojin and Kwak, Nojun and Choi, Jin Young},
  booktitle = {International Conference on Computer Vision (ICCV)},
  year={2019}
}

License

Copyright (c) 2019-present NAVER Corp.

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.