Sentence generation

19
Every Picture Tells a Story: Generating Sentences from Images Ali Farhadi, Mohsen Hejrati , Mohammad Amin Sadeghi, Peter Young, Cyrus Rashtchian, Julia Hockenmaier, David Forsyth Proceedings of ECCV-2010

Transcript of Sentence generation

Page 1: Sentence generation

Every Picture Tells a Story: Generating Sentences from Images

Ali Farhadi, Mohsen Hejrati , Mohammad Amin Sadeghi, Peter Young, Cyrus Rashtchian, Julia Hockenmaier, David Forsyth

Proceedings of ECCV-2010

Page 2: Sentence generation

Motivation

Demonstrating how good automatic methods can correlate a description to a given image or obtain images that illustrate a given sentence.

Auto-annotation

Page 3: Sentence generation

Motivation

Demonstrating how good automatic methods can correlate a description to a given image or obtain images that illustrate a given sentence.

Auto-illustration

Page 4: Sentence generation

Contributions

Proposes a system to compute score linking of an image to a sentence and vice versa.

Evaluates their methodology on a novel dataset consisting of human-annotated images. (PASCAL Sentence Dataset)

Quantitative evaluation on the quality of the predictions.

Page 5: Sentence generation

Overview

Page 6: Sentence generation

The ApproachMapping Image to Meaning

Predicting the triplet of an image involves solving a small multi-label Markov random field.

23

16

29

Page 7: Sentence generation

The Approach

Node potentials: Computed as a linear combination of scores from several detectors and classifiers. (feature functions)

Edge potentials: Edge potentials are estimated by the frequencies of the node labels.

Page 8: Sentence generation

The ApproachImage Space

To provide information about the nodes on the MRF we first need to construct image features:Node Features:

• Felzenszwalb et al. detector responses• Hoiem et al. classification responses• Gist-based scene classification responses

Feature Functions: Node features, Similarity Features

Page 9: Sentence generation

The ApproachImage Space

• Average of the node features over KNN neighbors in the training set to the test image by matching image features:

• Average of the node features over KNN neighbors in the training set to the test image by matching those node features derived from classifiers and detectors:

Similarity Features

Page 10: Sentence generation

The ApproachEdge Potentials

Four estimates for edges from node A to node B• The normalized frequency of the word A in our corpus, f(A).• The normalized frequency of the word B in our corpus, f(B).• The normalized frequency of (A and B) at the same time, f(A, B).• f(A,B)/(f(A)f(B))

Linear combination of multiple estimates for the edge potentials:

Page 11: Sentence generation

The Approach

Sentence Space

Extract triplets from sentencesUse Lin Similarity to determine Semantic distance between two words.Determine actions commonly co-occurring Compute sentence node potentials from these measures.

Page 12: Sentence generation

Learning and Inference1. Learning to predict triplets for images is done

discriminatively using a dataset of images labeled with their meaning triplets.

2. The potentials are computed as linear combinations of feature functions.

3. This makes the learning problem as searching for the best set of weights on the linear combination of feature functions so that the ground truth triplets score higher than any other triplet.

4. Inference involves finding argmaxywTφ(x, y) where φ is the potential function, y is the triplet label, and w are the learned weights.

Page 13: Sentence generation

Evaluation

Dataset

Experimental Settings

600 training images and 400 testing images.50 closest triplets for matching

PASCAL Sentence Dataset: Pascal 2008 development kit. 50 images from 20 categoriesAmazon’s Mechanical Turk generate 5 captions for each image.

Page 14: Sentence generation

Evaluation

Scoring a match between images and sentences is done by ranking them in opposite spaces and summing over them weighed by inverse rank of the triplets.

Distributional Semantics Usage:Text Information and Similarity measure is used to take care of out of vocabulary words that occurs in sentences but are not being learnt by a detector/classifier.

Page 15: Sentence generation

EvaluationQuantitative Measures

Tree-F1 measure: A measure that reflects two important interacting components, accuracy and specificity.

Precision is defined as the total number of edges on the path that matches the edges on the ground truth path divided by the total number of edges on the ground truth path.

Recall is the total number of edges on the predicted path which is in the ground truth path divided by the total number of edges in the path.BLUE Measure: A measure to check if the triplet we generate is logically valid or not. For e.g., (bottle, walk, street) is not valid. For that, we check if the triplet ever appeared in our corpus or not.

Page 16: Sentence generation

ResultsAuto -Annotation

Page 17: Sentence generation

ResultsAuto -Illustration

Page 18: Sentence generation

ResultsExamples of Failures

Page 19: Sentence generation

Discussion

•Sentences are not really generated from the image, but searched from a pool of user-annotated-descriptions.

• The intermediate meaning space in the model helps in approaching the two-way problem as well as is benefitted by the distributional semantics.

•The way to output a score and quantitatively evaluate the co-relation of description and images seems interesting.