Vision Transformers for Single Image Dehazing

Yuda Song, Zhuqing He, Hui Qian, Xin Du

This paper, titled "Vision Transformers for Single Image Dehazing," introduces DehazeFormer, a Transformer-based architecture that sets new state-of-the-art (SOTA) records for image restoration. While Vision Transformers (ViTs) have dominated high-level tasks like classification, they have struggled to unseat Convolutional Neural Networks (CNNs) in low-level tasks like dehazing—until now.

TL;DR

DehazeFormer is the first Transformer-based model to significantly outperform top-tier CNNs in image dehazing, achieving a record-breaking 40+ dB PSNR on the SOTS indoor benchmark. By replacing standard Transformer components (like LayerNorm and GELU) with restoration-friendly alternatives, the authors created a model that is both more accurate and vastly more efficient than previous leaders like FFA-Net.

What Problem Does This Paper Address?

Image dehazing is a "low-level" vision task where the goal is to recover a clear, latent image from a hazy input. For years, CNNs have been the gold standard. When researchers tried applying the popular Swin Transformer to this problem, the results were underwhelming.

The authors identify a fundamental "mismatch" between standard Transformer designs and the requirements of image restoration:

  1. Normalization Issues: Standard LayerNorm normalizes pixels independently, which destroys the relative brightness and contrast information essential for dehazing.
  2. Activation Functions: Functions like GELU are non-monotonic, which can cause "gradient reversal" and make it difficult for the network to "invert" the effects of haze during decoding.
  3. Edge Artifacts: The "cyclic shift" mechanism in Swin Transformers creates smaller, unstable windows at the image edges, leading to artifacts.

Methods

The authors propose DehazeFormer, which adapts the Swin Transformer architecture specifically for the physics of light and haze. Key innovations include:

  • RescaleNorm: Instead of normalizing tokens individually, RescaleNorm normalizes the entire feature map and reintroduces the mean and variance, preserving the global "style" and contrast of the image.
  • Activation Swap: They found that ReLU and LeakyReLU (and their proposed SoftReLU) perform better than GELU because they are easier to "invert" when the network is trying to reconstruct the original image domain.
  • Reflection Padding: To fix edge issues, they replaced cyclic shifts with reflection padding, ensuring that windows at the edges of the image are the same size as those in the center.
  • W-MHSA with Parallel Convolution: Since Multi-Head Self-Attention (MHSA) acts like a low-pass filter (smoothing things out), they added a parallel convolution branch to capture the high-frequency details (sharp edges) that haze often obscures.
  • Soft Reconstruction: Rather than just predicting a residual image, they use a "soft" constraint based on the atmospheric scattering model to guide the final image generation.

Datasets

The models were evaluated on:

  • RESIDE: The standard benchmark for dehazing, including the Indoor (ITS), Outdoor (OTS), and Synthetic Objective Testing Set (SOTS).
  • RS-Haze (New): The authors introduced a new, large-scale Remote Sensing Haze dataset. Unlike typical synthetic datasets that use uniform haze, RS-Haze uses multi-spectral data (Landsat-8) to simulate realistic, non-homogeneous haze patterns found in satellite imagery.

Key Insights and Ideas

  • The "Invertibility" Hypothesis: The authors argue that image restoration is essentially an "un-filtering" process. Non-monotonic activation functions like GELU create a "mathematical knot" that is harder for the decoder to untie compared to simpler, monotonic functions like ReLU.
  • Normalization is a Double-Edged Sword: In classification, you want to ignore global lighting to identify an object. In dehazing, the global lighting is the signal you need to model. RescaleNorm is a clever way to keep the training stability of normalization without losing the data.
  • Efficiency Gains: Transformers are often criticized for being "heavy," but DehazeFormer proves that a well-designed Transformer can be much lighter than a deep CNN.

Key Results

  • Record-Breaking Accuracy: DehazeFormer-L is the first method to achieve a PSNR over 40 dB on the SOTS indoor set, a significant jump over previous SOTA methods.
  • Massive Efficiency: The "Small" variant (DehazeFormer-S) outperformed the famous FFA-Net while using only 25% of the parameters and a staggering 5% of the computational cost (MACs).
  • Visual Quality: Qualitative results show that DehazeFormer avoids the color distortion and "blocky" artifacts common in older CNN-based dehazers, especially in regions with varying haze density.

Limitations and Future Work

  • Training Convergence: The authors noted that on the massive Outdoor Training Set (OTS), which has over 300,000 images, their models (and many baselines) may not have fully converged due to the sheer scale of the data.
  • Real-Time 4K: While the small models are very efficient, the "Large" model is still computationally demanding. The authors suggest future work could involve "thumbnail-to-full-res" decoding schemes to achieve real-time 4K dehazing.
  • Generalization: While it excels at dehazing, it remains to be seen how these specific modifications (like RescaleNorm) translate to other low-level tasks like denoising or super-resolution.

Summary updated

BibTeX
@article{song2023vision,
  author = {Yuda Song and Zhuqing He and Hui Qian and Xin Du},
  title = {{Vision Transformers for Single Image Dehazing}},
  journal = {IEEE Trans. Image Process.},
  year = {2023},
  doi = {10.1109/tip.2023.3256763},
}
Figure