RestoreAgent: Autonomous Image Restoration Agent via Multimodal Large Language Models

Haoyu Chen, Wenbo Li, Jinjin Gu, Jingjing Ren, Sixiang Chen, Tian Ye, Renjing Pei, Kaiwen Zhou, Fenglong Song, Lei Zhu

Abstract: Natural images captured by mobile devices often suffer from multiple types of degradation, such as noise, blur, and low light. Traditional image restoration methods require manual selection of specific tasks, algorithms, and execution sequences, which is time-consuming and may yield suboptimal results. All-in-one models, though capable of handling multiple tasks, typically support only a limited range and often produce overly smooth, low-fidelity outcomes due to their broad data distribution fitting. To address these challenges, we first define a new pipeline for restoring images with multiple degradations, and then introduce RestoreAgent, an intelligent image restoration system leveraging multimodal large language models. RestoreAgent autonomously assesses the type and extent of degradation in input images and performs restoration through (1) determining the appropriate restoration tasks, (2) optimizing the task sequence, (3) selecting the most suitable models, and (4) executing the restoration. Experimental results demonstrate the superior performance of RestoreAgent in handling complex degradation, surpassing human experts. Furthermore, the system modular design facilitates the fast integration of new tasks and models, enhancing its flexibility and scalability for various applications.

Introduction: The Challenge of Complex Degradation

In the real world, a single photograph rarely suffers from just one problem. A night-time shot might be noisy, blurry, and underexposed all at once. Traditionally, researchers have taken two paths to fix this: task-specific models and all-in-one models.

Task-specific models are highly optimized experts for one job (e.g., just denoising). However, using these effectively requires a human to manually pick the right models and—crucially—the right order to apply them. All-in-one models are single neural networks trained to handle many degradations. These often struggle with "out-of-distribution" data and tend to produce overly smooth, low-fidelity results because they try to be a "jack of all trades, master of none."

Performance and generalization trade-offs in image restoration models. (a) Specific noise levels require specific models. (b) Generalization to wider blur kernels reduces peak performance. (c) All-in-one models underperform single-task experts.

The core challenge is that the sequence of restoration matters. For example, enhancing a low-light image before denoising it often amplifies the noise, making the final result worse. With four types of degradation, there are 24 possible execution orders; add multiple model choices for each task, and the search space becomes too large for humans to navigate effectively.

Methods: The RestoreAgent Framework

The authors introduce RestoreAgent, which treats image restoration as a sequential decision-making problem handled by a fine-tuned Multimodal Large Language Model (MLLM), specifically Llava-Llama3-8b.

The system operates in four autonomous steps:

  1. Degradation Identification: The model "looks" at the image to diagnose specific problems (e.g., "This has heavy JPEG artifacts and mild noise").
  2. Sequence Optimization: It decides the best order of operations to avoid error amplification.
  3. Model Selection: It picks the best tool from a "model pool." For instance, it might choose a denoiser specifically trained for high-noise levels rather than a general one.
  4. Execution & Feedback: It runs the pipeline. Notably, the agent supports iterative re-planning and rollback. If a restoration step yields a suboptimal result, the agent can "undo" it and try a different path.

The model was trained using LoRA (Low-Rank Adaptation), allowing it to learn these complex decision-making logic gates without retraining the entire massive language model.

Datasets and Training

To train the agent, the authors constructed a dataset of 23,000+ training pairs. Through a process called Trajectory Discovery, they performed an exhaustive search of all possible model permutations and sequences for each degraded image to find the "optimal" path based on quality metrics like PSNR, SSIM, and LPIPS. The training data includes various scenarios: starting from scratch, processing partially restored images, rolling back from errors, and knowing when to "Stop" because the image is fully restored.

Key Insights: Why a "Manager" Beats a "Generalist"

RestoreAgent demonstrates that a smart orchestrator using specialized "expert" models is superior to a single, massive "all-in-one" model. Key takeaways include:

  • Order is Everything: Even with the right models, the wrong sequence can ruin an image. RestoreAgent’s ability to discern minute differences in degradation patterns allows it to find non-intuitive sequences that humans might miss.
  • Extreme Flexibility: Because the system is modular, you can add a new capability (like "desnowing") simply by adding the model to the library and doing a quick 30-minute fine-tuning of the agent. Traditional models would require a full, expensive retraining.
  • MLLMs as Vision-Logic Bridges: This work highlights that MLLMs' visual reasoning can be used to control complex computer vision pipelines effectively.
Visual evidence for the RestoreAgent approach. (a) All-in-one models struggle with unseen degradations and underperform specialized models. (b) The sequence of restoration tasks significantly impacts the final result. (c) Flexible model selection is necessary for optimal performance.

Key Results

  • Superiority over Humans: In blind tests, RestoreAgent’s decisions ranked in the top 12.9% of all possible restoration strategies, while human experts only reached the top 19.5%.
  • Quantitative Gains: RestoreAgent consistently achieved higher balanced scores compared to state-of-the-art all-in-one models like AirNet and InstructIR.
  • Efficiency: The agent can adapt to entirely new tasks in just half an hour of training, whereas traditional architectures would take days or weeks.

Limitations and Future Work

The agent is only as good as the models in its library; if the underlying expert models fail to generalize, the agent cannot fix the image. While the agent currently handles six major tasks, the team plans to expand the model library significantly to cover the full spectrum of real-world image corruption and explore high-resolution restoration scenarios.

Summary updated

BibTeX
@inproceedings{chen2024restoreagent,
  author = {Haoyu Chen and Wenbo Li and Jinjin Gu and Jingjing Ren and Sixiang Chen and Tian Ye and Renjing Pei and Kaiwen Zhou and Fenglong Song and Lei Zhu},
  title = {{RestoreAgent: Autonomous Image Restoration Agent via Multimodal Large Language Models}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2024},
  url = {https://openreview.net/forum?id=xgP5ynlZWf},
}
Figure