CAMSR: Content-Aware State Space Model for Lightweight Image Super-Resolution

Xiaoyan Lei, Biao Luo, Wenlong Zhang, Weifeng CaoarXiv 2026

TL;DR

Mamba models are fast and great at capturing long-range dependencies, but their unidirectional "causal" nature—reading pixels one by one like words in a sentence—limits how well they can reconstruct images. Instead of brute-forcing multiple scan directions, CAMSR clusters visually similar pixels together before scanning, letting a single Mamba scan capture global context. The result is state-of-the-art lightweight image super-resolution using just 371K parameters and 24.1G FLOPs.

What Problem Does This Paper Address?

Lightweight image super-resolution (SR) aims to upscale low-resolution images on mobile and edge devices where memory and compute budgets are tight. Recently, Mamba (a State Space Model) has emerged as a promising alternative to Transformers because its computational complexity scales linearly with image size rather than quadratically.

There is a catch, though. Mamba is inherently causal: its output at position $i$ only depends on inputs $1, 2, \dots, i$. For time-series data, that makes sense. For images, it means a pixel only "knows" about the pixels above and to the left of it.

To get around this, existing vision Mamba models use multi-directional scanning (e.g., scanning left-to-right, right-to-left, top-to-bottom, and bottom-to-top). While this breaks the causal constraint, it inflates parameter counts, FLOPs, and inference latency—and as the authors show, it introduces significant feature redundancy.

Comparison of Mamba scanning modes and LAM visualizations

Methods

The authors propose CAMSR (Content-Aware State Space Model for Lightweight Image Super-Resolution), which replaces multi-directional scanning with a single, content-aware scan. Its core building blocks are:

  • Content-Aware Sequence Generator (CASG): Instead of scanning pixels in fixed spatial rows, CASG groups semantically and texturally similar feature tokens together. It initializes $K=64$ cluster centers, computes the cosine similarity between each token and the centers, and reorders the 1D sequence so similar tokens sit next to each other. During training, centers are refined via a K-means-like update and stabilized with an exponential moving average (EMA). At inference, the learned centers are fixed to save compute.
  • Content-Aware State-Space Equation (CASE): Once tokens are grouped, CASE injects a low-rank, learnable prompt matrix (queried by each token's cluster assignment) into the state-space equation. This lets spatially distant but visually similar pixels interact directly within a single scan.
  • Residual Content-Aware Attention Block (RCAB): Each block pairs the Content-Aware State Space Model (CA-SSM) with Enhanced Spatial Attention (ESA)—which highlights key spatial structures like edges—and a Convolutional Feed-Forward Network (ConvFFN) for local spatial and channel-wise refinement.

The network uses 6 Residual Content-Aware Attention Groups (each with one RCAB) and is trained with a two-stage progressive learning strategy: first on $64 \times 64$ patches, then on $80 \times 80$ patches using L1 loss.

Overall architecture of CAMSR and its sub-modules

Datasets

  • Training: DF2K (3,450 high-quality images; also ablated against DIV2K's 800 images).
  • Bicubic SR Evaluation: Five standard benchmarks—Set5, Set14, BSD100, Urban100, and Manga109—at $\times 2$, $\times 3$, and $\times 4$ scales, evaluated via Y-channel PSNR and SSIM.
  • Real-World SR Evaluation: RealSR (Canon and Nikon subsets) and AIM2019-val, evaluated using PSNR, SSIM, and LPIPS.

Key Insights and Ideas

  • More scans $\neq$ better details: Using Local Attribution Maps (LAM), the authors show that going from 2-way to 4-way scanning ("Mix") increases parameters and FLOPs without meaningfully improving SR reconstruction quality.
  • Clustering beats learned routing: Prior work like SGN uses linear projections to route tokens, which can over-rely on high-level semantics and distort fine, low-level textures. CASG's cosine-similarity clustering produces cleaner, more coherent similarity maps and suppresses irrelevant background noise.
  • Mirrored padding matters: Because sequence lengths aren't always divisible by the number of clusters $K$, padding is needed. Zero-padding biases cluster centers toward zero vectors; flipping the tail of the sequence to pad it preserves statistical consistency and improves reconstruction.

Key Results

  • Bicubic $\times 4$ SR: With 371K parameters and 24.1G FLOPs, CAMSR achieves 32.22 dB PSNR on Set5, 28.63 dB on Set14, 27.61 dB on BSD100, 26.07 dB on Urban100, and 30.54 dB on Manga109—outperforming or matching heavier CNNs and the Mamba-based DVMSR (424K params). With self-ensemble (CAMSR+), it achieves the best PSNR and SSIM across all five benchmarks.
  • Massive memory savings over Transformers: Compared to CATANet (379K params) under identical training settings, CAMSR reduces FLOPs by 36% (24.1G vs. 37.5G) and slashes maximum GPU memory usage by 87% (978M vs. 7,956M), while slightly outperforming it on RealSR.
  • Real-world SR: When trained with GAN-based real-world degradation (CAMSR-Real), it achieves the best LPIPS scores on RealSR-canon (0.2932) and RealSR-nikon (0.2963), reconstructing sharper textures without over-smoothing.
PSNR vs. Parameters vs. FLOPs comparison on Set5 x4

Limitations and Future Work

On real-world degradation benchmarks (RealSR and AIM2019-val), CAMSR and CAMSR-Real do not consistently outperform all compared methods across every dataset and metric. The authors do not explicitly outline future research directions, though they note that achieving strong real-world performance with such a compact model size points to promising potential for resource-constrained, real-world SR applications.

Summary updated

BibTeX
@misc{lei2026camsr,
  author = {Xiaoyan Lei and Biao Luo and Wenlong Zhang and Weifeng Cao},
  title = {{CAMSR: Content-Aware State Space Model for Lightweight Image Super-Resolution}},
  year = {2026},
  eprint = {2612.04965},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2612.04965},
}
Figure