Abstract
Deep convolutional networks (CNNs) have exhibited their potential in image inpainting for producing plausible results. However, in most existing methods, e.g., context encoder, the missing parts are predicted by propagating the surrounding convolutional features through a fully connected layer, which intends to produce semantically plausible but blurry result. In this paper, we introduce a special shift-connection layer to the U-Net architecture, namely Shift-Net, for filling in missing regions of any shape with sharp structures and fine-detailed textures. To this end, the encoder feature of the known region is shifted to serve as an estimation of the missing parts. A guidance loss is introduced on decoder feature to minimize the distance between the decoder feature after fully connected layer and the ground-truth encoder feature of the missing parts. With such constraint, the decoder feature in missing region can be used to guide the shift of encoder feature in known region. An end-to-end learning algorithm is further developed to train the Shift-Net. Experiments on the Paris StreetView and Places datasets demonstrate the efficiency and effectiveness of our Shift-Net in producing sharper, fine-detailed, and visually plausible results.
Introduction
Image inpainting—the process of filling in missing pixels in a way that is visually and semantically consistent—has traditionally been approached through two distinct paradigms. Exemplar-based methods, such as Photoshop’s Content-Aware Fill, rely on searching for similar patches in the known parts of an image and "shifting" them into the hole. While these methods excel at preserving fine textures, they often lack a global understanding of the image structure, leading to semantically incorrect results, such as misplacing architectural elements.
Conversely, CNN-based methods leverage deep networks to understand global context. While they produce semantically sensible structures, they often suffer from blurriness. This is primarily because information must pass through a "bottleneck" (typically a fully connected layer) that discards the high-frequency details necessary for sharp textures. Shift-Net aims to bridge this gap by introducing a "shift-connection" layer into a U-Net architecture, combining the semantic intelligence of deep learning with the texture-preserving power of exemplar-based rearrangement.
The Shift-Net Architecture
The core innovation of Shift-Net is the Shift-connection layer, integrated into a standard U-Net framework. This layer enables the model to rearrange sharp, high-resolution features from known areas to fill in missing regions.
The Shift Operation
Instead of simply passing features through skip-connections, the shift-connection layer performs a nearest-neighbor search in the feature space. It utilizes "guidance" features from the decoder—which provide a rough, low-resolution blueprint of the missing area—to find the most similar features in the known regions of the encoder. These sharp encoder features are then "shifted" to the corresponding locations in the missing region.
Guidance Loss and Training
To ensure the accuracy of this shift, the authors introduced a Guidance Loss ($L_g$). This loss function constrains the decoder's bottleneck features to remain close to the ground-truth encoder features of the missing area, providing a reliable map for the shift operation. Shift-Net is trained end-to-end using a multi-component loss function including $L_1$ loss for pixel accuracy, adversarial loss for realism, and the new guidance loss.
Experimental Results
The model was rigorously evaluated on the Paris StreetView dataset (14,900 images of urban architecture) and the Places365-Standard dataset (1.6 million images across diverse scenes).
Visual Quality and Performance
Shift-Net demonstrates a clear advantage over existing state-of-the-art methods. As shown in Figure 1, it avoids the blurriness of pure CNN approaches while maintaining better global symmetry and structural integrity than traditional exemplar-based methods.
Quantitatively, Shift-Net achieved superior results on the Paris StreetView dataset with a PSNR of 26.51 and an SSIM of 0.90, both of which were the highest among the tested models.
Computational Efficiency
A standout feature of Shift-Net is its speed. By implementing the nearest-neighbor search as a convolutional operation, the model can compute shift vectors in parallel. Shift-Net processes a $256 \times 256$ image in approximately 80ms, making it roughly 500 times faster than competing hybrid methods like MNPS, which can take up to 40 seconds per image.
Discussion and Future Work
The success of Shift-Net highlights the power of performing exemplar-based operations in feature space rather than pixel space. Deep features capture the semantic essence of textures, making the matching process more robust than comparing raw RGB values.
However, some limitations remain. The current implementation uses a single shift-connection layer at a $32 \times 32$ resolution. Future work could explore multi-scale shift-connections to capture even finer details. Additionally, the authors suggest that the "shift-connection" concept could be generalized to other low-level vision tasks such as super-resolution or style transfer.
Conclusion
Shift-Net effectively combines the strengths of deep learning and traditional patch-based methods. By rearranging high-resolution features under the guidance of a deep semantic blueprint, it produces inpainting results that are both structurally sound and texturally rich, all while maintaining high computational efficiency.
Summary updated