Learning to Infer 3D Shape Programs with Differentiable Renderer

Yichao LiangarXiv 2022 · DOI

Abstract

This paper presents an analytical, differentiable renderer for 3D shape programs, which describe objects through geometric primitives and loops. By replacing traditional neural executors with a mathematically exact rendering process, the proposed method enables direct gradient-based optimization of program parameters. Evaluation on the ShapeNet dataset demonstrates a 50% improvement in 3D object reconstruction accuracy over previous state-of-the-art neural-based approaches.

Introduction

When humans observe a chair, we do not merely see a collection of points or a voxel grid; we perceive structure. We recognize repetition in its four legs and regularity in its symmetrical back. In computer vision, the field of "inverse graphics" seeks to reverse-engineer these high-level structural descriptions, or "programs," from raw 3D data.

Previous state-of-the-art methods (e.g., Tian et al., 2019) utilized neural networks to "execute" or render these programs back into shapes to verify accuracy. However, these neural executors act as black boxes: they are often imprecise, require massive training datasets, and struggle to generalize when new primitive types are introduced. This research addresses these challenges by making the rendering process mathematically exact and fully differentiable, allowing gradients to flow directly from the final 3D shape back to the program's parameters.

The 3D Shape Program Language

The core of this approach is a Domain Specific Language (DSL) that defines how 3D objects are constructed. The language includes commands for drawing primitives and control flow for repetition.

The grammar of the 3D shape program language, defining the structure of programs, statements, and parameters.

As shown in the grammar above, a program consists of a sequence of statements. These can be Draw commands—which specify semantics, shape (e.g., Cuboid, Cylinder), position, and geometry—or For loops that handle translations and rotations. This structured representation allows the model to capture the inherent regularity of man-made objects.

Methods

The authors' architecture improves upon standard models by swapping the neural executor for a differentiable analytical renderer. The system consists of three main parts:

  1. The Program Generator: A dual-LSTM setup (comprising a Block LSTM and a Step LSTM) processes a 3D voxel grid to predict a sequence of program tokens, such as Draw Cuboid or For Loop.
  2. The Differentiable Executor: This is the central innovation. Instead of a neural approximation, the system uses an analytical renderer. High-level For loops are mathematically "unrolled" into basic primitives. To maintain differentiability, the authors employ a reparameterization trick: they sample points from a standard uniform distribution and transform them using the program's predicted parameters (position, rotation, scale). This allows standard backpropagation to "nudge" the dimensions and locations of parts until they match the target data.
  3. Learning Objectives: The model is trained using two primary losses: Chamfer Distance, which measures the spatial distance between the predicted point cloud and the target, and Coverage Loss, which uses a distance field to ensure the predicted primitives occupy the correct volume.

Experimental Results

The study utilized the ShapeNetCore v2 dataset, focusing on categories like benches and cabinets to test how well the model adapts to unseen object classes. The proposed method, referred to as Direct Adaptation (DA), was compared against the previous "Guided Adaptation" (GA) approach which relied on neural executors.

Qualitative results showing reconstructed 3D shapes across various categories including beds, cabinets, and shelves.

Key Findings

  • Superior Accuracy: On the ShapeNet "bench" and "cabinet" categories, the DA model reduced reconstruction error (measured by Chamfer distance) by more than 50% compared to the neural executor baseline.
  • Sample Efficiency: Because the renderer is a known geometric function, it requires zero training, making the overall system significantly more sample-efficient than neural alternatives.
  • Faithful Extrapolation: Unlike neural executors that often "hallucinate" or blur details in complex loops, the analytical renderer is perfectly faithful to the program logic. This ensures that a For loop produces identical, repeating parts with sharp, clean geometries.

Conclusion and Future Work

By prioritizing mathematical formulas over neural approximations for geometric tasks, this work demonstrates that analytical renderers can significantly enhance the precision of inverse graphics. However, some limitations remain. The choice of shape (e.g., cuboid vs. cylinder) remains a discrete bottleneck that gradients cannot easily pass through, currently requiring reinforcement learning techniques like REINFORCE.

Future research aims to explore "library learning," where the algorithm could automatically invent new program components or sub-routines as it encounters increasingly complex shapes, further expanding the expressive power of the DSL.

Summary updated

BibTeX
@misc{liang2022learning,
  author = {Yichao Liang},
  title = {{Learning to Infer 3D Shape Programs with Differentiable Renderer}},
  year = {2022},
  eprint = {2206.12675},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2206.12675},
}
Figure