Introduction
Deep Convolutional Neural Networks (CNNs) have revolutionized computer vision but remain computationally expensive, hindering deployment on resource-constrained edge devices. Structural pruning—the removal of entire filters or channels—has emerged as a primary solution to reduce memory footprint and FLOPs.
Most state-of-the-art pruning techniques utilize sparsity training, where a penalty (typically L1 regularization) is added to the loss function to drive channel scaling factors toward zero. However, this paper identifies a fundamental flaw in this "blunt instrument" approach: global regularization. By applying the penalty to all channels indiscriminately, standard methods inadvertently suppress the weights of critical channels, reducing the network's total capacity and leading to under-fitting. The authors argue that regularization should be "pruning-aware," punishing only the components destined for removal.
The MaskSparsity Framework
To address the limitations of global regularization, the authors propose MaskSparsity, a multi-stage pipeline designed to decouple the identification of unimportant channels from the regularization process. The method ensures that important channels are protected from the gradient pressure of the sparsity penalty.
Methodology
The MaskSparsity pipeline consists of three distinct phases:
- Mask Generation: The model undergoes a brief initial period of global sparsity training. This phase is used solely to identify which channels are least important based on their scaling factors. A binary "pruning mask" is then generated using a predefined threshold.
- Fine-Grained Regularization: The model is reinitialized to its pre-sparsity state. Crucially, the L1 penalty is then applied only to the channels marked for pruning by the binary mask. This ensures that the gradient of the sparsity loss is zero for all channels intended to be kept, allowing them to focus entirely on minimizing the primary task loss (e.g., cross-entropy).
- Pruning & Fine-tuning: Once the targeted channels have been pushed near zero, they are physically removed. The resulting compact model undergoes a final fine-tuning stage to recover any minor accuracy loss.
Key Insights
The Bimodal Distribution Problem
In standard sparsity training, the distribution of scaling factors typically becomes bimodal. While one peak clusters near zero (the pruned channels), the peak representing "important" channels is often shifted significantly toward zero compared to a normally trained model. This shift is empirical evidence that global regularization degrades the representational power of the channels the network intends to keep. MaskSparsity eliminates this shift by protecting the "keep" channels from the regularization term.
Gradient Protection
Visualization of gradients during training reveals that in MaskSparsity, important channels experience virtually no gradient pressure from the sparsity penalty. This preservation of gradient flow allows the network to maintain higher accuracy even as it is being compressed.
Experimental Evaluation
The researchers evaluated MaskSparsity across standard benchmarks, including CIFAR-10 and ImageNet (ILSVRC-2012), using architectures like ResNet and VGG.
ImageNet Results
On the challenging ImageNet dataset, MaskSparsity demonstrated superior performance compared to both sparsity-based and non-sparsity-based state-of-the-art methods. As shown in the table below, MaskSparsity achieved a 51.07% reduction in FLOPs with only a 0.76% drop in Top-1 accuracy, outperforming established methods like HRank, FPGM, and DCP.
CIFAR-10 and Object Detection
- ResNet-110: Achieved a 63.03% reduction in FLOPs and a 60.34% reduction in parameters with zero loss in Top-1 accuracy.
- VGG-16: The pruned model actually increased accuracy by 0.38% while cutting FLOPs by 52.21%, suggesting that targeted pruning can act as an effective regularizer.
- Object Detection: On YOLOv5s (WiderFace), the method halved the FLOPs (from 4.1G to 2.0G) with less than a 1% drop in mAP.
Conclusion
MaskSparsity introduces a paradigm shift in sparsity training by making the regularization process "pruning-aware." By decoupling channel identification from weight shrinkage, it prevents the over-regularization of critical network components. While the multi-stage pipeline introduces some computational overhead compared to one-shot methods, the significant gains in accuracy-to-compression ratios make it a powerful tool for deploying high-performance CNNs on edge hardware.
Summary updated