Make Segment Anything Model Perfect on Shadow Detection
Xiao-Diao Chen, Wen Wu, Wenya Yang, Hongshuai Qin, Xian-Tao Wu, Xiaoyang Mao
Abstract
Compared to models pre-trained on ImageNet, the segment anything model (SAM) has been trained on a massive segmentation corpus, excelling in both generalization ability and boundary localization. However, these strengths are still insufficient to enhance shadow detection without additional training, and it raises the question: do we still need precise manual annotations to fine-tune SAM for high detection accuracy? This paper proposes an annotation-free framework for deep unsupervised shadow detection (USD) by leveraging SAM’s capabilities. The key lies in how to exploit the abilities acquired from a large-scale corpus and utilize them to improve downstream tasks. Instead of directly fine-tuning SAM, we propose a prompt-like tuning method to inject task-specific cues into SAM in a light-weight manner, namely ShadowSAM. This adaptation manner can ensure a good fitting when training data is limited. Moreover, considering that the pseudo labels used in our framework are generated by traditional USD approaches and may contain severe label noises, we propose an illumination and texture-guided updating strategy to selectively boost the quality of pseudo masks. To further improve the model’s robustness, we design a mask diversity index to establish easy-to-hard subsets for incremental curriculum learning. Extensive experiments on benchmark datasets ( <italic xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:xlink="http://www.w3.org/1999/xlink">i.e</i> ., SBU, UCF, ISTD, and CUHK-Shadow) demonstrate that our unsupervised solution can achieve comparable performance to state-of-the-art (SOTA) fully supervised methods. Our code is available at this repository.