
Source: AIML.com Research
Introduction
Image Captioning is a method generating descriptive text of a given image. At its core, image captioning is a multi-modal translation task: it requires a system to translate grids of pixels into a structured sequence of linguistic tokens. This process bridges the “Semantic Gap”, the distance between raw machine-readable data (RGB values) and human-level concepts (actions, relationships, and context). Different from object recognition of defining images, image captioning focuses on telling the story. A good image caption should understand how items interact and describe what’s happening in the image. Naturally, a robust model for image captioning should combine the toolkits of both Computer Vision (CV) and Natural Language Processing (NLP). In this article, we will discuss some related models, and applications of image captioning.
Classic Encoder-Decoder Pipeline
The most common solution to the image captioning problem is inspired by machine translation. This framework, known as the Encoder-Decoder model, maps an input image to an intermediate representation before converting it into a sequence of words.
The Encoder (Vision): Convolutional Neural Networks (CNNs) like ResNet or VGGNet are frequently used to detect objects and extract feature vectors from the last convolutional layers. These vectors provide a rich representation of the image’s contents. In the context of our flowchart, the encoder compresses the raw pixels of the golden retriever and the flying disc into a compact mathematical summary.
The Decoder (Language): Recurrent Neural Networks (RNNs), and specifically Long Short-Term Memory (LSTM) networks, are the standard for the decoding stage. LSTMs are preferred because they can capture long-term temporal dependencies and store important information throughout a sequence using an internal “gate” mechanism. This allows the model to take that visual summary and generate the coherent sentence “A golden retriever catching a frisbee” word by word, ensuring that “catching” logically follows “retriever.”

Source: AIML.com Research
Attention-based methods
While the standard Encoder-Decoder model was a major step forward, it had a significant flaw known as the information bottleneck. By forcing the model to compress an entire complex image into a single, fixed summary, fine details were often lost before the model even started writing the caption.
To fix this, researchers looked at human biology. As noted in recent reviews, attention mechanisms are designed to mimic how the human eye works. When we look at a scene, we don’t process every pixel at once with equal focus. Instead, we scan the image, focusing on the most interesting (“salient”) features one by one.
How It Works:
Technically, this adds a context vector (often labeled c) to the decoder. You can think of this as a dynamic spotlight. Instead of relying on a static memory of the image, the model uses this vector to “look back” at specific parts of the image relevant to the exact word it is currently writing.
There are two main ways to control this spotlight:
- Soft Attention: The model looks at the entire image but assigns “weights” to different parts. When writing the word “ball,” it highlights the pixels containing the ball and dims the rest. Since this is a smooth, mathematical process, it is easier to train.
- Hard Attention: The model makes a hard choice to look at only one specific spot at a time. While this is more similar to how our eyes actually jump between objects, it is harder to train because the decision is binary (look here vs. don’t look here).
The Next Step: “Up-Down” Attention: A more advanced version, called the Bottom-Up and Top-Down approach, changed how models “see” entirely.
- Bottom-Up: Instead of looking at a grid of raw pixels, an object detector (like Faster R-CNN) first identifies specific objects (e.g., finding a “dog,” a “frisbee,” and “grass.”)
- Top-Down: The language model then focuses on these specific objects rather than random patches of the image.
This shift allowed models to stop describing “clusters of yellow pixels” and start describing “a golden retriever,” drastically improving accuracy.

Source: Ghandi et al. , Xu et al.
The Transformers
In recent years, Transformers have replaced LSTMs as the industry standard. The main reason is how they process information.
LSTM-style models process data sequentially, like reading a sentence through a straw. If the “retriever” is at the start of the image and the “frisbee” is at the end, the model often struggles to connect them.
Transformers, on the other hand, come out as a better way than LSTM models. Using Self-Attention, Transformers process the entire image at once. In our example, the model doesn’t see a dog and then separately sees a frisbee; it sees them interacting simultaneously. This allows it to instantly understand the relationship that the dog is in the act of catching.
Advanced models like CLIP and BLIP take this further. By training on billions of internet images, they learn to describe objects they haven’t explicitly studied. Even if the model wasn’t trained on your specific dataset, it already knows what a “Frisbee” looks like because it has seen it online.
Refined Optimization
How we train these models is just as important as the architecture itself. Traditionally, models were graded like a strict vocabulary test using Cross-Entropy Loss. If the correct answer was “A Golden Retriever catches a frisbee,” and the model wrote “A dog catches a frisbee,” it would be penalized. This discouraged the model from being descriptive or using synonyms, forcing it to memorize specific labels rather than understanding the scene.
To fix this, researchers introduced Reinforcement Learning techniques, specifically Self-Critical Sequence Training (SCST), which fundamentally changed the objective. Instead of correcting every single word, the model writes a full sentence and is graded on the overall meaning using metrics like CIDEr. This evolution has pushed even further into unsupervised methods and Generative Adversarial Networks (GANs) to reduce reliance on perfectly paired data. In these advanced setups, a “Discriminator” network acts like a critic, judging whether a generated caption sounds human or machine-made, while “Concept Rewards” verify that objects detected in the image, like the frisbee or the grass, actually appear in the text. Consequently, if the model writes “A happy pup grabs a flying disc,” the system recognizes the sentence is both human-like and factually accurate, rewarding the AI. This shift encourages captions that are diverse and descriptive, rather than rigid and repetitive.

Source: Ghandi et al.
Real-World Applications
Image captioning transforms how machines understand the world, turning raw pixels into actionable language.
Its most important application is digital accessibility, where it narrates images for the visually impaired, converting a photo of a golden retriever into a spoken description for screen readers. To this extent, it can also benefit the visual impairment community. By translating the image, they can perceive the world by descriptive text. This “translation” capability also solves the problem of discoverability. Since search engines cannot naturally “see,” captioning provides the text metadata needed to make millions of unlabelled images searchable.
In industry, E-commerce platforms use it to instantly generate detailed product descriptions, while medical systems analyze X-rays to draft preliminary diagnostic reports for radiologists. Additionally, captioning serves as a high-speed safety tool in content moderation, converting visual content into text to rapidly flag harmful material across social media platforms.
Videos Explanations
- This video “13 Image Captioning – Computer Vision – Winter Term 21/22 – Freie Universität Berlin” explains the principal and models of image captioning in detail in lecture-style, including evaluation metric explained. Good for gaining a deeper understanding of image captioning (Runtime: 30 mins)
- This video “Pytorch Image Captioning Tutorial” detailedly explores classic encoder-decoder pipelines and how to build one from scratch. (Runtime: 35 mins).
Reference
- A Review on Automatic Image Caption Generation for Various Deep Learning Approaches
- Show, Attend and Tell: Neural Image Caption Generation with Visual Attention

