{'fraction_non_alphanumeric': 0.027419988647775402, 'fraction_numerical': 0.020303017071999302, 'mean_word_length': 4.701767488175255, 'pattern_counts': {'":': 0, '<': 0, '<?xml version=': 0, '>': 1, '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}}
Cascaded Video Generation for Videos In-the-Wild

Videos can be created by first outlining a global view of the scene and then adding local details. Inspired by this idea we propose a cascaded model for video generation which follows a coarse to fine approach. First our model generates a low resolution video, establishing the global scene structure, which is then refined by subsequent cascade levels operating at larger resolutions. We train each cascade level sequentially on partial views of the videos, which reduces the computational complexity of our model and makes it scalable to high-resolution videos with many frames. We empirically validate our approach on UCF101 and Kinetics-600, for which our model is competitive with the state-of-the-art. We further demonstrate the scaling capabilities of our model and train a three-level model on the BDD100K dataset which generates 256x256 pixels videos with 48 frames.


I. INTRODUCTION
Humans have the ability to simulate visual objects and their dynamics using their imagination. This ability is linked to the ability to perform temporal planning or counter-factual thinking. Replicating this ability in machines is a longstanding challenge that generative models try to address. Advances in generative modeling and increased computational resources have enabled the generation of realistic high-resolution images [1] or coherent text in documents [2]. Yet, video generation models have been less successful, in part due to their high memory requirements that scale with the generation resolution and length.
When creating visual data, artists often first produce a rough outline of the scene, to which then they add local details in multiple iterations [3]. The outline ensures global scene consistency and divides the creative process into multiple tractable local steps. Inspired by this process we propose CVG, a cascaded video generation model which divides the generative process into a set of simpler problems. CVG first generates a rough video that depicts a scene at a reduced framerate and resolution. This scene outline is then progressively upscaled and temporally interpolated to obtain the desired final video by one or more upscaling levels as depicted in Figure 1. Every cascade level outputs a video that serves as the input to the next one, with each level specializing in a particular aspect of the generation. Levels in our model are trained greedily, i.e. in sequence and not end-to-end. This allows to train only one level at a time and thus reduce the overall training memory requirements. We formulate each level as a adversarial game that we solve leveraging the GAN framework. Our training setup has the same global solution as an end-to-end model.
To further reduce the computational needs of our model, upscaling cascade levels can be applied only on temporal crops Fig. 1: Cascaded Video Generation We propose to divide the generative process into multiple simpler problems. CVG first generates a low resolution video that depicts a full scene at a reduced framerate. This scene outline is then progressively upscaled and temporally interpolated. Levels are trained sequentially and do not backprogagate gradient to previous levels. Additionally, upscaling levels can be trained on temporal crops of previous level outputs (illustrated by the non-shaded images) to reduce their computational requirements. Our model outperforms or matches the state-of-the-art in video generation and enables the generation of longer high resolution videos due to better scaling properties than previous methods. from previous outputs during training. Despite this temporallylocal training, upscaling levels are capable of producing videos with temporal coherence at inference time, as they upscale the output of the first level, which is temporally complete albeit at a reduced resolution. This makes CVG more scalable than previous methods, making it capable of generating high resolution videos with a larger number of frames.
Our contributions can be summarized as follows: • We define a cascade model for video generation which divides the generation process into multiple tractable steps. • We empirically validate our approach on UCF101, Kinetics-600 and BDD100K, large-scale datasets with complex videos in real-world scenarios. CVG matches or outperforms the state-of-art video generation models on these datasets. • We demonstrate that our approach has better scaling properties than comparable non-cascaded approaches and train a three-level model to generate videos with 48 frames at a resolution of 256x256 pixels.

II. CASCADED VIDEO GENERATION
Video scenes can be created by first outlining the global scene and then adding local details. Following this intuition we propose CVG, a cascade model in which each level only treats a lower dimensional view of the data. Video generation models struggle to scale to high frame resolutions and long temporal ranges. The goal of our method is to break down the generation process into smaller steps which require less computational resources when considered independently.
Problem Setting We consider a dataset of videos (x 1 , ..., x n ) where each video x i = (x i;0 , ..., x i;T ) is a sequence of T frames x i;t ∈ R H×W ×3 . Let f s denote a spatial bilinear downsampling operator and f t a temporal subsampling operator. For each video x i , we can obtain lower resolution views of our video by repeated application of f s and f t , i.e.
., x L i ) comes from a joint data distribution p d . The task of video generation consists in learning a generative distribution p g such that p g = p d .
Cascaded Generative Model We define a generative model that approximates the joint data distribution according to the following factorization: Each p gi defines a level in our model. This formulation allows us to decompose the generative process in to a set of smaller problems. The first level p g1 produces low resolution and temporally subsampled videos from a latent variable. For subsampling factors K T and K S (for time and space respectively), the initial level generates videos ×3 . The output of the first level is spatially upscaled and temporally interpolated by one or more subsequent upscaling levels.
Training We train our model greedily one level at a time and in order, i.e. we train the first level to generate global but downscaled videos, and then we train upscaling stages on previous level outputs one after each other. We do not train the levels in an end-to-end fashion, which allows us to break down the computation into tractable steps by only training one level at a time. We formulate a GAN objective for each stage of our model. We consider the distribution p g1 in eq. 1 and solve a min-max game with the following value function: where G 1 and D 1 are the generator/discriminator associated with the first stage and p z1 is a noise distribution. This is the standard GAN objective [4]. For upscaling levels corresponding to p g l , l > 1, we consider the following value function: where G l , D l are the generator and discriminator of the current level and p g l−1 is the generative distribution of the level l − 1.
The min-max game associated with this value function has a global minimum when the two joint distributions are equal, [6]. We also see from eq. 3 that the discriminator for upscaling stages operates on pairs (x l , x l−1 ) videos to determine whether they are real or fake. This ensures that the upscaling stages are grounded on their inputs, i.e that x l "matches" its corresponding x l−1 . Partial View Training Computational requirements for upscaling levels can be high when generating large outputs.
As we increase the length and resolution of a generation, the need to store activation tensors during training increases the amount of GPU memory required. To further reduce the computational requirements, we propose to train the upscaling levels on only temporal crops of their inputs. This strategy reduces training costs since we upscale smaller tensors, at the expense of having less available context to interpolate frames. We define convolutional upscaling levels that learn functions that can be applied in a sliding window manner over their inputs. At inference time, we do not crop the inputs and CVG is applied to all possible input windows, thus generating full-length videos.

III. MODEL PARAMETRIZATION
In this section we describe the parametrization of the different levels of CVG. We keep the discussion at a high level, briefly mentioning the main components of our model. Precise details on the architecture are provided in the appendix.
First Level The first level generator stacks units composed by a ConvGRU layer [7], modeling temporal information, and 2D-ResNet blocks that upsample the spatial resolution. Similar to MoCoGAN [8] and DVD-GAN [9], we use a dual discriminator with both a spatial discriminator that randomly samples k full-resolution frames and discriminates them individually, and a temporal discriminator that processes spatially downsampled but full-length videos.
Upsampling Levels The upsampling levels are composed by a conditional generator and three discriminators (spatial, temporal and matching). The conditional generator produces an upscaled versionx l of a lower resolution videox l−1 .
To discriminate samples from real videos, upscaling stages use a spatial and temporal discriminator, as in the first level. Additionally, we introduce a matching discriminator. The goal of the matching discriminator is to ensure that the output is a valid upsampling of the input, and its necessity arises from the model formulation. Without this discriminator, the upsampling generator could learn to ignore the low resolution input video. The conditional generator is trained jointly with the spatial, temporal and matching discriminators. Conditional Generator The conditional generator takes as input a lower resolution videox l−1 , a noise vector z and optionally a class label y, and generatesx l . Our conditional generator stacks units composed by one 3D-ResNet block and two 2D-ResNet blocks. Spatial upsampling is performed gradually by progressively increasing the resolution of the generator blocks. To condition the generator we add residual connections [10], [11] from the low-resolution video to the output of each generator unit.
Matching Discriminator The matching discriminator uses an architecture like that of the temporal discriminator. It discriminates real or generated input-output pairs. The output is downsampled to the same size as the input, and both tensors are concatenated on the channel dimension. A precise description of all discriminator architectures can be found in the appendix.

IV. RELATED WORK
The modern video generation literature [12], [13] first started as a result of adapting techniques for language modeling to video. Since then, many papers have proposed different approaches to represent and generate videos [14]- [18], including different kinds of tasks, conditionings and models. We review the most common types of generative video models below.
Autoregressive models [19]- [24] model the conditional probability of each pixel value given the previous ones. They do not use latent variables and their training can be easily parallelized. Inference in autoregressive models often requires a full forward pass for each output pixel, which does not scale well to long high resolution videos. Normalizing flows [25]- [27] learn bijective functions that transform latent variables into data samples. Normalizing flows are able to directly maximize the data likelihood. However, they require the latent variable to have the same dimensionality as its output, which becomes an obstacle when generating videos due to their large dimensionality. Variational AutoEncoders (VAEs) [28]- [30] also transform latent variables into data samples. While more scalable, VAEs often produce blurry results when compared to other generative models. Models based on VRNNs [31]- [34] use one latent variable per video frame and often produce better results.
Generative Adversarial Networks (GANs) are also latent variable models and optimize a min-max game between a generator G and a discriminator D trained to tell real and generated data apart [4]. Empirically, GANs usually produce better samples than competing approaches but might suffer from mode collapse. GAN models for video were first proposed in [35]- [37]. In recent work, SAVP [33] proposed to use the VAE-GAN [38] framework for video. TGANv2 [39] improves upon TGAN [40] and proposes a video GAN trained on data windows, similar to our approach. However, unlike TGANv2, our model is composed of multiple stages which are not trained jointly. MoCoGAN [8] first introduced a dual discriminator architecture for video, with DVD-GAN [9] scaling up this approach to high resolution videos in the wild. DVD-GAN outperforms MoCoGAN and TGANv2, and is arguably the current state-of-the-art in adversarial video generation. Our model is also related to work that proposes hierarchical or progressive training approaches for generative models [41]- [44]. Our model is different in that our stages are trained greedily in separate steps without backpropagation from one stage to the other, which reduces its computational requirements.

V. EXPERIMENTS
In this section we empirically validate our proposed approach. First, we show that our approach outperforms or matches the state-of-the-art on Kinetics-600 and UCF101. Then, we analyze the scaling properties of our model in Section V-D. Finally, we ablate the main components of our model in Section V-E.

A. Experimental Setting
Datasets We consider the Kinetics-600 [45], [46]  For the rest of the section we denote video dimensions by their output resolution DxD and number of frames F as F/DxD.

Evaluation metrics Defining evaluation metrics for video
generation is an open research area. We use metrics from the image generation literature adapted to video. On Kinetics, we report three metrics: i) Inception Score (IS) given by an I3D model [49] trained on Kinetics-400, ii) Frechet Inception Distance on logits from the same I3D network, also known as Frechet Video Distance (FVD) [50], and iii) Frechet Inception Distance on the last layer activations of an I3D network trained on Kinetics-600 (FID). On BDD100K we report FVD and FID as described before, but we omit IS scores as they are not applicable since there are no classes. On UCF101 we report IS scores following the standard setup in the literature. Implementation details All CVG models are trained with a batch size of 512 and using up to 4 nVidia DGX-1. Levels for Kinetics-600 are trained for 300k iterations, while levels for BDD100K and UCF101 are trained for 100k iterations, all with early stopping when evaluation metrics stop improving. We use PyTorch and distribute training across multiple machines using data parallelism. We synchronize the batch norm statistics across workers. We employ the Adam [51] optimizer to train all levels with a fixed learning rate of 1 × 10 −4 for G and 5 × 10 −4 for D. We use orthogonal initializations for all weights in our model and spectral norm in the generator and the discriminator. More details can be found in the appendix.
Comparisons are mostly against DVD-GAN, as the current state-of-the-art model for class-conditional video generation and the only approach that can generate realistic samples on Kinetics-600.   Fig. 3: Scaling the computational costs We report the required GPU memory for a two-level CVG. We observe that, given the same batch size, the memory cost scales linearly with the output length. Our model scales better than a comparable non-cascaded model.

B. Kinetics-600
We first evaluate the performance of CVG on the Kinetics-600 dataset with complex natural videos. We train a two-level CVG on Kinetics-600 that generates either 12/128x128 or 48/128x128 videos, to compare to the previous state-of-the-art. The first level of CVG generates 24/32x32 videos with a temporal subsampling of 4 frames.
The second level upsamples the first level output using a factor of 2 for the temporal resolution and a factor 4 for the spatial resolution, producing 48/128x128 videos with a temporal subsampling of 2 frames. Since these generations are large, we employ partial views on first level outputs to train the second level, which takes as input windows of 6/32x32 frames and is trained to generate 12/128x128 video snippets (4x lower dimensional than the final output). As a result, this level has approximately the same training cost than a model generating videos of size 12/128x128. At inference time we run the second level convolutionally over all the 24 first level frames to generate 128x128 videos with 48 frames. We also use the same model to generate 12/128x128 videos by using random 6 frame windows from the first level output (i.e. we use the same training and inference setup). We compare to DVD-GAN for both 12/128x128 and 48/128x128 videos with temporal subsampling 2, as the current state-of-the-art in this dataset. Note that DVD-GAN outperforms by a large margin other approaches on Kinetics-600 such as [23].
We report the scores obtained by our model in Table I. For 12/128x128 videos, our model achieves higher IS and comparable FID to DVD-GAN, validating that both models perform comparably when using a similar amount of computational resources. Additionally, CVG outperforms a 48/128x128 DVD-GAN model in FID score and reaches a similar IS score, despite  24.69 TGANv2 [39] 28.87 DVD-GAN [9] 32.97 CVG (ours) 53.72 only being trained on reduced views of the data. Qualitatively, the generations of both models are similar -they do not degrade noticeable in appearance through time although both have some temporal inconsistencies. For CVG temporal inconsistencies are often due to a poor first level generation. For DVD-GAN we hypothesize that inconsistencies are due to the reduced temporal field of view of its discriminator, which is of less than 10 frames while the model has to generate 48 frames.

C. UCF101
We further evaluate our approach on the smaller UCF101 dataset. We train a two-level CVG to generate 16/128x128 videos, as commonly done in the literature. The first level generates 8/64x64 videos with a temporal subsampling of 2 frames. The second level upscales the output of the first level to 16/128x128 videos, without temporal subsampling to match the literature. Since these are small videos, we do not use temporal windows to train the second upscaling level.
We report the scores obtained by our model in Table II. Our model obtains state-of-the-art results, outperforming previous approaches by a large margin. Qualitatively, CVG generates coherent samples with high fidelity details, with small temporal inconsistencies. Samples for the UCF101 dataset can be found in the appendix.

D. Scaling up CVG on BDD100K
To show that our model scales well with the video dimensionality, we train a three-stage model on the BDD dataset to generate 48/256x256 videos. A training iteration with a single 48/256x256 video for a similarly sized non-cascaded model requires more than 32GB of GPU memory. Such model is therefore not trainable on most current GPUs without techniques like gradient checkpointing which add a significant overhead to the training time. Instead, with our cascaded model we can fit 4 examples per GPU without any engineering tricks.
We train the first level to output 12 frames at 64x64 resolution with a temporal subsampling of 8 frames. The second level upsamples 12 frame windows at 128x128 resolution with temporal subsampling of 4 frames (since we are doubling the framerate of the first level). The third level is trained to upscale 12 frame windows at 256x256 resolution for a final temporal subsampling of 2 frames. Figure 4 shows samples from this model. The videos appear crisp, show multiple settings and do not degrade through time.
To further illustrate the scaling capabilities of our model, we report the memory requirements for a two-level 128x128 CVG as a function of the number of output frames in Figure 3. The first level generates half the output frames at 64x64, while the second level is trained to upscale windows of 6 frames into 12 128x128 frames, regardless of the first level output length. Compared to a non-cascaded 128x128 model, our first level scales better due to the lower resolution and reduced number of frames, and the second level has a fixed memory cost of 10290MB since it is trained on 6 frames windows. Given the same GPU memory budget, our model can generate sequences of up to 140 frames, more than double the frames of a non-cascaded model.

E. Model Ablations
Matching Discriminator Ablation To assess the importance of the matching discriminator, we compare two-level CVG models with and without the matching discriminator (we refer to the latter as No MD). As in Section V-B, we generate 48 frames with a two-level model on Kinetics-600. We train the upscaling level on 3-frame windows of the first level to generate 6 frames. We expect the No MD model to generate   Fig. 5 shows an example of a full length No MD generation in which this effect is observable. In contrast, our model (MD) stays grounded to the input and remains consistent through time. This is reflected in the reported metrics in Table III, where the No MD model has worse scores. This ablation shows the need of a matching discriminator to ground upsampling level outputs to their inputs. Temporal Window Ablation One modelling choice in CVG is the temporal window length used in the upsampling levels.
Shorter inputs provide less context to upsample frames, while longer inputs require more compute. To assess the impact of the window length, we compare two-level models trained on Kinetics-600 128x128: one trained on first level windows of 6 frames (same setup as in Section V-B) and one trained on windows of only 3 frames. The 6-frame level requires approximately 2x GPU memory than the 3-frame level during training, but we expect it to perform better due to the larger context available for upscaling. We compare their performance to generate 48 frames in Table IV. We conclude that the window size defines a trade-off between computational resources and sample quality. We refer the reader to the appendix for an additional ablations and experiments.

VI. CONCLUSIONS
We propose CVG, a cascaded video generator that divides the generative process into simpler steps. Our model is competitive with state-of-the-art approaches in terms of sample quality, while requiring significantly less computational resources due to the cascaded approach. Higher capacity models and larger outputs are key aspects in improving video generation, and CVG is a step in that direction with better scaling properties than previous approaches.