Print

发布时间: 2022-12-16
摘要点击次数:
全文下载次数:
DOI: 10.11834/jig.210359
2022 | Volume 27 | Number 12




    图像理解和计算机视觉    




  <<上一篇 




  下一篇>> 





多尺度条形池化与通道注意力的图像语义分割
expand article info 马吉权1, 赵淑敏1, 孔凡辉2
1. 黑龙江大学计算机科学与技术学院,哈尔滨 150080;
2. 黑龙江大学数据科学与技术学院,哈尔滨 150080

摘要

目的 针对自然场景下图像语义分割易受物体自身形状多样性、距离和光照等因素影响的问题,本文提出一种新的基于条形池化与通道注意力机制的双分支语义分割网络(strip pooling and channel attention net,SPCANet)。方法 SPCANet从空间与内容两方面对图像特征进行抽取。首先,空间感知子网引入1维膨胀卷积与多尺度思想对条形池化技术进行优化改进,进一步在编码阶段增大水平与竖直方向上的感受野;其次,为了提升模型的内容感知能力,将在ImageNet数据集上预训练好的VGG16(Visual Geometry Group 16-layer network)作为内容感知子网,以辅助空间感知子网优化语义分割的嵌入特征,改善空间感知子网造成的图像细节信息缺失问题。此外,使用二阶通道注意力进一步优化网络中间层与高层的特征选择,并在一定程度上缓解光照产生的色差对分割结果的影响。结果 使用Cityscapes作为实验数据,将本文方法与其他基于深度神经网络的分割方法进行对比,并从可视化效果和评测指标两方面进行分析。SPCANet在目标分割指标mIoU(mean intersection over union)上提升了1.2%。结论 提出的双分支语义分割网络利用改进的条形池化技术、内容感知辅助网络和通道注意力机制对图像语义分割进行优化,对实验结果的提升起到了积极作用。

关键词

图像分割; 注意力; 条形池化; 膨胀卷积; 感受野

Semantic image segmentation by using multi-scale strip pooling and channel attention
expand article info Ma Jiquan1, Zhao Shumin1, Kong Fanhui2
1. School of Computer Science and Technology, Heilongjiang University, Harbin 150080, China;
2. School of Data Science and Technology, Heilongjiang University, Harbin 150080, China
Supported by: Natural Science Foundation of Heilongjiang Province, China(LH2021F046)

Abstract

Objective Real-scenario image semantic segmentation is likely to be affected by multiple object-context shapes, ranges and illuminations. Current semantic segmentation methods have inaccurate classification results for pedestrians, buildings, road signs and other objects due to their small scales or wide ranges. At the same time, the existing methods are not distinguishable for objects with chromatic aberration, and it is easy to divide the same chromatic aberration-derived object into different objects, or segment different objects with similar colors into the same type of objects. In order to improve the performance of semantic image segmentation, we facilitate a new dual-branch semantic segmentation network in terms of strip pooling and attention mechanism (strip pooling and channel attention net (SPCANet)). Method the SPCANet can be used to extract the features of images via spatial and content perceptions. First, we employ the spatial perception Sub-net to augment the receptive field in the horizontal and vertical directions on the down-sampling stage by using dilated convolution and strip pooling with multi-scale. Our specific approach is focused on adding four parallel one-dimensional dilated convolutions with different rates to the horizontal and vertical branches on the basis of strip pooling model (based on the pooling operation which kernel size is n × 1 or 1 × n), which enhance the perception of large-scale objects in the image. Nextly, in order to improve the content perception ability of the model, we use the pre-trained VGG16 (Visual Geometry Group 16-layer network) based on ImageNet dataset as the content-perception sub-net to optimize the embedded features of semantic segmentation via spatial-perception assisted sub-net. The content sub-net can strengthen feature representation in combination with the spatial perception subnet. In addition, the second-order channel attention is used to optimize the feature assignment further between the middle and high-level layers of the network. In the network training period, the target information is focused and assigned a larger weight, and irrelevant information is suppressed and a smaller weight is assigned. By this way, the correlation is activated in the embedding features. To enhance the expression of image channel information, we use covariance and gating mechanism to achieve the second-order channel attention. Our model can be demonstrated sequentially 1) a three-channel color image is as input, 2) the spatial-based and content-oriented sub-nets are transmitted for feature encoding in the embedded space, 3) the two sets of features are fused (using the method of feature fusion for concatenate), and 4) the fused features are sent to a prediction module (head) for classification and the segmentation task. Result We use the popular benchmarks (Cityscapes) as the testing data and our results are compared with other deep neural network-based methods (including the existing network published on the Cityscapes official website and the network based on local reproduction from GitHub). We evaluate the performance qualitatively and quantitatively. The qualitative analysis is carried out by means of visual analysis and the experiment is analyzed quantitatively by public popular metrics. 1) From the perspective of the visualization of the segmentation results, the method proposed in this paper has a strong perception of wide-range objects in the image, and the overall segmentation effect is improved obviously; 2) the metrics of segmentation can reflect the result of the experiment as well. Through the experimental data found that the commonly-used metrics such as accuracy (Acc) and the mean intersection over union (mIoU) are significantly improved. The mIoU is increased by 1.2%, and the Acc is increased by 0.7%. The Ablation studies validated the effectiveness of our modules. Among them, the improved strip pooling module has a more obvious improvement effect on the segmentation result. Under the same experimental circumstances based on batch-train dataset with an input size of 512×512×3, the mIoU can be improved by 4%, and then change the input size to 768 under the same experimental conditions, the mIoU is improved by 5%. The use of second-order channel attention makes the model more sensitive to the chromatic aberration part in the image during the training process. From the visualization results based on the Cityscapes batch-train dataset, the classification result such as pedestrians is improved obviously. The stability of other classification needs to be strengthened further. In the selection of content-perception subnet, we use three pre-trained networks on the ImageNet as candidates, including VGG16, ResNet101 and DenseNet101. The pre-trained VGG16 as the content-perception sub-net can achieve the best performance. The supplementary use of content-perception sub-net enhances the information representation ability of feature maps. Conclusion We develop the image semantic segmentation algorithm in the context of attention mechanism, multi-scale strip pooling and feature fusion. To optimize our image semantic segmentation, it is harnessed by an improved strip pooling technology (the receptive field augmentation with no more parameters), second-order channel attention (channels-between information) and content perception auxiliary network. Our model can clarify the circumstances of inaccurate segmentation caused by multi-scale segmentation of objects. Our joint model with receptive fields and channel information is beneficial to the semantic image segmentation in the real scenario. To reduce the labor cost in data labeling, it can be extended to learn a more generalizing semantic image segmentation neural network through weakly supervised or unsupervised mode further.

Key words

image segmentation; attention; strip pooling; atrous convolution; receptive field

0 引言

图像语义分割是计算机视觉领域经典的研究课题。全卷积神经网络(fully convolutional networks,FCN)(Long等,2015)的提出拓宽了基于深度神经网络的研究方法在图像分割领域的视野,该网络将卷积神经网络(convolutional neural network,CNN)(LeCun等,1989)中的全连接层全部替换为卷积层,并在此基础上使用softmax函数对每个像素进行分类以完成图像分割。同年提出的U-Net(Ronneberger等,2015)在解码阶段使用多尺度特征融合的方式(concatenate)形成多通道特征图,提升了图像分割质量。随后,涌现出众多基于深度学习的图像语义分割模型,进一步提升了图像分割任务的效果。包括基于FCN/U-Net网络结构优化的方法(如3D UNet(Çiçek等,2016))、基于多尺度感知获得图像特征信息的方法(如DeepLabV1-V4(Chen等,2018b)和郭彤宇等人(2019)方法)、基于注意力机制的方法(如dual attention network(Fu等,2019))和基于网络参数优化及半监督的分割方法(如MobileNets(Howard等,2017))等。常见的基于以上4种方法分类的图像分割网络如图 1所示。

图 1 常见的图像分割网络分类
Fig. 1 Summary of common image segmentation networks

现有语义分割网络在复杂场景下容易对图像中有色差或图像中占有区域广、跨度大的物体产生错误的划分结果。针对这些问题,本文提出一种新的基于改进的条形池化与通道注意力机制的双分支语义分割网络(strip pooling and channel attention net,SPCANet)。该网络从空间和内容两方面对输入图像进行特征提取,并通过注意力机制实现对特征权重的重分配,提高特征表达能力。本文创新点如下:1)在空间感知子网中使用改进的条形池化技术(strip atrous block,SA Block),进一步在编码阶段增大水平与竖直方向上的感受野,提高对图像区域中跨度较大物体的感知能力。2)使用二阶通道注意力(second-order channel attention,SOCA)优化通道特征选择,一定程度减少了色差导致的图像分割错误。3)使用在ImageNet数据集上预训练好的VGG16(Visual Geometry Group 16-layer network)(Simonyan和Zisserman,2015)作为内容感知子网,以辅助空间感知子网优化语义分割的嵌入特征。4)SPCANet在Cityscapes数据集上的目标分割指标mIoU(mean intersection over union)与backbone相比提升了1.2%。消融性实验表明,本文提出的各种改进成分在分割任务中均起到了积极作用。

1 基于注意力和特征融合的图像分割方法介绍

1.1 基于注意力的图像分割方法

引入注意力机制的目的是根据某种关系对神经网络提取的不同层次的特征进行权重分配,以提升网络的特征表达能力。常见的注意力实现方式包括通道注意力和空间注意力两类,实现方法的简要展示如图 2所示。其中,通道注意力使用简单的全局平均池化来实现,空间注意力则通过计算特征的自相似性来获取其空间依赖关系,从而实现注意力分配。如今,注意力机制广泛应用于图像分类、图像修复及图像分割等诸多深度学习网络中(Vaswani等,2017)。其中,SENet(squeeze-and-excitation networks)(Hu等,2018)使用池化、全连接及门控机制形成通道注意力,提高通道特征信息的表达能力。该网络提出的SE Block是一种即插即用的模块化结构,可以方便地嵌入到其他神经网络中,如SE-Inception、SE-ResNet。Fu等人(2019)将基于上下文的空间信息引入图像分割网络,提出双重注意网络(dual attention network,DA-Net),通过矩阵转置及矩阵乘运算探索空间自相似性和特征在通道维度上的依赖关系。在金字塔注意力网络(pyramid attention network,PAN)(Li等,2018a)中,进一步将注意力机制应用于上采样过程,采用全局注意力上采样模块(global attention upsample,GAU)将高层次特征生成的全局上下文信息依次经过卷积、批量归一化和非线性变换等操作后与低层次特征相乘,最后将高层次特征与加权后的低层次特征相加并进行上采样。OCNet(object context network)(Yuan和Wang,2021)、DA-Net(dual attention network)(Fu等,2019)和CCNet(criss-cross attention network)(Huang等,2019)则利用非局部(non-local)思想来聚合远程空间信息。该类方法可以捕获图像中的长距离依赖关系,在计算某个位置的响应特征时,会计算该位置与图中其他所有像素点的相似度,并根据这个相似度值进行加权计算作为该位置的输出来实现注意力的权重分配。

图 2 通道注意力与空间注意力示意图
Fig. 2 Sketch of channel attention and spatial attention

本文提出的图像语义分割网络采用了两种注意力机制。一种是基于二阶特征的通道注意力,在使用协方差保留通道间关联关系的基础上,进一步使用门控开关来调整各通道的权重比例关系;另一种是基于改进后条形池化技术的空间注意力,这种注意力可以进一步增大在水平和竖直方向上的感受野,同时提高对图像中大尺度物体的感知度,并针对性的重新分配注意力权重,使这些大尺度物体的特征在学习过程中获得更大的关注度。

1.2 基于特征融合的图像分割方法

特征融合广泛应用于计算机视觉领域。为了解决图像中目标物体形状、颜色及亮度等多样性导致分割不准确问题,本文提出了基于条形池化和通道注意力的双分支分割网络,并引入特征融合来增强图像细节信息的表达。

现有的特征融合大部分基于多尺度思想实现。例如,使用并行的、不同大小的卷积或池化在特征提取后进行融合,或将具有抽象语义的高层特征图与具有更多图像细节的低层特征进行特征融合。图 3是多尺度及特征融合思想的示意图,这样的设计思路可以从多个尺度感知图像物体,从而增强图像细节信息的表达。DeepLabV2(Chen等,2017)引入空洞空间金字塔池化(atrous spatial pyramid pooling,ASPP)概念,使用多个并行的、具有不同大小感受野的卷积或池化操作来提取特征图信息以实现多尺度特征表达。类似地,PSPNet(pyramid scene parsing network)(Zhao等,2017)和RFBNet(receptive field block net)(Liu等,2018)也采用这样的思路进一步提高了分割质量。DeepLabV3在将多尺度应用于下采样阶段的同时,将特征融合的思路引入上采样阶段,进一步优化了网络结构。

图 3 两种常用的多尺度特征融合方法
Fig. 3 Commonly used multi-scale feature fusion methods
((a) spatial pyramid pooling module; (b) encoder-decoder multi-scale feature fusion)

本文提出的SPCANet引入了多尺度思想。首先利用改进后的条形池化技术进一步增大感受野,然后在此基础上从多个尺度对图像特征进行提取并融合。此外,使用内容感知子网增强对图像内容的感知,进一步提升后续特征融合阶段的图像特征表达能力。

2 方法

SPCANet的网络结构如图 4所示。网络输入为三通道彩色图像,将该输入图像分别送入空间感知子网和内容感知子网进行编码,获得嵌入空间的特征表达,然后采用concatenate特征融合方式对这两组特征进行融合。将融合后的特征图送入分类预测模块(head模块)进行分类;此时的输出已经是完成分类后、尺寸为输入图像1/8大小的分割图,最后使用最邻近插值法将图像恢复成原始图像大小作为最终的分割结果。

图 4 SPCANet网络结构图
Fig. 4 The structure of SPCANet

该网络旨在解决3个问题。1)采用改进后的条形池化技术SA Block,在1维的水平和竖直方向上拥有更大的感受野,增强对图像中大尺度物体的感知度,以解决在复杂场景下物体被错误分类问题;2)使用二阶通道注意力机制,进一步利用通道之间的关联关系对通道信息进行特征优化选择;3)通过引入特征融合的思想,利用内容感知子网Sub_VGG16改善由于空间感知子网更关注单维方向上的感受野导致的特征提取特异性问题。

2.1 改进的条形池化技术

受条形池化(strip pooling)(Hou等,2020)的启发,本文在条形池化技术的基础上结合多尺度思想加入并行的1维膨胀卷积,以进一步增大在水平及竖直方向上的感受野。具体实现过程如图 5所示。该模块将输入的特征图同时送入两个子分支进行不同维度(水平和竖直方向)的编码。在水平方向上,首先使用1×$n$的池化操作将特征图变换成形状为$n$×1的特征表示,这里$n$为模块输入特征图($n$×$n$)的尺寸。在此基础上,使用一组并行的膨胀卷积对特征图进行特征提取,膨胀率的选择借鉴了DeepLabV3(Chen等,2017)中ASPP的经验:随着特征图尺寸的减小,过大的膨胀率反而不利于提取到特征中更有效的图像特征,综合考量之后,将膨胀率(rate)设定为[0, 6, 12, 18]。该设计可以在不增加额外参数的情况下进一步增大在水平方向上的感受野,同时从多个尺度感知水平方向上的物体。之后,将这些并行分支产生的特征图采用concatenate特征融合方式进行特征融合,并使用最邻近插值法将$n$×1的特征图恢复至该模块输入时的尺寸大小。竖直方向上的做法与水平方向类似。使用$n$×1的池化操作将特征图变换成形状为1×$n$的特征表示,在此基础上,使用一组并行的膨胀卷积进行特征提取并融合,在填充之后得到竖直方向上的图像特征。在得到水平与竖直方向上的特征后,将这两个分支的结果通过加操作来完成特征融合,实现水平与竖直方向上的特征叠加。最后将叠加后的特征图送入1×1的卷积中进行特征调整,使用sigmoid函数将输出值映射到(0, 1),随后与原始输入相乘形成水平和竖直方向叠加后的权重分配。

图 5 改进后的条形池化模块
Fig. 5 Revised strip atrous block

2.2 二阶通道注意力机制

二阶通道注意力机制最先应用于图像的超分辨率领域,是一种参数较少且方便嵌入及调用的特征模块。该注意力机制是基于SE Block提出的。SE Block中的通道注意力是通过一阶统计信息(使用全局平均池化,将每张特征图用一个值表征)来实现的。本文通过基于协方差与全局池化的二阶特征统计实现通道特征加权。

在数学角度上,协方差可以用来描述变量之间的相关性。对于$H \times W \times C$的图像特征,可以将其维度转换为$WH \times C$,用协方差矩阵来描述$C$个通道之间的相关性。与传统一阶注意力机制的全局平均池化操作相比,该注意力通过使用二阶特征统计自适应地重新标定通道特征(按重要程度分配不同的权重),获得更具有区分性的特征表示,捕获优于一阶注意力的统计特征。二阶通道注意力模块的结构如图 6所示。该模块的输入是一组特征图,使用协方差对输入特征图的通道关系进行关联性表示后进行特征选择,相关操作与SE Block类似。具体做法如下:将协方差处理后得到的关联性结果送入一个池化函数中进行特征转换,并使用两个卷积层进行特征调整(这两个卷积层中间使用ReLU(rectified linear unit)来增加非线性),此后,通过函数sigmoid实现门控机制,动态地学习通道权重$W$。最后将学习到的权重$W$与该模块的输入相乘得到加权后的特征输出$F$

图 6 二阶通道注意力模块图
Fig. 6 SOCA Block

图 6中,${H_{{\rm{GCP}}}}$表示协方差池化函数,${H_{{\rm{GCP}}}}$的具体实现方式为

$ {\mathit{\boldsymbol{z}}_c} = {H_{GCP}}\left({{\mathit{\boldsymbol{y}}_c}} \right) = \frac{1}{c}\sum {{y_c}} (i) $ (1)

式中,${{\mathit{\boldsymbol{y}}_c}}$是使用协方差关联通道之间特征后的输出结果。

${W_D}$${W_U}$均为1×1的卷积层,其通道数分别为$c/r$$c$。SE Block中$r$的设定为16,但为了较大程度获取通道间关联性,尝试将$r$设定为8。实验发现,当$r$=8时,实验结果相对较好,最终确定$r$值为8。$\mathit{\boldsymbol{w}}$是门控开关后得到的各通道权重分配,具体实现为

$ \mathit{\boldsymbol{w}} = f\left({{W_U}\delta \left({{W_D}\mathit{\boldsymbol{z}}} \right)} \right) $ (2)

式中,$f$()和$\delta $()分别代表sigmoid和ReLU函数。该模块在得到$\mathit{\boldsymbol{w}}$后,与输入时的特征图对应相乘,得到模块最终的输出结果。

2.3 内容感知子网

本文网络模型借助内容感知辅助子网提升特征的内容表达能力,弥补由于空间感知子网更关注长条状感受野导致的图像内容特征信息的缺失。

在内容感知辅助子网结构的选择上,将3种在ImageNet数据集上预训练好的网络作为候选项,分别是VGG16(Simonyan和Zisserman,2015)、ResNet101(He等,2016)和DenseNet101(Huang等,2017)。实际使用过程中,对网络的编码部分进行了截取,以保证在特征融合时其特征图尺寸与空间感知子网的特征图尺寸一致。对基于以上3种网络结构的空间感知子网模型进行消融性实验,发现使用VGG16作为内容感知子网的效果最佳。最终选择在ImageNet数据集上预训练好的VGG16的前10层(10层卷积与3次池化操作)作为内容感知子网。

2.4 预测分类模块(Head)

在图像分割或分类网络中,获取高层特征后,会将特征图送入一个分类预测模块(Head)中进行分类。SPCANet选择延用SPNet中的Head模块,模块参数部分未做修改。该Head包括一个简单的通道降维、5个并行的卷积和池化操作。其内部卷积尺寸分别为3、1×3和3×1,池化操作的尺寸对应为1、12、20、1×$n$$n$×1(后期通过最邻近插值法将输出恢复至原尺寸大小),这里的池化操作是为了能在提取了较高语义特征的特征图上,进一步捕捉像素之间的依赖性。最后使用分类函数对像素进行分类。需要注意的是,在Head中已经完成了对像素的分类,但是此时的输出分割结果尺寸为原始图像的1/8。在Head模块之后,通过最邻近插值法恢复其图像大小,得到最后的图像语义分割结果。

3 实验

3.1 实验运算及参数说明

SPCANet模型在2块2080Ti的GPU上进行训练,使用框架为pytorch。网络训练过程中,将输入图像尺寸调整为768×768像素(原始图像为1 024×2 048像素,SPNet模型的图像输入大小即为768×768像素,为了能较好地对比两者的输出,控制训练参数,将本文模型的图像输入定为768×768像素),同时使用旋转、随机高斯模糊、水平随机翻转等方式进行数据增强。该网络的损失函数采用交叉熵损失,并将SGD(stochastic gradient descent)作为优化器。初始学习率设置为0.005,momentum为0.9,权重衰减值设置为0.000 1,该类参数均采用经验值作为默认值。并使用poly的学习率策略以加快收敛速度($power$为0.9,DeepLabV2及PARSENET均采用这种学习策略),其迭代策略为

$ R = {\left({1 - \frac{i}{{{i_{\max }}}}} \right)^{\mathit{power}}} $ (3)

式中,$R$为学习率衰减因子,$i$为当前迭代次数,${{i_{\max }}}$为最大迭代次数,${\mathit{power}}$为指数控制因子。

3.2 数据集

Cityscapes数据集共有5 000幅基于汽车驾驶场景的高分辨率图像,其中训练集2 975幅、验证集500幅、测试集1 525幅,记录了50个不同城市的街道场景。该数据集共有19个类别的密集像素标注(97%覆盖率)。此外,Cityscapes数据集有fine和coarse两套评测标准,前者提供5 000幅精细标注的图像,后者提供5 000幅精细标注外加20 000幅粗糙标注的图像。SPCANet使用精细标注的图像标签进行训练。

3.3 实验结果

3.3.1 实验结果对比

表 1为Cityscapes测试集在各网络模型上的预测结果,为杜绝恶意刷指标现象,官网未提供该数据集test部分的真实标注(ground truth),所以测试集指标需要将模型的输出结果打包上传至官网以获取最终的指标结果。表中指标值均为Cityscapes数据集官网提供。

表 1 不同方法在Cityscapes测试集上的结果展示
Table 1 Results of different methods on Cityscapes test set  

下载CSV
/%
网络 mIoU iIoU IoU 发表
EKENet 74.3 44.1 87.2 IEEE’2021
Ladder DenseNet 74.3 51.6 89.7 IEEE’2020
SwiftNetRN-18 pyramid 74.4 48.4 89.5 CVPR’2019
FoveaNet 74.1 52.4 89.3 ICCV’2017
RefineNet 73.6 47.2 87.9 CVPR’2017
Deep Layer Cascade (LC) 71.1 47 88.1 CVPR’2017
DeepLabV2-CRF 70.4 42.6 86.4 IEEE’2016
MobileNetV2Plus 70.7 46.8 87.6 -
本文 74.8 51.8 89.9 -
注:加粗字体表示各列最优结果。“-”表示暂未明确发布的模型。IoU:intersection over union, mIoU:mean IoU, iIoU:instance IoU。

此外,实验选择一些相关度较高的网络模型复现并进行对比。由于本文网络是基于条形池化技术、注意力机制和特征融合的语义分割网络,在复现其他模型时,针对性地选择了经典网络结构U-Net、提出条形池化模块的SPNet、基于注意力的SENet和特征融合提取网络PSPNet,对比结果如表 2所示。

表 2 各类网络在Cityscapes验证集上的实验对比
Table 2 Comparison with others networks on Cityscapes val set

下载CSV
网络 输入尺寸 epoch mIoU mAcc allAcc
U-Net 512 180 0.443 9 0.503 5 0.936 3
SENet 512 180 0.497 1 0.594 1 0.912 9
PSPNet 512 200 0.636 3 0.718 7 0.949 8
SPNet 768 180 0.717 4 0.804 7 0.961 1
本文 768 180 0.723 1 0.809 1 0.961 8
注:加粗字体表示各列最优结果。mAcc:mean accuracy, allAcc:all accuracy。

需要说明的是,复现网络模型采用的代码均为在GitHub中寻找的网络模型源码。将这些源码下载后进行调试训练,部分网络在复现过程中受参数及训练环境的影响无法完全复现其真实效果,指标值相对较低,表 2仅供参考。

图 7为本文网络在Cityscapes验证集上与其他网络模型的分割结果对比。图中蓝色框为提升效果较为明显部分。在第1组对比图中,SPCANet对蓝色框中较小区域的黄色路标进行了有效识别,这类物体易在光照影响下出现一定色差,从而导致分割错误;在第2组对比图中,SPCANet较为清晰地将长条状的交通标识和栏杆(灰色标注部分)分割出来,行人(红色标注部分)的轮廓也清晰准确。道路和建筑这类在图像中占有区域广、跨度大的物体,容易受距离影响而导致分割错误,在第3组和第4组对比图中,道路(粉色部分)和建筑的分割精准度也有明显提升。

图 7 SPCANet在Cityscapes数据集上与其他网络模型的分割结果对比
Fig. 7 Comparison of the segmentation resultson on Cityscapes between SPCANet and other models
((a)input images; (b)ground truth; (c)PSPNET; (d)SPNET; (e)ours)

图 8展示了本文方法在Cityscapes测试集的分割效果。可以看出,交通信号牌、信号灯、行人和篱笆等物体被较为清晰完整地标记出来,图像整体分割质量较高。

图 8 Cityscapes测试集实验结果图
Fig. 8 Experimental results of Cityscapes test set
((a) input images; (b) output results)

3.3.2 消融性对比

为了对引入的3个模块组件进行有效性分析,实验在原backbone的基础上,采用从无到有的方式依次对3个组件进行有效性验证,对比结果如表 3所示。

表 3 不同模块的消融性分析
Table 3 Ablation analysis on different models

下载CSV
网络 输入尺寸/像素 mIoU mAcc allAcc
backbone 512×512 0.453 5 0.550 0 0.902 0
backbone 768×768 0.471 3 0.565 2 0.916 4
backbone+ SA Block 512×512 0.499 0 0.613 8 0.904 3
backbone+ SA Block 768×768 0.545 2 0.640 1 0.937 4
backbone+SOCA_IN 512×512 0.439 9 0.545 4 0.896 5
backbone+SOCA_LA 512×512 0.463 6 0.583 8 0.893 3
backbone+SOCA_LA 768×768 0.477 5 0.575 5 0.903 9
backbone+VGG16+SOCA 512×512 0.489 1 0.607 6 0.902 5
backbone+ResNet101+ SOCA 512×512 0.327 7 0.441 7 0.831 0
backbone+DenseNet101+ SOCA 512×512 0.418 9 0.504 0 0.894 9
注:SOCA_IN为将SOCA模块放在空间感知子网络各layer内部位置的情况,SOCA_LA为将SOCA模块放在空间感知子网络各layer结束后的位置情况。

消融性对比实验采用小批量数据集进行。在Cityscapes数据集中随机抽取520幅图像作为训练数据,187幅图像作为验证数据。在消融性实验中,分别将图像裁剪为768 × 768像素和512 × 512像素送入网络。同时,为了防止小数据集训练导致欠拟合,在训练过程中增加了相应的迭代次数,设定其epoch值为360,单卡训练的batch_size值为1。

Backbone的基础结构采用SPNet的基础网络结构,即Resnet101为基准(bn1层略有调整),其4个layer后分别添加了条形池化模块(SPBlock),并且在编码后使用分类模块(head)进行分类。

为了进一步对改进后条形池化技术SA Block的有效性进行研究,对19种分类中每一类物体的精准度进行比较,具体指标结果如表 4所示。从指标IoU和Acc的变化中可以发现,人行道、交通信号灯、交通标志、行人和载重汽车的正确率明显提高。

表 4 Cityscapes不同类别物体的结果分析
Table 4 Segmentation results analysis of Cityscapes in different kinds of objects

下载CSV
类别 Id source IoU source Acc source+SA Block IoU source+SA Block Acc
road 0 0.960 4 0.974 6 0.978 0 0.987 5
sidewalk 1 0.508 9 0.706 0 0.654 6 0.801 2
building 2 0.818 3 0.921 0 0.852 9 0.926 9
wall 3 0.077 9 0.085 2 0.149 1 0.175 1
fence 4 0.151 0 0.240 3 0.185 9 0.240 1
pole 5 0.368 5 0.489 7 0.440 0 0.572 5
traffic light 6 0.384 9 0.433 3 0.506 5 0.599 3
traffic sign 7 0.537 8 0.599 2 0.664 0 0.754 6
vegetation 8 0.867 5 0.944 1 0.893 1 0.965 4
terrain 9 0.260 8 0.328 0 0.361 6 0.446 3
sky 10 0.873 3 0.929 2 0.883 3 0.937 1
person 11 0.589 1 0.750 7 0.675 3 0.835 8
rider 12 0.380 0 0.545 3 0.428 7 0.601 1
car 13 0.787 9 0.929 2 0.867 3 0.942 3
truck 14 0.165 0 0.179 5 0.303 1 0.405 3
bus 15 0.347 3 0.355 6 0.437 1 0.447 9
train 16 0.192 7 0.348 8 0.277 9 0.456 5
motorcycle 17 0.159 7 0.209 7 0.194 1 0.244 2
bicycle 18 0.523 2 0.768 8 0.605 5 0.822 2
注:加粗字体表示准确率明显提高,source IoU和source Acc指本文方法未加SA Block时的IoU和Acc值。

图 9为SA Block使用对比图,展示了基础backbone模型(输入尺寸为768×768像素)和在backbone基础上添加SA Block模型(输入尺寸分别为512×512像素和758×758像素)的输出结果。可以看出,人行道、行人和载重汽车的可视化结果更为明显,与表 4的结论相同。

图 9 SA Block使用对比图
Fig. 9 Comparison chart of SA Block usage
((a) input image; (b) basic backbone; (c) add SA Block(512×512);(d) add SA Block(768×768))

图 10为SOCA Block使用对比图,展示了基础backbone模型(输入尺寸为768×768像素)和在backbone基础上添加SOCA模型(输入尺寸分别为512×512像素和758×758像素)的输出结果。从结果图中可以发现,相关图像细节分类及准确度均有所提高。

图 10 SOCA Block使用对比图
Fig. 10 Comparison chart of SOCA Block
((a) input image; (b) basic backbone; (c) add SOCA block(512×512);(d) add SOCA block)(768×768)

4 结论

本文探索了优化的条形池化技术SA Block、二阶通道注意力机制SOCA以及基于内容感知子网的特征融合对语义图像分割的作用。实验表明,SA Block增大了图像感受野,并对在图像中占有区域广、跨度大的物体具有较好的感知度;通道注意力的使用可以进一步利用图像间的通道信息提升物体分割质量,在一定程度上减少了光照导致的分割错误;同时,使用内容感知子网进行特征融合可以最大程度地保留图像的原始细节特征,使模型的整体分割精度得到进一步提升。

在后续研究工作中,计划通过弱监督或无监督的训练方式减少模型对数据的依赖性。同时,希望借鉴光谱及色相的概念,进一步缓解由于色差导致的分割问题,提高算法模型的容错性及可移植性,争取探索到更加准确且高效的分割算法。

参考文献

  • Chen L C, Papandreou G, Kokkinos I, Murphy K, Yuille A L. 2018a. DeepLab: semantic image segmentation with deep convolutional nets, atrous convolution, and fully connected CRFs. IEEE Transactions on Pattern Analysis and Machine Intelligence, 40(4): 834-848 [DOI:10.1109/TPAMI.2017.2699184]
  • Chen L C, Papandreou G, Schroff F and Adam H. 2017. Rethinking atrous convolution for semantic image segmentation[EB/OL]. [2021-05-15]. https://arxiv.org/pdf/1706.05587.pdf
  • Chen L C, Zhu Y K, Papandreou G, Schroff F and Adam H. 2018b. Encoder-decoder with atrous separable convolution for semantic image segmentation//Proceedings of the 15th European Conference on Computer Vision. Munich, Germany: Springer: 831-851[DOI: 10.1007/978-3-030-01234-2_49]
  • Çiçek Ö, Abdulkadir A, Lienkamp S S, Brox T and Ronneberger O. 2016. 3D U-Net: learning dense volumetric segmentation from sparse annotation//Proceedings of the 19th International Conference on Medical Image Computing and Computer-Assisted Intervention. Athens, Greece: Springer: 424-432[DOI: 10.1007/978-3-319-46723-8_49]
  • Fu J, Liu J, Tian H J, Li Y, Bao Y J, Fang Z W and Lu H Q. 2019. Dual attention network for scene segmentation//Proceedings of 2019 IEEE/CVF Conference on Computer Vision and Pattern Recognition. Long Beach, USA: IEEE: 3141-3149[DOI: 10.1109/CVPR.2019.00326]
  • Guo T Y, Wang B, Liu Y, Wei Y. 2019. Multi-channel fusion separable convolution neural networks for brain magnetic resonance image segmentation. Journal of Image and Graphics, 24(11): 2009-2020 (郭彤宇, 王博, 刘悦, 魏颖. 2019. 多通道融合可分离卷积神经网络下的脑部磁共振图像分割. 中国图象图形学报, 24(11): 2009-2020) [DOI:10.11834/jig.190043]
  • He K M, Zhang X Y, Ren S Q and Sun J. 2016. Deep residual learning for image recognition//Proceedings of 2016 IEEE Conference on Computer Vision and Pattern Recognition. Las Vegas, USA: IEEE: 770-778[DOI: 10.1109/CVPR.2016.90]
  • Hou Q B, Zhang L, Cheng M M and Feng J S. 2020. Strip pooling: rethinking spatial pooling for scene parsing//Proceedings of 2020 IEEE/CVF Conference on Computer Vision and Pattern Recognition. Seattle, USA: IEEE: 4002-4011[DOI: 10.1109/CVPR42600.2020.00406]
  • Howard A G, Zhu M L, Chen B, Kalenichenko D, Wang W J, Weyand T, Andreetto M and Adam H. 2017. Mobilenets: efficient convolutional neural networks for mobile vision applications[EB/OL]. [2021-05-15]. https://arxiv.org/pdf/1704.04861.pdf
  • Hu J, Shen L and Sun G. 2018. Squeeze-and-excitation networks//Proceedings of 2018 IEEE/CVF Conference on Computer Vision and Pattern Recognition. Salt Lake City, USA: IEEE: 7132-7141[DOI: 10.1109/CVPR.2018.00745]
  • Huang G, Liu Z, Van Der Maaten L and Weinberger K Q. 2017. Densely connected convolutional networks//Proceedings of 2017 IEEE Conference on Computer Vision and Pattern Recognition. Honolulu, USA: IEEE: 2261-2269[DOI: 10.1109/CVPR.2017.243]
  • Huang Z L, Wang X G, Huang L C, Huang C, Wei Y C and Liu W Y. 2019. CCNet: Criss-cross attention for semantic segmentation//Proceedings of 2019 IEEE/CVF International Conference on Computer Vision. Seoul, Korea (South): IEEE: 603-612[DOI: 10.1109/ICCV.2019.00069]
  • LeCun Y, Boser B, Denker J S, Henderson D, Howard R E, Hubbard W, Jackel L D. 1989. Backpropagation applied to handwritten zip code recognition. Neural Computation, 1(4): 541-551 [DOI:10.1162/neco.1989.1.4.541]
  • Li H C, Xiong P F, An J and Wang L X. 2018a. Pyramid attention network for semantic segmentation//Proceedings of British Machine Vision Conference 2018. Newcastle, UK: BMVA Press: #1120
  • Liu S T, Huang D and Wang Y H. 2018. Receptive field block net for accurate and fast object detection//Proceedings of the 15th European Conference on Computer Vision. Munich, Germany: Springer: 404-419[DOI: 10.1007/978-3-030-01252-6_24]
  • Long J, Shelhamer E and Darrell T. 2015. Fully convolutional networks for semantic segmentation//Proceedings of 2015 IEEE Conference on Computer Vision and Pattern Recognition. Boston, USA: IEEE: 3431-3440[DOI: 10.1109/CVPR.2015.7298965]
  • Long X D, Zhang W W, Zhao B. 2020. PSPNet-SLAM: a semantic SLAM detect dynamic object by pyramid scene parsing network. IEEE Access, 8: 214685-214695 [DOI:10.1109/ACCESS.2020.3041038]
  • Ronneberger O, Fischer P and Brox T. 2015. U-Net: convolutional networks for biomedical image segmentation//Proceedings of International Conference on Medical Image Computing and Computer-Assisted Intervention. Munich, Germany: Springer: 234-241[DOI: 10.1007/978-3-319-24574-4_28]
  • Simonyan K and Zisserman A. 2015. Very deep convolutional networks for large-scale image recognition//Proceedings of the 3rd International Conference on Learning Representations. San Diego, USA: ICLR: #1409
  • Vaswani A, Shazeer N, Parmar N, Uszkoreit J, Jones L, Gomez A N, Kaiser L and Polosukhin I. 2017. Attention is all you need//Proceedings of the 31st International Conference on Neural Information Processing Systems. Long Beach, USA: Curran Associates Inc. : 6000-6010
  • Ye L, Zhu J Y, Duan T. 2020. Design of image segmentation model of driving vision based on deep learning. Research and Exploration in Laboratory, 39(10): 88-92 (叶绿, 朱家懿, 段婷. 2020. 基于深度学习的行驶视觉图像分割模型设计. 实验室研究与探索, 39(10): 88-92) [DOI:10.3969/j.issn.1006-7167.2020.10.020]
  • Yuan Y H and Wang J D. 2021. OCNet: object context network for scene parsing[EB/OL]. [2021-05-15]. https://arxiv.org/pdf/1809.00916v2.pdf
  • Zhao H S, Shi J P, Qi X J, Wang X G and Jia J Y. 2017. Pyramid scene parsing network//Proceedings of 2017 IEEE Conference on Computer Vision and Pattern Recognition. Honolulu, USA: IEEE: 6230-6239[DOI: 10.1109/CVPR.2017.660]