[Paper Review] SpA-Former: Transformer image shadow detection and removal via spatial attention
SpA-Former proposes a one-stage, end-to-end Transformer-based network for joint image shadow detection and removal, leveraging spatial attention and Fourier transform residual blocks to capture long-range dependencies and preserve both low- and high-frequency details. It achieves state-of-the-art performance on the ISTD dataset with a PSNR of 33.51 and RMSE of 6.86, while being trainable on standard GPU hardware.
In this paper, we propose an end-to-end SpA-Former to recover a shadow-free image from a single shaded image. Unlike traditional methods that require two steps for shadow detection and then shadow removal, the SpA-Former unifies these steps into one, which is a one-stage network capable of directly learning the mapping function between shadows and no shadows, it does not require a separate shadow detection. Thus, SpA-former is adaptable to real image de-shadowing for shadows projected on different semantic regions. SpA-Former consists of transformer layer and a series of joint Fourier transform residual blocks and two-wheel joint spatial attention. The network in this paper is able to handle the task while achieving a very fast processing efficiency. Our code is relased on https://github.com/zhangbaijin/SpA-Former-shadow-removal
Motivation & Objective
- To address the limitations of two-stage shadow removal methods that require separate detection and removal steps, which are computationally expensive and less adaptive to diverse semantic regions.
- To overcome the challenges in shadow removal, including artifacts, lighting inconsistencies, and poor modeling of long-range spatial dependencies in CNNs.
- To unify shadow detection and removal into a single, efficient, one-stage network that directly learns the mapping from shadowed to shadow-free images.
- To improve performance by integrating spatial attention and Fourier transform residual blocks to better preserve local details and model long-range context.
Proposed method
- The network employs a Transformer-based encoder-decoder architecture with self-attention mechanisms to model long-range dependencies across the image.
- It introduces a Two-wheel Joint Spatial Attention module that enhances feature representation by focusing on spatially relevant regions through dual-path attention learning.
- A novel Fourier Transform Residual (FTR) block is designed to jointly model low- and high-frequency components by transforming spatial features into the frequency domain for residual learning.
- The architecture is end-to-end trainable without post-processing, enabling direct prediction of shadow-free images from single input images.
- The model is trained using a combination of L1 loss and perceptual loss to preserve structural and semantic fidelity.
Experimental results
Research questions
- RQ1Can a one-stage deep learning framework effectively unify shadow detection and removal without requiring separate detection or refinement steps?
- RQ2How does the integration of spatial attention and Fourier residual blocks improve shadow removal performance compared to standard CNNs?
- RQ3To what extent can a Transformer-based architecture model long-range dependencies in shadowed images for better reconstruction quality?
- RQ4Can the proposed method achieve state-of-the-art performance while maintaining fast inference speed on consumer-grade GPUs?
Key findings
- SpA-Former achieves a PSNR of 33.51 on the ISTD dataset, outperforming previous methods including DSC, DHAN, and SID.
- The model records an RMSE of 6.86, significantly lower than the baseline (7.87), demonstrating improved pixel-level reconstruction accuracy.
- The combination of Transformer, FTR block, and Two-wheel Spatial Attention yields the best performance, with a 2.5% improvement in PSNR over the baseline.
- The ablation study confirms that both the FTR block and spatial attention contribute significantly to performance, with the full model achieving the highest SSIM (0.982) on shadow regions.
- The network is deployable on a single 1080Ti GPU, indicating high efficiency and low hardware barrier for real-world applications.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.