Real-Time Video Segmentation on Mobile Devices
Spatial pyramid pooling module or encode-decoder structure are used in deep neural networks for semantic segmentation task. The former networks are able to encode multi-scale contextual information by probing the incoming features with filters or pooling operations at multiple rates and multiple effective fields-of-view, while the latter networks can capture sharper object boundaries by gradually recovering the spatial information. In this work, we propose to combine the advantages from both methods. Specifically, our proposed model, DeepLabv3+, extends DeepLabv3 by adding a simple yet effective decoder module to refine the segmentation results especially along object boundaries. We further explore the Xception model and apply the depthwise separable convolution to both Atrous Spatial Pyramid Pooling and decoder modules, resulting in a faster and stronger encoder-decoder network. We demonstrate the effectiveness of the proposed model on the PASCAL VOC 2012 semantic image segmentation dataset and achieve a performance of 89 any post-processing. Our paper is accompanied with a publicly available reference implementation of the proposed models in Tensorflow.READ FULL TEXT VIEW PDF
In this work, we revisit atrous convolution, a powerful tool to explicit...
The object sizes in images are diverse, therefore, capturing multiple sc...
Semantic segmentation has been a hot topic across diverse research field...
Semantic image segmentation plays a pivotal role in many vision applicat...
Motivated by the success of encoding multi-scale contextual information ...
Melody extraction in polyphonic musical audio is important for music sig...
Cardiac structure segmentation plays an important role in medical analys...
Real-Time Video Segmentation on Mobile Devices
Google DeepLab v3 for Image Semantic Segmentation
|(a) Spatial Pyramid Pooling||(b) Encoder-Decoder||(c) Encoder-Decoder with Atrous Conv|
In order to capture the contextual information at multiple scales, DeepLabv3  applies several parallel atrous convolution with different rates (called Atrous Spatial Pyramid Pooling, or ASPP), while PSPNet 
performs pooling operations at different grid scales. Even though rich semantic information is encoded in the last feature map, detailed information related to object boundaries is missing due to the pooling or convolutions with striding operations within the network backbone. This could be alleviated by applying the atrous convolution to extract denser feature maps. However, given the design of state-of-art neural networks[7, 9, 10, 25, 26] and limited GPU memory, it is computationally prohibitive to extract output feature maps that are 8, or even 4 times smaller than the input resolution. Taking ResNet-101  for example, when applying atrous convolution to extract output features that are 16 times smaller than input resolution, features within the last 3 residual blocks (9 layers) have to be dilated. Even worse, 26 residual blocks (78 layers!) will be affected if output features that are 8 times smaller than input are desired. Thus, it is computationally intensive if denser output features are extracted for this type of models. On the other hand, encoder-decoder models [21, 22] lend themselves to faster computation (since no features are dilated) in the encoder path and gradually recover sharp object boundaries in the decoder path. Attempting to combine the advantages from both methods, we propose to enrich the encoder module in the encoder-decoder networks by incorporating the multi-scale contextual information.
In particular, our proposed model, called DeepLabv3+, extends DeepLabv3  by adding a simple yet effective decoder module to recover the object boundaries, as illustrated in Fig. 1. The rich semantic information is encoded in the output of DeepLabv3, with atrous convolution allowing one to control the density of the encoder features, depending on the budget of computation resources. Furthermore, the decoder module allows detailed object boundary recovery.
Motivated by the recent success of depthwise separable convolution [27, 28, 26, 29, 30], we also explore this operation and show improvement in terms of both speed and accuracy by adapting the Xception model , similar to , for the task of semantic segmentation, and applying the atrous separable convolution to both the ASPP and decoder modules. Finally, we demonstrate the effectiveness of the proposed model on PASCAL VOC 2012 and Cityscapes datasts and attain the test set performance of 89.0% and 82.1% without any post-processing, setting a new state-of-the-art.
In summary, our contributions are:
We propose a novel encoder-decoder structure which employs DeepLabv3 as a powerful encoder module and a simple yet effective decoder module.
In our structure, one can arbitrarily control the resolution of extracted encoder features by atrous convolution to trade-off precision and runtime, which is not possible with existing encoder-decoder models.
We adapt the Xception model for the segmentation task and apply depthwise separable convolution to both ASPP module and decoder module, resulting in a faster and stronger encoder-decoder network.
Our proposed model attains a new state-of-art performance on PASCAL VOC 2012 and Cityscapes datasets. We also provide detailed analysis of design choices and model variants.
We make our Tensorflow-based implementation of the proposed model publicly available at https://github.com/tensorflow/models/tree/master/research/deeplab.
Models based on Fully Convolutional Networks (FCNs) [8, 11] have demonstrated significant improvement on several segmentation benchmarks [1, 2, 3, 4, 5]. There are several model variants proposed to exploit the contextual information for segmentation [12, 13, 14, 15, 16, 17, 32, 33], including those that employ multi-scale inputs (i.e., image pyramid) [34, 35, 36, 37, 38, 39] or those that adopt probabilistic graphical models (such as DenseCRF  with efficient inference algorithm ) [42, 43, 44, 37, 45, 46, 47, 48, 49, 50, 51, 39]. In this work, we mainly discuss about the models that use spatial pyramid pooling and encoder-decoder structure.
Spatial pyramid pooling: Models, such as PSPNet  or DeepLab [39, 23], perform spatial pyramid pooling [18, 19] at several grid scales (including image-level pooling ) or apply several parallel atrous convolution with different rates (called Atrous Spatial Pyramid Pooling, or ASPP). These models have shown promising results on several segmentation benchmarks by exploiting the multi-scale information.
The encoder-decoder networks have been successfully applied to many computer vision tasks, including human pose estimation, object detection [54, 55, 56], and semantic segmentation [11, 57, 21, 22, 58, 59, 60, 61, 62, 63, 64]. Typically, the encoder-decoder networks contain (1) an encoder module that gradually reduces the feature maps and captures higher semantic information, and (2) a decoder module that gradually recovers the spatial information. Building on top of this idea, we propose to use DeepLabv3  as the encoder module and add a simple yet effective decoder module to obtain sharper segmentations.
Depthwise separable convolution: Depthwise separable convolution [27, 28] or group convolution [7, 65], a powerful operation to reduce the computation cost and number of parameters while maintaining similar (or slightly better) performance. This operation has been adopted in many recent neural network designs [66, 67, 26, 29, 30, 31, 68]. In particular, we explore the Xception model , similar to  for their COCO 2017 detection challenge submission, and show improvement in terms of both accuracy and speed for the task of semantic segmentation.
In this section, we briefly introduce atrous convolution [69, 70, 8, 71, 42] and depthwise separable convolution [27, 28, 67, 26, 29]. We then review DeepLabv3  which is used as our encoder module before discussing the proposed decoder module appended to the encoder output. We also present a modified Xception model [26, 31] which further improves the performance with faster computation.
Atrous convolution: Atrous convolution, a powerful tool that allows us to explicitly control the resolution of features computed by deep convolutional neural networks and adjust filter’s field-of-view in order to capture multi-scale information, generalizes standard convolution operation. In the case of two-dimensional signals, for each location on the output feature map and a convolution filter , atrous convolution is applied over the input feature map as follows:
where the atrous rate r determines the stride with which we sample the input signal. We refer interested readers to  for more details. Note that standard convolution is a special case in which rate . The filter’s field-of-view is adaptively modified by changing the rate value.
Depthwise separable convolution: Depthwise separable convolution, factorizing a standard convolution into a depthwise convolution followed by a pointwise convolution (i.e., convolution), drastically reduces computation complexity. Specifically, the depthwise convolution performs a spatial convolution independently for each input channel, while the pointwise convolution is employed to combine the output from the depthwise convolution. In the TensorFlow  implementation of depthwise separable convolution, atrous convolution has been supported in the depthwise convolution (i.e., the spatial convolution), as illustrated in Fig. 3. In this work, we refer the resulting convolution as atrous separable convolution, and found that atrous separable convolution significantly reduces the computation complexity of proposed model while maintaining similar (or better) performance.
|(a) Depthwise conv.||(b) Pointwise conv.||(c) Atrous depthwise conv.|
DeepLabv3 as encoder: DeepLabv3  employs atrous convolution [69, 70, 8, 71] to extract the features computed by deep convolutional neural networks at an arbitrary resolution. Here, we denote output stride as the ratio of input image spatial resolution to the final output resolution (before global pooling or fully-connected layer). For the task of image classification, the spatial resolution of the final feature maps is usually 32 times smaller than the input image resolution and thus . For the task of semantic segmentation, one can adopt (or
) for denser feature extraction by removing the striding in the last one (or two) block(s) and applying the atrous convolution correspondingly (e.g., we apply and to the last two blocks respectively for ). Additionally, DeepLabv3 augments the Atrous Spatial Pyramid Pooling module, which probes convolutional features at multiple scales by applying atrous convolution with different rates, with the image-level features 
. We use the last feature map before logits in the original DeepLabv3 as the encoder output in our proposed encoder-decoder structure. Note the encoder output feature map contains 256 channels and rich semantic information. Besides, one could extract features at an arbitrary resolution by applying the atrous convolution, depending on the computation budget.
Proposed decoder: The encoder features from DeepLabv3 are usually computed with . In the work of , the features are bilinearly upsampled by a factor of 16, which could be considered a naive decoder module. However, this naive decoder module may not successfully recover object segmentation details. We thus propose a simple yet effective decoder module, as illustrated in Fig. 2. The encoder features are first bilinearly upsampled by a factor of 4 and then concatenated with the corresponding low-level features  from the network backbone that have the same spatial resolution (e.g., Conv2 before striding in ResNet-101 ). We apply another convolution on the low-level features to reduce the number of channels, since the corresponding low-level features usually contain a large number of channels (e.g., 256 or 512) which may outweigh the importance of the rich encoder features (only 256 channels in our model) and make the training harder. After the concatenation, we apply a few convolutions to refine the features followed by another simple bilinear upsampling by a factor of 4. We show in Sec. 4 that using for the encoder module strikes the best trade-off between speed and accuracy. The performance is marginally improved when using for the encoder module at the cost of extra computation complexity.
We modify the Xception as follows: (1) more layers (same as MSRA’s modification except the changes in Entry flow), (2) all the max pooling operations are replaced by depthwise separable convolutions with striding, and (3) extra batch normalization and ReLU are added after eachdepthwise convolution, similar to MobileNet.
The Xception model 
has shown promising image classification results on ImageNet with fast computation. More recently, the MSRA team  modifies the Xception model (called Aligned Xception) and further pushes the performance in the task of object detection. Motivated by these findings, we work in the same direction to adapt the Xception model for the task of semantic image segmentation. In particular, we make a few more changes on top of MSRA’s modifications, namely (1) deeper Xception same as in  except that we do not modify the entry flow network structure for fast computation and memory efficiency, (2) all max pooling operations are replaced by depthwise separable convolution with striding, which enables us to apply atrous separable convolution to extract feature maps at an arbitrary resolution (another option is to extend the atrous algorithm to max pooling operations), and (3) extra batch normalization  and ReLU activation are added after each depthwise convolution, similar to MobileNet design . See Fig. 4 for details.
We employ ImageNet-1k  pretrained ResNet-101  or modified aligned Xception [26, 31] to extract dense feature maps by atrous convolution. Our implementation is built on TensorFlow  and is made publicly available.
The proposed models are evaluated on the PASCAL VOC 2012 semantic segmentation benchmark  which contains 20 foreground object classes and one background class. The original dataset contains (train), (val), and (test) pixel-level annotated images. We augment the dataset by the extra annotations provided by , resulting in (trainaug) training images. The performance is measured in terms of pixel intersection-over-union averaged across the 21 classes (mIOU).
We follow the same training protocol as in  and refer the interested readers to  for details. In short, we employ the same learning rate schedule (i.e., “poly” policy  and same initial learning rate ), crop size , fine-tuning batch normalization parameters  when , and random scale data augmentation during training. Note that we also include batch normalization parameters in the proposed decoder module. Our proposed model is trained end-to-end without piecewise pretraining of each component.
We define “DeepLabv3 feature map” as the last feature map computed by DeepLabv3 (i.e., the features containing ASPP features and image-level features), and as a convolution operation with kernel and filters.
When employing , ResNet-101 based DeepLabv3  bilinearly upsamples the logits by during both training and evaluation. This simple bilinear upsampling could be considered as a naive decoder design, attaining the performance of  on PASCAL VOC 2012 val set and is better than not using this naive decoder during training (i.e., downsampling groundtruth during training). To improve over this naive baseline, our proposed model “DeepLabv3+” adds the decoder module on top of the encoder output, as shown in Fig. 2. In the decoder module, we consider three places for different design choices, namely (1) the convolution used to reduce the channels of the low-level feature map from the encoder module, (2) the convolution used to obtain sharper segmentation results, and (3) what encoder low-level features should be used.
To evaluate the effect of the convolution in the decoder module, we employ and the Conv2 features from ResNet-101 network backbone, i.e., the last feature map in res2x residual block (to be concrete, we use the feature map before striding). As shown in Tab. 1, reducing the channels of the low-level feature map from the encoder module to either 48 or 32 leads to better performance. We thus adopt for channel reduction.
We then design the convolution structure for the decoder module and report the findings in Tab. 2. We find that after concatenating the Conv2 feature map (before striding) with DeepLabv3 feature map, it is more effective to employ two convolution with 256 filters than using simply one or three convolutions. Changing the number of filters from 256 to 128 or the kernel size from to degrades performance. We also experiment with the case where both Conv2 and Conv3 feature maps are exploited in the decoder module. In this case, the decoder feature map are gradually upsampled by 2, concatenated with Conv3 first and then Conv2, and each will be refined by the operation. The whole decoding procedure is then similar to the U-Net/SegNet design [21, 22]. However, we have not observed significant improvement. Thus, in the end, we adopt the very simple yet effective decoder module: the concatenation of the DeepLabv3 feature map and the channel-reduced Conv2 feature map are refined by two operations. Note that our proposed DeepLabv3+ model has . We do not pursue further denser output feature map (i.e., ) given the limited GPU resources.
|train OS||eval OS|
To compare the model variants in terms of both accuracy and speed, we report mIOU and Multiply-Adds in Tab. 3 when using ResNet-101  as network backbone in the proposed DeepLabv3+ model. Thanks to atrous convolution, we are able to obtain features at different resolutions during training and evaluation using a single model.
Baseline: The first row block in Tab. 3 contains the results from  showing that extracting denser feature maps during evaluation (i.e., ) and adopting multi-scale inputs increases performance. Besides, adding left-right flipped inputs doubles the computation complexity with only marginal performance improvement.
Adding decoder: The second row block in Tab. 3 contains the results when adopting the proposed decoder structure. The performance is improved from to or to when using or , respectively, at the cost of about 20B extra computation overhead. The performance is further improved when using multi-scale and left-right flipped inputs.
Coarser feature maps: We also experiment with the case when using (i.e., no atrous convolution at all during training) for fast computation. As shown in the third row block in Tab. 3, adding the decoder brings about 2% improvement while only 74.20B Multiply-Adds are required. However, the performance is always about 1% to 1.5% below the case in which we employ and different eval output stride values. We thus prefer using or during training or evaluation depending on the complexity budget.
|Model||Top-1 Error||Top-5 Error|
The results of using the proposed Xception as network backbone for semantic segmentation are reported in Tab. 5.
Baseline: We first report the results without using the proposed decoder in the first row block in Tab. 5, which shows that employing Xception as network backbone improves the performance by about 2% when over the case where ResNet-101 is used. Further improvement can also be obtained by using , multi-scale inputs during inference and adding left-right flipped inputs. Note that we do not employ the multi-grid method [77, 78, 23], which we found does not improve the performance.
Adding decoder: As shown in the second row block in Tab. 5, adding decoder brings about 0.8% improvement when using for all the different inference strategies. The improvement becomes less when using .
Using depthwise separable convolution: Motivated by the efficient computation of depthwise separable convolution, we further adopt it in the ASPP and the decoder modules. As shown in the third row block in Tab. 5, the computation complexity in terms of Multiply-Adds is significantly reduced by 33% to 41%, while similar mIOU performance is obtained.
Pretraining on COCO: For comparison with other state-of-art models, we further pretrain our proposed DeepLabv3+ model on MS-COCO dataset , which yields about extra 2% improvement for all different inference strategies.
Pretraining on JFT: Similar to , we also employ the proposed Xception model that has been pretrained on both ImageNet-1k  and JFT-300M dataset [80, 26, 81], which brings extra 0.8% to 1% improvement.
Test set results: Since the computation complexity is not considered in the benchmark evaluation, we thus opt for the best performance model and train it with and frozen batch normalization parameters. In the end, our ‘DeepLabv3+’ achieves the performance of 87.8% and 89.0% without and with JFT dataset pretraining.
Qualitative results: We provide visual results of our best model in Fig. 6. As shown in the figure, our model is able to segment objects very well without any post-processing.
Failure mode: As shown in the last row of Fig. 6, our model has difficulty in segmenting (a) sofa vs. chair, (b) heavily occluded objects, and (c) objects with rare view.
|train OS||eval OS|
|Deep Layer Cascade (LC) ||82.7|
In this subsection, we evaluate the segmentation accuracy with the trimap experiment [14, 40, 39] to quantify the accuracy of the proposed decoder module near object boundaries. Specifically, we apply the morphological dilation on ‘void’ label annotations on val set, which typically occurs around object boundaries. We then compute the mean IOU for those pixels that are within the dilated band (called trimap) of ‘void’ labels. As shown in Fig. 5 (a), employing the proposed decoder for both ResNet-101  and Xception  network backbones improves the performance compared to the naive bilinear upsampling. The improvement is more significant when the dilated band is narrow. We have observed 4.8% and 5.4% mIOU improvement for ResNet-101 and Xception respectively at the smallest trimap width as shown in the figure. We also visualize the effect of employing the proposed decoder in Fig. 5 (b).
|(a) mIOU vs. Trimap width||(b) Decoder effect|
In this section, we experiment DeepLabv3+ on the Cityscapes dataset , a large-scale dataset containing high quality pixel-level annotations of 5000 images (2975, 500, and 1525 for the training, validation, and test sets respectively) and about 20000 coarsely annotated images.
As shown in Tab. 7 (a), employing the proposed Xception model as network backbone (denoted as X-65) on top of DeepLabv3 , which includes the ASPP module and image-level features , attains the performance of 77.33% on the validation set. Adding the proposed decoder module significantly improves the performance to 78.79% (1.46% improvement). We notice that removing the augmented image-level feature improves the performance to 79.14%, showing that in DeepLab model, the image-level features are more effective on the PASCAL VOC 2012 dataset. We also discover that on the Cityscapes dataset, it is effective to increase more layers in the entry flow in the Xception , the same as what  did for the object detection task. The resulting model building on top of the deeper network backbone (denoted as X-71 in the table), attains the best performance of 79.55% on the validation set.
After finding the best model variant on val set, we then further fine-tune the model on the coarse annotations in order to compete with other state-of-art models. As shown in Tab. 7 (b), our proposed DeepLabv3+ attains a performance of 82.1% on the test set, setting a new state-of-art performance on Cityscapes.
|(a) val set results||(b) test set results|
Our proposed model “DeepLabv3+” employs the encoder-decoder structure where DeepLabv3 is used to encode the rich contextual information and a simple yet effective decoder module is adopted to recover the object boundaries. One could also apply the atrous convolution to extract the encoder features at an arbitrary resolution, depending on the available computation resources. We also explore the Xception model and atrous separable convolution to make the proposed model faster and stronger. Finally, our experimental results show that the proposed model sets a new state-of-the-art performance on PASCAL VOC 2012 and Cityscapes datasets.
Acknowledgments We would like to acknowledge the valuable discussions with Haozhi Qi and Jifeng Dai about Aligned Xception, the feedback from Chen Sun, and the support from Google Mobile Vision team.
The cityscapes dataset for semantic urban scene understanding.In: CVPR. (2016)
Xception: Deep learning with depthwise separable convolutions.In: CVPR. (2017)
Conditional random fields as recurrent neural networks.In: ICCV. (2015)
Weakly- and semi-supervised learning of a dcnn for semantic image segmentation.In: ICCV. (2015)