Frequency-Aware Transformer for Learned Image Compression

Han Li, Shaohui Li, Wenrui Dai, Chenglin Li, Junni Zou, Hongkai Xiong

In the world of image compression, there is a long-standing battle between "traditional" codecs (like JPEG, BPG, and the state-of-the-art VVC) and "learned" image compression (LIC) models based on neural networks. While AI models have recently taken the lead in performance, they often lack the elegant mathematical interpretability of classical methods like wavelets.

A new paper from researchers at Shanghai Jiao Tong University and Tsinghua University, published at ICLR 2024, bridges this gap. Their Frequency-Aware Transformer (FAT) model reintroduces multiscale directional analysis—a staple of classical signal processing—into the heart of the Transformer architecture.

The Problem: Isotropic Blind Spots in AI Compression

Most modern AI-based compression models use Convolutional Neural Networks (CNNs) or standard Transformers. While powerful, these architectures have a "blind spot": they are generally isotropic. A standard square window in a Transformer treats horizontal, vertical, and diagonal patterns the same way.

However, natural images are highly anisotropic. Think of a picket fence (vertical lines) or a horizon (horizontal lines). Classical compression techniques like Wavelets or Curvelets excel because they decompose images into specific directional subbands. Existing AI models often produce redundant latent representations because they fail to exploit these directional frequency characteristics efficiently.

Multiscale and directional window partitioning

Methods: Making Transformers Frequency-Aware

The researchers introduced three core innovations to make Transformers "frequency-aware":

Overall architecture of the FAT-LIC model
  1. Frequency-Decomposition Window Attention (FDWA): Instead of using only square windows, FDWA uses four different window shapes in parallel:
  2. Square ($s \times s$): Captures high-frequency details.
  3. Large Square ($4s \times 4s$): Captures low-frequency global structure.
  4. Vertical ($s \times 4s$): Specifically targets vertical frequency components.
  5. Horizontal ($4s \times s$): Specifically targets horizontal frequency components.
  6. Frequency-Modulation Feed-Forward Network (FMFFN): Standard feed-forward layers operate in the spatial domain. FMFFN takes the features into the frequency domain using a Fast Fourier Transform (FFT), applies a learnable filter to "equalize" or modulate different frequencies, and then brings them back via an Inverse FFT. This allows the model to adaptively prioritize which frequencies are worth keeping based on the available bitrate.
  7. Transformer-based Channel-wise Autoregressive (T-CA) Model: For the entropy bottleneck (the part that actually turns data into bits), the authors replaced standard CNNs with a Transformer that uses masked-slice channel attention. This allows the model to better predict the probability of a pixel based on previously decoded "slices" of data, leading to much tighter compression.

Datasets and Key Results

The model was trained on the Flickr2W and ImageNet-1k datasets (totaling 3.2M training steps). Evaluation was performed on industry-standard benchmarks including Kodak, Tecnick, and CLIC Professional Validation.

The FAT model achieved impressive quantitative gains:

  • BD-Rate Improvement: Compared to the latest traditional standard VTM-12.1 (VVC), the model reduced the bitrate required for the same quality by 14.5% (Kodak), 15.1% (Tecnick), and 13.0% (CLIC).
  • Visual Quality: Qualitatively, the model preserves directional textures (like the weave of a fabric or the slats of a window) much better than previous AI models, which tend to "smudge" these areas.
  • Complexity Trade-off: While the model has more parameters than some simpler CNN models (~71M), its computational complexity (GFLOPs) is lower than several recent high-performing Transformers, making it a competitive candidate for real-world deployment.

Key Insights

  • Geometry Matters: The "aha moment" here is that the shape of the attention window acts as a structural prior. By forcing the network to look through "slits" (rectangular windows), the authors effectively mimic the directional filters used in classical Multiscale Geometric Analysis (MGA).
  • The "Equalizer" Effect: The FMFFN acts like an audio equalizer for images. At low bitrates, it can learn to suppress high-frequency noise that would otherwise cost too many bits, while at high bitrates, it preserves the sharp edges.

Limitations and Future Work

  • Directional Limits: Currently, the FDWA only supports horizontal and vertical directions. Real-world images have diagonal and curved structures that could benefit from even more diverse window shapes or "Scattering Transforms."
  • Video Compression: This paper focuses strictly on still images. Extending this frequency-aware approach to the temporal dimension (video) is a logical—but computationally difficult—next step.
  • Complexity: While more efficient than some Transformers, it is still significantly more "heavy" than traditional codecs like JPEG, requiring powerful GPUs for real-time performance.

Reference: Li, H., et al. "Frequency-Aware Transformer for Learned Image Compression." ICLR 2024. GitHub Link

Summary updated

BibTeX
@inproceedings{li2024frequency,
  author = {Han Li and Shaohui Li and Wenrui Dai and Chenglin Li and Junni Zou and Hongkai Xiong},
  title = {{Frequency-Aware Transformer for Learned Image Compression}},
  booktitle = {International Conference on Learning Representations},
  year = {2024},
  url = {https://openreview.net/forum?id=HKGQDDTuvZ},
}
Figure