Exploiting Channel Similarity for Accelerating Deep Convolutional Neural Networks

Yunxiang Zhang, Chenglong Zhao, Bingbing Ni, Jian Zhang, Haoran DengarXiv 2019

Abstract

To address the limitations of existing magnitude-based pruning algorithms in cases where model weights or activations are of large and similar magnitude, we propose a novel perspective to discover parameter redundancy among channels and accelerate deep CNNs via channel pruning. Precisely, we argue that channels revealing similar feature information have functional overlap and that most channels within each such similarity group can be removed without compromising model's representational power. After deriving an effective metric for evaluating channel similarity through probabilistic modeling, we introduce a pruning algorithm via hierarchical clustering of channels. In particular, the proposed algorithm does not rely on sparsity training techniques or complex data-driven optimization and can be directly applied to pre-trained models. Extensive experiments on benchmark datasets strongly demonstrate the superior acceleration performance of our approach over prior arts. On ImageNet, our pruned ResNet-50 with 30% FLOPs reduced outperforms the baseline model.

Introduction

Deep Convolutional Neural Networks (CNNs) have achieved state-of-the-art performance in various computer vision tasks but at a high computational cost. This makes deployment on resource-constrained devices challenging. Network pruning is a common technique to mitigate this by removing redundant parameters.

Traditional methods primarily rely on magnitude-based pruning, which assumes that weights with small absolute values contribute less to the model's output. However, this heuristic fails when multiple channels are highly redundant but possess large magnitudes. In such cases, magnitude-based methods retain all redundant channels, leading to suboptimal compression.

Comparison of pruning strategies: magnitude-based vs. similarity-based.

Methodology

We propose a shift from magnitude to feature similarity. If two channels produce highly correlated feature maps, they are functionally redundant, and one can be safely removed.

Probabilistic Similarity via Batch Normalization

Measuring similarity by comparing activations across a dataset is computationally expensive ($O(H \times W \times B \times C^2)$). We circumvent this by leveraging Batch Normalization (BN) layers, which are ubiquitous in modern CNNs. BN layers track the mean ($\beta$) and variance ($\gamma^2$) of each channel. We demonstrate that the distance between two channels can be estimated probabilistically using only these BN parameters. This "data-free" approach reduces complexity to $O(C^2)$ and provides a stable metric independent of specific input batches.

Pruning via Hierarchical Clustering

Our pruning pipeline consists of three main steps:

  1. Distance Matrix Calculation: Compute the similarity between all channel pairs in a layer using BN statistics.
  2. Normalization: Normalize distances to ensure consistency across different layers. This prevents "layer collapse," where an algorithm might aggressively prune one layer down to a single channel and bottleneck the network.
  3. Clustering and Selection: Apply hierarchical clustering to group similar channels. Within each cluster, we retain the "strongest" channel (identified by the largest scaling factor $|\gamma|$) and prune the rest.

Experimental Results

The proposed method was evaluated on CIFAR-10, CIFAR-100, and ImageNet-2012 using VGG and ResNet architectures.

Performance on ImageNet

On the large-scale ImageNet dataset using ResNet-50, our method achieved a 45.90% reduction in FLOPs with a minimal Top-1 accuracy drop of only 0.80%. Notably, at a 30% FLOP reduction level, the pruned model actually outperformed the baseline, suggesting that removing redundancy can have a regularizing effect. Unlike magnitude-based methods which tend to aggressively prune upper layers and destroy high-level information, our similarity-based approach naturally retains more channels in the upper layers.

Real-world Acceleration

Theoretical FLOP reductions often do not translate linearly to hardware speedups. However, our approach demonstrated significant practical gains. On a TITAN X GPU, a ResNet-50 model with 60% FLOPs removed achieved a ~42% wall-clock inference speedup, confirming the efficiency of channel-level pruning.

Conclusion

By exploiting channel similarity through BN statistics, we provide a robust and efficient framework for CNN acceleration. This method avoids the pitfalls of magnitude-based pruning and does not require expensive data-driven optimization. While currently dependent on the presence of BN layers, future work aims to extend this similarity-based logic to other architectures like RNNs and GNNs.

Summary updated

BibTeX
@misc{zhang2019exploiting,
  author = {Yunxiang Zhang and Chenglong Zhao and Bingbing Ni and Jian Zhang and Haoran Deng},
  title = {{Exploiting Channel Similarity for Accelerating Deep Convolutional Neural Networks}},
  year = {2019},
  eprint = {1908.02620},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/1908.02620},
}
Figure