Initialization Strategies of Spatio-Temporal Convolutional Neural Networks

03/25/2015 ∙ by Elman Mansimov, et al. ∙ UNIVERSITY OF TORONTO 0

We propose a new way of incorporating temporal information present in videos into Spatial Convolutional Neural Networks (ConvNets) trained on images, that avoids training Spatio-Temporal ConvNets from scratch. We describe several initializations of weights in 3D Convolutional Layers of Spatio-Temporal ConvNet using 2D Convolutional Weights learned from ImageNet. We show that it is important to initialize 3D Convolutional Weights judiciously in order to learn temporal representations of videos. We evaluate our methods on the UCF-101 dataset and demonstrate improvement over Spatial ConvNets.



There are no comments yet.


page 7

This week in AI

Get the week's most popular data science and artificial intelligence research sent straight to your inbox every Saturday.

1 Introduction

Recognizing the action performed in videos is one of the most challenging problems in computer vision. Compared to images that only contain spatial information about objects present in one shot (frame), videos represent a continuous flow of information that describes the physics of the world that we live in. In these settings, learning the underlying temporal representations of information present in videos becomes an important challenge faced in order to recognize the action.

Despite the fact that GPUs are getting faster and getting more memory every year, training Spatio-Temporal ConvNets on large scale video datasets such as Sports-1M [7] and Facebook-380K [15] from scratch is a very time consuming task, which requires nearly a month to complete training. At the same time, training Spatio-Temporal ConvNets on smaller datasets such as UCF-101 [13] and HMDB [9] leads to severe overfitting. Taking a ConvNet trained on ImageNet [11] and fine-tuning it on individual video frames solves the problem of overfitting, but gives unsatisfying solution because this model doesn’t learn temporal representations present in multiple frames.

To tackle the above challenge, we propose several ways of initializing 3D convolutional weights, which learn temporal representations of videos, using 2D convolutional weights learned from images. This dramatically speeds up training of Spatio-Temporal ConvNets and reduces overfitting on relatively small video datasets. We found that in order to learn temporal representations present in videos and get improvements in accuracy, it is important to initialize weights in 3D convolutional layers judiciously. Otherwise, the Spatio-Temporal ConvNet remains stuck at the plateau that only extracts spatial information from videos and will not get improvements in accuracy. By appropriately initializing weights and using Composite LSTM that learned representations of video sequences [14] trained on labelled examples present in UCF-101 and unlabelled examples from Sports-1M, we managed to nearly match the current best classification accuracy [17] on RGB data extracted from UCF-101 which uses many additional tricks to improve their performance.

2 Related Work

Research in action recognition was mainly driven by advancements in object recognition in images, where those approaches were extended or adapted to deal with videos. Traditional shallow approaches consisted of three main stages. Firstly, sparse spatio-temporal interest points were detected in videos and extracted using Histogram of Oriented Gradients (HOG) [1] and Histogram of Optical Flow (HOF) [2]. Recently, Wang et al. [16]

have proposed dense trajectories which became state-of-the art hand-crafted features for action recognition. Next, those features got combined into a fixed-sized vector description, such as Bag of Words (BoW) or Fisher Vectors (FV). Lastly, the standard classifier such as SVM was trained on BoW or FV represenation to distinguish among the classes of interest. This approach still has state-of-the art performance on UCF-101 and HMDB datasets.

With the larger availability of labeled image data and advancements in parallel computing, Deep ConvNets [8] overshadowed traditional approaches in extracting features of images. Motivated by those results, researchers [7] and [15] have created large scaled labelled video datasets and trained Deep Spatio-Temporal ConvNets on them, which were originally proposed by Ji et al. [6]. Even though their models had access to temporal information presented in videos, they didn’t perform better than simple Spatial ConvNet fine-tuned on image frames extracted from UCF-101 and HMDB datasets [7], [15]. Recently, Simonyan et al. [12] showed that Deep Early Fusion Spatio-Temporal ConvNet trained on dense optical flow extracted from videos significantly boosts the performance of fine-tuned spatial ConvNet trained on images. Their approach nearly matched state-of-the-art performance on UCF-101 dataset. Additionally, [17], [4], [5] recently showed that spatio-temporal pooling of Deep ConvNet features gives additional improvement in performance.

3 Transforming Features

In this section we describe several ways of transforming 2D Convolutional Weights into 3D ones, without losing the spatial information learned by training Spatial ConvNet on ImageNet. Suppose that we have a 2D Convolutional Weight Matrix derived from training a Spatial ConvNet on ImageNet. Our goal is to create a 3D Convolutional Weight Matrix with temporal dimension using those weights. Each sub-matrix , has the same dimension as the original 2D Convolutional Weight Matrix.

In a trained Spatial ConvNet, each layer expects an input from the layer below it to be within some specific range. It is important to initialize in a certain way, so that the output of the 3D Convolutional Layer remains to be approximately in the same range as the output of the originally learned 2D Convolutional Layer. In order to enforce this constraint, the sum of all sub-matrices of has to be equal to at the initialization time, i.e. .

Below we desribe four different kinds of initializations of , which we have considered.

3.1 Initialization by Averaging. (IA)

Since the consecutive image frames in videos share similarities in appearance, we would expect to extract very similar spatial representations from each consecutive image frame. Therefore, we can initialize each sub-matrix to extract the same spatial representations present in its respective input feature map. This could be accomplished by diving each element of the 2D Convolutional weight matrix by the temporal size of the convolutional layer and setting all convolutional weights across temporal dimension of to the resulting matrix. More formally, it can be expressed as:


(a) IA

(b) IS

(c) ZWI

(d) NWI
Figure 1: Example values of for each initialization

3.2 Initialization by Scaling. (IS)

This method can be viewed as a generalization to the method of initializing weights by averaging. Instead of dividing by the same number and hence making each equal to each other, we can induce some diversity by setting each to divided by some random constant. Any combination of the values of those constants could work, as long as the constraint described in section 3 is satisfied. Therefore, becomes:

, where and

3.3 Zero Weight Initialization. (ZWI)

It is natural to ask ourselves what would happen if we initialize one of to

and initialize other sub-matrices to zero matrix. Would those sub-matrices initialized with zeros be able to learn to extract meaningful representations from the input even in spite of having limited training data ? Additionally, despite some differences in values, the distribution of weights is the same in each sub-matrix of

in the above initializations. Because of that the network might get stuck at the plateau which was reached by learning spatial representation on images and as a result it might not learn the temporal representation presented in multiple frames. Motivated by these points, we explored the following initialization technique, that can be expressed as:

Note that, for any , could be initialized to , as long as all values of other sub-matrices are zero. However, in our experiments we found out that changing the order made no difference in resulting accuracy.

3.4 Negative Weight Initialization. (NWI)

We can extend the zero weight initialization by encouraging each sub-matrix , excluding the first one, to move even further from original values of . This could be accomplished by setting the values of sub-matrices , to negative signed values of divided by some constant. This woud make the absolute values of , larger compared to other initializations. Again as in ZWI, changing the order of sub-matrices doesn’t give any change in resulting accuracy. It can be expressed as following:

, where

3.5 Architecture Details.

The ConvNet with an architecture described here was trained on ImageNet ILSVRC-2012. It yielded 13.5

top-5 error on ILSVRC-2012 validation set. In this study, we did not focus on using the best ImageNet model. Rather, we chose one that was convenient and easy to work with and focused on studying the relative impact of our proposed method. When fine-tuning, we removed the softmax layer and reduced the number of units in the last fully connected hidden layer from 4096 to 2048. Otherwise, the performance of the model dropped by 6-7

. We also used an aggressive dropout of 0.8 in both FC layers. The first two convolutional layers were transformed into 3D Convolutional layers with temporal size of 3, stride of 1 and temporal size of 2, stride of 1 respectively. The 3D pooling operation between those layers was perfromed on regions with temporal size of 2. The optimization in all convolutional layers started after 500 iterations in order to preserve good features learned by the model on ImageNet. Due to the limited size of the training set, other 3D Convolutional Networks with larger number of 3D Convolutional Layers performed worse than this model.

4 Evaluation and Discussion

4.1 Dataset

The evaluation is performed on first split of UCF-101 dataset. UCF-101 contains 13.2K videos (25 frames/second) annotated into 101 classes, where each split contains 9.5K training videos.

4.2 Effect of Different Initializations.

The results of all transfer learning experiments are shown in Table 1. The results yielded many different conclusions.

First, fine-tuning 3D ConvNet initialized by averaging or scaling yielded only small marginal improvement compared to fine-tuning 2D ConvNet. For the initialization by scaling, the best results were yielded by using and for the first convolutional layer, and for the second convolutional layer. We think that since each sub-matrix across temporal dimension is initialized with similar weights which extract spatial features, the convolutional layer couldn’t move beyond this plateau.

In contrast, despite the fact that all sub-matrices of , except for one, were initialized with zero matrix, the model did surprisingly better than models initialized using averaging or scaling. This could be explained by the fact that, at the initialization time the first sub-matrix which extracts spacial representations encouraged other sub-matrices to learn to extract temporal representations. Also, compared to other IA and IS, larger differences in values between first and other sub-matrices may have helped the model to learn to extract better temporal representations from the input. This might explain why the model initialized by Negative Weight Initialization yielded the best performance among them all.

Finally, by averaging our softmax class probabilities with softmax class probabilities of Composite LSTM, we managed to nearly match the current highest accuracy of deep learning based approaches on RGB data. We think that our performance can be further increased by using different tricks described in

[17] and using SVM fusion instead of averaging. The results are summarized in Table 2.

Model Performance
Spatial ConvNet 71.8
Init. by Averaging (IA) 72.0
Init. By Scaling (IS) 72.4
Zero Weight Init. (ZWI) 73.3
Negative Weight Init. (NWI) 73.9
Table 1: Comparisons of different initialization techniques in Spatio-Temporal ConvNet with simple Spatial ConvNet.
Model Performance
Spatial ConvNet [12] 72.8
C3D [15] 72.3
C3D + fc6 [15] 76.4
LRCN [3] 71.1
Composite LSTM [14] 75.8
NWI + Composite LSTM 78.3
ConvNet Features [17] 79.0
Table 2: Comparisons with other state-of-the-art neural networks based approaches on RGB data.

4.3 Two-Stream Spatio-Temporal ConvNets

(a) Initialization by Averaging
(b) Initialization by Scaling
(c) Zero Weight Initialization
(d) Negative Weight Initialization
Figure 2: 3D Convolutional Kernels learned by the first 3D Convolutional Layer initialized by IA, IS, ZWI and NWI respectively. In Spatio-Temporal ConvNet initialized by averaging or scaling, and look very similar to . Whereas in ConvNet initialized by NWI, and look different from . Also, despite having limited labelled training video data, and look like edge and color blobs detectors in Spatio-Temporal ConvNet initialized by ZWI.

We further ran experiments and evaluated complete two-stream model on first split, which combines RGB and Optical Flow based Spatio-Temporal ConvNets. Optical Flow based ConvNet, similar to the one proposed by [12], was trained on single frame optical flow and stacks of 10 optical flows. This gave an accuracy of 72.2 and 77.5 respectively. Additionally we trained a slow fusion version of this model, with an slow fusion setup same as in [7] and this model gave an accuracy of 79.3. We then combine the softmax scores of this optical flow based slow fusion model with the softmax scores of RGB based NWI + Composite LSTM model and obtain the accuracy of 85.3 on UCF-101. Also, despite the smaller accuracy of early fusion model compared to its slow fusion version, the combination of optical flow based early fusion model with NWI + Composite LSTM gave the same accuracy of 85.3 . Esentially, despite better results of slow fusion model, it gives no additional performance improvement in final averaged scores. The comparison of our model with state-of-the-art action recognition models is summarized in Table 3.

Method Performance
LRCN [3] 82.9
Two-Stream Convolutional Net [12] (split 1) 87.0
C3D + fc6 + iDT [15] 86.7
ConvNet Features + iDT [17] 89.7
Multi-skip feature stacking [10] 89.1
Composite LSTM Model [14] (split 1) 84.3
Two-Stream Spatio-Temporal Convolutional Net (split 1) 85.3
Table 3: Comparisons of different action recognition models.

5 Conclusions

We proposed a new way of creating Spatio-Temporal ConvNets, by incorporating temporal information into Spatial ConvNet trained on images. Despite having limited labelled video training data, our model outperformed Spatio-Temporal ConvNets trained on large scale labelled video datasets. It is interesting to see, whether initializing Spatio-Temporal ConvNet with one of the initialization techniques proposed here gives an improvement in performance on large scaled labelled video datasets. However, it is very challenging for us to process the datasets of such scale.