Generative Adversarial Networks (GANs) have realized great success in synthesizing photo-realistic images, given a set of latent codes. Despite the rapid boost in image quality, the interpretability of the generation process has become another major area of research. In general, interpretability requires latent codes to encode disentangled semantic information of the image. Further, ideally, well-disentangled semantics are supposed to be factorized to practically interpretable components and each component should be linear-encoded in the latent space as representation.
StyleGAN is a GAN for producing an unlimited number of (often convincing) portraits of fake human faces. The StyleGAN architecture provides an intermediate latent space to support the disentanglement property for face generation. Consequently, facial semantics are linear-encoded as latent representations.
Based on StyleGAN, sampling along a linear-encoded representation vector in latent space will change the associated facial semantic accordingly. This makes it possible to manipulate face generations to meet a target requirement. However, mapping particular facial semantics to a latent representation vector relies on training offline classifiers with manually labeled datasets. Thus, they require artificially defined semantics and provide the associated labels for all facial images. The disadvantages for training with labeled facial semantics include: (1) extra effort demanded on human annotations for each new attributes proposed; (2) each semantics is defined artificially, and the scope of semantics is limited to the linear combination of such definitions; and (3) by only training on each of the labeled semantics independently, insights on the connections among different semantics are unavailable.
Disclosed herein is a system and method for manipulating linear-encoded facial semantics from facial images generated by StyleGAN without external supervision. The method derives from linear regression and sparse representation learning concepts to make the manipulated latent representations easily interpreted. The method starts by coupling StyleGAN with a stabilized 3D deformable facial reconstruction method to decompose single-view GAN generations into multiple semantics. Latent representations are then extracted to capture interpretable facial semantics.
The disclosed invention provides an unsupervised method to minimize the demand for human annotation. A novel unsupervised framework is specified to disentangle and manipulate facial semantics under the StyleGAN environment, while still maintaining the interpretability for semantics as in labeled datasets.
The disclosed framework uses decorrelation regularization on StyleGAN to further enhance disentanglement for the latent representations. In addition, mutual reconstruction is introduced to stabilize training of an unsupervised 3D deformable face reconstruction method, such that it serves as an initial facial semantic extractor.
For univariate semantics (e.g., yaw angle, pose, lighting) a linear regression method to capture perturbations from latent space is disclosed. For pixel-level semantics (e.g., shape and texture), a localized representation learning algorithm is disclosed to capture sparse semantic perturbations from latent space.
All methods disclosed herein are based on a label-free training strategy. Only StyleGAN is trained with an in-the-wild face dataset. Therefore, a significant amount of human involvement in facial representation learning is not needed.
The goal of the facial representation disentanglement method disclosed herein is to capture linear-encoded facial semantics. With a given collection of coarsely aligned faces, a Generative Adversarial Network (GAN) is trained to mimic the overall distribution of the data. To better learn linear-encoded facial semantics, StyleGAN is re-implemented and trained. Further, the method improves the capability of the latent space trained by StyleGAN to disentangle by adding a decorrelation regularization. After training a StyleGAN model, the faces it generates are used as training data to train a 3D deformable face reconstruction method. A mutual reconstruction strategy stabilizes the training significantly. Then, a record is kept of the latent code from StyleGAN and linear regression is applied to disentangle the target semantics in the latent space.
Taking the reconstruction of the yaw angle as an example, the latent representation is manipulated as a data augmentation for training. Finally, a localized representation learning method to disentangle canonical semantics is disclosed.
By way of example, a specific exemplary embodiment of the disclosed system and method will now be described, with reference to the accompanying drawings, in which:
Decorrelating Latent Code in StyleGAN—In StyleGAN design, a latent code z∈d×1 is randomly generated from random noise, for example a Gaussian distribution. Then, a mapping network takes z as input and outputs a latent code w∈d×1. Space is proven to facilitate the learning of more disentangled representations. The disentangled representation can be further enhanced by decorrelating latent codes in . A more decorrelated latent space enforces more independent dimensions to encode information, and therefore encourages disentanglement in representations. To maximize the utilization of all dimensions in , all Pearson correlation coefficients pij should be zero and the variance of all dimensions Var[wi] should be the same value, where i, j are the subscripts of dimensions in space.
Therefore, decorrelation regularization is introduced via a loss function:
The overall objective for the GAN with decorrelation regularization follows:
Here the mapping network is the only one to update with the new loss, decorr.
Stabilized Training for 3D Face Reconstruction—An unsupervised 3D deformable face reconstruction method takes a roughly aligned face image and decomposes the faces into multiple semantics (e.g., view, lighting, albedo, and depth (yv,yl,ya and yd. respectively). During training, it uses these decomposed semantics to reconstruct the original input image I with the reconstruction loss:
recon=(I)|I−Î| (3)
This method is used to pre-decompose some external facial semantics (e.g., pose and lighting), from StyleGAN generations.
However, the 3D face reconstruction algorithm struggles to estimate the pose of profile or near-profile faces. Even worse, if the dataset contains a decent number of profile and near-profile faces (e.g., CASIA WebFace), the 3D reconstruction fails to learn physically sounded semantics, as shown in
To address this problem, a mutual reconstruction strategy is disclosed and is and is illustrated in
recon=(I,I′)|I−Î′| (4)
The overall loss to reconstruct each image then becomes:
(1−ϵ)recon+ϵrecon (5)
As a result, the shape and texture of faces with deviated facial semantics can be robustly estimated. Moreover, because images are now reconstructed from two images, the confidence map in the original work should be yielded by these two images accordingly. The two images are simply concatenated channel-wise as input to the confidence network, where the top image provides environmental semantics and the bottom image provides texture and shape information.
Disentangle Semantics with Linear Regression—With the 3D face reconstruction algorithm, face images generated by StyleGAN are decomposed to pose, lighting, depth, and albedo. The ultimate goal of disentangling semantics is to find a vector v∈ in StyleGAN, such that it only takes control of the target semantics.
Semantic Gradient Estimation—Consider a semantics y of a generated face image (w) that can be measured by a function ƒ(⋅). The linear approximation of the gradient ∇y with respect to the latent code w satisfies:
ƒ((w1))≈ƒ((w0))+∇y(w0)(w1−w0) (6)
Note that in general, the gradient at location w0, ∇y(w0), is a function of latent code w0. However, with StyleGAN, it is observed that many semantics can be linear-encoded in the disentangled latent space . It can therefore be assumed that all of the semantics can be linear-encoded. In other words, the gradient is now independent of the input latent code w0. This yields:
ƒ((w1))≈ƒ((w0))+∇y(w1−w0)
simplified as:
Δy≈∇yΔw (7)
Semantic Linear Regression—It is now obvious that in the ideal case, the target vector v=∇y. While in a real world scenario, the gradient ∇y is hard to estimate directly because back-propagation only captures local gradient, making it less robust to noises. Therefore, a linear regression model to capture global linearity for gradient estimation is disclosed. N pairs of (w1, w0) are randomly sampled. Images are generated with StyleGAN and their semantics are estimated. Finally, all samples of differences are concatenated, denoted as ΔY∈N×1 for semantics and ΔW∈N×d for latent codes. The objective is to minimize:
There exists a closed-form solution when N>d:
v=(ΔWΔW)−1ΔWΔY (9)
Image Manipulation for Data Augmentation—One useful application for guided image manipulation is to perform data augmentation. Data augmentation has proven to be efficient when dealing with unbalanced data during training. One related problem within an unsupervised framework is the inaccurate estimation of extreme yaw angle. This problem worsens when dealing with generations from CASIA StyleGAN because it contains a large number of facial images, only a small portion of which are profile faces (i.e., an unbalanced yaw distribution).
Disclosed herein is a data augmentation strategy based on self-supervised facial image manipulation. The end goal is to help the 3D face reconstruction network estimate the extreme yaw angle accurately. With the linear regression method previously discussed, manipulation vectors v for univariate semantics, including the yaw angle, denoted as vyaw, can be learned. Recall that extrapolating along v beyond its standard deviation, yields samples with more extreme values for the associated semantics. Particularly, images with an extreme yaw angle can be generated to neutralize the unbalanced yaw distribution and train the 3D face reconstruction algorithm. Therefore, by seeing more profile faces deliberately, the system can better estimate extreme yaw angles.
The data augmentation strategy is performed alongside the training of 3D face reconstruction. To be specific, v is estimated and updated with a historical moving average (e.g., momentum=0.995) every 10 iterations. Then, augmentation is achieved by extrapolating a latent vector wi(s) via:
wi(s)=wi−wivv+s·σwv (10)
In this case v=vyaw. Finally, the 3D face reconstruction method is trained with the augmented generations (wi(s)).
Localized Representation Learning—In the case where ƒ(⋅) returns canonical outputs (i.e., depth and albedo maps), the outputs consist of pixels in spatial dimensions wherein the pixel values are highly correlated as the latent code changes. However, every pixel-level gradient estimation (i.e., v from Eq. (9) is independently calculated and is thus extremely redundant. To address this problem, the goal for canonical semantics is re-formulated to find the manipulation vectors I that capture interpretable combinations of pixel value variations. Define a Jacobian matrix Jv∈S×d, which is the concatenation of all canonical pixel-level v. Here, S is the overall number of spatial and RGB dimensions of a given depth and albedo map.
One trivial definition of {circumflex over (v)} is that it maximizes ∥Jv*{circumflex over (v)}∥22. Ideally, a disentangled representation to manipulate interpretable facial semantics is expected. That is, interpolation along {circumflex over (v)} should result in a significant but localized (i.e., sparse) change across the image domain (e.g., some {circumflex over (v)} only control eye variations while some only control mouth variations, etc.). However, ∥Jv*{circumflex over (v)}∥22 captures the global pixel value perturbation. Thus, the localized canonical representation learning is derived by solving:
Each column in U=[u1, . . . , up]∈S×P is a sparse component of the canonical albedo and depth perturbation and {circumflex over (V)}=[{circumflex over (v)}1, . . . , {circumflex over (v)}P]∈d×P consists of the associated latent representation in space. α and β are tuning parameters to control the trade-off among the reconstruction accuracy of Jv*, sparsity of perturbation in semantics and orthogonality of associated latent representations.
Once a facial image 406 has been generated by generator 404, semantic extractor 408 then extracts semantic features from the facial image. Semantic extractor 408 may be a network trained to extract specific semantic features from the facial image. For example, the semantic extractor 408 shown in the exemplary embodiment of
Various semantic features 410 may be manipulated without changing the identity of the facial image. For example, semantic features representing pose and lighting can be manipulated and the identity of the facial image will not change. For identity-invariant features 412, for example, pose and lighting, the features may be extracted using a linear regression model.
Other semantic features 412 may be manipulated only to a certain extent before they become identity-variant. That is, if these features are changed too much, then the facial image 406 assumes a new identity. Such features 412 may be extracted via a localized semantics learning method. In the end, a vector of a certain length (which may be, in some embodiments, 512) for each independent semantic is acquired. By sampling along the acquired vectors, the associated semantic changes accordingly.
The overall design of the disclosed system can be sued for photo manipulation with a target demand. This is particularly useful in data augmentation for tasks that require a large number of training data but wherein only a limited number of training samples are available. The code-to-image generator to image-to-code-to-image generator can also be replaced, such that the generated images are identical to the input image. Additionally, the method may be used for image editing wherein the disentangled semantics are used to perform directed editing demands to modify the image.
An unsupervised learning framework for disentangling linear-encoded facial semantics from facial images generated by StyleGAN has been disclosed herein. The system can robustly decompose facial semantics from any single view GAN generation and disentangle facial semantics. Additionally, a method to perform guided data augmentation to counteract the problem brought by unbalanced data is disclosed.
As would be realized by one of skill in the art, the disclosed method described herein can be implemented by a system comprising a processor and memory, storing software that, when executed by the processor, performs the functions comprising the method.
As would further be realized by one of skill in the art, many variations on implementations discussed herein which fall within the scope of the invention are possible. Moreover, it is to be understood that the features of the various embodiments described herein were not mutually exclusive and can exist in various combinations and permutations, even if such combinations or permutations were not made express herein, without departing from the spirit and scope of the invention. Accordingly, the method and apparatus disclosed herein are not to be taken as limitations on the invention but as an illustration thereof. The scope of the invention is defined by the claims which follow.
This application claims the benefit of U.S. Provisional Patent Application No. 63/149,375, filed Feb. 15, 2021, the contents of which are incorporated herein in their entirety.
Filing Document | Filing Date | Country | Kind |
---|---|---|---|
PCT/US2022/015797 | 2/9/2022 | WO |
Publishing Document | Publishing Date | Country | Kind |
---|---|---|---|
WO2022/173814 | 8/18/2022 | WO | A |
Number | Name | Date | Kind |
---|---|---|---|
11250245 | Todorov | Feb 2022 | B2 |
20180365874 | Hadap | Dec 2018 | A1 |
20190295302 | Fu | Sep 2019 | A1 |
20200184660 | Shi | Jun 2020 | A1 |
20210150369 | Karras | May 2021 | A1 |
20210398335 | Hu | Dec 2021 | A1 |
20220028139 | Mitra | Jan 2022 | A1 |
20220138897 | Singh | May 2022 | A1 |
20240146963 | Chen | May 2024 | A1 |
Number | Date | Country |
---|---|---|
WO-2020091891 | May 2020 | WO |
WO-2021178936 | Sep 2021 | WO |
Entry |
---|
Heinrich (here is referred as Heinrich-2), Apr. 24, 2017, Photo Editing with Generative Adversarial Networks (Part 2) (pp. 1-30) (Year: 2017). |
Heinrich (here is referred as Heinrich-1), Apr. 20, 2017, Photo Editing with Generative Adversarial Networks (Part 1) (pp. 1-19) (Year: 2017). |
Karras et al., 2019, “A Style-Based Generator Architecture for Generative adversarial Networks” (pp. 1-12). (Year: 2019). |
Abdal et al., 2020, “Image2StyleGAN++: How to Edit the Embedded Images?” (pp. 8296-8305) (Year: 2020). |
Collins et al., 2020, “Editing in Style: Uncovering the Local Semantics of GANs” (pp. 5771-5780) (Year: 2020). |
Papastraits, 2020, “Deepfakes: Face synthesis with GANs and Autoencoders” (pp. 1-10) (Year: 2020). |
Zhu et al., 2020, “In-Domain Gan Inversion for Real Image Editing” (pp. 592-608). (Year: 2020). |
International Search Report and Written Opinion for the International Application No. PCT/US22/15797, mailed May 23, 2022, 7 pages. |
Number | Date | Country | |
---|---|---|---|
20240062441 A1 | Feb 2024 | US |
Number | Date | Country | |
---|---|---|---|
63149375 | Feb 2021 | US |