A G OOD I MAGE G ENERATOR I S W HAT Y OU N EED FOR H IGH -R ESOLUTION V IDEO S YNTHESIS
Anonymous authors
Paper under double-blind review
A BSTRACT
Image and video synthesis are closely related areas aiming at generating content from noise.
While rapid progress has been demonstrated in improving imagebased models to handle large resolutions, high-quality renderings, and wide variations in image content, achieving comparable video generation results remains problematic.
We present a framework that leverages contemporary image generators to render high-resolution videos.
We frame the video synthesis problem as discovering a trajectory in the latent space of a pre-trained and ﬁxed image generator.
Not only does such a framework render high-resolution videos, but it also is an order of magnitude more computationally efﬁcient.
We introduce a motion generator that discovers the desired trajectory, in which content and motion are disentangled.
With such a representation, our framework allows for a broad range of applications, including content and motion manipulation.
Furthermore, we introduce a new task, which we call cross-domain video synthesis , in which the image and motion generators are trained on disjoint datasets belonging to different domains.
This allows for generating moving objects for which the desired video data is not available.
Extensive experiments on various datasets demonstrate the advantages of our methods over existing video generation techniques.
I NTRODUCTION
Video synthesis seeks to generate a sequence of moving pictures from noise.
While its closely related counterpart—image synthesis—has seen substantial advances in recent years, allowing for synthesizing at high resolutions (Karras et al., 2017), rendering images often indistinguishable from real ones (Karras et al., 2019), and supporting multiple classes of image content (Zhang et al., 2019), contemporary improvements in the domain of video synthesis have been comparatively modest.
Due to the statistical complexity of videos and larger model sizes, video synthesis produces relatively low-resolution videos, yet requires longer training times.
For example, scaling the image generator of Brock et al.
(2019) to generate 256 × 256 videos requires a substantial computational budget 1 .
Can we use a similar method to attain higher resolutions?
We believe a different approach is needed.
There are two desired properties for generated videos: (i) high quality for each individual frame, and (ii) the frame sequence should be temporally consistent, i.e. depicting the same content with plausible motion.
Previous works (Tulyakov et al., 2018; Clark et al., 2019) attempt to achieve both goals with a single framework, making such methods computationally demanding when high resolution is desired.
We suggest a different perspective on this problem.
We hypothesize that, given an image generator that has learned the distribution of video frames as independent images, a video can be represented as a sequence of latent codes from this generator.
The problem of video synthesis can then be framed as discovering a latent trajectory that renders temporally consistent images.
Hence, we demonstrate that (i) can be addressed by a pre-trained and ﬁxed image generator, and (ii) can be achieved using the proposed framework to create appropriate image sequences.
To discover the appropriate latent trajectory, we introduce a motion generator, implemented via two recurrent neural networks, that operates on the initial content code to obtain the motion representation.
We model motion as a residual between continuous latent codes that are passed to the image generator for individual frame generation.
Such a residual representation can also facilitate the disentangling of motion and content.
The motion generator is trained using the chosen image discriminator with contrastive loss to force the content to be temporally consistent, and a patch-based multi-scale video discriminator for learning motion patterns.
Our framework supports contemporary image generators such as StyleGAN2 (Karras et al., 2019) and BigGAN (Brock et al., 2019).
Our proposed approach features several major advantages over traditional video synthesis pipelines.
First, it transcends the limited resolutions of existing techniques, allowing for the generation of highquality videos at resolutions up to 1024 × 1024 .
Second, as we search for a latent trajectory in an image generator, our method is computationally more efﬁcient, requiring an order of magnitude less training time than previous video-based works (Clark et al., 2019).
Third, as the image generator is ﬁxed, it can be trained on a separate high-quality image dataset.
Due to the disentangled representation of motion and content, our approach can learn motion from a video dataset and apply it to an image dataset, even in the case of two datasets belonging to different domains.
It thus unleashes the power of an image generator to synthesize high quality videos when a domain ( e.g. , dogs) contains many high-quality images but no corresponding high-quality videos (see Fig. 4).
In this manner, our method can generate realistic videos of objects it has never seen moving during training (such as generating realistic pet face videos using motions extracted from images of talking people).
We refer to this new video generation task as cross-domain video synthesis .
Finally, we quantitatively and qualitatively evaluate our approach, attaining state-of-the-art performance on each benchmark, and establish a challenging new baseline for video synthesis methods.
R ELATED W ORK
Video Synthesis .
Approaches to image generation and translation using Generative Adversarial
Networks (GANs) (Goodfellow et al., 2014) have demonstrated the ability to synthesize high quality images (Radford et al., 2016; Zhang et al., 2019; Brock et al., 2019; Donahue & Simonyan, 2019).
Built upon image translation (Isola et al., 2017; Wang et al., 2018b), works on video-tovideo translation (Bansal et al., 2018; Wang et al., 2018a) are capable of converting an input video to a high-resolution output in another domain.
However, the task of high-ﬁdelity video generation, in the unconditional setting, is still a difﬁcult and unresolved problem.
Without the strong conditional inputs such as segmentation masks (Wang et al., 2019) or human poses (Chan et al., 2019; Ren et al., 2020) that are employed by video-to-video translation works, generating videos following the distribution of training video samples is challenging.
Earlier works on GAN-based video modeling, including MDPGAN (Yushchenko et al., 2019), VGAN (Vondrick et al., 2016), TGAN (Saito et al., 2017), MoCoGAN (Tulyakov et al., 2018), ProgressiveVGAN (Acharya et al., 2018), TGANv2 (Saito et al., 2020) show promising results on low-resolution datasets.
Recent efforts demonstrate the capacity to generate more realistic videos, but with signiﬁcantly more computation (Clark et al., 2019; Weissenborn et al., 2020).
In this paper, we focus on generating realistic videos using manageable computational resources.
LDVDGAN (Kahembwe & Ramamoorthy, 2020) uses low dimensional discriminator to reduce model size and can generate videos with resolution up to 512 × 512 , while we decrease training cost by utilizing a pre-trained image generator.
The high-quality generation is achieved by using pre-trained image generators, while the motion trajectory is modeled within the latent space.
Additionally, learning motion in the latent space allows us to easily adapt the video generation model to the task of video prediction (Denton et al., 2017), in which the starting frame is given (Denton & Fergus, 2018;
Walker et al., 2017; Villegas et al., 2017b;a; Babaeizadeh et al., 2017; Hsieh et al., 2018; Byeon et al., 2018), by inverting the initial frame through the generator (Abdal et al., 2020), instead of training an extra image encoder (Tulyakov et al., 2018; Zhang et al., 2020).
Interpretable Latent Directions .
The latent space of GANs is known to consist of semantically meaningful vectors for image manipulation.
Both supervised methods, either using human annotations or pre-trained image classiﬁers (Goetschalckx et al., 2019; Shen et al., 2020), and unsupervised methods (Jahanian et al., 2020; Plumerault et al., 2020), are able to ﬁnd interpretable directions for image editing, such as supervising directions for image rotation or background removal (Voynov &
Babenko, 2020; Shen & Zhou, 2020).
We further consider the motion vectors in the latent space.
By disentangling the motion trajectories in an unsupervised fashion, we are able to transfer the motion information from a video dataset to an image dataset in which no temporal information is available.
[Table]
+S5kXZuyq79ctSpfo0jyMPJ3AK5+DBNVSgCjVoAAOEZ3iFN+fBeXHenY95a85ZRHgMf+B8/gDDkY1U</latexit> F
G I G I
G I
Image Discriminator
Contrastive Learning
Augment
Cosine similarity
Positive
Negative Contrastive Representation Learning is widely studied in unsupervised learning tasks (He et al., 2020; Chen et al., 2020a;b; H ´ enaff et al., 2020; L ¨ owe et al., 2019; Oord et al., 2018; Misra & Maaten, 2020). Related inputs, such as images (Wu et al., 2018) or latent representations (Hjelm et al., 2019), which can vary while training due to data augmentation, are forced to be close by minimizing differences in their representation during training.
Recent work (Park et al., 2020) applies noisecontrastive estimation (Gutmann & Hyv ¨ arinen, 2010) to image generation tasks by learning the correspondence between image patches, achieving performance superior to that attained when using cycle-consistency constraints (Zhu et al., 2017;
Yi et al., 2017).
On the other hand, we learn an image discriminator to create videos with coherent content by leveraging contrastive loss (Hadsell et al., 2006) along with an adversarial loss (Goodfellow et al., 2014).
M ETHOD
In this section, we introduce our method for high-resolution video generation.
Our framework is built on top of a pre-trained image generator (Karras et al., 2020a;b; Zhao et al., 2020a;b), which helps to generate high-quality image frames and boosts the training efﬁciency with manageable computational resources.
In addition, with the image generator ﬁxed during training, we can disentangle video motion from image content, and enable video synthesis even when the image content and the video motion come from different domains.
More speciﬁcally, our inference framework includes a motion generator G M and an image generator
G I .
G M is implemented with two LSTM networks (Hochreiter & Schmidhuber, 1997) and predicts the latent motion trajectory Z = { z 1 , z 2 , · · · , z n } , where n is the number of frames in the synthesized video.
The image generator G I can thus synthesize each individual frame from the motion trajectory.
The generated video sequence ˜ v is given by ˜ v = { ˜ x 1 , ˜ x 2 , · · · , ˜ x n } .
For each synthesized frame ˜ x t , we have ˜ x t
=
G I ( z t ) for t = 1 , 2 , · · · , n .
We also deﬁne the real video clip as v = { x 1 , x 2 , · · · , x n } and the training video distribution as p v .
To train the motion generator G M to discover the desired motion trajectory, we apply a video discriminator to constrain the generated motion patterns to be similar to those of the training videos, and an image discriminator to force the frame content to be temporally consistent.
Our framework is illustrated in Fig.
We describe each component in more detail in the following sections.
3. M OTION G ENERATOR
The motion generator G M predicts consecutive latent codes using an input code z 1 ∈ Z , where the latent space Z is also shared by the image generator.
For BigGAN (Brock et al., 2019), we sample zfrom the normal distribution p z .
For StyleGAN2 (Karras et al., 2020b), p z is the distribution after the multi-layer perceptron (MLP), as the latent codes within this distribution can be semantically disentangled better than when using the normal distribution (Shen et al., 2020; Zhu et al., 2020).
Formally, G M includes an LSTM encoder LSTM enc , which encodes z 1 to get the initial hidden state, and a LSTM decoder LSTM dec , which estimates n − 1 continuous hidden states recursively:
[Equation]
where h and c denote the hidden state and cell state respectively, and (cid:15) t is a noise vector sampled from the normal distribution to model the motion diversity at timestamp t .
Motion Disentanglement.
Prior work (Tulyakov et al., 2018) applies h t as the motion code for the frame to be generated, while the content code is ﬁxed for all frames.
However, such a design requires a recurrent network to estimate the motion while preserving consistent content from the latent vector, which is difﬁcult to learn in practice.
Instead, we propose to use a sequence of motion residuals for estimating the motion trajectory.
Speciﬁcally, we model the motion residual as the linear combination of a set of interpretable directions in the latent space (Shen & Zhou, 2020; H¨ark¨onen et al., 2020).
We ﬁrst conduct principal component analysis (PCA) on m randomly sampled latent vectors from Z to get the basis V .
Then, we estimate the motion direction from the previous frame z t − 1 to the current frame z t by using h t and V as follows:
[Equation]
where the hidden state h t ∈ [ − 1 , 1] , and λ controls the step given by the residual.
With Eqn.and Eqn. 2, we have G M ( z 1 ) =
{ z 1 , z 2 , · · · , z n } , and the generated video ˜ v is given as ˜ v =
G I ( G M ( z 1 )) .
Motion Diversity.
In Eqn. 1, we introduce a noise vector (cid:15) t to control the diversity of motion.
However, we observe that the LSTM decoder tends to neglect the (cid:15) t , resulting in motion mode collapse , meaning that G M cannot capture the diverse motion patterns from training videos and generate distinct videos from one initial latent code with similar motion patterns for different sequences of noise vectors.
To alleviate this issue, we introduce a mutual information loss L m to maximize the mutual information between the hidden vector h t and the noise vector (cid:15) t .
With sim( u , v ) =
u T v / (cid:107) u (cid:107) (cid:107) v (cid:107) denoting the cosine similarity between vectors u and v , we deﬁne L m as follows:
[Equation]
where H is a 2-layer MLP that serves as a mapping function.
Learning.
To learn the appropriate parameters for the motion generator G M , we apply a multi-scale video discriminator D V to tell whether a video sequence is real or synthesized.
The discriminator is based on the architecture of PatchGAN (Isola et al., 2017).
However, we use 3D convolutional layers in D V , as they can model temporal dynamics better than 2D convolutional layers.
We divide input video sequence into small 3D patches, and classify each patch as real or fake.
The local responses for the input sequence are averaged to produce the ﬁnal output.
Additionally, each frame in the input video sequence is conditioned on the ﬁrst frame, as it falls into the distribution of the pre-trained image generator, for more stable training.
We thus optimize the following adversarial loss to learn
G M and D V :
[Equation]
3. C ONTRASTIVE I MAGE D ISCRIMINATOR
As our image generator is pre-trained, we may use an image generator that is trained on a given domain, e.g. images of animal faces (Choi et al., 2020), and learn the motion generator parameters using videos from a different domain, such as videos of human facial expressions (Nagrani et al.,
With Eqn.
4 alone, however, we lack the ability to explicitly constrain the generated images ˜ x t | t> 1 to possess similar quality and content as the ﬁrst image ˜ x 1 , which is sampled from the image space of the image generator and thus has high ﬁdelity.
Hence, we introduce a contrastive image discriminator D I , which is illustrated in Fig.
1, to match both image quality and content between ˜ xand
˜ x t | t> 1 .
Quality Matching.
To increase the perceptual quality, we train D I and G M adversarially by forwarding ˜ x t into the discriminator D I and using ˜ x 1 as real sample and ˜ x t | t> 1 as the fake sample.
[Equation]
Content Matching.
To learn content similarity between frames within a video, we use the image discriminator as a feature extractor and train it with a form of contrastive loss known as InfoNCE (Oord et al., 2018).
The goal is that pairs of images with the same content should be close together in embedding space, while images containing different content should be far apart.
Given a minibatch of N generated videos { ˜ v (1) , ˜ v (2) , · · · , ˜ v ( N ) } , we randomly sample one frame t from each video: { ˜ x (1) t , ˜ x (2) t , · · · , ˜ x ( N ) t } , and make two randomly augmented versions ( ˜ x ( ia ) t , ˜ x ( ib ) t ) for each frame ˜ x
( i ) t , resulting in 2 N samples.
( ˜ x ( ia ) t , ˜ x ( ib ) t ) are positive pairs, as they share the same content.
( ˜ x ( i · ) t , ˜ x ( j · ) t ) are all negative pairs for i (cid:54) =
j .
Let F be an encoder network, which shares the same weights and architecture of D I , but excluding the last layer of D I and including a 2-layer MLP as a projection head that produces the representation of the input images.
We have a contrastive loss function L contr , which is the cross-entropy computed across 2 N augmentations as follows:
[Equation]
where sim ( · , · ) is the cosine similarity function deﬁned in Eqn. 3, 1 [ j (cid:54)
=
i ] ∈ { 0 , 1 } is equal to 1 iff j (cid:54)
=
i , and τ is a temperature parameter empirically set to 0 .
We use a momentum decoder mechanism similar to that of MoCo (He et al., 2020) by maintaining a memory bank to delete the oldest negative pairs and update the new negative pairs.
We apply augmentation methods including translation, color jittering, and cutout (DeVries & Taylor, 2017) on synthesized images.
With the positive and negative pairs generated on-the-ﬂy during training, the discriminator can effectively focus on the content of the input samples.
The choice of positive pairs in Eqn. 6 is speciﬁcally designed for cross-domain video synthesis, as videos of arbitrary content from the image domain is not available.
In the case that images and videos are from the same domain, the positive and negative pairs are easier to obtain.
We randomly select and augment two frames from a real video to create positive pairs sharing the same content, while the negative pairs contain augmented images from different real videos.
Aside from L contr , we also adopt the feature matching loss (Wang et al., 2018b)
L f between the generated ﬁrst frame and other frames by changing the L 1 regularization to cosine similarity.
Full Objective.
The overall loss function for training motion generator, video discriminator, and image discriminator is thus deﬁned as:
[Equation]
where λ m , λ contr , and λ f are hyperparameters to balance losses.
E XPERIMENTS
In this section, we evaluate the proposed approach on several benchmark datasets for video generation.
We also demonstrate cross-domain video synthesis for various image and video datasets.
4. V IDEO G ENERATION
We conduct experiments on three datasets including UCF-101 (Soomro et al., 2012), FaceForensics (R¨ossler et al., 2018), and Sky Time-lapse (Xiong et al., 2018) for unconditional video synthesis.
We use StyleGAN2 as the image generator.
Training details can be found in Appx.
B.
[Table] [Table] UCF-101 is widely used in video generation.
The dataset includes 13 , 320 videos of 101 sport categories.
The resolution of each video is 320 × 240 .
To process the data, we crop a rectangle with size of 240 × 240 from each frame in a video and resize it to 256 × 256 .
We train the motion generator to predict 16 frames.
For evaluation, we report Inception Score (IS) (Saito et al., 2020) on 10 , 000 generated videos and Fr ´e chet Video Distance (FVD)
(Unterthiner et al., 2018) on 2 ,videos.
The classiﬁer used to calculate IS is a C3D network (Tran et al., 2015) that is trained on the Sports-
M dataset (Karpathy et al., 2014) and ﬁne-tuned on UCF-101, which is the same model used in previous works (Saito et al., 2020; Clark et al., 2019).
The quantitative results are shown in Tab. 1.
Our method achieves state-of-the-art results for both
IS and FVD, and outperforms existing works by a large margin.
Interestingly, this result indicates that a well-trained image generator has learned to represent rich motion patterns, and therefore can be used to synthesize high-quality videos when used with a well-trained motion generator.
FaceForensics is a dataset containing news videos featuring various reporters.
We use all the images from 704 training videos, with a resolution of 256 × 256 , to learn an image generator, and sequences of 16 consecutive frames to train motion generator.
Note that our network can generate even longer continuous sequences, e.g. 64 frames (Fig. 10 in Appx.), though only 16 frames are used for training.
video clips
Additionally, we use the Average Content Distance (ACD) from
MoCoGAN (Tulyakov et al., 2018) to evaluate the identity consistency for these human face videos.
We calculate ACD values over 256 videos.
We also report the two metrics for ground truth (GT) videos.
To get FVD of
GT videos, we randomly sample two groups of real videos and compute the score.
Our method achieves better results than TGANv2 (Saito et al., 2020).
Both methods have low FVD values, and can generate complex motion patterns close to the real data.
However, the much lower ACD value of our approach, which is close to GT, demonstrates that the videos it synthesizes have much better identity consistency than the videos from TGANv2.
Qualitative examples in Fig.
2 illustrate different motions patterns learned from the dataset.
Furthermore, we perform perceptual experiments using Amazon Mechanical Turk (AMT) by presenting a pair of videos from the two methods to users and asking them to select a more realistic one.
Results in Tab.
2 indicate our method outperforms TGANv2 in 73.6% of the comparisons.
Sky Time-Lapse is a video dataset consisting of dynamic sky scenes, such as moving clouds.
The number of video clips for training and testing is 35 , 392 and 2 , 815 , respectively.
We resize images to 128 × 128 and train the model to generate 16 frames.
We compare our methods with the two recent approaches of MDGAN (Xiong et al., 2018) and DTVNet (Zhang et al., 2020), which are speciﬁcally designed for this dataset.
In Tab. 3, we report the FVD for all three methods.
It is clear that our approach signiﬁcantly outperforms the others.
Example sequences are shown in Fig.
Following DTVNet (Zhang et al., 2020), we evaluate the proposed model for the task of video prediction .
We use the Peak Signal-to-Noise Ratio (PSNR) and Structural Similarity (SSIM)
(Wang et al., 2004) as evaluation metrics to measure the frame quality at the pixel level and the structural similarity between synthesized and real video frames.
Evaluation is performed on the testing set.
We select the ﬁrst frame x 1 from each video clip and project it to the latent space of the image generator (Abdal et al., 2020) to get ˆ z 1 .
We use ˆ z 1 as the starting latent code for motion generator to get 16 latent codes, and interpolate them to get 32 latent codes to synthesize a video sequence, where the ﬁrst frame is given by G I (ˆ z 1 ) .
For a fair comparison, we also use G I (ˆ z 1 ) as the starting frame for MDGAN and DTVNet to calculate the metrics with ground truth videos.
In addition, we calculate the PSNR and SSIM between x 1 and G I (ˆ z 1 ) as the upper bound for all methods, which we denote as Up-B .
Tab.
3 shows the video prediction results, which demonstrate that our method’s performance is superior to those of MDGAN and DTVNet.
Interestingly, by simply interpolating the motion trajectory, we can easily generate longer video sequence, e.g. from 16 to 32 frames, while retaining high quality. [Table]
=
[Table]
t =t =t =t = t =t =
t =t = t = t =
t =t = t =t =
t =t =
t = 16 t =t =
t =t = t =t =
t =t =
4. C ROSS -D OMAIN V IDEO G ENERATION
To demonstrate how our approach can disentangle motion from image content and transfer motion patterns from one domain to another, we perform several experiments on various datasets.
More speciﬁcally, we use the StyleGAN2 model, pre-trained on the FFHQ (Karras et al., 2019), AFHQDog (Choi et al., 2020),
AnimeFaces (Branwen, 2019), and LSUN-Church (Yu et al., 2015) datasets, as the image generators.
We learn human facial motion from VoxCeleb (Nagrani et al., 2020) and time-lapse transitions in outdoor scenes from TLVDB (Shih et al., 2013).
In these experiments, a pair such as (FFHQ, VoxCeleb) indicates that we synthesize videos with image content from FFHQ and motion patterns from VoxCeleb.
We generate videos with a resolution of 256 × 256 and 1024 ×for FFHQ, 512 × 512 for AFHQ-Dog and AnimeFaces, and 256 × 256 for LSUN-Church.
Qualitative examples for (FFHQ, VoxCeleb), (LSUN-Church, TLVDB), (AFHQ-Dog, VoxCeleb), and (AnimeFaces, VoxCeleb) are shown in Fig.
4, depicting high-quality and temporally consistent videos (more videos, including results with BigGAN as the image generator, are shown in the Appendix).
We also demonstrate how the motion and content are disentangled in Fig.
5 and Fig.
6, which portray generated videos with the same identity but performing diverse motion patterns, and the same motion applied to different identities, respectively.
We show results from (AFHQ-Dog, VoxCeleb)
(ﬁrst two rows) and (AnimeFaces, VoxCeleb) (last two rows) in these two ﬁgures.
[Figure] [Figure]
4. A BLATION A NALYSIS
We ﬁrst report IS and FVD in Tab. 4 for UCF-101 using the following methods: w/o Eqn.
2 uses z t = h t instead of estimating the residual as in Eqn. 2; w/o D I omits the contrastive image discriminator
D I and uses the video discriminator D V only for learning the motion generator; w/o D V omits
D V during training; and Full-128 and Full-256 indicate that we generate videos using our full method with resolutions of 128 × 128 and 256 × 256 , respectively.
We resize frames for all methods to 128 × 128 when calculating IS and FVD.
The full method outperforms all others, proving the importance of each module for learning temporally consistent and high-quality videos.
We perform further analysis of our cross-domain video generation on (FFHQ, VoxCeleb).
We compare our full method ( Full ) with two variants.
w/o L contr denotes that we omit the contrastive loss (Eqn. 6) from D I , and w/o L m indicates that we omit the mutual information loss (Eqn. 3) for the motion generator.
The results in Tab. 5 demonstrate that L contr is beneﬁcial for learning videos with coherent content, as employing L contr results in lower ACD values and higher human preferences.
L m also contributes to generating higher quality videos by mitigating motion synchronization.
To validate the motion diversity, we show pairs of 9 randomly generated videos from the two methods to users and ask them to choose which one has superior motion diversity, including rotations and facial expressions.
User preference suggests that using L m increases motion diversity.
[Table] [Table]
C ONCLUSION
In this work we present a novel approach to video synthesis.
Building on contemporary advances in image synthesis, we show that a good image generator and our framework are essential ingredients to boost video synthesis ﬁdelity and resolution.
The key is to ﬁnd a meaningful trajectory in the image generator’s latent space.
This is achieved using the proposed motion generator, which produces a sequence of motion residuals, with the contrastive image discriminator and video discriminator.
This disentangled representation further extends applications of video synthesis to content and motion manipulation and cross-domain video synthesis.
The framework achieves superior results on a variety of benchmarks and reaches resolutions unattainable by prior state-of-the-art techniques
A A DDITIONAL D ETAILS FOR THE F RAMEWORK A. A DDITIONAL D ETAILS FOR THE M OTION G ENERATOR
To use StyleGAN2 (Karras et al., 2020b) as the image generator, we randomly sample 1 , 000 ,latent codes from the input space Z and send them to the 8-layer MLPs to get the latent codes in the space of W .
Each latent code is a 512 -dimension vector.
We perform PCA on these 1 , 000 ,latent codes and select the top 384 principal components to form the matrix V ∈ R 384 × 512 , which is used to model the motion residuals in Eqn. 2.
The LSTM encoder and the LSTM decoder in the motion generator both have an input size of 512 and a hidden size of 384 .
The noise vector (cid:15) t in
Eqn. 1 is also a 512 -dimension vector, and the network H in Eqn.
3 is a 2-layer MLPs withhidden units in each of the two fully-connected layers.
For BigGAN (Brock et al., 2019), we sample the latent code directly from the space of Z .
A. A DDITIONAL D ETAILS FOR THE D ISCRIMINATORS A.2. V IDEO D ISCRIMINATOR
The input images for the video discriminator D V are processed at two scales.
We downsample the output images from the image generator to the resolution of 128 × 128 and 64 × 64 .
The input sequences for D V have the shape of 6 × ( n − 1) × 128 × 128 and 6 × ( n − 1) × 64 × 64 , where n is the sequence length used for training.
For each of the ( n − 1) subsequent frames, we concatenate the RGB channels of both the ﬁrst frame and that subsequent frame, resulting in a 6 -channel input.
Details for D V are shown in Tab. 6.
[Table]
I MAGE D ISCRIMINATOR
The image discriminator D
I has an architecture based on that of the BigGAN discriminator, except that we remove the self-attention layer.
The feature extractor F used for contrastive learning has the same architecture as D I , except that it does not include the last layer of D I but has two additional fully connected (FC) layers as the projection head.
The number of hidden units for these two FC layers are both 256 .
Here we describe in more detail the image augmentation and memory bank techniques used for conducting contrastive learning.
Image Augmentation.
We perform data augmentation on images to create positive and negative pairs.
We normalize the images to [ − 1 , 1] and apply the following augmentation techniques.
• Afﬁne.
We augment each image with an afﬁne transformation deﬁned with three random parameters: rotation α r ∈ U ( − 180 , 180) , translation α t ∈ U ( − 0 .
1 , 0 . 1) , and scale α s ∈ U (0 .
• Brightness.
We add a random value α b ∼ U ( − 0 .
5 , 0 . 5) to all channels of each image.
• Color.
We add a random value α c ∼ U ( − 0 .
5 , 0 . 5) to one randomly-selected channel of each image.
• Cutout (DeVries & Taylor, 2017) .
We mask out pixels in a random subregion of each image to 0 .
Each subregion starts at a random point and with size ( α m H, α m W ) , where α m ∼ U (0 , 0 . 25) and ( H, W ) is the image resolution.
• Flipping
We
horizontally ﬂip the image with the probability of 0 .
Memory Bank.
It has been shown that contrastive learning beneﬁts from large batch-sizes and negative pairs (Chen et al., 2020b).
To increase the number of negative pairs, we incorporate the memory mechanism from MoCo (He et al., 2020), which designates a memory bank to store negative examples.
More speciﬁcally, we keep an exponential moving average of the image discriminator, and its output of fake video frames are buffered as negative examples.
We use a memory bank with a dictionary size of 4 , 096 .
B M ORE D ETAILS FOR E XPERIMENTS
Image Generators.
We train the unconditional StyleGAN2 models from scratch on the UCF-101,
FaceForensics, Sky Time-lapse, and AFHQ-Dog datasets.
We train the image generators with the ofﬁcial Tensorﬂow code 2 and select the checkpoints that obtain the best Fr ´e chet inception distance (FID) (Heusel et al., 2017) score to be used as the image generators.
The FID score of each image generator is shown in Table 7.
For FFHQ, AnimeFaces, and LSUN-Church, we simply use the released pre-trained models.
We also train an unconditional BigGAN model on the FFHQ dataset using the public PyTorch code 3 .
We train a model with resolution 128 × 128 and select the last checkpoint as the image generator.
[Table]
Training Time.
We train each image generator for UCF-101, FaceForensics, Sky Time-lapse, and
AFHQ-Dog in less than 2 days using 8 Tesla V100 GPUs.
For FFHQ, AnimeFaces, and LSUNChurch, we use the released models with no training cost.
The training time for video generators ranges from 1 .
5 ∼ 3 days depending on the datasets.
The total training time for all the datasets is 1 .
5 ∼ 5 days and the estimated cost for training on Google Cloud is $0.7K ∼ $2.3K.
Implementation Details.
We implement our experiments with PyTorch 1.3.1 and also tested them with PyTorch 1.6.
We use the Adam optimizer (Kingma & Ba, 2014) with a learning rate of 0 .for
G M , D V , and D I in all experiments.
In Eqn. 2, we set λ = 0 .
5 for conventional video generation tasks and use a smaller λ = 0 .
2 for cross-domain video generation, as it improves the content consistency.
In Eqn. 7, we set λ m = λ contr =
λ f = 1 .
Grid searching on these hyper-parameters could potentially lead to a performance boost.
For TGANv2, we use the released code 4 to train the models on UCF-101 and FaceForensics using 8 Tesla V100 with 16 GB of GPU memory.
Video Prediction.
For video prediction, we predict consecutive frames, given the ﬁrst frame x from a test video clip as the input.
We ﬁnd the inverse latent code ˆ z 1 for x 1 by minimizing the following objective:
[Equation]
where λ vgg is the weight for perceptual loss (Johnson et al., 2016), F vgg is the VGG feature extraction model (Simonyan & Zisserman, 2014).
We set λ vgg = 1 and optimize Eqn. 8 for 20 ,iterations.
We take ˆ z 1 as the input to our model for video prediction.
AMT Experiments.
We present more details on the AMT experiments for different experimental settings and datasets.
For each experiment, we run 5 iterations to get the averaged score.
• FaceForensics, Ours vs TGANv2.
We randomly select 300 videos from each method and ask users to select the better
• Sky Time-lapse, Ours vs DTVNet.
We compare our method with DTVNet on the video prediction task.
The testing set of Sky Time-lapse dataset includes 2 , 815 short video clips.
Considering that many of these video clips share similar content and are sampled fromlong videos, we select 148 short videos with different content for testing.
For these videos, we perform inversion (Eqn.
8) on the ﬁrst frame to get the latent code and generate videos.
For DTVNet, we use the ﬁrst frame directly as input to produce their results.
We ask users to chose the one with better video quality from a pair of videos generated by our method and DTVNet.
The results shown in Tab. 8 demonstrate the clear advantage of our approach.
[Table]
• FFHQ, Full vs w/o L contr .
We randomly sample 200 videos generated by each method and ask users to select the more realistic one from a pair of videos.
• FFHQ, Full vs w/o L m .
For each method, we use the same content code z 1 to generatevideos with different motion trajectories, and organize them into a 3 × 3 grid.
To conduct AMT experiments, we randomly generate 50 3 × 3 videos for each method and ask users to choose the one with higher motion diversity from a pair of videos.
Cross-Domain Video Generation.
We provide more details on the image and video datasets.
• Image Datasets: – FFHQ (Karras et al., 2019) consists of 70 , 000 high-quality face images at 1024 ×resolution with considerable variation in terms of age, ethnicity, and background.
– AFHQ-Dog (Choi et al., 2020) contains 5 , 239 high-quality dog images at 512 ×resolution with both training and testing sets.
– AnimeFaces (Branwen, 2019) includes 2 , 232 , 462 anime face images at 512 ×resolution.
– LSUN-Church (Yu et al., 2015) includes 126 , 227 in-the-wild church images at 256 × 256 resolution.
• Video Datasets: – VoxCeleb (Nagrani et al., 2020) consists of 22 , 496 short clips of human speech, extracted from interview videos uploaded to YouTube. –
TLVDB (Shih et al., 2013) includes 463 time-lapse videos, covering a wide range of landscapes and cityscapes.
For the video datasets, we randomly select 32 consecutive frames from training videos and select every other frame to form a 16-frame sequence for training.
C M ORE V IDEO R ESULTS
In this section, we provide more qualitative video results generated by our approach.
We show the thumbnail from each video in the ﬁgures.
Full resolution videos are in the supplementary material.
We also provide an HTML page to visualize these videos.
UCF-101.
In Fig.
7, we show videos generated by our approach on the UCF-101 dataset.
FaceForensics.
In Fig.
8, we show the generated videos for FaceForensics.
In Fig.
9 and Fig.
10, we show that our approach can generate long consecutive results, 32 and 64 frames respectively, even when trained with 16 -frame clips.
In Fig.
11, we demonstrate that our approach can generate diverse motion patterns using the same content code.
In Fig.
12, we apply the same motion codes with different content to get the synthesized videos.
Sky Time-lapse.
Fig.
13 shows the generated videos for the Sky Time-lapse dataset.
(FFHQ, VoxCeleb).
Fig.
14, Fig. 15, and Fig.
16 present the generated videos that have motion patterns from VoxCeleb and content from FFHQ, with resolutions of 128 × 128 , 256 × 256 , and 1024 × 1024 , respectively.
We use BigGAN as the generator for Fig.
14 and StyleGAN2 for Fig.and Fig.
(AFHQ-Dog, VoxCeleb).
Fig.
17 presents the generated videos that have motion patterns from
VoxCeleb and content from AFHQ-Dog.
The videos have a resolution of 512 × 512 .
In Fig.
18, we show the interpolation between every two frames to get longer sequences.
(AnimeFaces, VoxCeleb).
Fig.
19 shows the generated videos that have motion patterns from VoxCeleb and content from AmimeFaces.
The videos have a resolution of 512 × 512 .
(LSUN-Church, TLVDB).
Fig.
20 presents the generated videos that have time-lapse changing style from TLVDB and content from LSUN-Church.
D M ORE A BLATION A NALYSIS F OR M UTUAL I NFORMATION L OSS L m
In addition to Tab. 5, we perform another ablation experiment to show how mutual information loss L m improves motion diversity by considering the following setting.
We random sample a content code z 1 ∈ Z and use it as an input to synthesize 100 videos, where each video contains 16 frames.
We average the generated 100 videos (they share the same ﬁrst frame) to get one meanvideo , which contains 16 frames.
For example, for the last frame in the mean-video, it is obtained by averaging all the last frames from the 100 generated videos.
We also calculate the per-pixel standard deviation (std) for each averaged frame in the mean-video.
More blurry frames and higher per-pixel std indicate the 100 synthetic videos contain more diverse motion.
We evaluate the settings of Full and w/o L m (without using the mutual information loss) by running the above experiments for 50 times, e.g. , sampling z 1 for 50 times.
Across the 50 trials, for Full model, the mean and std of the per-pixel std for the 16 th frame (the last frame in a generated video) is 0 .
233 ± 0 .
036 , which is signiﬁcantly higher than that of the w/o L m model ( 0 . 126 ± 0 .
In
Fig.
21, we show 8 examples of the last frame from the mean-video and the images with per-pixel std (See supplementary material for the whole videos).
Our Full model has more diverse motion as the averaged frame is more blurry and the per-pixel std is higher.
Note that StyleGAN2 enables noise inputs for extra randomness, we disable it in this ablation study.
E L IMITATIONS
Our framework requires a well-trained image generator for frame synthesis.
In order to synthesize high-quality and temporally coherent videos, an ideal image generator should satisfy two requirements: R1.
The image generator should synthesize high-quality images, otherwise the video discriminator can easily tell the generated videos as the image quality is different from the real videos.
R2.
The image generator should be able to generate diverse image contents to include enough motion modes for sequence modeling.
Example of R1.
UCF-101 is a challenging dataset even for the training of an image generator.
In
Tab. 7, the StyleGAN2 model trained on UCF-101 has FID 45 . 63 , which is much worse than the others.
We hypothesis the reason is that the UCF-101 dataset is not diverse enough: each category includes relatively a small amount of videos and these videos share very similar content.
Such observation is also discussed in DVDGAN (Clark et al., 2019).
Although we can achieve state-ofthe-art performance on UCF-101 dataset, the quality of the generated videos is not as good as other datasets (Fig. 7), and the quality of synthesized videos is still not close to real videos.
Example of R2.
We test our method on BAIR Robot Pushing Dataset (Ebert et al., 2017).
We train a 64 × 64 StyleGAN2 image generator with using the frames from BAIR videos.
The image generator has FID as 6 . 12 .
Based on the image generator, we train a video generation model that can synthesize 16 frames.
An example of synthesized video is shown in Fig.
22 (more videos are in the supplementary materials).
We can see our method can successfully model shadow changing, the robot arm moving, but it struggles to decouple the robot arm from some small objects in the background, which we show analysis follows.
E. A NALYSIS OF THE INFORMATION CONTAINED IN PCA COMPONENTS .
Inspired by previous work (H¨ark¨onen et al., 2020), we further investigate the latent space of the image generator by considering the information contained in each PCA component.
Fig.
23 shows the percentage of total variance captured by top PCA components.
The image generator on BAIR compresses most of the information on a few components.
Specially, the top 20 PCA components captures 85% of the variance.
In contrast, the latent space of the image generator trained on FFHQ (and FFHQ 1024 for high-resolution image synthesis) uses 100 PCA components to capture 85% information.
This implies the BAIR generator models the dataset in a low-dimension space, and such generator increases the difﬁculty for fully disentangling all the objects in images for manipulation.
Moreover, we visualize the video synthesis results by moving along the top 20 PCA components.
Let V i denote the i th PCA component.
Given content code z 1 , we synthesize a 5 -frame video clip by using the following sequence as input: { z 1 − 2 V i , z 1 − V i , z 1 , z
1 + V i , z 1 + 2 V i } .
In Fig.
24, we show the video synthesis results by moving along the top 20 PCA directions.
It can be seen that:
1) changing the later components (the 8 th and later rows) of BAIR only
make small
changes; 2) the ﬁrst 7 components of BAIR have entangled semantic meaning, while the components in FFHQ have more disentangled meaning ( 2 nd row, rotation; 20 th row, smile).
This indicates the image generator of BAIR may not cover enough (disentangled) motion modes, and it might be hard for the motion generator to fully disentangle all the contents and motion with only a few dominating PCA components, while for the image generator trained on FFHQ, it is much easier for disentangling foreground and background
F F UTURE W ORK
In future work, instead of ﬁxing image generator during the training of motion generator, we plan to improve the training of image generator by incorporating video-related supervisions.
For example, frames within same video clip should have similar content and different motion, and such supervision should improve the semantic behavior of the latent space of StyleGAN2/BigGAN.