Abstract
Realistic image composition requires consistent shadow generation for inserted objects. We present DMASNet, a two-stage deep learning framework that addresses structural artifacts and data scarcity. By leveraging a novel synthetic dataset, RdSOBA, and a decomposed prediction strategy, DMASNet produces shadows that are visually and physically consistent with scene lighting.
Introduction
In image composition, the absence or inconsistency of shadows immediately breaks the illusion of realism. Generating accurate shadows is challenging due to the scarcity of paired "shadow/no-shadow" training data and the tendency of existing models to produce fragmented or physically implausible shapes. The human eye is highly sensitive to these errors, whether they involve incorrect shadow direction, intensity, or shape.
Methods: DMASNet
The authors propose the Decomposed Mask prediction and Attentive Shadow filling Network (DMASNet). This framework splits shadow generation into two distinct phases to ensure structural integrity and lighting consistency.
1. Decomposed Mask Prediction
Rather than predicting the shadow mask directly, DMASNet first performs bounding-box regression to localize the shadow area. This constraint prevents the generation of stray pixels or "fragmented" shadows. A subsequent mask prediction module refines the shape within this box, ensuring a solid, high-resolution structure.
2. Attentive Shadow Filling
To match the lighting of the target scene, the model employs an attention mechanism. It analyzes existing shadows in the background (reference shadows) to determine the appropriate darkness and color for the new shadow. This ensures the generated shadow isn't just plausible on its own but fits the specific ambient light and surface properties of the new environment.
The RdSOBA Dataset
A major contribution of this work is the RdSOBA dataset, containing 280,000 synthetic image tuples rendered in Unity-3D. Unlike previous datasets like DESOBA, which require manual shadow removal from real photos, RdSOBA provides perfect ground truth by toggling shadows in a controlled 3D environment. This massive scale allows the model to learn the underlying physics of light better than smaller, manually curated datasets.
Key Results
DMASNet demonstrates significant improvements in both qualitative and quantitative evaluations over previous state-of-the-art (SOTA) methods.
- Visual Quality: As shown in the comparison above, DMASNet avoids the "hollow" or fragmented artifacts common in models like SGRNet and ShadowGAN. In user studies, DMASNet achieved a Bradley-Terry score of 2.039, significantly higher than SGRNet's -0.192.
- Quantitative Accuracy: On the DESOBA benchmark, DMASNet achieved a Balanced Error Rate (BER) of 24.295, outperforming the previous SOTA (27.233).
- Efficiency: Despite its two-stage approach, the model is highly efficient, utilizing roughly half the parameters (10.97M vs 20.32M) and offering faster inference times (~35ms) than SGRNet.
Conclusion
By combining large-scale synthetic data with a structured, two-stage prediction approach, DMASNet sets a new standard for shadow generation in image composition. While the model excels at common objects, future work will focus on improving the representation of extremely fine geometric details, such as bicycle spokes or intricate railings, which remain a challenge for current generative architectures.
Summary updated