ContextHOI: Spatial Context Learning for Human-Object Interaction Detection

Mingda Jia, Liming Zhao, Ge Li, Yun Zheng

Abstract

Spatial contexts, such as the backgrounds and surroundings, are considered critical in Human-Object Interaction (HOI) recognition, especially when the instance-centric foreground is blurred or occluded. Recent advancements in HOI detectors are usually built upon detection transformer pipelines. While such an object-detection-oriented paradigm shows promise in localizing objects, its exploration of spatial context is often insufficient for accurately recognizing human actions. To enhance the capabilities of object detectors for HOI detection, we present a dual-branch framework named ContextHOI, which efficiently captures both object detection features and spatial contexts. In the context branch, we train the model to extract informative spatial context without requiring additional hand-craft background labels. Furthermore, we introduce context-aware spatial and semantic supervision to the context branch to filter out irrelevant noise and capture informative contexts. ContextHOI achieves state-of-the-art performance on the HICO-DET and v-coco benchmarks. For further validation, we construct a novel benchmark, HICO-ambiguous, which is a subset of HICO-DET that contains images with occluded or impaired instance cues. Extensive experiments across all benchmarks, complemented by visualizations, underscore the enhancements provided by ContextHOI, especially in recognizing interactions involving occluded or blurred instances.

Introduction: The Role of Spatial Context

Human-Object Interaction (HOI) detection aims to identify triplets of <Human, Interaction, Object>. Most modern detectors are built on the DETR (Detection Transformer) architecture, which is inherently instance-centric. These models excel at localizing specific objects but often treat the background as "negative noise" to be ignored.

However, in many real-world scenarios, identifying what a person is doing requires looking at more than just the person and the object. For example, a person near a car could be "parking" or "driving." Without clear visual cues from the person (e.g., if they are occluded or the image is blurred), the environment provides the necessary clues to infer the interaction.

Spatial context disambiguates interactions: the same car in a parking lot implies 'parking', while on a city road it implies 'driving'.

The problem arises in "visually uncertain" scenes. If a driver is hidden behind tinted windows or a person is partially occluded by a tree, instance-centric models struggle because the primary visual cues are missing. Humans overcome this by using spatial context—the environment provides the clues necessary to infer the interaction. ContextHOI addresses the misalignment between minimal context modeling in current detectors and the extensive contextual requirements of real-world action recognition.

Methodology: The ContextHOI Framework

ContextHOI is a dual-branch framework that adds a dedicated "Context Learning Branch" alongside the traditional instance detection branch.

Dual-Branch Architecture

While the instance branch focuses on the person and object, the context branch specifically extracts informative spatial features from the surroundings. This ensures that the model captures both local instance details and global environmental cues.

Spatially Contrastive Constraints

To prevent the context branch from simply replicating the instance branch, the authors use a set of "coarse-to-fine" constraints. These force the model to look outside the bounding boxes of the human and object, effectively "diverging" the attention of the two branches. A dynamic distance weighting ($W_d$) in the loss function encourages the model to look at the immediate surroundings of the interaction rather than just the extreme edges of the image.

Semantic-guided Context Explorer

The model leverages prior knowledge from Vision-Language Models (VLMs) like CLIP. It initializes "explorers" using text embeddings of object and verb categories. These explorers search the image for visual features semantically related to the action (e.g., looking for "asphalt" or "lane lines" when the potential action is "driving"). This helps the model bridge the gap between raw pixels and meaningful environmental cues.

Experimental Evaluation

The model was evaluated on standard benchmarks and a newly created "stress test":

  • HICO-DET: The standard large-scale benchmark for HOI.
  • v-coco: A common, smaller-scale HOI dataset.
  • HICO-ambiguous: A new subset of 659 images from the HICO-DET test set featuring occluded subjects, blurred instances, or subjects too small to distinguish clearly. This benchmark specifically measures how well a model handles limited visual cues.

Key Results

ContextHOI sets a new state-of-the-art for HOI detection:

  • HICO-DET Performance: It achieved 41.82 mAP, surpassing previous leaders like UniHOI (40.06 mAP).
  • Robustness to Ambiguity: On the HICO-ambiguous benchmark, ContextHOI showed significant improvement. Compared to the baseline QPIC, it achieved a +5.17 increase in overall mAP and a +16.66 increase in rare interaction mAP.
  • Efficiency: The model maintains a practical inference speed of 13.37 FPS on an A800 GPU.

Conclusion

ContextHOI demonstrates that spatial context is an active, not passive, component of action recognition. By explicitly training a model to find informative background cues through spatially contrastive constraints and semantic guidance, researchers can significantly improve the robustness of HOI detection, particularly in challenging, ambiguous environments. Future work will explore more fine-grained context learning and open-vocabulary scaling.

Summary updated

BibTeX
@inproceedings{jia2025contexthoi,
  author = {Mingda Jia and Liming Zhao and Ge Li and Yun Zheng},
  title = {{ContextHOI: Spatial Context Learning for Human-Object Interaction Detection}},
  booktitle = {AAAI Conference on Artificial Intelligence},
  year = {2025},
  url = {https://openreview.net/forum?id=AxY8fEObTf},
}
Figure