Non-local Attention Optimized Deep Image Compression

Haojie Liu, Tong Chen, Peiyao Guo, Qiu Shen, Xun Cao, Yao Wang, Zhan MaarXiv 2019

Abstract

Deep image compression has seen significant progress with Variational Autoencoders (VAEs), yet standard convolutional architectures often fail to exploit long-range dependencies and treat all features with uniform importance. This paper presents the Non-local Attention Optimized Deep Image Compression (NLAIC) framework. By incorporating non-local attention modules and a novel 3D masked convolution for entropy coding, NLAIC captures both global and local correlations while adaptively allocating bits to salient regions. Experimental results on the Kodak dataset demonstrate that NLAIC achieves state-of-the-art performance, significantly outperforming traditional codecs like BPG and existing learned compression models.

Introduction

Most deep image compression models rely on stacked convolutional neural networks (CNNs). While effective, these architectures have two major limitations. First, standard convolutions have local receptive fields, processing only small neighborhoods. This makes it difficult for the model to exploit global redundancies or long-range correlations within an image. Second, many models treat all latent features as equally important. In reality, human vision is more sensitive to certain areas, such as textures and edges, than others. While some previous works used "importance maps" to allocate bits adaptively, they often required extra bits to transmit those maps, reducing overall efficiency.

The NLAIC Framework

The NLAIC architecture builds upon the hierarchical VAE structure, integrating several key components to address these limitations. The framework consists of a main encoder-decoder pair and a hyperprior encoder-decoder pair, which work in tandem with a conditional context model to optimize the compression process.

The overall architecture of the NLAIC framework, featuring main and hyperprior encoder-decoder pairs integrated with a conditional context model.

Non-local Attention Module (NLAM)

To capture long-range dependencies, NLAIC embeds Non-local Attention Modules into both the main and hyperprior paths. Inspired by non-local neural networks used in video recognition, these modules allow the network to compute a weighted average of features across the entire spatial domain.

A critical innovation of this approach is the generation of implicit attention masks. Instead of signaling an importance map explicitly, the NLAM generates masks that weigh features based on their importance. Because these masks are generated internally by the architecture from the input features, they provide "adaptive bit allocation" without the overhead of extra signaling bits. This allows the network to prioritize complex textures and edges automatically during end-to-end training.

(a) Architecture of the non-local block. (b) The Non-local Attention Module (NLAM) generating implicit attention masks to weigh feature importance without extra signaling overhead.

3D Masked Convolution for Context Modeling

To improve entropy coding—the process of losslessly compressing the latent features—the authors introduce a $5 \times 5 \times 5$ 3D masked CNN. Unlike the 2D masked convolutions used in prior work, this 3D approach more effectively exploits correlations across both spatial dimensions and feature channels simultaneously. This transition to 3D context modeling significantly reduces the number of parameters needed while better capturing the statistical redundancies between different feature channels.

Experimental Results

The model was trained using the COCO and CLIC datasets, with images randomly cropped into $192 \times 192 \times 3$ patches. Performance was benchmarked on the Kodak dataset, a standard gold-standard for image compression research.

Rate-Distortion Performance

NLAIC outperforms traditional codecs including JPEG, JPEG2000, and BPG (4:4:4). It also shows a clear margin of improvement over previous state-of-the-art learned models. Specifically, the "NLAIC joint" model achieves a 64.39% BD-Rate reduction compared to legacy JPEG420 and a 12.26% reduction compared to BPG444.

Qualitative Quality

Visual results show that NLAIC preserves more realistic textures and avoids the "blocky" artifacts common in JPEG or the "blurry" look often found in other deep learning methods at low bitrates. By finding similarities between distant parts of an image, the model produces a more compact and visually faithful representation.

Conclusion and Future Work

NLAIC represents a significant step forward in learned image compression by effectively leveraging global context and adaptive feature weighting. While non-local operations and 3D convolutions are computationally intensive, the authors suggest that parallelization and hardware acceleration will make them practical for mobile deployment. Future work includes extending this framework's ability to capture spatial and temporal priors into the domain of end-to-end video compression.

Summary updated

BibTeX
@misc{liu2019non,
  author = {Haojie Liu and Tong Chen and Peiyao Guo and Qiu Shen and Xun Cao and Yao Wang and Zhan Ma},
  title = {{Non-local Attention Optimized Deep Image Compression}},
  year = {2019},
  eprint = {1904.09757},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/1904.09757},
}
Figure