A Token-based Self-Supervised Network on Traffic Flow data
The source code for the pre-print paper Masked Token Enabled Pre-training A Task-Agnostic Approach for Understanding Complex Traffic Flow, which is under review of IEEE Transactions on Intelligent Transportation Systems.
The main scripts are in folder main
, which can be directly ran in Pytorch after cloning this repository and getting all the requried dependencies ready. However, necessary data pre-processing is required to get the same data shape. The pre-processing scheme can be found in our paper.
The model structure is in folder model
. The code for pretrain and finetune phase is listed in pretrain
and finetune
respectively.
The comparison models of LSTM and Transformer are in LSTM
and transformer
.
-
A novel network, i.e. TSSN, is proposed for generating an effective task-agnostic model for various downstream tasks on traffic flow data.
Meanwhile, a novel pretext task, i.e. masked token prediction(MTP), is designed to provide strong surrogate supervision signals for the pre-training of TSSN.
-
Three types of downstream tasks, i.e. TF classification, prediction and completion, are solved by using the representations of tokens created in pre-training model.
The datasets for pre-training and TF prediction and completion tasks are collected from PeMS, and those used for TF classidication task is Seattle Inductive Loop Detector Dataset.