用强化学习自动分配卷积层剪枝比例,提升模型压缩效率。
RL-Pruner: Structured Pruning Using Reinforcement Learning for CNN Compression and Acceleration
- 通过强化学习学习各层最优剪枝比例,实现结构化剪枝。
- 在ResNet、MobileNet等模型上实现高精度压缩,保持性能稳定。
- 无需定制代码,通用性强,适合边缘设备部署。
卷积神经网络近年来表现出色。模型压缩不仅降低存储需求,使边缘设备部署成为可能,还能加速推理,减少延迟和计算成本。结构化剪枝通过逐层移除卷积核来直接修改模型架构,能获得更紧凑的结构,同时保持目标精度,确保压缩后模型具备良好兼容性和硬件效率。本文基于关键观察:不同层的卷积核对模型性能的重要性不同。当总剪枝数固定时,最优剪枝分布不均,敏感层应占更小剪枝比例。为此,我们提出RL-Pruner,利用强化学习学习最优剪枝分布。该方法可自动提取输入模型中卷积核间的依赖关系并执行剪枝,无需针对特定模型设计剪枝逻辑。我们在GoogleNet、ResNet、MobileNet等模型上进行了实验,与现有结构化剪枝方法对比,验证了其有效性。代码已开源:https://github.com/Beryex/RLPruner-CNN。
原文摘要 · Abstract (English)
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.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。