Skip to content

Commit

Permalink
更新
Browse files Browse the repository at this point in the history
  • Loading branch information
scutan90 committed Apr 26, 2019
1 parent 96898d7 commit ed06369
Show file tree
Hide file tree
Showing 245 changed files with 14 additions and 89 deletions.
54 changes: 14 additions & 40 deletions ch09_图像分割/第九章_图像分割.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,25 +2,11 @@

[TOC]

作者:scutan90
编辑者:shw2018(UESTC_孙洪卫_硕,Wechat:sunhwee)
提交:2018.10.25
更新:2018.10.31

<----cfj-2019-01-07---->

1. 新增什么是图像分割?图像分割算法类别
2. 新增图像分割数据集

# 第九章 图像分割

## 9.1 什么是图像分割?

图像分割是预测图像中每一个像素所属的类别或者物体。
## 9.1 图像分割算法分类?

## 9.2 图像分割算法分类?

基于深度学习的图像分割算法主要分为两类:
图像分割是预测图像中每一个像素所属的类别或者物体。基于深度学习的图像分割算法主要分为两类:

**1.语义分割**

Expand All @@ -34,57 +20,45 @@

![](./img/ch9/Instance-01.png)

## 9.3 传统的基于CNN的分割方法缺点?
## 9.2 传统的基于CNN的分割方法缺点?

&emsp;&emsp;
传统的基于CNN的分割方法:为了对一个像素分类,使用该像素周围的一个图像块作为CNN的输入,用于训练与预测,这种方法主要有几个缺点:
&emsp;&emsp;
1)存储开销大,例如,对每个像素使用15 * 15的图像块,然后不断滑动窗口,将图像块输入到CNN中进行类别判断,因此,需要的存储空间随滑动窗口的次数和大小急剧上升;
&emsp;&emsp;
2)效率低下,相邻像素块基本上是重复的,针对每个像素块逐个计算卷积,这种计算有很大程度上的重复;
&emsp;&emsp;
3)像素块的大小限制了感受区域的大小,通常像素块的大小比整幅图像的大小小很多,只能提取一些局部特征,从而导致分类性能受到限制。
&emsp;&emsp;
而全卷积网络(FCN)则是从抽象的特征中恢复出每个像素所属的类别。即从图像级别的分类进一步延伸到像素级别的分类。


## 9.2 FCN

### 9.2.1 FCN改变了什么?

&emsp;&emsp;
对于一般的分类CNN网络,如VGG和Resnet,都会在网络的最后加入一些全连接层,经过softmax后就可以获得类别概率信息。但是这个概率信息是1维的,即只能标识整个图片的类别,不能标识每个像素点的类别,所以这种全连接方法不适用于图像分割。
## 9.3 FCN

![](./img/ch9/figure_9.1.1_1.jpg)
### 9.3.1 FCN改变了什么?

&emsp;&emsp;
而FCN提出可以把后面几个全连接都换成卷积,这样就可以获得一张2维的feature map,后接softmax获得每个像素点的分类信息,从而解决了分割问题,如图4。
​ 对于一般的分类CNN网络,如VGG和Resnet,都会在网络的最后加入一些全连接层,经过softmax后就可以获得类别概率信息。但是这个概率信息是1维的,即只能标识整个图片的类别,不能标识每个像素点的类别,所以这种全连接方法不适用于图像分割。
而FCN提出可以把后面几个全连接都换成卷积,这样就可以获得一张2维的feature map,后接softmax层获得每个像素点的分类信息,从而解决了分割问题,如图4。

![](./img/ch9/figure_9.1.1_2.jpg)

<center>图 4</center>

### 9.2.2 FCN网络结构?
### 9.3.2 FCN网络结构?

&emsp;&emsp;
FCN对图像进行像素级的分类,从而解决了语义级别的图像分割(semantic segmentation)问题。与经典的CNN在卷积层之后使用全连接层得到固定长度的特征向量进行分类(全联接层+softmax输出)不同,FCN可以接受任意尺寸的输入图像,采用反卷积层对最后一个卷积层的feature map进行上采样, 使它恢复到输入图像相同的尺寸,从而可以对每个像素都产生了一个预测, 同时保留了原始输入图像中的空间信息, 最后在上采样的特征图上进行逐像素分类。
下图是语义分割所采用的全卷积网络(FCN)的结构示意图:
​ FCN对图像进行像素级的分类,从而解决了语义级别的图像分割(semantic segmentation)问题。与经典的CNN在卷积层之后使用全连接层得到固定长度的特征向量进行分类(全联接层+softmax输出)不同,FCN可以接受任意尺寸的输入图像,采用反卷积层对最后一个卷积层的feature map进行上采样, 使它恢复到输入图像相同的尺寸,从而可以对每个像素都产生了一个预测, 同时保留了原始输入图像中的空间信息, 最后在上采样的特征图上进行逐像素分类。
​ 下图是语义分割所采用的全卷积网络(FCN)的结构示意图:

![](./img/ch9/figure_9.1.2_1.jpg)

### 9.2.3 全卷积网络举例?
### 9.3.3 全卷积网络举例?

&emsp;&emsp;
通常CNN网络在卷积层之后会接上若干个全连接层, 将卷积层产生的特征图(feature map)映射成一个固定长度的特征向量。以AlexNet为代表的经典CNN结构适合于图像级的分类和回归任务,因为它们最后都得到整个输入图像的一个概率向量,比如AlexNet的ImageNet模型输出一个1000维的向量表示输入图像属于每一类的概率(softmax归一化)。
​ 通常CNN网络在卷积层之后会接上若干个全连接层, 将卷积层产生的特征图(feature map)映射成一个固定长度的特征向量。以AlexNet为代表的经典CNN结构适合于图像级的分类和回归任务,因为它们最后都得到整个输入图像的一个概率向量。

![](./img/ch9/figure_9.1.3_1.jpg)

&emsp;&emsp;
如图所示
如上图所示
&emsp;&emsp;
(1)在CNN中, 猫的图片输入到AlexNet, 得到一个长为1000的输出向量, 表示输入图像属于每一类的概率, 其中在“tabby cat”这一类统计概率最高, 用来做分类任务。
&emsp;&emsp;
(2)FCN与CNN的区别在于把CNN最后的全连接层转换成卷积层,输出的是一张已经Label好的图片, 而这个图片就可以做语义分割。
(2)FCN与CNN的区别在于把CNN最后的全连接层转换成卷积层,输出的是一张已经带有标签的图片, 而这个图片就可以做语义分割。
&emsp;&emsp;
(3)CNN的强大之处在于它的多层结构能自动学习特征,并且可以学习到多个层次的特征: 较浅的卷积层感知域较小,学习到一些局部区域的特征;较深的卷积层具有较大的感知域,能够学习到更加抽象一些的特征。高层的抽象特征对物体的大小、位置和方向等敏感性更低,从而有助于识别性能的提高, 所以我们常常可以将卷积层看作是特征提取器。

Expand Down
Binary file not shown.
Binary file removed ch11_迁移学习/__MACOSX/ch11_迁移学习/._ch11.pdf
Binary file not shown.
Binary file removed ch11_迁移学习/__MACOSX/ch11_迁移学习/._img
Binary file not shown.
Binary file removed ch11_迁移学习/__MACOSX/ch11_迁移学习/._media
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file removed ch11_迁移学习/__MACOSX/ch11_迁移学习/img/._ch11
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Binary file removed ch11_迁移学习/ch11_迁移学习/ch11.pdf
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -115,17 +115,6 @@ Reference:
3. Tan, B., Song, Y., Zhong, E. and Yang, Q., 2015, August. Transitive transfer learning. In Proceedings of the 21th ACM SIGKDD International Conference on Knowledge Discovery and Data Mining (pp. 1155-1164). ACM.


### 11.1.10 迁移学习与传统机器学习有什么区别?

| | 迁移学习 | 传统机器学习 |
| -------- | -------------------------- | -------------------- |
| 数据分布 | 训练和测试数据不需要同分布 | 训练和测试数据同分布 |
| 数据标签 | 不需要足够的数据标注 | 足够的数据标注 |
| 建模 | 可以重用之前的模型 | 每个任务分别建模 |

![1542973960796](./img/ch11/1542973960796.png)



## 11.2 迁移学习的基本思路有哪些?

Expand Down
38 changes: 0 additions & 38 deletions ch12_网络搭建及训练/第十二章_网络搭建及训练.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,44 +3,6 @@


# 第十二章 网络搭建及训练
目录
常用框架介绍
常用框架对比(表格展示) 16个最棒的深度学习框架 https://baijiahao.baidu.com/s?id=1599943447101946075&wfr=spider&for=pc
基于tensorfolw网络搭建实例
CNN训练注意事项
训练技巧
深度学习模型训练痛点及解决方法 https://blog.csdn.net/weixin_40581617/article/details/80537559
深度学习模型训练流程 https://blog.csdn.net/Quincuntial/article/details/79242364
深度学习模型训练技巧 https://blog.csdn.net/w7256037/article/details/52071345
https://blog.csdn.net/u012033832/article/details/79017951
https://blog.csdn.net/u012968002/article/details/72122965

深度学习几大难点 https://blog.csdn.net/m0_37867246/article/details/79766371

## CNN训练注意事项
http://www.cnblogs.com/softzrp/p/6724884.html
1.用Mini-batch SGD对神经网络做训练的过程如下:

不断循环 :

①  采样一个 batch 数据( ( 比如 32 张 )

②前向计算得到损失 loss

③  反向传播计算梯度( 一个 batch)

④  用这部分梯度迭代更新权重参数

2.去均值

去均值一般有两种方式:第一种是在每个像素点都算出3个颜色通道上的平均值,然后对应减去,如AlexNet。 第二种是在整个样本上就只得到一组数,不分像素点了,如VGGNet。
3.权重初始化
4.Dropout



# 第十二章 TensorFlow、pytorch和caffe介绍

# 12.1 TensorFlow

## 12.1.1 TensorFlow是什么?
Expand Down
Binary file not shown.

0 comments on commit ed06369

Please sign in to comment.