Unsupervised Deraining: Where Contrastive Learning Meets Self-similarity

Yuntong Ye, Changfeng Yu, Yi Chang, Lin Zhu, Xi-Le Zhao, Luxin Yan, Yonghong Tian

Introduction

Deep learning has revolutionized image restoration, yet supervised deraining models often struggle when transitioned from the laboratory to the real world. Most existing models rely on paired training data—synthetic rainy images and their clean counterparts. However, synthetic rain, typically modeled as simple linear streaks, fails to capture the complexity of real-world precipitation, which includes veiling effects, varying drop sizes, and atmospheric haze. This "domain gap" often results in supervised models over-smoothing fine details or failing to remove complex artifacts in real-world photos.

To bridge this gap, this paper introduces Asymmetric Non-local Contrastive Learning (ANLCL), a novel unsupervised framework that treats deraining as a contrastive decomposition task. By leveraging the intrinsic self-similarity of image patches and the inherent structural differences between background and rain, ANLCL achieves state-of-the-art performance on real-world scenes without requiring paired training data.

Methodology: Decomposition via Asymmetry

The core objective of ANLCL is to decompose a rainy image ($O$) into a clean background layer ($B$) and a rain layer ($R$), such that $O = B + R$. The framework introduces three primary innovations to ensure this separation is both clean and structurally accurate.

1. Non-local Contrastive Learning (NLCL)

Traditional contrastive learning often compares whole images or augmented versions of the same image. In contrast, NLCL utilizes patch-level sampling. It exploits the "self-similarity" found within a single image, searching for similar patches to serve as "positives" while pushing patches from the opposing layer (e.g., rain vs. background) away as "negatives." This allows the model to learn structural priors directly from the input image itself.

2. Complexity Asymmetry

A pivotal insight of this research is the quantitative proof that rain is structurally simpler than natural backgrounds. By analyzing the entropy and singular value decomposition (SVD) of image patches, the authors demonstrated that rain clusters are naturally more compact in feature space. ANLCL employs an Asymmetric Contrastive Loss that enforces tighter compactness for the simpler rain layer while allowing the more complex background layer greater variance in the feature space. This explicitly models the physical reality that a background contains significantly more information than a layer of streaks.

3. Dual Contrastive Constraints

To ensure the decomposition is effective, the model employs two distinct constraints:

  • Layer Contrastive: This pushes the features of the background and rain layers apart, ensuring a clean separation without residual artifacts.
  • Location Contrastive: This ensures that the restored background $B$ maintains the exact content and structure of the original rainy image $O$ at every pixel location, preventing the hallucination of new details.

The FCRealRain Dataset

To evaluate the model's efficacy in the real world, the authors introduced FCRealRain (Field Collection Real Rain). This large-scale dataset contains 4,000 high-resolution (4K) images collected under diverse weather conditions. Unlike internet-scraped datasets, FCRealRain includes bounding box annotations for six object categories (including people and cars). This allows researchers to evaluate deraining not just as a visual improvement, but as a critical pre-processing step for downstream computer vision tasks like object detection.

Experimental Results

Quantitative and Qualitative Performance

On the RainCityscapes benchmark, ANLCL achieved a PSNR of 27.42, outperforming the leading unsupervised method, DeCycleGAN, by nearly 0.5 dB. Qualitatively, the model excels at removing both distinct rain streaks and the "veiling effect" (the misty appearance of heavy rain) that often baffles supervised models.

Impact on Downstream Tasks

The utility of ANLCL was further proven through object detection tests. Using the model as a pre-processor for YOLOv5 on the FCRealRain dataset improved the Mean Average Precision (mAP) from 67.6% to 69.8%. Notably, some supervised methods actually decreased detection accuracy in these tests due to over-smoothing, which can obscure the edges of distant objects.

Computational Efficiency

ANLCL is designed for practical deployment. It is remarkably lightweight, featuring only 2.6M parameters—a fraction of the size of competitors like JORDER-E (16.7M) or DeCycleGAN (43.6M). With an inference time of just 0.01s per 256x256 image, it is well-suited for real-time applications.

Conclusion

ANLCL represents a significant step forward in unsupervised image restoration. by moving away from synthetic pairs and toward a model based on the physical and structural properties of rain—specifically its simplicity and self-similarity—the framework provides a robust solution for real-world weather challenges. While the model currently benefits from a two-stage training strategy involving synthetic pre-training, future work aims to achieve high-performance deraining through purely unsupervised training from scratch.

Summary updated

BibTeX
@inproceedings{ye2022unsupervised,
  author = {Yuntong Ye and Changfeng Yu and Yi Chang and Lin Zhu and Xi-Le Zhao and Luxin Yan and Yonghong Tian},
  title = {{Unsupervised Deraining: Where Contrastive Learning Meets Self-similarity}},
  booktitle = {IEEE/CVF Conference on Computer Vision and Pattern Recognition},
  year = {2022},
  doi = {10.1109/cvpr52688.2022.00573},
}
Figure