Content-Aware Mamba for Learned Image Compression

Yunuo Chen, Zezheng Lyu, Bing He, Hongwei Hu, Qi Wang, Yuan Tian, Li Song, Wenjun Zhang, Guo Lu

TL;DR: CMIC (Content-Aware Mamba-based Image Compression) reimagines how State-Space Models (SSMs) process images. By replacing rigid, predefined scanning patterns with content-adaptive token reordering and injecting global image "prompts" to break Mamba's strict causality, the model achieves state-of-the-art compression efficiency with linear computational complexity.

The Challenge of 2D Image Compression

Learned Image Compression (LIC) requires a delicate balance between capturing global redundancy—finding patterns across an entire image—and maintaining computational efficiency.

Recently, Mamba (a type of State-Space Model) has emerged as a faster alternative to Transformers. While Transformers possess a "global view," they suffer from quadratic complexity ($O(N^2)$). Mamba offers linear complexity ($O(N)$), making it highly efficient. However, Mamba was originally designed for 1D sequences like text. To adapt it for 2D images, researchers typically rely on a "raster scan," processing pixels row by row.

Content-Agnostic vs. Content-Adaptive Scanning

This standard approach has two major flaws:

  1. Rigid Scanning: A raster scan is "content-agnostic." It might process a blue sky pixel in the top-left and a similar blue sky pixel in the bottom-right thousands of steps apart, making it difficult for the model to recognize their redundancy.
  2. Strict Causality: Mamba is inherently causal, meaning a pixel can only "see" what came before it in the scan sequence. This clashes with the nature of images, where a pixel’s context depends on neighbors in all directions.

Introducing Content-Aware Mamba (CAM)

To overcome these limitations, the authors introduce Content-Aware Mamba (CAM), which features two primary innovations integrated into a Variational Autoencoder (VAE) architecture:

Overall Architecture of CMIC
  • Content-Adaptive Token Permutation (CTP): Instead of a fixed spatial scan, the model uses a learnable codebook to cluster similar features. It then reorders the sequence so that pixels with similar content (e.g., all "grass" pixels or all "sky" pixels) are placed next to each other in the 1D chain. This allows the SSM to focus on feature-space proximity rather than just Euclidean distance.
  • Global-Prior Prompting (GPP): To fix the causality problem without the massive overhead of scanning the image in multiple directions (a common but slow workaround), the authors inject a sample-specific global prompt into the Mamba equations. This prompt acts as a statistical summary of the entire image, allowing the model to "see" the global context at every single step of the sequence.

These CAM blocks are combined with window-based attention for local details, creating a robust pipeline for both short- and long-range dependencies.

Key Insights

  • Semantic Proximity > Spatial Proximity: The most striking realization is that for compression, the order in which pixels are processed shouldn't be fixed spatially. By reorganizing the image into "content-consistent" sequences, Mamba can eliminate redundancy much more effectively.
  • Breaking Causality with Prompts: Rather than making the model bi-directional (which doubles the computational load), giving the model a global "cheat sheet" effectively mitigates the limitations of one-way processing.
  • Visualizing the Receptive Field: Effective Receptive Field (ERF) visualizations demonstrate that the model actually "looks" at semantically related regions. While previous models showed cross-shaped or square-shaped focus areas, CMIC’s focus areas morph to match the shapes of objects in the image.

Performance and Results

The model was trained on the Flickr2W dataset and evaluated on standard benchmarks including Kodak, Tecnick, and CLIC. CMIC achieves impressive gains over both traditional and neural codecs:

  • Rate-Distortion Performance: It surpasses VTM-21.0 (the state-of-the-art traditional codec) by 15.91% to 21.34% in BD-rate, meaning it achieves the same visual quality with significantly less data.
  • Efficiency: Compared to other Mamba-based models like MambaIC, CMIC achieves a 78% reduction in GPU memory usage. This is because it uses a single, smart scan instead of computationally expensive multi-directional scans.
  • Speed: It maintains high throughput, outperforming Transformer-based models in decoding latency on high-resolution (2K) images.

Limitations and Future Work

The authors noted that while the CAM blocks were highly effective in the transform part of the network (turning the image into latent bits), they provided negligible gains when used in the entropy model (the part that predicts the probability of those bits). In the entropy model, local context—provided by simple convolutions—still appears to be the dominant factor.

Future research could explore more sophisticated clustering mechanisms or attempt to adapt this content-aware scanning logic to the temporal dimension of video compression, where redundancy exists across both space and time.

Summary updated

BibTeX
@inproceedings{chen2026content,
  author = {Yunuo Chen and Zezheng Lyu and Bing He and Hongwei Hu and Qi Wang and Yuan Tian and Li Song and Wenjun Zhang and Guo Lu},
  title = {{Content-Aware Mamba for Learned Image Compression}},
  booktitle = {International Conference on Learning Representations},
  year = {2026},
  url = {https://openreview.net/forum?id=WwDNiisZQm},
}
Figure