This is the code accompanying the paper Enhancing deep learning-based city-wide traffic prediction pipelines through complexity analysis
Ubuntu:
conda create --name pyenv python=3.11
conda activate pyenv
pip install -r requirements_frozen.txt
If GPU is not available, comment out these lines:
# #######################
# nvidia-cublas-cu11==11.11.3.6
# nvidia-cudnn-cu11==8.6.0.163
- Please ensure that
gpustat
is not installed. For GPU-usage while the script is running, please usenvidia-smi
instead
- The traffic data can be downloaded by following the instructions provided on the competition page for Traffic4Cast2022
Commit id for reproducing results from the paper: 1c7c302e68276a5c8a61be7bbefca5d36b871ec6
- For instructions on how to use the proposed metrics for a new dataset, please follow the detailed documentation using demo data at Demo_CATP.ipynb
- Sometimes, the github preview is slow and it might not load the Demo Jupyter notebook correctly due to figures in the outputs. If that happens, the Demo notebook with outputs removed can be viewed at Demo_CATP_without_images.ipynb
- A quick preview of the demo in
.html
format can be downloaded from Demo_CATP_html_format.ipynb and viewed using firefox. - The demo script runs well on google colab and and colab tensorflow version for the demo script that has been tested as of December 2023 is as shown below:
import tensorflow as tf tf.__version__ # 2.15.0
Details regarding the implementation-level considerations for the four key formulations from the paper can be found in the Jupyter notebook: Demo_CATP.ipynb. The four key formulations are reproduced here for convenience.
Equation (7) in paper: The criticality of a data point (sample) is given by Sample Complexity (SC) of a data point; given a model f
Equation (8) in paper: Model Complexity (MC) of a model is defined as the mean of sample complexities (criticalities) for all data points.
Equation (9) in paper: Intrinsic Sample Complexity (ISC) of a data point; given a prediction task
Equation (11) in paper: Intrinsic Complexity (IC) of a prediction task
If you find the codes in this repository useful for computing the complexity of your traffic prediction models, please consider citing our paper:
@article{kumar2024enhancing,
title={Enhancing Deep Learning-Based City-Wide Traffic Prediction Pipelines Through Complexity Analysis},
author={Kumar, Nishant and Martin, Henry and Raubal, Martin},
journal={Data Science for Transportation},
volume={6},
number={3},
pages={24},
year={2024},
publisher={Springer}
}