Facial texture model training method and device and facial texture generation method and device

By obtaining the face image and its texture data set, extracting and encoding texture features, using conditional embedding vectors to denoise the noisy texture image, and optimizing the texture generation model, the problems of low face texture generation efficiency and lack of realism in the existing technology are solved. problem, achieving high-quality texture reconstruction.

CN118710797APending Publication Date: 2024-09-27BEIHANG UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410650375.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-05-24
Publication Date
2024-09-27

AI Technical Summary

Technical Problem

The existing technology has low efficiency and insufficient realism in facial texture generation, resulting in insufficient quality of texture generation.

Method used

By obtaining a data set of face images and their corresponding textures, the texture features are extracted and encoded into conditional embedding vectors. These vectors are used to denoise the noise texture images, and a target denoised texture image that is highly corresponding to the real texture is generated. Compare the differences between noisy and denoised texture images to optimize the model and improve the authenticity and accuracy of texture generation.

Benefits of technology

The performance of the facial texture model is significantly improved, making the generated texture images more realistic, accurate and controllable, solving the problems of efficiency and realism.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118710797A
    Figure CN118710797A
Patent Text Reader

Abstract

The invention provides a facial texture model training method and device and a facial texture generation method and device. The method comprises the steps of obtaining a to-be-trained data set, wherein the to-be-trained data set comprises a face image and a face texture image corresponding to the face image; according to the to-be-trained data set, determining a noise texture image latent variable corresponding to the facial texture image; performing texture feature extraction on the face image to obtain a target texture feature and a condition embedding vector; performing denoising processing on the noise texture image latent variable according to the condition embedding vector and a preset time step condition to obtain a target denoising texture image latent variable corresponding to the preset time step condition; and training the to-be-trained model according to the noise texture image latent variable and the target de-noised texture image latent variable to obtain a target model. According to the method provided by the invention, the performance of the facial texture model can be remarkably improved, and a more real, accurate and controllable facial texture image can be generated.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of computer vision and graphics processing, and in particular to a facial texture model training method, a facial texture generation method and a device. Background Art

[0002] With the rapid development of virtual reality, augmented reality and film production technology, face digitization technology plays an increasingly important role in these fields. However, the urgent problem to be solved in face digitization technology is how to reconstruct the three-dimensional shape and texture of the face from a single field image.

[0003] In the prior art, machine learning models are often used to generate textures corresponding to face images. For example, the FFHQ-UV facial UV texture dataset uses the network structure of StyleGAN2 to train a texture decoder based on the Generative Adversarial Nets (GAN). This texture decoder can generate texture images by sampling from noise. When a face image is input, if you want to obtain a target texture image with the face image as a constraint, you need to iteratively train the texture decoder through three stages: linear 3D deformable model initialization, texture latent code optimization, and joint parameter optimization, so as to determine the target texture image.

[0004] However, existing methods have the problems of low generation efficiency and weak realism of facial texture generation when generating texture images. Summary of the invention

[0005] The embodiments of the present application provide a facial texture model training method, a facial texture generation method and a device, so as to solve the problems of low generation efficiency and weak realism of facial texture generation when the existing methods generate texture images.

[0006] In a first aspect, an embodiment of the present application provides a facial texture model training method, comprising:

[0007] Acquire a data set to be trained, the data set to be trained including a face image and a facial texture image corresponding to the face image;

[0008] Determine a noise texture image latent variable corresponding to the facial texture image according to the data set to be trained;

[0009] Extracting texture features of the face image to obtain target texture features and a conditional embedding vector, wherein the conditional embedding vector is obtained by encoding the target texture features;

[0010] According to the conditional embedding vector and the preset time step condition, the noise texture image latent variable is denoised to obtain the target denoised texture image latent variable corresponding to the preset time step condition, wherein the preset time step condition represents the number of time steps for adjusting the noise during the denoising process and the time step length corresponding to each time step;

[0011] According to the latent variables of the noise texture image and the latent variables of the target denoised texture image, the model to be trained is trained to obtain the target model.

[0012] In an embodiment of the present application, obtaining a data set to be trained includes:

[0013] Acquire a face image, where the face image is obtained by performing image feature mapping on the noise vector;

[0014] Perform perspective feature analysis on the face image to obtain a multi-perspective face image;

[0015] Performing texture prediction processing on multi-view facial images to obtain predicted texture images;

[0016] According to the multi-view facial image and the preset UV mapping relationship, the front face area and the side face area of ​​the multi-view facial image are mapped to the UV space to obtain a multi-view incomplete texture image;

[0017] According to the predicted texture image, the multi-view incomplete texture image and the preset facial feature image are linearly fused to obtain the facial texture image;

[0018] According to the face image and the facial texture image, a data set to be trained is obtained.

[0019] In the embodiment of the present application, the facial image is subjected to perspective feature analysis to obtain a multi-perspective facial image, including:

[0020] Perform posture detection and image screening on face images to obtain frontal face images and unobstructed face images;

[0021] Editing the latent vector information of the frontal face image and the latent vector information of the unobstructed face image to obtain an initial multi-view facial image;

[0022] The initial multi-view facial image is de-haired to obtain a multi-view facial image.

[0023] In an embodiment of the present application, after obtaining the data set to be trained, the method further includes:

[0024] According to the data set to be trained, the facial texture image is encoded to obtain the facial texture image latent variable;

[0025] Decoding the latent variables of the facial texture image to obtain a facial texture prediction image;

[0026] Determine a first loss function of an initial encoding / decoding network in a model to be trained according to the facial texture image and the facial texture prediction image;

[0027] According to the first loss function, the initial encoding and decoding network in the model to be trained is trained to obtain the target model to be trained, so that the target model to be trained determines the noise texture image latent variable corresponding to the facial texture image according to the data set to be trained.

[0028] In an embodiment of the present application, determining a noise texture image latent variable corresponding to a facial texture image according to a dataset to be trained includes:

[0029] Encode the facial texture image of the training data set to obtain a compressed facial texture image latent variable;

[0030] The compressed facial texture image latent variable is subjected to noise processing to obtain the noisy texture image latent variable corresponding to the facial texture image.

[0031] In the embodiment of the present application, according to the conditional embedding vector and the preset time step condition, the noise texture image latent variable is denoised to obtain the target denoised texture image latent variable corresponding to the preset time step condition, including:

[0032] According to the conditional embedding vector and the preset time step condition, the noise texture image latent variable is subjected to the first denoising process in the cross attention process, so that the noise texture image latent variable is denoised according to the guidance direction of the conditional embedding vector, and an initial denoised texture image latent variable is obtained;

[0033] According to the conditional embedding vector and the preset time step condition, the initial denoised texture image latent variable is subjected to the second denoising process in the cross attention process, so that the initial denoised texture image latent variable is denoised according to the guidance direction of the conditional embedding vector, and the target denoised texture image latent variable is obtained.

[0034] In the embodiment of the present application, the to-be-trained model is trained according to the noise texture image latent variable and the target denoised texture image latent variable to obtain the target model, including:

[0035] Determine the second loss function of the initial noise processing network and the initial condition feature extraction network in the to-be-trained model according to the noise texture image latent variable and the target denoised texture image latent variable;

[0036] According to the second loss function, the initial noise processing network and the initial condition feature extraction network are trained to obtain the target noise processing network and the target condition feature extraction network;

[0037] According to the target noise processing network and the target condition feature extraction network, a target model is obtained.

[0038] In a second aspect, an embodiment of the present application provides a facial texture generation method, comprising:

[0039] Obtain a target face image for which texture is to be generated;

[0040] Inputting the target face image into the facial texture generation model to obtain an identity conditional embedding vector corresponding to the target face image, wherein the facial texture generation model is the target model of any one of the facial texture model training methods described above;

[0041] According to the identity condition embedding vector, the noise in the facial texture generation model is denoised to obtain the target face texture image latent variable;

[0042] The latent variables of the target face texture image are decoded to obtain a facial texture image corresponding to the target face image.

[0043] In a third aspect, an embodiment of the present application provides a facial texture model training device, comprising:

[0044] A first acquisition module is used to acquire a data set to be trained, where the data set to be trained includes a face image and a facial texture image corresponding to the face image;

[0045] A determination module, used for determining a noise texture image latent variable corresponding to the facial texture image according to the data set to be trained;

[0046] An extraction module is used to extract texture features from a face image to obtain target texture features and a conditional embedding vector, wherein the conditional embedding vector is obtained by encoding the target texture features;

[0047] The first obtaining module is used to perform denoising on the noise texture image latent variable according to the conditional embedding vector and the preset time step condition, and obtain the target denoised texture image latent variable corresponding to the preset time step condition, wherein the preset time step condition represents the number of time steps for adjusting the noise during the denoising process, and the time step length corresponding to each time step;

[0048] The training module trains the model to be trained according to the latent variables of the noise texture image and the latent variables of the target denoised texture image to obtain the target model.

[0049] In a fourth aspect, an embodiment of the present application provides a facial texture generating device, comprising:

[0050] The second acquisition module is used to acquire the target face image for which the texture is to be generated;

[0051] An input module, used to input a target face image into a facial texture generation model to obtain an identity conditional embedding vector corresponding to the target face image, wherein the facial texture generation model is a target model of any of the above facial texture model training methods;

[0052] The second obtaining module is used to denoise the noise in the facial texture generation model according to the identity condition embedding vector to obtain the target face texture image latent variable;

[0053] A generation module is used to decode the latent variables of the target face texture image to obtain a facial texture image corresponding to the target face image, wherein the facial texture generation model is the target model of any one of the above-mentioned facial texture model training methods.

[0054] In a fifth aspect, an embodiment of the present application provides an electronic device, including: a processor, and a memory communicatively connected to the processor;

[0055] Memory stores computer-executable instructions;

[0056] The processor executes the computer-executable instructions stored in the memory to implement the above first aspect and / or various possible implementations of the first aspect.

[0057] In a sixth aspect, an embodiment of the present application provides a computer-readable storage medium, in which computer-executable instructions are stored. When the computer-executable instructions are executed by a processor, they are used to implement the first aspect above and / or various possible implementations of the first aspect.

[0058] In a seventh aspect, an embodiment of the present application provides a computer program product, including a computer program, which, when executed by a processor, implements the above first aspect and / or various possible implementation methods of the first aspect.

[0059] The facial texture model training method, facial texture generation method and device provided by the present application obtain a data set to be trained, wherein the data set to be trained includes a face image and a facial texture image corresponding to the face image; according to the data set to be trained, a noise texture image latent variable corresponding to the facial texture image is determined; texture features of the face image are extracted to obtain target texture features and a conditional embedding vector, wherein the conditional embedding vector is obtained after encoding the target texture features; according to the conditional embedding vector and a preset time step condition, a noise texture image latent variable is denoised to obtain a target denoised texture image latent variable corresponding to the preset time step condition, wherein the preset time step condition represents the number of time steps for adjusting the noise during the denoising process, and the time steps corresponding to each time step. time step; according to the noise texture image latent variables and the target denoising texture image latent variables, the training model is trained to obtain the means of the target model, the texture features extracted from the face image are used to obtain the conditional embedding vector, and the noise image is denoised using the conditional embedding vector, so that the model can generate and edit texture according to specific conditions, thereby effectively recovering a facial texture prediction image that is highly similar to the original image from the noise, thereby achieving the purpose of high-fidelity facial texture reconstruction. At the same time, the noise texture image latent variables determined by the facial texture image and the target denoising texture image latent variables can enable the model to better understand the relationship between noise and texture, which can significantly improve the performance of the facial texture model and enable it to generate more realistic, accurate and controllable facial texture images. BRIEF DESCRIPTION OF THE DRAWINGS

[0060] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.

[0061] Figure 1 A flowchart of a facial texture model training method provided in an embodiment of the present application;

[0062] Figure 2 A schematic diagram of a facial texture generation method provided in an embodiment of the present application;

[0063] Figure 3 A flowchart of another facial texture model training method provided in an embodiment of the present application;

[0064] Figure 4 A schematic diagram of a process for producing a human face texture UV map dataset provided in an embodiment of the present application;

[0065] Figure 5 A schematic diagram of a specific process of another facial texture model training method provided in an embodiment of the present application;

[0066] Figure 6 A schematic diagram of the structure of a facial texture model training device provided in an embodiment of the present application;

[0067] Figure 7 A schematic diagram of the structure of a facial texture generating device provided in an embodiment of the present application;

[0068] Figure 8 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application.

[0069] The above drawings have shown clear embodiments of the present application, which will be described in more detail later. These drawings and text descriptions are not intended to limit the scope of the present application in any way, but to illustrate the concept of the present application to those skilled in the art by referring to specific embodiments. DETAILED DESCRIPTION

[0070] Exemplary embodiments will be described in detail herein, examples of which are shown in the accompanying drawings. When the following description refers to the drawings, the same numbers in different drawings represent the same or similar elements unless otherwise indicated. The implementations described in the following exemplary embodiments do not represent all implementations consistent with the present application. Instead, they are merely examples of devices and methods consistent with some aspects of the present application as detailed in the appended claims.

[0071] In the prior art, in order to improve the texture generation performance, FFHQ-UV uses the network structure of StyleGAN2 to train a GAN-based texture decoder. Texture UV map Depend on where z∈Z represents the potential code in Z space and G tex (·) represents the texture decoder. The goal of this method is to find a latent code z in the 3D face reconstruction process. * , which passes through the texture decoder G tex (·), generates the optimal texture UV map for the input image. Specifically, the FFHQ-UV generation process includes linear 3DMM initialization, texture latent code z The first stage uses the Deep3D trained by HiFi3D++ to initialize the reconstruction; the second stage fixes the parameters {p id ,p exp ,p pose ,p light}, minimize the following loss to find the latent code z∈Z; the third stage joint parameter optimization, in this stage, FFHQ-UV relaxes the hypersphere constraint on the latent code z (to obtain more expressive capacity) and jointly optimizes all parameters {z, p id ,pexp ,p pose ,p light However, the texture generated by the texture generator trained by this method is an unconstrained texture. Therefore, when generating the texture corresponding to a randomly input face image, the texture generator needs to be trained and iterated in three stages to achieve the limitation of a specific identity, so as to generate the texture corresponding to the face image. Since the texture generator needs to be iterated each time a face image is input to generate a texture image, the texture generation efficiency is not high. In addition, the texture generator is designed based on the GAN architecture, and has unstable training results and tends to generate smooth results, resulting in the loss of facial details and identity information in wild images.

[0072] In order to solve the above problems, the embodiment of the present application provides a facial texture model training method, a facial texture generation method and a device, which can use a training data set to learn the mapping relationship between a face image and a corresponding texture to achieve the generation of high-quality texture. First, by obtaining a data set containing a face image and its corresponding texture, the corresponding noise texture image latent variable is determined to provide a basis for learning and simulation for the model; then, the texture features of the face image are extracted and encoded into conditional embedding vectors, which contain the key information required for reconstructing the texture. These vectors are used as guiding conditions and preset time step conditions to train the model to denoise the noise texture image latent variable and generate a target denoised texture image latent variable that corresponds to the real texture height; finally, by comparing the difference between the noise texture image latent variable and the target denoised texture image latent variable, the model is trained to optimize its generation ability, so that the model generates more realistic and accurate facial texture images.

[0073] The technical solution of the present application and how the technical solution of the present application solves the above-mentioned technical problems are described in detail below with specific embodiments. The following specific embodiments can be combined with each other, and the same or similar concepts or processes may not be repeated in some embodiments. The embodiments of the present application will be described below in conjunction with the accompanying drawings.

[0074] The embodiment of the present application provides a facial texture model training method, and the execution subject of the method can be a server. Among them, the server can be a mobile phone, a computer, a tablet and other devices. The embodiment of the present application does not impose any special restrictions on the implementation method of the execution subject, as long as the execution subject can obtain a data set to be trained, and the data set to be trained includes a face image and a facial texture image corresponding to the face image; according to the data set to be trained, determine the noise texture image latent variable corresponding to the facial texture image; extract the texture feature of the face image to obtain the target texture feature and the conditional embedding vector, wherein the conditional embedding vector is obtained after encoding the target texture feature; according to the conditional embedding vector and the preset time step condition, denoise the noise texture image latent variable to obtain the target denoised texture image latent variable corresponding to the preset time step condition, and the preset time step condition represents the number of time steps for adjusting the noise during the denoising process, and the time step corresponding to each time step; according to the noise texture image latent variable and the target denoised texture image latent variable, train the model to be trained to obtain the target model.

[0075] Among them, facial texture image can refer to a two-dimensional texture image associated with UV mapping (UV Mapping) of a three-dimensional face model in three-dimensional modeling and computer graphics. UV mapping is a technology that flattens the surface of a three-dimensional model to a two-dimensional plane, so that each point (vertex) of the three-dimensional surface can find a corresponding UV coordinate on the two-dimensional plane. Among them, the UV coordinates are derived from the two dimensions U (Horizontal) and V (Vertical) in the two-dimensional texture coordinate system. For example, in a facial texture image, each part of the face (such as eyes, nose, mouth, etc.) will be mapped to a specific area of ​​the two-dimensional plane, and then the texture will be drawn or pasted on these two-dimensional planes. When the facial texture image is applied back to the three-dimensional model, these details will be accurately mapped to the corresponding positions of the face model, thereby presenting realistic facial features in three-dimensional space.

[0076] Figure 1 The flowchart of a facial texture model training method provided in the embodiment of the present application is shown in FIG. The execution subject of the method may be a server or other server storing the facial texture model training method, and this embodiment is not particularly limited here. Figure 1 As shown, the method may include:

[0077] S101. Obtain a data set to be trained, where the data set to be trained includes a face image and a facial texture image corresponding to the face image.

[0078] The data set to be trained may include multiple pairs of face images and facial texture images. For example, the data set to be trained includes 100,000 pairs of matched face images and facial texture images.

[0079] The face image may refer to a face image sampled from random noise and generated using StyleGAN2, which is a new, synthetic image. The facial texture image corresponding to the face image may be a face texture UV map obtained using the BFM (Blend shape Model) shape base technology. The BFM shape base is a technology used for 3D facial animation and modeling, which involves creating a series of predefined facial shapes or expressions that can be linearly combined to generate new expressions or facial movements.

[0080] Among them, StyleGAN2 is a generative adversarial network GAN that can generate high-quality, high-resolution face images.

[0081] In this embodiment of the present application, the method for obtaining the data set to be trained may include:

[0082] Acquire a face image, where the face image is obtained by performing image feature mapping on the noise vector;

[0083] Perform perspective feature analysis on the face image to obtain a multi-perspective face image;

[0084] Performing texture prediction processing on multi-view facial images to obtain predicted texture images;

[0085] According to the multi-view facial image and the preset UV mapping relationship, the front face area and the side face area of ​​the multi-view facial image are mapped to the UV space to obtain a multi-view incomplete texture image;

[0086] According to the predicted texture image, the multi-view incomplete texture image and the preset facial feature image are linearly fused to obtain the facial texture image;

[0087] According to the face image and the facial texture image, a data set to be trained is obtained.

[0088] Among them, the method for obtaining a face image can be to first randomly sample a noise vector, which is usually a tensor with a specific dimension, and its dimension matches the dimension of the latent space of the StyleGAN2 model. Then, this noise vector is input into the StyleGAN2 model. The StyleGAN2 model maps this noise vector to specific image features in the latent space through multiple layers and activation functions, thereby generating a face image.

[0089] Multi-view facial images can refer to facial images obtained from different angles, thereby increasing the diversity of the data set. The method for texture prediction processing of multi-view facial images is to use the Deep3D model to analyze the input multi-view facial images and estimate the 3D geometric shape of the face. The Deep3D model then assigns a color value to each vertex of the 3D face model. These color values ​​together form a linear texture, i.e., a predicted texture image, which can be used as a filling template for linear fusion. Among them, the Deep3D model is a well-trained deep learning model that is specifically used to predict the shape and texture of a 3D face from a 2D image. The linear texture is a preliminary estimate of the face surface and contains basic color and texture information.

[0090] The method of mapping the frontal face region and the side face region of the multi-view facial image to the UV space may include: first, using the Deep3D model to predict the face geometric vertices and using the BiSeNet model to predict the face visible region; then, combining the predicted face geometric vertices and the face visible region, extracting the high-confidence face regions of the front and side from the multi-view facial image, these face regions provide the main features and shape information of the face; finally, using the predefined UV mapping relationship, projecting the extracted high-confidence face regions of the front and side to the UV space, thereby generating an incomplete texture image for each view, these textures contain the key features of the face, but may be incomplete because they only cover a part of the face. The predefined UV mapping relationship may be a process of mapping the vertices of a 3D model to a 2D texture image, in which each 3D vertex has a corresponding 2D coordinate, which allows the surface of the 3D model to be unfolded onto a plane to form a UV map.

[0091] The preset facial feature image may refer to a predefined facial mask, and multiple facial masks may be preset, for example, a connect mask and a multi-view facial mask. The facial mask may help identify and isolate the facial part in the image, thereby improving the accuracy and efficiency of recognition.

[0092] The predicted texture image is used as the base template, and then the multi-view incomplete texture image is aligned and fused with this template. Alignment is done by ensuring that each texture is mapped to the correct UV coordinates. The fusion process can use linear blending or other fusion techniques to determine the fusion weight of each area based on the preset facial feature image.

[0093] Since the face images used to prepare the training data set are synthetic images, the method for obtaining the training data set can achieve low-cost, large-scale batch production of the data set, overcoming the problems of small scale and high acquisition cost of existing data sets.

[0094] Among them, in the embodiment of the present application, the method of performing perspective feature analysis on the face image to obtain the multi-perspective face image may include:

[0095] Perform posture detection and image screening on face images to obtain frontal face images and unobstructed face images;

[0096] Editing the latent vector information of the frontal face image and the latent vector information of the unobstructed face image to obtain an initial multi-view facial image;

[0097] The initial multi-view facial image is de-haired to obtain a multi-view facial image.

[0098] Among them, the Deep3D model is used to detect the posture coefficient of the face, and the BiSeNet model is used to extract the proportion of the visible area of ​​the face. Through these models, the frontal and unobstructed (such as without glasses and other obstructions) face images are screened out from the generated face images.

[0099] The filtered images can be used to adjust the codes in the StyleGAN2 latent space through the parameters in the InterfaceGAN network to generate initial multi-view facial images.

[0100] Hair removal processing may refer to hair removal processing using a HairMapper network model. The HairMapper network model is a deep learning model specifically designed to remove hair from facial images and generate clean faces. Specifically, the HairMapper network model identifies hair areas in facial images, and then segments and removes the hair areas.

[0101] In this embodiment of the present application, after obtaining the data set to be trained, the method may further include:

[0102] According to the data set to be trained, the facial texture image is encoded to obtain the facial texture image latent variable;

[0103] Decoding the latent variables of the facial texture image to obtain a facial texture prediction image;

[0104] Determine a first loss function of an initial encoding / decoding network in a model to be trained according to the facial texture image and the facial texture prediction image;

[0105] According to the first loss function, the initial encoding and decoding network in the model to be trained is trained to obtain the target model to be trained, so that the target model to be trained determines the noise texture image latent variable corresponding to the facial texture image according to the data set to be trained.

[0106] The encoding and decoding network may be a network including an encoder and a decoder, which exists in the pixel space model of the model to be trained, and the pixel space model may be an encoding and decoding model using a VAE structure. In this model, the input image data, such as the input facial texture image, is first encoded into a low-dimensional representation by the encoder; then, the low-dimensional representation is decoded back to the original space, that is, the original dimensional representation, by the decoder, thereby realizing the reconstruction of the input image data. For example, the facial texture image is compressed by the encoder and mapped to the distribution parameters of the latent space. At this time, the encoding and decoding network converts the input data of the facial texture image into the mean and variance of the latent variable, and then the latent variable is mapped back to the data space by the encoding and decoding network, that is, the encoder realizes the compression of the facial texture image into the facial texture latent variable, and the decoder realizes the restoration of the facial texture latent variable to the facial texture, thereby compressing the facial texture image in the pixel space into the low-dimensional latent space, so that the subsequent diffusion process and the inverse diffusion process are performed in the latent space, thereby reducing the computational consumption of the diffusion model and improving the computational efficiency.

[0107] During the training process, the parameters of the encoder can be adjusted by minimizing the reconstruction error between the input data and the latent variables, and the parameters of the decoder can be adjusted by minimizing the reconstruction error between the decoder output data and the input data. The reconstruction error measures the difference between the decoder output and the original input data. This difference can be measured in many ways, such as using the KL divergence (Kullback-Leibler Divergence) to quantify the gap between the two probability distributions. For example, the resolution of the target denoised image is 64*64, and the resolution of the facial texture prediction image after decoding is 1024*1024.

[0108] The first loss function can include KL divergence regularization loss, adversarial loss and LPIPS (Least Squares Probability) perceptual loss. The first loss function satisfies:

[0109]

[0110] in, is the first loss function; is the KL divergence regularization loss; kl is the KL divergence regularized loss weight; To combat the loss; gan To counter the loss weight; is the LPIPS perception loss; λ lpips is the LPIPS perceptual loss weight.

[0111] S102: Determine a noise texture image latent variable corresponding to the facial texture image according to the data set to be trained.

[0112] The noise texture image latent variable can be a noise latent variable in the process of adding random noise to the original facial texture image, thereby making the image blurred and distorted. This noise addition process is usually predefined and can be uniform (such as Gaussian noise) or non-uniform (such as salt and pepper noise). The noise texture image latent variable is usually the starting point of the generation process in the diffusion model. The model needs to learn how to restore the clear original image from these noise texture image latent variables.

[0113] The diffusion probability distribution describes the probability that the image gradually changes from the original state to the noise state during the diffusion process. This distribution is the core of the diffusion model, which defines how noise is added to the image over time. For example, a Gaussian distribution can be used as a diffusion probability distribution to simulate the addition of noise. The parameters of the Gaussian distribution (such as mean and variance) will change as the noise addition steps proceed, thereby simulating the process of data gradually changing from a clear state to a pure noise state.

[0114] Among them, in the embodiment of the present application, the method of determining the noise texture image latent variable corresponding to the facial texture image according to the training data set may include:

[0115] Encode the facial texture image of the training data set to obtain a compressed facial texture image latent variable;

[0116] The compressed facial texture image latent variable is subjected to noise processing to obtain the noisy texture image latent variable corresponding to the facial texture image.

[0117] Among them, the facial texture image can be encoded using the encoder of VAE (Variational Autoencoder) and then mapped to a latent space to achieve data compression. Compressing the pixel resolution corresponding to the facial texture image and training the diffusion model in the latent space can solve the problem of large memory usage when training the model in the original pixel space, and facilitate better model training. For example, the resolution of the facial texture image of the training data set is 1024*1024, and the resolution of the compressed facial texture image after encoding is 64*64.

[0118] During the noise addition process of the diffusion model, the model gradually adds noise to the compressed facial texture image through a series of time steps of different levels. Each step corresponds to a state in a Markov chain, where the amount of added noise gradually increases until the data is completely transformed into noise, and the state of each step depends only on the state of the previous step.

[0119] S103, extracting texture features from the face image to obtain target texture features and a conditional embedding vector, wherein the conditional embedding vector is obtained by encoding the target texture features.

[0120] Among them, the conditional embedding vector encodes information about certain conditions or attributes of the generated data. In the case of facial texture generation, the conditional embedding can include the type, style or other relevant attributes of the facial texture, for example, identity features such as gender and facial features of the face image.

[0121] The neural network model in deep learning can be used to extract texture features from face images. For example, the Deep3D model and BiSeNet model can be used to extract the three-dimensional structure and detail features of the face image, and then the area related to the target texture in the image is identified, and the irrelevant parts are ignored to obtain the target texture features. Finally, the target texture features are encoded through the network τ θ Encoding is performed to obtain a fixed-length conditional embedding vector y, which captures the key information of the texture and compresses it into a representation suitable for the subsequent generation process.

[0122] S104. De-noising the noise texture image latent variable according to the conditional embedding vector and the preset time step condition to obtain the target denoised texture image latent variable corresponding to the preset time step condition. The preset time step condition represents the number of time steps for adjusting the noise during the denoising process and the time step length corresponding to each time step.

[0123] The preset time step condition can refer to the specific parameters or strategies adopted by the model at each time step during the inverse diffusion process. The time step condition can be used to control the speed and level of detail of the generation process. For example, in the early stages of the inverse diffusion process, more emphasis may be placed on generating rough outlines and shapes, while in the later stages, more emphasis may be placed on the clarity of details and textures.

[0124] The target denoising texture image latent variable may be a denoising latent variable in a process of gradually removing noise from the noisy texture image latent variable, thereby making the image clear and high-fidelity.

[0125] Denoising can refer to the inverse diffusion process, that is, using the conditional embedding vector and the time step condition to denoise the noise texture image latent variable, the target denoised texture image latent variable corresponding to the time step can be obtained, and finally all the time step conditions are executed to gradually predict the facial texture image latent variable, so as to find the mapping relationship between pure noise and facial texture image distribution under the guidance of the identity condition embedding of the face image. In the inverse diffusion process, the inverse diffusion probability distribution describes how to gradually reduce the noise and restore the probability of the original image based on the current noise texture image latent variable and the known diffusion process. In practical applications, by learning the inverse diffusion probability distribution, the diffusion model attempts to find the optimal denoising strategy to maximize the similarity between the target denoised texture image latent variable and the original image in each time step, thereby generating a high-quality denoised image.

[0126] Denoising can also refer to the process in the diffusion model of starting from a pure noise state, gradually removing noise, and finally restoring to the original data state. This process is also implemented through a parameterized Markov chain, but its goal is to learn how to recover the target denoised texture image latent variable from the noisy texture image latent variable.

[0127] Among them, in the embodiment of the present application, according to the conditional embedding vector and the preset time step condition, the method of denoising the noise texture image latent variable to obtain the target denoised texture image latent variable corresponding to the preset time step condition may include:

[0128] According to the conditional embedding vector and the preset time step condition, the noise texture image latent variable is subjected to the first denoising process in the cross attention process, so that the noise texture image latent variable is denoised according to the guidance direction of the conditional embedding vector, and an initial denoised texture image latent variable is obtained;

[0129] According to the conditional embedding vector and the preset time step condition, the initial denoised texture image latent variable is subjected to the second denoising process in the cross attention process, so that the initial denoised texture image latent variable is denoised according to the guidance direction of the conditional embedding vector, and the target denoised texture image latent variable is obtained.

[0130] Among them, cross-attention processing can refer to adding a cross-attention layer to the diffusion model, which allows the model to dynamically focus on different parts of the conditional embedding vector during the generation process to determine the conditional information. In this way, the model can gradually adjust the noise vector according to the guidance of the conditional information to generate an image that meets specific texture characteristics.

[0131] The cross-attention layer usually includes three parts: query, key, and value. In each attention layer, the model calculates the similarity between the query and the key, and then uses these similarities as weights to weight the corresponding values ​​to obtain the weighted output.

[0132] Among them, the cross-attention processing includes multiple consecutive attention layers. In each attention layer, the output image of the previous attention layer is denoised based on the guidance of the conditional embedding vector, and the guided denoised image is output until it passes through the last attention layer to obtain the target denoised image.

[0133] S105 . Training the model to be trained according to the noise texture image latent variable and the target denoised texture image latent variable to obtain a target model.

[0134] The model to be trained may include a conditional feature extraction model and a latent space model, and may also include a pixel space model. The conditional feature extraction model includes a conditional feature extraction network; the latent space model includes a noise processing network. The pixel space model may be trained separately, and the conditional feature extraction model and the latent space model may be trained jointly.

[0135] For example, the conditional feature extraction model adopts the ICM (Identity Conditional Module) model, in which the input face image is identified and the feature information of the target texture is extracted, and then encoded through the encoding network to obtain a conditional embedding vector y of fixed length. The latent space model adopts the LDM (Latent Diffusion Module), in which, under the guidance of the conditional embedding vector y, a texture image that meets specific conditions is generated through a noise processing network. Among them, the diffusion model is an image generation model that learns the information attenuation caused by noise, and then uses the learned pattern to generate images. In the traditional way, the diffusion model uses the image denoising in the forward process and the image denoising in the reverse process, and the difference between the denoised image and the original image is used as the basis to realize the training of the model; in the inference stage of the model, the reverse process of the diffusion model can be directly used to realize the generation of the image.

[0136] Among them, in the embodiment of the present application, according to the noise texture image latent variable and the target denoised texture image latent variable, the method for training the to-be-trained model to obtain the target model may include:

[0137] Determine the second loss function of the initial noise processing network and the initial condition feature extraction network in the to-be-trained model according to the noise texture image latent variable and the target denoised texture image latent variable;

[0138] According to the second loss function, the initial noise processing network and the initial condition feature extraction network in the training model are trained to obtain the target noise processing network and the target condition feature extraction network;

[0139] According to the target noise processing network and the target condition feature extraction network, a target model is obtained.

[0140] Among them, during the training process, the model will calculate the difference between the noise texture image latent variables in the denoising process and the denoising process and the target denoised texture image latent variables. By minimizing the difference between the noise texture image latent variables in the denoising process and the denoising process and the target denoised texture image latent variables, the model can adjust its parameters to better fit the real data.

[0141] The second loss function can be a loss function of the joint training of ICM and LDM, and the second loss function satisfies:

[0142]

[0143] Among them, L LDM is the second loss function; ε(·) is the encoding and decoding network; x is the facial texture image; y is the conditional embedding vector; the value range of t is {1,…,T}; z t is the denoised image; ∈ θ is the noise processing network; τ θ It is a conditional feature extraction network.

[0144] The target model is obtained by adjusting the parameters such as the learning rate of the trainable network through the loss function. For example, the encoding and decoding network is optimized using the Adam optimizer with β1 = 0.5 and β2 = 0.9, and the learning rate is η = 5.76×10 -4 , loss weight λ kl =10 -6 , gan =0.5,λ lpips = 1. The noise processing network and conditional feature extraction network use the AdamW optimizer, β1 = 0.9, β2 = 0.999, weight decay μ = 0.01, and learning rate η = 5.76 × 10 -4 To optimize.

[0145] The facial texture model training method provided in the embodiment of the present application ensures the richness and multi-perspective nature of the data through a detailed data set preparation process, including the acquisition of face images, perspective feature analysis, and texture prediction processing. Using conditional embedding vectors, the model guides the denoising process, gradually refines the target denoised image through a cross-attention mechanism, and finally decodes the predicted facial texture. Not only does it improve the authenticity and diversity of texture generation, but it also enhances the controllability and interpretability of the generation process through conditional guidance; by optimizing the loss function including the difference between facial texture images and predicted images, the model gradually improves its generation ability during the training process, making facial texture generation faster.

[0146] The embodiment of the present application provides a facial texture generation method, and the execution subject of the method can be a server. The server can be a mobile phone, a computer, a tablet and other devices. The embodiment of the present application does not impose any special restrictions on the implementation method of the execution subject, as long as the execution subject can obtain the target face image of the texture to be generated; input the target face image into the facial texture generation model to obtain the identity condition embedding vector corresponding to the target face image; according to the identity condition embedding vector, denoise the noise in the facial texture generation model to obtain the target face texture image latent variable; decode the target face texture image latent variable to obtain the facial texture image corresponding to the target face image.

[0147] Figure 2 The following is a flow chart of a facial texture generation method provided in an embodiment of the present application. Figure 2 As shown, the method may include:

[0148] S201, obtaining a target face image for which texture is to be generated.

[0149] Among them, the target face image can refer to the face image captured in a natural environment or an uncontrolled environment. These images may come from public datasets, social media, surveillance cameras and other sources, such as social media photos, surveillance video screenshots, street photography, etc.

[0150] S202. Input the target face image into a facial texture generation model to obtain an identity conditional embedding vector corresponding to the target face image, wherein the facial texture generation model is a target model of any one of the above facial texture model training methods.

[0151] S203, denoising the noise in the facial texture generation model according to the identity condition embedding vector to obtain a latent variable of the target facial texture image.

[0152] Among them, the facial texture generation model uses a noise processing network to predict the optimal way to remove noise at each time step. The input of the noise processing network can include the noise data of the current time step, as well as the conditional embedding vector and the time step condition.

[0153] S204: Decode the target face texture image latent variables to obtain a facial texture image corresponding to the target face image.

[0154] Among them, the VAE decoder can be used to decode the latent variables of the target face texture image, and reconstruct the facial texture image corresponding to the target face image from the latent space.

[0155] Compared with the prior art, the facial texture generation method provided in the embodiment of the present application does not need to iteratively process the model after acquiring the target facial image. The corresponding texture image can be generated according to the guidance of the target facial image, which reduces the time complexity and can better maintain facial details and identity similarity.

[0156] Figure 3 A flowchart of another facial texture model training method provided in an embodiment of the present application. Figure 3 As shown, the method may include:

[0157] S301, constructing a face texture UV map dataset.

[0158] The data set may be a data set of one hundred thousand pairs of paired face wild images and texture UV maps.

[0159] Among them, in the embodiment of the present application, the method for constructing a face texture UV map data set may include:

[0160] The noise is sampled to obtain a face image, and the face image is subjected to posture detection and image screening to obtain a frontal image and an unobstructed image;

[0161] Determine the codes corresponding to the front image and the unobstructed image in the StyleGAN2 latent space, perform InterfaceGAN network editing, and obtain multi-view images;

[0162] The multi-view images are subjected to hair removal processing to obtain multi-view "bald" images, and linear texture prediction is performed on the multi-view "bald" images to obtain predicted textures, and face regions are extracted and mapped on the multi-view "bald" images to obtain multi-view incomplete textures;

[0163] The predicted texture is used as a texture template, and the multi-view incomplete texture and predefined facial features are linearly fused to obtain a texture UV atlas.

[0164] Figure 4A schematic diagram of a process for preparing a face texture UV map dataset provided in an embodiment of the present application is shown in FIG. Figure 4 As shown in the figure, firstly, a batch of face images are generated in batches by sampling from noise (noise); then, the Deep3D model and BiSeNet model are used to detect the posture coefficient and extract the visible face area ratio respectively, and the front image and the unobstructed image (glasses, etc.) are screened out from the batch of face images, and the code corresponding to the filtered image in the StyleGAN2 latent space is edited based on the InterfaceGAN network to edit the face posture to generate multi-view face images (multi-viewfaces); in order to prevent hair from appearing in the texture, the HairMapper network model is used to remove the hair, forming a multi-view "bald" image (bald faces); the face reconstruction geometric vertices and face visible areas predicted by the Deep3D model and the BiSeNet model are used to extract the high-confidence face areas of the front and side from the multi-view bald images respectively, and project them into the UV space through the predefined UV mapping relationship to form a multi-view incomplete texture (remap texture&mask); finally, the predicted texture (predicted Texture) is used as a filling template, and the multi-view incomplete texture and the predefined facial mask (connect mask-connection feature, multi-view facial mask-multi-view facial connection feature) are linearly fused (Linear Blending Module) to form the final texture UV map (blended texture).

[0165] S302: training a texture generation model based on the data set.

[0166] Among them, the texture generation model UV-IDM trained based on the dataset includes VAE module, ICM module and LDM module.

[0167] VAE module: compresses the texture UV map x into the feature potential space;

[0168] ICM module: extracts incomplete textures from multi-view wild images and encodes them into conditional embedding y through a trainable encoding network;

[0169] LDM module: According to the guidance of y, a diffusion model is performed in the feature latent space, that is, the training of the noise prediction network to generate the corresponding texture UV map from the noise.

[0170] One of the training goals of VAE is to make the distribution of the latent space close to the standard normal distribution. To achieve this, it is necessary to optimize the KL divergence, which measures the difference between the distribution of the latent variable z and the standard normal distribution. During the training process, the parameters of Encoderε are adjusted to minimize the KL divergence, so that the distribution of the latent space is closer to the target distribution. The total loss function of VAE is the weighted sum of the KL divergence regularization loss, the adversarial loss, and the LPIPS perception loss.

[0171] Figure 5 A specific flow chart of another facial texture model training method provided in an embodiment of the present application is as follows: Figure 5 As shown, VAE consists of an Encoderε and a Decoder It is responsible for compressing the texture image x into the feature latent space to obtain the latent variable z; ICM uses the Deep3D model and the BiSeNet model to recognize and analyze the face image, extract the incomplete texture area, and determine the incomplete texture through the combined processing of the visual module and the segmentation module, and through the trainable encoding network τ θ Encoded as conditional embedding, so that LDM can guide denoising according to the conditional embedding; LDM consists of a diffusion process and a denoising process. The diffusion process is to gradually add noise to the latent variable z until the noise z is generated. T The denoising process is to transform the noise z T The process of gradually removing noise until the latent variable z is restored, where the conditional embedding guides the denoising process through the trainable noise prediction network ∈ θ Recover the latent variable z and then pass it through Decoder Decode the texture image The denoising process in the figure only shows the noise z T After denoising, we get z T-1 Since the denoising process is similar, we will not repeat the process of performing denoising in step T-1 according to the output result of the previous denoising step T (e.g., z T-1 Denoising to get z T-2 ) until the latent variable z is obtained.

[0172] The facial texture model training method provided in the embodiment of the present application designs a production process for a set of wild face image and face texture pairing datasets, which can achieve low-cost, large-scale batch production of datasets, overcoming the problems of small scale and high acquisition cost of existing datasets. An identity condition extraction module ICM is designed to make full use of the effective information of the face in the wild image, embed the information as a condition, guide the model to perform denoising, and generate high-fidelity, identity-consistent texture maps, which enhances the texture generation capability compared with the prior art.

[0173] Figure 6 A schematic diagram of the structure of a facial texture model training device provided in an embodiment of the present application. Figure 6 As shown, the facial texture model training device 60 includes: a first acquisition module 601, a determination module 602, an extraction module 603, a first obtaining module 604 and a training module 605. Among them:

[0174] A first acquisition module 601 is used to acquire a data set to be trained, where the data set to be trained includes a face image and a facial texture image corresponding to the face image;

[0175] A determination module 602 is used to determine a noise texture image latent variable corresponding to the facial texture image according to the training data set;

[0176] An extraction module 603 is used to extract texture features from the face image to obtain target texture features and conditional embedding vectors, wherein the conditional embedding vectors are obtained by encoding the target texture features;

[0177] A first obtaining module 604 is used to perform denoising processing on the noise texture image latent variable according to the conditional embedding vector and the preset time step condition to obtain the target denoised texture image latent variable corresponding to the preset time step condition, wherein the preset time step condition represents the number of time steps for adjusting the noise during the denoising process and the time step length corresponding to each time step;

[0178] The training module 605 trains the model to be trained according to the noise texture image latent variable and the target denoised texture image latent variable to obtain a target model.

[0179] In the embodiment of the present application, the first acquisition module 601 may also be used for:

[0180] Acquire a face image, where the face image is obtained by performing image feature mapping on the noise vector;

[0181] Perform perspective feature analysis on the face image to obtain a multi-perspective face image;

[0182] Performing texture prediction processing on multi-view facial images to obtain predicted texture images;

[0183] According to the multi-view facial image and the preset UV mapping relationship, the front face area and the side face area of ​​the multi-view facial image are mapped to the UV space to obtain a multi-view incomplete texture image;

[0184] According to the predicted texture image, the multi-view incomplete texture image and the preset facial feature image are linearly fused to obtain the facial texture image;

[0185] According to the face image and the facial texture image, a data set to be trained is obtained.

[0186] In the embodiment of the present application, the first acquisition module 601 may also be used for:

[0187] Perform posture detection and image screening on face images to obtain frontal face images and unobstructed face images;

[0188] Editing the latent vector information of the frontal face image and the latent vector information of the unobstructed face image to obtain an initial multi-view facial image;

[0189] The initial multi-view facial image is de-haired to obtain a multi-view facial image.

[0190] In the embodiment of the present application, the first acquisition module 601 may also be used for:

[0191] According to the data set to be trained, the facial texture image is encoded to obtain the facial texture image latent variable;

[0192] Decoding the latent variables of the facial texture image to obtain a facial texture prediction image;

[0193] Determine a first loss function of an initial encoding / decoding network in a model to be trained according to the facial texture image and the facial texture prediction image;

[0194] According to the first loss function, the initial encoding and decoding network in the model to be trained is trained to obtain the target model to be trained, so that the target model to be trained determines the noise texture image latent variable corresponding to the facial texture image according to the data set to be trained.

[0195] In the embodiment of the present application, the determination module 602 may also be used to:

[0196] Encode the facial texture image of the training data set to obtain a compressed facial texture image latent variable;

[0197] The compressed facial texture image latent variable is subjected to noise processing to obtain the noisy texture image latent variable corresponding to the facial texture image.

[0198] In the embodiment of the present application, the first obtaining module 604 may also be used for:

[0199] According to the conditional embedding vector, a cross attention process is performed on the noisy image so that the noisy image is denoised according to the guidance direction of the conditional embedding vector to obtain a target denoised image;

[0200] The target denoised image is decoded to obtain a facial texture prediction image.

[0201] In the embodiment of the present application, the obtaining module 604 may also be used for:

[0202] According to the conditional embedding vector and the preset time step condition, the noise texture image latent variable is subjected to the first denoising process in the cross attention process, so that the noise texture image latent variable is denoised according to the guidance direction of the conditional embedding vector, and an initial denoised texture image latent variable is obtained;

[0203] According to the conditional embedding vector and the preset time step condition, the initial denoised texture image latent variable is subjected to the second denoising process in the cross attention process, so that the initial denoised texture image latent variable is denoised according to the guidance direction of the conditional embedding vector, and the target denoised texture image latent variable is obtained.

[0204] In the embodiment of the present application, the training module 605 may also be used for:

[0205] Determine the second loss function of the initial noise processing network and the initial condition feature extraction network in the to-be-trained model according to the noise texture image latent variable and the target denoised texture image latent variable;

[0206] According to the second loss function, the initial noise processing network and the initial condition feature extraction network are trained to obtain the target noise processing network and the target condition feature extraction network;

[0207] According to the target encoding and decoding network, the target noise processing network and the target conditional feature extraction network, a target model is obtained.

[0208] Figure 7 This is a schematic diagram of the structure of a facial texture generation device provided in an embodiment of the present application. Figure 7 As shown, the facial texture generating device 70 comprises: a second acquiring module 701, an input module 702, a second obtaining module 703 and a generating module 704. Among them:

[0209] The second acquisition module 701 is used to acquire a target face image for which texture is to be generated;

[0210] An input module 702 is used to input a target face image into a facial texture generation model to obtain an identity conditional embedding vector corresponding to the target face image, wherein the facial texture generation model is a target model of any of the above facial texture model training methods;

[0211] The second obtaining module 703 is used to perform denoising on the noise in the facial texture generation model according to the identity condition embedding vector to obtain the target face texture image latent variable;

[0212] The generation module 704 is used to decode the latent variables of the target face texture image to obtain a facial texture image corresponding to the target face image.

[0213] Figure 8This is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application. Figure 8 As shown, the electronic device 80 may include a processor 801 with one or more processing cores, a memory 802 with one or more computer-readable storage media, a communication component 803 and other components. The processor 801, the memory 802 and the communication component 803 are connected via a bus 804.

[0214] In the specific implementation process, at least one processor 801 executes the computer execution instructions stored in the memory 802, so that at least one processor 801 executes the above facial texture model training method and facial texture generation method.

[0215] The specific implementation process of the processor 801 can be found in the above method embodiment, and its implementation principle and technical effect are similar, so this embodiment will not be repeated here.

[0216] In the above Figure 8 In the illustrated embodiment, it should be understood that the processor may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), etc. A general-purpose processor may be a microprocessor or any conventional processor. The steps of the method disclosed in the invention may be directly implemented as being executed by a hardware processor, or may be executed by a combination of hardware and software modules in the processor.

[0217] The memory may include a high-speed memory (Random Access Memory, RAM), and may also include a non-volatile memory (Non-volatile Memory, NVM), such as at least one disk memory.

[0218] The communication component may be a wireless communication component or a wired communication component, and the communication component is generally used to establish a communication connection between the electronic device and other electronic devices. For example, the communication component is used to connect the electronic device to an external terminal through a network, establish a data transmission channel and a communication connection between the electronic device and the external terminal, etc.

[0219] The bus may be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, or an Extended Industry Standard Architecture (EISA) bus, etc. The bus may be divided into an address bus, a data bus, a control bus, etc. For ease of representation, the bus in the drawings of the present application is not limited to only one bus or one type of bus.

[0220] In some embodiments, a computer program product is also proposed, including a computer program or instructions, which, when executed by a processor, implements the steps in any of the above-mentioned facial texture model training methods and facial texture generation methods.

[0221] A person of ordinary skill in the art will appreciate that all or part of the steps in the various methods of the above embodiments may be completed by instructions, or by controlling related hardware through instructions. The instructions may be stored in any computer-readable storage medium and loaded and executed by a processor.

[0222] To this end, an embodiment of the present application provides a computer-readable storage medium, which stores multiple instructions, which can be loaded by a processor to execute the steps in any facial texture model training method or facial texture generation method provided in the embodiment of the present application.

[0223] The storage medium may include: a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, etc.

[0224] According to one aspect of the present application, a computer program product or a computer program is provided. The computer program product or the computer program comprises computer instructions stored in a computer-readable storage medium.

[0225] Since the instructions stored in the storage medium can execute the steps in any facial texture model training method and facial texture generation method provided in the embodiments of the present application, the beneficial effects that can be achieved by any facial texture model training method and facial texture generation method provided in the embodiments of the present application can be achieved. Please refer to the previous embodiments for details and will not be repeated here.

[0226] The specific implementation of the above operations can be found in the previous embodiments, which will not be described in detail here.

[0227] Those skilled in the art will readily appreciate other embodiments of the present application after considering the specification and practicing the invention disclosed herein. The present application is intended to cover any modification, use or adaptation of the present application, which follows the general principles of the present application and includes common knowledge or customary techniques in the art that are not disclosed in the present application. The specification and examples are intended to be exemplary only, and the true scope and spirit of the present application are indicated by the following claims.

[0228] It should be understood that the present application is not limited to the precise structures that have been described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof. The scope of the present application is limited only by the appended claims.

Claims

1. A facial texture model training method, characterized in that: include: Acquire a data set to be trained, the data set to be trained comprising a face image and a facial texture image corresponding to the face image; Determining, according to the data set to be trained, a noise texture image latent variable corresponding to the facial texture image; Extracting texture features from the face image to obtain target texture features and a conditional embedding vector, wherein the conditional embedding vector is obtained by encoding the target texture features; According to the conditional embedding vector and the preset time step condition, the noise texture image latent variable is denoised to obtain a target denoised texture image latent variable corresponding to the preset time step condition, wherein the preset time step condition represents the number of time steps for adjusting the noise during the denoising process and the time step length corresponding to each time step; The model to be trained is trained according to the noise texture image latent variable and the target denoised texture image latent variable to obtain a target model.

2. The method according to claim 1, characterized in that: The step of obtaining a data set to be trained includes: Acquire a face image, wherein the face image is obtained by performing image feature mapping on a noise vector; Performing perspective feature analysis on the facial image to obtain a multi-perspective facial image; Performing texture prediction processing on the multi-view facial image to obtain a predicted texture image; According to the multi-view facial image and a preset UV mapping relationship, the front face area and the side face area of ​​the multi-view facial image are mapped to the UV space to obtain a multi-view incomplete texture image; According to the predicted texture image, linearly fuse the multi-view incomplete texture image and a preset facial feature image to obtain a facial texture image; A data set to be trained is obtained according to the face image and the facial texture image.

3. The method according to claim 2, characterized in that The performing perspective feature analysis on the facial image to obtain a multi-perspective facial image includes: Performing posture detection and image screening on the face image to obtain a frontal face image and an unobstructed face image; Editing the latent vector information of the frontal face image and the latent vector information of the unobstructed face image to obtain an initial multi-view facial image; The initial multi-view facial image is subjected to hair removal processing to obtain a multi-view facial image.

4. The method according to claim 1, characterized in that: After obtaining the data set to be trained, the method further includes: According to the data set to be trained, encoding the facial texture image is performed to obtain a facial texture image latent variable; Decoding the facial texture image latent variable to obtain a facial texture prediction image; Determine a first loss function of an initial encoding / decoding network in a model to be trained according to the facial texture image and the facial texture prediction image; According to the first loss function, the initial encoding and decoding network in the model to be trained is trained to obtain a target model to be trained, so that the target model to be trained determines the noise texture image latent variable corresponding to the facial texture image according to the data set to be trained.

5. The method according to claim 1, characterized in that The step of determining the noise texture image latent variable corresponding to the facial texture image according to the training data set includes: Encoding the facial texture image of the to-be-trained data set to obtain a compressed facial texture image latent variable; The compressed facial texture image latent variable is subjected to noise addition processing to obtain a noise texture image latent variable corresponding to the facial texture image.

6. The method according to claim 1, characterized in that The step of performing denoising on the noise texture image latent variable according to the conditional embedding vector and the preset time step condition to obtain a target denoised texture image latent variable corresponding to the preset time step condition includes: According to the conditional embedding vector and the preset time step condition, the noise texture image latent variable is subjected to a first denoising process in the cross attention process, so that the noise texture image latent variable is denoised according to the guiding direction of the conditional embedding vector, and an initial denoised texture image latent variable is obtained; According to the conditional embedding vector and the preset time step condition, the initial denoised texture image latent variable is subjected to a second denoising process in a cross attention process, so that the initial denoised texture image latent variable is denoised according to the guidance direction of the conditional embedding vector, and a target denoised texture image latent variable is obtained.

7. The method according to claim 1, characterized in that The step of training the model to be trained according to the noise texture image latent variable and the target denoised texture image latent variable to obtain a target model includes: Determine a second loss function of an initial noise processing network and an initial condition feature extraction network in the to-be-trained model according to the noise texture image latent variable and the target denoised texture image latent variable; According to the second loss function, the initial noise processing network and the initial condition feature extraction network are trained to obtain a target noise processing network and a target condition feature extraction network; A target model is obtained according to the target noise processing network and the target condition feature extraction network.

8. A facial texture generation method, characterized in that: include: Obtain a target face image for which texture is to be generated; Inputting the target face image into a facial texture generation model to obtain an identity conditional embedding vector corresponding to the target face image, wherein the facial texture generation model is the target model according to any one of claims 1 to 7; De-noising the noise in the facial texture generation model according to the identity condition embedding vector to obtain a target facial texture image latent variable; The target face texture image latent variable is decoded to obtain a facial texture image corresponding to the target face image.

9. A facial texture model training device, characterized in that: include: A first acquisition module is used to acquire a data set to be trained, wherein the data set to be trained includes a face image and a facial texture image corresponding to the face image; A determination module, used to determine a noise texture image latent variable corresponding to the facial texture image according to the data set to be trained; An extraction module, used to extract texture features from the face image to obtain target texture features and a conditional embedding vector, wherein the conditional embedding vector is obtained by encoding the target texture features; A first obtaining module is used to perform denoising processing on the noise texture image latent variable according to the conditional embedding vector and a preset time step condition to obtain a target denoised texture image latent variable corresponding to the preset time step condition, wherein the preset time step condition represents the number of time steps for adjusting the noise during the denoising process and the time step length corresponding to each time step; The training module trains the model to be trained according to the noise texture image latent variable and the target denoised texture image latent variable to obtain a target model.

10. A facial texture generating device, characterized in that: include: The second acquisition module is used to acquire the target face image for which the texture is to be generated; An input module, used for inputting the target face image into a facial texture generation model to obtain an identity conditional embedding vector corresponding to the target face image, wherein the facial texture generation model is a target model according to any one of claims 1 to 7; The second obtaining module is used to perform denoising on the noise in the facial texture generation model according to the identity condition embedding vector to obtain a target face texture image latent variable; The generating module is used to decode the latent variables of the target face texture image to obtain a facial texture image corresponding to the target face image.