IPT-V2: Efficient Image Processing Transformer using Hierarchical Attentions

Zhijun Tu, Kunpeng Du, Hanting Chen, Hailing Wang, Wei Li, Jie Hu, Yunhe WangarXiv 2024

Abstract

Recent advances have demonstrated the powerful capability of transformer architecture in image restoration. However, our analysis indicates that existing transformer-based methods can not establish both exact global and local dependencies simultaneously, which are much critical to restore the details and missing content of degraded images. To this end, we present an efficient image processing transformer architecture with hierarchical attentions, called IPT-V2, adopting a focal context self-attention (FCSA) and a global grid self-attention (GGSA) to obtain adequate token interactions in local and global receptive fields. Specifically, FCSA applies the shifted window mechanism into the channel self-attention, helps capture the local context and mutual interaction across channels. And GGSA constructs long-range dependencies in the cross-window grid, aggregates global information in spatial dimension. Moreover, we introduce structural re-parameterization technique to feed-forward network to further improve the model capability. Extensive experiments demonstrate that our proposed IPT-V2 achieves state-of-the-art results on various image processing tasks, covering denoising, deblurring, deraining and obtains much better trade-off for performance and computational complexity than previous methods. Besides, we extend our method to image generation as latent diffusion backbone, and significantly outperforms DiTs.

Introduction

Image restoration tasks—such as removing noise, blur, or rain—require a delicate balance between fine-grained local textures and broad global context. While Convolutional Neural Networks (CNNs) excel at local patterns, they often struggle with global dependencies. Conversely, standard Transformers model long-range dependencies well but suffer from quadratic computational complexity, making high-resolution processing difficult. Previous efficient transformers, such as SwinIR (window-based) or Restormer (channel-based), often sacrifice either precise local interaction or true global connectivity. IPT-V2 addresses this "local vs. global" tug-of-war by combining hierarchical attentions to achieve state-of-the-art results with significantly improved efficiency.

Methodology

IPT-V2 introduces three core architectural innovations to optimize token interactions:

  1. Focal Context Self-Attention (FCSA): This module focuses on local and cross-channel interactions by applying a shifted window mechanism to channel self-attention. This allows the model to capture local details and mutual interactions across color channels while maintaining linear complexity.
  2. Global Grid Self-Attention (GGSA): To establish long-range dependencies, GGSA partitions the image into a uniform grid and calculates attention between pixels occupying the same relative position across different patches. This aggregates global spatial information with minimal computational overhead.
  3. Structural Re-parameterization (Rep-LeFFN): The Feed-Forward Network (FFN) is enhanced using multiple depth-wise convolutions (1x1, 3x3, 5x5) during training. These are mathematically collapsed into a single efficient operation during inference, providing a performance boost without increasing computational cost.

Experimental Evaluation

The model was evaluated across several standard benchmarks, including synthetic and real-world denoising (BSD68, SIDD, DND), deblurring (GoPro, DPDD), and deraining (Rain100H). Additionally, IPT-V2 was tested as a backbone for latent diffusion models on the ImageNet 256×256 dataset.

Key Insights and Attribution

Analysis using Local Attribution Maps (LAM) reveals that IPT-V2 utilizes a significantly wider and more relevant range of pixels for restoration compared to previous window-based transformers or CNNs. This broader "area of contribution" is a direct result of the hierarchical attention mechanism.

Local Attribution Maps (LAM) comparing IPT-V2 with other methods, demonstrating a larger area of contribution for image restoration.

Key Results

IPT-V2 demonstrates superior performance-to-complexity trade-offs across all tested tasks:

  • Efficiency: IPT-V2 Base+ outperforms the heavy-hitter GRL-B while utilizing 5x fewer FLOPs.
  • Denoising: On the Urban100 dataset ($\sigma=50$), IPT-V2 achieved a PSNR of 0.51 dB higher than Restormer.
  • Generative Performance: When used in diffusion models, IPT-V2 reached an FID of 7.71 after 800k iterations, significantly outperforming the 33.56 FID of the standard DiT-S/2 model.
Performance comparison of IPT-V2 against state-of-the-art methods across denoising, deraining, and image generation tasks.

Conclusion and Future Work

IPT-V2 successfully bridges the gap between local detail and global context in image processing. While highly efficient, future research could explore its scalability for extremely high-resolution (4K/8K) content and its application in video processing, where temporal dependencies add further complexity to the local-global trade-off.

Summary updated

BibTeX
@misc{tu2024ipt,
  author = {Zhijun Tu and Kunpeng Du and Hanting Chen and Hailing Wang and Wei Li and Jie Hu and Yunhe Wang},
  title = {{IPT-V2: Efficient Image Processing Transformer using Hierarchical Attentions}},
  year = {2024},
  eprint = {2404.00633},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2404.00633},
}
Figure