Introduction
Computer vision architectures have long grappled with the trade-off between global receptive fields and computational efficiency. While Convolutional Neural Networks (CNNs) offer efficiency through local sliding windows, they often lack a global context. Conversely, Vision Transformers (ViTs) provide global modeling but suffer from quadratic complexity relative to image resolution. State Space Models (SSMs), specifically the Mamba architecture, have emerged as a promising alternative, offering linear complexity with global modeling capabilities. However, adapting Mamba—originally designed for 1D sequences—to 2D image data presents a significant structural challenge.
The Challenge of 2D Scanning
Standard applications of SSMs to images involve flattening 2D grids into 1D sequences using fixed patterns such as raster or snake scans. These approaches are inherently "content-blind," treating all regions of an image with uniform priority regardless of their semantic importance. Furthermore, fixed scans often disrupt spatial relationships, placing pixels that are adjacent in 2D space far apart in the 1D processing sequence.
Methods: Deformable Scanning (DS)
DefMamba addresses these limitations by introducing a content-aware, Deformable Scanning (DS) strategy. Unlike rigid, predefined paths, DefMamba dynamically adjusts both the spatial location of pixels and their order in the processing sequence based on the input image.
The architecture utilizes a hierarchical backbone incorporating several key innovations:
- Point Offset: Inspired by deformable convolutions, this mechanism shifts reference points toward salient image regions, ensuring the model focuses on informative features.
- Index Offset: This novel component allows the model to dynamically reorder the sequence of tokens. By allowing the scan to "jump" between spatially related but sequence-distant points, it preserves 2D topology within the 1D SSM framework.
- Deformable Mamba (DM) Blocks: These blocks integrate the DS strategy into the Mamba architecture. They maintain standard forward and backward scanning branches for stability while adding a deformable branch to enhance feature capture.
Experimental Evaluation
DefMamba was evaluated across three primary benchmarks: ImageNet-1K (classification), MS COCO 2017 (detection and segmentation), and ADE20K (semantic segmentation).
Key Results
- ImageNet-1K: DefMamba-T achieved a Top-1 accuracy of 78.6%, a 2.5% improvement over the ViM-T baseline.
- MS COCO: The model reached 47.5 box mAP, outperforming established architectures like Swin-T and ConvNeXt-T.
- ADE20K: It set a new benchmark for SSM-based models with a 48.8 mIOU.
- Efficiency: DefMamba-T demonstrates significant efficiency gains, reducing computational overhead by up to 60% compared to non-hierarchical Mamba models while maintaining superior performance.
Discussion and Limitations
The primary strength of DefMamba lies in its content-awareness. Activation maps indicate that the model focuses precisely on object boundaries and intricate structures that fixed-scan models often overlook. However, the authors noted two specific failure modes:
- Truncated Objects: When objects are partially outside the frame, the deformable mechanism may fail to capture full context, reverting toward standard scanning patterns.
- Repetitive Textures: In scenes with highly regular, grid-like patterns (e.g., tiled walls), the model struggles to find unique landmarks, leading to "indolent" learning where the offsets do not provide significant benefit over fixed scans.
Conclusion
DefMamba represents a significant step forward in adapting State Space Models for computer vision. By moving away from rigid 1D flattening and toward dynamic, deformable scanning, the model achieves a more effective balance of global context and spatial preservation. Future research will likely focus on improving robustness in the presence of repetitive patterns and partial occlusions.
Summary updated