# TrafficFlowPrediction **Repository Path**: chanzany/TrafficFlowPrediction ## Basic Information - **Project Name**: TrafficFlowPrediction - **Description**: Traffic Flow Prediction with Neural Networks(SAEs、LSTM、GRU). - **Primary Language**: Unknown - **License**: MIT - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 2 - **Forks**: 0 - **Created**: 2020-12-24 - **Last Updated**: 2022-07-28 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # Traffic Flow Prediction Traffic Flow Prediction with Neural Networks(SAEs、LSTM、GRU). ## Requirement - Python 3.6 - Tensorflow-gpu 1.5.0 - Keras 2.1.3 - scikit-learn 0.19 pip install Keras==2.1.3 pip install tensorflow==1.5.0 ## Train the model **Run command below to train the model:** ``` python train.py --model model_name ``` You can choose "lstm", "gru" or "saes" as arguments. The ```.h5``` weight file was saved at model folder. ## Experiment Data are obtained from the Caltrans Performance Measurement System (PeMS). Data are collected in real-time from individual detectors spanning the freeway system across all major metropolitan areas of the State of California. device: Tesla K80 dataset: PeMS 5min-interval traffic flow data optimizer: RMSprop(lr=0.001, rho=0.9, epsilon=1e-06) batch_szie: 256 **Run command below to run the program:** ``` python main.py ``` These are the details for the traffic flow prediction experiment. LSTM explained_variance_score:0.932454 mape:18.851012% mae:7.858430 mse:109.724229 rmse:10.474933 r2:0.932454 GRU explained_variance_score:0.939164 mape:26.271195% mae:7.582251 mse:100.641479 rmse:10.032023 r2:0.938045 SAEs explained_variance_score:0.927053 mape:23.476228% mae:11.858915 mse:234.535436 rmse:15.314550 r2:0.855621 | Metrics | MAE | MSE | RMSE | MAPE | R2 | Explained variance score | | ------- |:---:| :--:| :--: | :--: | :--: | :----------------------: | | LSTM | 7.21 | 98.05 | 9.90 | 16.56% | 0.9396 | 0.9419 | | GRU | 7.20 | 99.32 | 9.97| 16.78% | 0.9389 | 0.9389| | SAEs | 7.06 | 92.08 | 9.60 | 17.80% | 0.9433 | 0.9442 | ![evaluate](/images/eva.png) ## Reference @article{SAEs, title={Traffic Flow Prediction With Big Data: A Deep Learning Approach}, author={Y Lv, Y Duan, W Kang, Z Li, FY Wang}, journal={IEEE Transactions on Intelligent Transportation Systems, 2015, 16(2):865-873}, year={2015} } @article{RNN, title={Using LSTM and GRU neural network methods for traffic flow prediction}, author={R Fu, Z Zhang, L Li}, journal={Chinese Association of Automation, 2017:324-328}, year={2017} } ## Copyright See [LICENSE](LICENSE) for details.