Abstract
Semantic segmentation is a cornerstone of autonomous driving, yet standard convolutional neural networks (CNNs) often overlook the inherent spatial structure of urban scenes. We present the Height-driven Attention Network (HANet), a lightweight, "plug-and-play" module that exploits vertical spatial priors to enhance segmentation accuracy. By recognizing that specific object classes—such as roads, buildings, and the sky—occupy predictable vertical zones, HANet dynamically weights feature channels based on their height-wise position. Our approach achieves state-of-the-art results on the Cityscapes and BDD100K benchmarks with minimal computational overhead.
Introduction
In the context of autonomous driving, semantic segmentation—the task of assigning a class label to every pixel—is critical for safe navigation. Most modern deep learning architectures treat images as spatially uniform, meaning the network searches for a "car" or "road" with the same expectation regardless of its location in the frame. However, urban driving scenes are highly structured due to fixed camera mounting heights on vehicles. This paper introduces HANet, a module designed to explicitly leverage this "geometry of the world" to reduce uncertainty and improve segmentation performance.
Exploiting Vertical Priors
The core motivation for HANet lies in the predictable distribution of classes along the vertical axis of driving images. For instance, in the Cityscapes dataset, the probability of encountering a "road" pixel in the top third of an image is a negligible 0.006%, whereas it rises to approximately 88% in the bottom third.
To formalize this observation, we utilized information theory, specifically entropy, to demonstrate that dividing an image into horizontal strips significantly reduces class label uncertainty. Current architectures fail to incorporate this height-wise prior, often leading to avoidable misclassifications. HANet addresses this by learning to emphasize features relevant to specific vertical coordinates.
The HANet Architecture
HANet is designed as a general add-on module compatible with various CNN backbones, such as ResNet or MobileNet. The module operates through several key stages:
- Width-wise Pooling: The module first "squeezes" the horizontal dimension of a feature map to create a vertical strip representing average features for each row.
- Coarse Attention & Interpolation: To maintain efficiency, the vertical strip is downsampled to a coarse resolution before processing.
- 1D Convolutions: Unlike standard global attention mechanisms, HANet employs 1D convolutions. This allows the model to learn spatial relationships between adjacent rows, such as the typical transition from road to sidewalk.
- Sinusoidal Positional Encoding: Inspired by Transformer architectures, we inject positional encodings to provide the network with an explicit sense of its vertical position within the image.
- Channel Gating: The final output consists of row-by-row weights used to scale the original feature channels, prioritizing the most relevant features for each specific height.
To ensure the model remains robust to camera movement (e.g., driving over bumps), we employ "height jittering" during training, encouraging the network to learn general vertical trends rather than rigid pixel coordinates.
Experimental Evaluation
We evaluated HANet on two major urban-scene benchmarks: Cityscapes and BDD100K. The latter provides a rigorous test for generalization, featuring diverse weather conditions and times of day.
HANet provided consistent performance gains across all tested backbones. Notably, it improved the mean Intersection over Union (mIoU) of a ResNet-101 model on Cityscapes from 79.25% to 80.29%. When combined with standard inference techniques, HANet reached 83.2% mIoU on the Cityscapes test set, establishing a new record for ResNet-101-based models at the time of publication. Visualizations of the attention maps confirm that the model successfully learns to look for road-related features at the bottom and sky-related features at the top.
Conclusion
HANet demonstrates that incorporating domain-specific spatial priors can yield significant accuracy improvements with negligible computational cost. While the current implementation assumes a relatively stable horizon, it provides a powerful framework for urban-scene understanding. Future work may explore making height-driven attention adaptive to camera pitch and roll, or applying similar spatial priors to other domains like medical or satellite imaging.
Summary updated