Urban rail transit holiday short-time OD prediction method and system based on deep learning
The deep learning framework integrates real-time in-station and out-station data with OD data to address dynamic holiday traffic changes, improving prediction accuracy in urban rail transportation.
Patent Information
- Application Number
- CN202510434639.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-08
- Publication Date
- 2025-07-15
AI Technical Summary
The existing technology cannot effectively respond to the dynamic changes in urban rail transit passenger flow during holidays, resulting in poor prediction results and the incoming passenger flow and outgoing passenger flow cannot be used in real time to supplement OD data for accurate predictions.
The urban rail transit holiday short-term OD prediction method is adopted based on deep learning, and a deep learning framework is built using GCN and GRU structures, combining incoming passenger flow data, outbound passenger flow data and OD data, and feature encoding and decoding is performed through graph construction modules, multi-source heterogeneous data fusion modules and spatiotemporal dynamic graph convolution cycle modules to realize the prediction of real-time OD demand matrix.
It improves the accuracy and real-timeness of passenger flow prediction during holidays, can better capture the complex spatial and temporal characteristics of passenger flow, improves the interpretability and prediction reliability of the model, adapts to large-scale data processing, and has significant nonlinear modeling and feature learning capabilities.
Smart Images

Figure CN120317433A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the technical field of large model data prediction, and particularly to a short-term OD prediction method and system for urban rail transit during holidays based on deep learning. Background Art
[0002] During holidays, there will be abnormal fluctuations in the passenger flow of rail transit, and such abnormal passenger flow fluctuations have various impacts on the rail transit system. For example, in the case of a sharp increase in passenger flow, the rail transit system may face the problem of insufficient transport capacity, resulting in overcrowding on platforms and trains and difficulties for passengers to board, which not only reduces the transport efficiency but also increases the risk of passenger squeezing and trampling, presenting significant safety hazards. Therefore, studying the short-term OD passenger flow prediction of urban rail transit systems during holidays is of great significance to both operators and passengers. For operators, it can help them carry out targeted schedule optimization and balanced transport capacity allocation work; for passengers, it can reduce travel costs and enhance the travel experience during holidays.
[0003] In order to address the problem of short-term passenger flow prediction during holidays, in-depth research has been carried out based on deep learning in the prior art. The main prior art research includes:
[0004] 1) A spatio-temporal attention fusion network (STAFN) was proposed for short-term passenger flow prediction of urban rail systems during holidays.
[0005] 2) A dynamic OD passenger flow prediction method for subway systems based on a long short-term memory (LSTM) recurrent neural network was proposed.
[0006] 3) An improved support vector machine (SVM) was proposed for predicting passenger flow during holidays.
[0007] Currently, the main deficiencies in passenger flow prediction during holidays are as follows: (1) During holidays, the passenger flow surges, and the spatio-temporal distribution of the passenger flow changes greatly compared with weekdays, and the functionality of stations also changes accordingly. Existing OD passenger flow prediction methods usually model the spatial association relationship based on a static neighborhood topology map and cannot adapt to the dynamic changes of holiday passenger flow, resulting in poor model prediction effects; (2) Common mathematical statistics models (such as ARIMA, etc.) or machine learning models (such as support vector machines, etc.) usually predict the short-term passenger flow at the station level and are not applicable to the short-term passenger flow prediction of urban rail transit network level. In addition, most existing deep learning models only use existing historical data for OD prediction and cannot use real-time OD data for prediction. It is worth further studying to supplement real-time OD data with inbound and outbound passenger flows for real-time prediction.
[0008] In summary, there is still a lack of an effective real-time OD data prediction method. The existing technical methods cannot solve the dynamic changes in holiday passenger flow, resulting in poor model prediction effects, and cannot use real-time OD data for prediction, lacking the technical problems of supplementing real-time OD data with inbound and outbound passenger flow for real-time prediction.
[0009] Regarding the above-mentioned technical problems, there is an urgent need to propose a new method that can construct an effective deep learning framework by means of GCN and GRU structures, and at the same time organically integrate the inbound passenger flow data, outbound passenger flow data, and OD data during holidays to fully study the impact of holidays on passenger flow changes, capture the complex spatio-temporal characteristics of passenger flow dynamics, and improve the prediction accuracy of passenger flow during holidays while meeting the "real-time" requirements of short-term passenger flow prediction. Summary of the Invention
[0010] To solve the defects of the above-mentioned existing technologies, the present invention proposes a short-term OD prediction method and system for urban rail transit during holidays based on deep learning.
[0011] In a first aspect, an embodiment of the present application provides a short-term OD prediction method for urban rail transit during holidays based on deep learning. The method includes:
[0012] Based on the historical data of the urban rail transit automatic fare collection system, multi-source heterogeneous passenger flow data is obtained, where the multi-source heterogeneous passenger flow data includes: the road network topology structure of the urban rail transit network, the OD demand matrix, the real-time inbound and outbound passenger flow sequence data;
[0013] An OD prediction deep learning model is constructed, where the OD prediction deep learning model includes an encoder and a decoder. The encoder includes a graph construction module, a multi-source heterogeneous data fusion module, and a spatio-temporal dynamic graph convolutional recurrent module, and the decoder includes a spatio-temporal dynamic graph convolutional recurrent module;
[0014] The multi-source heterogeneous passenger flow data is input into the encoder of the OD prediction deep learning model. The multi-source heterogeneous data fusion module performs feature encoding and outputs the fused passenger flow features; the graph construction module constructs a geographical location neighborhood graph and a station functional semantic graph; the spatio-temporal dynamic graph convolutional recurrent module mines the spatio-temporal correlation relationship between the output of the graph structure and the fused passenger flow features, and performs secondary fusion to output the passenger flow hidden features;
[0015] The passenger flow hidden features are input into the decoder for decoding to complete the prediction of the complete OD demand matrix for a future period of time.
[0016] In an embodiment of the present invention, the above-mentioned short-term OD prediction method for urban rail transit during holidays based on deep learning further includes:
[0017] For the pre-training of the OD prediction deep learning model, the MSE is used as the loss function to calculate the mean square error between the original OD demand matrix and the restored OD demand matrix;
[0018] For the OD prediction deep learning model, the PINN loss function is used during training to calculate the prediction error between the predicted OD demand matrix and the true OD demand matrix.
[0019] In the embodiment of the present invention, the above OD prediction deep learning model uses the deep learning model DM-GCGRU, where the spatio-temporal dynamic graph convolutional recurrent module is stacked by multiple GRU modules embedded with GCN modules;
[0020] The OD demand matrix is an incomplete OD demand matrix, and the incomplete OD demand matrix includes: the boarding time of passengers, the boarding station, and the alighting station.
[0021] In the embodiment of the present invention, the above multi-source heterogeneous data fusion module is configured to perform the steps of:
[0022] Perform feature encoding on the multi-source heterogeneous data, and raise the low-dimensional representation of the in-bound or out-bound passenger flow to a high-dimensional space;
[0023] Use the vector inner product to represent the correlation between the real-time in-bound flow and the out-bound flow, and use the correlation matrix to calculate the fusion weights between each in-bound passenger flow and out-bound passenger flow respectively. Based on the fusion weights, fuse the in-bound and out-bound passenger flows to generate pseudo-OD features;
[0024] Concatenate the pseudo-OD features with the OD passenger flow features, and output the complete OD demand matrix through the fully connected layer.
[0025] In the embodiment of the present invention, the above graph construction module is configured to perform the steps of:
[0026] Construct a neighborhood graph, with stations or regions as nodes. Based on the road network topology structure of the urban rail transit network, establish edges between each region and its neighboring regions. Represent the association relationship between different regions through the edges to form a neighborhood graph;
[0027] Construct a station functional semantic graph. For the input historical OD passenger flow data, calculate the Euclidean distance between the historical in-bound and out-bound passenger flow sequences respectively. Use the K-nearest neighbor algorithm based on the in-bound and out-bound similarity matrices calculated from the Euclidean distance to construct a station in-bound functional semantic graph and a station out-bound functional semantic graph.
[0028] In the embodiment of the present invention, the above spatio-temporal dynamic convolution module is configured to perform the steps of:
[0029] Based on the neighborhood graph, the functional semantic graph, and the fused passenger flow features, use the graph convolutional neural network GCN model to construct a spatial association relationship;
[0030] Introduce the spatial graph convolutional neural network GCN into GRU to construct spatio-temporal correlation. Based on the spatial association relationship constructed by GCN, use the activation function to calculate the update gate and the reset gate; based on the input at the current moment and the reset hidden passenger flow state, after modeling the spatial dependence through the spatial module, calculate the candidate state through the tanh activation function. Finally, calculate the hidden passenger flow feature at the current moment through the update gate.
[0031] In the embodiment of the present invention, for the above-mentioned pre-training part, take MSE as the loss function and calculate the mean square error between the original OD demand matrix and the restored OD demand matrix. The steps include:
[0032] Input the multi-source heterogeneous data and the road network topology graph structure into the deep learning model DM-GCGRU. Randomly set some passenger flows in the OD demand matrix to zero, input the masked OD demand matrix and the complete inbound and outbound passenger flows of the stations into the encoder, and perform spatio-temporal relationship modeling through the linear layer.
[0033] After the linear layer numerically processes the high-dimensional features output by the encoding layer, predict the masked part of the passenger flow, calculate the MSE loss between the predicted value and the complete OD flow, and complete the pre-training.
[0034] In a second aspect, the embodiments of the present application provide a short-term OD prediction system for urban rail transit during holidays based on deep learning. Using the above-mentioned short-term OD prediction method for urban rail transit during holidays based on deep learning, the system includes:
[0035] Passenger flow data acquisition module: Based on the historical data of the urban rail transit automatic fare collection system, obtain multi-source heterogeneous passenger flow data. Among them, the multi-source heterogeneous passenger flow data includes: the road network topology graph structure of the urban rail transit network, the OD demand matrix, the real-time inbound passenger flow, and the outbound passenger flow sequence data.
[0036] Deep learning model construction module: Construct an OD prediction deep learning model. Among them, the OD prediction deep learning model includes an encoder and a decoder. The encoder includes a graph construction module, a multi-source heterogeneous data fusion module, and a spatio-temporal dynamic graph convolutional recurrent module. The decoder includes a spatio-temporal dynamic graph convolutional recurrent module.
[0037] Encoding module: Input the multi-source heterogeneous passenger flow data into the encoder of the OD prediction deep learning model. The multi-source heterogeneous data fusion module performs feature encoding and outputs the fused passenger flow features; the graph construction module constructs a geographical location neighborhood graph and a station functional semantic graph; the spatio-temporal dynamic graph convolutional recurrent module mines the spatio-temporal correlation relationship between the output of the graph structure and the fused passenger flow features, and performs secondary fusion to output the passenger flow hidden features.
[0038] Decoding module: Input the passenger flow hidden features into the decoder for decoding to complete the prediction of the complete OD demand matrix for a period of time in the future.
[0039] Thirdly, an embodiment of the present application provides a computer-readable storage medium, on which a computer program is stored, and when the program is executed by a processor, the steps of the above-mentioned short-term OD prediction method for urban rail transit during holidays based on deep learning are implemented.
[0040] Fourthly, an embodiment of the present application provides an electronic device, including a memory, a processor, and a computer program stored on the memory and executable on the processor. When the processor executes the program, the steps of the above-mentioned short-term OD prediction method for urban rail transit during holidays based on deep learning are implemented.
[0041] Compared with the related prior art, it has the following prominent beneficial effects:
[0042] 1) The deep learning model DM-GCGRU proposed by the method of the present invention focuses on the passenger flow prediction of urban rail transit during holidays. By combining the inbound flow, outbound flow, and OD data for passenger flow prediction, and at the same time constructing a spatio-temporal dynamic graph convolution module through the GCN and GRU models to extract the complex spatio-temporal relationships in the data, a model different from the prior art is proposed, which is innovative and has a good prediction effect. In addition, the data structure of the model is more complete and reliable compared with the prior art, improving the overall prediction effect, so it has a certain degree of innovation.
[0043] 2) The deep learning framework based on the decoder-encoder framework proposed by the method of the present invention embeds GCN into GRU to construct a spatio-temporal dynamic graph convolution loop module, which is original.
[0044] 3) The method of the present invention combines the inbound passenger flow data and outbound passenger flow data to supplement and improve the real-time nature of the OD data, which is novel.
[0045] 4) The method of the present invention uses the pre-training method to improve the model feature encoding ability, effectively solves the data sparsity problem in the short-term OD flow prediction during holidays. The model uses the data containing holidays in two consecutive years for prediction, fully considering the holiday attributes, which is innovative.
[0046] 5) Compared with the existing publicly disclosed urban rail transit holiday passenger flow prediction system, the present invention uses a deep learning model, while the existing publicly disclosed holiday passenger flow prediction system relies on traditional methods such as OD classification models, gravity models, and travel willingness grading models. In contrast, the deep learning model adopted by the present invention shows significant advantages in multiple aspects, specifically including the following points: (1) The deep learning model adopted by the present invention has excellent non-linear modeling capabilities and can deeply learn the relationship between complex inputs and outputs, automatically capturing potential non-linear patterns in passenger flow data. Traditional OD classification models, gravity models, and travel willingness grading models usually assume that travel patterns are linear or based on simple rules, which makes it difficult for them to effectively model complex travel behaviors, such as sudden passenger flow fluctuations during holidays or special events. The deep learning model can better handle these complex and changing travel patterns and provide more accurate predictions. (2) Automatic feature learning and optimization Different from traditional methods that rely on expert knowledge to manually design features, the deep learning model can extract the most effective features from a large amount of historical travel data through an automated feature learning process. Traditional gravity models usually rely on fixed features such as the distance between origin and destination, population density, and transportation facilities, and these features may not fully reflect the complexity of the urban rail transit system. The deep learning model can dynamically adjust and optimize feature representations according to the characteristics of the data, thus avoiding biases and omissions that may occur when manually designing features. In addition, deep learning can identify important hidden features that are difficult to detect by traditional models, improving the accuracy and reliability of predictions. (3) Excellent ability to process large-scale data The deep learning model can efficiently process large-scale data sets to meet the increasing demand for data volume. In the passenger flow prediction of urban rail transit, the data volume is often very large, involving multi-dimensional data such as a large number of historical travel records, weather data, and event information. Through its powerful computing ability, the deep learning model can fully utilize all available information in a big data environment, discover potential patterns in the data, and accurately predict future passenger flows. In contrast, traditional OD classification models and gravity models have limited computational efficiency and processing capabilities when faced with large-scale data, are easily affected by data quality or scale expansion, and cannot fully explore the deep-seated patterns hidden in the data. Through multi-level training, the deep learning model can learn more general travel patterns in diverse urban rail transit environments. Therefore, it has stronger generalization ability when faced with travel data from different cities or different holidays. This enables the deep learning model to achieve good prediction results in different application scenarios, while traditional models usually rely on specific regional features and fixed assumptions and have relatively weak generalization ability. In summary, the deep learning model adopted by the present invention has more significant advantages than the publicly disclosed methods in terms of non-linear modeling, feature learning, data processing ability, and generalization ability.This enables the present invention to provide a more accurate, efficient, and adaptable solution in the prediction of passenger flow during holidays in urban rail transit.
[0047] 6) Compared with the existing publicly disclosed subway network passenger flow prediction methods, the method of the present invention has obvious innovation. First, the application scenarios are different: the present invention focuses on OD (origin-destination) passenger flow prediction, while the existing methods target inbound passenger flow prediction. Second, in terms of model algorithms, the present invention proposes a complex deep learning model and uses physics-informed PINN (Physics-Informed Neural Network) as the loss function. In contrast, the existing methods only use a single LSTM model. By introducing physical quantity information, the present invention not only maintains the high prediction accuracy of data-driven methods but also improves the interpretability and prediction reliability of the model. From the perspective of data structure, the present invention constructs a multi-source heterogeneous data fusion module, combining inbound flow data, outbound flow data, and OD data, enhancing the real-time performance, while the existing methods only rely on the clearing data provided by the ACC system. In terms of algorithm design, the present invention proposes a spatio-temporal dynamic convolution model, effectively capturing the temporal and spatial features in the data, while the existing methods only use LSTM to capture temporal features. In addition, due to the sparsity of OD data during holidays, the present invention also introduces a pre-trained model, significantly improving the feature encoding ability, while this problem is not considered in the existing methods. Generally speaking, whether in terms of application scenarios, model algorithm frameworks, or data structure designs, etc., the present invention has significant differences from the existing publicly disclosed technologies and has strong innovation. BRIEF DESCRIPTION OF THE DRAWINGS
[0048] The drawings described herein are used to provide a further understanding of the present application and form a part of the present application. The schematic embodiments of the present application and their descriptions are used to explain the present application and do not constitute an improper limitation to the present application. In the drawings:
[0049] Figure 1 It is a schematic flow chart of the short-term OD prediction method for urban rail transit holidays of the present invention;
[0050] Figure 2 It is a schematic diagram of the DM-GCGRU model architecture of the embodiment of the present invention;
[0051] Figure 3 It is a schematic diagram of the multi-source heterogeneous data convolution module of the embodiment of the present invention;
[0052] Figure 4 It is a schematic diagram of the graph construction module of the embodiment of the present invention;
[0053] Figure 5 It is a schematic diagram of the spatio-temporal dynamic convolution module of the embodiment of the present invention;
[0054] Figure 6Schematic diagram of the pre-trained model structure according to an embodiment of the present invention;
[0055] Figure 7a Schematic diagram of the comparison of the model effects of RMSE under different time granularities according to an embodiment of the present invention;
[0056] Figure 7b Schematic diagram of the comparison of the model effects of MAE under different time granularities according to an embodiment of the present invention;
[0057] Figure 7c Schematic diagram of the comparison of the model effects of WMAPE under different time granularities according to an embodiment of the present invention;
[0058] Figure 8a Comparison diagram of the true value and predicted value of a single OD pair in the 15-minute granularity dataset according to an embodiment of the present invention;
[0059] Figure 8b Comparison diagram of the true value and predicted value of a single OD pair in the 30-minute granularity dataset according to an embodiment of the present invention;
[0060] Figure 8c Comparison diagram of the true value and predicted value of a single OD pair in the 60-minute granularity dataset according to an embodiment of the present invention;
[0061] Figure 9 Schematic diagram of the short-term OD prediction system for urban rail transit holidays according to the present invention;
[0062] Figure 10 Schematic diagram of the computer hardware according to the present invention. Detailed implementation manners
[0063] It should be noted that the term "and / or" in the present invention only describes the association relationship of associated objects, indicating that there can be three relationships. For example, A and / or B can represent: A exists alone, A and B exist simultaneously, and B exists alone. Among them, A and B can be singular or plural. In addition, the character " / " in the present invention generally represents an "or" relationship between the front and rear associated objects, but it may also represent a "and / or" relationship. Specifically, it can be understood by referring to the context.
[0064] In the present invention, "at least one" means one or more, and "multiple" means two or more. "At least one (item)" or its similar expression means any combination of these items, including any combination of single item (s) or multiple items (s). For example, at least one (item) of a, b, or c can represent: a, b, c, a - b, a - c, b - c, or a - b - c, where a, b, c can be single or multiple.
[0065] It should also be understood that in various embodiments of the present invention, the magnitudes of the serial numbers of the above processes do not imply the order of execution, and the execution order of each process should be determined by its function and internal logic, and should not constitute any limitation to the implementation process of the embodiments of the present invention.
[0066] In several embodiments provided by the present invention, it should be understood that the disclosed devices, apparatuses, and methods can be implemented in other ways. For example, the device embodiments described above are merely illustrative. For example, the division of the units is only a logical function division, and there can be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another device, or some features can be ignored or not executed. Another point is that the displayed or discussed couplings or direct couplings or communication connections to each other can be through some interfaces, and the indirect couplings or communication connections of the devices or units can be in electrical, mechanical, or other forms.
[0067] The units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they can be located in one place, or distributed to multiple network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0068] In addition, in each embodiment of the present invention, the functional units can be integrated in a processing unit, or each unit can exist physically alone, or two or more units can be integrated in one unit.
[0069] If the function is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, or this part of the technical solution, can be embodied in the form of a software product. The computer software product is stored in a storage medium and includes several instructions for causing a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods described in various embodiments of the present invention. The foregoing storage medium includes: USB flash drives, mobile hard disks, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical discs and other various media that can store program codes.
[0070] To make the above features and effects of the present invention more clearly and understandably described, specific embodiments are hereinafter given and detailed descriptions are made in conjunction with the accompanying drawings of the specification. This specification discloses one or more embodiments including the features of the present invention. The disclosed embodiments are only for illustrative purposes. The protection scope of the present invention is not limited to the disclosed embodiments, and the present invention is defined by the appended claims.
[0071] The present invention aims to propose a method for accurately predicting the passenger flow of urban rail transit. In particular, the prediction of passenger flow during holidays is crucial for improving the operation efficiency of the intelligent transportation system. How to dynamically model the complex spatio-temporal correlation of passenger flow is the key issue for achieving accurate passenger flow prediction during holidays. To solve this problem, the present invention proposes a short-term OD passenger flow prediction model DM-GCGRU during holidays under the encoder-decoder framework.
[0072] DM-GCGRU is a deep learning model that combines dynamic multi-scale graph convolution (Dynamic Multi-scale GCN) and gated recurrent unit (GRU), and is designed specifically for processing spatio-temporal sequence data (such as traffic flow, human action recognition). Its core goal is to simultaneously model spatial dependence (graph structure) and temporal dependence (sequence dynamics), and capture spatio-temporal features at different levels through a dynamic multi-scale mechanism.
[0073] The present invention intends to construct a practical and effective deep learning framework DM-GCGRU by means of GCN and GRU structures, and at the same time organically integrate the inbound passenger flow data, outbound passenger flow data, and OD data during holidays to fully study the impact of holidays on passenger flow changes, capture the complex spatio-temporal features of passenger flow dynamics, and improve the prediction accuracy of passenger flow during holidays while meeting the "real-time" requirement of short-term passenger flow prediction.
[0074] Specifically, the encoder of the present invention includes a graph construction module, a multi-source heterogeneous data fusion module, and a spatio-temporal dynamic graph convolution recurrent module, and the decoder is a spatio-temporal dynamic graph convolution recurrent module. At the same time, the model of the present invention adopts a pre-training method to improve the model feature encoding ability. In addition, the PINN loss function is used during the training of the model proposed by the present invention to calculate the prediction error between the predicted OD passenger flow matrix and the real OD passenger flow matrix. By using this method, physical quantity information is introduced. On the one hand, the prediction accuracy of the data-driven method is maintained, and at the same time, the interpretability of the model and the reliability of the prediction are improved. Experiments are carried out on the urban rail transit passenger flow dataset to verify the superiority of the present invention, which can provide an effective tool for predicting the passenger flow data of the urban rail transit system.
[0075] The following is a detailed description in conjunction with specific embodiments.
[0076] Embodiment 1
[0077] As Figure 1 shown Figure 1 This is a short-term OD prediction method for urban rail transit during holidays based on deep learning disclosed in an embodiment of the present invention. The technical solution of the present invention is divided into the following parts: First, define the scientific problem to be solved; secondly, propose a deep learning framework DM-GCGRU, and introduce in detail the graph construction module, multi-source heterogeneous data fusion module, and spatio-temporal dynamic graph convolution cycle module used in this framework. Finally, verify the prediction effect of the model on the Nanning holiday subway dataset in a specific embodiment, compare the prediction performance of the model proposed by the present invention with the prediction performance of common short-term passenger flow prediction models, and verify the accuracy of the model prediction and the rationality of the model structure.
[0078] A short-term OD prediction method for urban rail transit during holidays based on deep learning disclosed in an embodiment of the present invention, the method comprising:
[0079] Step 101, based on the historical data of the urban rail transit automatic fare collection system, obtain multi-source heterogeneous passenger flow data, wherein the multi-source heterogeneous passenger flow data includes: the road network topology structure of the urban rail transit network, the OD demand matrix, the real-time inbound passenger flow, and the outbound passenger flow sequence data;
[0080] Specifically, in a specific embodiment of the present invention, the problem definition includes the following:
[0081] The present invention aims to use historical AFC data (urban rail transit automatic fare collection system) and, with the help of a deep learning model, perform OD prediction for urban rail transit during holidays.
[0082] Definition 1 (Urban rail transit network): The present invention focuses on the prediction of OD demand between stations rather than a specific area. Define the rail transit network as G=(V, E, A), represent the area set as V×{v1, v2,..., v N}, where vi represents the i-th area, N represents the number of areas, E={e1, e2,..., e M} is the set of edges, M is the total number of edges, and the adjacency matrix is represented by A∈R N×N , which is a 0-1 matrix, where the relationship:
[0083]
[0084] Definition 2 (OD demand matrix): Extract the OD demand matrix X t , inbound passenger flow and outbound flow The extraction of this OD demand matrix only covers three aspects: the boarding time of passengers, the boarding station, and the alighting station. That is, the OD demand matrix is the number of passengers boarding at time t and alighting before the next time period, which is an incomplete OD demand matrix. The in-out passenger flow sequence is extracted according to the corresponding boarding station and boarding time, alighting station and alighting time. Where T represents all time periods of the time sequence, and t represents a certain intermediate time period. The specific representations of the OD demand matrix, inbound passenger flow, and outbound passenger flow are as follows:
[0085]
[0086] Among them, X t is the historical OD demand matrix, and is the travel demand from the origin area i to the destination area j at time t.
[0087]
[0088] Among them, is the real-time inbound passenger flow data, and is the inflow demand of area i at time t.
[0089]
[0090] Among them, is the real-time outbound passenger flow data, ——the outflow demand of area i at time t.
[0091] Objective equation: For the short-term OD flow prediction problem, existing methods often use the OD matrix of adjacent time periods as the input to predict the OD matrix for a future period of time. However, due to the influence of travel time, the real-time OD matrix cannot be obtained. Therefore, the present invention intends to combine the incomplete OD demand matrix with the time series data of the current train boarding and alighting flows and the rail transit map structure to predict the complete OD matrix for a future period of time and verify it. Therefore, the problems to be solved in this section are as follows:
[0092]
[0093] Among them, is the complete OD matrix predicted for the next time step in the future, [X t-k , …, X t is the OD demand matrix input for k time steps simultaneously, is the inbound passenger flow data, is the outbound passenger flow data, and G is the graph structure.
[0094] Step 102: Construct an OD prediction deep learning model. The OD prediction deep learning model includes an encoder and a decoder. The encoder includes a graph construction module, a multi-source heterogeneous data fusion module, and a spatio-temporal dynamic graph convolutional recurrent module. The decoder includes a spatio-temporal dynamic graph convolutional recurrent module. The above OD prediction deep learning model uses the deep learning model DM-GCGRU. Among them, the spatio-temporal dynamic graph convolutional recurrent module is stacked by multiple GRU modules embedded with GCN modules. The OD demand matrix is an incomplete OD demand matrix, and the incomplete OD demand matrix includes: the passenger's entry time, entry station, and exit station.
[0095] Specifically, in the specific embodiment of the present invention, the model structure includes:
[0096] The framework of the DM-GCGRU model is as Figure 2 shown. This model adopts an encoder-decoder structure. The encoder includes a graph construction module, a multi-source heterogeneous data fusion module, and a spatio-temporal dynamic graph convolutional recurrent module. The decoder is a spatio-temporal dynamic graph convolutional recurrent module. In order to improve the interpretability of the model and the reliability of prediction, the loss calculation module uses a Physics Informed Neural Network (PINN) loss function. First, input multi-source heterogeneous passenger flow data (including graph structure, OD demand matrix, entry passenger flow and exit passenger flow data) into the multi-source heterogeneous data fusion module for feature encoding. By fusing different passenger flow data, the low-dimensional representation is raised to a high-dimensional space, so that the fused output representation contains various passenger flow information. At the same time, use the OD passenger flow and road network topology map to construct a geographical location neighborhood graph and a station functional semantic graph in real time to master the changes in station functions during normal and holiday periods. Secondly, input the fused passenger flow features into the spatio-temporal dynamic graph convolutional recurrent module. This module is stacked by multiple GRU modules embedded with GCN, which is used to mine spatio-temporal correlation relationships and fuse the outputs of the two parts. Finally, input the hidden features output by the encoder into the decoder for decoding, complete the prediction of the OD matrix, and supervise the training of the model through the PINN loss function.
[0097] In addition, in order to improve the learning ability of sparse features, the model adopts a pre-training method. This operation is the training of the encoder, which can effectively handle problems such as low training efficiency and high complexity caused by the sparsity of the OD matrix, and enable the model to better learn diverse passenger flow information in the OD matrix during the encoding process. By performing a random masking operation on the original OD passenger flow matrix and using the encoder to recover the masked passenger flow, using the Mean-Squared Loss (MSE) function for backpropagation, and sharing the parameters of this part with the encoder implementation to improve the feature representation of the encoder.
[0098] Step 103: Input the multi-source heterogeneous passenger flow data into the encoder of the OD prediction deep learning model. The multi-source heterogeneous data fusion module performs feature encoding and outputs the fused passenger flow features. The graph construction module constructs the geographical location neighborhood graph and the station functional semantic graph. The spatio-temporal dynamic graph convolutional recurrent module mines the spatio-temporal correlation relationship between the output of the graph structure and the fused passenger flow features, and performs secondary fusion to output the passenger flow hidden features.
[0099] Step 104: Input the passenger flow hidden features into the decoder for decoding to complete the prediction of the complete OD demand matrix for a future period of time.
[0100] In the embodiment of the present invention, the above-mentioned multi-source heterogeneous data fusion module:
[0101] In urban rail transit, since the inbound passenger flow and outbound passenger flow can be obtained in real time while the real-time OD matrix demand cannot be obtained, the inbound and outbound passenger flows can supplement the incomplete OD demand matrix to make the real-time passenger flow distribution information complete. Therefore, real-time station inflow and outflow passenger flows are introduced in the input part to enhance the real-time nature of the passenger flow data. However, OD passenger flow, inbound passenger flow, and outbound passenger flow belong to heterogeneous data. If multiple sources of data are reasonably fused, two main problems are faced: the dimensionality difference and scale difference between heterogeneous data. Therefore, in the present invention, a multi-source heterogeneous data fusion module is designed as Figure 2 shown, which fuses multi-source heterogeneous data so that the fused output representation contains various passenger flow information, thereby supplementing the incomplete OD demand matrix.
[0102] As Figure 3 shown, the multi-source heterogeneous data fusion module: First, perform feature encoding on the multi-source heterogeneous data, namely the graph structure, OD demand matrix, real-time inbound and outbound passenger flow data, and raise the low-dimensional representation of the passenger flow to a high-dimensional space. Secondly, fuse the inbound and outbound passenger flows to generate pseudo-OD features, and then splice the pseudo-OD flow features onto the OD passenger flow features. Specifically, add each inbound feature and each outbound feature to generate pseudo-OD features.
[0103] However, the correlation between the inflow and outflow passenger flows in different regions is unknown. Directly adding the features will make the pseudo-OD features relatively dense and redundant. Therefore, in this section, the vector inner product is used to represent the correlation between different flows, as shown in formula (6):
[0104]
[0105] In addition, a correlation matrix is used to calculate the fusion weights between each inbound passenger flow and outbound passenger flow respectively, and the formula is as follows:
[0106] W in= softmax(Corr, dim = 0) (7)
[0107] W out = softmax(Corr, dim = 1) (8)
[0108] In the formula, W in is the inbound passenger flow fusion weight, and W out is the outbound passenger flow fusion weight.
[0109] Therefore, the pseudo-OD flow characteristics are redefined as:
[0110]
[0111] Finally, the pseudo-OD channel characteristics and OD passenger flow characteristics are concatenated, and the complete OD matrix is output through the fully connected layer:
[0112]
[0113] In the formula, —— The fused characteristics.
[0114] In the embodiment of the present invention, the above graph construction module is configured to execute the steps:
[0115] Construct a neighborhood graph, with stations or regions as nodes. Based on the road network topology structure of the urban rail transit network, edges are established between each region and its neighboring regions, and the association relationship between different regions is represented by the edges to form a neighborhood graph;
[0116] Construct a station functional semantic graph. For the input historical OD passenger flow data, calculate the Euclidean distance between the historical inbound and outbound passenger flow sequences respectively. Based on the inbound and outbound similarity matrices calculated from the Euclidean distance, use the K-nearest neighbor algorithm to construct a station inbound functional semantic graph and a station outbound functional semantic graph.
[0117] Specifically, the graph construction module in the embodiment of the present invention includes: Due to the complex spatial association between the origin and the destination, for example, commuting trips have relatively fixed travel OD, that is, there is a strong correlation between the traffic data of the two nodes O and D in the network. In addition, different origins or destinations may have implicit semantic information due to similar social functions or frequent mobile interactions. Therefore, the present invention introduces a graph structure to represent such complex associations. Considering the spatial correlation of OD flows during holidays, the influence of passenger flow similarity between neighboring stations and the dynamic semantic function correlation accompanied by the arrival of holiday vacations are respectively considered, and a graph construction module is designed to construct a neighborhood graph and a station functional semantic graph respectively, as Figure 4 shown.
[0118] 1) Neighborhood graph construction
[0119] Considering the geographical location relationship, the closer the distance between two areas, the more likely they are to have similar passenger flow patterns, and thus the greater the possibility of sharing similar historical mobility patterns. This type of association is called neighborhood similarity, and this neighborhood information is critical for spatial modeling. Therefore, a graph structure is constructed based on the traffic topology structure to aggregate spatial information. With stations or areas as nodes, based on the traffic topology structure, edges are established between each area as the center and the adjacent areas, and the association relationship between different areas is represented by the edges. Edges are established between adjacent areas to form a neighborhood graph. Therefore, the neighborhood graph G is constructed. a , the association matrix is A a ∈R N×N .
[0120] 2) Construction of site functional semantic graph
[0121] Due to the complex social functions of the departure and destination areas, some distant areas with high social function similarity or frequent mobile interactions can also share similar demand patterns, thus providing useful and unique information for messaging. Especially during holidays, the functionality of the area may also be affected due to the impact of holidays. For example, during the morning rush hour, some office areas lose their functionality, and some areas are converted from office areas to entertainment areas. In order to explore the real-time changes in site functionality, this module constructs a semantic space graph in real time. This operation will enrich the feature representation of OD passenger flow to a certain extent, thereby improving the accuracy of the prediction.
[0122] For the input historical OD passenger flow data X t ∈R N×N The Euclidean distance between each historical inflow and outflow passenger flow sequence is used to measure the semantic similarity. Formulas (11) and (12) show:
[0123]
[0124] In the formula: ED in,ij represents the Euclidean distance to the incoming station, ED out,ij Represents the Euclidean distance of the outflow station.
[0125] Finally, the K nearest neighbor algorithm (KNN, a non-parametric, supervised learning classifier that uses proximity to classify groups of single data points) is used on the inflow and outflow similarity matrices calculated by the above Euclidean distance to find the most similar K regions. Then, each semantic graph forms N edges to construct the station inflow function semantic graph G in,s and site outflow functional semantic graph G out,s , the dimension of the correlation matrix is N×N.
[0126] In the embodiments of the present invention, the above spatio-temporal dynamic convolution module is configured to execute the steps:
[0127] Based on the neighborhood graph, the functional semantic graph, and the fused passenger flow characteristics, use the graph convolutional neural network GCN model to construct the spatial association relationship;
[0128] Introduce the spatial graph convolutional neural network GCN into the GRU to construct the spatio-temporal correlation. Based on the spatial association relationship constructed by the GCN, use the activation function to calculate the update gate and the reset gate; based on the input at the current moment and the reset hidden passenger flow state, after modeling the spatial dependence through the spatial module, calculate the candidate state through the tanh activation function, and finally, calculate the hidden passenger flow characteristics at the current moment through the update gate.
[0129] Specifically, as Figure 5 shown, in the embodiments of the present invention, the spatio-temporal dynamic convolution module includes: There are complex spatial and temporal association relationships hidden between regions. For spatial dependence, the present invention considers using the graph convolutional neural network (GCN) model to construct the spatial association relationship. For temporal dependence, the present invention uses the gated recurrent unit (GRU) model to construct the temporal association relationship, and constructs the spatio-temporal association relationship based on the above models. The following is a detailed introduction:
[0130] 1) Construction of spatial association relationship
[0131] GCN can take into account the connection relationship between nodes and the local perception domain, use the adjacency matrix for feature propagation, and effectively model the local structure and proximity relationship of data in space, so as to realize the spatial modeling of graph structure data. The following is a detailed introduction to the model used in this section.
[0132] The degree matrix D of the graph is a diagonal matrix, indicating the number of edges connected to each node. The definition of the diagonal elements is shown in formula (13). Therefore, the Laplacian matrix is shown in formula (14). Furthermore, the normalized Laplacian matrix is shown in formula (15).
[0133]
[0134] L = D - A (14)
[0135]
[0136] First, define the normalized adjacency matrix However, the information of each node itself will be ignored. In order to add the information of itself to the adjacency matrix, its adjacency matrix can be defined as formula (16):
[0137]
[0138] Therefore, based on this adjacency matrix, it can also be regarded as a feature aggregation matrix. The feature propagation formula of GCN can be defined as in Equation (17):
[0139]
[0140] However, the OD matrix can be regarded as the two-dimensional coordinates of the origin and destination. The horizontal axis is the travel demand from one region to other regions, and the vertical axis is the travel demand from other regions to a certain region. In practical applications, this bilateral dependence is not necessarily equivalent at both the origin level and the destination level. To capture the special bilateral dependence therein, this chapter uses two-dimensional graph convolution to solve the bilateral spatial dependence. In addition, two different spatial correlations are mined in this chapter. Therefore, the formula for a complete layer of graph convolution in this chapter is shown in (18):
[0141]
[0142] In the formula: X l-1 is the hidden state of the (l-1)-th layer of the graph convolution layer, X l is the hidden state of the l-th layer of the graph convolution layer, D i is the degree matrix of the inflow graph structure when modeling bilateral dependence, D o is the degree matrix of the inflow graph structure, and W is the weight matrix.
[0143] 2) Construction of spatio-temporal correlation
[0144] To better integrate temporal and spatial dependencies, existing research has extended the graph convolutional network (GCN) into each GRU, enabling the neural network to capture both temporal features and spatial dependencies simultaneously. Therefore, this chapter introduces the spatial graph convolutional network (GCN) into GRU to capture spatio-temporal dependencies, as Figure 5 shown. Based on the hidden state and input at the current time step, GCN first models the spatial dependence. Then, the update gate and reset gate are calculated using the Sigmoid activation function, as shown in Equation (19):
[0145]
[0146] In the formula: is the passenger flow feature of the multi-source heterogeneous data fusion at time t, Ω t-1 is the hidden state at time t-1, u t , r t are the update gate and reset gate respectively.
[0147] Secondly, based on the input at the current moment and the reset hidden state, the spatial dependence is modeled through the spatial module, and then the candidate state is calculated through the tanh activation function, as shown in Equation (20):
[0148]
[0149] Finally, the output at the current moment is calculated through the update gate, as shown in Equation (21):
[0150] Ω t =(1 - u t )·Ω t-1 +u t · candi (21)
[0151] In the formula, Ω t is the hidden state at time t.
[0152] In the embodiments of the present invention, the above-mentioned short-term OD prediction method for urban rail transit based on deep learning further includes:
[0153] For the pre-training of the OD prediction deep learning model, MSE is used as the loss function to calculate the mean square error between the original OD demand matrix and the restored OD demand matrix;
[0154] For the OD prediction deep learning model, the PINN loss function is used during training to calculate the prediction error between the predicted OD demand matrix and the true OD demand matrix.
[0155] In the embodiments of the present invention, for the above-mentioned pre-training part, using MSE as the loss function to calculate the mean square error between the original OD demand matrix and the restored OD demand matrix, the steps include:
[0156] Input the multi-source heterogeneous data and the road network topology graph structure into the deep learning model DM-GCGRU. Randomly set some passenger flows in the OD demand matrix to zero, input the masked OD demand matrix and the complete inbound and outbound flows of the stations into the encoder, and perform spatio-temporal relationship modeling through a linear layer;
[0157] After numerically processing the high-dimensional features output by the encoding layer through the linear layer, predict the masked passenger flow part, calculate the MSE loss between the predicted value and the complete OD flow, and complete the pre-training.
[0158] Specifically, in the embodiments of the present invention, the training method includes:
[0159] As analyzed above, the passenger flow characteristics during holidays are special. Due to factors such as the diversity of passengers' travel modes and the uncertainty of travel purposes, the OD passenger flow of rail transit may show irregularity and instability, resulting in low or zero OD demand in some areas. This situation poses challenges to the modeling and prediction processes. At the same time, the generalization ability of the model will also be affected. Therefore, it is necessary to adopt appropriate processing strategies for sparse data to establish a model with strong generalization ability that can adapt to the data distribution characteristics at different time periods.
[0160] Based on this, the present invention proposes a pre-training method based on passenger flow masking to process the sparse characteristics of OD passenger flow, as Figure 6 shown. This module can perform random masking operations on the original OD passenger flow matrix, randomly covering some passenger flows in space (randomly setting the demand of some OD pairs to zero). Due to the randomness of the operation, the model's encoding part learns the covered passenger flows, thereby enhancing the model's learning ability for diverse OD passenger flow characteristics, especially for small passenger flows. Finally, the parameters obtained from the training are shared with the encoder, which can enhance the model's perception ability for sparse passenger flows.
[0161] Specifically, the model simultaneously inputs multi-source heterogeneous data and the road network topology structure. First, a graph structure is constructed using the complete OD passenger flow matrix and the road network topology. Then, some passenger flows in the OD matrix are randomly set to zero. The masked OD passenger flow matrix and the complete in-flow and out-flow of stations are input into the model, and through spatio-temporal relationship modeling, the formula is as follows:
[0162]
[0163] In the formula: Mask represents the masking operation, Encoder represents the encoding layer, Linear represents the linear layer, and X tpre represents the output passenger flow characteristics.
[0164] The linear layer reduces the high-dimensional feature representation output by the encoding layer to 1, then predicts the masked part of the passenger flow, and calculates the MSE loss between the predicted value and the complete OD flow to complete the training. The loss formula for this part is as follows:
[0165]
[0166] Finally, the parameters of this part are shared with the encoding layer parameters of the prediction part to improve the model's learning ability for sparse passenger flows during holidays.
[0167] In the embodiment of the present invention, the loss function is as follows:
[0168] For the pre-training part, taking MSE as the loss function, calculate the squared difference between the original OD passenger flow matrix and the restored OD passenger flow matrix, and the formula is expressed as:
[0169]
[0170] Wherein: is the true OD value, is the predicted OD value, and N is the number of stations.
[0171] For the encoder-decoder model framework, the PINN loss function is adopted during training to calculate the prediction error between the predicted OD passenger flow matrix and the true OD passenger flow matrix. As shown in formula (25), by using this method, physical quantity information is introduced. On the one hand, the prediction accuracy of the data-driven method is maintained, and at the same time, the interpretability of the model and the reliability of the prediction are improved.
[0172]
[0173] Based on this mechanism, this loss simultaneously incorporates the influence of OD passenger flow and inbound passenger flow information on the model, and uses different weights to balance the influence of different losses on the model. The formula is shown in formula (26):
[0174]
[0175] Wherein: is the true value, is the predicted value, is the real-time inbound flow sequence, W od is the influence weight of OD passenger flow, W in is the influence weight of inbound passenger flow.
[0176] In the embodiments of the present invention, the model evaluation includes:
[0177] The present invention verifies the prediction performance of DM-GCGRU on a real dataset. This part first introduces the dataset used in the research, then introduces the parameter settings and evaluation metrics of the model. Then, several conventional passenger flow prediction benchmark models selected in the research are introduced, and finally, the experimental results are analyzed from multiple perspectives.
[0178] Dataset
[0179] This experiment is based on the real AFC data of the urban rail transit system in Nanning, Guangxi Zhuang Autonomous Region, China. As shown in Table 1, the AFC data was collected from December 3, 2018 to January 6, 2019, and from December 2, 2019 to January 5, 2020, for a total of ten weeks of data. There were approximately 150,000 passengers per day. To ensure the accuracy of the prediction, the model only considered 41 consistent stations in different years, and the data span was from 06:00 to 23:00. Each record in Table 1 contains information such as passenger ID, entry / exit time, and entry / exit station. By processing the initial AFC data, the in-out flow data (taking the in-flow data at a 30-minute time granularity as an example in Table 2) and the OD passenger flow data (taking the OD passenger flow at a 30-minute time granularity as an example in Table 3) were obtained.
[0180] After analyzing the passenger flow change patterns during the New Year's Day holidays in 2019 and 2020, it was found that the changes generally showed a similar pattern. The passenger flow on December 31 increased significantly, and the passenger flow changes during the New Year's Day holidays were different from those on other characteristic days. Therefore, by further calculating the Pearson correlation coefficient between the passenger flows of different New Year's Day weeks, the similarity of the holiday patterns was measured. It was not difficult to find that the correlation coefficients between the passenger flows of the New Year's Day weeks in 2019 and 2020 were both greater than 0.7. This result indicates that there are similar patterns in the passenger flows of different New Year's Day weeks. Inspired by this observation, the present invention can better understand the overall trend of holiday passenger flow changes by using the continuous New Year's Day passenger flow. Therefore, the passenger flow data of the first nine weeks of the data set, including the passenger flow during the week where the 2019 New Year's Day holiday was located, was used to train and validate the model. The remaining data of the last week where the 2020 New Year's Day holiday was located was used to test the model. In this study, the time intervals of the data set were set to 15 minutes, 30 minutes, and 60 minutes respectively to study the prediction performance of the DM-GCGRU model in short-term OD flow prediction.
[0181] Table 1 Example of original AFC data
[0182]
[0183] Table 2 In-flow data
[0184]
[0185] Table 3 OD passenger flow data
[0186]
[0187] 1) Model configuration
[0188] This study conducted experiments on a desktop computer with the following configuration Core TMi9-10900X CPU, 32GB memory, and an NVIDIA GeForce RTX3050 GPU. The model is built using PyTorch.
[0189] Hyperparameters: In this experiment, a model is built using the PyTorch deep learning framework. The data from the first nine weeks is used for model training and validation, while the remaining data is used to test the model's performance. The input historical time step is 12, the batch size is 32, and the feature dimension of the hidden layer is uniformly set to 64. The learning rate is set to 0.01. The "Adam" optimizer is used.
[0190] Preprocessing: Before training, all data needs to be normalized. After obtaining the prediction results, they are inverse-normalized to the original scale range for result evaluation.
[0191] 2) Evaluation Metrics
[0192] In the present invention, the mean squared error MSE is used as the loss function for pre-training, as shown in Equation (24), and the PINN loss function is used as the loss function of the model, as shown in Equation (26). To evaluate the model performance, the root mean squared error RMSE, mean absolute error MAE, and weighted mean absolute percentage error WMAPE are used as evaluation metrics. Among them, for different time periods within a day, the metrics are calculated according to Equations (27)-(29):
[0193]
[0194] In the formula: is the true value, is the predicted value, t represents different time periods, and N represents the number of stations.
[0195] 3) Benchmark Model
[0196] To comprehensively evaluate the prediction performance of DM-GCGRU, this study will compare the prediction effects of DM-GCGRU and the benchmark model on the passenger flow dataset during the New Year's Day holiday in the Nanning Metro. The details of the benchmark model are described as follows:
[0197] MLP: Multilayer Perceptron. The simplest deep neural network, which has been used for flow prediction and consists of multiple layers of neurons in a feed-forward manner. In the experiment, three fully connected layers are used, and the input OD matrix sequence is reshaped into a new input vector by flattening each matrix and connecting them in chronological order. Dimension transformation is performed in the time dimension, successively as 12-64-128-1.
[0198] GCN: Construct a neural network consisting of two layers of graph convolutional networks and a fully connected layer. It can be applied to OD demand prediction to extract the spatial relationships between irregular regions in the city. The learning rate is 0.0001, the batch size is 32, and the feature dimension of the hidden layer is 64.
[0199] GRU: Gated Recurrent Unit. The most basic recurrent neural network with a gating mechanism to model the temporal dependencies of time series data. The learning rate is 0.0001, the batch size is 32, and the feature dimension of the hidden layer is 64.
[0200] DCRNN: Diffusion Convolutional Recurrent Neural Network, a deep learning model for traffic flow prediction. This model uses bidirectional random walks on the graph to capture spatial correlations and adopts a predefined sampled encoder-decoder architecture to capture temporal correlations. The input graph structure is a neighborhood graph. The learning rate is 0.0001, the batch size is 32, and the feature dimension of the hidden layer is 64.
[0201] GWN: A new type of graph neural network. It learns a new adaptive dependency matrix through node embedding to capture explicit or hidden spatial dependencies and adopts stacked extended one-dimensional convolutional components to learn long-term temporal dependencies. The learning rate is 0.0001, the batch size is 32, and the feature dimension of the hidden layer is 64.
[0202] TGCN: Temporal Graph Convolutional Network. Integrate the graph convolutional network into the gated recurrent unit (GRU) to model the spatial correlations between the road network topology and stations. The input graph structure is a neighborhood graph. The learning rate is 0.0001, the batch size is 32, and the feature dimension of the hidden layer is 64.
[0203] STGCN: Spatio-Temporal Graph Convolutional Network. Integrate graph convolution and gated temporal convolution in multiple convolutional blocks. In each block, two temporal gated convolutional layers are used to capture temporal dynamics, and one graph convolutional layer is used to capture spatial correlations. The input graph structure is a neighborhood graph. The learning rate is 0.0001, the batch size is 32, and the feature dimension of the hidden layer is 64.
[0204] 4) Result Analysis
[0205] a. Comparison of Short-Term OD Traffic Prediction Performance during Holidays
[0206] Tables 4 to 6 and Figure 7a 、 Figure 7b 、 Figure 7cThe performance comparison of DM-GCGRU and other methods is shown respectively under different prediction time granularities during the holiday period in Nanning, Guangxi Zhuang Autonomous Region. The bold results in the table are the optimal results. According to the experimental results, it is observed that DM-GCGRU achieves the best performance. The lowest RMSE values in the datasets with three time granularities of 15 min, 30 min, and 60 min are 4.4745, 8.4603, and 15.7570 respectively, the MAE values are 2.0626, 3.6147, and 6.6075 respectively, and the WMAPE values are 0.4554, 0.3995, and 0.3787 respectively.
[0207] Table 4 Model effects under the 15-min time granularity
[0208]
[0209] Continued Table 4
[0210]
[0211]
[0212] Table 5 Model effects under the 30-min time granularity
[0213]
[0214] Table 6 Model effects under the 60-min time granularity
[0215]
[0216] Continued Table 6
[0217]
[0218] b. Prediction performance of a single OD pair
[0219] To evaluate the performance of the model for different OD pairs at different time granularities, in this subsection, the comparison and fitting graphs of the real and predicted values of the passenger flow for each time period in the datasets with three time granularities of 15 min, 30 min, and 60 min are shown. It can be found from Figure 8a , Figure 8b , Figure 8c that DM-GCGRU can fit the real values well on different datasets. Two different OD pairs are selected in the article for comparison, and the specific analysis is as follows:
[0220] OD_1 (Fengling - Jinhu Square) shows the passenger flow characteristics of morning and evening rush hours on weekdays. During the morning rush hour, passengers usually travel from their residences to workplaces or schools. Therefore, the OD has a relatively large inflow of passenger flow to the station. During the evening rush hour, people usually return from workplaces or schools to their residences, and the OD has a relatively large outflow of passenger flow to the station. It can be seen that except during holidays, the OD passenger flow on weekdays shows a certain periodicity. During holiday periods, the travel time of residents is more randomized, losing the morning and evening rush hour characteristics of weekdays, and the passenger flow of commuting stations may be more randomly distributed.
[0221] OD_2 (Chaoyang Square - Qingchuan) As a transfer station, Chaoyang Square does not show obvious commuting characteristics (morning and evening rush hour characteristics), but the OD pairs of transfer stations usually show more flow exchangeability, that is, passengers transfer at this station. Therefore, the inflow and outflow of passengers during the morning and evening rush hours are relatively balanced, while ordinary stations may have obvious inflow or outflow directions. Also, since there is no obvious morning and evening rush hour during holidays, the passenger flow of transfer stations may be more evenly distributed throughout the day, not similar to the characteristics on weekdays that are concentrated in the morning and afternoon. The travel purposes of residents are more diverse, possibly for traveling to scenic spots, visiting relatives and friends, participating in activities, etc., resulting in a richer range of destinations involved in the OD pairs of transfer stations, and the passenger flow distribution will also change accordingly.
[0222] Finally, from December 30, 2019 to January 5, 2020, December 31, January 1, and January 2 showed passenger flow characteristics different from weekdays, with the largest passenger flow fluctuations on the 31st and a relatively large number of travelers. In summary, from the visualization graphs of the true values and predicted values, it can be seen that in various situations, DM - GCGRU can make good predictions for both stable OD demands and OD demands with large fluctuations, and performs well on datasets with different time granularities.
[0223] c. Ablation experiment research
[0224] To further analyze the impact of different components of DM - GCGRU on the model's prediction performance, this section conducts ablation experiments on the Nanning Metro dataset.
[0225] 1) w / o In - bound / Out - bound Passenger Flow: The input of in - bound and out - bound passenger flows is deleted, and the multi - source heterogeneous data fusion module is removed. Only incomplete real - time OD demand data is used for prediction.
[0226] 2) w / o Dynamic Semantic Map: The input for constructing the dynamic semantic map structure is deleted, and only the static adjacency map is used to model spatial relevance.
[0227] 3) w / o PINN - based Passenger Flow Loss: The PINN - based passenger flow loss function is deleted, and MSE is used as the loss function.
[0228] 4) Without pre-training, the pre-trained part of the model is removed.
[0229] As shown in the following table, through ablation experiments, it is proved that the module proposed in this chapter makes an effective contribution to the overall method.
[0230] Table 7 Ablation experiments of the model under 15-minute time granularity
[0231]
[0232] Table 8 Ablation experiments of the model under 30-minute time granularity
[0233]
[0234] Table 9 Ablation experiments of the model under 60-minute time granularity
[0235]
[0236] The results show that the multi-source heterogeneous data fusion module, graph construction, loss function, and pre-training mechanism proposed by this model play an important role in the prediction process, proving that 1) fusing real-time inbound and outbound flow sequences with OD matrices can provide real-time information. 2) Dynamic graph construction takes into account the real-time changing spatial characteristics of passenger flow during holidays and can effectively capture the complex spatial correlation of OD demand in real time. 3) Using the PINN loss function takes into account the relationship between the OD demand matrix and inbound passenger flow, improving the interpretability and reliability of the model. 4) Using pre-training can effectively enhance the feature learning ability of encoding, thus overcoming the problem of sparse OD demand matrices.
[0237] It can be seen from the result discussion part of the technical solution that the DM-GCGRU proposed by the present invention has an obvious effect on improving the prediction accuracy of passenger flow during holidays. Whether in the experimental research of the dataset or in the ablation experimental research, the prediction effect of the model proposed in this study is the best. Next, based on Tables 4, 5, and 6 in the technical solution, the three evaluation indicators are described separately.
[0238] For RMSE, under the 15-minute granularity, the prediction index compared with the currently optimal prediction model decreased from 4.7793 to 4.4745; under the 30-minute granularity, the prediction index decreased from 8.6922 to 8.4603; under the 60-minute granularity, the prediction index decreased from 17.2724 to 15.7570, with an average improvement of 8.75%.
[0239] For MAE, compared with the current optimal prediction model, the prediction index decreases from 2.1613 to 2.0626 at a 15-minute granularity; at a 30-minute granularity, the prediction index decreases from 3.7753 to 3.6147; at a 60-minute granularity, the prediction index decreases from 7.1428 to 6.6075, with an average improvement of 5.47%.
[0240] For WMAPE, compared with the current optimal prediction model, the prediction index decreases from 0.4772 to 0.4554 at a 10-minute granularity; at a 30-minute granularity, the prediction index decreases from 0.4172 to 0.3995; at a 60-minute granularity, the prediction index decreases from 0.4094 to 0.3787, with an average improvement of 5.44%.
[0241] Combined with the prediction results, it can be seen that DM-GCGRU effectively improves the accuracy of passenger flow prediction during holidays and can be used to guide engineering practice.
[0242] Example Two
[0243] As Figure 9 shown, the embodiment of the present application provides a short-term OD prediction system for urban rail transit during holidays based on deep learning. Using the short-term OD prediction method for urban rail transit during holidays based on deep learning as described above, the system includes:
[0244] Passenger flow data collection module 201: Based on the historical data of the urban rail transit automatic fare collection system, multi-source heterogeneous passenger flow data is obtained. Among them, the multi-source heterogeneous passenger flow data includes: the road network topology structure of the urban rail transit network, the OD demand matrix, and the real-time inbound and outbound passenger flow sequence data;
[0245] Deep learning model construction module 202: Construct an OD prediction deep learning model. Among them, the OD prediction deep learning model includes an encoder and a decoder. The encoder includes a graph construction module, a multi-source heterogeneous data fusion module, and a spatio-temporal dynamic graph convolutional recurrent module. The decoder includes a spatio-temporal dynamic graph convolutional recurrent module;
[0246] Encoding module 203: Input the multi-source heterogeneous passenger flow data into the encoder of the OD prediction deep learning model. The multi-source heterogeneous data fusion module performs feature encoding and outputs the fused passenger flow features; the graph construction module constructs a geographical location neighborhood graph and a station function semantic graph; the spatio-temporal dynamic graph convolutional recurrent module mines the spatio-temporal correlation relationship between the output of the graph structure and the fused passenger flow features and performs secondary fusion to output the passenger flow hidden features;
[0247] Decoding module 204: Input the passenger flow hidden features into the decoder for decoding to complete the prediction of the complete OD demand matrix for a future period of time.
[0248] Embodiment III
[0249] An embodiment of the present application provides a computer-readable storage medium, on which a computer program is stored. When the program is executed by a processor, the steps of the above-mentioned short-term OD prediction method for urban rail transit during holidays based on deep learning are implemented.
[0250] Embodiment IV
[0251] An embodiment of the present application provides an electronic device, including a memory, a processor, and a computer program stored on the memory and executable on the processor. When the processor executes the program, the steps of the above-mentioned short-term OD prediction method for urban rail transit during holidays based on deep learning are implemented.
[0252] In addition, the short-term OD prediction method for urban rail transit during holidays based on deep learning described in conjunction with Figure 1 the embodiments of the present application can be implemented by an electronic device, such as a computer device. Figure 10 FIG. is a schematic hardware structure diagram of a computer device according to an embodiment of the present application.
[0253] In some of these embodiments, the computer device may further include a communication interface 83 and a bus 80. Among them, as Figure 10 shown, the processor 81, the memory 82, and the communication interface 83 are connected through the bus 80 and complete communication with each other.
[0254] Specifically, the above-mentioned processor 81 may include a central processing unit (CPU), or an application specific integrated circuit (ASIC), or one or more integrated circuits configured to implement the embodiments of the present application.
[0255] The memory 82 can be used to store or cache various data files required for processing and / or communication, as well as possible computer program instructions executed by the processor 81.
[0256] The processor 81 reads and executes the computer program instructions stored in the memory 82 to implement any one of the short-term OD prediction methods for urban rail transit during holidays based on deep learning in the above embodiments.
[0257] The technical features of the above embodiments can be combined arbitrarily. For the sake of brevity of description, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, it should be considered to be within the scope described in this specification.
[0258] The above-described embodiments merely represent several implementation manners of the present application. The description thereof is relatively specific and detailed, but it should not be construed as a limitation to the scope of the invention patent. It should be noted that for those of ordinary skill in the art, without departing from the concept of the present application, several modifications and improvements can still be made, and these all fall within the protection scope of the present application. Therefore, the protection scope of the patent of the present application shall be subject to the appended claims.
Claims
1. A short-term OD prediction method for urban rail transit during holidays based on deep learning, characterized in that The method includes: Based on the historical data of the urban rail transit automatic fare collection system, multi-source heterogeneous passenger flow data is obtained. Among them, the multi-source heterogeneous passenger flow data includes: the road network topology structure of the urban rail transit network, the OD demand matrix, the real-time inbound passenger flow and outbound passenger flow sequence data; An OD prediction deep learning model is constructed. Among them, the OD prediction deep learning model includes an encoder and a decoder. The encoder includes a graph construction module, a multi-source heterogeneous data fusion module, and a spatio-temporal dynamic graph convolutional recurrent module. The decoder includes a spatio-temporal dynamic graph convolutional recurrent module; The multi-source heterogeneous passenger flow data is input into the encoder of the OD prediction deep learning model, and feature encoding is performed through the multi-source heterogeneous data fusion module, and the fused passenger flow features are output; the graph construction module constructs a geographical location neighborhood graph and a station function semantic graph; the spatio-temporal dynamic graph convolutional recurrent module mines the spatio-temporal correlation relationship between the output of the graph structure and the fused passenger flow features, and performs re-fusion to output the passenger flow hidden features; The passenger flow hidden features are input into the decoder for decoding to complete the prediction of the complete OD demand matrix for a future period of time.
2. The short-term OD prediction method for urban rail transit during holidays based on deep learning according to claim 1, wherein The method further includes: For the pre-training of the OD prediction deep learning model, MSE is used as the loss function to calculate the mean square error between the original OD demand matrix and the restored OD demand matrix; For the OD prediction deep learning model, the PINN loss function is used during training to calculate the prediction error between the predicted OD demand matrix and the real OD demand matrix.
3. The short-term OD prediction method for urban rail transit during holidays based on deep learning according to claim 1 or 2, characterized in that The OD prediction deep learning model uses the deep learning model DM-GCGRU. Among them, the spatio-temporal dynamic graph convolutional recurrent module is stacked by multiple GRU modules embedded with GCN modules; the OD demand matrix is an incomplete OD demand matrix, and the incomplete OD demand matrix includes: the inbound time of passengers, the inbound station and the outbound station.
4. The short-term OD prediction method for urban rail transit during holidays based on deep learning according to claim 3, wherein The multi-source heterogeneous data fusion module is configured to perform the steps of: Perform feature encoding on the multi-source heterogeneous data, and raise the low-dimensional representation of the inbound or outbound passenger flow to a high-dimensional space; Use the vector inner product to represent the correlation between the real-time inbound flow and the outbound flow, and use the correlation matrix to calculate the fusion weights between each inbound passenger flow and outbound passenger flow respectively. Based on the fusion weights, the inbound and outbound passenger flows are fused to generate pseudo-OD features; The pseudo-OD features are concatenated with the OD passenger flow features, and the complete OD demand matrix is output through a fully connected layer.
5. The short-term OD prediction method for urban rail transit during holidays based on deep learning according to claim 3, characterized in that The graph construction module is configured to perform the steps of: Construct a neighborhood graph, with stations or regions as nodes. Based on the road network topology structure of the urban rail transit network, edges are established between each region and adjacent regions with each region as the center, and the edges represent the association relationship between different regions to form a neighborhood graph; Construct a station function semantic graph. For the input historical OD passenger flow data, calculate the Euclidean distance between the historical inflow and outflow passenger flow sequences respectively. Use the K-nearest neighbor algorithm based on the inflow and outflow similarity matrix calculated based on the Euclidean distance to construct a station inflow function semantic graph and a station outflow function semantic graph.
6. The short-term OD prediction method for urban rail transit during holidays based on deep learning according to claim 5, wherein The spatio-temporal dynamic convolution module is configured to perform the steps of: Based on the neighborhood graph, the functional semantic graph, and the fused passenger flow characteristics, use a graph convolutional neural network (GCN) model to construct spatial association relationships; Introduce the spatial graph convolutional neural network (GCN) into the GRU to construct spatio-temporal correlations. Based on the spatial association relationships constructed by the GCN, use activation functions to calculate the update gate and the reset gate; based on the input at the current moment and the reset hidden passenger flow state, after modeling the spatial dependence through the spatial module, calculate the candidate state through the tanh activation function, and finally, calculate the hidden passenger flow characteristics at the current moment through the update gate.
7. The short-term OD prediction method for urban rail transit during holidays based on deep learning according to claim 3, wherein For the pre-training part, use the MSE as the loss function to calculate the mean square error between the original OD demand matrix and the restored OD demand matrix. The steps include: Input the multi-source heterogeneous data and the road network topology graph structure into the deep learning model DM-GCGRU. Randomly set to zero some of the passenger flows in the OD demand matrix. Input the masked OD demand matrix and the complete in-station and out-station flows of the stations into the encoder, and perform spatio-temporal relationship modeling through a linear layer; After the linear layer numerically processes the high-dimensional features output by the encoding layer, predict the masked part of the passenger flow, calculate the MSE loss between the predicted value and the complete OD flow, and complete the pre-training.
8. A short-term OD prediction system for urban rail transit during holidays based on deep learning, which adopts the short-term OD prediction method for urban rail transit during holidays based on deep learning described in any one of claims 1-7, characterized in that, The system includes: Passenger flow data acquisition module: Based on the historical data of the urban rail transit automatic fare collection system, obtain multi-source heterogeneous passenger flow data. Among them, the multi-source heterogeneous passenger flow data includes: the road network topology graph structure of the urban rail transit network, the OD demand matrix, the real-time in-station passenger flow, and the out-station passenger flow sequence data; Deep learning model construction module: Construct an OD prediction deep learning model. Among them, the OD prediction deep learning model includes an encoder and a decoder. The encoder includes a graph construction module, a multi-source heterogeneous data fusion module, and a spatio-temporal dynamic graph convolutional recurrent module. The decoder includes a spatio-temporal dynamic graph convolutional recurrent module; Encoding module: Input the multi-source heterogeneous passenger flow data into the encoder of the OD prediction deep learning model. The multi-source heterogeneous data fusion module performs feature encoding and outputs the fused passenger flow characteristics; the graph construction module constructs a geographical location neighborhood graph and a station functional semantic graph; the spatio-temporal dynamic graph convolutional recurrent module mines the spatio-temporal association relationships between the output of the graph structure and the fused passenger flow characteristics, and performs re-fusion to output the passenger flow hidden characteristics; Decoding module: Input the passenger flow hidden characteristics into the decoder for decoding to complete the prediction of the complete OD demand matrix for a future period of time.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the program is executed by a processor, it implements the steps of the deep learning-based short-term OD prediction method for urban rail transit during holidays as described in any one of claims 1-7.
10. An electronic device, comprising a memory, a processor, and a computer program stored on the memory and executable on the processor, characterized in that, When the processor executes the program, it implements the steps of the deep learning-based short-term OD prediction method for urban rail transit during holidays as described in any one of claims 1 to 7.
Citation Information
Cited By
Human activity intensity prediction method based on generalized spatial heterogeneity learning
CN121436040A
Human activity intensity prediction method based on generalized spatial heterogeneity learning
CN121436040B