Automatic Block-wise Pruning with Auxiliary Gating Structures for Deep Convolutional Neural Networks

Zhaofeng Si, Honggang Qi, Xiaoyu SongarXiv 2022

Abstract

Convolutional neural networks are prevailing in deep learning tasks. However, they suffer from massive cost issues when working on mobile devices. Network pruning is an effective method of model compression to handle such problems. This paper presents a novel structured network pruning method with auxiliary gating structures which assigns importance marks to blocks in backbone network as a criterion when pruning. Block-wise pruning is then realized by proposed voting strategy, which is different from prevailing methods who prune a model in small granularity like channel-wise. We further develop a three-stage training scheduling for the proposed architecture incorporating knowledge distillation for better performance. Our experiments demonstrate that our method can achieve state-of-the-arts compression performance for the classification tasks. In addition, our approach can integrate synergistically with other pruning methods by providing pretrained models, thus achieving a better performance than the unpruned model with over 93% FLOPs reduced.

Introduction

While Convolutional Neural Networks (CNNs) have revolutionized computer vision, their massive computational and storage requirements make them difficult to deploy on resource-constrained mobile devices. Network pruning generally falls into two categories: unstructured pruning (zeroing out individual weights) and structured pruning (removing entire channels or layers). While unstructured pruning saves storage, it doesn't significantly speed up computation on standard hardware. Structured pruning is better for hardware acceleration, but most existing methods work at a very fine granularity, such as individual channels.

This paper introduces Automatic Block-wise Pruning (ABP), a method that targets a larger granularity: the functional blocks of modern architectures like ResNet. By identifying and removing entire redundant blocks, ABP achieves significant hardware-friendly compression.

Methodology

The ABP framework utilizes auxiliary gating modules to rank the importance of network blocks and follows a structured training pipeline.

Auxiliary Gating Structures

Inspired by dynamic inference networks, the authors attach a small gating module to every block in the backbone. These modules learn to output an importance mark (a scalar between 0 and 1) for their respective blocks based on the input data.

The auxiliary gating module architecture (ConvGate or RecurGate) generates an importance mark to weigh the block output against the shortcut connection.

Three-Stage Training Schedule

The pruning process is executed in three distinct stages to ensure stability and performance recovery:

  1. Stage 1: Warm-up. The network is trained with gating modules active to learn block importance.
  2. Stage 2: Iterative Pruning. A "voting strategy" averages importance marks across the dataset. Blocks with the lowest average marks are pruned. Knowledge Distillation (KD) is employed, using the model from the previous iteration as a "teacher" to help the pruned "student" model recover accuracy.
  3. Stage 3: Fine-tuning. A final round of training polishes the pruned architecture. Once complete, gating modules are discarded, leaving a standard, slimmed-down CNN.
The three-stage training schedule: from soft-masked blocks in Stage 1 to iterative pruning with knowledge distillation in Stage 2, resulting in the final pruned model in Stage 3.

Experimental Results

The method was evaluated on CIFAR-10 and CIFAR-100 using various ResNet depths. ABP consistently outperformed state-of-the-art methods like GAL and HRank.

  • ResNet110 (CIFAR-10): The combined "ABP-SFP" method achieved a 93.7% reduction in FLOPs while actually increasing accuracy by 0.20% over the baseline.
  • ResNet56 (CIFAR-10): Pruning 20% of blocks (ABP-0.2) reduced FLOPs by 15% and increased accuracy by 0.91%.
  • ResNet32 (CIFAR-10): ABP-0.6 achieved a 61.7% FLOP reduction with a negligible 0.37% accuracy drop.

A key finding is Synergistic Pruning: because ABP prunes at a block level, it can be combined with fine-grained channel pruning methods (like SFP or HRank) to achieve superior results compared to either method alone.

Conclusion

Automatic Block-wise Pruning (ABP) provides a robust framework for CNN compression. By leveraging auxiliary gating structures and a multi-stage training schedule with knowledge distillation, it effectively identifies redundant blocks. The method not only reduces computational costs significantly but often acts as a regularizer, improving model accuracy. Its ability to integrate with other pruning techniques makes it a versatile tool for deploying deep learning on mobile devices.

Summary updated

BibTeX
@misc{si2022automatic,
  author = {Zhaofeng Si and Honggang Qi and Xiaoyu Song},
  title = {{Automatic Block-wise Pruning with Auxiliary Gating Structures for Deep Convolutional Neural Networks}},
  year = {2022},
  eprint = {2205.03602},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2205.03602},
}
Figure