Structure-Guided Diffusion Models for High-Fidelity Portrait Shadow Removal

Wanchang Yu, Qing Zhang, Rongjia Zheng, Wei-Shi Zheng

TL;DR

This paper introduces a novel diffusion-based approach for high-fidelity portrait shadow removal by framing it as a diffusion-based inpainting task. By leveraging a structure-guided diffusion model and a subsequent detail restoration diffusion model, the method achieves state-of-the-art results, robustly removing shadows while preserving facial identity and fine details.

What Problem Does This Paper Address?

Portrait photography, especially selfies, often suffers from undesirable facial shadows cast by external objects. These shadows not only degrade the aesthetic appeal but also negatively impact downstream computer vision tasks like face recognition and editing. While significant progress has been made in natural image shadow removal, portrait shadow removal remains challenging due to the scarcity of large-scale paired datasets and the high tolerance for visual artifacts in portraits. Existing methods often struggle with preserving facial identity, avoiding shadow residuals, color distortions, or structural blurring.

Methods

The proposed method tackles portrait shadow removal in three main stages:

  1. Shadow-Independent Structure Extraction: The authors train a "Structure Extraction Network" (SE-Net) that generates a structure map of the portrait. Crucially, this network is trained to be invariant to illumination changes, meaning the extracted structure map highlights facial details without being contaminated by shadow boundaries. This is achieved by synthesizing training data using a physics-based relighting method on existing portrait datasets.
  2. Structure-Guided Portrait Inpainting: A diffusion model is employed for shadow removal, conditioned on the shadow-independent structure map generated in the previous step. This structure map guides the inpainting process, ensuring that the generated shadow-free regions are consistent with the facial structure. The diffusion model learns to reverse a forward diffusion process that gradually adds noise to a masked image, effectively inpainting the masked (shadowed) regions.
  3. Gradient-Guided Detail Restoration: To recover fine-scale facial details (like eyelashes, moles, etc.) that might be lost during the inpainting stage, a second diffusion model is used. This model is guided by the gradients of the original shadow regions, allowing it to refine the shadow-free output and restore these subtle details.

The authors also introduce a shadow mask refinement step using Otsu-based thresholding to improve robustness against inaccurate input shadow masks.

Datasets

  • Training:
    • A synthetic dataset of 20,000 relighted portraits was synthesized from the CelebA dataset [30] for training the SE-Net.
  • The FFHQ dataset was used for training the inpainting diffusion model.
  • The same synthetic dataset used for SE-Net was also used for training the detail restoration diffusion model.
  • Evaluation:
    • The publicly available real-world paired dataset from PSM [56] was used.
  • An additional dataset of 200 portraits with diverse facial shadows was constructed by the authors for visual comparison.

Key Insights and Ideas

  • Shadow Removal as Inpainting: Framing shadow removal as a diffusion-based inpainting task is a key innovation, leveraging the powerful generative capabilities of diffusion models.
  • Illumination-Invariant Structure Extraction: The SE-Net's ability to extract structure maps that are independent of shadow boundaries is critical for guiding the inpainting process effectively. This addresses a major limitation of prior structure-based methods.
  • Two-Stage Diffusion Refinement: Using a structure-guided inpainting diffusion model followed by a gradient-guided detail restoration diffusion model allows for both accurate shadow removal and fine-grained detail preservation, leading to high-fidelity results.
  • Robustness to Inaccurate Inputs: The method demonstrates robustness to both inaccurate structure maps and shadow masks, making it more practical for real-world applications.

Key Results

  • Quantitative: The proposed method outperforms state-of-the-art methods on the PSM dataset across SSIM, LPIPS, and RMSE metrics. For instance, the full method achieves an SSIM of 0.830, LPIPS of 0.056, and RMSE of 17.162, surpassing other methods.
  • Qualitative: Visual comparisons show that the method effectively removes shadows while preserving facial identity, avoiding artifacts like shadow residuals, color distortions, and structural blurring. The detail restoration stage is shown to be crucial for recovering fine facial features. The method also shows competitive performance on natural images.

Limitations and Future Work

  • Limitations:
    • The method requires a shadow mask as input, although it is robust to inaccuracies.
  • While the SE-Net is trained on synthesized data, the domain gap between synthetic and real-world data might still be a factor.
  • The paper notes that some relighting-based methods are not compared due to the unavailability of their code.
  • Future Work:
    • The paper suggests that the method is also applicable to natural images by adapting the architecture and training data.
  • The authors' work on structure prediction and its impact on shadow removal suggests further exploration into robust structure estimation techniques.

Summary updated

BibTeX
@inproceedings{yu2025structure,
  author = {Wanchang Yu and Qing Zhang and Rongjia Zheng and Wei-Shi Zheng},
  title = {{Structure-Guided Diffusion Models for High-Fidelity Portrait Shadow Removal}},
  booktitle = {IEEE/CVF International Conference on Computer Vision},
  year = {2025},
}
Figure