[论文解读] CP-ViT: Cascade Vision Transformer Pruning via Progressive Sparsity Prediction
CP-ViT 通过对视觉变换器进行级联剪枝,逐步预测并剪除不信息的补丁和头部,使用累积分数和层级感知剪枝在尽量少的准确度损失前提下降低 FLOPs,可有无微调。
Vision transformer (ViT) has achieved competitive accuracy on a variety of computer vision applications, but its computational cost impedes the deployment on resource-limited mobile devices. We explore the sparsity in ViT and observe that informative patches and heads are sufficient for accurate image recognition. In this paper, we propose a cascade pruning framework named CP-ViT by predicting sparsity in ViT models progressively and dynamically to reduce computational redundancy while minimizing the accuracy loss. Specifically, we define the cumulative score to reserve the informative patches and heads across the ViT model for better accuracy. We also propose the dynamic pruning ratio adjustment technique based on layer-aware attention range. CP-ViT has great general applicability for practical deployment, which can be applied to a wide range of ViT models and can achieve superior accuracy with or without fine-tuning. Extensive experiments on ImageNet, CIFAR-10, and CIFAR-100 with various pre-trained models have demonstrated the effectiveness and efficiency of CP-ViT. By progressively pruning 50\% patches, our CP-ViT method reduces over 40\% FLOPs while maintaining accuracy loss within 1\%.
研究动机与目标
- 探索视觉变换器(ViT)中的稀疏性,以识别驱动准确性的有信息量的补丁和头部(PH区域)。
- 开发一个级联剪枝框架,动态剪除对准确性影响较小的无信息量 PH区域。
- 引入累积分数机制,在跨层保留有信息量的 PH区域。
- 提出基于注意力范围的分层感知剪枝比调整方法,平衡效率与准确性。
- 展示在不同 ViT 模型上的广泛适用性,以及有无微调时的性能表现。
提出的方法
- 在 ViT 中通过来自注意力概率的来自信息量的补丁/头部来定义信息量丰富的 PH区域。
- 使用一个渐进稀疏性预测框架在各层之间计算累积分数。
- 通过对 MHSA 和 FFN 中无信息量的 PH区域进行屏蔽来应用级联剪枝,从而在后续层中实现跳过计算。
- 使用“分层感知剪枝比”方法按层计算剪枝比,利用注意力范围来调整每一层的剪枝。
- 基于最大注意力概率值进行剪枝,以高效近似信息量。
- 可选地对预训练模型进行微调,以在剪枝下提高准确性。
实验结果
研究问题
- RQ1ViT 模型是否可以通过有信息量的补丁和头部表现出显著影响准确性的稀疏性?
- RQ2级联剪枝方法是否能够在跨层丢弃无信息量的 PH区域的同时保持准确性?
- RQ3如何动态按层调整剪枝比以考虑层间注意力范围的差异?
- RQ4在不同 ViT 架构下,CP-ViT 在大幅降低 FLOPs 的同时,是否有无微调均能维持较高准确性?
主要发现
- CP-ViT 能在不进行微调的情况下剪掉约 50% 的补丁,FLOPs 下降超过 40%,准确性损失低于 1%。
- 通过对层按注意力范围微调剪枝比,在较大剪枝水平下提升鲁棒性并降低准确性损失。
- 使用累积分数的渐进稀疏性预测在跨层保留有信息量的 PH区域,优于随机剪枝和逐层无感知剪枝。
- CP-ViT 与其他 ViT 剪枝方法相比,在是否进行微调时都能提供更有利的准确性–FLOPs 权衡。
- 对 CP-ViT 进行微调可显著增加可实现的 FLOPs 节省,同时在若干 ViT 模型上保持或略有提高准确性。
更好的研究,从现在开始
从阅读论文到最终审阅,大幅缩短您的研究时间。
无需绑定信用卡
本解读由 AI 生成,并经人工编辑审核。