语义分割--FCN中的Shift-and-stitch的详解

当网络最后一层输出的 prediciton map sizelabel map size 不匹配时,除了 cropping, resize 等暴力措施,且不采取 bilinear , uppooling, deconvolutiondecoder 结构, 为了实现 dense prediction , 该怎么做呢?

作者在这一段中指出: 为了实现dense prediction ,他们比较了三种不同方案,分别是 shift and stitch, deceasing subsampling,deconvolution。
简单来讲:shift and stitch的做法其实就是:
设降采样因子是f , 通过 shift pixels (平移像素)的方式,产生 f2versioninput ,输入网络后相应地产生 f2output, 然后 stitch(这个词不好翻译,先翻译成串联)所有 output 就实现了 dense prediciton

(1)我们举一个简单的例子来直观地说明 shift and stitch 的做法:

设网络只有一层 2x2 的maxpooling 层,所以下采样因子 f =2, 我们需要对input imagepixels 平移 (x,y)个单位,即将 image 向左平移 xpixels , 再向上平移y个单位,整幅图像表现向左上方向平移,空出来的右下角就以0 padding 。我们当然可以采取 FCN论文中的做法,将图像向右下角平移,空出来的左上角用 0 padding ,这两种做法产生的结果是一致的,没有本质区别。(x,y) 取(0,0), (0,1),(1,0),(1,1) 后,就产生了 f^2^ = 4input


4input分别进行 2x2 的maxpooling 操作后,共产生了4output,灰色区域代表 4个 output 中 值重复的区域:如黄色 output 中的第三列与红色 output 的第三列值重复,所以标为灰色,绿色 ouput 中的第三行与红色 ouput 中的第三行值重复,所以也标为灰色,蓝色output中的第三行与黄色 ouput中的第三行值重复,第三列与绿色output的第三列值重复,亦标位灰色。

最后,stitch the 4 different output 获得 dense prediction :


(2)怎样进行 stitch 的呢?


FCN中:Process each of these f2 inputs, and interlace the outputs so that the predictions correspond to the pixels at the centers of their receptive fields

说的很明白了,output 中的每个pixel都对应 original image 的不同 receptive field,将receptive field 的中心c填上这个来自outputpixel值,就是网络对original image 中像素 cprediction


为表述简洁,我用 “ 像素 i ” 表示“ 值为 i 的像素 ”

  • 红色 output中的像素1对应shifted input``(0,0) 的红色部分, 而对应 original image 的部分,也即receptive field仅仅为像素[1], 所以 receptive field 的中心为像素[1], 该位置填上红色output中像素 1 的值。

  • 黄色 output 中的像素4 对应 shifted input (1,0)的黄色部分, 而对应 original image 的部分,也即receptive field为像素 [3,4] , 所以 receptive field 的中心为像素[4], 该位置填上黄色output中像素 4 的值。

  • 以此类推..

到此就完成了对FCN论文中的 Shift-and-stitch 的详尽解释。

参考:
关于FCN 论文中的 Shift-and-stitch 的详尽解释

https://www.jianshu.com/p/e534e2be5d7d


  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值