A+D Net: Training a Shadow Detector with Adversarial Shadow Attenuation

Hieu Le, Tomas F. Yago Vicente, Vu Nguyen, Minh Hoai, Dimitris Samaras

Abstract

Shadow detection is a fundamental computer vision task complicated by the intricate interactions between light, geometry, and materials. Deep learning models for this task are often limited by the difficulty of obtaining large-scale, accurately labeled datasets. This paper presents A+D Net, a novel adversarial training framework that addresses these challenges. By utilizing a shadow attenuation network (A-Net) to generate physically plausible "hard" training examples, the framework pushes a detector network (D-Net) to identify even the most subtle shadows. A+D Net achieves state-of-the-art results on the SBU and UCF benchmarks, operating at real-time speeds of 45 fps.

Introduction

Shadow detection is notoriously difficult because shadows are not merely dark patches; they are the result of complex physical processes. While deep learning has advanced the field, these models require vast amounts of data. Manually labeling shadow data is labor-intensive (averaging 20 seconds per image), and standard augmentation techniques like rotation or flipping do not account for the physical variations in lighting. Furthermore, attempting to generate training data by completely removing shadows often leads to "label noise," where pixels labeled as shadows are visually indistinguishable from non-shadow regions, confusing the learning process.

The A+D Net Framework

The authors propose a Generative Adversarial Network (GAN) based framework consisting of two competing sub-networks: the Attenuator (A-Net) and the Detector (D-Net).

The A+D Net pipeline: An attenuator (A-Net) modifies original training images to create "harder" examples, which are then used alongside the original data to train a robust shadow detector (D-Net).

A-Net: The Attenuator

Instead of removing shadows entirely, A-Net attenuates them. It modifies training images to make shadows lighter and more difficult to detect. To ensure these generated examples remain realistic, A-Net is constrained by a simplified physical illumination model. This prevents the generation of digital artifacts and ensures the "hard" examples represent plausible real-world conditions.

D-Net: The Detector

D-Net is a U-Net-based classifier designed to predict shadow masks. It is trained on a combination of original images and the adversarial examples produced by A-Net. In this adversarial loop, A-Net attempts to "fool" D-Net by making shadows just faint enough to be missed, while D-Net learns to detect increasingly subtle shadows. To maintain label integrity, a Shadow Strength Heuristic ($k_{strength}$) is used to weight the training loss, preventing the model from trying to learn from images where the shadow has been effectively deleted.

Key Insights

  • Attenuation over Removal: Creating "weak" shadows is more effective for training than attempting full shadow removal, as it avoids the pitfalls of label noise while still challenging the detector.
  • Physics-Guided Learning: By incorporating a physics-based loss ($L_{ph}$) that enforces consistent illumination ratios, the GAN is forced to produce physically plausible training data rather than "hallucinations."
  • Efficiency: D-Net is a fully convolutional network that operates in a single pass, avoiding the slow post-processing steps (like Conditional Random Fields) required by many previous methods.

Experimental Results

The model was evaluated on the SBU Shadow Dataset (4,089 training images) and the UCF Dataset for cross-dataset evaluation.

  • State-of-the-Art Accuracy: A+D Net achieved a Balanced Error Rate (BER) of 5.4% on the SBU dataset, significantly outperforming previous models like scGAN (9.1%) and ST-CGAN (8.1%).
  • Robust Generalization: In cross-dataset tests on UCF, the model achieved a BER of 9.4%, a 16% improvement over the next best model.
  • Real-Time Performance: The system processes $256 \times 256$ images at 45 frames per second (fps), making it viable for real-time applications.
  • Ablation Study: The inclusion of the physics-based loss was shown to reduce the error rate by 20% compared to a version without it.

Limitations and Future Work

Despite its success, A+D Net occasionally confuses "dark albedo" materials (naturally dark objects like black clothing) with shadows. Additionally, approximately 65% of the model's errors occur near shadow boundaries (the penumbra). Future work will focus on improving boundary precision and better distinguishing between material properties and illumination effects.

Summary updated

BibTeX
@inproceedings{le2018d,
  author = {Hieu Le and Tomas F. Yago Vicente and Vu Nguyen and Minh Hoai and Dimitris Samaras},
  title = {{A+D Net: Training a Shadow Detector with Adversarial Shadow Attenuation}},
  booktitle = {European Conference on Computer Vision},
  year = {2018},
  doi = {10.1007/978-3-030-01216-8\_41},
}
Figure