Abstract
Shadow detection is a fundamental computer vision task complicated by the need for simultaneous local and global scene reasoning and the prevalence of class imbalance. We present scGAN (Sensitivity-conditioned Generative Adversarial Network), a novel approach that introduces a tunable sensitivity parameter ($w$) into the conditional GAN framework. This parameter allows a single trained model to adjust its detection threshold dynamically. Our method achieves a 17% error reduction over previous state-of-the-art methods on major benchmarks like the SBU dataset.
Introduction
Shadow detection requires distinguishing between dark-colored objects (albedo) and actual shadows caused by light obstruction. While local reasoning helps identify dark patches, global reasoning is necessary to ensure these patches are contextually consistent with the scene's lighting. Traditional methods, such as Conditional Random Fields (CRFs), often struggle with this global consistency. Furthermore, the "minority class" nature of shadows makes standard deep learning models prone to high false-negative rates unless specifically tuned, which usually requires expensive retraining.
Methodology: The scGAN Framework
The core innovation of scGAN is the sensitivity parameter ($w$). Unlike standard conditional GANs (cGANs) that map an image directly to a mask, scGAN treats $w$ as an additional input channel to the Generator.
Key Components:
- Input Conditioning: The Generator (a U-Net architecture) receives the RGB image concatenated with a scalar value $w$.
- Weighted Loss: A weighted cross-entropy loss is employed, where $w$ determines the penalty for missing shadow pixels. During training, $w$ is sampled uniformly, teaching the network to understand the relationship between sensitivity and mask generation.
- Adversarial Consistency: The Discriminator forces the Generator to produce spatially coherent masks that "look right" for the given scene, effectively replacing complex post-processing steps.
- Multi-scale Prediction: To ensure robustness, the model aggregates predictions from the full image and hundreds of overlapping patches at various scales.
Experimental Results
The scGAN was evaluated on the SBU Shadow Dataset (4,000+ images) and the UCF Shadow Dataset.
Quantitative Performance
On the SBU dataset, scGAN achieved a 9.1% Balanced Error Rate (BER), representing a 17% improvement over the previous state-of-the-art, stackedCNN (11.0% BER). In cross-dataset evaluations, where the model was trained on SBU and tested on UCF, it achieved an 11.5% BER, even outperforming models specifically trained on UCF data.
Qualitative Analysis
The model demonstrates superior performance in challenging scenarios, such as detecting shadows on highly reflective surfaces (e.g., snow) and correctly identifying dark-colored materials that are not shadows.
Conclusion
By introducing a sensitivity "knob" into the GAN framework, scGAN provides a flexible and highly accurate solution for shadow detection. While the current multi-scale inference approach is computationally intensive, the underlying principle of sensitivity conditioning offers a promising path for other imbalanced classification tasks in domains like medical imaging or infrastructure monitoring.
Summary updated