# CoScan: Multi-Scale Content-Adaptive Space-Filling Scans for Causal State-Space Image Restoration

AI.info

> Mamba-style state-space models process an image by flattening its 2D pixel grid into a 1D sequence, and the order of that flattening strongly affects how well the model can use spatial context…

**arXiv**: 2611.23717 · accepted · NEURIPS

**Published**: 2026-11-18

**Authors**: Wei Dong, Terry Ji, Yan Min, Shahram Shirani, Jun Chen, Han Zhou

## In plain words

Mamba-style state-space models process an image by flattening its 2D pixel grid into a 1D sequence, and the order of that flattening strongly affects how well the model can use spatial context, because each output only sees tokens that came before it.

## AI summary

## Overview

- **Research area:** Computer vision — image restoration with Mamba-based (selective state-space) networks, specifically the design of 2D-to-1D scan orders.
- **Technical level:** Advanced (assumes familiarity with state-space models, minimum spanning trees, and space-filling curves).
- **Scope:** The paper proposes CoScan, a content-adaptive space-filling scan framework that can be plugged into existing Mamba restoration backbones to improve low-light enhancement, deblurring, raindrop removal, dehazing, and super-resolution.

## What This Paper Is About

Mamba-style state-space models process an image by flattening its 2D pixel grid into a 1D sequence, and the order of that flattening strongly affects how well the model can use spatial context, because each output only sees tokens that came before it. Existing scan orders (row-wise, serpentine, window-based, diagonal, Hilbert) are fixed and ignore image content, and recent adaptive variants either jump around and break locality or revisit pixels repeatedly, so on degraded images they produce fragmented, semantically inconsistent context. The paper's goal is to learn scan orders that follow the image's actual content, stay spatially coherent, work at multiple feature resolutions, and start at informative regions.

## Key Contributions

1. **A differentiable learning framework for content-adaptive space-filling scans.** CoScan builds on the "cover-and-merge" space-filling-curve construction (2×2 circuit cover, dual graph, minimum spanning tree) but adds a learned weight generator plus a trained proxy evaluator that supplies differentiable supervision from three scan-quality objectives: short-range autocorrelation, autoregressive causal predictability, and spatial adjacency preservation.
2. **An efficient multi-scale scan construction.** Rather than regenerating a curve per resolution, the method coarsens the fine-level minimum spanning tree: intra-block edges are collapsed, inter-block edges are merged by median pooling, and a new MST is computed on the coarse graph, giving structure-consistent curves across U-Net scales.
3. **A frequency-guided start selection strategy.** A high-frequency saliency map (Fourier high-pass, normalized to [0,1]) is unfolded along the curve, split into K contiguous segments via dynamic programming, and scored by average frequency weight times length raised to a power α; the highest-scoring segment becomes the sequence prefix.
4. **A plug-and-play integration module (CAMM) with prefix global tokens.** The content-aware scan replaces the default scan in existing Mamba blocks, and 8 global tokens predicted by a lightweight MLP from pooled features are prepended to the sequence and discarded after the state-space layers.

## Main Findings

- **Low-light enhancement (LOL):** CoScan + MaIR reaches 24.1634 PSNR, 0.8537 SSIM, 0.1037 LPIPS, a +0.66 dB gain over the best non-Mamba baseline (Restormer) and PSNR gains of +1.07 dB (MambaIR), +0.89 dB (EAMamba), and +0.87 dB (MaIR) over their respective backbones. On real-world sets (MEF, DICM, LIME, NPE averages), CoScan + MaIR achieves the highest average CLIP-IQA (0.592) and lowest average NIQE (3.23), beating the second-best method by 0.045 and 0.16 respectively.
- **Deblurring:** CoScan + MaIR achieves 33.55 PSNR / 0.941 SSIM on GoPro and 31.76 / 0.929 on HIDE, a +1.53 dB and +1.50 dB margin over Restormer, and +0.58 dB and +1.34 dB over the MaIR backbone. MambaIR improves from 27.70 to 29.36 (GoPro) and 26.10 to 28.22 (HIDE); EAMamba from 30.15 to 31.28 and 28.57 to 30.15.
- **Raindrop removal:** CoScan + MaIR reaches 32.45 PSNR, 0.923 SSIM, 0.059 LPIPS, 0.488 MANIQA, 71.57 MUSIQ, lifting MaIR from 30.74 PSNR and enabling Mamba backbones to exceed non-Mamba methods such as HINet (31.20) and NAFNet (31.13).
- **Dehazing (RESIDE-6K):** CoScan + MaIR reaches 30.67 / 0.963 indoor and 31.24 / 0.966 outdoor with 23.5 M parameters and 35.2 G MACs on 128×128 patches — lower cost than MaIR (26.3 M, 49.3 G) and MambaIR (26.8 M, 57.5 G).
- **Super-resolution (×4):** CoScan + MaIR obtains 33.34 / 29.61 / 28.51 / 28.07 / 33.05 PSNR on Set5, Set14, B100, Urban100, and Manga109, an average +0.34 dB over MaIR.
- **Ablation (LOL, MaIR backbone):** Starting from 22.98 PSNR for the raw generated scan, adding multi-scale scan scaling gives +0.45 dB, adding frequency-guided start selection a further +0.54 dB, and adding prefix global tokens a further +0.19 dB, ending at 24.16 PSNR, 0.854 SSIM, 0.104 LPIPS.
- **Optimization ablation:** Plain NeuralSFC-style weights give 23.09 PSNR; adding Dafner anchoring via the ranking loss raises this to 23.73 (a 0.30 dB gain and 0.011 LPIPS improvement); adding the autoregressive and adjacency objectives raises SSIM to 0.847 and reaches 23.95; the full configuration reaches 24.16.
- **Comparison to other adaptive scans:** The paper argues MambaIRv2 contains significant jumps that damage locality, while DAMamba revisits tokens and deviates only slightly from row-wise scanning; CoScan adapts to content while remaining structure-consistent and causality-aligned.
- **High-level vision tasks:** The abstract mentions "promising results on high-level vision tasks," but no quantitative results for those tasks appear in the provided content.

## Methodology in Plain English

The researchers start from a classical way of drawing a single continuous path through every pixel of an image exactly once — a space-filling curve. That path is built by tiling the image with small 2×2 loops, linking neighboring loops with a minimum spanning tree whose edge costs depend on pixel-value differences, and then merging the loops along that tree.

Their key move is to make the loop-linking costs something a network can learn from the image rather than a hand-crafted rule. A small generator predicts the costs; a separate evaluator network is trained to predict three quality scores for any resulting path — how well neighboring values along the path correlate, how predictable each value is from the previous eight, and how often 4-neighbor pixels end up far apart in the sequence. Because building the tree itself is not differentiable, the evaluator acts as a differentiable stand-in, letting gradients flow back into the generator. A margin-based ranking term keeps the learned path at least as good as the classical reference in terms of autocorrelation.

For a U-Net-style network that processes features at several resolutions, they do not redraw the path at each scale; instead they shrink the tree — pooling edge weights by median across coarse blocks and recomputing the tree on the coarse grid — so the coarse paths remain structurally consistent with the fine one. Finally, they compute a high-frequency map of the input, cut the path into segments, pick the segment with the largest frequency-weighted length, and rotate the path to begin there, so informative structure appears early in the causal sequence. The resulting order simply replaces the default scan inside existing Mamba blocks, with 8 learned global tokens prepended as a compressed summary.

## Why This Matters

- **Research impact:** The work reframes scan-order design as a learnable, content-aware component of causal vision models rather than a fixed geometric choice, and provides concrete objectives (autocorrelation, autoregressive residual variance, adjacency) for what a "good" scan is. It also shows a practical route to injecting non-differentiable graph structures into gradient-based training via a learned proxy.
- **Real-world applications:** - Night-time and low-light photography on phones and cameras. - Motion-blur removal for handheld capture, with the paper specifically highlighting recovery of degraded text and facial features. - Raindrop removal for automotive and outdoor camera systems, where occluded regions must be reconstructed. - Dehazing for surveillance and outdoor vision, plus ×4 super-resolution for upscaling archival or sensor-limited imagery.
- **Industry relevance:** The method is a drop-in replacement that improves results on top of existing backbones without added computation — CoScan + MaIR actually reduces parameters and MACs relative to the backbone on dehazing — which lowers the barrier for deployment in computational-photography pipelines.

## Future Directions

- **End-to-end training.** CoScan currently uses a two-stage proxy: an evaluator is trained on ground-truth objectives, then a generator is trained against it. Training the scan generator jointly with the restoration network could remove this indirection and align the scan directly with restoration loss.
- **Extension beyond still images.** The paper studies 2D single-image restoration; whether the same content-adaptive, start-selected curves transfer to video or volumetric data, where an extra temporal axis must be linearized, is left open.
- **Cost and efficiency of curve construction.** The pipeline still involves MST computation and an evaluator network per image; the paper reports minimal overhead but does not break down the runtime of the curve-generation stage itself.
- **Validation on high-level tasks.** The abstract claims promising results on high-level vision, but the supplied content reports no such numbers, so a systematic evaluation on classification, detection, or segmentation remains to be shown.

## Target Audience

Researchers and graduate students working on efficient vision backbones, state-space/Mamba architectures, and image restoration; engineers deploying restoration models who want accuracy gains without extra inference cost; and anyone interested in learned discrete structures — scan orders, traversal paths, token serialization — inside neural networks. Beginners will struggle with the space-filling-curve and state-space formalism, though the qualitative figures are accessible.

## Authors’ abstract

Selective state-space models (SSMs) have recently shown strong potential for efficient image restoration. A central difficulty, however, is that a 2D feature map typically needs to be linearized into a 1D token sequence for causal state-space updates, making restoration performance highly sensitive to the imposed scan order. Existing deterministic scans follow space-filling principles but remain fixed and content-agnostic, and can yield fragmented or semantically…

[The full abstract on arXiv](https://arxiv.org/abs/2611.23717)

[Read the original paper](https://arxiv.org/abs/2611.23717)

## Related papers

- [NTIRE 2025 Challenge on Low Light Image Enhancement: Methods and Results](https://ai.info/paper/ntire-2025-challenge-on-low-light-image-enhancement-methods-and-results-2510.13670) 2025-10-15 · cs.CV · Also by Han Zhou, Jun Chen +2
- [Zero-Reference Joint Low-Light Enhancement and Deblurring via Visual Autoregressive Modeling with VLM-Derived Modulation](https://ai.info/paper/zero-reference-joint-low-light-enhancement-and-deblurring-via-visual-2511.18591) 2025-11-23 · cs.CV · Also by Han Zhou, Jun Chen +1
- [FastFrames: Video Generation at Interactive Latency](https://ai.info/paper/fastframes-video-generation-at-interactive-latency-2611.23226) 2026-11-17 · cs.CV · Also by Wei Dong
- [Depth Pro 2: Sharp and Temporally Consistent Metric Monocular Depth](https://ai.info/paper/depth-pro-2-sharp-and-temporally-consistent-metric-monocular-depth-2611.26603) 2026-11-19 · cs.CV · Also by Wei Dong
- [VideoAuto-R1: Video Auto Reasoning via Thinking Once, Answering Twice](https://ai.info/paper/videoauto-r1-video-auto-reasoning-via-thinking-once-answering-twice-2601.05175) 2026-01-08 · cs.CV · Also by Jun Chen

---

Canonical: https://ai.info/paper/coscan-multi-scale-content-adaptive-space-filling-scans-for-causal-2611.23717
