C-Flow: Conditional Generative Flow Models for Images and 3D Point Clouds

Albert Pumarola, Stefan Popov, Francesc Moreno-Noguer, Vittorio Ferrari

Introduction

Generative models have become extremely popular in the machine learning and computer vision communities. Two main actors currently prevail in this scenario, Variational Autoencoders (VAEs) and especially Generative Adversarial Networks (GANs) . In this paper we focus on a different family, the so-called flow-based generative models , which remain under the shadow of VAEs and GANs despite offering very appealing properties. Compared to other generative method, flow-based models build upon a sequence of reversible mappings between the input and latent space that allow for (1) exact latent-variable inference and log-likelihoood evaluation, (2) efficient and parallelizable inference and synthesis and (3) useful and simple data manipulation by operating directly on the latent space.

The main contribution of this paper is a novel approach to condition normalizing flows, making it possible to perform multi-modality transfer tasks which have so far not been explored under the umbrella of flow-based generative models. For this purpose, we introduce C-Flow, a framework consisting of two parallel flow branches, interconnected across their reversible functions using conditional coupling layers and trained with an invertible cycle consistency. This scheme allows guiding a source domain towards a target domain guaranteeing the satisfaction of the aforementioned properties of flow-based models. Conditional inference is then implemented in a simple manner, by (exactly) embedding the source sample into its latent space, sampling a point from a Gaussian prior, and then propagating them through the learned normalizing flow. For example, for the application of synthesizing multiple plausible photos given a semantic segmentation mask, each image is generated by jointly propagating the segmentation embedding and a random point drawn from a prior distribution across the learned flow.

Our second contribution is a strategy to enable flow-based methods to model unordered 3D point clouds. Specifically, we introduce (1) a re-ordering of the 3D data points according to a Hilbert sorting scheme, (2) a global feature operation compatible with the reversible scheme, and (3) an invertible cycle consistency that penalizes the Chamfer distance. Combining this strategy with the proposed conditional scheme we can then address tasks such as shape interpolation, 3D object reconstruction from an image, and rendering an image given a 3D point cloud (Fig. LABEL:fig:teaser).

Importantly, our new conditioning scheme enables a wide range of tasks beyond 3D point cloud modeling. In particular, we are the first flow-based model to show mapping between a large diversity of domains, including image-to-image, pointcloud-to-image, edges-to-image segmentation-to-image and their inverse mappings. Also, we are the first to demonstrate application in image content manipulation and style transfer tasks.

We believe our conditioning scheme, and its ability to deal with a variety of domains, opens the door to building general-purpose and easy to train solutions. We hope all this will spur future research in the domain of flow-based generative models.

Related Work

Variational Auto-Encoders (VAEs) and Generative Adversarial Networks (GANs) are the most studied deep generative models so far. VAEs use deep networks as function approximators and maximize a lower bound on the data log-likelihood to model a continuous latent variable with intractable posterior distribution . GANs, on the other hand, circumvent the need for dealing with likelihood estimation by leveraging an adversarial strategy. While GANs’ versatility has made possible advances in many applications , their training is unstable and requires careful hyper-parameter tuning.

Flow-based generative models have received little attention compared to GANs and VAEs, despite offering very attractive properties such as the ability to estimate exact log-likelihood, efficient synthesis and exact latent-variable inference. Further advances have been proposed in RealNVP by introducing the affine coupling layers and in Glow , through an architecture with 1x1 invertible convolutions for image generation and editing. These works have been later applied to audio generation , image modeling and video prediction .

Some recent works have proposed strategies for conditioning normalizing flows by combining them with other generative models. For instance, combine flows with GANs. These models, however, are more difficult to train as adversarial losses tend to introduce instabilities. Similarly, for the specific application of video prediction, enforces an autoregressive model onto the past latent variables to predict them in the future. Dual-Glow uses a conditioning scheme for MRI-to-PET brain scan mapping by concatenating the prior distribution of the source image with the latent variables of the target image.

In this paper, we introduce a novel mechanism to condition flow-based generative models by enforcing a source-to-target coupling at every transformation step instead of only feeding the source information into the target prior distribution. As we show experimentally, this enables fine-grained control over the modeling process (Sec. 7).

Modeling and reconstruction of 3D Shapes. The success of deep learning has spurred a large number of discriminative approaches for 3D reconstruction . These techniques, however, only learn direct mappings between output shapes and input images. Generative models, in contrast, capture the actual shape distribution from the training set, enabling not only to reconstruct new test images, but also to sample new shapes from the learned distribution. There exist several works along this line. For instance, GANs have been used in Wu et al. to model objects in a voxel representation; Hamu et al. used them to model body parts; and Pumarola et al. to learn the manifold of geometry images representing clothed 3D bodies. Auto-encoders and VAEs have also been applied to model 3D data. More recently, Joon Park et al. used auto-decoders to represent shapes with continuous volumetric fields. All previous techniques are not bijective, and thus, not directly applicable to our model.

PointFlow is the only approach that uses normalizing flows to model 3D data. They learn a generative model for point clouds by first modeling the distribution of object shapes and then applying normalizing flows to model the point cloud distribution for each shape. This strategy, however, cannot condition the shape, preventing PointFlow from being used in applications such as 3D reconstruction and rendering. Also, its inference time is very high, as point clouds are generated one point at a time, while we generate the entire point cloud in one forward pass.

Flow-Based Generative Model

Flow-based generative models aim to approximate an unknown true data distribution x∼p∗(x)\mathbf{x}\sim p^{*}(\mathbf{x}) from a limited set of observations {x(i)}i=1N\{\mathbf{x}^{(i)}\}_{i=1}^{N}. The data is modeled by learning an invertible transformation gθ(⋅)\mathbf{g}_{\boldsymbol{\theta}}(\cdot) mapping a latent space with tractable density pϑ(z)p_{\boldsymbol{\vartheta}}(\mathbf{z}) to x\mathbf{x}:

where z\mathbf{z} is a latent variable and pϑ(z)p_{\boldsymbol{\vartheta}}(\mathbf{z}) is typically a Gaussian distribution N(z;0,I)\mathbf{N}(\mathbf{z};0,\mathbf{I}). The function gθ\mathbf{g}_{\boldsymbol{\theta}}, commonly known as a normalizing flow , is bijective, meaning that given a data point x\mathbf{x} its latent-variable z\mathbf{z} is computed as:

where gθ−1\mathbf{g}^{-1}_{\boldsymbol{\theta}} is composed of a sequence of KK invertible transformations g−1=g1−1∘g2−1∘⋯∘gK−1\mathbf{g}^{-1}=\mathbf{g}_{1}^{-1}\circ\mathbf{g}_{2}^{-1}\circ\cdots\circ\mathbf{g}_{K}^{-1} defining a mapping between x\mathbf{x} and z\mathbf{z} such that:

The goal of generative models is to find the parameters θ\boldsymbol{\theta} such that pθ(x)p_{\boldsymbol{\theta}}(\mathbf{x}) best approximates p∗(x)p^{*}(\mathbf{x}). Explicitly modeling such probability density function is usually intractable, but using the normalizing flow mapping of Eq. (1) under the change of variable theorem, we can compute the exact log-likelihood for a given data point x\mathbf{x} as:

where ∂hi/∂hi−1\partial\mathbf{h}_{i}/\partial\mathbf{h}_{i-1} is the Jacobian matrix of gi−1\mathbf{g}^{-1}_{i} at hi−1\mathbf{h}_{i-1} and the Jacobian determinant measures the change of log-density made by gi−1\mathbf{g}^{-1}_{i} when transforming hi−1\mathbf{h}_{i-1} to hi\mathbf{h}_{i}. Since we can now compute the exact log-likelihood, the training criterion of flow-based generative model is directly the negative log-likelihood over the observations. Note that optimizing over the actual log-likelihood of the observations is more stable and informative than doing it over a lower-bound of the log-likelihood for VAEs, or minimizing the adversarial loss in GANs. This is one of the major virtues of flow-based approaches.

Conditional Flow-Based Generative Model

Given a true data distribution (xA,xB)∼p∗(xA,xB)(\mathbf{x}_{\text{A}},\mathbf{x}_{\text{B}})\sim p^{*}(\mathbf{x}_{\text{A}},\mathbf{x}_{\text{B}}). Our goal is to learn a model for xB∼p∗(xB∣xA)\mathbf{x}_{\text{B}}\sim p^{*}(\mathbf{x}_{\text{B}}|\mathbf{x}_{\text{A}}) to map sample points from domain AA to domain BB. For example, for the application of 3D reconstruction, xA\mathbf{x}_{\text{A}} would be an image and xB\mathbf{x}_{\text{B}} a 3D point cloud. To this end, we propose a conditional flow-based generative model extending . Our L-levels model, learns both distributions with two bijective transformations gθ\mathbf{g}_{\boldsymbol{\theta}} and fϕ\mathbf{f}_{\boldsymbol{\phi}} (Fig. 1):

where zA\mathbf{z}_{\text{A}} and zB\mathbf{z}_{\text{B}} are latent-variables, and pϑ(zA)p_{\boldsymbol{\vartheta}}(\mathbf{z}_{\text{A}}) and pφ(zB)p_{\boldsymbol{\varphi}}(\mathbf{z}_{\text{B}}) are tractable spherical multivariate Gaussian distributions with learnable mean and variance. Note that conditioning on zA\mathbf{z}_{A} or xA\mathbf{x}_{A} is equivalent, as they are related by a bijective transformation.

We then define the mapping M\mathcal{M} to sample xB\mathbf{x}_{\text{B}} conditioned on xA\mathbf{x}_{\text{A}}, as a three-step operation:

In the following subsections we describe how this conditional framework is implemented. Sec. 4.1 discusses the foundations of the conditional coupling layer we propose to map source to target data using invertible functions, and how its Jacobian is computed. Sec. 4.2 describes the architecture we define for the practical implementation of the coupling layers. Sec. 4.3 presents an invertible cycle consistency loss introduced to further stabilize the training process. Finally, in Sec. 4.4 we define the total training loss.

When designing the conditional coupling layer we need to fulfill the constraint that each transformation has to be bijective and tractable. As shown in , both these issues can be overcome by choosing transformations with triangular Jacobian. In this case their determinant is calculated as the product of diagonal terms, making the computation tractable and ensuring invertibility. Motivated by these works, we propose an extension of their coupling layer to account for cross-domain conditioning. A schematic of the proposed layers is shown in Fig. 2. Formally, let us define y≜hiy\triangleq h_{i} and x≜hi−1x\triangleq h_{i-1}. We then write the invertible function f−1\mathbf{f}^{-1} to transform a data point xB\mathbf{x}_{\text{B}} based on xA\mathbf{x}_{\text{A}} as follows:

The inverse f\mathbf{f} of the conditional coupling layer is:

2 Coupling Network Architecture

We next describe the architecture of Ψθ(⋅)\Psi_{\boldsymbol{\theta}}(\cdot) and Ψϕ(⋅)\Psi_{\boldsymbol{\phi}}(\cdot) used to regress the affine transform applied at every conditional coupling layer at each gi\mathbf{g}_{i} and fi\mathbf{f}_{i} respectively. We build upon the stack of three 2D convolution layers proposed by . The first two layers have a filter size of 3×33\times 3 and 1×11\times 1 with 512512 output channels followed by actnorm and a ReLU activation. The third layer regresses the final scale and translation by applying a 2D convolutional layer with filter size 3×33\times 3 initialized with zeros such that each affine transformation at the beginning of training is equivalent to an identity function.

For the transformation gi−1(xA)\mathbf{g}^{-1}_{i}(x_{\text{A}}) we exactly use this architecture, but for fi−1(xB∣xA)\mathbf{f}^{-1}_{i}(x_{\text{B}}|x_{\text{A}}) we extend it to take into account the conditioning xAx_{\text{A}}. Concretely, in fi−1\mathbf{f}^{-1}_{i}, xBx_{\text{B}} is initially transformed by two convolution layers, like the first two of gi−1\mathbf{g}^{-1}_{i}. Then, xAx_{\text{A}} is adapted with a channel-wise affine transform implemented by a 1×11\times 1 convolution. Finally, its output is added to the transformed xBx_{\text{B}}. To ensure a similar contribution of xAx_{\text{A}} and xBx_{\text{B}} their activations are normalized with actnorm so that they operate in the same range. A final 3×33\times 3 convolution regresses the conditional coupling layer operators log⁡(sB)\log(\mathbf{s}_{\text{B}}) and tB\mathbf{t}_{\text{B}}.

3 Invertible Cycle Consistency

We train our model to maximize the log-likelihood of the training dataset. However, likewise in GANs learning , we found beneficial to add a loss encouraging the generated and real samples to be similar in L1. To do so, we exploit the fact that our model is made of bijective transformations, and introduce what we call an invertible cycle consistency. This operation can be summarized as follows:

Concretely, the data points observations (xA\mathbf{x}_{\text{A}}, xB\mathbf{x}_{\text{B}}) are initially mapped into their latent variables (zA\mathbf{z}_{\text{A}}, zB\mathbf{z}_{\text{B}}), where each variable is composed of an LL-level stack. As demonstrated in the first levels encode the high frequencies (details) in the data, and the last levels the low frequencies.

We then resample the first L−1L-1 dimensions of zB\mathbf{z}_{\text{B}} from a Gaussian distribution, i.e. zB=[z1,…,zL]→z^B=[N(0,I)1,…,N(0,I)L−1,zL]\mathbf{z}_{\text{B}}=[\mathbf{z}_{1},\dots,\mathbf{z}_{L}]\rightarrow\hat{\mathbf{z}}_{\text{B}}=[\mathbf{N}(0,\mathbf{I})_{1},\dots,\mathbf{N}(0,\mathbf{I})_{L-1},\mathbf{z}_{L}]. By doing this, z^B\hat{\mathbf{z}}_{\text{B}} is only retaining the lowest frequencies of the original zB\mathbf{z}_{\text{B}}.

As a final step, we invert f−1\mathbf{f}^{-1}, to recover x^B=f(z^B∣zA)\hat{\mathbf{x}}_{\text{B}}=\mathbf{f}(\hat{\mathbf{z}}_{\text{B}}|{\mathbf{z}}_{\text{A}}) and penalize its L1 difference w.r.t the original xB{\mathbf{x}}_{\text{B}}. What we are essentially doing is to force the model to use information from the condition xA{\mathbf{x}}_{\text{A}} so that the recover sample x^B\hat{\mathbf{x}}_{\text{B}} is as similar as possible to the original xB{\mathbf{x}}_{\text{B}}. Note that if reconstructed z^B\hat{\mathbf{z}}_{\text{B}} based on the entire latent variable, the recovered sample would be identical to the original xB{\mathbf{x}}_{\text{B}} because f\mathbf{f} is bijective, and this loss would be meaningless.

4 Total Loss

Formally, denoting the training pairs of observations as {xA(i),xB(i)}i=1N\{\mathbf{x}^{(i)}_{\text{A}},\mathbf{x}^{(i)}_{\text{B}}\}_{i=1}^{N}, the model parameters are learned by minimizing the following loss function:

The first term maximizes the joint likelihood of the data observations. With our design, it also maximizes the conditional likelihood of xB∣xA\mathbf{x}_{\text{B}}|\mathbf{x}_{\text{A}} and thus forces the model to learn the desired mapping. To show this, we apply the law of total probability and we factor it into:

Due to the diagonal structure of the Jacobians, the marginal likelihood of xA\mathbf{x}_{\text{A}} depends only on θ\boldsymbol{\theta} (first sum), while the conditional of xB∣xA\mathbf{x}_{\text{B}}|\mathbf{x}_{\text{A}}, only on ϕ\boldsymbol{\phi}. Maximizing the joint likelihood thus maximizes both likelihoods independently.

The second term in (14) minimizes the cycle consistency loss. λ\lambda is a hyper-parameter balancing the terms. This loss is fully differentiable, and we provide details on how we optimize it in Sec. 6.

Modeling Unordered 3D Point Clouds

The model described so far can handle input data represented on regular grids but it fails to model unordered 3D point clouds, whose lack of spatial neighborhood ordering prevents convolutions from being applied. To process point clouds with deep networks, a common practice is to apply symmetry operations that create fixed-size tensors of global features describing the entire point cloud sample. These operations require extracting point-independent features followed by a max-pool, which is not invertible and not applicable to normalizing flows. Another alternative would be the graph convolutional networks , although their high computational cost makes them not suitable for our scheme of multiple coupling layers. We propose a three-step mechanism to enable modeling 3D point clouds:

(i) Approximate Sorting with Space-Filling Curves. C-Flow is based on convolutional layers which require input data with a local neigboorhood consistent across samples. To fulfill this condition on unordered point clouds, we propose to sort them based on proximity. As discussed in , for high dimensional spaces it is not possible to produce a perfect ordering stable to point perturbations. In this paper we therefore consider using the approximation provided by the Hilbert’s space-filling curve algorithm . For each training sample, we project its points into a 3D Hilbert curve and reorder them based on their ordering along the curve (Fig. 3). Notice that not only we can establish a neighborhood relationship but also a semantically-stable ordering (e.g. in Fig. 3 the chair’s right-leg is always blue). To the best of our knowledge there is no previous work using such preprocessing for point clouds.

(ii) Approximating Global Features. Hilbert Sort is not sufficient to model 3D data because of a major issue: it splits the space into equally sized quadrants and the Hilbert curve will cover all points in a quadrant before moving to the next. As a consequence, two points that were originally close in space, but lie near the boundaries of two different quadrants, will end up far away in the final ordering. To mitigate this effect we extend the proposed coupling network architecture (Sec. 4.2) with an approximate but invertible version of the global features proposed in that describe the whole point cloud. Concretely, we first resample and reshape the reordered point cloud to form H×W×3H\times W\times 3 matrices (in practice we use the same size as that of the images). Then we approximate the global descriptors of through a 1×11\times 1 convolution to extract point-independent features followed by a max-pool applied only over the first half of the point cloud features x1:cx^{1:c} (Fig. 4). The coupling layer remains bijective because during the backward propagation the approximated global features can be recovered using a similar strategy as in Eq. (12).

(iii) Symmetric Chamfer Distance for Cycle Consistency. For the specific case of point clouds, we observed that when penalizing the invertible cycle consistency with L1 the model converged to a mean Hilbert curve. Therefore, for point clouds, we substitute L1 by the symmetric Chamfer distance , which computes the mean Euclidean distance between the ground-truth point cloud xB\mathbf{x}_{\text{B}} and the recovered x^B\hat{\mathbf{x}}_{\text{B}}.

Implementation Details

Due to memory restrictions, we train with image samples of 64×6464\times 64 resolution. For 3D point clouds, to maintain the same architecture as in images, we reshape each point cloud sample (list of 64264^{2} points) to 64×6464\times 64. At test time we also regress 64264^{2} 3D points per forward pass. Our implementation builds upon that of Glow . We use Adam with learning rate 1e−61e^{-6}, β1=0.85\beta_{1}=0.85, β2=0.007\beta_{2}=0.007 and batch size 44. The multi-scale architecture consists of L=4L=4 levels with 12 flow steps per level (K=4∗12K=4*12 in Eq. (3)) each and 2×2\times squeezing operations. For conditional sampling we found additive coupling (s(⋅)=1s(\cdot)=1) to be more stable during training than affine transformation. The prior distributions pϑ(zA)p_{\boldsymbol{\vartheta}}(\mathbf{z}_{\text{A}}) and pφ(zB)p_{\boldsymbol{\varphi}}(\mathbf{z}_{\text{B}}) are initialized with mean 0 and variance 1. The rest of weights are randomly initilized from a normal distribution with mean and std 0.050.05. λ=10\lambda=10 in Eq. (14). As in previous likelihood-based generative models , we observed that sampling from a reduced-temperature prior improves the results. To do so, we multiply the variance of pφ(zB)p_{\boldsymbol{\varphi}}(\mathbf{z}_{\text{B}}) by T=0.9T=0.9. The model is trained with 4 GPUs P-100 for 10 days.

Experimental Evaluation

We next evaluate our system on diverse tasks: (1) Modeling point clouds (Sec. 7.1), (2) 3D reconstruction and rendering (Sec. 7.2), (3) Image-to-image mapping in a variety of domains and datasets (Sec. 7.3), and (4) Image manipulation and style transfer (Sec. 7.4).

We evaluate the potential of our approach to model 3D point clouds on ShapeNet . For this task, we do not consider the full conditioning scheme and only use one of the branches of C-Flow in Fig. 1, which we denote as C-Flow*.

In our first experiment we study the representation capacity of unknown shapes, formally defined as the ability to retain the information after mapping forward and backward between the original and latent spaces. For this purpose, we first map a real point cloud x\mathbf{x} to the latent space z=gθ−1(x)\mathbf{z}=\mathbf{g}^{-1}_{\boldsymbol{\theta}}(\mathbf{x}). The full-size embedding z=[z1,…,zL]\mathbf{z}=[\mathbf{z}_{1},\ldots,\mathbf{z}_{L}] has as many dimensions as the input (HWCHWC). Then we progressively remove information from z\mathbf{z} by replacing their left-most ll components with samples drawn from a Gaussian distribution, i.e. z^=[N(0,I)1,…,N(0,I)l,zl+1,…,zL]\hat{\mathbf{z}}=[\mathbf{N}(0,\mathbf{I})_{1},\dots,\mathbf{N}(0,\mathbf{I})_{l},\mathbf{z}_{l+1},\dots,\mathbf{z}_{L}]. Note that the embedding size L−lL-l can be set at test time with no need to retrain, making tasks like point cloud compression straightforward. Finally we map back this embedding to the original point cloud space x^=gθ(z)\hat{\mathbf{x}}=\mathbf{g}_{\boldsymbol{\theta}}(\mathbf{z}) and compare to x\mathbf{x}.

Tab. 1 reports the Chamfer Distance (CD) for different embedding sizes. CD is computed by densely resampling the input mesh with up to 10710^{7} vertices. The plain version of C-Flow* (no conditioning, no sorting, no global features) is equivalent to Glow . This version is consistently improved when introducing the sorting and global features strategies (Sec. 5). The error decreases gracefully as we increase the embedding size, and importantly, when using the full size embedding we obtain a perfect recovering (Fig. 5-top). This is a virtue of the bijective models, and is not a trivial property. Tab. 1 also reports the numbers of AtlasNet and DeepSDF , showing that our approach achieves competitive results. This comparison is only indicative as the representation used are inherently different ( parametric and continuous surface).

Recall that the left-most components in z\mathbf{z} encode the shape high details. We exploit this property to generate point clouds with an arbitrarily large number of points by performing multiple backward propagations (x^=gθ(z^)\hat{\mathbf{x}}=\mathbf{g}_{\theta}(\hat{\mathbf{z}})) of a partial embedding z^\hat{\mathbf{z}} (Fig. 5-bottom). Every time we propagate, we recover a new set of 3D points allowing to progressively improve the density of the reconstruction.

Another task that can be addressed with C-Flow is shape interpolation in the latent space (Figure 6).

2 3D Reconstruction & rendering

We next evaluate the ability of C-Flow to model the conditional distributions (1) image →\rightarrow point cloud , which enables to perform 3D reconstruction from a single image; and (2) point cloud →\rightarrow image, which is its inverse problem of rendering an image given a 3D point cloud. Fig. LABEL:fig:teaser shows qualitative results on the Chair class of ShapeNet. In the top row our model is able to generate plausible 3D reconstructions of unknown objects even under strong self-occlusions (top-right example). The second row depicts results for rendering, which highlights another advantage of our model: it allows sampling multiple times from the conditional distribution to produce several images of the same object which exhibit different properties (e.g. viewpoint or texture).

In Table 2 we compare C-Flow with other single-image 3D reconstruction methods 3D-R2N2 , PSGN , Pix2Mesh , AtlasNet and ONet . We evaluate 3D reconstruction in terms of the Chamfer distance (CD) with the ground truth shapes. Our approach (last row) performs on par with and it is slightly below the state-of-the-art techniques specifically designed for 3D reconstruction .

With the same model, we can also render images from point clouds. To the best of our knowledge, no previous work can perform such mapping. While a few approaches do render point clouds , they hold on strong assumptions of knowing the RGB color per point and the camera calibration to project the point cloud onto the image plane. Table 2 also reports an ablation study about the different operations we devised to handle 3D point clouds, namely sorting the point cloud (Sort), approximating global features (GF-Coupling) and inverse cycle consistency with chamfer distance (CD). In this case, evaluation is reported using Inception Score (IS) and Bits Per Dimension (BPD) which is equivalent to the negative log2-likelihood typically used to report flow-based methods performance. Results show a performance boost when using each of these components, and especially when combining them.

3 Image-to-Image mappings

We evaluate the ability of C-Flow to perform multi-domain image-to-image mapping: segmentation ↔\leftrightarrow street views trained on Cityscapes , structure ↔\leftrightarrow facade trained on CMP Facades , map ↔\leftrightarrow aerial photo trained on and edges ↔\leftrightarrow shoes trained on . Fig. 7-left shows mappings in which the target domain has a wide variance and multiple sampling generates different results (e.g. a semantic segmentation map can map to several grayscale images). Fig. 7-right examples have a target domain with a narrower variance, and despite multiple samplings the generated images are very similar (e.g. given an image its segmentation is well defined).

Table 3 reports quantitative evaluations using Structural Similarity (SSIM) , and again BPD and IS. When introducing the invertible cycle consistency loss (Sec. 4.3) the model does not improve its compression abilities (BPD) but improves in terms of structural similarity (SSIM) and semantic content (IS). It is worth mentioning that while GANs have shown impressive image-to-image mapping results, even at high resolution , ours is the first work that can address such tasks using normalizing flows.

4 Other Applications

Finally, we demonstrate the versatility of C-Flow being the first flow-based method capable of performing style transfer and image content manipulation (Fig. 8). Importantly, the model was not retrained for these specific tasks, and we use the same parameters learned to perform image-to-image mappings (Sec. 7.3). For image manipulation we use the weights of segmentation →\rightarrow street view and for style transfer those of edges ↔\leftrightarrow shoes. Formally, let the domain AA to be the structure (e.g. segmentation mask) and the domain BB to be the image (e.g. street view). Then, image manipulation is achieved via three operations:

Note that we are no longer conditioning based only on AA, as in Sec. 7.3, now the synthesised image is jointly conditioned on AA (for structure) and BB (for texture).

To perform style transfer, we first transform the content image into its structure xA2\mathbf{x}_{\text{A}}^{2}. For instance, in Fig. 8-bottom, the content of the shoe is initially mapped onto its edge structure with the shoes →\rightarrow edges weights. Then, we apply the same procedure as we did for image manipulation using the edges →\rightarrow shoes weights, setting xA1\mathbf{x}_{\text{A}}^{1} to be the structure of the content image and xB1\mathbf{x}_{\text{B}}^{1} the style image.

Conclusions

We have proposed C-Flow, a novel conditioning scheme for normalizing flows. This conditioning, in conjunction with a new strategy to model unordered 3D point clouds, has made it possible to address 3D reconstruction and rendering images from point clouds, problems which so far, could not be tackled with normalizing flows. Furthermore, we demonstrate C-Flow to be a general-purpose model, being also applicable to many more multi-modality problems, such as image-to-image translation, style transfer and image content edition. To the best of our knowledge, no previous model has demonstrated such an adaptability.

Acknowledgements

This project was done during an internship at Google. It is also partially supported by the EU project TERRINET: The European robotics research infrastructure network H2020-INFRAIA-2017-1-730994.

References