Skip to main content

One-Shot Free-View Neural Talking-Head Synthesis for Video Conferencing

In this report, we will look at the latest work published in CVPR 21 in the domain of one-shot talking-head synthesis.
Created on March 16|Last edited on April 19
For reasons we won't belabor, video conferencing has gained a tremendous user base in the last year. But despite its rise, it's not accessible to many because of the high network bandwidth required to carry both video and speech in real-time. Deep learning techniques (especially GANs) can deliver high-quality video via image compression at lower bit rates.
But before we dig into this research on a really interesting application of deep learning called talking head synthesis, we recommend checking out the brief video below. It'll help anchor the research as we dig a bit deeper into "One-Shot Free-View Neural Talking-Head Synthesis for Video Conferencing" (Wang et al., 2020).

Project Page | Paper | Online Demo




Overview of the Proposed Method

Let's first level-set on the notations that we'll be using and get a little clarity on the goal of this research. From the paper:
Let ss be an image of a person, referred to as the source image. Let {d1,d2,...,dN}\{d_1, d_2,...,d_N\} be a talking-head video, called the driving video, where did_i’s are the individual frames, and NN is the total number of frames.
Our goal is to generate an output video {y1,y2,...,yN}\{y_1, y_2,...,y_N\}, where the identity in yiy_i’s is inherited from ss and the motions are derived from did_i’s.
Depending on the ss (i.e. the image of the person), the goal can be either one of the two broader deep learning tasks:
  • If the person in the source image (ss) is the same as in the driving video (did_i), then it's a video reconstruction task. The generated output video (yiy_i) still takes the identity information from ss and motion information from did_i.
  • If the person in ss is not the same as in did_i, then it's a motion transfer task.
To inherit the features from the source image and control the novel synthesis of the talking head, the authors devised an unsupervised approach for learning a set of 3D keypoints and their decomposition.
The proposed method can be divided into three major steps:
  • Source image feature extraction
  • Driving video feature extraction
  • Video generation
The beauty of the proposed solution is the joint training of all the architectures, in all three stages. We will look into the training details in a moment, but let's first quickly look at the architectural design for source image feature extraction.

Source Image Feature Extraction

Figure: Different features extracted from the source image. (Source)
Four separate neural network architectures (well, three actually) are used to extract identity-specific information. Digging in a bit:

3D Appearance Feature Extraction (FF):

Using a neural network FF, the source image ss is mapped to a 3D appearance feature volume fsf_s. The network FF consists of multiple downsampling blocks followed by a number of 3D residual blocks to compute the 3D feature volume fsf_s.
Figure: Architectural design of FF. (Source)

KK3D Canonical Keypoint Extraction (LL):

Using a canonical 3D keypoint detection network LL, a set of KK  canonical 3D keypoints xc,kR3x_{c, k} \in \R^3 and their Jacobians Jc,kR3×3J_{c, k} \in \R^{3 \times 3} are extracted from ss.
The Jacobians represent how a local patch around the keypoint can be transformed into a patch in another image via an affine transformation.
The authors have used a U-Net style encoder-decoder to extract canonical keypoints.
Figure: Architectural design of LL. (Source)
Our canonical keypoints are formulated to be independent of the pose and expression change. They should only contain a person’s geometry signature, such as the shapes of face, nose, and eyes.

Head Pose (HH) and Expression Extraction (\triangle):

A pose estimation network HH is used to estimate the head pose of the person in ss. It is parameterized by a rotation matrix RsR3×3R_s \in \R^{3 \times 3} and a translation vector tsR3t_s \in \R^3. The rotation matrix RsR_s in practice is composed of three matrices - yaw, pitch
Expression deformation estimation network \triangle is used to estimate deformation of keypoints from the neutral expression. Thus there are KK 3D deformations δs,k\delta_{s, k}.
Note that the authors have used a common backbone with shared weights for both HH and \triangle. This is evident from the proposed architecture for the same.
Figure: Architectural design of HH and \triangle. (Source)
Note: The same architecture is used to extract motion-related information from the driving video.
Using the information from all 3 architectures, the authors have proposed a transformation TT to obtain the final 3D keypoints xs,kx_{s, k} and their Jacobians Js,kJ_{s, k} for the source image. TxT_x is applied to the keypoints and TjT_j to the Jacobians such that:
xs,k=Tx(xc,k,Rs,ts,δs,k)Rsxc,k+ts+δs,kx_{s, k} = T_x(x_{c, k}, R_s, t_s, \delta_{s, k}) \equiv R_sx_{c, k} + t_s + \delta_{s, k}
Js,k=Tj(Jc,k,Rs)RsJs,kJ_{s, k} = T_j(J_{c, k}, R_s) \equiv R_sJ_{s, k}

Driving Video Feature Extraction

Figure: Different features extracted from the driving video. (Source)
The driving video is used to extract motion-related information. To this end, head pose estimation network HH and expression deformation estimator network \triangle is used. Note that 3D feature extractor (FF) and canonical key point extraction network (LL) are not used. This is inclined to the formulated goal. From the paper,
Instead of extracting canonical 3D keypoints from the driving image dd using LL, we reuse xc,kx_{c, k} and Jc,kJ_{c, k}, which were extracted from the source image ss. This is because the face in the output image must have the same identity as the one in the source image ss. There is no need to compute them again.
Using the identity-specific information (xc,kx_{c, k} and Jc,kJ_{c, k}) and motion-related information, final 3D keypoints xd,kx_{d, k} and their Jacobians Jd,kJ_{d, k} is computed for the driving video. The same transformations TxT_x and TjT_j are used such that,
xd,k=Tx(xc,k,Rd,td,δd,k)Rdxc,k+td+δd,kx_{d, k} = T_x(x_{c, k}, R_d, t_d, \delta_{d, k}) \equiv R_dx_{c, k} + t_d + \delta_{d, k} Jd,k=Tj(Jc,k,Rd)RdJd,kJ_{d, k} = T_j(J_{c, k}, R_d) \equiv R_dJ_{d, k}
This 3D keypoint and its Jacobian are derived for every frame in the driving video. Since identity-specific information is used for computing final 3D keypoints and Jacobians for the driving video frame, we can provide user-specific rotation and translation matrix to change a person's head pose.
Our approach allows manual changes to the 3D head pose during synthesis. Let RuR_u and tut_ube user-specified rotation and translation, respectively. The final head pose in the output image is given by RdRuRdR_d \leftarrow R_uR_d and tdtu+tdt_d \leftarrow t_u + t_d. In video conferencing, we can change a person’s head pose in the video stream freely despite the original view angle.

Video Synthesis

Figure: Video synthesis pipeline. (Source)
The 3D keypoints and Jacobians extracted from the source image and the driving video frame are used to estimate warping flow maps. This flow map wkw_k is generated based on the kthk^{th} keypoint using the first-order approximation. This flow field wkw_k is used to warp the source feature wk(fs)w_k(f_s)  where k{1,2,..,K}k \in \{1,2,..,K\}. First Order Motion Model for Image Animation by Siarohin et al. might be a useful read. You can check out this paper's summary by Lavanya Shukla here.
These warped features are fed to a motion field estimator network MM which is a 3D U-Net style network. As shown in the figure, two outputs are estimated using this network - mask mm and occlusion oo.
Figure: Architectural design of MM. (Source)
  • Softmax activation is used to obtain the flow composition mask mm, which consists of KK 3D masks. These are again combined with KK warping flow maps wkw_k to obtain the final composite flow field ww. This is finally used to obtain the warped source feature w(fs)w(f_s).
  • Warping leads to occlusions. A 2D occlusion mask oo  is predicted to be inputted to the generator.
The authors have used a generator network GG that takes the warped 3D source feature map w(fs)w(f_s) and first projects them back to the 2D feature. This is then multiplied with the occlusion mask oo followed by a series of 2D residual blocks and upsampling layers to obtain the final image.
Figure: Architectural design of GG. (Source)
To summarize so far, we have source image ss and driving video dd. The task is to generate output video yy such that it has the identity-specific information from ss and motion-specific information from dd. To obtain identity-specific information different neural networks are used and the same goes for motion-specific information. These pieces of information are used to obtain KK 3D keypoints and Jacobians for both ss and dd.
These keypoints and Jacobians are then used to warp the source appearance feature fsf_sextracted from ss from which they generate the final output image using a generator network GG.
So how did the authors train this system? We'll cover the procedure, the dataset they used, and their losses.

Training the Models

The authors used a dataset of talking-head videos to train their models here. They mention the use of VoxCeleb2 and TalkingHead-1KH for evaluation, though it is a bit unclear which dataset they used for training.
For each video, two frames were sampled:
  • one would act as a source image ss,
  • and the other as the frame from the driving video dd.
The networks FF���, LL, HH, \triangle, MM, and GG are trained together by minimizing the following loss:
L=LP(d,y)+LG(d,y)+LE({xd,k},{Jd,k})+LL({xd,k})+LH(Rd,Rˉd)+L({δd,k})\mathcal{L} = \mathcal{L}_P(d, y) + \mathcal{L}_G(d, y) + \mathcal{L}_E(\{x_{d,k}\}, \{J_{d, k}\}) + \mathcal{L}_L(\{x_d, k\}) + \mathcal{L}_H(R_d, \bar{R}_d) + \mathcal{L}_{\triangle}(\{\delta_{d, k}\})
Let's go through each term one-by-one:
  • Perpetual Loss (LP\mathcal{L}_P): Perpetual loss is commonly used in image reconstruction tasks. Here's a nice description of this loss function. In short, a pre-trained VGG network is used to extract features from both the ground truth image and the reconstructed image. The L1L_1 distance is computed between the features. The features are extracted from multiple hidden layers of varying resolutions. Besides regular VGG (trained on ImageNet) the authors have also used a pre-trained face VGG network for obvious reasons.
  • GAN Loss (LG\mathcal{L}_G): The authors have used patch GAN implementation along with hinge loss. Check out this quick summary here.
  • Equivalence Loss (LE\mathcal{L}_E): This loss ensures the consistency of the estimated keypoints. Let xdx_d be the detected keypoints for the input image dd. When a known transformation TT is applied to the image (T(d)T(d)), the detected keypoints should be transformed in the same way. L1L_1 distance is minimized such that xdT1(xT(d))1||x_d - T^{-1}(x_{T(d)}) ||_1 tends to zero. Here T1T^{-1}  is the inverse of the known transform. The same logic is applicable to the jacobians of the keypoints.
  • Key Prior Loss (LLL_L): This loss encourages the estimated image-specific keypoints xd,kx_{d, k}to spread out across the face region, instead of crowding around a small neighborhood. Distance is computed between the keypoint pairs and penalized if the distance is below some threshold.
  • Head Pose Loss (LHL_H): L1L_1 distance is computed between the estimated head pose RdR_d and the one predicted by a pre-trained estimator Rˉd\bar{R}_d. This approximation is as good as the pre-trained model head pose estimator.
  • Deformation Prior Loss (LL_{\triangle}): This loss is simply given as L1L_1 norm of the deviation such that, L=δd,k1\mathcal{L}_{\triangle} = ||\delta_{d, k}||_1.
The models are trained using the coarse-to-fine technique. ADAM optimizer with a learning rate of 0.0002 is used to train the model on 256x256 resolution images for 100 epochs. This is then fine-tuned on 512x512 resolution images for 10 epochs.

Conclusion

The results of this research are really quite promising. The techniques we talked about here resulted in a 10X bandwidth reduction and, if you had a chance to look at the video in our introduction, you can see that the video quality is incredibly high considering that reduction. Models like this could make it possible to democratize access to video conferencing and reduce strain on networks, especially in residential and rural areas where bandwidth is already harder to come by.
The paper is packed with implementation details, failure modes, and other nitty-gritty. I highly recommend going through the paper especially the appendix section.
I would also like to thank Justin Tenuto for his edits.
Iterate on AI agents and models faster. Try Weights & Biases today.