APP下载

卷积神经网络RLeNet加速器设计

2021-03-22康磊李慧郑豪威李鑫

电脑知识与技术 2021年6期

康磊 李慧 郑豪威 李鑫

摘要:针对卷积神经网络(CNN)对运算的需求,现场可编程逻辑门阵列(FPGA)可以充分挖掘CNN内部并行计算的特性,提高运算速度。因此,本文基于FPGA开发平台,从模型优化、参数优化,硬件加速以及手写体数字识别四个方面对CNN的FPGA加速及应用进行研究。提出一种数字识别网络RLeNet,并对网络进行参数优化,卷积运算加速采用脉冲阵列与加法树结合的硬件结构实现,同时使用并行技术和流水线技术优化加速,并使用microblaze IP通过中断控制CNN加速器IP接收串口发送的图片数据进行预测,输出结果。最后在Xilinx Nexys 4 DDR:Artix-7开发板上实现了MNIST数据集手写体数字识别预测过程,当系统时钟为200MHz时,预测一张图片的时间为36.47us。

关键词:CNN;FPGA;RLeNet;MNIST;手写体数字识别

中图分类号:TP389.1     文献标识码: A

文章编号:1009-3044(2021)06-0016-04

Abstract: In response to the requirement of convolutional neural network (CNN) for multiplication and accu-mulation operations, Field Programmable Logic Gate Array (FPGA) can fully tap the characteristics of parallel computing within CNN and increase the speed of operation. Therefore, based on the FPGA development platform, this article studies the FPGA acceleration and application of CNN from four aspects: model optimization, parameter optimization, hardware acceleration, and handwritten digit recognition. Propose a digital recognition network RLeNet, and optimize the parameters of the network. Convolution operation acceleration use a hardware structure combining pulse array and addition tree,parallel technology,pipeline technology, and microblaze IP is used to control the CNN accelerator through interrupts. The IP receives the picture data sent by the serial port for prediction and outputs the result. Finally, on the Xilinx Nexys 4 DDR: Artix-7 development board, the MNIST data set handwritten digit recognition and prediction process is implemented. When the system clock is 200MHz, the time to predict a picture is 36.47us.

Key words: CNN; FPGA; RLeNet; MNIST; handwritten digit recognition

1 引言

CNN作为一种典型的深度学习神经网络结构,受到自然视觉认知机制启发而来[1],在视频处理、人脸识别、语音识别和自然语言处理等很多方面都表现得非常出色[2-3]。但CNN需要大量的计算,在这样的背景下,FPGA 似乎是一种非常理想的選择,同GPU相比,FPGA 不仅拥有数据并行的特点,还拥有流水线并行的特点[4]。目前很多研究者对FPGA加速进行了研究,例如Yu-Hsin Chen提出的Eyeriss高效可配置卷积神经网络[5],中科院Temam教授和陈教授合作的机器学习加速器DianNao[6],以及google的TPU[7]等。本文在已有加速器的基础上,进行了数据优化、加入流水线技术实现卷积神经网络的加速,并使用开发板自带microblaze通过中断控制CNN加速IP输出预测结果。

2 系统总体介绍

2.1 RLeNet模……

登录APP查看全文