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

Image Captioning with Object Detection and Localization

Zhongliang Yang, Yu-Jin Zhang, Sadaqat ur Rehman, Yongfeng Huang

Introduction

Image understanding—the ability to describe a complex scene in natural language—remains a significant challenge in computer vision. While standard "Encoder-Decoder" models have made strides, they often suffer from limitations. CNN-RNN models compress entire images into single feature vectors, losing fine-grained detail, while attention-based models frequently focus on semantically meaningless regions like empty patches of sky. This paper introduces a framework that mimics the human visual system by explicitly combining object detection with spatial localization to generate more accurate and meaningful captions.

Methods

The proposed framework utilizes a two-stage pipeline designed to anchor the model's attention to specific, semantically relevant objects.

The proposed model architecture uses Fast R-CNN for object detection and a masked VGG-16 approach for spatial localization, feeding into an LSTM decoder.

The Encoding Stage

The encoder generates "annotation vectors" through two distinct modules:

  1. Object Detection: A Faster R-CNN identifies the top-5 objects in an image. Each object is represented by a feature vector from the 'fc7' layer, capturing the object's identity.
  2. Object Localization: To capture spatial context, a masking technique is employed. For each detected object, a version of the image is created where only the object's bounding box is visible. This masked image is processed through VGG-16 to extract spatial features.
  3. Fusion: These identity and spatial vectors are concatenated, providing a comprehensive description of both "what" and "where" an object is.

The Decoding Stage

The decoder consists of a Long Short-Term Memory (LSTM) network with a "soft" attention mechanism. As the LSTM generates words, the attention mechanism calculates weights for each detected object, allowing the model to focus on specific entities (e.g., a horse or a person) at the appropriate moment in the sentence generation process.

Datasets and Evaluation

The model was evaluated on the Microsoft COCO (Common Objects in Context) dataset, which includes over 120,000 images with human-written captions. Standard splits of 5,000 images for validation and 5,000 for testing were used to ensure comparability with existing benchmarks.

Key Results

The model demonstrated significant improvements over baseline models across multiple metrics. Notably, it achieved a BLEU-4 score of 29.0, outperforming the baseline soft-attention model (24.3) and the NIC model (24.6). Furthermore, it reached a CIDEr score of 85.0, indicating high similarity to human-written consensus.

Qualitative examples demonstrating the model's ability to detect objects and generate contextually relevant captions.

The use of a VGG-16 backbone also proved computationally efficient compared to deeper architectures like GoogLeNet, while maintaining competitive performance.

Discussion and Future Work

By restricting attention to bounding boxes, the model effectively filters out background noise. The masked-image approach for spatial context allows the CNN to interpret the "silhouette" of objects, capturing nuanced relational data more effectively than raw coordinates.

However, limitations remain. The "top-5" object limit may be insufficient for highly complex scenes. Additionally, while the model captures spatial location, it does not explicitly model complex interactions or actions beyond what is learned implicitly by the LSTM. Future work may involve scaling to deeper backbones like ResNet or explicitly modeling object-to-object relationships.

Summary updated

BibTeX
@inproceedings{yang2017image,
  author = {Zhongliang Yang and Yu-Jin Zhang and Sadaqat ur Rehman and Yongfeng Huang},
  title = {{Image Captioning with Object Detection and Localization}},
  booktitle = {ICIG},
  year = {2017},
  doi = {10.1007/978-3-319-71589-6\_10},
}
Figure