Git Product home page Git Product logo

stega's Introduction

STEGA

The official implementation of Spatiotemporal Gated Traffic Trajectory Simulation with Semantic-aware Graph Learning (Information Fusion 2024).

Please consider giving this repository a star ⭐ if you find it helpful! πŸ˜‰

OverallFramework

Check out our paper:

Spatiotemporal Gated Traffic Trajectory Simulation with Semantic-aware Graph Learning.
Yu Wang, Ji Cao, Wenjie Huang, Zhihua Liu, Tongya Zheng†, Mingli Song. [Link]

Abstract: Traffic trajectories of various vehicles, bicycles and pedestrians can help understand the traffic dynamics in a fine-grained manner like traffic flow, traffic congestion and ride-hailing demand. The comprehensive usage of traffic trajectory data has not been fully investigated due to the prevalent privacy concerns and commercial limitations. The traffic trajectory simulation task has emerged to generate high-fidelity trajectories in demand for downstream tasks to fill the gap between the scarce trajectory data and the widespread applications. Previous state-of-the-art methods build the spatiotemporal dependencies of trajectories with Graph Neural Networks (GNNs) under generative adversarial training, yielding better yet unstable trajectory quality. We observe that the unsatisfied synthetic trajectories are caused by the insufficient spatiotemporal modeling of road networks and trajectory semantics. In this paper, we propose a novel SpatioTEmporal GAted (STEGA) framework equipped with semantic-aware graph learning for traffic trajectory simulation to enable the explicit modeling of spatiotemporal dependencies throughout the learning pipeline. On the one hand, STEGA employs a graph encoder with the semantics of road networks for the spatial points of a trajectory, together with a time encoder for the time points. On the other hand, STEGA devises two spatiotemporal gates with the semantic graphs for the predictions of the future trajectory. Boosted by the semantic-aware graph learning, the proposed STEGA outperforms the state-of-the-art counterparts consistently at both macro- and micro-level metrics on two datasets. Elaborate ablation studies and downstream tasks of the synthetic trajectories further demonstrate the superiority of STEGA. Our code is available at https://github.com/Star607/STEGA.

πŸ“š Citation

If you find our work useful in your research, please consider citing πŸ˜„:

@article{wang2024spatiotemporal,
  title={Spatiotemporal Gated Traffic Trajectory Simulation with Semantic-aware Graph Learning},
  author={Yu Wang, Ji Cao, Wenjie Huang, Zhihua Liu, Tongya Zheng, Mingli Song},
  journal={Information Fusion},
  volume={108},
  pages={102404},
  year={2024},
  issn={1566-2535},
  doi={https://doi.org/10.1016/j.inffus.2024.102404},
  url={https://www.sciencedirect.com/science/article/pii/S1566253524001829}
} 

βš™οΈ Installation

  • Environment

    • Tested OS: Linux
    • Python >= 3.9
    • PyTorch == 1.10.2
  • Dependencies

    • Install PyTorch 1.10.2 with the correct CUDA version.
    • Install dgl 1.1.0 with the correct CUDA version.
    • Execute pip install -r requirements.txt command to install all of the Python modules and packages used in this project.

πŸ“ Code Structure

Data is from the opensource dataset of TS-TrajGen.

β”œβ”€β”€ data
β”‚   └── BJ_Taxi
β”‚       β”œβ”€β”€ adjacent_mx_fill.npz.npy
β”‚       β”œβ”€β”€ adjacent_mx.npz
β”‚       β”œβ”€β”€ dist_geo.npy
β”‚       β”œβ”€β”€ node_feature.pt
β”‚       β”œβ”€β”€ od_and_probs_float.pt
β”‚       β”œβ”€β”€ rid_gps.json
β”‚       β”œβ”€β”€ road2grid.json
β”‚       β”œβ”€β”€ roadmap.geo
β”‚       β”œβ”€β”€ roadmap.rel
β”‚       β”œβ”€β”€ start_t_probs.pt
β”‚       β”œβ”€β”€ traj_tes.csv
β”‚       β”œβ”€β”€ traj_tra.csv
β”‚       └── traj_val.csv
β”œβ”€β”€ distance_gat_fc.py
β”œβ”€β”€ functional.py
β”œβ”€β”€ graph_model.py
β”œβ”€β”€ helpers.py
β”œβ”€β”€ model.py
β”œβ”€β”€ picture
β”‚   └── framework.png
β”œβ”€β”€ README.md
β”œβ”€β”€ requirements.txt
β”œβ”€β”€ sample.py
└── train.py

πŸš€ Running

  • Model Training

    • python train.py
    • --data sets the dataset
    • --datapath refers to the path of each dataset
    • --out_dir is the file directory to save the trained model
  • Trajectory Simulation

    • python sample.py
    • --data sets the dataset
    • --datapath refers to the path of each dataset
    • --out_dir is the file directory to save the trained model and simulated trajectories

πŸ“ƒ Related Works

😊 Note

The implemention is based on nanoGPT.

stega's People

Contributors

caoji2001 avatar star607 avatar

Stargazers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.