Papers

September 17, 2023 ยท View on GitHub

This is a Pytorch implementation of the following paper:

Papers

[๐Ÿงฉ] Spatiotemporal Graph Neural Networks with Uncertainty Quantification for Traffic Incident Risk Prediction

The Code

Requirements

Following is the suggested way to install the dependencies:

conda install --file STTD.yml

Note that pytorch >=1.10.

Folder Structure

โ””โ”€โ”€ code-and-data
    โ”œโ”€โ”€ cta_data_only10                 # CDPSAMP10 Dataset as an example
    โ”œโ”€โ”€ ny_data_only10                  # SLDSAMP10 Dataset as an example
    โ”œโ”€โ”€ ny_data_full_5min               # SLD_5min Dataset as an example
    โ”œโ”€โ”€ ny_data_full_15min              # SLD_15min Dataset as an example
    โ”œโ”€โ”€ ny_data_full_60min              # SLD_60min Dataset as an example
    โ”œโ”€โ”€ main_gau.py                     # STG Model
    โ”œโ”€โ”€ main_stnb.py                    # STNB Model
    โ”œโ”€โ”€ main_trunnorm.py                # STN Model
    โ”œโ”€โ”€ main_zero_NB.py                 # STZINB Model
    โ”œโ”€โ”€ main_tweedie.py                 # Tweedie Model (STTD, STP, STGM, STIG)
    โ”œโ”€โ”€ main_zitd.py                    # ZI-Tweedie Model
    โ”œโ”€โ”€ model.py                        # The core source code of our model
    โ”œโ”€โ”€ utils.py                        # Defination of auxiliary functions for running
    โ”œโ”€โ”€ STTD.yml                        # The python environment needed for STTD
    โ”œโ”€โ”€ pth                             # Best model save path
    โ””โ”€โ”€ README.md                       # This document

Datasets

Download datasets from ZhuangDingyi/STZINB: Source code of implementing spatial-temporal zero-inflated negative binomial network for trip demand prediction (github.com)

For London traffic risk dataset, please contact us for more details.

Configuration

Important parameters in the configuration are as follows :

nhid = 42                               # The hidden unit
weight_dacay = 1e-4                     # Weight decay
learning_rate = 1e-3                    # Learning rate
drop_out = 0.2                          # Dropout rate					 

Train and Test

Run python main_{method}.py to train and evaluate the model and generate model prediction .Remember to replace the corresponding data files and output files.