NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

Automatic Image Annotation Model Using LSTM Approach

Sonu Pratap Singh Gurjar, Shivam Gupta, Rajeev Srivastava

Abstract

In this digital world, artificial intelligence has provided solutions to many problems, likewise to encounter problems related to digital images and operations related to the extensive set of images. We should learn how to analyze an image, and for that, we need feature extraction of the content of that image. Image description methods involve natural language processing and concepts of computer vision. The purpose of this work is to provide an efficient and accurate image description of an unknown image by using deep learning methods. We propose a novel generative robust model that trains a Deep Neural Network to learn about image features after extracting information about the content of images, for that we used the novel combination of CNN and LSTM. We trained our model on MSCOCO dataset, which provides set of annotations for a particular image, and after the model is fully automated, we tested it by providing raw images. And also several experiments are performed to check efficiency and robustness of the system, for that we have calculated BLEU Score.

Introduction

While humans can effortlessly describe a scene, teaching a computer to do the same is a monumental challenge. It requires the system to not only identify objects (computer vision) but also understand their spatial relationships and actions, and then express that understanding in a grammatically correct, concise sentence (natural language processing).

Earlier attempts at "automatic image annotation" often relied on a similarity approach, which essentially treated the problem as a retrieval task—finding the most similar image in a database and "borrowing" its caption. However, these models fail when encountering unseen objects or unique scenes. This paper tackles the need for a constructive approach: a model that can generate brand-new sentences from scratch based on the specific features of a query image.

The constructive approach: transforming an input image into a descriptive sentence through object and attribute representation.

Methodology

The authors propose a hybrid architecture that functions as an encoder-decoder system, bridging the gap between low-level pixel data and high-level semantic understanding.

Feature Extraction (The "Eyes")

A robust Convolutional Neural Network (CNN) is used to analyze the input image. It extracts a hierarchy of features ranging from low-level (pixels, edges, and corners) and mid-level (curves and basic shapes) to high-level features (object detection and scene context).

Language Modeling and Generation (The "Voice")

The extracted feature vectors are passed to a Long Short-Term Memory (LSTM) network. LSTMs are a type of Recurrent Neural Network (RNN) specifically designed to handle sequences and long-term dependencies. By feeding CNN-extracted features directly into the LSTM's memory cells, the model maintains a "track" of the image context throughout the sentence generation process.

The high-level architecture combining a CNN model for feature extraction with an LSTM for sequence generation.

The model uses an n-gram approach to predict the next word in a sequence based on the image features and the words already generated. It starts with a "start" token and continues until it hits an "end" token. The system was implemented using the Keras library with a Theano backend and optimized using stochastic gradient descent.

Datasets and Evaluation

The model was trained and evaluated on several benchmark datasets:

  • MSCOCO: The primary dataset, containing approximately 80,000 images, each with at least five different human-generated captions.
  • Flickr30k & Flickr8k: Used to further validate the model's robustness across different types of imagery (sports, landscapes, portraits, etc.).

For the final evaluation, the authors used a testing phase consisting of 5,000 images from the MSCOCO set.

Key Results

The primary metric used for evaluation was the BLEU-4 score, which measures the correspondence between a machine's output and that of a human.

Model BLEU-4 Score
Our Model 20.84
Human Baseline 20.51
Karpathy (Previous SOTA) 20.4
CNN & RNN (Standard) 19.5
Nearest Neighbor (Retrieval) 9.9

Remarkably, the model's BLEU-4 score of 20.84 slightly exceeded the human baseline provided in the comparison table, suggesting a high degree of accuracy and relevance. Qualitative results showed the model could take a complex image and produce a coherent description, such as: "A woman sitting on a bench with a dog." (Note: While the gender was misidentified in this specific instance, the scene structure and object relationships were correct).

Conclusion and Future Work

While the model is robust, several areas for improvement remain. Future iterations could incorporate faster machine learning algorithms to reduce inference time and fine-tune the CNN feature extraction specifically for the captioning task. Additionally, testing on larger, more diverse datasets is necessary to ensure generalization to real-world imagery and to improve semantic accuracy regarding specific object attributes like gender.

Summary updated

BibTeX
@inproceedings{gurjar2017automatic,
  author = {Sonu Pratap Singh Gurjar and Shivam Gupta and Rajeev Srivastava},
  title = {{Automatic Image Annotation Model Using LSTM Approach}},
  booktitle = {Signal},
  year = {2017},
  doi = {10.5121/sipij.2017.8403},
}
Figure