Magic ELF: Image Deraining Meets Association Learning and Transformer

Kui Jiang, Zhongyuan Wang, Chen Chen, Zheng Wang, Laizhong Cui, Chia-Wen Lin · DOI

Abstract

Image deraining is a critical preprocessing step for computer vision tasks in adverse weather. Traditional methods often struggle to balance local texture recovery with global structural consistency. This paper introduces Magic ELF, a framework that integrates Convolutional Neural Networks (CNNs) and Transformers through a two-stage association learning process. By utilizing a predicted rain map as a degradation prior and employing a parallel hybrid architecture, Magic ELF achieves state-of-the-art performance with significantly lower computational overhead than existing models.

Introduction

Image deraining involves more than simply removing white streaks; rain often destroys fine textures, alters contrast, and introduces blur. Existing solutions typically rely on either CNNs or Transformers. CNNs are adept at learning local textures due to their sliding window nature but suffer from a limited receptive field. Conversely, Transformers excel at capturing global context via self-attention but are computationally expensive—often scaling quadratically with resolution—and can struggle with fine-grained local details.

Magic ELF (Image Deraining Meets Association Learning and Transformer) addresses this gap by unifying these architectures. It treats deraining as a two-stage "association learning" task: first identifying rain streaks and then using that information as a prior to reconstruct the background textures.

Methodology

Two-Stage Pipeline

Instead of a single-pass approach, ELF utilizes a sequential strategy:

  1. Image Deraining Network (IDN): Estimates the initial rain distribution.
  2. Background Recovery Network (BRN): Uses the predicted rain map to guide the restoration of underlying textures.

Hybrid Fusion Network (HFN)

The backbone of both stages is the HFN, a dual-path system that processes features in parallel rather than sequentially. This allows for simultaneous modeling of different frequency signals:

  • Residual Transformer Branch (RTB): Handles global structure and low-frequency signals.
  • Encoder-Decoder Branch (EDB): Utilizes CNNs to capture local textures and high-frequency signals.

Multi-input Attention Module (MAM)

The MAM is the core of the association learning process. It takes the predicted rain distribution from the IDN and treats it as a degradation prior. Using a cross-covariance attention mechanism, the module "excavates" background information from the rainy input, specifically focusing on areas where the rain was detected. This mechanism maintains linear complexity, avoiding the massive memory overhead of standard spatial self-attention.

Efficiency Optimizations

To ensure the model remains lightweight and suitable for real-time applications, the authors implemented several optimizations:

  • Depth-wise Separable Convolutions (DSC): Reduces parameter count.
  • Bilinear Sampling: Replaces heavy strided convolutions for downsampling and upsampling.
  • Channel-wise Attention: Applying self-attention across the channel dimension rather than the spatial dimension ensures the model scales efficiently with high-resolution images.

Experimental Evaluation

Performance and Efficiency

Magic ELF was evaluated against several state-of-the-art (SOTA) models across synthetic (Test100, R100H) and real-world (RID, RIS, Real127) datasets. The results demonstrate a superior balance between accuracy and resource consumption:

  • Accuracy: ELF outperformed the previous SOTA, MPRNet, by an average of 0.25 dB on synthetic benchmarks.
  • Resource Usage: ELF achieved these results using only 11.7% of the GFlops and 42.1% of the parameters required by MPRNet.
  • Inference Speed: Compared to the high-accuracy Restormer, ELF reduced inference time by 88% (125ms vs. 568ms for a 512x512 image).

Downstream Task Impact

To test practical utility, the authors evaluated the model's impact on object detection using YOLOv3 on the BDD350 dataset. Images processed by ELF showed a significant improvement in Mean Average Precision (mAP) compared to both raw rainy inputs and other deraining methods, highlighting its value for autonomous driving systems.

Conclusion and Future Work

Magic ELF demonstrates that treating rain as a "map" or prior, rather than just noise, allows for more targeted and efficient reconstruction. By running CNN and Transformer branches in parallel, the model captures both local and global features without the typical computational penalties of Transformer-based architectures.

While highly effective, the authors note that extremely complex conditions—such as heavy rain combined with thick fog—remain a challenge. Future research will focus on optimizing the architecture for mobile edge devices and extending the association learning framework to other restoration tasks like deblurring and dehazing.

Summary updated

BibTeX
@inproceedings{jiang2022magic,
  author = {Kui Jiang and Zhongyuan Wang and Chen Chen and Zheng Wang and Laizhong Cui and Chia-Wen Lin},
  title = {{Magic ELF: Image Deraining Meets Association Learning and Transformer}},
  booktitle = {ACM Multimedia},
  year = {2022},
  doi = {10.1145/3503161.3547760},
}
Figure