# Prediction of Daily Entrance and Exit Passenger Flow of Rail Transit Stations by Deep Learning Method

Authors: Huaizhong Zhu; Xiaoguang Yang; Yizhe Wang
Journal: Journal of Advanced Transportation
 (2018)

---

## Abstract

The prediction of entrance and exit passenger flow of rail transit stations is one of key research focuses in the area of intelligent transportation. Based on the big data of rail transit IC card (Public Transportation Card), this paper analyzes the data of major dynamic factors having effect on entrance passenger flow and exit passenger flow of rail transit stations: weather data, atmospheric temperature data, holiday and festival data, ground index data, and elevated road data and calculates the daily entrance passenger flow and daily exit passenger flow of individual rail transit stations with data reduction. Furthermore, based on the history data of passenger flow of rail transit stations and relevant influence factors, it applies the deep learning method to choose the relatively optimal hidden layer node by means of the cut-and-try method, set up input data and labeled data, select the activation function and loss function, and use the Adam Gradient Descent Optimization Algorithm for iterative global convergence. The results verify that this method accurately predicts the daily entrance passenger flow and daily exit passenger flow of rail transit stations with the prediction error of less than 4.1%. Finally, the proposed model is compared with the linear regression model.


---

## Body

## 1. Introduction

The urban rail transit systems with high transportation capacity, fast speed, punctuality, low unit energy consumption, low environmental pollution, safety, and reliability are an important part of urban public transportation. The monitoring of urban rail transit passenger flow is included in the critical daily work of rail transit operation units. Accurate passenger flow predictions constitute the basis of reasonable resource allocation for the operation units and of ground public transportation dispatching for public transportation units, so that travel requirements of citizens can be effectively met and their travel experience can be improved while sudden events of high passenger flow can be prevented to protect public safety. Thus, the accuracy and scientific rationality of passenger flow prediction are critical to the operation and management of urban rail transit.There are many factors having effect on rail transit passenger flow. Domestic and foreign scholars have made a lot of researches on them. Li et al. [1] established a multivariable regression model and quantitatively researched the effect of weather factors such as temperature and rainfall on random fluctuation of daily passenger flow of public transportation. Xu et al. [2] utilized the rail transit data of Beijing and discovered that the passenger flow in holidays and festivals varied more significantly than the passenger flow in ordinary days. With a questionnaire survey on rail transit passengers in Beijing, Zheng [3] discovered that the passengers taking rail transit for interchange mostly arrived by walking and the second major source of the passengers was ground public transportation. It could be seen that ground transportation has effect on the flow of passengers taking rail transit for interchange. Not only ground transportation but also elevated transportation has effect on rail transit passenger flow. For travelers, the selection of parking and then taking rail transit for interchange or other traveling modes is related to the conditions of ground transportation and elevated transportation near rail transit stations. Wang et al. [4] researched the site selection model of elevated transportation and urban rail transit-parking interchange facilities and concluded that the potential demand for parking and interchanging at an exit of elevated road was proportional to the daily mean vehicle flow of the elevated road exit. It could be seen that elevated transportation conditions have effect on the flow of passengers parking and taking rail transit for interchange. It is sure that some other minor dynamic factors are also present, such as humidity and air pollution index. However, with relevance analysis by R language, it has been discovered that these factors have very low degree of relevance as well as limited effect.At present, many achievements are also obtained in the area of quantitative research on rail transit passenger flow prediction. Li et al. [5] utilized the MSRBF model with the data of Beijing IC card and predicted the rail transit passenger flow under the circumstance of sudden events. Anvari et al. [6] put forward the Box–Jenkins method based on timing characteristics of passenger flow and utilized this method to predict passenger flow of Istanbul Rail Transit in individual time frames. The mixed EMD-BPN prediction model put forward by Wei and Chen [7] predicted the short-term passenger flow of rail transit in three phases including EMD phase, element identification phase, and BPN phase. Sun et al. [8] put forward the mixed mode Wavelet-SVM method and predicted the short-term passenger flow of Beijing Rail Transit in three phases including breakdown phase, prediction phase, and rebuilding phase. The above-mentioned researches put forward prediction methods and modelling for rail transit passenger flow, but they made little discussion about the rationality of data set partition to be used and were not combined with the multiple factors having effect on rail transit passenger flow. Some of them made prediction according to the change rule of IC card data with time and the data magnitude of their tests was limited so that it was difficult for the resultant model to handle the processing of mass data and the error range of prediction results was excessively large.In conclusion, researches on passenger flow characteristics remain in the simple passenger flow rule research phase and researches on the relevance relation between passenger flow characteristics and their influence factors are relatively few. In view of this reason, this paper puts forward the prediction of entrance and exit passenger flow of rail transit stations by using the deep learning method on the basis of big data of rail transit IC card and in combination with the data of major dynamic factors having effect on entrance and exit passenger flow of rail transit stations: weather data, atmospheric temperature data, holiday and festival data, ground index data, and elevated road data (based on their history data) and verifies that the prediction error is less than 4.1%, by means of experiment.


## 2. Relevant Data Having Effect on Rail Transit Passenger Flow and Data Reduction

### 2.1. Major Relevant Data Having Effect on Rail Transit Passenger Flow

The open data provided in the Shanghai Open Data Apps competition in 2015 includes ten major data sets such as urban road transportation index, rail transit operation data, IC card swipe data, and meteorological data, wherein the urban road transportation index data includes ground index, regional base data of ground road index, and elevated road index. The meteorological data includes weather and atmospheric temperature. This paper is based on five types of data included in the open data: weather data, atmospheric temperature data, holiday and festival data, ground index data, and elevated road data, wherein the holiday and festival data is applicable to the whole city, and the atmospheric temperature data and weather data are the corresponding data of the districts to which corresponding rail transit stations belong. With relevance analysis by R language, the rail transit passenger flow is highly relevant to the maximum value of ground index and the maximum value of elevated road index. The five types of data are used for model input under the precondition of mutual independence from and noninteraction with each other. The IC card swipe data related to entrance and exit passenger flow as well as the ground index data, elevated road data, and meteorological data having effect on the passenger flow are, respectively, introduced as below.The IC card swipe data is the data recorded in April 1st–30th, 2015, and it is saved in the CSV file format, as shown in Table1.Table 1
IC card swipe data.
Card number Transaction date Transaction time Station name Sector name Amount Transaction property 2201252167 2015-04-01 08:55:44 South Shanxi Road Rail transit 4.00 NonpreferentialIn Table1, the station name refers to the Chinese name of bus line or rail transit station, the sector name refers to the bus, rail transit, taxi, ferry, or P + R parking lot, and the transaction property may be nonpreferential, preferential, or none.The ground index data is provided at an interval of 10 minutes, as shown in Table2.Table 2
Ground index data.
Area name Ground area number Time Ground index Jiangwan Stadium 20XW_JWTYC0 2014-08-26 17:40:00 27.80The ground index in Table2 refers to the ground road transportation index. According to the definition at Shanghai transportation and travel website, the road transportation index represents the degree of road transportation operation congestion by using a quantitative method and it is a digital expression of road transportation status. It is expressed as a value in the range of 0–100. If the value is higher, it will indicate that road transportation becomes more congested. The value intervals of the index correspond to transportation congestion phenomena as follows: Clear: [0,30); Somewhat Clear: [30,50); Congested: [50,70); Blocked: [70,100].The elevated road data is provided in two time frames: morning and afternoon, as shown in Table3.Table 3
Elevated road data.
Area number Time Elevated road index Score Speed 01WHWWZ_HX 2014-08-08 10:40:00 22.32 0.92 61.84In Table3, the region corresponding to the area number indicates the specific elevated road name which is used for matching with the name of the nearest elevated road to rail transit station. The elevated road index in the table represents the road transportation index of elevated road and its value ranges from 0 to 100. It is similar to the ground road transportation index and it reflects the condition of elevated road congestion.The meteorological data is provided in 3-hour time frames, as shown in Table4.Table 4
Meteorological data.
Year/month/day/hour/minute Station number Station name Atmospheric temperature Wind direction Wind speed Rainfall 201504061800 58370 Pudong 10.3 57 2.9 3.8Based on the rainfall in Table4, it is judged whether it is raining. If the rainfall is >0, it will indicate a rainy day; otherwise, it will indicate a nonrainy day.


### 2.2. Data Reduction

The data reduction means that useful characteristics of the data depending on discovery target are found out on the basis of understanding mining tasks and own contents of the data to reduce the data size and consequently minimize the data volume under the prerequisite of keeping the original condition of data as far as possible.According to the IC card transaction time and station name, statistics can be prepared at certain time granularity. This paper predicts the entrance passenger flow and exit passenger flow of rail transit station in 1 day. After data reduction, the resultant data is shown in Table5 (with the Dabaishu station as an example).Table 5
Relevant data of passenger flow of Dabaishu rail transit station.
Date Atmospheric temperature Weather Working day Ground index Elevated road index Number of entrances Number of exits 1 22.4 1 1 42.28 37.63 18563 18077 2 31.3 2 1 58.51 43.91 18393 17999 3 14.6 1 1 58.51 38.46 19534 18172 4 17.1 2 2 58.51 20.21 10452 8734 5 13.3 2 2 58.51 35.65 8652 8417 6 11.8 2 2 58.51 34.86 7811 8704 7 8.9 2 1 58.51 50.59 17989 18400 8 11.6 1 1 58.51 34.32 18775 18441 9 13 1 1 58.51 43.33 18664 18220 10 16.1 1 1 51.91 40.28 19911 19259 11 16.8 1 2 45.48 30.99 12972 12097 12 19.6 1 2 41.96 22.9 10486 10601 13 14.4 1 1 54.9 54.82 18279 18098 14 16.1 1 1 52.5 48.02 18463 17956 15 22.4 1 1 54.58 42.4 18722 18302 16 24.3 1 1 52.35 31.62 18524 18265 17 18.8 1 1 51.79 39.17 20147 19200 18 26.3 1 2 44.3 34.64 12552 11750 19 21.7 1 2 37.93 25.85 10370 10509 20 16.2 2 1 58.51 48.96 18158 18108In Table5, the date ranges from April 1st to April 20th, 2015; the atmospheric temperature is taken from Table 4 and represents the daily maximum atmospheric temperature in the corresponding area of rail transit station; the weather is judged on the basis of rainfall: 1 indicates a nonrainy day and 2 indicates a rainy day; the “working day” is judged by means of calculation based on the date: 1 indicates a working day and 2 indicates a nonworking day; the ground index is taken from Table 2: ground index data; the elevated road index is taken from Table 3: elevated road data; the number of passengers entering the station and the number of passengers exiting the station represent the statistics on number of passengers based on the station name in Table 1: IC card swipe data: if the amount is 0, it will indicate entrance into the station; otherwise, it will indicate exit from the station. The reduced data in Table 5 is used as the input data, labeled data, and test data for the prediction by deep learning method.


## 2.1. Major Relevant Data Having Effect on Rail Transit Passenger Flow

The open data provided in the Shanghai Open Data Apps competition in 2015 includes ten major data sets such as urban road transportation index, rail transit operation data, IC card swipe data, and meteorological data, wherein the urban road transportation index data includes ground index, regional base data of ground road index, and elevated road index. The meteorological data includes weather and atmospheric temperature. This paper is based on five types of data included in the open data: weather data, atmospheric temperature data, holiday and festival data, ground index data, and elevated road data, wherein the holiday and festival data is applicable to the whole city, and the atmospheric temperature data and weather data are the corresponding data of the districts to which corresponding rail transit stations belong. With relevance analysis by R language, the rail transit passenger flow is highly relevant to the maximum value of ground index and the maximum value of elevated road index. The five types of data are used for model input under the precondition of mutual independence from and noninteraction with each other. The IC card swipe data related to entrance and exit passenger flow as well as the ground index data, elevated road data, and meteorological data having effect on the passenger flow are, respectively, introduced as below.The IC card swipe data is the data recorded in April 1st–30th, 2015, and it is saved in the CSV file format, as shown in Table1.Table 1
IC card swipe data.
Card number Transaction date Transaction time Station name Sector name Amount Transaction property 2201252167 2015-04-01 08:55:44 South Shanxi Road Rail transit 4.00 NonpreferentialIn Table1, the station name refers to the Chinese name of bus line or rail transit station, the sector name refers to the bus, rail transit, taxi, ferry, or P + R parking lot, and the transaction property may be nonpreferential, preferential, or none.The ground index data is provided at an interval of 10 minutes, as shown in Table2.Table 2
Ground index data.
Area name Ground area number Time Ground index Jiangwan Stadium 20XW_JWTYC0 2014-08-26 17:40:00 27.80The ground index in Table2 refers to the ground road transportation index. According to the definition at Shanghai transportation and travel website, the road transportation index represents the degree of road transportation operation congestion by using a quantitative method and it is a digital expression of road transportation status. It is expressed as a value in the range of 0–100. If the value is higher, it will indicate that road transportation becomes more congested. The value intervals of the index correspond to transportation congestion phenomena as follows: Clear: [0,30); Somewhat Clear: [30,50); Congested: [50,70); Blocked: [70,100].The elevated road data is provided in two time frames: morning and afternoon, as shown in Table3.Table 3
Elevated road data.
Area number Time Elevated road index Score Speed 01WHWWZ_HX 2014-08-08 10:40:00 22.32 0.92 61.84In Table3, the region corresponding to the area number indicates the specific elevated road name which is used for matching with the name of the nearest elevated road to rail transit station. The elevated road index in the table represents the road transportation index of elevated road and its value ranges from 0 to 100. It is similar to the ground road transportation index and it reflects the condition of elevated road congestion.The meteorological data is provided in 3-hour time frames, as shown in Table4.Table 4
Meteorological data.
Year/month/day/hour/minute Station number Station name Atmospheric temperature Wind direction Wind speed Rainfall 201504061800 58370 Pudong 10.3 57 2.9 3.8Based on the rainfall in Table4, it is judged whether it is raining. If the rainfall is >0, it will indicate a rainy day; otherwise, it will indicate a nonrainy day.


## 2.2. Data Reduction

The data reduction means that useful characteristics of the data depending on discovery target are found out on the basis of understanding mining tasks and own contents of the data to reduce the data size and consequently minimize the data volume under the prerequisite of keeping the original condition of data as far as possible.According to the IC card transaction time and station name, statistics can be prepared at certain time granularity. This paper predicts the entrance passenger flow and exit passenger flow of rail transit station in 1 day. After data reduction, the resultant data is shown in Table5 (with the Dabaishu station as an example).Table 5
Relevant data of passenger flow of Dabaishu rail transit station.
Date Atmospheric temperature Weather Working day Ground index Elevated road index Number of entrances Number of exits 1 22.4 1 1 42.28 37.63 18563 18077 2 31.3 2 1 58.51 43.91 18393 17999 3 14.6 1 1 58.51 38.46 19534 18172 4 17.1 2 2 58.51 20.21 10452 8734 5 13.3 2 2 58.51 35.65 8652 8417 6 11.8 2 2 58.51 34.86 7811 8704 7 8.9 2 1 58.51 50.59 17989 18400 8 11.6 1 1 58.51 34.32 18775 18441 9 13 1 1 58.51 43.33 18664 18220 10 16.1 1 1 51.91 40.28 19911 19259 11 16.8 1 2 45.48 30.99 12972 12097 12 19.6 1 2 41.96 22.9 10486 10601 13 14.4 1 1 54.9 54.82 18279 18098 14 16.1 1 1 52.5 48.02 18463 17956 15 22.4 1 1 54.58 42.4 18722 18302 16 24.3 1 1 52.35 31.62 18524 18265 17 18.8 1 1 51.79 39.17 20147 19200 18 26.3 1 2 44.3 34.64 12552 11750 19 21.7 1 2 37.93 25.85 10370 10509 20 16.2 2 1 58.51 48.96 18158 18108In Table5, the date ranges from April 1st to April 20th, 2015; the atmospheric temperature is taken from Table 4 and represents the daily maximum atmospheric temperature in the corresponding area of rail transit station; the weather is judged on the basis of rainfall: 1 indicates a nonrainy day and 2 indicates a rainy day; the “working day” is judged by means of calculation based on the date: 1 indicates a working day and 2 indicates a nonworking day; the ground index is taken from Table 2: ground index data; the elevated road index is taken from Table 3: elevated road data; the number of passengers entering the station and the number of passengers exiting the station represent the statistics on number of passengers based on the station name in Table 1: IC card swipe data: if the amount is 0, it will indicate entrance into the station; otherwise, it will indicate exit from the station. The reduced data in Table 5 is used as the input data, labeled data, and test data for the prediction by deep learning method.


## 3. Prediction of Daily Entrance Passenger Flow and Daily Exit Passenger Flow of Rail Transit Stations

### 3.1. Brief Introduction to Deep Learning

Since 2013, the big data has gradually prevailed in researches in the area of intelligent transportation. The application of deep learning especially [9] makes the artificial intelligence based on big data become possible. The concept of deep learning originates from the research on artificial neural network. The multilayer perceptron neural network containing multiple hidden layers is a deep learning structure. The multilayer neural network has three or more network layers. In other words, it includes at least input layer, one or more hidden layer, and output layer [10, 11]. The deep learning solves two problems in conventional multilayer neural networks, that is, local optimal solution and algorithm overfitting, so that the training of neural network can achieve global convergence to obtain the optimal solution. From the view of statistics and calculations, the deep learning is especially suitable for processing big data and it improves the accuracy of statistical estimation by means of big data.


### 3.2. Deep Learning Method Selection and Parameter Optimization

The deep learning neural network used in this paper is divided into 3 layers, wherein the first layer is the input layer which includes 5 nodes, respectively, corresponding to the data of atmospheric temperature, weather, working day or not, ground index, and elevated road index; the second layer is the hidden layer and the cut-and-try method is applied to select the optimal number of nodes for this layer; the third layer is the output layer which includes 1 node corresponding to the passenger flow (the entrance passenger flow and exit passenger flow are, respectively, predicted).For the number of nodes in the hidden layer, the normal calculation formula is shown as follows [12]:(1)Number  of  hidden  layer  nodes=α+Number  of  input  layer  nodes+Number  of  output  layer  nodeswhere α represents an integer in the range of 1–10.For the passenger flow prediction in this paper, the cut-and-try method is applied and the data of entrance passenger flow and exit passenger flow of Dabaishu station is utilized to determine the optimal number of nodes in the hidden layer.In view of the Mean Squared Error (MSE), the Mean Squared Relative Error (MSRE) is used for the training error in this paper to evaluate the fitting degree of training. The smaller the MSRE of training is, the higher the fitting degree will become. The calculation formula is shown as follows:(2)MSRE  of  training=∑i=1Training  sample  sizePredicted  value-Actual  value  of  training  sample  No.i/Actual  value  of  training  sample  No.i2Training  sample  size.For the test error, the relative error rate of prediction is utilized to evaluate the accuracy of prediction. The smaller the test error is, the higher the accuracy will become. The calculation formula is shown as follows:(3)Test  error=Predicted  value-Actual  value  for  testActual  value  for  test.The number of hidden layer nodes for the cut-and-try method testing is 4–13, and the number of training epochs is 5000. The result is shown in Table6.Table 6
Comparison 1 for selection test of number of hidden layer nodes.
Number of nodes Data type MSRE of training Test error 4 Exit 0.000367 0.004167 5 Exit 0.000492 0.077597 6 Exit 1.37910 E - 05 0.085266 7 Exit 9.46109 E - 05 0.004669 8 Exit 2.98736 E - 05 0.008882 9 Exit 2.16080 E - 06 0.041077 10 Exit 3.19902 E - 05 0.054408 11 Exit 6.06313 E - 06 0.048841 12 Exit 4.51542 E - 07 0.059716 13 Exit 3.95269 E - 06 0.052507When the entrance passenger flow is used as training data, conduct the same test. The comparison result of selection test of number of hidden layer nodes is shown in Table7.Table 7
Comparison 2 for selection test of number of hidden layer nodes.
Number of nodes Data type MSRE of training Test error 4 Entrance 8.52241 E - 05 0.012505 5 Entrance 1.06718 E - 05 0.026043 6 Entrance 6.48774 E - 07 0.005989 7 Entrance 6.57961 E - 05 0.003632 8 Entrance 1.76762 E - 05 0.059969 9 Entrance 1.08275 E - 06 0.054787 10 Entrance 1.93677 E - 06 0.059756 11 Entrance 6.00217 E - 05 0.007031 12 Entrance 4.35916 E - 09 0.017915 13 Entrance 3.5522 E - 06 0.082371With comparison between Table6 and Table 7, when the selected number of hidden layer nodes is 7, the training error of exit passenger flow prediction is 9.46109E-05 and its test error is 0.004669; the training error of entrance passenger flow prediction is 6.57961E-05 and its test error is 0.003632. It is relatively optimal in comparison with any other number of nodes.In the above-mentioned cut-and-try method test, the number of training epochs is 5000. The number of training epochs has a very close relationship with the training error, as shown in Figure1.Figure 1
Diagram of relationship between training error and epochs.Generally, the higher the number of training epochs is, the smaller the error will become. In Figure1, when the number of training epochs is 900, the error already approaches to 0. The number of training epochs used in this paper is 5000. In consideration of machine performance and training time, it is not suitable to use an excessively high number of training epochs.


### 3.3. Passenger Flow Prediction Process and Predictions

According to the above setting, use the deep learning method for training and calculate the predicted value of passenger flow. The prediction process is shown in Figure2.Figure 2
Prediction process of daily passenger flow of rail transit station.The process in Figure2 mainly describes the process of predicting passenger flow by deep learning method as put forward in this paper. The module shown in dashed line in the left side means that the relevant history data of passenger flow of rail transit station listed in Table 5 is read from the csv file, the data of 5 dynamic factors having effect on passenger flow is set up as the input data, and the history data of passenger flow is set up as the labeled data. The module shown in dashed line in the right side includes the establishment of deep learning method as follows: respectively, set up the number of nodes in individual layers for the model (5 nodes for the input layer, 7 nodes for the hidden layer, and 1 node for the output layer); define the Mean Squared Error as the loss function; use the Adam Gradient Descent Optimization Algorithm to achieve iterative global convergence; conduct training after the number of training epochs is set to 5000; save the weight and predict the passenger flow upon completion of training. The prediction of daily entrance passenger flow of rail transit stations with application of the above-mentioned process is shown in Figure 3 (with the Dabaishu station as an example).Figure 3
Prediction of daily entrance passenger flow of Dabaishu rail transit station.
(a) (b)The curve in Figure3(a) represents the history record of entrance passenger flow of Dabaishu rail transit station in April 1st–19th. According to the curve graph, it could be seen that the daily entrance passenger flow of this station presents a zigzag fluctuation of passenger flow under the influence of various objective factors and the range of fluctuation is 7811–20147 persons. The curve in Figure 3(b) represents the entrance passenger flow predicted on the basis of training weight of 5 types dynamic influence factors. According to the predicted curve, it is shown that the prediction result of entrance passenger flow of Dabaishu rail transit station on April 20th is 18023 persons. The actual entrance passenger flow was 18158 persons. Thus, the prediction error is 0.743%.Similarly, the prediction of daily exit passenger flow of rail transit station is shown in Figure4 (with the Dabaishu station as an example).Figure 4
Prediction of daily exit passenger flow of Dabaishu rail transit station.
(a) (b)The curve in Figure4(a) represents the history record of exit passenger flow of Dabaishu rail transit station in April 1st–19th. The curve in Figure 4(b) represents the predicted exit passenger flow. According to the predicted curve, it is shown that the prediction result of exit passenger flow of Dabaishu rail transit station on April 20th is 17489 persons. The actual exit passenger flow was 18108 persons. Thus, the prediction error is 3.42%.The above predictions are based on one hidden layer. With two hidden layers, the entrance passenger flow of Dabaishu rail transit station on April 20th is predicted. The prediction result is 18794 persons. The actual entrance passenger flow was 18158 persons. Thus, the prediction error is 3.5%. It is shown in Figure5.Figure 5
Prediction of daily entrance passenger flow of Dabaishu rail transit station (2 hidden layers).
(a) (b)The above prediction uses one hidden layer. With two hidden layers, the exit passenger flow of Dabaishu rail transit station on April 20th is predicted. The prediction result is 17530 persons. The actual exit passenger flow was 18108 persons. Thus, the prediction error is 3.19%. It is shown in Figure6.Figure 6
Prediction of daily exit passenger flow of Dabaishu rail transit station (2 hidden layers).
(a) (b)With three hidden layers, the entrance passenger flow of Dabaishu rail transit station on April 20th is predicted. The prediction result is 17532 persons. The actual entrance passenger flow was 18158 persons. Thus, the prediction error is 3.45%. It is shown in Figure7.Figure 7
Prediction of daily entrance passenger flow of Dabaishu rail transit station (3 hidden layers).
(a) (b)With three hidden layers, the exit passenger flow of Dabaishu rail transit station on April 20th is predicted. The prediction result is 16595 persons. The actual exit passenger flow was 18108 persons. Thus, the prediction error is 8.36%. It is shown in Figure8.Figure 8
Prediction of daily exit passenger flow of Dabaishu rail transit station (3 hidden layers).
(a) (b)The comparison of MSRE of training (with the formula (2)) and test error (with the formula (3)) among one hidden layer, two hidden layers, and three hidden layers is shown in Table 8.Table 8
Comparison among tests with one hidden layer, two hidden layers, and three hidden layers.
Number ofhidden layers Data type MSRE of training Test error 1 Entrance 9.65358 E - 05 2.9% 1 Exit 3.01996 E - 06 3.42% 2 Entrance 1.75225 E - 06 3.5% 2 Exit 6.87466 E - 13 3.19% 3 Entrance 2.87652 E - 07 3.45% 3 Exit 4.54518 E - 06 8.36%As shown in Table8, as the number of hidden layers increases, the MSRE of training becomes relatively lower. It indicates that the model highly fits the training data. At the same time, the test error becomes relatively higher. It indicates the reduced accuracy of model prediction, that is, the overfitting of deep learning. There is no universal agreement on how many layers a deep learning network should have. Generally, the number of hidden layers for deep learning is related to the size of data set. The determination of optimal number of hidden layers is included in the key contents of deep learning model exploration and also represents one of current research topics in the industry. At present, the cut-and-try method is usually applied to deep learning applications to determine the number of hidden layers. According to the data in Table 8, the deep learning model with one hidden layer achieves a higher accuracy for the data in this paper. The above experimental results show that considering neural networks deeper than one hidden layers was unnecessary for our problem which has only five input variables. Although the network structure utilized in our study with only one hidden layer cannot be regarded as a truly “deep” neural network, it fully exploits the main idea of deep learning methods and can be easily extended once more input variables are provided.According to the training principle of deep learning, the more the training samples are, the smaller the prediction error will become. A comparison test is conducted with the sample data selected for daily exit passenger flow. The 13-day training samples are utilized in Figure9 to predict the daily exit passenger flow of rail transit station on April 20th. The prediction result is 17257 persons and the prediction error is 4.700%. It is higher than the 3.42% prediction error in Figure 4. Consequently, it is shown that the less the training samples are, the higher the prediction error will become. When the training samples are excessively insufficient, no prediction is possible. When the 12-day training samples are used for prediction, a failure prompt occurs.Figure 9
Prediction of daily exit passenger flow of Dabaishu rail transit station based on 13-day training samples.
(a) (b)This deep learning model can predict the daily entrance passenger flow or daily exit passenger flow of rail transit station at any day. The passenger flow data of Wuwei rail transit station is used for prediction as follows. After data reduction, the resultant data is shown in Table9.Table 9
Relevant data of passenger flow of Wuwei rail transit station.
Date Atmospheric temperature Weather Working day Ground index Elevated road index Number of entrances Number of exits 1 25.4 1 1 24.76 26.68 2303 2149 2 31.3 1 1 25.44 30.32 2217 2027 3 14.7 2 1 26.58 29.61 2291 2062 4 17.1 1 2 22.84 19.43 1409 1222 5 13.8 2 2 21.77 17.38 1192 1158 6 11.7 2 2 21.49 19.67 1115 1087 7 8.9 2 1 24.76 30.00 2192 1976 8 11.7 1 1 25.00 24.84 2270 2125 9 14.5 1 1 25.65 29.92 2335 2184 10 16.6 1 1 25.52 22.13 2370 2197 11 19.2 1 2 23.34 19.20 1682 1542 12 21.4 1 2 22.21 28.67 1490 1390 13 14.9 1 1 25.89 27.35 2233 2108 14 16.5 1 1 25.03 27.48 2327 2165In Table9, the exit passenger flow at Day 14 was 2165 persons and it was obviously different from the exit passenger flow at Day 7, which was 1976 persons. The prediction of exit passenger flow at Day 14 with the deep learning model in this paper is shown in Figure 10.Figure 10
Prediction of exit passenger flow of Wuwei rail transit station at Day 14.
(a) (b)The prediction result is 2154 persons. The actual daily entrance passenger flow was 2165 persons. Thus, the prediction error is 0.51%. As shown in Table5, the rainy weather at Day 20 is classified as one abnormal mode for this city (for some cities, the sunny weather is classified as one abnormal mode). For the case verification under this paper, the daily entrance passenger flow or daily exit passenger flow at Day 20 is chosen for prediction.With the passenger flow data of Wuwei rail transit station in Table9, the multiple linear regression is utilized to, respectively, predict the entrance passenger flow and exit passenger flow of Wuwei rail transit station at Day 14. The result of prediction of daily entrance passenger flow is shown in Figure 11.Figure 11
Prediction of daily entrance passenger flow of Wuwei rail transit station (multiple linear regression).
(a) (b)The prediction result is 2303 persons. The actual daily entrance passenger flow was 2327 persons. Thus, the prediction error is 1.03%. The MSRE of training is 0.001782145. The result of prediction of daily exit passenger flow is shown in Figure12.Figure 12
Prediction of daily exit passenger flow of Wuwei rail transit station (multiple linear regression).
(a) (b)The prediction result is 2196 persons. The actual daily exit passenger flow was 2165 persons. Thus, the prediction error is 1.43%. The MSRE of training is 0.001532426.The comparison of MSRE of training (with the formula (2)) and test error (with the formula (3)) between deep learning model and multiple linear regression is shown in Table 10.Table 10
Comparison between deep learning model and multiple linear regression (Wuwei station).
Model type Data type MSRE of training Test error Deep learning Entrance 1.25627 E - 11 0.6% Deep learning Exit 5.96224 E - 09 0.51% Linear regression Entrance 0.001782145 1.03% Linear regression Exit 0.001532426 1.43%As shown in Table10, in comparison with the deep learning model, the MSRE of training of multiple linear regression is higher. In other words, the degree of data fit is low. Thus, the fluctuation of prediction error will be relatively large (additional, in line 1, the number of training epochs is 6000).


## 3.1. Brief Introduction to Deep Learning

Since 2013, the big data has gradually prevailed in researches in the area of intelligent transportation. The application of deep learning especially [9] makes the artificial intelligence based on big data become possible. The concept of deep learning originates from the research on artificial neural network. The multilayer perceptron neural network containing multiple hidden layers is a deep learning structure. The multilayer neural network has three or more network layers. In other words, it includes at least input layer, one or more hidden layer, and output layer [10, 11]. The deep learning solves two problems in conventional multilayer neural networks, that is, local optimal solution and algorithm overfitting, so that the training of neural network can achieve global convergence to obtain the optimal solution. From the view of statistics and calculations, the deep learning is especially suitable for processing big data and it improves the accuracy of statistical estimation by means of big data.


## 3.2. Deep Learning Method Selection and Parameter Optimization

The deep learning neural network used in this paper is divided into 3 layers, wherein the first layer is the input layer which includes 5 nodes, respectively, corresponding to the data of atmospheric temperature, weather, working day or not, ground index, and elevated road index; the second layer is the hidden layer and the cut-and-try method is applied to select the optimal number of nodes for this layer; the third layer is the output layer which includes 1 node corresponding to the passenger flow (the entrance passenger flow and exit passenger flow are, respectively, predicted).For the number of nodes in the hidden layer, the normal calculation formula is shown as follows [12]:(1)Number  of  hidden  layer  nodes=α+Number  of  input  layer  nodes+Number  of  output  layer  nodeswhere α represents an integer in the range of 1–10.For the passenger flow prediction in this paper, the cut-and-try method is applied and the data of entrance passenger flow and exit passenger flow of Dabaishu station is utilized to determine the optimal number of nodes in the hidden layer.In view of the Mean Squared Error (MSE), the Mean Squared Relative Error (MSRE) is used for the training error in this paper to evaluate the fitting degree of training. The smaller the MSRE of training is, the higher the fitting degree will become. The calculation formula is shown as follows:(2)MSRE  of  training=∑i=1Training  sample  sizePredicted  value-Actual  value  of  training  sample  No.i/Actual  value  of  training  sample  No.i2Training  sample  size.For the test error, the relative error rate of prediction is utilized to evaluate the accuracy of prediction. The smaller the test error is, the higher the accuracy will become. The calculation formula is shown as follows:(3)Test  error=Predicted  value-Actual  value  for  testActual  value  for  test.The number of hidden layer nodes for the cut-and-try method testing is 4–13, and the number of training epochs is 5000. The result is shown in Table6.Table 6
Comparison 1 for selection test of number of hidden layer nodes.
Number of nodes Data type MSRE of training Test error 4 Exit 0.000367 0.004167 5 Exit 0.000492 0.077597 6 Exit 1.37910 E - 05 0.085266 7 Exit 9.46109 E - 05 0.004669 8 Exit 2.98736 E - 05 0.008882 9 Exit 2.16080 E - 06 0.041077 10 Exit 3.19902 E - 05 0.054408 11 Exit 6.06313 E - 06 0.048841 12 Exit 4.51542 E - 07 0.059716 13 Exit 3.95269 E - 06 0.052507When the entrance passenger flow is used as training data, conduct the same test. The comparison result of selection test of number of hidden layer nodes is shown in Table7.Table 7
Comparison 2 for selection test of number of hidden layer nodes.
Number of nodes Data type MSRE of training Test error 4 Entrance 8.52241 E - 05 0.012505 5 Entrance 1.06718 E - 05 0.026043 6 Entrance 6.48774 E - 07 0.005989 7 Entrance 6.57961 E - 05 0.003632 8 Entrance 1.76762 E - 05 0.059969 9 Entrance 1.08275 E - 06 0.054787 10 Entrance 1.93677 E - 06 0.059756 11 Entrance 6.00217 E - 05 0.007031 12 Entrance 4.35916 E - 09 0.017915 13 Entrance 3.5522 E - 06 0.082371With comparison between Table6 and Table 7, when the selected number of hidden layer nodes is 7, the training error of exit passenger flow prediction is 9.46109E-05 and its test error is 0.004669; the training error of entrance passenger flow prediction is 6.57961E-05 and its test error is 0.003632. It is relatively optimal in comparison with any other number of nodes.In the above-mentioned cut-and-try method test, the number of training epochs is 5000. The number of training epochs has a very close relationship with the training error, as shown in Figure1.Figure 1
Diagram of relationship between training error and epochs.Generally, the higher the number of training epochs is, the smaller the error will become. In Figure1, when the number of training epochs is 900, the error already approaches to 0. The number of training epochs used in this paper is 5000. In consideration of machine performance and training time, it is not suitable to use an excessively high number of training epochs.


## 3.3. Passenger Flow Prediction Process and Predictions

According to the above setting, use the deep learning method for training and calculate the predicted value of passenger flow. The prediction process is shown in Figure2.Figure 2
Prediction process of daily passenger flow of rail transit station.The process in Figure2 mainly describes the process of predicting passenger flow by deep learning method as put forward in this paper. The module shown in dashed line in the left side means that the relevant history data of passenger flow of rail transit station listed in Table 5 is read from the csv file, the data of 5 dynamic factors having effect on passenger flow is set up as the input data, and the history data of passenger flow is set up as the labeled data. The module shown in dashed line in the right side includes the establishment of deep learning method as follows: respectively, set up the number of nodes in individual layers for the model (5 nodes for the input layer, 7 nodes for the hidden layer, and 1 node for the output layer); define the Mean Squared Error as the loss function; use the Adam Gradient Descent Optimization Algorithm to achieve iterative global convergence; conduct training after the number of training epochs is set to 5000; save the weight and predict the passenger flow upon completion of training. The prediction of daily entrance passenger flow of rail transit stations with application of the above-mentioned process is shown in Figure 3 (with the Dabaishu station as an example).Figure 3
Prediction of daily entrance passenger flow of Dabaishu rail transit station.
(a) (b)The curve in Figure3(a) represents the history record of entrance passenger flow of Dabaishu rail transit station in April 1st–19th. According to the curve graph, it could be seen that the daily entrance passenger flow of this station presents a zigzag fluctuation of passenger flow under the influence of various objective factors and the range of fluctuation is 7811–20147 persons. The curve in Figure 3(b) represents the entrance passenger flow predicted on the basis of training weight of 5 types dynamic influence factors. According to the predicted curve, it is shown that the prediction result of entrance passenger flow of Dabaishu rail transit station on April 20th is 18023 persons. The actual entrance passenger flow was 18158 persons. Thus, the prediction error is 0.743%.Similarly, the prediction of daily exit passenger flow of rail transit station is shown in Figure4 (with the Dabaishu station as an example).Figure 4
Prediction of daily exit passenger flow of Dabaishu rail transit station.
(a) (b)The curve in Figure4(a) represents the history record of exit passenger flow of Dabaishu rail transit station in April 1st–19th. The curve in Figure 4(b) represents the predicted exit passenger flow. According to the predicted curve, it is shown that the prediction result of exit passenger flow of Dabaishu rail transit station on April 20th is 17489 persons. The actual exit passenger flow was 18108 persons. Thus, the prediction error is 3.42%.The above predictions are based on one hidden layer. With two hidden layers, the entrance passenger flow of Dabaishu rail transit station on April 20th is predicted. The prediction result is 18794 persons. The actual entrance passenger flow was 18158 persons. Thus, the prediction error is 3.5%. It is shown in Figure5.Figure 5
Prediction of daily entrance passenger flow of Dabaishu rail transit station (2 hidden layers).
(a) (b)The above prediction uses one hidden layer. With two hidden layers, the exit passenger flow of Dabaishu rail transit station on April 20th is predicted. The prediction result is 17530 persons. The actual exit passenger flow was 18108 persons. Thus, the prediction error is 3.19%. It is shown in Figure6.Figure 6
Prediction of daily exit passenger flow of Dabaishu rail transit station (2 hidden layers).
(a) (b)With three hidden layers, the entrance passenger flow of Dabaishu rail transit station on April 20th is predicted. The prediction result is 17532 persons. The actual entrance passenger flow was 18158 persons. Thus, the prediction error is 3.45%. It is shown in Figure7.Figure 7
Prediction of daily entrance passenger flow of Dabaishu rail transit station (3 hidden layers).
(a) (b)With three hidden layers, the exit passenger flow of Dabaishu rail transit station on April 20th is predicted. The prediction result is 16595 persons. The actual exit passenger flow was 18108 persons. Thus, the prediction error is 8.36%. It is shown in Figure8.Figure 8
Prediction of daily exit passenger flow of Dabaishu rail transit station (3 hidden layers).
(a) (b)The comparison of MSRE of training (with the formula (2)) and test error (with the formula (3)) among one hidden layer, two hidden layers, and three hidden layers is shown in Table 8.Table 8
Comparison among tests with one hidden layer, two hidden layers, and three hidden layers.
Number ofhidden layers Data type MSRE of training Test error 1 Entrance 9.65358 E - 05 2.9% 1 Exit 3.01996 E - 06 3.42% 2 Entrance 1.75225 E - 06 3.5% 2 Exit 6.87466 E - 13 3.19% 3 Entrance 2.87652 E - 07 3.45% 3 Exit 4.54518 E - 06 8.36%As shown in Table8, as the number of hidden layers increases, the MSRE of training becomes relatively lower. It indicates that the model highly fits the training data. At the same time, the test error becomes relatively higher. It indicates the reduced accuracy of model prediction, that is, the overfitting of deep learning. There is no universal agreement on how many layers a deep learning network should have. Generally, the number of hidden layers for deep learning is related to the size of data set. The determination of optimal number of hidden layers is included in the key contents of deep learning model exploration and also represents one of current research topics in the industry. At present, the cut-and-try method is usually applied to deep learning applications to determine the number of hidden layers. According to the data in Table 8, the deep learning model with one hidden layer achieves a higher accuracy for the data in this paper. The above experimental results show that considering neural networks deeper than one hidden layers was unnecessary for our problem which has only five input variables. Although the network structure utilized in our study with only one hidden layer cannot be regarded as a truly “deep” neural network, it fully exploits the main idea of deep learning methods and can be easily extended once more input variables are provided.According to the training principle of deep learning, the more the training samples are, the smaller the prediction error will become. A comparison test is conducted with the sample data selected for daily exit passenger flow. The 13-day training samples are utilized in Figure9 to predict the daily exit passenger flow of rail transit station on April 20th. The prediction result is 17257 persons and the prediction error is 4.700%. It is higher than the 3.42% prediction error in Figure 4. Consequently, it is shown that the less the training samples are, the higher the prediction error will become. When the training samples are excessively insufficient, no prediction is possible. When the 12-day training samples are used for prediction, a failure prompt occurs.Figure 9
Prediction of daily exit passenger flow of Dabaishu rail transit station based on 13-day training samples.
(a) (b)This deep learning model can predict the daily entrance passenger flow or daily exit passenger flow of rail transit station at any day. The passenger flow data of Wuwei rail transit station is used for prediction as follows. After data reduction, the resultant data is shown in Table9.Table 9
Relevant data of passenger flow of Wuwei rail transit station.
Date Atmospheric temperature Weather Working day Ground index Elevated road index Number of entrances Number of exits 1 25.4 1 1 24.76 26.68 2303 2149 2 31.3 1 1 25.44 30.32 2217 2027 3 14.7 2 1 26.58 29.61 2291 2062 4 17.1 1 2 22.84 19.43 1409 1222 5 13.8 2 2 21.77 17.38 1192 1158 6 11.7 2 2 21.49 19.67 1115 1087 7 8.9 2 1 24.76 30.00 2192 1976 8 11.7 1 1 25.00 24.84 2270 2125 9 14.5 1 1 25.65 29.92 2335 2184 10 16.6 1 1 25.52 22.13 2370 2197 11 19.2 1 2 23.34 19.20 1682 1542 12 21.4 1 2 22.21 28.67 1490 1390 13 14.9 1 1 25.89 27.35 2233 2108 14 16.5 1 1 25.03 27.48 2327 2165In Table9, the exit passenger flow at Day 14 was 2165 persons and it was obviously different from the exit passenger flow at Day 7, which was 1976 persons. The prediction of exit passenger flow at Day 14 with the deep learning model in this paper is shown in Figure 10.Figure 10
Prediction of exit passenger flow of Wuwei rail transit station at Day 14.
(a) (b)The prediction result is 2154 persons. The actual daily entrance passenger flow was 2165 persons. Thus, the prediction error is 0.51%. As shown in Table5, the rainy weather at Day 20 is classified as one abnormal mode for this city (for some cities, the sunny weather is classified as one abnormal mode). For the case verification under this paper, the daily entrance passenger flow or daily exit passenger flow at Day 20 is chosen for prediction.With the passenger flow data of Wuwei rail transit station in Table9, the multiple linear regression is utilized to, respectively, predict the entrance passenger flow and exit passenger flow of Wuwei rail transit station at Day 14. The result of prediction of daily entrance passenger flow is shown in Figure 11.Figure 11
Prediction of daily entrance passenger flow of Wuwei rail transit station (multiple linear regression).
(a) (b)The prediction result is 2303 persons. The actual daily entrance passenger flow was 2327 persons. Thus, the prediction error is 1.03%. The MSRE of training is 0.001782145. The result of prediction of daily exit passenger flow is shown in Figure12.Figure 12
Prediction of daily exit passenger flow of Wuwei rail transit station (multiple linear regression).
(a) (b)The prediction result is 2196 persons. The actual daily exit passenger flow was 2165 persons. Thus, the prediction error is 1.43%. The MSRE of training is 0.001532426.The comparison of MSRE of training (with the formula (2)) and test error (with the formula (3)) between deep learning model and multiple linear regression is shown in Table 10.Table 10
Comparison between deep learning model and multiple linear regression (Wuwei station).
Model type Data type MSRE of training Test error Deep learning Entrance 1.25627 E - 11 0.6% Deep learning Exit 5.96224 E - 09 0.51% Linear regression Entrance 0.001782145 1.03% Linear regression Exit 0.001532426 1.43%As shown in Table10, in comparison with the deep learning model, the MSRE of training of multiple linear regression is higher. In other words, the degree of data fit is low. Thus, the fluctuation of prediction error will be relatively large (additional, in line 1, the number of training epochs is 6000).


## 4. Example Verification and Analysis

For the deep learning method put forward in this paper, the Wuwei Road Station in Shanghai Rail Transit Line 11 and the Yanchang Road rail transit station in Shanghai Line 1 are selected at random for daily entrance passenger flow prediction and daily exit passenger flow prediction. The results are shown in Table11.Table 11
Training error and test error of prediction on other rail transit stations.
Station name Data type MSRE of training Test error Wuwei Road Exit 0.000492401 0.015112 Wuwei Road Entrance 0.000175157 0.032301 Yanchang Road Exit 2.23271 E - 05 0.040324 Yanchang Road Entrance 8.20426 E - 07 0.018451According to the data in Table11, it could be found that the training error for MSRE of training is lower than 0.000492401. It indicates that the deep learning method in this paper achieves a very high fitting degree. From the view of test error, the values are lower than 0.040324. It indicates that this model has very strong generalization capability and it is suitable for prediction of entrance and exit passenger flow of individual rail transit stations.


## 5. Conclusions

This paper puts forward the approach of prediction of daily entrance passenger flow and daily exit passenger flow of rail transit stations by using the deep learning method on the basis of big data of IC card swipe at rail transit stations in Shanghai and in combination with the data of 5 major dynamic factors having effect on entrance and exit passenger flow of rail transit stations. By means of experiment, it is verified that the training error and prediction error and accuracy of the model put forward in this paper are higher than those of currently known prediction methods and its prediction error is lower than 4.1%. The model is suitable for accurately predicting the daily entrance passenger flow and daily exit passenger flow of rail transit stations. For the management of urban public transportation, on the one hand, conduct quantitative analyses on distribution and change conditions of passenger flow by establishing a series of statistical indices to directly provide decision-making bases for operation adjustment; on the other hand, analyze the major dynamic influence factors leading to the occurrence of certain change rule to the passenger flow and use them in the building of passenger flow prediction model for short-term passenger flow prediction to provide passenger flow data support for operation units. With the continuous enrichment of relevant transportation data, the continuous improvement in data of the factors having effect on rail transit passenger flow, and the continuous advancement of artificial intelligence for predicting rail transit passenger flow, the accuracy of prediction of rail transit passenger flow must become increasingly higher in future.



---

*Source: 6142724-2018-04-22.xml*