Short-Term Vehicular Traffic Prediction in Dresden: A Comparative Study of Hybrid Deep Learning Approaches
This repository contains the implementation of my Master's thesis at TU Dresden, comparing hybrid deep learning approaches for traffic prediction using the VAMOS dataset. The project develops and evaluates several spatio-temporal models to predict short-term traffic flow in Dresden's road network. We also included data preparation in case one wants to consider special events (football matches of Dynamo Dresden). The original commits were made to the TUD internal Git repository. This repository is only meant to showcase my work for public to access it in this future.
- Data processing pipeline for traffic sensor data
- Implementation of STAEformer, STNorm, AGCRN and GWNet.
- Incorporated special event handling (Dynamo Dresden football matches)
- Comparative evaluation of model performance
- Visualization tools for traffic patterns and prediction results
This guide explains how to prepare data and run the traffic prediction models using the VAMOS dataset.
- Python 3.8+
- Anaconda/Miniconda installed
- Linux or WSL (Windows Subsystem for Linux)
- NVIDIA GPU (recommended for training)
We use the 'final_loop_dataset_new_sensors.csv", "pcs_meta.csv", "sgd_2023.csv" files. These files have not been included in this repository to keep the size in check.
-
Prepare Initial Data:
Visualization.ipynb
Jupyter notebook contains exploratory data analysis.- This will process raw data and create necessary initial files for further data preprocessing. Please run the corresponding cells for the same.
-
Organize Data Files:
- Copy the output files ("final_data.csv" and "final_data_DD.csv") into: datasets/raw_data/VAMOS/
- You need to add the adjacency matrix file. It is created by
Visualization.ipynb
(named `adj_mx.pkl). Copy to /datasets/VAMOS/
-
Set Up Environment:
Create an environment using the requirements.txt file. Activate the environment.
- Generate Training Data: Run the following command to carry out final processing of the data into the training format:
python scripts/data_preparation/VAMOS/generate_training_data.py
This will create .dat training files in:datasets/VAMOS/ You can do the same for other datasets as well.
- Model Training
To train the STAEformer model on the prepared data:
python experiments/train.py -c baselines/STAEformer/VAMOS.py --gpus '0'
You can change the name of the model to run the corresponding model. We also have the batchfiles if you want to run it on the HPC. Login to the Alpha cluster of the ZIH HPC of TU Dresden. Copy the repository there. And create the Conda environment. Then run the batchfiles using sbatch.
- Model Evaluation and Results Analysis
After the training is completed the results are saved in the checkpoint/ folder. Use the Visualization.ipynb file to do further evaluation.
This work builds upon several open-source implementations. And the BasicTS repository for further help in implementation. We gratefully acknowledge the original authors:
-
STAEformer: Github Repository
Spatial-Temporal Adaptive Embedding Transformer -
STNorm: Github Repository
Spatial-Temporal Normalization -
GWNet: Github Repository
Graph WaveNet -
AGCRN: Github Repository
Adaptive Graph Convolutional Recurrent Network