ShadowDiffusion: When Degradation Prior Meets Diffusion Model for Shadow Removal

Lanqing Guo, Chong Wang, Wenhan Yang, Siyu Huang, Yufei Wang, Hanspeter Pfister, Bihan Wen

Abstract

ShadowDiffusion is a novel framework for single-image shadow removal that integrates the generative capabilities of diffusion models with physical degradation priors. Unlike traditional methods that treat shadow removal as a simple mapping task, ShadowDiffusion employs a dynamic mask-aware diffusion model (DMDM) and an unrolling-inspired sampling process. This approach jointly refines the shadow mask and the restored image, effectively eliminating boundary artifacts and ensuring physical consistency. Experimental results on ISTD, ISTD+, and SRD datasets demonstrate that ShadowDiffusion achieves state-of-the-art performance, significantly outperforming existing methods in both quantitative metrics and visual quality.

Introduction

Removing shadows from a single image is a classic "ill-posed" problem in computer vision. To achieve high-fidelity restoration, a model must simultaneously understand the physics of light obstruction (the degradation) and the characteristics of a natural, shadow-free scene (the generative prior).

Existing deep learning methods often fall short because they treat shadow removal as a straightforward image-to-image mapping. They frequently rely on coarse, inaccurate shadow masks provided by external detectors. Because these masks have "fuzzy" or incorrect edges, the resulting images often exhibit "ghosting" artifacts or visible seams. Furthermore, most models ignore the underlying physical relationship between shadowed and unshadowed regions, leading to inconsistent colors and textures.

Methodology

ShadowDiffusion bridges the gap between physics-based modeling and generative AI. The architecture consists of three main components:

  1. Shadow Degradation Model: Instead of assuming shadows are simple linear overlays, the authors propose a spatially-variant model. It decomposes the shadow into a mask ($m$) and an illumination weight ($w$), allowing the model to handle complex, non-uniform lighting.
  2. Dynamic Mask-Aware Diffusion Model (DMDM): Most conditional diffusion models use a fixed condition. DMDM treats the shadow mask as a dynamic variable, learning to predict noise and refine the shadow mask simultaneously at every step of the diffusion process.
  3. Unrolling-Inspired Diffusive Sampling: The researchers formulated shadow removal as an optimization problem and "unrolled" it into the diffusion sampling steps. This includes a Data Consistency (DC) step. During inference, the model iteratively checks the result against the original shadowed input to ensure the physics of the scene remain consistent.
The ShadowDiffusion architecture featuring the DMDM and unrolling-inspired sampling process.

Experimental Results

The model was evaluated on three standard benchmarks: ISTD, ISTD+, and SRD. ShadowDiffusion set new state-of-the-art records across all tested datasets:

  • SRD Dataset: It achieved a significant jump in PSNR, moving from the previous best of 31.69dB to 34.73dB.
  • ISTD Dataset: It reached a PSNR of 40.15dB in shadow regions, significantly outperforming competitors like BMNet and DHAN.
  • Qualitative Improvement: Visually, ShadowDiffusion produces seamless transitions that are nearly indistinguishable from the ground truth, avoiding the "dark rings" or blurry smudges common in previous methods.
Qualitative comparison of ShadowDiffusion against previous state-of-the-art methods across different datasets.

Discussion and Conclusion

A key insight of this work is that the shadow mask should not just be an input; it should be an auxiliary task that improves over time. By refining the mask alongside the image, the model learns precise boundaries, leading to cleaner edges. Additionally, by injecting a physical degradation prior via the unrolling framework, the generative model remains grounded in the reality of the input image.

While ShadowDiffusion outperforms existing methods, its primary limitation is inference speed, a common trait of diffusion-based approaches. Future work may involve optimizing sampling speed or applying this "dynamic mask" approach to other localized degradations, such as reflection or water droplet removal.

Summary updated

BibTeX
@inproceedings{guo2022shadowdiffusion,
  author = {Lanqing Guo and Chong Wang and Wenhan Yang and Siyu Huang and Yufei Wang and Hanspeter Pfister and Bihan Wen},
  title = {{ShadowDiffusion: When Degradation Prior Meets Diffusion Model for Shadow Removal}},
  booktitle = {IEEE/CVF Conference on Computer Vision and Pattern Recognition},
  year = {2022},
}
Figure