Skip to content

Commit

Permalink
Merge pull request scutan90#445 from ming71/work
Browse files Browse the repository at this point in the history
Work
  • Loading branch information
scutan90 authored Sep 28, 2019
2 parents 5c99a5a + ea82eff commit 8f7a071
Show file tree
Hide file tree
Showing 29 changed files with 492 additions and 14 deletions.
Binary file added ch08_目标检测/img/ch8/8.5.1-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added ch08_目标检测/img/ch8/8.5.1-2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added ch08_目标检测/img/ch8/8.5.1-3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added ch08_目标检测/img/ch8/8.5.1-4.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added ch08_目标检测/img/ch8/8.5.1-5.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added ch08_目标检测/img/ch8/8.5.1-6.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added ch08_目标检测/img/ch8/8.5.1-7.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added ch08_目标检测/img/ch8/8.5.1-8.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added ch08_目标检测/img/ch8/8.5.9-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added ch08_目标检测/img/ch8/8.5.9-2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added ch08_目标检测/img/ch8/8.5.9-3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added ch08_目标检测/img/ch8/8.5.9-4.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added ch08_目标检测/img/ch8/DetNet-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added ch08_目标检测/img/ch8/DetNet-2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added ch08_目标检测/img/ch8/DetNet-3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added ch08_目标检测/img/ch8/DetNet-4.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added ch08_目标检测/img/ch8/DetNet-5.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added ch08_目标检测/img/ch8/DetNet-6.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added ch08_目标检测/img/ch8/DetNet-7.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added ch08_目标检测/img/ch8/DetNet-8.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 2 additions & 0 deletions ch08_目标检测/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@

更新日志:**

2019.9.20(明奇):新增DOTA数据集、目标检测的训练tricks、数据增强方法、CBNet、DetNet

2019.01.05(陈方杰):新增8.3节One-Stage检测算法:M2Det

2018.12.21(陈方杰):新增SSD系列创新点,新增YOLO系列创新点
Expand Down
384 changes: 375 additions & 9 deletions ch08_目标检测/第八章_目标检测.md

Large diffs are not rendered by default.

Binary file added ch09_图像分割/img/ch9/9.13-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added ch09_图像分割/img/ch9/9.13-2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added ch09_图像分割/img/ch9/9.13-3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added ch09_图像分割/img/ch9/9.13-4.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added ch09_图像分割/img/ch9/9.13-5.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 2 additions & 0 deletions ch09_图像分割/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,6 @@
**贡献者(排名不分先后):**
内容贡献者可自加信息

北京理工大学--明奇

###########################################################
118 changes: 113 additions & 5 deletions ch09_图像分割/第九章_图像分割.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@
![](./img/ch9/figure_9.1.1_2.jpg)

<center>图 4</center>

### 9.3.2 FCN网络结构?

​ FCN对图像进行像素级的分类,从而解决了语义级别的图像分割(semantic segmentation)问题。与经典的CNN在卷积层之后使用全连接层得到固定长度的特征向量进行分类(全联接层+softmax输出)不同,FCN可以接受任意尺寸的输入图像,采用反卷积层对最后一个卷积层的feature map进行上采样, 使它恢复到输入图像相同的尺寸,从而可以对每个像素都产生了一个预测, 同时保留了原始输入图像中的空间信息, 最后在上采样的特征图上进行逐像素分类。
Expand Down Expand Up @@ -138,7 +137,6 @@ Upsampling的操作可以看成是反卷积(deconvolutional),卷积运算的
<center>上图中的反卷积,input是2×2, output是4×4。 Zero padding, non-unit strides, transposed。</center>
![](./img/ch9/figure_9.1.8_2.png)
<center>上图中的反卷积,input feature map是3×3, 转化后是5×5, output是5×5</center>

### 9.2.8 跳级(skip)结构

&emsp;&emsp;
Expand Down Expand Up @@ -199,7 +197,6 @@ Upsampling的操作可以看成是反卷积(deconvolutional),卷积运算的
![](./img/ch9/figure_9.1.10_5.png)

<center>第三次反卷积步长为8,记为FCN-8s</center>

其他参数:
&emsp;&emsp;
minibatch:20张图片。
Expand Down Expand Up @@ -717,7 +714,6 @@ $$

&emsp;&emsp;
Wisconsin-Madison大学的Jia Xu提出了一个统一的框架来处理各种不同类型的弱标记:图像级别的标记、bounding box和部分像素标记如scribbles。该方法把所有的训练图像分成共计$n$个super-pixel,对每个super-pixel提取一个$d$维特征向量。因为不知道每个super-pixel所属的类别,相当于无监督学习,因此该方法对所有的super-pixel做聚类,使用的是最大间隔聚类方法(max-margin clustering, MMC),该过程的最优化目标函数是:

$$
\underset{W,H}{min} \qquad \frac{1}{2}tr\left ( W^TW \right ) + \lambda\sum_{p=1}^{n}\sum_{c=1}^{C}\xi \left ( w_c;x_p;h_p^c \right)
$$
Expand All @@ -733,6 +729,43 @@ $$
&emsp;&emsp;
小结:在弱标记的数据集上训练图像分割算法可以减少对大量全标记数据的依赖,在大多数应用中会更加贴合实际情况。弱标记可以是图像级别的标记、边框和部分像素的标记等。训练的方法一般看做是限制条件下的最优化方法。另外EM算法可以用于CNN参数和像素类别的联合求优。


### 9.10.5 弱监督分割最新进展(贡献者:明奇-北京理工大学)
* **bbox监督**
1. Learning to Segment via Cut-and-Paste(ECCV 2018)

利用GAN对抗学习的思想,在cut-paste思想指导下利用bbox弱监督进行实例分割。
![](./img/ch9/9.10.5-1.png)
采用对抗学习的思想,网络主体分为两大部分:mask生成器和合成图像判别器。具体过程为:(1)在图像上截取gt,经过特征提取后预测一个bbox内gt的mask;(2)在原图上随机cut一个背景图像,将bbox内按照生成的mask提取出物体分割结果,然后paste到原图裁剪的背景上去;(3)合成的图像经过判别器进行真假判断。
通过生成器生成更好mask来使得判别器更难判别,在对抗学习中提升两者的性能,逐渐获得更好的结果 .

2. Simple Does It: Weakly Supervised Instance and Semantic Segmentation(CVPR2017)
本文做的是bbox弱监督语义/实例分割任务,能达到全监督分割效果(DeepLabv1)的95%。主要工作为:讨论了使用弱监督语义标签进行迭代训练的方法,以及其限制和不足之处;证明了通过类似GrabCut的算法能通过bbox生成分割训练标签方法的可行性,可以避免像上面的迭代方法重新调整网络训练策略;在VOC数据集上逼近监督学习的分割任务效果。
作者的启发是:将bbox level的mask送入网络训练后得到分割mask的比输入的bbox mask要好(这是很好的insight)。因此启发的操作是:将bbox level标注作为初始mask输入优化,每次得到的标注作为gt进行下一轮的迭代,从而不断获得更好的效果。效果图如下:
![](./img/ch9/9.10.5-3.png)
在此基础上,再加上优化的GrabCut+算法,以及部分区域的筛选,以及BSDS500的边界预测信息整合到一起,能够达到很好的弱监督迭代分割效果。





* **分类监督**
1. Weakly Supervised Learning of Instance Segmentation with Inter-pixel Relations(CVPR2019)
使用分类标注作为弱监督信息,在CAM提取到特征的基础上,进一步设计IRNet学习额外的特征约束,从而到达更好的弱监督实例分割效果。为了解决CAM应用到实例分割的上述局限,设计IRNet。其组成为两部分:(1)不分类别的实例响应图 (2)pairwise semantic affinitie。其中通过不分类别的实例响应图和CAM结合,约束后得到instance-wise CAMS;另一个分支预先预测物体的边界然后得到pairwise semantic affinitie(关于这个的论文参考Related Work的对应部分,有相应的方法,暂时不深究)进行融合和处理得到最终的分割。整体流程如下:
![](./img/ch9/9.10.5-2.png)

2. Weakly Supervised Instance Segmentation using Class Peak Response(CVPR2018)
本文使用图像级的类别标注监督信息,通过探索类别响应峰值使分类网络能够很好地提取实例分割mask。本工作是使用图像级标注进行弱监督实例分割的首个工作。
在分类监督信息之下,CNN网络会产生一个类别响应图,每个位置是类别置信度分数。其局部极大值往往具有实例很强视觉语义线索。首先将类别峰值响应图的信息进行整合,然后反向传播将其映射到物体实例信息量较大的区域如边界。上述从类别极值响应图产生的映射图称为Peak Response Maps (PRMs),该图提供了实例物体的详细表征,可以很好地用作分割监督信息。
具体流程如图:
![](./img/ch9/9.10.5-4.png)
首先将图片经过正常的分类网络训练,其中在类别预测响应图上提取出局部响应极值点,进行增强卷积后预测出PRM。然后结合多种信息进行推断生成mask。

3. Weakly Supervised Semantic Segmentation Using Superpixel Pooling Network(AAAI 2017)
本文介绍通过类别标注的标签实现弱监督语义分割的方法。该方法在语义分割mask生成和使用生成mask学习分割生成网络之间反复交替。要实现这种交替迭代学习,关键点就是如何利用类别标注得到较准确的初始分割。为了解决这一问题,提出了Superpixel Pooling Network (SPN),将输入图像的超像素分割结果作为低阶结构的表征,辅助语义分割的推断。
![](./img/ch9/9.10.5-5.png)
首先是SPN生成初始mask,然后用另一个网络DecoupledNet来学习每个像素的mask标注。其中,该分割网络将语义分割任务解耦为分类和分割两个子任务,并且能够从类别标注中学习形状先验知识用于辅助分割。

## 9.11 DenseNet(贡献者:黄钦建-华南理工大学)

&emsp;&emsp;
Expand Down Expand Up @@ -794,10 +827,85 @@ Cityscapes 是驾驶领域进行效果和性能测试的图像分割数据集,

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

## 9.13 全景分割(贡献者:北京理工大学--明奇)
全景分割的开山之作:何恺明的*Panoptic Segmentation*

1. **Introduction**

&emsp;&emsp;语义分割通过带孔全卷积网络,根据不同的stuff进行划分;实例分割则是在目标检测的基础上基于检测框进行物体的分割。缺少一种框架可以将两者进行融合实现既能分割背景又能分割实例,而这在自动驾驶和AR技术中大有作为。由此提出的全景分割任务能将两者进行结合。


&emsp;&emsp;全景分割的思路很直观:为图像的每个像素分配语义label和类内实例id,前者用于区分语义信息,后者用于分割实例(因此stuff不具有实例id)。提出全景分割时,只是启发式地将语意分割和实例分割两种任务的输出进行后处理的融合(如NMS),并以此建立PS任务的baseline。为了评价全景分割的质量,提出panoptic quality (PQ) 标准,将背景和物体的评价纳入一个完整的框架下。示意图如下:
![](./img/ch9/9.13-1.png)

2. **Panoptic Segmentation**
* **Task format**
全景分割的标注方法:
像素级的标注,标出类别label和类内实例id。如果某像素的这两个信息都能匹配,则可以将该像素匹配到某个类别和实例中去;类外的像素可以分配空标签,即并不是所有的像素都要有语义类别。

* **Stuff and thing labels**
对于stuff和thing(背景填充和物体实例)的标签,交集是空集,并集是所有可能的label空间。这两者是互相独立不相关的(很好理解,像素属于那个类和它属于哪个物体不具有相关性)。

* **Relationship**
都是像素级的label,需要为每个像素分配对应的标签。但是实例分割基于region的,允许重叠的segmentation,而全景分割和语义分割一样是像素级的label,不允许重叠标签的出现。

* **Confidence scores**
这一点上更像语义分割而不是实例分割,对于PS不需要置信分数评价分割质量。提到这个,作者认为语义分割和全景分割可以直接利用人工标注的label进行对比从而评价当前mask的质量;而实例分割在选择mask时评价的是分类置信度,这个并没有人工标注进行参考,因此难以把握。


3. **Panoptic Segmentation Metric**
&emsp;&emsp;用于衡量全景分割效果的指标应具有:完备性;可解释性;简洁性。由是提出了PQ指标,可分为两步:分割匹配、在匹配上进行计算PQ。

3.1 **Segment Matching**
&emsp;&emsp;定义match:预测的segmentation和gt的iou大于0.5,说明两者can match。再结合全景分割的不可重叠性,不难得到:最多只有一个预测的segmentation可以match gt。

3.2 **PQ Computation**
&emsp;&emsp;PQ的计算类似mAP,也是类内求取,然后求类间的平均值,以便不敏感类别不平衡。对于每一类,可以根据gt与预测的segmentation分为三类(下图描述):
![](./img/ch9/9.13-2.png)

TP: 预测为正,实际为正,描述match较好的
FP: 预测为正,实际为负,描述match错的
FN: 预测为负,实际为正,描述没match出来的gt
&emsp;&emsp;通过上述三类可以计算得到PQ值公式:
![](./img/ch9/9.13-3.png)

式中出去FP与FN后,剩下的式子描述的是match的segmentation的平均IoU,加上FP与FN是为了惩罚match失败的分割实例。
有意思的是,对上述式子进行简单的恒等变化:
![](./img/ch9/9.13-4.png)

第一项评价的是match分割的质量,第二项类似于F1得分。因此可以PQ分解为:
$$PQ=SQ*RQ$$

* **Void labels**
gt中可能出现两种像素标注为空的情况:超出类别的像素和模糊不清的像素(难以分类)。在评估结果时,这些空的标签不予以评估。具体而言:
(1)在matching部分,预测出为void的像素会被移出prediction并不参与IoU计算;
(2)matching后,unmatched prediction按照一般情况会计算FP FN,但是对于空标签情况,如果该prediction含有的void像素块超过一定匹配阈值就会被移除,并不算作FP计算得分。

* **Group labels**
有时区分相同语义类别的实例个体标注比较困难,因此有提出组标签的标注方法。但对于PQ计算而言:
(1)matching部分不使用组标签,而是严格区分实例
(2)matching后,对于包含一部分相同类别像素点的unmatched predicted segments,这一部分将被去除并不视作false positives

3.3 **Comparison to Existing Metrics**
* **Semantic segmentation metrics**
衡量语义分割的标准有像素级精度,平均精度,IoU。但是其只专注于像素级的划分,不能反映物体实例级别的分割性能。

* **Instance segmentation metrics**
度量为AP,主要是引入了置信度分数confidence score对检测目标进行打分。(两者不是完全的隔绝,实例分割也有用IoU监督的,而confidence score是否能够反映mask的真实质量也有存疑过,这个标准也不是固定的)

* **Panoptic quality**
PQ的度量可以分解成SQ和RQ,SQ反映了语义分割的像素级IoU性能,RQ专注于检测识别的效果,因此将两者统一到一个框架下。

分割效果:
![](./img/ch9/9.13-5.png)

<br>
<br>
<hr />
TODO

- [ ] 图像分割数据集标注工具
- [ ] 图像分割评价标准
- [ ] 全景分割
- [x] 全景分割
- [ ] UNet++

0 comments on commit 8f7a071

Please sign in to comment.