On Hallucinating Context and Background Pixels from a Face Mask using Multi-scale GANs

Sandipan Banerjee, Walter J. Scheirer, Kevin W. Bowyer, Patrick J. Flynn

TL;DR

This paper introduces a novel multi-scale GAN architecture that can "hallucinate" realistic facial context (hair, forehead, neck) and backgrounds directly from a face mask, without needing the original image or user input. This approach overcomes limitations of existing inpainting and face-swapping methods, enabling more versatile face generation and offering a powerful tool for data augmentation in computer vision tasks.

What Problem Does This Paper Address?

Current generative adversarial networks (GANs) for face synthesis typically require a full face image as input. While some methods can fill in small missing regions (inpainting) or swap faces, they struggle when the majority of the image, including the context and background, is masked. This leaves a significant gap: how to generate a complete, realistic face image when only a face mask is available. This is particularly challenging because generating plausible context and background requires understanding the underlying facial features and their relationship to the surrounding environment, a task that simple inpainting or face-swapping techniques are not designed for.

Methods

The core of this work is a cascaded multi-scale GAN architecture. Instead of a single GAN trying to generate a high-resolution image from a low-resolution mask, their model breaks down the problem into stages. It starts with a low-resolution GAN block (8x8) that learns to reconstruct the basic structure from the mask. The output of this block is then upscaled and fed into the next GAN block (16x16), which refines the hallucinated context and background, and so on, up to a 128x128 resolution.

Key aspects of their method include:

  • Cascaded GAN Blocks: Each block handles hallucination at a specific resolution, progressively building up the image detail.
  • Pixelwise Addition: To preserve fine facial details, the original face mask pixels are added back into the generated output at each stage.
  • Multi-Loss Function: To ensure realism and identity preservation, each GAN block is trained using a combination of:
  • Reconstruction Loss (Lpixel): Ensures the generated pixels are close to the ground truth.
  • Perceptual Loss (Lpc): Uses deep features (LPIPS metric) to ensure perceptual similarity.
  • Adversarial Loss (Ladv): Uses a discriminator to push generated images towards the real data distribution.
  • Identity Loss (Lid): Leverages a pre-trained VGG-Face model to preserve the identity of the input mask.
  • Total Variation Loss (Ltv): Helps suppress artifacts and smooth the generated image.
  • Progressive Growing (ProGAN) Variant: For comparison, they also implement a version inspired by ProGAN, where layers are added progressively during training.

Datasets

  • Training Data: The model is trained on approximately 12,622 face images from a dataset described as being acquired for recognition tasks, with variations in pose and background. The paper also mentions using data from [59] for training.
  • Evaluation Datasets:
    • LFW (Labeled Faces in the Wild) [27]: Used extensively for quantitative and qualitative comparisons with other methods.
  • CASIA-WebFace (CW) [74]: Used to evaluate the model's effectiveness as a data augmentation tool for training CNNs.

Key Insights and Ideas

  • Decomposing the Problem: Breaking down the high-resolution generation into a cascade of lower-resolution tasks significantly improves the ability to hallucinate complex context and backgrounds from just a mask.
  • Identity Preservation is Crucial: Simply generating realistic pixels isn't enough; maintaining the original identity is paramount. The multi-loss approach, particularly the identity loss, is key to achieving this.
  • Mask as a Strong Prior: Unlike inpainting which fills "holes," this method uses the mask as a strong prior to guide the generation of entirely new context and background, making it suitable for scenarios with extensive missing information.
  • Data Augmentation Powerhouse: The ability to generate realistic synthetic faces from masks makes this model a powerful tool for augmenting training datasets, especially for tasks where diverse backgrounds or challenging poses are needed.

Key Results

  • Superior Performance: The proposed cascaded GAN model significantly outperforms popular facial inpainting methods (GenFace, DeepFillv1, SymmFCNet, EdgeConnect) across multiple metrics (Mean Match Score, Mean SSIM, FID, Mean Perceptual Error) on the LFW dataset.
  • Competitive with Face Swapping: While DeepFake achieves good results, the proposed method demonstrates better identity preservation and more robust generation across variations in skin tone, pose, and expression.
  • Effective Data Augmentation: Fine-tuning a ResNet-50 model on a dataset augmented with synthetic faces generated by their model led to improved performance on the LFW dataset, demonstrating its utility for CNN training.
  • Cascaded vs. ProGAN: The cascaded approach generally yields sharper results and better perceptual quality compared to their ProGAN variant, despite the ProGAN variant being faster to train.

Limitations and Future Work

  • Resolution Limitations: The current model generates 128x128 images. The authors suggest that increasing resolution could be achieved by adding more generator blocks in a progressive manner, similar to [35, 13].
  • Artifacts in ProGAN Variant: The ProGAN version, while faster, suffers from blurrier artifacts, especially in hair, potentially due to using only the final block for synthesis.
  • Style Variation: The authors propose exploring style-based noise injection [36] to introduce more variation in the generated output's style while maintaining subject identity.
  • Video Extension: A natural next step is to extend this work to generate full face videos.

Summary updated

BibTeX
@misc{banerjee2018hallucinating,
  author = {Sandipan Banerjee and Walter J. Scheirer and Kevin W. Bowyer and Patrick J. Flynn},
  title = {{On Hallucinating Context and Background Pixels from a Face Mask using Multi-scale GANs}},
  year = {2018},
  eprint = {1811.07104},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/1811.07104},
}
Figure