ShadowFormer
Transformer for single-image shadow removal that uses non-shadow regions to restore shadowed ones.
Diffusion and generative · 941 operations Checked
Click or tap a spot to read it up close. Scroll or drag inside the diagram to move through it. Zoom with + and − or Ctrl and scroll. Press 0 for the whole graph. Swipe inside the diagram to move through it. Use + and − to zoom.
At a glance
- Parameters
- 11.4M
- Operations
- 941
- Framework
- PyTorch
- Recurrent
- No
- Published
- AAAI 2023
- Cited by
- 16 (as of 28 October 2026)
- Authors
- Lanqing Guo, Siyu Huang, Ding Liu and others
- License
- MIT
- Checked
- Passed: the trace was replayed operation by operation and matched the model's own output for this input.
Files
The file opened in a new tab. Use your browser's Save command there to keep it.
The diagram is a drawing of a TorchLens trace of the source code. It contains no code or weights.
Details
- Stable ID
- m20369
- Graph hash
- 02e80e4062117407c3211465e69c4c9257142b0f939dbad4ac534d4ce1cae288
- Skeleton hash
- 4843b555d7f2db14a0084de119ba2fbaa8eaa2467d17e8a61403eaf8d74fa066
- Architecture hash
- 2c93133f0a580500d15e8444e44a599e7540f45c248abd9118db5fcfa6520a27
- Diagram SHA-256
- 017273fc3a7ca17967c6ef4353d450b578e36fa3d276a06ceb289755b86244b9
- TorchLens version
- 2.36.0
- Renderer
- graphviz 2.43.0+pyvips 3.2.0+libvips 8.18.7+render-opts@06c1f0d3
- Check
- Forward pass replayed in PyTorch
What it is
ShadowFormer is a transformer-based network for image shadow removal, built to use the non-shadow regions of an image to help restore the shadowed ones. The paper's argument is that most earlier approaches work locally within shadow and non-shadow regions, which leaves severe artifacts around the shadow boundaries.
The network takes a shadow image together with its shadow mask. Its encoder and decoder are transformer blocks with channel attention, arranged as a multi-scale pipeline. In the bottleneck stage sits the Shadow-Interaction Module (SIM), whose Shadow-Interaction Attention (SIA) reweights the attention map to emphasize the similarity between non-shadow and shadow regions. The reweighting is driven by the mask, which is max-pooled to the spatial size of the bottleneck features. A final linear projection produces a residual image, which is added to the shadow input.
Training uses a single L1 loss, where the paper says other shadow removal methods are trained under a hybrid loss function. On three shadow removal datasets (ISTD, ISTD+ and SRD), the paper reports outperforming the methods it compares against while using 5× to 150× fewer model parameters. The repository released pretrained models for ISTD and ISTD+.
Key idea. ShadowFormer places a Shadow-Interaction Module in the bottleneck of a channel-attention transformer so that non-shadow regions inform the restoration of shadow regions.
- ShadowFormer
- shadow removal
- image shadow removal
- Shadow-Interaction Module
- Shadow-Interaction Attention
- SIM
- SIA
- Retinex-based shadow model
- ISTD
AI-written summary, based on the paper and checked automatically against it; not reviewed by a person. Corrections welcome.
Cite the paper
@misc{guo2023shadowformerglobalcontexthelps,
title={ShadowFormer: Global Context Helps Image Shadow Removal},
author={Lanqing Guo and Siyu Huang and Ding Liu and Hao Cheng and Bihan Wen},
year={2023},
eprint={2302.01650},
archivePrefix={arXiv},
primaryClass={cs.CV},
url={https://arxiv.org/abs/2302.01650},
}