Skip to main content
QUICK REVIEW

[Paper Review] QuadMamba: Learning Quadtree-based Selective Scan for Visual State Space Model

Fei Xie, Weijia Zhang|arXiv (Cornell University)|Oct 9, 2024
Video Surveillance and Tracking MethodsComputer Science6 citations
TL;DR

QuadMamba introduces a learnable quadtree-based selective scan to adapt Mamba State Space Models for vision, achieving strong performance with linear complexity across classification, detection, and segmentation.

ABSTRACT

Recent advancements in State Space Models, notably Mamba, have demonstrated superior performance over the dominant Transformer models, particularly in reducing the computational complexity from quadratic to linear. Yet, difficulties in adapting Mamba from language to vision tasks arise due to the distinct characteristics of visual data, such as the spatial locality and adjacency within images and large variations in information granularity across visual tokens. Existing vision Mamba approaches either flatten tokens into sequences in a raster scan fashion, which breaks the local adjacency of images, or manually partition tokens into windows, which limits their long-range modeling and generalization capabilities. To address these limitations, we present a new vision Mamba model, coined QuadMamba, that effectively captures local dependencies of varying granularities via quadtree-based image partition and scan. Concretely, our lightweight quadtree-based scan module learns to preserve the 2D locality of spatial regions within learned window quadrants. The module estimates the locality score of each token from their features, before adaptively partitioning tokens into window quadrants. An omnidirectional window shifting scheme is also introduced to capture more intact and informative features across different local regions. To make the discretized quadtree partition end-to-end trainable, we further devise a sequence masking strategy based on Gumbel-Softmax and its straight-through gradient estimator. Extensive experiments demonstrate that QuadMamba achieves state-of-the-art performance in various vision tasks, including image classification, object detection, instance segmentation, and semantic segmentation. The code is in https://github.com/VISION-SJTU/QuadMamba.

Motivation & Objective

  • Motivate adapting Mamba to vision tasks by preserving 2D locality and handling multi-granularity visual signals.
  • Propose a learnable quadtree-based scanning module to form locality-aware 1D sequences for Vision Mamba.
  • Enable end-to-end training with differentiable partitioning via Gumbel-Softmax and sequence masking.
  • Incorporate omnidirectional window shifting to capture informative features across regions.
  • Demonstrate strong performance on ImageNet-1k, COCO, and ADE20K compared to CNNs, Transformers, and prior Mamba models.

Proposed method

  • Partition image into 4x4 patches and embed to tokens.
  • Predict a partition map to guide bi-level quadtree partitioning into coarse and fine windows.
  • Construct a differentiable 1D token sequence using Gumbel-Softmax-based masking and Hadamard/element-wise ops.
  • Apply QuadVSS blocks (Mamba-based) with shift and multi-stage Transformer-like structure.
  • Incorporate omnidirectional window shifting across blocks to enhance locality and cross-region information flow.
  • Tune architecture variants (Lite/Tiny/Small/Base) with configurable QuadVSS depth and channels.

Experimental results

Research questions

  • RQ1Can a learnable quadtree-based scan preserve 2D locality better than raster or fixed-window scans for Vision Mamba?
  • RQ2Does adaptive, multi-granularity partitioning improve long-range modeling and efficiency in vision tasks?
  • RQ3What is the impact of omnidirectional window shifting on localization and performance across tasks?
  • RQ4How do QuadMamba variants compare to CNNs, Vision Transformers, and prior Mamba backbones on ImageNet-1k, COCO, and ADE20K?

Key findings

  • QuadMamba variants achieve strong accuracy with lower or comparable FLOPs than contemporaries (e.g., QuadMamba-S: Top-1 82.4% on ImageNet-1k with 31M params and 5.5G FLOPs).
  • QuadMamba-S and -B surpass several CNN, Transformer, and Mamba backbones at similar complexity in object detection and instance segmentation on COCO (e.g., QuadMamba-S: APbox 46.7, APmask 42.4).
  • QuadMamba achieves semantic segmentation mIoU of 47.2% (QuadMamba-S) on ADE20K, competitive with or better than many baselines at similar cost.
  • Ablations show that coarse-to-fine, multi-level locality and multi-directional window shifts significantly improve performance over naive flattening and single-direction shifts.
  • Window partitioning scale and layer distribution (LP3) yield best trade-offs between accuracy and complexity.

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.