Abstract
Traditional image inpainting methods often struggle with complex semantic structures and large missing regions because they rely solely on internal image priors or general learned patterns. This paper introduces a novel reference-guided framework that leverages external images of the same scene to provide high-fidelity texture and structure information. By employing a specialized Feature Alignment Module (FAM) and a dual-stream architecture, the proposed method effectively transfers information from misaligned reference images. To facilitate research in this area, the authors also introduce DPED10K, a new benchmark dataset for reference-guided inpainting.
Introduction
Image inpainting is the process of reconstructing missing or corrupted parts of an image. While deep learning has significantly advanced this field, existing techniques frequently produce blurred textures or distorted geometries when faced with large-scale holes. The primary bottleneck is information scarcity: the model must "hallucinate" missing content based on limited context.
This research proposes a shift toward reference-guided inpainting. By providing the model with a "reference" image—a photo of the same scene taken from a different viewpoint or at a different time—the system can borrow authentic details to fill the gaps. The challenge lies in the fact that reference images are rarely perfectly aligned with the target. This paper addresses this through a robust alignment and feature-fusion strategy.
Methodology
The core of the proposed system is a Referenced-Based Encoder-Decoder network designed to handle the complexities of spatial misalignment and feature integration.
Dual-Stream Feature Extraction
The architecture treats texture and structure as distinct components. Shallow features from the encoder are reorganized into texture representations, capturing local patterns and fine details. Deep features are processed into structure representations, focusing on the global geometric layout. This separation allows the model to preserve sharp boundaries while maintaining consistent textural patterns.
Feature Alignment Module (FAM)
Because reference images are typically taken from different perspectives, they cannot be directly overlaid onto the target image. The FAM utilizes deformable convolutions and a dynamic offset estimator to spatially warp the reference features. This ensures that the information borrowed from the reference image is pixel-aligned with the target before fusion, significantly reducing artifacts caused by geometric discrepancies.
Multi-Scale Filling Branches
Following alignment, the features are processed through parallel texture and structure branches. These branches utilize partial convolutions with varying kernel sizes to fill missing regions across multiple scales. To ensure structural integrity, the structure branch is supervised using images processed by Relative Total Variation (RTV), which emphasizes the "skeleton" of the scene.
The DPED10K Dataset
To evaluate the performance of reference-guided inpainting, the authors introduced the DPED10K dataset. Derived from the Digital Photography Enhancement Dataset (DPED), it contains 10,000 training pairs and 200 test pairs of real-world photos. The pairs were curated using SIFT (Scale-Invariant Feature Transform) to ensure that the reference images share meaningful structural and textural similarities with the target images, providing a rigorous benchmark for the field.
Experimental Results
The proposed method was benchmarked against several state-of-the-art (SOTA) models, including MEDFE, EC, and GI.
Quantitative Performance
On the DPED10K dataset, the model demonstrated superior performance across various mask ratios. It achieved an average Peak Signal-to-Noise Ratio (PSNR) of 25.91 and a Structural Similarity Index (SSIM) of 0.863. These metrics indicate a higher degree of reconstruction accuracy compared to existing baselines.
Qualitative Analysis
Visual comparisons highlight the model's ability to recover sharp, continuous lines and realistic textures. While competing models often produced "smeared" or "bent" structures—such as broken window frames or blurred foliage—the reference-guided approach maintained geometric consistency and high-frequency detail.
Computational Efficiency
The model processes a 256×256 image in approximately 77ms. While the dual-stream architecture and alignment modules introduce more complexity than simpler models like EC (22ms), the proposed method remains faster than other high-quality competitors like GI (106ms), striking a balance between reconstruction quality and inference speed.
Conclusion
This paper demonstrates that external reference images can significantly enhance the quality of image inpainting. By explicitly separating texture and structure and employing a deformable alignment module, the proposed framework overcomes the limitations of traditional "blind" inpainting. While the method's performance is tied to the availability of a relevant reference, it sets a new standard for high-fidelity image restoration in scenarios where multiple views of a scene are available. Future work will focus on optimizing the architecture for mobile deployment and expanding the diversity of reference-guided datasets.
Summary updated