Abstract
Shadow removal is a fundamental task in computer vision aimed at restoring the appearance of areas obscured by shadows. While Transformer-based architectures have become popular for this task, they often struggle with a "Goldilocks" problem: global attention is computationally expensive, while fixed window-based attention can lack necessary "lit" reference points if a window is entirely shadowed. We propose the Regional Attention Shadow Removal Model (RASM), which introduces a sliding-window Regional Attention mechanism. This approach allows shadowed pixels to aggregate information from their immediate non-shadowed neighbors. RASM achieves state-of-the-art performance, surpassing previous methods by 0.90dB PSNR on the ISTD+ dataset, while maintaining a lightweight profile of 5.2M parameters and 25.2 GFLOPs, making it suitable for mobile applications.
Introduction
Shadow removal involves reconstructing the texture and color of regions under shadow to match the surrounding lit areas. Recent trends have moved toward Transformer-based models to leverage their powerful attention mechanisms. However, standard global attention scales quadratically with image size, and window-based attention (e.g., Swin Transformers) uses static grids that may isolate shadowed pixels from their lit counterparts.
The core challenge lies in the "Contrast Hypothesis": the information required to restore a shadowed pixel is typically found in its immediate non-shadowed surroundings. Existing models often fail to capture this local contrast efficiently.
Methods
The proposed RASM architecture is a U-shaped network that integrates Channel Attention (CA) for global context and Regional Attention (RA) for local spatial reconstruction.
Regional Attention
Unlike fixed-window attention, Regional Attention uses a sliding neighborhood centered on each token. This ensures that pixels at the edge of a shadow always have access to adjacent lit regions. To further enhance the receptive field without adding parameters, we introduce a dilation factor, creating Dilated Regional Attention. This allows the model to "reach out" further to find reference lit areas while maintaining computational sparsity.
Experimental Results
RASM was evaluated on the ISTD+ and SRD datasets. The results demonstrate that RASM provides a superior trade-off between restoration quality and computational efficiency.
Quantitative Performance
On the ISTD+ dataset, RASM achieved a PSNR of 40.73dB in shadow regions, a significant improvement over the previous state-of-the-art. As shown in the efficiency analysis, RASM (Ours) maintains low error rates while requiring significantly fewer GFLOPs than competing models like ShadowDiffusion or DHAN.
Efficiency
With only 5.2 million parameters and 25.2 GFLOPs, RASM is roughly 5x more efficient than the DHAN model and over 30x more efficient than ShadowDiffusion in terms of GFLOPs, while producing higher quality results.
Conclusion
RASM demonstrates that localized, sliding-window attention is highly effective for shadow removal. By prioritizing the immediate neighborhood of shadowed pixels, the model achieves superior accuracy and efficiency. Future work includes improving robustness to predicted shadow masks and exploring the limits of regional attention in scenes with very large shadows.
Summary updated