TL;DR
HANet (Height-driven Attention Network) is a lightweight, plug-and-play module that significantly improves semantic segmentation in urban driving scenes by exploiting a simple structural truth: cars don't fly, and the sky is always at the top. By selectively weighting features based on their vertical position, HANet consistently boosts accuracy across various backbone architectures with virtually zero computational or memory overhead.
What Problem Does This Paper Address?
Most state-of-the-art semantic segmentation networks treat images uniformly, ignoring the inherent geometry of specific domains. In urban driving datasets, images are captured from a fixed camera mounted on a vehicle. This creates a strong, predictable structural prior: roads are always at the bottom, buildings and traffic signs are on the sides/middle, and the sky is at the top.
Standard global or channel-wise attention mechanisms fail to exploit this spatial consistency because they aggregate information across the entire image uniformly. The authors address this gap by designing an attention mechanism that explicitly uses a pixel's vertical position to guide feature selection.
Methods
The authors introduce HANet, an add-on module that generates row-specific, channel-wise attention weights through the following steps:
- Width-wise Pooling: The input feature map is squeezed horizontally (average pooling across the width) to extract a height-wise context vector for each row.
- Coarse Attention & 1D Convolutions: To ensure robustness and capture relationships between adjacent rows, the height map is downsampled. Instead of using fully connected layers (which throw away spatial relationships), HANet employs 1D convolutions to model smooth vertical transitions.
- Positional Encoding: To give the network an absolute sense of "up" and "down," sinusoidal positional encodings (similar to those used in Transformers) are injected into the intermediate layers of the module.
- Gating: The resulting attention map is upsampled back to the original feature map height and element-wise multiplied with the main network's feature maps, scaling channel activations based on height.
HANet is highly modular and can be inserted at multiple layers within standard architectures like DeepLabv3+.
Datasets
The model was evaluated on two prominent urban-scene datasets:
- Cityscapes: A benchmark dataset for urban scene understanding containing 5,000 finely annotated and 20,000 coarsely annotated road-driving images from various cities.
- BDD100K (Berkeley Deep Drive): A large-scale, diverse driving dataset with 7,000 training and 1,000 validation images capturing various weather conditions, times of day, and geographic scenarios.
Key Insights and Ideas
- Entropy Reduction via Horizontal Splitting: The authors mathematically prove that the uncertainty (entropy) of class distributions drops significantly (from 1.84 to an average of 1.26) when an image is divided into horizontal bands. Knowing the height band drastically simplifies the classification problem.
- Global Context is Too Homogeneous: Traditional channel attention (like SENet) relies on global image context. However, because driving images all share highly similar global statistics (they are all road scenes), global context fails to provide distinct, localized guidance for pixel classification.
- 1D Convolutions over MLPs: Using 1D convolutions allows the network to learn localized vertical context, ensuring that what the network expects to see in row $Y$ smoothly informs what it expects to see in row $Y+1$.
Key Results
- Consistent mIoU Boost: Adding HANet to various backbones (ShuffleNetV2, MobileNetV2, ResNet-50, ResNet-101) consistently improved performance. For instance, it boosted a ResNet-101 baseline from 77.80% to 79.31% mIoU on the Cityscapes validation set.
- State-of-the-Art Performance: Combined with standard inference techniques (multiscale testing, flipping), HANet achieved a new state-of-the-art score of 83.2% mIoU on the Cityscapes test benchmark using a ResNext-101 backbone.
- Negligible Cost: The parameter and FLOP increases are practically invisible (e.g., an increase of just 0.1M parameters and 0.1 GFLOPs for ResNet-101), making it a highly efficient alternative to simply deepening a network or reducing output stride.
- Regional Efficacy: Confirming the authors' hypothesis, the largest performance gains occurred in the upper (+1.60%) and lower (+2.45%) regions of the images, where structural priors are strongest and entropy is lowest.
Limitations and Future Work
While the authors do not include a dedicated limitations section, the approach inherently relies on the structural consistency of the camera viewpoint. To mitigate variations in camera mounting positions across different vehicles, the authors utilized random height jittering during training. However, HANet remains specialized for structured environments (like driving or fixed security surveillance) and would likely provide little to no benefit on unconstrained, generic image datasets (like ImageNet or COCO) where vertical position does not correlate strongly with specific semantic classes.
Summary updated