arXiv:2502.16762cs.CV2025-02

用知识蒸馏让小模型学大模型,提升图像识别精度

A Transformer-in-Transformer Network Utilizing Knowledge Distillation for Image Recognition

  • 内外双层Transformer捕捉图像全局与局部特征
  • 在多个数据集上达成92%以上准确率,最优达99.56%
  • 适合资源受限场景下的高效图像分类任务

本文提出一种基于知识蒸馏的新型Transformer-in-Transformer网络(TITN),用于高效图像分类。自然图像包含复杂结构和大量冗余信息,单纯依赖局部图像块计算注意力难以全面建模。为此,我们设计了内外双层Transformer架构,兼顾全局与局部特征。同时,为缓解大型Transformer训练耗时、耗资源的问题,引入知识蒸馏机制,通过教师模型指导学生模型学习,显著提升训练效率。特别地,蒸馏过程嵌入特征提取层,使模型具备轻量化特性。在MNIST、CIFAR10和CIFAR100上的大量实验表明,该模型性能优异:在CIFAR100上达到74.71%的Top-1准确率和92.28%的Top-5准确率;在CIFAR-10上实现92.03%的Top-1准确率和99.80%的Top-5准确率;在MNIST上达到99.56%的Top-1准确率。消融实验进一步验证了各组件的有效性。

原文摘要 · Abstract (English)

This paper presents a novel knowledge distillation neural architecture leveraging efficient transformer networks for effective image classification. Natural images display intricate arrangements encompassing numerous extraneous elements. Vision transformers utilize localized patches to compute attention. However, exclusive dependence on patch segmentation proves inadequate in sufficiently encompassing the comprehensive nature of the image. To address this issue, we have proposed an inner-outer transformer-based architecture, which gives attention to the global and local aspects of the image. Moreover, The training of transformer models poses significant challenges due to their demanding resource, time, and data requirements. To tackle this, we integrate knowledge distillation into the architecture, enabling efficient learning. Leveraging insights from a larger teacher model, our approach enhances learning efficiency and effectiveness. Significantly, the transformer-in-transformer network acquires lightweight characteristics by means of distillation conducted within the feature extraction layer. Our featured network's robustness is established through substantial experimentation on the MNIST, CIFAR10, and CIFAR100 datasets, demonstrating commendable top-1 and top-5 accuracy. The conducted ablative analysis comprehensively validates the effectiveness of the chosen parameters and settings, showcasing their superiority against contemporary methodologies. Remarkably, the proposed Transformer-in-Transformer Network (TITN) model achieves impressive performance milestones across various datasets: securing the highest top-1 accuracy of 74.71% and a top-5 accuracy of 92.28% for the CIFAR100 dataset, attaining an unparalleled top-1 accuracy of 92.03% and top-5 accuracy of 99.80% for the CIFAR-10 dataset, and registering an exceptional top-1 accuracy of 99.56% for the MNIST dataset.

图像识别Transformer知识蒸馏轻量化

Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。