Abstract
Video semantic segmentation is critical for autonomous systems but often suffers from high computational costs or temporal inconsistency. We present LMANet, a lightweight module that leverages a local memory attention mechanism to incorporate temporal context from preceding frames. By restricting attention to local neighborhoods, LMANet avoids the quadratic complexity of global attention while effectively filtering spatial noise. Our approach achieves significant accuracy improvements on the Cityscapes dataset—up to +2.1% mIoU—with minimal inference overhead, making it suitable for real-time applications.
1. Introduction
Semantic segmentation—the task of assigning a class label to every pixel—is a cornerstone of autonomous driving. While most models process video frame-by-frame, this approach ignores the rich temporal context available in a video stream. Existing methods to exploit this data usually rely on computationally expensive optical flow or difficult-to-train Recurrent Neural Networks (RNNs).
LMANet addresses this gap with a simple, fast, and general module that can be integrated into virtually any existing architecture to improve temporal consistency and accuracy without sacrificing real-time performance.
2. Methodology
The Local Memory Attention Network (LMANet) consists of three main components designed for efficiency and accuracy.
2.1 Memory Module
LMANet maintains an explicit memory that stores "Keys" (low-dimensional features) and "Values" (rich semantic features) from the last few frames ($S=3$ to $5$). Unlike RNNs, this memory is updated at every step, providing a stable temporal reference.
2.2 Local Key Matching
Standard Transformer-style attention compares every pixel in the current frame to every pixel in memory, resulting in $O((HW)^2)$ complexity. LMANet exploits a temporal prior: an object at a given position is likely to remain in the same neighborhood in the next frame. By limiting the search to a local radius ($R$), complexity is reduced to $O(HW \cdot R^2)$, which also filters out "wrong correlations" from similar-looking objects elsewhere in the scene.
2.3 Attention-based Fusion
Once relevant features are read from memory, a fusion module decides how much to trust the memory versus the current frame. It uses sigmoid-activated gates to handle dynamic events like occlusions or new objects entering the frame.
3. Experimental Results
The researchers evaluated LMANet on the Cityscapes dataset, using both the lightweight ERFNet and the accuracy-focused PSPNet backbones.
- Quantitative Gains: ERFNet + LMANet improved mIoU by 1.67% (72.05% → 73.72%) with only 1.5ms of overhead. PSPNet + LMANet saw a 2.14% mIoU boost.
- Efficiency: Local attention is significantly more memory-efficient. For a search radius of $R=21$, GPU memory overhead was only 13%, compared to 166% for global matching.
- Qualitative Stability: The model showed much better temporal stability, specifically reducing flickering on thin or distant objects like traffic lights and barriers.
4. Conclusion and Future Work
LMANet demonstrates that locality is a powerful inductive bias for video segmentation. While the current two-step training process and fixed search radius are areas for improvement, the module provides a superior speed-to-accuracy trade-off. Future work may explore adaptive search regions or integrating sparse global memory to handle long-term occlusions.
Summary updated