Summary
In this chapter, we focused on a very interesting task that involves generating captions for given images. Our learning model was a complex machine learning pipeline, which included the following:
Inferring feature vectors for a given image using a CNN
Learning word embeddings for the words found in the captions
Training an LSTM with the image feature vectors and their corresponding captions
We discussed each component in detail. First, we talked about how we can use a pretrained CNN model on a large classification dataset (that is, ImageNet) to extract good feature vectors without training a model from scratch. For this, we used a VGG with 16 layers. Next we discussed step by step how we can create TensorFlow variables, load the weights into them, and create the network. Finally, we ran a few of the test images through the model to make sure the model is actually capable of recognizing objects in the image.
Then we used the CBOW algorithm to learn good word embeddings of the words found...