GeoMamba: Geometry-Aware State Space Modeling for Image Restoration

Dafeng Zhang, Shizhuo LiuNeurIPS 2026

TL;DR

When restoring degraded images, modern State Space Models (like Mamba) group similar-looking pixels from across the image into a single 1D line so they can share context—accidentally tricking the model's math into thinking distant parts of a photo are physically touching. GeoMamba fixes this spatial illusion by teaching the model to measure physical jump distances and continuously adapt to sharp edges. The result is crisper, more accurate image restoration without bloating model size or compute.

What Problem Does This Paper Address?

To fix a blurry or noisy photo, a neural network needs both local finesse and a global view (for example, borrowing texture from a clear windowpane on the left to fix a blurry one on the right). Vision Transformers are great at global context, handle it via self-attention, and pay a steep quadratic $\mathcal{O}(N^2)$ compute cost. State Space Models (SSMs), popularized by Mamba, offer a linear $\mathcal{O}(N)$ alternative by scanning 2D images as 1D sequences, updating a running "memory" step-by-step.

Recent models like MambaIRv2 improved this by ditching rigid row-by-row scanning for semantic reordering—shuffling pixels so similar textures sit next to each other in the 1D sequence. However, the authors uncover two subtle flaws with this trick:

  1. Geometry-Discretization Mismatch: SSMs originate from continuous-time physics. Their math assumes step $k-1$ and step $k$ happen smoothly right next to each other. When semantic reordering places a pixel from the top-left corner right before a pixel from the bottom-right, the SSM blindly carries its running memory across that massive spatial leap, bleeding unrelated structural artifacts across the image.
  2. The Quantization-Smoothing Dilemma: Recurrent memory naturally acts like a low-pass filter, smoothing out crisp edges. Existing fixes adjust how memory is read out by picking from a small, finite "prompt" codebook. Because natural textures vary smoothly rather than falling into neat discrete buckets, this creates abrupt transitions and fails to restore fine, high-frequency details.

Methods

GeoMamba builds on a standard image restoration pipeline (shallow feature extraction, stacked refinement blocks, and image reconstruction) and retains semantic pixel reordering, but rewires the core SSM transitions with two novel mechanisms:

  • Geometry-Adaptive Discretization (GAD): Before transitioning from one reordered pixel to the next, GAD calculates the normalized 2D Euclidean distance between their original locations on the image grid. It feeds this distance (via sinusoidal encoding and a tiny MLP) alongside pixel content to predict the SSM's internal time-step ($\Delta$). If two pixels are neighbors, $\Delta$ stays small and memory flows normally. If the scan jumps across the image, $\Delta$ grows large, mathematically decaying the transition matrix $\exp(\Delta \mathbf{A})$ toward zero. It acts as a soft reset, flushing out irrelevant history without losing the current pixel's signal.
  • Continuous Dynamic Matrix (CDM): Instead of picking readout adjustments from a discrete codebook, CDM calculates horizontal and vertical spatial gradients (first-order pixel differences) to spot high-contrast edges. A lightweight hyper-network ($3\times3$ depth-wise convolution and linear projection) takes the pixel features and gradients to regress a continuous, pixel-specific modulation parameter. This dynamically sharpens the output readout exactly where recurrent smoothing hurts most.
Figure 1: Analysis of geometric correlation and frequency characteristics. Up: Given the original image (left), we plot the relationship between the normalized spatial distance of tokens and the generated time-step ∆. Unlike the chaotic distribution in MambaIRv2 (center), our GAD module establishes a strong positive correlation (right), validating its ability to handle discontinuous spatial jumps. Down: 2D frequency spectra and the corresponding 1D radial frequency profile. The results demonstrate that our CDM mechanism effectively counteracts the inherent low-pass filtering tendency of SSMs, preserving significantly more high-frequency details.

Datasets

No new benchmarks are introduced; the authors strictly follow established protocols for fair comparison:

  • Super-Resolution (SR): Trained on DIV2K (lightweight) and DF2K (classic). Evaluated across $2\times, 3\times$, and $4\times$ upsampling on Set5, Set14, BSDS100, Urban100, and Manga109.
  • Gaussian Color Denoising & JPEG Artifact Reduction: Trained on a mix of DIV2K, Flickr2K, BSDS500, and WED. Denoising is tested on CBSD68, Kodak24, McMaster, and Urban100; JPEG artifact removal is tested on Classic5 and LIVE1.

Key Insights and Ideas

  • Token order is a geometric constraint, not just a formatting trick: Flattening 2D vision into 1D sequences breaks spatial causality. Giving the SSM's time-step a physical sense of distance turns its native decay math into an automatic gatekeeper against cross-image artifacts (pushing distance-to-timestep correlation from $-0.0134$ in MambaIRv2 up to $0.8188$).
  • True Euclidean geometry matters: In ablations comparing Euclidean distance against Manhattan (grid-like) distance and 1D rank-jump distance, Euclidean won across the board. Because it is isotropic, it treats diagonal and straight jumps by their true physical length, aligning cleanly with continuous-space SSM math.
  • Explicit gradients rescue high frequencies: Spectral profiles show SSMs lose energy at high spatial frequencies. Feeding simple local contrast cues directly into a continuous readout matrix counteracts this blurriness without needing massive extra parameters.

Key Results

GeoMamba consistently outperforms strong CNN, Transformer (SwinIR, HAT), and Mamba baselines:

  • Smarter, not bigger: In lightweight SR, GeoMamba beats MambaIRv2-light across scales while using 17K fewer parameters (e.g., 757K vs. 774K at $2\times$) and nearly identical compute (290.5G vs. 286.3G MACs).
  • Excelling on tricky structures: Gains are most pronounced on datasets full of repeating grids, windows, and sharp ink lines—places where unmitigated spatial jumps wreak havoc. On classic $4\times$ SR for Urban100, GeoMamba reaches 28.02 dB PSNR, beating MambaIRv2-B by 0.13 dB and the heavy-hitting Transformer HAT by 0.05 dB.
  • Complementary components: On lightweight $2\times$ Urban100, adding GAD alone boosts the baseline by +0.08 dB, CDM alone adds +0.08 dB, and combining them yields a +0.23 dB jump. It also transfers well, beating MambaIRv2 on color denoising and matching it on JPEG artifact reduction.

Limitations and Future Work

While the authors do not dedicate a standalone section to limitations, they note empirically that on smooth natural images or saturated benchmarks (like Set5, BSDS100, or JPEG artifact reduction at quality $q=40$), performance margins are quite modest because existing baselines already cluster near the ceiling. For future work, the authors suggest a broader paradigm shift: state-space vision architectures should stop treating token-scanning order merely as an efficiency puzzle, and start modeling the physical geometry of how recurrent memory travels through space.

Summary updated

Abstract

State space models (SSMs) provide an efficient route to global image restoration because they model long sequences with linear complexity. Recent restoration architectures further enlarge the effective context by reordering image tokens so that semantically similar pixels become neighbors in the 1D scan. This strategy improves texture aggregation, but it also exposes a mismatch between the geometry of images and the discretization used by SSMs: adjacent tokens in the reordered sequence can be spatially distant, while the recurrent update still treats them as consecutive samples of a continuous process. In addition, existing prompt-based modulation relies on a finite set of discrete prompts, which is poorly matched to the continuous variation of natural textures and offers no explicit compensation for the low-pass tendency of recurrent integration. We propose GeoMamba, a geometry-aware and continuously modulated SSM for image restoration. GeoMamba introduces geometry-adaptive discretization (GAD), which conditions the SSM time-step on the Euclidean distance between consecutive reordered tokens and attenuates history propagation across spatial jumps. It also introduces a continuous dynamic matrix (CDM), which regresses pixel-wise modulation parameters from feature and gradient cues to reduce prompt quantization and preserve high-frequency details. Experiments on lightweight and classical image super-resolution demonstrate consistent improvements over strong Transformer- and Mamba-based baselines, while achieving better or competitive performance in additional denoising and JPEG artifact reduction settings.
BibTeX
@inproceedings{zhang2026geomamba,
  author = {Dafeng Zhang and Shizhuo Liu},
  title = {{GeoMamba: Geometry-Aware State Space Modeling for Image Restoration}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2026},
  url = {https://openreview.net/forum?id=ztrNOMAstc},
}
Figure