Restore Anything Pipeline: Segment Anything Meets Image Restoration

Jiaxi Jiang, Christian HolzarXiv 2023 · DOI · arXiv

Introduction

Image restoration tasks, such as deblurring, denoising, and the removal of JPEG artifacts, are fundamentally "ill-posed" problems. For any given degraded image, there are multiple plausible high-quality reconstructions. Current state-of-the-art (SOTA) models typically struggle with two primary issues: global uniformity and a lack of user agency. Most models apply a single, deterministic filter to an entire image, which often results in over-smoothing textured regions or failing to adequately clean smooth backgrounds. Furthermore, because image quality is subjective, a "one-size-fits-all" output rarely satisfies every user's preference.

The Restore Anything Pipeline (RAP) addresses these challenges by integrating the Segment Anything Model (SAM) with a controllable restoration framework. This approach shifts image restoration from a global, black-box process to a semantic, object-level, and interactive experience.

The Restore Anything Pipeline (RAP)

Overview of the Restore Anything Pipeline (RAP) integrating SAM with controllable restoration. Restore Anything Pipeline: Segment Anything Meets Image Restoration, page 3

Overview of the Restore Anything Pipeline (RAP) integrating SAM with controllable restoration.

The RAP architecture consists of a three-stage pipeline designed for maximum flexibility and precision:

  1. Interactive Segmentation: Leveraging the zero-shot capabilities of SAM, users can isolate specific objects using simple prompts like clicks or bounding boxes. Research indicates that SAM is remarkably robust, maintaining high mask quality even when processing images with significant noise or blur.
  2. Controllable Restoration: The core engine is an extension of the Flexible Blind CNN (FBCNN). Unlike standard models, this component predicts specific degradation parameters (dp)—such as noise level ($\sigma$), blur kernel width, or JPEG quality factor. It operates in two modes:
  3. Automatic Mode: The model restores the object using its internally predicted parameters.
  4. Interactive Mode: Users can manually adjust these parameters via sliders to achieve a personalized balance between detail preservation and artifact removal.
  5. Object-Level Enhancement: Following restoration, users can apply standard photographic adjustments (e.g., brightness, contrast) to the segmented objects to refine the final composition.

Semantic-Aware Restoration and Results

Examples of RAP applied to diverse objects, showing segmentation masks and restored outputs for a bird, a building, and a coffee cup. Restore Anything Pipeline: Segment Anything Meets Image Restoration, page 1

Examples of RAP applied to diverse objects, showing segmentation masks and restored outputs for a bird, a building, and a coffee cup.

By segmenting the image first, RAP enables semantic-aware restoration. This allows for different "restoration budgets" to be applied across the image. For instance, heavy denoising can be applied to a flat sky while a lighter touch preserves the intricate high-frequency textures of a brick wall. A unique byproduct of this object-level approach is the ability to create a synthetic "bokeh" effect by deblurring the foreground subject while maintaining or increasing the blur of the background.

Performance Evaluation

RAP was trained on high-resolution datasets, including DIV2K and Flickr2K, and evaluated against SOTA methods like Restormer, NAFNet, and BSRGAN. Key findings include:

  • Texture Preservation: RAP successfully removes grain from smooth areas without "smearing" complex textures, a common failure point for global models like Restormer.
  • Artifact Removal: In JPEG restoration, RAP outperforms DPIR and the original FBCNN by targeting low-frequency regions where blocking artifacts are most prominent, without sacrificing the sharpness of edges or text.
  • Fidelity: Unlike generative models (e.g., GFPGAN) that may hallucinate features, RAP focuses on preserving original details, leading to more faithful reconstructions.

Conclusion and Future Work

RAP demonstrates that combining robust segmentation with controllable restoration provides a superior, user-centric alternative to global restoration methods. While the current pipeline requires user interaction for optimal results, it opens new avenues for semantic-aware image processing. Future work aims to expand the model's scope to include image super-resolution and more complex blur kernels, as well as tighter integration where semantic labels (e.g., "skin" vs. "foliage") automatically dictate optimal restoration parameters.

Summary updated

Abstract

Recent image restoration methods have produced significant advancements using deep learning. However, existing methods tend to treat the whole image as a single entity, failing to account for the distinct objects in the image that exhibit individual texture properties. Existing methods also typically generate a single result, which may not suit the preferences of different users. In this paper, we introduce the Restore Anything Pipeline (RAP), a novel interactive and per-object level image restoration approach that incorporates a controllable model to generate different results that users may choose from. RAP incorporates image segmentation through the recent Segment Anything Model (SAM) into a controllable image restoration model to create a user-friendly pipeline for several image restoration tasks. We demonstrate the versatility of RAP by applying it to three common image restoration tasks: image deblurring, image denoising, and JPEG artifact removal. Our experiments show that RAP produces superior visual results compared to state-of-the-art methods. RAP represents a promising direction for image restoration, providing users with greater control, and enabling image restoration at an object level.
BibTeX
@misc{jiang2023restore,
  author = {Jiaxi Jiang and Christian Holz},
  title = {{Restore Anything Pipeline: Segment Anything Meets Image Restoration}},
  year = {2023},
  eprint = {2305.13093},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2305.13093},
}
Figure