Python impletmentaion of the thesis AdjNet: a deep learning approach for Crowd Flow Prediction (Link)
We propose AdjNet (Adjacency Matrix Neural Network), which solves the Crowd Flow Prediction problem using an approach based on Graph Convolutional Networks (GCN) and Convolutional Neural Networks (CNN). In the first stage, we first represent the area taken into account using different tessellations. In the second stage, we train our model using the New York City Bike Share dataset to predict flows among regions.
Architecture of CrowdNet.We evaluate our model using different tessellation, evaluating them exploiting the RMSE metric. We compare it using as baseline another Deep Learning approach named STResNet (Link).
RMSE
Tile Size | |||||||
---|---|---|---|---|---|---|---|
750m | 1000m |
1500m | |||||
AdjNet | STResNet | AdjNet | STResNet | AdjNet | STResNet | ||
Time intervals | 15min | 1.71 | 1.69 | 2.76 | 2.35 | 3.73 | 3.35 |
30min | 3.69 | 2.65 | 5.23 | 4.85 | 8.93 | 5.64 | |
45min | 4.34 | 3.67 | 6.68 | 5.63 | 11.3 | 10.91 | |
60min | 5.18 | 5.44 | 8.53 | 9.38 | 11.1 | 11.66 |
Images
A visual comparison of the mean real crowd inflows with the mean crowd inflows predicted by STResNet and AdjNet is provided by the following image.
Comparison of mean real crowd inflows (center) with those predicted by CrowdNet (left) and STResNet (right) using tile size of 1000m and time intervals of 30 minutes.
Flow data available online
At first you need to clone this repository:
$ git clone https://github.com/jonpappalord/crowd_flow_prediction
$ cd crowd_flow_prediction
Create a new environment:
$ python -m venv yourenvname
$ source yourenvname/bin/activate
Launch the following command to install the required packages
$ pip install -r requirements.txt
We have prepared an instance for running the model, that is main.py
.
$ python main.py