通过降低核复杂度,实现高效视觉Transformer的通道自适应剪枝。
Compact Vision Transformer by Reduction of Kernel Complexity
- 基于理论泛化界设计可微通道选择机制,精准剪枝非关键通道。
- 在保持精度前提下,模型FLOPs和参数量显著下降,性能更优。
- 兼容ViT、Swin等主流架构,适合资源受限场景的高效部署。
自注意力与Transformer架构已成为现代深度学习的核心组件。近期研究将Transformer模块融入紧凑型神经网络以提升计算机视觉效率,催生了多种高效视觉Transformer。本文提出一种新型紧凑Transformer模块——核复杂度缩减Transformer(KCR-Transformer),其通过新颖且严格的理论泛化界指导可微通道选择,在Transformer块的MLP层中实现输入/输出通道剪枝,有效降低计算开销。我们提供了严谨的理论分析,建立了配备KCR-Transformer模块网络的紧致泛化误差上界。基于此强理论保障,通道剪枝过程具备泛化意识,确保模型仍维持可证明的小泛化误差。该模块兼容多种主流紧凑Transformer网络(如ViT、Swin),替换全部Transformer块后,所得KCR-Transformer网络在多个视觉任务中表现优异,以更低的FLOPs与参数量超越原模型性能。
原文摘要 · Abstract (English)
Self-attention and transformer architectures have become foundational components in modern deep learning. Recent efforts have integrated transformer blocks into compact neural architectures for computer vision, giving rise to various efficient vision transformers. In this work, we introduce Transformer with Kernel Complexity Reduction, or KCR-Transformer, a compact transformer block equipped with differentiable channel selection, guided by a novel and sharp theoretical generalization bound. KCR-Transformer performs input/output channel selection in the MLP layers of transformer blocks to reduce the computational cost. Furthermore, we provide a rigorous theoretical analysis establishing a tight generalization bound for networks equipped with KCR-Transformer blocks. Leveraging such strong theoretical results, the channel pruning by KCR-Transformer is conducted in a generalization-aware manner, ensuring that the resulting network retains a provably small generalization error. Our KCR-Transformer is compatible with many popular and compact transformer networks, such as ViT and Swin, and it reduces the FLOPs of the vision transformers while maintaining or even improving the prediction accuracy. In the experiments, we replace all the transformer blocks in the vision transformers with KCR-Transformer blocks, leading to KCR-Transformer networks with different backbones. The resulting TCR-Transformers achieve superior performance on various computer vision tasks, achieving even better performance than the original models with even less FLOPs and parameters.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。