arXivDaily arXiv每日学术速递 周一至周五更新
arXiv周末暂无论文更新,休息一下吧,周末愉快~~
arXiv 2407.04616cs.CVcs.AIcs.LG

视觉模型的同构剪枝

Isomorphic Pruning for Vision Models

National University of Singapore(新加坡国立大学);Huawei Technologies Ltd.(华为技术有限公司)

Gongfan Fang, Xinyin Ma, Michael Bi Mi, Xinchao Wang

AI总结:

本文提出同构剪枝方法,针对视觉模型中异构子结构难以比较重要性的问题,通过按子结构类型隔离排序与比较实现更可靠的剪枝,在ViT和CNN上均取得优于专用剪枝基线的性能。

摘要:

结构化剪枝通过移除冗余子结构来降低深度神经网络的计算开销。然而,评估不同子结构的相对重要性仍然是一个重大挑战,尤其是在具有自注意力、深度可分离卷积或残差连接等新机制和新架构的先进视觉模型中。这些异构子结构通常表现出不同的参数规模、权重分布和计算拓扑,给重要性比较带来了相当大的困难。为了克服这一问题,我们提出了同构剪枝(Isomorphic Pruning),这是一种简单的方法,在视觉Transformer和CNN等一系列网络架构上均展现出有效性,并在不同模型规模下提供了具有竞争力的性能。同构剪枝源于一个观察:在预定义的重要性准则下进行评估时,异构子结构的重要性分布表现出显著差异,而同构结构则呈现相似的重要性模式。这启发我们对不同类型的子结构进行隔离排序和比较,以实现更可靠的剪枝。我们在ImageNet-1K上的实验结果表明,同构剪枝超越了多个专门为Transformer或CNN设计的剪枝基线。例如,我们通过剪枝一个现成的DeiT-Base模型,将DeiT-Tiny的准确率从74.52%提高到77.50%。对于ConvNext-Tiny,我们将性能从82.06%提升到82.18%,同时减少了参数数量和内存占用。代码可在\url{https://github.com/VainF/Isomorphic-Pruning}获取。

英文摘要:

Structured pruning reduces the computational overhead of deep neural networks by removing redundant sub-structures. However, assessing the relative importance of different sub-structures remains a significant challenge, particularly in advanced vision models featuring novel mechanisms and architectures like self-attention, depth-wise convolutions, or residual connections. These heterogeneous substructures usually exhibit diverged parameter scales, weight distributions, and computational topology, introducing considerable difficulty to importance comparison. To overcome this, we present Isomorphic Pruning, a simple approach that demonstrates effectiveness across a range of network architectures such as Vision Transformers and CNNs, and delivers competitive performance across different model sizes. Isomorphic Pruning originates from an observation that, when evaluated under a pre-defined importance criterion, heterogeneous sub-structures demonstrate significant divergence in their importance distribution, as opposed to isomorphic structures that present similar importance patterns. This inspires us to perform isolated ranking and comparison on different types of sub-structures for more reliable pruning. Our empirical results on ImageNet-1K demonstrate that Isomorphic Pruning surpasses several pruning baselines dedicatedly designed for Transformers or CNNs. For instance, we improve the accuracy of DeiT-Tiny from 74.52% to 77.50% by pruning an off-the-shelf DeiT-Base model. And for ConvNext-Tiny, we enhanced performance from 82.06% to 82.18%, while reducing the number of parameters and memory usage. Code is available at \url{https://github.com/VainF/Isomorphic-Pruning}.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑