[Paper Review] Generating Diverse Structure for Image Inpainting With Hierarchical VQ-VAE
This paper proposes a two-stage image inpainting method using hierarchical VQ-VAE to generate diverse, high-quality image completions. It first generates multiple distinct structures via autoregressive modeling of discrete latent codes, then refines each with a texture generator using a structural attention module and two dedicated feature losses, achieving state-of-the-art diversity and quality on CelebA-HQ, Places2, and ImageNet.
Given an incomplete image without additional constraint, image inpainting natively allows for multiple solutions as long as they appear plausible. Recently, multiplesolution inpainting methods have been proposed and shown the potential of generating diverse results. However, these methods have difficulty in ensuring the quality of each solution, e.g. they produce distorted structure and/or blurry texture. We propose a two-stage model for diverse inpainting, where the first stage generates multiple coarse results each of which has a different structure, and the second stage refines each coarse result separately by augmenting texture. The proposed model is inspired by the hierarchical vector quantized variational auto-encoder (VQ-VAE), whose hierarchical architecture isentangles structural and textural information. In addition, the vector quantization in VQVAE enables autoregressive modeling of the discrete distribution over the structural information. Sampling from the distribution can easily generate diverse and high-quality structures, making up the first stage of our model. In the second stage, we propose a structural attention module inside the texture generation network, where the module utilizes the structural information to capture distant correlations. We further reuse the VQ-VAE to calculate two feature losses, which help improve structure coherence and texture realism, respectively. Experimental results on CelebA-HQ, Places2, and ImageNet datasets show that our method not only enhances the diversity of the inpainting solutions but also improves the visual quality of the generated multiple images. Code and models are available at: https://github.com/USTC-JialunPeng/Diverse-Structure-Inpainting.
Motivation & Objective
- To address the limitation of existing multiple-solution inpainting methods that produce low-quality results due to structural distortion and blurry textures.
- To explicitly generate diverse image structures rather than relying on implicit latent space sampling.
- To improve texture realism and structure coherence by leveraging disentangled structural and textural features from hierarchical VQ-VAE.
- To enhance diversity while maintaining high visual quality through structured generation and targeted feature losses.
- To demonstrate the effectiveness of structural information in guiding diverse and realistic image inpainting.
Proposed method
- Uses a hierarchical VQ-VAE to disentangle structural and textural features in the latent space, enabling discrete representation of image content.
- Employs autoregressive modeling over discrete latent codes to generate multiple diverse structural features from a single input.
- Applies a structural attention module in the texture generator that computes full attention over structural features to ensure spatial consistency.
- Introduces two auxiliary feature losses: a structural feature loss ($\mathcal{L}_{sf}$) to preserve shape coherence and a textural feature loss ($\mathcal{L}_{tf}$) to enhance texture realism.
- Trains the model with L1, adversarial, and the two feature losses to optimize for both fidelity and diversity.
- Uses a two-stage pipeline: first generating diverse structures, then refining each structure into a complete, realistic image.
Experimental results
Research questions
- RQ1Can autoregressive modeling of discrete latent codes in a hierarchical VQ-VAE generate diverse and plausible image structures for inpainting?
- RQ2Does using structural features as attention context in the texture generation network improve consistency between structure and texture?
- RQ3Can dedicated feature losses for structure and texture improve visual quality beyond standard perceptual and style losses?
- RQ4How does the proposed method compare in diversity and quality to existing multiple-solution inpainting methods?
- RQ5To what extent does hierarchical VQ-VAE enable disentanglement of structural and textural information for improved inpainting?
Key findings
- The proposed method achieves a Fréchet Inception Distance (FID) of 9.670 on CelebA-HQ, outperforming baseline methods and demonstrating superior image quality.
- The method achieves a diversity score of 0.029 using the LPIPS metric, comparable to state-of-the-art methods like PIC and UCTGAN, indicating strong structural diversity.
- The ablation study shows that using both $\mathcal{L}_{sf}$ and $\mathcal{L}_{tf}$ losses leads to the highest SSIM (0.8676), IS (3.467), and lowest FID (9.670), confirming their effectiveness.
- The structural attention module significantly improves texture consistency, enabling realistic features such as symmetric eyes and eyebrows, as shown in qualitative comparisons.
- Replacing perceptual and style losses with the proposed feature losses reduces artifacts and improves structure-texture alignment, as evidenced by visual and quantitative results.
- The method maintains high performance across diverse datasets, including CelebA-HQ, Places2, and ImageNet, confirming its generalization capability.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.