---
abstract: 'Given a video and its incomplete textural description with missing words, the **Video-Fill-in-the-Blank (ViFitB)** task is to automatically find the missing word.  The contextual information of the sentences are important to infer the missing words; the visual cues are even more crucial to get a more accurate inference.  In this paper, we presents a new method which intuitively takes advantage of the structure of the sentences and employs merging LSTMs (to merge two LSTMs) to tackle the problem with embedded textural and visual cues.  In the experiments, we have demonstrated the superior performance of the proposed method on the challenging “Movie Fill-in-the-Blank” dataset [@Rohrbach2016].' 
author:
- |
    Amir Mazaheri, Dong Zhang, Mubarak Shah\
    Center for Research in Computer Vision, University of Central Florida\
    Orlando, Florida, USA\
    [mazaheri@cs.ucf.edu, dzhang@cs.ucf.edu, shah@crcv.ucf.edu]{}
title: Video Fill in the Blank with Merging LSTMs
---

Introduction and Related Work
=============================

Video-Fill-in-the-Blank (ViFitB) is a new computer vision problem. ( Figure \[fig\_example\] shows an example).  It is related to the standard Video-Question-and-Answer (ViQaA) problem, but have significant differences.  A major difference is that, for a standard VQaA problem, it has a complete sentence of the “question”, and requires the methods to output the “answer”.  In this framework, it is easier to encode the “question” in the model (e.g. Neural Networks) and then use it to predict an output.  However, in the Video-Fill-in-the-Blank (ViFitB) problem, it is much trickier to encode the “question”, since the “question” is broken into parts and is much more challenging to encode the pieces of question to find the missing word of “blank” efficiently. 

In this paper, we propose a new method to encode the sentence fragments before and after the blank using two LSTMs (Long Short Term Memory), and use these two LSTMs’ outputs to find the correct answer.  This is an intuitive way to encode the semantic and contextual information from the sentence efficiently and makes the model easier to train.  Similar to traditional Visual-Question-and-Answer (VQaA), we encode both textural and visual cues.  From the experiments we found that both cues are crucial to improve the performance. 

![ An example of the Video-Fill-in-the-Blank problem.[]{data-label="fig_example"}](example.pdf){width="2.5in"}

![ image](framework.pdf){width="5in"}

The Visual-Fill-in-the-Blank (VFitB) problem is related to Visual-Captioning (VC) problem [@Xu2015; @Venugopalan2014], for which the deep neural networks, especially Recurrent Neural Networks (e.g. LSTM: Long Short Term Memory) are intensely employed [@Yao2015; @Venugopalan2015].  It’s also highly related to the Visual-Question-and-Answer (VQaA) problem [@Antol2015; @Ren2015; @Yang2015a; @Kafle2016; @Wu2015; @Zhu2015].  For VQaA problem, usually there is a “question” with a question mark, and the answer is a word from the dictionary [@Antol2015].  The answer can be numbers, colors, objects, etc.  Some of the datasets [@Zhu2015] provide multiple choices as the candidates for the answer.  Strictly speaking, a Visual-Fill-in-the-Blank (VFitB) problem can be considered as a VQaA problem; however, this question is dramatically different from standard VQaA problems.  There are already some work for Image-Fill-in-the-Blank (ImFitB) problem [@Yu2015], however, the blanks in the dataset are usually at the end of the sentence and it is similar to sentence prediction.  Also there is a dataset for Video-Fill-in-the-Blank (ViFitB) problem [@Zhu2015a], however, the dataset was collected in a multiple choice fashion and limited number of words are available for the blank and mostly are about objects or actions.  To our knowledge, “Movie Fill-in-the-Blank” dataset [@Rohrbach2016] is the first large-scale dataset for the ViFitB problem in the wild and we show superior performance of the proposed method on the dataset. 

Method
======

The proposed method encodes the sentence with two LSTMs, and encodes the video by max-pooling over features coming out of a CNN.  An attention model [@Yang2015] helps us to leverage more spatial information from videos.  Figure \[fig\_framework\] shows an illustration of the proposed method.  Each of the words from the sentence is converted into a feature vector using the Word2Vec approach [@Mikolov2013], and then pass to LSTMs one by one.  The left part (before blank) and the right part (after blank) are fed into two different LSTMs, aiming to capture the structure of the sentence.  We use $u_L$ and $u_R$ to represent the output from the left and right LSTMs respectively, and we combine them using by $$u = tanh(W_u \times  [u_L | u_R]),$$ where $u$ is the final output, $W_u$ is a trainable parameter matrix, and “$|$” means concatenation of left and right vectors.  The output $u$ from the two LSTMs are then input into the visual attention model.  On the other hand, the video frames are processed by a pre-trained VGG19 network [@Simonyan2014] and the last pooling layer is extracted.  A max-pooling has been applied to all the frames’ features and one $14 \times 14 \times 512$ tensor is the outcome of this part as a visual feature.  Within the attention model, this visual feature and the textural feature $u$ are combined by $$h = tanh(W_{vh} \times F_v \oplus W_{uh} \times u),$$ where $h$ is output feature, $W_{vh}$ and $W_{uh}$ are trainable parameter matrices, $F_v$ is the visual feature, and “$\oplus$” means summation of the feature vector $u$ wit all $196$ vectors in $F_v$. The combined feature $h$ is then used to find attention model: $$P = softmax(W_p \times h),$$ where $W_p$ is the trainable parameter matrix.  The attention model $P$ is employed to output the weights for $196$ visual features.  Finally, the textural and weighted visual features $\tilde{v} = P \times F_v$ are combined to predict the word in the blank $$P_{blank} = softmax(W_{blank} \times (u+\tilde{v})).$$

Experiments
===========

There are two methods to train the proposed deep network: End-to-End training, and Incremental training.  For End-to-End training, we train the whole network together, and for Incremental training, we first train the sentence network (LSTMs), then combine it with the visual attention network and train them together again.  We found the Incremental training method has better performance. 

We did our experiments on the “Movie Fill-in-the-Blank” dataset [@Rohrbach2016].  We use Categorical Cross-Entropy as our loss function and ADaGrad optimizer with early stoping strategy by observing the validation loss. 

We show the performances of the proposed method with different setups, and compared it with several state-of-the-art methods.  Table \[table\_results\] shows some of the quantitative results. The “End-to-End" is our method which trains all the parameters from scratch.  However, Our “Incremental" method uses the method “Sentence" to initialize two LSTMs and the matrix $W_u$, since they are in common between both of them.  The “Left Sentence" method just uses the left part of the blank to answer the question. “ Visual LSTM" method uses just CNN features coming out of last fully connected layer of Vgg-19 and pass them through an LSTM to get the answer with out considering the question. 

  Method   Setup              Accuracy
  -------- ----------------- ----------
  LSTM     Sentence            0.280
  LSTM     Visual              0.055
  LSTM     Left Sentence       0.155
  LSTM     Video+Sentences     0.312
  Ours     End-to-End          0.317
  Ours     Incremental         0.342

  : Results on “Movie Fill-in-the-Blank” dataset. 

\[table\_results\]

Conclusion
==========

We have proposed a new method for the Video-Fill-in-the-Blank (ViFitB) problem which takes advantage of the sentence structure before and after the blank and employed two LSTMs to encode the textural information efficiently.  We have demonstrated that, by incorporating the visual cues with the spatial attention model, the performance can be further improved.  We verified our ideas on the new “Movie Fill-in-the-Blank” dataset of 2016’ Large Scale Movie Description and Understanding Challenge (LSMDC), and showed improved results compared with several baseline methods.  In experiments, we have considered the output dimension of $u$ vector as $1000$. Also the batch size in training stage is $16$. Each epoch takes about $2000$ seconds in our implementation settings. 

[10]{}=-1pt

S. Antol, A. Agrawal, J. Lu, M. Mitchell, D. Batra, C. Lawrence Zitnick, and D. Parikh.  Vqa: Visual question answering.  In [*Proceedings of the IEEE International Conference on Computer Vision*]{}, pages 2425–2433, 2015. 

K. Kafle and C. Kanan.  Answer-type prediction for visual question answering.  In [*Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition*]{}, pages 4976–4984, 2016. 

T. Mikolov, I. Sutskever, K. Chen, G. S. Corrado, and J. Dean.  Distributed representations of words and phrases and their compositionality.  In [*Advances in neural information processing systems*]{}, pages 3111–3119, 2013. 

M. Ren, R. Kiros, and R. Zemel.  Exploring models and data for image question answering.  In [*Advances in Neural Information Processing Systems*]{}, pages 2953–2961, 2015. 

A. Rohrbach, A. Torabi, T. Maharaj, M. Rohrbach, C. Pal, A. Courville, and B. Schiele?  Movie fill-in-the-blank dataset, 2016. 

K. Simonyan and A. Zisserman.  Very deep convolutional networks for large-scale image recognition. ,  2014. 

S. Venugopalan, M. Rohrbach, J. Donahue, R. Mooney, T. Darrell, and K. Saenko.  Sequence to sequence-video to text.  In [*Proceedings of the IEEE International Conference on Computer Vision*]{}, pages 4534–4542, 2015. 

S. Venugopalan, H. Xu, J. Donahue, M. Rohrbach, R. Mooney, and K. Saenko.  Translating videos to natural language using deep recurrent neural networks. ,  2014. 

Q. Wu, P. Wang, C. Shen, A. v. d. Hengel, and A. Dick.  Ask me anything: Free-form visual question answering based on knowledge from external sources. ,  2015. 

K. Xu, J. Ba, R. Kiros, K. Cho, A. Courville, R. Salakhutdinov, R. S. Zemel, and Y. Bengio.  Show, attend and tell: Neural image caption generation with visual attention. ,  2(3):5, 2015. 

Z. Yang, X. He, J. Gao, L. Deng, and A. Smola.  Stacked attention networks for image question answering. ,  2015. 

Z. Yang, X. He, J. Gao, L. Deng, and A. Smola.  Stacked attention networks for image question answering. ,  2015. 

L. Yao, A. Torabi, K. Cho, N. Ballas, C. Pal, H. Larochelle, and A. Courville.  Describing videos by exploiting temporal structure.  In [*Proceedings of the IEEE International Conference on Computer Vision*]{}, pages 4507–4515, 2015. 

L. Yu, E. Park, A. C. Berg, and T. L. Berg.  Visual madlibs: Fill in the blank image generation and question answering. ,  2015. 

L. Zhu, Z. Xu, Y. Yang, and A. G. Hauptmann.  Uncovering temporal context for video question and answering. ,  2015. 

Y. Zhu, O. Groth, M. Bernstein, and L. Fei-Fei.  Visual7w: Grounded question answering in images. ,  2015.