Diff-Shadow: Global-guided Diffusion Model for Shadow Removal

Jinting Luo, Ru Li, Chengzhi Jiang, Xiaoming Zhang, Mingyan Han, Ting Jiang, Haoqiang Fan, Shuaicheng Liu

TL;DR

This paper introduces Diff-Shadow, a novel diffusion-based model for shadow removal that leverages both local patch details and global image context. By combining parallel UNets and a unique sampling strategy, Diff-Shadow achieves state-of-the-art results in producing shadow-free images with improved illumination consistency and fewer boundary artifacts.

What Problem Does This Paper Address?

Shadows in images are a persistent challenge for many computer vision tasks, complicating object detection, segmentation, and more. The goal of shadow removal is to restore the image to a state as if no shadow were present, ensuring consistent illumination across the entire scene. While previous deep learning methods have shown promise, transformer-based approaches often struggle with residual shadows and boundary artifacts, and diffusion models, while powerful for image generation, can exhibit illumination inconsistencies. This paper aims to bridge this gap by developing a diffusion model that effectively integrates global contextual information to overcome the limitations of existing methods.

Methods

Diff-Shadow employs a parallel UNet architecture, a departure from standard single-UNet diffusion models. This architecture consists of two main branches:

  • Local Branch: This branch focuses on estimating noise within individual image patches, leveraging the diffusion process.
  • Global Branch: This branch reconstructs a low-resolution, shadow-free version of the entire image.

To effectively integrate information between these branches, two key novel components are introduced:

  • Reweight Cross Attention (RCA) Module: This module allows the local branch to access and utilize contextual information from non-shadow regions identified by the global branch. It specifically uses a masking mechanism to suppress irrelevant shadow information from the global context, focusing on more important non-shadow details.
  • Global-guided Sampling Strategy (GSS): During the diffusion denoising process, GSS intelligently merges the noise estimations from overlapping patches. It uses a weighted approach that considers both the brightness consistency between the local patch and the global image, and the proportion of shadow versus non-shadow pixels within the patch. This strategy helps to mitigate patch boundary artifacts and ensure uniform illumination.

Datasets

The paper evaluates Diff-Shadow on three standard datasets for shadow removal:

  • ISTD (Li, Wang, and Yang 2018): Contains shadow images, corresponding shadow masks, and shadow-free ground truth.
  • Adjusted ISTD (ISTD+) (Le and Samaras 2019): A variation of ISTD designed to reduce illumination inconsistencies between shadow and shadow-free images.
  • SRD (Qu et al. 2017): Consists of shadow and shadow-free image pairs, but without explicit shadow masks. For this dataset, the authors used a predicted mask from DHAN (Cun, Pun, and Shi 2020).

Key Insights and Ideas

  • Synergy of Local and Global: The core insight is that combining the fine-grained detail from local patch processing with the holistic understanding from global image context is crucial for high-quality shadow removal.
  • Targeted Global Context: The RCA module's ability to selectively use non-shadow information from the global branch, rather than just any global information, is key to avoiding the introduction of unwanted artifacts.
  • Intelligent Patch Merging: The GSS is a significant advancement over simple averaging or fixed-weight merging of patch results. By dynamically weighting patch contributions based on local image characteristics (brightness and shadow content), it effectively handles the inherent discontinuities of shadow removal.
  • Diffusion for Consistency: Leveraging diffusion models' generative power, combined with these novel guidance mechanisms, allows for more consistent illumination and fewer block artifacts compared to previous diffusion-based or transformer-based methods.

Key Results

Diff-Shadow achieves state-of-the-art performance across the evaluated datasets:

  • Quantitative Improvements:
    • On the ISTD dataset, Diff-Shadow improved PSNR from 32.33dB to 33.69dB compared to ShadowDiffusion.
  • On the SRD dataset, PSNR was improved from 32.90 dB to 34.93 dB compared to ShadowFormer.
  • The paper reports significant improvements in PSNR, SSIM, and RMSE across shadow, non-shadow, and all image regions on ISTD, SRD, and ISTD+ datasets, often outperforming previous methods by a notable margin.
  • Qualitative Improvements:
    • Results show high-quality shadow removal with consistent illumination and no visible block boundary artifacts, as demonstrated in Figure 1(c) and Figure 4.
  • The method excels in challenging scenarios with high contrast and fragmented shadows, producing results that are more similar to the ground truth.

Limitations and Future Work

  • Limitations:
    • The paper acknowledges that while GSS improves consistency, it is still a challenge to perfectly match the brightness of restored patches to the global image, especially in areas with extreme illumination disparities.
  • The current implementation focuses on 256x256 resolution for core evaluation, though the method is designed to handle arbitrary resolutions.
  • Future Work:
    • The authors suggest that further exploration of adaptive sampling strategies and more sophisticated global context integration could lead to even better results.
  • Investigating the model's performance on a wider range of challenging shadow scenarios and diverse image types could be a future direction.

Summary updated

BibTeX
@inproceedings{luo2025diff,
  author = {Jinting Luo and Ru Li and Chengzhi Jiang and Xiaoming Zhang and Mingyan Han and Ting Jiang and Haoqiang Fan and Shuaicheng Liu},
  title = {{Diff-Shadow: Global-guided Diffusion Model for Shadow Removal}},
  booktitle = {AAAI Conference on Artificial Intelligence},
  year = {2025},
  doi = {10.1609/aaai.v39i6.32625},
}
Figure