I Am Guessing You Can't Recognize This: Generating Adversarial Images for Object Detection Using Spatial Commonsense (Student Abstract)

Anurag Garg, Niket Tandon, Aparna S. VardeAAAI 2020 · DOI

Abstract

Object detection models often struggle with domain shift, failing when encountered with lighting or layouts different from their training data. Traditionally, identifying these failures requires expensive manual labeling. This paper introduces CSK-SNIFFER, a novel system that leverages "spatial commonsense"—basic logic about where objects should be relative to one another—to automatically identify model failures. By flagging physically impossible predictions, the system generates high-quality adversarial datasets for new domains without requiring human intervention.

Introduction: The Challenge of Domain Shift

While state-of-the-art object detection models perform exceptionally on benchmarks like MSCOCO, their performance often degrades in real-world deployments. This is primarily due to domain shift. For instance, a model trained on standard urban datasets may struggle with the specific object densities or environmental conditions of a "smart mobility" scene in a different geographic region.

To rectify these errors, researchers typically must manually label thousands of images from the new domain to pinpoint failures. CSK-SNIFFER addresses this bottleneck by asking: Can we automatically predict when a model is failing on a new domain without needing ground-truth labels?

The CSK-SNIFFER Framework

CSK-SNIFFER operates as a pipeline designed to "sniff out" logical inconsistencies in model outputs by comparing them against a Commonsense Knowledge Base (KB).

The CSK-SNIFFER pipeline: from raw domain images to an automatically identified adversarial subset.

The process follows four primary stages:

  1. Detection: A pre-trained model (e.g., YOLO) processes images from a target domain.
  2. Relation Extraction: The system calculates spatial relationships for every pair of predicted bounding boxes, focusing on five relations: isAbove, isBelow, isInside, isNear, and overlapsWith.
  3. Commonsense Verification: These relations are checked against a KB containing "sanity check" rules. For example, while a person can be inside a car, a car is logically never inside a person.
  4. Flagging: If a predicted relationship contradicts the KB, the image is flagged as a likely error and added to an "adversarial dataset."

Geometry as a Proxy for Truth

A key insight of this work is that one does not need ground-truth labels to identify a failure; spatial inconsistency alone is a powerful signal. If a detector claims a car is floating above a pedestrian or nested inside a child, the model's interpretation of the pixels is logically flawed.

An example of a spatial commonsense violation where a model incorrectly detects a "car" (cyan box) inside a person.

This method identifies "natural" adversarial examples—real-world images that naturally confuse the model's logic—rather than synthetic pixel-level perturbations. This zero-annotation approach allows for the rapid identification of edge cases in new environments.

Results and Evaluation

The authors tested CSK-SNIFFER on a "smart mobility" domain, using image search engines to compile a collection of nearly 15,000 images related to urban traffic and pedestrian safety.

  • Precision: Human verification confirmed that 80% of the images flagged by CSK-SNIFFER as "bad" actually contained object detection errors.
  • Discrimination: The system correctly identified "good" predictions (those adhering to commonsense) with 86.2% accuracy.
  • Efficiency: From the initial pool, the system automatically extracted a subset of 4,872 high-quality adversarial images, providing a targeted dataset for model stress-testing without manual labor.

Conclusion and Future Work

CSK-SNIFFER demonstrates that spatial logic can effectively substitute for human labels in error detection. Future research may expand the Knowledge Base beyond spatial relations to include temporal logic for video or functional logic (e.g., identifying that a refrigerator is unlikely to be found in a forest). While the current work focuses on finding errors, the next step is to prove that retraining models specifically on these "sniffed" adversarial subsets leads to superior performance gains compared to random sampling.

Summary updated

BibTeX
@inproceedings{garg2020i,
  author = {Anurag Garg and Niket Tandon and Aparna S. Varde},
  title = {{I Am Guessing You Can't Recognize This: Generating Adversarial Images for Object Detection Using Spatial Commonsense (Student Abstract)}},
  booktitle = {AAAI Conference on Artificial Intelligence},
  year = {2020},
  doi = {10.1609/aaai.v34i10.7166},
}
Figure