DLGSANet: Lightweight Dynamic Local and Global Self-Attention Networks for Image Super-Resolution

Xiang Li, Jiangxin Dong, Jinhui Tang, Jinshan Pan

TL;DR

This paper introduces DLGSANet, a novel lightweight network for image super-resolution that effectively balances local and global feature extraction using dynamic self-attention mechanisms. By proposing a sparse global attention module and a dynamic local attention module, DLGSANet achieves competitive accuracy with significantly fewer parameters and lower computational costs compared to existing state-of-the-art methods.

What Problem Does This Paper Address?

Image Super-Resolution (SISR) aims to reconstruct a high-resolution image from a low-resolution input. While traditional methods like bicubic interpolation are simple, they produce blurry results. Convolutional Neural Networks (CNNs) have significantly improved SISR quality, but often require a large number of parameters and high computational costs, limiting their real-world applicability. More recently, Vision Transformers (ViTs) have shown promise due to their ability to model global contexts with fewer parameters. However, standard ViTs are computationally expensive, and existing adaptations like shifted window attention can limit the ability to model continuous local features and aggregate information outside of windows. This paper addresses the need for an SISR method that is both lightweight and effective, capable of capturing both fine-grained local details and broader global context without the computational burden of existing Transformer-based approaches.

Methods

The core of DLGSANet is its Hybrid Dynamic-Transformer Block (HDTB), which integrates two novel modules:

  • Multi-Head Dynamic Local Self-Attention (MHDLSA): This module aims to extract local features efficiently. It uses a dynamic weight generation network, incorporating a depth-wise convolutional layer, to create spatial-variant filters. These filters are then used as dynamic local attention to aggregate local features. A gated feed-forward network is applied for further feature representation enhancement.
  • Sparse Global Self-Attention (SparseGSA): Recognizing that not all token similarities are relevant for feature aggregation, this module aims to select only the most useful global similarities. It employs a ReLU activation function after calculating attention scores, effectively sparsifying the attention map by removing negative or less relevant similarities. This allows for better utilization of global features for reconstruction.

These HDTBs are organized into Residual Hybrid Dynamic-Transformer Groups (RHDTGs), which are stacked and embedded within a residual learning framework to ease training. The overall DLGSANet architecture consists of a shallow feature extraction module, six RHDTGs for deep feature extraction, and a high-resolution image reconstruction module.

Datasets

The paper uses the following datasets:

  • Training: DIV2K dataset.
  • Evaluation: Set5, Set14, B100, Urban100, and Manga109 datasets.

Key Insights and Ideas

  • Sparsity is Key for Global Attention: The paper argues that not all attention scores are equally important for image reconstruction. By using ReLU to sparsify the attention map, DLGSANet can focus on the most relevant global features, leading to better results and efficiency.
  • Dynamic Local Attention for Efficiency: Instead of fixed convolutional kernels or standard windowed attention, the dynamic local attention mechanism in MHDLSA adapts to local image content, improving feature extraction while remaining computationally efficient.
  • Hybrid Approach Outperforms Single-Module Focus: Combining both dynamic local and sparse global attention within the HDTB is crucial. Experiments show that using only one of these modules results in lower performance, highlighting the synergy between local detail capture and global context aggregation.
  • Lightweight Design for Practicality: The explicit focus on reducing parameters and FLOPs, demonstrated by the DLGSANet-tiny and DLGSANet-light variants, makes the method suitable for real-world applications where computational resources are limited.

Key Results

  • Parameter and FLOP Efficiency: DLGSANet achieves competitive PSNR scores with significantly fewer parameters (e.g., <5M for the main model) and lower FLOPs compared to state-of-the-art CNNs (like EDSR) and Transformer-based methods (like SwinIR and ELAN). For instance, it uses approximately 1/10th the parameters and FLOPs of EDSR while achieving comparable or better results.
  • Competitive Accuracy: On the Urban100 dataset, DLGSANet achieves comparable PSNR values to methods like SwinIR and ELAN, while being much more efficient.
  • Ablation Studies:
    • The hybrid HDTB (combining MHDLSA and SparseGSA) outperforms baselines using only MHDLSA or only SparseGSA.
  • MHDLSA provides a 0.28dB gain over standard multi-head window attention.
  • SparseGSA achieves a 0.12dB higher PSNR than a standard softmax-based global attention mechanism on Urban100, with an average attention map sparsity of 22.6%.
  • Qualitative Improvements: Visual results show that DLGSANet recovers finer details and sharper boundaries, particularly in challenging textures like stripes and building windows, compared to other methods.

Limitations and Future Work

  • Limitations: The paper does not explicitly discuss limitations in terms of specific failure cases or scenarios where the method might struggle. The reliance on specific datasets for evaluation might also limit generalizability.
  • Future Work: The authors suggest that their lightweight and efficient design makes DLGSANet suitable for real-world applications. Further exploration of optimizing the network for even greater efficiency or applying it to other image restoration tasks could be future directions. The paper also notes the potential for further improvements by exploring other activation functions for sparsity, though ReLU proved effective.

Summary updated

BibTeX
@inproceedings{li2023dlgsanet,
  author = {Xiang Li and Jiangxin Dong and Jinhui Tang and Jinshan Pan},
  title = {{DLGSANet: Lightweight Dynamic Local and Global Self-Attention Networks for Image Super-Resolution}},
  booktitle = {IEEE/CVF International Conference on Computer Vision},
  year = {2023},
  doi = {10.1109/iccv51070.2023.01175},
}
Figure