Image generation method and related device

By extracting and processing the audio and emotional information in the facial image, the target facial image frame is generated, which solves the problem of low facial image generation efficiency in the existing technology and achieves fast and efficient facial posture adjustment.

WO2024051445A9PCT designated stage expired Publication Date: 2024-09-12TENCENT TECHNOLOGY (SHENZHEN) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
PCT/CN2023/112814
Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Priority Date
2022-09-05
Filing Date
2023-08-14
Publication Date
2024-09-12

AI Technical Summary

Technical Problem

When acquiring facial images in different facial postures, the existing technology requires manual drawing, which is time-consuming and labor-intensive, and has low efficiency.

Method used

By obtaining the original facial image, audio-driven information and emotion-driven information, spatial feature extraction and feature interaction processing are performed to generate target facial image frames and improve the efficiency and accuracy of facial image generation.

Benefits of technology

It achieves fast and efficient generation of target facial image frames, improves the efficiency and accuracy of image generation, and reduces the need for manual drawing.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN2023112814_12092024_PF_FP_ABST
    Figure CN2023112814_12092024_PF_FP_ABST
Patent Text Reader

Abstract

The present application discloses an image generation method and a related device. Related embodiments can be applied to various scenes such as cloud technology, artificial intelligence, smart transportation and assisted driving. The method comprises: obtaining an original facial image frame of an object to be adjusted, audio driving information and emotion driving information; performing spatial feature extraction on the original facial image frame to obtain an original facial spatial feature; performing feature interaction on the audio driving information and the emotion driving information to obtain a local facial posture feature; and performing facial reconstruction on the object to be adjusted on the basis of the original facial spatial feature and the local facial posture feature to generate a target facial image frame. The present application can utilize the audio driving information and the emotion driving information to capture the facial posture detail information of the object to be adjusted, then performs facial adjustment on the original facial image frame, and obtains the corresponding target facial image frame, so as to improve the generation efficiency and accuracy of the target facial image frame.
Need to check novelty before this filing date? Find Prior Art

Description

Image generation method and related device

[0001] This application claims priority to the Chinese patent application filed with the China Patent Office on September 5, 2022, with application number 202211080126.5 and application name “Image Generation Method and Related Equipment”, the entire contents of which are incorporated by reference into this application. Technical Field

[0002] The present application relates to the field of computer technology, and in particular to image generation technology. Background Art

[0003] With the development of computer technology, image processing technology has been applied to more and more fields. For example, image processing technology can include image generation, specifically facial image generation, which can be applied to fields such as animation production.

[0004] In the current related technologies, if facial images of the same object to be adjusted in different facial postures are to be obtained, modelers and animators are required to draw the facial images in each facial posture respectively. This image generation method is relatively time-consuming and labor-intensive, and the image generation efficiency is low.

[0005] Summary of the Invention

[0006] Embodiments of the present application provide an image generation method and related equipment. The related equipment may include an image generation device, an electronic device, a computer-readable storage medium, and a computer program product, which can improve the generation efficiency and accuracy of target facial image frames.

[0007] An embodiment of the present application provides an image generation method, which is executed by an electronic device and includes:

[0008] Acquiring an original facial image frame of a subject to be adjusted, audio driving information, and emotion driving information, wherein the original facial image frame includes the original face of the subject to be adjusted, the audio driving information includes the speech content of the subject to be adjusted, and drives the facial posture of the original face to change according to the speech content; and the emotion driving information is used to describe the target emotion of the subject to be adjusted when the speech content is uttered, and drives the facial posture of the original face to change according to the target emotion;

[0009] Performing spatial feature extraction on the original facial image frame to obtain original facial spatial features corresponding to the original facial image frame;

[0010] Performing feature interaction processing on the audio driving information and the emotion driving information to obtain local facial posture features of the object to be adjusted when emitting the speech content under the target emotion;

[0011] Based on the original facial spatial features and the local facial posture features, facial reconstruction processing is performed on the object to be adjusted to generate a target facial image frame.

[0012] Accordingly, an embodiment of the present application provides an image generating device, which is deployed on an electronic device and includes:

[0013] an acquisition unit, configured to acquire an original facial image frame of a subject to be adjusted, audio driving information, and emotion driving information, wherein the original facial image frame includes the original face of the subject to be adjusted, the audio driving information includes the speech content of the subject to be adjusted, so as to drive the facial posture of the original face to change according to the speech content, and the emotion driving information is used to describe the target emotion of the subject to be adjusted when uttering the speech content, so as to drive the facial posture of the original face to change according to the target emotion;

[0014] an extraction unit, configured to extract spatial features from the original facial image frame to obtain original facial spatial features corresponding to the original facial image frame;

[0015] An interaction unit, configured to perform feature interaction processing on the audio driving information and the emotion driving information to obtain local facial gesture features of the object to be adjusted when emitting the speech content under the target emotion;

[0016] The reconstruction unit is used to perform facial reconstruction processing on the object to be adjusted based on the original facial spatial features and the facial local posture features to generate a target facial image frame.

[0017] An electronic device provided in an embodiment of the present application includes a processor and a memory, wherein the memory stores a computer program, and the processor loads the computer program to execute the method provided in the embodiment of the present application.

[0018] An embodiment of the present application further provides a computer-readable storage medium having a computer program stored thereon, wherein the computer program, when executed by a processor, implements the method provided in the embodiment of the present application.

[0019] In addition, an embodiment of the present application also provides a computer program product, including a computer program, which implements the method provided in the embodiment of the present application when executed by a processor.

[0020] Embodiments of the present application provide an image generation method and related apparatus that can obtain an original facial image frame, audio-driven information, and emotion-driven information of a subject to be adjusted. The original facial image frame includes the original face of the subject to be adjusted, the audio-driven information includes the speech content of the subject to be adjusted, and drives the facial posture of the original face to change according to the speech content. The emotion-driven information describes the target emotion of the subject to be adjusted when the speech content is uttered, and drives the facial posture of the original face to change according to the target emotion. Spatial features are extracted from the original facial image frame to obtain original facial spatial features corresponding to the original facial image frame. The audio-driven information and the emotion-driven information are interactively processed to obtain local facial posture features of the subject to be adjusted. The local facial posture features can reflect the facial posture changes caused by the current speech content and emotion. Based on the original facial spatial features and the local facial posture features, the subject to be adjusted is reconstructed, thereby generating a target facial image frame based on the original facial image frame. The present application can utilize the audio-driven information and the emotion-driven information to capture detailed facial posture information of a portion of the subject to be adjusted, and then perform facial adjustments on the original facial image frame based on the captured information to obtain the corresponding target facial image frame. This method can improve the efficiency and accuracy of generating the target facial image frame. BRIEF DESCRIPTION OF THE DRAWINGS

[0021] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present application. For those skilled in the art, other drawings can be obtained based on these drawings without creative work.

[0022] FIG1a is a schematic diagram of a scene of an image generation method provided in an embodiment of the present application;

[0023] FIG1b is a flow chart of an image generation method provided in an embodiment of the present application;

[0024] FIG1c is an illustration of an image generation method provided in an embodiment of the present application;

[0025] FIG1d is another diagram illustrating the image generation method provided in an embodiment of the present application;

[0026] FIG1e is a model structure diagram of the image generation method provided in an embodiment of the present application;

[0027] FIG1f is another model structure diagram of the image generation method provided in an embodiment of the present application;

[0028] FIG2 is another flow chart of the image generation method provided in an embodiment of the present application;

[0029] FIG3 is a schematic structural diagram of an image generating device provided in an embodiment of the present application;

[0030] FIG4 is a schematic structural diagram of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0031] The following will be combined with the drawings in the embodiments of this application to clearly and completely describe the technical solutions in the embodiments of this application. Obviously, the embodiments described are only part of the embodiments of this application, not all of the embodiments. Based on the embodiments in this application, all other embodiments obtained by those skilled in the art without making creative efforts are within the scope of protection of this application.

[0032] The present invention provides an image generation method and related devices, which may include an image generation device, an electronic device, a computer-readable storage medium, and a computer program product. The image generation device may be integrated into an electronic device, which may be a terminal or a server.

[0033] It is understandable that the image generation method of this embodiment can be executed on a terminal, on a server, or jointly by a terminal and a server. The above examples should not be construed as limiting the present application.

[0034] As shown in Figure 1a, taking the example of a terminal and a server jointly executing an image generation method, the image generation system provided in the embodiment of the present application includes a terminal 10 and a server 11, etc.; the terminal 10 and the server 11 are connected via a network, such as a wired or wireless network, wherein the image generation device can be integrated into the server.

[0035] The server 11 can be configured to: obtain an original facial image frame, audio-driven information, and emotion-driven information of the subject to be adjusted, wherein the original facial image frame includes the original face of the subject to be adjusted; the audio-driven information includes the voice content of the subject to be adjusted, thereby driving the facial posture of the original face to change according to the voice content; and the emotion-driven information describes the target emotion of the subject to be adjusted when the voice content is uttered, thereby driving the facial posture of the original face to change according to the target emotion; extract spatial features from the original facial image frame to obtain original facial spatial features corresponding to the original facial image frame; perform feature interaction processing on the audio-driven information and the emotion-driven information to obtain local facial posture features of the subject to be adjusted; perform facial reconstruction processing on the subject to be adjusted based on the original facial spatial features and local facial posture features, generate a target facial image frame, and transmit the target facial image frame to the terminal 10. The server 11 can be a single server, or a server cluster or cloud server composed of multiple servers. In the image generation method or device disclosed in this application, the multiple servers can be combined into a blockchain, and the servers are nodes on the blockchain.

[0036] The terminal 10 can be configured to receive the target facial image frame sent by the server 11. The terminal 10 can include a mobile phone, a smart TV, a tablet computer, a laptop computer, a personal computer (PC), an intelligent voice interaction device, a smart home appliance, a vehicle-mounted terminal, or an aircraft. The terminal 10 can also be configured with a client, which can be an application client or a browser client.

[0037] The step of generating the target facial image frame by the server 11 may also be performed by the terminal 10 .

[0038] The image generation method provided in the embodiments of the present application relates to computer vision technology, speech technology, and natural language processing in the field of artificial intelligence.

[0039] It should be noted that the order of description of the following embodiments is not intended to limit the preferred order of the embodiments.

[0040] This embodiment will be described from the perspective of an image generating device. The image generating device may be integrated into an electronic device, which may be a server, a terminal or other device.

[0041] It is understandable that in the specific implementation of this application, related data such as user information is involved. When the above embodiments of this application are applied to specific products or technologies, user permission or consent is required, and the collection, use and processing of relevant data must comply with relevant laws, regulations and standards of relevant countries and regions.

[0042] This embodiment can be applied to various scenarios such as cloud technology, artificial intelligence, smart transportation, and assisted driving.

[0043] As shown in FIG1b , the specific process of the image generation method may be as follows:

[0044] 101. Obtain original facial image frames, audio driving information, and emotion driving information.

[0045] The original facial image frame includes the original face of the subject to be adjusted, i.e., the original facial image frame is an image containing the original face of the subject to be adjusted. The subject to be adjusted may be a subject whose facial posture is to be adjusted. The facial posture herein may specifically refer to facial expression, such as lip shape, eye contact, and other facial information of the subject, which is not limited in this embodiment. The emotion expressed on the face of the subject to be adjusted in the target facial image frame may correspond to the emotion-driven information, and the lip shape of the subject to be adjusted in the target facial image frame may correspond to the audio-driven information.

[0046] Among them, the audio driving information is audio information used to drive the facial posture of the original face to change, and the audio driving information includes the voice content of the object to be adjusted to drive the facial posture of the original face to change according to the voice content, and the change here is mainly the change of the mouth shape. In order to improve the efficiency of image generation, in an embodiment of the present application, the audio driving information can be used to replace the facial posture of the object to be adjusted in the original facial image frame with the corresponding facial posture when the object to be adjusted speaks, so as to obtain a target facial image frame, wherein the audio information (i.e., voice content) corresponding to the speech of the object to be adjusted is the audio driving information, and the audio driving information is mainly based on the driving information of the voice content emitted by the object to be adjusted. The audio length corresponding to the audio driving information can be 1 second or 2 seconds, and this embodiment does not impose any restrictions on this.

[0047] The emotion-driven information is information used to drive a change in the original facial posture. The emotion-driven information describes the target emotion of the subject being adjusted when speaking, driving the original facial posture to change according to the target emotion, thereby adjusting the facial posture to the target emotion represented by the emotion-driven information. The emotion-driven information is primarily based on the emotion of the subject being adjusted. This emotion-driven information can be carried in a variety of formats, such as text, audio, images, and video, and this embodiment does not impose any limitations on this.

[0048] For example, the emotion driving information may be text containing emotion description information of “angry”. Based on the emotion driving information, the facial posture of the object to be adjusted in the target facial image frame finally generated may be in an angry mood.

[0049] For another example, the emotion-driven information may be an audio clip containing the emotion of "panic". Based on the emotion recognition of the audio clip, an emotion recognition result - "panic" - may be obtained. The facial posture of the object to be adjusted in the target facial image frame generated based on the emotion recognition result may be in the emotion of "panic".

[0050] For another example, the emotion-driven information may be an image containing the emotion information of "excitement". Based on the emotion recognition of the image, an emotion recognition result - "excitement" can be obtained. The facial posture of the object to be adjusted in the target facial image frame generated based on the emotion recognition result may be in the emotion of "excitement".

[0051] In this embodiment, the voice content of the object to be adjusted contained in the audio driving information can be used to determine the change information such as the lip shape of the object to be adjusted when speaking, and the target emotion contained in the emotion driving information can be used to determine the posture information such as the eyes of the object to be adjusted, and then comprehensively determine the facial posture changes of the object to be adjusted.

[0052] For example, if the audio driving information includes the voice content of "hello," then the lip shape of the object to be adjusted can be simply determined based on the audio driving information, ensuring that the lip shape is the lip shape of the word "hello." If the target emotion represented by the emotion driving information is "anger," then although the lip shape is still the lip shape of the word "hello," because the target emotion is "anger," the change in emotion will affect the facial posture of parts such as the eyes. Therefore, the facial posture changes caused by the target emotion can be superimposed on the lip shape of the word "hello."

[0053] In some embodiments, the emotion of the object to be adjusted can also be judged based on the speech content and volume of the object to be adjusted contained in the audio driving information, and the facial posture changes of the object to be adjusted can be determined by combining the judgment result and the emotion driving information.

[0054] In a specific scenario, this embodiment can obtain multiple audio driving information and emotion driving information of the object to be adjusted, and for each audio driving information, generate a target facial image frame under the target emotion corresponding to each audio driving information according to the target emotion corresponding to each audio driving information and emotion driving information and the original facial image frame, and then splice the target facial image frames under the target emotion corresponding to each audio driving information to generate a target facial video clip corresponding to the object to be adjusted under the target emotion. The target facial video clip contains the facial posture change process of the object to be adjusted when speaking under the target emotion, and the audio information corresponding to the speech of the object to be adjusted is each segment of audio driving information. It should be noted that the protagonist in the target facial video clip is still the object's face in the original facial image frame, and the expression (especially the lip shape) of the object to be adjusted in the generated target facial video clip corresponds to the emotion driving information and each segment of audio driving information.

[0055] In one embodiment, the present application can also be applied to the scenario of video restoration. For example, if a speech video of the object to be adjusted is damaged and some video frames in the speech video are lost, the lost video frames can be restored based on the image generation method provided by the present application by utilizing other video frames in the speech video, the audio information corresponding to the lost video frames, and the emotion tags. The audio information used for restoration can specifically be an audio clip of 1 second before and after the lost video frame in the speech video. This audio clip is also the audio driving information in the above embodiment. The emotion tag can be the emotion tag corresponding to the speech video, or the emotion tag of the speaker in the video frames before and after the lost video frame. This embodiment does not limit this.

[0056] As shown in Figure 1c, taking a human face as an example, the target facial image frame is generated based on the original facial image frame, audio-driven information, and emotion-driven information (such as the emotional description of "contempt"). The person's lip shape in the target facial image frame matches the audio-driven information, and the person's emotion is consistent with the emotion-driven information. The original facial image frame can be regarded as the original facial image to be driven.

[0057] 102. Perform spatial feature extraction on the original facial image frame to obtain original facial spatial features corresponding to the original facial image frame.

[0058] The original facial spatial features may specifically include 3D (three-dimensional) facial coefficients corresponding to the original facial image frame, such as identity information, lighting, texture, expression, pose, gaze, etc. The face of the original facial image frame can be reconstructed based on these facial coefficients.

[0059] The spatial feature extraction of the original facial image frame may specifically include performing convolution processing and pooling processing on the original facial image frame, which is not limited in this embodiment.

[0060] In this embodiment, spatial features can be extracted from the original facial image frame through an image feature extraction network, wherein the image feature extraction network can specifically be a neural network model, and the neural network can be a visual geometry group network (VGGNet, Visual Geometry Group Network), a residual network (ResNet, Residual Network) and a densely connected convolutional network (DenseNet, Dense Convolutional Network), etc. However, it should be understood that the neural network of this embodiment is not limited to the types listed above.

[0061] The image feature extraction network may be pre-trained, and the three-dimensional facial coefficient corresponding to the facial image may be predicted through the image feature extraction network.

[0062] In a specific scenario, ResNet50 or other network structures can be used to extract the original facial spatial features corresponding to the original facial image frame. The feature extraction process can be expressed by the following formula (1): coeff = D3DFR (I face ) (1)

[0063] Among them, coeff is the three-dimensional facial coefficient, that is, the original facial spatial features corresponding to the original facial image frame. D3DFR can represent ResNet50 or other network structures. face Represents the original facial image frame.

[0064] After extracting the original facial spatial features, features associated with the facial posture of the object to be adjusted can also be screened from the original facial spatial features. For example, identity information, light and shadow, texture, expression, posture, eye contact and other three-dimensional facial coefficients can be extracted from the original facial spatial features, and these three-dimensional facial coefficients can be used as the final original facial spatial features.

[0065] 103. Perform feature interaction processing on the audio driving information and the emotion driving information to obtain local facial posture features of the object to be adjusted when uttering the speech content under the target emotion.

[0066] Feature interaction refers to combining different features according to certain rules to form new features. Feature interaction can help capture the relationships between features, learn and utilize information in the data from multiple perspectives, and thus enhance the model's predictive performance. Rules can include addition, multiplication, squaring, and root extraction, for example.

[0067] That is, in the embodiments of the present application, the audio-driven information and the emotion-driven information can be combined according to certain rules to obtain local facial posture features. For example, the audio-driven information and the emotion-driven information can be added to obtain local facial posture features, or the audio-driven information and the emotion-driven information can be multiplied to obtain local facial posture features, and so on.

[0068] In this embodiment, the method of performing feature interaction processing on the audio driving information and the emotion driving information to obtain the facial local posture features of the object to be adjusted when emitting speech content under the target emotion may be:

[0069] Performing feature interaction processing on audio-driven information and emotion-driven information to obtain interactive feature information;

[0070] Predict local facial posture features based on interactive feature information and emotion-driven information.

[0071] The audio driving information may specifically be an audio driving sequence, which may include at least one audio frame.

[0072] Among them, performing feature interaction processing on audio-driven information and emotion-driven information may refer to combining audio-driven information and emotion-driven information according to certain rules to form new information, namely, interactive feature information. Interactive feature information may be information obtained by combining multiple features, which may reflect the relationship between different features to a certain extent. In some embodiments, semantic feature extraction may be performed on the emotion-driven information first to obtain the emotional semantic features corresponding to the emotion-driven information; and vectorization processing may be performed on each audio frame in the audio-driven information to obtain the initial feature vector corresponding to each audio frame, and then dimension mapping may be performed on the initial feature vector of each audio frame to obtain the audio feature vector corresponding to each audio frame. Among them, through dimension mapping, the vector dimension of the initial feature vector may be converted, so that the vector dimension of the audio feature vector of each audio frame may be consistent. Then, feature interaction may be performed on the emotional semantic features and the audio feature vector of each audio frame to obtain interactive feature information.

[0073] In one possible implementation, the specific process of feature interaction processing may include: arranging the strings corresponding to each audio frame in the audio driving information in the order of the audio frames to obtain an arranged string sequence; adding the strings corresponding to the emotion driving information to the arranged string sequence to obtain an updated string sequence; extracting the string feature information for each string in the updated string sequence; processing the string feature information based on the feature information of the preceding and following strings; fusing the processed feature information of each string to obtain interactive feature information; and predicting local facial posture features based on the interactive feature information and the emotion driving information. The prediction method may be implemented using a neural network model, which may be pre-trained.

[0074] The emotional semantic features corresponding to the emotional driving information are regarded as a token (character string), and the audio feature vector of each audio frame in the audio driving information is regarded as a token. The specific process of the above-mentioned feature interaction processing can be: the tokens corresponding to each audio frame can be arranged in the order of the audio frames to obtain an arranged token sequence, and then the token corresponding to the emotional driving information is added to the arranged token sequence, such as at the head or tail of the queue, so as to obtain the target token sequence. For each token in the target token sequence, its feature information is extracted, and then the feature information of the token is processed based on the feature information of the previous and next tokens of each token. Based on the feature information of each token after processing, interactive feature information is obtained. For example, the feature information of each token after processing can be fused to obtain interactive feature information. The fusion method can be splicing or weighted operation.

[0075] In this embodiment, the audio driving information may include multiple audio frames, and the audio driving information and the emotion driving information are subjected to feature interaction processing to obtain the interactive feature information in the following manner:

[0076] Extracting object identity information from raw facial spatial features;

[0077] Encoding position information of each audio frame in the audio driving information of the multiple audio frames to obtain a position code of each audio frame, and combining the position codes corresponding to the multiple audio frames to obtain position code information corresponding to the audio driving information;

[0078] The object identity information, position coding information, audio driving information and emotion driving information are subjected to feature interaction processing to obtain interactive feature information.

[0079] In some embodiments, the original facial spatial features may include object identity information, light and shadow, texture, expression, posture, eye contact and other three-dimensional facial coefficients corresponding to the original facial image frame, from which the object identity information corresponding to the object to be adjusted can be extracted.

[0080] The position coding information corresponding to the audio driving information may include the frame number of each audio frame in the audio driving information. In the feature interaction processing process, adding the position coding information can integrate the temporal features of the audio driving information into the interaction feature information.

[0081] By combining object identity information, position encoding information, audio driving information and emotion driving information for feature interaction processing, the accuracy of feature interaction information is improved, so that more realistic facial image frames can be reconstructed subsequently.

[0082] In one possible implementation, based on the interactive feature information and the emotion-driven information, the method for predicting the local facial posture features may be:

[0083] Fuse the interactive feature information and the emotion-driven information to obtain fused feature information;

[0084] The fused feature information is decoded to obtain the local facial posture features.

[0085] There are many ways to fuse the interactive feature information and the emotion-driven information, which are not limited in this embodiment. For example, the fusion method can be splicing processing or weighted calculation.

[0086] The fused feature information is decoded, and specifically, attention is performed on the fused feature information, thereby obtaining local facial posture features corresponding to the target facial image frame.

[0087] Considering that emotions often involve intensity (i.e., strength), facial reconstruction can also be performed in combination with emotion intensity information. Based on this, in one possible implementation, the audio-driven information and emotion-driven information are interactively processed to obtain local facial posture features in the following way:

[0088] Obtaining preset emotion intensity information corresponding to the emotion driving information;

[0089] The audio driving information, emotion driving information and preset emotion intensity information are interactively processed to obtain the facial local posture features and updated emotion intensity information corresponding to the target facial image frame, so that the facial local posture features and the updated emotion intensity information can be used for subsequent facial reconstruction processing to obtain a more realistic facial image frame.

[0090] Emotional intensity information can reflect the intensity of an emotion. For example, if the emotion is happiness, the intensity of happiness can vary, which in turn leads to different changes in facial posture. Consequently, the facial posture changes caused by the emotion-driven information vary. Therefore, local facial posture features can be determined based on the emotion intensity information. The emotion intensity information used here can be pre-set emotion intensity information, i.e., preset emotion intensity information. The preset emotion intensity information can be set based on actual circumstances and can be arbitrarily set, which is not limited in this embodiment. It should be noted that the preset emotion intensity information is learnable.

[0091] For example, a mapping relationship between different emotions, emotion intensity information and the degree of change in facial posture can be established in advance. In this way, after obtaining the emotion driving information and preset emotion intensity information, the degree of change in facial posture can be determined based on the mapping relationship, and then combined with the voice content included in the audio driving information to obtain the local facial posture features, thereby adjusting the facial posture of the object to be adjusted.

[0092] The updated emotion intensity information may be learned emotion intensity information, which can be used to represent the intensity of emotions.

[0093] In one specific embodiment, a Transformer network, commonly used in sequence modeling, can be used to convert audio-driven and emotion-driven information into local facial gesture features. The Transformer is a model composed entirely of an attention mechanism and generally includes an encoder and a decoder. The input to the Transformer network can be a sequence, with each part of the sequence being called a token.

[0094] When using audio and emotion description to drive the generation of facial images, the audio driving information can first be processed by feature processing to obtain an audio driving sequence (denoted as A 1-32 ), the audio driving sequence may include the audio feature information corresponding to each audio frame in the audio driving information. Since facial features and object identity information are closely related, the facial expression coefficient generated based only on audio and emotional description does not completely decouple the face identity information. Therefore, a token (α) can be extended, where α represents the object identity information, and the object identity information is input into the Transformer Encoder (Φ). In addition, in order to match the feature dimension in the encoder, the audio driving sequence A can be first 1-32 And the object identity information α is dimensionally mapped, and then the dimensionally mapped audio driving sequence A 1-32 and object identity information α are input into the encoder.

[0095] Among them, for emotion-driven information, the contrastive language-image pre-training (CLIP) model can be used to extract the emotional semantic features contained therein (denoted as z emo The CLIP model, specifically a multimodal pre-training model, is a multimodal model based on contrastive learning. It can learn the matching relationship between text and images. It can include a text encoder and an image encoder, which are used to extract text and image representations respectively. The CLIP model facilitates the transfer between multiple tasks and can be applied to other visual tasks.

[0096] In addition, considering that emotions often involve intensity, a learnable emotion intensity token (σ) can be extended to encode intensity information, where σ represents the preset emotion intensity information corresponding to the emotion driving information. emo The position encoding information of the audio driving information (denoted as PE, position encoding) is added to the audio driving information, object identity information and learnable emotion intensity representation (i.e., preset emotion intensity information), and then input into the encoder for feature interaction learning of audio and emotion. The feature interaction process is specifically shown in formula (2):

[0097] Wherein, z is the intermediate feature of audio-emotion fusion, that is, the interactive feature information in the above embodiment; is the updated learnable emotion intensity representation, i.e., the updated emotion intensity information in the above embodiment. Linear represents a linear layer, which can be used for dimensional mapping; φ represents an encoder.

[0098] Then, the emotion representation z corresponding to the interaction feature information z and the emotion driving information can be emo The fusion is performed, such as addition, and the fusion result is input into the Transformer Decoder (Ψ) to predict the emotion coefficient, thereby obtaining the local facial posture feature. Optionally, a fully connected layer can be designed to perform dimension mapping on the features output by the decoder to obtain the emotion coefficient under the preset dimension. The specific process is shown in formula (3):

[0099] Among them, q T It is the position encoding information of the audio driving information with a time dimension of T. Linear represents the fully connected layer, that is, the linear layer, and Ψ represents the decoder. It can be used to represent local facial posture features.

[0100] Based on the above process, the given audio driving information and emotion driving information can be finally reflected in the expression coefficients in the three-dimensional facial coefficients.

[0101] 104. Perform facial reconstruction on the object to be adjusted based on the original facial spatial features and the facial local posture features to generate a target facial image frame.

[0102] The local facial posture features can reflect the changes in facial posture caused by the current audio and emotions. Therefore, the facial reconstruction processing of the object to be adjusted can be performed based on the original facial spatial features and the local facial posture features, thereby generating a target facial image frame based on the original facial image frame. Among them, the facial reconstruction processing of the object to be adjusted provided in the embodiment of the present application is actually obtained by adjusting the original face included in the original facial image frame, thereby eliminating the need for redrawing and improving image generation efficiency. That is, the target facial image frame can specifically be the facial image corresponding to the facial posture adjustment in the original facial image frame based on the audio-driven information and the emotion-driven information.

[0103] In one possible implementation, if feature interaction processing is performed on the audio-driven information and the emotion-driven information to obtain local facial posture features corresponding to the target facial image frame, and updated emotion intensity information is also generated, then facial reconstruction processing is performed on the object to be adjusted based on the original facial spatial features and local facial posture features, and the target facial image frame is generated in the following manner:

[0104] Based on the original facial spatial features, local facial posture features and updated emotion intensity information, the face of the object to be adjusted is reconstructed to generate a target facial image frame.

[0105] The original facial spatial features, the local facial posture features, and the updated emotion intensity information can be fused to obtain fused facial spatial features. This fusion can be performed in a variety of ways, which are not limited in this embodiment. For example, the fusion method can be splicing or weighted fusion. After the fusion process, the face of the object to be adjusted is reconstructed based on the fused facial spatial features to generate a target facial image frame.

[0106] The above method takes into account that emotions often involve intensity, and the intensity of emotions can be reflected by the updated emotion intensity information. Then, when generating the target facial image frame, the impact of the intensity of emotions on facial posture is taken into account, thereby obtaining a more realistic and accurate target facial image frame.

[0107] In one possible implementation, based on the original facial spatial features and the facial local posture features, the facial reconstruction process is performed on the object to be adjusted to generate the target facial image frame in the following manner:

[0108] Fusing the original facial spatial features and the facial local posture features to obtain the fused facial spatial features;

[0109] Based on the fused facial spatial features, the face of the object to be adjusted is reconstructed to obtain a reference facial image frame corresponding to the object to be adjusted;

[0110] A target facial image frame is generated based on the original facial image frame, the fused facial spatial features and the reference facial image frame.

[0111] Among them, the local facial posture features contain part of the facial posture information in the target facial image frame to be generated. For example, the local facial posture features can include relevant three-dimensional facial coefficients such as expression, posture, eye contact, and mouth shape; and the original facial spatial features contain the facial posture information of the original facial image frame.

[0112] There are many ways to fuse the original facial spatial features and the facial local posture features. For example, the fusion method can be splicing processing or weighted fusion, etc., which is not limited in this embodiment.

[0113] In this way, the fused facial spatial features obtained contain both the main facial features of the target object and the detailed information of the specific facial expression, which is conducive to better simulating the corresponding facial posture of the target object.

[0114] In a possible implementation, based on the fused facial spatial features, facial reconstruction is performed on the object to be adjusted to obtain a reference facial image frame corresponding to the object to be adjusted. The method may be:

[0115] Based on the fused facial spatial features, the facial reconstruction process is performed on the object to be adjusted to obtain a reconstructed three-dimensional facial image corresponding to the object to be adjusted;

[0116] The reconstructed three-dimensional facial image is subjected to rendering mapping processing to obtain a reference facial image frame corresponding to the object to be adjusted.

[0117] Among them, the facial reconstruction processing of the object to be adjusted can be performed based on the fused facial spatial features through a 3DMM (3D Morphable Model) model to obtain a reconstructed three-dimensional facial image. This facial reconstruction processing is also called 3D reconstruction. 3D reconstruction can represent the input two-dimensional facial image with a 3D mesh (three-dimensional mesh model). The 3D mesh can include vertex coordinates and colors of the three-dimensional mesh structure. This embodiment can also project the 3D mesh (that is, the reconstructed three-dimensional facial image) onto a two-dimensional plane by rendering, as shown in Figure 1d. In Figure 1d, the image marked by (1) is the original facial image, and the image marked by (2) is the effect of the original facial image being projected onto the two-dimensional plane.

[0118] Among them, the texture and light of the reconstructed three-dimensional facial image can come from the original facial image frame, and the posture and expression of the reconstructed three-dimensional facial image can come from audio-driven information and emotion-driven information. The reconstructed three-dimensional facial image is rendered and mapped, and the three-dimensional image can be projected onto a two-dimensional plane to obtain a reference facial image frame corresponding to the object to be adjusted.

[0119] In one possible implementation, the fused facial spatial features may include geometric and texture features of the object to be adjusted. Based on these geometric and texture features, a reconstructed three-dimensional facial image may be constructed. Geometric features may be understood as coordinate information of key points in the 3D mesh structure of the object to be adjusted, and texture features may be understood as features indicating texture information of the object to be adjusted. There are various ways to perform facial reconstruction based on the fused facial spatial features and obtain a reconstructed three-dimensional facial image corresponding to the object to be adjusted. For example, the positional information of at least one facial key point may be extracted from the fused facial spatial features, the positional information of the facial key point may be converted into geometric features, and the texture features of the object to be adjusted may be extracted from the fused facial spatial features.

[0120] After converting the geometric and texture features, a three-dimensional object model of the object to be adjusted can be constructed, i.e., the reconstructed three-dimensional facial image in the above-mentioned embodiment. The three-dimensional object model can then be projected onto a two-dimensional plane to obtain a reference facial image frame. There are various ways to obtain the reference facial image frame. For example, three-dimensional model parameters of the object to be adjusted can be determined based on the geometric and texture features. A three-dimensional object model of the object to be adjusted can be constructed based on the three-dimensional model parameters. The three-dimensional object model can then be projected onto a two-dimensional plane to obtain a reference facial image frame.

[0121] In one possible implementation, a target facial image frame may be generated based on the original facial image frame, the fused facial spatial features, and the reference facial image frame by:

[0122] Performing multi-scale feature extraction on the original facial image frame to obtain original facial feature maps at multiple scales corresponding to the original facial image frame;

[0123] Performing multi-scale feature extraction on the reference facial image frame to obtain reference facial feature maps at multiple scales corresponding to the reference facial image frame;

[0124] Perform encoding mapping on the fused facial spatial features to obtain the latent feature information corresponding to the fused facial spatial features;

[0125] The original facial feature maps at multiple scales, the reference facial feature maps at multiple scales and the latent feature information are fused to obtain the target facial image frame.

[0126] Multi-scale feature extraction can be used to obtain spatial features of the original facial image frame or the reference facial image frame at each preset resolution. The image scales of the original facial feature maps corresponding to different resolutions are different. Similarly, the image scales of the reference facial feature maps corresponding to different resolutions are different. In this embodiment, multi-scale extraction can be used to obtain original spatial features of the original facial image frame and reference spatial features of the reference facial image frame. The original spatial features include original facial feature maps at multiple scales, and the reference spatial features include reference facial feature maps at multiple scales. Therefore, the original spatial features of the original facial image frame and the reference spatial features of the reference facial image frame are both multi-layer spatial features.

[0127] There are multiple ways to extract original facial feature maps at multiple scales of the original facial image frame and reference facial feature maps at multiple scales of the reference facial image frame, as follows:

[0128] For example, the encoding network (denoted as Enc Block) of the trained image generation model can be used to spatially encode the original facial image frame and the reference facial image frame at each preset resolution, thereby obtaining the original facial feature map and the reference facial feature map at each resolution.

[0129] Among them, the encoding network (Enc Block) can include multiple sub-encoding networks, each sub-encoding network corresponds to a preset resolution. The sub-encodings can be arranged in order from small to large according to the size of the resolution, thereby obtaining an encoding network. When the original facial image frame and the reference facial image frame are input into the encoding network for network encoding, each sub-encoding network can output a spatial feature corresponding to the preset resolution. The encoding network for the original facial image frame and the reference facial image frame can be the same or different encoding networks, but different encoding networks share network parameters. The structure of the encoding sub-network can be various, for example, it can be composed of a simple one-layer convolutional network, or it can be other encoding network structures. The preset resolution can be set according to the actual application, for example, the resolution can be from 4*4 to 512*512.

[0130] The latent feature information is specifically the intermediate feature w obtained by encoding and mapping the fused facial spatial features. Different elements of the intermediate feature w control different visual features, thereby reducing the correlation between features (decoupling and feature separation). The encoding and mapping process can be used to extract the deep-level relationships hidden under the surface features from the fused facial spatial features, decouple these relationships, and thus obtain the latent features (latent code). There are many ways to use the trained image generation model to map the fused facial spatial features into latent feature information. For example, the mapping network of the trained image generation model can be used. The fused facial spatial features are mapped into latent feature information (w).

[0131] Multi-scale feature extraction enables the acquisition of spatial features from the original facial image frame or reference facial image frame at each preset resolution. Original facial feature maps corresponding to different resolutions have different image scales. Low-level features have higher resolution and contain more detailed information, while high-level features have stronger semantic information. Combining the original facial feature maps and reference facial feature maps at each scale to construct the facial image frame improves feature representation, thereby increasing the efficiency and accuracy of generating the target facial image frame. Furthermore, through encoding and mapping processing, the dimensionality of the fused facial spatial features can be reduced, thereby reducing the computational effort required to generate the target facial image frame and improving its efficiency.

[0132] In one possible implementation, the original facial feature maps at multiple scales, the reference facial feature maps at multiple scales, and the latent feature information are fused to obtain the target facial image frame in the following manner:

[0133] The latent feature information, the original facial feature map at the target scale, and the reference facial feature map at the target scale are fused to obtain a fused facial feature map corresponding to the target scale, where the target scale is a scale selected from multiple scales;

[0134] The corresponding fused facial feature map at the target scale, the original facial feature map at the adjacent scale, and the reference facial feature map at the adjacent scale are fused to obtain the target facial image frame.

[0135] In one possible implementation, a method of fusing the corresponding fused facial feature map at the target scale, the original facial feature map at the adjacent scale, and the reference facial feature map at the adjacent scale to obtain the target facial image frame may be:

[0136] Based on the latent feature information, the style modulation processing is performed on the fused facial feature map corresponding to the target scale to obtain the modulated style feature;

[0137] The modulated style features, the original facial feature map at adjacent scales, and the reference facial feature map at adjacent scales are fused to obtain the target facial image frame.

[0138] Specifically, the adjacent scale can be a scale larger than the target scale among the multiple scales. If the multiple scales include 4*4, 8*8, 16*16, 32*32, and 64*64, if the target scale is 16*16, the adjacent scale can be 32*32; if the target scale is 4*4, the adjacent scale can be 8*8.

[0139] This embodiment can adjust the preset basic style features based on the implicit feature information to obtain the modulated style features. The preset basic style features can be understood as the style features in the constant tensor (Const) pre-set during the image driving process. The so-called style features can be understood as the feature information used to generate an image of a specific style.

[0140] There are many ways to perform style modulation processing, such as adjusting the size of the basic style features to obtain the initial style features, modulating the latent feature information to obtain the convolution weights corresponding to the initial style features, and adjusting the initial style features based on the convolution weights to obtain the modulated style features.

[0141] The convolution weights can be understood as the weight information used when convolving the initial style features. There are many ways to modulate the latent feature information. For example, the base convolution weights can be obtained and adjusted based on the latent feature information to obtain the convolution features corresponding to the initial style features. Adjusting the convolution weights based on latent feature information can be achieved primarily using the Mod and Demod modules in the decoding network of StyleGAN v2 (a style transfer model).

[0142] After modulating the latent feature information, the initial style features can be adjusted based on the convolution weights obtained after the modulation process. This adjustment can be done in a variety of ways. For example, the target style convolution network corresponding to the resolution of the base facial image can be selected from the style convolution network (StyleConv) of the trained image generation model. Based on the convolution weights, the initial style features are adjusted to obtain the modulated style features. The base facial image at the initial resolution is generated based on the preset base style features.

[0143] In one possible implementation, the modulated style features, the original facial feature map at adjacent scales, and the reference facial feature map at adjacent scales are fused to obtain the target facial image frame in the following manner:

[0144] The modulated style features, the original facial feature map at adjacent scales, and the reference facial feature map at adjacent scales are fused to obtain a fused facial feature map at adjacent scales;

[0145] The target facial image frame is generated by fusion of facial feature maps and basic facial images at adjacent scales.

[0146] Among them, the fused facial feature map can also be regarded as a fused style feature.

[0147] In one possible implementation, a method for generating a target facial image frame by using fused facial feature maps at adjacent scales and a base facial image may be as follows: using the fused facial feature maps at adjacent scales as a new fused facial feature map at a target scale, returning to execute a step of performing style modulation processing on the corresponding fused facial feature map at the target scale based on latent feature information to obtain a modulated style feature, until the scale of the obtained target facial image frame meets a preset scale condition.

[0148] Specifically, the preset scale condition may enable the scale of the target facial image frame to be the largest scale among multiple scales.

[0149] In this embodiment, there are many ways to filter out the target original spatial features (i.e., the original facial feature map at the target scale) from the original spatial features based on the preset resolution, and to filter out the target reference spatial features (i.e., the reference facial feature map at the target scale) from the reference spatial features. For example, the original spatial features and the reference spatial features can be sorted based on the preset resolution, and based on the sorting information, the original spatial features with the smallest resolution can be filtered out from the original spatial features as the target original spatial features, and the original spatial features with the smallest resolution can be filtered out from the reference spatial features as the target original spatial features. After filtering out the target original spatial features and the target reference spatial features, the target original spatial features can be deleted from the original spatial features and deleted from the reference spatial features. In this way, the spatial features with the smallest resolution can be filtered out from the original spatial features and the reference spatial features each time, thereby obtaining the target original spatial features and the target reference spatial features.

[0150] After the target original space features and the target reference space features are screened out, the modulated style features, the target original space features and the target reference space features can be fused. There are many ways to fuse them. For example, the target original space features, the target reference space features and the modulated style features can be directly spliced ​​to obtain the fused style features at the current resolution. Specifically, they can be shown in formulas (4), (5) and (6): φ i =F flow (F i-1 ) (5)

[0151] Among them, z sty Represents the fused facial spatial features, StyleConv represents the style convolution module in stylegan v2, Up represents upsampling, T represents the feature resampling operation, and F flow The function is to convert the features into a dense flow field (φ i ), F RGB Its function is to convert features into RGB color images F i+1 is the fused style feature, which can be the style feature corresponding to the next preset resolution of the basic style feature. i As the basic style features, is the original spatial feature of the target at the preset resolution, is the target reference space feature at the preset resolution.

[0152] After obtaining the fused style features at the current resolution, the target facial image frame at the target resolution can be generated based on the fused style features and the basic facial image. There are many ways to generate the target facial image frame at the target resolution. For example, the current facial image can be generated based on the fused style features, and the current facial image and the basic facial image can be fused to obtain a fused facial image at the current resolution. The fused style features can be used as the preset basic style features, and the fused facial image can be used as the basic facial image. The step of adjusting the preset basic style features based on the latent feature information is returned to execute until the current resolution is the target resolution, and the target facial image frame is obtained.

[0153] Among them, in the process of generating the target facial image frame of the target resolution, it can be found that the current facial image at different resolutions is superimposed with the basic facial image in sequence, and in the superposition process, the resolution is increased in sequence, so that a high-definition target facial image frame can be output.

[0154] In one possible implementation, a base optical flow field at the initial resolution can be generated based on the basic style features, thereby outputting a target optical flow field at the target resolution. The base optical flow field can be understood as a visual field indicating the movement of key points in the facial image at the initial resolution. There are various ways to output the target optical flow field. For example, a base optical flow field at the initial style resolution can be generated based on the basic style features. Based on the base optical flow field, the modulated style features, the original spatial features, and the reference spatial features can be fused to obtain the target optical flow field at the target resolution.

[0155] Among them, there are many ways to fuse the modulated style features, original space features, and reference space features. For example, based on the preset resolution, the target original space features can be screened out from the original space features, and the target reference space features can be screened out from the reference space features. The modulated style features and the target style features can be fused to obtain the fused style features at the current resolution. Based on the fused style features and the basic optical flow field, the target optical flow field at the target resolution is generated.

[0156] Among them, there are many ways to generate a target optical flow field at the target resolution based on the fused style features and the basic optical flow field. For example, the current optical flow field can be generated based on the fused style features, and the current optical flow field and the basic optical flow field can be fused to obtain the fused optical flow field at the current resolution. The fused style features are used as the preset basic style features, and the fused optical flow field is used as the basic optical flow field. The step of adjusting the preset basic style features based on the latent feature information is returned to execute until the current resolution is the target resolution to obtain the target optical flow field.

[0157] Among them, the target facial image and the target optical flow field can be generated simultaneously based on the preset basic style features, or the target facial image or the target optical flow field can be generated separately based on the preset style features. Taking the simultaneous generation of the object to be adjusted and the target optical flow field as an example, the preset basic style features, the basic facial image and the basic optical flow field can be processed by the decoding network of the trained image generation model. Each decoding network can include a decoding sub-network corresponding to each preset resolution, and the resolution can be increased from 4*4 to 512*512. The network structure of the decoding sub-network can be as shown in Figure 1e, which receives the fused style features (F i ), fusion of facial images and fused optical flow field (φ i ), modulate the latent feature information w to obtain F i The corresponding convolution weight, and based on the convolution weight, F i Perform convolution processing to obtain the modulated style features (denoted as ), based on the resolution corresponding to the decoding sub-network, the decoding sub-network corresponding to the target original spatial features is selected from the original spatial features And filter out the target reference space features corresponding to the decoding subnetwork from the reference space features F i 、 The spatial resolution is the same as and By connecting them in series, we can get the fused style features (F i+1 ), then, based on F i+1 Generate the current facial image and the current optical flow field, and combine the current facial image and the output of the previous decoding sub-network By fusing, we can get the fused facial image output by the current decoding sub-network The fused optical flow field (φ i ) are fused to obtain the fused optical flow field (φ i+1 ), and then output it to the decoding sub-network of the next layer until the decoding sub-network corresponding to the target resolution outputs the fused facial image and the fused optical flow field. The fused facial image at the target resolution (specifically, resolution 512) can be used as the target facial image frame, and the fused optical flow field at the target resolution can be used as the target optical flow field.

[0158] The operation of each layer in the network during the above image generation process can be referred to Figure 1e. The left side of Figure 1e shows the framework diagram of the high-fidelity emotional face generation network. Through this emotional face generation network, the original facial image frame Is , fused facial spatial features and reference facial image frame I rd , generating the target facial image frame. The right side shows the details of each layer in the network module G in the emotional face generation network; through the network module G, the original facial feature map F at various scales can be used to generate the target facial image frame. s , reference facial feature maps F at various scales rd And the fused facial spatial features z sty , generate the target facial image frame

[0159] The generative network can be built based on StyleGAN2. In one possible implementation, the original facial spatial features (denoted as θ) of the source face (i.e., the original facial image frame) and the facial local posture features (denoted as ) is reorganized, for example, the object identity information (α s )、Light and shadow(δ s ), texture (γ s ) and facial local posture features The expression coefficient in Posture (p d ) and updated updated sentiment intensity information Merge into a new feature vector (z sty ), which is the fused facial spatial feature in the above embodiment. This feature vector contains the expression and posture information driving the face, and the emotional information is further enhanced by the emotional intensity representation output by the Transformer Encoder. The process of obtaining the fused facial spatial feature is shown in formula (7):

[0160] Among them, Linear represents the linear layer.

[0161] In addition, the source face encoder (E src ) provides texture clues of the source face (F s ) and render-driven face encoder (E rd ) to explicitly provide spatial cues driving the face (F rd ), which mainly includes information such as posture and expression.

[0162] Then, z sty 、F s 、F rd The input is input into the network G, and after being processed by each layer in the network G, a high-fidelity face can be generated, that is, the target facial image frame in the above embodiment.

[0163] The training process of the emotional face generation network can be as follows:

[0164] Acquire training data, where the training data includes original facial image frame samples of the sample object, target-driven facial image frame samples, and audio-driven information samples and emotion-driven information samples corresponding to the target-driven facial image frame samples;

[0165] Extracting spatial features of the original facial image frame samples to obtain original facial spatial features corresponding to the original facial image frame samples;

[0166] Performing feature interaction processing on audio-driven information samples and emotion-driven information samples to obtain facial local posture sample features corresponding to target-driven facial image frame samples;

[0167] Through the preset emotional face generation network, the sample object is reconstructed based on the original facial spatial features and facial local posture sample features to obtain the predicted driving facial image frame;

[0168] Based on the target-driven facial image frame samples and the predicted-driven facial image frames, the parameters of the preset emotional face generation network are adjusted to obtain a trained emotional face generation network.

[0169] In a specific embodiment, four loss functions can be used to train the emotional face generation network. The four loss functions are: emotion consistency loss (denoted as L emo ), pixel-level image reconstruction loss (denoted as L rec ), the perceptual loss at the feature level (denoted as L p ) and adversarial loss (denoted as L gan In one possible implementation, the four loss functions can be fused (e.g., weighted operation) to obtain a total loss function. Based on the total loss function, the parameters of the emotional face generation network are adjusted until the total loss function meets a preset loss condition, thereby obtaining a trained emotional face generation network. The preset loss condition can be that the total loss function is less than a preset loss value.

[0170] In some embodiments, the total loss function L can be expressed as formula (8): L = L emo +L rec +L p +L gan (8)

[0171] Among them, for the emotion consistency loss L emo, by performing emotion recognition processing on the sample objects in the target-driven facial image frame and the predicted-driven facial image frame respectively, a first emotion recognition result corresponding to the target-driven facial image frame sample and a second emotion recognition result corresponding to the predicted-driven facial image frame can be obtained; based on the first emotion recognition result and the second emotion recognition result, the emotion consistency loss of the preset emotional face generation network is calculated.

[0172] Among them, for the image reconstruction loss L rec The image reconstruction loss of the preset emotional face generation network can be determined based on the similarity between the target driving facial image frame sample and the predicted driving facial image frame. The similarity can be specifically measured by cosine similarity or histogram similarity, which is not limited in this embodiment.

[0173] Among them, the perceptual loss L p It is the loss value at the feature level; specifically, spatial features are extracted for the target-driven facial image frame sample and the predicted-driven facial image frame respectively to obtain the first facial spatial features of the target-driven facial image frame sample and the second facial spatial features of the predicted-driven facial image frame, and then the similarity between the first facial spatial features and the second facial spatial features is calculated to obtain the perceptual loss; the greater the similarity, the smaller the perceptual loss, and conversely, the smaller the similarity, the greater the perceptual loss.

[0174] Among them, for the adversarial loss L gan , the probability that the target driving facial image frame sample and the predicted driving facial image frame belong to the real driving facial image frame can be predicted respectively, and the adversarial loss of the preset emotional face generation network can be determined based on the probability.

[0175] In this embodiment, the method of respectively predicting the probability that the target driving facial image frame sample and the predicted driving facial image frame belong to the real driving facial image frame, and determining the adversarial loss of the preset emotional face generation network based on the probabilities may be:

[0176] Predicting first probability information that the target driving facial image frame sample belongs to the real driving facial image frame through a preset discriminant model;

[0177] Predicting, by a preset discriminant model, second probability information that the predicted driving facial image frame belongs to the real driving facial image frame;

[0178] Based on the first probability information and the second probability information, adversarial loss information of a preset emotional face generation network is determined.

[0179] The emotional face generation network can be a Generative Adversarial Network (GAN). A GAN consists of a generator and a discriminator. The generator is responsible for generating samples, while the discriminator is responsible for verifying whether the samples generated by the generator are genuine. The generator aims to generate as realistic samples as possible to confuse the discriminator, while the discriminator aims to distinguish between the samples generated by the generator and real samples. Through continuous adversarial competition, the two networks improve the generator's capabilities.

[0180] The preset discriminant model can be a discriminator D. During training, the target driving facial image frame samples are real images, and the predicted driving facial image frames are the results generated by the preset emotional face generation network. The discriminator needs to judge the generated results as false and the real images as true. The preset emotional face generation network can be regarded as the overall generation network G. During the training and learning process, the images generated by the generation network G need to be able to deceive the discriminator D. In other words, the probability that the discriminator D judges that the predicted driving facial image frames generated by the generation network G are real driving facial image frames should be 1 as much as possible.

[0181] The discriminator takes as input either a real image or the output of the emotional face generation network. Its goal is to distinguish the emotional face generation network output from real images as much as possible. The emotional face generation network, on the other hand, aims to deceive the discriminator as much as possible. The emotional face generation network and the discriminator compete with each other, and parameters are continuously adjusted to obtain a trained emotional face generation network.

[0182] In a possible implementation, the spatial feature extraction of the original facial image frame to obtain the original facial spatial features corresponding to the original facial image frame may be performed as follows:

[0183] Through the image generation model, the spatial features of the original facial image frame are extracted to obtain the original facial spatial features corresponding to the original facial image frame;

[0184] The method of interactively processing the audio-driven information and the emotion-driven information to obtain the facial local posture features corresponding to the target facial image frame may be:

[0185] Through the image generation model, the audio-driven information and the emotion-driven information are interactively processed to obtain the local facial posture features corresponding to the target facial image frame;

[0186] Based on the original facial spatial features and the local facial posture features, the facial reconstruction process is performed on the object to be adjusted, and the target facial image frame is generated in the following manner:

[0187] Based on the original facial spatial features and local facial posture features, the image generation model is used to reconstruct the face of the object to be adjusted and generate a target facial image frame.

[0188] Among them, the image generation model can be a visual geometry group network (VGGNet), a residual network (ResNet), a densely connected convolutional network (DenseNet), etc., but it should be understood that the image generation model of this embodiment is not limited to the types listed above.

[0189] It should be noted that the image generation model can be trained by multiple sets of training data. The image generation model can be trained by other equipment and then provided to the image generation device, or it can be trained by the image generation device itself.

[0190] If the image generation device performs training by itself, then before extracting spatial features from the original facial image frame using the image generation model to obtain the original facial spatial features corresponding to the original facial image frame, the image generation method may further include:

[0191] Acquire training data, where the training data includes original facial image frame samples of the sample object, target-driven facial image frame samples, and audio-driven information samples and emotion-driven information samples corresponding to the target-driven facial image frame samples;

[0192] By using a preset image generation model, spatial features of the original facial image frame samples are extracted to obtain the original facial spatial features corresponding to the original facial image frame samples;

[0193] Performing feature interaction processing on audio-driven information samples and emotion-driven information samples to obtain facial local posture sample features corresponding to target-driven facial image frame samples;

[0194] Based on the original facial spatial features and facial local posture sample features, the sample object is reconstructed to obtain a predicted driving facial image frame;

[0195] Based on the target-driven facial image frame samples and the predicted-driven facial image frames, the parameters of the preset image generation model are adjusted to obtain a trained image generation model.

[0196] The target-driven facial image frame samples may be regarded as label information, and specifically may be the expected-driven facial image frames corresponding to the audio-driven information samples and the emotion-driven information samples.

[0197] There are many ways to obtain the original facial image frame samples, target-driven facial image frame samples, and audio-driven information samples and emotion-driven information samples corresponding to the target-driven facial image frame samples of the sample object, which are not limited in this embodiment.

[0198] For example, a speaker video with emotion labels can be used to train a model. For example, two frames containing the subject's face can be extracted from a speech video of a sample subject. One of the frames is used as the original facial image frame sample, and the remaining frame is used as the target-driven facial image frame sample. The audio information corresponding to the target-driven facial image frame sample 1 second before and after the speech video is used as the audio-driven information sample, and the emotion label of the speech video is used as the emotion-driven information sample.

[0199] For another example, 32 consecutive frames can be randomly captured from a speech video as driving images (i.e., target driving facial image frame samples, denoted as I 1-32 ), which is also the supervised truth value of the model generation result, where the first frame I1 can be used as the original image (that is, the original facial image frame sample), and the audio signal corresponding to the continuous driving image is used as the audio driving information sample (A 1-32 ), the text representation of the video emotion label (t emo ) as the emotion-driven information for generating faces.

[0200] In one possible implementation, based on the target driving facial image frame sample and the predicted driving facial image frame, the parameters of the preset image generation model are adjusted to obtain the trained image generation model in the following manner:

[0201] Performing emotion recognition processing on the target-driven facial image frame sample to obtain a first emotion recognition result corresponding to the target-driven facial image frame sample, and performing emotion recognition processing on the sample object in the predicted-driven facial image frame to obtain a second emotion recognition result corresponding to the predicted-driven facial image frame;

[0202] Calculating emotion loss information of a preset image generation model based on the first emotion recognition result and the second emotion recognition result;

[0203] Determining reconstruction loss information of a preset image generation model based on the similarity between the target driving facial image frame sample and the predicted driving facial image frame;

[0204] According to the emotion loss information and the reconstruction loss information, the parameters of the preset image generation model are adjusted to obtain the trained image generation model.

[0205] Among them, the emotion recognition model can be used to perform emotion recognition processing on the sample objects in the target-driven facial image frame samples and the predicted-driven facial image frame respectively. The emotion recognition model can specifically be a neural network model.

[0206] The first emotion recognition result may be first probability information indicating that the emotion of the sample subject in the target driving facial image frame belongs to a preset emotion, and the second emotion recognition result may be second probability information indicating that the emotion of the sample subject in the target driving facial image frame belongs to the preset emotion. Emotion loss information is then obtained based on a cross entropy loss between the first probability information and the second probability information.

[0207] In one possible implementation, based on the similarity between the target driving facial image frame sample and the predicted driving facial image frame, the reconstruction loss information of the preset image generation model may be determined by:

[0208] Performing feature extraction on the target-driven facial image frame sample to obtain first feature information corresponding to the target-driven facial image frame sample;

[0209] Performing feature extraction on the predicted driving facial image frame to obtain second feature information corresponding to the predicted driving facial image frame;

[0210] Reconstruction loss information of a preset image generation model is determined according to the similarity between the first feature information and the second feature information.

[0211] Among them, the vector distance between the feature vector corresponding to the first feature information and the feature vector corresponding to the second feature information can be calculated, and the similarity between the first feature information and the second feature information can be determined based on the vector distance. The larger the vector distance, the lower the similarity, and the greater the loss value corresponding to the reconstruction loss information; conversely, the smaller the vector distance, the higher the similarity, and the smaller the loss value corresponding to the reconstruction loss information.

[0212] In one possible implementation, parameters of a preset image generation model are adjusted according to the emotion loss information and the reconstruction loss information. A method for obtaining a trained image generation model may be:

[0213] Extracting spatial features of target-driven facial image frame samples to obtain target facial spatial features corresponding to the target-driven facial image frame samples;

[0214] Performing facial key point extraction on the target facial spatial features to obtain first facial key points corresponding to the target facial spatial features, and performing facial key point extraction on the facial local posture sample features to obtain second facial key points corresponding to the facial local posture sample features;

[0215] Determining facial keypoint loss information based on the first facial keypoint and the second facial keypoint;

[0216] Determining regularization loss information of a preset image generation model based on the feature distance between the local facial posture sample features and the target facial spatial features;

[0217] According to the emotion loss information, reconstruction loss information, facial key point loss information and regularization loss information, the parameters of the preset image generation model are adjusted to obtain the trained image generation model.

[0218] The spatial feature extraction of the target-driven facial image frame samples may include performing convolution processing and pooling processing on the target-driven facial image frame samples, which is not limited in this embodiment. In this embodiment, the spatial feature extraction of the target-driven facial image frame samples may be performed using a trained image feature extraction network.

[0219] The extracted target facial spatial features corresponding to the target-driven facial image frame samples may specifically include three-dimensional (3D) facial coefficients corresponding to the target-driven facial image frame samples, such as identity information, lighting, texture, expression, pose, gaze, etc.

[0220] Among them, facial key point extraction can specifically extract key points of facial features such as eyes and mouth.

[0221] Regarding the regularization loss information, this embodiment may use the target facial spatial features corresponding to the target-driven facial image frame samples as supervisory signals for the extracted local facial posture features. In one possible implementation, this embodiment may calculate the characteristic distance between the local facial posture sample features corresponding to the target-driven facial image frame samples and the target facial spatial features, and determine the regularization loss information based on this characteristic distance. The larger the characteristic distance, the larger the loss value corresponding to the regularization loss information; conversely, the smaller the characteristic distance, the smaller the loss value corresponding to the regularization loss information.

[0222] The parameters of the preset image generation model are adjusted according to the emotion loss information, the reconstruction loss information, the facial key point loss information, and the regularization loss information. The trained image generation model can be obtained by:

[0223] The emotion loss information, reconstruction loss information, facial key point loss information and regularization loss information are integrated to obtain the total loss information;

[0224] According to the total loss information, the parameters of the preset image generation model are adjusted to obtain the trained image generation model.

[0225] There are many ways to fuse the emotion loss information, reconstruction loss information, facial key point loss information and regularization loss information, which are not limited in this embodiment. For example, the fusion method can be weighted fusion.

[0226] The training process of the preset image generation model first calculates the total loss information. Then, the backpropagation algorithm is used to adjust the parameters of the preset image generation model. The parameters of the image generation model are optimized based on the total loss information, so that the loss value corresponding to the total loss information is less than the preset loss value, thereby obtaining a trained image generation model. The preset loss value can be set according to actual conditions. For example, if the accuracy of the image generation model is required to be higher, the preset loss value should be smaller.

[0227] In one embodiment, the image generation model may include an emotion-aware audio-to-3D coefficient conversion network and an emotional face generation network. As shown in FIG1f , the specific network structure of the emotion-aware audio-to-3D coefficient conversion network is illustrated. This image generation model can be used to perform facial posture adjustment on the original facial image frame of the subject to be adjusted based on audio-driven information and emotion-driven information, thereby driving the generation of a corresponding target facial image frame. For example, the source face (i.e., the original facial image frame) can be input into the image feature extraction network within the emotion-aware audio-to-3D coefficient conversion network to obtain the original facial spatial features corresponding to the original facial image frame, denoted as θ. θ can include subject identity information α, as well as three-dimensional facial coefficients such as lighting, texture, expression, posture, and gaze. Some of the three-dimensional facial coefficients within θ (such as expression, posture, and gaze) can be denoted as β.

[0228] Then, the audio-driven information and the emotion-driven information can be interactively processed to obtain the facial local posture features, which are recorded as The specific process may include: extracting the emotional semantic features (denoted as z) contained in the emotion-driven information (such as descriptive information such as "angry") through the multimodal model emo ), extract the object identity information α from the original facial spatial features θ, and pass the linear layer to the audio driving sequence (A1, A2, ..., A T ) and object identity information α are dimensionally mapped, and then the position encoding information PE of the audio driving information, the preset emotion intensity information σ, and the emotion semantic feature z are emo , and the audio driver sequence A after dimension mapping 1-32 and object identity information α are input into the encoder to perform feature interaction and obtain interactive feature information z (z can include feature sequences z1, z2, ..., z T ) and updated sentiment intensity information Then the interactive feature information z and emotional semantic feature z emoThe position encoding information of the audio driving information is input into the decoder, and the decoder output is processed through the linear layer to obtain the local facial posture features. Specifically, it can include coefficients

[0229] After obtaining the facial local posture features, the original facial spatial features and facial local posture features can be fused. Specifically, β in the original facial spatial features θ can be replaced by After getting the updated It should be noted that β and The coefficients in are corresponding. In addition, the updated emotion intensity information can be combined with The fused facial spatial features are then obtained. The subject to be adjusted is then reconstructed based on the fused facial spatial features to obtain a reconstructed 3D facial image corresponding to the subject to be adjusted. This reconstructed 3D facial image is then rendered and mapped through the rendering layer to obtain a 2D image of the driven emotional face, which is the reference facial image frame corresponding to the subject to be adjusted. Finally, the reference facial image frame, the source face, and the reconstructed coefficients (specifically, the fused facial spatial features) are input into the emotional face generation network to obtain the final realistic face.

[0230] In the training process of the emotion-aware audio-to-3D coefficient conversion network, the target-driven facial image frame sample corresponding to the sample object can be denoted as I, and the reference facial image frame sample obtained by the rendering layer can be denoted as I rd In this embodiment, the rendered face I rd Through facial mask processing, it is pasted back to the original facial image frame sample to form a new face map, which is recorded as I 3d , and I 3d The and the true value graph I are input into the emotion recognition model for emotion recognition processing, and the emotion loss information of the network (that is, emotion consistency loss) is calculated based on the emotion recognition result, as shown in the following formula (9): L emo =‖φ emo (I 3d )-φ emo (I)‖2 (9)

[0231] in, represents the emotion recognition model, L emo Indicates a loss of emotional consistency.

[0232] In addition, it is also possible to use the true value image I and the rendered face I rd , calculate the facial reconstruction loss of the emotion-aware audio-to-3D coefficient conversion network, as shown in formula (10): Lrec =‖I rd -M⊙I‖1 (10)

[0233] Among them, M represents mask processing, L rec represents the face reconstruction loss.

[0234] In some embodiments, the original 68 facial key points (denoted as l) can be extracted from the 3D facial coefficients of the target driving facial image frame sample, and the facial key points (denoted as l) can be extracted from the reconstructed 3D facial coefficients. rd ), calculate the facial key point loss between the two, as shown in formula (11): L lmd =‖ll rd ‖2 (11)

[0235] Among them, L lmd represents the facial keypoint loss.

[0236] In some embodiments, the coefficient regularization loss of the emotion-aware audio-to-3D coefficient conversion network can also be calculated, and the coefficient regularization term can be used to stabilize the training process. Specifically, the 3D facial coefficient (β) output by the image feature extraction network and the 3D facial coefficient predicted by the decoder can be calculated. The loss value between , to get the coefficient regularization loss L reg , as shown in formula (12):

[0237] After obtaining the emotion consistency loss, facial reconstruction loss, facial key point loss, and coefficient regularization loss, the total loss function of the emotion-aware audio-to-3D coefficient conversion network can be calculated based on these four loss functions, and then the emotion-aware audio-to-3D coefficient conversion network can be trained based on the total loss function. The total loss function L can be shown as formula (13): L = L emo +L rec +L lmd +L reg (13)

[0238] Based on the image generation method provided in this application, facial movement in any original facial image frame can be flexibly driven based on given audio and emotional descriptions to generate target facial image frames whose lip movements are consistent with the audio content and whose facial emotions are consistent with the emotional descriptions. The emotional descriptions herein can be mixed emotions, for example, and this is not limited in this embodiment. This solution can achieve emotional voice-driven portraits, reflecting arbitrary emotions and audio on any face, achieving multimodal emotional face driving and providing a highly operational solution.

[0239] Among them, the emotional voice-driven portrait specifically controls the facial expression of the portrait based on external given emotional conditions or emotional representations decoupled from the audio to make it consistent with the desired emotional expression.

[0240] As can be seen from the above, this embodiment can obtain an original facial image frame, audio-driven information, and emotion-driven information of the subject to be adjusted. The original facial image frame includes the original face of the subject to be adjusted, the audio-driven information includes the speech content of the subject to be adjusted, and drives the facial posture of the original face to change according to the speech content. The emotion-driven information is used to describe the target emotion when the subject to be adjusted speaks the speech content, and drives the facial posture of the original face to change according to the target emotion. Spatial features are extracted from the original facial image frame to obtain original facial spatial features corresponding to the original facial image frame. The audio-driven information and the emotion-driven information are interactively processed to obtain local facial posture features of the subject to be adjusted. The local facial posture features can reflect the facial posture changes caused by the current speech content and emotion. Based on the original facial spatial features and local facial posture features, the subject to be adjusted is reconstructed, thereby generating a target facial image frame based on the original facial image frame. This application can use the audio-driven information and the emotion-driven information to capture detailed facial posture information of a portion of the subject to be adjusted, and then perform facial adjustments on the original facial image frame based on the captured information to obtain the corresponding target facial image frame. This helps improve the efficiency and accuracy of generating the target facial image frame.

[0241] According to the method described in the previous embodiment, the image generating device will be further described in detail below by taking the example of being specifically integrated into a server.

[0242] The present application provides an image generation method. As shown in FIG2 , the specific process of the image generation method may be as follows:

[0243] 201. The server obtains an original facial image frame, audio driving information, and emotion driving information of an object to be adjusted.

[0244] 202. The server extracts spatial features from the original facial image frame to obtain original facial spatial features corresponding to the original facial image frame.

[0245] 203. The server performs feature interaction processing on the audio driving information and the emotion driving information to obtain interaction feature information.

[0246] 204. The server predicts local facial posture features based on the interaction feature information and the emotion-driven information.

[0247] 205. The server performs facial reconstruction processing on the object to be adjusted based on the original facial spatial features and the facial local posture features to generate a target facial image frame.

[0248] Based on the image generation method provided in this application, facial movement in any original facial image frame can be flexibly driven based on given audio and emotional descriptions to generate target facial image frames whose lip movements are consistent with the audio content and whose facial emotions are consistent with the emotional descriptions. The emotional descriptions herein can be mixed emotions, for example, and this is not limited in this embodiment. This solution can achieve emotional voice-driven portraits, reflecting arbitrary emotions and audio on any face, achieving multimodal emotional face driving and providing a highly operational solution.

[0249] Among them, the emotional voice-driven portrait specifically controls the facial expression of the portrait based on external given emotional conditions or emotional representations decoupled from the audio to make it consistent with the desired emotional expression.

[0250] As can be seen from the above, this embodiment can obtain the original facial image frame, audio driving information and emotion driving information of the object to be adjusted through the server. Spatial feature extraction is performed on the original facial image frame to obtain the original facial spatial features corresponding to the original facial image frame. Feature interaction processing is performed on the audio driving information and the emotion driving information to obtain interactive feature information, and then based on the interactive feature information and the emotion driving information, the local facial posture features are predicted. The local posture features can reflect the changes in facial posture caused by the current audio and emotions, so the server can perform facial reconstruction processing on the object to be adjusted based on the original facial spatial features and the local facial posture features, thereby generating a target facial image frame based on the original facial image frame. The present application can use the audio driving information and the emotion driving information to capture the facial posture details of the part of the object to be adjusted, and then perform facial adjustment on the original facial image frame based on the captured information, thereby obtaining the corresponding target facial image frame, which is conducive to improving the generation efficiency and accuracy of the target facial image frame.

[0251] To better implement the above method, an embodiment of the present application further provides an image generation device. As shown in FIG3 , the image generation device may include an acquisition unit 301 , an extraction unit 302 , an interaction unit 303 , and a reconstruction unit 304 , as follows:

[0252] (1) Acquisition unit 301;

[0253] An acquisition unit is used to acquire an original facial image frame, audio driving information, and emotion driving information of the object to be adjusted, wherein the original facial image frame includes the original face of the object to be adjusted, the audio driving information includes the voice content of the object to be adjusted, so as to drive the facial posture of the original face to change according to the voice content, and the emotion driving information is used to describe the target emotion when the object to be adjusted emits the voice content, so as to drive the facial posture of the original face to change according to the target emotion.

[0254] (2) extraction unit 302;

[0255] The extraction unit is used to extract spatial features from the original facial image frame to obtain original facial spatial features corresponding to the original facial image frame.

[0256] (3) Interaction unit 303;

[0257] The interaction unit is used to perform feature interaction processing on the audio driving information and the emotion driving information to obtain the facial local posture features of the object to be adjusted when emitting the speech content under the target emotion.

[0258] In some embodiments of the present application, the interaction unit may include a feature interaction subunit and a prediction subunit, as follows:

[0259] The feature interaction subunit is configured to perform feature interaction processing on the audio driving information and the emotion driving information to obtain interaction feature information;

[0260] A prediction subunit is used to predict the local facial posture features based on the interaction feature information and the emotion-driven information.

[0261] In some embodiments of the present application, the audio driving information includes multiple audio frames, and the feature interaction sub-unit can be specifically used to extract object identity information from the original facial spatial features; encode the position information of each audio frame in the multiple audio frames in the audio driving information to obtain the position code of each audio frame, and combine the position codes corresponding to the multiple audio frames to obtain the position code information corresponding to the audio driving information; perform feature interaction processing on the object identity information, the position code information, the audio driving information and the emotion driving information to obtain the interactive feature information.

[0262] In some embodiments of the present application, the prediction subunit can be specifically used to fuse the interactive feature information and the emotion-driven information to obtain fused feature information; and decode the fused feature information to obtain the local facial posture feature.

[0263] (4) reconstruction unit 304;

[0264] The reconstruction unit is configured to perform facial reconstruction processing on the object to be adjusted based on the original facial spatial features and the facial local posture features to generate the target facial image frame.

[0265] In some embodiments of the present application, the interaction unit may include a setting subunit and an interaction subunit, as follows:

[0266] The setting subunit is used to obtain preset emotion intensity information corresponding to the emotion driving information;

[0267] an interaction subunit, configured to perform feature interaction processing on the audio driving information, the emotion driving information, and the preset emotion intensity information to obtain the facial local posture feature and updated emotion intensity information;

[0268] The reconstruction unit may be specifically configured to perform facial reconstruction processing on the object to be adjusted based on the original facial spatial features, the facial local posture features, and the updated emotion intensity information to generate the target facial image frame.

[0269] In some embodiments of the present application, the reconstruction unit may include a fusion subunit, a reconstruction subunit, and a generation subunit, as follows:

[0270] The fusion subunit is used to fuse the original facial spatial features and the facial local posture features to obtain fused facial spatial features;

[0271] A reconstruction subunit, configured to perform facial reconstruction processing on the object to be adjusted based on the fused facial spatial features to obtain a reference facial image frame corresponding to the object to be adjusted;

[0272] A generating subunit is configured to generate the target facial image frame based on the original facial image frame, the fused facial spatial features, and the reference facial image frame.

[0273] In some embodiments of the present application, the reconstruction subunit can be specifically used to perform facial reconstruction processing on the object to be adjusted based on the fused facial spatial features to obtain a reconstructed three-dimensional facial image corresponding to the object to be adjusted; and perform rendering mapping processing on the reconstructed three-dimensional facial image to obtain a reference facial image frame corresponding to the object to be adjusted.

[0274] In some embodiments of the present application, the generation subunit can be specifically used to perform multi-scale feature extraction on the original facial image frame to obtain original facial feature maps at multiple scales corresponding to the original facial image frame; perform multi-scale feature extraction on the reference facial image frame to obtain reference facial feature maps at multiple scales corresponding to the reference facial image frame; perform encoding mapping processing on the fused facial spatial features to obtain latent feature information corresponding to the fused facial spatial features; and fuse the original facial feature maps at multiple scales, the reference facial feature maps at multiple scales, and the latent feature information to obtain the target facial image frame.

[0275] In some embodiments of the present application, the extraction unit may be specifically configured to perform spatial feature extraction on the original facial image frame using an image generation model to obtain original facial spatial features corresponding to the original facial image frame;

[0276] The interaction unit may be specifically configured to perform feature interaction processing on the audio driving information and the emotion driving information through the image generation model to obtain the facial local posture feature;

[0277] The reconstruction unit can be specifically configured to perform facial reconstruction processing on the object to be adjusted based on the original facial spatial features and the facial local posture features through the image generation model to generate the target facial image frame.

[0278] In some embodiments of the present application, the image generation device may further include a training unit, which may be used to train the image generation model;

[0279] The training unit can be specifically used to obtain training data, which includes original facial image frame samples of sample objects, target-driven facial image frame samples, and audio-driven information samples and emotion-driven information samples corresponding to the target-driven facial image frame samples; through a preset image generation model, spatial feature extraction is performed on the original facial image frame samples to obtain original facial spatial features corresponding to the original facial image frame samples; feature interaction processing is performed on the audio-driven information samples and the emotion-driven information samples to obtain facial local posture sample features corresponding to the target-driven facial image frame samples; based on the original facial spatial features and the facial local posture sample features, facial reconstruction processing is performed on the sample object to obtain a predicted-driven facial image frame; based on the target-driven facial image frame samples and the predicted-driven facial image frame, the parameters of the preset image generation model are adjusted to obtain a trained image generation model.

[0280] In some embodiments of the present application, the step of “adjusting parameters of a preset image generation model based on the target driving facial image frame sample and the predicted driving facial image frame to obtain a trained image generation model” may include:

[0281] performing emotion recognition processing on the target-driven facial image frame sample to obtain a first emotion recognition result corresponding to the target-driven facial image frame sample, and performing emotion recognition processing on the sample object in the predicted-driven facial image frame to obtain a second emotion recognition result corresponding to the predicted-driven facial image frame;

[0282] Calculating emotion loss information of the preset image generation model based on the first emotion recognition result and the second emotion recognition result;

[0283] Determining reconstruction loss information of the preset image generation model based on the similarity between the target driving facial image frame sample and the predicted driving facial image frame;

[0284] According to the emotion loss information and the reconstruction loss information, the parameters of the preset image generation model are adjusted to obtain a trained image generation model.

[0285] In some embodiments of the present application, the step of “adjusting the parameters of the preset image generation model according to the emotion loss information and the reconstruction loss information to obtain a trained image generation model” may include:

[0286] Performing spatial feature extraction on the target-driven facial image frame sample to obtain target facial spatial features corresponding to the target-driven facial image frame sample;

[0287] Performing facial key point extraction on the target facial spatial feature to obtain first facial key points corresponding to the target facial spatial feature, and performing facial key point extraction on the facial local posture sample feature to obtain second facial key points corresponding to the facial local posture sample feature;

[0288] Determining facial key point loss information based on the first facial key points and the second facial key points;

[0289] Determining regularization loss information of the preset image generation model based on a feature distance between the facial local posture sample feature and the target facial spatial feature;

[0290] According to the emotion loss information, the reconstruction loss information, the facial key point loss information and the regularization loss information, the parameters of the preset image generation model are adjusted to obtain a trained image generation model.

[0291] In some embodiments of the present application, the step of “performing feature interaction processing on the audio driving information and the emotion driving information to obtain local facial gesture features of the object to be adjusted when emitting the speech content under the target emotion” may include:

[0292] The character strings corresponding to each audio frame in the audio driving information are arranged in the order of the audio frames to obtain an arranged character string sequence, the character strings corresponding to the emotion driving information are added to the arranged character string sequence to obtain an updated character string sequence, for each character string in the updated character string sequence, feature information of the character string is extracted, the feature information of the character string is processed according to feature information of previous and next characters of the character string, the feature information of each processed character string is fused to obtain interactive feature information, and the local facial posture feature is predicted based on the interactive feature information and the emotion driving information.

[0293] As can be seen from the above, this embodiment can obtain the original facial image frame, audio driving information and emotion driving information of the object to be adjusted through the acquisition unit 301, the original facial image frame includes the original face of the object to be adjusted, the audio driving information includes the voice content of the object to be adjusted, so as to drive the facial posture of the original face to change according to the voice content, and the emotion driving information is used to describe the target emotion when the object to be adjusted emits the voice content, so as to drive the facial posture of the original face to change according to the target emotion; the extraction unit 302 performs spatial feature extraction on the original facial image frame to obtain the original facial spatial feature corresponding to the original facial image frame; the interaction unit 303 performs feature interaction processing on the audio driving information and the emotion driving information to obtain the facial local posture feature of the object to be adjusted; the facial local posture feature can reflect the facial posture changes caused by the current voice content and emotion, so the reconstruction unit 304 performs facial reconstruction processing on the object to be adjusted based on the original facial spatial feature and the facial local posture feature, thereby generating a target facial image frame based on the original facial image frame. This application can use audio-driven information and emotion-driven information to capture the facial posture details of the object to be adjusted, and then perform facial adjustments on the original facial image frame based on the captured information to obtain the corresponding target facial image frame, which is conducive to improving the generation efficiency and accuracy of the target facial image frame.

[0294] The present application also provides an electronic device, as shown in FIG4 , which shows a schematic diagram of the structure of the electronic device involved in the present application embodiment. The electronic device may be a terminal or a server, etc. Specifically:

[0295] The electronic device may include components such as a processor 401 with one or more processing cores, a memory 402 with one or more computer-readable storage media, a power supply 403, and an input unit 404. Those skilled in the art will appreciate that the electronic device structure shown in FIG4 does not limit the electronic device and may include more or fewer components than shown, or combine certain components, or arrange the components differently.

[0296] Processor 401 is the control center of the electronic device. It connects all parts of the electronic device using various interfaces and circuits. It performs various functions of the electronic device and processes data by running or executing software programs and / or modules stored in memory 402 and accessing data stored in memory 402. Optionally, processor 401 may include one or more processing cores. Preferably, processor 401 may integrate an application processor and a modem processor. The application processor primarily handles the operating system, user interface, and application programs, while the modem processor primarily handles wireless communications. It is understood that the modem processor may not be integrated into processor 401.

[0297] The memory 402 can be used to store software programs and modules. The processor 401 executes various functional applications and data processing by running the software programs and modules stored in the memory 402. The memory 402 may mainly include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required for at least one function (such as a sound playback function, an image playback function, etc.), etc.; the data storage area may store data created according to the use of the electronic device, etc. In addition, the memory 402 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other volatile solid-state storage device. Accordingly, the memory 402 may also include a memory controller to provide the processor 401 with access to the memory 402.

[0298] The electronic device also includes a power supply 403 for supplying power to various components. Preferably, the power supply 403 can be logically connected to the processor 401 via a power management system, thereby enabling the power management system to manage charging, discharging, and power consumption. The power supply 403 can also include one or more DC or AC power supplies, a recharging system, a power failure detection circuit, a power converter or inverter, a power status indicator, and other arbitrary components.

[0299] The electronic device may further include an input unit 404, which may be configured to receive input digital or character information and generate keyboard, mouse, joystick, optical or trackball signal inputs related to user settings and function control.

[0300] Although not shown, the electronic device may further include a display unit, etc., which will not be described in detail here. Specifically, in this embodiment, the processor 401 in the electronic device will load the executable files corresponding to the processes of one or more application programs into the memory 402 according to the following instructions, and the processor 401 will run the application programs stored in the memory 402 to implement various functions as follows:

[0301] Acquire an original facial image frame, audio driving information, and emotion driving information of the object to be adjusted, wherein the original facial image frame includes the original face of the object to be adjusted, the audio driving information includes the voice content of the object to be adjusted, so as to drive the facial posture of the original face to change according to the voice content, and the emotion driving information is used to describe the target emotion when the object to be adjusted emits the voice content, so as to drive the facial posture of the original face to change according to the target emotion; perform spatial feature extraction on the original facial image frame to obtain the original facial spatial features corresponding to the original facial image frame; perform feature interaction processing on the audio driving information and the emotion driving information to obtain the facial local posture features of the object to be adjusted when emitting the voice content under the target emotion; perform facial reconstruction processing on the object to be adjusted based on the original facial spatial features and the facial local posture features to generate a target facial image frame.

[0302] The specific implementation of the above operations can be found in the previous embodiments and will not be repeated here.

[0303] Those skilled in the art will appreciate that all or part of the steps in the various methods of the above embodiments may be accomplished by a computer program or by controlling related hardware through instructions. The computer program may be stored in a computer-readable storage medium and loaded and executed by a processor.

[0304] To this end, an embodiment of the present application provides a computer-readable storage medium, which stores a computer program. The computer program can be loaded by a processor to execute the steps in any image generation method provided in the embodiment of the present application.

[0305] The specific implementation of the above operations can be found in the previous embodiments and will not be repeated here.

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

[0307] Since the computer program stored in the computer-readable storage medium can execute the steps in any image generation method provided in the embodiments of the present application, the beneficial effects that can be achieved by any image 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.

[0308] According to one aspect of the present application, a computer program product is provided, comprising a computer program stored in a computer-readable storage medium. A processor of a computer device reads the computer program from the computer-readable storage medium and executes the computer program, causing the computer device to perform the methods provided in various optional implementations of the aforementioned image generation aspects.

[0309] The above is a detailed introduction to an image generation method and related equipment provided in the embodiments of the present application. Specific examples are used in this article to illustrate the principles and implementation methods of the present application. The description of the above embodiments is only used to help understand the method of the present application and its core idea; at the same time, for technical personnel in this field, based on the ideas of the present application, there will be changes in the specific implementation methods and application scope. In summary, the content of this specification should not be understood as a limitation on the present application.

Claims

1. A method for generating an image, the method being performed by an electronic device, comprising: Acquire an original facial image frame, audio driving information, and emotion driving information, wherein the original facial image frame includes an original face of an object to be adjusted, the audio driving information includes voice content of the object to be adjusted, so as to drive the facial posture of the original face to change according to the voice content, and the emotion driving information is used to describe a target emotion when the object to be adjusted emits the voice content, so as to drive the facial posture of the original face to change according to the target emotion; Extracting spatial features from the original facial image frame to obtain original facial spatial features corresponding to the original facial image frame; Performing feature interaction processing on the audio driving information and the emotion driving information to obtain facial local gesture features of the object to be adjusted when the object emits the speech content under the target emotion; Based on the original facial spatial features and the facial local posture features, facial reconstruction processing is performed on the object to be adjusted to generate a target facial image frame.

2. According to the method of claim 1, the step of performing feature interaction processing on the audio driving information and the emotion driving information to obtain facial local gesture features of the object to be adjusted when the object emits the speech content under the target emotion comprises: Performing feature interaction processing on the audio driving information and the emotion driving information to obtain interactive feature information; The local facial posture feature is predicted based on the interaction feature information and the emotion-driven information.

3. The method according to claim 2, wherein the audio driving information includes a plurality of audio frames, and the step of performing feature interaction processing on the audio driving information and the emotion driving information to obtain interactive feature information comprises: Extracting object identity information from the original facial spatial features; Encoding position information of each audio frame in the audio driving information to obtain a position code of each audio frame, and combining the position codes corresponding to the multiple audio frames to obtain position code information corresponding to the audio driving information; The object identity information, the position coding information, the audio driving information and the emotion driving information are subjected to feature interaction processing to obtain the interaction feature information.

4. The method according to claim 2 or 3, wherein the predicting of the local facial posture features based on the interactive feature information and the emotion-driven information comprises: Fusing the interactive feature information and the emotion-driven information to obtain fused feature information; The fused feature information is decoded to obtain the facial local posture feature.

5. According to the method of claim 1, the step of performing feature interaction processing on the audio driving information and the emotion driving information to obtain facial local gesture features of the object to be adjusted when the object emits the speech content under the target emotion comprises: Acquire preset emotion intensity information corresponding to the emotion driving information; Performing feature interaction processing on the audio driving information, the emotion driving information and the preset emotion intensity information to obtain the facial local posture feature and updated emotion intensity information; The step of performing facial reconstruction processing on the object to be adjusted based on the original facial spatial features and the facial local posture features to generate a target facial image frame includes: Based on the original facial spatial features, the facial local posture features and the updated emotion intensity information, facial reconstruction processing is performed on the object to be adjusted to generate the target facial image frame.

6. The method according to any one of claims 1 to 4, wherein the facial reconstruction processing is performed on the object to be adjusted based on the original facial spatial features and the facial local posture features to generate a target facial image frame, comprising: Fusing the original facial spatial features and the facial local posture features to obtain fused facial spatial features; Based on the fused facial spatial features, performing facial reconstruction processing on the object to be adjusted to obtain a reference facial image frame corresponding to the object to be adjusted; The target facial image frame is generated based on the original facial image frame, the fused facial spatial features and the reference facial image frame.

7. The method according to claim 6, wherein the step of performing facial reconstruction processing on the object to be adjusted based on the fused facial spatial features to obtain a reference facial image frame corresponding to the object to be adjusted comprises: Based on the fused facial spatial features, performing facial reconstruction processing on the object to be adjusted to obtain a reconstructed three-dimensional facial image corresponding to the object to be adjusted; The reconstructed three-dimensional facial image is subjected to rendering mapping processing to obtain a reference facial image frame corresponding to the object to be adjusted.

8. The method according to claim 6 or 7, wherein generating the target facial image frame based on the original facial image frame, the fused facial spatial features and the reference facial image frame comprises: Performing multi-scale feature extraction on the original facial image frame to obtain original facial feature maps at multiple scales corresponding to the original facial image frame; Performing multi-scale feature extraction on the reference facial image frame to obtain reference facial feature maps at multiple scales corresponding to the reference facial image frame; Performing encoding mapping processing on the fused facial spatial features to obtain latent feature information corresponding to the fused facial spatial features; The original facial feature maps at the multiple scales, the reference facial feature maps at the multiple scales, and the latent feature information are fused to obtain the target facial image frame.

9. The method according to any one of claims 1 to 8, wherein extracting spatial features from the original facial image frame to obtain original facial spatial features corresponding to the original facial image frame comprises: Extracting spatial features of the original facial image frame through an image generation model to obtain original facial spatial features corresponding to the original facial image frame; The performing feature interaction processing on the audio driving information and the emotion driving information to obtain the facial local posture features of the object to be adjusted when the object emits the speech content under the target emotion includes: By using the image generation model, the audio driving information and the emotion driving information are subjected to feature interaction processing to obtain the facial local posture feature; The step of performing facial reconstruction processing on the object to be adjusted based on the original facial spatial features and the facial local posture features to generate a target facial image frame includes: Based on the original facial spatial features and the facial local posture features, the facial reconstruction process is performed on the object to be adjusted through the image generation model to generate the target facial image frame.

10. The method according to claim 9, before extracting spatial features from the original facial image frame using an image generation model to obtain the original facial spatial features corresponding to the original facial image frame, further comprising: Acquire training data, wherein the training data includes original facial image frame samples of a sample object, target-driven facial image frame samples, and audio-driven information samples and emotion-driven information samples corresponding to the target-driven facial image frame samples; Extracting spatial features of the original facial image frame samples through a preset image generation model to obtain original facial spatial features corresponding to the original facial image frame samples; Performing feature interaction processing on the audio-driven information sample and the emotion-driven information sample to obtain facial local posture sample features corresponding to the target-driven facial image frame sample; Based on the original facial spatial features and the facial local posture sample features, performing facial reconstruction processing on the sample object to obtain a predicted driven facial image frame; Based on the target driving facial image frame samples and the predicted driving facial image frames, the parameters of the preset image generation model are adjusted to obtain a trained image generation model.

11. The method according to claim 10, wherein the parameters of the preset image generation model are adjusted based on the target driving facial image frame sample and the predicted driving facial image frame to obtain a trained image generation model, comprising: Performing emotion recognition processing on the target driven facial image frame sample to obtain a first emotion recognition result corresponding to the target driven facial image frame sample, and performing emotion recognition processing on the sample object in the predicted driven facial image frame to obtain a second emotion recognition result corresponding to the predicted driven facial image frame; Calculating emotion loss information of the preset image generation model based on the first emotion recognition result and the second emotion recognition result; Determining reconstruction loss information of the preset image generation model based on the similarity between the target driving facial image frame sample and the predicted driving facial image frame; According to the emotion loss information and the reconstruction loss information, the parameters of the preset image generation model are adjusted to obtain a trained image generation model.

12. The method according to claim 11, wherein the parameters of the preset image generation model are adjusted according to the emotion loss information and the reconstruction loss information to obtain a trained image generation model, comprising: Extracting spatial features of the target driven facial image frame samples to obtain target facial spatial features corresponding to the target driven facial image frame samples; Extracting facial key points from the target facial spatial features to obtain first facial key points corresponding to the target facial spatial features, and extracting facial key points from the facial local posture sample features to obtain second facial key points corresponding to the facial local posture sample features; Determining facial key point loss information based on the first facial key point and the second facial key point; Determining regularization loss information of the preset image generation model based on a feature distance between the facial local posture sample feature and the target facial spatial feature; According to the emotion loss information, the reconstruction loss information, the facial key point loss information and the regularization loss information, the parameters of the preset image generation model are adjusted to obtain a trained image generation model.

13. The method according to claim 1, wherein the step of performing feature interaction processing on the audio driving information and the emotion driving information to obtain facial local gesture features of the object to be adjusted when the object emits the speech content under the target emotion comprises: The character string corresponding to each audio frame in the audio driving information is arranged in the order of the audio frames to obtain an arranged character string sequence, the character string corresponding to the emotion driving information is added to the arranged character string sequence to obtain an updated character string sequence, for each character string in the updated character string sequence, feature information of the character string is extracted, the feature information of the character string is processed according to feature information of previous and next characters of the character string, the feature information of each processed character string is fused to obtain interactive feature information, and the local facial posture feature is predicted based on the interactive feature information and the emotion driving information.

14. An image generating device, the device being deployed on an electronic device, comprising: an acquisition unit, configured to acquire an original facial image frame, audio driving information, and emotion driving information of an object to be adjusted, wherein the original facial image frame includes an original face of the object to be adjusted, the audio driving information includes voice content of the object to be adjusted, so as to drive the facial posture of the original face to change according to the voice content, and the emotion driving information is used to describe a target emotion when the object to be adjusted emits the voice content, so as to drive the facial posture of the original face to change according to the target emotion; An extraction unit, configured to extract spatial features from the original facial image frame to obtain original facial spatial features corresponding to the original facial image frame; An interaction unit, configured to perform feature interaction processing on the audio driving information and the emotion driving information to obtain facial local gesture features of the object to be adjusted when the object emits the speech content under the target emotion; The reconstruction unit is used to perform facial reconstruction processing on the object to be adjusted based on the original facial spatial features and the facial local posture features to generate a target facial image frame.

15. An electronic device comprising a memory and a processor; the memory stores a computer program, and the processor is used to run the computer program in the memory to execute the method according to any one of claims 1 to 13.

16. A computer-readable storage medium storing a computer program, wherein the computer program is suitable for being loaded by a processor to execute the method according to any one of claims 1 to 13.

17. A computer program product, comprising a computer program, which implements the method according to any one of claims 1 to 13 when executed by a processor.