Lip shape generation method and device, and lip shape generation model training method and device

By generating lip shape and texture separately, and utilizing lip shape parameter sequences and cross-attention mechanisms, combined with a 3D face model and lip texture feature set, the error problem in existing lip shape generation algorithms is solved, achieving higher accuracy and consistency in lip shape generation.

CN120374845BActive Publication Date: 2026-11-20WUHAN AI RES
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510439759.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-04-09
Publication Date
2026-11-20
Estimated Expiration
2045-04-09

AI Technical Summary

Technical Problem

Existing lip shape generation algorithms are prone to problems such as color difference, mismatch between speaking habits and facial features when generating lip shapes, resulting in errors in the generated lip shapes.

Method used

By generating lip shape and lip texture separately, the lip shape is generated first and then the lip texture is generated. Lip shape parameter sequences and cross-attention mechanisms are used to extract lip shape related information. Combined with a 3D face model and lip texture feature set, the accuracy of lip shape generation is improved.

Benefits of technology

It improves the accuracy of lip shape generation, reduces the influence of lip texture on shape, and enhances the matching and consistency between the generated lip shape and the source face.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120374845B_ABST
    Figure CN120374845B_ABST
Patent Text Reader

Abstract

A lip shape generation method and device, and a training method and device of a lip shape generation model are disclosed, and belong to the technical field of image generation. The method comprises: obtaining a first voice, the first voice being a voice input to the lip shape generation model; inputting the first voice and a first face image into the lip shape generation model to obtain a second face image sequence, the second face image sequence being used to simulate a lip shape and a lip texture when a human body in the first face image speaks the first voice; wherein, in the process of generating the second face image sequence by the lip shape generation model, the lip shape in the second face image sequence is generated first, and then the lip texture in the second face image sequence is generated based on the lip shape in the second face image sequence. The method can improve the accuracy of the generated lip shape.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This disclosure relates to the field of image generation technology, and in particular to a lip shape generation method and apparatus, and a training method and apparatus for a lip shape generation model. Background Technology

[0002] Lip-shape generation algorithms are algorithms that use computer technology and artificial intelligence methods to accurately replicate and simulate the lip shape of a specific person. These algorithms have wide applications in film and television production, game development, virtual social networking, and digital broadcasting. When generating lip shapes, this algorithm focuses on replacing the mouth area of ​​the face based on the driving audio.

[0003] In related technologies, lip shape generation algorithms include: inputting a source face and speech into the lip shape generation algorithm, completely obscuring the lip portion of the source face, and generating a face image containing lip pixels based on the speech and the source face with the lip portion obscured.

[0004] However, although this method can achieve lip shape and speech matching, it inevitably produces problems such as color difference between the generated lip shape and the source face, mismatch of speaking habits, and changes in appearance. In other words, the lip shape generated in related technologies has errors. Summary of the Invention

[0005] This disclosure provides a method and apparatus for generating lip shapes, as well as a method and apparatus for training a lip shape generation model, which can improve the accuracy of the generated lip shapes. The technical solution includes at least the following: In a first aspect, a lip shape generation method is provided, comprising: acquiring a first speech, wherein the first speech is speech input to a lip shape generation model; inputting the first speech and a first face image into the lip shape generation model to obtain a second face image sequence, wherein the second face image sequence is used to simulate the lip shape and lip texture of a human in the first face image when speaking the first speech; wherein, in the process of the lip shape generation model generating the second face image sequence, the lip shape in the second face image sequence is first generated, and then the lip texture in the second face image sequence is generated based on the lip shape in the second face image sequence.

[0006] Optionally, the lip shape generation model generates the second face image sequence in the following manner: based on the first speech, obtain the lip shape parameter sequence corresponding to the first speech; use the lip shape parameter sequence to generate a third face image sequence, wherein the face in the third face image sequence is a three-dimensional face model, and the third face image sequence is used to indicate the lip shape changes when the human body speaks the first speech; based on the lip portion of the third face image sequence, predict the lip texture of the first face image in the third face image sequence to obtain the second face image sequence.

[0007] Optionally, the step of predicting the lip texture of the first face image in the third face image sequence based on the lip portion of the third face image sequence to obtain the second face image sequence includes: using the lip portion of the third face image sequence as a mask for the first face image to obtain a mask image sequence; obtaining a mask feature sequence, the mask feature sequence including multiple mask feature sets, each mask feature set corresponding to a mask image in the mask image sequence; and predicting the lip texture of the mask portion in the mask image sequence based on the mask feature sequence to obtain the second face image sequence.

[0008] Optionally, obtaining the lip shape parameter sequence corresponding to the first speech based on the first speech includes: obtaining the speech feature sequence of the first speech; obtaining a lip shape semantic vector set, the lip shape semantic vector set including multiple lip shape semantic vectors, the lip shape semantic vectors being determined based on the lip shape-related benchmark expressions in Blendshape expressions; and processing the speech feature sequence and the lip shape semantic set using a cross-attention mechanism to obtain the lip shape parameter sequence.

[0009] Secondly, a training method for a lip shape generation model is also provided. The method includes: obtaining a lip shape parameter sequence corresponding to a sample speech; generating a third face image sequence using the lip shape parameter sequence; training the lip shape generation model using the third face image sequence and the sample face image sequence, wherein the sample face image sequence is a multi-frame face image of a person speaking the sample speech; wherein, during the training of the lip shape generation model, the lip portion of the third face image sequence is used as a mask for the lip portion of the first face image sequence to train the ability of the lip shape generation model to generate lip textures.

[0010] Optionally, after using the lip portion of the third face image sequence as a mask for the lip portion of the first face image sequence, a mask image sequence corresponding to the sample speech is obtained. The lip shape generation model further includes a single-person adapter, which is connected to an encoder and a decoder. The encoder is used to obtain a mask feature sequence corresponding to the mask image sequence, and the decoder is used to predict the lip texture of the mask portion in the mask image sequence based on the mask feature sequence. The method further includes: fine-tuning the single-person adapter based on a first dataset, wherein the first dataset includes multiple speech-face image pairs of a single person, and each face image in the first dataset includes lip shapes.

[0011] Thirdly, a lip shape generation device is also provided, comprising: an acquisition module for acquiring a first speech, wherein the first speech is speech input to a lip shape generation model; and a generation module for inputting the first speech and a first face image into the lip shape generation model to obtain a second face image sequence, wherein the second face image sequence is used to simulate the lip shape and lip texture of a person in the first face image speaking the first speech; wherein, in the process of the lip shape generation model generating the second face image sequence, the lip shape in the second face image sequence is first generated, and then the lip texture in the second face image sequence is generated based on the lip shape in the second face image sequence.

[0012] Optionally, the generation module is further configured to: obtain a lip shape parameter sequence corresponding to the first speech based on the first speech; generate a third face image sequence using the lip shape parameter sequence, wherein the face in the third face image sequence is a three-dimensional face model, and the third face image sequence is used to indicate the lip shape changes when the human body speaks the first speech; and predict the lip texture of the first face image in the third face image sequence based on the lip portion of the third face image sequence to obtain the second face image sequence.

[0013] Optionally, the generation module is further configured to use the lip portion of the third face image sequence as a mask for the first face image to obtain a mask image sequence; obtain a mask feature sequence, the mask feature sequence including multiple mask feature sets, each mask feature set corresponding to a mask image in the mask image sequence; and predict the lip texture of the mask portion in the mask image sequence based on the mask feature sequence to obtain the second face image sequence.

[0014] Optionally, the acquisition module is further configured to acquire the speech feature sequence of the first speech; acquire a lip shape semantic vector set, the lip shape semantic vector set including multiple lip shape semantic vectors, the lip shape semantic vectors being determined based on the lip shape-related baseline expressions in Blendshape expressions; and process the speech feature sequence and the lip shape semantic vector set using a cross-attention mechanism to obtain the lip shape parameter sequence.

[0015] Fourthly, a training device for a lip shape generation model is also provided. This device includes: an acquisition module for acquiring a lip shape parameter sequence corresponding to sample speech; a generation module for generating a third face image sequence using the lip shape parameter sequence; and a training module for training the lip shape generation model using the third face image sequence and the sample face image sequence, wherein the sample face image sequence is a multi-frame face image of a person speaking the sample speech. During the training of the lip shape generation model, the lip portion of the third face image sequence is used as a mask for the lip portion of the first face image sequence to train the lip shape generation model's ability to generate lip textures.

[0016] Optionally, the lip shape generation model further includes a single-person adapter. After using the lip portion of the third face image sequence as a mask for the lip portion of the first face image sequence, a mask image sequence corresponding to the sample speech is obtained. The lip shape generation model further includes a single-person adapter connected to an encoder and a decoder. The encoder is used to obtain a mask feature sequence corresponding to the mask image sequence, and the decoder is used to predict the lip texture of the mask portion in the mask image sequence based on the mask feature sequence. The device further includes a fine-tuning module, which is used to fine-tune the single-person adapter based on a first dataset. The first dataset includes multiple speech-face image pairs of a single person, and each face image in the first dataset includes lip shapes.

[0017] Fifthly, a computer device is also provided, comprising: a memory and a processor, wherein the memory stores at least one computer program, the at least one computer program being loaded and executed by the processor to perform the lip-shape generation method and the lip-shape generation model training method described in the above embodiments.

[0018] Sixthly, a computer-readable storage medium is also provided, wherein at least one computer program is stored in the computer-readable storage medium, the at least one computer program being loaded and executed by a processor to perform the lip-shape generation method and the lip-shape generation model training method described in the above embodiments.

[0019] In a seventh aspect, a computer program product is provided, including a computer program / instructions that, when executed by a processor, implement the method described in the first aspect.

[0020] The beneficial effects of the technical solutions provided in this disclosure include at least the following: In related technologies, lip image generation involves completely obscuring the lips before generating the lip shape. This means the lip shape and texture are generated simultaneously, which can easily lead to the generated lip texture affecting the accuracy of the lip shape, resulting in errors in the final lip shape. In this embodiment, the lip shape and texture are generated separately (the lip shape is generated first, then the lip texture). Therefore, generating the lip texture does not affect the previous lip shape, thus improving the accuracy of the final second face image sequence. Compared to lip generation methods in related technologies, the lip generation method in this embodiment has higher accuracy. Attached Figure Description

[0021] To more clearly illustrate the technical solutions in the embodiments of this disclosure, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of this disclosure. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0022] Figure 1 A flowchart of a lip shape generation method provided in an exemplary embodiment of this disclosure is shown; Figure 2 This is a schematic diagram of the lip shape generation model; Figure 3 This is a schematic diagram of the lip shape parameter generation module; Figure 4 This is a schematic diagram of the lip texture generation module; Figure 5 This is a schematic diagram of the lip texture generation module that includes a single-person adapter; Figure 6 A flowchart illustrating a training method for a lip shape generation model provided in another exemplary embodiment of this disclosure is shown; Figure 7 A schematic diagram of the structure of a lip-forming apparatus provided in an exemplary embodiment of this disclosure is shown; Figure 8 A schematic diagram of the structure of a training apparatus for a lip shape generation model provided in an exemplary embodiment of the present disclosure is shown; Figure 9 This is a schematic diagram of the structure of a computer device provided in an embodiment of this disclosure. Detailed Implementation

[0023] Unless otherwise defined, the technical or scientific terms used herein shall have the ordinary meaning as understood by one of ordinary skill in the art to which this disclosure pertains. The terms “first,” “second,” “third,” and similar terms used in this patent application specification and claims do not indicate any order, quantity, or importance, but are merely used to distinguish different components. Similarly, the terms “an” or “a” and similar terms do not indicate a quantity limitation, but rather indicate the presence of at least one. The terms “comprising” or “including” and similar terms mean that the elements or objects preceding “comprising” or “including” encompass the elements or objects listed following “comprising” or “including” and their equivalents, and do not exclude other elements or objects. The terms “connected” or “linked” and similar terms are not limited to physical or mechanical connections, but can include electrical connections, whether direct or indirect.

[0024] To make the objectives, technical solutions, and advantages of this disclosure clearer, the embodiments of this disclosure will be described in further detail below with reference to the accompanying drawings.

[0025] Figure 1 A flowchart illustrating a lip-shape generation method provided in an exemplary embodiment of this disclosure is shown. This method can be executed by a computer device. See also... Figure 1 The method includes: In step 101, the first voice is acquired.

[0026] The first speech is the speech input to the lip-shape generation model.

[0027] In step 102, the first speech and the first face image are input into the lip-shape generation model to obtain the second face image sequence.

[0028] The second face image sequence is used to simulate the lip shape and lip texture of the human body in the first face image when speaking the first speech.

[0029] In the process of generating the second face image sequence using the lip shape generation model, the lip shape in the second face image sequence is generated first, and then the lip texture in the second face image sequence is generated based on the lip shape in the second face image sequence.

[0030] Here, the first face image is a real face, equivalent to the source face, and the second face image sequence is a sequence of face images generated based on the first face image. The face images in the second face image sequence are also complete faces.

[0031] In related technologies, lip image generation involves completely obscuring the lips before generating the lip shape. This means the lip shape and texture are generated simultaneously, which can easily lead to the generated lip texture affecting the accuracy of the lip shape, resulting in errors in the final lip shape. In this embodiment, the lip shape and texture are generated separately (the lip shape is generated first, then the lip texture). Therefore, generating the lip texture does not affect the previous lip shape, thus improving the accuracy of the final second face image sequence. Compared to lip generation methods in related technologies, the lip generation method in this embodiment has higher accuracy.

[0032] Optionally, step 102 includes the following step AC. Figure 2 This is a schematic diagram of the lip shape generation model. The following explanation of step AC is based on the structure of the lip shape generation model. Figure 2 As shown, the lip shape generation model includes a lip shape parameter generation module 201, a rendering module 202, and a lip texture generation module 203 connected in sequence.

[0033] Step A: Based on the first speech, obtain the lip shape parameter sequence corresponding to the first speech.

[0034] The lip shape parameter generation module 201 is used to obtain the lip shape parameter sequence corresponding to the first speech based on the first speech, that is, the lip shape parameter generation module 201 is used to execute step A. Figure 3 This is a structural diagram of the lip shape parameter generation module, as shown below. Figure 3 As shown, the lip shape parameter generation module 201 includes a speech coding unit 2011 and a cross attention unit 2012 connected in sequence.

[0035] Optionally, step A includes the following three steps: The first step is to obtain the speech feature sequence of the first speech.

[0036] Figure 3 In this process, the speech coding unit 2011 is used to obtain the speech feature sequence of the first speech, which is also the first step of the speech coding unit to perform step A.

[0037] For example, a pre-trained Wav2vec2 model is used to obtain the speech feature sequence of the first speech. The pre-trained Wav2vec2 model can map the first speech (typically a single-channel Wav format with a sampling rate of 16000Hz) into a speech feature sequence. The speech feature sequence can be represented as... ,in These represent the features of the first speech corresponding to the first frame image, the features of the first speech corresponding to the second frame image, ..., the features of the first speech corresponding to the Tth frame image, respectively.

[0038] The first step is essentially the process of encoding the initial speech. In implementation, the Wav2vec2 model can also be replaced with speech coding models such as Hubert and Whisper.

[0039] The second step is to obtain the set of lip shape semantic vectors.

[0040] The lip shape semantic vector set includes multiple lip shape semantic vectors, which are determined based on the lip shape-related baseline expressions in Blendshape expressions.

[0041] In Blendshape facial expressions, facial expressions are divided into 52 regions of motion, such as JawOpen, MouthClose, and MouthFunnel, meaning there are 52 baseline expressions in Blendshape. In this embodiment, the baseline expressions related to lip shape in Blendshape are encoded to obtain a set of lip shape semantic vectors. Here, a lip shape-related baseline expression can be encoded into a lip shape semantic vector.

[0042] For example, there are 27 baseline expressions related to lip shape in Blendshape expressions, which means that the lip shape semantic vector set includes 27 lip shape semantic vectors.

[0043] When encoding 27 baseline expressions related to lip shape into 27 lip shape semantic vectors, the 27 baseline expressions are first encoded in one-hot encoding. Then, a semantic encoding network is used to extract the semantic information of each baseline expression. Finally, the semantic information of each baseline expression is mapped to the corresponding one-hot encoding to obtain 27 lip shape semantic vectors.

[0044] The third step involves using a cross-attention mechanism to process the speech feature sequence and the lip shape semantic set to obtain the lip shape parameter sequence.

[0045] Figure 3 In this process, the cross-attention unit 2012 is used to process the speech feature sequence and the lip shape semantic set using the cross-attention mechanism to obtain the lip shape parameter sequence, which is also the third step of step A performed by the cross-attention unit 2012.

[0046] When using the Cross Attention (CA) mechanism to process speech feature sequences and lip-shape semantic sets, the query is the speech feature sequence, and the key and value are the lip-shape semantic sets.

[0047] In addition to the speech corresponding to the lip shapes, the first speech often also includes irrelevant features (such as timbre, background noise, etc.). Through the cross-attention mechanism in the third step, lip shape parameters and speech features can interact, so as to dynamically extract information related to the lip shape of the current frame from the speech and ignore information irrelevant to the lip shape. For example, when the word "apple" is contained in the first speech, processing the first speech through the cross-attention mechanism can focus on the lip shapes corresponding to the pronunciations "p-ing-guo" (for example, the pronunciation of "p" requires lip closure), while ignoring whether the timbre is sharp or deep when the first speech produces the sound of "apple".

[0048] Optionally, the cross-attention mechanism can also be combined with the Self Attention (SA) mechanism, for example, the output of the cross-attention mechanism can be further processed using the self-attention mechanism.

[0049] The self-attention mechanism helps to understand the temporal structure of speech signals (such as phonemes, intonation, and rhythm). By capturing long-distance dependencies, the self-attention mechanism eliminates the influence of noise or redundant information. For example, the pronunciation of the previous phoneme may affect the lip shape change of the subsequent phoneme, and the self-attention mechanism can associate these long-distance speech segments. For instance, in the first speech, "apple" is a continuous sequence, and the self-attention mechanism will mark them as a whole; there needs to be a transition from "mouth opening" to "closure" in lip shapes, and the self-attention mechanism can ensure the continuity of this process from "mouth opening" to "closure" in lip shapes.

[0050] When implementing the third step, a multi-layer cascaded attention mechanism can be adopted. Any layer of the attention mechanism includes cross-attention and self-attention, and each layer of the attention mechanism has the same structure.

[0051] As shown in Figure 3 the i-th layer attention mechanism 301, the output of the (i-1)-th layer attention mechanism and the lip shape semantic set are input into the cross-attention mechanism. At this time, the output of the (i-1)-th layer attention mechanism serves as the Query, and the lip shape semantic set serves as the Key and Value. Then the output of the cross-attention mechanism is input into the self-attention mechanism for processing, so as to obtain the output of the i-th layer attention mechanism.

[0052] In the case where there is a multi-layer cascaded attention mechanism, the output of the last layer of the attention mechanism is the lip shape parameter sequence corresponding to the first speech.

[0053] Here, since the speech feature sequence extracted from the first speech corresponds to multiple image frames, the lip shape parameter sequence extracted based on this speech feature sequence also corresponds to multiple image frames. Essentially, each speech feature in the speech feature sequence extracted from the first speech extracts a lip shape parameter, and each lip shape parameter corresponds to one image frame; these lip shape parameters constitute a lip shape parameter sequence.

[0054] Step B involves generating a third-person face image sequence using the lip shape parameter sequence.

[0055] The faces in the third face image sequence are three-dimensional face models. The third face image sequence is used to indicate the changes in lip shape when a person speaks the first utterance.

[0056] The rendering module 202 is used to generate a third face image sequence using the lip shape parameter sequence.

[0057] For example, the 3D face model in the third face image sequence is FLAME (Faces Learned with an Articulated Model and Expressions). In this case, the rendering module 202 is the FLAME renderer.

[0058] When generating a third face image sequence from a lip shape parameter sequence, it is equivalent to generating a third face image for each lip shape parameter in the lip shape parameter sequence.

[0059] 3D face models do not have skin texture, but they can reflect facial muscle movements, such as lip movements. Therefore, a third face image sequence can reflect the changes in lip shape when a person speaks the first word.

[0060] Step C: Based on the lip portion of the third face image sequence, predict the lip texture of the first face image in the third face image sequence to obtain the second face image sequence.

[0061] The second face image sequence is a series of images output by the lip-shape generation model that correspond to the first speech. These multiple images can be played back as a video.

[0062] Optionally, step C includes the following steps C1-C3. Figure 4 This is a structural diagram of the lip texture generation module, as shown below. Figure 4 As shown, the lip texture generation module 203 includes a mask unit 2031, an encoder 2032, a texture generation unit 2033, and a decoder 2034 connected in sequence.

[0063] Step C1: Use the lip portion of the third face image sequence as a mask for the first face image to obtain a mask image sequence.

[0064] The masking unit 2031 is used to use the lip portion of the third face image sequence as a mask for the first face image to obtain a mask image sequence. In other words, the masking module 2031 is used to execute step C1.

[0065] like Figure 4 As shown, when implementing step C1, the masking module 2031 can use a face key point matching algorithm to splice the lip portion of the third face image sequence 401 with the portion above the lips of the first face image 402 to obtain the mask image sequence 403.

[0066] Since lip shape parameters are implicitly represented, directly embedding them into the first face image for training would increase the learning burden on the network. Therefore, in this embodiment, the lip shape parameter sequence is first rendered into a third image sequence, and then the lip portion of the third face image sequence is used as a mask for the first face image, thereby reducing the learning burden on the network and improving learning efficiency.

[0067] Conventional lip generation algorithms also mask the lip portion of the source face (i.e., the first face image) during lip generation. However, this mask is empty and contains no information; it's just a mask. Therefore, when a lip generation model generates lips based on this mask, it needs to start from scratch. However, generating lips directly from scratch increases the learning burden on the lip generation model.

[0068] In this embodiment, the lip portion of the third face image sequence is used as a mask for the first face image. Since the lip portion of the third face image sequence already has a complete lip shape, the lip shape generation model only needs to generate lip texture based on the lip portion of the third face image sequence. This is equivalent to the lip portion of the third face image sequence serving as both a mask and a geometric prior guiding the lip shape generation model, thereby effectively reducing the learning burden of the lip shape generation model and improving the efficiency of lip shape generation. Even with a small amount of data, replication can be achieved without causing overfitting.

[0069] In related technologies, lip image generation involves completely obscuring the lips before generating the lip shape. This means the lip shape and texture are generated simultaneously, which can easily lead to the generated lip texture affecting the accuracy of the lip shape, resulting in errors in the final lip shape. In this embodiment, the lip shape and texture are generated separately (the lip shape is generated first, then the lip texture). Therefore, generating the lip texture does not affect the previous lip shape, thus improving the accuracy of the final second face image sequence. Compared to lip generation methods in related technologies, the lip generation method in this embodiment has higher accuracy.

[0070] When generating the second face image sequence, the portion above the lips of the source face remains unchanged. Therefore, the lip generation model only needs to generate the lip portion of the third face image sequence to obtain the second face image sequence.

[0071] Step C2: Obtain the mask feature sequence.

[0072] The mask feature sequence includes multiple mask feature sets, and each mask feature set corresponds to a mask image in the mask image sequence.

[0073] Encoder 2032 is used to convert the masked image sequence into a masked feature sequence, that is, encoder 2032 is used to perform step C2. For example... Figure 4 As shown, after the mask image sequence 403 is input to the encoder 2032, the encoder 2032 outputs the mask feature sequence 404.

[0074] The essence of step C2 is to use an encoder to extract features from each mask image in the mask image sequence. Since any mask image can extract a set of mask features, multiple mask images in the mask image sequence can extract multiple sets of mask features, which is the mask feature sequence.

[0075] Step C3: Based on the mask feature sequence, predict the lip texture of the masked portion in the mask image sequence to obtain the second face image sequence.

[0076] Optionally, step C3 includes the following three steps.

[0077] The first step is to obtain a set of lip texture features.

[0078] The lip texture feature set can be trained together with the lip shape generation model, or it can be trained independently. When obtaining the lip texture feature set, you can first obtain the lip texture dataset, and then extract multiple feature vectors from the lip texture dataset. These multiple feature vectors are the multiple lip texture features in the lip texture feature set.

[0079] The lip texture feature set includes a variety of possible lip texture details (such as lip lines, reflections, wrinkles, etc.). The lip texture feature set can provide the "skin texture" of the lips, rather than controlling how the lips move.

[0080] The lip texture feature set is reusable and is completely independent of the texture of the first speech and the content of the first face image.

[0081] The second step is to obtain the i-th lip texture feature that is closest to the i-th feature vector in the lip texture feature set for the i-th feature vector in the first mask feature set.

[0082] The first mask feature set is any mask feature set in the mask feature sequence; The texture generation unit 2033 is used to obtain the i-th lip texture feature that is closest to the i-th feature vector in the lip texture feature set from the i-th feature vector in the first mask feature set. That is, the texture generation unit 2033 is used to perform the second step of step C3.

[0083] When implementing the texture generation unit 2033, the nearest neighbor algorithm can be used to obtain the i-th lip texture feature that is closest to the i-th feature vector in the lip texture feature set. For each feature vector in the first mask feature set, a closest lip texture feature can be found in the lip texture feature set, and then the third step can be performed.

[0084] The third step is to generate the lip texture of the masked part in the mask image corresponding to the first mask feature set based on the lip texture features corresponding to each feature vector in the first mask feature set.

[0085] Decoder 2034 generates the lip texture of the masked portion in the masked image corresponding to the first mask feature set based on the lip texture features corresponding to each feature vector in the first mask feature set. After the decoder generates the lip texture of the masked portion in the masked image corresponding to the first mask feature set, this image becomes one of the images in the second face image sequence. Essentially, decoder 2034 restores the lip texture features corresponding to each feature vector in the first mask feature set into image form.

[0086] For any set of mask features in the mask feature sequence, the decoder 2034 can process it using the first to third steps of step C3 above, and finally the decoder 2034 can output the second face image sequence 405.

[0087] Traditional lip shape generation models often use preset reference face images to provide lip texture features when generating lip textures. However, these reference face images often contain lip shape information, which can interfere with the generation of lip textures, leading to errors in the generated lip texture. In this embodiment, lip texture features are provided through a lip texture feature set that does not contain lip shape information. This avoids interference from lip shape information during lip texture generation, thereby improving the accuracy of the final generated lip texture.

[0088] The lip shape generation model in steps A to C above can generate lip shapes relatively accurately and has good versatility.

[0089] When using a lip shape generation model to generate lips, although the lip feature set includes various mouth features, it may still be insufficiently refined for faces whose lip feature set has not been learned. Therefore, an additional single-person adapter can be set in the lip texture generation module 203. When generating lips for a single person, only the single-person adapter needs to be fine-tuned, thereby improving the accuracy of the lip shape generation model when generating lips for a single person.

[0090] Figure 5 This is a structural diagram of a lip texture generation module that includes a single-user adapter. Figure 5 In this design, a single-person adapter 501 is connected to both the encoder and the decoder. This single-person adapter is, for example, a convolutional neural network. The single-person adapter 501 receives multi-scale feature input from the encoder 2032, performs convolution to obtain adaptive features, and injects them into the decoder, thereby improving the details on the single person and achieving high-precision replication.

[0091] Here, before using the lip-shape generation model that includes a single-person adapter, it is necessary to fine-tune the single-person adapter. The method includes: fine-tuning the single-person adapter based on a first dataset, which includes multiple voice-face image pairs of a single person, and each face image in the first dataset includes lip shapes.

[0092] In the context of single-person lip generation, existing techniques often suffer from slow inference speeds and high training costs. For example, methods based on Neural Radiation Fields (Nerf) can achieve relatively good single-person lip generation, but require pixel-by-pixel rendering, resulting in slow inference speeds. Methods based on 3DGS (3D Gaussian Splatting) improve rendering speed, but their effectiveness is highly dependent on the distribution and quality of the input data. They are relatively weak at capturing complex details (such as fine textures or rapidly changing lighting effects), potentially leading to blurred edges or loss of detail.

[0093] In this embodiment, single-person lip shape generation is performed using a single-person adapter. When applied to different people, only the single-person adapter needs to be fine-tuned, without training the entire model, thus reducing the training cost for single-person lip shape generation. Furthermore, the single-person adapter uses a conventional convolutional neural network, resulting in faster inference speed and easier deployment.

[0094] There are also general lip-shape generation methods in related technologies, which utilize encoder-decoder architectures to generate lip shapes. However, these general methods often employ complex model architectures and a large number of parameters to improve generalization performance, resulting in slow inference speeds. Furthermore, their replication effect is insufficient; directly applying them to single-person scenarios leads to issues such as color discrepancies, loss of speech habits, inability to generate lip and tooth details, and damage to identity information. Fine-tuning a general model for a single person is cumbersome, requiring extensive experimentation, and the lack of explicit decoupling of lip movements and textures in these general methods easily leads to overfitting and loss of the general model's inherent ability to synchronize speech and lip shape.

[0095] The lip shape generation method in this embodiment decouples the lip shape and lip texture (that is, generates the lip shape and lip texture separately). When fine-tuning, only the ability of the model to generate lip texture needs to be adjusted. Therefore, only a single adapter is needed, which is not easy to cause overfitting and will not lose the synchronization ability of the general model's speech and lip shape.

[0096] Figure 6 A flowchart illustrating a training method for a lip shape generation model provided in an exemplary embodiment of this disclosure is shown. This method can be performed by a computer device. See also Figure 6 The method includes: In step 601, the lip shape parameter sequence corresponding to the sample speech is obtained.

[0097] The details of step 601 are as described in step A above and will not be elaborated here.

[0098] In this embodiment, the structure of the lip shape generation model is the same as described above. Figure 2 The structure of the lip shape generation model is the same. In the lip shape generation model, step 601 is executed through the lip shape parameter generation module 201. Therefore, the lip shape parameter generation module 201 needs to be trained first.

[0099] In one possible implementation, the training lip shape parameter generation module 201 is implemented using the following steps: DF.

[0100] Step D: Obtain the second dataset.

[0101] The second dataset includes multiple speech samples and multiple lip shape parameter sequences, with each speech sample corresponding to one lip shape parameter sequence.

[0102] Step E: Input the second speech into the lip shape parameter generation module to obtain the first lip shape parameter sequence output by the lip shape parameter generation module.

[0103] The second speech is any speech data from the second dataset.

[0104] Step F: Based on the mean square error between the lip shape parameter sequence corresponding to the second speech and the first lip shape parameter sequence in the second dataset, train the lip shape parameter generation module.

[0105] The essence of step F is to use the mean squared error (MSE) between the lip shape parameter sequence corresponding to the second speech in the second dataset and the first lip shape parameter sequence as the loss, and train the lip shape generation module 201 with the goal of minimizing the loss.

[0106] In another possible implementation, the training lip shape parameter generation module 201 is implemented using the following steps GI.

[0107] Step G: Generate the fourth face image sequence using the first lip shape parameter sequence.

[0108] The faces in the fourth face image sequence are three-dimensional face models.

[0109] Step H: Generate the fifth face image sequence using the lip shape parameter sequence corresponding to the second speech in the second dataset.

[0110] The faces in the fifth face image sequence are three-dimensional face models.

[0111] Here, both steps G and H use the FLAME renderer to generate the face image sequence.

[0112] Step I: Train the lip shape parameter generation module based on the mean square error between the fourth and fifth image sequences.

[0113] The essence of step GI is to use the mean square error between geometric projection images as the loss and train the lip shape generation module 201 with the goal of minimizing the loss.

[0114] Optionally, when implementing the training lip shape parameter generation module 201, steps DF and GI can be used simultaneously, that is, the mean square error between the lip shape parameter sequences and the mean square error between the geometric projection images are used together as the loss to implement the training lip shape parameter generation module 201.

[0115] After the lip shape parameter generation module 201 is trained, the mapping from speech to parameters can be achieved (that is, after speech is input into the lip shape parameter generation module 201, the lip shape parameter generation module 201 will output the corresponding lip shape parameter sequence). Furthermore, the training process of the lip shape parameter generation module 201 is independent of the specific person, so it only needs to be trained once and can be widely used with different speech inputs without further fine-tuning. In subsequent steps 603, only the lip texture generation module 203 needs to be trained, without needing to train the lip shape parameter generation module 201.

[0116] In step 602, a third face image sequence is generated using the lip shape parameter sequence.

[0117] The details of step 602 are as described in step B above and will not be elaborated here.

[0118] In step 603, a lip shape generation model is trained using a third face image sequence and a sample face image sequence.

[0119] The sample face image sequence consists of multiple frames of face images of a person speaking the sample speech. The sample speech and sample face image sequences can be data from a pre-acquired training set. In this training set, each sample speech corresponds to one sample face image sequence.

[0120] In the process of training the lip shape generation model, the lip portion of the third face image sequence is used as a mask for the lip portion of the sample face image sequence to train the lip shape generation model's ability to generate lip textures.

[0121] Optionally, step 603 includes the following three steps.

[0122] The first step is to generate a mask image sequence based on the third-party face image sequence and the sample face image sequence.

[0123] The second step is to generate a second face image sequence based on the mask image sequence.

[0124] Both the first and second steps are implemented using the lip texture generation module 203 of the lip shape generation model.

[0125] The third step involves training the lip-shape generation model using the mean square error between the sample face image sequence and the second face image sequence, the perceptual loss, and the generative adversarial network training loss.

[0126] Perceptual loss can be LPIPS (Learned Perceptual Image Patch Similarity), and generative adversarial network training loss can be LSGAN (Least Squares Generative Adversarial Network).

[0127] There are many methods for obtaining mean squared error, perceptual loss, and generative adversarial network training loss, which will not be detailed here.

[0128] By training the lip shape generation model using steps 601 to 603 described above, the accuracy of the second image sequence generated by the lip shape generation model can be effectively improved.

[0129] The following are device embodiments of this application. For details not described in detail in the device embodiments, please refer to the above method embodiments.

[0130] Figure 7 A schematic diagram of the structure of a lip-forming apparatus provided in an exemplary embodiment of this disclosure is shown. See also Figure 7 The lip-shaped generating device 700 includes an acquisition module 701 and a generating module 702.

[0131] The acquisition module 701 is used to acquire the first speech, which is the speech input to the lip-shape generation model.

[0132] The generation module 702 is used to input the first speech and the first face image into the lip shape generation model to obtain the second face image sequence. The second face image sequence is used to simulate the lip shape and lip texture of the human body in the first face image when speaking the first speech. In the process of generating the second face image sequence by the lip shape generation model, the lip shape in the second face image sequence is generated first, and then the lip texture in the second face image sequence is generated based on the lip shape in the second face image sequence.

[0133] Optionally, the generation module 702 is further configured to obtain a lip shape parameter sequence corresponding to the first speech based on the first speech; generate a third face image sequence using the lip shape parameter sequence, wherein the face in the third face image sequence is a three-dimensional face model, and the third face image sequence is used to indicate the lip shape changes when the human body speaks the first speech; and predict the lip texture of the first face image in the third face image sequence based on the lip part of the third face image sequence to obtain a second face image sequence.

[0134] Optionally, the generation module 702 is further configured to use the lip portion of the third face image sequence as a mask for the first face image to obtain a mask image sequence; obtain a mask feature sequence, which includes multiple mask feature sets, each of which corresponds to a mask image in the mask image sequence; and predict the lip texture of the mask portion in the mask image sequence based on the mask feature sequence to obtain a second face image sequence.

[0135] Optionally, the acquisition module 701 is further configured to acquire the speech feature sequence of the first speech; acquire a set of lip shape semantic vectors, the set of lip shape semantic vectors includes multiple lip shape semantic vectors, the lip shape semantic vectors are determined based on the lip shape-related benchmark expressions in Blendshape expressions; and use a cross-attention mechanism to process the speech feature sequence and the lip shape semantic set to obtain a lip shape parameter sequence.

[0136] Figure 8 A schematic diagram of a training apparatus for a lip shape generation model provided in an exemplary embodiment of this disclosure is shown. See also Figure 8The training device 800 for the lip shape generation model includes: an acquisition module 801, a generation module 802, and a training module 803.

[0137] The acquisition module 801 is used to acquire the lip shape parameter sequence corresponding to the sample speech.

[0138] The generation module 802 is used to generate a third face image sequence using the lip shape parameter sequence.

[0139] The training module 803 is used to train a lip shape generation model using a third face image sequence and a sample face image sequence. The sample face image sequence consists of multiple frames of face images when a person speaks sample speech. During the training of the lip shape generation model, the lip portion of the third face image sequence is used as a mask for the lip portion of the first face image sequence to train the lip shape generation model's ability to generate lip textures. The first speech, the lip shape parameter sequence, and the third face image sequence are obtained using the lip shape generation method of the first aspect.

[0140] Optionally, after using the lip portion of the third face image sequence as a mask for the lip portion of the first face image sequence, a mask image sequence corresponding to the sample speech is obtained. The lip shape generation model further includes a single-person adapter, which is connected to an encoder and a decoder. The encoder is used to obtain the mask feature sequence corresponding to the mask image sequence, and the decoder is used to predict the lip texture of the mask portion in the mask image sequence based on the mask feature sequence. The device also includes a fine-tuning module 804. The fine-tuning module 804 is used to fine-tune the single-person adapter based on a first dataset, which includes multiple speech-face image pairs of a single person, and each face image in the first dataset includes lip shapes.

[0141] It should be noted that the lip-shape generation device provided in the above embodiments, when generating lip shapes, or the lip-shape generation model training device, when training lip-shape generation models, is only illustrated by the division of the above functional modules. In practical applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above. Furthermore, the lip-shape generation device and the lip-shape generation method embodiments provided in the above embodiments belong to the same concept, and the lip-shape generation model training device and the lip-shape generation model training method embodiments provided in the above embodiments belong to the same concept. For details of their implementation, please refer to the method embodiments, which will not be repeated here.

[0142] The module division in this embodiment is illustrative and represents only one logical functional division. In actual implementation, other division methods are possible. Furthermore, the functional modules in the various embodiments of this disclosure can be integrated into a single processor, exist as separate physical entities, or be integrated into a single module. The integrated modules described above can be implemented in hardware or as software functional modules.

[0143] If the integrated module is implemented as a software functional module and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this disclosure, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a terminal device (which may be a personal computer, mobile phone, or communication device, etc.) or processor to execute all or part of the steps of the methods of the various embodiments of this disclosure. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0144] Figure 9 This is a schematic diagram of the structure of a computer device provided in an embodiment of this disclosure. For example... Figure 9 As shown, the computer device 900 includes a processor 901 and a memory 902.

[0145] Processor 901 may include one or more processing cores, such as a quad-core processor, an octa-core processor, etc. Processor 901 may be implemented using at least one hardware form selected from DSP (Digital Signal Processing), FPGA (Field-Programmable Gate Array), and PLA (Programmable Logic Array). Processor 901 may also include a main processor and a coprocessor. The main processor, also known as a CPU (Central Processing Unit), is used to process data in the wake-up state; the coprocessor is a low-power processor used to process data in the standby state. In some embodiments, processor 901 may integrate a GPU (Graphics Processing Unit), which is responsible for rendering and drawing the content to be displayed on the screen. In some embodiments, processor 901 may also include an AI (Artificial Intelligence) processor, which is used to handle computational operations related to machine learning.

[0146] The memory 902 may include one or more computer-readable storage media, which may be non-transitory. The memory 902 may also include high-speed random access memory and non-volatile memory, such as one or more disk storage devices or flash memory devices. In some embodiments, the non-transitory computer-readable storage media in the memory 902 are used to store at least one instruction, which is executed by the processor 901 to implement the lip-shape generation method and the lip-shape generation model training method provided in the embodiments of this disclosure.

[0147] Those skilled in the art will understand that Figure 9 The structure shown does not constitute a limitation on the computer device 900, and may include more or fewer components than shown, or combine certain components, or use different component arrangements.

[0148] This disclosure also provides a non-transitory computer-readable storage medium, wherein when the instructions in the storage medium are executed by the processor of a computer device, the computer device is able to execute the lip-shape generation method and the lip-shape generation model training method provided in this disclosure.

[0149] This disclosure also provides a computer program product, including a computer program / instruction, which, when executed by a processor, implements the lip shape generation method and the lip shape generation model training method provided in this disclosure.

[0150] The above description is merely an optional embodiment of this disclosure and is not intended to limit this disclosure. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this disclosure should be included within the protection scope of this disclosure.

Claims

1. A method for generating lip shapes, characterized in that, The method includes: Obtain the first speech, which is the speech input to the lip-shape generation model; The first speech and the first face image are input into the lip shape generation model to obtain a second face image sequence. The second face image sequence is used to simulate the lip shape and lip texture of the human body in the first face image when speaking the first speech. In the process of generating the second face image sequence by the lip shape generation model, the lip shape in the second face image sequence is generated first, and then the lip texture in the second face image sequence is generated based on the lip shape in the second face image sequence. When generating the lip texture in the second face image sequence based on the lip shape in the second face image sequence, the lip part of the third face image sequence is used as a mask for the first face image. The face in the third face image sequence is a three-dimensional face model used to indicate the lip shape change when the human body speaks the first speech. The mask carries lip shape information and has a geometric prior guiding role for the lip shape generation model.

2. The lip-shape generation method according to claim 1, characterized in that, The lip shape generation model generates the second face image sequence in the following manner: Based on the first speech, obtain the lip shape parameter sequence corresponding to the first speech; A third face image is generated for each lip shape parameter in the lip shape parameter sequence to obtain a third face image sequence. The face in the third face image sequence is a three-dimensional face model. The third face image sequence is used to indicate the lip shape changes when a human speaks the first speech. Based on the lip portion of the third face image sequence, the lip texture of the first face image in the third face image sequence is predicted to obtain the second face image sequence.

3. The lip-shape generation method according to claim 2, characterized in that, The step of predicting the lip texture of the first face image in the third face image sequence based on the lip portion of the third face image sequence to obtain the second face image sequence includes: The lip portion of the third face image sequence is used as a mask for the first face image to obtain a mask image sequence. Obtain a mask feature sequence, the mask feature sequence including multiple mask feature sets, each mask feature set corresponding to a mask image in the mask image sequence; Based on the mask feature sequence, the lip texture of the masked portion in the masked image sequence is predicted to obtain the second face image sequence.

4. The lip-shape generation method according to claim 2 or 3, characterized in that, The step of obtaining the lip shape parameter sequence corresponding to the first speech includes: Obtain the speech feature sequence of the first speech; Obtain a set of lip shape semantic vectors, which includes multiple lip shape semantic vectors, and the lip shape semantic vectors are determined based on the lip shape-related baseline expressions in Blendshape expressions; The speech feature sequence and the lip shape semantic set are processed using a cross-attention mechanism to obtain the lip shape parameter sequence.

5. A training method for a lip shape generation model, characterized in that, The method includes: Obtain the lip shape parameter sequence corresponding to the sample speech; The lip shape parameter sequence is used to generate a third face image sequence; The lip shape generation model is trained using the third face image sequence and the sample face image sequence, wherein the sample face image sequence consists of multiple frames of face images when a person speaks the sample speech. In the process of training the lip shape generation model, the lip portion of the third face image sequence is used as a mask for the lip portion of the sample face image sequence to train the lip shape generation model's ability to generate lip textures. The mask carries lip shape information and has a geometric prior guiding role for the lip shape generation model.

6. The method according to claim 5, characterized in that, After using the lip portion of the third face image sequence as a mask for the lip portion of the sample face image sequence, a mask image sequence corresponding to the sample speech is obtained. The lip shape generation model also includes a single-person adapter connected to an encoder and a decoder. The encoder is used to obtain a mask feature sequence corresponding to the mask image sequence, and the decoder is used to predict the lip texture of the masked portion in the mask image sequence based on the mask feature sequence. The method further includes: Based on the first dataset, the single-person adapter is fine-tuned. The first dataset includes multiple voice-face image pairs of a single person, and each face image in the first dataset includes lip shapes.

7. A lip-shaped generating device, characterized in that, The device includes: The acquisition module is used to acquire the first speech, which is the speech input to the lip-shape generation model; The generation module is used to input the first speech and the first face image into the lip shape generation model to obtain a second face image sequence. The second face image sequence is used to simulate the lip shape and lip texture of the human body in the first face image when speaking the first speech. In the process of generating the second face image sequence by the lip shape generation model, the lip shape in the second face image sequence is generated first, and then the lip texture in the second face image sequence is generated based on the lip shape in the second face image sequence. When generating the lip texture in the second face image sequence based on the lip shape in the second face image sequence, the lip part of the third face image sequence is used as a mask for the first face image. The face in the third face image sequence is a three-dimensional face model used to indicate the lip shape change when the human body speaks the first speech. The mask carries lip shape information and has a geometric prior guiding role for the lip shape generation model.

8. A training device for a lip shape generation model, characterized in that, The device includes: The acquisition module is used to acquire the lip shape parameter sequence corresponding to the sample speech; The generation module is used to generate a third face image sequence using the lip shape parameter sequence; The training module is used to train the lip shape generation model using the third face image sequence and the sample face image sequence, wherein the sample face image sequence is a multi-frame face image of a human speaking the sample speech; In the process of training the lip shape generation model, the lip portion of the third face image sequence is used as a mask for the lip portion of the sample face image sequence to train the lip shape generation model's ability to generate lip textures. The mask carries lip shape information and has a geometric prior guiding role for the lip shape generation model.

9. A computer device, characterized in that, The computer device includes a memory and a processor, wherein the memory stores at least one computer program, which is loaded and executed by the processor to implement the method according to any one of claims 1 to 4 or any one of claims 5 to 6.

10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores at least one computer program, which is loaded and executed by a processor to implement the method of any one of claims 1 to 4 or any one of claims 5 to 6.