DEIM Forum 2019 H8-5

Forecasting of Pedestrian Counts at City Location Points
Sridhar BABU M † , Adam JATOWT† , Yihong ZHANG† , and Masatoshi YOSHIKAWA†† Department of Social Informatics, Graduate School of Informatics, Kyoto University
Yoshidahonmachi, Sakyo Ward, Kyoto, Kyoto Prefecture 606-8501, Japan
E-mail: †{sridharbabu1138,jatowt,yhzhang7}@gmail.com, ††yoshikawa@i.kyoto-u.ac.jp
Abstract The main purpose of this research work is to accurately analyze the pedestrian count flow in the cityand predict the future count precisely. Walking is an important mode of transport, and is a non-polluting and an
energy burning activity. With the increasing urban development and infalted fuel prices around the world more
people prefer to use bicycles or walk than any other mode of transport. However, the flow of pedestrian varies
across different location points in the same city. Existing research works only focus on the collective location points
around the same area and are not very specific to particular locations. Our research focuses on each location point
separately and makes use of the rich historical pedestrian count data collected from sensors placed around different
locations in the city. In addition, it also incorporates other external factors associated with pedestrian movement tocollectively model them and finally predict the future pedestrian count value. After pre-processing the input data
and deploying the models, the recurrent neural network models have shown to outperform the time series models.
The RMSE error measure for the best model is 17.23.
Key words Pedestrian Count, Time Series, Recurrent Neural Networks

1 INTRODUCTION

the pedestrian count is for urban planning and management.
Either the case of opening a new shop, business in a locality

With millions of people travelling around the city every

or design of roads and pavements the planners need to doday, it becomes very vital for the urban planners and design-a detailed analysis on pedestrian flow in that locality since

ers to come out with an optimized plan to accommodate thethey are the potential customers.

crowd. Increasingly, many city corporations and institutes

The real question that needs to be answered is how to pre-for health and care excellence are collaborating to create new

dict the future pedestrian counts at different location points

proposals to increase the amount of physical activity in peo-in the city. There are two cases of scenarios for the above

ples daily lives. As result, more and more number of people

problem. One case assumes the availability of rich historicalare regularly using the walking mode of transport and plan-counts of pedestrian flow and requires developing temporalners are asked to design more wide and sophisticated pave-models to process and perform regression for future forecast-ments including bumps and grooves with anti-glare surfaces

ing. The other case assumes complete lack of historical data

for those with visual impairments.

(e.g. a city with no pedestrian count sensors installed). In

So, the inference is rapid increase in the pedestrian walk-

this work, the focus is on the data rich location points i.e

ing. With the increase in pedestrian counts, there will be

the city location points for which we have some historicalincrease in number of business commodities in that particu-

pedestrian counts.

lar locality. Particularly, if there are more number of people

The following research work focuses on the case one, as-walking in the mid night time and early morning it can be re-suming the city has rich historical pedestrian counts. Withgarded as a safe locality to travel. Safety index of the city is

the presence of these rich data, couple of time series andalso directly related to the number of pedestrians moving inneural network models are proposed. These models are effi-that particular location of city. Often crimes are happening

ciently trained with these historical temporal data to forecastin the secluded or less people moving areas. The pedestrianpedestrian counts for the future. In this work, the prime fo-

flow in a particular location point then provides us insights

cus is only the pedestrian counts of next day in particular

about the safety index of the location. If pedestrian flow iscity location point.

more high the probability of crime is less with the notion

The rest of the paper is organized as follows. Section 2that crimes usually happen in remote or secluded streets.

contains related works and literature survey. Section 3 is

One more important and economical aspect of determining

about the methodology. Section 4 presents the experiments

and datasets used for the project. Section 5 briefs about themay perform better if the external factors are also included

conclusion of the work and future work that is in progressin implementation.

with the current research project.

2 RELATED WORKS

Since the entire data is temporal, there are several typesof time series analysis that could be done. For one kind ofsimilar problem, the ARIMA model was developed to pre-Pedestrian counting strategies are vital statistics for urban

dict the water quality [6]. Previous works have also utilized

and city planning. Manual counting is however prone to er-

the time series model, but on the raw sensor data withoutrors and more cost expensive. In addition, higher pedestriantaking the seasonality into account [2]. Similarly, time series

volumes are directly related with the roads or streets with

were used to predict the air quality but neural networks out-high activity zones [1]. However, it is of prime importance toperformed their accuracy [4]. In addition, the deep neural

efficiently monitor and predict the future pedestrian demand

network seems to be promising in handling spatial temporalzones for social welfare.

data with less error and more accuracy [7]. This gives us

Predicting the future demand is useful for many real time

more information about using neural networks in our study

applications. Once the passenger demand zone is identified,and analyze the accuracy of models with respect to current

it will be a useful insight for the taxi, cabs to navigate toproblem.

that particular destination. On the other hand, it is an additional information for navigation purposes. Once the most

3 METHODOLOGY

people moving area is known, that particular route can be

The flow of the system in fig(1a) depicts the entire pro-avoided to reduce travel time. There are several works thatcess organization. After the raw data is extracted from theanalyze the pedestrian traffic congestion. One more reason

pedestrian counting system, the raw data and meta data

for traffic congestion to happen is the case of planned spe-are collaborated in the data processing before being sent forcial events happening in the city [5]. If the events details

model building. After the data processing the below set ofand previous pedestrian flow data are known these kind ofmodels are applied and each model separately performs the

chaotic situations could have been averted.

forecasting of future pedestrian counts. List of models used

Another similar kind of problem is metro passenger flow
forecasting in a city. To forecast the metro transit passen-

and their working details are mentioned below.
3 1 Auto Regressive Integrated Moving Average

ger flow two nearby events, namely, a tennis game and a

Time series models are very resourceful since they can

baseball game are considered [3]. Social media is also widelymodel both linear and non-linear patterns with accurate pre-used as a proxy to estimate the pedestrian flow in the local-

dictions. One such time series model which is useful for ourity. Presence of twitter data makes it an additional feature

current motivation is the Auto Regressive Integrated Mov-for regression modelling. Extraction of a number of uniqueing Average model or ARIMA. It is a uni-variate time series

user tweets were found to be directly proportional to pas-models, basically used for modelling linear time series data

senger flow counts in the metro transit [3]. This gives theand mainly for stationary time series. It is especially useful

researchers information about using social media as a proxyfor short term forecasting of future values.

for pedestrian count estimation.

3 1. 1 AutoRegressive ModelIn the above, both the physical and social media worlds

This is one part of the ARIMA model, the AutoRegres-are discussed. Similarly, there exists a cyber-social world

sive part of the model also represented as AR(p). AR(p)that is predominantly gaining popularity in the research do-

equation ismain. Increasingly, number of people involved in the virtual
gaming environment. As a result, the number of people playing pokemon-go in virtual cyber world were used to predictthe pedestrian flow in the neighbouring locality [8]. However,they were not used as a single feature separately but their ad-

xt = φ1xt−1 + φ2 xt−2 + ...... + φp xt−p + et
3 1. 2 MovingAverage Model
Moving average model or MA(q) makes use of past forecast
errors in regression like model. MA(q) equation isdition gives more useful insights and more conclusions weredrawn.

yt = θ1 et−1 + θ2 et−2 + ...... + θq et−q + etMoreover, there are several factors that also influence peoOne such vital parameter is

To model ARIMA time series, we need to implement cou-

weather factor. Traffic flow characteristics, pedestrian walk-ple of relation functions and determine the p,d,q parameters.

ing environment, transportation safety are all having a major

The list of functions to be implemented includes, auto corre-

impact because of inclement weather[10]. Hence, the model

lation function, partial auto correlation function. From theple movement in the city.

Figure 2 Metadata Analysis

Figure 1 Architectural Flow of the System

Figure 3 Difference of Pedestrian Count on different Days

implementation, we need to determine the parameter values

why RNNs are called recurrent is because they perform thefor the model.

same task for every element of a sequence, with the output
being dependent on the previous computations.

3 2 Vector Auto Regressive Model
The Above time series model is useful for modelling uni-

Another way to think about RNNs is that they have avariate time series data. Several cases we may have more

!Hmemory !Iwhich captures information about what has beenfeatures and more related set of time series. In such cases,

calculated so far. In theory RNNs can make use of infor-

Vector Autoregressive (VAR) models are very useful for mod-mation in arbitrarily long sequences, but they suffer from

elling multivariate time series data. The VAR model is rep-

vanishing gradients problem.

resented as follows:

3 4 Long Short Term Memory
LSTM networks are a special kind of RNN, capable ofyt = dt + At Yt−1 + A2 Yt−2 + ...... + Ap yt−p + ut

learning long-term dependencies. They were introduced bywhere yt = y1t , ....., ykt is a list of k observed time series at

Hochreiter and Schmidhubler[9] and were refined and pop-

time t. In this case, k=2 (Pedestrian count and weather

ularized by many people in research domain. They workdata). yt−1 , yt−2 are list of time series observed at time

tremendously well on large variety of problems and are nowthwidely used for variety of applications. LSTMs are explicitlyt − 1, t − 2 and so on.Ai is the coefficient matrix for the ivalue, ut is the error and dt is a constant.

Each set of variables in the time series is a linear function of past lags of itself and past lags of the other variables.

designed to avoid a long-term dependency problem. Remembering information for long periods of time is practically theirdefault behaviour, not something they struggle to learn.

Similar to ARIMA model VAR model also has a parame-

All recurrent neural networks have the form of a chain ofter value to be determined. The value can be determined

repeating modules of neural networks. In standard RNNs,

with the help of auto correlation and cross correlation func-

this repeating module will have a very simple structure, suchtions. Since we have the pedestrian count data, along withas a single tanh layer. LSTM’s also have this chain like struc-weather data time series we can use them to model the vec-

ture, but the repeating module has a different structure. In-

tor autoregressive model. By training simultaneous weather

stead of having a single neural network layer, there are four,and pedestrian count time series we can use one of the twointeracting in a very special way.

variable as a predictor variable to predict their future count

4 EXPERIMENTS

value, for their corresponding weather series.
3 3 Recurrent Neural Network

4 1 DATASET DESCRIPTION

Recurrent Neural Networks is one of the prominent typeThe dataset used for the model building consists of pedes-of neural networks used in the recent research works. The

trian count data collected from sensors placed around theidea behind RNNs is to make use of sequential information.

different location points in the city of Melbourne. At present

If we want to predict the next value in a sequence we need tothey have around 40 sensors placed in different streets of theknow list of values came before in the sequence. The reason

city. These sensors with hourly granularity take the counting

Figure 4 ARIMA Model forecasting for next day (24 hours)of number of people walking or crossing that specific locality!JCm1!K. They send the updated counts to the central server,

Figure 5 VAR Model forecasting for next day (24 hours)

4 3 WEATHER CORRELATION COMPUTATION

which publishes the data online. We collected the data from

The weather data and its corresponding pedestrian countJan 2016 to Dec 2018. Then the raw data is carefully pre

at same time are taken and for each hour the correlation

processed before applying to the model building.

coefficient is computed and then the average of the all thecorrelation coefficient is taken for overall results.
1 X
pearson(wi , pi )mm∀Hour124 =i=0

The correlation plot in fig(3) is average of all correlation obtained at all the sensor locations taken for the study. The
correlation graph reveals that the weather at most of thehours has an influence on the pedestrian counts. At sometimes, the pedestrian counts may not be positively correlatedwith weather. For example,at hours 4,5,9 they are mostly
negatively correlated. Nevertheless, they are well positively
correlated at other hours, so we can include them for VAR
modelling.
4 4 MODEL BUILDING

Figure 6 Weather vs Pedestrian Correlation

First one of the baseline model ARIMA model, is con4 2 WEATHER DATA

structed. With the three to six months of data taken for

In order to compute the pedestrian count and weather data

model building, we predict the pedestrian count for the next

correlation, we need to extract the weather details for thatday. With the help of ACF and PACF functions, we wereparticular location. With the help of darksky API!JCm2!Kinter-

face, weather details for those different locations are collected

able to retrieve optimum parameters for the model. As aresult ARIMA gives a better result of forecasting.

in the same period of pedestrian count data. Then the cor-

With the same set of pedestrian count data, repeat therelation coefficient and in turn vector autoregressive model

process along with the series of weather data obtained forare computed.

the same time period. Then construct the VAR model by

Apart from the above two datasets, we also crawled the na-

training the model and predicting the next day pedestriantional holidays, state holidays and weekdays/weekends data.

count. It can be seen that VAR model slightly underperforms

These are just the Meta data mentioned in the figure.

compared to ARIMA model.
Since the time series models are having quite a long series of data, it becomes little difficult to capture the depen-!JCm1!K!’http://www.pedestrian.melbourne.vic.gov.au/dencies. These traditional models have difficulties capturing!JCm2!K!’https://darksky.net/dev

them and hence the methodology to try out neural networks

Figure 7 SimpleRNN forecasting for next day (24 hours)

was proposed.
Recurrent neural networks a type of neural networks particularly suited for sequential data is taken to handle thisproblem.

The experiment is repeated with the recurrent

Figure 8 LSTM forecasting for next day (24 hours)

5 RESULTS
All the mentioned time series and neural network models
are implemented for the given problem.

neural network for learning the model. Model training andtesting was done with the same set of data as it was donewith time series models. RNN performed way better than
the traditional time series models.
With the same set of training data, each day of twenty
four hours are sent as input to the model and alternatively

Model

RMSE

ARIMA

55.64

VAR

57.26

BasicRNN

25.23

LSTM
17.23
Table 1 Model and Error Accuracy Measuresremaining set of days are sent as input once the previous day
is processed. As a result a set of sequential data for recurrent

fig(3) is the results of time series forecasting for the fu-

neural network model is developed. Finally, once the modelture pedestrian count. It trains and predicts the pedestrian

training and testing is done it predicts the pedestrian count

count for the next day. Fig(3.a) represents ARIMA modelfor the next day.

and Fig(3.b) represents VAR model.

Since recurrent neural network suffers from vanishing gra-Fig(4) is the future forecasting graph obtained by the neu-

dient problems, special kind of neural network and one of

ral network models. Fig(4.a) and fig(4.b) represent the Sim-the prominent ones for handling sequential time series data

pleRNN based and LSTM based forecasting results respec-

LSTM is used. Exactly the same procedure, that is followed

tively. In all the results of forecasting, the graphs are plottedfor RNN is repeated for LSTM modelling. Same set of datafor pedestrian count against the corresponding hours of thewith same training and testing time are taken. LSTM modelday. Each graph has both the actual value of pedestrianoutperforms all the previous models. Though the difference

count observed and the predicted value by the model curvesin accuracy measures are less between neural network mod-plotted. Time series model tend to have a quite a huge mar-els, but we can clearly see the difference in computation of

gin of errors in forecasting compared to the neural networks.

LSTM and traditional time series models.

Table.1 shows the list of models tried in the experimentand their corresponding error measures. The accuracy measure used here to determine the model efficiency is root meansquare error (RMSE). In the Table.1 each model with their

RMSE are mentioned. The model and accuracy results provide a clear cut insight that LSTM performs bettern thansimple RNN and in more brief the neural network outshine[6]

the time series models in learning short term forecasting ofpedestrian counts.

[7]

6 CONCLUSION and FUTURE WORKIn this paper, the pedestrian count data along with external parameters like weather are included for the modelling[8]

and have been successfully implemented. The time seriesmodels like ARIMA with only pedestrian count data, VAR
with both people count and weather data are implemented.
Then neural network models for sequential data learning like

[9]

RNN, LSTM are also implemented successfully. The overall[10]

work is more of analysis on the prediction of pedestrian countdata for the next day, taking into account the rich historical data in the past. From the analysis, conclusion is LSTM
performs better in terms of accuracy compared to the traditional time series models for forecasting the future pedestrian
counts.
For future work, there is more scope in improving the performance of model building for the current type of problem.
In the current work, there are lot of models constructed foreach location point and for different days. In future, there
will be considerable need to develop less number of models
by incorporating information about holidays, weekdays andweekends into the model rather than being done at preprocessing.
Secondly, the most crucial and challenging work will be topredict the pedestrian counts at location points where there
are no sensors deployed and there is complete absence of historical data. Forecasting the count in data scarce locationsin the city by utilizing the values in the data rich city will besignificant and essential for research community and urban
development managers.

References[1] Schneider, Robert J., Todd Henry, Meghan F. Mitman,
Laura Stonehill, and Jesse Koehler. ”Development and application of the San Francisco pedestrian intersection volume model.” (2013).
[2] Wang, Xianjing, Jonathan Liono, Will Mcintosh, and Flora
D. Salim. ”Predicting the city foot traffic with pedestrian
sensor data.” (2017).
[3] Ni, Ming, Qing He, and Jing Gao.”Forecasting the subway
passenger flow under event occurrences with social media.”IEEE Transactions on Intelligent Transportation Systems
18, no. 6 (2017): 1623-1632.
[4] Freeman, Brian S., Graham Taylor, Bahram Gharabaghi,
and Jesse Th. ”Forecasting air quality time series using
deep learning.” Journal of the Air and Waste Management
Association (2018): 1-21.
[5] Kwoczek, Simon, Sergio Di Martino, and Wolfgang Nejdl.
”Predicting and visualizing traffic congestion in the pres-ence of planned special events.” Journal of Visual Languages and Computing 25, no. 6 (2014): 973-980.
Faruk, Durdu mer. ”A hybrid neural network and ARIMA
model for water quality time series prediction.” Engineering Applications of Artificial Intelligence 23, no. 4 (2010):
586-594.
Zhang, Junbo, Yu Zheng, Dekang Qi, Ruiyuan Li, and Xiuwen Yi. ”DNN-based prediction model for spatio-temporal
data.” In Proceedings of the 24th ACM SIGSPATIAL International Conference on Advances in Geographic Information Systems, p. 92. ACM, 2016.
Wang, Derek, Tingmin Wu, Sheng Wen, Donghai Liu, Yang
Xiang, Wanlei Zhou, Houcine Hassan, and Abdulhameed
Alelaiwi. ”Pokmon GO in Melbourne CBD: A case studyof the cyber-physical symbiotic social networks.” Journal ofcomputational science 26 (2018): 456-467.
Pedestrian Counting System - Government of Melbourne
initiative http://www.pedestrian.melbourne.vic.gov.au/
Lin, Lei, Ming Ni, Qing He, Jing Gao, and Adel W. Sadek.
”Modeling the impacts of inclement weather on freeway
traffic speed: exploratory study with social media data.”
Transportation Research Record: Journal of the Transportation Research Board 2482 (2015): 82-89.