Small CNN-based models usually require transferring knowledge from a large model before they are deployed in computationally resource-limited edge devices. Masked image modeling (MIM) methods achieve great success in various visual tasks but remain largely unexplored in knowledge distillation for heterogeneous deep models. The reason is mainly due to the significant discrepancy between the Transformer-based large model and the CNN-based small network. In this paper, we develop the first Heterogeneous Generative Knowledge Distillation (H-GKD) based on MIM, which can efficiently transfer knowledge from large Transformer models to small CNN-based models in a generative self-supervised fashion. Our method builds a bridge between Transformer-based models and CNNs by training a UNet-style student with sparse convolution, which can effectively mimic the visual representation inferred by a teacher over masked modeling. Our method is a simple yet effective learning paradigm to learn the visual representation and distribution of data from heterogeneous teacher models, which can be pre-trained using advanced generative methods. Extensive experiments show that it adapts well to various models and sizes, consistently achieving state-of-the-art performance in image classification, object detection, and semantic segmentation tasks. For example, in the Imagenet 1K dataset, H-GKD improves the accuracy of Resnet50 (sparse) from 76.98% to 80.01%.
翻译:基于CNN的小模型通常需要先从一个大型模型中迁移知识,才能部署于计算资源受限的边缘设备。掩码图像建模(MIM)方法在多种视觉任务中取得了巨大成功,但在异构深度模型的知识蒸馏中仍鲜有探索,这主要是由于基于Transformer的大模型与基于CNN的小网络之间存在显著差异。本文首次提出基于MIM的异构生成式知识蒸馏(H-GKD),能够以生成式自监督方式将知识从大型Transformer模型高效迁移至小型CNN模型。我们的方法通过训练一个采用稀疏卷积的UNet风格学生模型,在Transformer与CNN之间架起桥梁,从而有效模仿教师模型在掩码建模中推断出的视觉表征。该学习范式简洁而高效,能够从异构教师模型中学习数据的视觉表征与分布,且教师模型可使用先进的生成方法进行预训练。大量实验表明,该方法能良好适配不同模型与规模,在图像分类、目标检测和语义分割任务中持续取得最优性能。例如,在ImageNet 1K数据集上,H-GKD将Resnet50(稀疏)的准确率从76.98%提升至80.01%。