# Editing Conditional Radiance Fields

Steven Liu, Xiuming Zhang, Zhoutong Zhang, Richard Zhang, Jun-Yan Zhu, Bryan Russell · arXiv · 2021-5-13

- **Problem** Editing a NeRF-style scene means carrying sparse 2D scribbles into a 3D field whose weights give no direct handle on the region being changed.
- **Method** Trains a conditional radiance field over a shape class with a shared shape branch, then updates only later layers and latent codes to fit each scribble-based edit.

![Figure 2: Conditional radiance ﬁeld network. Our network maps a 3D location x, viewing direction d, and instance-speciﬁc shape code z(s) and color code z(c) to…](https://refivu.com/papers/c434d11b-0144-4e79-9742-c728495cdf18/figures/figure-c4db772c226101666084fdea180092bb.png?thumb=512)

**Figure 2** : Conditional radiance ﬁeld network. Our network maps a 3D location x, viewing direction d, and instance-speciﬁc shape code z(s) and color code z(c) to radiance c and scalar density σ. The network is composed of modular parts for better shape and color disentanglement. We train our network over a collection of 3D objects (Section 3.1). As highlighted, only a subset of the network components need to be updated during editing (Section 3.2).

[Original paper](https://arxiv.org/abs/2105.06466v2) · [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/) · Steven Liu, Xiuming Zhang, Zhoutong Zhang, Richard Zhang, Jun-Yan Zhu, Bryan Russell · Editing Conditional Radiance Fields · Original paper figure · Extracted the figure area from page 3 of the original PDF.

## Why editing a neural radiance field is hard

A NeRF-style model keeps the scene inside the weights of a neural network, so a user cannot grab a vertex or a texture region directly as in a mesh editor. The network maps a 3D location and a viewing direction to a color and a density, and a pixel is formed only after many samples along a ray are blended together.

This leaves two obstacles for an editor. A stroke drawn on one rendered view has to reach every 3D point of the same part, and the network holds millions of parameters without an obvious mapping from each parameter to a visible property. Earlier 3D editing work targets explicit representations, so it does not carry over directly to a neural representation.

The study works at the level of an object class rather than a single scene. The model is trained over many instances of one class, and an edit changes a local part of one instance, either by recoloring it, reshaping it, or transferring the color or shape of another instance.

## A conditional radiance field with a shared shape branch

The model starts from NeRF, which renders novel views of one scene. The conditional radiance field adds a shape code and a color code for each instance, so one network covers a whole class. Given a location x, a viewing direction d and the two codes, the network returns a radiance c and a scalar density σ. The density does not depend on the viewing direction, while the radiance does.

A shared shape network acts only on the positional encoding of the location and carries geometry common to all instances. An instance-specific shape network takes the shape code together with the same encoding and adjusts the shared features for one object, and a fusion network combines the two. A linear density head reads the fused features.

A radiance head concatenates the fused features, the color code and the encoded viewing direction, then passes them through a two-layer MLP.

The shared branch is set against the approach of Schwarz et al. That approach builds a generative radiance field with latent vectors for shape and appearance and relies on an adversarial loss. Here an instance-agnostic branch pushes the network toward features common across a class, and the model is trained with a photometric loss alone.

Rendering samples Nc points along each ray, with δi the distance between neighbouring samples and αi = 1 − exp(−σiδi) the opacity of each sample. The pixel color is the weighted sum below. \\\[ \\hat{C}(r, z^{(s)}, z^{(c)}) = \\sum\_{i=1}^{N\_c-1} c\_i\\,\\alpha\_i \\exp\\!\\left(-\\sum\_{j=1}^{i-1}\\sigma\_j\\delta\_j\\right) \\\]

## Choosing which parameters to update

An edit minimizes a loss over the network weights and the learned codes, given the user's rays. Two goals pull against each other: the edited field must match the intent, and the user must see the result quickly. Changing weights takes dozens of forward and backward passes, which is why the choice of parameters matters.

Three options are compared. Updating only the codes is cheap but gives low-quality edits. Updating every weight is slow and changes unedited parts of the instance. The chosen hybrid updates only later layers, so gradients are computed only over those layers.

For color edits, only the radiance head and the color code are optimized. This reduces optimization time 3.7× against the whole network, from 972 to 260 seconds. For shape edits, only the fusion network and the density head are optimized. Optimization time drops from 1,081 to 342 seconds, a 3.2× reduction.

Each optimization step uses a random subset of the user rays, 64 for color edits and 8,192 for shape edits. This gives 24× speedups for color edits and 2.9× for shape edits. The appendix notes that training on fewer rays can let an edit spread into unmarked areas. It reports an average PSNR of 34.49 over the three color edits for the variant that paragraph describes, and the text does not state that variant's exact configuration.

Feature caching reuses network outputs that do not change during an edit. For color edits only the radiance branch changes, so its input features are cached for each displayed view. Rendering a 256×256 image dropped from 6.2 to under 0.8 seconds, a 7.8× speedup. Caching during optimization sped up color edits by 3.2× and shape edits by 1.9×.

## Losses that enforce the edit and keep the rest

A color edit gives a target color for foreground rays and keeps the original rendered color for background rays. The reconstruction loss sums the squared Euclidean distance between each composited ray color and its target. \\\[ L\_{\\mathrm{rec}} = \\sum\_{(r,c\_f)\\in y\_f} \\left\\lVert \\hat{C}(r, z^{(s)}, z^{(c)}) - c\_f \\right\\rVert\_2^2 + \\sum\_{(r,c\_b)\\in y\_b} \\left\\lVert \\hat{C}(r, z^{(s)}, z^{(c)}) - c\_b \\right\\rVert\_2^2 \\\]

A regularization term penalizes squared differences between the original and updated weights, which keeps the edit close to the original model. The color loss adds this term with weight λreg = 10 and is optimized over the color code and F\_rad.

Shape removal begins with an editing example in which the foreground region is whitened out and the rest of the view is treated as background. The density loss is the entropy of each foreground ray's normalized density vector, summed over the foreground rays. \\\[ L\_{\\mathrm{dens}} = -\\sum\_{r\\in y\_f} \\sigma\_r^{\\top}\\log(\\sigma\_r) \\\] Penalizing this entropy pushes the densities toward sparsity, so the removed region ends up with zero density.

The removal loss is reconstruction plus 0.01 times the density loss plus 10 times the regularization, optimized over F\_dens and F\_fuse.

When the part to remove sits in front of another part, the first density mode along each foreground ray is zeroed out instead. This works but is slow and can leave some of the removed part behind.

Shape addition pastes a region from a new instance into a rendered view. Rays in the pasted region take the new instance's shape code and the original color code, and the loss is reconstruction plus 10 times the regularization, optimized over F\_dens and F\_fuse. Because this needs many training iterations it is slow. The appendix offers a faster cross-entropy loss that matches densities to the copied ones, at the cost of being less effective.

## Ablating the shape and color design

Each variant is trained on PhotoShapes and on Aubry chairs and scored on held-out views with PSNR and LPIPS. PhotoShapes uses 100 instances with 40 training views each, and Aubry chairs uses 500 instances with 36 each. Row 1 is one NeRF per dataset. Row 2 adds one 64-dimensional learned code per instance to NeRF. Row 3 separates shape and color codes, Row 4 is the full model with the shared and instance branches, and Row 5 trains an independent NeRF for each instance.

Table 1 lists the ablation rows.

On PhotoShapes, PSNR rises from 17.81 for a single NeRF to 36.50 with learned codes, to 36.88 with separate shape and color codes, and to 37.67 with the shared and instance branches. The separately trained NeRFs reach 37.31 on the same dataset.

Scaling to all 626 PhotoShape instances, the full model reaches 35.79 PSNR. Without the shared shape branch it reaches 33.91, and the authors credit the shared branch with helping the model scale to more instances.

## Color edits against GAN and single-instance baselines

Each color test takes a PhotoShapes training instance and edits it toward an unseen target that has the same shape and a different color. Edit 1 changes the seat from brown to red, and Edit 2 darkens the seat and turns the back green. Each edit is scored over 40 rendered views against the ground truth, and the table reports the average over three edits.

Restricting the change to the color code cannot fit the target. Updating the whole network fits the color but changes the shape, and the authors attribute this to earlier layers feeding the density output.

The single-instance baseline trains a NeRF on the source instance and applies the same editing method to it. The GAN baseline trains a StyleGAN2 on PhotoShapes images, projects the source and target views into latent and noise vectors, and then applies Model Rewriting to paste the target region onto the source view.

The single-instance NeRF creates artifacts in other views, and finetuning it can make colors inconsistent across views. The GAN methods neither change the object's color correctly nor keep its shape consistent across views, which the authors tie to the lack of a 3D representation.

On one more comparison, recoloring the seat bright red with a single NeRF creates red artifacts in the chair's background, while the conditional model confines the change to the seat.

## Shape edits and the update choice

The shape test starts from an Aubry chairs training instance and edits it toward an unseen target with a similar shape. The reported results average three edits, and rendered views are compared against ground truth.

Visually, the codes-only and density-only variants leave the chair mostly unchanged. Optimizing the whole network removes the arms but causes artifacts in the rest of the object. The hybrid update removes the arms, fills the hole they leave, and carries the edit to unseen views.

Figure 4 shows the source, the editing scribble, the four update variants and the hybrid result for one edit.

## Swapping codes and editing a real photograph

Changing the color code while keeping the shape code leaves the rendered shape unchanged, since density has no color-code input. Changing the shape code while keeping the color code leaves the rendered color unchanged, even though radiance depends on both codes. The authors read the second result as the network having learned to separate color from shape when it predicts radiance.

For a real photograph, the user first picks a training view with a similar object pose, and this pose does not need to be exact. The image is assumed to share attributes with the training data, such as object class and background. The shape and color codes are optimized first with the MLP weights fixed, and then all parameters are optimized together, which the authors report is more stable than optimizing everything at once.

On the photograph, the edit changes the chair seat to red and removes two of the chair's legs.

## Limitations

A shape edit takes over a minute before the user gets feedback, and most of that time goes to rendering views rather than to the edit itself. The authors expect faster NeRF rendering to help.

The method fails to reconstruct novel instances that differ strongly from the other instances of the class.

The CARLA cars have only one training view per instance, so the paper gives qualitative results only. A self-consistency regularizer on view direction was added to limit color drift across views in this setting.

Figure 7 contrasts a model with and without this regularizer on CARLA views.

Quantitative evaluation of color edits uses PhotoShapes, with GAN-based and single-instance NeRF baselines. Shape edits are compared only against other update choices of the same method, so the excerpt includes no comparison with prior neural shape editing methods.

The occlusion-aware removal procedure and the shape addition method are both slow, and the removal procedure can leave artifacts of incomplete removal.

## Paper info

- **Authors**: Steven Liu, Xiuming Zhang, Zhoutong Zhang, Richard Zhang, Jun-Yan Zhu, Bryan Russell
- **Venue**: arXiv · Preprint
- **First published**: 2021-5-13
- **Added**: 2026-11-5
- **Updated**: 2021-6-4
- **Version**: v2
- **arXiv**: 2105.06466
- **Category**: cs.CV · cs.GR · cs.LG
- **Original paper terms**: [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/)
- **What we show**: Paper info, commentary and permitted figures from the original paper

[Original paper ↗](https://arxiv.org/abs/2105.06466v2) · [PDF ↗](https://arxiv.org/pdf/2105.06466v2)

AI commentary is a separate explanation from the original paper and may contain errors. The original paper and figures follow each source's terms of use and any rights noted separately.

## Abstract

A neural radiance field (NeRF) is a scene model supporting high-quality view synthesis, optimized per scene. In this paper, we explore enabling user editing of a category-level NeRF - also known as a conditional radiance field - trained on a shape category. Specifically, we introduce a method for propagating coarse 2D user scribbles to the 3D space, to modify the color or shape of a local region. First, we propose a conditional radiance field that incorporates new modular network components, including a shape branch that is shared across object instances. Observing multiple instances of the same category, our model learns underlying part semantics without any supervision, thereby allowing the propagation of coarse 2D user scribbles to the entire 3D region (e.g., chair seat). Next, we propose a hybrid network update strategy that targets specific network components, which balances efficiency and accuracy. During user interaction, we formulate an optimization problem that both satisfies the user's constraints and preserves the original object structure. We demonstrate our approach on various editing tasks over three shape datasets and show that it outperforms prior neural editing approaches. Finally, we edit the appearance and shape of a real photograph and show that the edit propagates to extrapolated novel views.

## Quote from the paper

Steven Liu, Xiuming Zhang, Zhoutong Zhang, Richard Zhang, Jun-Yan Zhu, Bryan Russell (2021). Editing Conditional Radiance Fields. arXiv:2105.06466v2. https://arxiv.org/abs/2105.06466v2

**BibTeX**

```
@misc{liu2021editing,
  title = {{Editing Conditional Radiance Fields}},
  author = {Steven Liu and Xiuming Zhang and Zhoutong Zhang and Richard Zhang and Jun-Yan Zhu and Bryan Russell},
  year = {2021},
  eprint = {2105.06466},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2105.06466v2}
}
```

## Other paper commentary

- [Point-NeRF: Point-based Neural Radiance Fields](https://refivu.com/en/papers/1ccf15ea-4e2c-4539-a808-6f6861ba729e-point-nerf-point-based-neural-radiance-fields.md)
- [NeRF-SLAM: Real-Time Dense Monocular SLAM with Neural Radiance Fields](https://refivu.com/en/papers/00ff6632-386d-4846-bfdb-98c18566d9ed-nerf-slam-real-time-dense-monocular-slam-with.md)
- [DiffRF: Rendering-Guided 3D Radiance Field Diffusion](https://refivu.com/en/papers/6a9b5a5d-11ba-4359-bd5a-bacf91ac15e4-diffrf-rendering-guided-3d-radiance-field-diffusion.md)
- [3D Gaussian Splatting for Real-Time Radiance Field Rendering](https://refivu.com/en/papers/d283b4d8-b4d8-4fce-b08f-da8a9a94eaf5-3d-gaussian-splatting-for-real-time-radiance-field.md)
- [NeRF: Representing Scenes as Neural Radiance Fields for View Synthesis](https://refivu.com/en/papers/574db119-6e77-4d31-8936-4265ae5865bc-nerf-representing-scenes-as-neural-radiance-fields-for.md)
- [Learning Land-Surface Hydrology World Model from Satellite Observations](https://refivu.com/en/papers/5b7cd482-ff8e-468e-bde7-b24240a651d4-learning-land-surface-hydrology-world-model-from-satellite.md)
- [MixHop: Higher-Order Graph Convolutional Architectures via Sparsified Neighborhood Mixing](https://refivu.com/en/papers/1250a8b5-0d20-48a6-bf8a-8ec6a0c220d1-mixhop-higher-order-graph-convolutional-architectures-via.md)
- [Exact Combinatorial Optimization with Graph Convolutional Neural Networks](https://refivu.com/en/papers/8df34e94-f13d-47fe-92a7-0d3d6b6d4386-exact-combinatorial-optimization-with-graph-convolutional.md)
- [MagicAnimate: Temporally Consistent Human Image Animation using Diffusion Model](https://refivu.com/en/papers/d7e4c79d-ac46-4e0f-aef6-34e570d43e2f-magicanimate-temporally-consistent-human-image-animation.md)
- [Self-supervised 6D Object Pose Estimation for Robot Manipulation](https://refivu.com/en/papers/d923d9fd-647d-4656-905f-defb6f68182a-self-supervised-6d-object-pose-estimation-for-robot.md)
- [Learning Problem-agnostic Speech Representations from Multiple Self-supervised Tasks](https://refivu.com/en/papers/a1a919cd-efff-487c-86c6-982c7afc65eb-learning-problem-agnostic-speech-representations-from.md)

## Terms in this paper

- [PSNR](https://refivu.com/en/terms/fcbb9b8276a7-psnr)
- [SSIM](https://refivu.com/en/terms/a5c530b66e8d-ssim)
- [LPIPS](https://refivu.com/en/terms/21dda2beca88-lpips)
- [NeRF](https://refivu.com/en/terms/3a72e6d9737b-nerf)
- [Reconstruction Loss](https://refivu.com/en/terms/58c946085188-reconstruction-loss)
- [StyleGAN2](https://refivu.com/en/terms/77cd7d2c5d81-stylegan2)
- [alpha compositing](https://refivu.com/en/terms/8ad5b9d8b9b8-alpha-compositing)

---

AI-written text can contain mistakes. [Refivu](https://refivu.com/en/papers/c434d11b-0144-4e79-9742-c728495cdf18-editing-conditional-radiance-fields)
