DeViT:面向边缘设备协同推理的 Vision Transformer 分解
DeViT: Decomposing Vision Transformers for Collaborative Inference in Edge Devices
AI总结:
提出协同推理框架 DeViT 及基于知识蒸馏的 DEKD 算法,将大型 ViT 分解为多个小模型以降低边缘部署的计算与通信开销,在保持准确率的同时显著提升推理速度并降低能耗。
摘要:
近年来,vision transformer (ViT) 取得了巨大成功,在多个计算机视觉基准上实现了最先进的性能。然而,ViT 模型参数量庞大且计算成本高,导致难以部署在资源受限的边缘设备上。现有解决方案大多将 ViT 模型压缩为紧凑模型,但仍无法实现实时推理。为解决此问题,我们提出探索 transformer 结构的可分性,并将大型 ViT 分解为多个小模型,以便在边缘设备上进行协同推理。我们的目标是在保持与大型 ViT 相当的准确率的同时,实现快速且节能的协同推理。为此,我们首先提出了一种名为 DeViT 的协同推理框架,通过分解大型 ViT 来促进边缘部署。随后,我们设计了一种基于知识蒸馏的分解与集成算法,称为 DEKD,用于融合多个分解后的小模型,同时大幅减少通信开销,并通过开发特征匹配模块来处理异构模型,以促进分解模型对大型 ViT 的模仿。在四个广泛使用的数据集上对三种代表性 ViT 主干网络进行的大量实验表明,我们的方法实现了高效的 ViT 协同推理,并优于现有的轻量级 ViT,在效率和准确率之间取得了良好的折中。例如,在 GPU 服务器上使用 CIFAR-100 与大型 ViT ViT-L/16 相比,我们的 DeViT 将端到端延迟提高了 2.89 倍,仅牺牲了 1.65% 的准确率。DeDeiTs 在 ImageNet-1K 上的准确率比近期高效的 ViT MobileViT-S 高出 3.54%,同时在边缘设备上运行速度快 1.72 倍,能耗降低 55.28%。
英文摘要:
Recent years have witnessed the great success of vision transformer (ViT), which has achieved state-of-the-art performance on multiple computer vision benchmarks. However, ViT models suffer from vast amounts of parameters and high computation cost, leading to difficult deployment on resource-constrained edge devices. Existing solutions mostly compress ViT models to a compact model but still cannot achieve real-time inference. To tackle this issue, we propose to explore the divisibility of transformer structure, and decompose the large ViT into multiple small models for collaborative inference at edge devices. Our objective is to achieve fast and energy-efficient collaborative inference while maintaining comparable accuracy compared with large ViTs. To this end, we first propose a collaborative inference framework termed DeViT to facilitate edge deployment by decomposing large ViTs. Subsequently, we design a decomposition-and-ensemble algorithm based on knowledge distillation, termed DEKD, to fuse multiple small decomposed models while dramatically reducing communication overheads, and handle heterogeneous models by developing a feature matching module to promote the imitations of decomposed models from the large ViT. Extensive experiments for three representative ViT backbones on four widely-used datasets demonstrate our method achieves efficient collaborative inference for ViTs and outperforms existing lightweight ViTs, striking a good trade-off between efficiency and accuracy. For example, our DeViTs improves end-to-end latency by 2.89$\times$ with only 1.65% accuracy sacrifice using CIFAR-100 compared to the large ViT, ViT-L/16, on the GPU server. DeDeiTs surpasses the recent efficient ViT, MobileViT-S, by 3.54% in accuracy on ImageNet-1K, while running 1.72$\times$ faster and requiring 55.28% lower energy consumption on the edge device.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。