卷积神经网络在不同硬件平台上的能效比较研究

 2022-05-20 10:05

论文总字数:34899字

摘 要

卷积神经网络可以模仿生物视觉神经的行为特征,是深度学习的代表算法之一,已广泛应用于图像识别领域,并且具有较高的识别准确率。目前常用的实现卷积神经网络的硬件平台有CPU、GPU和FPGA等,本文分别在这三种硬件平台上实现卷积神经网络,并根据测量所得的功耗和数据吞吐率综合比较各自的系统能效。在CPU和GPU平台上的实现方法是通过TensorFlow框架实现卷积神经网络,在FPGA平台上的实现方法为HLS综合模块后加入系统工程调用实现卷积神经网络。

本文中三种硬件平台的功耗和能效对比结果表明:在能效对比上,FPGA在MNIST和CIFAR-10数据集上的能效分别为3.923GOPS/W和2.268GOPS/W,远高于CPU和GPU的能效;在数据吞吐率和功耗对比上,GPU的数据吞吐率高于CPU和FPGA的数据吞吐率,且FPGA平台的功耗远远低于CPU和GPU平台的功耗。FPGA的优化中特别采用了HLS生成卷积神经网络模块,极大地提升了数据吞吐率。

关键词:卷积神经网络,FPGA,CPU,GPU,吞吐率,能效

Abstract

Convolutional neural networks, CNN, can mimic the behavioral characteristics of biological optic nerves and has been one of the representative algorithms of deep learning. They have been widely used in the field of image recognition and have high recognition accuracy. At present, the typical hardware platforms for implementing CNN are CPU, GPU and FPGA. In this paper, CNN has been implemented on these three hardware platforms, and the respective systems are compared according to the measured power consumption and data throughput. The implementation method on the CPU and GPU platform is the TensorFlow framework. The implementation method on the FPGA platform is to add the system engineering call after the HLS synthesis module.

The comparison of power consumption and energy efficiency of the three hardware platforms was shown in this paper. The energy efficiency of FPGA on MNIST and CIFAR-10 data sets is 3.923 GOPS/W and 2.268 GOPS/W, respectively, which is much higher than that of CPU’s and GPU’s energy efficiency. In terms of data throughput and power consumption, GPU’s data throughput is higher than CPU and FPGA, FPGA’s power consumption is far lower than CPU and GPU. During the optimization of FPGA, HLS has been applied to generate convolutional neural network module, which improved the data throughput rate greatly.

KEY WORDS: CNN, FPGA, CPU, GPU, throughput, energy efficiency

目 录

摘 要 I

第一章 绪论 1

1.1 研究背景 1

1.2 国内外研究现状 1

1.2.1 国外研究现状 1

1.2.2 国内研究现状 2

1.3 论文内容 3

1.3.1 论文意义 3

1.3.2 主要工作 3

1.3.3 技术难点 3

1.4 论文组织结构 4

第二章 卷积神经网络实现环境 5

2.1 卷积神经网络 5

2.1.1 卷积神经网络原理 5

2.1.2 卷积神经网络结构 5

2.1.3 卷积神经网络应用 6

2.2 卷积神经网络实现的平台 7

2.2.1 卷积神经网络实现的软件平台 7

2.2.2 卷积神经网络实现的硬件平台 8

2.3 本章小结 9

第三章 卷积神经网络实现方案 10

3.1 卷积神经网络数据集选择及获取 10

3.1.1 数据集选择 10

3.1.2 MNSIT数据集及获取 10

3.1.3 CIFAR-10数据集及获取 10

3.2 卷积神经网络训练方案 11

3.2.1 方案选择 11

3.2.2 训练实现过程 11

3.3 卷积神经网络权重获取方案 12

3.3.1 方案选择 12

3.3.2 MNIST数据集的网络权重获取 12

3.3.3 CIFAR-10数据集的网络权重获取 13

3.4 系统优化 13

3.4.1 网络模型优化 13

3.4.2 HLS优化 13

3.4.3 FPGA系统频率优化 14

3.5 本章小结 14

第四章 卷积神经网络模型在不同硬件平台上的具体实现 15

4.1 在CPU上实现VGG19对比试验 15

4.2 在CPU实现卷积神经网络模型 15

4.2.1 在MNIST数据集上实现 16

4.2.2 在CIFAR-10数据集上实现 17

4.3 GPU实现卷积神经网络模型 17

4.3.1 在MNIST和CIFAR-10数据集上实现 18

4.4 FPGA实现卷积神经网络模型 18

4.4.1 在FPGA上预实现的功能 18

4.4.2 在MNIST数据集上实现 20

4.4.3 在CIFAR-10数据集上实现 27

4.5 本章小节 28

第五章 系统测试分析 29

5.1 实验环境介绍 29

5.2 系统测试 29

5.2.1 CPU平台测试 29

5.2.2 GPU平台测试 34

5.2.3 FPGA平台测试 36

5.3 性能分析 39

5.3.1 数据吞吐率分析 39

5.3.2 系统功耗分析 39

5.3.3 系统整体分析 40

5.4 本章小结 41

第六章 总结与展望 42

6.1 总结 42

6.2 展望 43

参考文献 46

绪论

研究背景

上世纪80年代到90年代,相关工作者开始了卷积神经网络(Convolutional Neural Networks, CNN)的研究,时间延时网络和Lenet-5网络是最早被提出的卷积神经网络。最近十几年,由于基础科学研究以及硬件设备的性能提升,卷积神经网络有了更加快速且多样的发展,逐步被大量使用。卷积神经网络是一类包含卷积计算且具有深度结构的前馈神经网络,目前已成为当前人工智能的核心技术,发展迅速,也是深度学习的代表算法之一[1]。常用的卷积神经网络有LeNet、AlexNet、VggNet、ResNet等,隐含层内的卷积核参数共享和层间连接的稀疏性使得卷积神经网络能够以较小的计算量对数据层进行格点化,所以可以更加高效的对像素和音频等具有局部特征的数据源进行学习,并能表现出较好的学习能力[2]。卷积神经网络已经广泛用于图像识别、图像分类,因为它能模仿生物视觉神经的行为,且不同于传统的方法,在多次训练后可以在图像识别、图像分类上获得较高的准确率。

剩余内容已隐藏,请支付后下载全文,论文总字数:34899字

您需要先支付 80元 才能查看全部内容!立即支付

该课题毕业论文、开题报告、外文翻译、程序设计、图纸设计等资料可联系客服协助查找;