Principal Filter Analysis for Guided Network Compression

Xavier Suau, Luca Zappella, Vinay Palakkode, Nicholas Apostoloff

TL;DR

Principal Filter Analysis (PFA) is a practical, response-based method for compressing neural networks by identifying and removing redundant filters. By exploiting the correlation between filter outputs, PFA can significantly reduce a model's footprint and computational cost—often while maintaining or even improving its original accuracy.

What Problem Does This Paper Address?

Modern deep neural networks are notoriously over-parameterized. While this "extra" width helps during training, it creates a massive bottleneck for deployment on edge devices with limited memory and compute power.

Existing compression techniques often come with high "friction." Some require modifying the loss function during the initial training (like Network Slimming), while others rely on complex optimization problems for every layer. Many methods also prune based on weight magnitude, which ignores the actual data distribution the model will encounter. The authors of PFA sought a method that is agnostic to the training regime, easy to implement, and capable of specializing a model for specific target domains.

Methods

PFA shifts the focus from weights to filter responses. The core idea is simple: if two filters produce highly correlated outputs across a dataset, one of them is redundant.

The authors propose two main algorithms:

  1. PFA-En (Energy-based): This uses Principal Component Analysis (PCA) on the layer responses. A user specifies an "energy threshold" (e.g., 95% of variance), and the algorithm recommends the minimum number of filters needed to preserve that energy. This is highly flexible; you can iteratively adjust the threshold to hit a specific target footprint or FLOP count.
  2. PFA-KL (KL Divergence-based): This is a parameter-free "auto-pilot" version. it uses Kullback-Leibler divergence to measure how far a layer's response distribution is from an ideal, uncorrelated (uniform) distribution. It automatically determines the pruning ratio for each layer.

Once the number of filters to keep is decided, PFA uses Pearson correlation to identify and remove the specific filters that are most redundant. The resulting "thinner" architecture is then fine-tuned to recover performance.

Datasets

The researchers evaluated PFA on several standard benchmarks:

  • CIFAR-10 and CIFAR-100: Small-scale image classification.
  • ImageNet: Large-scale visual recognition.
  • Domain Adaptation Subsets: The authors created specific subsets of CIFAR-100 (e.g., just "aquarium fish" vs. "boy") to demonstrate how PFA can specialize a general model for a niche task.

Key Insights and Ideas

  • Correlation = Redundancy: The fundamental "aha" moment is that the internal representation of a network is often much simpler than its parameter count suggests. By measuring intra-layer correlation, we can mathematically "see" the waste.
  • The Regularization Bonus: Surprisingly, PFA often results in a higher accuracy than the original full model. This suggests that pruning acts as a form of regularization, stripping away noise and helping the model generalize better.
  • Domain Specialization: Because PFA is data-driven, it doesn't just compress; it adapts. If you run PFA on a general-purpose model using a specific dataset (like medical images), it will prune the filters that are irrelevant to that domain, creating a specialized, efficient model.
  • One-Shot Parallelism: Unlike many pruning methods that must be applied layer-by-layer in a slow, iterative process, PFA can analyze all layers in parallel, making the "recipe" generation extremely fast.

Key Results

PFA proves to be highly competitive with state-of-the-art (SOTA) methods like Variational Information Bottleneck (VIB) and Network Slimming, but with much lower implementation complexity.

  • VGG-16 on CIFAR-10: Achieved an 8x compression rate with a 0.4% accuracy gain.
  • VGG-16 on ImageNet: Achieved a 1.4x compression rate with a 2.4% accuracy gain.
  • Efficiency: As shown in Figure 1, PFA solutions consistently sit near the empirical "upper bound" of accuracy for a given footprint, far outperforming random pruning.
Figure 1. Results of different SimpleCNN compressed networks. Accuracy change in the y axis is reported in percentage points (error bars show the standard deviation of multiple runs). Note how: (1) all PFA solutions lie close to the upper bound while random pruning severely degrades accuracy; (2) in most cases filter selection strategy is better than random initalization.

On more complex architectures like ResNet-56, PFA maintains SOTA performance across both CIFAR-10 and CIFAR-100, demonstrating its robustness across different network depths and complexities.

Figure 2. Results for VGG-16 and ResNet-56 on CIFAR-10 and CIFAR-100. Accuracy change in the y axis is reported in percentage points. Note how the accuracy obtained by PFA is comparable to the state of the art, and how PFA works across different architectures.

Limitations and Future Work

While PFA is powerful, it does have requirements:

  • Data Dependency: It requires a representative dataset to perform the initial response analysis. If the analysis data doesn't match the deployment data, the pruning might be sub-optimal.
  • Fine-tuning: Like most pruning methods, it still requires a fine-tuning phase to "heal" the network after filters are removed.
  • Scope: The current paper focuses on convolutional and fully connected layers. The authors suggest that future work could extend this logic to recurrent neural networks (RNNs), attention mechanisms, and word embeddings.

Summary updated

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 maintain as much as possible the accuracy of the full model. We propose two algorithms: the first allows users to target compression to specific network property, such as number of trainable variable (footprint), and produces a compressed model that satisfies the requested property while preserving the maximum amount of spectral energy in the responses of each layer, while the second is a parameter-free heuristic that selects the compression used at each layer by trying to mimic an ideal set of uncorrelated responses. Since PFA compresses networks based on the correlation of their responses we show in our experiments that it gains the additional flexibility of adapting each architecture to a specific domain while compressing. PFA is evaluated against several architectures and datasets, and shows considerable compression rates without compromising accuracy, e.g., for VGG-16 on CIFAR-10, CIFAR-100 and ImageNet, PFA achieves a compression rate of 8x, 3x, and 1.4x with an accuracy gain of 0.4%, 1.4% points, and 2.4% respectively. Our tests show that PFA is competitive with state-of-the-art approaches while removing adoption barriers thanks to its practical implementation, intuitive philosophy and ease of use.
BibTeX
@inproceedings{suau2020principal,
  author = {Xavier Suau and Luca Zappella and Vinay Palakkode and Nicholas Apostoloff},
  title = {{Principal Filter Analysis for Guided Network Compression}},
  booktitle = {IEEE/CVF Winter Conference on Applications of Computer Vision},
  year = {2020},
  url = {https://openreview.net/forum?id=jR5ZLxiNk9e},
}
Figure