๐Ÿงพ Introduction

October 31, 2024 ยท View on GitHub

DiffLight: A Partial Rewards Conditioned Diffusion Model for Traffic Signal Control with Missing Data

pytorch arXiv License

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
Hanyang Chen1,2, Yang Jiang1,2, Shengnan Guo1,2,*, Xiaowei Mao1,2, Youfang Lin1,2, Huaiyu Wan1,2
The Thirty-Eighth Annual Conference on Neural Information Processing Systems (NeurIPS 2024)
1School of Computer Science and Technology, Beijing Jiaotong University, Chinaย ย 
2Beijing Key Laboratory of Traffic Data Analysis and Mining, Beijing, China ย ย 
*Corresponding author.

ย 

๐Ÿงพ Introduction

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.

๐Ÿ’ป Repository Structure

  • 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.

๐Ÿ› ๏ธ Usage

Prerequisites

  1. Install Python 3.8 or higher.
  2. Install the required dependencies by running:
    pip install -r requirements.txt
    
  3. Install CityFlow by following the instructions here.

Data Preparation

  1. Download the memories of datasets from the following links:
  2. Place the downloaded memories in the memory/fourphase/ directory.
  3. Unzip the memories using the following command:
    unzip memory/fourphase/[dataset].zip -d memory/fourphase/
    

Running DiffLight

  1. Run the DiffLight algorithm using the following command:
    python run_difflight.py -[dataset] -[pattern & rate]
    
    where [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).

Evaluating Results

  1. After running the experiments, you can summarize and evaluate the results using:
    python summary.py
    

Example Configuration

Here is an example for running the DiffLight algorithm on the Hangzhou dataset with random missing data:

python run_difflight.py -hangzhou_1 -rm_1

๐Ÿ™ Acknowledgements

DiffLight 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.

๐Ÿท๏ธ License

DiffLight is licensed under the GPLv3 License.

๐Ÿ“ Citation

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}
}