Filter Pruning for Efficient CNNs via Knowledge-driven Differential Filter Sampler

Shaohui Lin, Wenxuan Huang, Jiao Xie, Baochang Zhang, Yunhang Shen +3 more
7/1/2023
cs.CV

Official code: Osilly/KDFS (7 stars, MIT, last commit 2023-07-14).

Abstract

Filter pruning simultaneously accelerates the computation and reduces the memory overhead of CNNs, which can be effectively applied to edge devices and cloud services. In this paper, we propose a novel Knowledge-driven Differential Filter Sampler~(KDFS) with Masked Filter Modeling~(MFM) framework for filter pruning, which globally prunes the redundant filters based on the prior knowledge of a pre-trained model in a differential and non-alternative optimization. Specifically, we design a differential sampler with learnable sampling parameters to build a binary mask vector for each layer, determining whether the corresponding filters are redundant. To learn the mask, we introduce masked filter modeling to construct PCA-like knowledge by aligning the intermediate features from the pre-trained teacher model and the outputs of the student decoder taking sampling features as the input. The mask and sampler are directly optimized by the Gumbel-Softmax Straight-Through Gradient Estimator in an end-to-end manner in combination with global pruning constraint, MFM reconstruction error, and dark knowledge. Extensive experiments demonstrate the proposed KDFS's effectiveness in compressing the base models on various datasets. For instance, the pruned ResNet-50 on ImageNet achieves $55.36\%$ computation reduction, and $42.86\%$ parameter reduction, while only dropping $0.35\%$ Top-1 accuracy, significantly outperforming the state-of-the-art methods. The code is available at \url{https://github.com/Osilly/KDFS}.

View on arXivView PDF

Code Implementations(1)

Osilly/KDFSOfficial100%
MIT

The official pytorch implementation of KDFS. Paper: Filter Pruning for Efficient CNNs via Knowledge-driven Differential Filter Sampler

70Shell, PythonJun 12, 20233 years agoMIT

Similar Papers

Cite this paper

@article{lin2023filter,
  title  = {Filter Pruning for Efficient CNNs via Knowledge-driven Differential Filter Sampler},
  author = {Shaohui Lin and Wenxuan Huang and Jiao Xie and Baochang Zhang and Yunhang Shen and Zhou Yu and Jungong Han and David Doermann},
  year   = {2023},
  eprint = {2307.00198},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2307.00198v1}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2307.00198.svg)](https://codeofpaper.com/paper/2307.00198)

Discussion