Introduction
Semantic segmentation—the task of assigning a category label to every pixel—becomes significantly more complex in the context of video. While frame-by-frame processing is possible, it fails to leverage temporal relationships, often leading to flickering or inconsistent results. Historically, researchers relied on optical flow to track motion and maintain consistency. However, optical flow requires heavy computation and is prone to error propagation during occlusions or fast motion.
The Temporal Memory Attention Network (TMANet) addresses these issues by replacing explicit motion estimation with a self-attention mechanism that retrieves relevant features from a memory bank of past frames.
Methodology
TMANet consists of four primary stages designed to capture long-range temporal relations efficiently.
- Shared Backbone: A standard feature extractor (e.g., ResNet-50) processes the current "query" frame and a sequence of $T$ past "memory" frames.
- Encoding Layers: These layers use 1x1 convolutions for channel reduction and 3x3 convolutions to preserve spatial context, producing "Keys" (for matching) and "Values" (containing feature data).
- Temporal Memory Attention (TMA) Module: This core component compares the "Key" of the current frame against the "Keys" of all frames in the memory bank. This creates an attention map identifying relevant past information, which is then used to retrieve corresponding "Values."
- Feature Aggregation: The retrieved memory features are concatenated with the current frame's features and passed to a segmentation head for final prediction.
Experimental Setup
The model was evaluated on two major benchmarks for urban scene understanding:
- Cityscapes: 5,000 high-quality images of urban driving scenes with 19 classes.
- CamVid: A dataset consisting of 4 video sequences with 11 semantic categories.
Key Results and Insights
TMANet achieves state-of-the-art (SOTA) results while maintaining high efficiency compared to existing methods.
- Accuracy: On Cityscapes, TMANet achieved 80.3% mIoU, outperforming the previous leader, TDNet (79.9%). On CamVid, it reached 76.5% mIoU, again surpassing TDNet (76.0%).
- Efficiency: TMANet requires only 754 GFLOPs, significantly lower than TDNet (1082 GFLOPs) and traditional flow-based methods like DFF or Netwarp, which exceed 919 GFLOPs.
Ablation Insights
- Memory Depth: Increasing memory from 2 to 4 frames provides a significant boost, though 6 frames show diminishing returns, suggesting 4 frames is the "sweet spot."
- Sampling Strategy: Continuous frame sampling (immediate past) outperformed random sampling because the visual representation remains more highly correlated.
- Spatial Context: The inclusion of 3x3 convolutions in the encoding layer is vital; using only 1x1 convolutions degrades performance by losing local spatial structures.
Conclusion
TMANet demonstrates that explicit optical flow is not strictly necessary for high-performance video segmentation. By utilizing a temporal memory attention mechanism, the framework achieves superior accuracy and efficiency, offering a robust alternative for real-time urban scene understanding.
Summary updated