当前位置:网站首页>研究生新生培训第二周:卷积神经网络基础
研究生新生培训第二周:卷积神经网络基础
2022-07-29 05:21:00 【Fanshoo】
part 1:视频学习
学习内容专知课程《卷积神经网络基础》,主要内容包括CNN基本结构和典型的神经网络结构
一、卷积神经网络基本结构
1.卷积层
卷积层中定义的基本概念:

卷积神经网络的运算:

卷积层在CNN中的主要作用为局部关系的特征提取。
2.池化层
池化层在卷积神经网络中的作用:保留主要特征同时减少参数和计算量,防止过拟合,提高模型泛化能力

Pooling的类型:
(1)MaxPooling (2)AveragePooling
3.全连接层

全连接层在CNN中主要起到对卷积层提取出来的局部特征进行学习分类。
二、卷积神经网络经典结构:
1.卷积神经网络发展历史

2.AlexNet

AlexNet是CNN的奠基之作,引领起CNN与深度学习研究热潮
网络中使用到两块GPU对数据进行并行运算,最后通过FC层整合
3.VGG

大深度,大参数量,大运算的神经网络结构
4.GoogleNet

引入inception块,对信息采用多个卷积核进行特征提取
另外,未使用全连接层,使神经网络中的参数数量大大降低
5.ResNet
引入残差思想,在训练深层次网路中效果极好

PART 2:代码实验
一、利用CNN实现MNIST手写数据集分类:
1.神经网络构建
全连接层:

卷积层:

2.全连接神经网络与卷积神经网络训练结果:


CNN在图像识别方面准确率远高于全连接神经网络
3.对图像数据进行洗牌后在进行识别
打乱后的图像数据:
4.全连接神经网络与卷积神经网络训练结果:


CNN无法提取出图像的局部特征,分类结果不好。
二、使用 CNN 对 CIFAR10 数据集进行分类
1.构建网络:

2.训练模型

3.图片分类结果

三、使用 VGG16 对 CIFAR10 分类
1.装载数据集

与实验二不同,这里采用RandomCrop(),RandomHorizontalFlip(),对数据进行了预处理
2.构建神经网络模型

3.模型训练

4.测试集分类准确率

分类准确度提升20多个百分点,简单VGG网络模型的效果远远好于简单的LeNetCNN网络模型。
PART 3:问题回答
1.dataloader 里面 shuffle 取不同值有什么区别?
shuffle可以取值为 "true" 或者 "false",表示是否对数据进行打乱洗牌,通常需要对训练集打乱洗牌,测试集可以不打乱
2.transform 里,取了不同值,这个有什么区别?
transform是常用的图像预处理方法,包括归一化、随机裁剪等,提高泛化能力。代码练习中用到的有:
transforms.ToTensor() 作用是转换为tensor格式,这个格式可以直接输入进神经网络;
transforms.Normalize()是对像素值进行归一化处理,使得数据服从均值为0,标准差为1的分布;
transforms.RandomCrop()是在图片的随机位置上进行裁剪并返回新的图片;
transforms.RandomHorizontalFlip()是依据概率p对图片进行水平翻转,p默认0.5;
transforms.Compose()是将一系列的transforms有序组合,实现时按照这些方法依次对图像操作。
3.epoch 和 batch 的区别?
epoch和batch都是神经网络训练中的超参数,epoch表示神经网络训练的轮数,batch用于定义在更新内部模型参数之前要处理的样本数,一次epoch至少要训练完成一个batch.
4.1x1的卷积和 FC 有什么区别?主要起什么作用?
FC可以看作全局卷积,1*1卷积可以替代FC,FC主要起到线性变化和分类的作用,1*1通常用于实现降维,用作非线性变化
5.residual leanring 为什么能够提升准确率?
解决了梯度消失问题
6.代码练习二里,网络和1989年 Lecun 提出的 LeNet 有什么区别?
代码练习二中激活函数为ReLU,而LeNet激活函数是Sigmoid。代码二中的网络结构通常较=叫LeNet-5
7.代码练习二里,卷积以后feature map 尺寸会变小,如何应用 Residual Learning?
通过线性变换将原图像缩小为和feature map大小相同的图像。当输入输出维度上升时有两种处理方式:第一种是仍使用恒等映射,多出来的通道使用零矩阵填充,这样做的好处是不会带来额外的参数;第二种是添加变换方程,通常来说会使用 1*1 卷积来完成升维
8.有什么方法可以进一步提升准确率?
(1)改进网络结构 (2)选择合适优化器 (3)选择合适损失函数 (4)选择合适激活函数 (5)增加网络深度 (6)增加训练轮数 (7)采用更大的数据集
2.
边栏推荐
- Analysis on the principle of flow
- SSM integration
- [go] use of defer
- mysql 的show profiles 使用。
- Super simple integration HMS ml kit face detection to achieve cute stickers
- [CV] what are the specific numbers of convolution kernels (filters) 3*3, 5*5, 7*7 and 11*11?
- 【go】defer的使用
- Valuable blog and personal experience collection (continuous update)
- Semaphore (semaphore) for learning notes of concurrent programming
- [clustmaps] visitor statistics
猜你喜欢

How to obtain openid of wechat applet in uni app project

D3.JS 纵向关系图(加箭头,连接线文字描述)

微信小程序源码获取(附工具的下载)

Are you sure you know the interaction problem of activity?

Training log II of the project "construction of Shandong University mobile Internet development technology teaching website"
![[database] database course design - vaccination database](/img/4d/e8aff67e3c643fae651c9f62af2db9.png)
[database] database course design - vaccination database

day02 作业之文件权限

Reporting Services- Web Service

Ribbon学习笔记二

Intelligent security of the fifth space ⼤ real competition problem ----------- PNG diagram ⽚ converter
随机推荐
与张小姐的春夏秋冬(3)
xtrabackup 的使用
Are you sure you know the interaction problem of activity?
与张小姐的春夏秋冬(4)
有价值的博客、面经收集(持续更新)
DataX installation
Study and research the way of programming
Thinkphp6 pipeline mode pipeline use
Interesting talk about performance optimization thread pool: is the more threads open, the better?
Activity交互问题,你确定都知道?
Detailed explanation of atomic operation class atomicinteger in learning notes of concurrent programming
C # judge whether the user accesses by mobile phone or computer
NIFI 改UTC时间为CST时间
[CV] what are the specific numbers of convolution kernels (filters) 3*3, 5*5, 7*7 and 11*11?
【bug】XLRDError: Excel xlsx file; not supported
简单聊聊 PendingIntent 与 Intent 的区别
Synchronous development with open source projects & codereview & pull request & Fork how to pull the original warehouse
datax安装
【go】defer的使用
Show profiles of MySQL is used.