{'fraction_non_alphanumeric': 0.03398879198859303, 'fraction_numerical': 0.023510296116987763, 'mean_word_length': 4.726927459172047, 'pattern_counts': {'":': 0, '<': 0, '<?xml version=': 0, '>': 0, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
Efficient Video Generation on Complex Datasets

Generative models of natural images have progressed towards high fidelity samples by the strong leveraging of scale. We attempt to carry this success to the field of video modeling by showing that large Generative Adversarial Networks trained on the complex Kinetics-600 dataset are able to produce video samples of substantially higher complexity than previous work. Our proposed network, Dual Video Discriminator GAN (DVD-GAN), scales to longer and higher resolution videos by leveraging a computationally efficient decomposition of its discriminator. We evaluate on the related tasks of video synthesis and video prediction, and achieve new state of the art Frechet Inception Distance on prediction for Kinetics-600, as well as state of the art Inception Score for synthesis on the UCF-101 dataset, alongside establishing a number of strong baselines on Kinetics-600.

Modern deep generative models can produce realistic natural images [10,25,28,34,39] when trained on high-resolution and diverse datasets. Generation of natural video is an obvious further challenge for generative modeling, but one that is plagued by increased data complexity and computational requirements. For this reason, much prior work on video generation has revolved around relatively simple datasets, or tasks where strong temporal conditioning information is available. Figure 2: Generated video samples with interesting behavior. In raster-scan order: a) A generated camera change. b) Zooming in on an object. c) A well structured moving object. d) Fine detail from a pen being left on paper. The first sample is 128 × 128, all others are 64 × 64.
We focus on the tasks of video synthesis and video prediction (defined in Section 2.1), and aim to extend the strong results of generative image models to the video domain. We build upon the state-of-the-art BigGAN architecture [10], introducing a number of video-specific modifications including efficient separable attention and a spatio-temporal decomposition of the discriminator. This allows us to train on Kinetics-600 -a complex dataset of natural videos an order of magnitude larger than the commonly used datasets. The resulting model, Dual Video Discriminator GAN (DVD-GAN), is able to generate temporally coherent, high-resolution videos of notable fidelity ( Figure 1).
Our contributions are as follows: • We propose DVD-GAN -a scalable generative model of natural video which produces high-quality samples at resolutions up to 256 × 256 and lengths up to 48 frames.
• We achieve state of the art for video synthesis on UCF-101 and prediction on Kinetics-600.
• We establish class-conditional video synthesis on Kinetics-600 as a new benchmark for generative video modeling, and report DVD-GAN results as a strong baseline.

Video Synthesis and Prediction
Generative video modeling is a widely explored problem which has included work on VAEs [5,16,30,22], auto-regressive models [38,48,24,62], normalizing flows [29], and GANs [33,59,42,41]. Exact formulations of the task differ in the type of the conditioning signal provided. At one extreme lies unconditional video synthesis where the task is to generate any video following the training distribution. Another extreme is occupied by strongly-conditioned models, including generation conditioned on another video for content transfer [7,68], per-frame segmentation masks [61], or pose information [60,58,66]. In the middle ground there are tasks which are more structured than unconditional generation, and yet are more challenging from a modeling perspective than stronglyconditional generation (which gets a lot of information about the generated video through its input). The objective of class-conditional video synthesis is to generate a video of a given category (e.g., "riding a bike") while future video prediction is concerned with generation of continuing video given initial frames. These problems differ in several aspects, but share a common requirement of needing to generate realistic temporal dynamics, and in this work we restrict ourselves to these two problems.

Generative Adversarial Networks
Generative Adversarial Networks (GANs) [19] are a class of generative models defined by a minimax game between a Discriminator D and a Generator G. The original objective was proposed by [19], and many improvements have since been suggested, mostly targeting improved training stability [4,67,10,20,36]. We use the hinge formulation of the objective [32,10] which is optimized by gradient descent (ρ is the elementwise ReLU function): GANs have well-known limitations including a tendency towards limited diversity in generated samples (a phenomenon known as mode collapse) and the difficulty of quantitative evaluation due to the lack of an explicit likelihood measure over the data. Despite these downsides, GANs have produced some of the highest fidelity samples across many visual domains [25,10].

Multiple GAN Discriminators for Video
High-quality videos typically contain coherent objects that progress consistently in time. An active area of prior work considers decompositions which model the texture and spatial consistency of objects separately from their temporal dynamics. One approach is to split G into foreground and background models [59,47], while another considers explicit or implicit optical flow in either G or D [42,37]. A third approach is to decompose D into sub-networks that judge image quality separately from motion. For instance, MoCoGAN [54] contains a separate discriminator for individual frames in addition to the discriminator operating on slices of the whole video; other models discriminate groups of frames [65,49] or sub-batches at different resolutions [41]. A benefit of some of these approaches is that D no longer processes the entire batch of videos at full resolution.

Kinetics-600
Kinetics is a large dataset of 10-second high-resolution YouTube clips [26,2] originally created for the task of human action recognition. We use the second iteration of the dataset, Kinetics-600 [13], which consists of 600 classes with at least 600 videos per class for a total of around 500,000 videos. 1 Kinetics videos are diverse and unconstrained, which allows us to train large models without being concerned with the overfitting that occurs on small datasets with fixed objects interacting in specified ways [18,9]. Among prior work, the closest dataset (in terms of subject and complexity) which is consistently used is UCF-101 [46]. We focus on Kinetics-600 because of its larger size (almost 50x more videos than UCF-101) and its increased diversity (600 instead of 101 classes -not to mention increased intra-class diversity). Nevertheless for comparison with prior art we train on UCF-101 and set a new state-of-the-art Inception Score there. Kinetics contains many artifacts expected from YouTube, including cuts (as in Figure 2a), title screens and visual effects. Except when specifically described, we choose frames with stride 2 (meaning we skip every other frame). This allows us to generate videos with higher complexity without incurring extra computational cost.

Evaluation Metrics
Designing metrics for measuring the quality of generative models (GANs in particular) is an active area of research [43,8]. In this work we report the two most commonly used metrics, Inception Score (IS) [44] and Fréchet Inception Distance (FID) [21]. The standard instantiation of these metrics is intended for generative image models, and uses an Inception model [51] for image classification or feature extraction. For videos, we use the publicly available Inflated 3D Convnet (I3D) network trained on Kinetics-600 [12]. Our Fréchet Inception Distance is therefore very similar to the Fréchet Video Distance (FVD) [56], although our implementation is different and more aligned with the original FID metric. 2

Dual Video Discriminator GAN
Our primary contribution is Dual Video Discriminator GAN (DVD-GAN) which is able to generate high-resolution and temporally consistent videos. It extends a large image generation model (Big-GAN [10]) to video while introducing several techniques to accelerate training. An overview of the DVD-GAN architecture is given in Figure 3 and a detailed description is in Appendix A.2. Unlike some of the prior work, our generator contains no explicit priors for foreground, background or motion (optical flow); instead, we rely on a high-capacity neural network to learn this in a data-driven manner. DVD-GAN contains both self-attention and an RNN but is not autoregressive in time or in space. While the RNN produces features for each frame sequentially, afterwards all frames are produced by the ResNet in parallel, generating all pixels in each frame jointly. In other words, the  pixels of each frame do not directly depend on other pixels in the video, as would be the case for auto-regressive models.

Dual Discriminators
Given a video with length T , height H, and width W , DVD-GAN employs two discriminators for its assessment: a Spatial Discriminator D S and a Temporal Discriminator D T . D S critiques single frame content and structure by randomly sampling k full-resolution frames and processing them individually. We use k = 8 and show in Section 4.3 this choice improves performance. D S 's final score is the sum of the per-frame scores, similar to TGANv2 [41].
The temporal discriminator D T must provide G with the learning signal to generate movement (something not critiqued by D S ). To make the model scalable, we would like to achieve this without processing the entire video at full resolution. Rather than subsampling the batch [41] or selecting only a subset of frames [41,54], we apply a spatial downsampling function φ(·) to the whole video and feed its output to D T . We choose φ to be a 2 × 2 average pooling function, but discuss alternatives in Section 4.3. This results in an architecture where the discriminators do not process the entire high-resolution video (since D S processes only k × H × W pixels and D T only T × H 2 × W 2 ), and yet together they ensure that G learns to generate high-resolution and temporally consistent videos. D S is similar to the per-frame discriminator D I in MoCoGAN [54]. However MoCoGAN's analog of D T looks at full resolution videos, whereas D S is the only source of learning signal for highresolution details in DVD-GAN. For this reason, D S is essential when φ is not the identity, unlike in MoCoGAN where the per-frame discriminator is less crucial.

Separable Self-Attention
The Transformer module of self-attention [57] is a popular architectural building block whose global receptive field allows for propagation of information across the entire feature map. However, directly applying it to large video features is prohibitive since self-attention requires the computation and storage of the attention weight matrix of size (HW T ) 2 . To circumvent this limitation, we introduce an efficient self-attention variant that we term Separable Attention. Instead of attending to all locations of our features simultaneously, we apply three attention layers in a row, each subsequently attending over the height, width and time axis. This reduces the size of the largest tensor we need to store in memory from being proportional to (HW T ) 2 to max H 2 W T, HW 2 T, HW T 2 . This can be seen as a special case of Factorized Attention concurrently introduced in [14].

Experiments and Analysis
Our training setup is directly modeled on that of BigGAN [10]: a detailed description can be found in Appendix A.3. Each DVD-GAN was trained on slices of TPUv3 pods [1] using between 32 and 512 replicas with an Adam [27] optimizer for up to 300,000 update steps (though commonly we evaluate models at the final checkpoint before collapse -often between 100k and 250k steps). We rely on the TF-Replicator [11] framework for data parallel training. Models took between 12 and 96 hours to train.

Class-Conditional Video Synthesis
Our primary results concern the problem of Class-Conditional Video Synthesis. We provide our results for the UCF-101 and Kinetics-600 datasets. With Kinetics-600 emerging as a new benchmark for generative video modelling, our results establish a strong baseline for future work.    [42] 11.85 ± .07 MoCoGAN [54] 12.42 ± .03 ProgressiveVGAN [3] 14.56 ± .05 TGANv2 [41] 24.34 ± .35 DVD-GAN (ours) 32.97 ± 1.7 high quality textures, object composition and movement. At higher resolutions, generating coherent objects becomes more difficult (movement consists of a much larger number of pixels), but high-level details of the generated scenes are still extremely coherent, and textures (even complicated ones like the side of an ice rink in Figure 1a) are generated well. It is further worth noting that the 48-frame models do not see more high resolution frames than the 12-frame model (due to the fixed choice of k = 8 described in Section 3.1), yet nevertheless learn to generate high resolution images across all 48 frames.

Video Synthesis on UCF-101
We further verify our results by testing the same model on UCF-101 [46], a smaller dataset of 13,320 videos of human actions across 101 classes that has previously been used for video synthesis and prediction [42,41,54]. Our model produces samples with an IS of 32.97, significantly outperforming the state of the art (see Table 2 for quantitative comparison and Appendix B.2 for more details).

Future Video Prediction
Future Video Prediction is the problem of generating a sequence of frames which directly follow from one (or a number) of initial conditioning frames. Both this and video synthesis require G to learn to produce realistic scenes and temporal dynamics, however video prediction further requires G to analyze a video and discover elements in the scene which will evolve over time. In this section, we use the Fréchet Video Distance exactly as [56] using the logits of an I3D network trained on Kinetics-400 as features. This allows for direct comparison to prior work. Our model, DVD-GAN-FP (Frame Prediction), is slightly modified to facilitate the changed problem, and details of these changes are given in Appendix A.4.

Frame-Conditional Kinetics
For direct comparison with concurrent work on autoregressive video models [62] we consider the generation of 11 frames of Kinetics-600 at 64 × 64 resolution conditioned on 5 frames, where the videos for training are not taken with any frame skipping. We show results for all these cases in Table 3. Our frame-conditional model DVD-GAN-FP outperforms the (limited) prior work on frame-conditional prediction for Kinetics. The final row labeled DVD-GAN is the FVD of 16-frame  Video Synthesis samples (no conditioning frames) without any frame skipping, which is notably better. This means that the synthesis model is able to generate higher quality videos from scratch than a model which must infer plausible video continuations.

BAIR Robot Pushing
We further evaluate DVD-GAN-FP on the BAIR Robot Pushing [18] dataset, a dataset of stationary videos of a robot arm manipulating a range of small objects. Here our model gets competitive FVD with prior work, but does not achieve state of the art performance. More details are given in Appendix B.1.

Dual Discriminator Input
We analyze several choices for k (the number of frames per sample in the input to D S ) and φ (the downsampling function for D T ). We expect setting φ to the identity or k = T to result in the best model, but we are interested in the maximally compressive k and φ that reduce discriminator input size (and the amount of computation), while still producing a high quality generator. For φ, we consider: 2 × 2 and 4 × 4 average pooling, the identity (no downsampling), as well as a φ which takes a random half-sized crop of the input video (as in [41]). Results can be seen in Figure 7. For each ablation, we train three identical DVD-GANs with different random initializations on 12-frame clips of Kinetics-600 at 64 × 64 resolution for 100,000 steps. We report mean and standard deviation (via the error bars) across each group for the whole training period. For k, we consider 1, 2, 8 and 10 frames.

Truncation Curves and Interpolations
We expect G to produce samples of higher quality from latents near the center or mean of the distribution (zero). This is the idea behind the Truncation Trick [10]. Like BigGAN, we find that DVD-GAN is amenable to truncation. We also experiment with interpolations in the latent space ( Figure 8) and in the class embedding ( Figure 9) (see also Appendix D.2). In both cases, interpolations are evidence that G has learned a relatively smooth mapping from the latent space to real videos: this would be impossible for a network that has only memorized the training data, or which is only capable of generating a few exemplars per class. Note that while all latent vectors along an interpolation are valid (and therefore G should produce a reasonable sample), at no point during training is G asked to generate a sample halfway between two classes. Nevertheless G is able to interpolate between even very distinct classes.

Conclusion
We approached the challenging problem of modeling natural video by introducing a GAN capable of capturing the complexity of a large video dataset. We showed that on UCF-101 and frame-conditional Kinetics-600 it quantitatively achieves the new state of the art, alongside qualitatively producing sample videos with high complexity and diversity. We further wish to emphasize the benefit of training generative models on large and complex video datasets, such as Kinetics-600. We envisage the strong baselines we established on this dataset with DVD-GAN will be used as a reference point by the generative modeling community moving forward. While much remains to be done before realistic videos can be consistently generated in an unconstrained setting, we believe DVD-GAN is a step in that direction. Figure 9: Frames from two videos generated from the same z under two distinct classes (top two rows) and the interpolation between them at a single selected frame (bottom row).

A.1 Dataset Processing
For all datasets we randomly shuffle the training set for each model replica independently. Experiments on the BAIR Robot Pushing dataset are conducted in the native resolution of 64 × 64, where for UCF-101 we operate at a (downsampled) 128 × 128 resolution. This is done by a bilinear resize such that the video's smallest dimension is mapped to 128 pixels (maintaining aspect ratio). From this we take a random 128-pixel crop along the other dimension. We use the same procedure to construct datasets of different resolutions for Kinetics-600. All three datasets contain videos with more frames that we generate, so we take a random sequence of consecutive frames from the resized output.

A.2 Architecture Description
Our model adopts many architectural choices from BigGAN [10] including our nomenclature for describing network width, which is determined by the product of a channel multiplier ch with a constant for each layer in the network. The layer-wise constants for G are [8,8,8,4,2] for 64 × 64 videos and [16,16,8,4,2,1] for 128 × 128 (identical to BigGAN). The width of the i-th layer is given by the product of ch and the i-th constant and all layers prior to the residual network in G use the initial layer's multiplier and we refer to the product of that and ch as ch 0 . ch for D is always 128, where for G it is 128 in smaller models and 64 for models at greater than 64 × 64 resolution, or which generate 48 frames. The corresponding ch lists for both D T and D S are [2,4,8,16,16] for 64 × 64 resolution and [1,2,4,8,16,16] for 128 × 128.
The input to G consists of a Gaussian latent noise z ∼ N (0, I) and a learnt embedding e(y) of the desired class y. Both inputs are 120-dimensional vectors. G first computes an affine transformation of [z; e(y)] to a [4, 4, ch 0 ]-shaped tensor, which is treated as the input to a recurrent neural network for each of T timesteps. In the majority of our experiments we use a Multiplicative Convolutional Gated Recurrent Unit [6,64,50] in G, whose update rule for input x t and previous output h t−1 is given by the following: In these equations σ and ρ are the elementwise sigmoid and ReLU functions respectively, the n operator represents a convolution with a kernel of size n × n, and the operator is an elementwise multiplication. Brackets are used to represent a feature concatenation. We found that the choice of the recurrent network architecture has a non-negligible effect on the sample quality. For the majority of our experiments we generate less than 48 frames, and in that setting the Multiplicative Convolutional Gated Recurrent Unit performs best. However, for videos with 48 frames the standard ConvGRU (where g = h t−1 ) performs better. We believe that further architectural improvements in G's RNN should enable high-quality video modeling across all lengths with the same architecture, and we leave this to future work.
The result of the RNN are features of shape [T, 4, 4, ch 0 ] which are fed as the input to a noncausal self-attention block [57]. It has a single attention head and is not separable (as described in Section 3.2) since it operates on a small number of features. Finally, each frame is generated from the corresponding temporal slice of the attention's output by a residual network nearly identical to that of BigGAN; though following BigGAN-deep we double the number of overall blocks and pass the entire conditioning vector [z; e(y)] to each block (without a hierarchical split). The residual network is applied to each frame individually (i.e., the time axis is folded into the batch axis before the forward pass), but we do not reduce over the time dimension when calculating Batch Normalization statistics. This prevents the network from utilizing the Batch Normalization layers to pass information between timesteps. The residual network upscales each frame largely independently, with the exception of its self-attention layer which, following BigGAN, is placed before the final residual block. Due to the large size of the tensors, we use the separable self-attention block described in Section 3.2.
The spatial discriminator D S functions almost identically to BigGAN's discriminator. A score is calculated for each of the uniformly sampled k frames (we default to k = 8) and the D S output is the sum over per-frame scores. The temporal discriminator D T has a similar architecture, but pre-processes the real or generated video with a 2 × 2 average-pooling downsampling function φ. Furthermore, the first two residual blocks of D T are 3-D, where every convolution is replaced with a 3-D convolution with a kernel size of 3 × 3 × 3. The rest of the architecture follows BigGAN [10].

A.3 Training Details
Sampling from DVD-GAN is very efficient, as the core of the generator architecture is a feed-forward convolutional network: two 64 × 64 48-frame videos can be sampled in less than 150ms on a single TPU core. The dual discriminator D is updated twice for every update of G [21] and we use Spectral Normalization [67] for all weight layers (approximated by the first singular value) and orthogonal initialization of weights [45]. Sampling is carried out using the exponential moving average of G's weights, which is accumulated with decay γ = 0.9999 starting after 20,000 training steps. The model is optimized using Adam [27] with batch size 512 and a learning rate of 1·10 −4 and 2·10 −4 for G and D respectively. Class conditioning in D [35] is projection-based whereas G relies on class-conditional Batch Normalization [23,15,17]: equivalent to standard Batch Normalization without a learned scale and offset, followed by an elementwise affine transformation where each parameter is a function of the noise vector and class conditioning.

A.4 Architecture Extension to Video Prediction
In order to provide results on future video prediction problems we describe a simple modification to DVD-GAN to facilitate the added conditioning. A diagram of the extended model is in Figure 10.
Given C conditioning frames {f 1 , ..., f C }, our modified DVD-GAN-FP passes each frame separately through a deep residual network identical to D S . The resulting features for each conditioning frame are concatenated in the channel dimension and a 1 × 1 convolution reduces the channel number to 512. The spatial dimensions of the output of this network exactly match the shape of the recurrent state in G's RNN, so we pass the output of this ResNet as the initial state. Both D T and D S operate on the concatenation of the conditioning frames and the output of G, meaning that the discriminators do not receive any extra information detailing that the first C frames are special. To further facilitate the preservation of small details from the conditioning frames we add U-Net [40]

Frame Prediction
A 1x1 Convolution combines features over time.
ResNet U-Net connections link layers processing conditioning frames to G's residual blocks..
Conditioning frames become the first frames in the generated video.  We test future video prediction on the single-class BAIR Robot Pushing Dataset [18], a dataset of stationary videos of a robot arm moving around a set of changing objects. In order for direct comparison with previous results reported in [56] (for the SAVP model [30]) and [62], we consider generating 15 frames conditioned on a single starting frame. Results are reported in Table 4. We find that DVD-GAN-FP is competitive with previous adversarial approaches, but worse than concurrent results from autoregressive models [62].

B.2 UCF-101
UCF-101 [46] is a dataset of 13,320 videos of human actions across 101 classes that has previously been used for video synthesis and prediction [42,41,54]. We report Inception Score (IS) calculated with a C3D network [53] for quantitative comparison with prior work. 3 Our model produces samples with an IS of 32.97, significantly outperforming the state of the art (see Table 2). The DVD-GAN architecture on UCF-101 is identical to the model used for Kinetics, and is trained on 16-frame 128 × 128 clips from UCF-101.
However, it is worth mentioning that our improved score is, at least partially, due to memorization of the training data. In Figure 11 we show interpolation samples from our best UCF-101 model. Like Figure 8, we sample 2 latents (left and rightmost columns) and show samples from the linear Figure 11: The first frames of interpolations between UCF-101 samples. Each row is a separate interpolation. Contrast with Figure 8 and Appendix D.2.
interpolation in latent space along each row. Here we show 4 such interpolations (the first frame from each video). Unlike Figure 8 which smoothly transitions from one sample to the other, we see abrupt jumps in the latent space between highly distinct samples, and little intra-video diversity between samples in each group. It can be further seen that some generated samples highly correlate with samples from the training set.
We show this both as a failure of the Inception Score metric, the commonly reported value for classconditional video synthesis on UCF-101, but also as strong signal that UCF-101 is not a complex or diverse enough dataset to facilitate interesting video generation. Each class is relatively small, and reuse of clips from shared underlying videos means that the intra-class diversity can be restricted to just a handful of videos per class. This suggests the need for larger, more diverse and challenging datasets for generative video modelling, and we believe that Kinetics-600 provides a better benchmark for this task.

C Miscellaneous Experiments
Here we detail a number of modifications or miscellaneous results we experimented with which did not produce a conclusive result.
• We experimented with several variations of normalization which do not require calculating statistics over a batch of data. Group Normalization [63] performed best, almost on a par with (but worse than) Batch Normalization. We further tried Layer Normalization [31], Instance Normalization [55], and no normalization, but found that these significantly underperformed Batch Normalization.
• We found that removing the final Batch Normalization in G, which occurs after the ResNet and before the final convolution, caused a catastrophic failure in learning. Interestingly, just removing the Batch Normalization layers within G's residual blocks still led to good (though slightly worse) generative models. In particular, variants without Batch Normalization in the residual blocks often achieve significantly higher IS (up to 110.05 for 64 × 64 12 frame samples -twice normal). But these models had substantially worse FID scores (1.22 for the aforementioned model) -and produced qualitatively worse video samples.
• Early variants of DVD-GAN contained Batch Normalization which normalized over all frames of all batch elements. This gave G an extra channel to convey information across time.
It took advantage of this, with the result being a model which required batch statistics in order to produce good samples. We found that the version which normalizes over timesteps independently worked just as well and without the dependence on statistics.
• Models based on the residual blocks of BigGAN-deep trained faster (in wall clock time) but slower with regards to metrics, and struggled to reach the accuracy of models based on BigGAN's residual blocks.

D Generated Samples
It is difficult to accurately convey complicated generated video through still frames. Where provided, we recommend readers view the generated videos themselves via the provided links. We refer to videos within these batches by row/column number where the video in the 0th row and column is in the top left corner.      Columns in between represent videos of that same latent generated across an interpolation of the class embedding. Even though at no point has DVD-GAN been trained on data under an interpolated class, it nevertheless produces reasonable samples.