Home

Awesome

ZSKD

Zero-Shot Knowledge Distillation in Deep Networks

Paper link : http://proceedings.mlr.press/v97/nayak19a/nayak19a.pdf

Presentation slides link : https://icml.cc/media/Slides/icml/2019/grandball(13-11-00)-13-11-30-4371-zero-shot_knowl.pdf

Poster link : https://drive.google.com/file/d/1ZMCUPnJ3epCtLov26mVttmJT5OQB2HwK/view?usp=sharing

Dependencies

How to use this code:

The cifar 10 dataset is available at:

https://drive.google.com/drive/folders/12mTAIrxSEGQthor3eFO4aBm6-bS4X-sI?usp=sharing

Copy the cifar 10 folder from the above link and put it in the model_training/dataset/ folder

Go to the folder "model_training"

 CUDA_VISIBLE_DEVICES=0 python train.py --network teacher --dataset cifar10 --suffix original_data --epoch 1000 --batch_size 512 

The pretrained teacher model weights are also kept in checkpoints/teacher/ folder.

Make sure the checkpoint and meta graph path is correct in the extract_weights.py script.

 python extract_weights.py

Go to the folder di_generation/

 python dirichmat.py

Two files with name "visualMat_alexnet_cifar10_scale_1.pickle" and "visualMat_alexnet_cifar10_scale_0.1.pickle" will get saved in the same directory

 python cifar_10_impressions_alexnet_Dirch.py

40000 Di's will be saved in the folder alex_di/cifar_10/dirichlet/40000_di/

The sample generated DI's are also available at :

https://drive.google.com/drive/folders/1nsQfzQQh6GTZU5XHd0YztFkw_JDuXO7x?usp=sharing

 CUDA_VISIBLE_DEVICES=0 python train.py --network student --dataset data_impressions --data_augmentation

Citing

If you use this code, please cite our work:

@inproceedings{
nayak2019zero,
title={Zero-Shot Knowledge Distillation in Deep Networks},
author={Nayak, G. K., Mopuri, K. R., Shaj, V., Babu, R. V., and Chakraborty, A.},
booktitle={International Conference on Machine Learning},
pages={4743--4751},
year={2019}
}