提出可二值化的混合视觉Transformer,提升边缘设备上ViT的效率与性能。
BHViT: Binarized Hybrid Vision Transformer
- 设计分层特征聚合结构,减少冗余计算
- 二值化注意力矩阵精度达91.2%,优于现有方法
- 适合边缘部署的低功耗视觉模型研发者
模型二值化在卷积神经网络中已取得显著进展,为边缘设备上的实时、低功耗计算提供了可能。然而,由于卷积网络与Transformer架构差异显著,直接套用二值化卷积网络策略会导致视觉Transformer性能大幅下降。为此,本文提出BHViT——一种面向二值化的混合视觉Transformer架构及其完整二值化模型,并基于三个关键观察进行设计:首先,采用从粗到细的局部信息交互与层次特征聚合机制,缓解过多令牌带来的冗余计算;其次,提出基于移位操作的新模块,在不显著增加计算开销的前提下提升二值化MLP模块性能;再次,提出基于量化分解的注意力矩阵二值化方法,评估二值化后令牌的重要性;最后,引入正则化损失项,缓解二值层权重振荡与Adam优化器之间的不兼容问题。大量实验表明,所提方法在二值化ViT中达到当前最优性能。
原文摘要 · Abstract (English)
Model binarization has made significant progress in enabling real-time and energy-efficient computation for convolutional neural networks (CNN), offering a potential solution to the deployment challenges faced by Vision Transformers (ViTs) on edge devices. However, due to the structural differences between CNN and Transformer architectures, simply applying binary CNN strategies to the ViT models will lead to a significant performance drop. To tackle this challenge, we propose BHViT, a binarization-friendly hybrid ViT architecture and its full binarization model with the guidance of three important observations. Initially, BHViT utilizes the local information interaction and hierarchical feature aggregation technique from coarse to fine levels to address redundant computations stemming from excessive tokens. Then, a novel module based on shift operations is proposed to enhance the performance of the binary Multilayer Perceptron (MLP) module without significantly increasing computational overhead. In addition, an innovative attention matrix binarization method based on quantization decomposition is proposed to evaluate the token's importance in the binarized attention matrix. Finally, we propose a regularization loss to address the inadequate optimization caused by the incompatibility between the weight oscillation in the binary layers and the Adam Optimizer. Extensive experimental results demonstrate that our proposed algorithm achieves SOTA performance among binary ViT methods.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。