SWA-SOP: Spatially-aware Window Attention for Semantic Occupancy Prediction in Autonomous Driving

Helin Cao, Rafael Materla, Sven BehnkearXiv 2025 · DOI · arXiv

Introduction

Autonomous driving systems rely heavily on sensors like LiDAR and cameras to perceive their environment. However, these sensors face inherent limitations: LiDAR scans are naturally sparse, and cameras suffer from occlusions where objects block the view of what lies behind them. Semantic Occupancy Prediction (SOP) addresses these challenges by reconstructing a dense, 3D voxel grid from partial observations, assigning a semantic label (e.g., road, car, sidewalk) to every cell in the scene.

While Transformer-based models have shown promise in capturing long-range relationships, they often lack the "geometric common sense" required for local structural consistency. They treat tokens as isolated units, struggling to maintain the 3D spatial context necessary for accurate reconstruction. Furthermore, many existing models fail in distant or highly occluded areas where depth data is unreliable. To solve this, the authors introduce SWA-SOP, a framework featuring a novel Spatially-aware Window Attention (SWA) mechanism designed to "fill in the blanks" of 3D surroundings with high precision.

The SWA-SOP Architecture

The SWA-SOP framework is built around a U-Net architecture that integrates the SWA module to bridge the gap between the efficiency of sparse convolutions and the reasoning power of Transformers. The pipeline begins with a sparse LiDAR point cloud, which undergoes semantic segmentation and voxelization before being processed by the SWA U-Net to produce a dense semantic scene.

The SWA-SOP pipeline: from sparse LiDAR point clouds to dense semantic scenes via voxelization and the SWA U-Net.

Key to this architecture is the Sliding Window Computation. Inspired by sparse convolutions, the model moves a 3D window across the voxel grid, performing attention calculations only when a window contains at least one "active" (non-empty) voxel. This approach significantly reduces computational overhead while focusing resources on relevant spatial regions.

Spatially-aware Window Attention

The core innovation of SWA-SOP is the SWA module, which introduces two critical components for geometric reasoning: Intra-Window Spatial Embedding and the Center Query Strategy.

Standard attention mechanisms often treat all tokens in a neighborhood equally, ignoring their relative 3D positions. SWA overcomes this by applying position-aware modulation to the "Keys" and "Values" within each window. This forces the model to encode the relative 3D position of each voxel, allowing it to better understand and reconstruct local geometry.

The Spatially-aware Window Attention (SWA) mechanism, highlighting the spatial embedding and center query strategy for geometric expansion.

To achieve "scene completion"—turning a sparse skeleton of points into a solid 3D model—the model employs a Center Query Strategy. When the center of a window is empty, the model generates a synthetic query based on its global grid index. This ensures the model always has a mechanism to pull information from neighboring voxels into empty spaces, enabling robust geometric expansion even in areas where sensor data is completely missing.

Experimental Results

The authors evaluated SWA-SOP on the SemanticKITTI benchmark, a large-scale real-world dataset for autonomous driving. The results demonstrate the model's superior ability to maintain spatial consistency:

  • LiDAR Performance: SWA-SOP achieved a mIoU of 27.4 and a high IoU of 57.9. While some competitors may reach higher mIoU in specific categories, SWA-SOP provides a more balanced and spatially consistent reconstruction, as evidenced by its superior IoU.
  • Modality Generality: The SWA module is plug-and-play. When integrated into the camera-based VoxFormer pipeline, it improved the mIoU from 12.20 to 13.19, proving that spatial embedding logic enhances performance regardless of the input sensor.
  • Ablation Studies: Removing the spatial embedding and center query components led to a significant performance drop (mIoU falling from 27.91 to 24.46), confirming that explicit spatial modeling is essential for effective occupancy prediction.

Conclusion

SWA-SOP represents a significant step forward in 3D scene understanding for autonomous vehicles. By combining local geometric awareness with flexible Transformer reasoning, it effectively reconstructs dense environments from sparse data. Future work will focus on optimizing the model for real-time performance on vehicle hardware and exploring cross-modal fusion to combine the strengths of LiDAR and camera sensors within the SWA framework.

Summary updated

Abstract

Perception systems in autonomous driving rely on sensors such as LiDAR and cameras to perceive the 3D environment. However, due to occlusions and data sparsity, these sensors often fail to capture complete information. Semantic Occupancy Prediction (SOP) addresses this challenge by inferring both occupancy and semantics of unobserved regions. Existing transformer-based SOP methods lack explicit modeling of spatial structure in attention computation, resulting in limited geometric awareness and poor performance in sparse or occluded areas. To this end, we propose Spatially-aware Window Attention (SWA), a novel mechanism that incorporates local spatial context into attention. SWA significantly improves scene completion and achieves state-of-the-art results on LiDAR-based SOP benchmarks. We further validate its generality by integrating SWA into a camera-based SOP pipeline, where it also yields consistent gains across modalities.
BibTeX
@misc{cao2025swa,
  author = {Helin Cao and Rafael Materla and Sven Behnke},
  title = {{SWA-SOP: Spatially-aware Window Attention for Semantic Occupancy Prediction in Autonomous Driving}},
  year = {2025},
  eprint = {2506.18785},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2506.18785},
}
Figure