Abstract
This paper introduces a novel image inpainting framework that leverages "coherence priors"—the inherent link between an object's semantic class (e.g., "dog") and its texture (e.g., "fur")—to fill complex holes. By jointly optimizing semantic segmentation and image completion through a specialized Semantic-Wise Attention Propagation (SWAP) module, the model ensures that missing regions are filled with textures that are both structurally accurate and semantically consistent.
Introduction
Image inpainting—the process of filling in missing or corrupted parts of an image—has seen significant progress in simple scenes. However, a persistent challenge remains when a "hole" spans multiple distinct objects or backgrounds, such as a gap covering both a person and a brick wall.
Existing state-of-the-art methods often rely on mid-level structural clues, like edges, to guide the filling process. The authors argue that edges are inherently ambiguous; a curved line could represent the edge of a cloud or the edge of a sheep. This ambiguity frequently leads to "texture mix-up," where the model incorrectly paints fur onto a cloud or vice versa, resulting in blurry boundaries and unrealistic artifacts. To solve this, the authors propose using high-level semantic labels to disambiguate texture selection.
Methodology
The proposed framework treats inpainting and semantic segmentation as complementary tasks within a multi-scale joint optimization framework. The core of this approach is the Coherence Prior, which posits that high-level semantics provide much stronger clues for texture than low-level structures.
Semantic-Wise Attention Propagation (SWAP)
Standard attention mechanisms in inpainting typically scan the entire known portion of an image to find patches to "borrow" from. The SWAP module is more surgical: it utilizes a predicted segmentation map to ensure that a missing region identified as a "tree" only borrows textures from other known "tree" regions. This constraint prevents the blending of unrelated textures and maintains the integrity of object boundaries.
Dual Coherence Losses
To further refine the results, the authors introduce two specialized loss functions:
- Structure Coherence Loss: This uses conditional discriminators to ensure the global layout of the inpainted image aligns perfectly with the predicted semantic segmentation map.
- Non-local Patch Coherence Loss: This encourages the distribution of generated patches to match the distribution of real patches within the same semantic category, ensuring local texture authenticity.
Experimental Results
The model was evaluated on three major benchmarks: Outdoor Scenes, Cityscapes, and Places2.
Quantitative Performance
The proposed method consistently outperformed state-of-the-art baselines, including GatedConv, EdgeConnect, and SGE-Net. On the Outdoor Scenes dataset, the model achieved a PSNR of 21.18 and an FID of 38.15, significantly better than the next best competitor, SGE-Net (20.53 PSNR and 40.67 FID).
Qualitative Analysis and User Study
Visual results demonstrate much cleaner boundaries between objects. While other models often produce a "texture soup" at the intersection of two objects, this method maintains distinct, realistic textures. In a blind user study with 20 subjects, the proposed method was selected as the "favorite" in 51.8% of cases, more than doubling the score of the nearest competitor.
Conclusion
By shifting the focus from low-level edges to high-level semantic coherence, this framework significantly advances the state of image inpainting. The mutual reinforcement between segmentation and completion allows for more realistic texture synthesis in complex scenes.
However, the method's performance is inherently tied to the accuracy of the initial semantic prediction; misidentifying a class early in the process can lead to the propagation of incorrect textures. Future work may involve incorporating even higher-level priors, such as 3D geometry, to further enhance visual authenticity.
Summary updated