Home

Awesome

Knowledge Distillation Methods with Tensorflow

Knowledge distillation is the method to enhance student network by teacher knowledge. So annually knowledge distillation methods have been proposed, but each paper's do experiments with different networks and compare with different methods. Moreover, each method is implemented by each author, so if a new researcher wants to study knowledge distillation, they have to find or implement all of the methods. Surely it is tough work. To reduce this burden, I publish some codes and modify from my research codes. I'll update the code and knowledge distillation algorithm, and all of the things will be implemented using Tensorflow.

Upgrade version of this Repo. will be available at this link

Implemented Knowledge Distillation Methods

Please check detail of each category in MHGD and If you think the above categorization is useful, please consider citing the following paper.

@inproceedings{GraphKD,
  title = {Graph-based Knowledge Distillation by Multi-head Attention Network},
  author = {Seunghyun Lee, Byung Cheol Song},
  booktitle = {British Machine Vision Conference (BMVC)},
  year = {2019}
}

Response-based Knowledge

Defined knowledge by the neural response of the hidden layer or the output layer of the network

Multi-connection Knowledge

Increase the quantity of knowledge by sensing several points of the teacher network

Shared-representation Knowledge

Defined knowledge by the shared representation between two feature maps

Relational Knowledge

Defined knowledge by intra-data relation

Experimental Results

The below table and plot are sample results using ResNet and train on CIFAR100.

I use the same hyper-parameter for training each network, and only tune hyper-parameter of each distillation algorithm. However the results may be not optimal. All of the numerical values and plots are averages of five trials.

Network architecture

The teacher network is ResNet32 and Student is ResNet8, and the student network is well-converged (not over and under-fit) for evaluating each distillation algorithm performance precisely. Note that implemented ResNet has doubled depth.

Training/Validation accuracy

MethodsLast AccuracyBest Accuracy
Student71.7671.92
Teacher78.9679.08
Soft-logits71.7972.08
FitNet72.7472.96
AT72.3172.60
FSP72.6572.91
DML73.2773.47
KD-SVD73.6873.78
KD-EID73.8474.07
FT73.3573.50
AB73.0873.41
RKD73.4073.48
MHGD73.9874.30
<img src="plots.png" width="800">

Plan to do