Efficient Similarity-Based Passive Filter Pruning for Compressing CNNS

Arshdeep Singh, Mark D. Plumbley

TL;DR

This paper introduces an efficient method for compressing Convolutional Neural Networks (CNNs) by pruning redundant filters without requiring a dataset (passive pruning). By using the Nystrom approximation to estimate filter similarity from only a few columns of a similarity matrix, the authors achieve a 3x speedup over standard similarity-based pruning while maintaining comparable accuracy on acoustic scene classification tasks.

What Problem Does This Paper Address?

As CNNs grow in complexity, deploying them on resource-constrained devices (like smartphones or IoT sensors) becomes difficult due to high memory and computational demands. Filter pruning helps by removing unnecessary parts of the network.

There are two main types of pruning:

  1. Active: Uses a dataset to see which filters contribute most to the output.
  2. Passive: Looks only at the filter weights themselves, making it much faster and easier to implement.

Within passive pruning, most methods are norm-based (removing filters with small weights). However, these methods often fail to account for redundancy—two filters might both have large weights but perform the exact same task. Similarity-based pruning solves this by removing redundant filters, but it is computationally expensive because it requires calculating the similarity between every possible pair of filters ($O(n^2)$ complexity). This paper tackles the high computational cost of similarity-based pruning.

Methods

The authors propose an Efficient Similarity-based Passive Filter Pruning framework. The core innovation is the application of the Nystrom approximation to the similarity matrix.

  1. Filter Representation: Each filter is converted into a representative vector using a Rank-1 approximation via Singular Value Decomposition (SVD).
  2. Partial Matrix Calculation: Instead of calculating the full $n \times n$ similarity matrix (where $n$ is the number of filters), they calculate only a small subset of columns ($m \ll n$).
  3. Nystrom Approximation: They use these few columns to mathematically estimate the full pairwise similarity matrix. This reduces the complexity from $O(n^2d)$ to $O(m^3 + nmk)$.
  4. Pruning: Based on the approximated matrix, they identify pairs of filters that are most similar. One filter from each pair is deemed redundant and removed.
  5. Fine-tuning: The pruned network is briefly retrained to recover any lost accuracy.

Datasets

The method was evaluated on two architectures designed for Acoustic Scene Classification (ASC):

  • DCASE21_Net: A baseline network for the DCASE 2021 Task 1A, evaluated on the TAU Urban Acoustic Scenes 2020 Mobile dataset.
  • VGGish: A popular audio feature extractor, evaluated on the TUT Urban Acoustic Scenes 2018 dataset.

Key Insights and Ideas

  • Magnitude isn't everything: The authors demonstrate that norm-based methods (like $l_1$-norm) might keep two very similar filters just because they both have high magnitudes, wasting space. Similarity-based pruning ensures diversity in the learned features.
  • Approximation is "Good Enough": A surprising "aha moment" is that you don't need a perfect similarity matrix to prune effectively. The authors found that using as few as 9 columns to approximate a 512-column matrix was sufficient to identify the same "important" filters as the full calculation.
  • Scaling for Deep Nets: The computational savings are most dramatic in deeper layers with many filters (e.g., 512 filters), where calculating a full $512 \times 512$ matrix is a significant bottleneck.

Key Results

  • Speedup: The proposed method is 3 times faster than standard similarity-based pruning for the VGGish network.
  • Efficiency: On the DCASE21_Net, the method reduced both the number of parameters and the computational load (MACs) by approximately 50%, with only a 3% drop in accuracy.
  • Performance vs. Norm-based: For the VGGish network, the proposed method achieved 62% accuracy, outperforming both $l_1$-norm (60.02%) and Geometric Median (59.71%) pruning methods while using the same budget for parameters and computations.

Limitations and Future Work

  • Accuracy Trade-off: Like most pruning methods, there is still a small drop in accuracy compared to the original unpruned model.
  • Hyperparameter Tuning: The number of columns ($m$) and the rank ($k$) for the Nystrom approximation need to be selected, though the paper provides some guidance on how to choose these based on approximation error ($\delta$).
  • Future Directions: The authors suggest exploring more complex distance measures, such as graph-based similarity, and investigating ways to reduce the number of fine-tuning epochs to make the overall compression pipeline even faster.

Summary updated

BibTeX
@inproceedings{singh2023efficient,
  author = {Arshdeep Singh and Mark D. Plumbley},
  title = {{Efficient Similarity-Based Passive Filter Pruning for Compressing CNNS}},
  booktitle = {IEEE International Conference on Acoustics, Speech and Signal Processing},
  year = {2023},
  doi = {10.1109/icassp49357.2023.10095560},
}
Figure