Restoring Vision in Hazy Weather with Hierarchical Contrastive Learning

Tao Wang, Guangpin Tao, Wanglong Lu, Kaihao Zhang, Wenhan Luo, Xiaoqin Zhang, Tong Lu

TL;DR

Hierarchical Contrastive Dehazing (HCD) is a novel framework that improves single-image dehazing by explicitly modeling the relationships between multi-scale features. By combining a hierarchical interaction network with a contrastive loss that leverages both clear and hazy images as anchors, HCD achieves state-of-the-art performance across major benchmarks while generalizing effectively to deraining and nighttime dehazing tasks.

What Problem Does This Paper Address?

Single image dehazing—the process of recovering a clear scene from a hazy input—is a fundamental challenge in computer vision, critical for autonomous driving and surveillance. While deep learning has advanced the field, the authors identify two major gaps in existing methods:

  1. Neglected Feature Hierarchy: Standard CNNs produce features at various scales. Shallow features capture spatial details, while deep features capture semantic context. Most dehazing models fail to fully exploit the complementary relationships between these hierarchical levels.
  2. Underutilized Supervision: Most data-driven methods focus solely on "positive" supervision (minimizing the distance to the ground-truth clear image). They ignore the valuable information contained in the "negative" samples (the hazy inputs), which can help the model learn what features to suppress.

Methods

The HCD framework consists of two primary components: the Hierarchical Dehazing Network (HDN) and the Hierarchical Contrastive Loss (HCL).

1. Hierarchical Dehazing Network (HDN)

The HDN architecture (see Figure 2) uses three parallel branches to process features at different resolutions.

  • Hierarchical Feature Extractor (HFE): Uses Deformable Convolutions (DCN) instead of standard ones. DCNs allow the network to adaptively expand its receptive field based on the image content, which is particularly useful for handling non-uniform haze.
  • Hierarchical Interaction Module (HIM): This is the "brain" of the network. It utilizes a Hierarchical Fusion Block (HFB) (Figure 3) to facilitate bi-directional information flow. It performs Bottom-Up Fusion to propagate high-level context to shallow layers (suppressing noise) and Top-Down Fusion to bring spatial details to deeper layers.
The HCD architecture featuring the HDN and the multi-scale contrastive loss.

2. Hierarchical Contrastive Loss (HCL)

To train the network, the authors propose a novel contrastive loss. Unlike standard pixel-wise losses (like MSE or Charbonnier), HCL pulls the restored image closer to the clear ground truth (positive pair) while pushing it away from the hazy input (negative pair) in a latent feature space (VGG-19). Crucially, this contrastive constraint is applied across all three scales of the network's output.

The Hierarchical Fusion Block (HFB) facilitates bi-directional feature exchange.

Datasets

The model was trained and evaluated on several standard benchmarks:

  • RESIDE: A massive dataset including indoor (ITS) and outdoor (OTS) training sets, and the Synthetic Objective Testing Set (SOTS).
  • HazeRD: A challenging dataset for outdoor scene dehazing.
  • DENSE-HAZE: A real-world dataset featuring extremely thick haze.
  • RTTS: A real-world task-driven dataset used for qualitative evaluation.
  • NHR: Used specifically for evaluating nighttime dehazing.

Key Insights and Ideas

  • Active Interaction vs. Passive Fusing: The authors show that simply using skip connections isn't enough. The HFB's specific design—calculating differences between features across branches—forces the network to learn more discriminative representations.
  • The Power of Negatives: By treating the hazy input as a negative sample in the contrastive loss, the model gains a "lower bound." This helps the network focus specifically on removing the complex haze components that differentiate the input from the ground truth.
  • Scale-Invariant Learning: Applying the contrastive loss hierarchically ensures that the model maintains consistent dehazing performance regardless of the resolution, leading to fewer artifacts in the final high-res output.

Key Results

HCD achieves significant quantitative gains over previous state-of-the-art (SOTA) methods like FFA-Net and AECR-Net.

  • Quantitative Superiority: On the SOTS-Indoor dataset, HCD achieved a PSNR of 38.31 dB, outperforming the previous best (AECR-Net) by 1.14 dB. It also showed strong leads on DENSE-HAZE (+0.61 dB PSNR).
  • Visual Quality: Qualitative results (Figure 6) show that HCD produces images with richer details and fewer color distortions compared to methods like DCP or DehazeNet, which often leave residual haze or artifacts.
  • Generalization: Despite being designed for dehazing, HCD set new SOTA records for image deraining (surpassing MSPFN by 2.61 dB on Rain100L) and performed excellently on nighttime dehazing, effectively handling glow and low-light conditions.
Performance comparison showing HCD outperforming SOTA methods across four major datasets.

Limitations and Future Work

The authors acknowledge a few areas for growth:

  • Paired Data Dependency: Like most supervised methods, HCD relies on paired synthetic data, which may not always perfectly capture the physics of real-world haze. The authors suggest exploring unsupervised learning strategies in the future.
  • Task Expansion: The success in deraining suggests the hierarchical contrastive approach is robust. Future work will look into extending HCD to other restoration tasks like desnowing, deblurring, and low-light enhancement.

Summary updated

BibTeX
@article{wang2022restoring,
  author = {Tao Wang and Guangpin Tao and Wanglong Lu and Kaihao Zhang and Wenhan Luo and Xiaoqin Zhang and Tong Lu},
  title = {{Restoring Vision in Hazy Weather with Hierarchical Contrastive Learning}},
  journal = {Pattern Recognition},
  year = {2022},
}
Figure