Linear Attention Modeling for Learned Image Compression

Donghui Feng, Zhengxue Cheng, Shen Wang, Ronghua Wu, Hongwei Hu, Guo Lu, Li Song

Abstract

Recent years, learned image compression has made tremendous progress to achieve impressive coding efficiency. Its coding gain mainly comes from non-linear neural network-based transform and learnable entropy modeling. However, most studies focus on a strong backbone, and few studies consider a low complexity design. In this paper, we propose LALIC, a linear attention modeling for learned image compression. Specially, we propose to use Bi-RWKV blocks, by utilizing the Spatial Mix and Channel Mix modules to achieve more compact feature extraction, and apply the Conv based Omni-Shift module to adapt to two-dimensional latent representation. Furthermore, we propose a RWKV-based Spatial-Channel ConTeXt model (RWKV-SCCTX), that leverages the Bi-RWKV to modeling the correlation between neighboring features effectively. To our knowledge, our work is the first work to utilize efficient Bi-RWKV models with linear attention for learned image compression. Experimental results demonstrate that our method achieves competitive RD performances by outperforming VTM-9.1 by -15.26%, -15.41%, -17.63% in BD-rate on Kodak, CLIC and Tecnick datasets.

Introduction

Learned Image Compression (LIC) has recently surpassed classical methods like JPEG or HEVC by utilizing deep neural networks to learn efficient image representations. Currently, state-of-the-art LIC models rely heavily on Transformers due to their ability to capture long-range dependencies. However, Transformers suffer from quadratic computational complexity ($O(N^2)$) relative to pixel count, leading to high latency and memory consumption for high-resolution images. While window-based attention offers a partial solution, it restricts the model's receptive field. LALIC addresses this by introducing a linear attention mechanism ($O(N)$) that maintains a global receptive field with significantly lower complexity.

Methodology

LALIC introduces two primary architectural innovations based on the Receptance Weighted Key Value (RWKV) framework, originally developed for natural language processing.

Bi-RWKV Transform Blocks

The core backbone utilizes bidirectional RWKV blocks. To adapt this 1D sequence-based architecture for 2D image data, the authors incorporate an Omni-Shift module. This module uses a reparameterized 5x5 depthwise convolution to capture local spatial context, providing a necessary spatial prior before the linear attention mechanism processes the global image structure.

The LALIC architecture, highlighting the Bi-RWKV block and the Omni-Shift layer used for spatial-channel modeling.

RWKV-SCCTX

For entropy modeling, LALIC employs the RWKV-based Spatial-Channel ConTeXt model (RWKV-SCCTX). This model partitions data into slices and leverages RWKV blocks to effectively model correlations across both spatial and channel dimensions, improving the probability estimation of latent representations.

Experimental Results

The model was trained on the OpenImages dataset and evaluated on standard benchmarks including Kodak, Tecnick, and CLIC Professional Validation.

Compression Performance and Efficiency

LALIC achieves a significant trade-off between compression gain and computational cost. It outperforms the VTM-9.1 reference codec with BD-rate reductions of -15.26% on Kodak and -17.63% on Tecnick. Crucially, it maintains a decoding latency of approximately 150ms, making it substantially faster than other high-performance models like FAT or MLIC++.

Performance comparison showing LALIC's superior balance of BD-Rate reduction and decoding latency compared to existing models.

Receptive Field Analysis

Visualization of the Effective Receptive Field (ERF) confirms that LALIC maintains a much wider, global view of the image compared to competing window-based models. This global perspective allows the model to identify and eliminate redundancies across the entire frame, leading to superior bitrate savings.

Conclusion

LALIC demonstrates that linear attention is a highly effective "sweet spot" for image compression, offering the global modeling capabilities of Transformers with the efficiency of linear complexity. While adapting 1D linear attention to 2D data remains a design challenge, the success of the Omni-Shift layer points toward a promising hybrid approach. Future work will explore extending this architecture to video compression, where the benefits of linear complexity are even more pronounced.

Summary updated

BibTeX
@inproceedings{feng2025linear,
  author = {Donghui Feng and Zhengxue Cheng and Shen Wang and Ronghua Wu and Hongwei Hu and Guo Lu and Li Song},
  title = {{Linear Attention Modeling for Learned Image Compression}},
  booktitle = {IEEE/CVF Conference on Computer Vision and Pattern Recognition},
  year = {2025},
  url = {https://openreview.net/forum?id=pxWnMKwaSr},
}
Figure