Abstract
Recovering 3D geometry from 2D images is a fundamental challenge in computer vision, typically relying on photometric consistency across multiple views. However, traditional methods often struggle with non-Lambertian surfaces or complex lighting. We introduce "Neural Shadow Fields," a method that reconstructs 3D geometry using exclusively the shadows cast within a scene. By implementing a differentiable version of the classic shadow mapping technique, we train a neural network to "carve" 3D shapes from binary shadow masks. Our approach demonstrates that sparse, 1-bit shadow cues provide sufficient geometric constraints to recover complex shapes, often outperforming standard RGB-based methods like Neural Radiance Fields (NeRF) in challenging viewing conditions.
Introduction
The task of 3D reconstruction from 2D projections is inherently ill-posed, as multiple 3D configurations can produce identical 2D images. Modern state-of-the-art techniques, such as NeRF, rely heavily on the assumption that a point's appearance remains consistent across different camera angles. This assumption frequently breaks down in the presence of specularity, reflections, or intricate textures.
Shadows, often viewed as noise or artifacts to be removed, actually contain rich, physically-anchored geometric information. They represent a direct constraint between the light source, the occluding object, and the receiving surface. While "Shape-from-Shadow" (SfS) is a known concept, existing algorithms are often too rigid for complex, uncontrolled environments. Neural Shadow Fields bridge this gap by integrating shadow-based reconstruction into a differentiable volumetric rendering framework.
Methodology
The core of our approach is the replacement of the standard color-based loss function with a shadow-based loss, enabling the optimization of a volumetric density field ($\sigma$) using a Multi-Layer Perceptron (MLP).
Differentiable Shadow Mapping
The primary innovation lies in making the shadow mapping process differentiable. In standard computer graphics, shadow mapping involves rendering a depth map from the light's perspective and comparing it to the camera's view. We formulate this process to allow gradients to flow from the shadow error back into the 3D density field.
Soft Comparison and Distance Transforms
To handle the non-differentiable nature of binary "in shadow" vs. "not in shadow" checks, we employ a sigmoid-based soft comparison. This provides the optimizer with a signal regarding how far a predicted geometry is from casting the correct shadow. Furthermore, since binary masks have zero gradients away from edges, we apply a distance transform to the ground-truth masks. This creates a "gradient ramp" that guides the model toward convergence more effectively.
Experimental Setup
We evaluated our method using both synthetic and real-world data:
- Synthetic Dataset: Four objects (cuboid, vase, chair, bunny) were rendered in Blender from 200 camera positions with a fixed light source.
- Real-World Dataset: An iPhone video of a human hand was used. Camera and light poses were estimated via COLMAP, and shadow masks were extracted using simple intensity thresholding.
Results
Our results indicate that shadows are a powerful "hidden" signal for geometry reconstruction. In synthetic tests, the shadow-based approach frequently matched or exceeded the performance of vanilla NeRF. For instance, in an overhead-view setup for a cuboid, our method achieved an RMSE of 0.0078, compared to NeRF's 0.097.
In real-world applications, the model successfully reconstructed a 3D mesh of a human hand from just 74 shadow masks, accurately capturing the gaps between fingers—a feat often difficult for silhouette-based methods. Because the method relies on binary masks, it is inherently robust to variations in texture, reflectance, and lighting color, facilitating easier sim-to-real transfer.
Discussion and Future Work
While promising, the current implementation has limitations. It assumes the light source position is known and requires that all parts of the object cast a shadow at some point to be reconstructed; otherwise, "hollow" geometry may occur. Future work will explore jointly optimizing for light position and geometry. Additionally, integrating shadow loss as a regularizer for standard NeRF could combine high-detail photometric textures with physically accurate, shadow-constrained geometry.
Summary updated