← Back to learning

Mamba × TTT · IRSTD

Turn a two-dimensional image into four directional readings.

VMamba: Visual State Space Model · NeurIPS 2024. Understand SS2D indexing, merging, and hierarchical structure to judge what it preserves for tiny targets.

About 20 min

Course chapters
Progress and notes stay in this browser.

Paper mechanism: SS2D's four routes are not four straight lines

The feature map X∈ℝH×W×C is flattened into four complete sequences: row-major, column-major, and their reversals. Each route performs a selective scan, then maps back to the original pixel coordinates before merging. Every route visits all H×W positions.

X → row-major / column-major / reversed row-major / reversed column-major
Each route: selective_scan → inverse_permutation
Align to the same (i,j), then merge → Y

Original sources: VMamba · NeurIPS 2024 ↗

From SS2D to a vision backbone

The final NeurIPS VSS block combines LayerNorm, SS2D, an FFN, and residual connections and is stacked into a hierarchical backbone. Hierarchical representations can feed a dense-prediction decoder, but global semantics and original-pixel localization are different objectives.

Read the scan in Figure 2 and the final block in Figure 3, and pin the official code version. Details such as gating changed between the early preprint and the final version; the architecture diagram should match the version actually reproduced.

Multidirectional scans are complementary, but neither strictly rotation-invariant nor able to preserve all two-dimensional adjacencies. Consecutive sequence positions may cross from the end of one row to the start of the next.

Original sources: VMamba · NeurIPS 2024 ↗

A 3×3 target enters the backbone: three checkpoints

LocationWhat may be lostHow to check
Input and patch embeddingSubpixel contrast and bright-point peaksCompare target pixels before and after resizing; fix the interpolation method
Multistage downsamplingSpatial position and local boundariesRetain shallow skip connections; stratify misses by target area
Scanning and fusionWeak signals in a finite stateCompare local branches and one/four routes while controlling computation
A minimal parameter-inspection approach
# Illustration, not a complete reproduction of Tent
for name, module in model.named_modules():
    if isinstance(module, (BatchNorm2d, LayerNorm, GroupNorm)):
        print(name, type(module).__name__)
# Explicitly check trainable parameter names, counts, and nonzero gradients.
# Reset the model, optimizer, teacher, statistics, and cache.

Pause and test your intuition

Why apply an inverse permutation before merging SS2D outputs?

Connect this unit to your IRSTD work

Progress and notes stay in this browser.