A method for predicting short-term OD demand of urban rail transit under emergencies
Through the real-time OD demand data estimation, dynamic compression and deep learning framework, combined with AGC-LSTM, MPC-ATTN and heterogeneous information fusion module, the real-time availability and sparseness problems in short-term OD demand forecast in urban rail transit are solved. Improve prediction accuracy and interpretability.
Patent Information
- Application Number
- CN202311345507.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-10-17
- Publication Date
- 2024-12-20
- Estimated Expiration
- 2043-10-17
AI Technical Summary
The short-term OD demand forecast of urban rail transit under emergencies faces problems of real-time data availability and sparseness, which makes it difficult for the model to accurately learn the distribution characteristics of OD demand, affecting the prediction accuracy.
A real-time OD requirement data estimation method and dynamic compression method are proposed, combining adaptive graph convolutional length short-term memory network (AGC-LSTM) and multi-period cross attention mechanism (MPC-ATTN), and introducing heterogeneous information fusion module and Masked physically guided loss function, and constructed a deep learning framework to capture the spatiotemporal distribution characteristics and physical quantitative relationships of OD requirements.
Real-time and accuracy improvement of OD requirements in emergencies, enhance the interpretability and prediction reliability of the model, and overcome the problems of data sparsity and high-dimensionality.
Smart Images

Figure CN117593878B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of traffic passenger flow prediction, and more specifically, to a method for predicting short-term OD demand of urban rail transit under emergencies. Background Art
[0002] The OD demand in emergencies is highly random and sudden, which brings huge challenges to the operation and management of urban rail transit and also causes great inconvenience to passengers. Therefore, it is particularly important to predict the short-term OD demand of urban rail transit under emergencies.
[0003] In the prior art, the OD demand prediction scheme for urban rail transit under emergencies mainly has the following defects or characteristics: Different from the OD demand of taxis, the real-time OD demand data of urban rail transit can only be obtained when the passengers complete their trips. Therefore, when predicting the short-term OD demand of urban rail transit, it is impossible to obtain complete real-time OD demand data immediately; Affected by the different land use properties in different geographical areas of the city, the OD demand is not evenly distributed in various areas of the city, and its distribution has obvious sparsity. This sparsity makes the model easily affected by lower OD demand when learning the spatiotemporal distribution characteristics of OD demand, and thus cannot accurately learn the distribution of OD demand; Since the OD demand describes the station The relationship between OD demand and passenger flow between stations is usually higher in dimension than conventional in- and out-station passenger flow data when processing OD demand data, which increases the computational cost of the model. Since emergencies will have a significant impact on the OD demand distribution of urban rail transit and cause abnormal fluctuations in OD demand in a short period of time, characterizing the evolution trend of OD demand distribution during emergencies is conducive to improving prediction accuracy. There is a definite quantitative relationship between OD demand and station in- and out-station passenger flow. Taking the starting station as an example, its in-station flow is equal to the OD demand starting from the station. Therefore, effectively utilizing the physical quantitative relationship between OD demand and in- and out-station flow is conducive to enhancing the training effect of the model and improving the interpretability of the model and the reliability of prediction. Summary of the invention
[0004] The purpose of the present invention is to overcome the defects of the above-mentioned prior art and provide a method for predicting short-term OD demand of urban rail transit under emergencies. The method comprises the following steps:
[0005] In the current time period t, the observed OD demand sequence, real-time station flow data and rail transit network diagram are obtained;
[0006] Input the OD demand sequence, the real-time station entry flow data and the rail transit network diagram into the trained prediction model to predict the OD demand of the rail transit system in the next time period It is expressed as:
[0007]
[0008] Where f represents the trained prediction model, represents the OD demand sequence observed in time period t, represents the real-time station flow data in time period t, T represents the historical T time steps, G = (S, E, A) represents the rail transit network graph, S represents the station set, E represents the edge set, A represents the weighted adjacency matrix of the rail transit network, t day Indicates the total number of time slots in a day.
[0009] Compared with the prior art, the advantages of the present invention are that a real-time OD demand data estimation method is proposed to overcome the real-time availability of OD demand data; and a new OD demand dynamic compression method is proposed to solve the sparsity and high dimensionality of OD demand data; in addition, an adaptive graph convolution long short-term memory network structure (AGC-LSTM) and a multi-cycle cross attention mechanism (MPC-ATTN) are proposed to construct an effective deep learning framework, and a heterogeneous information fusion module is proposed to organically integrate the OD demand data during the emergency and the emergency-related data to fully explore the impact of the emergency on the change of OD demand and capture the dynamic and complex spatiotemporal distribution characteristics of OD demand; finally, a masked physical guided loss function is proposed to train the model, embed the physical quantity relationship between OD demand and inbound and outbound flow, thereby enhancing the training process of the model and improving the interpretability and prediction reliability of the model. While meeting the "real-time" requirements of short-term OD demand prediction, the present invention improves the prediction accuracy of OD demand under emergencies.
[0010] Further features and advantages of the present invention will become apparent from the following detailed description of exemplary embodiments of the present invention with reference to the attached drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0011] The accompanying drawings, which are incorporated in and constitute a part of the specification, illustrate embodiments of the invention and, together with the description, serve to explain the principles of the invention.
[0012] Figure 1 is a flowchart of a method for predicting short-term OD demand of urban rail transit under emergencies according to an embodiment of the present invention;
[0013] Figure 2 is a schematic diagram of a dynamic OD matrix compression operation according to an embodiment of the present invention;
[0014] Figure 3 2. It is a schematic diagram of a PAG-STAN model framework based on a physically guided adaptive graph spatiotemporal attention network according to an embodiment of the present invention;
[0015] Figure 4 is a real-time OD demand estimation module according to an embodiment of the present invention;
[0016] Figure 5 is a schematic diagram of an adaptive graph convolutional long short-term memory network structure AGC-LSTM according to an embodiment of the present invention;
[0017] Figure 6 is a schematic diagram of a multi-cycle cross-attention mechanism MPC-ATTN according to an embodiment of the present invention;
[0018] Figure 7 is a schematic diagram showing a calculation process of BiLSTM according to an embodiment of the present invention;
[0019] Figure 8 It is a schematic diagram showing the calculation process of the heterogeneous information fusion module according to an embodiment of the present invention. DETAILED DESCRIPTION
[0020] Various exemplary embodiments of the present invention will now be described in detail with reference to the accompanying drawings. It should be noted that the relative arrangement of components and steps, numerical expressions and numerical values set forth in these embodiments do not limit the scope of the present invention unless otherwise specifically stated.
[0021] See also Figure 1 As shown, in short, the provided method for predicting short-term OD demand of urban rail transit under emergencies includes: step S110, in the current time period t, obtaining the observed OD demand sequence, real-time station flow data and rail transit network diagram; step S120, inputting the OD demand sequence, the real-time station flow data and the rail transit network diagram into the trained prediction model to predict the OD demand of the rail transit system in the next time period. In the following, the scientific problems to be solved, the model structure and the experimental verification results will be described in detail.
[0022] 1. Problem Definition
[0023] The present invention aims to use historical AFC data and other reliable data sources, with the help of deep learning models, to predict the short-term OD demand of stations in the entire urban rail transit network under emergencies.
[0024] Definition 1 (URT network): In order to focus on the OD demand prediction between stations in the urban rail transit system, the urban rail transit (URT) network G = (S, E, A) is defined to represent the spatial correlation between each station, where S = {s1, s2, …, s N} represents the station set, N is the number of subway stations. E∈R N×N represents the set of edges, e ijis a 0-1 variable, indicating whether station i and station j are adjacent in the physical network; A∈R N×N Represents the weighted adjacency matrix of the URT network.
[0025]
[0026] Among them, P T ∈R N×TS represents the observed inbound flow at each station in the urban rail transit network in the Tth period, N represents the number of stations in the urban rail transit network, and TS represents the time step included in the Tth period. For example, the passenger flow data of the past 12 time steps is used to predict the passenger flow Y in the next time step. t .
[0027] Definition 2 (passenger flow matrix): Given AFC records, the historical entry and exit flow sequences can be extracted and integrated into passenger flow matrices at different time granularities, such as 10 minutes and 60 minutes. represents the in-and-out flow of station i in time period t, and is defined as a passenger flow vector, which represents the number of inbound and outbound passengers of all stations in the urban rail transit system in time period t. For example, using the real-time passenger flow of T historical time steps to estimate the real-time OD demand solves the problem of real-time availability of OD demand data. Therefore, the passenger flow matrix of time period t can be defined as and Taking the inbound flow of the urban rail transit network as an example, the inbound flow matrix of time period t can be defined as:
[0028]
[0029] Definition 3 (OD demand matrix): The goal of short-term OD demand forecasting is to predict the short-term future OD demand between stations in the URT network. Therefore, it is necessary to define the OD demand matrix. Let x t (i,j) represents the complete travel demand from station i to station j in time period t, where i,j = 1, 2, ..., N. OD demand matrix X t ∈R N×N It represents the OD demand between all stations in the urban rail transit network in time period t. Taking the complete OD demand in time period t as an example, the relevant OD demand matrix is defined as:
[0030]
[0031] It should be noted that there is a coupling quantitative relationship between the OD demand and the inbound and outbound flows of each station in the URT network, which can be defined as:
[0032]
[0033] Definition 4 (Dynamically compressed OD matrix): Due to the uneven distribution of OD demand between URT network sites, the original OD demand matrix has significant sparsity, that is, the OD demand between some sites (suburban sites) is relatively low or even non-existent, while the OD demand between some sites (residential and commercial areas) is very obvious. Those lower OD demands usually represent random or irregular travel, which has little impact on the urban rail transit system, but is easy to affect the accuracy of OD demand prediction; in addition, the high dimensionality of the original OD demand matrix is also easy to lead to high computational costs.
[0034] To solve the above problem, only some OD pairs with higher demand are considered to generate a dynamically compressed OD demand matrix. Specifically, for each starting station i, the passenger flow distribution rate of all destination stations is first calculated. The specific calculation is as follows:
[0035]
[0036] After obtaining the passenger flow distribution rate R of the destination station at the starting station i d (i) After that, the destination sites are sorted from high to low according to their distribution rate. Next, a threshold PCT is given P , select the first k i -1 site with high distribution rate, must satisfy the following constraints.
[0037]
[0038] Among them, |j| represents the number of selected destination sites, and the parameter k of different starting sites i Different from the target station, the OD demand between the target station and the selected destination station is taken as the k i -1 OD demand feature, and the total OD demand of the remaining destination stations and the target station is taken as the kth i OD demand features, thereby generating a compressed OD matrix for time period t Where N is the number of stations in the URT network, K = Max(k1, k2, ..., k N ). Since the number of OD features at different starting sites is different, 0 can be used to fill the OD feature vector of each starting site to ensure that the OD feature vector dimension of each starting site is consistent. The entire process of dynamically compressing the OD matrix is as follows: Figure 2 This compression method can fully solve the sparsity and high-dimensionality problems of OD demand data.
[0039] Definition 5 (Multiple OD demand patterns): Since passengers' travel behavior has significant periodicity, in one embodiment, multiple OD demand patterns are considered, namely, weekly OD demand patterns, daily OD demand patterns, and real-time OD demand patterns, to learn the long- and short-term periodic characteristics of OD demand distribution. Specifically, assuming that the current time period is t, and the total number of time periods in a day is t day The weekly OD demand pattern represents the compressed OD demand during the same time period last week, which can be expressed as The daily OD demand pattern represents the compressed OD demand during the same time period yesterday, which can be expressed as The real-time OD demand pattern represents the historical compressed OD demand sequence of the past T time steps in the current period, expressed as
[0040] Problem definition: In time period t, given the observed OD demand sequence Real-time inbound flow data The rail transit network graph G = (S, E, A) aims to learn a function f(·) to predict the complete OD demand of the rail transit system in the next time period. Therefore, the prediction problem can be described as:
[0041]
[0042] Among them, f represents the model to be learned during training.
[0043] 2. About the Attention Mechanism and Convolutional Long and Short Time Attention Network
[0044] The attention mechanism provides a general method to model the correlation between a set of values and keys under a query. The correlation weight assigned to each value is calculated by the compatibility function of the query and the corresponding key associated with the value. Mathematically, the attention mechanism can be viewed as a function that maps a query and a set of key-value pairs to an output, where the query, key, and value are all vectors, and the output calculation result is the weighted sum of the values.
[0045] Taking Transformer as an example, it proposes an attention mechanism based on "Scaled Dot-Product", which calculates the relevant weight of each value through the dot product between the query and the value. Specifically, given the number of columns d k The query and key of (assuming the query and key have the same number of columns) and the number of columns is d v The value of , the attention mechanism is defined as:
[0046]
[0047] In order to jointly process information from different representation subspaces, a multi-head attention mechanism needs to be considered. Given a query key and value where d model Representing the feature size of the input, the multi-head attention mechanism first linearly transforms the query, key, and value into different subspaces, and then calculates the attention in parallel. The multi-head attention mechanism can be defined as:
[0048] MultiHead(Q,K,V)=Concat(Head1,Head2,…,Head H )W o (9)
[0049]
[0050] Among them, H represents the number of long positions, are the projection weight matrices of Q, K, and V respectively, Represents the final output projection matrix. For example, setting d k =d v =d model / H.
[0051] For general spatiotemporal sequence modeling, Convolution LSTM (ConvLSTM) is stable and powerful in modeling long-term spatiotemporal relationships in sequence data. t As a memory of state information, the information can be updated through several self-parameterized control gates, namely the input gate, the forget gate, and the output gate. When a new input arrives, if the input gate i t is activated, its information will be accumulated into the unit. The past unit state C t-1 will be forgotten if the forget gate t The last memory cell C is activated. t Can the output propagate to the final state h? t , by the output gate o t Compared with FC-LSTM, the innovation of ConvLSTM is to replace the full connection in the input-state and state-state transfer process with a convolution operation, thereby encoding spatial information based on the past state of the input and the local neighbors of a specific unit. The calculation process is as follows:
[0052]
[0053] Among them, * represents the convolution operation, represents the Hadamard product; Represents sequence input; Represents the memory unit output; represents the hidden state, W xi , W hi and W ci etc. are the weights of the corresponding items, b i , b f , b c and b o Since ConvLSTM uses convolution operation to encode spatiotemporal information, it has strong representation ability and is suitable for complex dynamic traffic flow prediction.
[0054] 3. Model Structure
[0055] In order to accurately predict the OD demand of urban rail transit system under emergencies, a new physically guided adaptive graph spatiotemporal attention mechanism (PAG-STAN) is proposed to make full use of various heterogeneous information, namely, historical complete OD demand, real-time entry and exit flow, emergency related information and date attribute data to effectively model the spatiotemporal evolution pattern of OD demand under emergencies. Figure 3 The architecture of the proposed model is illustrated, which mainly includes the design of real-time OD estimation module, encoder, decoder, and mask physics-guided loss function.
[0056] Figure 4 It is a schematic diagram of the real-time OD demand estimation module, which can solve the problem of real-time availability of OD data. This module estimates the complete real-time OD demand using the real-time inbound flow and the long- and short-time historical OD demand distribution rate. Specifically, first, the OD distribution rate at the same time yesterday and the same time last week is calculated based on the input weekly and daily OD demand patterns; secondly, by multiplying the real-time inbound flow and the long- and short-time historical OD distribution rate, two potential long- and short-time OD demand matrices are obtained. Finally, the two long- and short-time potential OD demand matrices are fused to obtain a complete real-time OD demand matrix. In this way, a complete real-time OD demand matrix with long- and short-time historical OD distribution information can be obtained.
[0057] In the encoder, a new adaptive graph convolutional long short-term memory network (AGC-LSTM) and a new multi-period mutual attention (MPC-ATTN) are designed to learn the hidden spatiotemporal distribution information of OD demand. In order to capture the significant periodicity of OD demand, the model fully considers multiple OD demand modes, namely weekly OD mode, daily OD mode and real-time OD mode, and deeply aggregates the hidden spatiotemporal distribution information of the three OD modes by inputting into three AGC-LSTM branches. Then, MPC-ATTN generates feature representation by encoding the hidden periodic spatiotemporal distribution information from the AGC-LSTM branch. Finally, the feature representation is input into a convolutional network with residual operation to enhance the periodic spatiotemporal distribution feature representation.
[0058] In the decoder, multiple BiLSTMs are used to integrate the enhanced periodic spatiotemporal distribution feature representation from the encoder and the estimated real-time OD demand. Specifically, the estimated real-time OD demand is first processed by a BiLSTM to capture the real-time global spatiotemporal distribution information. Then, multiple identical BiLSTMs are used to aggregate the feature representation from the encoder and the processed real-time OD demand, which is conducive to fully decoding the scenario spatiotemporal distribution information from the forward and backward directions. In addition, in order to learn the impact of external factors on subway OD demand under emergencies, a heterogeneous information fusion module (HIFB) is proposed to fully fuse OD demand with other external data (emergency-related data, date attribute data). This module can effectively learn information used to enhance the evolution characteristics of OD demand. Finally, through several stacked fully connected layers, accurate prediction of urban rail transit OD demand in the next time period is achieved.
[0059] In addition, considering the physical quantitative relationship between OD demand and inbound and outbound flows, effective information can be provided to improve the reliability of prediction. In one embodiment, a new masked physical guidance loss function (MPG-LossFunction) is proposed to guide the training of the model by considering the physical quantitative relationship between OD demand and inbound and outbound flows. This loss function improves the interpretability of the OD demand prediction model while maintaining the advantages of accurate prediction of the data-driven model. In addition, the MPG-Loss Function uses a mask operation to eliminate the training error caused by filling zero values in the dynamically compressed OD demand matrix, thereby improving the prediction performance of the part of OD demand that affects the operation of the URT system.
[0060] In general, the present invention effectively integrates multiple OD demand patterns, real-time in-and-out station flows, and external factors to predict future OD demand of urban rail transit systems under emergencies. Next, the components of each module will be specifically introduced.
[0061] 1) Real-time OD estimation module
[0062] Since some passengers may not complete their trips in the current time period, the complete OD demand information cannot be obtained in time, and the incomplete real-time OD demand matrix will interfere with feature learning, resulting in inaccurate predictions. Therefore, when predicting the OD demand of urban rail transit, it is necessary to overcome the problem of real-time availability of OD demand data. Although the complete real-time OD demand data cannot be obtained in time, the real-time station flow data can be obtained from the AFC records in time. In addition, since the passenger travel behavior has periodic characteristics, the historical long-short time destination distribution rate contains meaningful OD demand periodic distribution information. Therefore, it is reasonable and feasible to estimate the complete real-time OD demand using real-time station flow data and historical long-short flow destination distribution rate. The real-time OD estimation module proposed in the present invention is used to estimate the complete real-time OD demand. By jointly utilizing the long-short time distribution information of the real-time station flow and the historical OD demand, the real-time availability problem of OD data can be effectively solved.
[0063] Figure 4 Describes the process of real-time OD demand estimation. Let t be the current time period and the complete real-time OD demand matrix X t It can be estimated in the following way. First, for each origin station, the long-short time distribution ratio of all destination stations is calculated based on the historical OD demand input. It should be noted that the short-time destination distribution ratio Indicates the destination distribution rate at the same time yesterday, which can reflect the recent OD distribution information; long-term destination distribution rate represents the destination distribution rate at the same time last week, which can reflect the periodic OD distribution information. Therefore, the present invention uses the long-term and short-term distribution rates to estimate the complete real-time OD demand. Specifically, given the real-time inbound flow P of all starting stations in the current time period, t , short-term OD distribution rate Matrix for estimating potential short-term OD demand in the current time period Long-term OD distribution rate Matrix for estimating the potential long-term OD demand in the current time period The calculation process is as follows:
[0064]
[0065] After obtaining two potential OD demand matrices, the two matrices are concatenated and input into the unit convolutional network to generate the complete real-time OD demand with long- and short-term period distribution information.
[0066]
[0067] 2) Encoder
[0068] The goal of the encoder is to mine hidden periodic spatiotemporal distribution information based on multiple OD demand patterns. To this end, in one embodiment, a new adaptive graph convolutional long short-term memory network (AGC-LSTM) and a novel multi-cycle interactive attention mechanism (MPC-ATTN) are proposed to deeply integrate multiple OD demand patterns for learning inherent periodic spatiotemporal distribution features. Specifically, the encoder considers three different OD demand patterns, namely weekly OD pattern, daily OD pattern and real-time OD pattern. The weekly OD pattern and the daily OD pattern are first input into the weekly and daily AGC-LSTM to capture the long and short hidden states. Then, the long and short hidden states are regarded as the initial state, and the real-time OD pattern is regarded as the feature input, which are all input into the real-time AGC-LSTM branch to generate feature outputs with long and short period information. In order to further mine significant periodic spatiotemporal distribution information, the outputs of the three branches are input into the MPC-ATTN to jointly mine the intrinsic correlation from different subspaces, which can effectively encode periodic spatiotemporal distribution information to generate potential representations. Overall, the encoder deeply integrates multiple OD demand patterns through AGC-LSTM and MPC-ATTN to effectively learn the significant periodic spatiotemporal distribution information of OD demand.
[0069] (1) Adaptive Graph Convolutional Long Short-Term Memory Network (AGC-LSTM)
[0070] The urban rail transit system is essentially a dynamic transportation system with a complex spatial topological structure. Therefore, GCN (graph convolutional network) can be used to capture the complex spatial dependencies of passenger flow dynamics. The essence of graph convolution is to extract the features of the target node by aggregating the information of adjacent nodes. Specifically, the graph convolution features can be calculated in the following way.
[0071]
[0072] Among them, H l+1 and H l They represent the hidden features of the l+1th layer and the lth layer respectively; σ represents the activation function, such as ReLU and Tanh function. Represents the addition of a self-connected adjacency matrix, which aims to maintain the node's own information during the convolution operation, where I N represents the identity matrix. D represents the degree matrix, where D ii =∑ j A ij .W l Represents the trainable weight matrix of the l-th graph convolutional layer.
[0073] Although traditional graph convolution can effectively model topological spatial features, the predefined static adjacency matrix limits the performance of graph convolutional networks in traffic flow prediction because the spatial dependencies between traffic nodes usually change over time. For example, on weekdays, there is a significant dependency between stations in residential and commercial areas; on Sundays, there are fewer connections, so dynamic spatial dependencies cannot be effectively learned through predefined static adjacency matrices. In order to model dynamic spatial dependencies, this paper introduces an adaptive adjacency matrix It should be noted that this matrix does not require any prior knowledge and can be updated by stochastic gradient descent. Specifically, we first randomly initialize the embeddings of the two nodes For generating an adaptive adjacency matrix:
[0074]
[0075] By initializing the node embedding multiplication, the hidden spatial dependencies between nodes can be extracted. In this process, the ReLU activation function can ignore weaker dependencies, and Softmax can be used to normalize the adaptive adjacency matrix. In essence, the adaptive adjacency matrix is a supplement to the uncertain relationship between nodes, and can dynamically model hidden spatial dependencies during training. Therefore, the present invention embeds the adaptive adjacency matrix into the topological adjacency matrix by element addition, which can not only consider the prior spatial information, but also dynamically model the hidden spatial dependencies in an adaptive manner. The specific calculation process is as follows:
[0076]
[0077] The traditional convolution operation in ConvLSTM only focuses on the conventional Euclidean structure and cannot effectively extract the complex non-Euclidean spatial information in the urban rail transit network. In order to simultaneously capture the complex spatial topological characteristics and temporal evolution characteristics of OD demand, in one embodiment, a new adaptive graph convolutional long short-term memory network (AGC-LSTM) is proposed, which uses adaptive graph convolution operations to replace the conventional convolution operations in ConvLSTM, see Figure 5 shown.
[0078] Compared with ConvLSTM, AGC-LSTM uses adaptive graph convolution operators in state-to-state and input-to-state transitions, which can adaptively consider the input and hidden states of its topological neighbors to determine the future state of the target node. The calculation process of AGC-LSTM is as follows: represents the adaptive graph convolution operator, Represents the Hadamard product.
[0079]
[0080]
[0081] Using AGC-LSTM, the complex spatiotemporal dependencies of the OD demand of the urban rail transit system can be adaptively learned. Specifically, the weekly OD pattern and the daily OD pattern are first input into two independent AGC-LSTM branches to generate long- and short-term periodic hidden states:
[0082]
[0083] Hidden State and Unit convolutional layers are fused to construct a dense periodic hidden state. It is then used as the initial state and input into the real-time AGC-LSTM branch together with the estimated real-time OD pattern, aiming to generate real-time feature output with long- and short-term period information.
[0084]
[0085] (2) Multi-cycle interactive attention mechanism
[0086] Since passenger travel behavior is cyclical, there are significant correlations between multiple OD demand patterns. For example, the weekly OD demand pattern can reflect the regularity of OD distribution on weekdays / weekends from a long-term perspective, and the daily OD demand pattern can reflect the fluctuation trend of OD demand from a short-term perspective. These historical multiple OD demand patterns contain meaningful periodic spatiotemporal distribution information in OD demand, which is conducive to effectively modeling the intrinsic OD distribution. Since the multi-head attention mechanism can jointly pay attention to information from different representation subspaces and improve the ability of feature representation, in order to further explore the significant periodic spatiotemporal distribution information of OD demand, in one embodiment, a new multi-period interactive attention mechanism is proposed to jointly model the inherent correlations between different OD demand patterns from multiple representation subspaces. This method can effectively encode multiple OD feature outputs from three AGC-LSTM branches to generate latent representations, see Figure 6 shown.
[0087] Specifically, the feature outputs of the three AGC-LSTM branches are first transformed into feature embeddings of the same dimension It should be noted that the linear projection of the query value and the key value in the conventional attention mechanism is replaced by a convolution operation to facilitate the consideration of the local distribution information required by OD. Then, the long-term and short-term interaction attention scores are calculated to study their correlation, as follows:
[0088]
[0089] Where T represents the matrix transfer operator. Specifically, Represents the relevance weight of long-term period distribution information, represents the relevance weight of the short-term periodic distribution information. Then, the long-term relevance weight and the short-term relevance weight are respectively multiplied by the real-time value V by element multiplication. r Integration is performed to propagate periodic information with higher attention weights:
[0090]
[0091] After information propagation, the long-term interaction attention Attn l Attn s The concatenation is performed and processed using unit convolution to generate global interactive attention, which can fully reflect the significant long- and short-term period distribution information.
[0092]
[0093] in, Representation splicing operator. By using multi-head attention calculation to jointly focus on information from different representation subspaces, multiple OD features can be effectively encoded to generate a potential representation that contains significant long- and short-term period distribution information in OD requirements. The specific calculation is as follows:
[0094]
[0095] Among them, h represents the number of long positions, represents the potential attention weight coefficient.
[0096] 3) Decoder
[0097] In the encoder, AGC-LSTM and MPC-ATTN are introduced to deeply integrate multiple OD demand patterns for learning long-term and short-term periodic spatiotemporal distribution information. In the decoder, multiple bidirectional LSTMs (BiLSTMs) are used to decode historical periodic spatiotemporal distribution information from forward to backward. The network can effectively capture situational information and learn the global evolution pattern of OD demand. In addition, since the OD demand of urban rail transit system is easily affected by emergencies, the OD demand has irregular spatiotemporal distribution. This irregular OD distribution usually increases the difficulty of OD demand prediction under emergencies. Therefore, in order to learn the impact of external factors on the OD demand of urban rail transit system under emergencies, a heterogeneous information fusion module (HIFB) is further proposed to fuse external heterogeneous information, including social media information of emergencies, date attribute information, etc. The heterogeneous information fusion module effectively mines the interactive information between emergency information and rail transit OD demand information to enhance the evolution characteristics of OD demand over time. Finally, the complete OD demand at the future moment can be accurately predicted through the fully connected layer.
[0098] (1) Bidirectional LSTM
[0099] Due to the significant determinism and suddenness of OD demand under emergencies, unidirectional modeling may not be able to fully capture the global time distribution information of OD demand under emergencies. Therefore, bidirectional LSTM can be used to decode meaningful historical periodic distribution information, providing complementary information from the forward and backward directions to fully understand the complex global evolution pattern of OD demand. The framework of bidirectional LSTM is as follows: Figure 7 Specifically, BiLSTM first processes the input data from the forward and reverse directions respectively to obtain the forward and reverse time dependencies, and then concatenates the forward and reverse time dependencies and inputs them into the fully connected layer to obtain the final hidden state. This module enables the model to learn the long- and short-term period distribution information of OD demand from two directions, and enhances the understanding of the complex evolution pattern of OD demand under emergencies.
[0100] In the decoder, the real-time estimated OD demand is first processed by a BiLSTM to capture the decoded sequence. Next, the latent representation from the encoder is regarded as the initial state and input into the BiLSTM together with the decoded sequence. Finally, by stacking multiple BiLSTMs, the historical periodic spatiotemporal distribution information can be effectively decoded. In this way, each position of the decoded sequence can be fused with the periodic distribution feature representation from the encoder, which is conducive to understanding the global evolution pattern of OD demand from both forward and backward.
[0101] (2) Heterogeneous Information Fusion Module
[0102] Urban rail transit OD demand is usually easily affected by external factors. Emergency events can easily lead to irregular changes in passenger flow in urban rail transit systems, significantly affecting the spatiotemporal distribution of OD demand. In recent years, the rise of social media has provided a feasible way to understand the relationship between urban rail transit OD demand and people's travel behavior. Social media tweets about emergencies can reflect people's travel intentions and travel mode choices to a certain extent. In addition, rail transit passenger flow fluctuations are also affected by date attributes, such as weekdays / weekends, or holiday attributes. In the era of big data, massive heterogeneous data is conducive to exploring external factors that affect abnormal passenger flow fluctuations from multiple perspectives. Therefore, a new heterogeneous information fusion module (HIFB) is proposed to consider multi-source heterogeneous information, including relevant social media data of emergencies and date attribute data. This module aims to learn meaningful information that can reflect the impact of external factors on subway OD demand, and use this information to improve the accuracy of urban rail transit OD prediction.
[0103] Figure 8 It is the framework diagram of the heterogeneous information fusion module. Specifically, given the social media data and date attribute data related to emergencies, the heterogeneous information vector F for time period t is definedt It should be noted that the heterogeneous feature vector F in time period t t Share daily data, because the heterogeneous data sources only contain daily data. Specifically, first use the learnable embedding to transform the heterogeneous feature vector F t The dimension is d model The latent feature matrix For heterogeneous feature mapping; then, the latent feature matrix Convolution operations and pooling operations (such as maximum pooling and average pooling) are performed along its time dimension. In this way, HIFB can mine meaningful information reflecting the impact of heterogeneous information on urban rail transit OD demand from the time dimension. Finally, the latent feature matrix is multiplied by the element-wise multiplication method. Fusion of heterogeneous data information to obtain enhanced feature matrix In summary, the calculation process of this module is as follows:
[0104]
[0105] Where σ represents the Sigmoid function. Given the enhanced feature matrix Use multiple fully connected layers to transform its dimensions so that its dimensions are consistent with the compressed OD requirement matrix Finally, the feature enhancement matrix and the compressed OD requirement matrix are directly fused by element addition to complete the heterogeneous information fusion processing.
[0106] 4) Loss Function
[0107] There is an obvious quantitative relationship between OD demand and inbound and outbound passenger flow in urban rail transit systems. For example, the OD demand with station A as the departure station is equivalent to the inbound flow of station A, and the OD demand with station B as the terminal station is equivalent to the outbound flow of station B. This quantitative relationship reveals the physical law of OD demand evolution, which is conducive to improving the interpretability and reliability of OD demand prediction. Therefore, the passenger flow quantity law can be embedded in the loss function to characterize the physical coupling relationship between OD demand and inbound and outbound flow in urban rail transit systems, thereby guiding model training. In addition, during the OD matrix preprocessing process, the dynamically compressed OD matrix can be filled with 0 values. These zero values will affect the model prediction. In one embodiment, a mask operation is introduced into the loss function to eliminate the training bias caused by zero values. In general, a masked physical guidance loss function (MPG-Loss Function) is proposed to enhance the model prediction effect, and its main form is as follows:
[0108]
[0109] Among them, W OD,W in ,W out Represents the influence weight of different parts of the loss function. By setting weights to weigh the influence of different parts on the loss function, the influence of different information on model training can be dynamically adjusted during the training process. ij represents the true value, represents the predicted value, P i in represents the inbound flow of site i, P j out represents the outbound flow of site j, (N×K) masked Represents a mask matrix of shape (N×K), where K represents the number of top-k sites with higher demand.
[0110] Specifically, the first item of the loss function is used to evaluate the model's ability to learn the characteristics of the OD distribution; the second and third items are used to evaluate the model's ability to learn the physical laws described by the quantitative relationship equations. During the training process, if the numerical value is masked, the corresponding error will not be back-propagated. Therefore, during the back-propagation process, a mask operation is used to perform a mask operation on the filled 0 values of the dynamically compressed OD matrix to eliminate the interference of the filled 0 values on the training caused by the compression of the OD demand matrix, and to improve the prediction performance of other OD demands. In addition, the passenger flow pattern is embedded into the loss function, and meaningful physical information is back-propagated to enhance model training. By embedding physical meaning, the MPG-Loss Function improves the interpretability of the OD demand prediction model while maintaining the accuracy of the data-driven model.
[0111] IV. Model Evaluation
[0112] To further verify the effect of the present invention, the prediction performance of PAG-STAN is verified on a real data set. The following will introduce the data set used in the experiment, the parameter settings of the model, the evaluation index, the benchmark model, and the comparison of experimental results.
[0113] 1) Dataset
[0114] The dataset used in the experiment is the AFC dataset of urban rail transit in Nanning, Guangxi Zhuang Autonomous Region. The dataset mainly includes the AFC data of Nanning Metro from 6 am to 11 pm from January 6, 2020 to May 31, 2020, covering the entire development stage of the emergency. For example, multiple time granularities such as 15 minutes, 30 minutes, and 60 minutes are used to extract the inbound passenger flow data of each station and the OD demand data between stations. The station numbers are sorted according to the adjacency relationship between the subway lines and stations.
[0115] In the experimental study, we crawled relevant blogs with specific geographic tag information and containing "emergency name" and "Nanning" from Sina Weibo within a specific period (consistent with the time period of passenger flow data). Since the number of crawled tweets is limited, we counted tweets by day, and used the daily tweet volume to represent the number of tweets in any time period of the day.
[0116] In addition, date attribute data was collected, including day of the week, date type (weekday / weekend), and holiday attributes. Since date attribute data is a non-numerical feature, one-hot encoding is used to convert non-numerical external features into binary vectors. After conversion, there are 10 variables to represent all external factors, that is, the external feature dimension is 10. Table 1 below shows all data attributes.
[0117] Table 1 Description of heterogeneous data
[0118]
[0119] 2) Model configuration
[0120] The experiment was conducted on a desktop computer with the following configuration: Core TM i9-10900X CPU, 64GB memory, and an NVIDIA GeForce RTX3050 GPU. The model is built using PyTorch.
[0121] Hyperparameters: This experiment divides the Nanning subway passenger flow dataset into training set, validation set, and test set according to time in a ratio of 12:4:5. All data are normalized to the range of [0, 1] using the Min-Max normalization method and input into the model. The model is composed of three layers of encoder layers and three layers of decoder layers. After fine-tuning, the feature size d of the model is model is 256, the number of heads H is 4, the historical time step TS is 12, and the batch size is 32. To improve the training effect and avoid overfitting, a dropout layer with a probability of 0.1 is added to each encoder layer and decoder layer. The optimizer of the model is Adam, and its learning rate is 0.0005. EarlyStopping is used for iteration, and its parameter patience is set to 100.
[0122] Preprocessing: Before training, all data needs to be normalized. After obtaining the prediction results, they are inversely normalized to the original scale range to facilitate the evaluation of the results.
[0123] 3) Evaluation indicators
[0124] The root mean square error (RMSE), mean absolute error (MAE) and weighted mean absolute percentage error (WMAPE) are used as evaluation indicators of the model prediction effect.
[0125]
[0126] in, is the predicted value, y ij is the true value, and N is the number of stations.
[0127] 4) Baseline Model
[0128] In order to comprehensively evaluate the prediction performance of PAG-STAN, the prediction effects of PAG-STAN and the benchmark model are compared on the passenger flow dataset during the Nanning subway emergency. The details of the benchmark model are described as follows:
[0129] Autoregressive Integrated Moving Average (ARIMA): In this experiment, the three parameters of ARIMA: lag order, difference, and moving average order were adjusted and set to 2, 1, and 2 respectively.
[0130] 3D Convolutional Neural Network (3DCNN): This experiment uses two layers of CNN for feature extraction with a convolution kernel size of 3×3; then a fully connected layer is used to predict future OD demand, with 256 neurons.
[0131] Long Short-Term Memory Neural Network (LSTM): This experiment uses two LSTM layers to predict future OD demand, and its hidden state dimension is 256.
[0132] ConvLSTM: The architecture of this model is very similar to LSTM. The biggest difference is that ConvLSTM uses convolution operations instead of the original full connection operations of LSTM, so the model can model both temporal and spatial correlations. The parameters of the model are consistent with LSTM, and the dimension of the hidden state is also set to 256.
[0133] Graph WaveNet (GWN): This model introduces an adaptive adjacency matrix for modeling latent spatial dependencies and uses an expanded 1D convolutional unit to model long-term temporal dependencies.
[0134] Contextualized Spatial-Temporal Network (CSTN): This model is the first to study the traffic OD demand prediction based on deep learning, which fully integrates local spatial scenarios, temporal evolution scenarios and global correlation scenarios to predict the OD demand of taxis between regions.
[0135] ST-ResNet: In this model, residual convolutional units are used to model long- and short-term temporal and spatial features, and an aggregation mechanism is introduced to learn the impact of external factors on traffic flow. This experiment only uses three residual convolutional units to learn multiple long- and short-term spatiotemporal dependencies without considering external factors.
[0136] Spatial-Temporal Encoder-Decoder Residual Multi-Graph ConvolutionalNetwork (ST-ED-RMGC): ST-ED-RMGC is a recently proposed model for rail transit OD demand prediction. In this model, adjacency graph, functional similarity graph, center distance graph and mobility pattern association graph are introduced to learn the complex pattern of OD demand. This experiment reproduces the model based on its public code.
[0137] Transformer: A Transformer framework consisting of three layers of encoders and three layers of decoders was built. The number of heads was set to 8 and the feature size was d model is 512. The output of the Transformer is input into two fully connected layers for prediction, and each fully connected layer contains 256 neurons.
[0138] Informer: We built an Informer framework with three layers of encoders and three layers of decoders, with 8 heads and feature size d. model is 512, and the other parameters are consistent with Transformer.
[0139] 5) Experimental results analysis
[0140] (1) Research on network-level prediction performance
[0141] The model is first compared with other baseline models on the entire subway dataset. The comparison results are shown in Table 2 below. It can be seen that the mathematical statistics model ARIMA performs the worst in all time periods because of its poor ability to capture the complex spatiotemporal characteristics of OD demand. Compared with ARIMA, the prediction effect of the basic deep learning models CNN and LSTM has been improved to a certain extent. These two models predict OD demand by modeling spatial or temporal dependencies respectively. The composite models ConvLSTM, GWN, and ST-ResNet simultaneously model the spatiotemporal dependencies of OD demand, so their performance is better than other basic models, indicating the importance of fully exploring spatiotemporal dependencies for improving prediction accuracy. The more popular OD demand prediction models CSTN and ST-ED-RMGC did not achieve satisfactory prediction results on this dataset, probably because the two models mainly focus on the OD demand prediction of taxis, and their spatiotemporal characteristics are significantly different from those of rail transit OD demand prediction. Therefore, CSTN and ST-ED-RMGC may not be suitable for urban rail transit OD demand prediction. In addition, according to the prediction results, the performance of the attention models Transformer and Informer is competitive in all time periods, and the models effectively model the temporal dependency without considering the sequence distance. Although these two models do not consider spatial features, the topological structure of the subway network involved in the dataset is not complex, so the impact on the prediction effect is small.
[0142] Although the above models have made progress in architecture and performance, they only focus on historical OD demand information and ignore the impact of external factors on OD demand distribution during emergencies. Compared with the above models, PAG-STAN not only deeply integrates multiple OD demand patterns to capture periodic spatiotemporal dependencies for modeling OD demand distribution, but also introduces heterogeneous data (such as relevant social media data and date attribute data under emergencies) to learn meaningful information that can reflect the impact of emergencies on OD demand distribution, thereby enhancing the evolution trend of OD demand over time. Therefore, PAG-STAN outperforms other baseline models at all time granularities and achieves the lowest evaluation index in most examples. Compared with the best existing models, PAG-STAN achieved 1.60%, 1.77% and 1.57% improvements in RMSE, MAE and WMAPE, respectively. Table 2 Comparison of network-level prediction performance of different models.
[0143] Table 2 Network-level prediction performance of different models
[0144]
[0145] In order to more intuitively understand the prediction performance of the model, the heat map is also used to visualize the predicted OD demand matrix in different time periods, namely 8:00-8:30, 12:00-12:30 and 19:00-19:30. For example, each row represents the starting station and each column represents the target station. The actual OD demand matrix and the predicted OD demand matrix of 8:00-8:30 in the morning peak on April 22, 2022 are visualized. And the actual OD demand matrix and the predicted OD demand matrix of 12:00-12:30 in the afternoon on April 22, 2022 are visualized. In addition, the actual OD demand matrix and the predicted OD demand matrix of 19:00-19:30 in the evening peak on April 22, 2022 are also visualized. Through visual analysis, it can be seen that due to the impact of emergencies (such as epidemics), most of the OD demands are very small or even zero even in the morning and evening peaks, and only a part of the OD pairs have high OD demands. Due to the significant sparsity of the OD demand matrix, it is challenging to accurately predict OD demand during emergencies. To achieve accurate rail transit OD demand prediction, PAG-STAN deeply integrates multiple OD demand patterns to mine the periodic spatiotemporal distribution information of OD demand. Therefore, whether it is low demand or high demand, the predicted value of the model is very close to the true value. In addition, the experiment shows that the OD demand prediction performance of the model during peak hours in the morning and evening is better than that during normal hours. This is because there are more significant OD demand distribution characteristics during peak hours in the morning and evening, which facilitates model learning and improves prediction accuracy. These comparison results fully demonstrate the effectiveness and reliability of PAG-STAN in predicting subway OD demand during emergencies.
[0146] (2) Comparison of prediction performance among high-demand sites
[0147] During the experiment, the performance of PAG-STAN and other baseline models in OD demand prediction between high-demand sites was compared. First, the top-k high-demand sites were selected, and only the OD demand between these sites was considered to evaluate the prediction performance of the model. Specifically, for 15 sites with high demand, about 65% of the OD demand in the dataset is covered. Table 3 below shows the prediction performance of different methods under high OD demand sites. It can be seen that PAG-STAN achieved the best prediction performance, and as the time granularity increases, the advantage of PAG-STAN becomes more obvious. Specifically, compared with the second best existing model, PAG-STAN has improved RMSE, MAE and WMAPE by 1.37%, 1.60% and 1.07% respectively in the OD demand prediction of high-demand sites, indicating that PAG-STAN has a good prediction effect in the OD demand prediction between high-demand sites.
[0148] Table 3 OD demand prediction performance of high-demand stations in different models
[0149]
[0150] (3) Ablation experimental study
[0151] To further analyze the impact of different components of PAG-STAN on the model prediction performance, an ablation experiment was performed on the subway dataset.
[0152] Effectiveness of Multi-Periodic OD demand: Due to the significant long- and short-term periodicity of OD distribution, multiple OD demand patterns are considered to learn periodic spatiotemporal distribution information. The impact of multi-periodic OD demand on subway OD demand forecasting is explored, that is, the long- and short-term OD distribution information of weekly OD patterns and daily OD patterns is used to predict future OD demand. The following are several variants:
[0153] Net-Real-time OD: This variant directly uses the estimated real-time OD demand to predict future subway OD demand.
[0154] Net-Real-time OD+weekly OD: In addition to the estimated real-time OD demand, this variant uses the weekly OD pattern to jointly predict the future OD demand, aiming to study the impact of long-term historical OD distribution information on OD demand prediction.
[0155] Net-Real-time OD+daily OD: Similar to the previous variant, this variant uses the daily OD pattern together with the estimated real-time OD demand to jointly predict the future OD demand, aiming to explore the impact of short-term historical OD distribution information on OD demand prediction.
[0156] Net-Mulit-periodic OD: This variant integrates weekly and daily OD demand patterns to capture long- and short-term historical OD distribution information, which is used to model the periodic evolution characteristics of OD demand.
[0157] Table 4 Impact of different multi-period OD demand patterns on OD demand forecast
[0158]
[0159] The prediction effect indicators of the model are shown in Table 4 above. It can be found that the prediction effect of Net-Real-time OD is the worst, because this variant only uses limited real-time information to predict OD demand and ignores the long-term and short-term periodicity of OD distribution. When the weekly OD mode or the daily OD mode is considered, the prediction performance of the model is improved to a certain extent, indicating that the long-term or short-term OD distribution information is conducive to OD demand prediction. At the same time, it can be found that in most cases, the prediction performance of the variant Net-Real-time OD+daily OD is better than that of Net-Real-time OD+weekly OD, because the short-term spatiotemporal distribution information can more accurately characterize the evolution characteristics of periodic OD demand. Compared with the above variants, Net-Mulit-periodic OD achieves the best prediction performance by jointly mining the long-term and short-term OD distribution information based on multiple OD modes. Compared with Net-Real-time OD, RMSE, MAE, and WMAPE are improved by 8.05%, 6.45%, and 7.29% on average. Therefore, the long- and short-term period demand distribution information extracted from multi-period demand can greatly improve the demand forecasting performance.
[0160] Effectiveness of Real-time OD demand estimation: Since some passengers have not completed their trips at the current moment, only an incomplete real-time OD demand matrix can be obtained. Incomplete real-time OD demand will interfere with the training of the model and reduce the prediction accuracy. Therefore, the real-time OD demand is estimated based on the real-time station flow and the historically complete long- and short-time OD distribution rate. To explore the impact of real-time OD demand estimation on OD demand prediction, this experiment proposes the following variants.
[0161] Net-Incomplete OD: This variant directly uses the incomplete OD demand to predict future subway OD demand.
[0162] Net-Real-time OD (long-term): This variant uses the real-time estimated OD demand considering only the long-term OD distribution rate (weekly OD distribution rate) to predict the future subway OD demand.
[0163] Net-Real-time OD (short-term): Similar to the previous variant, this variant uses the real-time estimated OD demand considering only the short-term OD distribution rate (Short-term OD distribution rate) to predict the future subway OD demand.
[0164] Net-Real-time OD (long short-term): This variant uses the real-time estimated OD matrix demand considering the complete OD distribution information in long and short terms to predict the future subway OD demand.
[0165] Table 5 Impact of real-time OD demand estimation on OD demand forecast
[0166]
[0167] The prediction results of all variants are summarized in Table 5 above. It can be seen that when the incomplete OD demand matrix is used directly to predict future OD demand, the variant Net-Incomplete OD achieves the worst prediction result. This is because the incomplete OD demand matrix does not record the unfinished travel information, which will interfere with the learning of OD distribution information and lead to inaccurate OD demand prediction. The present invention uses real-time inbound flow and historical complete OD distribution rate to estimate the complete real-time OD demand, thereby solving the problem of real-time data availability. It can be observed that the prediction results of Net-Real-time OD (long-term) and Net-Real-time OD (short-term) are improved because they both consider complete OD demand information. Similar to the above experimental results, the prediction effect of Net-Real-time OD (short-term) is better than that of Net-Real-time OD (long-term), once again proving that short-term periodic OD distribution data can provide more useful information for OD demand prediction. Compared with the above three variants, Net-Real-time OD (long short-term) achieves the best prediction effect at all time granularities, indicating that the real-time OD demand estimation module proposed in the present invention can generate a real-time and complete OD demand matrix by utilizing the real-time inbound flow and long-short-term complete OD distribution information, thereby improving the prediction accuracy.
[0168] Effectiveness of Heterogeneous information: The new heterogeneous information fusion module (HIFB) provided by this invention can fully mine meaningful information from multi-source heterogeneous data (emergency-related social media data, date attribute data), reflecting the impact of external factors on subway OD distribution during emergencies. This experiment further studies the impact of multi-source heterogeneous data information on prediction performance, and several variants are introduced next. Table 6 shows the impact of different external factors on OD demand prediction.
[0169] Net-no heterogeneous information: This variant does not use multi-source heterogeneous data to predict future OD demand, which means that the impact of external factors on subway OD distribution during emergencies is not considered.
[0170] Net-Social Media Information: This variant uses social media data related to emergencies to assist prediction, thereby learning the impact of emergencies on subway OD distribution.
[0171] Net-Date Attribute Information: This variant uses date attribute data to assist prediction, thereby learning the impact of date attributes on subway OD distribution.
[0172] Net-Heterogeneous Information: This variant makes full use of multi-source heterogeneous data to assist in predicting subway OD demand during emergencies. The model considers social media data and date attribute data related to emergencies to comprehensively learn the impact of external factors on subway OD distribution during emergencies.
[0173] Table 6 The impact of different external factors on OD demand forecast
[0174]
[0175] Effectiveness of Masked Physics Guided Loss Function: This paper proposes a new masked physics guided loss function, which not only embeds the passenger flow quantity relationship into the loss function to guide the model training, but also uses the mask operation to eliminate the interference of the 0 values filled in the compressed OD matrix on the model training. This experiment studies the effect of this loss function and proposes the following variants.
[0176] Net-General Loss Function: This variant uses the conventional MSE loss function to train the model.
[0177] Net-Information Embedding Loss Function: This variant embeds the passenger flow quantity pattern into the loss function to enhance the model training process, but does not use masking operations to eliminate the impact of 0 values in the compressed OD matrix on model training.
[0178] Net-Masked Loss Function: This variant uses a mask operation to eliminate the impact of 0 values in the compressed OD matrix on model training, but does not embed the passenger flow quantity pattern into the loss function.
[0179] Net-MPG-Loss Function: This variant uses the MPG-Loss Function proposed in this invention to train the model.
[0180] Table 7 Effect of different loss functions on OD demand prediction
[0181]
[0182] Table 7 above summarizes the prediction effect of PAG-STAN after training under different loss functions. It can be seen from the table that the model has the worst effect after training with the conventional MSE loss function. This is because the physical quantitative relationship between OD demand and inbound and outbound flows is not considered during model training, and the 0 value of the compressed OD matrix interferes with the training of the model. When the model masks the 0 value of the compressed OD demand matrix during training, the prediction effect of the model is improved, indicating that the masking operation can eliminate the training error caused by the 0 value in the compressed OD matrix; at the same time, when the model considers the physical quantitative relationship between OD demand and inbound and outbound flows during training, the prediction effect of the model is improved, indicating that the physical quantitative relationship between OD demand and inbound and outbound flows can enhance the training of the model and improve the interpretability of the model. When PAG-STAN is trained using the MPG loss function, the model achieves the best prediction effect at all time granularities, indicating that the MPG-Loss Function proposed in the present invention can effectively improve the training of the model, enhance the interpretability of the model and the reliability of the prediction.
[0183] The present invention may be a system, a method and / or a computer program product. The computer program product may include a computer-readable storage medium on which are loaded computer-readable program instructions for causing a processor to implement various aspects of the present invention. The various embodiments of the present invention have been described above, and the above description is exemplary, not exhaustive, and is not limited to the disclosed embodiments. Without departing from the scope and spirit of the described embodiments, many modifications and changes will be apparent to those of ordinary skill in the art. The choice of terms used herein is intended to best explain the principles of the embodiments, practical applications, or technical improvements in the market, or to enable other persons of ordinary skill in the art to understand the embodiments disclosed herein.
Claims
1. A method for predicting short-term OD demand of urban rail transit under emergencies, comprising the following steps: In the current time period t, the observed OD demand sequence, real-time station flow data and rail transit network diagram are obtained; Input the OD demand sequence, the real-time station entry flow data and the rail transit network diagram into the trained prediction model to predict the OD demand of the rail transit system in the next time period It is expressed as: Where f represents the trained prediction model, represents the OD demand sequence observed in time period t, represents the real-time station flow data in time period t, T represents the historical T time steps, G = (S, E, A) represents the rail transit network graph, S represents the station set, E represents the edge set, A represents the weighted adjacency matrix of the rail transit network, t day Indicates the total number of time slots in a day; The prediction model includes a real-time OD estimation module, an encoder and a decoder, wherein: The real-time OD estimation module performs: calculating the OD distribution rate at the same time yesterday and the same time last week according to the input weekly and daily OD demand patterns; obtaining two potential long-short-time OD demand matrices by multiplying the real-time inbound flow and the long-short-time historical OD distribution rate; and fusing the two potential long-short-time OD demand matrices to obtain a fused real-time OD demand matrix; The encoder comprises three adaptive graph convolutional long short-term memory networks and a multi-cycle mutual attention module, wherein the three adaptive graph convolutional long short-term memory networks respectively take a weekly OD mode, a daily OD mode and a real-time OD mode as input to aggregate the hidden spatiotemporal distribution information of the three OD modes; the multi-cycle mutual attention module generates a feature representation by encoding the hidden periodic spatiotemporal distribution information from the adaptive graph convolutional long short-term memory network, and inputs the feature representation into a convolutional network with a residual operation to enhance the periodic spatiotemporal distribution feature representation; The decoder is used to integrate the enhanced periodic spatiotemporal distribution feature representation from the encoder and the estimated real-time OD demand; The decoder includes multiple BiLSTMs, heterogeneous information fusion modules and fully connected layers, wherein the first BiLSTM is used to capture real-time global spatiotemporal distribution information, and the remaining BiLSTMs are used to aggregate feature representations from the encoder and real-time OD demands processed by the first BiLSTM; the heterogeneous information fusion module is used to mine the interactive information between emergency information and OD demand information; the fully connected layer is used to realize the OD demand forecast of urban rail transit in the next time period; The real-time OD estimation module performs the following process: Using short-term destination OD distribution rate Estimate the potential short-term OD demand matrix for the current time period t And use the long-term destination OD distribution rate Estimate the potential long-term OD demand matrix for the current time period t It is expressed as: Will and The two matrices are concatenated and input into the unit convolutional network to generate real-time OD demand with long and short time period distribution information, expressed as: Among them, P t (i) is the real-time inbound flow of site i in the current time period t, and i,j are site indexes.
2. The method according to claim 1, characterized in that: The loss function for training the prediction model is the mask physics guided loss function, expressed as: Among them, W OD ,W in ,W out represents the weight, y ij represents the true value, represents the predicted value, i,j are the site indexes, N represents the number of sites, K=Max(k1,k2,…,k N ) represents the number of top k sites with high demand, P i in represents the inbound flow of site i, P j out represents the outbound flow of site j, (N×K) masked Represents a mask matrix of shape (N×K).
3. The method according to claim 1, characterized in that: For the adaptive graph convolutional long short-term memory network, first randomly initialize two node embeddings For generating an adaptive adjacency matrix: The adaptive adjacency matrix is embedded into the topological adjacency matrix by element addition. The calculation process is expressed as: Among them, H l+1 and H l They represent the hidden features of the l+1th layer and the lth layer respectively, σ represents the activation function, Represents the adjacency matrix with added self-connection, I N represents the identity matrix, D represents the degree matrix, W l Represents the trainable weight matrix of the l-th graph convolutional layer.
4. The method according to claim 1, characterized in that: Given the social media data and date attribute data related to emergencies, for the heterogeneous information vector F in time period t t , the calculation process of the heterogeneous information fusion module is expressed as: Among them, σ represents the Sigmoid function, is the enhanced feature matrix, AvgPool represents average pooling, MaxPool represents maximum pooling, is the latent feature matrix, Transform the heterogeneous feature vector F using learnable embeddings t get.
5. A computer-readable storage medium having a computer program stored thereon, wherein: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 4 are implemented.
6. A computer device comprising a memory and a processor, wherein a computer program capable of being run on the processor is stored in the memory, characterized in that: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 4 are implemented.
