[Paper Review] Real-time Semantic Segmentation with Fast Attention
This paper proposes Fast Attention Network (FANet), a real-time semantic segmentation model that uses a novel fast spatial attention mechanism to efficiently capture long-range contextual dependencies at linear computational cost, enabling high accuracy on high-resolution images and videos. FANet achieves 75.5% mIoU at 72 FPS on Cityscapes, outperforming prior methods by ~50% in speed while maintaining state-of-the-art accuracy.
In deep CNN based models for semantic segmentation, high accuracy relies on rich spatial context (large receptive fields) and fine spatial details (high resolution), both of which incur high computational costs. In this paper, we propose a novel architecture that addresses both challenges and achieves state-of-the-art performance for semantic segmentation of high-resolution images and videos in real-time. The proposed architecture relies on our fast spatial attention, which is a simple yet efficient modification of the popular self-attention mechanism and captures the same rich spatial context at a small fraction of the computational cost, by changing the order of operations. Moreover, to efficiently process high-resolution input, we apply an additional spatial reduction to intermediate feature stages of the network with minimal loss in accuracy thanks to the use of the fast attention module to fuse features. We validate our method with a series of experiments, and show that results on multiple datasets demonstrate superior performance with better accuracy and speed compared to existing approaches for real-time semantic segmentation. On Cityscapes, our network achieves 74.4$\%$ mIoU at 72 FPS and 75.5$\%$ mIoU at 58 FPS on a single Titan X GPU, which is~$\sim$50$\%$ faster than the state-of-the-art while retaining the same accuracy.
Motivation & Objective
- To address the trade-off between high accuracy and real-time inference in semantic segmentation by efficiently capturing rich spatial context and fine-grained details.
- To reduce the computational cost of self-attention mechanisms in deep networks without sacrificing spatial or contextual information.
- To enable real-time processing of high-resolution inputs by applying spatial reduction to intermediate feature stages rather than downscaling input images.
- To extend the fast attention mechanism to video semantic segmentation for efficient spatial-temporal context modeling with constant computational cost.
Proposed method
- Introduces a fast spatial attention module that replaces softmax normalization in self-attention with cosine similarity, reducing complexity from O(n²c) to O(nc²).
- Leverages matrix-multiplication associativity to compute attention maps efficiently, achieving ∼n/c speedup over standard self-attention when n ≫ c.
- Applies spatial reduction to intermediate feature maps instead of input images, preserving high-resolution spatial details while reducing FLOPs.
- Uses a cascaded feature fusion strategy from deep to shallow stages to combine contextual and detailed features for final prediction.
- Generalizes fast attention to spatial-temporal context by extending it to video inputs with a fixed computational cost, regardless of temporal window size.
- Employs a lightweight encoder-decoder architecture with FANet-18 and FANet-34 variants optimized for speed and accuracy trade-offs.
Experimental results
Research questions
- RQ1Can a modified attention mechanism be designed to maintain rich spatial context while drastically reducing computational cost for real-time semantic segmentation?
- RQ2How can high-resolution spatial details be preserved in real-time models without increasing FLOPs?
- RQ3Can intermediate feature map spatial reduction outperform input image downscaling in accuracy and efficiency?
- RQ4Can the fast attention mechanism be extended to video segmentation with minimal computational overhead?
- RQ5Does combining fast attention with spatial reduction lead to state-of-the-art performance in both speed and accuracy for real-time semantic segmentation?
Key findings
- FANet achieves 74.4% mIoU at 72 FPS and 75.5% mIoU at 58 FPS on Cityscapes using a single Titan X GPU, outperforming prior state-of-the-art methods by ~50% in inference speed.
- On CamVid, FANet-18 achieves 29.5% mIoU at 142 FPS, outperforming BiseNet and ICNet in both accuracy and speed.
- On COCO-Stuff, FANet-34 achieves 29.5% mIoU at 142 FPS, surpassing ICNet in both accuracy and speed at 640×640 resolution.
- The spatial-temporal extension of fast attention (FANet+Temp) achieves 76.7% mIoU at 58 FPS on Cityscapes video, outperforming PEARL by 40× in speed and Netwarp by 200× in efficiency.
- FANet-18+Temp achieves 75.5% mIoU at 72 FPS with only 14ms average inference time, demonstrating low latency and high throughput.
- The ablation study confirms that intermediate feature reduction with fast attention preserves accuracy while reducing FLOPs, proving effective for high-resolution input processing.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.