CodeNeRF: Disentangled Neural Radiance Fields for Object Categories

Wonbong Jang, Lourdes Agapito · OpenReview

Introduction

Neural Radiance Fields (NeRF) have set a high bar for photorealistic 3D synthesis. However, standard NeRF models are limited by scene-specific overfitting and entangled representations of geometry and appearance. CodeNeRF addresses these limitations by extending NeRF to entire object categories through learned, disentangled latent embeddings for shape and texture. This framework enables high-fidelity 3D reconstruction and interactive editing from a single unposed image.

Methodology

CodeNeRF utilizes an auto-decoder architecture, learning latent codes (embeddings) for every object in the training set rather than relying on a convolutional encoder.

CodeNeRF pipeline: Shape ($z_s$) and texture ($z_t$) codes condition the MLP to produce volume density and color.

The system's core is a conditioned MLP architecture designed for disentanglement:

  • Shape Code ($z_s$): This code strictly controls volume density ($\sigma$), which defines the object's 3D geometry.
  • Texture Code ($z_t$): This code influences RGB color, which is also conditioned on 3D coordinates, viewing direction, and the underlying shape.
  • Test-time Optimization: At inference, the model freezes its weights and optimizes the shape code, texture code, and camera pose to match a single input image.

The model was trained on the ShapeNet-SRN benchmark and validated on real-world datasets like Stanford-Car and Pix3D to test its ability to bridge the sim-to-real gap.

Key Insights

A critical finding of CodeNeRF is that architectural disentanglement—feeding different codes into specific layers of the MLP—is more effective than using a single concatenated vector. This structural choice forces the model to separate geometry from appearance. Furthermore, by learning a category prior, the model can accurately predict occluded parts of an object, such as the back of a chair, from a single viewpoint. Finally, treating camera pose as an optimizable variable allows CodeNeRF to function without the ground-truth pose data required by many competing methods.

Experimental Results

CodeNeRF performs competitively on the SRN benchmark, achieving results comparable to PixelNeRF despite the latter's reliance on known camera poses. The optimization process is robust; even with an initial camera guess 80° off-target, the model converges to the correct pose in 85% of cases.

CodeNeRF demonstrates robust test-time optimization and independent editing of shape and texture.

The disentangled latent space allows for sophisticated texture and shape editing. Users can perform "shape/texture transfer" by swapping latent codes, such as applying the texture of a rusty truck to the sleek geometry of a sports car. Qualitative tests on real-world photographs demonstrate that the model maintains geometric consistency even in complex lighting and backgrounds.

Limitations and Future Work

While powerful, CodeNeRF's reliance on test-time optimization (taking approximately 299 iterations) makes it slower than feed-forward methods. The optimization can also occasionally settle into local minima. Future work includes developing a "universal" CodeNeRF capable of handling multiple object categories within a single model.

Summary updated

BibTeX
@misc{jang2021codenerf,
  author = {Wonbong Jang and Lourdes Agapito},
  title = {{CodeNeRF: Disentangled Neural Radiance Fields for Object Categories}},
  year = {2021},
  eprint = {2109.01750},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2109.01750},
}
Figure