用结构感知融合提升视觉状态空间模型的长程依赖捕捉能力
Spatial-Mamba: Effective Visual State Space Models via Structure-aware State Fusion
- 直接在状态空间建模邻域连接,引入空洞卷积捕获图像结构依赖
- 单次扫描即达到分类、检测、分割任务的顶尖性能
- 理论统一Mamba与线性注意力,适合视觉建模研究者参考
选择性状态空间模型(SSMs)如Mamba在处理一维序列的长程依赖上表现优异,但在二维视觉任务中仍面临挑战。现有视觉SSM通常将图像转为一维序列并采用多种扫描模式以引入局部空间依赖,但这些方法在捕捉复杂图像空间结构方面有限,且扫描路径变长导致计算成本增加。为此,我们提出Spatial-Mamba,通过在状态空间中直接建立邻域连接,不依赖单一序列状态转移,而是引入结构感知状态融合机制,利用空洞卷积捕获图像空间结构依赖,显著增强视觉上下文信息流动。Spatial-Mamba分为三个阶段:单向扫描初始化状态、通过结构感知状态融合获取空间上下文、使用观测方程计算最终状态。理论分析表明,Spatial-Mamba在统一的矩阵乘法框架下整合了原始Mamba与线性注意力,提供了更深层理解。实验结果表明,即使仅一次扫描,Spatial-Mamba在图像分类、检测和分割任务上均达到或超越当前最优的基于SSM的模型。源代码与训练模型见https://github.com/EdwardChasel/Spatial-Mamba。
原文摘要 · Abstract (English)
Selective state space models (SSMs), such as Mamba, highly excel at capturing long-range dependencies in 1D sequential data, while their applications to 2D vision tasks still face challenges. Current visual SSMs often convert images into 1D sequences and employ various scanning patterns to incorporate local spatial dependencies. However, these methods are limited in effectively capturing the complex image spatial structures and the increased computational cost caused by the lengthened scanning paths. To address these limitations, we propose Spatial-Mamba, a novel approach that establishes neighborhood connectivity directly in the state space. Instead of relying solely on sequential state transitions, we introduce a structure-aware state fusion equation, which leverages dilated convolutions to capture image spatial structural dependencies, significantly enhancing the flow of visual contextual information. Spatial-Mamba proceeds in three stages: initial state computation in a unidirectional scan, spatial context acquisition through structure-aware state fusion, and final state computation using the observation equation. Our theoretical analysis shows that Spatial-Mamba unifies the original Mamba and linear attention under the same matrix multiplication framework, providing a deeper understanding of our method. Experimental results demonstrate that Spatial-Mamba, even with a single scan, attains or surpasses the state-of-the-art SSM-based models in image classification, detection and segmentation. Source codes and trained models can be found at https://github.com/EdwardChasel/Spatial-Mamba.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。