Method of Predicting Passenger Flow in Scenic Areas Considering Multisource Traffic Data

The rapid growth of passenger flows has brought a series of challenges to the environment and safety management of tourist attractions. It is vital to establish an accurate passenger flow prediction model to reduce the risks associated with human flows. Owing to the limitation of a single data source, the existing research on the prediction of tourist flows in scenic spots ignores the impact of public transport passengers on the internal tourist flow in scenic areas. The prediction model lacks the learning process of data samples, and the ability of generalization and self-study is weak. In this paper, we propose a new method of predicting passenger flow in scenic areas based on a convolutional neural network and long short-term memory (CNN-LSTM) hybrid neural network (HNN) model, which considers the multisource traffic flow around a scenic area. It uses a series of HNNs to mine the temporal and spatial correlation between the passenger flows from multiple sources and solves the problem of data stability dependence. The time series of the passenger flow in the study area was designed and extracted on the basis of the spatial analysis of South Luogu Lane in Beijing, and the input structure was constructed by combining the multisource traffic passenger flow dimension. This model for predicting passenger flow in scenic areas based on CNN-LSTM provides a reference for the comprehensive application of multisource data in scenic areas and has high accuracy and robustness.


Introduction
Passenger flow prediction in scenic areas plays a key role in their development. Accurate passenger flow prediction facilitates relevant departments to carry out safety risk management and control and improve the safety management of scenic areas. (1) With the continuous improvement of computer performance, the world has entered the era of big data, and the mining of tourism data has also transitioned from the collection and analysis of sparse samples to multisource big-data comprehensive analysis. However, the existing research, which ignores the impact of the spatiotemporal distribution of public transport passenger flow on the passenger flow inside a scenic area, is mostly based on the single-source monitoring data of passenger flow, mainly relying on the manual investigation or installation of fixed information collection equipment for data acquisition. The method for gathering and evaluating the passenger flow in urban tourist attractions should go hand in hand with the changes in passenger flow inside the scenic area. (2)(3)(4)(5) Therefore, in this paper, we consider fusing the prediction of multisource traffic passenger flows around scenic areas and passenger flows in the core area. Buses, subways, taxis, and shared bicycles are the main research objects of scholars of passenger flows because these are the most important modes of transportation in cities. The related research of scholars has mainly focused on the large-scale passenger flow distribution and passenger behavior pattern mining, while there have been few studies on passenger flow in scenic areas using traffic passenger flow data. For example, some scholars have used Beijing's transportation card data to analyze passenger space-time characteristics. (6) Some scholars have used the data obtained by bus card swiping in London and used passenger portraits to explore the patterns of resident public interchange and travel. (7) In terms of prediction methods, since the passenger flow in a scenic area is susceptible to many external factors such as weather and holidays, it has complex nonlinearity and volatility, so it is difficult to capture the inherent laws governing changes. However, the existing forecasting methods of passenger flow are mostly based on the idea of mathematical statistics, which mostly establish a subjective model of the sequence in advance and then make predictions on the basis of the subjective model, such as a time series analysis or Kalman filtering model. (8,9) For example, some scholars have predicted passenger flow in scenic areas using the autoregressive integrated moving average (ARIMA) model based on monthly passenger flow data obtained over two years in the Huangshan scenic area. (10) Some scholars have constructed a combined model by combining a grey model with a Markov chain to forecast highway passenger traffic. (11) However, these methods still lack the learning process of data samples and do not have the ability of generalization and self-learning. It is thus difficult to accurately predict the flow of tourists in a scenic area.
In this paper, we propose a method of predicting passenger flow in a scenic area that is based on a hybrid neural network (HNN) model combining a convolutional neural network (CNN) and long short-term memory (LSTM) with the support of multisource traffic data. We hope that this model will be used to reduce the dependence of traditional prediction models on data stability and improve prediction accuracy.
In what follows, we propose a passenger flow prediction method for scenic areas based on CNN-LSTM and introduce the algorithm structure and input format. Afterwards, taking South Luogu Lane in Beijing as an example, multisource data are normalized according to the spatial distribution characteristics of the study area. Then, we verify the prediction results of CNN-LSTM and a comparative algorithm through model evaluation indicators and time distribution curves. Finally, we conclude the paper with a discussion of our research.

HNN
A single neural network has different advantages in nonlinear dynamic modeling and application. To make better use of the advantages of highly nonlinear, adaptive, and selflearning neural networks with different structures, an HNN concept has been proposed. An HNN is related to a single type of neural network. It combines multiple types of neural network and uses structural advantages to compensate for the disadvantages of each network, thereby reducing the training time. This makes the network converge faster and improves the performance of its applications.
An HNN mainly includes two structures: series and parallel networks. In the series network, multiple neural networks with different structures are connected in series, and the networks of separate structures are connected in sequence according to the series hierarchy. The input and output dimensions at the two layers are the same. The data are transferred in layers until the final layer receives the final output. In the parallel network, multiple networks with different structures are connected in parallel. The input dimensions of all networks are the same, that is, all networks perform parallel operations on the input data, and then the output results of different dimensions of different networks are integrated. Finally, the output is obtained.
At present, there are many different HNN structures. Scholars have proposed different network models for specific application scenarios. (12)(13)(14) 2.2 CNN-LSTM forecasting model

Framework
A CNN consists of an input layer, a convolutional layer, a pooling layer, a fully connected layer, and an output layer. Figure 1 displays the structure. There are three main advantages of a CNN: (i) Weight sharing. Since the parameters of the convolution kernel are all shared, the number of parameters is reduced and the network learning efficiency is improved. (ii) Downsampling. The pooling layer reduces the network feature dimension after the convolutional layer and improves the calculation efficiency. (iii) Local area perception. The convolution kernel performs local perception and gradually extracts high-dimensional features in layers, which improves the generalization ability of the model. An LSTM network has been proposed as an improved recurrent neural network (RNN). It not only can effectively avoid the problem of gradient disappearance but also has a significant effect on processing and predicting time series with longer intervals and delayed events. The internal structure of the LSTM layer is shown in Fig. 2. The input is a time sequence x = (x 1 , x 2 , ..., x t ) of t moments and the output is a hidden layer sequence h = (h 1 , h 2 , ..., h t ). At each iteration, the hidden value h t-1 of the previous moment is input together with the input value x t of the current moment, thereby transmitting information from previous multiple moments. (15)(16)(17)(18)(19)(20) A CNN and LSTM are mainstream algorithms for deep learning. A CNN is suitable for extracting local features of data and abstracting them into high-level features, while LSTM is more suitable for time expansion, and its long-term memory function is more suitable for processing time series. Therefore, in this paper, we propose a hybrid model for passenger flow prediction in scenic areas that is based on a CNN-LSTM method, which gives the model the ability to extract potential features existing in multisource time series data in scenic areas. In the model framework, a space-time data set is first constructed from multisource traffic data around the scenic area and passenger flow data obtained by laser monitoring in the core of the scenic area, and then the feature vectors are input into the LSTM network in time series so as to realize the passenger flow forecast in the core area of the scenic area. The overall model structure is shown in Fig. 3.

Input structure
To avoid influence on the time series in the convolution process and separate the feature extraction from the time series prediction, the CNN-LSTM HNN takes a one-dimensional time series vector as the input of the network. To meet the demand for the early warning of congestion in scenic areas, the total number of passengers in the scenic area needs to be predicted on the same day from 3:00 am to 10:00 pm, and the estimated passenger flow must be predicted every 15 min. Therefore, when constructing a sample, it is first necessary to arrange the normalized data in a sequence according to the time course and form a two-dimensional data matrix, and then construct the data set by sliding window interception, where the predicted label here is the number of passengers in the scenic area at that moment. The constructed input format is shown in Fig. 4, where t is a specific time with an interval of 15 min, and t + n is the time n interval of 15 min after time t.

Evaluation indexes
To better analyze the prediction effect of the CNN-LSTM passenger flow prediction model under different parameter settings and compare it with a comparative algorithm, we use the mean absolute error (MAE), mean absolute percentage error (MAPE), and root mean square error (RMSE) as indicators for evaluation. The three indicators are defined in Eqs. (1)-(3), where Y t,i and Y p,i represent the true and predicted passenger flows at time i, respectively. (21)(22)(23)(24)(25) , , 0

Study area
The historical and cultural neighborhood of South Luogu Lane is a scenic area in Beijing. The main road is South Luogu Lane, which runs from north to south. Its north end is adjacent to Gulou East Street and the south end is next to Di'anmen East Street. Because the scenic area is located at the center of Beijing, the transportation is convenient, and there are many buses and subway lines in this area. Its surrounding bus stations include eight stations, such as Luogu Lane Station, Gulou Station, Di'anmen Wai Station, and two subway stations, South Luogu Lane Station and Shichahai Station. Although bikes and taxis are prohibited inside the scenic area, tourists can walk to the surrounding main roads along any lane to take public transportation.
Therefore, to fully consider the spatial distribution of public transportation facilities in South Luogu Lane, in this study, a rectangular study area covering an area of about 1 km 2 was selected, with the central area of South Luogu Lane as the center, Di'anmen Wai Street and Jiaodaokou South Street at the east and west edges, and Gulou East Street and Di'anmen East Street at the south and north edges, respectively. The red rectangle in Fig. 5 represents the study area, the blue markers indicate the bus stations, and the brown markers indicate the subway stations.

Data source and preprocessing
The research data include bus card data, subway card data, taxi order data, bike-sharing order data, and laser monitoring data of the passenger flow in the core area of South Luogu  Table 1. The multisource traffic data can be divided into order and card data.
For the order data, the same passenger information cannot be extracted from the taxi and bike-sharing order data, and similarly, the same information cannot be extracted from the bus and subway card data. Therefore, the transfer behavior cannot be identified from the individual. Moreover, taxi and bike-sharing trips are generally independent with almost no transfer using the same vehicle, so we do not consider the transfer factor for order data. We extract the data within the study area from the entire city of Beijing through the coordinates of the starting point of the order and its corresponding time in order to extract time series data of taxis and bike sharing within the study area.
Because of the complex environment of the study area (in addition to the South Luogu Lane scenic area, there are many schools, hospitals, and residential areas), it is impossible to ultimately determine whether individual passengers have entered the scenic area. Therefore, potential relationships can only be analyzed by time-series changes in passenger flow. However, owing to multiple factors such as the complex environment of the urban scenic area, the time series of bus and subway passenger flows still have a large number of passengers who are not going to the scenic area. Thus, we establish a connection based on the card numbers in the bus and subway data, and retrieve the card records of the same number in the two modes of transportation and extract the travel chain to exclude passengers passing through the stations in the scenic area instead of entering the scenic area. The data processing flow is shown in Fig. 6. The specific steps are as follows: Step 1: Filter out card records within the study area.
Step 2: Extract the travel chain of bus and subway journeys.
Step 3: Exclude transfer credit card records.
Step 4: Count the passenger flow of each station at 15 min intervals.

Results and interpretation
In this paper, the 25 days of data from August 1 to August 25, 2018 are used as the training data set, and data from August 26 to August 30, 2018 are used as the test data set. The test data set is divided into five subsets in units of days, which is convenient for evaluating the performance and stability of the model. The model is optimized by stochastic gradient descent. The learning rate is 0.001, the number of iterations is 100, and the loss function is the mean square error (MSE). After test comparison, the optimal structure and parameter configuration are shown in Table 2. The input step is set to 10, which is equivalent to using the first 10 samples to predict the next value. Therefore, the input form is a two-dimensional vector with dimensions of (10, 25). Data first enter the CNN part. This part was designed as four convolutional and four pooling layers. Finally, the flattening layer compresses the three-dimensional vector array into a onedimensional vector array of length 544, which was extracted as a global feature. The LSTM in this study consists of three LSTM layers and a fully connected layer. The numbers of LSTM units in the layers are 32, 64, and 128. Each hidden layer of the model adds dropout constraints, and the optimization function uses the Adam algorithm.
In addition, we select two classic time-series prediction methods (ARIMA and LSTM) for comparative experiments, and compared the forecasts based on evaluation indicators and curves. In this paper, the ARIMA algorithm is implemented using the auto.arima() function in R language, where the model parameters p, d, and q are automatically obtained from the Akaike information criterion (AIC) and the Bayesian information criterion (BIC). The LSTM comparison model is tested with multiple sets of parameters. We use the optimal multilayer LSTM network model, including two LSTM layers and one fully connected layer. The neuron structure of the model is 32 × 64 × 128 × 8.
The results of the predicted curves of the three models in the five test sets are shown in Fig. 7. The blue, yellow, green, and red curves in each figure represent the actual curve for the day and the ARIMA, LSTM, and CNN-LSTM prediction curves, respectively. For the fundamental passenger flow law, both the neural-network-based model and the traditional time-series model can learn some characteristics and predict the passenger flow in the future. However, from the  (1) qualitative performance of each model, the CNN-LSTM curve is the most similar to the actual curve shape in all test sets, with only an oscillation phenomenon causing the curve to deviate from the actual trend. ARIMA cannot adequately identify the changes in passenger flow, resulting in a significant deviation from the actual curve on all five days. The prediction curve of LSTM is a significant improvement over that of ARIMA except for the first test set, but  compared with the actual curve, it is shifted to the left. Therefore, according to the qualitative observation, the CNN-LSTM model has the highest prediction accuracy.
The experimental results of the three evaluation indicators of the prediction models are shown in Table 3. In order to make the evaluation indicators more intuitive, we calculated the indicators by the denormalization of the predicted output values. The results show that CNN-LSTM has better MAE, MAPE, and RMSE in all test sets than the other benchmark models. The RMSE of the ARIMA model in the five test sets exceeded 1000 people, and the MAPE reached 2.29 on August 30. Because this model can essentially only capture the linear relationship, it is difficult to characterize the changes in a complex nonlinear sequence. ARIMA is mainly suitable for time series with stable data sets, and there are strict requirements on the statistical properties of the research objects. However, the passenger flow data in an urban scenic area reflects the operation status of the area, and the daily passenger flow will produce irregularities depending on the date, weather, and other factors. The fluctuation of the passenger flow time series will also produce anomalous subsequences owing to surrounding activity events, so the experimental accuracy of ARIMA is lowest. LSTM performs better than ARIMA, but the prediction accuracy is low on August 26, and the indicators of each data set have some fluctuations. As a nonlinear model, LSTM can solve the long-term dependence of time series data through multiple cell states to a certain extent and retain the long-and shortterm fluctuation rules of the passenger flow in the scenic area. However, LSTM can only fit single-source data and is unable to mine the potential impact of the surrounding traffic passenger flow because it lacks the ability to merge multisource data. MAE for CNN-LSTM is on average 60% larger than that of LSTM, and the fluctuation range of the three indicators in each training set does not exceed 20%. CNN-LSTM uses the feature extraction ability of the convolution structure and fully excavates the correlation of the multisource passenger flow in the scenic area. Therefore, the experimental accuracy is relatively high.

Discussion and Conclusion
In the context of today's global call for green travel, public transportation has become the first choice for tourists. Public transportation, subways, taxis, and shared bikes are the main components of public transportation for urban passengers. Various data collection systems can be used for dynamic analysis. Extracting potential information does not only grasp the passenger flow status of a scenic spot in real time but also provides a basis for decision making for the evacuation of passenger flows on important holidays and in emergency responses. In this article, we use South Luogu Lane, a famous historic and cultural district in Beijing, as an example and propose a method of predicting passenger flow in scenic spots. This method identifies relevant public transportation facilities in a scenic spot through the spatial analysis of the scenic spot, then normalizes the spatiotemporal processing of multisource public transportation data, and designs and constructs a passenger flow forecast for a CNN-LSTM hybrid network. This model can provide important early-warning indicators for passenger flow management in the South Luogu Lane scenic area.
Compared with other traditional passenger flow prediction models, the prediction model designed in this article has the best performance on various indicators, improves the accuracy of passenger flow prediction, and can provide a basis for decision making in scenic area management. The advantages of the passenger flow prediction method proposed in this article are as follows: (i) The use of multisource public transportation data around the scenic area makes up for problems, such as the sparseness of a single data source, and enhances the continuity and comprehensiveness of the data. (ii) Continuous one-dimensional feature vectors are constructed from multisource data using a time-sliding window as the input. This makes full use of the potential advantages of the CNN model for feature extraction, so that more useful information contained in the data can be mined. (iii) The feature vector extracted by the CNN, which takes into account the time sequence of multisource traffic as the input of the LSTM network model, can be used to better fit the timing of complex passenger flow data in the scenic area and the complicated highdimensional nonlinear relationship. Owing to the interference of seasonal factors, external shocks, economic cycles, and other factors, the short-term or medium-long-term periodic passenger flow has strong nonstationarity characteristics, and different types of scenic area are affected by different factors. Therefore, in follow-up research, the impact of various transportation modes on different types of scenic area should be explored, and a multiscale input model structure, which can improve the real-time performance of passenger flow prediction while ensuring the accuracy of prediction, should be designed. By using data transmission and calculation technology, this study can have more significance for passenger flow prediction and early warning in a variety of crowded places.