[Paper Review] Generative Image Inpainting with Segmentation Confusion Adversarial Training and Contrastive Learning
This paper proposes a novel adversarial training framework for image inpainting that combines segmentation confusion adversarial training (SCAT) and contrastive learning to achieve global consistency, local texture fidelity, and flexibility with free-form holes. By training a generator to fool a segmentation network and using contrastive losses to align features with ground truth, the method outperforms state-of-the-art models on Places2 and CelebA in both qualitative and quantitative evaluations.
This paper presents a new adversarial training framework for image inpainting with segmentation confusion adversarial training (SCAT) and contrastive learning. SCAT plays an adversarial game between an inpainting generator and a segmentation network, which provides pixel-level local training signals and can adapt to images with free-form holes. By combining SCAT with standard global adversarial training, the new adversarial training framework exhibits the following three advantages simultaneously: (1) the global consistency of the repaired image, (2) the local fine texture details of the repaired image, and (3) the flexibility of handling images with free-form holes. Moreover, we propose the textural and semantic contrastive learning losses to stabilize and improve our inpainting model's training by exploiting the feature representation space of the discriminator, in which the inpainting images are pulled closer to the ground truth images but pushed farther from the corrupted images. The proposed contrastive losses better guide the repaired images to move from the corrupted image data points to the real image data points in the feature representation space, resulting in more realistic completed images. We conduct extensive experiments on two benchmark datasets, demonstrating our model's effectiveness and superiority both qualitatively and quantitatively.
Motivation & Objective
- To address the limitations of existing GAN-based inpainting methods that fail to simultaneously achieve global consistency, local texture detail, and flexibility with free-form holes.
- To develop a pixel-level adversarial training signal that enhances local realism without relying on fixed-size patch discriminators.
- To stabilize and improve training by leveraging feature space contrastive learning between inpainted, ground truth, and corrupted images.
- To enable the model to generalize across diverse hole shapes and sizes while maintaining semantic and structural coherence.
Proposed method
- Introduces segmentation confusion adversarial training (SCAT), where a segmentation network distinguishes between real and generated image regions, forcing the generator to produce more realistic local details.
- Combines SCAT with global per-image adversarial training to jointly optimize for global structure and local texture fidelity.
- Proposes textural contrastive learning to pull the feature representations of inpainted images closer to those of ground truth images in the discriminator’s feature space.
- Introduces semantic contrastive learning to push the feature representations of inpainted images away from those of corrupted (input) images, enhancing semantic consistency.
- Utilizes the discriminator’s intermediate features as the representation space for contrastive learning, improving feature quality without additional parameters.
- Employs spectral normalization and PatchGAN-style discriminators to stabilize training and support free-form hole inpainting.
Experimental results
Research questions
- RQ1Can a segmentation network be used as a pixel-level discriminator to improve local texture details in image inpainting?
- RQ2Can contrastive learning in the discriminator’s feature space improve the realism and consistency of inpainted images?
- RQ3Can SCAT and contrastive learning be combined with global adversarial training to simultaneously achieve global coherence, local detail, and free-form hole generalization?
- RQ4How does the proposed framework compare to state-of-the-art methods in terms of qualitative and quantitative performance on standard benchmarks?
Key findings
- The proposed method achieves state-of-the-art performance on both Places2 and CelebA datasets, with significant improvements in FID scores across all mask ratios.
- On Places2, the method outperforms prior state-of-the-art models such as LaMa, CoModGAN, and WaveFill, especially in preserving large-scale structural details and reducing artifacts.
- On CelebA, the model produces more realistic facial features with fewer local artifacts, particularly around eyes, ears, and hair, compared to DeepFillv2 and CTSDG.
- Ablation studies confirm that each component—SCAT, textural contrastive learning, and semantic contrastive learning—contributes independently to performance, with the full model achieving the best results.
- The combination of SCAT and contrastive learning leads to more stable training and better feature space alignment, as evidenced by improved FID and LPIPS metrics.
- Qualitative results show that the model effectively handles large, irregular holes while maintaining semantic and structural plausibility.
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.