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

Kiran Purohit, Anurag Reddy Parvathgari, Sourangshu Bhattacharya

TL;DR

This paper introduces a novel two-level hierarchical framework for whole-network filter pruning in CNNs that optimizes global classification loss without the massive computational overhead typical of traditional methods. By combining a greedy layer-selection strategy with a fast backward-elimination filter pruning algorithm using a closed-form error criterion, the approach achieves massive size and FLOP reductions (e.g., a 94% FLOP reduction on ResNext101) while maintaining or even improving baseline accuracy.

What Problem Does This Paper Address?

Deploying deep convolutional neural networks (CNNs) on resource-constrained edge and IoT devices is challenging due to their massive memory footprints and computational complexity (FLOPs). Filter pruning—removing entire hardware-friendly channels rather than individual weights—is a popular solution to make networks smaller and faster.

While uniform pruning removes a fixed percentage of filters from every layer, whole-network pruning (WNP) offers greater flexibility by pruning varying fractions of filters from different layers based on their actual importance. However, existing WNP methods suffer from a difficult trade-off: they are either computationally prohibitive (requiring expensive passes over the entire dataset to evaluate every single filter's impact on loss) or rely on sub-optimal heuristics that fail to capture how pruning one layer affects the rest of the network.

Methods

The authors propose a two-level hierarchical approach to optimize whole-network pruning directly from training data loss:

  1. Higher-Level (Layer Selection): This level iteratively determines which layer in the network is currently the best candidate to prune. The authors introduce two global criteria: HBGS (Hierarchical Backward Greedy Search), which minimizes the relative reconstruction error of layer outputs, and HBGTS (Hierarchical Backward Greedy Tree Search), which directly evaluates and optimizes the final classification layer error.
  2. Lower-Level (Filter Pruning): Once a layer is selected, this level determines which specific filters to remove. It treats filter pruning as a sparse approximation problem: a filter can be safely removed if its output can be linearly reconstructed by the remaining filters.

To make this hierarchical search practical for large networks, the authors introduce FP-Backward, a backward-elimination algorithm. It leverages a novel closed-form expression to compute the exact increase in least-squares error when a filter is dropped, avoiding expensive iterative optimization steps and dropping the time complexity to $O(n^2)$.

Figure 1: Hierarchical approach for non-uniform pruning of filters across the network.
Algorithm 3: Filter Pruning-Backward Elimination (FP-Backward).

Datasets

The methods were evaluated on three standard image classification benchmarks:

  • CIFAR-10: 10 classes, 50k training images, 10k test images (32x32 resolution).
  • CIFAR-100: 100 classes, 500 training images per class.
  • Tiny-Imagenet: 200 classes, 100k images (resized to 224x224).

No new benchmarks were introduced in this work.

Key Insights and Ideas

  • Dynamic Activation Tracking: Unlike static threshold methods, this greedy approach utilizes activations from the already modified network at each iteration. This ensures that downstream pruning decisions account for the errors introduced in earlier steps.
  • The Closed-Form Speedup: The core mathematical breakthrough is deriving a closed-form error criterion for multivariate linear regression during backward elimination. Instead of re-running optimization steps for every filter candidate, the algorithm computes the exact error increase instantly using block-matrix inversion.
  • Information-Driven Non-Uniformity: Visualizing the pruned networks reveals that layers capturing diverse, unique features are automatically preserved (low pruning ratio), while layers with highly redundant feature maps are aggressively stripped away (up to 93.75% pruned), validating the hierarchical selection logic.

Key Results

  • Massive Resource Reductions: On ResNext101 (CIFAR-10), the HBGTS-B algorithm reduced VRAM requirements from 7.6 GB to 1.5 GB and achieved a 94.3% reduction in FLOPs while actually improving test accuracy from 92.1% to 93.2%.
  • Superior High-Compression Performance: At extreme parameter reduction levels ($\ge 90\%$), the proposed methods consistently outperformed state-of-the-art pruning techniques (such as LRF, HRank, and LFPC) by 3% to 8% in final accuracy.
  • Pruning Speedups: The backward-elimination variant (FP-Backward) cut the lower-level pruning time in half compared to forward orthogonal matching pursuit (FP-OMP), while HBGTS-B delivered a 55-57% reduction in total pruning time compared to vanilla HBGTS.

Limitations and Future Work

While highly effective for CNNs, the current formulation is specifically tailored to convolutional layers and 1x1 weight compensations. The authors note that a promising future direction is extending this linear-approximation-based pruning framework to transformer-based models, specifically targeting the redundant filters within Feed-Forward Networks (FFNs).

Summary updated

Abstract

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.
BibTeX
@article{purohit2024greedy,
  author = {Kiran Purohit and Anurag Reddy Parvathgari and Sourangshu Bhattacharya},
  title = {{A Greedy Hierarchical Approach to Whole-Network Filter-Pruning in CNNs}},
  journal = {Accepted by TMLR},
  year = {2024},
  url = {https://openreview.net/forum?id=WzHuebRSgQ},
}
Figure