What is image captioning?
Image captioning is the task of automatically describing the content of an image in a natural language sentence; it connects computer vision with natural language processing.
Unlike visual question answering, which finds a specific piece of information the user asks for, captioning describes the image in general without any question.
- Topic
- Machine learning, models and training
- Also known as
- Image description, automatic caption generation
- Origin
- End-to-end caption generation with deep learning, 2014
How image captioning works
- A convolutional network, usually pre-trained for image classification, turns the image into a numerical representation.
- A language-generating decoder starts from that representation and produces the sentence word by word, following the encoder-decoder recipe of machine translation.
- An attention mechanism lets the model focus on relevant regions of the image as it generates each word.
- The model is trained to maximise the likelihood of the target description sentence given the training image.
In more detail
Captioning with attention
The attention-based captioning model proposed in 2015 does not compress the whole image into one static representation; it brings relevant regions forward as each word is generated. The model learns by itself to fix its gaze on salient objects while generating the corresponding words, which also makes it possible to visualise which image region each word relies on.
Commonly confused terms
| Term | How it differs |
|---|---|
| Image classification | Image classification gives an image labels from predefined classes. Image captioning describes the content in a free-form sentence and can also express relationships between objects. |
Why image captioning matters for on-premises AI
The COCO Caption dataset set out to provide over one and a half million captions describing over 330,000 images, with five independent human-written captions for each training and validation image. Generated captions are scored with metrics such as BLEU, METEOR, ROUGE and CIDEr; CIDEr was designed to measure how well a sentence matches human consensus. Organisations use captioning to make visual archives searchable by text and to draft descriptions for images.
A news agency generates draft captions for the images in its photo archive. Editors check and correct the drafts; approved captions make the archive searchable by text and shorten the time needed to tag new images.
Common questions
What is the difference between image captioning and visual question answering?
Captioning describes an image in a general sentence without a question. Visual question answering answers a specific question asked by the user.
How is caption quality measured?
The generated sentence is compared with several reference captions written by people for the same image. Automatic metrics such as BLEU, METEOR, ROUGE and CIDEr are used; CIDEr was designed to measure agreement with human consensus.
Do captioning models make mistakes?
Yes. A model can describe a detail that is not in the image or miss an important object, so captions intended for publication should be reviewed by people.
Related terms
- Vision-language model
- Computer vision
- Encoder-decoder architecture
- Attention mechanism
- Visual question answering
Sources
- Show and Tell: A Neural Image Caption Generator, arXiv, 2014
- Show, Attend and Tell: Neural Image Caption Generation with Visual Attention, arXiv, 2015
- Microsoft COCO Captions: Data Collection and Evaluation Server, arXiv, 2015
- CIDEr: Consensus-based Image Description Evaluation, arXiv, 2014
In the glossary: Glossary, E to L