This repo is the implementation of our manuscript entitled Region-Aware Hierarchical Graph Contrastive Learning for Ride-Hailing Driver Profiling. The code is based on Pytorch 1.13.1, and tested on Ubuntu 18 with NVIDIA Tesla V100 GPU.
In this study, we present a region-aware Hierarchical Graph Contrastive Learning (HGCL) model for ride-hailing driver profiling. The model consists of three modules: trajectory transformer, regional driving state extractor and multi-view urban graph encoder. Then obtained driver profiles can be used as extra features for various downstream tasks.
HGCL uses the following dependencies:
- Pytorch 1.13.1 and its dependencies
- Numpy
- torch_geometric 2.2.0 and its dependencies
- CUDA 11.3 or latest version, cuDNN.
The dataset is based on Chengdu Taxi dataset, with around 5000 taxi drivers. Since the overall dataset is extremely large, here we provide sample dataset with trajectories from 10 drivers (~700 M).
- stage: training stage, within [traj, relation_graph, urban, total], to train the model layer by layer or end-to-end
- batch_size: training batch size
- lr: the learning rate
- weight_decay: the weight decay of the optimizer in Adam
- seed: random seed
- hidden_dim: the dimension of embeddings
- epoch: training epochs
Before training the model, you need to install the dependencies:
pip install -r requirements.txt
Then you can train the model with designated hyperparameters, for instance:
python main.py --mode 'train' --stage 'total' --lr 1e-3 --hidden_dim 64
@article{chen2023region,
title={Region-Aware Hierarchical Graph Contrastive Learning for Ride-Hailing Driver Profiling},
author={Chen, Kehua and Han, Jindong and Feng, Siyuan and Zhu, Meixin and Yang, Hai},
journal={Transportation Research Part C: Emerging Technologies},
volume={156},
pages={104325},
year={2023},
publisher={Elsevier}
}