arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2409.03777cs.CVcs.LG
收藏

一种面向CNN全网络滤波器剪枝的贪婪层次方法

A Greedy Hierarchical Approach to Whole-Network Filter-Pruning in CNNs

Department of Computer Science and Engineering(计算机科学与工程系);Indian Institute of Technology, Kharagpur, India(印度理工学院,Khargpur,印度)

Kiran Purohit, Anurag Reddy Parvathgari, Sourangshu Bhattacharya

AI总结:

提出一种基于线性近似的两层层次化贪婪剪枝算法,通过低层滤波器选择和全局剪枝准则高效剪枝,在多个网络上优于现有方法。

摘要:

深度卷积神经网络(CNN)在许多计算机视觉任务中取得了令人印象深刻的表现。然而,它们的大模型尺寸需要大量计算资源,因此从预训练的CNN中剪枝冗余滤波器是开发资源受限设备高效模型的关键任务。全网络滤波器剪枝算法从每层剪枝不同比例的滤波器,从而提供更大的灵活性。当前的全网络剪枝方法要么因需要使用训练数据集计算每个剪枝滤波器的损失而计算成本高昂,要么使用各种启发式/学习标准来确定每层的剪枝比例。本文提出了一种高效的两级层次化全网络滤波器剪枝方法,该方法使用分类损失作为最终标准。低级算法(称为滤波器剪枝)使用基于滤波器权重线性近似的稀疏近似公式。我们探索了两种算法:基于正交匹配追踪的贪婪选择和贪婪反向剪枝方法。反向剪枝算法使用一种新颖的闭式误差标准,在每个阶段高效选择最优滤波器,从而使整个算法更快。高级算法(称为层选择)使用全局剪枝准则贪婪地选择最佳剪枝层(使用滤波器选择算法进行剪枝)。我们针对两种不同的全局剪枝准则提出了算法:(1)逐层相对误差(HBGS),和(2)最终分类误差(HBGTS)。我们的算法套件在ResNet18、ResNet32、ResNet56、VGG16和ResNext101上优于最先进的剪枝方法。我们的方法将ResNext101的RAM需求从7.6 GB降低到1.5 GB,并在CIFAR-10上实现了94%的FLOPS减少而不损失精度。

英文摘要:

Deep convolutional neural networks (CNNs) have achieved impressive performance in many computer vision tasks. However, their large model sizes require heavy computational resources, making pruning redundant filters from existing pre-trained CNNs an essential task in developing efficient models for resource-constrained devices. Whole-network filter pruning algorithms prune varying fractions of filters from each layer, hence providing greater flexibility. Current whole-network pruning methods are either computationally expensive due to the need to calculate the loss for each pruned filter using a training dataset, or use various heuristic / learned criteria for determining the pruning fractions for each layer. This paper proposes a two-level hierarchical approach for whole-network filter pruning which is efficient and uses the classification loss as the final criterion. The lower-level algorithm (called filter-pruning) uses a sparse-approximation formulation based on linear approximation of filter weights. We explore two algorithms: orthogonal matching pursuit-based greedy selection and a greedy backward pruning approach. The backward pruning algorithm uses a novel closed-form error criterion for efficiently selecting the optimal filter at each stage, thus making the whole algorithm much faster. The higher-level algorithm (called layer-selection) greedily selects the best-pruned layer (pruning using the filter-selection algorithm) using a global pruning criterion. We propose algorithms for two different global-pruning criteria: (1) layer-wise relative error (HBGS), and (2) final classification error (HBGTS). Our suite of algorithms outperforms state-of-the-art pruning methods on ResNet18, ResNet32, ResNet56, VGG16, and ResNext101. Our method reduces the RAM requirement for ResNext101 from 7.6 GB to 1.5 GB and achieves a 94% reduction in FLOPS without losing accuracy on CIFAR-10.

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

↑