Paper commentary
Physics-based Shadow Image Decomposition for Shadow Removal
Physics-based decomposition removes shadows from images
- Problem End-to-end networks that map shadow images straight to shadow-free images often give blurry outputs with artifacts. They also ignore the physical properties of shadows, which contain useful priors.
- Method The authors propose a physics-based decomposition that keeps a linear illumination model. SP-Net predicts its scale and offset per color channel, and M-Net predicts a soft matte that blends the relit image with the input.
- Results On the ISTD dataset, SP+M-Net reaches a shadow-area MAE of 6.5, compared with 7.6 for Hu et al.

Fig. 2 : Shadow Removal Framework. The shadow parameter estimator network SP-Net takes as input the shadow image and the shadow mask to predict the shadow parameters (w,b ). The relit image Irelit is then computed via Eq. 6 using the estimated parameters from SP-Net. The relit image, together with the input shadow image and the shadow mask are then input into the shadow matte prediction network M-Net to get the shadow matte layer α. The system outputs the shadow-free image via Eq. 5, using the shadow image, the relit image, and the shadow matte. SP-Net learns to predict the shadow parameters (w,b ), denoted as the regression loss. M-Net learns to minimize the L1 distance between the output of the system and the shadow-free image (reconstruction loss). I-Net takes as input the shadow image, shadow mask, and the shadow-free image computed from SP-Net and M-Net to output a residual image that is used to obtain the final shadow-free image.
Original paper · CC BY 4.0 · Hieu Le, Dimitris Samaras · Physics-based Shadow Image Decomposition for Shadow Removal · Original paper figure · Extracted the figure area from page 3 of the original PDF.Why end-to-end shadow removal stalls
Physics-based methods work by estimating the parameters of a source-occluder system and then reversing the shadow effects. Solving them takes considerable processing time or user assistance, as the paper notes with references to [11] and [30]. Large-scale datasets changed this picture, because a network can now be trained end-to-end to map a shadow image to a shadow-free image.
Such a network ignores the physical properties of shadows, even though these properties contain strong priors to localize and modify shadowed pixels. Deep-network outputs also tend to be blurry and/or contain artifacts, as [34], [35] and [36] report. The authors' main idea is to keep the physical model and let deep networks estimate its parameters instead.
Because the mapping is strictly defined by the simplified illumination model, it is simpler and easier to constrain.
Paired shadow and shadow-free training data is costly to collect, which makes it a second bottleneck. Shadow-free images are cumbersome to acquire, so a method that avoids them would remove that constraint. The authors therefore aim for a method that stays physically grounded and can also be trained without shadow-free images. The framework is trained on paired data for state-of-the-art results, and it can also be trained with only unpaired shadow and shadow-free patches.
A linear relight plus a matte layer
The network has to predict only the parameters of a linear relight and a per-pixel matte, not the shadow-free pixels themselves. SP-Net predicts the shadow parameters (w,b) from the shadow image, and M-Net predicts the matte layer α. The shadow-free image is then composed as the shadow image blended with the relit image through α. The authors argue that this mapping is simpler than pixel-wise image-to-image translation and easier to constrain via regularization.
The physical starting point is a lit pixel, whose intensity is reflectance times direct plus ambient illumination. A shadow blocks the direct light and part of the ambient light, so the shadowed pixel depends on the remaining ambient fraction. Combining these two relations gives a linear map from the shadowed pixel to the lit pixel, with a scale and an offset per color channel.
The relation is Ishadow-free(k) = wk × Ishadow(k) + bk, where k indexes the color channel. The scale and offset are assumed constant across the umbra, so one pair per channel relights the whole fully shadowed area. Given a shadow image and its shadow-free counterpart, linear regression recovers these values.
The relit image applies this map to the whole shadow image, giving Irelit = w · Ishadow + b. The final image is a per-pixel blend, Ishadow-free = Ishadow(1 − α) + Irelit α. Ideally, α is 1 in the non-shadow area and 0 in the umbra, and it changes gradually in the penumbra. A binary mask would leave visible boundary artifacts along the penumbra, which a soft matte avoids.
The authors estimate α from the output of this composition, so α can be checked against the shadow-free image.
How SP-Net, M-Net and I-Net run in sequence
At run time, the pipeline takes a shadow image and a shadow mask, and the mask comes from a shadow detector. SP-Net predicts six values, one scale and one offset for each of the three color channels. The relit image is computed from those parameters, and M-Net takes it together with the shadow image and mask to predict the matte. Eq. 5 then composes an intermediate shadow-free image from the shadow image, the relit image and the matte.
I-Net takes that intermediate result with the shadow image and mask, and it outputs a residual. The residual is added to obtain the final shadow-free image, so I-Net refines the output rather than starting over.
SP-Net's training targets come from a least squares fit between each shadow image and its shadow-free counterpart. The shadow mask is eroded by 5 pixels, so that penumbra pixels stay out of the fit. The scale w is bounded to [1,3], and the lower bound of 1 makes the transformation always scale up shadowed pixels. A Trust Region Algorithm solves this bounded linear system, because it suits optimization problems with bounds.
SP-Net minimizes an L1 regression loss on its parameters, together with a final L1 image reconstruction loss.
M-Net is trained with an L1 reconstruction loss on the output composed from SP-Net and M-Net, before I-Net is added. A second L1 loss applies only to the penumbra areas, so that M-Net concentrates on the soft boundary. The penumbra is the union of Min and Mout, where Mout comes from dilating the shadow mask and Min from eroding it. A smoothness loss on the spatial gradients of the matte, Lsm-α = |∇α|, prevents M-Net from producing undesired artifacts.
I-Net targets shadow pixels that the linear model misses, such as saturated dark or bright pixels and uneven umbra intensity. Earlier residual methods remove shadows from the input shadow image directly, while I-Net only refines the SP-Net and M-Net result. I-Net is trained with the final L1 reconstruction loss against the ground truth shadow-free image.
The overall objective is a weighted sum of these losses, with fully-supervised weights of 1, 1, 10, 1 and 1.
Fully-supervised results on ISTD
The ISTD testing set has to be adjusted before any method can be compared fairly on it. ISTD provides 1870 training triplets from 135 scenes and 540 testing triplets from 45 scenes. The authors fit a per-channel linear regression from the shadow image onto the non-shadow pixels of the shadow-free image. On one example this correction cut the difference from 12.9 to 2.9.
Over the whole test set the non-shadow difference fell from 6.83 to 2.6, so every method is compared on this adjusted set.
Shadow-area MAE is measured in the Lab color space, with all results resized to 256 by 256 before comparison with ground truth. The comparison covers Qu et al., Wang et al., Cun et al. and Hu et al., with the input shadow images as the first row. SP-Net alone scored 8.4 on shadow areas, which is close to the 7.6 of Hu et al. Its outputs still have visible shadow boundaries, because SP-Net uses a binary mask.
Adding M-Net cut the shadow MAE from 8.4 to 6.5, a 30% reduction. Measured against Hu et al.'s 7.6, the SP+M-Net result is a 14% error reduction. The authors read the gain as M-Net learning to give a smaller weight to pixels that SP-Net over-lights. Adding I-Net brought the full system to 6.0, another 8% reduction on shadow areas.
The ablation starts from a baseline SP+M-Net that reaches 7.9 shadow MAE. Limiting the search space of the parameters and matte lowered the shadow MAE to 7.1, a 10% error reduction. The penumbra loss then gave 6.7, and adding I-Net gave 6.2. Adding the smoothness loss gave the final 6.0, and each row adds one component to the row above. The penumbra loss pushes M-Net to focus on penumbra areas of shadows.
Without shadow masks as input, the full system scored 6.6 on shadow areas. That is slightly worse than the 6.0 of the main setting, but still ahead of earlier methods by a large margin. With ground-truth masks at test time, the full system reached 5.3 on shadow areas.
Weakly-supervised patch training
The authors crop each shadow image into overlapping 128 by 128 patches with a step of 32. Patches are sorted into non-shadow, shadow-boundary and full-shadow sets, and training maps boundary patches to non-shadow patches. This yields 311,220 patches from 1,330 training images, including 147,312 boundary patches.
D-Net's adversarial signal alone doesn't reliably push SP-Net and M-Net to remove shadows. Without constraints, SP-Net tends to output high parameter values that simply brighten the patches. Matte-Net, in the same unconstrained setting, tends to introduce artifacts resembling patterns found in non-shadow areas. So the search spaces are bounded, with w kept in [1,3] as in the fully-supervised training.
M-Net's output is mapped to [0,1], with α pinned to 0 on non-shadow pixels and 1 in the umbra.
The matting term sums |α_i − 1| over the umbra pixels and |α_i| over the pixels outside the dilated mask. The boundary loss L_bd compares the mean output just inside and just outside the shadow edge. The adversarial term is L_GAN = log(1 − D(I_output)), where D is D-Net. The boundary, matting, smoothness and adversarial weights are 0.5, 100, 10 and 0.5.
At test time, the image-level shadow parameters are a linear combination of the patch parameters. The overlapping matte patches are combined per pixel, with non-shadow pixels set to 0 and umbra pixels set to 1.
Weakly-supervised results on ISTD
On ISTD, the weakly-supervised wSP+M-Net reaches a shadow-area MAE of 9.7 without using any shadow-free training images. The text calls the baseline Mask-ShadowGAN and gives its shadow-area MAE as 12.4, so the text value and the table entry don't match. Mask-ShadowGAN needs unpaired shadow and shadow-free images, whereas wSP+M-Net needs only shadow images and their masks.
wSP+M-Net also gets a lower non-shadow MAE, 3.0 against 3.8 for Hu et al. [42].
With ground-truth shadow masks, wSP+M-Net reaches 9.1 on shadow areas and 3.6 overall. Compared to the fully-supervised model, the weakly-supervised one produces more boundary artifacts.
The ablation in Table 3 starts from the full weakly-supervised model, which has a shadow-area MAE of 9.7. Removing the search-space bounds gives 47.5, and the model collapses to uniformly dark images. Removing the boundary loss gives 41.7, another collapse, and the authors say this loss stabilizes training. Removing the matting loss gives 38.7, and removing the adversarial loss gives 26.9.
Dropping the smoothness loss only moves the shadow MAE from 9.7 to 10.2, but boundary artifacts become more visible.
SBU-Timelapse as a test of unseen shadows
ISTD contains simple scenes and simple shadows, so the authors built a harder test from time-lapse video. The SBU-Timelapse dataset has 50 clips, and each one shows a static scene where only shadows move. Because the camera is static and no visible object moves, the changes in each video come from moving shadows. The authors take the per-pixel maximum over the video to get Vmax, a pseudo shadow-free frame.
The per-pixel minimum gives Vmin, which holds the shadowed values of pixels that enter a shadow. A moving-shadow mask marks pixels where Vmax,i is greater than Vmin,i plus epsilon, with epsilon set to 80. Manual cleaning then removes changes that aren't caused by shadows, such as subtle motion or color shifts.
The evaluation feeds the video frames to each method and measures MAE in Lab space against Vmax on the moving-shadow area. On this test, the input frames scored 33.8 MAE, and Hu et al. scored 27.3. Cun et al. scored 31.2 and reduced the input error by only 8%. wSP+M-Net, trained with shadow images only, scored 23.4, which is 25% below Cun et al.
SP+M+I-Net, trained with paired data, scored 20.1, the lowest of all methods. The fully-supervised model shows little gain over its weakly-supervised counterpart and Mask-ShadowGAN. The MAE is measured against the pseudo frame Vmax, not against a real shadow-free image.
Where the method still breaks
The method fails in two main ways, and both trace back to the components that estimate the shadow parameters and the mask. The first failure type is an inaccurate predicted shadow mask, which makes the method miss the true shadow area. The second failure type is an incorrect color for the lit area, caused by inaccurate estimated shadow parameters.
During testing, the shadow masks come from the shadow detection network of Zhu et al., so detector errors flow straight into the output. The authors state that the method inherits the error from the shadow detector, shown in the third row of the SBU-Timelapse figure.
The shadow parameters (w,b) are assumed constant across all pixels in the umbra area, which is a strict assumption. Shadow intensity can vary inside the umbra, for example near the occluding object, and the authors route these cases to I-Net. I-Net partly fixes these cases, but the paper's third-row example shows SP-Net can still estimate the shadow parameters incorrectly.
Pixels with very dark or very bright colors may also fail to follow the linear illumination model because of color saturation.
Compared with the fully-supervised method, the weakly-supervised method produces more boundary artifacts. On the weakly-supervised side, the Mask-ShadowGAN comparison shows that the boundary loss and matting loss are needed to avoid collapse. On the SBU-Timelapse set, the authors note that all methods fail on some complex shadows, so the limits are not specific to this method.
The evaluation on the main results uses only the adjusted ISTD test set, so the results on other data are less tested. The authors name a more physically sophisticated illumination model as the main way to extend the work.
Paper info
- Authors
- Hieu Le, Dimitris Samaras
- Venue
- arXiv · Preprint
- First published
- 2020-12-23
- Added
- 2026-11-6
- Updated
- 2021-11-9
- Version
- v2
- arXiv
- 2012.13018
- DOI
- 10.1109/tpami.2021.3124934
- Category
- cs.CV
- Original paper terms
- CC BY 4.0
- What we show
- Paper info, commentary and permitted figures from the original paper
AI commentary is a separate explanation from the original paper and may contain errors. The original paper and figures follow each source's terms of use and any rights noted separately.
Abstract
We propose a novel deep learning method for shadow removal. Inspired by physical models of shadow formation, we use a linear illumination transformation to model the shadow effects in the image that allows the shadow image to be expressed as a combination of the shadow-free image, the shadow parameters, and a matte layer. We use two deep networks, namely SP-Net and M-Net, to predict the shadow parameters and the shadow matte respectively. This system allows us to remove the shadow effects from images. We then employ an inpainting network, I-Net, to further refine the results. We train and test our framework on the most challenging shadow removal dataset (ISTD). Our method improves the state-of-the-art in terms of root mean square error (RMSE) for the shadow area by 20\%. Furthermore, this decomposition allows us to formulate a patch-based weakly-supervised shadow removal method. This model can be trained without any shadow-free images (that are cumbersome to acquire) and achieves competitive shadow removal results compared to state-of-the-art methods that are trained with fully paired shadow and shadow-free images. Last, we introduce SBU-Timelapse, a video shadow removal dataset for evaluating shadow removal methods.
Figures from the paper

Fig. 1 : Shadow Removal via Shadow Image Decomposition. A shadow-free image Ishadow-free can be expressed in terms of a shadow image Ishadow, a relit image Irelit and a shadow matte α. The relit image is a linear transformation of the shadow image. The two unknown factors of this system are the shadow parameters (w,b ) and the shadow matte layer α. We use two deep networks to estimate these two unknown factors.
Original paper · CC BY 4.0
Fig. 3 : A comparison of the ground truth shadow mask and our shadow matte. From left to right: The input image, the relit image computed from the parameters estimated via SP-Net, the ground truth shadow mask, the final results when we use the shadow mask, the shadow matte computed using our M-Net, and the final shadow-free image when we use the shadow matte to combine the input and relit image. The matting layer handles the soft shadow and does not generate visible boundaries in the final result. (Please view in magnification on a digital device to see the difference more clearly.)
Original paper · CC BY 4.0
Fig. 5 : The effect of the inpainting network, I-Net. From left to right: The input images, the shadow-free images computed from our SP-Net and M-Net (SP+M-Net), the error heat maps of the SP+M-Net’s results, the shadow-free images computed with the addition of the inpainting network I-Net (SP+M+I-Net), and the error heat maps of SP+M+I-Net’s results. The inpainting network I-Net partially corrects the colors of the pixels in the umbra areas.
Original paper · CC BY 4.0
Fig. 6 : Weakly-supervised shadow decomposition. We train our SP-Net and M-Net together with an adversarial network, D-Net, using only two sets of unpaired shadow and shadow free patches. These patches are cropped directly from the shadow images (left panel). SP-Net and M-Net predict the shadow parameters (w,b ) and the matte layerα respectively to jointly remove the shadow. D-Net is the critic function distinguishing between the generated image patches and the real shadow-free patches. The only supervision signal is the set of shadow-free patches, which can be easily obtained using the shadow masks. The four losses guiding this training are the matting loss, smoothness loss, boundary loss, and adversarial loss.
Original paper · CC BY 4.0
TABLE 2 : Shadow removal results of our weakly-supervised method compared to weakly-supervised and priors-based shadow removal methods on the adjusted ISTD testing set [32].
Original paper · CC BY 4.0
Fig. 10 : Comparison of fully-supervised shadow removal methods on the ISTD dataset. Qualitative comparison between our method and previous state-of-the-art methods: ST-CGAN [32], Cun et al. [58], and DSC [41]. “SP+M+I-Net” are the shadow removal results using the parameters computed from SP-Net, the shadow matte computed from M-Net, and the residual layer computed from I-Net.
Original paper · CC BY 4.0
Fig. 11 : Failure cases of our method. The first row shows a case where our method fails to accurately localize the shadow area while in the second row, the color of the lit area is incorrect.
Original paper · CC BY 4.0![Table 3: Ablation Studies. We train our networks with different
settings and report the shadow removal performances on the ISTD
dataset [32]. The metric is MAE…](/papers/d32bad95-acf1-4c8e-b576-21beb7815856/figures/figure-88c7c61edf7d6070808a997be80639e0.png?thumb=512)
TABLE 3 : Ablation Studies. We train our networks with different settings and report the shadow removal performances on the ISTD dataset [32]. The metric is MAE (the lower, the better).
Original paper · CC BY 4.0![Figure 12: Comparison between our shadow removal method and the method of Cun et al . [58] on the SBU dataset [33]](/papers/d32bad95-acf1-4c8e-b576-21beb7815856/figures/figure-79e1636aa19848dfb2907eacd16cf1f4.png?thumb=512)
Fig. 12 : Comparison between our shadow removal method and the method of Cun et al . [58] on the SBU dataset [33]
Original paper · CC BY 4.0
Fig. 14 : Examples of the SBU-Timelapse dataset. We collected a time-lapse video dataset where both the scene and the visible objects remain static. The dataset includes videos containing shadows cast by close-up occluders, far distance occluders, videos with simple-to-complex shadows, and shadows on various types of backgrounds and materials.
Original paper · CC BY 4.0Quote from the paper
Hieu Le, Dimitris Samaras (2020). Physics-based Shadow Image Decomposition for Shadow Removal. arXiv:2012.13018v2. https://doi.org/10.1109/tpami.2021.3124934
BibTeX
@article{le2020physics,
title = {{Physics-based Shadow Image Decomposition for Shadow Removal}},
author = {Hieu Le and Dimitris Samaras},
year = {2020},
eprint = {2012.13018},
archivePrefix = {arXiv},
doi = {10.1109/tpami.2021.3124934},
url = {https://arxiv.org/abs/2012.13018v2}
}