# Unsupervised Learning of Video Representations using LSTMs

LSTM encoders learn video representations from unlabelled clips

Nitish Srivastava, Elman Mansimov, Ruslan Salakhutdinov · arXiv · 2015-2-16

- **Problem** Labelled video is costly to collect, and supervised models struggle to learn long-range structure in high-dimensional clips.
- **Method** The Composite Model sends one encoder state to two decoders, one reconstructing the input and one predicting future frames. Its encoder weights then initialize an action recognition classifier.
- **Results** Pretraining raised UCF-101 accuracy from 29.6% to 34.3% when only one labelled video per class was used.

## Why learn video features without labels

Supervised learning has produced visual features that transfer to other tasks, and video work has followed with 3D convolutional nets and different temporal fusion strategies. Video is much higher dimensional than a single image, so credit assignment over long spans gets harder unless more labelled clips or hand-built motion features are added.

The authors regard that dependence on labels and engineering as unsatisfying in the long run. Videos carry spatial and temporal regularities, which makes them a natural setting for unsupervised models that find structure without annotation.

The study asks whether an LSTM encoder-decoder trained on unlabelled clips learns a representation that supports both reconstructing and extrapolating frames. It then checks whether that representation helps action recognition, particularly when few labelled videos are available.

## What one LSTM unit computes

Each LSTM unit keeps a cell state that acts as a memory, and sigmoidal gates decide what is written, kept and read from it. The unit has an input gate, a forget gate and an output gate, each a sigmoid of a weighted combination of the current frame, the previous hidden state and the cell state.

The cell update is \\( c\_t = f\_t c\_{t-1} + i\_t \\tanh(W\_{xc} x\_t + W\_{hc} h\_{t-1} + b\_c) \\), so the old memory is scaled by the forget gate and new content is added through the input gate. The hidden output is \\( h\_t = o\_t \\tanh(c\_t) \\), where \\( o\_t \\) is the output gate.

The weights from each cell to its own gates are diagonal, which the authors call peephole connections, so each gate sees only the state of its own cell. Because the cell state accumulates activity over time, error derivatives do not vanish quickly when sent back through time, and the models are trained with full backpropagation through time.

## Encoding a clip and reconstructing it

The LSTM Autoencoder Model has an encoder LSTM that reads the frames and a decoder LSTM that starts after the last frame has been read. The decoder is trained to output the input frames in reverse order, which the authors argue makes optimization easier because the model can first exploit short-range correlations.

The authors compare the encoder to building a list by repeatedly adding each new input to the front of the previous one, and the decoder to reading that list back out from the front. The decoder may be conditional, receiving the last generated frame as an extra input, or unconditioned.

The state must hold appearance and motion, because the decoder has to rebuild the input from it. Copying the input is discouraged by the fixed number of hidden units and by reapplying the same recurrent dynamics at every decoding step, which stops the model from learning a trivial identity mapping.

## Predicting frames that follow the input

The LSTM Future Predictor Model uses the same encoder, but its decoder produces frames that come after the observed input. Ranzato et al. (2014) predicted only the next frame at each step, whereas this model predicts a long sequence into the future.

A conditional decoder can represent several plausible futures, which an unconditioned decoder would average into one blurred prediction, but this only matters when the target distribution has several modes. An unconditioned decoder also avoids a training shortcut, since strong short-range correlations in video would otherwise make the decoder rely on the last frames and learn little from long-term structure.

## Combining reconstruction and prediction

The Composite Model sends one encoder state to two decoders, one that reconstructs the input and one that predicts future frames, so the state has to support both tasks. Each of the two decoders can be conditional or unconditioned, and the composite design can be built with a conditional future predictor.

Each single model has a weakness that the other covers. An autoencoder can learn to memorize inputs in a way that does not help prediction, while a future predictor tends to keep only the last few frames, since those matter most for the next step. Asking the state to also reconstruct the whole input keeps earlier frames in the representation.

## Training data and input percepts

UCF-101 has 13,320 videos in 101 action categories, and HMDB-51 has 5100 videos in 51 categories; both come with three standard train/test splits.

Unsupervised pretraining used 300 hours of YouTube video, cut as random 10 second clips from a subset of Sports-1M rather than selected for motion. The authors chose random sampling to avoid an unnatural bias, and adding UCF-101 and HMDB-51 to the pretraining data gave no clear gain over the YouTube videos alone.

Frames of 240 × 320 video at almost 30 frames per second were cropped to the central 224 × 224 patch and passed through a convnet to produce RGB percepts. For UCF-101, flow percepts were also computed with the Brox method and a temporal stream network, and the 4096-dimensional fc6 layer was used because it beat fc7 on single-frame classification.

Models were also trained directly on 32 × 32 pixel patches.

A two-layer Composite Model with 2048 units per layer, predicting 13 frames and reconstructing 16, took 18-20 hours on a single NVIDIA Titan GPU to converge on the 300 hours of percepts. The supervised classifiers trained on 16 frames took 5-15 minutes to converge.

## Reconstruction and prediction on moving digits

The moving-digit videos are 20 frames long, with two digits moving inside a 64 × 64 frame and bouncing off the walls. The authors chose this data because it can be generated on the fly, which removes disk access and overfitting from the picture, and because occlusion and wall bouncing give interesting dynamics.

A one-layer Composite Model with 2048 units per LSTM took 10 frames, reconstructed them and predicted the next 10, using logistic output units with cross entropy loss.

The authors observe that the model separates overlapping digits and keeps modeling them as they pass through each other, which they read as some evidence of disentangling the factors of variation. A second layer improved the predictions, and making the future predictor conditional produced sharper predictions, according to the authors' reading of the examples.

## Natural image patches

A two-layer model with 2048 units gave reconstructions and predictions that were both very blurry. A bigger model with 4096 units gave much sharper reconstructions, and the paper reports this comparison only visually; Table 2 has no squared loss entry for the 4096-unit model.

## Running past the training horizon

The activity pattern in the future predictor kept a periodic quality over those 100 steps, so the model continued generating persistent motion. Reconstruction only produced blobs after the first 15 frames, although the motion was relatively well preserved.

A randomly initialized future predictor converged to a fixed state and its outputs blurred completely, which the authors use to show that a periodic pattern does not come for free from the architecture.

## Digit counts unseen in training

The model was trained on sequences of two moving digits and then tested on sequences with one digit and with three digits. With one digit it did well, but it tended to hallucinate a second digit overlapping the first, and that digit appeared towards the end of the future prediction. With three digits the model merged the digits into blobs while still getting the overall motion roughly right.

The authors read this as a drawback of modeling whole frames in a single pass, and they suggest attention and variable amounts of computation for scenes with a variable number of objects.

## What the learned weights look like

Each input frame connects to the encoder with weights of size 64 × 64, in four sets: one to the input units and one to each of the three gates. Many input features are thin strips, and others are higher frequency strips, which the authors consider a possible means of encoding direction and velocity.

The output features from the two decoders are more often local blobs, and the strips in them are shorter than in the input features. The authors interpret the input strips as precise location and velocity information, and the output blobs as a hedge against sharp predictions in the wrong place.

Figures in the source list the top-200 features ordered by L2 norm for both the input and the output weights.

## Setting up the action classifier

The classifier starts from a two-layer Composite Model with 2048 units and no conditioning on either decoder, trained on percepts from 300 hours of YouTube, and its encoder LSTM weights initialize an LSTM classifier. A softmax on each second-layer LSTM output predicts the action at every time step, and the target is the same across time because each video contains one action.

At test time the per-step predictions are averaged, and video-level predictions average over 16 frame blocks taken with a stride of 8 frames. A smaller stride did not improve results.

The baseline is the same classifier with randomly initialized weights, and all classifiers use dropout between layers but not through time, following Zaremba et al. (2014). The authors call this a very strong baseline and say dropout was crucial for training good baselines with very few training examples.

## Action recognition results

On UCF-101 RGB, the single frame classifier reached 72.2, the LSTM classifier 74.5, and the Composite Model with fine-tuning 75.8. On HMDB-51 RGB, Table 1 gives 40.1, 42.8 and 44.1 for the same three rows, while the text reports 44.0 for the pretrained model on the full dataset.

The gain is largest with few labels: on UCF-101 with one labelled video per class, accuracy rises from 29.6% to 34.3%. On HMDB-51 with one video per class, accuracy rises from 14.4% to 19.1%.

On the full UCF-101 set the gain is smaller, from 74.5% to 75.8%, and on the full HMDB-51 set it is from 42.8% to 44.0% with 70 videos per class. The authors say the improvement is not as large as they expected, but it still adds to a strong baseline.

For optical flow percepts on UCF-101, single frame flow reached 72.2 and stacks of 10 flows reached 77.5. An LSTM with 128 hidden units raised single frame flow to 74.3, and pretraining raised it further to 74.9 (±0.1). Bigger LSTMs did not improve results, and for stacks of 10 frames the pretrained model reached 77.7.

## Which unsupervised variant helps most

On moving MNIST, the cross entropy of the Future Predictor is 350.2, the Composite Model 344.9, the conditional future predictor 343.5, and the composite with a conditional future predictor 341.2. Lower cross entropy is better, so the composite with a conditional future predictor has the lowest value in this comparison.

On natural image patches, the squared loss values are 225.2, 210.7, 221.3 and 208.1 in the same model order, again with the composite model ahead of the Future Predictor. The authors read the composite advantage as evidence that the autoencoder term keeps input detail that prediction needs.

On the supervised tasks, Table 3 gives the baseline LSTM 63.7 on UCF-101 small (10 videos per class) and 74.5 on the full set, and 25.3 on HMDB-51 small (4 videos per class) and 42.8 on the full set. The Autoencoder reaches 66.2, 75.1, 28.6 and 44.0 in those four columns, and the Composite Model reaches 67.0, 75.8, 29.1 and 44.1. Every unsupervised model in Table 3 scores above the baseline LSTM in all four columns.

The Autoencoder performs more consistently than the Future Predictor, and the Composite Model does better than either alone. Conditioning on generated inputs gave no clear advantage, and the composite with conditional future predictor was best but almost level with the composite.

## Comparison with published benchmarks

Table 4 lists the Composite LSTM Model at 75.8 on UCF-101 and 44.0 on HMDB-51, beside the spatial convolutional net at 73.0 and 40.5, C3D at 72.3, and LRCN at 71.1. These published numbers come from the cited works and were not rerun by the authors under the same conditions.

The authors note that when C3D features are concatenated with fc6 percepts they do slightly better than their model, and Table 4 gives 76.4 for that entry.

Flow gains over a randomly initialized LSTM are small, which the authors partly attribute to flow percepts already capturing much of the motion. Combining predictions from the RGB and flow models gives 84.3 accuracy on UCF-101, which sits below the two-stream entry at 88.0 and the multi-skip feature stacking entry at 89.1 in Table 4.

## Limitations

Input reconstruction error cannot rank models, because copying the input always lowers it, so the authors judge models by future prediction and by supervised accuracy.

Out-of-domain digit counts lead to hallucinated or merged objects, and the authors suggest attention and variable computation as ways to address this. The Composite Model keeps motion going over long horizons, but it loses precise object features quickly after the training time scale.

The authors list untested options: running over different patch locations, mirroring patches, and applying the model deeper inside a convnet. Evaluation covers only UCF-101 and HMDB-51 for supervised tasks, and flow pretraining gives only a small gain over a randomly initialized LSTM.

## Paper info

- **Authors**: Nitish Srivastava, Elman Mansimov, Ruslan Salakhutdinov
- **Venue**: arXiv · Preprint
- **First published**: 2015-2-16
- **Added**: 2026-11-12
- **Updated**: 2016-1-4
- **Version**: v3
- **arXiv**: 1502.04681
- **Category**: cs.LG · cs.CV · cs.NE
- **Original paper terms**: [arXiv non-exclusive 1.0](https://arxiv.org/licenses/nonexclusive-distrib/1.0/)
- **What we show**: Paper info and commentary

[Original paper ↗](https://arxiv.org/abs/1502.04681v3) · [PDF ↗](https://arxiv.org/pdf/1502.04681v3)

AI commentary is a separate explanation from the original paper and may contain errors. The original paper and figures follow each source's terms of use and any rights noted separately.

## Quote from the paper

Nitish Srivastava, Elman Mansimov, Ruslan Salakhutdinov (2015). Unsupervised Learning of Video Representations using LSTMs. arXiv:1502.04681v3. https://arxiv.org/abs/1502.04681v3

**BibTeX**

```
@misc{srivastava2015unsupervised,
  title = {{Unsupervised Learning of Video Representations using LSTMs}},
  author = {Nitish Srivastava and Elman Mansimov and Ruslan Salakhutdinov},
  year = {2015},
  eprint = {1502.04681},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/1502.04681v3}
}
```

## Other paper commentary

- [Expressive Body Capture: 3D Hands, Face, and Body from a Single Image](https://refivu.com/en/papers/13b094cd-136a-43d9-a552-fafa9aa19691-expressive-body-capture-3d-hands-face-and-body.md)
- [WIDER FACE: A Face Detection Benchmark](https://refivu.com/en/papers/f25dbb8a-9814-427e-8059-2cad94728cee-wider-face-a-face-detection-benchmark.md)
- [End-to-end Recovery of Human Shape and Pose](https://refivu.com/en/papers/da029864-5c93-4c98-a8b5-99aa97d36118-end-to-end-recovery-of-human-shape-and.md)
- [Vision Mamba: Efficient Visual Representation Learning with Bidirectional State Space Model](https://refivu.com/en/papers/178fce5e-d4f5-44ae-8265-df3fb75ee87b-vision-mamba-efficient-visual-representation-learning-with.md)
- [Semantic Understanding of Scenes through the ADE20K Dataset](https://refivu.com/en/papers/3862d7db-bf28-4590-ab09-839bcbf7ccaa-semantic-understanding-of-scenes-through-the-ade20k-dataset.md)
- [Prompt-to-Prompt Image Editing with Cross Attention Control](https://refivu.com/en/papers/a18cb3bd-2a1b-4adf-9a2a-f866c7f83edf-prompt-to-prompt-image-editing-with-cross-attention.md)
- [Curiosity-driven Exploration by Self-supervised Prediction](https://refivu.com/en/papers/93936438-d2c7-4a12-b814-3073185546ca-curiosity-driven-exploration-by-self-supervised-prediction.md)
- [FFA-Net: Feature Fusion Attention Network for Single Image Dehazing](https://refivu.com/en/papers/05326df3-34c3-4503-97d2-d46822e1fbfa-ffa-net-feature-fusion-attention-network-for-single.md)
- [Adversarial Examples: Attacks and Defenses for Deep Learning](https://refivu.com/en/papers/757e3533-c849-4349-8fbc-e8ea84c0b042-adversarial-examples-attacks-and-defenses-for-deep-learning.md)
- [SpanBERT: Improving Pre-training by Representing and Predicting Spans](https://refivu.com/en/papers/11f04ed9-a517-4d5d-a835-58a3e13f7118-spanbert-improving-pre-training-by-representing-and.md)
- [AutoPrompt: Eliciting Knowledge from Language Models with Automatically Generated Prompts](https://refivu.com/en/papers/e3fa3b73-5b1d-4ff0-8f81-98fad2340fa5-autoprompt-eliciting-knowledge-from-language-models-with.md)
- [Session-based Recommendation with Graph Neural Networks](https://refivu.com/en/papers/62d7225d-cbaa-40dd-937a-e1fda19d331d-session-based-recommendation-with-graph-neural-networks.md)

## Terms in this paper

- [Accuracy](https://refivu.com/en/terms/1995c0cd6282-accuracy)
- [LSTM](https://refivu.com/en/terms/ba10547646d9-lstm)
- [cross entropy loss](https://refivu.com/en/terms/b16f172737ac-cross-entropy-loss)
- [backpropagation through time](https://refivu.com/en/terms/46e13bff8275-backpropagation-through-time)
- [C3D](https://refivu.com/en/terms/b5d0d61f0554-c3d)
- [Sports-1M](https://refivu.com/en/terms/8252abb599c4-sports-1m)
- [dropout regularization](https://refivu.com/en/terms/6e95c9111eca-dropout-regularization)
- [HMDB-51](https://refivu.com/en/terms/9fda92137fdc-hmdb-51)
- [LRCN](https://refivu.com/en/terms/911e4c2b1c42-lrcn)
- [UCF-101](https://refivu.com/en/terms/30291e1672c6-ucf-101)
- [Long Short Term Memory](https://refivu.com/en/terms/175b1f813da8-long-short-term-memory)
- [peephole connections](https://refivu.com/en/terms/ab7eba3fdb49-peephole-connections)
- [squared error loss](https://refivu.com/en/terms/84e1e32d5ea9-squared-error-loss)

---

AI-written text can contain mistakes. [Refivu](https://refivu.com/en/papers/a715f01b-843f-4405-90d9-dbb255bc47c5-unsupervised-learning-of-video-representations-using-lstms)
