Abstract
Segment Anything Model (SAM), an advanced universal image segmentation model trained on an expansive visual dataset, has set a new benchmark in image segmentation and computer vision. However, it faced challenges when it came to distinguishing between shadows and their backgrounds. To address this, we proposed ShadClips, which consists of SAM-optimizer and SONet. It has dramatically enhanced SAM’s ability to segment shadow images, differentiating between the background and both soft and hard shadows adeptly. Due to its dependence on pixel point inputs, the SAM-Optimizer interface could do better. This method presents challenges, especially when dealing with long, extended shadows. To make the user experience more intuitive and effective, we incorporated the capabilities of CLIPs. Therefore, simple text descriptions like “A photo of a shadow” can be used to guide the SAM-Optimizer, allowing it to select the most relevant shadow mask from SAM’s comprehensive category list. Meanwhile, we introduce SONet to shadow removal. A large number of experiments on ISTD/SRD prove that the proposed method is effective and satisfactory.
Introduction
Shadow removal remains a persistent challenge in computer vision. Beyond simple brightness adjustments, shadows alter color, texture, and fine spatial details, complicating the restoration of the underlying background. While the Segment Anything Model (SAM) has revolutionized general image segmentation, it suffers from two primary limitations in the context of shadow removal: a significant domain gap where it struggles to distinguish dark backgrounds from actual shadows, and interaction friction caused by the need for manual point prompts. These manual prompts are particularly inefficient for irregular or elongated shadows. ShadClips addresses these issues by automating shadow segmentation through multimodal integration and physically grounded restoration.
Methodology
The ShadClips framework is a three-stage pipeline designed for automated, high-fidelity shadow removal.
SAM-Optimizer and Multimodal Integration
To bridge the domain gap without the prohibitive cost of retraining SAM, the authors introduce the SAM-Optimizer. This component utilizes Parameter-Efficient Fine-Tuning (PEFT) by inserting small, trainable Adapters into the Vision Transformer (ViT) blocks. This allows the model to specialize in shadow nuances while retaining its broad segmentation capabilities.
To eliminate the need for manual clicking, ShadClips integrates CLIP (Contrastive Language-Image Pre-training). By processing a simple text prompt such as "A photo of a shadow," the system calculates a relevance index for the various masks generated by SAM, automatically selecting the most accurate candidate for the shadow region.
SONet: Second-Order Shadow Removal
Once a mask is identified, the Second-order shadow removal Network (SONet) performs the restoration. Unlike standard "black box" convolutional networks, SONet is a deep unfolding network based on a variational optimization model. It treats shadow removal as an illumination estimation problem, employing second-order light enhancement to ensure smooth, natural transitions between shadowed and unshadowed regions.
Results and Discussion
The framework was evaluated on the ISTD and SRD benchmark datasets. Quantitative results demonstrate a significant performance leap:
- Segmentation: The SAM-Optimizer improved the Intersection over Union (IoU) from a baseline of 0.6320 to 0.9521.
- Restoration: On the ISTD dataset, ShadClips achieved a Peak Signal-to-Noise Ratio (PSNR) of 29.85 and a Structural Similarity Index (SSIM) of 0.959, outperforming recent state-of-the-art models like DHAN and DSC.
Qualitatively, ShadClips effectively eliminates "ghost shadows"—artifacts often found at shadow boundaries—providing superior visual fidelity compared to previous methods.
Conclusion
ShadClips demonstrates that combining foundation models like SAM and CLIP with parameter-efficient fine-tuning can solve specialized computer vision tasks with high automation. While the current pipeline is computationally intensive (approximately 1.5 seconds per image), its accuracy sets a new standard for shadow removal. Future work will focus on optimizing the model for real-time applications and improving performance in extreme lighting conditions.
Summary updated