语音识别中的Conformer模型压缩研究
2023-04-13卢江坤许鸿奎张子枫周俊杰李振业郭文涛
卢江坤 许鸿奎 张子枫 周俊杰 李振业 郭文涛



摘 要: 针对使用Conformer模型的语音识别算法在实际应用时设备算力不足及资源缺乏的问题,提出一种基于Conformer模型间隔剪枝和参数量化相结合的模型压缩方法。实验显示,使用该方法压缩后,模型的实时率(real time factor, RTF)达到0.107614,较基线模型的推理速度提升了16.2%,而识别准确率只下降了1.79%,并且模型大小也由原来的207.91MB下降到72.69MB。该方法在模型准确率损失很小的情况下,较大程度地提升了模型的适用性。
关键词: 深度学习; 模型压缩; 模型量化; 模型剪枝; Conformer
中图分类号:TP319 文獻标识码:A 文章编号:1006-8228(2023)04-16-07
Abstract: Aiming at the problem of insufficient computing power and resources in the actual application of speech recognition algorithm using the Conform model, a model compression method based on the combination of interval pruning and parameter quantization of Conformer model is proposed. Experimental results show that the real time factor (RTF) of the compressed model is 0.107614, which is 16.2% higher than the reasoning speed of the baseline model, while the recognition accuracy is only 1.79% lower, and the size of the model is reduced from 207.91MB to 72.69MB. This method greatly improves the applicability of the model with little loss of accuracy.
Key words: deep learning; model compression; model quantization; model pruning; Conformer
0 引言
端到端(end-to-end,E2E)语音识别系统将整个识别网络简化成一个单一的网络结构, 在训练时只需要注意整个系统的输入和输出,大大减少了对语音识别系统构建的难度[1-3]。随着Transformer模型在计算机视觉、自然语言处理等领域展现出来出色的性能[4],Dong等人首次将具有自注意力机制的深度神经网络Transformer模型引入到语音识别领域[5]。文献[6]提出一种模型结构Conformer,将卷积模块加入到Transformer模型的编码器部分,从而达到增强识别效果的目的。
不断加深的神经网络迅速增加了数据量,这将花费更大的存储资源和计算开销。仅8层的AlexNet[7]就需要至少7.29亿次浮点型计算,需要占用约233MB内存。庞大的网络参数极大地限制了模型在算力有限的设备上部署[8]。因此需要对这些大型神经网络模型进行压缩,降低模型大小和计算成本[9]。
早期Babak Hassibi等人使用来自误差函数的所有二阶导数来判断哪些不重要的参数来进行剪枝,进而提升模型的泛化能力和推理速度[10]。……
