Home

Awesome

TransPAI

MIT License Python 3.7 repo size GitHub stars

Transportation data online Prediction And Imputation(TransPAI).

This is the code repository for paper 'Real-time Spatiotemporal Prediction and Imputation of Traffic Status Based onLSTM and Graph Laplacian Regularized Matrix Factorization' which is submitted to Transportation Research Part C: Emerging Technologies

Contents

Strategic aim

Minning the spatial temporal characteristics of transportation data to predict the future transportation status. And impute possible missing entries along the real-time data collection.

Tasks and challenges

Tasks

Challenges

The data we acquired may not be complete due to detector mailfunction, data transmission error and so on. We need to mine the data characteristic and make predictions with insufficient information. There are basically two forms of data missing:

Overview

Accurate prediction of traffic status in real time is critical for advanced traffic management and travel navigation guidance. There are many attempts to predict short-term traffic flows using various deep learning algorithms. Most existing prediction models are only tested on spatiotemporal data assuming no missing data entries. However, this ideal situation rarely exists in real world due to sensor or network transmission failure. Missing data is an unnegligible problem.  Previous studies either remove time series with missing entries or impute missing data before building prediction models. The former may cause insufficient data for model training, while the latter adds extra computational burden and the imputation accuracy has direct impacts on the prediction performance.

Proposed method

We propose a framework based on Matrix Factorization which is able to make spatiotemporal predictions using raw incomplete data and perform online data imputation simultaneously. We innovatively design a spatial and temporal regularized matrix factorization model, namely LSTM-GL-ReMF, as the key component of the framework.

On the basis of TRMF, we propose a novel LSTM and Graph Laplacian regularized matrix factorization (LSTM-GL-ReMF). In LSTM-GL-ReMF, its temporal regularizer depends on the state-of-the-art Long Short-term Memory (LSTM) model, and the spatial regularizer is designed based on Graph Laplacian (GL) spatial regularization. These regularizers enable the incorporation of complex spatial and temporal dependence into matrix factorization process for more accurate prediction performance. The illustration of LSTM-GL-ReMF is presented as:

<p align="center"> <img align="middle" src="https://github.com/Vadermit/TransPOL/blob/master/images/lstmremf.png" width="650" /> </p>

The proposed MF model can be easily extended to LSTM Regularized Matrix Factorization (LSTM-ReMF) model by neglectng the Graph Laplacian spatial regularizer. LSTM-ReMF and LSTM-GL-ReMF can also be extended to there tensor deomcomposition version LSTM-ReTF and LSTM-GL-ReTF respectively by following the tensor Canonical Polyadic (CP) decomposition method.

We propose a framework based on the aforementioned LSTM-(GL-)ReMF/TF models which is able to make spatiotemporal predictions using raw incomplete data and perform online data imputation simultaneously. As shown in the figure below, the framework basically consists of two steps: static training and dynamic prediction and imputation.

<p align="center"> <img align="middle" src="https://github.com/Vadermit/TransPOL/blob/master/images/framework_sub.png" width="850" /> </p>

Model Comparison

<table> <tr> <td>Proposed Models</td> <td colspan="2">Seattle Speed Data</td> <td colspan="2">Shanghai Pollutant Data</td> <td>Code Format</td> </tr> <tr> <td>Online Tasks:</td> <td>Prediction</td> <td>Imputation</td> <td>Prediction</td> <td>Imputation</td> <td> </td> </tr> <tr> <td><b>LSTM-ReMF</b></td> <td>✔</td> <td>✔</td> <td>✔</td> <td>✔</td> <td>Jupyter Notebook</td> </tr> <tr> <td><b>LSTM-GL-ReMF</b></td> <td>✔</td> <td>✔</td> <td>❌</td> <td>❌</td> <td>Jupyter Notebook</td> </tr> <tr> <td><b>LSTM-ReTF</b></td> <td>❌</td> <td>❌</td> <td>✔</td> <td>✔</td> <td>Jupyter Notebook</td> </tr> <tr> <td><b>LSTM-GL-ReTF</b></td> <td>❌</td> <td>❌</td> <td>✔</td> <td>✔</td> <td>Jupyter Notebook</td> </tr> </table> <table> <tr> <td>Proposed Models</td> <td colspan="2">Seattle Speed Data</td> <td colspan="2">Shanghai Pollutant Data</td> <td>Code Format</td> </tr> <tr> <td>Online Tasks:</td> <td>Prediction</td> <td>Imputation</td> <td>Prediction</td> <td>Imputation</td> <td> </td> </tr> <tr> <td><b>TRMF</b></td> <td>✔</td> <td>✔</td> <td>✔</td> <td>✔</td> <td>Jupyter Notebook</td> </tr> <tr> <td><b>BTMF</b></td> <td>✔</td> <td>✔</td> <td>✔</td> <td>✔</td> <td>Jupyter Notebook</td> </tr> <tr> <td><b>LSTM</b></td> <td>✔</td> <td>❌</td> <td>✔</td> <td>❌</td> <td>Jupyter Notebook</td> </tr> <tr> <td><b>GRU-D</b></td> <td>✔</td> <td>❌</td> <td>✔</td> <td>❌</td> <td>Jupyter Notebook</td> </tr> <tr> <td><b>GCN-DDGF</b></td> <td>✔</td> <td>❌</td> <td>✔</td> <td>❌</td> <td>Python Code</td> </tr> <td><b>TGC-LSTM</b></td> <td>✔</td> <td>❌</td> <td>❌</td> <td>❌</td> <td>Jupyter Notebook</td> </tr> </table>

Selected references

Our blog posts (in Chinese)

License

This work is released under the MIT license.