Table of Contents
Fetching ...

RL-Pruner: Structured Pruning Using Reinforcement Learning for CNN Compression and Acceleration

Boyao Wang, Volodymyr Kindratenko

TL;DR

RL-Pruner can automatically extract dependencies between filters in the input model and perform pruning, without requiring model-specific pruning implementations, and is based on a key observation: filters in different layers of a neural network have varying importance to the model's performance.

Abstract

Convolutional Neural Networks (CNNs) have demonstrated exceptional performance in recent years. Compressing these models not only reduces storage requirements, making deployment to edge devices feasible, but also accelerates inference, thereby reducing latency and computational costs. Structured pruning, which removes filters at the layer level, directly modifies the model architecture. This approach achieves a more compact architecture while maintaining target accuracy, ensuring that the compressed model retains good compatibility and hardware efficiency. Our method is based on a key observation: filters in different layers of a neural network have varying importance to the model's performance. When the number of filters to prune is fixed, the optimal pruning distribution across different layers is uneven to minimize performance loss. Layers that are more sensitive to pruning should account for a smaller proportion of the pruning distribution. To leverage this insight, we propose RL-Pruner, which uses reinforcement learning to learn the optimal pruning distribution. RL-Pruner can automatically extract dependencies between filters in the input model and perform pruning, without requiring model-specific pruning implementations. We conducted experiments on models such as GoogleNet, ResNet, and MobileNet, comparing our approach to other structured pruning methods to validate its effectiveness. Our code is available at https://github.com/Beryex/RLPruner-CNN.

RL-Pruner: Structured Pruning Using Reinforcement Learning for CNN Compression and Acceleration

TL;DR

RL-Pruner can automatically extract dependencies between filters in the input model and perform pruning, without requiring model-specific pruning implementations, and is based on a key observation: filters in different layers of a neural network have varying importance to the model's performance.

Abstract

Convolutional Neural Networks (CNNs) have demonstrated exceptional performance in recent years. Compressing these models not only reduces storage requirements, making deployment to edge devices feasible, but also accelerates inference, thereby reducing latency and computational costs. Structured pruning, which removes filters at the layer level, directly modifies the model architecture. This approach achieves a more compact architecture while maintaining target accuracy, ensuring that the compressed model retains good compatibility and hardware efficiency. Our method is based on a key observation: filters in different layers of a neural network have varying importance to the model's performance. When the number of filters to prune is fixed, the optimal pruning distribution across different layers is uneven to minimize performance loss. Layers that are more sensitive to pruning should account for a smaller proportion of the pruning distribution. To leverage this insight, we propose RL-Pruner, which uses reinforcement learning to learn the optimal pruning distribution. RL-Pruner can automatically extract dependencies between filters in the input model and perform pruning, without requiring model-specific pruning implementations. We conducted experiments on models such as GoogleNet, ResNet, and MobileNet, comparing our approach to other structured pruning methods to validate its effectiveness. Our code is available at https://github.com/Beryex/RLPruner-CNN.

Paper Structure

This paper contains 28 sections, 18 equations, 3 figures, 4 tables.

Figures (3)

  • Figure 1: Increase in test error for a compressed VGG-16 model after pruning 10% of filters from each individual layer. The pruning is conducted based on three different baselines: the dense model, a model with 5% of filters pruned from all layers, and a model with 10% of filters pruned from all layers. The results highlight that different layers have varying sensitivity to pruning, and this sensitivity changes dynamically throughout the pruning process. A negative increase indicates that performance improves.
  • Figure 2: Illustration of RL-Pruner: We start by initializing a uniform pruning distribution based on the output channel density of each prunable layer. Next, we iteratively generate a new distribution, evaluate the corresponding compressed model to obtain a reward, and update the pruning distribution using the replay buffer.
  • Figure 3: Sparsity changes across different layers during the pruning of VGG-19 on CIFAR-100 over 75 pruning steps with various reward strategies. The first row (from left to right) shows the sparsity changes in the $14^\text{th}$ and $16^\text{th}$ convolutional layers, while the second row (from left to right) depicts the sparsity changes in the $1^\text{st}$ and $2^\text{nd}$ linear layers of the architecture.