Abstract
The objective of the image inpainting task is to fill missing regions of an image in a visually plausible way. Recently, deep-learning-based image inpainting networks have generated outstanding results, and some utilize their models as object removers by masking unwanted objects in an image. However, while trying to better remove objects using their networks, the previous works pay less attention to the importance of the input mask. In this paper, we focus on generating the input mask to better remove objects using the off-the-shelf image inpainting network. We propose an automatic mask generator inspired by the explainable AI (XAI) method, whose output can better remove objects than a semantic segmentation mask. The proposed method generates an importance map using randomly sampled input masks and quantitatively estimated scores of the completed images obtained from the random masks. The output mask is selected by a judge module among the candidate masks which are generated from the importance map. We design the judge module to quantitatively estimate the quality of the object removal results. In addition, we empirically find that the evaluation methods used in the previous works reporting object removal results are not appropriate for estimating the performance of an object remover. Therefore, we propose new evaluation metrics (FID$^*$ and U-IDS$^*$) to properly evaluate the quality of object removers. Experiments confirm that our method shows better performance in removing target class objects than the masks generated from the semantic segmentation maps, and the two proposed metrics make judgments consistent with humans.
Introduction
In the field of AI-powered image editing, object removal is a common yet challenging task. While modern deep-learning-based inpainting networks are capable of generating high-quality textures, their performance is heavily dependent on the shape of the input mask. Researchers have identified a significant trade-off between mask precision and inpainting quality.
As illustrated in Figure 1, a tight mask (e.g., a standard segmentation map) often fails to cover the object's boundary features, leading to a visible "afterimage" or silhouette in the final output. Conversely, a loose mask removes excessive background context, which can cause the inpainting network to produce warped textures or distorted geometric structures. Finding the "Goldilocks" mask that balances these two extremes has traditionally been a manual and subjective process.
Methodology: The AURA Framework
AURA (Automatic mask generator using Randomized input sampling) is an automated system designed to find the optimal mask for any off-the-shelf inpainting network. Inspired by Explainable AI (XAI) techniques like RISE, AURA treats the inpainter as a black box and uses an iterative sampling approach to discover which pixels are most critical to mask for a clean removal.
The AURA pipeline consists of several key stages:
- Randomized Sampling: The system starts with a base segmentation mask and generates thousands of variations (typically 2,000) by overlaying random circular patches.
- The Judge Module: Each masked image is processed by the inpainting network. The results are then evaluated by a multi-criteria Judge module that calculates a score based on:
- Detection Score ($J_{detect}$): Ensuring the target object is no longer detectable.
- Background Score ($J_{background}$): Minimizing changes to the unmasked background using $L_2$ loss.
- Afterimage Score ($J_{afterimage}$): Using Perceptual Similarity (LPIPS) to detect ghosting artifacts.
- Importance Map: High-scoring masks are aggregated into an importance map that highlights the pixels most essential for successful inpainting.
- Final Selection: The system generates candidate masks from this map and selects the one that maximizes the Judge's score.
Experimental Results
The researchers evaluated AURA using the COCO and RORD (Real-world Object Removal Dataset) benchmarks.
Quantitative Performance: On the RORD dataset, AURA outperformed standard and dilated segmentation masks across key metrics, including FID (Fréchet Inception Distance) and LPIPS. These results indicate that AURA produces images with higher visual fidelity and fewer perceptual artifacts than baseline methods.
Qualitative Evaluation: A user study with 20 participants further validated the approach. In head-to-head comparisons on the COCO dataset, AURA's results were preferred 158 times, significantly outperforming the best baseline mask, which received only 72 votes.
Conclusion and Future Work
AURA demonstrates that the optimal mask is network-dependent; because different inpainting models have different strengths and weaknesses, a one-size-fits-all segmentation mask is rarely ideal. By treating the inpainter as a black box, AURA finds the best mask for any specific model. While the current computational cost of 2,000 samples per image is high, future research could focus on optimizing the sampling process or integrating the Judge module's logic directly into the training of inpainting networks to enable real-time performance.
Summary updated