torchdistill: A Modular, Configuration-Driven Framework for Knowledge Distillation

25 Nov 2020  ·  Yoshitomo Matsubara ·

While knowledge distillation (transfer) has been attracting attentions from the research community, the recent development in the fields has heightened the need for reproducible studies and highly generalized frameworks to lower barriers to such high-quality, reproducible deep learning research. Several researchers voluntarily published frameworks used in their knowledge distillation studies to help other interested researchers reproduce their original work. Such frameworks, however, are usually neither well generalized nor maintained, thus researchers are still required to write a lot of code to refactor/build on the frameworks for introducing new methods, models, datasets and designing experiments. In this paper, we present our developed open-source framework built on PyTorch and dedicated for knowledge distillation studies. The framework is designed to enable users to design experiments by declarative PyYAML configuration files, and helps researchers complete the recently proposed ML Code Completeness Checklist. Using the developed framework, we demonstrate its various efficient training strategies, and implement a variety of knowledge distillation methods. We also reproduce some of their original experimental results on the ImageNet and COCO datasets presented at major machine learning conferences such as ICLR, NeurIPS, CVPR and ECCV, including recent state-of-the-art methods. All the source code, configurations, log files and trained model weights are publicly available at https://github.com/yoshitomo-matsubara/torchdistill .

PDF Abstract
Task Dataset Model Metric Name Metric Value Global Rank Uses Extra
Training Data
Result Benchmark
Object Detection COCO test-dev Faster R-CNN (Bottleneck-injected ResNet-50 and FPN) box mAP 35.9 # 218
Hardware Burden None # 1
Operations per network pass None # 1
Object Detection COCO test-dev Mask R-CNN (Bottleneck-injected ResNet-50, FPN) box mAP 36.9 # 213
Hardware Burden None # 1
Operations per network pass None # 1
Instance Segmentation COCO test-dev Mask R-CNN (Bottleneck-injected ResNet-50, FPN) mask AP 33.6 # 98
Image Classification ImageNet ResNet-18 (KD w/ ResNet-34 teacher) Top 1 Accuracy 71.37% # 938
Image Classification ImageNet ResNet-18 (L2 w/ ResNet-34 teacher) Top 1 Accuracy 71.08% # 941
Image Classification ImageNet ResNet-18 (SSKD w/ ResNet-34 teacher) Top 1 Accuracy 70.09% # 950
Image Classification ImageNet ResNet-18 (CRD w/ ResNet-34 teacher) Top 1 Accuracy 70.93% # 943
Image Classification ImageNet ResNet-18 (FT w/ ResNet-34 teacher) Top 1 Accuracy 71.56% # 935
Image Classification ImageNet ResNet-18 (PAD-L2 w/ ResNet-34 teacher) Top 1 Accuracy 71.71% # 932
Hardware Burden None # 1
Operations per network pass None # 1
Image Classification ImageNet ResNet-18 (tf-KD w/ ResNet-18 teacher) Top 1 Accuracy 70.52% # 947

Methods