On Learning 3D Face Morphable Model from In-the-wild Images

Luan Tran, Xiaoming Liu

Introduction

The 33D Morphable Model (33DMM) is a statistical model of 33D facial shape and texture in a space where there are explicit correspondences . The morphable model framework provides two key benefits: first, a point-to-point correspondence between the reconstruction and all other models, enabling “morphing”, and second, modeling underlying transformations between types of faces (male to female, neutral to smile, etc.). 33DMM has been widely applied in numerous areas including, but not limited to, computer vision , computer graphics , human behavioral analysis and craniofacial surgery .

Traditionally, 33DMM is learnt through supervision by performing dimension reduction, typically Principal Component Analysis (PCA), on a training set of co-captured 33D face scans and 22D images. To model highly variable 33D face shapes, a large amount of high-quality 33D face scans is required. However, this requirement is expensive to fulfill as acquiring face scans is very laborious, in both data capturing and post-processing stage. The first 33DMM was built from scans of 200200 subjects with a similar ethnicity/age group. They were also captured in well-controlled conditions, with only neutral expressions. Hence, it is fragile to large variances in the face identity. The widely used Basel Face Model (BFM) is also built with only 200200 subjects in neutral expressions. Lack of expression can be compensated using expression bases from FaceWarehouse or BD-33FE , which are learned from the offsets to the neutral pose. After more than a decade, almost all existing models use no more than 300300 training scans. Such small training sets are far from adequate to describe the full variability of human faces . Until recently, with a significant effort as well as a novel automated and robust model construction pipeline, Booth et al. build the first large-scale 33DMM from scans of ∼10,000{\sim}10,000 subjects.

Second, the texture model of 33DMM is normally built with a small number of 22D face images co-captured with 33D scans, under well-controlled conditions. Despite there is a considerable improvement of 33D acquisition devices in the last few years, these devices still cannot operate in arbitrary in-the-wild conditions. Therefore, all the current 33D facial datasets have been captured in the laboratory environment. Hence, such models are only learnt to represent the facial texture in similar, rather than in-the-wild, conditions. This substantially limits its application scenarios.

Finally, the representation power of 33DMM is limited by not only the size or type of training data but also its formulation. The facial variations are nonlinear in nature. E.g., the variations in different facial expressions or poses are nonlinear, which violates the linear assumption of PCA-based models. Thus, a PCA model is unable to interpret facial variations sufficiently well. This is especially true for facial texture. For all current 33DMM models, their low-dimension albedo subspace faces the same problem of lacking facial hair, e.g., beards. To reduce the fitting error, it compensates unexplainable texture by alternating surface normal, or shrinking the face shape . Either way, linear 33DMM-based applications often degrade their performances when handling out-of-subspace variations.

Given the barrier of 33DMM in its data, supervision and linear bases, this paper aims to revolutionize the paradigm of learning 33DMM by answering a fundamental question:

Whether and how can we learn a nonlinear 33D Morphable Model of face shape and albedo from a set of in-the-wild 22D face images, without collecting 33D face scans?

If the answer were yes, this would be in sharp contrast to the conventional 33DMM approach, and remedy all aforementioned limitations. Fortunately, we have developed approaches to offer positive answers to this question. With the recent development of deep neural networks, we view that it is the right time to undertake this new paradigm of 33DMM learning. Therefore, the core of this paper is regarding how to learn this new 33DMM, what is the representation power of the model, and what is the benefit of the model to facial analysis.

We propose a novel paradigm to learn a nonlinear 33DMM model from a large in-the-wild 22D face image collection, without acquiring 33D face scans, by leveraging the power of deep neural networks captures variations and structures in complex face data. As shown in Fig. 1, starting with an observation that the linear 33DMM formulation is equivalent to a single layer network, using a deep network architecture naturally increases the model capacity. Hence, we utilize two convolution neural network decoders, instead of two PCA spaces, as the shape and albedo model components, respectively. Each decoder will take a shape or albedo parameter as input and output the dense 33D face mesh or a face skin reflectant. These two decoders are essentially the nonlinear 33DMM.

Further, we learn the fitting algorithm to our nonlinear 33DMM, which is formulated as a CNN encoder. The encoder network takes a face image as input and generates the shape and albedo parameters, from which two decoders estimate shape and albedo.

The 33D face and albedo would perfectly reconstruct the input face, if the fitting algorithm and 33DMM are well learnt. Therefore, we design a differentiable rendering layer to generate a reconstructed face by fusing the 33D face, albedo, lighting, and the camera projection parameters estimated by the encoder. Finally, the end-to-end learning scheme is constructed where the encoder and two decoders are learnt jointly to minimize the difference between the reconstructed face and the input face. Jointly learning the 33DMM and the model fitting encoder allows us to leverage the large collection of in-the-wild 22D images without relying on 33D scans. We show significantly improved shape and facial texture representation power over the linear 33DMM. Consequently, this also benefits other tasks such as 22D face alignment, 33D reconstruction, and face editing.

A preliminary version of this work was published in 2018 IEEE Conference on Computer Vision and Pattern Recognition . We extend it in numerous ways: 1) Instead of having lighting embedded in texture, we split texture into albedo and shading. Truthfully modeling the lighting help to improve the shape modeling as it can help to guide the surface normal learning. This results in better performance in followed tasks: alignment and reconstruction, as demonstrated in our experiment section. 2) We propose to present the shape component in the 22D UV space, which helps to reserve spatial relation among its vertices. This also allows us to use a CNN, rather than an expensive multi-layer perceptron, as the shape decoder. 3) To ensure plausible reconstruction, we employ multiple constraints to regularize the model learning.

In summary, this paper makes the following contributions:

We learn a nonlinear 33DMM model, fully models shape, albedo and lighting, that has greater representation power than its traditional linear counterpart.

Both shape and albedo are represented as 22D images, which help to maintain spatial relations as well as leverage CNN power in image synthesis.

We jointly learn the model and the model fitting algorithm via weak supervision, by leveraging a large collection of 22D images without 33D scans. The novel rendering layer enables the end-to-end training.

The new 33DMM further improves performance in related tasks: face alignment, face reconstruction and face editing.

Prior Work

Linear 33DMM. Blanz and Vetter propose the first generic 33D face model learned from scan data. They define a linear subspace to represent shape and texture using principal component analysis (PCA) and show how to fit the model to data. Since this seminal work, there has been a large amount of effort on improving 33DMM modeling mechanism. In , the dense correspondence between facial mesh is solved with a regularised form of optical flow. However, this technique is only effective in a constrained setting, where subjects share similar ethnicities and ages. To overcome this challenge, Patel and Smith employ a Thin Plate Splines (TPS) warp to register the meshes into a common reference frame. Alternatively, Paysan et al. use a Nonrigid Iterative Closest Point (ICP) to directly align 33D scans. In a different direction, Amberg et al. extended Blanz and Vetter’s PCA-based model to emotive facial shapes by adopting an additional PCA modeling of the residuals from the neutral pose. This results in a single linear model of both identity and expression variation of 33D facial shape. Vlasic et al. use a multilinear model to represent the combined effect of identity and expression variation on the facial shape. Later, Bolkart and Wuhrer show how such a multilinear model can be estimated directly from the 33D scans using a joint optimization over the model parameters and groupwise registration of 33D scans.

Improving Linear 33DMM. With PCA bases, the statistical distribution underlying 33DMM is Gaussian. Koppen et al. argue that single-mode Gaussian can’t well represent real-world distribution. They introduce the Gaussian Mixture 33DMM that models the global population as a mixture of Gaussian subpopulations, each with its own mean, but shared covariance. Booth et al. aim to improve texture of 33DMM to go beyond controlled settings by learning “in-the-wild” feature-based texture model. On another direction, Tran et al. learn to regress robust and discriminative 33DMM representation, by leveraging multiple images from the same subject. However, all works are still based on statistical PCA bases. Duong et al. address the problem of linearity in face modeling by using Deep Boltzmann Machines. However, they only work with 22D face and sparse landmarks; and hence cannot handle faces with large-pose variations or occlusion well. Concurrent to our work, Tewari et al. learn a (potentially non-linear) corrective model on top of a linear model. The final model is a summation of the base linear model and the learned corrective model, which contrasts to our unified model. Furthermore, our model has an advantage of using 22D representation of both shape and albedo, which maintains spatial relations between vertices and leverages CNN power for image synthesis. Finally, thanks for our novel rendering layer, we are able to employ perceptual, adversarial loss to improve the reconstruction quality.

22D Face Alignment. 22D Face Alignment can be cast as a regression problem where 22D landmark locations are regressed directly . For large-pose or occluded faces, strong priors of 33DMM face shape have been shown to be beneficial . Hence, there is increasing attention in conducting face alignment by fitting a 33D face model to a single 22D image . Among the prior works, iterative approaches with cascade of regressors tend to be preferred. At each cascade, there is a single or even two regressors used to improve its prediction. Recently, Jourabloo and Liu propose a CNN architecture that enables the end-to-end training ability of their network cascade. Contrasted to aforementioned works that use a fixed 33DMM model, our model and model fitting are learned jointly. This results in a more powerful model: a single-pass encoder, which is learned jointly with the model, achieves state-of-the-art face alignment performance on AFLW20002000 benchmark dataset.

33D Face Reconstruction. Face reconstruction creates a 33D face model from an image collection or even with a single image . This long-standing problem draws a lot of interest because of its wide applications. 33DMM also demonstrates its strength in face reconstruction, especially in the monocular case. This problem is a highly under-constrained, as with a single image, present information about the surface is limited. Hence, 33D face reconstruction must rely on prior knowledge like 33DMM . Statistical PCA linear 33DMM is the most commonly used approach. Besides 33DMM fitting methods , recently, Richardson et al. design a refinement network that adds facial details on top of the 33DMM-based geometry. However, this approach can only learn 2.52.5D depth map, which loses the correspondence property of 33DMM. The follow up work by Sela et al. try to overcome this weakness by learning a correspondence map. Despite having some impressive reconstruction results, both these methods are limited by training data synthesized from the linear 33DMM model. Hence, they fail to handle out-of-subspace variations, e.g., facial hair.

Unsupervised learning in 33DMM. Collecting large-scale 33D scans with detailed labels for learning 33DMM is not an easy task. A few work try to use large-scale synthetic data as in , but they don’t generalize well as there still be a domain gap with real images. Tewari et al. is among the first work attempting to learn 33DMM fitting from unlabeled images. They use an unsupervised loss which compares projected textured face mesh with the original image itself. The sparse landmark alignment is also used as an auxiliary loss. Genova et al. further improve this approach by comparing reconstructed images and original input using higher-level features from a pretrained face recognition network. Compared to these work, our work has a different objective of learning a nonlinear 33DMM.

The Proposed Nonlinear 333DMM

In this section, we start by introducing the traditional linear 33DMM and then present our novel nonlinear 33DMM model.

The 33D Morphable Model (33DMM) and its 22D counterpart, Active Appearance Model , provide parametric models for synthesizing faces, where faces are modeled using two components: shape and albedo (skin reflectant). In , Blanz et al. propose to describe the 33D face space with PCA:

The 33DMM can be used to synthesize novel views of the face. Firstly, a 33D face is projected onto the image plane with the weak perspective projection model:

where g(S,m)g(\mathbf{S},\mathbf{m}) is the projection function leading to the 22D positions V2D\mathbf{V}^{\text{2D}} of 33D rotated vertices V\mathbf{V}, ff is the scale factor, Pr=[100010]\mathbf{Pr}=\begin{bmatrix}1&0&0\\ 0&1&0\end{bmatrix} is the orthographic projection matrix, R\mathbf{R} is the rotation matrix constructed from three rotation angles (pitch, yaw, roll), and t2d\mathbf{t}_{2d} is the translation vector. While the project matrix MM is of the size of 2×42\times 4, it has six degrees of freedom, which is parameterized by a 66-dim vector m\mathbf{m}. Then, the 22D image is rendered using texture and an illumination model such as Phong reflection model or Spherical Harmonics .

2 Nonlinear 333DMM

As mentioned in Sec. 1, the linear 33DMM has the problems such as requiring 33D face scans for supervised learning, unable to leverage massive in-the-wild face images for learning, and the limited representation power due to the linear bases. We propose to learn a nonlinear 33DMM model using only large-scale in-the-wild 22D face images.

In linear 33DMM, the factorization of each of components (shape, albedo) can be seen as a matrix multiplication between coefficients and bases. From a neural network’s perspective, this can be viewed as a shallow network with only one fully connected layer and no activation function. Naturally, to increase the model’s representation power, the shallow network can be extended to a deep architecture. In this work, we design a novel learning scheme to joint learn a deep 33DMM model and its inference (or fitting) algorithm.

Specifically, as shown in Fig. 2, we use two deep networks to decode the shape, albedo parameters into the 33D facial shape and albedo respectively. To make the framework end-to-end trainable, these parameters are estimated by an encoder network, which is essentially the fitting algorithm of our 33DMM. Three deep networks join forces for the ultimate goal of reconstructing the input face image, with the assistant of a physically-based rendering layer. Fig. 2 visualizes the architecture of the proposed framework. Each component will be present in following sections.

where R(m,L,S,A)\mathcal{R}(\mathbf{m},\mathbf{L},\mathbf{S},\mathbf{A}) is the rendering layer (Sec. 3.2.3).

2.2 Albedo & Shape Representation

Fig. 3 illustrates three possible albedo representations. In traditional 33DMM, albedo is defined per vertex (Fig. 3(a)). This representation is also adopted in recent work such as . There is an albedo intensity value corresponding to each vertex in the face mesh. Despite widely used, this representation has its limitations. Since 33D vertices are not defined on a 22D grid, this representation is mostly parameterized as a vector, which not only loses the spatial relation of its vertices, but also prevents it to leverage the convenience of deploying CNN on 22D albedo. In contrast, given the rapid progress in image synthesis, it is desirable to choose a 22D image, e.g., a frontal-view face image in Fig. 3(b), as an albedo representation. However, frontal faces contain little information of two sides, which would lose many albedo information for side-view faces.

In light of these consideration, we use an unwrapped 22D texture as our texture representation (Fig. 3(c)). Specifically, each 33D vertex v\mathbf{v} is projected onto the UV space using cylindrical unwarp. Assuming that the face mesh has the top pointing up the yy axis, the projection of v=(x,y,z)\mathbf{v}=(x,y,z) onto the UV space vuv=(u,v)\mathbf{v}^{\text{uv}}=(u,v) is computed as:

Usually, it involves sub-pixel sampling via bilinear interpolation:

where vuv=(u,v)\mathbf{v}^{\text{uv}}=(u,v) is the UV space projection of v\mathbf{v} via Eqn. 6.

Representing 33D face shape in UV space allow us to use a CNN for shape decoder DSD_{S} instead of using a multi-layer perceptron (MLP) as in our preliminary version . Avoiding using wide fully-connected layers allow us to use deeper network for DSD_{S}, potentially model more complex shape variations. This results in better fitting results as being demonstrated in our experiment (Sec. 4.1.2).

Also, it is worth to note that different from our preliminary version where the reference UV space, for texture, is build upon projection of the mean shape with neutral expression; in this version, the reference shape used has the mouth open. This change helps the network to avoid learning a large gradient near the two lips’ borders in the vertical direction when the mouth is open.

To regress these 22D representation of shape and albedo, we can employ CNNs as shape and albedo networks respectively. Specifically, DSD_{S}, DAD_{A} are CNN constructed by multiple fractionally-strided convolution layers. After each convolution is batchnorm and eLU activation, except the last convolution layers of encoder and decoders. The output layer has a tanhtanh activation to constraint the output to be in the range of $$. The detailed network architecture is presented in Tab. I.

2.3 In-Network Physically-Based Face Rendering

where BB is the number of spherical harmonics bands. We use B=3B=3, which leads to B2=9B^{2}=9 coefficients in L\mathbf{L} for each of three color channels. Secondly, the 33D shape/mesh S\mathbf{S} is projected to the image plane via Eqn. 4. Finally, the 33D mesh is then rendered using a Z-buffer renderer, where each pixel is associated with a single triangle of the mesh,

where Φ(g,m,n)={v1,v2,v3}\Phi(g,m,n)=\{\mathbf{v}_{1},\mathbf{v}_{2},\mathbf{v}_{3}\} is an operation returning three vertices of the triangle that encloses the pixel (m,n)(m,n) after projection gg; Φuv(g,m,n)\Phi^{\text{uv}}(g,m,n) is the same operation with resultant vertices mapped into the referenced UV space using Eqn. 6. In order to handle occlusions, when a single pixel resides in more than one triangle, the triangle that is closest to the image plane is selected. The final location of each pixel is determined by interpolating the location of three vertices via barycentric coordinates {λi}i=13\{\lambda_{i}\}_{i=1}^{3}.

There are alternative designs to our rendering layer. If the texture representation is defined per vertex, as in Fig. 3(a), one may warp the input image Ii\mathbf{I}_{i} onto the vertex space of the 33D shape S\mathbf{S}, whose distance to the per-vertex texture representation can form a reconstruction loss. This design is adopted by the recent work of . In comparison, our rendered image is defined on a 22D grid while the alternative is on top of the 33D mesh. As a result, our rendered image can enjoy the convenience of applying the perceptual loss or adversarial loss, which is shown to be critical in improving the quality of synthetic texture. Another design for rendering layer is image warping based on the spline interpolation, as in . However, this warping is continuous: every pixel in the input will map to the output. Hence this warping operation fails in the occluded region. As a result, Cole et al. limit their scope to only synthesizing frontal-view faces by warping from normalized faces.

The CUDA implementation of our rendering layer is publicly available at https://github.com/tranluan/Nonlinear_Face_3DMM.

2.4 Occlusion-aware Rendering

Very often, in-the-wild faces are occluded by glasses, hair, hands, etc. Trying to reconstruct abnormal occluded regions could make the model learning more difficult or result in an model with external occlusion baked in. Hence, we propose to use a segmentation mask to exclude occluded regions in the rendering pipeline:

As a result, these occluded regions won’t affect our optimization process. The foreground mask M\mathbf{M} is estimated using the segmentation method given by Nirkinet al. . Examples of segmentation masks and rendering results can be found in Fig. 6.

2.5 Model Learning

The entire network is end-to-end trained to reconstruct the input images, with the loss function:

where the reconstruction loss LrecL_{\text{rec}} enforces the rendered image I^\mathbf{\hat{I}} to be similar to the input I\mathbf{I}, the landmark loss LLL_{L} enforces geometry constraint, and the regularization loss LregL_{\text{reg}} encourages plausible solutions.

Reconstruction Loss. The main objective of the network is to reconstruct the original face via disentangle representation. Hence, we enforce the reconstructed image to be similar to the original input image:

where V\mathcal{V} is the set of all pixels in the images covered by the estimated face mesh. There are different norms can be used to measure the closeness. To better handle outliers, we adopt the robust l2,1l_{2,1}, where the distance in the 33D RGB color space is based on l2l_{2} and the summation over all pixels enforces sparsity based on l1l_{1}-norm .

To improve from blurry reconstruction results of lpl_{p} losses, in our preliminary work , thanks for our rendering layer, we employ adversarial loss to enhance the image realism. However, adversarial objective only encourage the reconstruction to be close to the real image distribution but not necessary the input image. Also, it’s known to be not stable to optimize. Here, we propose to use a perceptual loss to enforce the closeness between images I^\mathbf{\hat{I}} and I\mathbf{I}, which overcomes both of adversarial loss’s weaknesses. Besides encouraging the pixels of the output image I^\mathbf{\hat{I}} to exactly match the pixels of the input I\mathbf{I}, we encourage them to have similar feature representations as computed by the loss network φ\varphi.

We choose VGG-Face as our φ\varphi to leverage its face-related features and also because of simplicity. The loss is summed over C\mathcal{C}, a subset of layers of φ\varphi. Here φj(I)\varphi_{j}(\mathbf{I}) is the activations of the jj-th layer of φ\varphi when processing the image I\mathbf{I} with dimension Wj×Hj×CjW_{j}\times H_{j}\times C_{j}. This feature reconstruction loss is one of perceptual losses widely used in different image processing tasks .

The final reconstruction loss is a weighted sum of two terms:

Sparse Landmark Alignment. To help achieving better model fitting, which in turn helps to improve the model learning itself, we employ the landmark alignment loss, measuring Euclidean distance between estimated and groundtruth landmarks, as an auxiliary task,

Also, note that different from some prior work , our network only requires ground-truth landmarks during training. It is able to predict landmarks via m\mathbf{m} and S\mathbf{S} during the test time.

Regularizations. To ensure plausible reconstruction, we add a few regularization terms:

Albedo Symmetry As the face is symmetry, we enforce the albedo symmetry constraint,

Employing on 22D albedo, this constraint can be easily implemented via a horizontal image flip operation flip()\text{flip}().

Albedo Constancy Using symmetry constraint can help to correct the global shading. However, symmetrical details, i.e., dimples, can still be embedded in the albedo channel. To further remove shading from the albedo channel, following Retinex theory which assumes albedo to be piecewise constant, we enforce sparsity in two directions of its gradient, similar to :

where Ni\mathcal{N}_{i} denotes a set of 44-pixel neighborhood of pixel viuv\mathbf{v}_{i}^{\text{uv}}. With the assumption that pixels with the same chromaticity (i.e., c(x)=I(x)/∣I(x)∣\mathbf{c}(x)=\mathbf{I}(x)/|\mathbf{I}(x)|) are more likely to have the same albedo, we set the constant weight ω(viuv,vjuv)=exp⁡(−α∥c(viuv)−c(vjuv)∥)\omega(\mathbf{v}_{i}^{\text{uv}},\mathbf{v}_{j}^{\text{uv}})=\exp\left(-\alpha\left\lVert\mathbf{c}(\mathbf{v}_{i}^{\text{uv}})-\mathbf{c}(\mathbf{v}_{j}^{\text{uv}})\right\rVert\right), where the color is referenced from the input image using the current estimated projection. Following , we set α=15\alpha=15 and p=0.8p=0.8 in our experiment.

Shape Smoothness For shape component, we impose the smoothness by adding the Laplacian regularization on the vertex locations for the set of all vertices.

Intermediate Semi-Supervised Training. Fully unsupervised training using only the reconstruction and adversarial loss on the rendered images could lead to a degenerate solution, since the initial estimation is far from ideal to render meaningful images. Therefore, we introduce intermediate loss functions to guide the training in the early iterations.

With the face profiling technique, Zhu et al. expand the 300W dataset into 122,450122,450 images with fitted 33DMM shapes S~\widetilde{\mathbf{S}} and projection parameters m~\widetilde{\mathbf{m}}. Given S~\widetilde{\mathbf{S}} and m~\widetilde{\mathbf{m}}, we create the pseudo groundtruth texture T~\widetilde{\mathbf{T}} by referring every pixel in the UV space back to the input image, i.e., the backward of our rendering layer. With m~\widetilde{\mathbf{m}}, S~\widetilde{\mathbf{S}}, T~\widetilde{\mathbf{T}}, we define our intermediate loss by:

where: LS=∥S−S~∥22L_{\text{S}}=\left\lVert\mathbf{S}-\mathbf{\widetilde{S}}\right\rVert^{2}_{2}, LT=∥T−T~∥1L_{\text{T}}=\left\lVert\mathbf{T}-\mathbf{\widetilde{T}}\right\rVert_{1}, Lm=∥m−m~∥22L_{\text{m}}=\left\lVert\mathbf{m}-\mathbf{\widetilde{m}}\right\rVert^{2}_{2}.

It’s also possible to provide pseudo groundtruth to the SH coefficients L\mathbf{L} and followed by albedo A\mathbf{A} using least square optimization with a constant albedo assumption, as has been done in . However, this estimation is not reliable for in-the-wild images with occlusion regions. Also empirically, with proposed regularizations, the model is able to explore plausible solutions for these components by itself. Hence, we decide to refrain from supervising L\mathbf{L} and A\mathbf{A} to simplify our pipeline.

Due to the pseudo groundtruth, using L0L_{0} may run into the risk that our solution learns to mimic the linear model. Thus, we switch to the loss of Eqn. 12 after L0L_{0} converges. Note that the estimated groundtruth of m~\widetilde{\mathbf{m}}, S~\widetilde{\mathbf{S}}, T~\widetilde{\mathbf{T}} and the landmarks are the only supervision used in our training, for which our learning is considered as weakly supervised.

Experimental Results

The experiments study three aspects of the proposed nonlinear 33DMM, in terms of its expressiveness, representation power, and applications to facial analysis. Using facial mesh triangle definition by Basel Face Model (BFM) , we train our 33DMM using 300W-LP dataset , which contains 122,450122,450 in-the-wild face images, in a wide pose range from −90∘-90^{\circ} to 90∘90^{\circ}. Images are loosely square cropped around the face and scale to 256×256256\times 256. During training, images of size 224×224224\times 224 are randomly cropped from these images to introduce translation variations.

The model is optimized using Adam optimizer with a learning rate of 0.0010.001 in both training stages. We set the following parameters: Q=53,215Q=53,215, U=192,V=224U=192,V=224, lS=lT=160l_{S}=l_{T}=160. λ\lambda values are set to make losses to have similar magnitudes.

Albedo Regularization. In this work, to regularize albedo learning, we employ two constraints to efficiently remove shading from albedo namely albedo symmetry and constancy. To demonstrate the effect of these regularization terms, we compare our full model with its partial variants: one without any albedo reqularization and one with the symmetry constraint only. Fig. 7 shows visual comparison of these models. Learning without any constraints results in the lighting is totally explained by the albedo, meanwhile is the shading is almost constant (Fig. 7(a)). Using symmetry help to correct the global lighting. However, symmetric geometry details are still baked into the albedo (Fig. 7(b)). Enforcing albedo constancy helps to further remove shading from it (Fig. 7(c)). Combining these two regularizations helps to learn plausible albedo and lighting, which improves the shape estimation.

Shape Smoothness Regularization. We also evaluate the need in shape regularization. Fig. 8 shows visual comparisons between our model and its variant without the shape smoothness constraint. Without the smoothness term the learned shape becomes noisy especially on two sides of the face. The reason is that, the hair region is not completely excluded during training because of imprecise segmentation estimation.

1.2 Modeling Lighting and Shape Representation

In this work, we make two major algorithmic differences with our preliminary work : incorporating lighting into the model and changing the shape representation.

Our previous work models the texture directly, while this work disentangles the shading from the albedo. As argued, modeling the lighting should have a positive impact on shape learning. Hence we compare our models with results from in face alignment task.

Also, in our preliminary work , as well as in traditional 33DMM, shape is represented as a vector, where vertices are independent. Despite this shortage, this approach has been widely adopted due to its simplicity and sampling efficiency. In this work, we explore an alternative to this representation: represent the 33D shape as a position map in the 22D UV space. This representation has three channels: one for each spatial dimension. This representation maintains the spatial relation among facial mesh’s vertices. Also, we can use CNN as the shape decoder replacing an expensive MLP. Here we also evaluate the performance gain by switching to this representation.

Tab. II reports the performance on the face alignment task of different variants. As a result, modeling lighting helps to reduce the error from 4.704.70 to 4.304.30. Using the 22D representation, with the convenience of using CNN, the error is further reduced to 4.124.12.

1.3 Comparison to Autoencoders

We compare our model-based approach with a convolutional autoencoder in Fig. 9. The autoencoder network has a similar depth and model size as ours. It gives blurry reconstruction results as the dataset contain large variations on face appearance, pose angle and even diversity background. Our model-based approach obtains sharper reconstruction results and provides semantic parameters allowing access to different components including 33D shape, albedo, lighting and projection matrix.

2 Expressiveness

Exploring feature space. We feed the entire CelebA dataset with ∼200{\sim}200k images to our network to obtain the empirical distribution of our shape and texture parameters. By varying the mean parameter along each dimension proportional to its standard deviation, we can get a sense how each element contribute to the final shape and texture. We sort elements in the shape parameter fS\mathbf{f}_{S} based on their differences to the mean 33D shape. Fig. 10 shows four examples of shape changes, whose differences rank No.11, 4040, 8080, and 120120 among 160160 elements. Most of top changes are expression related. Similarly, in Fig. 11, we visualize different texture changes by adjusting only one element of fA\mathbf{f}_{A} off the mean parameter fˉA\bar{\mathbf{f}}_{A}. The elements with the same 44 ranks are selected.

Attribute Embedding. To better understand different shape and albedo instances embedded in our two decoders, we dig into their attribute meaning. For a given attribute, e.g., male, we feed images with that attribute {Ii}i=1n\{\mathbf{I}_{i}\}_{i=1}^{n} into our encoder EE to obtain two sets of parameters {fSi}i=1n\{\mathbf{f}_{S}^{i}\}_{i=1}^{n} and {fAi}i=1n\{\mathbf{f}_{A}^{i}\}_{i=1}^{n}. These sets represent corresponding empirical distributions of the data in the low dimensional spaces. Computing the mean parameters fˉS,fˉA\mathbf{\bar{f}}_{S},\mathbf{\bar{f}}_{A} and feed into their respective decoders, also using the mean lighting parameter, we can reconstruct the mean shape and texture with that attribute. Fig. 12 visualizes the reconstructed textured 33D mesh related to some attributes. Differences among attributes present in both shape and texture. Here we can observe the power of our nonlinear 33DMM to model small details such as “bag under eyes”, or “rosy cheeks”, etc.

3 Representation Power

We compare the representation power of the proposed nonlinear 33DMM vs. traditional linear 33DMM.

Albedo. Given a face image, assuming we know the groundtruth shape and projection parameters, we can unwarp the texture into the UV space, as we generate “pseudo groundtruth” texture in the weakly supervision step. With the groundtruth texture, by using gradient descent, we can jointly estimate, a lighting parameter L\mathbf{L} and an albedo parameter fA\mathbf{f}_{A} whose decoded texture matches with the groundtruth. Alternatively, we can minimize the reconstruction error in the image space, through the rendering layer with the groundtruth S\mathbf{S} and m\mathbf{m}. Empirically, two methods give similar performances but we choose the first option as it involves only one warping step, instead of doing rendering in every optimization iteration. For the linear model, we use albedo bases of Basel Face Model (BFM) . As in Fig. 13, our nonlinear texture is closer to the groundtruth than the linear model. This is expected since the linear model is trained with controlled images. Quantitatively, our nonlinear model has significantly lower averaged L1L_{1} reconstruction error than the linear model (0.0530.053 vs. 0.0620.062).

3D Shape. We also compare the power of nonlinear and linear 33DMMs in representing real-world 33D scans. We compare with BFM , the most commonly used 33DMM at present. We use ten 33D face scans provided by , which are not included in the training set of BFM. As these face meshes are already registered using the same triangle definition with BFM, no registration is necessary. Given the groundtruth shape, by using gradient descent, we can estimate a shape parameter whose decoded shape matches the groundtruth. We define matching criterion on both vertex distances and surface normal direction. This empirically improves fidelity of final results compared to only optimizing vertex distances. Fig. 14 shows the visual quality of two models’ reconstruction. Our reconstructions closely match the face shapes details. To quantify the difference, we use NME, averaged per-vertex errors between the recovered and groundtruth shapes, normalized by inter-ocular distances. Our nonlinear model has a significantly smaller reconstruction error than the linear model, 0.01460.0146 vs. 0.02410.0241 (Tab. III).

Besides, to evaluate our model power to represent different facial expressions, we make a similar comparison on 3D scans with different expression from BU-3DFE dataset . Here we compare with Facewarehouse bilinear model , which is directly learn from 33D scans with various facial expressions. Due to the difference in mesh topology, here we try to optimize the Chamfer distance between the ground-truth shape and our estimation. Fig. 15 show qualitatively comparisons on scans with different expressions. Our model has comparable performance on capturing the facial expression, while being better on resembling facial details. This is reflected on the averaged Chamfer distance of all 25002500 scans in the dataset (0.000830.00083 v.s 0.001970.00197 for our model and FaceWarehouse model respectively).

4 Applications

Having shown the capability of our nonlinear 33DMM (i.e., two decoders), now we demonstrate the applications of our entire network, which has the additional encoder. Many applications of 33DMM are centered on its ability to fit to 22D face images. Similar to linear 33DMM, our nonlinear 33DMM can be utilized for model fitting, which decomposes a 22D face into its shape, albedo and lighting. Fig. 16 visualizes our 33DMM fitting results on AFLW2000 and CelebA dataset. Our encoder estimates the shape S\mathbf{S}, albedo A\mathbf{A} as well as lighting L\mathbf{L} and projection parameter m\mathbf{m}. We can recover personal facial characteristic in both shape and albedo. Our albedo can present facial hair, which is normally hard to be recovered by linear 33DMM.

Face alignment is a critical step for many facial analysis tasks such as face recognition . With enhancement in the modeling, we hope to improve this task (Fig. 17). We compare face alignment performance with state-of-the-art methods, 33DDFA , DeFA , 33D-FAN and PRN , on AFLW2000 dataset on both 33D and 33D settings.

The accuracy is evaluated using Normalized Mean Error (NME) as the evaluation metric with bounding box size as the normalization factor . For fair comparison with these methods in term of computational complexity, for this comparison we use ResNet18 as our encoder. Here, 33DDFA and DeFA use the linear 33DMM model (BFM). Even though being trained with larger training corpus (DeFA) or having a cascade of CNNs iteratively refines the estimation (33DDFA), these methods are still significantly outperformed by our nonlinear model (Fig. 18). Meanwhile, 33D-FAN and PRN achieve competitive performances by by-passing the linear 33DMM model. 33D-FAN uses the heat map representation. PRN uses the position map representation which shares a similar spirit to our UV representation. Not only outperforms these methods in term of regressing landmark locations (Fig. 18), our model also directly provides head pose as well as the facial albedo and environment lighting information.

4.2 3D Face Reconstruction

We compare our approach to recent representative face reconstruction work: 33DMM fitting networks learned in unsupervised (Tewari et al. ) or supervised fashion (Sela et al. ) and also a non-33DMM approach (Jackson et al. ).

MoFA, the monocular reconstruction work by Tewari et al. , is relevant to us as they also learn to fit 33DMM in an unsupervised fashion. Even being trained on in-the-wild images, their method is still limited to the linear bases. Hence there reconstructions suffer the surface shrinkage when dealing with challenging texture, i.e., facial hair (Fig. 19). Our network faithfully models these in-the-wild texture, which leads to better 33D shape reconstruction.

Concurrently, Tewari et al. try to improve the linear 33DMM representation power by learning a corrective space on top of a traditional linear model. Despite sharing similar spirit, our unified model exploits spatial relation between neighbor vertices and uses CNNs as shape/albedo decoders, which is more efficient than MLPs. As a result, our reconstructions more closely match the input images in both texture and shape (Fig. 20).

The high-quality 33D reconstruction work by Richardson et al., Sela et al. obtain impressive results on adding fine-level details to the face shape when images are within the span of the used synthetic training corpus or the employed 33DMM model. However, their performance significantly degrades when dealing with variations not in its training data span, e.g., facial hair. Our approach is not only robust to facial hair and make-up, but also automatically learns to reconstruct such variations based on the jointly learned model. We provide comparisons with them in Fig. 21, using the code provided by the author.

The current state-of-art method by Sela et al. consisting of three steps: an image-to-image network estimating a depth map and a correspondence map, non-rigid registration and a fine detail reconstruction. Their image-to-image network is trained on synthetic data generated by the linear model. Besides domain gap between synthetic and real images, this network faces a more serious problem of lacking facial hair in the low-dimension texture subspace of the linear model. This network’s output tends to ignore these unexplainable region (Fig. 21), which leads to failure in later steps. Our network is more robust in handing these in-the-wild variations. Furthermore, our approach is orthogonal to Sela et al. ’s fine detail reconstruction module or Richardson et al.’s finenet. Employing these refinement on top of our fitting could lead to promising further improvement.

We also compare our approach with a non-33DMM apporach VRN by Jackson et al. . To avoid using low-dimension subspace of the linear 33DMM, it directly regresses a 33D shape volumetric representation via an encoder-decoder network with skip connection. This potentially helps the network to explore a larger solution space than the linear model, however with a cost of losing correspondence between facial meshes. Fig. 22 shows 33D reconstruction visual comparison between VRN and ours. In general, VRN robustly handles in-the-wild texture variations. However, because of the volumetric shape representation, the surface is not smooth and is partially limited to present medium-level details as ours. Also, our model further provides projection matrix, lighting and albedo, which is applicable for more applications.

To quantitatively compare our method with prior works, we evaluate monocular 33D reconstruction performance on FaceWarehouse and Florence dataset , in which groundtruth 3D shape is available. Due to the diffrence in mesh topology, ICP is used to establish correspondence between estimated shapes and ground truth point clouds. Similar to previous experiments, NME (averaged per-vertex errors normalized by inter-ocular distances) is used as the comparison metric.

FaceWarehouse. We compare our method with prior works with available pretrained models on all 1919 expressions of 150150 subjects of FaceWarehouse database . Visual and quantitative comparisons are shown in Fig. 23. Our model can faithfully resemble the input expression and significantly surpass all other regression methods (PRN and 3DDFA+ ) in term of dense face alignment.

Florence. Using the experimental setting proposed in , we also quantitatively compared our approach with state-of-the-art methods (e.g.VRN and PRN ) on the Florence dataset . Each subject is rendered with multiple poses: pitch rotations of −15∘-15^{\circ}, 20∘20^{\circ} and 25∘25^{\circ} and raw rotations between −80∘-80^{\circ} and 80∘80^{\circ}. Our model consistently outperforms other methods across different view angles (Fig. 24).

4.3 Face editing

Decomposing face image into individual components give us ability to edit the face by manipulating any component. Here we show two examples of face editing using our model.

Relighting. First we show an application to replacing the lighting of a target face image using lighting from a source face (Fig. 25). After estimating the lighting parameters Lsource\mathbf{L}_{\text{source}} of the source image, we render the transfer shading using the target shape Starget\mathbf{S}_{\text{target}} and the source lighting Lsource\mathbf{L}_{\text{source}}. This transfer shading can be used to replace the original source shading. Alternatively, value of Lsource\mathbf{L}_{\text{source}} can be arbitrarily chosen based on the SH lighting model, without the need of source images. Also, here we use the original texture instead of the output of our decoder to maintain image details.

Attribute Manipulation. Given faces fitted by 33DMM model, we can edit images by naive modifying one or more elements in the albedo or shape representation. More interestingly, we can even manipulate the semantic attribute, such as growing beard, smiling, etc. The approach is similar to learning attribute embedding in Sec. 4.2. Assuming, we would like to edit appearance only. For a given attribute, e.g., beard, we feed two sets of images with and without that attribute {Iip}i=1n\{\mathbf{I}^{p}_{i}\}_{i=1}^{n} and {Iin}i=1n\{\mathbf{I}^{n}_{i}\}_{i=1}^{n} into our encoder to obtain two average parameters fAp\mathbf{f}_{A}^{p} and fAn\mathbf{f}_{A}^{n}. Their difference ΔfA=fAp−fAn\mathbf{\Delta f}_{A}=\mathbf{f}_{A}^{p}-\mathbf{f}_{A}^{n} is the direction to move from the distribution of negative images to positive ones. By adding ΔfA\mathbf{\Delta f}_{A} with different magnitudes, we can generate modified images with different degree of changes. To achieve high-quality editing with identity-preserved, the final editing result is obtained by adding the residual, the different between the modified image and our reconstruction, to the original input image. This is a critical difference to Shu et al. to improve results quality (Fig. 26).

Conclusions

Since its debut in 1999, 33DMM has became a cornerstone of facial analysis research with applications to many problems. Despite its impact, it has drawbacks in requiring training data of 33D scans, learning from controlled 22D images, and limited representation power due to linear bases for both shape and texture. These drawbacks could be formidable when fitting 33DMM to unconstrained faces, or learning 33DMM for generic objects such as shoes. This paper demonstrates that there exists an alternative approach to 33DMM learning, where a nonlinear 33DMM can be learned from a large set of in-the-wild face images without collecting 33D face scans. Further, the model fitting algorithm can be learnt jointly with 33DMM, in an end-to-end fashion.

Our experiments cover a diverse aspects of our learnt model, some of which might need the subjective judgment of the readers. We hope that both the judgment and quantitative results could be viewed under the context that, unlike linear 33DMM, no genuine 33D scans are used in our learning. Finally, we believe that unsupervisedly or weak-supervisedly learning 33D models from large-scale in-the-wild 22D images is one promising research direction. This work is one step along this direction.

References