Introduction
Autonomous driving (AD) systems must navigate complex, dynamic environments characterized by a variable number of actors and intricate road geometries. Traditional deep learning approaches often rely on fixed-size feature vectors or grid-based representations, which can struggle to scale or capture the relational nuances of traffic scenes. Graph Neural Networks (GNNs) offer a promising alternative by representing vehicles and road segments as nodes and their interactions as edges. However, the lack of standardized tools for converting raw traffic data into graph formats has hindered progress. To bridge this gap, we introduce CommonRoad-Geometric (cr-geo), an open-source Python framework designed to automate the generation of standardized heterogeneous graphs for AD research.
The CommonRoad-Geometric Framework
Built upon the CommonRoad traffic framework and PyTorch-Geometric (PyG), cr-geo simplifies the data engineering pipeline. It allows researchers to focus on model architecture by providing a modular interface for dataset curation. The library follows a Strategy Pattern, enabling users to customize "Edge Drawers" (defining connectivity logic) and "Feature Extractors" (defining node/edge attributes) without modifying the underlying pipeline. This modularity supports both real-world datasets, such as NuPlan, and simulated environments like SUMO for closed-loop training.
Heterogeneous Graph Representation
The framework models the traffic environment as a heterogeneous graph consisting of two primary node types: Lanelet Nodes (L), representing static road segments, and Vehicle Nodes (V), representing dynamic agents. To capture the geometric and social context, five distinct edge types are defined:
- L2L (Lane-to-Lane): Encodes topological relationships like successors and adjacent lanes.
- V2V (Vehicle-to-Vehicle): Captures social interactions via geometric rules like K-Nearest Neighbors or Voronoi diagrams.
- V2L / L2V: Establishes map awareness by connecting vehicles to their occupied or nearby lanes.
- VTV (Vehicle-Temporal-Vehicle): Links a vehicle's current state to its historical states.
Spatiotemporal Modeling and Temporal Unrolling
A key innovation in cr-geo is its approach to temporal data. Instead of relying on separate recurrent architectures, the framework employs temporal unrolling. By treating time as an additional dimension within the graph, a vehicle at time $t$ is connected to its previous states (e.g., $t-1, t-2$) via VTV edges. This allows the GNN to process spatial and temporal dependencies simultaneously within a unified message-passing framework. Furthermore, to handle variable-length lane geometries, the library uses a Gated Recurrent Unit (GRU) to encode waypoint sequences into fixed-size vectors, providing a rich geometric encoding for lanelet nodes.
Experimental Results
To demonstrate the framework's utility, we evaluated a Heterogeneous Graph Transformer (HGT) on the NuPlan dataset across three cities. The model was tasked with trajectory prediction, achieving high precision in complex urban layouts. In Singapore, the model achieved an Average Displacement Error (ADE) of 0.106 m and a Final Displacement Error (FDE) of just 0.227 m for a 1.0s prediction horizon. Performance in Boston (ADE: 0.138 m) and Pittsburgh (ADE: 0.215 m) further validates the effectiveness of the graph-based representation across diverse urban environments.
Conclusion and Future Work
CommonRoad-Geometric provides a standardized foundation for applying geometric deep learning to autonomous driving. While the current framework demonstrates strong performance, future work will address the computational complexity of large-scale temporal graphs and explore learned edge connectivity. By open-sourcing this tool, we aim to foster a collaborative ecosystem for developing robust, graph-based AD models.
Summary updated