UNet介绍

作者: 幽并游侠儿_1425 | 来源:发表于2020-07-23 07:34 被阅读0次

    参考链接1
    参考链接2
    参考链接3

    一、语义分割(semantic segmentation)介绍

    1.图像分类(image classification)

    image.png
    1. 分类和定位(classification with localization)
    image.png
    1. 物体检测(object detection)
    image.png
    1. 语义分割(semantic segmentation)
    image.png
    1. 实例分割(instance segmentation)
    image.png

    几个方向的对比:

    对比图

    二、 理解卷积,最大池化和转置卷积

    1. 卷积(convolution)

    一个卷积操作有两个输入
    (I)3D输入图片(NinNinchannels)
    (ii) k个过滤器组成的一个系列(filters/kernels/feature extractors),每个过滤器的尺寸为(ffchannels),f通常为3或5。
    卷积操作的输出为一个三维的volume(也称为feature map或者输出),其尺寸为(NoutNoutk)
    Nin和Nout的关系如下:

    卷积算法

    卷积操作可视化如下:

    image.png

    在上图中,输入的尺寸在773,两个过滤器的尺寸为333,padding为0,步长为2。因此,输出的volume的尺寸为332。

    另一个重要概念为感知域(receptive field)。它是指输入volume中每个filter所看到的部分。在上图中,3*3的蓝色区域为感知域。感知域也常常被称为context。

    receptive field (context) is the area of the input image that the filter covers at any given point of time.

    2. 最大池化操作

    目的:减小feature map的尺寸

    来源: https://www.quora.com/What-is-max-pooling-in-convolutional-neural-networks##)

    最大池化中两个重要的超参数(hyper-parameters):filter的尺寸和步长。

    最大池化的目的是保留每个区域最重要的信息(具有最大值的像素)并且丢弃不重要的信息。这里的”重要“是指,能最好描述图片内容的信息。

    值得注意的是,卷积和池化都能减小图片尺寸,因此他们被称为”下采样(down sampling)“。

    3. 上采样(up sampling)

    如果我们只做下采样,我们只能得到”what“信息,但是损失了”where“信息。为了得到”where"信息,需要对图片进行上采样。
    上采样的方法有:bi-linear interpolation, cubic interpolation, nearest neighbor interpolation, unpooling, transposed convolution, etc
    转置卷积(transposed convolution)是对图片进行上采样时比较被偏爱的方法。

    4. 转置卷积(transposed convolution)

    强烈建议阅读这篇文章

    我自己之前也总结过

    三、UNET的结构

    UNET结构的介绍性文字:

    The architecture contains two paths. First path is the contraction path (also called as the encoder) which is used to capture the context in the image. The encoder is just a traditional stack of convolutional and max pooling layers. The second path is the symmetric expanding path (also called as the decoder) which is used to enable precise localization using transposed convolutions. Thus it is an end-to-end fully convolutional network (FCN), i.e. it only contains Convolutional layers and does not contain any Dense layer because of which it can accept image of any size.

    UNet的结构

    文中输入推按的尺寸是572 * 572 * 3。这里我们用128 * 128 * 3的图片进行举例。

    下图是关于UNET结构的详细介绍:

    image.png

    下面我自己结合参考链接写一些对结构的理解:
    先看decoder部分:

    2@Conv layers是指应用了两个连续的卷积层;
    c1-c5是卷积层的输出,p1-p4是最大池化层的输出;
    进行conv2d layer的filter的channel数目增多,从而增加output的channel数目,但是size不变;
    进行maxpool事后,channel数目不变,但是size减小了一半;
    decoder部分是从128x128x3 到8x8x256。

    1. 参考链接
      overtiling 策略
    2. 参考链接
      边缘像素加权

    参考链接
    这个UNet的降采样一共经历了4层。浅层可以抓取图像的一些简单的信息,比如边界、颜色等。深藏结构因为感受野大了,且经过的卷积操作变多了,会抓取一些抽象特征。

    再看encoder部分:
    每一次转置卷积之后,height和weights都加倍,同时depth(channel数目)减半;
    c6和u6的size相同;
    encoder部分是从8x8x256 到 128x128x3;
    灰色箭头表示复制和剪切操作,可以发现,在同一层左边的最后一层要比右边的第一层要大一些,这就导致了:想要利用浅层的feature,就要进行一些剪切,也导致了最终的输出是输入的中心某个区域;
    长连接(skip connection)的优点:参考链接

    • fight the vanishing gradient problem
    • learns pyramid level feature
    • recover information loss in down sampling
      其他network与长连接(skip connection)相对应的功能:参考链接
    • FCN: use summation
    • U-Net: use concatenation
    • SegNet: use pooling indice instead of skip connection
    • Some generators in GAN have no skip connection

    U-Net中的长连接是有必要的,它联系了输入图像的很多信息,有助于还原降采样所带来的信息损失,在一定程度上,我觉得它和残差的操作非常类似,也就是residual操作,x+f(x)。我不知道大家是否同意这一个观点。因此,我的建议是最好给出一个综合长连接和短连接的方案。

    四、问答环节

    1. 为什么在decoder里要采用双卷积?
    2. 为什么在encoder里要用到decoder中卷积的output,是如何运用的?

    The reason here is to combine the information from the previous layers in order to get a more precise prediction.

    • 在upsampling中使用feature channels能使得context information传播到更高分辨率的层去(更高层的up layer)。
    • 能够通过镜像的方法来推断出丢失信息。
    3. UNet和其他的FCN相比,还有哪些其他的不同?这些改变对结果有什么好处?

    相关文章

      网友评论

        本文标题:UNet介绍

        本文链接:https://www.haomeiwen.com/subject/whqclktx.html