Skip to main content
QUICK REVIEW

[Paper Review] RTFormer: Efficient Design for Real-Time Semantic Segmentation with Transformer

Jian Wang, Chenhui Gou|arXiv (Cornell University)|Oct 13, 2022
Advanced Neural Network ApplicationsComputer Science76 citations
TL;DR

RTFormer introduces a dual-resolution transformer with GPU-friendly attention and cross-resolution attention to achieve state-of-the-art real-time semantic segmentation accuracy with high FPS on Cityscapes, CamVid, ADE20K, and COCOStuff.

ABSTRACT

Recently, transformer-based networks have shown impressive results in semantic segmentation. Yet for real-time semantic segmentation, pure CNN-based approaches still dominate in this field, due to the time-consuming computation mechanism of transformer. We propose RTFormer, an efficient dual-resolution transformer for real-time semantic segmenation, which achieves better trade-off between performance and efficiency than CNN-based models. To achieve high inference efficiency on GPU-like devices, our RTFormer leverages GPU-Friendly Attention with linear complexity and discards the multi-head mechanism. Besides, we find that cross-resolution attention is more efficient to gather global context information for high-resolution branch by spreading the high level knowledge learned from low-resolution branch. Extensive experiments on mainstream benchmarks demonstrate the effectiveness of our proposed RTFormer, it achieves state-of-the-art on Cityscapes, CamVid and COCOStuff, and shows promising results on ADE20K. Code is available at PaddleSeg: https://github.com/PaddlePaddle/PaddleSeg.

Motivation & Objective

  • Motivate real-time semantic segmentation with transformer-based networks and address GPU-friendly attention and efficiency concerns.
  • Propose RTFormer block and dual-resolution architecture to balance global context modeling with inference speed.
  • Show empirical results across Cityscapes, CamVid, ADE20K, and COCOStuff demonstrating superior speed-accuracy trade-offs.

Proposed method

  • Introduce RTFormer block with a low-resolution branch using GPU-Friendly Attention (GFA) derived from external attention with grouped double normalization.
  • In the high-resolution branch, apply Cross-resolution Attention to inject global context from the low-resolution branch.
  • Use a stepped layout to fuse information from low- and high-resolution branches and employ two 3x3 conv-based FFN without feature-dimension expansion.
  • Construct RTFormer by combining initial convolutional stems and last two stages with RTFormer blocks, plus a DAPPM-based segmentation head.
  • Pretrain on ImageNet and fine-tune on segmentation datasets with standard augmentations and training schedules as described.

Experimental results

Research questions

  • RQ1Can a dual-resolution transformer with GPU-friendly attention achieve real-time inference without sacrificing segmentation accuracy?
  • RQ2Does cross-resolution attention effectively propagate high-level global context from low-resolution branches to high-resolution features?
  • RQ3What is the impact of various attention and FFN designs on speed (FPS) and accuracy (mIoU) in real-time segmentation?
  • RQ4How does RTFormer perform on standard real-time benchmarks (Cityscapes, CamVid) and generalized scenes (ADE20K, COCOStuff) compared to CNN-based and other transformer-based methods?

Key findings

  • RTFormer-Slim achieves 76.3% mIoU at 110.0 FPS on Cityscapes (real-time balance).
  • RTFormer-Base achieves 79.3% mIoU at 39.1 FPS on Cityscapes, setting state-of-the-art among real-time methods at the time.
  • On CamVid, RTFormer-Slim reaches 81.4% mIoU at 190.7 FPS, with 4.8M parameters.
  • On ADE20K, RTFormer-Base attains 42.1% mIoU at 71.4 FPS.
  • On COCOStuff, RTFormer-Base attains 35.3% mIoU at 143.3 FPS.
  • Ablations show GPU-Friendly Attention outperforms multi-head external and self-attention in speed-accuracy trade-offs; cross-resolution attention provides further gains with modest FPS drop.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.