作者投稿和查稿 主编审稿 专家审稿 编委审稿 远程编辑

计算机工程 ›› 2025, Vol. 51 ›› Issue (6): 74-82. doi: 10.19678/j.issn.1000-3428.0069199

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

基于向量转换的卷积计算优化方法

王培吉1,*(), 邹承明1,2,3   

  1. 1. 武汉理工大学计算机与人工智能学院,湖北 武汉 430000
    2. 交通物联网技术湖北省重点实验室,湖北 武汉 430000
    3. 鹏城实验室,广东 深圳 518055
  • 收稿日期:2024-01-10 出版日期:2025-06-15 发布日期:2024-06-06
  • 通讯作者: 王培吉

Optimization Method for Convolutional Computing Based on Vector Transformation

WANG Peiji1,*(), ZOU Chengming1,2,3   

  1. 1. School of Computer Science and Artificial Intelligence, Wuhan University of Technology, Wuhan 430000, Hubei, China
    2. Key Laboratory of Transportation IoT Technology in Hubei Province, Wuhan 430000, Hubei, China
    3. Pengcheng Laboratory, Shenzhen 518055, Guangdong, China
  • Received:2024-01-10 Online:2025-06-15 Published:2024-06-06
  • Contact: WANG Peiji

摘要:

针对卷积计算中的效率问题,提出卷积计算优化方法OAC。该研究的主要目的在于提高卷积计算的效率,以应对深度学习领域对卷积计算速度不断增大的需求。在该技术实现过程中,OAC方法以向量转换为基础,采取一系列巧妙的步骤来优化卷积计算。首先,通过逐行取值的方式将输入矩阵连接成一个向量;然后,对卷积核进行拉伸变换,并根据输入矩阵的宽度和卷积核的大小在适当位置进行补零,形成另一个向量,这一转换的设计旨在和输入矩阵转换后的向量能够进行正确计算,最大程度地减少计算过程中的冗余操作,从而提高效率;最后,结合一些其他的优化手段对向量计算进行加速。实验结果表明,与传统MEC方法相比,OAC方法的计算速度提高了58.9%,与im2col方法相比,计算速度提升90.1%,内存占用相比于MEC方法减少了53.7%。OAC方法不仅在计算效率上取得了显著成果,而且为深度学习等计算任务提供了高效可行的解决方案。

关键词: 深度学习, 卷积计算, 卷积优化, 向量转换, 加速库

Abstract:

To solve efficiency problems in convolution calculations, this paper proposes a convolution calculation optimization method OAC. The objective is to improve the efficiency of convolution calculations to address the increasing demand for high convolution calculation speed in fields such as deep learning. The OAC method is based on vector conversion and involves a series of ingenious steps to optimize convolution calculations. First, the input matrix is concatenated row-by-row into a vector. Subsequently, the convolution kernel is stretched and transformed, and zeroes are padded at appropriate positions according to the width of the input matrix and size of the convolution kernel to form another vector. This transformation is designed to perform correct calculations with the transformed vectors of the input matrix and minimize redundant operations in the calculation process, thereby improving efficiency. Finally, other optimization methods are combined to accelerate the vector calculations. Experimental results show that the calculation speed of the OAC method is 58.9% and 90.1% higher than that of the traditional MEC method and the im2col method. Further, the memory usage is reduced by 53.7% compared with that of the MEC method. The OAC method has not only achieved significant results in computational efficiency, but also provided efficient and feasible solutions for computing tasks such as deep learning scheme.

Key words: deep learning, convolutional computation, convolutional optimization, vector transformation, acceleration library