Abstract
In this paper, we introduce Principal Filter Analysis (PFA), an easy-to-use and effective method for neural network compression. PFA exploits the correlation between filter responses within network layers to recommend a smaller network that maintains as much as possible the accuracy of the full model. We propose two algorithms: the first (PFA-En) allows users to target compression to specific network properties, such as the number of trainable variables (footprint), while preserving the maximum amount of spectral energy. The second (PFA-KL) is a parameter-free heuristic that selects compression by mimicking an ideal set of uncorrelated responses. PFA is evaluated against several architectures and datasets, showing considerable compression rates without compromising accuracy. For instance, on VGG-16, PFA achieves compression rates of 8× (CIFAR-10), 3× (CIFAR-100), and 1.4× (ImageNet) with accuracy gains of 0.4%, 1.4%, and 2.4% respectively.
Introduction
Deep Neural Networks (DNNs) are notoriously over-parameterized, often containing far more filters than necessary for a given task. While this redundancy aids learning, it results in models that are computationally expensive and memory-intensive, hindering deployment on edge devices like smartphones or IoT sensors.
Traditional compression methods typically rely on weight pruning—removing filters with small magnitudes—or knowledge distillation. However, weight magnitude is not always a reliable proxy for a filter's actual contribution to the model's output. This work proposes looking instead at filter responses (feature maps). If two filters produce highly correlated outputs, one is redundant. Principal Filter Analysis (PFA) provides a principled, data-driven framework to identify and prune these redundancies.
Principal Filter Analysis (PFA)
The core methodology of PFA involves analyzing the activations of each layer when a representative dataset is passed through the network.
Response Analysis and Selection
For each layer, filter responses are collected and max-pooled to reduce dimensionality. A covariance matrix is then computed, followed by an eigenvalue decomposition (similar to Principal Component Analysis). This process identifies the principal directions of variance in the filter responses.
The authors propose two algorithmic variants:
- PFA-En (Energy-based): Users specify a target "spectral energy" to preserve (e.g., 95%). The algorithm determines the minimum number of filters required to maintain this information level, allowing for targeted compression based on hardware constraints.
- PFA-KL (Parameter-free): This version uses Kullback-Leibler (KL) divergence to measure the distance between current filter responses and an "ideal" uncorrelated state. It automatically optimizes the compression rate for each layer without manual hyperparameter tuning.
Once the target number of filters is determined, Pearson correlation is used to identify and prune the most redundant specific filters. The resulting "distilled" network is then fine-tuned to recover or improve upon the original model's accuracy.
Experimental Results
PFA was evaluated across standard benchmarks, including CIFAR-10, CIFAR-100, and ImageNet, using architectures like VGG-16 and ResNet-34/56.
As shown in the CIFAR experiments, PFA is highly competitive with state-of-the-art methods such as Network Slimming (NS) and Variational Information Bottleneck (VIB). Notably, for VGG-16 on CIFAR-10, PFA achieved an 8x reduction in trainable variables while gaining 0.4% in accuracy.
Large-Scale Evaluation on ImageNet
The effectiveness of PFA scales to large-scale datasets like ImageNet. For VGG-16, PFA achieved a 1.4x compression rate with a significant 2.4% accuracy boost.
Key Insights
- Compression as Regularization: A surprising finding is that compressed models often outperform their full-sized counterparts. By removing redundant filters, PFA acts as a form of regularization, reducing overfitting and improving generalization.
- Domain Specialization: Since PFA is data-driven, it can adapt a general-purpose model to a specific domain. By analyzing responses on domain-specific data, PFA prunes filters irrelevant to that task, effectively performing simultaneous compression and domain adaptation.
- Efficiency and Agnostic Nature: PFA uses closed-form solutions (PCA and KL divergence), making it significantly faster than iterative optimization-based pruning. Furthermore, it is agnostic to the training loss or optimization strategy used for the original model.
Conclusion and Future Work
PFA offers a practical and effective solution for neural network compression by focusing on filter response correlations. While it requires a forward pass on a representative dataset and involves PCA computation, its performance and ease of use make it a compelling alternative to existing methods. Future research will explore extending PFA to other architectures, such as Recurrent Neural Networks (RNNs) and Attention mechanisms, where redundancy is also prevalent.
Summary updated