Skip to main content
Back

Derain-Agent Turns Rain Removal Into a Planning Problem, Gaining 1.19 dB

A new plug-and-play agent framework diagnoses residual noise, blur, and color shifts after deraining, then applies targeted fixes with spatially adaptive strength.

Pro

  • Derain-Agent adds a plug-and-play refinement stage that dynamically plans post-deraining cleanup per image.
  • Uses a Planning Network to pick tool sequences and Strength Modulation for pixel-wise intensity control.
  • Toolbox has three frozen operators: SCUNet, WB LUTs, and Restormer.
  • Delivers +0.81 to +1.19 dB PSNR gains on LHP-Rain across six modern derainers.
  • Adds only ~3.5% FLOPs overhead on top of a Restormer base model.
  • Beats iterative agent baselines like Q-Agent's IQA-Greedy and AgenticIR's Rollback-Replanning.

Single-image deraining models have gotten remarkably good at scrubbing rain streaks out of synthetic benchmarks, but drop them on real photographs and cracks appear: faint noise, motion blur, and washed-out colors that no amount of extra training seems to fully eliminate. A team from Harbin Institute of Technology, Nanjing University of Science and Technology, and Tsinghua propose a different fix in Derain-Agent, a plug-and-play refinement stage that treats post-deraining cleanup as a planning problem rather than a bigger network.

Why static deraining keeps failing on real rain

While deep learning has advanced single-image deraining, existing models suffer from a fundamental limitation: they employ a static inference paradigm that fails to adapt to the complex, coupled degradations (e.g., noise artifacts, blur, and color deviation) of real-world rain. A network trained on synthetic streaks learns one fixed mapping and applies it identically to every input. Real rain is messier. It couples splatter, motion, and photometric shifts, and the mix varies scene by scene.

The authors point out that the ceiling here is not model capacity. It is the inference paradigm itself. Cascaded and recurrent derainers still run the same routine every time, without diagnosing what specifically went wrong in a given output. The result is residual artifacts and inconsistent perceptual quality even from state-of-the-art models.

Derain-Agent two-stage perception and execution pipeline

Turning deraining into a planning problem

Derain-Agent sits after any base derainer and produces what the paper calls a restoration program: an ordered sequence of tools plus per-pixel strength maps controlling how aggressively each tool is applied. Derain-Agent equips a base deraining model with two core capabilities: 1) a Planning Network that intelligently schedules an optimal sequence of restoration tools for each instance, and 2) a Strength Modulation mechanism that applies these tools with spatially adaptive intensity.

The toolbox is intentionally small. Three frozen operators cover the main residual degradations: SCUNet for denoising, WB LUTs for white-balance color correction, and Restormer for deblurring. With three tools and the option to use none, that is 16 possible ordered paths, small enough to enumerate for training labels but too expensive to brute-force at inference.

How the agent decides what to do

The perception stage uses a ResNet34 backbone to extract features from the preliminary derained image. Two lightweight heads sit on top:

  • Tool Scheduler: a classifier over the 16 candidate paths that picks the best ordered sequence for this specific image.
  • Strength Modulator: conditioned on the chosen path, it predicts a pixel-wise map in [0,1] for each tool in the sequence, controlling how much of that tool's effect is applied where.

Execution is a simple residual blend. For each step, the tool is applied, and the strength map interpolates between the input and the tool's output at every pixel: I_next = I + λ ⊙ (tool(I) - I). That means the agent can denoise hard on a smooth sky region while barely touching a textured facade in the same frame.

Training happens in two stages to avoid mixing discrete and continuous objectives. First the backbone and scheduler learn to predict the optimal path (labels come from offline exhaustive search over the toolbox against paired ground truth). Then those weights are frozen and only the strength modulator trains against an L1 plus SSIM reconstruction loss.

What the numbers show

The authors evaluate on LHP-Rain (paired real rain) and RE-Rain (unpaired real rain), using six modern derainers as base models including Restormer, NeRD-Rain, FADformer, FreqMamba, and TransMamba. Cross-dataset gains are consistent:

  • Base models trained on Rain13K, tested on LHP-Rain: +0.81 dB PSNR average.
  • Base models trained on Rain200H (larger domain gap): +1.19 dB PSNR average.
  • A single unified Derain-Agent works across all six backbones without per-model tuning.
  • On unpaired RE-Rain, average BRISQUE drops from 22.24 to 20.43 and NIQE from 3.88 to 3.78.
Visual comparison of Derain-Agent enhancement across baseline deraining methods

The compute overhead is modest. Adding the agent on top of Restormer takes parameters from 26.09M to 49.02M, but FLOPs at 256x256 only rise from 140.9G to 145.8G, roughly a 3.5% increase. Most of the work still happens in the base derainer.

The real breakthrough

Ablations against other agentic strategies are the most interesting result. IQA-Greedy (from Q-Agent) and Rollback-Replanning (from AgenticIR) both rely on iterative search with quality feedback, and both barely move the needle over the baseline (31.65 and 31.69 PSNR versus 31.59). Derain-Agent's learned scheduler jumps to 32.34. The lesson: with a small toolbox, exploration policies stall in a cramped search space, while amortizing the search into a classifier plus spatially adaptive strengths captures nearly the same quality as exhaustive search at a fraction of the cost.

Downstream tasks benefit too. Running YOLOv8 detection and segmentation on Derain-Agent outputs yields fewer false negatives and tighter masks than on baseline derained images, which matters for the autonomous driving and surveillance applications this line of work targets.

Where it falls short

The toolbox is fixed and hand-picked at three operators. Performance improves monotonically as the toolbox grows from one to three tools, which suggests headroom, but also means the current system only handles the specific residual degradations its authors anticipated. The scheduler is trained with cross-entropy against paths chosen by paired-supervision search, so it inherits whatever biases the training pairs carry. The paper does not release code or pretrained weights alongside the preprint, and future work explicitly points to using LLMs for richer degradation diagnosis and extending the framework to dehazing and low-light, tasks it does not currently cover.