Exploring Semantic Clustering and Similarity Search for Heterogeneous Traffic Scenario Graph

Ferdinand Mütsch, Maximilian Zipfl, Nikolai Polley, J. Marius Zöllner · DOI

Abstract

Testing and validating autonomous vehicles (AVs) requires a vast and diverse library of driving scenarios. However, the manual labeling of millions of miles of sensor data is prohibitively expensive and unscalable. This paper introduces a novel framework for representing complex traffic scenes as heterogeneous graphs and utilizes self-supervised learning to automatically cluster similar driving behaviors. By leveraging graph-based embeddings, the proposed method enables the discovery of rare "corner cases" and semantic similarity search without the need for human-annotated labels.

Introduction

Validating an AV is fundamentally an "open-context" problem where the number of potential situations is effectively infinite. While the majority of driving data is mundane, the "long tail" of rare, safety-critical events—often called corner cases—is where AV systems are most likely to fail. Current methods for organizing these scenarios typically rely on manual engineering, which lacks scalability, or oversimplified automated methods that ignore rich relational context, such as the interaction between a pedestrian and a crosswalk.

This research aims to develop a data-driven, scalable approach to measure semantic similarity. The goal is to identify scenarios that share the same underlying meaning (e.g., "left turn at a busy intersection") even if their absolute coordinates or specific vehicle models differ.

Methodology

The Heterogeneous Scenario Graph

To capture the relational complexity of traffic scenes, the authors represent scenarios as heterogeneous graphs. Unlike simple trajectory lists, this structure explicitly models the environment's context:

  • Nodes: Represent road segments (lanes, walkways) and obstacles (vehicles, pedestrians).
  • Edges: Define spatial relationships (e.g., "left of"), semantic interactions (e.g., "yields to"), and temporal connections (linking an object's state across time steps).
  • Invariance: By using relative positions and velocities for edge attributes, the representation remains invariant to the scene's absolute orientation, ensuring the model focuses on behavior rather than coordinates.
Figure 1: Mapping a real-world traffic scene to a heterogeneous graph representation with spatial and semantic edges.

Self-Supervised Embedding Learning

To transform these graphs into searchable vectors (embeddings), the researchers adapted the Bootstrapped Graph Latent (BGRL) technique. This self-supervised approach trains the model by presenting it with two augmented versions of the same scenario graph. The model learns to produce nearly identical embeddings for these versions while maintaining distance from unrelated scenarios. This process requires no human labels, allowing the model to discover inherent structures in the data.

Figure 5: The self-supervised learning pipeline using Online and Target encoders to generate scenario embeddings.

Following embedding generation, the HDBSCAN density-based clustering algorithm is used to group these vectors into distinct scenario categories.

Experiments and Results

The framework was evaluated using the nuPlan dataset, utilizing 25,000 scenarios from Boston for training and testing, with additional data from Pittsburgh and Singapore to test generalization.

Key findings include:

  • Similarity Performance: The model achieved a 99.99% success rate in identifying augmented versions of a scenario as the most similar in the embedding space.
  • Clustering Utility: The model automatically identified 74 distinct scenario types in the Boston data. Qualitative analysis confirmed these clusters corresponded to specific maneuvers, such as stopping at traffic lights or high-speed straight driving.
  • Downstream Accuracy: A simple classifier trained on the learned embeddings achieved ~60% accuracy in predicting human-assigned labels, despite the embeddings being learned entirely without supervision.

Discussion and Conclusion

A notable observation was the "sea of mundane driving"—a large portion of data (up to 71%) remained unclustered. The authors interpret this as standard driving behavior that does not form distinct maneuvers, which effectively highlights the more unique and interesting maneuvers that do form clusters.

While the model successfully groups by behavior, future work will focus on correlating these clusters with "criticality" to specifically isolate dangerous events. Additionally, these learned embeddings could serve as seeds for generative models to synthesize new, realistic test scenarios for AV simulation.

Summary updated

BibTeX
@misc{mutsch2025exploring,
  author = {Ferdinand Mütsch and Maximilian Zipfl and Nikolai Polley and J. Marius Zöllner},
  title = {{Exploring Semantic Clustering and Similarity Search for Heterogeneous Traffic Scenario Graph}},
  year = {2025},
  eprint = {2507.05086},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2507.05086},
}
Figure