计算机工程与应用 ›› 2025, Vol. 61 ›› Issue (11): 204-215.DOI: 10.3778/j.issn.1002-8331.2402-0221

• 模式识别与人工智能 • 上一篇    下一篇

聚类和群智能优化算法的自动剪枝方法

刘洲峰,吴文涛,李环宇,邵昕楠,李春雷   

  1. 1.中原工学院 信息与通信工程学院,郑州 450000 
    2.中国石油大学(华东) 海洋与空间信息学院,山东 青岛 266580
  • 出版日期:2025-06-01 发布日期:2025-05-30

Automatic Channel Pruning Method Based on Clustering and Swarm Intelligence Optimization Algorithm

LIU Zhoufeng, WU Wentao, LI Huanyu, SHAO Xinnan, LI Chunlei   

  1. 1.College of Information and Communication Engineering, Zhongyuan University of Technology, Zhengzhou 450000, China
    2.College of Ocean and Space Information, China University of Petroleum, Qingdao, Shandong 266580, China
  • Online:2025-06-01 Published:2025-05-30

摘要: 近年来,网络剪枝技术作为一种极为有效的卷积神经网络压缩方案,得到了迅猛的发展,其中通道剪枝得益于其硬件友好性,有着尤为明显的优势。然而,当前主流方法集中于通过通道重要性评估或人工干预来实现剪枝,低效且容易导致次优结果;同时一些基于搜索算法的自动化剪枝方法则难以控制搜索空间与搜索效率之间的平衡。为了解决这些问题,提出了一种基于聚类与群智能优化算法的自动通道剪枝方法。具体来说,根据特征图的相似度利用[K]-Mediod算法进行逐层的通道聚类,并通过灵敏度分析找到当前最优剪枝率,从而形成初步的压缩模型,引入粒子群算法(PSO)对其进行迭代搜索并找到最优剪枝网络结构。对剪枝网络进行微调,以降低精度损失。在CIFAR-10、ILSVRC-2012上对几种最为常用的CNN模型进行了评估,与近年来的主流方法相比实验结果有所提升,证明了剪枝后网络的有效性,在ILSVRC-2012中,在ResNet-50达到45.5%剪枝率的前提下,模型准确度只降低了0.23个百分点。

关键词: 卷积神经网络, 模型压缩, 网络剪枝, 网络结构搜索, 粒子群算法

Abstract: In recent years, network pruning techniques have witnessed rapid development as highly effective solutions for compressing convolutional neural networks. Among them, channel pruning stands out due to its hardware-friendly nature. Current mainstream methods focus on setting manual constraints as evaluation criteria, which are inefficient and can easily lead to suboptimal results. On the other hand, existing automatic pruning methods based on search algorithms struggle to strike a balance between search space and search efficiency. To address these issues, a novel automatic channel pruning method based on clustering and swarm intelligence optimization algorithms is proposed. Specifically, the method employs the [K]-Medoids algorithm to perform layer-wise channel clustering based on the similarity of feature maps. Through sensitivity analysis, the current optimal pruning rate is determined, forming an initial compressed model that simplifies the search space for swarm intelligence optimization algorithms. The particle swarm optimization (PSO) algorithm is introduced to iteratively search and optimize the pruned structure of the initial compression model using meta-learning, resulting in the identification of the optimal pruned network structure. Finally, the pruned network is fine-tuned to mitigate any accuracy loss caused by pruning. Evaluation experiments are conducted on CIFAR-10 and ILSVRC-2012 datasets using several commonly used CNN models. Comparative results with mainstream methods from recent years demonstrate improvements, thereby validating the effectiveness of the pruned networks. For instance, on the ILSVRC-2012 dataset, with a pruning rate of 45.5% having been achieved on ResNet-50, the model’s accuracy has only dropped by 0.23 percentage points.

Key words: convolutional neural network(CNN), model compression, network pruning, neural architecture search (NAS), particle swarm optimization (PSO)