基于对抗网络的MNIST数字图像识别及其性能分析毕业论文

 2021-04-10 10:04

摘 要

根据博弈论中二人零和博弈原理,生成对抗网络(Generative Adversarial Networks)的思想开始萌芽。生成式模型和判别式模型是对抗网络模型中的两位博弈方。生成模型由捕捉样本的数据,并使用服从分布的噪声生成一个与真实训练数据相似的样本,其目的是无限接近真实样本;然后使用一个二分类器作为判别模型来估计样本来自训练数据的概率:如果判别样本来自于真实数据,则输出一个较大概率,否则判别模型输出一个小概率。

在本文研究过程中,主要工作概括为以下几个方面:

1、下载MNIST图像库;MNIST手写数字数据库作为大的手写体数据库NIST的子集,现在在图像识别领域已经成为用于测试其自身算法的基准数据库。该图像库可以由用户在TensorFlow 官网上下载,并导入在环境中。

2、读取显示真实图像;在编译环境中直接利用代码显示出真实图像。

3、生成伪图像;生成器的隐层利用Leaky ReLU函数,输出层利用tanh函数,通过输入噪声图片,输出一个与真实图像相同大小的图像。

4、对抗训练;对于真实图片,判别器标注 1;对于生成图片,判别器标注0;同时,生成器目标是自己生成的图片被判别器标注1。

5、对真实图像进行分类;挑选经过迭代训练的结果图,研究迭代次数的增加生成器生成伪图像的能力如何变化。

关键字:生成对抗网络;手写数据集;生成器;辨别器;对抗训练;损失函数

MINST digital image recognition and its performance analysis

based on Generative Adversarial Networks

Abstract

Generative Adversarial Networks is based on the two person zero-sum game in the game theory, and the two game players in the Generative Adversarial Networks model are acted by the generative model and the discriminant model respectively. The generation model captures the distribution of sample data and generates a sample similar to real training data by obeying the noise of a certain distribution (uniform distribution, Gauss distribution, etc.), and the pursuit effect is more like the real sample. The discriminant model is a two classifier, and a sample is estimated from the training data (rather than the generated data). If the sample comes from the real training data, the output of the model is large probability. Otherwise, the discriminant model outputs small probability.

In the process of the study, the major work could be summed up as follows:

1, download MNIST: The MNIST handwritten digital database is a large subset of the handwriting database NIST and now has become a benchmark database for the field of image recognition to test its own algorithms. MNIST can be downloaded on the TensorFlow website and imported in compile environment.

2, display real image: The real image can be directly shown in the compile environment by entering codes.

3, generate fake image: Using Leaky ReLU as the hidden layer activation function and tanh as the output layer function, generator can generate the same size fake image by noise.

4, adversarial train: For a given real image, the discriminator should label it 1; For a given generated image, the discriminator should label it 0; For the generation of the generator to the discriminator, the generator expects the discriminator to be labeled 1.

5, classify real images: Select some images after epochs, and it is easy to see at the beginning there was only white in the middle, and there was a lot of noise in the background black block. Along with the increase of the number of epochs, the generator’s ability to create "fake figure" is becoming more and more strong, it gradually learned real picture distribution, the most obvious thing is to distinguish between the black background and white line of the characters.

Key words:Generative Adversarial Networks, MNIST, Generator, Discriminator, adversarial train, loss function

目录

摘 要 I

Abstract II

第一章 绪论 1

1.1 国内外研究概况 1

1.2 研究该课题的重要意义 2

1.3 本文的安排 3

第二章 安装环境简介 4

2.1 TensorFlow 4

2.2 Anaconda 5

2.3 Jupyter Notebook 6

第三章 GAN的原理与概述 7

3.1 GAN的基本原理 7

3.2 GAN的学习模型 8

第四章 MNIST提取与查看 10

4.1 MNIST 简介 10

4.2 MNIST 导入 12

4.3 MNIST 展示 13

第五章 生成器与辨别器的实现 14

5.1 生成器的定义 14

5.1.1 Leaky ReLU 函数 15

5.1.2 tanh 函数 17

5.2 判别器的定义 18

5.2.1 Leaky ReLU 函数 20

5.2.2 sigmoid 函数 20

第六章 对抗训练 22

6.1 损失函数 22

6.1.1 交叉熵 22

6.1.2 Label Smoothing Regularization 23

6.1.3 loss函数的定义 24

6.2 优化函数 25

6.3 训练结果展示 25

6.3.1 loss变化图像展示 26

6.3.2 最后一轮结果展示 26

6.3.3 过程展示 27

第七章 结论与展望 28

7.1 论文总结 28

7.2 GAN技术的展望 29

致谢 30

参考文献 31

附录 33

图表目录

图2.2 终端激活(关闭)TensorFlow界面 5

图2.3终端打开(关闭)Jupyter Notebook界面 6

图3.1 GAN的计算流程与结构 8

图4.1.1 MNIST 的图片 10

图4.1.2 MNIST 图片和标签的对应 11

图4.1.3 MNIST 的训练数据集 11

图4.1.4 MNIST 的训练数据集标签 12

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

课题毕业论文、开题报告、任务书、外文翻译、程序设计、图纸设计等资料可联系客服协助查找,优先添加企业微信。