Obj-GloVe: Scene-Based Contextual Object Embedding

Canwen Xu, Zhenzhong Chen, Chenliang LiarXiv 2019 · arXiv

Abstract

Modern computer vision systems often treat objects in isolation, ignoring the rich contextual relationships inherent in real-world scenes. This paper introduces Obj-GloVe, a novel approach that adapts the Global Vectors for Word Representation (GloVe) algorithm to the visual domain. By transforming image bounding box annotations into sequential "sentences" of object labels, Obj-GloVe learns low-dimensional embeddings that capture semantic and implicit spatial relationships. We demonstrate that these embeddings can accurately infer missing objects in a scene and significantly enhance text-to-image synthesis, all without processing raw pixel data.

Introduction

Modern computer vision relies heavily on Deep Convolutional Neural Networks (DCNNs) to extract visual features from pixels. However, objects in the real world do not exist in isolation; they appear in predictable contexts—for instance, a computer mouse is typically found near a keyboard rather than a giraffe. While Natural Language Processing (NLP) has successfully captured such contextual relationships using embeddings like Word2Vec or GloVe, computer vision has lacked a generic, lightweight vector representation for visual objects based purely on their scene context.

The authors aim to bridge this gap with Obj-GloVe, a contextual object embedding designed to infer relationships and augment vision systems when visual features alone are insufficient due to factors like occlusion, poor lighting, or low confidence scores.

Methodology

The core innovation of Obj-GloVe is the adaptation of the GloVe algorithm to the visual domain through a two-step process:

  1. Data Pre-processing (Image to Text): The method bypasses image pixels entirely. Instead, it utilizes bounding box annotations. By calculating the center points of these boxes and scanning them horizontally from left to right, the system generates a sequence of object labels. This effectively converts a 2D image into a text-like "sentence."
  2. GloVe Embedding: The standard GloVe algorithm is applied to this corpus of image-sentences. GloVe constructs a co-occurrence matrix and employs weighted least squares regression to learn vector representations. The resulting embeddings capture the statistical probability of two objects appearing within the same scene.
The Obj-GloVe pre-processing pipeline converts spatial bounding boxes into a sequential "sentence" of object labels.

Because visual objects in datasets are explicitly disambiguated (e.g., distinguishing a "computer keyboard" from a "musical keyboard"), Obj-GloVe avoids the polysemy issues that often affect traditional word embeddings.

Experimental Setup

The embeddings were trained on the Open Images V4 dataset due to its massive scale. The authors utilized 14.6 million bounding box labels across 1.74 million images, covering 596 object classes. Additionally, the COCO dataset was used indirectly through a pre-trained AttnGAN model to evaluate text-to-image synthesis applications.

Results and Discussion

Implicit Spatial and Semantic Awareness

Despite the simplicity of horizontal scanning, the embeddings implicitly learn spatial structures. For example, human body parts cluster in a logical spatial order (leg → body → arm → hair) because photographs represent spatial slices of reality. Furthermore, Obj-GloVe vectors can be projected onto semantic axes; projecting objects onto an "Animal-Person" axis cleanly separates the two categories based solely on context. However, this also reveals dataset biases, such as gender stereotyping present in the underlying Flickr images.

Object Inference and Synthesis

To evaluate contextual understanding, the authors performed a masking task where one object label was hidden and predicted using the remaining objects. Obj-GloVe achieved an Accuracy@1 of 36.33% and an Accuracy@10 of 81.04%, outperforming random guessing by over 200 times without ever seeing image pixels.

In text-to-image synthesis, Obj-GloVe was used to "auto-complete" scene prompts for an AttnGAN. By finding nearest neighbors in the vector space (e.g., adding "pillow" and "bookcase" to a "sofa bed" prompt), the system generated significantly richer and more realistic images than the base prompt alone.

Conclusion and Future Work

While Obj-GloVe demonstrates the power of scene context, it faces limitations with rare classes due to the long-tail distribution of datasets. Additionally, the horizontal scanning method is a coarse approximation of spatial relationships. Future work involves moving toward spatial graphs and graph embedding techniques (like DeepWalk) to capture more fine-grained relationships such as "inside" or "on top of." The authors also propose applying Obj-GloVe to zero-shot classification and Visual Q&A to further integrate linguistic priors into vision models.

Summary updated

Abstract

Recently, with the prevalence of large-scale image dataset, the co-occurrence information among classes becomes rich, calling for a new way to exploit it to facilitate inference. In this paper, we propose Obj-GloVe, a generic scene-based contextual embedding for common visual objects, where we adopt the word embedding method GloVe to exploit the co-occurrence between entities. We train the embedding on pre-processed Open Images V4 dataset and provide extensive visualization and analysis by dimensionality reduction and projecting the vectors along a specific semantic axis, and showcasing the nearest neighbors of the most common objects. Furthermore, we reveal the potential applications of Obj-GloVe on object detection and text-to-image synthesis, then verify its effectiveness on these two applications respectively.
BibTeX
@misc{xu2019obj,
  author = {Canwen Xu and Zhenzhong Chen and Chenliang Li},
  title = {{Obj-GloVe: Scene-Based Contextual Object Embedding}},
  year = {2019},
  eprint = {1907.01478},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/1907.01478},
}
Figure