[Paper Review] MaIR: A Locality- and Continuity-Preserving Mamba for Image Restoration
MaIR proposes a novel Mamba-based image restoration model that preserves locality and spatial continuity through a Nested S-shaped Scanning (NSS) strategy and Sequence Shuffle Attention (SSA) for cross-sequence aggregation. It achieves state-of-the-art performance across 14 benchmarks in super-resolution, denoising, deblurring, and dehazing, outperforming 40 baselines with minimal computational overhead.
Recent advancements in Mamba have shown promising results in image restoration. These methods typically flatten 2D images into multiple distinct 1D sequences along rows and columns, process each sequence independently using selective scan operation, and recombine them to form the outputs. However, such a paradigm overlooks two vital aspects: i) the local relationships and spatial continuity inherent in natural images, and ii) the discrepancies among sequences unfolded through totally different ways. To overcome the drawbacks, we explore two problems in Mamba-based restoration methods: i) how to design a scanning strategy preserving both locality and continuity while facilitating restoration, and ii) how to aggregate the distinct sequences unfolded in totally different ways. To address these problems, we propose a novel Mamba-based Image Restoration model (MaIR), which consists of Nested S-shaped Scanning strategy (NSS) and Sequence Shuffle Attention block (SSA). Specifically, NSS preserves locality and continuity of the input images through the stripe-based scanning region and the S-shaped scanning path, respectively. SSA aggregates sequences through calculating attention weights within the corresponding channels of different sequences. Thanks to NSS and SSA, MaIR surpasses 40 baselines across 14 challenging datasets, achieving state-of-the-art performance on the tasks of image super-resolution, denoising, deblurring and dehazing. The code is available at https://github.com/XLearning-SCU/2025-CVPR-MaIR.
Motivation & Objective
- To address the limitations of existing Mamba-based image restoration methods that disrupt spatial locality and continuity during 1D sequence flattening.
- To design a scanning strategy that preserves both local structure and spatial continuity in 2D images during sequence processing.
- To develop an effective sequence aggregation mechanism that captures complementary dependencies across differently unfolded sequences (e.g., forward and reversed rows/columns).
- To achieve state-of-the-art performance in image restoration without introducing significant computational cost.
Proposed method
- Proposes a Nested S-shaped Scanning (NSS) strategy that divides images into non-overlapping stripes and applies an S-shaped scanning path within and across stripes to preserve spatial continuity.
- Uses a shift-stripe mechanism within NSS to maintain continuity across stripe boundaries, ensuring smooth transitions in the scanning path.
- Introduces a Sequence Shuffle Attention (SSA) block that computes attention weights across corresponding channels of multiple sequences, enabling adaptive fusion of contextually distinct sequences.
- Employs a 3-step pipeline: (1) stripe-based 2D-to-1D flattening via NSS, (2) independent selective scan processing, and (3) SSA-based sequence aggregation.
- Designs NSS as a cost-free solution that preserves locality and continuity without additional parameters or computation.
- Leverages the inherent long-range modeling capability of Mamba while maintaining structural coherence through spatial-aware scanning and attention-based fusion.
Experimental results
Research questions
- RQ1How can a scanning strategy be designed to simultaneously preserve locality and spatial continuity in 2D image restoration using Mamba?
- RQ2What is the impact of different sequence unfolding patterns (e.g., Z-shaped, S-shaped, window-based) on image restoration performance?
- RQ3How can sequences processed via distinct scanning paths (e.g., forward vs. reversed rows/columns) be effectively aggregated to leverage complementary information?
- RQ4To what extent does the stripe width in the NSS strategy affect the final image restoration quality?
- RQ5Can a Mamba-based model achieve SOTA performance in image restoration while maintaining low computational cost and structural fidelity?
Key findings
- MaIR achieves state-of-the-art performance across 14 diverse image restoration benchmarks, surpassing 40 baselines in super-resolution, denoising, deblurring, and dehazing tasks.
- On the outdoor SOTS-Outdoor benchmark, MaIR improves PSNR by 2.67 dB over DehazeFormer and 2.04 dB over UVM-Net, despite using only 0.3% and 4.8% of UVM-Net’s parameters and MACs.
- Abllation studies confirm that NSS consistently outperforms alternative scanning strategies (Z-shaped, Hilbert, LocalMamba, ZigMa), with PSNR of 32.97 on Urban100 for ×2 super-resolution.
- SSA significantly improves performance over simple sequence-wise addition (PSNR: 32.97 vs. 32.90) and gating mechanisms (PSNR: 32.90), demonstrating its effectiveness in cross-sequence attention.
- The model shows robustness to stripe width variations, maintaining PSNR within 32.92–32.97 across widths 2 to 32 on Urban100, with optimal performance at widths 4–16.
- The proposed NSS and SSA components are computationally efficient, offering locality and continuity preservation without additional parameters or computational cost.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.