TL;DR
This paper introduces a novel method for compressing deep neural networks by first theoretically estimating the maximum possible compression rate using gradient matrix singularity analysis. Then, a hierarchical pruning algorithm is proposed to achieve this compression by intelligently removing filters, layer by layer, and then filter by filter, to avoid performance degradation.
What Problem Does This Paper Address?
Deep neural networks, while powerful, are often computationally expensive and require significant memory, making them unsuitable for deployment on resource-constrained devices. Network compression techniques aim to reduce the size and computational cost of these models. However, existing methods face two main challenges:
- Lack of a theoretical framework for maximum compression: It's difficult to determine how much a network can be compressed without sacrificing performance. Current approaches often rely on trial-and-error.
- Layer Over-pruning: When pruning filters independently across layers, some layers might lose too many filters, creating bottlenecks and leading to a significant drop in network accuracy.
This paper seeks to address these issues by providing a principled way to estimate the optimal compression ratio and a more robust pruning strategy.
Methods
The authors propose two key innovations:
- Effective Filter Analysis (EFA): This method estimates the maximum network redundancy and thus the optimal pruning ratio. It's inspired by Hessian matrix singularity analysis but uses a more computationally feasible approach:
- Gradient Matrix Singularity Analysis: Instead of the expensive Hessian matrix, they analyze the weight gradient matrix. They theorize that the Hessian matrix of the loss function is related to the covariance of the gradients.
- PCA on Gradient Matrix: Principal Component Analysis (PCA) is applied to the weight gradient matrix of each layer. The number of non-dominant eigenvectors (those explaining less variance) is used to estimate the number of redundant filters.
- Gradient Preprocessing: To mitigate the impact of stochastic errors from mini-batch training, they introduce a preprocessing step that sets gradients to zero for weights whose contribution to the loss is negligible.
- Hierarchical Pruning Algorithm: This algorithm uses the estimated pruning ratio from EFA to prune the network in a structured, two-stage process:
- Layer Selection: Candidate layers for pruning are identified using cross-entropy between the weight distributions of adjacent layers. Layers with similar weight distributions (low cross-entropy) are considered more redundant.
- Filter Selection: Within the selected layers, filters are pruned based on their information entropy. Filters with lower entropy (more uniform parameter values) are considered less informative and are candidates for removal.
- Iterative Process: The algorithm iteratively prunes layers and then filters within those layers, aiming to avoid the layer over-pruning problem.
Datasets
The proposed method was evaluated on two standard benchmark datasets:
- CIFAR-10: A dataset of 32x32 natural images with 10 classes.
- ILSVRC-2012: A larger dataset with 1000 classes, commonly used for image classification benchmarks.
Key Insights and Ideas
- Theoretical Basis for Pruning Ratio: Moving beyond empirical trial-and-error, the paper provides a theoretical grounding for determining how much a network can be compressed by analyzing the inherent redundancy in its weight gradients.
- Hierarchical Pruning for Robustness: The layer-first, then filter-second approach is crucial. By considering layer-level redundancy before individual filter removal, the method aims to prevent the creation of performance bottlenecks that plague simpler filter-wise pruning strategies.
- Gradient Analysis as a Proxy for Hessian: Leveraging the relationship between the Hessian and gradient covariance is a smart way to avoid the computational burden of Hessian matrix calculation while still gaining insights into network sensitivity.
- EFA as a Global Metric: Using global variance contribution ratios from PCA provides a unified way to guide pruning across the entire network, which is then translated into layer-specific pruning decisions.
Key Results
The paper demonstrates significant improvements over existing pruning methods:
- State-of-the-Art Performance: The proposed hierarchical pruning algorithm achieved state-of-the-art results on CIFAR-10 and ILSVRC-2012 datasets.
- High Compression with Minimal Accuracy Loss:
- On CIFAR-10, for VGG-A, a pruning ratio of 81% (parameters) was achieved with only a 7.67% test error increase (compared to a 90% error for a traditional method).
- For ResNet56 on CIFAR-10, the method achieved a parameter compression of 71.76% with a Top-1 accuracy loss of only 1.39%, outperforming other methods like HRank and HS.
- On ILSVRC-2012, for ResNet50, a parameter compression rate of 52.76% was achieved with a Top-1 accuracy of 73.01% and Top-5 accuracy of 91.11%, while other methods had lower compression or accuracy.
- Mitigation of Layer Over-pruning: Figure 3 visually demonstrates how the hierarchical method avoids extreme filter removal in certain layers, unlike traditional methods that can lead to drastic filter distribution changes.
Limitations and Future Work
- Computational Cost of EFA: While more efficient than Hessian-based methods, EFA still involves gradient calculations and PCA, which can be computationally intensive for very large models.
- Hyperparameter Tuning: The paper mentions setting a global variance contribution ratio (e.g., 0.99, 0.95) and an entropy threshold (e.g., 40th percentile). The optimal choice of these hyperparameters might require some experimentation.
- Future Work: The authors suggest that their method provides a comprehensive solution and a novel hierarchical approach. Further exploration of its application to different network architectures and tasks could be a natural next step. The paper also implies that the theoretical framework for estimating redundancy can be further refined.
Summary updated