Non-Deterministic Face Mask Removal Based On 3D Priors

Xiangnan Yin, Liming ChenICIP 2022

TL;DR

This paper introduces a novel framework for removing face masks from images, generating diverse and controllable results by integrating 3D face reconstruction with image inpainting. By leveraging predicted 3D facial priors, the method effectively reconstructs masked facial regions and allows for dynamic editing of expressions and shapes, overcoming limitations of existing deterministic approaches.

What Problem Does This Paper Address?

The widespread adoption of face masks for public health has created a significant challenge for computer vision tasks that rely on unoccluded facial information, such as recognition and expression analysis. While existing methods can remove masks, they often suffer from two main issues: a reliance on manually labeled missing regions and the generation of deterministic, single-output results. This means they can't produce varied or editable facial appearances after mask removal, and they often require precise annotation of the masked area. This paper aims to address these limitations by developing a method that can automatically remove masks, produce a range of plausible facial appearances, and allow for control over the resulting facial expressions and shapes.

Methods

The proposed approach consists of two main modules:

  • Multi-task 3D Face Reconstruction and Mask Segmentation (N3D): This module takes a masked face image as input and simultaneously predicts two key pieces of information:
  • 3DMM Parameters: These parameters define the 3D shape, pose, texture, and illumination of the face. The 3D Morphable Model (3DMM) is a standard representation for faces, and predicting its parameters allows for a geometrically consistent reconstruction.
  • Binary Occlusion Map: This map precisely outlines the area covered by the mask. The module uses a ResNet50 backbone and incorporates a gated convolution layer to help focus on visible textures. The training is guided by several losses, including Binary Cross-Entropy (BCE) for segmentation, coefficient loss for 3DMM parameters, a photo loss to ensure visual realism, and an identity loss to preserve facial identity.

  • Face Inpainting Module (NG): This module takes the masked image, the predicted occlusion map, and the rendered 3D face as input. It then generates the final mask-free face. The module uses a generator network with residual blocks and is trained with a discriminator to ensure realism. The losses used here include:

  • Pixel-wise Loss: To ensure the generated pixels closely match the ground truth.
  • Identity Loss: Similar to the 3D reconstruction module, to maintain facial identity.
  • Total Variation Loss: To encourage smooth transitions in the generated image.
  • Adversarial Loss: To make the generated images indistinguishable from real faces.

A key innovation is the use of the predicted 3DMM parameters to guide the inpainting process. By manipulating these parameters, the method can generate diverse facial expressions and shapes, leading to non-deterministic and controllable results.

Datasets

The paper addresses the scarcity of paired masked/unmasked face datasets by creating synthetic training data. They overlay masks onto ordinary face images. For training the segmentation and reconstruction module, they manually labeled 900 mask templates and collected 800 texture patches. These synthetic pairs are generated on-the-fly using images from the CelebA-Mask-HQ and FFHQ datasets. For evaluation, they synthesized 1000 masked face images from the test set.

Key Insights and Ideas

  • 3D Priors for Inpainting: The core idea is that a geometrically consistent 3D representation of the face provides crucial structural and semantic information that significantly aids in the challenging task of inpainting occluded regions.
  • Controllable Non-Determinism: By leveraging the 3DMM parameters, the method moves beyond single-output inpainting to generate a variety of plausible facial appearances, allowing users to control expressions and shapes. This is a significant step towards more interactive and versatile face editing.
  • Robustness to Mask Variations: The use of a large, diverse set of manually annotated mask templates for training leads to a more robust segmentation and reconstruction module, which is essential for handling the wide variety of masks encountered in real-world scenarios.
  • Bridging Segmentation and Reconstruction: The multi-task approach effectively combines mask segmentation and 3D face reconstruction, allowing these tasks to benefit from each other.

Key Results

  • Qualitative Improvements: The paper demonstrates significant qualitative improvements over existing methods like Zhang et al. and Din et al. in mask removal, producing more realistic and artifact-free results. The method also shows better adherence to 3D face shapes compared to landmark-guided approaches like LaFIn.
  • Quantitative Performance: In quantitative comparisons (Table 2), the proposed method achieves state-of-the-art results across several metrics, including L1 Loss, PSNR, SSIM, and Cosine ID, indicating superior face restoration quality. While Din et al. reported a better FID score, the authors question the credibility of those results due to inconsistencies with other methods.
  • Face Editing Capabilities: The paper showcases impressive face editing capabilities, allowing for changes in expression and even skin tone, which are not easily achievable with other methods.

Limitations and Future Work

  • Data Dependency: While the paper addresses the lack of paired data by creating synthetic datasets, the quality of the generated results is still dependent on the diversity and realism of these synthetic training pairs.
  • Potential for Artifacts: Although significantly reduced, there's always a possibility of minor artifacts in generated images, especially in highly complex or unusual scenarios.
  • Future Work: The authors suggest that further improvements could be made by exploring more advanced 3D reconstruction techniques or by incorporating more sophisticated inpainting architectures. The ability to control more nuanced facial attributes beyond basic expressions could also be a future direction.

Summary updated

BibTeX
@inproceedings{yin2022non,
  author = {Xiangnan Yin and Liming Chen},
  title = {{Non-Deterministic Face Mask Removal Based On 3D Priors}},
  booktitle = {ICIP},
  year = {2022},
  doi = {10.1109/icip46576.2022.9897343},
}
Figure