25 Jul 2024 | Shangquan Sun, Wenqi Ren, Xinwei Gao, Rui Wang, and Xiaochun Cao
This paper proposes a novel method called Histoformer for restoring images affected by adverse weather conditions. The method introduces a Histogram Transformer (Histoformer) that uses a dynamic-range histogram self-attention mechanism to effectively capture and restore weather-induced degradation. The key components of Histoformer include a Dynamic-range Histogram Self-Attention (DHSA) module and a Dual-scale Gated Feed-Forward (DGFF) module. The DHSA module segments spatial features into intensity-based bins and applies self-attention across bins or within each bin to selectively focus on spatial features of dynamic range. The DGFF module enhances the representation of multi-range features, contributing to the image restoration process. Additionally, the method introduces a correlation loss based on the Pearson correlation coefficient to enforce the recovered pixels to follow the identical order as the ground-truth. The proposed method is evaluated on various weather removal tasks, including desnowing, deraining, dehazing, and raindrop removal. The results show that Histoformer achieves state-of-the-art performance across different datasets and effectively restores real-world images, improving the performance of downstream tasks such as object detection. The method is implemented in Python using PyTorch and trained on a large dataset of weather-degraded images. The experiments demonstrate that Histoformer outperforms existing methods in terms of both quantitative and qualitative performance.This paper proposes a novel method called Histoformer for restoring images affected by adverse weather conditions. The method introduces a Histogram Transformer (Histoformer) that uses a dynamic-range histogram self-attention mechanism to effectively capture and restore weather-induced degradation. The key components of Histoformer include a Dynamic-range Histogram Self-Attention (DHSA) module and a Dual-scale Gated Feed-Forward (DGFF) module. The DHSA module segments spatial features into intensity-based bins and applies self-attention across bins or within each bin to selectively focus on spatial features of dynamic range. The DGFF module enhances the representation of multi-range features, contributing to the image restoration process. Additionally, the method introduces a correlation loss based on the Pearson correlation coefficient to enforce the recovered pixels to follow the identical order as the ground-truth. The proposed method is evaluated on various weather removal tasks, including desnowing, deraining, dehazing, and raindrop removal. The results show that Histoformer achieves state-of-the-art performance across different datasets and effectively restores real-world images, improving the performance of downstream tasks such as object detection. The method is implemented in Python using PyTorch and trained on a large dataset of weather-degraded images. The experiments demonstrate that Histoformer outperforms existing methods in terms of both quantitative and qualitative performance.