Optimizing Video Prediction via Video Frame Interpolation

Video prediction is an extrapolation task that predicts future frames given past frames, and video frame interpolation is an interpolation task that estimates intermediate frames between two frames. We have witnessed the tremendous advancement of video frame interpolation, but the general video prediction in the wild is still an open question. Inspired by the photo-realistic results of video frame interpolation, we present a new optimization framework for video prediction via video frame interpolation, in which we solve an extrapolation problem based on an interpolation model. Our video prediction framework is based on optimization with a pretrained differentiable video frame interpolation module without the need for a training dataset, and thus there is no domain gap issue between training and test data. Also, our approach does not need any additional information such as semantic or instance maps, which makes our framework applicable to any video. Extensive experiments on the Cityscapes, KITTI, DAVIS, Middlebury, and Vimeo90K datasets show that our video prediction results are robust in general scenarios, and our approach outperforms other video prediction methods that require a large amount of training data or extra semantic information.


Abstract
Video prediction is an extrapolation task that predicts future frames given past frames, and video frame interpolation is an interpolation task that estimates intermediate frames between two frames. We have witnessed the tremendous advancement of video frame interpolation, but the general video prediction in the wild is still an open question. Inspired by the photo-realistic results of video frame interpolation, we present a new optimization framework for video prediction via video frame interpolation, in which we solve an extrapolation problem based on an interpolation model. Our video prediction framework is based on optimization with a pretrained differentiable video frame interpolation module without the need for a training dataset, and thus there is no domain gap issue between training and test data. Also, our approach does not need any additional information such as semantic or instance maps, which makes our framework applicable to any video. Extensive exper-iments on the Cityscapes, KITTI, DAVIS, Middlebury, and Vimeo90K datasets show that our video prediction results are robust in general scenarios, and our approach outperforms other video prediction methods that require a large amount of training data or extra semantic information.

Introduction
Video prediction is an extrapolation task to predict future video frames given some past frames. Video prediction has broad applications including robotics planning, autonomous driving and video manipulations [6,23,39,41]. For instance, predicted videos can help autonomous robots to better plan future actions with future visual information. Video prediction is also a fundamental task for unconditional video synthesis that can be decomposed into image synthesis and future video prediction.
Video prediction is a challenging extrapolation problem.

Video Frame Interpolation G Video Frame Interpolation
Input frame −1 Input frame Optimization target ሚ +1→ ሚ +1→ Predicted frame +1 Figure 2. Overview of our method. We optimize optical flowft+1→t by a video frame interpolation G [11]. Our optimization objective is image-level distance Limg and a consistency constraint between our predicted flowft+1→t and the flow f G t→t+1 generated by G.
Several studies [18,20,22,42] only take RGB frames as input for video prediction and find that the video prediction problem is difficult to solve, because of the inherent high complexity of video prediction and the uncertainty of future states. Thus, recently, a lot of constraints and assumptions about the modeling scene have been employed to simplify the problem. However, these assumptions reduce the generalization ability of these video prediction models. FVS [45] and Lee et al. [15] require semantic maps to decompose the scene. Bei et al. [4] first predict semantic maps and then synthesize future frames. Qi et al. [35] require depth maps to reconstruct 3D point clouds. However, such additional information is often hard to obtain or estimate correctly in general scenarios. These strong assumptions limit these methods to be only applicable to data when these assumptions hold. For example, failing to detect some objects (including unseen objects) will lead to performance degradation. When this extra information is unavailable or of poor quality, these methods suffer from performance degradation and cannot be even applied in diverse videos in the real world.
Moreover, these external methods usually need to train one model for each specific scenario, making them difficult generalize to other scenarios. For example, it is hard to apply a video prediction model trained on a driving scene to a human moving dataset, as the motion difference is huge.
To address these issues, we propose an optimizationbased video prediction method, without the requirement of external training (no external dataset is needed for training), and can produce state-of-the-art results. Our insight is that we can cast the video prediction problem as a video frame interpolation (VFI) based optimization problem. Inspired by the recent success of VFI, we connect these two problems to solve the video prediction problem in a new way. Our method does not require any assumption such as semantic segmentation and can be applied to any video. We evaluate our method on multiple datasets, and our method can outperform the state of the arts. Our contributions can be summarized as follows: • We present the first optimization framework for video prediction. We cast the extrapolation problem of video prediction as an optimization problem with VFI.
• Our framework is highly flexible as it does not require any semantic or instance maps, prior knowledge about the scene, or external training. Our method is applicable to video prediction in any scene at any resolution.
• Our method obtains outstanding performance on various datasets and outperforms state-of-the-art video prediction approaches that require additional information. Our method surpasses external learning methods taking only RGB frames as input by a large margin.

Video Prediction
Early works, taking RGB frames as input, employ several mechanisms to improve video prediction. MCNet [42] decomposes a scene into content and motion components. DVF [20] proposes deep voxel flow to synthesize future frames. However, video prediction in the wild is still quite hard due to its inherent high complexity and uncertainty. Thus, explicit modeling, constraints, and assumptions about the scene are introduced. Qi et al. [35] utilize depth maps to reconstruct 3D point clouds. Gao et al. [7] use semantic maps to enforce layout consistency. FVS [45] needs semantic segmentation and instance segmentation to decompose a scene into background and foreground identities. Bei et al. [4] and Lee et al. [15] also require semantic maps.
Although the performance of video prediction has been gradually improved, the generalization ability of these approaches is arguably reduced. It is hard to apply these methods to data without these extra annotations. Moreover, these methods may suffer from performance degradation when the test data is from a different domain than the train data. For example, it is hard to apply a model trained on robot scenarios to driving scenes because the motion in these two domains is quite different. Thus, we propose an optimization-based video prediction method, which can produce state-of-the-art results without external training (thus no domain gap).

Video Frame Interpolation
Contrary to the challenges of video prediction problems, VFI has gained great success recently, which motivates our model design. VFI aims to interpolate intermediate frames between successive input frames. There are three categories of algorithms: kernel-based [2,3,29,30], phase-based [24,25], and motion-based [2,3,10,13,19,21,27,28,32,33]. These motion-based methods use bi-directional optical flows to warp two consecutive frames forward and backward to obtain an intermediate frame. Our method adopts a motion-based framework. Super SloMo [13] linearly combines bi-directional flows as an initial approximation of the intermediate flows for further refinement. Park et al. [33] conduct asymmetric bilateral motion estimation. Sim et al. [37] first handle the VFI for 4K videos with large motion. RIFE [11] is a real-time interpolation algorithm that estimates the intermediate flows in a coarse-to-fine fashion. Different from the domain gap problem in video prediction, there are much fewer domain constraints in VFI. These methods do not require additional information, such as semantic maps and depth maps, and can produce outstanding interpolation performance even with complex motion. Inspired by the success of VFI, we cast video prediction as an optimization problem based on VFI.

Optimization-based Methods
Since learning-based methods suffer from the domain gap between training data and test data, optimization-based methods on test data are still competitive nowadays. Gatys et al. [8] propose the first optimization-based method for neural style transfer. Shaham et al. [36] optimize a generative model on a single image and can generate high quality and diverse samples from the image. Lei et al. [16,17] optimize a network to improve the temporal consistency. Mildenhall et al. [26] optimize a fully-connected network on a sparse set of input views from a scene for novel view synthesis. These optimization-based methods inspire us to propose a framework that not only tackles the domain gap problem but also provides an on-the-fly control for users during optimization.

Problem Formulation
Let x t be the video frame at time step t. The input to our framework includes two recent RGB frames x t−1 and x t . Our goal is to predict the future frames {x t+1 ,x t+2 , . . .}. We adopt a pretrained video interpolation network [11] denoted as G. We will focus on predicting the next framẽ x t+1 first as we can predict future frames one by one sequentially. During the optimization process, the parameters of G are unchanged. Our primary objective is where E is an objective function that measures image similarity. Here we utilize a VFI network G to constrain the relationship among x t−1 ,x t+1 , and x t . To ease the optimization process, we choose to optimize optical flowf t+1→t between the predicted framex t+1 and the last observed frame x t instead of directly optimizex t+1 . x t+1 is computed using backward warping [12]: ( Then Eq. 1 can be rewritten as Flow initialization. To ease the optimization of Eq. 3, it is a good practice to start with a flowf t+1→t that produces an approximate motion. Therefore, we initialize it utilizing the negative flow of f t→t−1 : We first compute −f t→t−1 as a rough approximation of f t−>t+1 . Then we initializef t+1→t as the inversion of −f t→t−1 . δ represents the operation similar to the flow reversal layer [46] to convert a forward flow to a backward flow (details in the supplement). However, directly optimizing Eq. 3 is still difficult, because the constraint towardsf t+1→t is indirect, and the optimization process is difficult to converge.

Video Frame Interpolation Network
Thus, we propose to utilize the intermediate results of network G. Given x t−1 andx t+1 as input, G generates optical flows of two directions f G t→t−1 , f G t→t+1 , and a mask m G . The superscript G denotes that it is the output of network G. The video interpolation network warps x t−1 and x t+1 towards time step t: where has a closer relation withx t+1 and can dismiss the effect of m G . We employ a L 1 distance between I G t+1 and x t : We also argue that there is a forward-backward consistency relationship between f G t→t+1 andf t+1→t . This constraint means that after the forward and backward propagation, the pixels should go back to the original locations: where ∆f t+1→t (p) is the discrepancy obtained from forward and backward flow check at pixel location p: Our overall objective function is L total = ω 1 L img + ω 2 L cons , where ω 1 and ω 2 are the loss weights.

Flow Inpainting
There always exist occlusion areas in optical flow: some pixels do not have corresponding pixels in successive frames. The estimated optical flow in occlusion areas is unreliable. Thus, we set a threshold α to mask out these areas, and using flow inpainting to fill in the holes: If ϕ(p) is 1, its optical flow is treated unreliable, and is inpainted by a linear combination of neighboring valid flow values, whose weights are inversely proportional to the distance between the invalid pixel and the valid pixels.

External learning methods
External training Semantic Instance Depth We try to use adaptive weights like Softmax Splatting [28] to resolve the occlusions and find it unsuitable for our framework. Detailed analysis is described in the supplement.

Implementation
Multi-frame prediction. For multi-frame prediction, we choose to optimize the next frame recurrently. We try to set the optimization target as multiple optical flows and optimize multiple future frames together. The result turns out recurrently optimizing the next frame is more stable.
The input frame length for all datasets is set to 2. The hyperparameters ω 1 , ω 2 , α are set to 1.0, 3.0, 1.5 empirically. We adopt RAFT [40] to estimate optical flow used for optimization target initialization. The Adam optimizer [14] is used with a learning rate of 0.1 for 3000 iterations for each future frame. We adopt the VFI method RIFE [11], which is pretrained only on Vimeo90K [47], for all the experiments. During the process of optimization, the network weight of RIFE [11] is fixed.

Experiments
We compare our method with state-of-the-art methods as shown in Table 1 in terms of methods' requirements. Due to the complexity of future video prediction, many recent methods add some extra assumptions for video prediction, such as semantic maps [4,15,31,35,43,45], instance maps [45], and depth maps [35]. These assumptions may improve prediction performance but vastly decrease their generalization capability. Furthermore, these methods demand a training dataset to train a neural network. However, our method can avoid these restrictions by casting the video prediction problem as optimization. We do not require external training and do not have any assumptions about the data. Our method is very general and outperforms previous external RGB-based methods and methods using additional assumptions [31,43,45]. Statistical analysis for long-term prediction and more visual comparisons are provided in the supplement.  Input  t+1  t+3  t+5  t+1  t+3  t+5  t+1  t+3  t+5  t+1  t+3  t+5 External learning methods  Table 2. Comparison with state-of-the-art methods on the Cityscapes and KITTI datasets. S. and I. denote that the method requires semantic maps or instance maps as input. Our method can outperform previous video prediction methods by a large margin. Figure 3. Multi-frame prediction comparison on KITTI. As the pink boxes show, DVF [20] fails to separate the motion of the blue car from the background and produces a "zooming-in" effect, which is the major motion exhibited in the dataset, caused by the forward movement of the running car. FVS [45] wrongly predicts the motion of the blue car at t + 3 and t + 5, resulting in incorrect frame prediction results. Our model can correctly capture the motion of the blue car without external training.

Evaluation on Driving Datasets
We first evaluate our approach and relevant baselines on driving datasets, where semantic information is available, because some baselines require additional semantic maps.
Baselines. All baselines are trained on the corresponding training set in Cityscapes and KITTI. We categorize baselines into two types. One type is the methods that take only RGB frames as input, such as PredNet [22], MCNet [42], and DVF [20]. Another type is the methods that require some additional information, such as semantic maps, instance maps, including Vid2vid [43], Seg2vid [31], and FVS [45]. However, these assumptions restrict these methods to be only applicable when this additional context is ac-cessible, degrading their potential generalization ability. We use Multi-scale Structural Similarity Index Measure (MS-SSIM) [44] and LPIPS [48] as evaluation metrics. Higher MS-SSIM and lower LPIPS indicate better performance.
Quantitative results. Although our method does not use the training set in Cityscapes and KITTI, our method can still produce outstanding results. As shown in Table 2, our method can outperform RGB-based methods by a large margin in both short-term and long-term video prediction. Our method improves DVF [20]   Ground Truth DVF [20] Ours t + 1 t + 1 t + 3 t + 1 t + 3 Figure 5. Multi-frame prediction on Vimeo90K. Since Vimeo90K contains triplets and we use two frames as input, there is no ground-truth corresponding to t + 3.
The quantitative results demonstrate that our method without external training on the training set of Cityscapes and KITTI, can achieve better performance in both short-term and long-term video prediction. This is because our method is based on the powerful constraints from VFI: recent VFI models can produce superior interpolation results that can be arguably treated as ground truth. While other methods use handcrafted loss functions, these methods may

Ours
Input Ours Figure 6. The next frame prediction performance on diverse data. The left image is the last observed frame, and we use red arrows to indicate the motion from the input frames. The right image is the predicted next frame by our method.
overfit to the major motion exhibited in the training set, the "zooming-in" effect, which is caused by the moving of the forwarding car, instead of learning the real motion. Qualitative Results. In Fig. 3, our method is compared to recent video prediction methods, DVF [20] (RGB) and FVS [45] (RGB + semantic + instance). DVF [20] tends to be dominated by "zooming-in" motion without predicting the true motion, since the driving datasets are captured by a forward moving camera. FVS [45] uses a handcrafted 2D affine transformation to approximate the motion of moving cars. However, complex motion, including nonrigid deformation and 3D rotation, can not be captured by 2D affine transformation. Moreover, DVF and FVS rely on semantic and instance segmentation, and their performance degrades when these assumptions do not hold. Visual comparisons on Cityscapes are presented in the supplement.

Evaluation on Diverse Datasets
Since our optimization framework does not need external training, our method can be generalized to any video at any resolution. Meanwhile, previous external methods trained on dataset A may have performance degradation when applied to dataset B, caused by the domain gap between A and B. To demonstrate the generality of our method, we conduct a cross-dataset evaluation on diverse datasets.

Datasets.
We evaluate our methods on multiple datasets, including DAVIS [34], Middlebury-Other [1], and Vimeo90K [47]  Baselines. We compare our method with two latest external methods, DVF [20] and DYAN [18], which take only RGB frames as input, since they can be applied to these datasets. Other methods that require additional assumptions cannot be compared because their assumptions do not hold. We test these two models on these datasets using their pretrained model on UCF101 [38].
Quantitative results. As exhibited in Table 3, our method outperforms DYAN [18] by 12.90%, 15.0% in DAVIS, and by 23.97%, 28.00% on Middlebury in LPIPS for t + 1, t + 3 predictions. Note that our method is still robust in long-term prediction. On the Vimeo90K dataset, our method outperforms DVF [20] by 53.56% in LPIPS for next-frame prediction. Although these two baselines may perform well on UCF-101, there is a domain gap problem between UCF-101 and these test videos. This domain gap phenomenon commonly exists in video prediction tasks, so most video prediction methods [4,18,20,22,31,42,45] usually train a separate model for each dataset and even employ different assumptions for each dataset. Differently, the domain gap in the VFI task does not appear to be an issue. VFI methods [11,33] can use one dataset for training and can produce excellent results on various datasets. With the powerful constraints provided by VFI, our method does not have the domain gap problem (no external training): each sequence is independently optimized by employing the FVI network as a constraint.
Qualitative results. As shown in Fig. 4 and Fig. 5, our method yields better prediction results than baselines. The baselines produce distortion artifacts around object boundary or fail at prediction when motion is complicated. Meanwhile, our method can robustly predict future frames. As the Vimeo90K dataset only provides three frames, we take the first two frames as input for future frame prediction (there is only ground truth for the t + 1 prediction). Our method can produce high-quality prediction results in the long term, as shown in Fig. 5. The intricate details, such as the hair of the woman, remain clear in our results.
To demonstrate the generality of our method, we collect some real videos from YouTube, such as the movie clips as shown in Fig. 6. We also present some visual results on the BAIR Pushing [6] and Penn Action [49] datasets. Our method can produce strong results on diverse data.

Ablation Study
We conduct an ablation study to demonstrate the importance of each component, as shown in Table 4. Our ablation study is conducted on Cityscapes. We use the performance of the next-frame prediction to evaluate different components. Visual comparisons are presented in the supplement.
Initialization. If we set the optimization target as the prediction frame, then the optimization cannot converge. Thus, we choose to optimize optical flow, which eases the optimization process since pixels can be copied from observed frames. If we initialize optical flow as zeros or Gaussian noise, then our performance becomes worse. If we initialize the optical flow as the copy of f t→t−1 , then the performance is similar to our full model. This demonstrates that good initialization helps the optimization to converge.
Loss functions. We conduct experiments with loss functions with several variants. Without L img : supervised only by L cons . Without L cons : supervised only by L img . L img with MSE: using MSE loss rather than L 1 loss in Eq. 8. With L interp : use the interpolation result of VFI I G t rather than the intermediate output I G t+1 in Eq. 8. Long-term L img : setting the input frame length as 4 and add a long-term constraint between x t−3 ,x t+1 and x t−1 . The results show that the combination of L img and L cons performs best. L img provides a more direct constraint than L interp . Long-term L img has performance degradation because when the motion is too large, the accuracy of VFI decreases .
Flow inpainting. If we remove the optical flow inpainting procedure, then our performance also drops because optical flow inpainting effectively corrects invalid flow values.
Other pretrained VFI models. We also try utilizing Super SloMo [13] as our VFI backbone and find this method also works for our framework. For the next frame prediction on Cityscapes, the MS-SSIM for Super SloMo [13] and RIFE [11] is 0.9199 and 0.9454. Thus, we choose RIFE [11] as our VFI backbone.

Convergence Analysis
As shown in Fig. 7, we conduct the convergence analysis on Cityscapes with a resolution of 256 × 512 . In the first 400 iterations, the optimization converges fast. After 400 iterations, the prediction result gradually improves. The prediction result is still slowly improving after 3000 iterations.

Conclusion
We propose the first video prediction optimization method by casting the video prediction problem as a VFI based optimization problem, which addresses the domain gap issue in most video prediction methods. Our method can outperform state-of-the-art methods and can be adapted to any video at any resolution. Although our method relieves domain gap problem and presents impressive performance, optimizing every frame by our method costs more time than other external learning-based methods. The comparison between our and other methods in terms of the model size and inference time is presented in the supplement. As we observe, most run time in our model is spent on the gradient propagation inside the VFI network [11], which inspires us to design a more efficient backbone for acceleration in the future.