Learning Energy-based Spatial-Temporal Generative ConvNets for Dynamic Patterns
Jianwen Xie, Song-Chun Zhu, Ying Nian Wu
Introduction
There are a wide variety of dynamic patterns in video sequences, including dynamic textures or textured motions that exhibit statistical stationarity or stochastic repetitiveness in the temporal dimension, and action patterns that are non-stationary in either spatial or temporal domain. Recently we have witnessed tremendous advance in developing discriminative models for dynamic pattern recognition, e.g., , , , , , , , and , however, the progress in developing generative models of dynamic patterns for synthesis purpose has been lagging behind. Synthesizing dynamic patterns has been an interesting but challenging problem in computer vision and computer graphics. In this paper, we focus on the task of learning to synthesize dynamic patterns via generative modeling of dynamic patterns with a generative version of the convolutional neural network (ConvNet or CNN), or more specificcally, an energy-based model with ConvNet parametrization of the energy function.
The ConvNet has proven to be an immensely successful discriminative learning machine. The convolution operation in the ConvNet is particularly suited for signals such as images, videos and sounds that exhibit translation invariance either in the spatial domain or the temporal domain or both. Recently, researchers have become increasingly interested in the generative aspects of ConvNet, for the purpose of visualizing the knowledge learned by the ConvNet, or synthesizing realistic signals, or developing generative models that can be used for unsupervised learning.
In terms of synthesis, various approaches based on the ConvNet have been proposed for synthesizing realistic static images . However, there has not been much work in the literature on modeling and synthesizing dynamic patterns based on the ConvNet, and this is the focus of the present paper.
In the pattern theory of Grenander, a visual pattern is represented by a probability distribution. Grenander used Gibbs distributions or energy-based models to approximate probability densities for image patterns. In this paper, we continue this paradigm and adopt spatial-temporal convolutional neural networks (ConvNet or CNN) to parametrize the energy functions of the energy-based models that are capable of synthesizing realistic videos of many dynamic patterns.
In terms of generative modeling, generative adversarial networks (GAN) and variational autoencoder (VAE) have emerged as two most popular approaches for unsupervised learning of complex distributions. However, neither GAN nor VAE provides explicit probability densities of the data that they model, since they only focus on generating data by learning a mapping from an easily sampled low dimensional distribution (e.g., Gaussian distribution) to the target data distribution. Moreover, both GAN and VAE rely on auxiliary models for training. For example, GAN adopts a discriminator to train the generator in a minimax two-player game, but eventually discards the discriminator after the generator is trained. VAE recruits an encoder as the inference model to approximate the inference process based on the posterior distribution, which may cause a gap between the VAE and the maximum likelihood estimator. This paper proposes a different model for dynamic patterns. It can be learned without recruiting an auxiliary model.
2 Overview of model and algorithm
The energy-based generative ConvNet can be sampled by the Langevin dynamics. Because of the aforementioned auto-encoding structure of the energy-based generative ConvNet, the Langevin dynamics is driven by the reconstruction error, i.e., the difference between the current sample and its reconstruction by the above auto-encoding process. The model can be learned by the stochastic gradient algorithm . It is an “analysis by synthesis” scheme that seeks to match the synthesized signals generated by the Langevin dynamics to the observed training signals. Specifically, the learning algorithm iterates the following two steps after initializing the parameters and the synthesized signals. Step 1 updates the synthesized signals by the Langevin dynamics that samples from the currently learned model. Step 2 then updates the parameters based on the difference between the synthesized data and the observed data in order to shift the density of the model from the synthesized data towards the observed data. It is shown by that the learning algorithm can synthesize realistic spatial image patterns such as textures and objects.
In this article, we generalize the energy-based spatial generative ConvNet by adding the temporal dimension, so that the resulting ConvNet consists of multiple layers of spatial-temporal filters that seek to capture spatial-temporal patterns at various scales. For dynamic textures, these spatial-temporal filters are convolutional in the temporal domain, reflecting the statistical stationarity or stochastic repetitiveness of the patterns in the temporal domain. If the dynamic textures also exhibit spatial stationarity, we also make the spatial-temporal filters convolutional in the spatial domain. For action and motion patterns that are non-stationary in the temporal domain, the top layer filters are fully connected in the temporal domain. We provide a mode seeking and mode shifting interpretation and an adversarial interpretation of the learning and sampling algorithm. We show that the learning algorithm for training the model can synthesize realistic dynamic patterns. We also show that it is possible to learn the model from incomplete video sequences with either occluded pixels or missing frames, so that model learning and pattern completion can be accomplished simultaneously.
3 Related work
In this section, we provide a comprehensive review of related work.
Dynamic pattern recognition. Recognizing dynamic patterns (e.g., actions) with ConvNets has been extensively studied in the past few years. applied ConvNets with deep structures on a large-scale video dataset for classification. designed a two-stream ConvNet structure, which incorporates spatial network trained on still image frames and temporal network trained on motion in the form of dense optical flow, for action recognition. trained 3D ConvNets on the realistic and large-scale video datasets to learn both appearance and motion features with 3D convolution operations. studied modeling long-range temporal structure with ConvNets and LSTM . and generalized the residual networks (ResNets) for the spatiotemporal domain for video action recognition and dynamic scene recognition. proposed the Inception 3D (I3D) model by inflating all the 2D convolution filters and pooling kernels used by the Inception V1 architecture into 3D convolutions and pre-training the model on the large-scale Kinetics human action video dataset . Instead of learning discriminative spatial-temporal ConvNets of dynamic patterns, our paper mainly focuses on generative modeling of spatial-temporal ConvNets for dynamic pattern synthesis.
FRAME models. The FRAME (Filters, Random fields, And Maximum Entropy) model is a Markov random field model (or a Gibbs distribution, or an energy-based model) that defines a probability distribution on the data space. The probability distribution is the maximum entropy distribution that reproduces the statistical properties of filter responses in the observed data. The original FRAME model is a stationary model developed for modeling texture patterns. A non-stationary version of FRAME model designed for object patterns was proposed in . The filters used in the above two versions of FRAME models are the Gabor filters and the isotropic Difference of Gaussian filters. These are linear filters that capture simple local image features, such as edges and blobs. Inspired by the recent successes of deep convolutional neural networks (CNNs or ConvNets) , the deep FRAME model replaces the linear filters by the non-linear filters at a certain convolutional layer of a pre-trained deep ConvNet. Such filters can capture more complex patterns, and the deep FRAME model built on such filters can be more expressive. Our model is a spatial-temporal (3D) generalization of the deep FRAME model with the non-linear filters in the deep ConvNet trained by maximum likelihood from the observed data.
Energy-based generative ConvNet. Recently, a deep generative model directly derived from the discriminative ConvNet model was proposed in . The resulting model is an energy-based generative ConvNet model. The maximum likelihood learning of the model involves Markov chain Monte Carlo (MCMC) approximation of the gradient of the data log-likelihood. To address the inefficiency of MCMC sampling, developed a multi-grid sampling and learning method for the energy-based generative ConvNet, and proposed to recruit a top-down generator serving as an approximate sampler of the energy-based generative ConvNet model. did not work on dynamic patterns such as those in the video sequences. is a generalization of for dynamic patterns by adopting spatial-temporal ConvNets to capture spatial and temporal features of the video sequences. Recently, proposed a volumetric version of the energy-based generative ConvNet for modeling 3D shape patterns. This paper is an expanded version of our conference paper in .
Dynamic textures. Generating dynamic textures or textured motions have been studied by . For instance, proposed a vector auto-regressive model coupled with frame-wise dimension reduction by single value decomposition. It is a linear model with Gaussian innovations. proposed a dynamic model based on sparse linear representation of frames. See for a recent review of dynamic textures. The spatial-temporal generative ConvNet is a non-linear and non-Gaussian model and is expected to be more flexible in capturing complex spatial-temporal patterns in dynamic textures with multiple layers of non-linear spatial-temporal filters. Recently some researcher have started to study dynamic texture synthesis by matching feature statistics, which are extracted by pre-trained convolutional networks, between synthesized and observed examples, e.g., adopted a pre-trained ConvNet for object recognition, while used two pre-trained ConvNets trained for object recognition and optical flow prediction separately. Even though a ConvNet structure is also included in our model, it serves as the energy function of the energy-based model and is learned from scratch by maximizing the log-likelihood of the observed data, without relying on other pre-trained networks for assistance.
Generative adversarial networks of videos. Recently, multiple video generation frameworks using generative adversarial network (GAN) were proposed. For example, one can generalize the existing image-based generative adversarial networks framework to video generation by using a single generator consisting of 3D deconvolutional layers. proposed generative adversarial networks for video with a spatial-temporal convolutional architecture that disentangles the scene’s foreground from the background. TGAN exploited a 1D temporal generator and a 2D image generator for video generation. The temporal generator takes a single latent variable as input and outputs a set of latent variables, while the image generator transforms these latent variables provided by the temporal generator into video frames. MoCoGAN proposed the motion and content decomposed generative adversarial networks for video generation. All of the above methods need to recruit a discriminator with appropriate convolutional architecture to evaluate whether the generated videos are from the training data or the video generator. Different from GAN-based methods, our model is a deep 3D convolutional energy-based model with only one single bottom-up 3D ConvNet architecture as the energy function. Our model generates video clips by directly sampling from an explicit distribution by MCMC, such as Langevin dynamics, while the GAN-based methods cannot provide explicit distributions of the videos that they seek to model. Our model has an adversarial interpretation. See section 3.1 for details.
Recurrent neural network. For temporal data, a popular model is the recurrent neural network . It is a causal model and it requires a starting frame. In contrast, our model is non-causal, and does not require a starting frame. Compared to the recurrent network, our model is more convenient and direct in capturing temporal patterns at multiple time scales.
Subsection 3.3 presents a detailed comparison between various generative models of dynamic patterns that are based on deep neural networks.
4 Contributions
The following are the main contributions of this paper. (1) We propose an energy-based spatial-temporal generative ConvNet for modeling video sequences by combining the 3D ConvNets and the energy-based generative ConvNets . (2) We show that the model is capable of synthesizing realistic dynamic patterns. (3) We show that it is possible to learn the model from incomplete data. (4) We present a mode seeking and mode shifting interpretation of the learning and sampling algorithm, and we also present an adversarial interpretation of the algorithm.
Energy-based Spatial-temporal generative ConvNet
To fix notation, let be an image sequence of a video defined on the square (or rectangular) image domain and the time domain , where indexes the coordinates of pixels, and indexes the frames in the video sequence. We can treat as a three dimensional function defined on . For a spatial-temporal filter , we let denote the filtered image sequence or feature map, and let denote the filter response or feature at pixel and time .
The spatial-temporal ConvNet is a composition of multiple layers of linear filtering and ReLU non-linearity, as expressed by the following recursive formula:
where indexes the layers. are the filters at layer , and are the filters at layer . and are used to index filters at layers and respectively, and and are the numbers of filters at layers and respectively. The filters are locally supported, so the range of is within a local support (such as a box of image sequence). The weight parameters define a linear filter that operates on . The are bias parameters. The linear filtering operation is followed by ReLU . At the bottom layer, , where indexes the three color channels. Sub-sampling may be implemented so that in , , and . For example, if the sub-sampling size is , we only keep the first pixel and then every -th pixel after the first. The sub-sampling operation can be applied to both spatial and temporal domains.
The spatial-temporal filters at multiple layers are expected to capture the spatial-temporal patterns at multiple scales. It is possible that the top-layer filters are fully connected in the spatial domain as well as the temporal domain (e.g., the feature maps are in the spatial domain) if the dynamic pattern does not exhibit spatial or temporal stationarity.
2 Energy-based spatial-temporal generative ConvNet
The spatial-temporal generative ConvNet is an energy-based model or a random field model defined on the image sequence . It is in the form of exponential tilting of a reference distribution :
where the scoring function is
where consists of all the weight and bias terms that define the filters at layer , and is the Gaussian white noise model, i.e.,
where counts the number of pixels in the domain . Without loss of generality, we shall assume . is the normalizing constant or partition function that is analytically intractable.
The scoring function in (3) tilts the Gaussian reference distribution into a non-Gaussian model. In fact, the purpose of is to identify the non-Gaussian spatial-temporal features or patterns. In the definition of in (3), we sum over the filter responses at the top layer over all the filters, positions and times. The spatial and temporal pooling reflects the fact that we assume the model is stationary in spatial and temporal domains. If the dynamic texture is non-stationary in the spatial or temporal domain, then the top layer filters are fully connected in the spatial or temporal domain, e.g., is .
A simple but consequential property of the ReLU non-linearity is that , where is the indicator function, so that if and otherwise. As a result, the scoring function is piecewise linear , and each linear piece is defined by the multiple layers of binary activation variables , which tells us whether a local spatial-temporal pattern represented by the -th filter at layer , , is detected at position and time . Let be the activation pattern of . Then divides the image space into a large number of pieces according to the value of . On each piece of image space with fixed , the scoring function is linear, because with fixed value of the indicator function , the ReLU reduces to a linear mapping. Specifically, according to , we can write
where both and are defined by and . In fact, , and can be computed by back-propagation, with . The back-propagation process defines a top-down deconvolution process , where the filters at multiple layers become the basis functions at those layers, and the activation variables at different layers in become the coefficients of the basis functions in the top-down deconvolution.
where , which is constant on the piece of image space with fixed .
Since is a piecewise quadratic function, is piecewise Gaussian. On the piece of image space , where is a fixed value of , is truncated to , where we use to denote the identity matrix. If the mean of this Gaussian piece, , is within , then is also a local mode, and this local mode satisfies a hierarchical auto-encoder, with a bottom-up encoding process , and a top-down decoding process . In general, for an image sequence , can be considered a reconstruction of , and this reconstruction is exact if is a local mode of .
Our model in (2) directly corresponds to a classifier, specifically a spatial-temporal discriminative ConvNet, in the following sense . Suppose we have categories of video sequences. Let be the video sequence distribution of category , for , which is defined according to model (2). The ConvNet structures may share common lower layers of parameters. Let be the prior probability of category for . The posterior distribution for classifying an example to the category is a softmax multi-class classifier (Spatial-temporal discriminative ConvNet) given by
where the category-specific bias term . The correspondence to discriminative ConvNet justifies the energy-based spatial-temporal generative ConvNet model.
3 Sampling and learning algorithm
One can sample from of model (2) by the Langevin dynamics:
where indexes the time steps, is the step size, and is the Gaussian white noise term.
The Langevin dynamics consists of a deterministic part and a stochastic part. The former is a gradient descent that attempts to find the minimum of the energy function , while the latter is a Brownian motion that prevents the gradient descent from falling into local minimum traps.
The dynamics is driven by the reconstruction error . The finiteness of the step size can be corrected by a Metropolis-Hastings acceptance-rejection step. The Langevin dynamics can be extended to Hamiltonian Monte Carlo or more sophisticated versions .
The learning of from training image sequences can be accomplished by the maximum likelihood estimation (MLE), which follows an “analysis by synthesis” scheme. Let , with defined in (2),
can be updated by a stochastic gradient ascent algorithm with learning rate :
See Algorithm 1 for a description of the learning and sampling algorithm. The algorithm keeps synthesizing image sequences from the current model, and updating the model parameters in order to match the synthesized image sequences to the observed image sequences. This is an “analysis by synthesis” scheme. The convergence of the algorithm has been studied by .
In algorithm 1, the Langevin sampling step involves the computation of , and the parameter updating step involves the computation of . Because of the ConvNet structure of , both gradients can be computed efficiently by back-propagation, and the two gradients share most of their chain rule computations in back-propagation. The whole learning and sampling algorithm can be considered an alternating back-propagation algorithm: (1) Sampling back-propagation: changing the synthesized examples via Langevin dynamics or gradient descent. (2) Learning back-propagation: changing the model parameters according to the synthesized examples and the observed examples by gradient ascent. In term of MCMC sampling, the Langevin dynamics samples from an evolving distribution because keeps changing. Thus the learning and sampling algorithm runs non-stationary chains.
Interpretations and related models
This section presents interpretations of the learning algorithms, as well as related models of dynamic patterns.
Our spatial-temporal generative ConvNet model is an energy-based model
where the energy function .
The update of is based on , which can be approximated by
This is an adversarial interpretation of the learning and sampling algorithm, but the value function is different from that of the generative adversarial learning . It can also be considered a generalization of the herding method from exponential family models to general energy-based models.
In our work, we let . We can also let by assuming a uniform reference distribution . Our experiments show that the model with the uniform can also synthesize realistic dynamic patterns.
2 Mode seeking and mode shifting
The data distribution might have many local modes, if the observed data are highly varied. Our model parametrized by a ConvNet structure can be flexible and expressive enough to fit such a by creating modes to encode the observed examples with highly diverse patterns. The or equivalently the energy function should be learned such that the energy function places lower values on the observed examples than the unobserved examples. This can be achieved by the sampling and learning algorithm presented in Algorithm 1, which can be interpreted as a process that alternates mode seeking and mode shifting.
The learning algorithm will create and sharpen the major modes to concentrate on the observed image sequences, if those modes are too diffused around the observed image sequences. The learned energy landscape might have some major modes that are not occupied by the observed examples, and these modes will create examples that are similar to the observed examples.
This mode seeking and mode shifting interpretation is related to Hopfield network that uses local modes of energy landscape to memorize the observed examples. This is also related to attractor network with the Langevin dynamics serving as the attractor dynamics.
3 Comparison with other models of dynamic patterns
The energy-based model is based on a bottom-up ConvNet defined on the video sequence . There are other models based on top-down ConvNets.
One generator model assumes a hidden noise vector , where is the identity matrix of dimension . Then , where is parametrized by a top-down spatial-temporal ConvNet, and is Gaussian white noise.
The other generator model is a non-linear version of the state space model or hidden Markov model, where , and , where is the state vector, and is the noise vector, and the transition model is parametrized by a forward network, and the emission model is parametrized by a top-down network. This model is called dynamic generator model . It has a causal structure. It is a non-linear generalization of the dynamic texture model .
The above generator models can be learned by maximum likelihood. They can also be learned jointly with inference models as in VAE, or discriminator models as in GAN, or the energy-based models. In the joint training of the dynamic generator model and the energy-based model, the former plays the role of actor and the latter plays the role of evaluator or critic.
In comparison with classical mechanics, the energy-based model is similar to the Lagrangian formulation which is based on the action defined on the whole trajectory, whereas the dynamic generator model is similar to the Hamiltonian formulation which unfolds the trajectory over time.
In the Gibbs distribution in statistical mechanics, the energy function is defined on the spatial domain, and the system evolves over time and converges to the Gibbs distribution . In the energy-based model studied in this paper, the energy function is defined on the spatial-temporal domain, where the time dimension is treated in the same way as the spatial dimensions. The Langevin dynamics evolves this spatial-temporal model over a virtue time (denoted by ). This treatment is similar to the lattice field theory in physics, which is also based on a Gibbs distribution whose energy is defined on the spatial-temporal domain, and the MCMC sampler evolves the system over a virtue time .
In the context of image-based control or intuitive physics, we can jointly model the actions and the video sequences, using the energy-based model and the dynamic generator model. The energy function in the energy-based model can be interpreted as the cost function for optimal control, and the dynamic generator model consists of the policy and the dynamics .
Beside the energy-based models and the generator models, there are also flow-based models , where the log-likelihoods can be computed in closed form. Specifically, , where is a noise vector that is of the same dimensionality as , and is a composition of a sequence of invertible transformations that are designed such that the inverse and the Jacobian of can be computed in closed form.
Experiments
We learn the energy-based spatial-temporal generative ConvNet from video clips collected from DynTex++ dataset of and the Internet. We show the synthesis results by displaying the frames in the video sequences. We have posted the synthesis results on the project page http://www.stat.ucla.edu/~jxie/STGConvNet/STGConvNet.html, so that the reader can watch the videos.
We first learn the model from dynamic textures that are stationary in both spatial and temporal domains. Because these dynamic textures exhibit spatial-temporal homogeneity, we use spatial-temporal filters that are convolutional in both spatial and temporal domains to design our network , which consists of three layers of spatial-temporal convolution, ReLU nonlinearity, and sub-sampling. The first layer has 120 filters with sub-sampling size of 7 pixels and frames. The second layer has 40 filters with sub-sampling size of 3. The third layer has 20 filters with sub-sampling size of . The sub-sampling operation is useful to reduce the size of the output feature map of each layer for the sake of efficient computation.
Figure 1 displays 4 results of learning to synthesize water waves. For each category, the first row displays 7 frames of the observed sequence, while the second and third rows show the corresponding frames of two synthesized sequences generated by the learning algorithm. The qualitative results displayed in Figure 1 clearly show that our model can learn to generate realistic examples of dynamic textures with both spatial and temporal stationarity, such as water waves. The synthesized examples are similar, but not identical, to the observed video sequence. Generally, when the number of chains of synthesis increases, the diversity of the synthesized sequences will also increase.
2 Experiment 2: Generating dynamic textures with only temporal stationarity
Many dynamic textures have structured background and objects that are not stationary in the spatial domain. In this case, the network used in Experiment 1 may fail. However, we can modify the network in Experiment 1 by using filters that are fully connected in the spatial domain at the second layer to account for spatial non-homogeneity of the dynamic textures. Specifically, the first layer has 120 filters with sub-sampling size of 3 pixels and frames. The second layer is a spatially fully connected layer, which contains 30 filters that are fully connected in the spatial domain but convolutional in the temporal domain. The temporal size of the filters is 4 frames with sub-sampling size of 2 frames in the temporal dimension. Due to the spatial full connectivity at the second layer, the spatial domain of the feature maps at the third layer is reduced to . The third layer has 5 filters with sub-sampling size of 1 in the temporal dimension.
We use end-to-end learning scheme to learn the above 3-layer energy-based spatial-temporal generative ConvNet for dynamic textures with only temporal stationarity. At each iteration, the 3 layers of filters are updated with 3 different layer-specific learning rates. The learning rate at the higher layer is much less than that at the lower layer to avoid the issue of large gradients.
The computational time for each iteration including 20 steps of Langevin dynamics is roughly 120 seconds on a PC with an Intel i7-6700k CPU and a Titan Xp GPU. It takes roughly 5 seconds for each step of Langevin dynamics sampling.
Quantitative evaluation for dynamic texture synthesis is a particularly challenging task, because there is no unique correct output when synthesizing new samples of an observed dynamic texture. The structural similarity (SSIM) index is designed to provide a perceptual judgment on the similarity between two videos, and ranges from -1 to 1, with a larger score indicating greater similarity. We can calculate the SSIM between the synthesized image sequence and the original image sequence to examine the synthesis quality. A larger SSIM indicates a better synthesis quality due to higher perceptual similarity between the synthesized and original sequences. We compare our method with some baseline methods for dynamic textures, such as HOSVD , FFT-LDS , and Doretto et al , in terms of SSIM on 17 dynamic texture videos in Table I. Our method outperforms the baseline methods.
Human perception, which is also an important and reliable measure to evaluate synthesis quality, has been used in , , ,. Following the protocal of, we conduct a human perceptual study to evaluate the perceived realism of the synthesized dynamic textures. Twenty different human observers are randomly chosen to participate in the perceptual experiment. Each participant performs 36 (12 categories 3 examples) pairwise comparisons between a synthesized dynamic texture and its real version. Participants are asked to select which one looks more realistic after viewing each pair of dynamic textures for a specified exposure time. The dynamic textures are all shown at the same resolution (each image frame is of the size pixels) in the form of video. The comparisons are randomized across the left-right order of two videos in each pair and the order of presenting different video pairs. The exposure time is chosen from discrete durations between 0.3 and 3.6 seconds. This evaluates how quickly the difference between two dynamic textures can be perceived.
We record the “fooling” rate, which is the participant error rate in distinguishing synthesized dynamic textures from real ones, for each participant. The higher the “fooling” rate, the more realistic the synthesized dynamic textures. Note that “perfectly” synthesized results would lead to a “fooling” rate of 50 , indicating that the participants are unable to differentiate between the synthesized and real examples, and thus make random guesses.
Our model is compared with four baseline methods, such as LDS (linear dynamic system) , dynamic generator , TwoStream and MoCoGAN , on 12 dynamic texture video sequences (e.g., waterfall, burning fire, waving flag, etc) that have been adopted in . We briefly introduce them as follows. LDS simulates dynamic textures by a first-order auto-regressive moving average model driven by white zero-mean Gaussian noise; Dynamic generator is a non-linear generalization of the linear state space model where the non-linear transformations in the transition and emission models are parameterized by neural networks, and its training is based on maximum likelihood, which is accomplished by the alternating back-propagation through time algorithm; TwoStream method synthesizes dynamic textures by matching the feature statistics that are extracted from two pre-trained convolutional neural networks between synthesized and observed examples, where the pre-trained convolutional neural networks are trained for two independent tasks: object recognition, and optical flow prediction; and MoCoGAN is a motion and content decomposed generative adversarial network for video generation, where extra networks, e.g., image and video discriminators, are recruited to train the video generator in an adversarial manner.
Figure 4 shows the comparison results at different exposure times, where the “fooling” rate decreases as exposure time increases, and then remains at the same level for longer exposures. This means that as the given exposure time becomes longer and longer, it becomes easier for the participants to tell “fake” examples from real ones. In summary, the dynamic textures generated by our proposed method are more realistic than other baseline methods. Besides, since the dynamic generator is a non-linear generalization of LDS, it is undoubtedly more expressive than LDS. The result also shows that the LDS outperforms those methods using sophisticated deep network structures (i.e., TwoStream and MoCoGAN). This is not surprising because when learning from a small number of training data (in this experiment, we only have one single training example), the MoCoGAN, with a large number of parameters that need to be estimated, may not fit the training data very well by using an unstable and complicated adversarial training scheme, while the TwoStream method has a limitation that it cannot synthesize dynamic textures not being spatially homogeneous (i.e., dynamic textures with structured background, e.g., burning fire heating a pot). Our model is simple yet powerful, relying on neither extra networks nor extra labeled data for pre-training.
3 Experiment 3: Generating action patterns without spatial or temporal stationarity
Experiments 1 and 2 show that the energy-based generative spatial-temporal ConvNet can learn from video sequences without alignment. We can also specialize it to learning roughly aligned video sequences of action patterns, which are non-stationary in either spatial or temporal domain, by using a single top-layer filter that covers the whole video sequence.
The action patterns are spatial-temporally aligned in the sense that (1) for each time step, the target objects in different videos possess the same locations, shapes, and poses (i.e., spatially aligned), and (2) the start and end times of the actions in different videos are the same (i.e., temporally aligned).
We learn a 2-layer energy-based spatial-temporal generative ConvNet from video sequences of roughly aligned actions. The first layer has 200 filters with sub-sampling size of 3 pixels and frames. The second layer is a fully connected layer with a single filter that covers the whole sequence. The observed sequences are of the size pixels frames.
The experiments show that our model can capture non-stationary action patterns. In general, both appearances and motions of the animals in the synthesized video sequences are physically plausible. We also notice that the synthesized action patterns contain some artifacts (e.g., the appearance of additional limbs of the animals in the synthesized video sequences), which is due to the fact that the action patterns in the collected training video sequences are not perfectly aligned (e.g., at a specific time, the poses of the animals in different videos are not the same). Note that synthesizing action patterns can be difficult for the methods of and .
One limitation of our model is that it does not involve explicit tracking of the objects and their parts, therefore the model can only learn descriptive features of an action pattern for the sake of synthesis, instead of an explainable action decomposition for the purpose of understanding. The other limitation is that a single model can only be used for single category of action pattern. Unsupervised learning from actions of mixed categories requires fitting a mixture of energy-based spatial-temporal generative ConvNet models. However, this would require the estimation of the intractable normalizing constants of the models, because the EM-type algorithm to fit mixtures of energy-based spatial-temporal generative ConvNet models involves computation of the log-likelihood of each video sequence under each model. Our previous works and have studied this issue. Nevertheless, the dynamic generator and MoCoGAN adopt top-down generators, with explicit latent variables accounting for action categories, to learn from actions of mixed categories in an unsupervised manner.
4 Experiment 4: Learning from incomplete data
Our model can learn from video sequences with occluded pixels. The task is inspired by the fact that most of the videos contain occluded objects. Our learning method can be adapted to this task with minimal modification. The modification involves, for each iteration, running steps of Langevin dynamics to recover the occluded regions of the observed sequences. The additional Langevin dynamics for recovery is initialized by the observed occluded sequences, and it only synthesizes the occluded regions, while keeping the visible parts in the observed sequences unchanged. At each iteration, we use the completed observed sequences and the synthesized sequences to compute the gradient of the log-likelihood and update the model parameters. Our method simultaneously accomplishes the following tasks: (1) recover the occluded pixels of the training video sequences, (2) synthesize new video sequences from the learned model, (3) learn the model by updating the model parameters using the recovered sequences and the synthesized sequences. See Algorithm 2 for the description of the learning, sampling, and recovery algorithm.
We design 3 types of occlusions: (1) Type 1: salt and pepper occlusion, where we randomly place masks on the image domain to cover of the pixels of the videos. (2) Type 2: single region mask occlusion, where we randomly place a mask on the image domain. (3) Type 3: missing frames, where we randomly block of the image frames from each video. Figure 8 displays two examples of the recovery results for each type of occlusion. Each video has 70 frames. We can see that our model can recover the incomplete video sequences, while learning from them.
We want to emphasize that (1) our models differ from denoising auto-encoders , where the training data are fully observed, and noises are added as a matter of regularization; (2) our experiments are different from in-painting or de-noising, where the prior model or regularization has already been learned from fully observed data or provided; (3) Learning from incomplete data can be difficult for GAN and VAE.
5 Experiment 5: Background inpainting
If a moving object in the video is occluded in each frame, it turns out that the recovery algorithm will become an algorithm for background inpainting of videos, where the goal is to remove the undesired moving object from the video. We use the same model as the one in Experiment 2 for Figure 2. Figure 9 shows two examples of removals of (a) a moving boat and (b) a walking person respectively. The videos are collected from . For each example, the first column displays 4 frames of the original video. The second column shows the corresponding frames with masks occluding the target to be removed. The third column presents the inpainting result by our algorithm. The video size is pixels frames in example (a) and pixels frames in example (b). The experiment is different from the video inpainting by interpolation. We synthesize image patches to fill in the empty regions of the video by running Langevin dynamics. We run a single Langevin chain for synthesis. As shown in Figure 9, our method successfully removes the target objects and inpaints the regions of the removed objects with reasonable backgrounds. Both appearance and motion of the inpainted video sequences are physically plausible.
Conclusion
In this paper, we propose an energy-based spatial-temporal generative ConvNet model for dynamic patterns, such as dynamic textures and action patterns. The model is in the form of deep spatial-temporal convolutional energy-based model where the energy function is defined by a bottom-up spatial-temporal ConvNet. The model corresponds to a spatial-temporal discriminative ConvNet classifier in the sense that the latter can be directly derived from the former. This property makes our model natural for modeling dynamic patterns. The learning of the model is achieved by an “analysis by synthesis” scheme: we sample the synthesized examples from the current model, usually by Markov chain Monte Carlo (MCMC), and then update the model parameters based on the difference between the observed training examples and the synthesized examples. We show that the learning algorithm can be interpreted as an alternating mode seeking and mode shifting process, as well as an adversarial minimax optimization process.
Our experiments show that the model can synthesize different types of realistic dynamic patterns, with well designed spatial-temporal ConvNet structures serving as energy functions. Besides, it is possible to learn the model from videos with occluded pixels or missing frames. This can be achieved by adopting an extra Langevin dynamics starting from the corrupted training video sequences to recover the missing information. The resulting learning, sampling, and recovery algorithm is useful for unsupervised video inpainting, which includes video recovery (e.g., recovering missing pixels of frames of a video) and background inpainting (e.g., removing undesired moving object from a video). We show that learning from incomplete training data can provide an objective criterion to evaluate generative models of dynamic patterns.
Acknowledgments
We gratefully acknowledge the support of NVIDIA Corporation with the donation of the Titan Xp GPU used for this research. The work is supported by ONR MURI N00014-16-1-2007, and DARPA ARO W911NF-16-1-0579.