Learning from Synthetic Shadows for Shadow Detection and Removal

Naoto Inoue, Toshihiko Yamasaki · DOI

Introduction

Shadow detection and removal are fundamental challenges in computer vision, essential for tasks ranging from image editing to autonomous navigation. The primary bottleneck in developing robust deep learning models for these tasks is the scarcity of high-quality, diverse training data. To effectively train a model for shadow removal, researchers typically require "paired data": a photograph of a scene containing a shadow and an identical photograph of the same scene without it.

Collecting such data in real-world environments is notoriously difficult. It requires static lighting, a fixed camera position, and the physical removal of the shadow-casting object (the occluder) without disturbing the scene. Consequently, existing datasets are often limited to a few hundred scenes, lacking the diversity in shadow geometry and lighting conditions necessary for broad generalization. This paper introduces SynShadow, a massive synthetic dataset and a physics-based synthesis pipeline designed to overcome these data limitations.

The SynShadow Pipeline

The researchers propose a two-stage pipeline to synthesize realistic shadow/shadow-free/matte triplets at scale. This approach decouples the geometric shape of the shadow from the lighting environment, allowing for near-infinite variety.

1. Shadow Matte Generation (Offline)

The process begins by generating shadow "mattes"—grayscale images where pixel values represent the degree of shadowing (1 for full umbra, and values between 0 and 1 for the soft penumbra). Using 3D model libraries such as AMASS (for human figures) and ShapeNet (for objects), the authors use Blender to project shadows onto a virtual plane. This stage focuses purely on the geometry and softness of the shadow edges.

2. Shadow Composition (Online)

The second stage involves a physically-grounded shadow illumination model to composite the synthetic mattes onto real-world background images. Rather than simply darkening pixels, the model represents the relationship between a lit pixel and a shadowed pixel using an affine transform.

A key innovation is the parameter randomization strategy. By sampling variables such as ambient light color and shadow intensity, the pipeline can generate hundreds of different shadow variations for a single background/matte pair. This accounts for the "Blue Sky" effect—the physical reality that shadows in outdoor scenes are often lit by ambient blue light from the sky rather than direct sunlight. By baking this physical intuition into the synthesis process, the resulting images achieve a high degree of realism.

Datasets and Evaluation

The effectiveness of SynShadow was evaluated using a combination of new and existing benchmarks:

  • SynShadow: The core dataset consisting of 10,000 rendered shadow mattes applied to 1,800 real-world background images.
  • ISTD+ and SRD+: Refined versions of standard benchmarks, corrected for color inconsistencies to ensure more accurate evaluation.
  • USR: A challenging dataset of unpaired real-world images used to test the "zero-shot" generalization of models trained on synthetic data.
  • SBU: A large-scale dataset specifically for shadow detection.

Key Insights

The research highlights several critical findings for the field of computer vision:

  • Independence of Parameters: Treating lighting parameters as independent variables that can be randomly sampled is more effective than attempting to learn the complex mapping between masks and shadows from limited real-world data.
  • Pre-training Efficacy: While models trained solely on SynShadow perform remarkably well, the dataset is most powerful as a pre-training step. It provides a foundational understanding of shadow physics that significantly enhances the performance of models when they are subsequently fine-tuned on small, real-world datasets.
  • Computational Efficiency: Because the composition step is performed "online" during training, the neural network is exposed to unique examples in every epoch, preventing overfitting and improving robustness.

Results

The SynShadow approach demonstrates that synthetic data, when grounded in physical principles, can outperform limited real-world data. In shadow detection tasks on the ISTD benchmark, a model pre-trained on SynShadow achieved a 50% reduction in Balance Error Rate (BER), dropping from 2.17 to 1.09.

In shadow removal tests on the USR dataset, models trained with SynShadow were rated significantly higher in user studies than those trained on traditional paired datasets. This indicates that the synthetic pipeline captures the nuances of real-world shadows more effectively than small-scale manual captures.

Limitations and Future Work

While SynShadow represents a significant leap forward, it operates under certain constraints. The current pipeline assumes shadows are cast on flat surfaces and does not account for complex 3D geometry, such as shadows falling across stairs or curved objects. Additionally, it assumes a single primary light source and that the occluder is outside the camera's field of view. Future research will focus on incorporating more complex 3D scene layouts and multi-light environments to further narrow the gap between synthetic and real-world imagery.

Summary updated

BibTeX
@article{inoue2021learning,
  author = {Naoto Inoue and Toshihiko Yamasaki},
  title = {{Learning from Synthetic Shadows for Shadow Detection and Removal}},
  journal = {IEEE Trans. Circuits Syst. Video Technol.},
  year = {2021},
  doi = {10.1109/tcsvt.2020.3047977},
}
Figure