HyperAIHyperAI

Command Palette

Search for a command to run...

5 months ago

Direction-aware Spatial Context Features for Shadow Detection and Removal

Xiaowei Hu; Chi-Wing Fu; Lei Zhu; Jing Qin; Pheng-Ann Heng

Direction-aware Spatial Context Features for Shadow Detection and Removal

Abstract

Shadow detection and shadow removal are fundamental and challenging tasks, requiring an understanding of the global image semantics. This paper presents a novel deep neural network design for shadow detection and removal by analyzing the spatial image context in a direction-aware manner. To achieve this, we first formulate the direction-aware attention mechanism in a spatial recurrent neural network (RNN) by introducing attention weights when aggregating spatial context features in the RNN. By learning these weights through training, we can recover direction-aware spatial context (DSC) for detecting and removing shadows. This design is developed into the DSC module and embedded in a convolutional neural network (CNN) to learn the DSC features at different levels. Moreover, we design a weighted cross entropy loss to make effective the training for shadow detection and further adopt the network for shadow removal by using a Euclidean loss function and formulating a color transfer function to address the color and luminosity inconsistencies in the training pairs. We employed two shadow detection benchmark datasets and two shadow removal benchmark datasets, and performed various experiments to evaluate our method. Experimental results show that our method performs favorably against the state-of-the-art methods for both shadow detection and shadow removal.

Code Repositories

stevewongv/dsc-pytorch
pytorch
Mentioned in GitHub
xw-hu/DSC
pytorch

Benchmarks

BenchmarkMethodologyMetrics
shadow-detection-on-cuhk-shadowDSC (CVPR 2018, TPAMI 2020) (256x256)
BER: 10.97
shadow-detection-on-cuhk-shadowDSC (CVPR 2018, TPAMI 2020) (512x512)
BER: 9.53
shadow-detection-on-sbuDSC (CVPR 2018, TPAMI 2020) (256x256)
BER: 6.79
shadow-removal-on-istdDSC
MAE: 6.67
shadow-removal-on-istd-1DSC (TPAMI 2020) (256x256)
LPIPS: 0.347
PSNR: 26.53
RMSE: 3.44
SSIM: 0.738
shadow-removal-on-srdDSC (TPAMI 2020) (256x256)
LPIPS: 0.412
PSNR: 25.46
RMSE: 3.97
SSIM: 0.678

Build AI with AI

From idea to launch — accelerate your AI development with free AI co-coding, out-of-the-box environment and best price of GPUs.

AI Co-coding
Ready-to-use GPUs
Best Pricing
Get Started

Hyper Newsletters

Subscribe to our latest updates
We will deliver the latest updates of the week to your inbox at nine o'clock every Monday morning
Powered by MailChimp