Joint Multi-Dimension Pruning via Numerical Gradient Update

Zechun Liu, Xiangyu Zhang, Zhiqiang Shen, Yichen Wei, Kwang-Ting Cheng, Jian Sun

Abstract

We present joint multi-dimension pruning (JointPruning), an effective method of pruning a network on three crucial aspects: spatial, depth, and channel simultaneously. To tackle these three naturally different dimensions, we proposed a general framework by defining pruning as seeking the best pruning vector (i.e., the numerical value of layer-wise channel number, spatial size, depth) and construct a unique mapping from the pruning vector to the pruned network structures. Then we optimize the pruning vector with gradient update and model joint pruning as a numerical gradient optimization process. To overcome the challenge that there is no explicit function between the loss and the pruning vectors, we proposed self-adapted stochastic gradient estimation to construct a gradient path through network loss to pruning vectors and enable efficient gradient update. We show that the joint strategy discovers a better status than previous studies that focused on individual dimensions solely, as our method is optimized collaboratively across the three dimensions in a single end-to-end training. Extensive experiments on large-scale ImageNet dataset across a variety of network architectures MobileNet V1, V2, V3 and ResNet demonstrate the effectiveness of our proposed method.

Introduction

Traditionally, network pruning focuses on removing redundant channels to reduce model width. However, a model's efficiency is also heavily dictated by its depth (number of layers) and spatial resolution (input image size). These three dimensions are deeply interrelated; for example, reducing the input resolution might allow for a deeper network under the same computational budget.

The challenge lies in the search space, which is astronomical and discrete. Most existing methods either prune one dimension at a time—leading to sub-optimal results—or use computationally expensive "grid searches." Furthermore, there is no direct mathematical formula linking a specific architecture configuration to the final network loss, making standard gradient descent impossible. JointPruning addresses this by treating architecture search as a continuous optimization problem solved via numerical gradient updates.

Methodology

JointPruning treats the architecture search as a continuous optimization problem through several key components:

  1. The Pruning Vector ($v$): A vector is defined to represent the number of channels per layer, the input resolution, and the network depth.
  2. Stochastic Gradient Estimation (SGE): Since the loss is not directly differentiable with respect to the architecture, the method employs SGE. By injecting random Gaussian noise into the pruning vector and evaluating the resulting "noisy" architectures, the system estimates a "numerical gradient." This gradient indicates the direction to adjust the pruning vector to minimize inference error.
  3. Joint Weight Sharing: To avoid training every sampled architecture from scratch, a "super-network" is utilized. The method trains one large model and "crops" its weights and feature maps to simulate smaller, pruned versions during the search process.
  4. Alternating Optimization: The process alternates between updating the network weights (to improve super-network robustness) and updating the pruning vector (to find the optimal architecture).
Stochastic Gradient Estimation (SGE) framework for optimizing the pruning vector.

Hardware-Aware Optimization

A significant advantage of JointPruning is its ability to target specific hardware metrics such as FLOPs, CPU latency, or GPU latency. The algorithm discovers that different hardware favors different architectural balances:

  • CPU Preference: Under CPU constraints, the algorithm tends to favor deeper networks with smaller spatial resolutions.
  • GPU Preference: For GPUs, which thrive on parallelism, the algorithm discovers architectures with more channels and fewer layers to better utilize parallel processing power.

Experimental Evaluation

The primary benchmark used is the ImageNet 2012 classification dataset. JointPruning consistently outperforms both uniform scaling and specialized AutoML pruning methods across various architectures.

As shown in the MobileNet V1 results, the joint search across channel, image (spatial), and depth dimensions significantly outperforms single-dimension searches and established baselines like NetAdapt and AMC. For instance, JointPruning achieved improvements of 2.5% and 2.6% in Top-1 accuracy over state-of-the-art methods under extreme compression ratios for MobileNet V1 and V2.

Performance comparison on MobileNet V1, showing JointPruning outperforming other methods.

Key results include:

  • MobileNet V3: Reached 77.3% Top-1 accuracy at 344M FLOPs, surpassing previous NAS results.
  • Efficiency: Finding an optimal pruned network took only 40 GPU hours, significantly faster than adaptation-based methods like ChamNet.
  • ResNet-50: At 2.8G FLOPs, JointPruning achieved 76.5% accuracy, outperforming traditional channel-only pruning methods.

Conclusion

JointPruning demonstrates that width, depth, and resolution should not be tuned in isolation. By treating discrete architectural parameters as continuous values and utilizing stochastic gradient estimation, the framework efficiently navigates the complex search space. While the weight-sharing mechanism can introduce ranking bias, the significant accuracy gains and reduced search time mark a major step forward in automated network compression. Future work will focus on automating hyperparameter tuning and extending the method to tasks like object detection and segmentation.

Summary updated

BibTeX
@article{liu2021joint,
  author = {Zechun Liu and Xiangyu Zhang and Zhiqiang Shen and Yichen Wei and Kwang-Ting Cheng and Jian Sun},
  title = {{Joint Multi-Dimension Pruning via Numerical Gradient Update}},
  journal = {IEEE Trans. Image Process.},
  year = {2021},
  doi = {10.1109/tip.2021.3112041},
}
Figure