Deformba: Vision State Space Model with Adaptive State Fusion
May 10, 2026 ยท View on GitHub
Deformba: Vision State Space Model with Adaptive State Fusion
Deformba: Vision State Space Model with Adaptive State Fusion, ICML 2026, Paper
WorkFlow

Abstaract
State Space Models (SSMs) have emerged as a powerful and efficient alternative to Transformers, demonstrating linear-time complexity and exceptional sequence modeling capabilities. However, their application to vision tasks remains challenging. First, existing vision SSMs largely depend on manually designed fixed scanning methods to flatten image patches into sequences, which imposes predefined geometric structures and increases the complexity. Second, the broader adoption of vision SSMs is hindered in domains that require query-based interactions between distinct information streams. This is a result of the inherently causal and self-referential nature of SSMs designed for 1D sequence modeling tasks. This fusion mechanism is indispensable for critical perception tasks such as multi-view 3D fusion. To address these limitations, we propose Deformba, a context adaptive method that dynamically augments the spatial structural information while maintaining the linear complexity of SSMs. Deformba also allows multi-modal fusion, analogous to standard cross attention. To demonstrate the effectiveness and general applicability of Deformba, we test its performance on general 2D vision tasks such as image classification, object detection, instance segmentation, and semantic segmentation, as well as 3D vision tasks like BEV perception. Extensive experiments show that Deformba achieves strong performance across various visual perception benchmark.
๐ ๏ธ Getting Started
-
Clone repo
git clone https://github.com/amai-gsu/Deformba.git cd Deformba -
Create and activate a new conda environment
conda create -n Deformba python=3.10 conda activate Deformba -
Install dependent packages
pip install --upgrade pip pip install -r requirements.txt cd models/selective_scan && pip install . cd models/ops_dcnv3 sh ./make.sh
๐ Data Preparation
-
ImageNet is an image database organized according to the WordNet hierarchy. Download and extract ImageNet train and val images from http://image-net.org/. Organize the data into the following directory structure:
imagenet/ โโโ train/ โ โโโ n01440764/ (Example synset ID) โ โ โโโ image1.JPEG โ โ โโโ image2.JPEG โ โ โโโ ... โ โโโ n01443537/ (Another synset ID) โ โ โโโ ... โ โโโ ... โโโ val/ โโโ n01440764/ (Example synset ID) โ โโโ image1.JPEG โ โโโ ... โโโ ... -
COCO is a large-scale object detection, segmentation, and captioning dataset. Please visit http://cocodataset.org/ for more information, including for the data, paper, and tutorials. COCO API also provides a concise and efficient way to process the data.
-
ADE20K is composed of more than 27K images from the SUN and Places databases. Please visit https://ade20k.csail.mit.edu/ for more information and see the GitHub Repository for an overview of how to access and explore ADE20K.
โจ Pre-trained Models
| name | pretrain | resolution | acc@1 | #param | FLOPs | download |
|---|---|---|---|---|---|---|
| Deformba-T | ImageNet-1K | 224x224 | 83.8 | 25M | 4.8G | ckpt |
| Deformba-S | ImageNet-1K | 224x224 | 84.9 | 45M | 10.3G | ckpt |
| Deformba-B | ImageNet-1K | 224x224 | 85.4 | 85M | 16.3G | ckpt |
๐ Quick Start
-
Image Classification
To train Deformba models for classification on ImageNet, use the following commands for different configurations:
cd classification python -m torch.distributed.launch --nnodes=1 --node_rank=0 --nproc_per_node=8 --master_addr="127.0.0.1" --master_port=20000 main.py --cfg </path/to/config> --batch-size 128 --data-path </path/of/dataset> --output /tmpTo evaluate the performance with pre-trained weights:
cd classification python -m torch.distributed.launch --nnodes=1 --node_rank=0 --nproc_per_node=8 --master_addr="127.0.0.1" --master_port=20000 main.py --cfg </path/to/config> --batch-size 128 --data-path </path/of/dataset> --output /tmp --pretrained </path/of/checkpoint> --evalTo test the throughput of model:
cd classification/models python3 benchmark.py --batch-size 128 --model Deformba