Giter VIP home page Giter VIP logo

deepstn's Introduction

DeepSTN+

Keras implementation of DeepSTN+: Context-aware Spatial-Temporal Neural Network for Crowd Flow Prediction in Metropolis. Ziqian Lin^, Jie Feng^, Ziyang Lu, Yong Li, and Depeng Jin. AAAI 2019. (^ indicates equal contribution) PDF If our codes is helpful to your research, you can cite our work by:

@article{lin2019deepstn+:,
title={DeepSTN+: Context-aware Spatial Temporal Neural Network for Crowd Flow Prediction in Metropolis},
author={Lin, Ziqian and Feng, Jie and Lu, Ziyang and Li, Yong and Jin, Depeng},
booktitle={Thirty-Thrid AAAI Conference on Artificial Intelligence},
year={2019}
}

Datasets

Similar to ST-ResNet, our dataset is from the NYC Bike. Besides, we collect 9 types of PoIs for this dataset. The spatial map size of the dataset is 21x12. The dataset is in the folder /DATA/dataBikeNYC flow_data.npy ( TimeLenth x In&OutFlow x MapHeight x MapWidth = 4392 x 2 x 21 x 12 ) and poi_data.npy ( PoICategories x MapHeight x MapWidth = 9 x 21 x 12 ) for directly used.

Requirements

  • python 3.5
  • Keras 2.0
  • NumPy

Project Structure

File BikeNYC corresponds the Dataset BikeNYC in the Paper DeepSTN+.

  • /DATA
    • dataBikeNYC contain dataset flow_data.npy and poi_data.npy
    • lzq_read_data_time_poi.py transfer flow_data.npy and poi_data.npy to the input of the DeepSTN+ network
  • /DST_network baseline from ST-ResNet
    • ilayer.py
    • metrics.py
    • STResNet.py
  • /DeepSTN_00/SCORE are used to save the results of DeepSTN
  • /DeepSTN_10/SCORE are used to save the results of DeepSTN+plus
  • /DeepSTN_01/SCORE are used to save the results of DeepSTN+PoI$*$time
  • /DeepSTN_11/SCORE are used to save the results of DeepSTN+plus+PoI$*$time
  • /DeepSTN_network
    • DeepSTN_net.py model codes for DeepSTN+
    • metrics.py contains the metric RMSE
  • /ComparisonBikeNYC.py you can run this file to get the results of ST-ResNet and DeepSTN in the paper.

Usage

python ComparisonBikeNYC.py

Other parameters:

Refer to ComparisonBikeNYC.py and DeepSTN_net.py

  • for training:
    • epoch, batch_size, lr, days_test, iterate_num
    • XDST, X11, X10, X01, X00, trainDST, train11, train10, train01, train00
  • model definition: H, W, channel, T, len_closeness, len_period, len_trend, T_closeness, T_period, T_trend, pre_F, conv_F, R_N, drop, is_plus, plus, rate, is_pt, P_N, T_F, PT_F, is_summary, kernel1, isPT_F

deepstn's People

Contributors

clannadkey avatar vonfeng avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

deepstn's Issues

How to produce flow_data.npy and poi_data.npy from dataBikeNYC

Thank you very much for sharing this great model.
I am an AI student and trying to have a better understanding about data preprocessing step.
I have collected dataBikeNYC containting tripduration, starttime, stoptime, start station id, ....etc. Could I please know how to produce flow_data.npy and poi_data.npy from dataBikeNYC?
Thank you very much in advance.

多尺度融合的实现问题

您好,看了您的论文和代码,您在论文中提到multi-scale fusion mechanism at the end of DeepSTN+ to improve both the accuracy of prediction and the stability of the model.
但是在代码中,您是将ResPlus最后输出的结果进行了激活、正则化、卷积、正则化的操作,
` if is_plus:
for i in range(R_N):
cpt=Res_plus('Res_plus_'+str(i+1),conv_F,plus,rate,drop,H,W)(cpt)

else:  
    for i in range(R_N):
        cpt=Res_normal('Res_normal_'+str(i+1),conv_F,drop,H,W)(cpt)

cpt_conv2=Activation('relu')(cpt)
cpt_out2=BatchNormalization()(cpt_conv2)
cpt_conv1=Dropout(drop)(cpt_out2)
cpt_conv1=Conv2D(filters=channel,kernel_size=(1, 1),padding="same")(cpt_conv1)
cpt_out1=Activation('tanh')(cpt_conv1)`

并不是像论文架构图中将多个ResPlus Unit 的输出进行融合在输送到最后的卷积模块,而是只将ResPlus最后的输出送到了最后的卷积模块,是为什么呢?

model.load_weights()

Hi,I see you use keras==2.0 and i used keras==2.3.1 several days ago,i can run your programme.but,now i met the question(model_weights() IndexError: list index out of range).i think it is the question that i use keras==2.3.1,this version is too high?but i can not slove this question.

数据来源

您好,您位置的数据来源能不能分享一下,还有处理的方法

Dataset MobileBJ

Hi!

Could you share with the link I can access to the dataset MobileBJ used in your paper?

Thanks!

ConvPlus求助

您好,拜读了您的论文和实验代码,对论文提到的ResPlus中的ConvPlus操作不是很理解,首先论文中提到使用全连接建模long-range spatial dependence,代码中使用的是卷积核为pooling后map的宽高,通道数为plusHW的Conv2D卷积,请问是为什么呢?

the file STResNet.py has a bug

as title,when i run STResNet.py,raise
ValueError: Only layers of same output shape can be merged using sum mode. Layer shapes: [(None, 6, 32, 2), (None, 2, 32, 32)],
how to solve it?

edit

您好,我在AAAI2019接收的论文里看到了您做的研究工作成果论文,对我现在的研究非常有帮助,但是一直没找到论文的全文,所以想叨扰您一份《DeepSTN+: Context aware Spatial Temporal Neural Network for Crowd Flow Prediction in Metropolis》的原文,非常感谢!
邮箱:[email protected]

model.load_weights(file_conv)

when i in this step :model.load_weights(file_conv).
i hava a problem IndexError: list index out of range
have you met before?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.