Multi-graph convolutional network inbound and outbound passenger flow prediction method based on space-time marking
By using a spatiotemporally labeled multi-graph convolutional network method, the shortcomings of existing passenger flow prediction models in modeling the topological associations and spatiotemporal interaction patterns of transportation networks are addressed, achieving higher accuracy in passenger flow prediction and supporting the optimization and service improvement of urban rail transit.
Patent Information
- Application Number
- CN202511311698.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-09-15
- Publication Date
- 2025-12-12
AI Technical Summary
Existing passenger flow prediction models are unable to effectively model the complex topological relationships and multi-scale spatiotemporal interaction patterns of transportation networks, and there is an inseparability problem in spatiotemporal feature extraction, resulting in insufficient prediction accuracy.
A spatiotemporally labeled multi-graph convolutional network method is adopted. By constructing a spatiotemporally labeled encoding module to generate self-learning node embedding vectors, and combining a multimodal graph structure learning framework and attention mechanism, it captures multi-source spatial dependencies and dynamic temporal changes. Gated recurrent units are used to capture long-term and short-term passenger flow temporal patterns.
It improves the ability to identify patterns in historical passenger flow data, enhances the accuracy of predicting future passenger flow changes, and provides support for optimizing urban rail transit operation strategies and improving service quality.
Smart Images

Figure CN121119271A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of passenger flow prediction technology, specifically to a method for predicting passenger flow in and out of stations based on a multi-graph convolutional network with spatiotemporal labeling. Background Technology
[0002] Urban rail transit, with its advantages of speed, safety, and efficiency, has become the core choice for urban residents' travel and plays an irreplaceable role in the public transportation system. However, with the continuous increase in passenger volume, problems such as overcrowding and supply-demand imbalance are becoming increasingly prominent. Accurate short-term passenger flow forecasting is crucial for reducing congestion and ensuring the stable operation of the system. Station managers can implement dynamic passenger flow control and guidance strategies based on forecast results, effectively alleviating congestion within stations and avoiding safety hazards. Operators can optimize the allocation of transport capacity resources through forecast data, improving service efficiency to meet passenger demand. Passengers can also obtain real-time line capacity information, thereby optimizing travel decisions and improving their travel experience.
[0003] As time-series data, traffic data was initially studied primarily based on statistics and shallow machine learning models, such as linear models like the Autoregressive Integrated Moving Average (ARIMA) and Kalman filtering, and nonlinear models like Support Vector Machines (SVR) and Random Forests. ARIMA initialization is quite cumbersome, so some scholars proposed Vector Autoregression (VAR) to improve this. While these methods can capture basic time-series patterns, they have two fundamental limitations: they rely on manually defined feature engineering, making it difficult to model complex topological relationships in traffic networks (such as dynamic travel path dependencies between stations); and they lack the ability to model multi-scale spatiotemporal interaction patterns in passenger flow data (such as peak-hour tidal effects and sudden changes in passenger flow during holidays).
[0004] Deep learning technology has overcome the aforementioned limitations through autonomous feature learning mechanisms. Hybrid architectures based on Convolutional Neural Networks (CNNs) and Recurrent Neural Networks (RNNs) (such as CNN-LSTM and ConvLSTM) have achieved preliminary spatiotemporal joint modeling. However, when modeling temporal relationships, RNNs suffer from gradient explosion and vanishing problems, and the traffic conditions of some road segments are affected by the traffic conditions at adjacent times, making it impossible for RNNs to capture such dynamic temporal dependencies. To address this, Long Short-Term Memory (LSTM) networks, which are improved based on RNNs, have been used to capture long-term temporal dependencies. Furthermore, some researchers have proposed Gated Recurrent Units (GRUs) based on the LSTM structure, further enhancing the ability to capture temporal features. To address the issue that CNNs do not model spatial correlations deeply enough, some researchers have combined CNNs and ResNets to model deeper spatial correlations. Subsequently, further research has been conducted based on these models. For example, considering the spatiotemporal dependence of traffic flow, a spatiotemporal residual network is proposed to learn spatial correlations and predict population inflows and outflows in each region.
[0005] In modeling spatial relationships, the limitations of CNNs in processing non-Euclidean spatial data make it difficult to effectively represent road network topology. This bottleneck has driven the application of graph neural network (GCN) technology. In modeling spatial relationships, Graph Convolution Networks (GCNs), improved from CNNs, extend convolution operations to general graph structures: Diffusion Convolutional Recurrent Neural Networks (DCRNNs) model directed spatial dependencies through bidirectional diffusing convolutions, while Spatio-temporal Convolution Networks (STGCNs) construct spatio-temporal graph convolutional layers to achieve joint feature extraction. More advanced models, such as personalized augmented graph convolutional networks, dynamically adjust neighborhood aggregation strength using trainable diagonal matrices. These methods still suffer from the problem of static graph construction relying on prior knowledge (such as physical adjacency matrices), making it difficult to represent dynamic semantic associations. To address spatial dynamics modeling, scholars have proposed various improvement schemes: Tang et al. constructed heterogeneous association matrices to extract multi-dimensional spatial features, while Shen et al. achieved dynamic feature fusion through multi-hypergraph structures. In temporal modeling, the Transformer architecture has demonstrated significant advantages: Yu Qian et al. integrated GRU with a self-attention mechanism to capture multi-granularity temporal dependencies, while Zhang et al. proposed causal convolutional probabilistic sparse self-attention to reduce computational complexity. Although these methods improve feature extraction capabilities, they fail to effectively address the inseparability of spatiotemporal features—that is, the model struggles to distinguish which sequence or time period of passenger flow time series data with similar features belongs to. Furthermore, existing research primarily relies on data-driven matrix modeling of the spatial interactions of passenger flow, considering the changes in spatial dependencies over time through dynamic matrices, but it lacks sufficient exploration of the inherent patterns in historical traffic flow time series data. Summary of the Invention
[0006] To address the aforementioned shortcomings in existing technologies, this invention provides a method for predicting passenger flow in and out of stations based on spatiotemporally labeled multi-graph convolutional networks. This method improves the ability to identify patterns in historical passenger flow data, enhances the accuracy of predicting future passenger flow changes, and provides strong support for optimizing urban rail transit operation strategies and improving service quality.
[0007] To achieve the above-mentioned objectives, the technical solution adopted by this invention is as follows: A method for predicting passenger flow in and out of stations based on spatiotemporally labeled multi-graph convolutional networks includes the following steps: Obtain passenger flow data; The passenger flow data is spatiotemporally labeled and encoded using a pre-generated self-learning spatiotemporal label vector to obtain the spatiotemporally labeled and encoded passenger flow sequence. Static topology graphs, passenger flow similarity graphs, and functional similarity graphs of the transportation network are constructed. An adaptive weighted summation method is used to fuse multi-graph information. The fused graph structure is then convolved with the spatiotemporally labeled passenger flow sequence to obtain passenger flow spatial dependency features. A gated loop unit is used to capture the temporal patterns of short- and long-term passenger flow based on the spatial dependence features of passenger flow, and an attention mechanism is combined to dynamically assign weights to time nodes to obtain the predicted passenger flow in and out of the station.
[0008] Furthermore, the self-learning spatiotemporal label vector is generated as follows: Time t Passenger flow data is divided into recent time series segments. Xtr =[ Xt - p , , Xt -2, Xt -1], daily cycle time segment Xtd =[ Xt - a - p +1, , Xt - a -1, Xt - a Weekly time series segment Xtw =[ Xt -7 a - p +1, , Xt -7 a -1, Xt -7 a ],in, a The total time step for each day, p For historical time steps; Construct spatial label vectors based on time series data of passenger flow. E ; Construct a recent time series label vector based on the number of sequence samples in recent time series segments. E r ; Construct a daily periodic time series label vector based on the number of samples taken in a day within the daily periodic time series segment. E d ; Construct a weekly periodic time series label vector based on the number of samples taken in a week within the weekly periodic time series segment. E w .
[0009] Furthermore, the passenger flow data is spatiotemporally labeled and encoded using pre-generated self-learning spatiotemporal label vectors to obtain the spatiotemporally labeled and encoded passenger flow sequence, including: For the i Passenger flow time series at time t The time segments are embedded through a fully connected layer to obtain the passenger flow embedding vector; According to the i Passenger flow time series at time t The time segment query corresponds to the pre-generated self-learning spatiotemporal label vector. The passenger flow embedding vector is concatenated with the self-learning spatiotemporal label vector to obtain the spatiotemporally labeled passenger flow sequence.
[0010] Furthermore, the static topology diagram of the transportation network is constructed as follows:
[0011] in, A adj ( i , j ) is the in the physical adjacency matrix i Line number j Column elements, v i For the first i One site, v j For the first j One site.
[0012] Furthermore, constructing a passenger flow similarity graph for the transportation network includes: The distance between the passenger flow sequences of two stations is calculated using the dynamic time warping method; The attenuation coefficient is calculated based on the number of inflection points and the total number of stations along the optimal path, and then distance correction is performed using the attenuation coefficient. Passenger flow similarity is calculated based on the corrected distance, and a passenger flow similarity matrix is constructed using the passenger flow similarity.
[0013] Furthermore, the attenuation coefficient is calculated based on the number of inflection points on the optimal path and the total number of stations as follows:
[0014] in, β The attenuation coefficient is... Lo This represents the number of inflection points on the optimal path. Li Represents a node i The total number of sites in the country.
[0015] Furthermore, the functional similarity diagram for constructing the transportation network includes: Calculate the density feature vectors of different interest points around the road based on their type and number; Calculate the functional similarity of different points of interest around the road based on the density feature vectors of different points of interest around the road. A functional similarity matrix is constructed by utilizing the functional similarity of different points of interest around the road.
[0016] Furthermore, the density feature vectors of different points of interest around the road are calculated based on their type and quantity as follows:
[0017] in, P vi ( k ) is the first one around the road k Density feature vectors of interest points n i For roads v i Total number of surrounding points of interest n i k For roads v i The surrounding area k Number of points of interest N The total number of points of interest in the entire road network. N k The first in the entire road network k The number of interest points of the same type.
[0018] Furthermore, the adaptive weighted summation method is used for multi-graph information fusion as follows:
[0019] in, A The resulting graph structure. A adj It is the physical adjacency matrix. A s For passenger flow similarity matrix, A f For functional similarity matrices, w adj The weights of the physical adjacency matrix. w s The weights of the passenger flow similarity matrix, w f The weights are the weights of the functionally similar matrices.
[0020] Furthermore, the fused graph structure is convolved with the spatiotemporally labeled passenger flow sequence to obtain the spatial dependency features of the passenger flow, specifically:
[0021] in,H t Due to the spatial dependence of passenger flow, It is a graph structure with self-loops. D The degree matrix of the graph structure. X I The passenger flow sequence after spatiotemporal labeling. These are the learnable parameters in the graph convolutional layer.
[0022] The present invention has the following beneficial effects: This invention effectively solves the problem of spatiotemporal inseparability by constructing a spatiotemporal labeling and encoding module to generate self-learning node embedding vectors. Furthermore, it designs a multimodal graph structure learning framework and a temporal feature extraction module to achieve joint modeling of multi-source spatial dependencies and dynamic temporal changes. This enhances the ability to identify historical passenger flow patterns, improves the accuracy of predicting future passenger flow changes, and provides strong support for optimizing urban rail transit operation strategies and improving service quality. Attached Figure Description
[0023] Figure 1 This is a schematic diagram of a method for predicting passenger flow in and out of stations based on a multi-graph convolutional network with spatiotemporal labeling. Figure 2 This is a schematic diagram of a multi-graph convolutional network framework for predicting passenger flow in and out of stations based on spatiotemporal labeling. Figure 3 These are time-series sample diagrams from different locations (sites) within the same time period; Figure 4 These are time-series sample diagrams of the same space (site) but different time periods; Figure 5 The graph shows the results of hyperparameter tuning. Figure 6 This is a comparison of the ablation experimental results of the STT-MGCN model at different time granularities. Detailed Implementation
[0024] The specific embodiments of the present invention are described below to enable those skilled in the art to understand the present invention. However, it should be understood that the present invention is not limited to the scope of the specific embodiments. For those skilled in the art, various changes are obvious as long as they are within the spirit and scope of the present invention as defined and determined by the appended claims. All inventions utilizing the concept of the present invention are protected.
[0025] like Figure 1 As shown in the figure, an embodiment of the present invention provides a method for predicting passenger flow in and out of stations based on a multi-graph convolutional network with spatiotemporal labeling, comprising the following steps S1 to S4: S1. Obtain passenger flow data; S2. Use the pre-generated self-learning spatiotemporal label vector to perform spatiotemporal label encoding on the passenger flow data to obtain the spatiotemporally labeled encoded passenger flow sequence. In this embodiment, the self-learning spatiotemporal label vector is generated as follows: Time t Passenger flow data is divided into recent time series segments. Xtr =[ Xt - p , , Xt -2, Xt -1], daily cycle time segment Xtd =[ Xt - a - p +1, , Xt - a -1, Xt - a Weekly time series segment Xtw =[ Xt -7 a - p +1, , Xt -7 a -1, Xt -7 a ],in, a The total time step for each day, p For historical time steps; Construct spatial label vectors based on time series data of passenger flow. E ; Construct a recent time series label vector based on the number of sequence samples in recent time series segments. E r ; Construct a daily periodic time series label vector based on the number of samples taken in a day within the daily periodic time series segment. E d ; Construct a weekly periodic time series label vector based on the number of samples taken in a week within the weekly periodic time series segment. E w .
[0026] The passenger flow data is spatiotemporally labeled and encoded using pre-generated self-learning spatiotemporal label vectors to obtain the spatiotemporally labeled and encoded passenger flow sequence, including: For the i Passenger flow time series at time t The time segments are embedded through a fully connected layer to obtain the passenger flow embedding vector; According to the i Passenger flow time series at time tThe time segment query corresponds to the pre-generated self-learning spatiotemporal label vector. The passenger flow embedding vector is concatenated with the self-learning spatiotemporal label vector to obtain the spatiotemporally labeled passenger flow sequence.
[0027] In this embodiment, the transportation network is treated as an undirected connected graph, denoted as . G = (V, E, A) .in, G Indicates transportation network, V It is a set of nodes. E It is a set of edges. A This represents the adjacency matrix reflecting the connectivity relationships between nodes in a graph. Let the transportation network contain N stations; define the input feature tensor. X ∈ R N×p×K Indicates each station at p A historical time step K 3D feature data. The prediction task aims to build network topology. G and historical data X To the future q time step I dimensional feature tensor Y∈ R N×p×I mapping relationship f ( ), meaning outputting all stations in the future q a time step I The predicted value, this mapping relationship is expressed as:
[0028] To better utilize the GRU model's ability to capture short-term and long-term time dependencies, the input time series is sliced, i.e., multi-time-period feature extraction is performed, dividing the input time series into three segments: recent time series segments. Xtr =[ Xt - p , , Xt -2, Xt -1]∈ RN × p Daily cycle time series segments Xtd =[ Xt - a - p +1, , Xt - a -1, Xt - a ]∈ RN × p Weekly time series segments Xtw =[ Xt -7 a - p +1, , Xt -7 a -1, Xt -7 a ]∈ RN × p Where 'a' represents the total time step for each day in the data, and this value is related to the chosen time granularity.
[0029] The spatiotemporal labeled multi-graph convolutional network model framework constructed in this embodiment consists of a spatiotemporal labeling encoding module, a multi-graph convolution module, and an attention-gated recurrent unit, as follows: Figure 2 As shown, historical passenger flow data first enters the spatiotemporal labeling and encoding module, which generates label vectors with spatiotemporal distinctiveness and self-learning ability for nodes at different time series and spatial locations; the multi-graph learning module deeply extracts the explicit and implicit spatial dependencies of passenger flow through graph convolution operations; the gated recurrent unit is used to capture the long-term and short-term passenger flow time change patterns, and combines the attention mechanism to fit the degree of influence of passenger flow at each time step on the model prediction, so as to ensure the accuracy of future passenger flow prediction.
[0030] Generally, the passenger flow time series samples before forecasting are obtained from an original time series using a sliding window. Considering that different series and different periods exhibit different passenger flow patterns, the time series obtained by the sliding window ultimately contains many samples with similar historical data but different future data, such as... Figure 3 and Figure 4 As shown.
[0031] Figure 3 and Figure 4 In the middle, the green box represents a sliding window, the left side of the green dotted line represents historical passenger flow data, and the right side represents future passenger flow data. Figure 3 This shows data obtained from sliding windows at different sites within the same time period. Their historical data is similar, but their future data differs greatly. Similarly, Figure 4 The data also shows the results of a sliding window at the same site over different time periods, exhibiting a similar historical pattern but drastically different future outcomes. Traditional prediction models cannot produce drastically different prediction results for samples with similar historical data but drastically different future data. This property is referred to in this embodiment as spatiotemporal indistinguishability.
[0032] To address this spatiotemporal indistinguishability, this embodiment designs a spatiotemporal labeling encoding module. This module generates self-learning label vectors to encode nodes, ultimately producing node inputs with spatiotemporal discriminability. Four types of vectors are used for encoding, representing the spatial and temporal discriminability of the nodes.
[0033] Assume the number of time series is N Randomly initialize a matrix E ∈ RN×M ,in M This matrix represents the dimension of the embedding and is used for spatial labeling and encoding of passenger flow sequences.
[0034] Assuming that in the recent periodic slice of time series data, the number of sequence samples is... N r Randomly initialize a matrix E r ∈ R Nr×M ,in M Indicates the dimension of the embedding.
[0035] Assuming that in a daily periodic slice of time series data, the number of samples per day is... N d Randomly initialize a matrix E d ∈ R Nd×M ,in M Indicates the dimension of the embedding.
[0036] Assuming that in a periodic slice of time series data, the number of samples per week is... N w =7, randomly initialize a matrix. E w ∈ R Nw×M ,in M Indicates the dimension of the embedding.
[0037] matrix E r , E d , E w This represents a time-stamped encoding of passenger flow sequences. The above four matrices are randomly initialized and then trained by the model to obtain reasonable values, exhibiting self-learning properties.
[0038] For a given number i A passenger flow time series, which is in t The time segment obtained at time point is denoted as X i t-p:t ∈R p By querying the four encoding matrices respectively, four matrices of length are obtained. M vector: E i , E i r , E id , E i w .right X i t-p:t ∈R p The query performs embedding operations through a fully connected layer, transforming it into... X i M Then, it is concatenated with the four label vectors, specifically: ; .
[0039] S3. Construct a static topology graph, passenger flow similarity graph, and functional similarity graph of the transportation network. Use an adaptive weighted summation method to fuse multi-graph information. Then, perform graph convolution operation between the fused graph structure and the passenger flow sequence encoded with spatiotemporal labels to obtain passenger flow spatial dependency features. In this embodiment, graphs are used to encode different types of spatial relationships. Three adjacency matrices based on different information and constructed by different methods are designed to capture the spatial characteristics of the traffic network.
[0040] In transportation networks, directly connected nodes typically exhibit higher spatial correlation, while less connected nodes show lower correlation. To capture these explicit spatial associations between directly connected stations, we utilize... This reflects the adjacency relationship between nodes in the network, specifically:
[0041] in, A adj ( i , j ) is the _th ... i Line number j Column elements, v i For the first i One site, v j For the first j Each site. When the site v i With the site v j When physically connected A adj ( i , j ) = 1, otherwise 0.
[0042] In subway transportation networks, even if stations are not directly connected, their passenger flow may exhibit similar patterns and trends. These trends reflect changes in passenger flow over time, but they also reveal an implicit connection between stations with similar patterns. Therefore, to capture this potential spatial connection, a spatial correlation matrix based on passenger flow similarity is constructed using the Dynamic Time Warping (DTW) algorithm.
[0043] Generally, passenger flow similarity graphs are denoted as... GP = ( V , E , AP ), AP ∈R N × N Represents the passenger flow similarity matrix. N This indicates the total number of subway stations. wp ( vi , vj (site) vi With the site vj Passenger flow pattern similarity. Select an appropriate time granularity and organize it into an inbound passenger flow sequence. Ivi and exit passenger flow sequence Ovi The passenger flow sequence entering the station is spliced together to obtain Pvi ∈R1× T ,in T This represents the length of the time series. The calculation process is as follows: For the site vi and vj The DTW algorithm is used to calculate. Pvi and Pvj The distance between them is denoted as DTW ( vi , vj First, calculate the matrix according to formula (5). D All elements in D ( i , j ), then calculate DTW ( vi , vj Specifically:
[0044]
[0045] To better reflect the actual similarity between time series, especially when dealing with time series with different time offsets or phase differences, an attenuation coefficient is introduced to adjust the degree of similarity. DTW Distance, specifically:
[0046]
[0047] in, β Indicates the attenuation coefficient. Lo This represents the number of inflection points on the optimal path. Li Indicates the first i The length of the diagonal line segment (total number of stations). S ( i , j ) represents the distance after correction by the attenuation coefficient.
[0048] Obtain the corrected distance S ( i , j After that, it needs to be converted into passenger flow similarity calculation, specifically:
[0049] in, α and ε The parameter represents the control of the sparsity of the matrix. wp ( vi , vj This indicates the similarity of passenger flow. wp ( vi , vj Set as a node i and j The element values corresponding to the similarity matrix are used to obtain the passenger flow similarity matrix. A s .
[0050] Using 30-minute time granularity, passenger flow data for a subway station over a continuous week was selected as the time series input to calculate the passenger flow similarity between different subway stations. Figure 3-5 A heatmap showing the similarity of their passenger flow is displayed here. β The value is 5×10 -4 , ε The value is 0.75.
[0051] In transportation networks, the various facilities surrounding a station and the type of geographical area it occupies influence its traffic patterns. Different types of geographical areas (such as commercial areas, residential areas, and industrial areas) exhibit varying traffic characteristics due to differences in their internal facilities and services, while roads with similar traffic patterns are correlated to some extent. To capture these differences and build a reasonable model, this embodiment introduces a functional similarity map based on points of interest. This map quantifies the types and number of points of interest around a station, calculates the functional similarity between roads, and uses this to construct an adjacency matrix to describe the spatial correlation and traffic pattern correlation between roads.
[0052] Based on the types and quantities of points of interest (POIs) around a road, a functional similarity matrix is calculated. Referring to the TF-IDF algorithm in natural language processing, the specific calculation method for the density of different POI types around a road is as follows:
[0053] in, P vi ( k ) is the first one around the road k Density feature vectors of interest points n i For roads v i Total number of surrounding points of interest n i k For roads v i The surrounding area k Number of points of interest N The total number of points of interest in the entire road network. N k The first in the entire road network k The number of interest points of the same type.
[0054] Obtain the POI density feature vectors for different roads P vi ( k After that, the functional similarity of POIs between different roads is calculated based on cosine similarity, specifically as follows:
[0055] in, S f ( i , j ) indicates road v i and roads v j Cosine similarity based on POI features.
[0056] Based on the cosine similarity mentioned above, the adjacency matrix of the functional similarity graph is constructed. A f Specifically: .
[0057] In GCN, the input graph is actually represented as an adjacency matrix. The road network can be viewed as a graph structure, where different road segments are considered nodes, and graph signals represent node features. GCN captures deep features by aggregating node features, thereby effectively processing graph-structured data. To fuse and aggregate spatial information from different graphs, an adaptive weighting method is used to complete the graph fusion task, specifically:
[0058] in, A The resulting graph structure. A adj It is the physical adjacency matrix. A s For passenger flow similarity matrix, A f For functional similarity matrices, w adj The weights of the physical adjacency matrix. w s The weights of the passenger flow similarity matrix, w f The weights of the functional similarity matrix are obtained through model self-learning; This represents the element-wise dot product operation.
[0059] The passenger flow sequence fragments, after undergoing spatiotemporal labeling and encoding, are then fed into the GCN layer, specifically as follows:
[0060] in, H t Due to the spatial dependence of passenger flow, It is a graph structure with self-loops. D The degree matrix of the graph structure. X I The passenger flow sequence after spatiotemporal labeling. For learnable parameters in graph convolutional layers, nodes can be based on Aggregate information from neighboring nodes and update it automatically.
[0061] S4. A gated loop unit is used to capture the long-term and short-term passenger flow time series patterns based on the spatial dependence features of passenger flow, and an attention mechanism is combined to dynamically allocate the weights of time nodes to obtain the passenger flow prediction results for entering and exiting the station.
[0062] In this embodiment, LSTM, as a variant of RNN, improves the problem of RNN's inability to handle long-term dependencies by using carefully designed structures called "gates" to remove or add information to the cell state. However, on the one hand, due to the presence of three types of gating, the number of units in LSTM is four times that of traditional RNN, significantly increasing training time and resource consumption; on the other hand, the functions of the forget gate and the input gate may be coupled. Therefore, this embodiment uses an attention mechanism combined with GRU to capture temporal features.
[0063] In the temporal attention module, the attention weights for the Value are typically assigned through the convergence of attention between the Query and the Key to generate the output. Assume that the input to the GRU at time t is a vector after spatial feature extraction. hGt Hidden state is hRt- 1, then Q , K , V The calculation formula is:
[0064]
[0065]
[0066] in, w q , w k , w v Represents the learnable parameter matrix; Q t This indicates the information that needs to be queried. K t and V t This represents the input key-value pair.
[0067] Then according to Q t and K t To calculate the correlation between the two, we use the scaled dot product attention approach, and the formula is as follows:
[0068] in, express Q t and K t The correlation; d Representing vectors Q t and K tThe length.
[0069] The softmax function is used to map all relevances to the interval [0,1] to obtain the attention score, specifically:
[0070] Next, the weights of the GRU input are adjusted using the attention score, that is, the degree of influence of different time steps on the information at the current time step is adjusted, specifically as follows: .
[0071] The formula for calculating GRU incorporating the attention mechanism is as follows:
[0072]
[0073]
[0074]
[0075] in, wr , wz , wh These represent the weights of the corresponding reset gate, update gate, and candidate hidden state, respectively. br , bz , bh These represent the biases for the corresponding reset gate, update gate, and candidate hidden state, respectively. It represents the Hadamardi (or Hadama) stack; σ This represents the activation function, which acts as a gating signal to transition intermediate states to the range of 0 to 1.
[0076] The method of the present invention will be analyzed and explained below with reference to specific experiments.
[0077] 1. Data Preprocessing 1.1 Dataset Preparation This embodiment uses operational data from a specific subway line from a specific date to a specific day to construct an analysis dataset. The original data covers several rail transit stations and several operating subway lines. The experimental data mainly consists of two parts: one is a 282×282 matrix describing the spatial adjacency relationships between stations, where each row represents a subway station and the element value is 0 or 1, representing that the stations are not adjacent or are adjacent; the other is a matrix based on passenger flow data, where each row represents a station and each column represents the passenger flow entering and exiting the station at different time periods. The entire matrix records time-varying passenger flow data.
[0078] The effective observation period was set from 6:30 AM to 11:00 PM, and data cleaning was performed, resulting in approximately 70 million valid travel records. Passenger flow sequence datasets with three time granularities—5 minutes, 15 minutes, and 30 minutes—were constructed. Simultaneously, a physical adjacency graph was generated based on the actual rail transit network topology. The data partitioning scheme is as follows: the training set uses operational data from a specific date within a certain month, the validation set uses data from a specific date within a certain month, and the test set includes data samples from a specific date to the end of the month.
[0079] 1.2 Experimental Environment Setup This embodiment constructs an STT-MGCN hybrid neural network model based on the PyTorch framework. Range normalization is used to linearly map passenger flow sequence data to the [0,1] interval for model training. During the prediction phase, inverse normalization is used to restore the original dimensions before result evaluation. The model training configuration employs a differentiated learning rate strategy for slices of data at different time granularities: a learning rate of 1e-4 is set for 5-minute granularity data, while 1e-3 is increased for 15-minute and 30-minute granularity data. The Adam algorithm is used for optimization, with L1Loss as the loss function, calculated as follows:
[0080] To prevent overfitting, an early stopping mechanism was used during training. Regarding parameter settings, the maximum number of training epochs was set to 800. Throughout the training process, the patience value was set to 40 for 5-minute granularity data, and 80 for 15-minute and 30-minute granularity data. Finally, the prediction time step was set to 12.
[0081] 1.3 Evaluation Indicators To evaluate the model's prediction accuracy, three performance metrics are used: Root Mean Square Error (RMSE), Mean Absolute Error (MAE), and Weighted Mean Absolute Percentage Error (wMAPE). The calculation formulas are as follows:
[0082]
[0083]
[0084] in, y i This represents actual passenger flow data. Indicates the predicted value; N This represents the total number of nodes.
[0085] This paper uses the operation data of Chengdu Metro from May 5 to 31, 2022 to construct an analysis dataset. The original data covers 282 rail transit stations and 12 metro lines in operation.
[0086] 2. Parameter tuning Before the experiment, the hyperparameters were tuned, and the input slice time step and the number of hidden units were adjusted. The results are as follows: Figure 5 As shown.
[0087] 3. Performance Comparison and Result Analysis This embodiment uses two datasets, airport terminal stations and high-speed rail stations, to evaluate the predictive performance of the STT-MGCN model and compares the results with seven baseline models (ARIMA, SVR, MLP, LSTM, TCN, and GCN-GRU). Furthermore, to further explore the impact of each model component on predictive performance and the effectiveness of the improvement method, model ablation experiments were conducted.
[0088] 3.1 Comprehensive Performance Comparison and Result Analysis As shown in Tables 1 and 2, overall, MLP, as a fundamental method of deep learning, significantly outperforms ARIMA in prediction. It also outperforms SVR in prediction at 15-minute and 30-minute time granularities. The main reason is that deep learning-based counting models can learn deeper features in the data by stacking neural network layers, thereby completing more accurate and efficient prediction tasks.
[0089] Table 1. Passenger Flow Forecast Results at Three Time Granularities
[0090] Table 2. Outbound passenger flow prediction results at three different time granularities.
[0091] While all are deep learning-based methods, LSTM, TCN, and TGCN outperform MLP in prediction. For example, in predicting passenger flow at a 30-minute time granularity for entering and exiting the station, LSTM reduced RMSE and MAE by 11.72% and 10.72% (entry 30 min), and 17.73% and 16.24% (exit 30 min), respectively, compared to MLP; while TCN reduced RMSE and MAE by 6.41% and 5.02% (entry 30 min), and 12.76% and 15.93% (exit 30 min), respectively, compared to MLP.
[0092] The superior prediction performance of LSTM and TCN models is due to the fact that LSTM captures long-term dependencies in the time dimension through a gating mechanism, and its unique memory unit design effectively solves the gradient explosion and vanishing problems of traditional RNNs. TCN, on the other hand, uses an expanded convolutional structure to build a dynamic perception range, and combined with the inherent parallel computing characteristics of convolutional neural networks, it balances computational efficiency and model accuracy in the process of temporal feature extraction.
[0093] The three deep learning-based models mentioned above all focus on capturing temporal relationships, while TGCN performs a simple modeling of the spatial correlations between subway stations, initially uncovering spatial associations and ultimately achieving better prediction results with further improved prediction accuracy. In all time-granularity passenger flow prediction tasks, STT-MGCN achieves the best prediction performance. For example, in the 5-minute time-granularity passenger flow prediction task, compared to the TGCN model, STT-MGCN's RMSE and MAE decrease by 12% and 7.76% (5 minutes for entry), and 9.85% and 5.35% (5 minutes for exit), respectively.
[0094] 3.2 Ablation Experiment and Analysis The STT-MGCN model contains multiple spatiotemporal components. To further investigate the impact of different spatiotemporal components on prediction accuracy and verify the effectiveness of each component, this embodiment designs an ablation experiment to analyze the MFGCN-GRU model. The results are shown in Tables 3 and 4. Figure 6 As shown in Tables 3 and 4, the functional similarity graph and its sub-models respectively demonstrate the passenger flow prediction results for entering and exiting the station at three different time granularities. Figure 6 The evaluation index results in Tables 3 and 4 were then visually compared using a bar chart.
[0095] Table 3. Comparison of Evaluation Indicators for Passenger Flow Prediction at Three Time Granularities in STT-MGCN and its Sub-models
[0096] Table 4. Comparison of Evaluation Indicators for Outbound Passenger Flow Prediction at Three Time Granularities for STT-MGCN and its Sub-models
[0097] The names and details of the ablation sub-models are as follows: STT-MGCN-a: The sub-model with physical adjacency graph removed.
[0098] STT-MGCN-b: A sub-model that removes the passenger flow similarity map.
[0099] STT-MGCN-c: Sub-models with functional similarity graphs removed.
[0100] STT-MGCN-d: Sub-model with time stamp encoding removed.
[0101] STT-MGCN-e: A sub-model with spatial tag encoding removed.
[0102] STT-MGCN-att: A sub-model that removes the temporal attention mechanism.
[0103] Ablation experiments show that the synergistic effect of the spatiotemporal components in the STT-MGCN model significantly improves the accuracy of passenger flow prediction for arrivals and departures. In passenger flow prediction, STT-MGCN achieves optimal RMSE, MAE, and wMAPE at 5-minute, 15-minute, and 30-minute time granularities. The RMSE at the 30-minute granularity is 3.3% lower than the second-best performing model, MGCN-GRU-b, validating the effectiveness of multi-component fusion. Specifically, the removal of the physical adjacency graph (STT-MGCN-a) leads to a significant difference in RMSE at the 15-minute granularity compared to the complete model, indicating that physical adjacency relationships are crucial for modeling the spatial dependence of passenger flow in the short to medium term. The removal of the passenger flow similarity graph (STT-MGCN-b) has a relatively small impact on MAE (7.035 people) at the 5-minute granularity, but the wMAPE at the 30-minute granularity (7.415%) is 3.2% higher than the complete model (7.186%), demonstrating that passenger flow similarity plays a unique role in suppressing long-term prediction errors. The removal of the temporal attention mechanism (STT-MGCN-att) resulted in a MAE (15.678 participants) close to that of the complete model (15.208 participants) at the 15-minute granularity, but its RMSE (45.176 participants) was significantly degraded at the 30-minute granularity, indicating that this mechanism is irreplaceable for capturing dynamic patterns in the long temporal domain.
[0104] The outbound passenger flow prediction results (Table 4) further reveal the differentiated impact of different components. The RMSE of STT-MGCN at the 30-minute granularity (51.295 people) is 3.9% lower than that of the optimal sub-model STT-MGCN-e (53.358 people), highlighting the necessity of multi-component joint optimization. The removal of the functional similarity graph (STT-MGCN-c) results in a significantly higher wMAPE at the 5-minute granularity (12.603%) compared to the complete model (12.229%), indicating that functional similarity is particularly crucial for characterizing short-term outbound passenger flow distribution. The absence of time-stamped encoding (STT-MGCN-d) increases the MAE at the 30-minute granularity (26.344 people) by 4.5% compared to the complete model (25.204 people), validating that spatiotemporal encoding reduces the temporal inseparability of passenger flow in long-term prediction.
[0105] In summary, physical adjacency graphs, functional similarity graphs, and temporal attention mechanisms enhance local spatial association, global semantic association, and temporal feature modeling capabilities, respectively, while the synergistic effect of temporal-spatial labeling effectively alleviates the problem of spatiotemporal inseparability. Ablation experiments confirm the completeness of the STT-MGCN component design, and its multi-level spatiotemporal fusion mechanism provides a robust solution for rail transit passenger flow prediction.
[0106] To address the challenges of modeling complex spatiotemporal dependencies and the widespread spatiotemporal indistinguishability of passenger flow time-series data, this invention proposes a spatiotemporally labeled multi-graph convolutional network model. By integrating spatiotemporal labeling encoding, multi-graph convolutional networks, and attention gating units, it captures and fuses spatial distribution, topological correlation, and dynamic temporal features, thereby alleviating the spatiotemporal indistinguishability of data and improving the accuracy of passenger flow prediction.
[0107] (1) The STT-MGCN model effectively distinguishes the spatiotemporal sources of passenger flow through spatiotemporal labeling encoding; at the same time, the multi-graph convolutional network and attention gating unit deeply explore the multi-level spatiotemporal correlations of passenger flow data, improving the model's ability to model complex spatiotemporal relationships. In addition, the modular design of the model ensures the efficiency and accuracy of feature extraction and utilization.
[0108] (2) The experiment used subway passenger flow data with time granularities of 5, 15, and 30 minutes. Compared with various baseline models, the STT-MGCN model showed significant advantages in evaluation indicators such as RMSE, MAE, and wMAPE. Ablation experiments further verified the necessity of each module.
[0109] (3) In reality, passenger flow is not only affected by time and space factors, but also by external factors such as weather and holidays. Future research will combine multimodal data, such as meteorological data, holiday information, and special events, to enrich the input information of the model and improve the accuracy and robustness of prediction.
[0110] This invention is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart illustrations and / or block diagrams. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.
[0111] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.
[0112] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.
[0113] Specific embodiments have been used to illustrate the principles and implementation methods of this invention. The descriptions of the embodiments above are only for the purpose of helping to understand the method and core ideas of this invention. At the same time, for those skilled in the art, there will be changes in the specific implementation methods and application scope based on the ideas of this invention. Therefore, the content of this specification should not be construed as a limitation of this invention.
[0114] Those skilled in the art will recognize that the embodiments described herein are intended to help the reader understand the principles of the invention, and should be understood that the scope of protection of the invention is not limited to such specific statements and embodiments. Those skilled in the art can make various other specific modifications and combinations based on the technical teachings disclosed in this invention without departing from the spirit of the invention, and these modifications and combinations are still within the scope of protection of this invention.
Claims
1. A method for predicting passenger flow in and out of stations based on spatiotemporally labeled multi-graph convolutional networks, characterized in that, Includes the following steps: Obtain passenger flow data; The passenger flow data is spatiotemporally labeled and encoded using a pre-generated self-learning spatiotemporal label vector to obtain the spatiotemporally labeled and encoded passenger flow sequence. Static topology graphs, passenger flow similarity graphs, and functional similarity graphs of the transportation network are constructed. An adaptive weighted summation method is used to fuse multi-graph information. The fused graph structure is then convolved with the spatiotemporally labeled passenger flow sequence to obtain passenger flow spatial dependency features. A gated loop unit is used to capture the temporal patterns of short- and long-term passenger flow based on the spatial dependence features of passenger flow, and an attention mechanism is combined to dynamically assign weights to time nodes to obtain the predicted passenger flow in and out of the station.
2. The method for predicting passenger flow in and out of stations based on spatiotemporally labeled multi-graph convolutional networks according to claim 1, characterized in that, The self-learning spatiotemporal label vector is generated as follows: Time t Passenger flow data is divided into recent time series segments. Xtr =[ Xt - p , , Xt -2, Xt -1], daily cycle time segment Xtd =[ Xt - a - p +1, , Xt - a -1, Xt - a Weekly time series segment Xtw =[ Xt -7 a - p +1, , Xt -7 a -1, Xt -7 a ],in, a The total time step for each day, p For historical time steps; Construct spatial label vectors based on time series data of passenger flow. E ; Construct a recent time series label vector based on the number of sequence samples in recent time series segments. E r ; Construct a daily periodic time series label vector based on the number of samples taken in a day within the daily periodic time series segment. E d ; Construct a weekly periodic time series label vector based on the number of samples taken in a week within the weekly periodic time series segment. E w .
3. The method for predicting passenger flow in and out of stations based on spatiotemporally labeled multi-graph convolutional networks according to claim 1, characterized in that, The passenger flow data is spatiotemporally labeled and encoded using pre-generated self-learning spatiotemporal label vectors to obtain the spatiotemporally labeled and encoded passenger flow sequence, including: For the first i Passenger flow time series at time t The time segments are embedded through a fully connected layer to obtain the passenger flow embedding vector; According to the i Passenger flow time series at time t The time segment query corresponds to the pre-generated self-learning spatiotemporal label vector. The passenger flow embedding vector is concatenated with the self-learning spatiotemporal label vector to obtain the spatiotemporally labeled passenger flow sequence.
4. The method for predicting passenger flow in and out of stations based on spatiotemporally labeled multi-graph convolutional networks according to claim 1, characterized in that, The static topology diagram of the transportation network is as follows: in, A adj ( i , j ) is the in the physical adjacency matrix i Line 1 j Column elements, v i For the first i One site, v j For the first j One site.
5. The method for predicting passenger flow in and out of stations based on a multi-graph convolutional network with spatiotemporal labeling as described in claim 1, characterized in that, The passenger flow similarity graphs for constructing transportation networks include: The distance between the passenger flow sequences of two stations is calculated using the dynamic time warping method; The attenuation coefficient is calculated based on the number of inflection points and the total number of stations along the optimal path, and then distance correction is performed using the attenuation coefficient. Passenger flow similarity is calculated based on the corrected distance, and a passenger flow similarity matrix is constructed using the passenger flow similarity.
6. The method for predicting passenger flow in and out of stations based on spatiotemporally labeled multi-graph convolutional networks according to claim 5, characterized in that, The attenuation coefficient is calculated based on the number of inflection points along the optimal path and the total number of stations as follows: in, β The attenuation coefficient is... Lo This represents the number of inflection points on the optimal path. Li Represents a node i The total number of sites in the country.
7. The method for predicting passenger flow in and out of stations based on spatiotemporally labeled multi-graph convolutional networks according to claim 1, characterized in that, Functional similarity diagrams for constructing transportation networks include: Calculate the density feature vectors of different interest points around the road based on their type and number; Calculate the functional similarity of different points of interest around the road based on the density feature vectors of different points of interest around the road. A functional similarity matrix is constructed by utilizing the functional similarity of different points of interest around the road.
8. The method for predicting passenger flow in and out of stations based on a multi-graph convolutional network with spatiotemporal labeling as described in claim 7, characterized in that, The density feature vectors of different points of interest around the road are calculated based on their type and number. in, P vi ( k ) is the first one around the road k Density feature vectors of interest points n i For roads v i Total number of surrounding points of interest n i k For roads v i The surrounding area k Number of points of interest N The total number of points of interest in the entire road network. N k The first in the entire road network k The number of points of interest.
9. The method for predicting passenger flow in and out of stations based on a multi-graph convolutional network with spatiotemporal labeling as described in claim 1, characterized in that, The adaptive weighted summation method for multi-graph information fusion is specifically as follows: in, A The resulting graph structure. A adj It is the physical adjacency matrix. A s For passenger flow similarity matrix, A f This is a functional similarity matrix. w adj The weights of the physical adjacency matrix. w s The weights of the passenger flow similarity matrix, w f The weights are the weights of the functionally similar matrices.
10. The method for predicting passenger flow in and out of stations based on a multi-graph convolutional network with spatiotemporal labeling as described in claim 1, characterized in that, The fused graph structure is then convolved with the spatiotemporally labeled passenger flow sequence to obtain the spatial dependency features of the passenger flow, specifically: in, H t Due to the spatial dependence of passenger flow, It is a graph structure with self-loops. D The degree matrix of the graph structure. X I The passenger flow sequence after spatiotemporal labeling. These are the learnable parameters in the graph convolutional layer.
Citation Information
Cited By
Rail transit short-term OD passenger flow prediction method based on node-edge space-time fusion
CN122242838A