After a Decade: Bringing Shadow Removal into the Real World with Agentic Training Data
Organizations: Department of Computer Science Stony Brook University · Department of Computer Science University of North Carolina at Charlotte
Abstract
Shadow removal looks nearly solved on established benchmarks, yet remains brittle in the real world. Models have advanced; the paired training data they rely on have barely changed in nearly a decade. The reason is simple: obtaining a shadow-free target requires removing the occluder while keeping the scene, camera, and illumination otherwise unchanged, making diverse paired data difficult to capture. Meanwhile, large shadow detection datasets already contain diverse real-world images and masks, but no shadow-free targets. To turn this abundant but incomplete data into paired supervision, we propose an offline agentic workflow combining physics-motivated generation, failure detection, feedback-driven retry, candidate selection, and deterministic correction. Using this workflow, we construct AgenticShadow, a dataset of 17,138 image-mask-target triplets spanning general scenes, faces, and remote sensing. Our construction workflow reduces Color Distribution Difference by 50.5% over previous shadow removal work, while training existing shadow removal models on AgenticShadow reduces cross-domain LAB RMSE by 19.7-37.5%.
Figures & tables
| SBU | CUHK | ASFW | S-EO | Total | |
|---|---|---|---|---|---|
| Domain | General | General | Facial | Remote sensing | – |
| Train | 3,974 | 8,335 | 928 | 880 | 14,117 |
| Test | 635 | 2,087 | 153 | 146 | 3,021 |
| Total | 4,609 | 10,422 | 1,081 | 1,026 | 17,138 |
| Method | Mean | Std | Min | Max |
|---|---|---|---|---|
| SID ( Le and Samaras, 2019 ) | 38.00 | 45.05 | 1.66 | 353.64 |
| SF ( Guo et al., 2023a ) | 33.63 | 52.74 | 0.41 | 427.34 |
| SD ( Guo et al., 2023b ) | 89.72 | 130.54 | 0.29 | 650.26 |
| I4S ( Li et al., 2023a ) | 31.57 | 48.39 | 0.43 | 402.44 |
| SRR ( Hu et al., 2025 ) | 14.06 | 26.08 | 0.24 | 215.40 |
| Ours-Physics | 6.96 | 18.59 | 0.01 | 158.40 |
| ISTD+ | AgenticShadow | |||
|---|---|---|---|---|
| Model | PSNR | LAB | PSNR | LAB |
| HomoFormer ∗ | 32.53 | 1.92 | 18.85 | 8.43 |
| PF ∗ | 32.95 | 1.87 | 18.70 | 8.55 |
| HomoFormer | 32.92 | 1.85 | 21.95 | 5.87 |
| PF | 32.74 | 1.86 | 22.50 | 5.55 |
| ISTD+ | AgenticShadow: LAB RMSE | AgenticShadow: Macro | |||||||
| Method | LAB | SBU | CUHK | ASFW | S-EO | PSNR | SSIM | MAE | LAB |
| Official ISTD+ checkpoints | |||||||||
| SID ( Le and Samaras, 2019 ) | 2.89 | 7.25 | 10.86 | 7.48 | 10.23 | 18.28 | 0.6404 | 23.77 | 8.96 |
| ShadowFormer ( Guo et al., 2023a ) | 1.95 | 6.63 | 10.01 | 7.35 | 10.74 | 18.57 | 0.6592 | 23.36 | 8.68 |
| Inpaint4Shadow ( Li et al., 2023a ) | 2.77 | 7.12 | 9.72 | 7.58 | 10.08 | 18.59 | 0.6119 | 23.06 | 8.63 |
| StableSR ( Xu et al., 2025b ) | 2.03 | 7.32 | 8.84 | 10.01 | 10.93 | 17.90 | 0.6506 | 25.23 | 9.28 |
Appendix figures & tables22 assets
Supplementary material from the paper’s appendix.
Appendix
| Final triplets | |||||||
|---|---|---|---|---|---|---|---|
| Source | Eligible | Selected | Usable | Generated | Train | Test | Total |
| SBU | 4,723 | 4,621 | 4,614 | 4,609 | 3,974 | 635 | 4,609 |
| CUHK | 10,500 | 10,430 | 10,430 | 10,425 | 8,335 | 2,087 | 10,422 |
| ASFW | 1,081 | 1,081 | 1,081 | 1,081 | 928 | 153 | 1,081 |
| S-EO | 19,162 | 1,026 | 1,026 | 1,026 | 880 | 146 | 1,026 |
| Total | 35,466 | 17,158 | 17,151 | 17,141 | 14,117 | 3,021 | 17,138 |
| Probe routing | Final selection | |||||
|---|---|---|---|---|---|---|
| Source | Generated | Pass | Retry | Multi | Single | Fallback |
| SBU | 4,609 | 4,500 | 109 | 4,588 | 19 | 2 |
| (97.64%) | (2.36%) | (99.54%) | (0.41%) | (0.04%) | ||
| CUHK | 10,425 | 10,193 | 232 | 10,364 | 48 | 13 |
| (97.77%) | (2.23%) | (99.41%) | (0.46%) | (0.12%) | ||
| ASFW | 1,081 | 1,081 | 0 | 1,081 | 0 | 0 |
| Prompt setting | Cases | Pass | Retry | Edits | Evaluations | Selectors |
|---|---|---|---|---|---|---|
| Generic | 399 | 391 | 8 | 1,205 | 1,205 | 394 |
| Physics-motivated | 399 | 389 | 10 | 1,207 | 1,207 | 397 |
| Method | Checkpoint condition | Mask | Inference |
| SID ( Le and Samaras, 2019 ) | Official ISTD+ | Yes | Resize to |
| ShadowFormer ( Guo et al., 2023a ) | Official ISTD+ | Yes | Resize to |
| Inpaint4Shadow ( Li et al., 2023a ) | Official ISTD+ | Yes | Resize to |
| StableSR ( Xu et al., 2025b ) | Official ISTD+ / INS | No | Native resolution; 20 steps |
| Padded to a multiple of 16 | |||
| ShadowDiffusion ( Guo et al., 2023b ) | Official ISTD+ | Yes | Full inference 25 DDIM steps |
| Method | Online params (M) | Trainable params (M) | Time/image (s) | Peak VRAM (GiB) |
|---|---|---|---|---|
| ShadowDiffusion | 55.52 | 55.52 | 2.558 | 1.51 |
| HomoFormer | 17.81 | 17.81 | 0.505 | 0.92 |
| PhaSR | 323.37 | 19.00 | 0.445 | 2.80 |
| PF | 658.93 | 19.25 | 0.999 | 3.33 |
| PF-MF | 658.61 | 18.92 | 0.978 | 3.32 |
| SBU | CUHK-Shadow | |||||||
| Method | PSNR | SSIM | MAE | LAB | PSNR | SSIM | MAE | LAB |
| Official ISTD+ checkpoints | ||||||||
| SID ( Le and Samaras, 2019 ) | 20.28 | 0.6258 | 18.26 | 7.25 | 16.32 | 0.5643 | 30.43 | 10.86 |
| ShadowFormer ( Guo et al., 2023a ) | 21.02 | 0.6506 | 16.99 | 6.63 | 17.09 | 0.6008 | 28.50 | 10.01 |
| Inpaint4Shadow ( Li et al., 2023a ) | 20.51 | 0.5883 | 18.30 | 7.12 | 17.54 | 0.5406 | 26.43 | 9.72 |
| StableSR ( Xu et al., 2025b ) | 20.34 | 0.6345 | 18.83 | 7.32 | 18.38 | 0.6173 | 23.94 | 8.84 |
| ASFW | S-EO | |||||||
| Method | PSNR | SSIM | MAE | LAB | PSNR | SSIM | MAE | LAB |
| Official ISTD+ checkpoints | ||||||||
| SID ( Le and Samaras, 2019 ) | 20.02 | 0.7687 | 19.38 | 7.48 | 16.50 | 0.6027 | 27.02 | 10.23 |
| ShadowFormer ( Guo et al., 2023a ) | 20.18 | 0.7801 | 19.36 | 7.35 | 16.01 | 0.6052 | 28.57 | 10.74 |
| Inpaint4Shadow ( Li et al., 2023a ) | 19.90 | 0.7523 | 19.88 | 7.58 | 16.43 | 0.5665 | 27.62 | 10.08 |
| StableSR ( Xu et al., 2025b ) | 17.14 | 0.7367 | 28.16 | 10.01 | 15.75 | 0.6140 | 29.98 | 10.93 |
| ISTD+ | AgenticShadow | ||||||||
|---|---|---|---|---|---|---|---|---|---|
| Model | Checkpoint | PSNR | SSIM | MAE | LAB | PSNR | SSIM | MAE | LAB |
| StableSR | ISTD+ | 32.23 | 0.9272 | 4.84 | 2.03 | 17.90 | 0.6506 | 25.23 | 9.28 |
| INS | 22.76 | 0.8986 | 12.14 | 5.82 | 16.55 | 0.6350 | 28.93 | 11.12 | |
| PhaSR | ISTD+ | 32.12 | 0.9330 | 4.82 | 2.13 | 17.90 | 0.6556 | 24.75 | 9.33 |
| INS | 26.03 | 0.9129 | 8.93 | 4.32 | 17.24 | 0.6415 | 26.90 | 10.37 | |
| ISTD+ | AgenticShadow | |||||
|---|---|---|---|---|---|---|
| Training data | PSNR | LAB | PSNR | SSIM | MAE | LAB |
| ISTD+ | 32.53 | 1.92 | 18.85 | 0.6597 | 22.36 | 8.43 |
| AgenticShadow | 27.96 | 2.74 | 21.85 | 0.7152 | 15.45 | 5.94 |
| Combined | 32.92 | 1.85 | 21.95 | 0.7181 | 15.25 | 5.87 |
| Variant | ISTD+ | SBU | CUHK | ASFW | S-EO | Macro |
|---|---|---|---|---|---|---|
| HomoFormer | 1.860 | 4.907 | 6.266 | 5.434 | 7.041 | 5.912 |
| Depth only | 1.859 | 4.835 | 6.155 | 5.122 | 6.964 | 5.769 |
| Semantic only | 1.857 | 4.731 | 6.051 | 4.750 | 6.807 | 5.585 |
| PF | 1.861 | 4.723 | 6.045 | 4.737 | 6.804 | 5.577 |