Urban rail transit short-time pull-in passenger flow prediction method based on space-time dynamic semantic hypergraph convolution
By using space-time dynamic semantic hypergraph convolution technology in urban rail transit, dynamic semantic hypergraph and space-time interaction modules are constructed, and the problem of underutilization of spatial-temporal characteristics and high-order complex relationships in the existing technology are solved, and a higher accuracy of passenger flow prediction is achieved.
Patent Information
- Application Number
- CN202510292400.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-12
- Publication Date
- 2025-06-24
AI Technical Summary
In the prediction of short-term passenger flow in urban rail transit, the existing technology fails to fully consider the dynamic nature and high-order complex relationships of space-time characteristics, resulting in insufficient prediction accuracy.
A short-term incoming passenger flow prediction method based on space-time dynamic semantic hypergraph convolution is proposed. By constructing dynamic semantic hypergraphs and space-time interaction modules, the multi-scale spatiotemporal characteristics of the passenger flow sequence are captured, and feature fusion is performed through time-gated convolution and hypergraph convolution techniques.
It significantly improves the accuracy of passenger flow prediction, can more effectively capture space-time interaction information and high-order relationships, surpassing the performance of traditional methods.
Smart Images

Figure CN120197765A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of intelligent transportation, and particularly relates to a short-term inbound passenger flow prediction method for urban rail transit based on spatio-temporal dynamic semantic hypergraph convolution. Background Technique
[0002] Short-term passenger flow prediction is a typical time series prediction problem, and various prediction methods have been developed, such as parametric models like the Historical Average Model (HA), AutoRegressive Integrated Moving Average Model (ARIMA) and its variant forms, Kalman filtering (KF), etc., and non-parametric models like the Decision Tree (DT). Deep learning methods based on time series have also played an important role in the field of subway passenger flow prediction, which mainly include: Recurrent Neural Network (RNN), Long Short Term Memory (LSTM), Gated Recurrent Unit (GRU), etc. However, these models only consider the time variation of the passenger flow state and ignore the spatial correlation.
[0003] With the development of deep learning technology, graph neural networks (GNNs) have become the main method for processing non-Euclidean space data. Yu et al. proposed a spatio-temporal prediction method based on spatio-temporal graph convolutional networks (STGCNs), which uses graph convolutional neural networks to obtain the spatial characteristics of data sequences and one-dimensional convolutional neural networks to obtain the temporal characteristics of data sequences. However, the traditional graph convolution modeling method adopted by the above method enables the graph structure to only represent the pairwise associations between two points, making it difficult to model the high-order complex relationships between data. Therefore, Yi et al. proposed a time series prediction method for hypergraph convolutional recurrent neural networks (HGC-RNNs). Hypergraphs are used to represent complex spatial dependencies, and hypergraph convolution technology is adopted to extract the spatial dependency features of input data. At the same time, a recurrent neural network structure is used to learn the temporal dependency features from the data sequence. Wang et al. proposed a spatio-temporal hypergraph convolutional network (ST-Hconv). According to the definition of hypergraphs, hyperedges are used to characterize the high-order relationships of traffic networks. At the same time, a spatio-temporal interaction module composed of temporal gated convolution and spatial hypergraph convolution is used to fuse spatio-temporal features. However, when such methods use static hypergraphs to capture the spatial features of sequences, they do not fully consider their dynamic characteristics. At the same time, hypergraphs based on physical topologies only consider the physical structure of traffic networks and ignore the in-depth improvement of network representation capabilities. Summary of the Invention
[0004] The purpose of the present invention is to propose a short-term inbound passenger flow prediction method for urban rail transit based on spatio-temporal dynamic semantic hypergraph convolution to improve the accuracy of passenger flow prediction.
[0005] To achieve the above purpose, the technical solution of the present invention is: a short-term inbound passenger flow prediction method for urban rail transit based on spatio-temporal dynamic semantic hypergraph convolution, including the following steps:
[0006] Step S1: Preprocess the collected subway traffic data set, and generate a passenger flow feature matrix of stations according to the preprocessed passenger flow data; the passenger flow feature matrix of the station uses the station as a node and records the passenger flow characteristics of the node in the form of a feature matrix;
[0007] The subway traffic data set includes the historical passenger flow, the affiliated line, the station type, and the land use attributes around the stations of different subway stations;
[0008] Step S2: According to the size of the prediction time window, divide the passenger flow feature matrix of the station into the recent time series and the daily cycle time series of the station;
[0009] Step S3: Take the recent time series and the daily cycle time series of different stations as passenger flow features, and integrate them with the station features and land use features of the corresponding stations in the subway traffic dataset as the input of the clustering algorithm; on this basis, construct dynamic semantic hypergraphs for the recent time series and the daily cycle time series respectively;
[0010] The station features include the line to which the station belongs and the station type; the land use features include the land use attributes around the station;
[0011] Step S4: Construct a short-term inbound passenger flow prediction model based on the spatio-temporal dynamic semantic hypergraph convolutional network; the short-term inbound passenger flow prediction model includes a spatio-temporal feature extraction layer and a feature fusion layer; the spatio-temporal feature extraction layer contains two spatio-temporal interaction modules for capturing the spatio-temporal features of the deep-level subway passenger flow; the feature fusion layer includes a time-gated convolutional layer and a fully connected layer;
[0012] Step S5: Take the recent time series and the daily cycle time series of the station, and the constructed dynamic semantic hypergraphs of the recent time series and the daily cycle time series as the input data of the spatio-temporal feature extraction layer of the short-term inbound passenger flow prediction model for model training; obtain the final prediction result through the feature fusion layer, and obtain the prediction error according to the loss function, and iterate the model parameters through the optimization algorithm until the model converges, obtain the optimal model and use it for the short-term inbound passenger flow prediction of urban rail transit.
[0013] Preferably, in step S1, preprocess the collected subway traffic dataset, and generate the passenger flow feature matrix of the station according to the preprocessed passenger flow data. The specific steps include:
[0014] Statistically analyze the historical passenger flow data of different subway stations in the subway traffic dataset in units of a preset time period, and represent it as the passenger flow feature matrix X = (X 1 , X 2 , …, X N ), where N represents the number of stations, represents the historical passenger flow statistical data of the Nth station, represents the passenger flow information of the Nth station in the tth time interval;
[0015] Perform Z-Score normalization processing on the continuous passenger flow feature matrix X. The normalization formula is as follows:
[0016]
[0017] Among them, μ represents the average value of the passenger flow feature matrix X, σ represents the standard deviation of the passenger flow feature matrix X, and X' represents the normalized passenger flow feature matrix.
[0018] Preferably, in step S2, according to the size of the prediction time window, the passenger flow feature matrix of the station is divided into the recent time series and the daily cycle time series of the station. The specific steps include:
[0019] Let the current time point be t0, and the size of the prediction time window be T p , and divide one day into q identical-sized time intervals according to a preset duration;
[0020] Intercept two time series segments with a time length of T h and T d from the normalized passenger flow feature matrix of the station along the time axis, and use them as the recent time series X h and the daily cycle time series X d respectively, where T h and T d are both integer multiples of T p ;
[0021] The recent time series refers to a segment of historical time series adjacent to the prediction period:
[0022]
[0023] The daily cycle time series is composed of data in the same time period as the prediction period in the past several days:
[0024]
[0025] In the formula, represents the passenger flow volume data of all stations in the t0-th time interval of the normalized passenger flow feature matrix.
[0026] Preferably, in step S3, the dynamic semantic hypergraphs of the recent time series and the daily cycle time series are constructed respectively. The specific steps include:
[0027] Use the recent time series X h and the daily cycle time series X d as two independent input branches for processing respectively, and represent the recent time series X h and the daily cycle time series X d as historical passenger flow sequences F1, F2, F3,..., F m respectively. When the input is the recent time series X h , m represents the length of T h . When the input is the recent time series, m represents the length of T d ;
[0028] Integrate the historical passenger flow sequences F1, F2, F3, …, F of each branch m with the one-hot encoded station features and land use features to form vector factors where the subscript l represents the total number of parameters involved in the station features and land use features;
[0029] Take the vector factor of each branch as the input of the clustering algorithm to obtain traffic stations of k categories; based on this, construct a corresponding dynamic semantic hypergraph to obtain the recent semantic hypergraph H h and the daily cycle semantic hypergraph H d , and represent it with the incidence matrix H n×m as:
[0030]
[0031] where ν i (i = 1, 2, 3, …, N) represents subway stations, and e j (j = 1, 2, 3,..., k) represents different clusters divided after clustering, and h ij (i = 1, 2, 3,..., N; j = 1, 2, 3,..., k) is the correlation representation between nodes and edges, that is, the attribution relationship between stations and each cluster in the subway network. If station i belongs to cluster j, then h ij takes 1, otherwise takes 0.
[0032] Preferably, the station types include origin stations, transfer stations, terminal stations, and ordinary stations; the land use attributes around the stations are specifically the proportion of different land use attributes within a preset radius centered on the station, including the proportion of residential areas, the proportion of commercial areas, the proportion of office buildings, the proportion of schools, the proportion of hospitals, and the proportion of transportation facilities; at this time, the total number of parameters l involved in the station features and land use features is at least 11 (the station types involve at least 4 parameters, the lines to which the stations belong involve 1 parameter, and the land use attributes around the stations involve at least 6 parameters).
[0033] Preferably, the spatio-temporal interaction module includes two completely identical parallel network structures and a normalization layer. The two parallel network structures are used to process the recent time series and the recent semantic hypergraph, as well as the daily cycle time series and the daily cycle semantic hypergraph respectively; and the ends of the two parallel network structures are connected to the normalization layer; each network structure is composed of a time-gated convolutional layer and a spatial feature extraction layer stacked on top of each other.
[0034] Preferably, each network structure of the spatio-temporal interaction module includes two layers of temporal gated convolutional layers and one layer of spatial feature extraction layer; among them, the recent time series and the daily periodic time series are respectively used as the inputs of the first temporal gated convolutional layer of two network structures; the output of the recent time series through one of the first temporal gated convolutional layers and the recent semantic hypergraph are used as the inputs of the spatial feature extraction layer of the corresponding network structure, and the output of the daily periodic time series through the other first temporal gated convolutional layer and the daily periodic semantic hypergraph are used as the inputs of the spatial feature extraction layer of the corresponding network structure; the outputs of the two spatial feature extraction layers are respectively used as the inputs of the second temporal gated convolutional layer of the corresponding network structure; the outputs of the two second temporal gated convolutional layers are used as the inputs of the normalization layer.
[0035] Preferably, the temporal gated convolutional layer has two input branches: one uses causal convolution to aggregate temporal features, combines residual connection and tanh function to generate a feature representation, denoted as output P; the other is to generate output Q using the sigmoid function after causal convolution, and the output Q is responsible for controlling the transmission and filtering of input information; calculate the Hadamard product e of P and Q to obtain the output of the temporal gated convolutional layer:
[0036]
[0037] Among them, X represents the input passenger flow sequence of the temporal gated convolution, linear() represents the fully connected function, Γ represents the temporal gated convolution kernel, * τ represents the temporal gated convolution operator, Conv() represents the causal convolution function, t is the time step, M is the length of the input passenger flow sequence, K t is the width of the causal convolution kernel for the corresponding time interval, and C0 represents the number of output channels of the temporal convolution layer.
[0038] Preferably, the spatial feature extraction layer includes a multi-head self-attention layer and a spatial hypergraph convolutional layer;
[0039] After processing the input of the spatial feature extraction layer through the multi-head self-attention layer, a residual connection is made with the input of the spatial feature extraction layer to obtain the output X sattn of the multi-head self-attention layer, and the specific expression is as follows:
[0040]
[0041] Q s = X t W Q K s = X t W K V s = X t W V (8)
[0042] Among them, Q s , K s , V s represent the query matrix, key matrix, and value matrix respectively; W Q , W K , W V represent the weight matrices of the corresponding matrices respectively; X t represents the input of the spatial feature extraction layer; is the scaling factor; h represents the number of attention heads; W O is the weight matrix for the output of the multi-head self-attention layer;
[0043] After that, the output of the multi-head self-attention layer and the adjacency matrix corresponding to the dynamic semantic hypergraph generated by the subway passenger flow sequence are jointly input into the hypergraph convolutional network of the spatial hypergraph convolutional layer, and multiple iterations are performed through hypergraph convolution. The hypergraph convolution expression is:
[0044]
[0045] Among them, X sattn is the output of the multi-head self-attention layer; K s represents the length of the spatial hypergraph convolution kernel; g φ is the spatial hypergraph convolution kernel, * δ is the spatial hypergraph convolution operator; k s represents the order corresponding to the currently calculated hypergraph convolution kernel; represents the trainable parameters of the hypergraph convolution kernel, which are used to adjust the weights of the k s -th order high-order hypergraph convolution operator; represents the high-order hypergraph convolution operator, with the normalized Laplacian matrix as the input, and different-order transformations are constructed in a recursive form; φ is the parameter of the hypergraph convolution filter, is to add the identity matrix I to the adjacency matrix A H of the hypergraph to represent self-loops; is the degree matrix of the adjacency matrix A H ; represents the normalized Laplacian matrix; the specific definition of the adjacency matrix A H of the hypergraph is:
[0046]
[0047] A H = HWH T - D v (11)
[0048] v i represents station i; e j represents a certain hyperedge connecting a group of nodes; EH denotes the set of hyperedges contained in the hypergraph; h(v i , e j ) denotes the membership relationship between node v i and hyperedge e j ; w(e j ) denotes the weight value corresponding to the hyperedge, and the weight value is determined according to the number of edges connected to the node; H is used to refer to the association matrix of the recent semantic hypergraph H h or the daily-cycle semantic hypergraph H d ; W ∈ R k ×k is the diagonal matrix of hyperedge weights; D v ∈ R N×N is the diagonal matrix of all node degrees, and for site i, the degree of this node is d(v i ).
[0049] Preferably, in step S6, the final prediction result is obtained through the feature fusion layer, and the prediction error is obtained according to the loss function. The model parameters are iteratively updated through the optimization algorithm until the model converges to obtain the optimal model. Specifically:
[0050] The output result of the spatio-temporal feature extraction layer is input into the time gating convolutional layer of the feature fusion layer, and the prediction result is obtained through the fully connected layer of the feature fusion layer Construct the loss function loss of the model. Continuously update the model parameters according to the loss function value using the backpropagation algorithm. Select Adam as the optimizer for gradient calculation and parameter update in the backpropagation algorithm. After the parameter model converges, obtain the trained optimal model; the specific expression is as follows:
[0051]
[0052] where, X″ c represents the output of the spatio-temporal feature extraction layer, linear() represents the fully connected function, Y i is the true traffic data target value, is the model prediction value, and θ is all learnable parameters in the model.
[0053] Compared with the prior art, the present invention has the following beneficial effects:
[0054] The present invention proposes a short-term inbound passenger flow prediction model based on a spatio-temporal dynamic semantic hypergraph convolutional network. A dynamic semantic hypergraph is constructed according to the clustering results of the passenger flow characteristics, station characteristics, and land use characteristics of the dynamic subway passenger flow sequence. On this basis, the model models and introduces the recent and daily periodic inherent characteristics of the subway passenger flow to achieve multi-scale feature processing of the passenger flow sequence. Specifically, the model extracts the time features of the passenger flow sequence by integrating causal convolution into the gated hyperbolic tangent unit in the time-gated convolutional layer. In the spatial feature extraction layer, a multi-head self-attention mechanism combined with a residual connection is used to capture the dynamic complex spatial dependencies between different stations, and hypergraph convolution is used to capture the high-order relationships between stations. Finally, the spatio-temporal features of the subway passenger flow at multiple scales are fused through the time-gated convolutional layer and the fully connected layer. Thereby, the accuracy of passenger flow prediction is greatly improved. BRIEF DESCRIPTION OF THE DRAWINGS
[0055] Figure 1 FIG. is the overall framework diagram of the short-term inbound passenger flow prediction model based on the spatio-temporal dynamic semantic hypergraph convolutional network of the present invention;
[0056] Figure 2 FIG. is a schematic diagram of the division of the preprocessed passenger flow data of the present invention;
[0057] Figure 3 FIG. is the internal structure diagram of the spatio-temporal interaction module in the model of the present invention;
[0058] Figure 4 FIG. is the structure diagram of the time-gated convolutional layer of the present invention;
[0059] Figure 5 FIG. is a schematic diagram of the process of hypergraph convolution of the present invention. DETAILED DESCRIPTION OF THE INVENTION
[0060] The following will specifically describe the technical solution of the present invention in conjunction with the attached Figures 1-5 drawings.
[0061] The present invention proposes a method for predicting short-term inbound passenger flow of urban rail transit based on spatio-temporal dynamic semantic hypergraph convolution, and the specific implementation steps are as follows:
[0062] Step S1: Preprocess the collected subway traffic data set, and generate a passenger flow feature matrix of the station according to the preprocessed passenger flow data; the passenger flow feature matrix of the station uses the station as a node and records the passenger flow characteristics of the node in the form of a feature matrix;
[0063] The subway traffic data set includes the historical passenger flow, the affiliated line, the station type, and the land use attributes around the station of different subway stations;
[0064] Step S2: According to the size of the prediction time window, divide the passenger flow feature matrix of the station into the recent time series and the daily cycle time series of the station;
[0065] Step S3: Take the recent time series and the daily cycle time series of different stations as passenger flow features, and integrate them with the station features and land use features of the corresponding stations in the subway traffic dataset as the input of the clustering algorithm; On this basis, construct dynamic semantic hypergraphs for the recent time series and the daily cycle time series respectively;
[0066] The station features include the line to which the station belongs and the station type; the land use features include the land use attributes around the station;
[0067] Step S4: Construct a short-term inbound passenger flow prediction model based on the spatio-temporal dynamic semantic hypergraph convolutional network; The short-term inbound passenger flow prediction model includes a spatio-temporal feature extraction layer and a feature fusion layer; The spatio-temporal feature extraction layer contains two spatio-temporal interaction modules for capturing the spatio-temporal features of the deep-level subway passenger flow; The feature fusion layer includes a temporal gated convolutional layer and a fully connected layer;
[0068] Step S5: Take the recent time series and the daily cycle time series of the station, and the constructed dynamic semantic hypergraphs of the recent time series and the daily cycle time series as the input data of the spatio-temporal feature extraction layer of the short-term inbound passenger flow prediction model for model training; Obtain the final prediction result through the feature fusion layer, and obtain the prediction error according to the loss function, and iterate the model parameters through the optimization algorithm until the model converges, obtain the optimal model and use it for the short-term inbound passenger flow prediction of urban rail transit.
[0069] In this embodiment, in step S1, the collected subway traffic dataset is preprocessed, and the passenger flow feature matrix of the station is generated according to the preprocessed passenger flow data. The specific steps are as follows:
[0070] Statistically process the historical passenger flow data of different subway stations in the subway traffic dataset in units of a preset time period (for example, 5 minutes), and represent it as the passenger flow feature matrix X=(X 1 ,X 2 ,…,X N ), where N represents the number of stations, represents the historical passenger flow statistical data of the Nth station, represents the passenger flow information of the Nth station in the tth time interval;
[0071] Perform Z-Score normalization on the continuous passenger flow feature matrix X to eliminate the dimensionality effect between parameters. The normalization formula is as follows:
[0072]
[0073] Where μ represents the mean value of the passenger flow feature matrix X, σ represents the standard deviation of the passenger flow feature matrix X, and X' represents the normalized passenger flow feature matrix.
[0074] In this embodiment, in step S2, according to the size of the prediction time window, the passenger flow feature matrix of the station is divided into the recent time series and the daily cycle time series of the station. The specific steps include:
[0075] Let the current time point be t0, and the size of the prediction time window be T p , and one day is divided into q time intervals of the same size according to a preset duration;
[0076] The normalized passenger flow feature matrix X' of the station is intercepted along the time axis for two time series segments with time lengths of T h and T d respectively, as the recent time series X h and the daily cycle time series X d , where T h and T d are both integer multiples of T p ;
[0077] The recent time series refers to a historical time series adjacent to the prediction period:
[0078]
[0079] The daily cycle time series is composed of data in the same time period as the prediction period in the past several days:
[0080]
[0081] In the formula, represents the passenger flow volume data of all stations in the t0th time interval in the normalized passenger flow feature matrix.
[0082] In this embodiment, in step S3, the dynamic semantic hypergraphs of the recent time series and the daily cycle time series are respectively constructed. The specific steps include:
[0083] The recent time series X h and the daily cycle time series X d are respectively processed as two independent input branches, and the recent time series X h and the daily cycle time series X d are respectively represented as historical passenger flow sequences F1, F2, F3,..., F m , when the input is the recent time series X h , m represents the length of T h , when the input is the recent time series, m represents the length of T d ;
[0084] Integrate the historical passenger flow sequences F1, F2, F3, …, F of each branch m with the one-hot encoded station features and land use features to form vector factors where the subscript l represents the total number of parameters involved in the station features and land use features;
[0085] Use the vector factor of each branch as the input of the clustering algorithm to obtain traffic stations of k categories; the clustering algorithm can adopt K-means clustering; construct a corresponding dynamic semantic hypergraph based on the clustering result to obtain the recent semantic hypergraph H h and the daily cycle semantic hypergraph H d , and represent it with the incidence matrix H n×m as:
[0086]
[0087] where ν i (i = 1, 2, 3, …, N) represents subway stations, and e j (j = 1, 2, 3, …, k) represents different clusters divided after clustering, and h ij (i = 1, 2, 3,..., N; j = 1, 2, 3,..., k) is the representation of the correlation between nodes and edges, that is, the belonging relationship between stations and each cluster in the subway network. If station i belongs to cluster j, then h ij takes 1, otherwise takes 0.
[0088] In this embodiment, the station types include originating stations, transfer stations, terminal stations, and ordinary stations; the land use attributes around the stations are specifically the proportion of different land use attributes within a preset radius centered on the station, including the proportion of residential areas, commercial areas, office buildings, schools, hospitals, and transportation facilities; at this time, the total number of parameters l involved in the station features and land use features is at least 11 (the station types involve at least 4 parameters, the lines to which the stations belong involve 1 parameter, and the land use attributes around the stations involve at least 6 parameters).
[0089] In this embodiment, the spatio-temporal interaction module includes two completely identical parallel network structures and a normalization layer. The two parallel network structures are used to process the recent time series and the recent semantic hypergraph, as well as the daily cycle time series and the daily cycle semantic hypergraph respectively; and the ends of the two parallel network structures are connected to the normalization layer; each network structure is composed of a time-gated convolutional layer and a spatial feature extraction layer stacked on top of each other.
[0090] In this embodiment, each network structure of the spatio-temporal interaction module includes two layers of temporal gated convolutional layers and one layer of spatial feature extraction layer. Among them, the recent time series and the daily periodic time series are respectively used as the inputs of the first temporal gated convolutional layers of two network structures. The output of the recent time series passing through one of the first temporal gated convolutional layers and the recent semantic hypergraph are used as the inputs of the spatial feature extraction layer of the corresponding network structure. The output of the daily periodic time series passing through the other first temporal gated convolutional layer and the daily periodic semantic hypergraph are used as the inputs of the spatial feature extraction layer of the corresponding network structure. The outputs of the two spatial feature extraction layers are respectively used as the inputs of the second temporal gated convolutional layers of the corresponding network structures. The outputs of the two second temporal gated convolutional layers are used as the inputs of the normalization layer.
[0091] In this embodiment, the temporal gated convolutional layer has two input branches: one uses causal convolution to aggregate temporal features, combines residual connection and the tanh function to generate a feature representation, denoted as output P; the other passes through causal convolution and then uses the sigmoid function to generate output Q, and the output Q is responsible for controlling the transmission and filtering of input information. Calculate the Hadamard product e of P and Q to obtain the output of the temporal gated convolutional layer:
[0092]
[0093] Among them, X represents the input passenger flow sequence of the temporal gated convolution, linear() represents the fully connected function, Γ represents the temporal gated convolution kernel, * τ represents the temporal gated convolution operator, Conv() represents the causal convolution function, t is the time step, M is the length of the input passenger flow sequence, K t is the width of the causal convolution kernel corresponding to the time interval, and C0 represents the number of output channels of the temporal convolution layer.
[0094] The temporal gated convolutional layer uses a convolutional neural network to capture the temporal dynamic characteristics of subway passenger flow; at the same time, a gated tanh unit (GTU) is introduced to selectively filter out some information with low correlation with the temporal dynamic characteristics while capturing the non-linear characteristics of the input information.
[0095] In this embodiment, the spatial feature extraction layer includes a multi-head self-attention layer and a spatial hypergraph convolutional layer;
[0096] After processing the input of the spatial feature extraction layer through the multi-head self-attention layer, a residual connection is made with the input of the spatial feature extraction layer to obtain the output X sattn of the multi-head self-attention layer, and the specific expression is as follows:
[0097]
[0098] Qs = X t W Q K s = X t W K V s = X t W V (8)
[0099] Among them, Q s , K s , V s represent the query matrix, the key matrix, and the value matrix respectively; the query matrix is used to guide the focus of attention, the key matrix provides the association information between each site, and the value matrix contains the site feature information that needs to be aggregated into the context representation; W Q , W K , W V represent the weight matrices of the corresponding matrices respectively; X t represents the input of the spatial feature extraction layer; is the scaling factor, which is introduced to prevent significant differences in the matrix probability distribution caused by the dot product of Q s and K s ; h represents the number of attention heads; W O is the weight matrix for the output of the multi-head self-attention layer;
[0100] After that, the output of the multi-head self-attention layer and the adjacency matrix corresponding to the dynamic semantic hypergraph generated by the subway passenger flow sequence are jointly input into the hypergraph convolutional network of the spatial hypergraph convolutional layer. Through multiple iterations of hypergraph convolution, the node features are transmitted and aggregated on the hypergraph, enabling it to generate more representative node representations. The hypergraph convolution expression is:
[0101]
[0102] Among them, X sattn is the output of the multi-head self-attention layer; K s represents the length of the spatial hypergraph convolution kernel; g φ is the spatial hypergraph convolution kernel, * δ is the spatial hypergraph convolution operator; k s represents the order of the hypergraph convolution kernel corresponding to the current calculation; represents the trainable parameter of the hypergraph convolution kernel, which is used to adjust the weight of the k s -th order high-order hypergraph convolution operator; represents the high-order hypergraph convolution operator, which takes the normalized Laplacian matrix as the input and constructs different-order transformations in a recursive form; φ is the parameter of the hypergraph convolution filter, is on the adjacency matrix A of the hypergraph HAdd the identity matrix I to represent self-loops; is the adjacency matrix A H of the degree matrix; represents the normalized Laplacian matrix; the adjacency matrix A of the hypergraph H The specific definition is:
[0103]
[0104] A H = HWH T - D v (11)
[0105] v i represents site i; e j represents a certain hyperedge connecting a group of nodes; E H represents the set of hyperedges contained in the hypergraph; h(v i , e j ) represents the node v i and the hyperedge e j 's belonging relationship; w(e j ) represents the weight value corresponding to the hyperedge, and the weight value is determined according to the number of edges connected to the node; H is used to refer to the recent semantic hypergraph H h or the daily periodic semantic hypergraph H d 's incidence matrix; W ∈ R k ×k is the diagonal matrix of hyperedge weights; D v ∈ R N×N is the diagonal matrix of all node degrees. For site i, the degree of this node is d(v i ).
[0106] The spatial feature extraction layer uses a multi-head self-attention layer to capture the dynamic complex spatial relationships between different sites, and then improves the training effectiveness and network generalization ability through residual connections; subsequently, the high-order relationships between sites can be further generalized through a layer of spatial hypergraph convolutional layer.
[0107] In this embodiment, in step S6, the final prediction result is obtained through the feature fusion layer, and the prediction error is obtained according to the loss function. The model parameters are iterated through the optimization algorithm until the model converges to obtain the optimal model. Specifically:
[0108] The output result of the spatio-temporal feature extraction layer is input into the time-gated convolutional layer of the feature fusion layer, and the prediction result is obtained through the fully connected layer of the feature fusion layer Construct the loss function loss of the model. Continuously update the model parameters according to the loss function value using the backpropagation algorithm. Select Adam as the optimizer for gradient calculation and parameter update in the backpropagation algorithm. After the parameter model converges, obtain the trained optimal model. The specific expression is as follows:
[0109]
[0110] Among them, X″ c represents the output of the spatio-temporal feature extraction layer, linear() represents the fully connected function, and Y i is the target value of the real traffic data, is the model prediction value, and θ is all learnable parameters in the model.
[0111] Next, take X h as an example for illustration:
[0112] First, input it into the temporal gated convolutional layer to extract the temporal features of the passenger flow sequence:
[0113]
[0114] Input the output X th of the temporal gated convolutional layer into the multi-head self-attention layer with residual connections:
[0115]
[0116] Q s = X th W Q K s = X th W K V s = X th W V
[0117] After that, input the output X sattn_h of the multi-head self-attention layer and the adjacency matrix h corresponding to the recent semantic hypergraph H generated by the subway passenger flow sequence into the hypergraph convolutional network of the spatial hypergraph convolutional layer. Among them, the specific definition of the adjacency matrix of the hypergraph is:
[0118]
[0119] Then, for any node in the subway network, aggregate the information of multiple nodes connected by its hyperedges. After that, perform feature aggregation on the adjacent nodes of this node to obtain the new features of this node:
[0120]
[0121] Finally, the output X of the spatial hypergraph convolution layer gh is input into the temporal gated convolution layer again to obtain X th2 . And its result is input into the normalization layer to obtain X' h ;
[0122] X th2 = Γ * τX gh
[0123] X' h = Relu(Norm(X th2 ))
[0124] where Relu() represents the activation function and Norm() represents the normalization function;
[0125] Input X' h into the next spatio-temporal interaction module, and repeat the corresponding steps above to obtain X″ h ;
[0126] Input X″ h and X″ d into Concat() for merging to obtain X″ c , and then input it into the feature fusion layer to obtain the prediction result
[0127] The above network model is evaluated using MAE and RMSE for the model prediction performance on the publicly available dataset. The results show that the short-term inbound passenger flow prediction model based on the spatio-temporal dynamic semantic hypergraph convolution network proposed by the present invention comprehensively considers the spatio-temporal interaction information, can improve the accuracy of passenger flow prediction, and the experimental results outperform the traditional methods.
[0128] Although the specific embodiments of the present invention have been described above, those skilled in the art should understand that the specific embodiments we described are illustrative rather than used to limit the scope of the present invention. Equivalent modifications and variations made by those skilled in the art in accordance with the spirit of the present invention should be covered by the scope protected by the claims of the present invention.
Claims
1. A method for predicting short-term passenger flow in urban rail transit based on spatiotemporal dynamic semantic hypergraph convolution, characterized in that: The following steps are involved: Step S1: preprocessing the collected subway traffic data set, and generating the passenger flow feature matrix of the station according to the preprocessed passenger flow data; The passenger flow feature matrix of the site is to use the site as a node and record the passenger flow features of the node in the form of a feature matrix; The subway transportation dataset includes the historical passenger flow, lines, station types, and land use attributes around different subway stations; Step S2: Divide the passenger flow feature matrix of the station into the recent time series and daily cycle time series of the station according to the size of the prediction time window; Step S3: The recent time series and daily cycle time series of different stations are used as passenger flow features, and are integrated with the station features and land use features of the corresponding stations in the subway traffic dataset as the input of the clustering algorithm; on this basis, dynamic semantic hypergraphs of the recent time series and daily cycle time series are constructed respectively; The site characteristics include the line to which the site belongs and the site type; the land use characteristics include the land use attributes around the site; Step S4: constructing a short-term passenger flow prediction model based on a spatiotemporal dynamic semantic hypergraph convolutional network; the short-term passenger flow prediction model includes a spatiotemporal feature extraction layer and a feature fusion layer; the spatiotemporal feature extraction layer includes two spatiotemporal interaction modules to capture the spatiotemporal features of deep-level subway passenger flow; the feature fusion layer includes a time-gated convolutional layer and a fully connected layer; Step S5: The recent time series and daily cycle time series of the station, as well as the constructed dynamic semantic hypergraph of the recent time series and daily cycle time series are used as input data of the spatiotemporal feature extraction layer of the short-term inbound passenger flow prediction model to perform model training; the final prediction result is obtained through the feature fusion layer, and the prediction error is obtained according to the loss function. The model parameters are iterated through the optimization algorithm until the model converges, and the optimal model is obtained and used for the short-term inbound passenger flow prediction of urban rail transit.
2. The urban rail transit short-term inbound passenger flow prediction method based on spatiotemporal dynamic semantic hypergraph convolution according to claim 1 is characterized in that: In step S1, the collected subway traffic data set is preprocessed, and the passenger flow feature matrix of the station is generated according to the preprocessed passenger flow data. The specific steps include: The historical passenger flow data of different subway stations in the subway traffic data set are counted according to the preset time length as a unit, and expressed as the passenger flow feature matrix X = (X 1 ,X 2 ,…,X N ), where N is the number of sites, represents the historical passenger flow statistics of the Nth station, represents the passenger flow information of the Nth station in the tth time interval; Perform Z-Score normalization on the continuous passenger flow feature matrix X. The normalization formula is as follows: Where μ represents the average value of the passenger flow feature matrix X, σ represents the standard deviation of the passenger flow feature matrix X, and X' represents the normalized passenger flow feature matrix.
3. The urban rail transit short-term inbound passenger flow prediction method based on spatiotemporal dynamic semantic hypergraph convolution according to claim 2 is characterized in that: In step S2, the passenger flow feature matrix of the station is divided into the recent time series and the daily cycle time series of the station according to the size of the prediction time window. The specific steps include: Assume the current time point is t0 and the prediction time window size is T p , divide a day into q time intervals of equal size according to the preset duration; The normalized passenger flow feature matrix X' of the station is intercepted along the time axis by a time length of T h and T d Two time series segments of X are respectively used as the recent time series X h and the daily periodic time series X d , where T h and T d All T p An integer multiple of ; The recent time series refers to a historical time series adjacent to the forecast period: The daily cycle time series consists of data from the past few days in the same time period as the forecast period: In the formula, Represents the passenger flow data of all stations in the t0th time interval in the normalized passenger flow feature matrix.
4. The urban rail transit short-term inbound passenger flow prediction method based on spatiotemporal dynamic semantic hypergraph convolution according to claim 3 is characterized in that: In step S3, dynamic semantic hypergraphs of recent time series and daily periodic time series are constructed respectively. The specific steps include: The recent time series X h and the daily periodic time series X d They are processed as two independent input branches and the recent time series X h and the daily periodic time series X d They are represented as historical passenger flow sequences F1, F2, F3, …, F m , when the input is a recent time series X h When m represents T h The length of T. When the input is a recent time series, m represents T d Length; The historical passenger flow sequence F1, F2, F3, ..., F m Integrate with the one-hot encoded site features and land use features to form a vector factor Among them, the subscript l represents the total number of parameters involved in site characteristics and land use characteristics; Factor each branch's vector As the input of the clustering algorithm, we get k types of traffic stations; based on this, we build the corresponding dynamic semantic hypergraph and obtain the recent semantic hypergraph H h and daily cycle semantic hypergraph H d , using the incidence matrix H N×k It is expressed as: Among them, ν i (i=1,2,3,…,N) represents the subway station, e j (j=1,2,3,…,k) represents the different clusters divided after clustering, h ij (i=1,2,3,...,N;j=1,2,3,...,k) represents the correlation between nodes and edges, that is, the relationship between stations and clusters in the subway network. If station i belongs to cluster j, then h ij Takes 1, otherwise takes 0.
5. The urban rail transit short-term inbound passenger flow prediction method based on spatiotemporal dynamic semantic hypergraph convolution according to claim 3 is characterized in that: The station types include departure stations, transfer stations, terminal stations and ordinary stations; the land use attributes around the station are specifically the proportion of different land use attributes within a preset radius centered on the station, including the proportion of residential areas, commercial areas, office buildings, schools, hospitals and transportation facilities.
6. The urban rail transit short-term inbound passenger flow prediction method based on spatiotemporal dynamic semantic hypergraph convolution according to claim 1 is characterized in that: The spatiotemporal interaction module includes two identical parallel network structures and a normalization layer. The two parallel network structures are used to process recent time series and recent semantic hypergraphs, as well as daily periodic time series and daily periodic semantic hypergraphs respectively; and the ends of the two parallel network structures are connected to the normalization layer; each network structure is composed of a time-gated convolutional layer and a spatial feature extraction layer stacked on each other.
7. The urban rail transit short-term inbound passenger flow prediction method based on spatiotemporal dynamic semantic hypergraph convolution according to claim 6 is characterized in that: Each network structure of the spatiotemporal interaction module includes two layers of time-gated convolutional layers and one layer of spatial feature extraction layer; wherein the recent time series and the daily cycle time series are respectively used as inputs of the first time-gated convolutional layers of the two network structures; the recent time series is used as the input of the spatial feature extraction layer of the corresponding network structure through the output of one of the first time-gated convolutional layers and the recent semantic hypergraph, and the daily cycle time series is used as the input of the spatial feature extraction layer of the corresponding network structure through the output of another first time-gated convolutional layer and the daily cycle semantic hypergraph; the outputs of the two spatial feature extraction layers are respectively used as inputs of the second time-gated convolutional layers of the corresponding network structure; and the outputs of the two second time-gated convolutional layers are used as inputs of the normalization layer.
8. The urban rail transit short-term inbound passenger flow prediction method based on spatiotemporal dynamic semantic hypergraph convolution according to claim 6 is characterized in that: The time-gated convolution layer has two input branches: one uses causal convolution to aggregate time features, and combines residual connection and tanh function to generate feature representation, which is recorded as output P; the other uses sigmoid function to generate output Q after causal convolution, and the output Q is responsible for controlling the transmission and filtering of input information; the Hadamard product e of P and Q is calculated to obtain the output of the time-gated convolution layer: Where X represents the input passenger flow sequence of the time-gated convolution, Γ represents the time-gated convolution kernel, *τ represents the time-gated convolution operator, Conv() represents the causal convolution function, linear() represents the fully connected function, t is the time step, M is the length of the input passenger flow sequence, and K t is the causal convolution kernel width corresponding to the time interval, and C0 represents the number of output channels of the temporal convolution layer.
9. The urban rail transit short-term inbound passenger flow prediction method based on spatiotemporal dynamic semantic hypergraph convolution according to claim 6 is characterized in that: The spatial feature extraction layer includes a multi-head self-attention layer and a spatial hypergraph convolution layer; After the input of the spatial feature extraction layer is processed by the multi-head self-attention layer, a residual connection is performed with the input of the spatial feature extraction layer to obtain the output X of the multi-head self-attention layer. sattn , the specific expression is as follows: Q s =X t W Q K s =X t W K V s =X t W V (8) Among them, Q s , K s 、V s represent the query matrix, key matrix and value matrix respectively; W Q , W K , W V Represent the weight matrices of the corresponding matrices respectively; X t Represents the input of the spatial feature extraction layer; is the scaling factor; h represents the number of attention heads; W O is the weight matrix for the output of the multi-head self-attention layer; Then, the output of the multi-head self-attention layer and the adjacency matrix corresponding to the dynamic semantic hypergraph generated by the subway passenger flow sequence are jointly input into the hypergraph convolution network of the spatial hypergraph convolution layer. Multiple iterations are performed through the hypergraph convolution. The hypergraph convolution expression is: Among them, X sattn is the output of the multi-head self-attention layer; K s represents the length of the spatial hypergraph convolution kernel; g φ is the spatial hypergraph convolution kernel, * δ is the spatial hypergraph convolution operator; k s Indicates the order of the currently calculated hypergraph convolution kernel; Represents the trainable parameters of the hypergraph convolution kernel, which is used to adjust the kth s The weights of the high-order hypergraph convolution operators; represents a high-order hypergraph convolution operator, with a normalized Laplacian matrix is the input, and transforms of different orders are constructed recursively; φ is the parameter of the hypergraph convolution filter, is the adjacency matrix A in the hypergraph H The identity matrix I is added to represent the self-loop; is the adjacency matrix A H The degree matrix of Represents the normalized Laplacian matrix; the adjacency matrix A of the hypergraph H The specific definition of is: A H =HWH T -D v (11) v i Indicates site i; e j represents a hyperedge connecting a set of nodes; E H represents the set of hyperedges contained in the hypergraph; h(v i ,e j ) represents node v i With super edge e j The relationship of ownership; w(e j ) represents the weight corresponding to the hyperedge, which is determined by the number of edges connected to the node; H is used to refer to the recent semantic hypergraph H h or daily period semantic hypergraph H d The incidence matrix of k×k is the diagonal matrix of hyperedge weights; D v ∈R N×N is the diagonal matrix of all node degrees. For site i, the degree of the node is d(v i ).
10. The urban rail transit short-term inbound passenger flow prediction method based on spatiotemporal dynamic semantic hypergraph convolution according to claim 8 is characterized in that: In step S6, the final prediction result is obtained through the feature fusion layer, and the prediction error is obtained according to the loss function. The model parameters are iterated through the optimization algorithm until the model converges to obtain the optimal model, which is specifically: The output result of the spatiotemporal feature extraction layer is input into the time-gated convolution layer of the feature fusion layer, and then the prediction result is obtained through the fully connected layer of the feature fusion layer. Construct the loss function of the model, and use the back propagation algorithm to continuously update the model parameters according to the loss function value. Adam is selected as the optimizer for gradient calculation and parameter update in the back propagation algorithm. After the parameter model converges, the trained optimal model is obtained. The specific expression is as follows: Among them, X″ a represents the output of the spatiotemporal feature extraction layer, linear() represents the fully connected function, and Y i is the target value of real traffic data, is the model prediction value, and θ is all the learnable parameters in the model.
Citation Information
Cited By
Subway network passenger flow propagation prediction method based on space-time diagram convolution
CN121724225A