Abstract
Learned Image Compression (LIC) has increasingly adopted attention mechanisms from Vision Transformers to improve performance. However, standard window-based self-attention often introduces redundancy by aggregating similar features across all patches within a window. This paper presents GABIC (Graph-based Attention Block for Image Compression), which treats image patches as nodes in a dynamic graph. By utilizing a $k$-Nearest Neighbors ($k$-NN) approach, GABIC constrains attention to the most informative neighbors, reducing bit allocation for redundant information. Experimental results show that GABIC achieves a BD-Rate gain of 1.50% on the Kodak dataset, demonstrating superior efficiency, especially at high bit rates.
Introduction
In the field of Learned Image Compression (LIC), researchers have transitioned from simple Convolutional Neural Networks (CNNs) to sophisticated attention mechanisms derived from Vision Transformers (ViTs). While window-based self-attention, such as that used in Swin Transformers, has significantly boosted performance, it often suffers from feature redundancy. In a standard window, every patch attends to every other patch, potentially aggregating redundant visual information into the latent representation. Since compression efficiency relies on minimizing bit usage, representing redundant data leads to suboptimal rate-distortion (RD) performance. GABIC addresses this by constraining the attention mechanism to focus only on the most informative neighbors.
Methods: Graph Window Attention Module (G-WAM)
The primary innovation of GABIC is the Graph Window Attention Module (G-WAM). This module shifts from fixed, fully connected attention windows to a flexible, dynamic graph structure.
Graph Representation and Dynamic k-NN
The input feature map is partitioned into $M \times M$ windows, where each patch is treated as a node in a graph. Instead of a dense attention pattern, GABIC identifies the $k$-Nearest Neighbors for each patch in the feature space. This graph is dynamic; edges are updated during each iteration based on current feature characteristics.
Graph Convolution and Integration
A graph convolutional operator updates patch embeddings by computing attention coefficients only for the $k$ selected neighbors. This pruning effectively removes "noise" and redundant information. GABIC is a generalized framework: by setting $k$ to the total number of patches in a window, it reverts to standard window-based attention.
The G-WAM is integrated into a state-of-the-art LIC architecture featuring a Variational Autoencoder (VAE) with a hyperprior and a channel-wise autoregressive entropy model.
Experimental Results
The model was trained on a subset of 300,000 images from the OpenImages dataset and evaluated on the Kodak and CLIC benchmarks.
Rate-Distortion Performance
GABIC demonstrated significant gains over the Zou2022 baseline:
- Kodak: ~1.50% BD-Rate gain.
- CLIC: ~0.89% BD-Rate gain.
The performance advantage is most notable at high bit rates (high PSNR), where GABIC's ability to preserve fine, irregular details without redundancy is most critical.
Computational Efficiency
Despite the inclusion of $k$-NN logic, GABIC maintains a complexity profile similar to standard local attention models. On the Kodak dataset, GABIC requires approximately 348M FLOPs, nearly identical to the 349M FLOPs of the baseline.
Key Insights
- Sparsity via Graphing: Treating self-attention as a Graph Attention Network (GAT) allows for targeted, sparse operations that reduce bit allocation for redundant features.
- Detail Preservation: The graph-based approach excels at capturing irregular local shapes and contours that rigid grid-based windows might miss.
Limitations and Future Work
GABIC currently faces challenges at low bit rates, where it may over-allocate bits to "flat" or simple regions. Future research will focus on hybrid mechanisms capable of simultaneously capturing both high-frequency irregular details and low-frequency regular shapes to improve performance across all quality levels.
Summary updated