ShadowMaskFormer: Mask Augmented Patch Embeddings for Shadow Removal
Zhuohao Li, Guoyang Xie, Guannan Jiang, Zhichao Lu
TL;DR
ShadowMaskFormer addresses shadow removal by integrating shadow information at the very start of processing, using Mask Augmented Patch Embedding (MAPE) to bias patch embeddings toward shadow regions. The method uses two complementary binarizations of the shadow mask to compute a shadow-enhanced embedding and applies a lightweight convolutional projection before passing to a vision transformer backbone, enabling accurate restoration with only about 2.2MB of parameters. Empirical results on ISTD, ISTD+, and SRD show state-of-the-art or competitive performance with strong efficiency and robustness to mask quality, including generalization to unseen shadow scenarios. This work highlights the practical impact of leveraging shadow information early in patch embeddings, offering a scalable and effective direction for shadow-aware vision transformers.
Abstract
Transformer recently emerged as the de facto model for computer vision tasks and has also been successfully applied to shadow removal. However, these existing methods heavily rely on intricate modifications to the attention mechanisms within the transformer blocks while using a generic patch embedding. As a result, it often leads to complex architectural designs requiring additional computation resources. In this work, we aim to explore the efficacy of incorporating shadow information within the early processing stage. Accordingly, we propose a transformer-based framework with a novel patch embedding that is tailored for shadow removal, dubbed ShadowMaskFormer. Specifically, we present a simple and effective mask-augmented patch embedding to integrate shadow information and promote the model's emphasis on acquiring knowledge for shadow regions. Extensive experiments conducted on the ISTD, ISTD+, and SRD benchmark datasets demonstrate the efficacy of our method against state-of-the-art approaches while using fewer model parameters.g fewer model parameters. Our implementation is available at https://github.com/lizhh268/ShadowMaskFormer.
