DiffLight: A Partial Rewards Conditioned Diffusion Model for Traffic Signal Control with Missing Data
This repo is the official code release for the NeurIPS 2024 conference paper:
|
DiffLight: A Partial Rewards Conditioned Diffusion Model for Traffic Signal Control with Missing Data
|
In this paper, we study the problem of TSC with missing data in the offline setting. We introduce DiffLight, a novel conditional diffusion model for TSC under data-missing scenarios in the offline setting. Specifically, we integrate two essential sub-tasks, i.e., traffic data imputation and decision-making, by leveraging a Partial Rewards Conditioned Diffusion (PRCD) model to prevent missing rewards from interfering with the learning process. Meanwhile, to effectively capture the spatial-temporal dependencies among intersections, we design a Spatial-Temporal transFormer (STFormer) architecture. In addition, we propose a Diffusion Communication Mechanism (DCM) to promote better communication and control performance under data-missing scenarios.
Extensive experiments on five datasets with various data-missing scenarios demonstrate that DiffLight is an effective controller to address TSC with missing data.
checkpoints/: Stores the trained models of DiffLight.data/: Contains datasets for different cities and traffic scenarios.memory/: Stores memories of the datasets for different data-missing scenarios.models/: Contains the implementation of DiffLight.records/: Stores the results and logs of different experiments.utils/: Utility scripts for data processing, configuration, and model evaluation.run_difflight.py: Main script to run the DiffLight algorithm.summary.py: Script to summarize and evaluate the results of the experiments.requirements.txt: List of dependencies required to run the project.
- Install Python 3.8 or higher.
- Install the required dependencies by running:
pip install -r requirements.txt
- Install CityFlow by following the instructions here.
- Download the memories of datasets from the following links:
- Place the downloaded memories in the
memory/fourphase/directory. - Unzip the memories using the following command:
unzip memory/fourphase/[dataset].zip -d memory/fourphase/
- Run the DiffLight algorithm using the following command:
where
python run_difflight.py -[dataset] -[pattern & rate][dataset]is the city name (e.g.,hangzhou_1,jinan_1,newyork) and[pattern & rate]is the data-missing scenario (e.g.,rm_1: random missing,km_wn_1: kriging missing w/ neighbors,km_won_1: kriging missing wo/ neighbors).
- After running the experiments, you can summarize and evaluate the results using:
python summary.py
Here is an example for running the DiffLight algorithm on the Hangzhou dataset with random missing data:
python run_difflight.py -hangzhou_1 -rm_1DiffLight is based on many open-source projects, including Decision Diffuser, Advanced-XLight, CityFlow, CoLight and FRAP. We would like to thank the authors for their contributions to the communities.
DiffLight is licensed under the GPLv3 License.
If you find this work useful, please consider citing the following paper:
@article{chen2024difflight,
title={DiffLight: A Partial Rewards Conditioned Diffusion Model for Traffic Signal Control with Missing Data},
author={Chen, Hanyang and Jiang, Yang and Guo, Shengnan and Mao, Xiaowei and Lin, Youfang and Wan, Huaiyu},
journal={Advances in Neural Information Processing Systems},
year={2024}
}