Detecting out-of-context objects using contextual cues

Manoj Acharya, Anirban Roy, Kaushik Koneripalli, Susmit Jha, Christopher Kanan, Ajay DivakaranarXiv 2022

Abstract

Traditional object detection models often struggle when objects appear in unusual settings. This paper introduces the Graph Contextual Reasoning Network (GCRN), a framework designed to identify "out-of-context" (OOC) objects by explicitly modeling relationships between objects in a scene. By comparing visual appearance against contextual expectations, GCRN effectively flags anomalies that standard detectors miss.

Introduction

Most computer vision models are trained on "natural" datasets where objects appear in predictable settings, such as cars on roads or chairs in kitchens. However, when these models encounter an object in an unusual context—like an elephant in a living room—their performance often degrades. Detecting OOC objects is challenging because the objects themselves appear normal in isolation; the anomaly lies entirely in their relationship to the environment.

An input image of an elephant in a living room alongside its graph representation.

Addressing this "elephant in the room" is critical for the safety and reliability of autonomous systems and medical AI, which must recognize when a scenario deviates from expected norms.

Methodology: Graph Contextual Reasoning Network (GCRN)

The GCRN treats an image as a graph where detected objects are nodes and their relationships are edges. The architecture employs two distinct graph convolutional networks (GCNs):

  1. Representation Graph (RepG): Learns to identify objects based on their visual features and those of their neighbors.
  2. Context Graph (ConG): Explicitly captures contextual rules, including co-occurrence, relative size, and typical spatial positioning.
The GCRN architecture comparing visual predictions with contextual expectations to identify OOC objects.

The system identifies OOC objects by comparing the object's context-agnostic visual appearance with the ConG's prediction of what should be in that location. A high KL Divergence between these two predictions indicates a mismatch, flagging the object as out-of-context.

Datasets and Evaluation

To evaluate OOC detection, the authors developed two benchmarks:

  • COCO-OOC: A dataset of 106,036 images created by transplanting COCO objects into unusual scenes, violating rules of co-occurrence and size.
  • OCD Dataset: A benchmark of ~11,000 synthetic indoor scenes where objects violate gravity, size, or co-occurrence.

Key Results and Insights

The GCRN significantly outperformed baseline methods. On the COCO-OOC dataset, it achieved an AUC of 0.980, whereas a simple softmax confidence baseline reached only 0.043. Ablation studies confirmed that the explicit Context Graph (ConG) is vital; removing it caused performance to drop to 0.589.

Key insights include:

  • Context as a Double-Edged Sword: While context aids normal identification, it confuses models when the context is incorrect.
  • Explicit Modeling: Separating "what it looks like" from "what should be here" is essential for anomaly detection.
  • Appearance is Insufficient: High model confidence does not preclude an object from being out-of-context.

Limitations and Future Work

The model faces challenges with perspective ambiguity, where 2D projections make distant large objects look like nearby small ones, leading to false OOC size flags. Additionally, domain shifts between natural (COCO) and synthetic (OCD) data affect consistency. Future work aims to incorporate 3D information (RGB+Depth) to better resolve spatial relationships and true object sizes.

Summary updated

BibTeX
@misc{acharya2022detecting,
  author = {Manoj Acharya and Anirban Roy and Kaushik Koneripalli and Susmit Jha and Christopher Kanan and Ajay Divakaran},
  title = {{Detecting out-of-context objects using contextual cues}},
  year = {2022},
  eprint = {2202.05930},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2202.05930},
}
Figure