Abstract
RiCS introduces a novel approach to bridge the gap between 2D image processing and 3D volumetric understanding. By encoding 3D self-occlusion information into a compact 2D map (Ray-marching in Camera Space), the proposed ShadingNet produces realistic, temporally coherent shadows on human models. This method significantly enhances image harmonization and improves the performance of computer vision models trained on synthetic data.
Introduction
In computer vision, "image harmonization" refers to the process of seamlessly integrating a foreground object, such as a person, into a background environment. A primary challenge in achieving realism is accurate shading. If the lighting on the subject does not match the environment, or if the subject lacks realistic self-shadows (e.g., an arm casting a shadow on the torso), the composite image appears artificial.
While 2D deep learning models excel at image processing, they often lack an inherent understanding of 3D volume and occlusion. Conversely, full 3D models are computationally expensive and difficult to align with 2D image grids. This research addresses this "dimensionality misalignment" by providing 2D models with 3D-aware context without the overhead of a full 3D pipeline.
Methods: ShadingNet and RiCS
The proposed framework, ShadingNet, relies on a novel representation called RiCS (Ray-marching in Camera Space) to bridge the 2D-3D gap.
The RiCS Map
For every pixel on the 3D surface of an object, the system shoots 62 rays in various directions. It records a "1" if a ray intersects the object itself and a "0" if it escapes to the environment. This process results in a 62-channel 2D map that explicitly informs the network which directions are blocked by the object's geometry. Because RiCS is calculated directly from geometry, it serves as a stable, reliable anchor for the learning process.
Architecture Components
As illustrated in the architecture diagram below, ShadingNet integrates several key components:
- Deep Light Encoder: Analyzes the background image to estimate Image-Based Lighting (IBL) conditions.
- Shading Generator: A U-Net architecture that processes the RiCS map, surface normals, albedo (base color), and the estimated light representation to synthesize a realistic shading map.
- Edge-Guided Loss: To ensure sharp and accurate shadows, the model employs Canny edge detection to focus on areas with significant light-to-dark transitions, preventing blurry or noisy artifacts.
Datasets and Training
The authors developed a comprehensive dataset to train and validate their approach:
- Volumetric Human Dataset: This dataset includes 212,955 frames featuring 38 human models performing 398 motion sequences. These were rendered using high-quality Monte Carlo path tracing to provide ground-truth shading.
- Evaluation Tasks: The model was tested on the SURREAL dataset for synthetic training and evaluated on real-world datasets like Freiburg Sitting People (FSitting) and Unite the People (UP) for human part segmentation tasks.
Key Results
The research demonstrates that the "Sim-to-Real" gap in computer vision is largely a shading gap. By improving the realism of synthetic training data, ShadingNet significantly boosts model performance on real-world data.
Quantitative Performance
ShadingNet outperformed existing baselines, such as Deep CG2Real and DoveNet, across all metrics. Specifically, it reduced Mean Squared Error (MSE) by 42.77% and improved temporal stability (measured by FVD) by 49.34% compared to the leading baseline.
Qualitative Improvements
Visually, the method produces significantly cleaner results, particularly on complex areas like faces and limbs. It avoids the pixel noise common in other image-to-image translation methods.
Downstream Impact
When a human part segmentation network was pre-trained on synthetic data harmonized by ShadingNet, its pixel accuracy on the real-world FSitting dataset increased by approximately 16% compared to training on standard synthetic data.
Limitations and Future Work
While ShadingNet represents a significant advancement, several areas for future research remain:
- Environmental Shadows: Currently, the model focuses on self-occlusion. It does not yet account for shadows the subject should cast onto the background floor or walls.
- Controllable Lighting: The light representation is currently a "black box" embedding. Future work could make this representation more interpretable and controllable, allowing users to manually adjust light sources.
- Ray Density: The fixed 62-ray RiCS map may miss extremely fine shadow details. Moving toward a continuous representation of occlusion could further improve resolution.
Summary updated