Structure-guided Image Outpainting

Xi Wang, Weixi Cheng, Wen‐Liang JiaarXiv 2022 · DOI

TL;DR

This paper introduces a structure-guided approach to image outpainting (extending an image's boundaries) by using predicted edges as a "skeleton" for new content. By combining a three-stage GAN training pipeline with a novel semantic embedding loss derived from a modified VGG16 network, the authors achieve more spatially consistent and visually realistic landscape expansions compared to baseline models.

What Problem Does This Paper Address?

Image outpainting, or image extrapolation, is significantly more challenging than standard inpainting. While inpainting fills holes using surrounding context from all sides, outpainting must "hallucinate" entirely new regions based on information from only one side.

Existing methods often struggle with:

  1. Structural Inconsistency: Generated content looks "melted" or lacks clear boundaries.
  2. Large-scale Area Loss: The lack of neighboring pixels makes it hard to maintain high-frequency details.
  3. Perceptual Insanity: Models might generate textures that are mathematically plausible but semantically nonsensical (e.g., stray colors or artifacts that don't belong in a landscape).

Methods

The authors propose a deep learning framework based on Generative Adversarial Networks (GANs) that breaks the problem into structure and content.

1. Three-Stage Training Pipeline

Instead of generating pixels directly, the model follows a multi-phase adversarial scheme:

  • Stage 1: Edge Inference: A generator learns to predict the "edge map" (the structural skeleton) of the missing region based on the existing image.
  • Stage 2: Content Inpainting: A second generator fills in the colors and textures, using ground-truth edges as a guide to learn the relationship between structure and appearance.
  • Stage 3: Joint Training: The two networks are fine-tuned together, where the content generator now uses the predicted edges from the first stage.

2. Semantic Embedding Loss ($L_{sEM}$)

The core novelty is the addition of a semantic embedding loss. The authors modified a VGG16 network (pretrained on ImageNet) by replacing its final fully-connected layers with a single convolutional and one fully-connected layer. This produces a 512-dimensional feature vector that captures the "meaning" of the image. By calculating the L2 distance between the embeddings of the ground truth and the generated image, the model is forced to maintain semantic "sanity" and avoid unrealistic artifacts.

Datasets

  • Places2: The model was initially fine-tuned from a version pretrained on this massive scene recognition dataset (containing over 2 million images).
  • Landscape Dataset: The primary experiments were conducted on a landscape-specific dataset sourced from Kaggle. This choice highlights the practical application of expanding travel or nature photography where "anti-shake" cropping might have removed desired details.

Key Insights and Ideas

  • Structure as a Prior: By predicting edges first, the model creates a "blueprint" that constrains the content generation, preventing the "bleeding" or blurring common in naive upsampling.
  • Beyond Pixel-to-Pixel Matching: Standard losses like MAE (Mean Absolute Error) often lead to blurry results because they average out possibilities. The semantic embedding loss acts as a high-level "critic," ensuring the generated glacier or forest actually looks like a glacier or forest to a neural observer.
  • The Difficulty of Landscapes: Unlike faces (which have a rigid "meta-structure" like eyes always being above a mouth), landscapes are highly variable. The authors note that this lack of a fixed structure makes edge prediction particularly difficult but essential for realism.

Key Results

The inclusion of the semantic embedding loss ($L_{sEM}$) provided measurable improvements across both qualitative and quantitative metrics:

Metric Model without $L_{sEM}$ Model with $L_{sEM}$
PSNR (Higher is better) 22.702 23.127
SSIM (Higher is better) 0.890 0.894
MAE (Lower is better) 0.043 0.040

Qualitative Findings: Visual comparisons show that the improved model produces more seamless transitions. For example, in glacier scenes, the blending between the original and generated parts is nearly invisible, and in forest scenes, textures are more reasonably represented without the "stray colors" seen in baseline versions.

Limitations and Future Work

  • Complexity vs. Accuracy: The authors acknowledge that complex edges and colors can still result in lower quality (noise or blur) because the model occasionally fails to generate perfectly accurate edges for highly intricate textures.
  • Scope of Expansion: Currently, the model only implements outpainting for the right quarter of the image.
  • Future Directions: The team plans to expand the outpainting range to half the image and explore other structural priors beyond simple edges, such as landmarks or high-frequency components, to better handle the "meta-structure" of diverse scenes.

Summary updated

BibTeX
@misc{wang2022structure,
  author = {Xi Wang and Weixi Cheng and Wen‐Liang Jia},
  title = {{Structure-guided Image Outpainting}},
  year = {2022},
  eprint = {2212.12326},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2212.12326},
}
Figure