A facial expression synthesis method based on generative adversarial network
Through the feature separation and fusion framework based on the generative adversarial network, the problem of feature entanglement in facial expression synthesis is solved, high-resolution synthesis is achieved, and the synthesis effect is verified through similarity indicators, which solves the problem of facial expression image distortion in the existing technology. question.
Patent Information
- Application Number
- CN202111639025.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-12-29
- Publication Date
- 2024-10-15
- Estimated Expiration
- 2041-12-29
AI Technical Summary
Existing image synthesis methods have feature entanglement in facial expression synthesis, resulting in distortion and low resolution of synthesized facial expression images, and lack effective theoretical verification methods.
A feature separation and fusion framework based on generative adversarial networks is used to extract identity and expression feature vectors through the ResNet50 network, and encoding and decoding are performed in the feature separation framework. It combines progressive layers and affine transformations to achieve feature decoupling and fusion. Finally, using The similarity index evaluates the synthesis effect.
It improves the high-resolution synthesis of facial expression images, ensures the accuracy of feature separation, and theoretically verifies the effectiveness of the synthesis effect through structural similarity and quality evaluation indicators.
Smart Images

Figure CN114399453B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of image processing, and in particular to a method for synthesizing facial expressions based on a generative adversarial network. Background Art
[0002] Existing image synthesis methods usually directly input the source image and the target image into the generation network for fusion processing to obtain the final facial expression image. However, this method has limitations: First, due to the complexity of the overall structure of the human face, when each dimension in the feature vector obtained by the transformation is controlled by a corresponding feature, the remaining other features can only be controlled by a combination of multiple dimensions, which produces feature entanglement, and then causes the subsequent synthesized facial expression image to be distorted, have low resolution and other undesirable phenomena; second, the final synthesis effect of the facial expression image is only verified intuitively by the human eye, and the effectiveness of the implementation process of the entire image synthesis method cannot be judged theoretically. Summary of the invention
[0003] The present invention provides a facial expression synthesis method based on a generative adversarial network to solve one or more technical problems existing in the prior art and at least provide a beneficial choice or create conditions.
[0004] The present invention provides a method for synthesizing facial expressions based on a generative adversarial network, comprising:
[0005] Construct a feature separation framework and a feature fusion framework based on a generative adversarial network, and any framework includes a mapping network and a generation network composed of N (N>1) progressive layers;
[0006] Extracting an initial identity feature vector from the source image, and then inputting the initial identity feature vector into the feature separation framework for encoding and decoding to obtain an optimized identity feature vector;
[0007] Extracting an initial expression feature vector from the target image, and then inputting the initial expression feature vector into the feature separation framework for encoding and decoding to obtain an optimized expression feature vector;
[0008] The identity feature vector and the expression feature vector are sequentially input into the generation network in the feature fusion framework in a specified progressive layer manner to perform fusion operations between different levels to obtain a facial expression image;
[0009] The synthesis result of the facial expression image is evaluated according to the similarity index value between the facial expression image and the source image.
[0010] Furthermore, the N progressive layers are connected in series in order of output image resolution from small to large.
[0011] Furthermore, the identity feature vector and the expression feature vector are sequentially input into the generating network in the feature fusion framework in a specified progressive layer manner to perform fusion operations between different levels to obtain the facial expression image, including:
[0012] Specifying K (0<K<N) progressive layers from the N progressive layers to use the identity feature vector as input and the remaining NK progressive layers to use the expression feature vector as input;
[0013] Performing an affine transformation on the identity feature vector to obtain a first control vector, and performing an affine transformation on the expression feature vector to obtain a second control vector;
[0014] Starting from the first progressive layer, upsampling and convolution operations are performed on the feature vector of the specified input, and the control vector corresponding to the feature vector is used to correct the result to obtain the first layer output vector;
[0015] In the second progressive layer, the feature vector of the specified input is normalized and merged with the output vector of the first layer, and then the merged vector is upsampled and convolved, and the result is corrected using the control vector corresponding to the feature vector to obtain the output vector of the second layer;
[0016] By analogy, the Nth layer output vector is obtained in the Nth progressive layer, and then the Nth layer output vector is converted into a facial expression image.
[0017] Furthermore, extracting the initial identity feature vector from the source image includes:
[0018] Based on the fact that the source image contains real face information, face alignment cropping and background normalization processing are performed on the source image to obtain a source image to be processed after removing redundant information;
[0019] The ResNet50 network is used to extract the identity feature information contained in the source image to be processed to form an initial identity feature vector.
[0020] Furthermore, the initial identity feature vector is input into the feature separation framework for encoding and decoding to obtain the optimized identity feature vector, including:
[0021] Inputting the initial identity feature vector into the mapping network in the feature separation framework for linear transformation to obtain a third intermediate vector;
[0022] Inputting the third intermediate vector into the generating network in the feature separation framework to perform feature separation enhancement and reorganization to obtain a reorganized source image;
[0023] A feature loss value between the recombined source image and the source image is calculated, and after determining that the feature loss value reaches a preset convergence condition, the third intermediate vector is directly defined as an optimized identity feature vector.
[0024] Furthermore, after determining that the feature loss value does not reach a preset convergence condition, the Adam optimizer is used to update the third intermediate vector according to the feature loss value, and then the updated third intermediate vector is returned to the generation network in the feature separation framework for feature separation enhancement and reorganization.
[0025] Furthermore, the step of inputting the third intermediate vector into a generation network in a feature separation framework for feature separation enhancement and reorganization to obtain a reorganized source image includes:
[0026] Performing an affine transformation on the third intermediate vector to obtain a third control vector;
[0027] Starting from the first progressive layer, a random noise is input and up-sampled and convolved, and the result is corrected by using the third control vector to obtain a first-layer feature vector;
[0028] In the second progressive layer, upsampling and convolution operations are performed on the first layer feature vectors, and the results are corrected using the third control vector to obtain the second layer feature vectors;
[0029] By analogy, an N-th layer feature vector is obtained in the N-th progressive layer, and then the N-th layer feature vector is converted into a reconstructed source image.
[0030] Furthermore, the similarity index value includes a structural similarity index value between the facial expression image and the source image and a quality assessment index value of the facial expression image.
[0031] The present invention has at least the following beneficial effects: using the ResNet50 network to extract the initial feature vectors contained in the source image and the target image respectively, and then building a feature separation framework to perform feature decoupling only on the two initial feature vectors, thereby obtaining two optimized feature vectors that can control a single feature, thereby ensuring the accuracy of feature separation; by building a feature fusion framework to perform regular fusion operations on the above two optimized feature vectors, high-resolution synthetic output of facial expression images can be achieved; by introducing a similarity index value to verify the synthetic effect of the facial expression image, the implementation effectiveness of the entire synthesis method is theoretically supported. BRIEF DESCRIPTION OF THE DRAWINGS
[0032] The accompanying drawings are used to provide a further understanding of the technical solution of the present invention and constitute a part of the specification. Together with the embodiments of the present invention, they are used to explain the technical solution of the present invention and do not constitute a limitation on the technical solution of the present invention.
[0033] Figure 1 It is a flowchart of a facial expression synthesis method based on a generative adversarial network in an embodiment of the present invention. DETAILED DESCRIPTION
[0034] In order to make the purpose, technical solution and advantages of the present invention more clearly understood, the present invention is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not used to limit the present invention.
[0035] It should be noted that, although the functional modules are divided in the system schematic diagram and the logical order is shown in the flowchart, in some cases, the steps shown or described may be performed in a different order than the module division in the system or the order in the flowchart. The terms "first", "second", etc. in the specification, claims and the above drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence.
[0036] See also Figure 1 , Figure 1 A schematic flow chart of a method for synthesizing facial expressions based on a generative adversarial network provided by an embodiment of the present invention is shown, and the method comprises the following steps:
[0037] S101, constructing a feature separation framework and a feature fusion framework based on a generative adversarial network, wherein any framework includes a mapping network and a generation network composed of N (N>1) progressive layers;
[0038] Among them, the N progressive layers are connected in series in the order of output image resolution from small to large. In the embodiment of the present invention, only nine progressive layers are used according to the resolution requirement, and the implementation effect of each progressive layer is: when the image vector to be processed is input into the generation network, in the two progressive layers with a resolution of 4*4 and a resolution of 8*8, only low-level features such as face posture, face hairstyle contour and face shape can be affected, in the two progressive layers with a resolution of 16*16 and a resolution of 32*32, high-level features such as face features, face hairstyle shape, eye opening and closing amplitude, and mouth opening and closing amplitude are mainly affected, and in the five progressive layers with a resolution of 64*64 to 1024*1024, microscopic features such as eye pupil color, hair color, and face skin color are mainly affected.
[0039] S102, extracting an initial identity feature vector from the source image, and then inputting the initial identity feature vector into the feature separation framework for encoding and decoding to obtain an optimized identity feature vector;
[0040] The implementation process of the present invention includes the following:
[0041] (1) Based on the fact that the source image contains real face information, the source image is subjected to face alignment, cropping and background normalization processing to obtain a source image to be processed after removing redundant information;
[0042] In this step (1), firstly, the coordinates of the center points of both eyes and the left and right critical points of the mouth in the source image are obtained, and the line segment distance between the left eye and the right critical point of the mouth and the line segment distance between the right eye and the left critical point of the mouth are calculated. Then, the maximum line segment distance is taken as the basic scale and the center point of the line segment is defined as the facial reference point. Secondly, a face alignment area centered on the facial reference point is cropped out from the source image, and the length of each side of the face alignment area is four times the basic scale, and the connecting lines between the two sides and the center points of both eyes are parallel to each other. Finally, image enhancement processing and background normalization processing are performed on the cropped image in sequence to obtain the source image to be processed.
[0043] It should be noted that, when at least one vertex in the face alignment area falls outside the area where the source image is located, a data filling operation is performed on the edge of the area where the source image is located to ensure normal extraction of the face alignment area.
[0044] (2) extracting identity feature information contained in the source image to be processed using a ResNet50 network to form an initial identity feature vector;
[0045] In this step (2), the structure of the ResNet50 network includes a convolution layer, a pooling layer and a fully connected layer. When the source image to be processed is input into the ResNet50 network, a sliding convolution operation is performed on each pixel in the source image to be processed using a number of convolution kernels of different sizes to output all local features contained in the source image to be processed. Then, all local features are reduced in dimension one by one using the pooling layer, and then all local features after dimension reduction are integrated using the fully connected layer to obtain an initial identity feature vector.
[0046] (3) inputting the initial identity feature vector into the mapping network in the feature separation framework for linear transformation to obtain a third intermediate vector;
[0047] In the embodiment of the present invention, the mapping network is composed of eight fully connected layers connected in series in sequence. After the initial identity feature vector is input into the mapping network, the initial identity feature vector may be subjected to mapping encoding processing.
[0048] (4) inputting the third intermediate vector into the generative network in the feature separation framework to perform feature separation enhancement and reorganization to obtain a reorganized source image;
[0049] In this step (4), firstly, the third intermediate vector w is affine transformed to obtain the third control vector y=(y s ,y b ), where y s is the scaling factor, y b is the bias factor; then starting from the first progressive layer, a random noise is input and upsampled and convolved, and the result is corrected by the third control vector to obtain the first layer feature vector; in the second progressive layer, the first layer feature vector is upsampled and convolved, and the result is corrected by the third control vector to obtain the second layer feature vector; and so on, in the Nth progressive layer, the Nth layer feature vector is obtained, and then the Nth layer feature vector is converted into a reconstructed source image.
[0050] It should be noted that the third control vector is configured to respectively modify the upsampling result and the convolution result output by each progressive layer, that is, to perform adaptive instance normalization processing on the above two output results, which is specifically manifested as follows:
[0051]
[0052] Among them, AdaIN(x i ,y) is the output result x i The feature vector obtained after processing, μ(x i ) is the output result x i The mean value, σ(x i ) is the output result x i The standard deviation of .
[0053] (5) calculating a feature loss value between the reconstructed source image and the source image;
[0054] In this step (5), the VGG16 convolutional neural network is first used to extract the feature map I of the source image and the feature map G of the reconstructed source image, and then the Euclidean distance between the feature map I and the feature map G is calculated, that is, the feature loss value between the reconstructed source image and the source image is:
[0055]
[0056] Among them, Loss is the feature loss value, ω is the feature latent code corresponding to the third intermediate vector, and L percept (G,I) is the perceptual loss function, λ L2 ‖GI‖2 is the result of the L2 regularization term. In the embodiment of the present invention, only four feature maps output by the VGG16 convolutional neural network are used for verification, namely, the one-dimensional feature map F1 output by the first convolutional layer, the two-dimensional feature map F2 output by the first convolutional layer, the two-dimensional feature map F3 output by the third convolutional layer, and the two-dimensional feature map F4 output by the fourth convolutional layer. j To generate one of the feature maps F j The weight parameters of the convolutional layer on which it depends.
[0057] (6) After determining that the feature loss value reaches a preset convergence condition, the third intermediate vector is directly defined as an optimized identity feature vector, and the process directly jumps to step S103;
[0058] (7) After determining that the feature loss value does not reach the preset convergence condition, use the Adam optimizer to update the third intermediate vector according to the feature loss value, and then use the updated third intermediate vector to return to re-execute step (4).
[0059] S103, extracting an initial expression feature vector from the target image, and then inputting the initial expression feature vector into the feature separation framework for encoding and decoding to obtain an optimized expression feature vector;
[0060] In the embodiment of the present invention, the implementation process of this step S103 is basically similar to the implementation process of the above-mentioned step S102, and the feature separation framework adopted by the two steps is also the same, which will not be described in detail here.
[0061] S104, inputting the identity feature vector and the expression feature vector into the generation network in the feature fusion framework in sequence in a designated progressive layer manner to perform fusion operations between different levels to obtain a facial expression image;
[0062] The implementation process of the present invention comprises: designating K (0<K<N) progressive layers from the N progressive layers to take the identity feature vector as input and the remaining NK progressive layers to take the expression feature vector as input; performing affine transformation on the identity feature vector to obtain a first control vector, and performing affine transformation on the expression feature vector to obtain a second control vector; starting from the first progressive layer, performing upsampling and convolution operations on the feature vector of the designated input, and using the control vector corresponding to the feature vector to correct the result, so as to obtain a first layer output vector; in the second progressive layer, normalizing the feature vector of the designated input and the first layer output vector, and then performing upsampling and convolution operations on the combined vector, and using the control vector corresponding to the feature vector to correct the result, so as to obtain a second layer output vector; and so on, obtaining an Nth layer output vector in the Nth progressive layer, and then converting the Nth layer output vector into a facial expression image.
[0063] It should be noted that the selection of the input value of each of the N progressive layers is the optimal result obtained by the technicians based on multiple experiments in advance, which shows that the K progressive layers with the identity feature vector as input are not necessarily arranged continuously, and similarly, the NK progressive layers with the expression feature vector as input are not necessarily arranged continuously. In addition, the process of correcting the result by using the corresponding control vector in each progressive layer is the same as the implementation principle in the above step S102, and will not be repeated here.
[0064] S105 . Evaluate a synthesis result of the facial expression image according to a similarity index value between the facial expression image and the source image.
[0065] In an embodiment of the present invention, the similarity index value includes a structural similarity index value SSIM between the facial expression image and the source image and a quality assessment index value FID of the facial expression image, which are respectively as follows:
[0066]
[0067]
[0068] Wherein, x is the source image, y is the facial expression image, l(x, y) is the brightness evaluation value, α is the brightness weight coefficient, c(x, y) is the contrast evaluation value, β is the contrast weight coefficient, s(x, y) is the image structure evaluation value, γ is the image structure weight coefficient, μ x is the mean of the source image, μ y is the mean value of the facial expression image, σ x is the variance of the source image, σ yis the variance of the facial expression image, σ xy is the covariance between the source image and the facial expression image, C1, C2, C3 are all constants, C x is the covariance matrix of the eigenvector of the source image, C y is the covariance matrix of the eigenvector of the facial expression image, and Tr(X) represents the sum of all elements on the diagonal of the matrix X.
[0069] The synthesis result of the facial expression image is evaluated, which is shown as follows: when the structural similarity index value SSIM obtained by the solution is higher, it means that the similarity between the facial expression image and the source image at the corresponding pixel level is higher; and when the quality evaluation index value FID obtained by the solution is lower, it means that the degree of distortion of the facial expression image is smaller, that is, the quality of the facial expression image is better.
[0070] Those of ordinary skill in the art will appreciate that all or some of the steps and systems in the disclosed method above can be implemented as software, firmware, hardware and appropriate combinations thereof. Some physical components or all physical components can be implemented as software executed by a central processing unit, a digital signal processor or a microprocessor, or implemented as hardware, or implemented as an integrated circuit. Such software can be distributed on a computer-readable medium, and the computer-readable medium can include a computer storage medium (or a non-transitory medium) and a communication medium (or a temporary medium). As known to those of ordinary skill in the art, computer storage media include volatile and non-volatile, removable and non-removable media implemented in any method or technology for storing information (such as computer-readable instructions, data structures, program modules or other data). Computer storage media include, but are not limited to, RAM, ROM, EEPROM, flash memory or other memory technology, CD-ROM, digital versatile disk (DVD) or other optical disk storage, magnetic cassette, magnetic tape, disk storage or other magnetic storage device, or any other medium that can be used to store desired information and can be accessed by a computer. Furthermore, as is well known to those skilled in the art, communication media typically embodies computer readable instructions, data structures, program modules, or other data in a modulated data signal such as a carrier wave or other transport mechanism, and may include any information delivery media.
[0071] The above specifically describes the preferred implementation of the present invention, but the present invention is not limited to the above implementation mode. Those skilled in the art can make various equivalent modifications or substitutions without violating the spirit of the present invention. These equivalent modifications or substitutions are all included in the scope defined by the claims of the present invention.
Claims
1. A facial expression synthesis method based on generative adversarial network, characterized in that: include: Construct a feature separation framework and a feature fusion framework based on a generative adversarial network, and any framework includes a mapping network and a generation network composed of N (N>1) progressive layers; Extracting an initial identity feature vector from the source image, and then inputting the initial identity feature vector into the feature separation framework for encoding and decoding to obtain an optimized identity feature vector; Extracting an initial expression feature vector from the target image, and then inputting the initial expression feature vector into the feature separation framework for encoding and decoding to obtain an optimized expression feature vector; The identity feature vector and the expression feature vector are sequentially input into the generation network in the feature fusion framework in a specified progressive layer manner to perform fusion operations between different levels to obtain a facial expression image; The synthesis result of the facial expression image is evaluated according to the similarity index value between the facial expression image and the source image.
2. The method for synthesizing facial expressions based on a generative adversarial network according to claim 1, characterized in that: The N progressive layers are connected in series in the order of output image resolution from small to large.
3. The method for synthesizing facial expressions based on a generative adversarial network according to claim 1, characterized in that: The identity feature vector and the expression feature vector are sequentially input into the generating network in the feature fusion framework in a specified progressive layer manner to perform fusion operations between different levels to obtain a facial expression image, including: Specifying K (0<K<N) progressive layers from the N progressive layers to use the identity feature vector as input and the remaining NK progressive layers to use the expression feature vector as input; Performing an affine transformation on the identity feature vector to obtain a first control vector, and performing an affine transformation on the expression feature vector to obtain a second control vector; Starting from the first progressive layer, upsampling and convolution operations are performed on the feature vector of the specified input, and the control vector corresponding to the feature vector is used to correct the result to obtain the first layer output vector; In the second progressive layer, the feature vector of the specified input is normalized and merged with the output vector of the first layer, and then the merged vector is upsampled and convolved, and the result is corrected using the control vector corresponding to the feature vector to obtain the output vector of the second layer; By analogy, the Nth layer output vector is obtained in the Nth progressive layer, and then the Nth layer output vector is converted into a facial expression image.
4. The method for synthesizing facial expressions based on a generative adversarial network according to claim 1, characterized in that: The extracting of the initial identity feature vector from the source image comprises: Based on the fact that the source image contains real face information, face alignment cropping and background normalization processing are performed on the source image to obtain a source image to be processed after removing redundant information; The ResNet50 network is used to extract the identity feature information contained in the source image to be processed to form an initial identity feature vector.
5. The method for synthesizing facial expressions based on a generative adversarial network according to claim 4, characterized in that: The initial identity feature vector is input into the feature separation framework for encoding and decoding to obtain the optimized identity feature vector, which includes: Inputting the initial identity feature vector into the mapping network in the feature separation framework for linear transformation to obtain a third intermediate vector; Inputting the third intermediate vector into the generating network in the feature separation framework to perform feature separation enhancement and reorganization to obtain a reorganized source image; A feature loss value between the recombined source image and the source image is calculated, and after determining that the feature loss value reaches a preset convergence condition, the third intermediate vector is directly defined as an optimized identity feature vector.
6. The method for synthesizing facial expressions based on a generative adversarial network according to claim 5, characterized in that: After determining that the feature loss value does not reach the preset convergence condition, the Adam optimizer is used to update the third intermediate vector according to the feature loss value, and then the updated third intermediate vector is returned and input into the generation network in the feature separation framework for feature separation enhancement and reorganization.
7. The method for synthesizing facial expressions based on a generative adversarial network according to claim 5, characterized in that: The step of inputting the third intermediate vector into the generative network in the feature separation framework for feature separation enhancement and reorganization to obtain the reorganized source image comprises: Performing an affine transformation on the third intermediate vector to obtain a third control vector; Starting from the first progressive layer, a random noise is input and up-sampled and convolved, and the result is corrected by using the third control vector to obtain a first layer feature vector; In the second progressive layer, upsampling and convolution operations are performed on the first layer feature vectors, and the results are corrected using the third control vector to obtain the second layer feature vectors; By analogy, an N-th layer feature vector is obtained in the N-th progressive layer, and then the N-th layer feature vector is converted into a reconstructed source image.
8. The method for synthesizing facial expressions based on a generative adversarial network according to claim 1, characterized in that: The similarity index value includes a structural similarity index value between the facial expression image and the source image and a quality assessment index value of the facial expression image.
