SoftShadow: Leveraging Soft Masks for Penumbra-Aware Shadow Removal
Xinrui Wang, Lanqing Guo, Xiyu Wang, Siyu Huang, Bihan Wen
TL;DR
SoftShadow tackles the challenge of removing soft shadows by introducing soft shadow masks predicted via a fine-tuned Segment Anything Model (SAM) with Low-Rank Adaptation (LoRA) and guiding a shadow-removal network with a penumbra-aware constraint. The framework jointly optimizes mask prediction and shadow removal using three losses: $L_{mask}$, $L_{pen}$, and $L_{rem}$, enabling end-to-end training without ground-truth masks. By modeling penumbra formation, the method achieves more accurate boundary handling and reduces artifacts, delivering state-of-the-art results on SRD and LRSS and strong generalization to UIUC and ISTD+. The approach presents practical impact by leveraging powerful external detectors (SAM) in a soft, differentiable manner to improve shadow removal in real-world images with nuanced illumination transitions.
Abstract
Recent advancements in deep learning have yielded promising results for the image shadow removal task. However, most existing methods rely on binary pre-generated shadow masks. The binary nature of such masks could potentially lead to artifacts near the boundary between shadow and non-shadow areas. In view of this, inspired by the physical model of shadow formation, we introduce novel soft shadow masks specifically designed for shadow removal. To achieve such soft masks, we propose a SoftShadow framework by leveraging the prior knowledge of pretrained SAM and integrating physical constraints. Specifically, we jointly tune the SAM and the subsequent shadow removal network using penumbra formation constraint loss, mask reconstruction loss, and shadow removal loss. This framework enables accurate predictions of penumbra (partially shaded) and umbra (fully shaded) areas while simultaneously facilitating end-to-end shadow removal. Through extensive experiments on popular datasets, we found that our SoftShadow framework, which generates soft masks, can better restore boundary artifacts, achieve state-of-the-art performance, and demonstrate superior generalizability.
