OD passenger flow prediction method and device, electronic equipment and storage medium
The multi-module deep learning method (HDF-DL) is used to process multi-source data of urban rail transit networks and extract high-dimensional features for OD passenger flow prediction, which solves the spatiotemporal complexity of OD passenger flow prediction and the computational complexity of traditional models, and achieves Accurate, real-time short-term OD passenger flow forecast.
Patent Information
- Application Number
- CN202410700310.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-05-31
- Publication Date
- 2024-09-20
AI Technical Summary
It is difficult to predict OD passenger flow in urban rail transit accurately, in real time and quickly. Existing technologies are mostly focused on station passenger flow prediction. Multi-source data is rarely used, and spatiotemporal characteristics are difficult to fully capture. Traditional models have high computational complexity and cannot meet real-time requirements. .
A multi-module deep learning method (HDF-DL) is used to extract high-dimensional features of passenger flow distribution from multi-source data through time feature module, spatial feature module and external feature module, including time volatility, trend and periodicity. Features, combined with K-means and K-shape clustering algorithms, use one-dimensional convolutional neural network and gated recurrent unit for feature processing, and fuse multi-source data for prediction.
It improves the accuracy and speed of OD passenger flow prediction, enables accurate and real-time short-term OD passenger flow prediction in large-scale subway networks, reduces prediction errors, and is suitable for complex spatiotemporal relationships and multi-source data characteristics.
Smart Images

Figure CN118674594A
Abstract
Description
Technical Field
[0001] The embodiments of the present invention relate to the technical field of passenger flow prediction, and in particular to an OD passenger flow prediction method and device, an electronic device and a storage medium. Background Art
[0002] Urban rail transit plays a positive role in optimizing urban spatial structure, alleviating urban traffic congestion and protecting the environment. It is a large-capacity, convenient, punctual and efficient mode of transportation.
[0003] In recent years, with the dramatic increase in passenger travel demand, urban rail transit companies are facing new challenges. Therefore, how to accurately, in real time and quickly conduct OD passenger flow forecasts to provide reliable decision-making basis for operation organizers has become a technical problem that urban rail transit companies urgently need to solve. Summary of the invention
[0004] The embodiments of the present invention provide an OD passenger flow prediction method and device, an electronic device and a storage medium, which can accurately, real-timely and quickly perform OD passenger flow prediction.
[0005] In a first aspect, an embodiment of the present invention provides an OD passenger flow prediction method, comprising:
[0006] Acquire OD passenger flow distribution data, wherein the OD passenger flow distribution data includes multi-source data in multiple time series, and the multi-source data includes time data, space data, and weather data;
[0007] Extracting temporal features, spatial features and external features from the OD passenger flow distribution data;
[0008] The time feature, the space feature and the external feature are input into a passenger flow prediction model to perform passenger flow prediction to obtain a passenger flow prediction result, wherein the passenger flow prediction model includes a time feature module, a space feature module and an external feature module, the time feature module is used to process the time feature, the space feature module is used to process the space feature, and the external feature module is used to process the external feature.
[0009] In some embodiments, the time feature is represented by a time series, and the time feature includes a time fluctuation feature, a time trend feature, and a time periodic feature. The processing flow of the time feature module for the time feature includes the following:
[0010] Using multiple time series as input, extracting the time volatility feature, the time trend feature and the time periodic feature;
[0011] Extracting key features from the time series by introducing a one-dimensional convolutional neural network;
[0012] Compressing the key features using a pooling layer to obtain the compressed key features;
[0013] Using a convolutional gated recurrent unit to obtain high-dimensional relationship features in the compressed key features;
[0014] The high-dimensional relationship features are processed through a fully connected neural network to merge the time fluctuation features, the time trend features and the time periodicity features.
[0015] In some embodiments, the convolutional gated recurrent unit is composed of an input layer, a one-dimensional convolutional layer, an average pooling layer, a gated recurrent unit, a fully connected neural network, and an output layer. Each one-dimensional convolutional layer is composed of a convolution operation and an activation function. The output of a single one-dimensional convolutional layer is expressed as:
[0016] C i =f(W i *C i-1 +b i )
[0017] Where * represents convolution operation; W i is a learnable parameter; i represents the i-th layer in the entire convolutional model; C i-1 represents the output of layer i-1; C i is the output of the i-th layer; f is the activation function.
[0018] In some embodiments, the fully connected neural network includes an input layer, a hidden layer, and an output layer. The nodes of two adjacent layers of the input layer, the hidden layer, and the output layer are all connected. The fully connected neural network with a single hidden layer is expressed as follows:
[0019]
[0020] H j =tanh(X 1 ·W 1j +X 2 ·W 2j +…+X U ·W Uj +b j )
[0021] O k =tanh(H 1 W′ 1k +H 2 W′ 2k +…+H Q W′ Qk +b k )
[0022] The activation function uses the tanh function; X i is the i-th input of the input layer, with a total of U; H j is the jth neuron in the hidden layer, with a total of Q neurons; O k is the kth neuron in the output layer, with a total of P neurons; W ij and W′ jk is the weight and b is the bias.
[0023] In some embodiments, the spatial feature module processes the spatial feature as follows:
[0024] Extracting high-dimensional spatial category features from the spatial features through K-means and K-shape clustering algorithms;
[0025] A fully connected neural network is used to mine the interactive relationship between the high-dimensional space category features, and the high-dimensional space category features are fused based on the interactive relationship.
[0026] In some embodiments, the external feature module processes the external feature as follows:
[0027] Taking external features as input, wherein the external features are obtained from the weather data;
[0028] The external features are processed using one-hot encoding, gated recurrent units and fully connected neural networks to obtain external feature processing results.
[0029] In some embodiments, the temporal feature module includes two layers of one-dimensional convolution, one layer of pooling, two layers of gated recurrent units and one layer of fully connected neural network, wherein the one-dimensional convolution layer uses 256 convolution kernels of size 1*3, the pooling layer uses an average pooling method, the convolution kernel size is 2, the gated recurrent unit layer contains 2048 hidden neurons, and the fully connected neural network layer contains 1 hidden neuron;
[0030] The spatial feature module includes a fully connected layer, which is a single layer and contains 32 hidden neurons;
[0031] The external feature module includes a gated recurrent unit layer containing 256 hidden neurons and a fully connected neural network layer containing 1 hidden neuron;
[0032] The outputs of the time feature module, the spatial feature module and the external feature module are spliced in the third dimension, and after splicing, they are input into the fully connected neural network layer, and after output, the final output value of the passenger flow prediction model is obtained; among them, only the activation function of the fully connected neural network is a linear function, and the activation functions of other neural networks are all relu, the loss function of the passenger flow prediction model is Huber, and the optimizer used is the Adam optimizer.
[0033] In a second aspect, an embodiment of the present invention further provides an OD passenger flow prediction device, the device comprising:
[0034] An acquisition module, used for acquiring OD passenger flow distribution data, wherein the OD passenger flow distribution data includes multi-source data under multiple time series, and the multi-source data includes time data, space data and weather data;
[0035] An extraction module, used for extracting time features, spatial features and external features from the OD passenger flow distribution data;
[0036] A prediction module is used to input the time feature, the space feature and the external feature into a passenger flow prediction model to perform passenger flow prediction and obtain a passenger flow prediction result, wherein the passenger flow prediction model includes a time feature module, a space feature module and an external feature module, the time feature module is used to process the time feature, the space feature module is used to process the space feature, and the external feature module is used to process the external feature.
[0037] In a third aspect, an embodiment of the present invention further provides an electronic device, comprising: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the OD passenger flow prediction method as described in the first aspect when executing the computer program.
[0038] In a fourth aspect, an embodiment of the present invention further provides a computer-readable storage medium storing computer-executable instructions, wherein the computer-executable instructions are used to execute the OD passenger flow prediction method as described in the first aspect.
[0039] According to the OD passenger flow prediction method and device, electronic device and storage medium provided by the embodiment of the present invention, the OD passenger flow prediction method includes: obtaining OD passenger flow distribution data, the OD passenger flow distribution data includes multi-source data under multiple time series, and the multi-source data includes time data, space data and weather data; extracting time features, space features and external features from the OD passenger flow distribution data; inputting the time features, space features and external features into the passenger flow prediction model to perform passenger flow prediction, and obtaining the passenger flow prediction result, wherein the passenger flow prediction model includes a time feature module, a space feature module and an external feature module, the time feature module is used to process the time feature, the space feature module is used to process the space feature, and the external feature module is used to process the external feature. Based on this, the embodiment of the present invention adopts multi-source data, integrates the high-dimensional features of passenger flow distribution, and adopts a multi-module combination of deep learning methods (HDF-DL) to solve the problem of short-term prediction of OD passenger flow in urban rail transit networks, wherein the multi-module combination is a combination of a time feature module, a space feature module and an external feature module. By analyzing the temporal, spatial and external characteristics of OD passenger flow distribution, the accuracy of OD passenger flow prediction is improved, and OD passenger flow prediction can be performed accurately, in real time and quickly. BRIEF DESCRIPTION OF THE DRAWINGS
[0040] Figure 1 is a flow chart of an OD passenger flow prediction method provided by an embodiment of the present invention;
[0041] Figure 2 is a schematic diagram of the HDF-DL model architecture provided by an embodiment of the present invention;
[0042] Figure 3 It is a schematic diagram of the structure of a fully connected neural network FCN provided by an embodiment of the present invention;
[0043] Figure 4 is a schematic diagram of a GRU structure provided by an embodiment of the present invention;
[0044] Figure 5 1 is a schematic diagram of the structure of a convolutional gated recurrent unit provided by an embodiment of the present invention;
[0045] Figure 6 It is a structural schematic diagram of an OD passenger flow prediction device provided by an embodiment of the present invention;
[0046] Figure 7 is a schematic diagram of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0047] In order to make the purpose, technical solution and advantages of the present invention more clearly understood, the present invention is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not used to limit the present invention.
[0048] It should be noted that, although the functional modules are divided in the device schematic diagram and the logical order is shown in the flowchart, in some cases, the steps shown or described may be performed in a different order than the module division in the device or the order in the flowchart. The terms "first", "second", etc. in the specification and claims and the following drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence.
[0049] In the embodiments of the present invention, the words "further", "exemplarily" or "optionally" are used to indicate examples, illustrations or descriptions, and should not be interpreted as being more preferred or more advantageous than other embodiments or designs. The use of the words "further", "exemplarily" or "optionally" is intended to present related concepts in a specific way.
[0050] First, several terms involved in the present invention are analyzed:
[0051] OD pair: The starting point (English: origin) and the end point (English: destination) of a passenger's trip are combined to form an OD pair. "O" stands for "origin" and "D" stands for "destination". It is a professional term in the field of transportation. Any two stations on the subway network can form an OD pair. Once the starting station and the end station are specified, an OD pair is defined. OD passenger flow refers to the passenger flow from the starting station to the end station.
[0052] In order to more conveniently describe the working principle of the embodiment of the present invention later, an introduction to relevant technical scenarios is first given below.
[0053] Urban rail transit plays a positive role in optimizing urban spatial structure, alleviating urban traffic congestion and protecting the environment. It is a large-capacity, convenient, punctual and efficient mode of transportation.
[0054] In recent years, with the dramatic increase in passenger travel demand, urban rail transit companies are facing new challenges. Therefore, how to accurately, in real time and quickly conduct OD passenger flow forecasts to provide reliable decision-making basis for operation organizers has become a technical problem that urban rail transit companies urgently need to solve.
[0055] In the related technologies, existing research still has the following deficiencies:
[0056] (1) Current passenger flow prediction research focuses on station passenger flow prediction, while there is little research on passenger flow prediction for OD pairs. The research on passenger flow prediction based on a single data source (subway AFC data) is relatively in-depth, while the research on passenger flow prediction using multi-source data is still in the exploratory stage and requires more in-depth research.
[0057] (2) The spatiotemporal characteristics of passenger flow distribution are difficult to fully capture and describe. With the rapid expansion of the urban rail transit network and the sharp increase in passenger flow, the spatiotemporal distribution characteristics of the network passenger flow are becoming increasingly complex. How to comprehensively consider the spatiotemporal characteristics of passenger flow under the background of networking and large passenger flow, as well as the characteristics of external factors such as weather, and improve the accuracy of network-level passenger flow prediction, requires further in-depth research.
[0058] (3) The accuracy of short-term OD passenger flow prediction in urban rail transit needs to be improved. There is an extremely complex spatiotemporal relationship between OD passenger flows. A single mathematical method is difficult to describe the complex spatiotemporal relationship between OD flows, and the accuracy needs to be improved. Most existing studies are applied to a certain station or a small-scale subway network. As the network expands, the number of OD pairs increases dramatically, and the OD flow is severely sparse. The computational complexity of the traditional model will be greatly increased, and it cannot meet the real-time requirements.
[0059] Based on this, the present invention provides an OD passenger flow prediction method and device, electronic device and storage medium. Among them, the OD passenger flow prediction method includes: obtaining OD passenger flow distribution data, the OD passenger flow distribution data includes multi-source data under multiple time series, and the multi-source data includes time data, space data and weather data; extracting time features, space features and external features from the OD passenger flow distribution data; inputting the time features, space features and external features into the passenger flow prediction model to perform passenger flow prediction, and obtaining the passenger flow prediction result, wherein the passenger flow prediction model includes a time feature module, a space feature module and an external feature module, the time feature module is used to process the time feature, the space feature module is used to process the space feature, and the external feature module is used to process the external feature. Based on this, the embodiment of the present invention adopts multi-source data, integrates the high-dimensional features of passenger flow distribution, and adopts a multi-module combination of deep learning methods (HDF-DL) to solve the problem of short-term prediction of OD passenger flow in urban rail transit networks, wherein the multi-module combination is a combination of a time feature module, a space feature module and an external feature module. By analyzing the temporal, spatial and external characteristics of OD passenger flow distribution, the accuracy of OD passenger flow prediction is improved, and OD passenger flow prediction can be performed accurately, in real time and quickly.
[0060] The embodiments of the present invention are further described below in conjunction with the accompanying drawings.
[0061] like Figure 1 As shown, Figure 1It is a flowchart of an OD passenger flow prediction method provided by an embodiment of the present invention. The OD passenger flow prediction method may include but is not limited to steps S101 to S103.
[0062] Step S101: Obtain OD passenger flow distribution data, where the OD passenger flow distribution data includes multi-source data in multiple time series, where the multi-source data includes time data, space data, and weather data;
[0063] Step S102: extracting time features, spatial features and external features from OD passenger flow distribution data;
[0064] Step S103: Input the time feature, space feature and external feature into the passenger flow prediction model to perform passenger flow prediction and obtain the passenger flow prediction result, wherein the passenger flow prediction model includes a time feature module, a space feature module and an external feature module, the time feature module is used to process the time feature, the space feature module is used to process the space feature, and the external feature module is used to process the external feature.
[0065] It should be noted that, in order to facilitate the problem description, the present invention designs the following symbols: the set of all stations is denoted as V, the OD pair of passenger travel is denoted as (r, s), r, s∈V, r is the passenger's departure station, s is the passenger's arrival station. For the convenience of description, the operating time of a day is divided into time periods with a time granularity of Δt as the interval. For the OD pair (r, s), the actual passenger flow in the mth time period on the nth day is denoted as The predicted passenger flow is recorded as The average passenger flow in the mth period is recorded as
[0066] In view of the fact that there are many factors that affect the passenger flow distribution in different time periods, in order to facilitate the design of the passenger flow prediction model, multi-source data are combined to extract the key high-dimensional features that affect the passenger flow distribution, which are used as the input of the subsequent passenger flow prediction model.
[0067] It is understandable that for time data, the passenger flow of urban rail transit every day in a week and the distribution of passenger flow in each time period every day show obvious regular characteristics. After statistical analysis of the historical AFC data of the subway in City A, the distribution of passenger flow in each time period of each day in a week for each OD is obtained. It can be found that the OD has the following characteristics for passenger flow distribution: ① The passenger flow demand has a certain fluctuation regularity with the change of departure time; ② The fluctuation characteristics of the passenger flow demand every day in a week have a certain trend, and the passenger flow distribution from Monday to Thursday, Friday and weekends is different; ③ The time period distribution of passenger flow is periodic, with one week as a cycle. ④ The passenger flow distribution patterns of different ODs are obviously different.
[0068] It can be understood that, for the time characteristics, the time characteristics of OD passenger flow distribution can be expressed by time series.
[0069] The first one is the fluctuation characteristic, denoted as That is, the passenger flow in adjacent time periods within a day has a certain volatility. However, considering that the formation of OD passenger flow has a time lag, this time lag makes it impossible to obtain the OD passenger flow in adjacent time periods in the transportation network in real time through the urban rail transit AFC system. Moreover, the travel mileage between different OD pairs is quite different, resulting in a large difference in the time lag between different OD pairs. Therefore, it is impossible to unify the lengths of adjacent time periods considered by each OD pair. In response to this problem, the present invention adopts the method of discarding the passenger flow sequences of several adjacent time periods (which cannot be obtained in real time). After calculation and analysis, it is found that the shortest path travel time of more than 96.4% of the OD pairs on the subway network of City A can be controlled within 1h, that is, the latest OD time period passenger flow generated 1h ago can be obtained. If the time granularity Δt=1h, then only one time period passenger flow data needs to be discarded, that is, using It can be input into the model as a fluctuation feature to predict the OD passenger flow in the mth time period.
[0070] The second is the trend feature, denoted as That is, within a few consecutive days, the passenger flow distribution at the same time of each day has a greater trend; the third type is a periodic feature, recorded as That is, the passenger flow distribution cycles in a cycle of one week.
[0071] In addition, the passenger flow from Monday to Thursday, Friday and weekends is significantly different, so the day of the week n is marked as W. n , W n =0 means one day from Monday to Thursday, W n =1 means Friday, W n =2 means weekend.
[0072] It can be understood that for spatial features, according to the station category of the OD pair, the origin and destination station types are combined to obtain the category of the OD pair, which is recorded as Cv r,s According to the shortest path between OD pairs (shortest mileage, shortest time, number of transfers, etc.), the K-means clustering method is used to classify the OD pairs, denoted as Cl r,s ; Based on the passenger flow distribution pattern between OD pairs The K-shape clustering method is used to classify the OD pairs, denoted as Cq r,s .
[0073] It can be understood that for external characteristics, considering that rainfall has a significant impact on passenger flow, for the OD pair (r, s), the rainfall category on the nth day is recorded as WEA n , WEA n=1,2,3, corresponding to no rain, light rain and heavy rain respectively.
[0074] It can be understood that the present invention integrates multi-source data, comprehensively considers time, space and weather factors, and proposes a deep learning method based on high-dimensional feature fusion of multi-source data for the short-term prediction of OD passenger flow in large-scale urban rail transit networks. In view of the diversity of multi-source data types, it is difficult to use a single method for feature extraction. Therefore, the present invention designs three modules in the HDF-DL method to extract features from the data respectively, and then performs feature fusion to improve the accuracy of passenger flow prediction, specifically, a spatial feature module, a temporal feature module and an external feature module, such as Figure 2 shown.
[0075] It can be understood that the composition of each feature module is as follows:
[0076] In the time feature module, multiple time series are used as input to preliminarily extract the periodicity, trend and volatility features in the data; by introducing a one-dimensional convolutional neural network, key features are extracted from the sequence to enhance the abstract expression ability of the local network module; the pooling layer is used to compress the features, simplify the network complexity, and improve the receptive field of subsequent features; the gated recurrent unit (GRU) is used to capture the abstracted high-dimensional relationship features; further processing is performed through a fully connected neural network (FCN), and finally multiple time features are fused together.
[0077] In the spatial feature module, the initial data is extracted through K-means and K-shape algorithms to extract high-dimensional spatial category features of OD pairs in the subway network, and FCN is used to further explore the interaction between spatial features and fuse them.
[0078] In the external feature module, weather features are taken as input and processed using one-hot encoding, GRU and FCN.
[0079] It is understandable that a fully connected neural network (FCN) is a multi-layer perceptron structure, including an input layer, a hidden layer, and an output layer. The nodes of two adjacent layers are all connected. The hidden layer can better separate the features of the data, but too many hidden layers will lead to overfitting problems. Figure 3 As shown, the formula is as follows:
[0080]
[0081] H j =tanh(X 1 ·W 1j +X 2 ·W 2j +…+X U ·W Uj +bj ) (2)
[0082] O k =tanh(H 1 W′ 1k +H 2 W′ 2k +…+H Q W′ Qk +b k ) (3)
[0083] The activation function uses the tanh function. i is the i-th input of the input layer, with a total of U; H j is the jth neuron in the hidden layer, with a total of Q neurons; O k is the kth neuron in the output layer, with a total of P neurons; W ij and W′ jk is the weight and b is the bias.
[0084] It is understandable that for gated recurrent units, LSTM and GRU are currently two more advanced neural network models for processing sequence data, which avoid the gradient vanishing and explosion problems of traditional recurrent neural networks (RNNs). Both LSTM and GRU use gating mechanisms to determine how much information from the previous stage should be passed to the output. Compared with LSTM, GRU has a relatively simpler structure, fewer parameters, and is easier to train.
[0085] A single GRU unit such as Figure 4 As shown, the unit obtains the input data x at the current time step t t and the hidden state h at the previous time step t-1 , where state h t-1 Saves the useful information of the previous t-1 time steps and outputs the new hidden state h t A single GRU unit has two gates: an update gate Z t , which determines how much previous information needs to be passed to the future (i.e., h t ); a reset gate r t , determines how much previous information to forget. The calculation formula inside a single GRU unit is as follows:
[0086]
[0087] r t =σ(W r ·[h t-1 ,x t ]+b r ) (6)
[0088] Z t =σ(WZ ·[h t-1 ,x t ]+b Z ) (7)
[0089]
[0090] It is understandable that for the convolutional gated recurrent unit, traffic flow data has obvious time dependence, but models such as RNN, LSTM, GRU, etc. that are widely used in time series data analysis are difficult to calculate in parallel, because each step of training is too dependent on the time state of the previous step, resulting in a long training time. However, convolutional neural networks have great advantages in the field of time series data processing due to their good feature extraction capabilities. The convolutional gated recurrent unit proposed in the present invention can not only effectively capture the features of adjacent time steps, but also better capture the long-term dependencies of the sequence. The convolutional gated recurrent unit consists of an input layer, a one-dimensional convolutional layer, an average pooling layer, a GRU, a FCN, and an output layer. The structure of the convolutional gated recurrent unit is as follows: Figure 5 As shown in the figure, N is the number of convolution kernels, L is the number of hidden neurons in GRU, and the one-dimensional convolution layer extracts the deep features in the original data. Each convolution layer consists of a convolution operation and an activation function. The output of a single convolution layer can be described as:
[0091] C i =f(W i *C i-1 +b i ) (10)
[0092] Where * represents the convolution operation; W i is a learnable parameter; i represents the i-th layer in the entire convolutional model; C i-1 represents the output of layer i-1; C i is the output of the i-th layer; f is the activation function.
[0093] There are many pooling methods, such as average pooling, maximum pooling, etc. The pooling method used in the convolutional gated recurrent unit proposed in the present invention is average pooling. The pooling layer can be used to reduce the dimension of features, reduce the amount of calculation and improve the robustness of the model.
[0094] Based on this, the present invention integrates multi-source data, comprehensively considers time, space and weather factors, and proposes a deep learning method based on high-dimensional feature fusion of multi-source data (abbreviated as HDF-DL method) for the short-term prediction problem of OD passenger flow in urban rail transit network. Taking into account the diversity of input data types, the HDF-DL method is designed in the form of modules, including a time feature module, a space feature module and an external feature module, which process the time characteristics, space characteristics and external characteristics of passenger flow distribution respectively. The main contributions of the present invention are as follows:
[0095] (1) Multiple time series are used as input to describe the multi-dimensional time characteristics of passenger flow distribution, including periodicity, trend, and volatility. The time lag problem of passenger flow acquisition is solved by discarding passenger flow sequences within the adjacent 1-hour period in the input data (more than 96.4% of OD pairs on the subway network of City A can be controlled within 1 hour for the shortest path travel time).
[0096] (2) By utilizing multi-source data (including OD passenger flow data, subway network structure data, subway timetable, AOI and POI data around subway stations, and weather conditions), K-means and K-shape algorithms are used to extract high-dimensional spatial category features of OD pairs in the subway network from multiple perspectives, solving the problems of dispersed OD passenger flow, difficult feature aggregation, and complex spatial distribution.
[0097] (3) Design a multi-module deep learning framework. Each module selects a different neural network method flow based on the input data type, effectively solving the problem of diverse input data types and difficulty in integrating features. Conduct experimental analysis on a large-scale subway network, test at multiple time granularities, and design multiple comparison models to effectively verify the stability of the model's prediction accuracy and the rationality of the structural design.
[0098] It is understandable that in order to verify the OD passenger flow prediction method of the present invention, the experiment used the OD passenger flow data in the AFC system of the A city subway from March 1, 2023 to May 31, 2023, the A city subway network structure data, the A city subway timetable, the AOI and POI data around the subway station (from Gaode Map) and the A city rainfall data of the same period. Since the passenger flow of some OD pairs is small and insufficient for research, the present invention selects OD pairs with an average daily passenger flow of more than 200 for experimental analysis, totaling 5715 OD pairs. The first 70% (65 days) of the data set is selected as the training set, and the remaining part (27 days) is used as the test set. The passenger travel volume on the subway network before 7 am and after 23 pm is small, and the OD passenger flow departing between [7:00, 23:00] is selected for research. Three different time granularities Δt = 30min, 1h, and 2h are selected to divide the time period and conduct experiments respectively.
[0099] There are three types of prediction errors used in the present invention, namely, mean absolute error (MAE), mean absolute percentage error (MAPE) and root mean square error (RMSE), and the specific calculation method is as follows.
[0100]
[0101] In the formula, z is the number of samples in the data set.
[0102] As described above, the present invention designs corresponding modules for processing different features, and these modules are interdependent to some extent. In the temporal feature module, there are two layers of one-dimensional convolution, one pooling layer, two layers of GRU and one layer of FCN, wherein the convolution layer uses 256 convolution kernels of size 1*3, the pooling layer uses the average pooling method, the convolution kernel size is 2, the GRU layer contains 2048 hidden neurons, and the FCN layer contains 1 hidden neuron; in the spatial feature module, the fully connected layer is a single layer, containing 32 hidden neurons; in the external feature module, there is a GRU layer containing 256 hidden neurons, and a FCN layer containing 1 hidden neuron.
[0103] The outputs of the three modules are concatenated in the third dimension and then input into the FCN layer to obtain the final output value of the model. Among them, only the activation function of FCN is a linear function, and the activation functions of other neural networks are all relu. The loss function of this model is Huber, and the optimizer used is Adam optimizer.
[0104] For the benchmark model, in order to illustrate the rationality of the HDF-DL model structure and the superiority of prediction accuracy, two groups of comparative experiments were designed, including a total of 8 benchmark comparison models. The first group includes the currently popular single model, and the second group simplifies the corresponding module structure based on the HDF-DL model. The first group of benchmark models are as follows:
[0105] (1) ARIMA: ARIMA is a mature time series forecasting model. W n , Cv r,s , Cl r,s , Cq r,s and WEA n As input to the ARIMA model.
[0106] (2) LSTM: LSTM is one of the classic methods widely used in traffic forecasting problems. The input data is consistent with the ARIMA model.
[0107] (3) GRU: GRU has good performance in sequence modeling and is also one of the classic methods widely used in traffic forecasting problems. The input data is consistent with the ARIMA model.
[0108] (4) Bidirectional Long Short-Term Memory Network (Bi-LSTM): Bi-LSTM consists of two independent LSTMs, one responsible for forward processing of the input sequence and the other responsible for reverse processing of the input sequence. This design enables Bi-LSTM to better capture the past and future characteristics of the input sequence. It is also one of the classic methods widely used in traffic forecasting problems. The input data used is consistent with the ARIMA model.
[0109] The second set of baseline models are as follows:
[0110] (1) HDF-DL-1: Only the framework of the spatial feature module and the temporal feature module in HDF-DL is retained, and the rest are removed.
[0111] (2) HDF-DL-2: Only the framework of the temporal feature module in HDF-DL is retained and the rest are removed.
[0112] (3) HDF-DL-3: Only the time volatility and time trend parts of the time feature module in HDF-DL are retained. This part refers to and After being processed by the convolutional layer, pooling layer, GRU and FCN respectively, they are finally fused and output, and the rest are removed.
[0113] (4) HDF-DL-4: Only the temporal trend part of the temporal feature module in HDF-DL is retained, which refers to After being processed by convolutional layers, pooling layers, GRU and FCN, they are finally fused and output, and the rest are removed.
[0114] For the analysis of experimental results, the experimental results of the model HDF-DL at three different time granularities are shown in Table 1. As can be seen from Table 1, the prediction error of the HDF-DL model at various time granularities is low, and the MAPE error is about 10%, which shows that the model has good prediction accuracy and is suitable for short-term prediction of OD passenger flow in large-scale subway networks. When the time granularity is large, the volatility of OD passenger flow distribution over time will be relatively stable, and the prediction error of the model will be lower. Relevant staff can choose the appropriate time granularity for OD passenger flow prediction according to actual needs in order to obtain better prediction accuracy.
[0115] Table 1 Error comparison of HDF-DL model at different time granularities
[0116]
[0117] The overall prediction errors of HDF-DL and the benchmark model at the 1-hour time granularity are shown in Table 2. The prediction errors at each departure time are shown in Table 2. Figure 5 As shown in Table 2 and Figure 5The following conclusions can be drawn:
[0118] (1) The first set of comparative experiments shows that the prediction error of the HDF-DL model is significantly smaller than that of a single model, indicating that the HDF-DL model designed in a targeted manner based on the input feature type is helpful in improving the accuracy of passenger flow prediction.
[0119] (2) The second set of comparative experiments shows that each component module of the HDF-DL model can effectively reduce the prediction error of the model. After abandoning the spatial feature module, the prediction error of the model increases significantly, indicating that the spatial structure divided by OD category features can solve the problem of complex spatial features in large-scale network OD passenger flow prediction.
[0120] (3) In the time feature module, reducing the input of some time features will increase the prediction error of the model, indicating that considering high-dimensional time features helps to improve the prediction accuracy of the model. Considering the time lag of OD passenger flow formation, the passenger flow sequence of adjacent time periods is discarded in the time fluctuation feature, but the time fluctuation feature after such processing can still effectively reduce the prediction error of the model. Therefore, the model structure designed by the present invention has good rationality.
[0121] (4) The prediction error of the HDF-DL model in each departure period remains low, and the overall performance is relatively stable without obvious fluctuations. However, the prediction errors of other benchmark models increase significantly during the morning and evening peak hours. This shows that during periods of large passenger flow fluctuations, the HDF-DL model can also effectively capture passenger flow characteristics and perform better fitting, while the benchmark model performs poorly, and the prediction accuracy decreases significantly during the morning and evening peak hours.
[0122] Table 2 Prediction errors of various models at one-hour time granularity
[0123]
[0124] Based on the above, the present invention adopts multi-source data, integrates the high-dimensional features of passenger flow distribution, and designs a multi-module combined deep learning method (HDF-DL) for the short-term prediction of OD passenger flow in urban rail transit networks. In the time feature module, the time volatility, time trend and time periodicity characteristics of passenger flow distribution are considered; in the spatial feature module, K-means and K-shape clustering methods are used to classify OD pairs from multiple angles to extract the spatial characteristics of OD passenger flow distribution; weather characteristics are used as input to the external feature module. An experimental analysis was carried out based on the subway network of City A, and multiple comparative benchmark models were designed. The conclusions are as follows:
[0125] (1) The HDF-DL method has good passenger flow prediction accuracy at various time granularities, with a MAPE error of about 10%. The passenger flow prediction accuracy remains stable in each departure period, which can effectively capture the volatility of passenger flow and has good stability. Compared with the benchmark model, the prediction accuracy of the HDF-DL method is significantly superior, indicating the rationality of the design method of the present invention.
[0126] (2) The HDF-DL method adopts a modular design structure that takes high-dimensional features into consideration and selects appropriate neural network structures based on the feature types of each module, which significantly improves the prediction accuracy of the model and solves the problems of complex spatial features and time lag in OD passenger flow prediction for large-scale subway networks.
[0127] It should be noted that in the present invention, high-dimensional time features and spatial features are mainly considered, and external features only include weather features, but other influencing factors can also be considered, such as holidays and special events. The model is designed using a graph neural network structure, and the spatial and temporal features are integrated through the spatial topological structure diagram of the OD pair to improve the accuracy of passenger flow prediction.
[0128] In summary, the present invention adopts multi-source data and designs a multi-module combined deep learning method (HDF-DL). In the time feature module, the time volatility, time trend and time periodicity characteristics of passenger flow distribution are considered. In the time volatility, the passenger flow sequence of adjacent time periods is discarded, and the time lag problem of OD passenger flow formation is solved; in the spatial feature module, K-means and K-shape clustering methods are used to classify OD pairs from multiple angles, extract the spatial characteristics of OD passenger flow distribution, and solve the problem of large scale and complex characteristics of OD pairs; weather characteristics are used as the input of the external feature module. An experimental analysis was carried out based on the subway network of City A, and multiple comparative benchmark models were designed. The experimental results show that the HDF-DL method has good passenger flow prediction accuracy at various time granularities, and the MAPE error is about 10%. The HDF-DL method has high passenger flow prediction accuracy in each departure period, can effectively capture the volatility of passenger flow, and has good stability. The HDF-DL method adopts a modular design structure that considers high-dimensional features and selects appropriate neural network methods based on the feature types of each module, which significantly reduces the prediction error of the model. Compared with the benchmark model, the prediction accuracy of the HDF-DL method is significantly superior.
[0129] In addition, if Figure 6 As shown, one embodiment of the present invention further discloses an OD passenger flow prediction device, the device comprising:
[0130] An acquisition module 110 is used to acquire OD passenger flow distribution data, where the OD passenger flow distribution data includes multi-source data in multiple time series, where the multi-source data includes time data, space data, and weather data;
[0131] An extraction module 120, used to extract temporal features, spatial features and external features from OD passenger flow distribution data;
[0132] The prediction module 130 is used to input the time feature, space feature and external feature into the passenger flow prediction model to perform passenger flow prediction and obtain the passenger flow prediction result, wherein the passenger flow prediction model includes a time feature module, a space feature module and an external feature module, the time feature module is used to process the time feature, the space feature module is used to process the space feature, and the external feature module is used to process the external feature.
[0133] The OD passenger flow prediction device of the embodiment of the present invention is used to execute the OD passenger flow prediction method in the above embodiment. Its specific processing process is the same as the OD passenger flow prediction method in the above embodiment, which will not be described in detail here.
[0134] In addition, if Figure 7 As shown, an embodiment of the present invention also discloses an electronic device, including: at least one processor 210; at least one memory 220, for storing at least one program; when the at least one program is executed by the at least one processor 210, the OD passenger flow prediction method as in any of the previous embodiments is implemented.
[0135] In addition, an embodiment of the present invention further discloses a computer-readable storage medium, in which computer-executable instructions are stored. The computer-executable instructions are used to execute the OD passenger flow prediction method in any of the previous embodiments.
[0136] The system architecture and application scenarios described in the embodiments of the present invention are intended to more clearly illustrate the technical solutions of the embodiments of the present invention, and do not constitute a limitation on the technical solutions provided by the embodiments of the present invention. Those skilled in the art will appreciate that with the evolution of the system architecture and the emergence of new application scenarios, the technical solutions provided by the embodiments of the present invention are equally applicable to similar technical problems.
[0137] Those skilled in the art will appreciate that all or some of the steps in the methods disclosed above, and the functional modules / units in the systems and devices may be implemented as software, firmware, hardware, or a suitable combination thereof.
[0138] In hardware implementation, the division between the functional modules / units mentioned in the above description does not necessarily correspond to the division of physical components; for example, a physical component may have multiple functions, or a function or step may be performed by several physical components in cooperation. Some physical components or all physical components may be implemented as software executed by a processor, such as a central processing unit, a digital signal processor or a microprocessor, or implemented as hardware, or implemented as an integrated circuit, such as an application-specific integrated circuit. Such software may be distributed on a computer-readable medium, which may include a computer storage medium (or non-transitory medium) and a communication medium (or temporary medium). As known to those of ordinary skill in the art, the term computer storage medium includes volatile and non-volatile, removable and non-removable media implemented in any method or technology for storing information (such as computer-readable instructions, data structures, program modules or other data). Computer storage media include, but are not limited to, RAM, ROM, EEPROM, flash memory or other memory technology, CD-ROM, digital versatile disk (DVD) or other optical disk storage, magnetic cassettes, magnetic tapes, disk storage or other magnetic storage devices, or any other medium that can be used to store desired information and can be accessed by a computer. Furthermore, it is well known to those skilled in the art that communication media typically embodies computer readable instructions, data structures, program modules, or other data in a modulated data signal such as a carrier wave or other transport mechanism, and may include any information delivery media.
[0139] The terms "component", "module", "system", etc. used in this specification are used to represent computer-related entities, hardware, firmware, a combination of hardware and software, software, or software in execution. For example, a component can be, but is not limited to, a process running on a processor, a processor, an object, an executable file, an execution thread, a program, or a computer. By way of illustration, both applications running on a computing device and a computing device can be components. One or more components may reside in a process or an execution thread, and a component may be located on a computer or distributed between two or more computers. In addition, these components may be executed from various computer-readable media having various data structures stored thereon. Components may communicate, for example, through local or remote processes based on signals having one or more data packets (e.g., data from two components interacting with another component between a local system, a distributed system, or a network, such as the Internet interacting with other systems through signals).
Claims
1. A method for predicting OD passenger flow, comprising: Acquire OD passenger flow distribution data, wherein the OD passenger flow distribution data includes multi-source data in multiple time series, and the multi-source data includes time data, space data, and weather data; Extracting temporal features, spatial features and external features from the OD passenger flow distribution data; The time feature, the space feature and the external feature are input into a passenger flow prediction model to perform passenger flow prediction to obtain a passenger flow prediction result, wherein the passenger flow prediction model includes a time feature module, a space feature module and an external feature module, the time feature module is used to process the time feature, the space feature module is used to process the space feature, and the external feature module is used to process the external feature.
2. The method according to claim 1, characterized in that The time feature is represented by a time series, and the time feature includes a time fluctuation feature, a time trend feature, and a time periodic feature. The processing flow of the time feature module for the time feature includes the following: Using multiple time series as input, extracting the time volatility feature, the time trend feature and the time periodic feature; Extracting key features from the time series by introducing a one-dimensional convolutional neural network; Compressing the key features using a pooling layer to obtain the compressed key features; Using a convolutional gated recurrent unit to obtain high-dimensional relationship features in the compressed key features; The high-dimensional relationship features are processed through a fully connected neural network to merge the time fluctuation features, the time trend features and the time periodicity features.
3. The method according to claim 2, characterized in that The convolutional gated recurrent unit consists of an input layer, a one-dimensional convolutional layer, an average pooling layer, a gated recurrent unit, a fully connected neural network and an output layer. Each one-dimensional convolutional layer consists of a convolution operation and an activation function. The output of a single one-dimensional convolutional layer is expressed as: C i =f(W i *C i-1 +b i ) Where * represents convolution operation; W i is a learnable parameter; i represents the i-th layer in the entire convolutional model; C i-1 represents the output of layer i-1; C i is the output of the i-th layer; f is the activation function.
4. The method according to claim 2, characterized in that: The fully connected neural network includes an input layer, a hidden layer and an output layer. The nodes of two adjacent layers of the input layer, the hidden layer and the output layer are all connected. The fully connected neural network with a single hidden layer is expressed as follows: H j =tanh(X1·W 1j +X2·W 2j +…+X U ·W Uj +b j ) O k =tanh(H1W′ 1k +H2W′ 2k +…+H Q W′ Qk +b k ) The activation function uses the tanh function; X i is the i-th input of the input layer, with a total of U; H j is the jth neuron in the hidden layer, with a total of Q neurons; O k is the kth neuron in the output layer, with a total of P neurons; W ij and W′ jk is the weight and b is the bias.
5. The method according to claim 1, characterized in that The processing flow of the spatial feature module on the spatial feature includes the following: Extracting high-dimensional spatial category features from the spatial features through K-means and K-shape clustering algorithms; A fully connected neural network is used to mine the interactive relationship between the high-dimensional space category features, and the high-dimensional space category features are fused based on the interactive relationship.
6. The method according to claim 1, characterized in that The processing flow of the external feature module on the external feature includes the following: Taking external features as input, wherein the external features are obtained from the weather data; The external features are processed using one-hot encoding, gated recurrent units and fully connected neural networks to obtain external feature processing results.
7. The method according to claim 1, characterized in that The temporal feature module includes two layers of one-dimensional convolution, one layer of pooling, two layers of gated recurrent units and one layer of fully connected neural network, wherein the one-dimensional convolution layer uses 256 convolution kernels of 1*3 size, the pooling layer uses the average pooling method, the convolution kernel size is 2, the gated recurrent unit layer contains 2048 hidden neurons, and the fully connected neural network layer contains 1 hidden neuron; The spatial feature module includes a fully connected layer, which is a single layer and contains 32 hidden neurons; The external feature module includes a gated recurrent unit layer containing 256 hidden neurons and a fully connected neural network layer containing 1 hidden neuron; The outputs of the time feature module, the spatial feature module and the external feature module are spliced in the third dimension, and after splicing, they are input into the fully connected neural network layer, and after output, the final output value of the passenger flow prediction model is obtained; among them, only the activation function of the fully connected neural network is a linear function, and the activation functions of other neural networks are all relu, the loss function of the passenger flow prediction model is Huber, and the optimizer used is the Adam optimizer.
8. An OD passenger flow prediction device, characterized in that: The device comprises: An acquisition module, used for acquiring OD passenger flow distribution data, wherein the OD passenger flow distribution data includes multi-source data under multiple time series, and the multi-source data includes time data, space data and weather data; An extraction module, used for extracting time features, spatial features and external features from the OD passenger flow distribution data; A prediction module is used to input the time feature, the space feature and the external feature into a passenger flow prediction model to perform passenger flow prediction and obtain a passenger flow prediction result, wherein the passenger flow prediction model includes a time feature module, a space feature module and an external feature module, the time feature module is used to process the time feature, the space feature module is used to process the space feature, and the external feature module is used to process the external feature.
9. An electronic device, comprising: A memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the OD passenger flow prediction method as described in any one of claims 1 to 7 when executing the computer program.
10. A computer-readable storage medium storing computer-executable instructions, wherein the computer-executable instructions are used to execute the OD passenger flow prediction method according to any one of claims 1 to 7.
