ContextNet: Exploring Context and Detail for Semantic Segmentation in Real-time

Rudra P. K. Poudel, Ujwal Bonde, Stephan Liwicki, Christopher Zach

Introduction

Semantic segmentation—the task of assigning a category to every pixel in an image—is a critical component for autonomous driving. However, a persistent trade-off exists between accuracy and speed. High-resolution processing is necessary for sharp object boundaries but is computationally expensive. Conversely, understanding global scene context requires deep layers but can be achieved with lower-resolution inputs. ContextNet addresses this by decoupling context and detail into a dual-branch architecture designed for real-time performance.

Architecture and Methodology

ContextNet utilizes a two-branch deep neural network to balance computational efficiency with spatial accuracy. By separating the processing of global context from local spatial details, the model significantly reduces the number of parameters and floating-point operations.

The dual-branch architecture of ContextNet, featuring a deep context branch and a shallow detail branch.
  1. Context Branch (Low-Resolution): This branch processes a downsampled version of the input image (1/4 resolution). It consists of a deep network (38 layers) using bottleneck residual blocks and depth-wise separable convolutions. Its primary role is to capture the global "what" and "where" of the scene.
  2. Detail Branch (High-Resolution): This branch operates on the full-resolution image but is kept shallow (4 layers). It focuses on refining boundaries and capturing fine spatial details lost during downsampling.

The features from both branches are combined in a Feature Fusion Unit using addition and subsequent convolutions, ensuring that global context effectively informs local detail. To further optimize performance, the authors employ factorized convolutions and a network pruning strategy, starting with an over-parameterized model and reducing it to a target size.

Experimental Results

The model was evaluated on the Cityscapes dataset, a benchmark for urban street scene segmentation. ContextNet achieved a competitive 66.1% mIoU on the test set while maintaining real-time performance.

Qualitative results on the Cityscapes dataset comparing original images, ground truth, and ContextNet predictions.

Key performance metrics include:

  • Speed: 18.3 FPS on a single Titan X GPU at full resolution (1024 x 2048), increasing to 23.2 FPS with pipelined computation.
  • Efficiency: The model is extremely lightweight, containing only 0.85 million parameters.
  • Pruning Gains: Pruning an over-parameterized network yielded a 1.9% mIoU improvement over training a smaller network from scratch, validating the "lottery ticket" approach.

Conclusion

ContextNet demonstrates that a dual-branch approach effectively bridges the gap between real-time speed and high-resolution accuracy. By separating global context from local detail, the model achieves state-of-the-art efficiency for semantic segmentation. Future work may involve exploring quantization techniques and applying this architecture to related tasks like depth prediction.

Summary updated

BibTeX
@inproceedings{poudel2018contextnet,
  author = {Rudra P. K. Poudel and Ujwal Bonde and Stephan Liwicki and Christopher Zach},
  title = {{ContextNet: Exploring Context and Detail for Semantic Segmentation in Real-time}},
  booktitle = {BMVC},
  year = {2018},
}
Figure