DABNet: Depth-wise Asymmetric Bottleneck for Real-time Semantic Segmentation
Gen Li Inyoung Yun Jonghyun Kim Joongkyu Kim
cs.CV

Experimental dissipative quantum sensing
    Jiangfeng Du
    December 21, 2021
========================================



†Corresponding author


As a pixel-level prediction task, semantic segmentation needs large computational cost with enormous parameters to obtain high performance.
Recently, due to the increasing demand for autonomous systems and robots, it is significant to make a trade-off between accuracy and inference speed.
In this paper, we propose a novel Depth-wise Asymmetric Bottleneck (DAB) module to address this dilemma, which efficiently adopts depth-wise asymmetric convolution and dilated convolution to build a bottleneck structure. 
Based on the DAB module, we design a Depth-wise Asymmetric Bottleneck Network (DABNet) especially for real-time semantic segmentation, which creates sufficient receptive field and densely utilizes the contextual information.
Experiments on Cityscapes and CamVid datasets demonstrate that the proposed DABNet achieves a balance between speed and precision.
Specifically, without any pretrained model and post-processing, it achieves 70.1% Mean IoU on the Cityscapes test dataset with only 0.76 million parameters and a speed of 104 FPS on a single GTX 1080Ti card.
Code is available at <https://github.com/Reagan1311/DABNet>.




§ INTRODUCTION





Recently, autonomous systems and augmented reality devices have drawn widespread attention, which are the main application fields of semantic segmentation.
Such real-world applications not only demand competitive performance with low energy and memory but also have a strict requirement for inference speed.
Existing real-time semantic segmentation <cit.> models have successfully sped up to real time, but meanwhile, they significantly sacrifice model accuracy.
Therefore, how to design an effective real-time semantic segmentation network with fast inference speed and small capacity becomes a challenging problem.

Most of the previous excellent work <cit.> has already proved the availability of dilated convolution which is able to create sizeable receptive field while maintaining the number of parameters.
Thus, many existing semantic segmentation models aiming at real time employ dilated convolution in their network.
Another method to effectively reduce the number of parameters is depth-wise separable convolution (ds-Conv). It computes cross-channel and spatial correlations independently, which is widely used in lightweight models <cit.>.
However, simply replacing the standard convolution with ds-Conv results in large performance degradation, as ds-Conv dramatically reduces the parameters, and it often leads to a sub-optimal problem.
Therefore, here we hold the opinion that a well-designed combination of dilated convolution and ds-Conv is especially suitable for real-time semantic segmentation.

Based on the above observation, we propose a novel network architecture specially designated for real-time semantic segmentation, which is presented in Figure <ref>.
More specifically, we design a depth-wise asymmetric bottleneck to extract dense feature under a shallow network, which has common advantages of both dilated convolution and depth-wise separable convolution.

Our main contributions could be summarized as:

    
  * We propose a bottleneck structure which incorporates depth-wise asymmetric convolution with dilated convolution, and it is termed as Depth-wise Asymmetric Bottleneck (DAB). This structure extracts local and contextual information jointly and dramatically reduces the parameters.
    
  * We elaborately design DABNet based on DAB module,  it has much fewer parameters than the existing state-of-the-art real-time semantic segmentation methods while providing comparable accuracy and faster inference speed.
    
  * We achieve remarkable results on both of Cityscapes <cit.> and CamVid <cit.> benchmarks without any context module, pretrained model, and post-processing scheme. Under an equivalent number of parameters, the proposed DABNet significantly outperforms existing semantic segmentation networks. It can run on high-resolution images (512×1024) at 104 FPS on a single GTX 1080Ti card and 70.1% Mean IoU on the Cityscapes test dataset with merely 0.76 M parameters.







§ RELATED WORK

Recent real-time semantic segmentation models use multiple different techniques, such as dilated convolution and convolution factorization, to enlarge the receptive field and speed up networks.
In this section, we briefly introduce recent research progress and describe some approaches that are of great help in real-time semantic segmentation.

Real-time semantic segmentation.
Real-time semantic segmentation network requires finding a trade-off between high-quality prediction and high-inference speed.
ENet <cit.> is the first network to be designed in real time, it trims a great number of convolution filters to reduce computation.
ICNet <cit.> proposes an image cascade network that incorporates multi-resolution branches.
ERFNet <cit.> uses residual connections and factorized convolutions to remain efficient while retaining remarkable accuracy.
More recently, ESPNet <cit.> introduces an efficient spatial pyramid (ESP), which brings great improvement in both speed and performance.
BiSeNet <cit.> proposes two paths to combine spatial information and context information.
These networks successfully made a trade-off between speed and performance, but there is still sufficient space for further improvement.

Dilated convolution.
Dilated convolution <cit.> inserts zeros between each pixel in a standard convolution, which leads to a large effective receptive field without increasing parameters, hence it is generally used in semantic segmentation models.
In DeepLab series <cit.>, an atrous spatial pyramid pooling (ASPP) module is introduced which employs multiple parallel filters with different dilation rates to collect multi-scale information. 
DenseASPP <cit.> concatenates a set of dilated convolution layers to generate dense multi-scale feature representation.
Most of the state-of-the-art networks in semantic segmentation exploit dilated convolution, which proves its effectiveness in pixel-level prediction task.

Convolution Factorization.
Convolution factorization divides a standard convolution operation into several steps to reduce the computational cost and memory,  which is extensively adopted in lightweight CNN models.
Inception <cit.> employ several small-sized convolutions to replace the convolution with large kernel size while maintaining the size of the receptive field.
Xception <cit.> and MobileNet <cit.> use the depth-wise separable convolution to reduce the amount of computation with only a slight drop in performance.
MobileNetV2 <cit.> proposes an inverted residual block and linear bottlenecks to further improve the performance.
ShuffleNet <cit.> applies the point-wise group convolution with channel shuffle operation to enable information communication between different groups of channels.




§ PROPOSED NETWORK

In this section, we first introduce the DAB module, which is the core component of DABNet.
Then based on DAB module, we elaborate design choices of the final model, the overall structure of proposed DABNet is shown in Figure <ref>.



 §.§ Depth-wise Asymmetric Bottleneck


Inspired by bottleneck design in ResNet <cit.> (See Figure <ref>(a)) and factorized convolutions in ERFNet <cit.> (See Figure <ref>(b)), we design the DAB module with their common advantages.

Bottleneck design. 
DAB module follows the bottleneck structure similar to ResNet <cit.>.
In order to reduce the parameters and accelerate training process, ResNet-50, 101, 152 modify the original block as a bottleneck design, which is shown in Figure <ref>(a).

For the same reason, here we also utilize the bottleneck structure in DAB module, as shown in Figure <ref>(c).
Every bottleneck firstly reduces the number of channels by half and restores original channels by a point-wise convolution.
Nevertheless, we make some modifications on the original bottleneck structure:
(1) We use 3× 3 convolution at the beginning of each DAB module.
Here we clarify the reason: although a 1× 1 convolution has fewer parameters than 3× 3 convolution, the intention of ResNet <cit.> is to make a deep model with more than 100 layers, since deep convolutional neural network can increase the receptive field and capture more complex features.
Unfortunately, higher number of layers also bring increasing runtime and memory requirements.
Therefore, for the sake of high inference speed, we instead use the 3× 3 convolution to avoid making a deep model.
(2) We only reduce the number of channels by half after the first convolution, as the maximum number of channels in our model is only 128 compared with thousands of channels in ResNet <cit.>.
Thus, for preserving spatial information, we do not compress the channels too much.

Two-branch structure.
For semantic segmentation, previous remarkable networks have already demonstrated the significance of semantic context information, good prediction results usually come from a combination of hierarchical information, consequently how to effectively fuse multi-scale information remains a tough problem.
In DAB module,  we design a novel two-branch structure and each branch is responsible for extracting corresponding information.

To extract local information, we use a simple 3× 3 depth-wise convolution in the first branch. For further reducing the computation, referred by ERFNet <cit.> non-bottleneck-1D module (Figure <ref>(b)), we apply convolution factorization to depth-wise convolution.
Namely, a standard n× n depth-wise convolution is substituted for an n× 1 depth-wise convolution followed by a 1× n depth-wise convolution. For an N× N kernel, asymmetric convolution reduces the computational complexity per pixel from O(N^2) to O(N).  

To extract broader context information, we adopt dilated convolution, which creates a large receptive field without decreasing the resolution of the feature map.
However, when dilation rate becomes larger and larger (in most cases, it increases up to 16 or more), we need to implement lots of padding to maintain the size of the feature map.
This brings heavy computational cost, which prohibits dilated convolution from being used in a real-time model.
In order to resolve the above contradiction, the second branch only applies dilated convolution to the depth-wise asymmetric convolution to reduce computational cost, thus it is called “depth-wise asymmetric dilated convolution”.

In summary, all the convolutions we used in the “neck” part of our bottleneck structure are depth-wise convolution.
In the two-branch structure, each branch can be termed as local information branch and context information branch on the basis of their respective function.
Finally, we add the two branches together and then a 1× 1 point-wise convolution is employed at the end of each DAB module, which is used to restore the number of channels and fuse all the channel information.

Activation function.
In our DAB module, we adopt pre-activation scheme <cit.> and batch normalization <cit.> is used before every non-linear function.
Referring to ENet <cit.>, we use PReLU <cit.> as nonlinearity function, as PReLU achieves slightly better performance than ReLU due to the shallow network model.
And as mentioned in <cit.>, using non-linear layers in bottlenecks hurts the performance, therefore non-linearity is removed after the final 1× 1 point-wise convolution.







 §.§ Network Architecture Design


Based on the DAB module, we elaborately design the architecture of DABNet as shown in Figure <ref>.
In this subsection, we discuss the design choices on the final model of DABNet.
Since our research aims at the lightweight model with fast inference speed and comparable results, the essence is to build a shallow model with fewer parameters and remove redundant components.
The detailed architecture of DABNet is presented in Table <ref>.

Downsampling.
We first use three 3× 3 convolutions to extract initial features, then we employ the same downsampling block with ENet <cit.> initial block, which is a concatenation of a 3× 3 convolution with stride 2 and a 2× 2 max-pooling.
Similarly, we only use the initial block in the first downsampling, the second downsampling block is a single 3× 3 convolution with stride 2.

Downsampling operation reduces the size of the feature map and enlarges the receptive field for extracting more contextual information.
However, a reduction in the resolution of the feature map often results in information loss, which has a severe effect on the final prediction result.
Therefore, to preserve the spatial information and details, we only employ three downsampling operations in our model and finally obtain 1/8 feature map resolution, while most of existing semantic segmentation models employ five downsampling operations and get 1/32 feature map resolution.
Furthermore, inspired by ESPNetv2 <cit.>, we build a long-range shortcut connection between the input image and each downsampling block as well as the last convolution layer (see Figure <ref>), which facilitates feature reuse and compensates information loss.
This connection first downsamples the original image to the same size as the feature map and then concatenates them together.

DAB block.
We design two DAB blocks in the DABNet, which include several consecutive DAB modules for dense feature extraction.
The first and the second DAB block consist of 3 and 6 DAB modules, respectively.

To better strengthen spatial relationships and feature propagation, we introduce inter-block concatenation to combine high-level feature with low-level feature, which means stacking first DAB module with last DAB module in each DAB block.
Besides, we employ dilated convolution in every DAB module as mentioned in Section <ref>.
Specifically, all the DAB module in DAB block 1 include a depth-wise asymmetric dilated convolution with dilation rate 2, and dilation rates in DAB block 2 are 4, 4, 8, 8, 16, 16, respectively.
As with <cit.>, we choose this sequential scheme to enlarge the receptive field gradually.

Design choices.
Note that DABNet is lack of decoder structure, which is much different from popular encoder-decoder structure utilized in most of the semantic segmentation models.
In pursuit of faster inference speed, we discard the decoder in DABNet.
Although the decoder can lead to an effective increase in accuracy, even a small decoder would slow down the network and bring extra computation.
Besides, as we only downsample the input image three times, decoder is not essential in our network.

To make an end-to-end deep learning architecture, we do not use any post-processing technique to improve the final result.
Also, our model does not depend on any backbone, we design our model from scratch.
It is worth noting that the capacity of DABNet is extremely low, and we employ less than 0.76 million parameters.


§ EXPERIMENTS


In this section, we evaluate our proposed network on two challenging datasets: Cityscapes <cit.> and Camvid <cit.>, which are widely used in semantic segmentation.
Firstly, we introduce the datasets and implementation protocol. 
Then, we conduct several experiments on Cityscapes validation set to prove the effectiveness of our network.
Finally, we report the comparisons with state-of-the-art systems, all the performances are measured using mean intersection-over-union (mIoU).



 §.§ Experimental Settings

Cityscapes. 
The Cityscapes is a large urban street scene dataset.
 It contains a train set of 2975 images, a validation set of 500 images and a test set of 1525 images.
There is another set of 19,998 images with coarse annotation, but we only use the fine annotated images for all experiments.
The images have a resolution of 1024×2048 and 19 semantic categories.

CamVid.
The CamVid is another street scene dataset for autonomous driving applications.
It includes 701 images in total, 367 for training, 101 for validation and 233 for testing.
The images have a resolution of 360×480 and 11 semantic categories.

Implementation protocol.
All the experiments are performed with one 1080Ti GPU, CUDA 9.0 and cuDNN V7 on the Pytorch platform.
Runtime evaluation is performed on a single 1080Ti card, we report an average of 100 frames for the frames per second (FPS) measurement.

We use mini-batch stochastic gradient descent (SGD) with batch size 8, momentum 0.9 and weight decay 1e^-4 in training.
We employ the “poly” learning rate policy <cit.> and the initial learning rate is set to 4.5e^-2 with power 0.9.
As no pre-training is used, here we set the maximum number of epochs to 1000.
For data augmentation, we employ random horizontal flip, the mean subtraction, and random scale on the input images during training.
The random scale contains {0.75, 1.0, 1.25, 1.5, 1.75, 2.0}. Finally, we randomly crop the image into fixed size for training.



 §.§ Ablation Study

In this subsection, we design a series of experiments to demonstrate the effectiveness of our network.
We adopt Cityscapes dataset <cit.> to conduct quantitative and qualitative analysis.
All the ablation studies are trained from Cityscapes training set and evaluated on Cityscapes validation set.





Dilation rates.
We adopt gradually increasing sequence of dilation rates in the DAB block 2, which is {4, 4, 8, 8, 16, 16}.
To investigate the effectiveness of this scheme, we set all the dilation rate as 4 in the DAB block 2 for comparison.
In addition, previous work <cit.>  proposed that coprime dilation rates yield better results, therefore we set another varying dilation rates list, which is {3, 3, 7, 7, 13, 13}.
In Table <ref>(a), DABNet-(r=4) performs 2.3% lower accuracy than DABNet, which indicates the importance of increasing dilation rates.
Also, coprime dilation rates perform worse than DABNet, it seems large dilation rates are more effective in our network.

Decoder.
For striking a balance between the speed and prediction performance, we discard the decoder module in DABNet.
Here we build a network with the decoder of ERFNet for comparison and use deconvolution layer to restore the resolution of the feature map.
As can be seen from Table <ref>(a), adding the ERF decoder can bring 0.3% slightly better accuracy, while resulting in increased runtime with only 58.6 FPS.
 Apparently, the decoder is not essential in DABNet, which heavily slows down the model.

Context module.
PSPNet <cit.> is a classic model which employs a spatial pyramid pooling (SPP) module to improve performance by capturing global and local context at different feature resolutions.
To explore the ability to capture context information, we construct a DABNet variant with an SPP head in the end, which is termed as “DABNet-SPP”.
Table <ref>(a) shows that DABNet-SPP even decreases 0.5% accuracy, also it has 4.2% times more parameters and slows down the model by 32 FPS.
Therefore, we conclude that the DAB module can better capture context information than a heavy SPP context module.

Inference speed.
As mentioned in Section <ref>, dilated convolution brings heavy computational cost and slows down the model.
In order to explore the effect of dilated convolution on inference speed, we design two experiments for comparison in FPS.
In the first experiment we remove all the dilated convolutions in DABNet, and in the other experiment we further adopt a dilation rate 2 in the first 3× 3 standard convolution of our DAB module.
As presented in both Table <ref> (a) and (b), even if we decrease the dilation rate or remove all the dilated convolutions, the FPS is hardly changed (range from 104.2 to 104.5).
Nevertheless, when we apply dilated convolution (with only a dilation rate 2) to the standard convolution, there is an obvious decrease in speed, from 104.2 to 85.6. 
The experimental result proves that dilated convolution has a significant effect on inference speed, but when applied to depth-wise convolution, it has nearly no harmful effect.













 §.§ Comparison with state-of-the-arts

In this subsection, we compare our algorithm with state-of-the-art models.
We first report the final results on Cityscapes <cit.> and CamVid <cit.> benchmarks,
then we analyze the speed of our model and compute the FPS of other state-of-the-art methods under the same status for fair comparison.
During evaluation, we do not adopt any testing tricks such as multi-crop and multi-scale testing.


Accuracy and parameter comparisons.
With only 0.76 million parameters, our DABNet achieves impressive results.
Here we show the results on Cityscapes and CamVid benchmarks, respectively.
As shown in Table <ref>, DABNet achieves 70.1% mIoU on Cityscapes test set, which significantly outperforms existing real-time segmentation work.

In general, the more parameters, the more complex the function that can be fitted.
However, most of the large models have massive redundant parameters.  
Table <ref> shows that DABNet only uses 9.7% of ICNet's parameters, but achieves a better result.
Moreover, as can be observed, compared with the offline methods—PSPNet <cit.> and DeepLabV2 <cit.>, we only use 1% of their parameters to keep a comparable performance.
The qualitative results on Cityscapes validation set are presented in Figure <ref>.
On CamVid test set, as reported in Table <ref>, DABNet again achieves outstanding performance with small capacity, and it can process a 360×480 CamVid image at the speed of 146 FPS.


Speed comparison. 
Since different methods employ various devices and diverse input sizes, 
for fair comparison of speed, all the speed experiments are performed with a single 1080Ti GPU on the Pytorch platform.
Additionally, we also list the FPS and their test device from existing literature in Table <ref> for reference.
Table <ref> presents the speed comparison between our method with other state-of-the-art approaches at full, half and quarter resolution on images of Cityscapes.
DABNet is able to process a 1024× 2048 image at the speed of 27.7 FPS.
ESPNet <cit.> is one of the fastest real-time networks, and it has slightly quicker speed than DABNet. However it only achieves 60.3% mIoU which is 9.8% less than our network.
The speed comparison represents that DABNet is able to process a high resolution image with fast inference speed while maintaining high performance.




§ CONCLUSIONS

In this paper, we propose a novel Depth-wise Asymmetric Bottleneck module to extract local and contextual features jointly.
Based on the DAB module, we elaborately design the Depth-wise Asymmetric Bottleneck Network, a lightweight model with fast inference speed and competitive results. 
Through analysis and quantitative experimental results, we demonstrate the effectiveness of our method.
The proposed DABNet achieves 70.1% Mean IoU on Cityscapes test set with only 0.76 million parameters, and can run at 104 fps on 512× 1024 high-resolution images.
In conclusion, our network shows significant improvements in all the aspects of accuracy, speed, and capacity compared with the state-of-the-art methods.



§ ACKNOWLEDGEMENT

This work was supported by the National Research Foundation of the Korea (No.NRF-2017R1D1A1B03034288)
and the MSIT (Ministry of Science, ICT), Korea, under the High-Potential Individuals Global Training Program (2019-0-01609) supervised by the IITP (Institute for Information & Communications Technology Planning & Evaluation).


