Literature DB >> 34711889

Feature fusion network based on strip pooling.

Gaihua Wang1,2, Qianyu Zhai3.   

Abstract

Contextual information is a key factor affecting semantic segmentation. Recently, many methods have tried to use the self-attention mechanism to capture more contextual information. However, these methods with self-attention mechanism need a huge computation. In order to solve this problem, a novel self-attention network, called FFANet, is designed to efficiently capture contextual information, which reduces the amount of calculation through strip pooling and linear layers. It proposes the feature fusion (FF) module to calculate the affinity matrix. The affinity matrix can capture the relationship between pixels. Then we multiply the affinity matrix with the feature map, which can selectively increase the weight of the region of interest. Extensive experiments on the public datasets (PASCAL VOC2012, CityScapes) and remote sensing dataset (DLRSD) have been conducted and achieved Mean Iou score 74.5%, 70.3%, and 63.9% respectively. Compared with the current typical algorithms, the proposed method has achieved excellent performance.
© 2021. The Author(s).

Entities:  

Year:  2021        PMID: 34711889      PMCID: PMC8553855          DOI: 10.1038/s41598-021-00585-z

Source DB:  PubMed          Journal:  Sci Rep        ISSN: 2045-2322            Impact factor:   4.379


Introduction

Semantic segmentation, which is the fundamental and challenging problem in computer vision, is to parse the category of each pixel in the image. It has been extensively researched in a variety of fields, such as autonomous driving, remote sensing images, medical diagnosis, and so on. With the emergence of Fully Convolutional Neural Networks (FCNs)[1], many methods have made remarkable progress in semantic segmentation. However, due to the limitations of the network structure, the traditional FCN only obtains the local information of the image and lacks sufficient contextual information, which can easily lead to incorrect segmentation results. In recent years, many novel networks[2-7] have tried to seek new methods to solve FCN's issues. UperNet[8] uses feature pyramid network (FPN) to capture multi-scale features and analyze different scenes. DenseASPP[9] combines dense connection with ASPP, which is composed of the dilated convolution with different rates, to generate different receptive fields. Affinity Loss[10] was proposed by Yu et al. to distinguish the relationship between different pixels. HRNet[11] maintains high-resolution representations by connecting high-resolution to low-resolution convolutions in parallel. LedNet[12] uses attention pyramid network (APN) to capture contextual information, and uses convolutional decomposition and channel separation to reduce network complexity. HANet[13] introduces a highly-driven attention module to improve image segmentation in urban scenes. SPNet[14] proposes the strip pooling to solve the long-term dependence of the network. In order to complete the semantic segmentation task more quickly and accurately, a novel semantic segmentation network is designed, which can efficiently aggregate context information. Specifically, it consists of a series of convolution branches and two FF modules. The FF module uses strip pooling and two linear layers to generate the affinity matrix, which can capture the correlation between any features. For each spatial position on the affinity matrix, it collects all the information from the local feature map. The main contributions of this study can be summarized as follows: 1. We design a new network with self-attention mechanism, to solve the long-term dependence problem in semantic segmentation tasks. 2. An FF module is proposed to reduce the computational cost of affinity matrix. It efficiently captures contextual information by converting matrix multiplication to vector multiplication. 3. The experiments show that the proposed method has better performance on three mainstream benchmarks including PASCAL VCO 2012, Cityscapes and DLRSD. The remaining paper is organized in the following way. “Related work” examines the top-ranking related work on semantic segmentation. The proposed method is introduced in “Methods”. In “Experiments”, We have conducted a large number of ablation and comparative experiments to verify the effectiveness of the proposed method. “Conclusion” is the summary of this paper.

Related work

Context information

In semantic segmentation, contextual information aggregation can significantly improve the segmentation effect. Some methods with aggregating context information have been studied. DeepLabs[15,16] uses dilated convolutions with different rates to stack the ASPP (atrous spatial pyramid pooling) structure to capture different contextual information. Zhao et al.[17] stacked pooling layers of different sizes to form a pyramid structure to capture more contextual information. GCN[18] aggregates more context information by using a larger convolution kernel and reduces the number of parameters by convolution decomposition. Some works, such as SegNet[19], U-Net[20], U-Net++[21] and ENet[22], use encoding–decoding structures to aggregate low-dimensional information. In addition, the attention mechanism is also introduced to aggregate context information. DFNet[23] and EncNet[24] are inspired by SENet[25] and assign different weights to different channels. Zhao et al.[26] proposed a PSA module to generate an over-completed map to adaptively aggregate context information. These methods with aggregating certain contextual information can assist the network focus on areas of interest effectively.

Self-attention mechanism

Long-term dependence is a significant issue that influences the effect of semantic segmentation. One solution is to use the self-attention mechanism[27] which is first applied in the field of natural language processing to calculate the affinity matrix between each pixel. It can be expressed as: Q, K, and V are weight matrixes, and is a constant. The self-attention mechanism needs to multiply two matrices, which will cause huge computation. The non-local[28] module employs the relationship between two locations to capture long-term dependence of the network, which enable each position on the feature map to obtain information of other positions. CCNet[29] has designed a CC module to capture the horizontal and vertical direction information. By repeatedly stacking the CC modules, the similarity of any two positions on the feature map can be calculated. DANet[30] and DRANet[31] learn the correlation between space and channel respectively through position and channel attention modules. TANet[32] combines channel and spatial attention to improve the segmentation effect. OCNet[33] combines the self-attention mechanism with the ASPP structure. Different from previous self-attention modules, we design a lightweight self-attention module based on strip pooling, which can capture global information more efficiently and uses the linear layer to make up for the loss of information caused by the pooling operation.The proposed self-attention module transforms the original matrix multiplication into vector multiplication, which greatly reduces the cost of computation and memory.

Method

This section first introduces the overall architecture of the network and describes the FF module that can capture sparse local information. Then recurrent the FF module to capture the dense global information. Finally it describes how to aggregate all the module together.

Network architecture

The overall architecture of the network is shown in Fig. 1. The convolutional layer in the figure represents a convolution, BN, and ReLU. CNN uses ResNet50 with dilated convolution. To retain more detailed information, dilated convolution is used in the last two blocks of ResNet50. The height and width of the output are 1/8 of the input I. The extracted feature is processed by 3 × 3 convolutional layer to get I' (the number of channels decreased from 2048 to 512). Then, the network with Q, V, and X branches is designed. The Q has two serial FF modules. The first FF module generates feature map F by extracting information in the horizontal and vertical directions. The second FF module generates the affinity matrix F', which is the result of the weighted summation of all pixels. The V and X directly reduce the channel dimension through the 3 × 3 convolution with BN and ReLU (the number of channels decreased from 512 to 128). And the result of V branch and F' are multiplied to generate the attention matrix M. The result of X branchand M are added to enhance the feature representation. Finally, the fused feature map is sent to the convolutional layer and generates ultimate prediction images.
Figure 1

The overall structure of our network.

The overall structure of our network.

Feature fusion module

As shown in Fig. 2, given feature map F (CxHxW), which divides into two branches q and k. In the q branch, it performs 1 × 1 convolutional to reduce dimension to C' × H × W (C' is half of the C) and a column average pooling to compress height dimension to get Y (C' × 1 × W), where Y ∈ R. Then reshapes to C' × W (remove height dimension) and gets feature vector q' by using two linear layers. Among them, the function of the linear layer is to convert the strip pooling result and reduce feature loss caused by strip pooling. It is worth noting that the output size of the linear layer is C' → C'/4 → C', and they all use linear activation functions. This process can be described as:
Figure 2

The main architecture of the FF module.

The main architecture of the FF module. Equation (2) shows the process of column average pooling, where H represents the height of the feature map, ti represents the ith element in each column. Y is the result of column average pooling. Eq. (3) shows the process of fully connected layer, where g represents linear layer, W is the learnable weight matrix of the linear layer. It can be found that q' is generated after the input feature map is compressed and then space transformation is performed. The k branch is similar to the q branch, and k' will be obtained after row average pooling and two linear layers. After reshaping q' and k', matrix multiplication is performed to produce the output E. Then, use E to generate output O. Please note that O is equal to E in the first FF module, but in the second FF module, O is obtained after E passes through the Softmax function. As shown in Fig. 2, the way of the FF module collects information is marked in red. Each position on O combines information from row and column of the feature map F. An FF module cannot collect enough global information, so we feed O to the FF module again to capture global information, and calculate the affinity matrix between pixels through the Softmax function. Note that the linear layer can only output a fixed size. So,we use 1 × 1 convolution instead of the linear layer to achieve an output of any size. Experiments have also proved that the 1 × 1 convolution and linear layer are equivalent.

Experiments

we first introduce PASCAL VOC2012, Cityscapes, and DLRSD, then introduce the experimental environment and details, and finally compare and verify the proposed method on different datasets.

Datasets

PASCAL VOC2012 is a segmentation dataset. It has 21 categories, including airplanes, bicycles, boats, etc. The dataset has 10,582 images for training and 1449 images for verification. CityScapes is a city segmentation dataset. It collects road landscape images of 50 cities, each image size is 2048 × 1024. The dataset contains 19 common categories in road scenes, with a total of 5000 high-quality pixel-level labels. The training set contains 2979 images, the validation set contains 500 images, and the test set contains 1525 images. DLRSD is a dense labeling dataset that builds for remote sensing image segmentation tasks. It contains 2100 images with a pixel size of 256 × 256, covering 17 common remote sensing image scene categories. We divide the training set and validation set according to the ratio of 0.8:0.2 for each category.

Experimental settings

The implementation of our network is based on the Pytorch framework. Its version is 1.1.0, and the CUDA version is 10.0. We only use a Nvidia GTX 1080TI to complete the experiment. Like the previous method, it uses the ‘Poly’ strategy to update the learning rate. The decoder initial learning rates of the PASCAL VOC 2012, DLRSD, and CityScapes datasets are 0.05, 0.008, and 0.01. During the training process, the learning rate of the encoder is 1/10 of that of the decoder. We employ the SGD optimizer, where weight decay and momentum are 0.0001 and 0.9 respectively. For the backbone network, it chooses ResNet50[34] with dilated convolution, which has been pre-trained on ImageNet. For the sake of generality, all the networks in the experiment do not use auxiliary loss functions. We use flip, rotate, zoom, random scramble, random crop, and blur operations on the dataset to augment the data. The batch sizes of the PASCAL VOC 2012, and DLRSD are 8, the CityScapes is 4. And the size of the input is randomly cropped to 384, 224, and 512 respectively. The number of epoch of the PASCAL VOC 2012 and DLRSD is 180 and the CityScapes is 120. Besides, the pixel accuracy (PA) and the mean intersection of union (mIoU) are used as the main evaluation indicators of the experiment, and their definitions are as follows:where TP represents true positive, TN represents true negative, FP represents false positive, FN represents false negative, and k represents the number of categories.

Results analysis

Ablation study

We use the same hyperparameters for experiments. As shown in Table 1, the ablation experiments on the PASCAL VOC 2012 are performed.
Table 1

Results of ablation experiments.

MethodBackboneFFmIoU (%)PA (%)
FCN8s[1]ResNet50[32]64.490.8
OursResNet50[32] × 172.892.9
OursMobileNet v2[34] × 267.791.2
OursEfficientNet b0[35] × 270.490
OursResNet50[32] × 274.593.5
OursResNet101[33] × 275.893.8
Results of ablation experiments. In the Table1, the second row is the result of one FF module. And the fifth row is the result of two FF modules. Obviously, The FF module can significantly improve the segmentation accuracy. Compared with the base-line FCN8s (use ResNet50 as the backbone network), using an FF module can bring an 8.4% improvement on mIoU. When stacking two FF modules repeatedly, the proposed method can increase mIoU from 72.8% to 74.5%. And it can help the network better aggregate contextual information. We add the FF module to different backbone networks to verify its effectiveness. Like ResNet50, we replace the last convolutional layer of the backbone network with dilated convolutional and fine-tune it. When the FF module is combined with the lightweight backbones MobileNet v2 and EfficientNet b0, 67.7% and 70.4% mIoU can be achieved respectively. It is worth noting that when we use ResNet101, its feature extraction ability is stronger, which can bring the highest mIoU of 75.8%. In Fig. 3, we visualize feature maps (come from ResNet50) at different positions. the images in the 4th and 5th columns are the output of the 13th and 15th channels respectively. It shows that the proposed method can get better features. The 6th and 7th columns are the output of the first FF module and the second FF module respectively. After the second FF module, the relationship between each pixel will be calculated, and important information will be given higher weight (such as the bright spot in Fig. 3). The attention map (come from attention matrix), which is generated after aggregating context information, is shown in the final image. It is not difficult to find that the attention map can make the network pay more attention to the area of interest.
Figure 3

Visualization of PASCAL VOC 2012 (val).

Visualization of PASCAL VOC 2012 (val).

Results on PASCAL VOC 2012

The segmentation results of PASCAL VOC 2012 are show in Table 2. Obviously, the proposed method is better than other methods. Compared with other attention methods, such as DANet and CCNet, the proposed method achieves a higher mIoU (74.5%). In terms of model complexity, the proposed method parameter is only 279 MB, which is about 1/3 less than the most recent mainstream models, such as SPNet and DRANet.
Table 2

Performance comparison of different models in PASCAL VOC 2012 (val).

MethodPublicationWeightsmIoU (%)PA (%)
FCN8s[1]CVPR2015180 MB64.490.8
PSPNet[17]CVPR2017392 MB70.892
Deeplab[16]ECCV2018309 MB71.892.3
UperNet[8]ECCV2018817 MB69.491.8
CCNet[28]ICCV2019363 MB7192.5
DANet[29]CVPR2019363 MB73.293
DRANet[30]IEEE400 MB73.893.8
SPNet[14]CVPR2020346 MB69.291.4
Ours279 MB74.593.5
Performance comparison of different models in PASCAL VOC 2012 (val). The segmentation results of each category of PASCAL VOC 2012 (val) are shown in Table 3. For categories with a small number and a small area, such as “bicycles” and “bottles”, the proposed model considers rich context information, which make segmentation more delicate and better segmentation results.
Table 3

Per-class results on PASCAL VOC 2012 (val).

MethodBackgroundAirplaneBicycleBirdBoatBottleBusCarCatChairCowDiningDogHorseMotorcyclePersonPotted plantsSheepSofaTrainTV
FCN8[1]90.680.155.477.759.757.573.575.577.422.76840.571.767.172.680.648.167.535.871.959.4
PSPNet[17]91.886.253.886.365.674.183.48186.127.383.148.778.5798280.3346.383.942.674.663.5
Deeplab[16]91.68851.984.466.361.187.281.888.630.7815981.774.274.782.951.569.547.284.369.3
UPerNet[8]91.384.155.482.165.165.783.678.882.828.174.354.377.675.378.480.747.374.542.371.864.6
CCNet[28]91.687.248.184.267.174.984.882.187.728.981.544.377.677.771.682.348.482.84081.266.9
DANet[29]92.687.354.887.566.876.986.687.285.629.48256.476.579.479.383.856.178.142.378.869.3
DRANet[30]92.388.656.485.871.7768685.190.631.280.158.583.174.780.282.755.181.841.982.666.3
SPNet[14]90.685.451.681.765.971.690.782.58524.47649.877.56071.480.238.979.436.883.770.3
Ours92.888.661.387.269.376.986.48389.328.381.951.682.27980.484.160.87946.285.470.1
Per-class results on PASCAL VOC 2012 (val).

Results on CityScapes

We conduct experiments on the CityScapes. The experimental results are shown in Table 4. It can be found that the proposed method achieves 70.3% mIoU, which surpasses the previous mainstream methods. Compared with DANet and DRANet, which also use the self-attention mechanism, the proposed method has 2.9% and 1.1% improvements in mIoU, respectively.
Table 4

Segmentation results on the CityScapes (val).

MethodmIoU (%)PA (%)
FCN8s[1]62.994.4
U-Net[20]61.394.2
PSPNet[17]67.195.2
DeepLab[16]68.695.5
CCNet[28]6695
DANet[29]67.495.1
DRANet[30]69.295.7
SPNet[14]67.695.1
Ours70.395.7
Segmentation results on the CityScapes (val). As shown in Fig. 4, we visualize the most recent mainstream methods on the CityScapes. The proposed network can obtain a global perspective and accurately segment the image based on contextual information. For example, red boxes for the "road " or "building" in the image, the proposed method can correctly judge the target around the "road " according to the context information and make the segmentation more accurate.
Figure 4

Visualization of CityScapes (val).

Visualization of CityScapes (val).

Results on DLRSD

The DLRSD dataset is taken from the sky. The background of the objects in the image is complex and the scale is changed drastically, which makes segmentation very difficult. Table 5 shows the verification results on the DLRSD, where FLOPs are measured when the input size is 3 × 248 × 248 and the number of outputs is 17. Compared with DANet, which also uses the self-attention mechanism, the parameter amount of the proposed method is 20% lower than it. Computational complexity can be measured in FLOPs. The proposed network has far fewer FLOPs than the dual-channel self-attention network DANet. Compared with lightweight network LedNet, the proposed method has higher computational complexity, but more computation brings higher segmentation accuracy. The proposed method can automatically aggregate contextual information and achieve 63.9% in the mIoU. Figure 5 shows the corresponding visualization results. In red boxes, for large-scale targets, such as "aircraft", the proposed method can make a more complete segmentation. For small-scale targets, such as "cars", the proposed method can perceive their existence from a global perspective, which is less missed than other methods.
Table 5

Segmentation results on the DLRSD (val).

NetworkmIoU(%)PA(%)FLOPsParams
FCN 8s[1]52.771.86.7 × 10911,853,788
U-Net[20]59.374.41.38 × 101028,957,521
PSPNet[17]59.977.64.33 × 101023,357,160
DeepLab[16]6177.44.46 × 101020,237,465
UperNet[8]60.377.61.11 × 101153,619,560
DANet[29]59.177.24.81 × 101047,565,905
LedNet[12]56.675.71.26 × 101011,419,797
SPNet[14]55.274.63.78 × 101045,371,537
Ours63.9793.81 × 101037,862,993
Figure 5

DLRSD (val) dataset visualization results.

Segmentation results on the DLRSD (val). DLRSD (val) dataset visualization results.

Conclusion

We propose an efficient self-attention segmentation network (FFANet). FF module that can efficiently capture contextual information is designed. It uses strip pooling to reduce the complexity of the affinity matrix. The spatial transformation is performed through the linear layer to compensate for the information ambiguity caused by the strip pooling. Experiments show that the proposed method can effectively solve long-term dependence and make the segmentation result more accurate. It achieves 74.5% mIoU on the PASCAL VOC 2012, 70.3% mIoU on the CityScapes, and 63.9% mIoU on the DLRSD. Although the use of a linear layer can reduce the information loss caused by the pooling operation, some information will still be lost. Therefore, in the future research, we will explore other feature compression methods to capture global information more effectively (Suppl. Information). Supplementary Information.
  5 in total

1.  Squeeze-and-Excitation Networks.

Authors:  Jie Hu; Li Shen; Samuel Albanie; Gang Sun; Enhua Wu
Journal:  IEEE Trans Pattern Anal Mach Intell       Date:  2019-04-29       Impact factor: 6.226

2.  DeepLab: Semantic Image Segmentation with Deep Convolutional Nets, Atrous Convolution, and Fully Connected CRFs.

Authors:  Liang-Chieh Chen; George Papandreou; Iasonas Kokkinos; Kevin Murphy; Alan L Yuille
Journal:  IEEE Trans Pattern Anal Mach Intell       Date:  2017-04-27       Impact factor: 6.226

3.  SegNet: A Deep Convolutional Encoder-Decoder Architecture for Image Segmentation.

Authors:  Vijay Badrinarayanan; Alex Kendall; Roberto Cipolla
Journal:  IEEE Trans Pattern Anal Mach Intell       Date:  2017-01-02       Impact factor: 6.226

4.  Scene Segmentation With Dual Relation-Aware Attention Network.

Authors:  Jun Fu; Jing Liu; Jie Jiang; Yong Li; Yongjun Bao; Hanqing Lu
Journal:  IEEE Trans Neural Netw Learn Syst       Date:  2021-06-02       Impact factor: 10.451

5.  UNet++: A Nested U-Net Architecture for Medical Image Segmentation.

Authors:  Zongwei Zhou; Md Mahfuzur Rahman Siddiquee; Nima Tajbakhsh; Jianming Liang
Journal:  Deep Learn Med Image Anal Multimodal Learn Clin Decis Support (2018)       Date:  2018-09-20
  5 in total
  1 in total

1.  An improved Deeplabv3+ semantic segmentation algorithm with multiple loss constraints.

Authors:  Yunyan Wang; Chongyang Wang; Huaxuan Wu; Peng Chen
Journal:  PLoS One       Date:  2022-01-19       Impact factor: 3.240

  1 in total

北京卡尤迪生物科技股份有限公司 © 2022-2023.