【Paper】Semantic Soft Segmentation 语义软分割

一、研究问题

【Paper】Semantic Soft Segmentation 语义软分割
从标题看,这篇文章研究的是基于语义信息的图像分割。图像分割在这篇文章研究的应用场景中,通俗讲就是抠图。区别于一般用抠图工具(魔术棒、套索工具等)得到的抠图选区,soft segmentation得到的选区是带透明度的,类似PS中的选区羽化。

1.1 Soft Segmentation

【Paper】Semantic Soft Segmentation 语义软分割
每个选区中的像素都是带透明度的,同一个位置的像素在不同选区中的透明度总和为1。论文最终就是要得到一系列的α值。

二、核心想法

The paper constructs a graph that fuses higher-level information coming from a deep network with the local texture information in order to generate soft segments that correspond to semantically meaningful regions in the image.

论文的核心idea就是用图像的高层语义信息和local的颜色信息构建一个Graph,然后运用谱分析Spectral Analysis来分析得到图像中的分割区域信息。

三、背景

3.1 Spectral Matting

The paper uses the same formalism as spectral matting in formulating the soft segmentation task as an eigenvector estimation problem1. The core component of this approach is the creation of a Laplacian matrix L that represents how likely each pair of pixels in the image is to belong to the same segment.

3.1.1 laplacian matrix

【Paper】Semantic Soft Segmentation 语义软分割
上面是一个简单图结构的拉普拉斯矩阵构造过程。其中矩阵D由矩阵A按行加和得到。
从图片构造拉普拉斯矩阵的方法也很简单,就是替换矩阵A的定义方式。

3.1.2 eigenvector estimation problem

【Paper】Semantic Soft Segmentation 语义软分割
定义图像(或者Graph)中的一个连通分量为C,mC中的每个分量表示对应像素点是否属于连通分量C。那么mC则是拉普拉斯矩阵L特征值为0的特征向量。
举一个直观的例子,下图右矩阵运算的结构为0向量:
【Paper】Semantic Soft Segmentation 语义软分割

3.1.3 soft segmentation

【Paper】Semantic Soft Segmentation 语义软分割
得到上一步的特征向量之后,通过线性组合这些特征向量得到最后的分层参数。这里的优化策略是希望生成更多的01向量,也就是说鼓励每个分割图层是全透明或者完全不透明的,但允许出现透明度不为0,1的情况。左上的图是γ=0.9时的图像,源自博客:Spectral Matting 方法的理解

四、论文方法

相比于2008年的《Spectral Matting》,这篇《SSS》主要在两方面做了改进

  • 拉普拉斯的构建方法
  • 特征向量的线性组合方案

4.1 Laplacian构建方案

【Paper】Semantic Soft Segmentation 语义软分割
《SSS》论文中采用的拉普拉斯矩阵选用了Normalized的格式。核心就是三个W矩阵的构建:

  • WL 延用《Spectral Matting》中的matting affinities定义
  • WC定义了nonlocal color affinities
  • WS定义了semantic affinities

4.1.1 matting affinity matrix

They first introduced the matting Laplacian that uses local color distributions to define a matrix L that captures the affinity between each pair of pixels in a local patch, typically 5 × 5 pixels.

4.1.2 nonlocal color affinity matrix

【Paper】Semantic Soft Segmentation 语义软分割

Generate 2500 superpixels using SLIC2 and estimate the affinity between each superpixel and all the superpixels within a radius that corresponds to 20% of the image size.

《SSS》认为原论文的local color affinity定义方式有个很大的缺陷:如果增加窗口大小,则计算开销增大,sparsity减小;如果减小窗口大小,容易错过重要的特征,算法鲁棒性下降。所以《SSS》提供了一个感知区域更大的颜色特征定义方法。
首先是采用了超像素,并且对每个超像素计算与周围20%图像大小范围内的超像素之间的Affinity,因为每个超像素只在质心位置采样一次,所以这个部分能够保持很高的稀疏度。公式中的Cs和Ct表示的都是超像素的平均像素值。erf是高斯误差函数,具有sigmoid形状,将结果映射到[0, 1]。

4.1.3 semantic affinity matrix

【Paper】Semantic Soft Segmentation 语义软分割
semantic affinity matrix与nonlocal color affinity matrix的定义方式类似,都采用了超像素作为结点。区别的是,nonlocal color affinity matrix采用的是neighborhood方式——邻域内计算affinity(20% of the image size),semantic affinity matrix采用的是nearby方式——只在超像素的邻接点计算affinity。
通过预训练的网络为每个像素计算一个128维的特征向量,通过PCA分解压缩到3维,再经过guided filter得到最后在公式中f所应用的3维语义特征

The feature extractor is based on DeepLab-ResNet-1013, but it is trained with a metric learning approach 4 to maximize the L2 distance between the features of different objects.

【Paper】Semantic Soft Segmentation 语义软分割

4.2 特征向量的线性组合策略

4.2.1 Constrained Sparsification

基本沿用08年那篇的pipeline,主要区别是优化α时的初始化策略不同。

  • 计算拉普拉斯矩阵L的100最小特征值对应的特征向量。
  • 对3维语义特征表示的像素做k-means聚类,得到初始分层状态,取γ=0.8对图层参数进行优化,生成40层分割图层。40层中很多图层为0,留下了15-25个有效图层。
  • 对上一步中得到的有效图层做K=5的k-means聚类,得到最终的分割图层。

本论文认为这一步中得到的结果,会具有较多的半透明区域,不是最好的soft segmentation结果,因此还要做进一步的优化。

4.2.2 Relaxed Sparsification

这一步采用能量方程对α值进行优化。每一项的意思都很直观:

  • EL:基础项,满足分割的基本要求。
  • ES:希望颜色梯度小的位置(e.g.分割区域的内部)更多地保持0或1的透明度,颜色梯度大的位置(e.g.分割区域的边界)则不作约束,可以设置任意的透明度。
  • EF:希望新生成的分割图层策略与上一步得到的结果比较接近。
  • EC:放宽透明度之和为1的约束,希望它接近1,但不强制。
    【Paper】Semantic Soft Segmentation 语义软分割

五、结果

放一个我比较喜欢的处理:
【Paper】Semantic Soft Segmentation 语义软分割
其他见论文。

六、局限

  • Runtime for a 640 x 480 image lies between 3 and 4 minutes.
  • Do not generate separate layers for different in stances of the same class of objects.
  • May fail at the initial constrained sparsification step when the object colors are very similar, or the grouping of soft segments may fail due to unreliable semantic feature vectors around large transition regions.
    【Paper】Semantic Soft Segmentation 语义软分割

七、感触

这篇是组会paper reading时候展示的,但被实验室老大嫌弃这篇文章没有在paper reading展示的价值。老大表示,不是说这篇文章做得不好,而是说这篇文章就是在以前的工作上修修补补,基本没什么启发人的东西。希望我们能多分享一些角度独到的论文,在组会的时候听个大概,听个思路,具体细节怎么实现则靠课外直接去读论文来掌握的。更重要的是要从论文中得到启发,然后课外去拓展这种启发和兴趣,最好能自己去动手做一做,改一改,看看能不能用类似的思路定义别的问题的pipeline。这样逐渐积累,最终才能产生自己的论文idea。
深以为然啊。
另外组会上分享的有几篇论文感觉还蛮有趣的,下次可以写一写。(真的会有下次么,写博客好累哦orz


  1. Anat Levin, Alex Rav-Acha, and Dani Lischinski. 2008b. Spectral Matting. IEEE Trans. Pattern Anal. Mach. Intell. 30, 10 (2008), 1699–1712. ↩︎

  2. R. Achanta, A. Shaji, K. Smith, A. Lucchi, P. Fua, and S. Süsstrunk. 2012. SLIC Superpixels Compared to State-of-the-Art Superpixel Methods. IEEE Trans. Pattern Anal. Mach. Intell. 34, 11 (2012), 2274–2282. ↩︎

  3. Liang-Chieh Chen, George Papandreou, Iasonas Kokkinos, Kevin Murphy, and Alan L Yuille. 2017. DeepLab: Semantic Image Segmentation with Deep Convolutional Nets, Atrous Convolution, and Fully Connected CRFs. IEEE Trans. Pattern Anal. Mach. Intell. (2017). ↩︎

  4. Elad Hoffer and Nir Ailon. 2015. Deep metric learning using triplet network. In International Workshop on Similarity-Based Pattern Recognition. ↩︎