From Shadow Segmentation to Shadow Removal

Hieu M. Le, Dimitris Samaras · OpenReview

TL;DR

This paper introduces a novel shadow removal technique that bypasses the need for paired shadow and shadow-free images during training. By leveraging an adversarial framework guided by physics-based constraints, the method learns to remove shadows using only shadow and non-shadow patches extracted from the same image, achieving competitive results and showing promise for video shadow removal.

What Problem Does This Paper Address?

Shadows are a ubiquitous phenomenon in natural images, posing significant challenges for various computer vision tasks like object detection and segmentation. While deep learning has led to remarkable progress in shadow removal, most state-of-the-art methods rely on large datasets of paired shadow and shadow-free images. Acquiring such paired data is cumbersome, often results in datasets lacking diversity and prone to errors (e.g., color mismatches), and struggles to capture self-cast shadows. This dependency on paired data limits the scalability and robustness of existing shadow removal algorithms.

Methods

The core innovation of this work lies in its weakly-supervised training approach. Instead of requiring paired images, the authors propose to train a shadow removal system using unpaired shadow and non-shadow patches that are cropped directly from the same shadow image. This is achieved through an adversarial framework where a generator network attempts to remove shadows from shadow-boundary patches, and a discriminator network tries to distinguish these generated shadow-free patches from real shadow-free patches.

Crucially, the authors introduce a set of physics-based constraints to guide this adversarial training. These constraints are derived from a physical model of shadow formation and incorporate properties like shadow matting and smoothness. Specifically, the method decomposes the shadow image into a shadow parameter set (w, b) and a matte layer (α).

  • Param-Net predicts the shadow parameters (w, b) for each color channel, which are used to relight shadowed pixels.
  • Matte-Net predicts the matte layer (α) that blends the original shadow image and the relit image to produce a shadow-free output.
  • D-Net acts as the discriminator.

The training is guided by four losses:

  1. Matting loss: Ensures correct blending of shadow and relit regions.
  2. Smoothness loss: Enforces smooth transitions of the matte layer across shadow boundaries.
  3. Boundary loss: Encourages color similarity between areas inside and outside shadow boundaries.
  4. Adversarial loss: Drives the generator to produce realistic shadow-free patches.

This combination of adversarial learning and physics-based priors allows the model to learn physically plausible shadow removal without direct supervision from paired data.

Datasets

  • ISTD dataset: Used for training and evaluation of the patch-based shadow removal method. The authors note that their method is trained using only shadow masks from this dataset.
  • Proposed Video Shadow Removal dataset: A novel dataset collected by the authors, consisting of videos with static scenes and moving shadows. This dataset was used to evaluate the method's performance on video shadow removal and to demonstrate the effectiveness of fine-tuning.

Key Insights and Ideas

  • Shadow patches contain sufficient information: The authors hypothesize that image patches near shadow boundaries contain critical information (color differences, gradual transitions) for shadow removal, making it possible to learn from these patches alone.
  • Physics-based constraints are key to adversarial training: Simply using an adversarial signal is insufficient for shadow removal due to the vast parameter space. Incorporating physical properties of shadows provides the necessary guidance to prevent model collapse and achieve meaningful results.
  • Weak supervision unlocks new possibilities: By removing the dependency on paired data, the method becomes more flexible and can be applied to a wider range of scenarios, including video, where paired data is even harder to obtain.
  • Fine-tuning for video is highly effective: The ability to fine-tune the pre-trained model on a single video with only shadow masks significantly improves performance, highlighting the adaptability of the approach.

Key Results

  • Competitive performance on ISTD: The proposed method achieves RMSE scores on the ISTD dataset that are competitive with state-of-the-art methods, even those trained with full supervision. Specifically, it achieves an RMSE of 9.7 on shadow areas, outperforming MaskShadow-GAN by 22% and being competitive with SP+M-Net.
  • Superior video shadow removal: On their proposed video dataset, the method outperforms existing methods like MaskShadow-GAN and SP+M-Net.
  • Significant improvement with fine-tuning: Fine-tuning the model for just one epoch on a testing video leads to a substantial reduction in RMSE (e.g., 10% error reduction on their video dataset), demonstrating the practical advantage for video applications.
  • Qualitative results: The method produces clean shadow-free images with fewer artifacts compared to some other state-of-the-art methods, and it preserves textures well.

Limitations and Future Work

  • Dependency on shadow masks: While the method eliminates the need for paired images, it still requires shadow segmentation masks for training. The authors acknowledge that the performance is influenced by the quality of these masks, especially in video scenarios where masks can be imperfect.
  • Generalization to complex scenes: While the method shows promise, the paper mentions challenging cases where all methods fail to remove shadows properly, suggesting room for improvement in handling highly complex shadow scenarios.
  • Future work: The authors suggest that as shadow detection methods mature, their approach can be trained with very low annotation costs. The ability to fine-tune on videos also opens avenues for real-time shadow removal applications. The paper also implicitly points towards exploring more sophisticated physics-based constraints or integrating more advanced adversarial training techniques.

Summary updated

BibTeX
@inproceedings{le2020from,
  author = {Hieu M. Le and Dimitris Samaras},
  title = {{From Shadow Segmentation to Shadow Removal}},
  booktitle = {European Conference on Computer Vision},
  year = {2020},
  doi = {10.1007/978-3-030-58621-8\_16},
}
Figure