Introduction
State Space Models (SSMs), particularly the Mamba architecture, have recently emerged as a compelling alternative to Transformers in natural language processing. Their primary appeal lies in their linear computational complexity relative to sequence length, which addresses the quadratic scaling bottleneck of the self-attention mechanism. However, translating this success to computer vision presents a unique challenge: while text is inherently 1D, images are 2D grids. Existing vision SSMs typically bridge this gap using manually designed, rigid scanning patterns to flatten images into sequences. This paper introduces DAMamba, a vision SSM that replaces these fixed heuristics with a Dynamic Adaptive Scan (DAS) mechanism, allowing the model to learn data-driven scanning paths that adapt to the content of the image.
The Problem: The Rigidity of Fixed Scanning
Previous attempts to adapt SSMs for vision, such as Vim or VMamba, rely on predefined scanning strategies—sweeping left-to-right, top-to-bottom, or utilizing fixed local blocks. While these methods allow 2D data to be processed by 1D SSMs, they are fundamentally limited by their lack of content awareness. A fixed scan treats every pixel or patch with the same priority, often separating pixels that belong to the same semantic object and disrupting spatial adjacency. For instance, a rigid scan might fail to maintain the continuity of a central subject, instead interleaving its features with irrelevant background noise. The authors argue that for SSMs to truly excel in vision, the scanning process must be flexible enough to focus on salient regions dynamically.
Methodology: Dynamic Adaptive Scan (DAS)
The core innovation of DAMamba is the Dynamic Adaptive Scan (DAS). Rather than following a predetermined path, DAS enables the model to determine the most informative sampling locations based on the input features.
Offset Prediction Network (OPN)
At the heart of DAS is the Offset Prediction Network (OPN), a lightweight module that processes the input feature map to predict 2D coordinate offsets for each patch. This approach is conceptually similar to Deformable Convolutions but is applied here to generate the sequence for an SSM. By predicting these offsets, the model can "shift" its attention toward important visual structures.
Differentiable Sampling and Sequence Formation
To ensure the entire architecture remains end-to-end trainable, the predicted offsets are added to the original patch coordinates, and the features are sampled using bilinear interpolation. This allows the network to learn optimal scanning paths through standard backpropagation. Once sampled, these features are arranged into a sequence and passed into the SSM for global feature extraction.
DAMamba Architecture
DAMamba integrates DAS into a hierarchical vision backbone. To complement the global modeling capabilities of the SSM, the architecture also incorporates convolutional positional encodings (Convpos) and convolutional Feed-Forward Networks (ConvFFN). These additions strengthen local feature extraction, resulting in a robust and versatile vision model.
Experimental Evaluation
The authors evaluated DAMamba across several standard benchmarks, demonstrating its superiority over existing SSMs, CNNs, and Vision Transformers (ViTs).
Image Classification (ImageNet-1K)
DAMamba achieves state-of-the-art results in classification tasks. The Tiny variant (DAMamba-T) reached 83.8% Top-1 accuracy, outperforming VMamba-T (82.6%) and ConvNeXt-T (82.1%). The Base model (DAMamba-B) achieved 85.2%, maintaining a significant lead over its predecessors.
Object Detection and Segmentation (COCO & ADE20K)
In downstream tasks, the benefits of dynamic scanning become even more apparent:
- COCO 2017: Using a Mask R-CNN framework, DAMamba-T achieved 48.5 AP for box detection and 43.4 AP for instance segmentation, surpassing VMamba-T by 1.2 and 0.7 points, respectively.
- ADE20K: For semantic segmentation, DAMamba-T reached 50.3 mIoU, a substantial 2.3-point improvement over VMamba-T.
Key Insights
The success of DAMamba highlights several critical points for future vision research:
- Data-Driven Routing: The bottleneck in vision SSMs is not the sequence modeling itself, but the method of sequence formation. Learning where to look is more effective than manual heuristics.
- Foreground Focus: Analysis of DAS scanning paths reveals that the model naturally learns to cluster sampling points around primary subjects while ignoring background clutter.
- Efficiency: The OPN adds minimal overhead—only 0.4M parameters and 0.07G FLOPs for the Tiny model—while providing a significant performance boost. Furthermore, DAMamba maintains competitive inference throughput on modern GPUs.
Conclusion and Future Work
DAMamba demonstrates that dynamic, content-aware scanning is a vital component for vision-based State Space Models. By allowing the model to learn its own scanning paths, DAMamba overcomes the limitations of rigid heuristics, achieving superior performance across classification, detection, and segmentation tasks.
While the dynamic sampling introduces irregular memory access patterns that can impact wall-clock speed on specific hardware, the theoretical efficiency and linear complexity of the model remain highly attractive. Future work will likely focus on scaling these models to larger parameter counts and exploring their application in high-resolution video or 3D modeling, where spatial-temporal scanning complexity is even more pronounced.
Summary updated