Single-Mask Inpainting for Voxel-Based Neural Radiance Fields

Jiafu Chen, Tianyi Chu, Jiakai Sun, Wei Xing, Lei Zhao

Abstract

This paper presents a novel framework for 3D scene inpainting in voxel-based Neural Radiance Fields (NeRFs) that significantly reduces the annotation burden by requiring only a single user-drawn mask. Traditional 3D inpainting methods often suffer from view inconsistency and high annotation costs. By unprojecting a single 2D mask into a voxel grid and employing a mask-aware Score Distillation Sampling (SDS) loss with a 2D diffusion model, the proposed method achieves superior visual fidelity and 3D consistency. Experimental results on the SPIn-NeRF and LLFF datasets demonstrate that this approach outperforms existing state-of-the-art methods in both perceptual quality and sharpness.

Introduction

Neural Radiance Fields (NeRFs) have revolutionized photorealistic 3D scene capture, yet editing these scenes—specifically removing unwanted objects—remains a significant challenge. This task, known as 3D inpainting, faces three major hurdles: geometric uncertainty regarding occluded backgrounds, the heavy annotation burden of per-view masking, and the visual inconsistency that arises when inpainting multiple views independently. When a NeRF attempts to reconcile inconsistent 2D inpaints, the result is often a blurry, low-fidelity reconstruction.

Methodology

The proposed framework addresses these challenges by building upon Direct Voxel Grid Optimization (DVGO), a fast NeRF variant. The pipeline consists of three primary stages:

  1. 2D-to-3D Mask Unprojection: Instead of masking every input image, the user provides a mask for a single selected view. Rays are cast through this mask into the 3D voxel grid, identifying the "inpainting zone." These voxels are initialized as free space to allow for new structural generation.
  2. Rough Inpainting (Priors): A pre-trained 2D inpainter (LaMa) fills the color and depth of the masked area in the selected view. This provides a crucial initial supervision signal for the 3D geometry.
  3. Refinement via SDS-mask Loss: To ensure high-frequency detail and multi-view consistency, the system utilizes a 2D Diffusion Model (Stable Diffusion). A specialized "mask-aware Score Distillation Sampling (SDS)" loss provides gradients that sharpen the inpainted voxels based on the diffusion model's generative priors, without disturbing the static parts of the scene.
Figure 1: Overview of the input views and the single user-selected view with its corresponding mask used for the 3D unprojection process.

Key Results and Insights

The method was evaluated on the LLFF and SPIn-NeRF datasets. Quantitative results on the SPIn-NeRF benchmark show that the proposed method achieves state-of-the-art performance:

  • FID (Realism): 168.70 (compared to SPIn-NeRF's 204.26).
  • Sharpness: 585.05 (nearly double the 294.92 achieved by previous methods).
  • LPIPS: 0.186, indicating high perceptual similarity to ground truth.

Qualitatively, the method excels at recovering fine textures, such as grass or wood grain, which remain consistent across different camera angles. This success is attributed to the "Power of One"—using a single reference to avoid conflicting 2D instructions—and the critical role of depth inpainting as an anchor for 3D geometry.

Figure 2: Qualitative results demonstrating successful object removal and consistent background reconstruction across multiple viewpoints.

Limitations and Future Work

While effective, the framework is currently optimized for forward-facing scenes and does not yet support full 360-degree object-centric reconstructions. Additionally, the deterministic nature of the initial 2D inpainter limits user control over the content of the filled region. Future research will focus on expanding to 360-degree scenes and introducing controllable inpainting capabilities.

Summary updated

BibTeX
@inproceedings{chen2024single,
  author = {Jiafu Chen and Tianyi Chu and Jiakai Sun and Wei Xing and Lei Zhao},
  title = {{Single-Mask Inpainting for Voxel-Based Neural Radiance Fields}},
  booktitle = {European Conference on Computer Vision},
  year = {2024},
  doi = {10.1007/978-3-031-72998-0\_7},
}
Figure