VoxGRAF: Fast 3D-Aware Image Synthesis with Sparse Voxel Grids
Abstract
State-of-the-art 3D-aware generative models rely on coordinate-based MLPs to parameterize 3D radiance fields.
While demonstrating impressive results, querying an MLP for every sample along each ray leads to slow rendering.
Therefore, existing approaches often render low-resolution feature maps and process them with an upsampling network to obtain the final image.
Albeit efficient, neural rendering often entangles viewpoint and content such that changing the camera pose results in unwanted changes of geometry or appearance.
Motivated by recent results in voxel-based novel view synthesis, we investigate the utility of sparse voxel grid representations for fast and 3D-consistent generative modeling in this paper.
Our results demonstrate that monolithic MLPs can indeed be replaced by 3D convolutions when combining sparse voxel grids with progressive growing, free space pruning and appropriate regularization.
To obtain a compact representation of the scene and allow for scaling to higher voxel resolutions, our model disentangles the foreground object (modeled in 3D) from the background (modeled in 2D).
In contrast to existing approaches, our method requires only a single forward pass to generate a full 3D scene.
It hence allows for efficient rendering from arbitrary viewpoints while yielding 3D consistent results with high visual fidelity.
Code and models are available at https://github.com/autonomousvision/voxgraf.
Introduction
Generating photorealistic renderings of scenes at high resolution is a long-standing goal in computer vision and graphics.
The primary paradigm is to carefully design 3D models, which are then rendered using realistic camera and illumination models.
In recent years, the computer vision community has made significant headway towards reducing these design efforts by approaching content generation from a data-centric perspective.
Generative Adversarial Networks (GANs) [10] have emerged as a powerful class of generative models for photorealistic high-resolution image synthesis [3, 19, 20, 22, 23, 39, 40].
One benefit of these 2D models is that they can be trained with large collections of images which are readily available.
However, scaling GANs to 3D is non-trivial because 3D supervision is difficult to obtain.
Recently, 3D-aware GANs have emerged to address the gap between handcrafted 3D models and image synthesis with 2D GANs which lack 3D constraints [5,15,26,32,33,41].
3D-aware GANs combine 3D generators, differentiable rendering and adversarial training to synthesize novel images with explicit control over the camera pose and, potentially, other scene properties like object shape and appearance.
Early 3D-aware GANs explored voxel-based 3D representations [15, 32].
To compensate for the cubic memory growth of voxel grids, HoloGAN [32] generates features on a small 3D grid and uses a neural network to map 3D features to a 2D image.
While such a neural renderer allows scaling to higher image resolutions, it may also entangle viewpoint and generated content [41].
Consequently, early voxel-based approaches were either limited in image resolution or lacking 3D consistency.
About the same time, Neural Radiance Fields (NeRF) [30] emerged in the context of view synthesis as a powerful alternative 3D representation.
In their seminal work, Mildenhall et al.
[30] represent a scene as a function of color and density, parameterized by a coordinate-based MLP.
The predicted color and density values are then projected to an image with differentiable volume rendering.
GRAF [42] adapts NeRF’s coordinate-based representation to Generative Radiance Fields (GRAF) and proposes a 3D-aware GAN using a coordinate-based MLP and volume rendering.
This propelled 3D-aware image synthesis to higher image resolutions while better preserving 3D consistency due to the physically-based and parameter-free rendering.
These benefits led to the establishment of coordinate-based MLPs as new de facto standard for 3D-aware image synthesis [5,34].
While recent 3D-aware GANs [5,7,11] have started to attain image fidelity and resolution similar to 2D GANs, training and inference is computationally expensive as the MLP must be queried at multiple points along each ray for volume rendering.
However, querying 3D space densely is prohibitively costly.
For example, rendering an image at resolution 256 2 using 48 sample points along each ray requires to query the neural network 256 2 · 48 ≈ 3 M times.
As a result, most recent works combine neural and volume rendering to ease computational cost at high resolutions [33].
Consequently, viewpoint and 3D content are often entangled, such that changing the camera pose might result in unwanted changes of the geometry or the appearance of the 3D scene.
Further, for many downstream applications, e.g. integrating assets into physics engines, it is desirable to generate 3D content at high resolution directly.
These shortcomings identify the need for a 3D representation that can be efficiently rendered at high resolution with a model that is 3D-consistent by design .
Recently, there has been significant progress towards accelerated training of novel view synthesis models for single scenes by removing the MLP from the representation.
In particular, DVGO [44] and Plenoxels [1] directly optimize a sparse voxel grid for novel-view synthesis, demonstrating that the visual fidelity attained by NeRF [30] is not primarily attributed to its MLP-based representation but rather to volumetric rendering and gradient-based optimization.
In addition to impressive image quality, [1,44] obtain large rendering speedups due to their fast density and color queries.
Taking inspiration from these works, we revisit voxel-based representations for 3D-aware GANs [15,32] in the context of volumetric rendering.
To circumvent the cubic memory growth that limits early voxel-based approaches [15,32], we explore sparse voxel grids for the generative settings, see Fig.
We observe that sparsity is key to enable scaling the 3D representation to higher resolution and to combine it with volume rendering.
Specifically, we propose a 3D-aware GAN with a sparse voxel grid generator at its core.
As a result, our approach inherits fast rendering and trilinear interpolation while being 3D-consistent by design, separating it from other recent 3D-aware GANs [4,7,11] which require a forward pass for every point along each camera ray of every view.
Another difference to existing 3D-aware GANs is that sparsity is a built-in feature of our representation, mitigating the need for exploiting sophisticated strategies to sample points along camera rays as in [5,37,47].
Our final model achieves image fidelity similar to recent 3D-aware GANs leveraging neural rendering while generating high-resolution geometry and improving 3D consistency.
During inference, our model only requires a single forward pass which takes up most of the inference time.
Once the 3D scene is generated, images can be rendered within milliseconds while existing approaches require another forward pass which is two orders of magnitude slower.
We refer to our model as VoxGRAF .
Related Work
2D GANs.
Rapid progress on Generative Adversarial Networks [10] now enables photorealistic synthesis up to megapixel resolution [3, 19, 21–23, 29, 40].
While the disentangled style-space of StyleGANs [21–23] allows for control over the viewpoint of the generated images to some extent [14, 27, 43, 52], gaining precise 3D-consistent control is still non-trivial due to its lack of physical interpretation and operation in 2D.
In contrast, in this work we aim for explicit control over the camera pose by incorporating a 3D representation into the generator.
3D-Aware GANs.
The first 3D-aware GANs, i.e. GANs that incorporate a 3D representation into the generator model, were voxel-based approaches.
Dense grid-based approaches [15,54] are limited to a lower grid resolution due to their cubic memory growth.
Other works combine lower-resolution grids with neural rendering [26,32] which scale to higher resolutions, but the generated images lack 3D consistency [42].
Recently, GRAF [41] and π -GAN combine volume rendering and coordinate-based representations [30] allowing to scale 3D-aware GANs with physically inspired rendering to high resolutions.
However, dense ray marching remains computationally expensive and limits image fidelity.
GIRAFFE [34] therefore proposes a hybrid rendering approach.
They render a low-resolution feature map with ray marching and use a neural renderer to decode it into a high-resolution image.
Due to efficiency, this approach has been widely adopted in subsequent works [4,11,18,36,48,51,53].
While some approaches try to counteract introduced inconsistencies, e.g. via dual discrimination [4] or a reconstruction loss [11], we instead propose a model that is 3D-consistent by design and can generate the 3D object at high-resolution.
As an alternative to hybrid rendering, GOF [47], ShadeGAN [37] and GRAM [7] focus on reducing the number of query points for volume rendering.
While aforementioned methods aim for reducing the number of sample points as querying a large MLP is computationally expensive, we instead use a sparse voxel grid as 3D representation.
This allows us to speed up rendering without reducing the sample size as feature querying via trilinear interpolation is fast and can be efficiently implemented via custom CUDA kernels.
Sparse 3D Representations.
As NeRF requires an optimization time in the order of multiple days per scene, a series of follow-up works [28,38,45,50] propose techniques to speed up this process.
The recent works Plenoxels [1] and DVGO [44] demonstrate that sparse voxel grid representations can achieve even faster convergence and higher rendering speed.
In addition to efficient rendering, sparse voxel grids enable fast trilinear interpolation when queried beyond their grid resolution.
Building on this representation, our approach inherits these benefits.
We remark that very recently InstantNGP [31] achieves even faster rendering by combining small MLPs with a multi-resolution hash table.
Exploring this representation might be an interesting avenue for future extensions of our work.
Note that all of these works focus on novel-view-synthesis for single scenes and require multi-view image supervision.
Instead, we propose a generative model that trains with raw image collections and that can generate multiple novel instances at inference.
Method
We first provide the necessary background by summarizing the currently dominating paradigm for designing 3D-aware GANs which combines an MLP scene representation and volume rendering as introduced in GRAF [42].
Next, we introduce our sparse voxel-based scene representation which boosts rendering speed while retaining 3D-consistency by design.
We refer to our model as VoxGRAF.
of resolution R G .
Given camera intrinsics K and a camera pose ξ ′ , a foreground image is obtained using differentiable volume rendering [30].
The values at the sampling points along the camera rays are computed by trilinearly interpolating the voxel grid [1].
The background is generated by a 2D GAN G bgθ b and combined with the foreground using alpha composition.
The discriminator D ϕ compares the generated image ˆI the real image
3.1 3D-aware GANs with Coordinate-Based Scene Representations
Recent 3D-aware GANs typically consist of a learned coordinate-based MLP as 3D generator, a deterministic volume rendering step potentially combined with a learned neural renderer in the 2D image domain, and a learned 2D discriminator.
Let G MLPψ denote the 3D generator parameterized by a coordinate-based MLP with learnable parameters ψ .
The 3D generator predicts a radiance field defined by color c ∈ [0 , 1] and density values σ ∈ R + .
The radiance field is defined at any 3D point x ∈ R 3 and for any viewing direction d ∈ S 2 .
To model different 3D scenes, the generator is additionally conditioned on an M -dimensional latent variable z ∈ N ( 0 , 1 ) .
The inputs x and d are projected to higher-dimensional features γ ( x ) ∈
L x and γ ( d )
∈ L d with a fixed positional encoding to overcome the MLP’s smoothness bias and model high-frequency content γ ( · ) [30,46].
Formally,
[Equation]
In this paper, we challenge this paradigm and investigate a sparse 3D CNN instead of a coordinatebased MLP as generator, as described in the next section.
The radiance field is rendered by approximating the intractable volumetric projection integral via numerical integration.
First, the generator is queried at N sampling points along each camera ray r yielding colors and densities { ( c ir , σ ir ) } Ni =1 .
For each camera ray r , these points are projected to an
RGB color value c r and optionally an alpha mask a r using alpha composition
[Equation]
where T ir and α ir denote the transmittance and alpha value of sample point i along ray r and
[Equation]
− x ir
[Equation]
2 is the distance between neighboring sample points.
As volume rendering has proven a powerful tool for high-fidelity reconstruction, VoxGRAF retains this rendering mechanism but reduces its computational cost by leveraging sparse scene representations.
3.2 VoxGRAF: Generating Radiance Fields on Sparse Voxel Grids
Our goal is to design a 3D-aware GAN based on a sparse scene representation that allows for efficient rendering.
Fig.
2 shows an overview over our approach.
In contrast to recent works [4,7,47], we do not use a coordinate-based MLP to parameterize the radiance field.
Instead, inspired by recent work on novel view synthesis [1,44], we generate values on a sparse voxel grid using a 3D convolutional neural network.
Therefore, our generator requires only a single forward pass to generate a 3D scene.
To disentangle 3D content from the background we combine a 3D foreground generator G fgθ f with a 2D background generator G bgθ b .
G fgθ f takes a camera matrix K , camera pose ξ and a latent code z
[Figure]
as input and predicts colors c and density values σ on a sparse voxel grid.
For unstructured images, camera matrix K and pose ξ can be determined e.g. with an off-the-shelf pose detector as done in [5].
Volume rendering yields a foreground image and an alpha mask.
The background generator maps the latent code z to a background image which is then combined with the foreground image using alpha composition.
We train our model in an adversarial setting using a 2D discriminator on the full image.
Foreground Generator.
Our foreground generator builds on the popular StyleGAN2 architecture [22] which achieves high fidelity in the 2D image domain.
Conditioned on a camera pose ξ ∈ R P , it maps a latent code z to color values c and density values σ on a sparse voxel grid
[Equation]
where θ f and R G denote the learnable parameters and the resolution of the voxel grid, respectively.
Note that in contrast to most existing coordinate-based 3D-aware GANs, see Eq.
(1), we do not condition the 3D generator on the view direction (per-ray).
Instead, we follow [4] and condition it on the pose ξ (per-image) to model directional dependencies.
For rendering, we compute ( c ir , σ ir ) via trilinear interpolation of densities and colors stored at the nearest eight vertices [1].
We use the same rendering formulation outlined in 3.1 and leverage custom CUDA kernels 1 for efficiency.
To generate voxel grids instead of images, we replace all 2D operations of the StyleGAN2 generator with their 3D equivalent, e.g., 3D modulated convolutions and 3D upsampling.
At resolutions beyond 32 3 , we investigate sparse convolutions [13] instead of dense ones as they can be more computationally efficient.
We compare the computational efficiency of sparse convolutions 2 to dense convolutions for which we zero out the values of pruned voxels. For our architecture, using sparse convolutions reduces the memory consumption but due to the computational overhead for managing coordinates increases the runtime, see Table 1.
To sparsify the representation, we combine progressive growing [19] with pruning [1] as illustrated in Fig. 3a.
Specifically, we start with training a dense model at resolution 32 3 .
After sufficient training, we add the next layer of convolutions and prune its inputs based on the rendered view.
Intuitively, the next layer should only operate on voxels visible in the rendered view to yield a sparse representation.
Consequently, we prune voxels that are either occluded or have a low density.
Following Eq.
(2), the rendered alpha value is a r = (cid:80) Ni =1 T ir α ir .
Accordingly, occluded voxels (low transmittance T i ) and empty voxels (low density σ i ) do not contribute to the final image.
The pruning operator ρ discards all voxels along a camera ray r for which transmittance T i or density σ i is smaller than threshold τ T or τ σ , respectively.
Let V r denote the set of voxels intersecting with ray r , then
[Equation]
where V pr is the set of the retained voxels.
After pruning, we upsample the kept voxels via sparse transposed convolutions.
After the newly-added layer is sufficiently trained, we repeat this process for the next added stage.
Fig.
3b shows images and voxel grids at different resolutions.
We implement this on-the-fly pruning operation using efficient custom CUDA kernels.
the Minkowski Engine com NVIDIA MinkowskiEngine git In agreement with [4], we observe that it is crucial to account for view dependent effects or posecorrelated attributes in the training data, like eyes always looking into the camera.
We take two measures to increase the flexibility of our model:
Following [4], G fgθ f is conditioned on the pose ξ which corresponds to the rendering pose ξ ′ in 50% of the cases and is randomly chosen otherwise.
Formally, ξ ∼ p ξ | p ( ξ = ξ ′ )
=0 .
At inference, the pose-conditioning is fixed to retain 3D consistency.
However, we find that pose conditioning alone is not always sufficient to account for strong correlations in the data.
Depending on the dataset, we optionally refine the rendered image with a shallow 2D CNN with 2 hidden layers of dimension 16 and kernel size 3 .
While this refinement is powerful enough to model dataset biases, it is considerably less flexible than the neural rendering used in [5,11,33]: Our 2D CNN operates on the rendered image instead of rendered features at smaller resolution.
Operating on 3 channels at full resolution allows to keep its capacity at a minimum and, due to not using any upsampling operation, results in a local receptive field.
Background Generator.
We consider datasets with a single object per image.
Modeling only the object in 3D saves computation and is advantageous for potential downstream tasks, e.g., integrating generated assets into new environments Hence, we model the object in 3D and generate the background of the image with a 2D GAN.
Specifically, we use the StyleGAN2 generator [22] with reduced channel size as modeling the background requires less capacity than generating the full image:
[Equation]
We choose the same latent code z for foreground and background to allow for modeling correlations like lighting between the two.
Note that, unlike the foreground generator, the background generator is not conditioned on the camera pose.
As the background remains fixed when changing the camera pose, the generator is encouraged to model pose-dependent content with the foreground generator leading to disentanglement (see supp.
mat.
for qualitative disentanglement results).
The final image is obtained using alpha composition
[Equation]
The full generator is defined as
[Equation]
Regularization.
For fast rendering, it is crucial that most generated voxels are either fully opaque or empty such that early stopping and empty space skipping are effective.
By regularizing the variance of the expected depth ˆ z r along each ray r , the foreground generator is encouraged to generate a single, sharp surface:
[Equation]
where τ is a hyperparameter that defines the thickness of the surface.
We find that thresholding the loss is important to avoid an empty foreground.
In addition, we find that adding the grid TV regularization
L TV from [1] and fore- and background coverage regularization L fgcvg and L bgcvg from [49] further stabilizes training (see sup.
mat.
for details).
The full regularization term of our generator is
[Equation]
Discriminator.
We use the StyleGAN2 discriminator and condition it on the camera pose as proposed in [4].
Similarly, we find that conditioning guides the generator to learn correct 3D priors and a canonical representation.
Since rendering our sparse representation is fast, our discriminator is able to operate on the full image and does not need to consider image patches as done in GRAF [42].
3.3 Training
Given images I from the data distribution p D with known camera extrinsics ξ I and intrinsics K I and latent codes z ∈ N ( 0 , 1 ) , we train our model using a GAN objective with R1-regularization [29]
[Equation]
where f ( t ) =
− log(1 + exp( − t )) and λ controls the strength of the R1-regularizer.
G θ and D ϕ are trained with alternating gradient descent combining the GAN objective with the regularization terms:
[Equation]
In practice, we optimize the generator with a non-saturating variant of Eq.
We train our approach with Adam [24] using a batch size of 64 at grid resolution R G = 32 , 64 and 32 at R G = 128 .
We use a learning rate of 0 .
0025 for the generator and 0 .
002 for the discriminator.
For faster training, we first grow R I from 32 to 128 while keeping R G at 32 .
Then, we alternately increase the grid resolution and the image resolution until the dataset resolution and R G = 128 are reached.
For synthetic datasets, i.e. Carla [42], we do not add any refinement layers.
Depending on the dataset, we train our models for 3 to 7 days on 8 Tesla V100 GPUs.
Details on the network architectures can be found in the supplemental material.
Results
Datasets.
We validate our approach on standard benchmark datasets for 3D-aware image synthesis.
The synthetic Carla dataset [9, 41] contains 10 k images and camera poses of 18 car models with randomly sampled colors.
FFHQ [22] comprises 70 k aligned face images.
AFHQv2 Cats [6] consists of 4834 cat faces.
Following [5], we estimate camera poses for both datasets with off-the-shelf pose estimators [8,25] and augment all datasets with horizontal flips.
Due to the limited number of images in AFHQv2 and Carla, we use adaptive discriminator augmentation [20] for these datasets.
Evaluation Metrics.
We measure image fidelity by calculating the Fréchet Inception Distance ( FID ) [16] between 20 k generated images and the full dataset.
For all runtime comparisons, we report times on a single Tesla V100 GPU with a batch size of 1.
4.1 Ablation Study
[Table]
Memory
[Table]
[Table]
We investigate the sparsity of the generated voxel grids and validate the importance of the depth variance loss, see Eq.
Sparsity is evaluated by fusing the pruned voxel grids from 16 equally spaced camera views and reporting the number of empty voxels divided by the total number of voxels R 3 G .
Table 1 shows results averaged over 100 instances.
The depth variance loss increases sparsity from 74% to 95% , lowering the memory consumption.
With the sparser representation, the times needed for scene generation t G fg + bg and rendering t π are reduced significantly.
We further compare an implementation with dense instead of sparse convolutions where we zero out the values of pruned voxels.
While this increases memory consumption, it reduces the runtime due to the computational overhead of managing coordinates for sparse convolutions.
We prioritize faster training over memory and hence train our models with dense convolutions where we set values of pruned voxels to zero.
4.2 Baseline Comparison
Baselines.
We group the baselines into two categories: (i) methods that render low-resolution features and use 2D-upsampling, i.e. a neural renderer, to obtain the final image, e.g. StyleNeRF [11], and (ii) methods that render the 3D representation directly at the final image resolution, e.g. πGAN [5].
VoxGRAF falls into the second group.
We use the official code release for all methods.
Further, we reference numbers reported by concurrent works GRAM [7] and EG3D [4].
Qualitative Results.
Fig.
4 shows samples from multiple views for StyleNeRF, GRAM and
VoxGRAF on FFHQ at resolution 256 2 .
StyleNeRF can generate additional faces or strands of hair across views, as indicated by the red frames in Fig.
These inconsistencies under viewpoint changes
G R
A M
S t y l e N e R
F
V o
[Figure]
[Figure]
[Table] [Figure] [Table] [Figure]
[Table]
[Figure]
[Table]
[Figure]
[Table]
[Figure]
[Table]
[Figure]
[Table]
[Figure]
[Table]
[Table]
a faster GPU (RTX 3090 GPU) compared to the others (Tesla V100 GPU)
are introduced by StyleNeRF’s powerful neural renderer.
GRAM achieves more consistent results, but its plane representation creates stripe artifacts for large viewpoint ranges.
Due to the shallow 2D
CNN, VoxGRAF can model the dataset bias of eyes looking into the camera
but otherwise achieves high 3D-consistency even under large viewing angles. Additional samples of our method and the corresponding sparse voxel grids for all datasets are provided in Fig. 1 and Fig. Quantitative Results.
Table 2 reports FID on all datasets.
As expected, methods that use neural rendering with upsampling, i.e., StyleNeRF and EG3D, perform best in terms of image fidelity.
This is expected as a neural renderer can add flexibility.
But, as shown in Fig.
4, for StyleNeRF
it reduces 3D-consistency.
Among methods without a neural renderer, VoxGRAF significantly improves over π -GAN and GOF and surpasses the current state-of-the-art approach GRAM.
Runtime Comparison.
Lastly, we compare the rendering times at inference for methods with and methods without a neural renderer.
In contrast to all baselines, VoxGRAF requires only a single forward pass to generate the scene, which can then be rendered from different viewpoints efficiently.
Note that at inference, voxels are pruned solely based on their density to amortize the rendering costs per scene.
We find that this does not visibly affect the rendered images.
We report the times for generating the scene and rendering one view separately in Table 3.
One of the earliest works,
GIRAFFE, is the fastest among all approaches as it renders a low-resolution feature volume and uses comparably small neural networks.
StyleNeRF significantly increases the neural renderer’s size to improve image fidelity, which comes at the cost of speed compared to GIRAFFE.
Yet, StyleNeRF is the fastest approach for generating a single image among the best-performing methods.
However, a potential application of 3D-aware GANs is generating novel views of a single instance in real-time.
In this setting, at resolution 256 2 , VoxGRAF generates novel views at 167 FPS, whereas StyleNeRF runs at 20 FPS as its rendering costs are not amortized per scene.
Limitations and Discussion
In this work, we investigate sparse voxel grids as representation for 3D-aware image synthesis.
We find that the key to generating sparse voxel grids is to combine progressive growing, pruning, and regularization to encourage a sharp surface that can be rendered efficiently.
Our approach outperforms all methods that do not employ a neural renderer.
Instead of discarding neural rendering entirely, we find it advantageous to utilize a shallow CNN for refinement.
This CNN can model dataset bias but is significantly weaker than standard neural rendering approaches that upsample low resolution feature maps.
Our approach can reduce the gap to models that build heavily on neural rendering, yet a trade-off between 3D-consistency and image fidelity remains.
Whether a certain amount of neural rendering is inherently needed to reach best performance is an important direction for future research.
Lastly, the speed of our method depends on the sparsity of the modeled scene.
Therefore, rendering times will likely increase on more complex datasets than those commonly used in literature.
Acknowledgments and Disclosure of Funding
We acknowledge the financial support by the BMWi in the project KI Delta Learning (project number 19A19013O), the support from the BMBF through the Tuebingen AI Center (FKZ:01IS18039A), and the support of the DFG under Germany’s Excellence Strategy (EXC number 2064/1 - Project number 390727645).
Andreas Geiger and Michael Niemeyer were supported by the ERC
Starting Grant LEGO-3D (850533).
We thank the International Max Planck Research School for Intelligent Systems (IMPRS-IS) for supporting Katja Schwarz and Michael Niemeyer.
This work was supported by an NVIDIA research gift.
We thank Christian Reiser for the helpful discussions and suggestions.
Lastly, we would like to thank Nicolas Guenther for his general support.
A Implementation
Foreground Generator
The foreground generator builds on the StyleGAN2 generator [22] replacing 2D operations with their 3D equivalent as described in the main paper.
For faster training, we consider the layers of StyleGAN2 instead of their alias-free version proposed in StyleGAN3 [21].
The mapping network has 2 layers with 64 channels.
Since 3D convolutions have more parameters than 2D convolutions with the same channel size, we reduce the channel base 3 from 32768 for StyleGAN to 4000 .
To facilitate progressive growing we choose an architecture with skip connections which adds an upsampled version of the output grid of the previous layer to the input of the next layer.
The skip architecture is equivalent to the 2D variant proposed in [22].
Following [4], we condition the generator on a camera pose.
Specifically, we condition the generator on a rotation matrix and a translation vector, yielding a 12 -dimensional vector as input to the conditioning.
The foreground generator predicts color and density values on a sparse voxel grid.
Following
Plenoxels [1], the generator outputs the coefficients of spherical harmonics.
We choose spherical harmonics of degree 0 , i.e., a single coefficient for each color channel.
For a sharp surface and efficient rendering, the foreground generator needs to predict high values for the density.
We facilitate generating high values by multiplying the density output of the network with a factor of 30 .
A similar idea was proposed in [1] where the learning rate for the density is set to a higher value than the learning rate for the color.
Sparse Convolutions We investigate sparse convolutions [12] for the foreground generator but find that the computational overhead of managing coordinates increases runtime for our architecture.
We therefore use dense convolutions and zero out values in the feature maps for pruned voxels.
We also compare the difference for both implementations on performance.
In general, we observe similar training behavior for both implementations.
However, the faster dense implementation allows us to train the model for 60M iterations compared to 30M for the model with sparse convolutions.
This improves FID from 14.4 for the sparse implementation to 9.0 for the dense implementation on FFHQ 256.
Background Generator We use the StyleGAN2 [22] generator with a 2-layer mapping network with 64 channels, and a synthesis network with channel base 2048 and a maximum of 64 channels per layer.
2D Refinement Layers Depending on the dataset, we optionally refine the rendered image with a shallow 2D CNN with 2 hidden layers of dimension 16 and kernel size 3 .
To avoid texture sticking under viewpoint changes we use alias-free layers [21] with critical sampling.
Regularization Without regularization, volume rendering is prone to result in semi-opaque voxels and floating artifacts and struggles to accurately represent sharp surfaces [17,33,35,47].
Therefore, we regularize both the variance of the depth, as described in the main paper, and the total variation of the predicted density.
For the depth variance loss L DV , we set τ = (1 . 5 δ 0 ) 2 where δ 0 is the size of one voxel and λ DV = 0 . 01 .
Following Plenoxels [1], we regularize the total variation of the predicted density values in the set of all voxels V for a compact, smooth geometry
[Equation]
with ∆ 2 x ( σ ) shorthand for ( σ i,j,k − σ i +1 ,j,k ) 2 and analogously for ∆ 2 y ( σ ) and ∆ 2 z ( σ ) .
For efficiency, we evaluate the loss stochastically on random contiguous segments of voxels as proposed in [1] and set λ TV = 10 − 5 in all experiments.
To avoid that the full image is generated by either background or foreground generator, we use a hinge loss on the mean mask value as proposed in GIRAFFE-HD [49]
[Equation]
where η fg and η bg denote the minimum fraction that should be covered by foreground and background, respectively.
To ensure that both models are used, we set η fg = 0 .
4 for AFHQ [6] and FFHQ [22] and η fg = 0 .
1 for Carla [42] because Carla’s objects cover a much smaller fraction of the image.
We use η bg = 0 .
1 and λ fgcvg = λ bgcvg = 0 .
1 for all datasets.
Discriminator We use the StyleGAN2 [22] discriminator with conditional input as in [4].
To facilitate progressive growing we choose a skip architecture which adds a downsampled version of the input image to the input of each layer as introduced in [22].
Rendering For efficient rendering, we leverage custom CUDA kernels building on the official code release of [1].
We select equidistant sampling points for volume rendering in steps of 0 .
5 voxels but skip voxels with σ i < 10 − 10 and stop rendering early if T i < 10 − 7 as in [1].
Implementation and Training Our code base builds on the official PyTorch implementation of
StyleGAN2 [22] available at https://github.com/NVlabs/stylegan3.
Similar to StyleGAN2, we train with equalized learning rates for the trainable parameters and a minibatch standard deviation layer at the end of the discriminator [19] and apply an exponential moving average of the generator weights.
For faster training, we use mixed-precision for both the generator and the discriminator as proposed in [20].
Unlike [22], we do not train with path regularization or style-mixing.
To reduce computational cost and overall memory usage R1-regularization [29] is applied only once every 4 minibatches.
We use a regularization strength of γ = 1 for all datasets.
Due to the small size of AFHQ, we follow [20] and finetune a generator that is pretrained on FFHQ with R I = 128 and R G = 32 , i.e., before the representation is pruned.
B Baselines
Qualitative Results We provide qualitative results for StyleNeRF
[11] and GRAM [7] in both the main paper and the supplemental material.
For StyleNeRF, we obtain samples from the pretrained
FFHQ model available at https://github.com/facebookresearch/StyleNeRF.git.
For GRAM, its authors kindly provided unpublished code and pretrained models which we use for evaluation.
In the qualitative comparisons, i.e., Fig. 4 of the main paper and Fig. 8, we use a truncation of ψ = 0 .
7 for all methods.
For GRAM and our approach, we show samples from − 40 ◦ to +40 ◦ which roughly corresponds to 2 standard deviations of the pose distribution.
We find that StyleNeRF does not necessarily adhere to the input pose.
Hence, we manually define the range to be − 60 ◦ to +60 ◦ such that the rendered images roughly align with the other methods.
Quantitative Results Table 2 of the main paper shows a quantitative comparison for all baselines and our method in terms of FID.
For EG3D [4] and GIRAFFE [33], we report the numbers from [4].
For StyleNeRF [11], we take the numbers from [11].
From [11] we further reference the results on
FFHQ and AFHQ for GRAF [41] and π -GAN [5] as these datasets were not considered in the original publications.
On Carla, we report the results from [41] and [5], respectively.
For GOF [47], we reference the numbers from [47] on Carla and train new models to obtain results on FFHQ and AFHQ using the official code release available at https://github.com/SheldonTsui/GOF_NeurIPS2021.git.
For GRAM [7], we report the results from [7] for FFHQ.
As AFHQ is not considered in [7], we train
GRAM on AFHQ using their unpublished code.
Similar to our approach, we finetune a generator that was pre-trained on FFHQ.
We remark that across all reported values for FID the number of generated image varies where most methods report values considering either 20k or 50k generated images.
An overview is provided in Table 4 which is discussed in more detail at the end of Section C.
FFHQ [22] AFHQ [6] Carla [42] R
I = 256 2 R I =
2 R I =
GIRAFFE [34] 31.5 † 16.1 † –
VolumeGAN [48] 9.1 † – 7.9 †
StyleNeRF
EG3D [4] 4.8 † 3.9 † –
GRAF [42] 71 † 121 † 41 ∗π -GAN [5] 85 † 47 † 29.2 ∗
GOF [47] 69.
29.3 GRAM [7] 17.
VoxGRAF 9.6 / 9.0 † 9.6 / 9.4 † 6.7 / 6.3 †
C Results
Background and Foreground Disentanglement.
Fig.
6 illustrates foreground masks, foreground and background image, and the image after alpha composition.
As the background remains fixed under viewpoint changes, the generator is encouraged to model pose-dependent content with the foreground generator.
The regularization in Eq.
(14) and Eq.
(15) encourages the generator to use both the background and the foreground generator to synthesize the full image.
Multi-View Consistency.
Corresponding to Fig.
4 of the main paper, we provide additional qualitative comparisons on multi-view consistency in Fig.
For StyleNeRF [11], the red boxes highlight inconsistencies, like changing eye shape (first row on the left), moving strands of hair (second row, third row on the left) and
distortion of the face shape (first and third row on the right).
For GRAM [7], red boxes indicate layered artifacts stemming from its manifold representation.
In contrast, our method leads to more multi-view consistent results.
We further include a quantitative evaluation on consistency in Table 6.
We implemented our own version of the depth and pose metric following the description in [4] as their evaluation code is not publicly available.
We report the results for our approach, GRAM, StyleNeRF and EG3D for
[Figure]
reference.
We also report the standard deviation across the 1024 samples used for evaluation.
While the results in Table 6 agree with our qualitative analysis of view consistency in Fig.
4 and the supplementary video, we find that both metrics are very sensitive to the latent code and the sampled poses, as indicated by the large standard deviations.
As no established evaluation pipeline exists, our results should not be directly compared to the numbers in [4] as the implementation and pose sampling might differ.
Pose Conditioning.
Fig.
9 illustrates the impact of the pose conditioning on the generated images.
Pose conditioning is not only used to model slight changes, e.g. of the eyes or the smile, but can alter the general appearance of the generated instance.
However, by fixing the pose conditioning during inference, view-consistent images can be generated.
Regularization.
We ablate the effect of regularization in terms of end-to-end performance measured in FID.
Table 5 shows that the regularizers do not significantly change FID.
Nonetheless, L DV speeds up training (see Table 1 of the main paper) and we find the remaining losses to be helpful for stabilizing training.
L reg w/o L DV w/o L TV w/o L fgcvg w/o L bgcvg
FID 14.2 14.
[Table]
Failure Cases.
Fig.
7 illustrates failure cases of out method.
For some samples, we observe that the background and the foreground are not disentangled properly.
The left column in Fig.
7 shows an example where the foreground generates parts of the background, as indicated by the red boxes.
In turn, the background models the body of the person which should be part of the foreground.
Learning to disentangle background and foreground without direct supervision, e g., instance masks, is often ambiguous which makes it a challenging task.
The middle column in Fig.
7 displays a common failure case of our model on AFHQ: The whiskers of the cat are connected to its body.
This is likely a consequence from the depth variance and total variation regularization we apply to obtain a single sharp surface and compact geometry.
The right column in Fig.
7 shows an occasional failure on
FFHQ.
For some samples, we observe that the hair is directed inward to the head instead of outward.
In the rendered image this effect is not visible which suggests that it likely results from ambiguity in the training data.
Uncurated Samples.
We provide additional samples of our method for FFHQ [22] in Fig.
AFHQ [6] in Fig.
11, and Carla [42] in Fig.
Quantitative Comparison.
As FID is biased towards the number of images [2], we explicitly annotate the number of generated images for the results reported in Table 2 of the main paper in
Table 4.
Most works evaluate FID either using 20k or 50k generated images.
We evaluate our method for both cases.
For our method and the considered datasets, the difference between using 20k or 50k generated images is reasonably small.
D Societal Impact
This work considers the task of generating photorealistic renderings of scenes with data-driven approaches which has potential downstream applications in virtual reality, augmented reality, gaming and simulation.
While many use-cases are possible, we believe that in the long run this line of research could support designers in creating renderings of 3D models more efficiently.
However, generating photorealistic 3D-scenarios also bears the risk of manipulation, e.g., by creating edited imagery of real people.
Further, like all data-driven approaches, our method is susceptible to biases in the training data.
Such biases can, e.g., result in a lack of diversity for the generated faces and have to be addressed before using this work for any downstream applications.