Pruning Filters for Efficient ConvNets

Hao Li, Asim Kadav, Igor Durdanovic, Hanan Samet, Hans Peter Graf

TL;DR

This paper introduces a simple yet effective method for accelerating Convolutional Neural Networks (CNNs) by pruning entire filters instead of individual weights. By removing "unimportant" filters based on their $l_1$-norm, the authors achieve significant reductions in computational cost (FLOPs) and model size without requiring specialized hardware or sparse software libraries, all while maintaining near-original accuracy.

The Problem: Irregular Sparsity

Deep learning models, particularly CNNs, have become increasingly "heavy," requiring massive amounts of memory and computation. While previous research focused on weight pruning (removing individual connections with small magnitudes), this approach creates "irregular sparsity."

Standard hardware and software (like BLAS libraries) are optimized for dense matrix multiplications; they struggle to turn irregular sparsity into actual wall-clock speedups. Furthermore, while weight pruning effectively shrinks the size of fully connected layers, it often fails to significantly speed up convolutional layers, which are the primary bottleneck during inference. The authors aim to bridge this gap by proposing structured pruning that results in smaller, dense networks that run faster on any standard device.

Methods: Structured Filter Pruning

The authors propose a straightforward four-step pipeline for pruning filters within a layer:

  1. Importance Ranking: For every filter in a layer, calculate the sum of its absolute weights (the $l_1$-norm). The intuition is that filters with smaller weights produce weaker activations and contribute less to the final result.
  2. Pruning: Remove the $m$ filters with the lowest $l_1$-norms.
  3. Structural Adjustment: When a filter is removed, its corresponding output feature map is also gone. This means the kernels in the subsequent layer that would have processed that feature map must also be removed to keep the dimensions consistent.
Illustration of structured filter pruning
  1. Retraining: To recover any lost accuracy, the pruned model is fine-tuned (retrained) for a few epochs.

The paper also explores "one-shot" pruning, where multiple layers are pruned simultaneously before a single retraining phase, which is much faster than the traditional layer-by-layer iterative approach. For complex architectures like ResNets, the authors develop specific rules to handle identity shortcuts, ensuring that the dimensions of residual additions remain compatible after pruning.

Datasets

The researchers evaluated their method on two primary benchmarks:

  • CIFAR-10: Used to test VGG-16 and deep ResNets (ResNet-56 and ResNet-110).
  • ImageNet (ILSVRC 2012): Used to test the scalability of the method on a larger, real-world dataset using ResNet-34.

Key Insights and Ideas

  • Density is King: By pruning entire filters, the network remains "dense." This allows the model to leverage existing, highly optimized libraries for matrix multiplication, leading to immediate "wall-clock" time savings.
  • Sensitivity Matters: Not all layers are created equal. The authors performed a sensitivity analysis and found that some layers (often the earliest or those where feature map sizes change) are highly sensitive to pruning, while others are incredibly redundant. For example, in VGG-16, some layers can lose 50-75% of their filters with almost no impact on accuracy.
Sensitivity analysis of VGG-16 on CIFAR-10
  • ResNets are Leaner but still Prunable: Even though ResNets are designed to be more efficient than older architectures like VGG, they still contain roughly 30% redundancy in their convolutional layers.
  • Data-Free Heuristic: Using the $l_1$-norm of weights is a "data-free" approach. Unlike methods that require passing thousands of images through the network to see which neurons fire, this method only requires looking at the model's parameters.

Key Results

The results demonstrate that significant efficiency gains are possible with minimal accuracy trade-offs:

  • VGG-16 (CIFAR-10): Reduced FLOPs by 34% and parameters by 64%. Surprisingly, the error rate actually decreased slightly (from 6.75% to 6.60%), suggesting the pruning acted as a form of regularization.
  • ResNet-110 (CIFAR-10): Achieved a 38% reduction in FLOPs with virtually no loss in accuracy.
  • ResNet-34 (ImageNet): Reduced FLOPs by 24% with only a ~1% increase in top-5 error.
  • Wall-Clock Speedup: On a Titan X GPU, the pruned VGG-16 model showed a 40.7% improvement in inference time, proving that FLOP reductions translate directly to real-world speed.

Limitations and Future Work

  • Heuristic Simplicity: While the $l_1$-norm is effective, it is a simple heuristic. It doesn't account for the correlation between filters (e.g., two large filters might be doing the exact same thing).
  • Manual Sensitivity Tuning: The authors manually determined which layers to prune based on sensitivity plots. Automating this "pruning schedule" for any arbitrary architecture remains an open challenge.
  • Extreme Pruning: The "one-shot" retraining strategy works well for moderate pruning, but the authors note that for very aggressive pruning or sensitive layers, iterative pruning (prune-retrain-prune) is still necessary to maintain accuracy.

Summary updated

BibTeX
@inproceedings{li2017pruning,
  author = {Hao Li and Asim Kadav and Igor Durdanovic and Hanan Samet and Hans Peter Graf},
  title = {{Pruning Filters for Efficient ConvNets}},
  booktitle = {International Conference on Learning Representations},
  year = {2017},
  url = {https://openreview.net/forum?id=rJqFGTslg},
}
Figure