BiSeNet: Bilateral Segmentation Network for Real-time Semantic Segmentation
- Publication
- ECCV 2018Conference
- First submitted to arXiv
- arXiv:1808.00897
Cite this paper · BibTeX
The citation identifies the linked source version. It cites the original paper and its authors.
@misc{segmentationbisenet2018,
title = {{BiSeNet: Bilateral Segmentation Network for Real-time Semantic Segmentation}},
author = {Changqian Yu and Jingbo Wang and Chao Peng and Changxin Gao and Gang Yu and Nong Sang},
year = {2018},
eprint = {1808.00897},
archivePrefix = {arXiv},
url = {https://arxiv.org/abs/1808.00897}
}
The segmentation models in the last few notes were all competing on accuracy. PSPNet reached 78.4% mIoU on Cityscapes, at the cost of running a dilated ResNet-101 at resolution all the way through; the paper didn't report speed. The same team later built ICNet specifically to deal with PSPNet being too slow for real time.
Self-driving cars, AR glasses and surveillance cameras need real time. A street scene has to be segmented within a few tens of milliseconds.
Changqian Yu and colleagues from Huazhong University of Science and Technology, Peking University and Megvii proposed BiSeNet to get two things at once. It wants detail and a large receptive field, and it has no intention of sacrificing either one for the other.
Defining the Problem
There were roughly three ways to speed up segmentation at the time. The authors put them in one figure together with the U-shaped structure.

Look at the two columns of (a). The first approach is shrinking the input; methods like ICNet shrink the image before segmenting it, which is simple and effective, but small objects and boundary detail are gone from the start. The second is pruning channels, especially in the early part of the network; speed goes up, and the capacity for spatial information goes down with it. The third is ENet's approach, dropping the last stage outright, which makes the network very lean, but the receptive field is no longer large enough and large objects go unrecognized.
All three trade accuracy for speed.
The common remedy is the U-shaped structure in (b), which, like U-Net, connects shallow encoder features back into the decoder and raises the resolution step by step. The authors see two problems with it. A full U-shaped structure has to do a lot of extra computation on high-resolution feature maps, so it slows down again; more fundamentally, the spatial information thrown away by shrinking the input or pruning channels can't be recovered from the shallow layers either. In the authors' words, the U-shape only eases the problem; it doesn't solve it.
So the problem becomes two needs pulling against each other. Keeping spatial detail needs features with a small stride and high resolution; seeing the whole scene needs a large receptive field, usually obtained through many downsamplings. For one network to do both, it has to be deep and wide, and then it can't run fast.
Solving the Problem
The authors' answer is (c), with two paths that each take care of one thing.

This figure has three parts to read, the Spatial Path on the left, the Context Path on the right, and the FFM that joins them. We'll take the input the paper uses for its speed measurements, a Cityscapes image shrunk to , and walk it down each path.
Spatial Path: Shallow and Wide
The Spatial Path has only three layers. Each is a stride-2 convolution followed by BatchNorm and ReLU.
After three stride-2 layers, the input becomes , or of the original. This feature map is large, with each cell covering only an region of the original image, so the detail is all still there. With only three layers, it's cheap to compute as well.
Its receptive field is tiny, since three convolution layers can't see far. That isn't its job.
Context Path: Deep and Narrow
The Context Path uses a lightweight Xception, which the authors call Xception39. Its task is to downsample fast, shrinking the image to , , and . At the feature map is only , each cell covers a region of the original image, and the receptive field is already large.
Not satisfied with that, the authors add a global average pooling at the end of Xception39. The whole feature map is averaged into one vector, which has the largest receptive field possible, covering the entire image. This vector is enlarged back to and added to the last stage's output.
Next comes an "incomplete U-shape." Only the features of the last two stages ( and ) are progressively upsampled and added, outputting at to match the Spatial Path's . The authors call this U-shape-8s; a standard U-shaped structure goes all the way to and is called U-shape-4s.
ARM: Picking Channels with Global Information
An Attention Refinement Module (ARM) is attached to the output of each of the and stages.
ARM first global-average-pools the feature map into a vector, passes it through a convolution and BatchNorm, then a sigmoid, which gives each channel a weight between 0 and 1, and finally multiplies these weights back onto the original features. It's the same idea as SENet's channel attention, using statistics of the whole image to decide which channels to amplify.
The authors stress that ARM injects global context into the features without any upsampling, at a nearly negligible computational cost.
FFM: The Two Kinds of Features Can't Simply Be Added
Both paths now output feature maps. The Spatial Path's are low-level features that record edges and textures; the Context Path's are high-level features that record "this patch is road, that patch is a car."
The authors argue that the two sit at different levels and can't be added directly, so they designed the Feature Fusion Module (FFM). First the two are concatenated and mixed through conv+BN+ReLU; then the mixed features get SENet-style weighting, where global pooling, convolution, ReLU, convolution and sigmoid produce channel weights that are multiplied in, and the result is added back to the original features.
A classifier comes last, and at test time the prediction is enlarged 8× back to the original image.
Computing Both Paths Together
This design helps speed in two ways. The Spatial Path has high resolution but only three layers; the Context Path is deep, but its resolution drops so fast that every layer is small. The two paths are independent of each other and can run in parallel.
During training, the authors add an auxiliary loss to each of the Context Path's two intermediate outputs:
is the main loss on the whole network's output and is the auxiliary loss for the -th stage of the Context Path, all of them per-pixel softmax cross-entropy, with . The auxiliary losses are used only during training.
The other settings are SGD, batch 16, momentum 0.9, weight decay and a learning rate starting at 0.025 with poly decay; data augmentation consists of horizontal flipping and random scaling from 0.75 to 2.0×.
Discussion
The ablations are all on the Cityscapes validation set. Cityscapes is a street-scene dataset shot from a car, with 2,975 training, 500 validation and 1,525 test images at and 19 classes; the paper uses only the finely annotated part.
What Each Part Contributes
First, how far the Context Path's U-shape should go (Table 2 of the paper). U-shape-8s and 4s reach 66.01 and 66.13 mIoU, practically identical; on a input they take 12 ms and 17 ms. One more level of U-shape costs 40% more for 0.12 points. The authors chose 8s, which jumps from about 60.8, with just the backbone and direct upsampling, to 66.01.
Then the other parts are added in turn (Table 3 of the paper):
| Setting | mIoU (%) |
|---|---|
| Context Path | 66.01 |
| + Spatial Path (plain sum) | 66.82 |
| + Spatial Path (FFM) | 67.42 |
| + global pooling | 68.42 |
| + ARM | 68.72 |
| + global pooling + ARM | 71.40 |
The Spatial Path itself adds 0.8 points, and fusing with FFM instead adds another 0.6, confirming that the two paths' features really don't suit plain addition. Global pooling and ARM each add only about 1 point on their own; added together, they give nearly 4. Both parts inject global information into the Context Path, and together they do more than the sum of their separate gains, which the paper doesn't explain further.

In the numbers the Spatial Path adds less than 1 point, but the figure shows what it fills in. In the second and third rows, the thin poles and signals in the middle of the frame are often broken or smeared into a blob in the U-shape column, and much cleaner in the BiSeNet column. These thin little objects take up very few pixels and barely move mIoU, but they matter a great deal to a self-driving car.
Speed
Table 5 of the paper measures three input sizes on a Titan XP:
| Model | |||
|---|---|---|---|
| BiSeNet (Xception39) | 4 ms | 8 ms | 18 ms |
| BiSeNet (ResNet-18) | 5 ms | 13 ms | 29 ms |
On a Titan X at the same , ENet takes 46 ms, SegNet 637 ms, and BiSeNet (Xception39) 24 ms.
As for computation (Table 4 of the paper, input), BiSeNet (Xception39) needs 2.9 GFLOPs, less than ENet's 3.8, while its parameters are 5.8M against ENet's 0.4M. ENet has far fewer parameters yet runs slower; parameter count and speed are two different things.
Results in the Real-Time Setting
Table 6 of the paper gives Cityscapes test-set results, with speed and accuracy measured under the same setting:
| Method | Backbone | Test mIoU (%) | FPS |
|---|---|---|---|
| SegNet | VGG16 | 56.1 | – |
| ENet | From scratch | 58.3 | – |
| ICNet | PSPNet50 | 69.5 | 30.3 |
| Two-column Net | ResNet-50 | 72.9 | 14.7 |
| BiSeNet | Xception39 | 68.4 | 105.8 |
| BiSeNet | ResNet-18 | 74.7 | 65.5 |
The ResNet-18 version is 5 points above ICNet at more than twice its speed; the Xception39 version is 1 point below ICNet at more than three times its speed.
There's a condition here to read carefully. The abstract says " input, 105 FPS," but the main text explains that for measuring speed and accuracy, the authors first shrink the images to . So BiSeNet actually processes only 56% of the original pixels, which is exactly the "shrinking the input" the authors criticized when defining the problem. The scaling isn't drastic, but before comparing its FPS with other papers, check that everyone measured at the same resolution.
Without the Speed Limit
The authors also trained in a setting that ignores speed (Table 7 of the paper), with random crops. BiSeNet with a ResNet-101 backbone reaches 78.9% on the Cityscapes test set, slightly above PSPNet's 78.4%; the ResNet-18 version gets 77.7%.
On the CamVid test set, the Xception39 and ResNet-18 versions get 65.6% and 68.7%, against 55.6% for SegNet; on the COCO-Stuff validation set, the ResNet-101 version gets 31.3% mIoU.
Conclusion
BiSeNet refuses to choose between keeping detail and enlarging the receptive field, and gives each one its own path. The Spatial Path keeps detail at resolution with three convolution layers, the Context Path sees the whole image with a lightweight backbone plus global pooling, and the FFM combines the two kinds of features with channel weighting. In the paper's real-time setting, the ResNet-18 version runs at 65.5 images per second with 74.7% on the Cityscapes test set.
This skeleton, with one path for detail and one for semantics, is what BiSeNetV2, DDRNet and PIDNet later kept refining in the same direction. Three years on, Rethinking BiSeNet measured that the Spatial Path itself is quite time-consuming, dropped it altogether, and instead uses Detail Guidance during training to supervise detail in the shallow layers, so inference computes nothing extra.
If you're going to deploy it, measure the speed again at your own resolution and on your own GPU. The paper's 105 FPS was measured on frames shrunk to .