CAGNet: a context-aware graph neural network for detecting social relationships in videos

Fan Yu, Yaqun Fang, Zhixiang Zhao, Jia Bei, Tongwei Ren, Gangshan WuVis. Intell 2024

Abstract

Understanding human interactions in video requires moving beyond fleeting visual actions to identifying stable social relationships. This paper introduces CAGNet, a context-aware graph neural network designed for the Video Social Relationship Graph Generation (VSRGG) task. CAGNet maps out complex social webs—such as "parent-offspring" or "friends"—by leveraging temporal continuity and graph-based reasoning. Alongside the model, the authors present VidSoR, a massive new dataset containing 72 hours of annotated video footage. CAGNet demonstrates superior performance by effectively fusing facial and body features and utilizing an iterative message-passing mechanism to infer relationships from social context.

Introduction: The Challenge of Social Relationships in Video

While computer vision has made significant strides in identifying "visual relationships" (e.g., man-holding-apple), these are often transient interactions captured in isolated frames. In contrast, social relationships (e.g., colleagues, couples, or siblings) are enduring bonds essential for narrative comprehension. Detecting these relationships in video presents unique challenges:

  1. Temporal Discontinuity: Two individuals may share a deep social connection but rarely appear in the same frame simultaneously.
  2. Computational Complexity: In crowded scenes, the number of potential pairs grows exponentially, making exhaustive "complete graph" approaches computationally prohibitive.

The authors formalize this task as Video Social Relationship Graph Generation (VSRGG). The goal is to generate a graph where nodes represent unique characters and edges represent their social bonds across the entire video duration.

The VSRGG task: extracting a social relationship graph from a sequence of video frames.

The CAGNet Framework

CAGNet addresses the VSRGG task through a structured four-stage pipeline:

1. Person Detection and Clustering

The system employs RetinaFace for face detection and Faster R-CNN for body detection. To maintain identity across temporal gaps, CAGNet clusters these detections throughout the video. This ensures that a character appearing at the start of a clip is recognized as the same individual at the end, providing a consistent node for the social graph.

2. Sparse Graph Proposal

To manage complexity, CAGNet avoids checking every possible pair. Instead, it constructs a sparse initial graph by only proposing edges between individuals who co-occur within a specific "sliding window" of time. This significantly reduces noise and computational overhead.

3. Multi-Modal Feature Extraction

The model extracts rich features for both nodes and edges:

  • Nodes: Facial features (via VGG16) and body features (via ResNet50) are fused to describe individuals, capturing identity, age, and emotional cues.
  • Edges: A 3D-ResNet50 extracts temporal features from video segments where both individuals appear, capturing the dynamics of their interaction.

4. Relationship Prediction via GNN

The core of CAGNet is an iterative message-passing mechanism. Rather than analyzing pairs in isolation, the network allows information to flow across the graph. For instance, if the model identifies Person A as the "parent" of Person B, and Person B is the "sibling" of Person C, it can use this contextual logic to more accurately predict the relationship between A and C.

The VidSoR Dataset

To benchmark this task, the authors introduced VidSoR, a significant advancement over previous datasets like MovieGraphs.

  • Scale: VidSoR contains 1,798 video clips totaling 72 hours from over 300 TV dramas.
  • Complexity: It features 6,276 person instances and 5,313 relationship instances across eight categories: Colleague, Couple, Friend, Leader-subordinate, Opponent, Parent-offspring, Service, and Sibling.
  • Density: VidSoR clips are longer (144s average) and contain nearly double the relationship instances per clip compared to prior benchmarks, making it a more rigorous test for long-term social reasoning.

Analysis and Results

CAGNet was evaluated against state-of-the-art models in image-based relationship detection and video scene graph generation.

Key Findings

  • Facial Features are Paramount: Ablation studies showed that facial features are significantly more predictive of social relationships than body features. Faces provide critical cues regarding identity and emotional state that distinguish categories like "friend" from "colleague."
  • Contextual Reasoning: The iterative GNN message passing proved vital. By updating node and edge representations based on their neighbors, the model resolved visual ambiguities that would be impossible to decode from isolated snippets.
  • Efficiency: A sliding window width of two provided the optimal balance between capturing interactions and minimizing false-positive edges.

Performance Metrics

On the VidSoR dataset, CAGNet achieved a mean Average Precision (mAP) of 10.04 and a mean Recall (mRecall) of 7.05 for the full VSRGG task. Notably, when provided with ground-truth person detections (the VSRGG task), the mAP jumped to 17.73*, indicating that the reasoning engine is highly effective when the initial detection stage is accurate.

Conclusion and Future Directions

While CAGNet sets a new standard for social relationship detection, two primary bottlenecks remain. First, the model's performance is heavily dependent on the quality of the initial person detector; errors in clustering or detection lead to fragmented graphs. Second, the "long-tail" distribution of real-world social ties makes it difficult for the model to learn rare categories like "Service" or "Sibling" as effectively as common ones like "Friend."

Future work will explore integrating multi-modal data, such as audio and text transcripts. Speech recognition could help resolve ambiguities—such as distinguishing between a "colleague" and a "friend" in an office setting—that visual data alone may not fully capture.

Summary updated

BibTeX
@article{yu2024cagnet,
  author = {Fan Yu and Yaqun Fang and Zhixiang Zhao and Jia Bei and Tongwei Ren and Gangshan Wu},
  title = {{CAGNet: a context-aware graph neural network for detecting social relationships in videos}},
  journal = {Vis. Intell.},
  year = {2024},
  doi = {10.1007/s44267-024-00056-9},
}
Figure