Restoring Images in Adverse Weather Conditions via Histogram Transformer

Shangquan Sun, Wenqi Ren, Xinwei Gao, Rui Wang, Xiaochun Cao

Abstract

Restoring images obscured by adverse weather conditions like rain, snow, or fog is a critical low-level vision task with significant implications for high-level perception systems, such as autonomous driving. Traditional Transformer-based architectures often struggle to balance computational efficiency with the need for global context. This paper introduces the Histogram Transformer (Histoformer), which utilizes intensity-based histogram categorization to group pixels with similar degradation patterns. This approach enables efficient long-range modeling of weather effects. Experimental results demonstrate that Histoformer achieves state-of-the-art performance across multiple benchmarks, including a 32.16 dB PSNR on the Snow100K-L dataset.

Introduction

Adverse weather conditions significantly degrade image quality, posing a challenge for both human vision and computer vision algorithms. For instance, in autonomous navigation, the inability to see through a snowstorm or heavy rain can lead to catastrophic failures. While Transformers have shown promise in modeling global relationships for image restoration, their quadratic computational complexity often necessitates restricting attention to local windows or color channels. However, weather degradations typically exhibit spatially distant but visually similar patterns (e.g., snowflakes across a frame) that these restricted attention mechanisms fail to capture.

Examples of adverse weather conditions addressed: rain, raindrops, and snow.

Methodology

The Histoformer architecture introduces several innovations to overcome the limitations of spatial-domain attention:

1. Dynamic-range Histogram Self-Attention (DHSA)

The core innovation is DHSA, which shifts attention from the spatial domain to the intensity domain. Pixels are sorted by intensity and segmented into discrete "bins." Self-attention is then performed within and across these bins. This allows the model to process all pixels affected by similar degradation (e.g., all "haze-like" pixels) simultaneously, regardless of their spatial distance.

The Histogram Categorization process groups pixels into bins based on intensity to capture global weather patterns.

2. Dynamic-range Convolution

Unlike standard convolutions that operate on physical neighbors, this layer sorts pixels by intensity before applying the filter. This ensures that the convolution operates on pixels with similar degradation characteristics rather than just physical proximity.

3. Dual-scale Gated Feed-Forward (DGFF)

Replacing the standard Multi-Layer Perceptron (MLP), DGFF utilizes parallel paths of depth-wise convolutions with varying scales and dilations to capture multi-range features more effectively.

4. Pearson Correlation Loss

To better preserve the linear relationship between pixels, the authors supplement standard $L_1$ loss with a Pearson correlation-based loss, ensuring the restored intensity rankings match the ground truth.

Experiments and Results

Histoformer was evaluated on standard benchmarks including Snow100K, Outdoor-Rain, and RainDrop. The model achieved state-of-the-art (SOTA) results across all tested categories:

  • Desnowing: On Snow100K-L, Histoformer achieved 32.16 dB PSNR, outperforming the popular Restormer (30.36 dB).
  • Raindrop Removal: The model reached 33.06 dB PSNR, surpassing both specialized and unified models like TransWeather.
  • Perceptual Improvement: Beyond pixel metrics, the authors demonstrated that deweathered images significantly improve object detection confidence when processed by the Google Cloud Vision API, proving practical utility for downstream tasks.

Conclusion

The Histogram Transformer demonstrates that intensity-based pixel grouping is a powerful proxy for identifying weather-related degradations. By moving away from purely spatial attention, Histoformer achieves a global receptive field with manageable computational costs. Future work will focus on bridging the gap between synthetic training data and real-world performance, as well as optimizing inference latency for real-time applications.

Summary updated

BibTeX
@inproceedings{sun2024restoring,
  author = {Shangquan Sun and Wenqi Ren and Xinwei Gao and Rui Wang and Xiaochun Cao},
  title = {{Restoring Images in Adverse Weather Conditions via Histogram Transformer}},
  booktitle = {European Conference on Computer Vision},
  year = {2024},
  doi = {10.1007/978-3-031-72670-5\_7},
}
Figure