Subway station passenger flow prediction method considering multi-factor event influence
Through the deep learning model combining LSTM and attention mechanism, the historical data of subway passenger flow and external factors are integrated, which solves the problem of difficult to effectively consider complex factors in the existing technology, and significantly improves the passenger flow prediction accuracy.
Patent Information
- Application Number
- CN202411760487.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-03
- Publication Date
- 2025-03-18
AI Technical Summary
When predicting subway passenger flow, it is difficult for the prior art to effectively consider complex factors such as weather changes, temperature fluctuations and holiday effects, resulting in limited prediction accuracy.
A deep learning model is adopted, combining long and short-term memory network (LSTM) and attention mechanism, a multi-branch fusion model is designed, the subway passenger flow historical data and external factors are integrated, a comprehensive input matrix is constructed, and adaptive prediction is performed.
It significantly improves the accuracy of passenger flow prediction, can be applied in multiple scenarios, and its effectiveness is verified through actual data.
Smart Images

Figure CN119646399A_ABST
Abstract
Description
Technical Field
[0001] The invention belongs to the field of intelligent transportation technology, and in particular relates to a subway station passenger flow prediction method considering the influence of multi-factor events. Background Art
[0002] With the acceleration of urbanization, subways have become an important public transportation tool in large cities. Accurately predicting subway passenger flow is of great significance for traffic management, operation scheduling, and passenger services.
[0003] At present, traditional passenger flow forecasting methods mostly rely on time series analysis or simple regression models. Although these methods have achieved basic predictions, they are insufficiently responsive to changes in passenger flow caused by complex factors (such as weather changes, temperature fluctuations, holiday effects, etc.), and their prediction accuracy is limited. Summary of the invention
[0004] In view of this, the present invention aims to propose a subway station passenger flow prediction method which takes into account the influence of multiple factors and events. By introducing a deep learning model to comprehensively analyze the influence of factors such as weather, temperature, holidays, etc., the accuracy of passenger flow prediction can be significantly improved.
[0005] To achieve the above object, the technical solution of the present invention is achieved as follows:
[0006] The subway station passenger flow prediction method considering the impact of multiple factors and events includes:
[0007] Integrate historical subway passenger flow data with external factors, and clean, align and standardize the data;
[0008] Based on the processed data, the temporal, spatial and external influence characteristics are extracted to construct a comprehensive input matrix, while at the same time enhancing the historical patterns and dynamic change characteristics;
[0009] Using the input matrix generated by feature engineering, we design a multi-branch fusion model that combines long short-term memory networks with attention mechanisms;
[0010] Ensure efficient model convergence during training by using improved loss functions, dynamic learning rate strategies, and model interpretability analysis;
[0011] Use the trained model combined with real-time updated external factors to make adaptive predictions, and verify the applicability and prediction effect of the model in multiple scenarios through actual data.
[0012] Furthermore, the historical data of subway passenger flow and external factors include:
[0013] Subway passenger flow data: extract historical passenger flow data from the subway ticketing system, divide it into time granularity, and record the number of inbound and outbound passengers in each period;
[0014] External influence data: collect weather data, holiday data, and other potential influencing factors;
[0015] The weather data includes temperature, precipitation, wind speed and weather type, and the holiday data includes public holidays and special events.
[0016] Furthermore, based on the processed data, the time, space and external influence characteristics are extracted to construct a comprehensive input matrix, and at the same time, the historical patterns and dynamic change characteristics are enhanced, including:
[0017] Construct the time feature matrix Pt, including short-term dependency and long-term dependency features:
[0018] P t ={x t-24 , x t-168};
[0019] Among them, x t-24 represents the passenger flow at the same time of the previous day; x t-168 Indicates the passenger flow at the same time of the previous week;
[0020] Combine weather and holiday data to construct the external feature matrix Wt:
[0021] W t ={T t , R t , V t , H t};
[0022] in,
[0023] T t Indicates the temperature of the current period;
[0024] R t Indicates the precipitation in the current period;
[0025] V t Indicates the wind speed in the current period;
[0026] H t Indicates the holiday status of the current period;
[0027] Construct the comprehensive input matrix Xt through the sliding window technique:
[0028] X t ={x t-k+1 , x t-k+2 , ..., x t , P t , W t};
[0029] Among them, k represents the sliding window size and indicates the length of the historical time series included.
[0030] Furthermore, the input matrix generated by feature engineering is used to design a multi-branch fusion model combining long short-term memory network and attention mechanism, including:
[0031] Use LSTM to extract the time series features of the input matrix Xt:
[0032] h t =LSTM(X t );
[0033] Among them, h t Represents the time series feature vector at the current moment;
[0034] The external feature matrix Wt is processed through a fully connected network to generate an embedded feature vector Ft′:
[0035] F′ t =σ(W f W t +b f );
[0036] Among them, W f , b f represents the weight and bias parameters of the external feature branch; σ represents the activation function;
[0037] Dynamically calculate the weights αi of time series features:
[0038]
[0039] Among them, α i represents the weight coefficient of the i-th time step; W a , b a Represents the weight and bias parameters of the attention mechanism;
[0040] Fusion of time series and external features:
[0041]
[0042] Among them, h′ t Represents the fused feature vector, which contains time series information and the influence of external factors;
[0043] Generate passenger flow forecasts for future time periods through a fully connected network:
[0044]
[0045] Among them, the predicted passenger flow in the t+k period, W o , b oRepresents the weights and bias parameters of the output layer.
[0046] Furthermore, by using an improved loss function, a dynamic learning rate strategy, and model interpretability analysis, the model is ensured to converge efficiently during training, including:
[0047] An improved mean square error loss function with dynamic weights is introduced to improve adaptability to special scenarios:
[0048]
[0049] Among them, y i is the actual passenger flow; To predict passenger flow;
[0050] w i It is a dynamic weight, which is related to characteristics such as holidays and peak periods:
[0051]
[0052] Furthermore, the trained model is combined with external factors updated in real time to perform adaptive prediction, and the applicability and prediction effect of the model in multiple scenarios are verified through actual data, including:
[0053] Used to measure the squared error between the predicted value and the true value:
[0054]
[0055] It is used to measure the average percentage error of the predicted value relative to the true value:
[0056]
[0057] Furthermore, the present solution discloses an electronic device, including a processor and a memory that is communicatively connected to the processor and is used to store executable instructions of the processor, wherein the processor is used to execute a method for predicting passenger flow in a subway station that takes into account the impact of multiple factors.
[0058] Furthermore, the present solution discloses a server comprising at least one processor and a memory communicatively connected to the processor, wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the processor so that the at least one processor executes a method for predicting passenger flow in a subway station taking into account the impact of multiple factors.
[0059] Furthermore, the present solution discloses a computer-readable storage medium storing a computer program, which, when executed by a processor, implements a method for predicting passenger flow at a subway station that takes into account the impact of multiple events.
[0060] Compared with the prior art, the subway station passenger flow prediction method considering the impact of multiple factors and events described in the present invention has the following beneficial effects:
[0061] The subway station passenger flow prediction method considering the impact of multiple events described in the present invention significantly improves the accuracy of passenger flow prediction by introducing a deep learning model to comprehensively analyze the impact of factors such as weather, temperature, and holidays. BRIEF DESCRIPTION OF THE DRAWINGS
[0062] The accompanying drawings constituting a part of the present invention are used to provide a further understanding of the present invention. The exemplary embodiments of the present invention and their descriptions are used to explain the present invention and do not constitute an improper limitation of the present invention. In the accompanying drawings:
[0063] Figure 1 This is a schematic diagram of a subway station passenger flow prediction method considering the impact of multiple events according to an embodiment of the present invention. DETAILED DESCRIPTION
[0064] It should be noted that, in the absence of conflict, the embodiments of the present invention and the features in the embodiments may be combined with each other.
[0065] The present invention will be described in detail below with reference to the accompanying drawings and in conjunction with embodiments.
[0066] Integrate historical subway passenger flow data with external factors, and clean, align and standardize the data;
[0067] Based on the processed data, the temporal, spatial and external influence characteristics are extracted to construct a comprehensive input matrix, while at the same time enhancing the historical patterns and dynamic change characteristics;
[0068] Using the input matrix generated by feature engineering, we design a multi-branch fusion model that combines long short-term memory networks with attention mechanisms;
[0069] Ensure efficient model convergence during training by using improved loss functions, dynamic learning rate strategies, and model interpretability analysis;
[0070] Use the trained model combined with real-time updated external factors to make adaptive predictions, and verify the applicability and prediction effect of the model in multiple scenarios through actual data.
[0071] Furthermore, the historical data of subway passenger flow and external factors include:
[0072] Subway passenger flow data: extract historical passenger flow data from the subway ticketing system, divide it into time granularity, and record the number of inbound and outbound passengers in each period;
[0073] External influence data: collect weather data, holiday data, and other potential influencing factors;
[0074] The weather data includes temperature, precipitation, wind speed and weather type, and the holiday data includes public holidays and special events.
[0075] Furthermore, based on the processed data, the time, space and external influence characteristics are extracted to construct a comprehensive input matrix, and at the same time, the historical patterns and dynamic change characteristics are enhanced, including:
[0076] Construct the time feature matrix Pt, including short-term dependency and long-term dependency features:
[0077] P t ={x t-24 , x t-168};
[0078] Among them, x t-24 represents the passenger flow at the same time of the previous day; x t-168 Indicates the passenger flow at the same time of the previous week;
[0079] Combine weather and holiday data to construct the external feature matrix Wt:
[0080] W t ={T t , R t , V t , H t};
[0081] in,
[0082] T t Indicates the temperature of the current period;
[0083] R t Indicates the precipitation in the current period;
[0084] V i Indicates the wind speed in the current period;
[0085] H t Indicates the holiday status of the current period;
[0086] Construct the comprehensive input matrix Xt through the sliding window technique:
[0087] X t ={x t-k+1 , x t-k+2 , ..., x t , P t , W t};
[0088] Among them, k represents the sliding window size and indicates the length of the historical time series included.
[0089] Furthermore, the input matrix generated by feature engineering is used to design a multi-branch fusion model combining long short-term memory network and attention mechanism, including:
[0090] Use LSTM to extract the time series features of the input matrix Xt:
[0091] h t =LSTM(X t );
[0092] Among them, h t Represents the time series feature vector at the current moment;
[0093] The external feature matrix Wt is processed through a fully connected network to generate an embedded feature vector Ft′:
[0094] F′ t =σ(W f W t +b f );
[0095] Among them, E f 、b f represents the weight and bias parameters of the external feature branch; σ represents the activation function;
[0096] Dynamically calculate the weight αi of time series features:
[0097]
[0098] Among them, α i represents the weight coefficient of the i-th time step; W a 、b a Represents the weight and bias parameters of the attention mechanism;
[0099] Fusion of time series and external features:
[0100]
[0101] Among them, h′ t Represents the fused feature vector, which contains time series information and the influence of external factors;
[0102] Generate passenger flow forecasts for future time periods through a fully connected network:
[0103]
[0104] Among them, the predicted passenger flow in the t+k period, W o 、b o Represents the weights and bias parameters of the output layer.
[0105] Furthermore, by using an improved loss function, a dynamic learning rate strategy, and model interpretability analysis, the model is ensured to converge efficiently during training, including:
[0106] An improved mean square error loss function with dynamic weights is introduced to improve adaptability to special scenarios:
[0107]
[0108] Among them, y i is the actual passenger flow; To predict passenger flow;
[0109] w i It is a dynamic weight, which is related to characteristics such as holidays and peak periods:
[0110]
[0111] Furthermore, the trained model is combined with external factors updated in real time to perform adaptive prediction, and the applicability and prediction effect of the model in multiple scenarios are verified through actual data, including:
[0112] Used to measure the squared error between the predicted value and the true value:
[0113]
[0114] It is used to measure the average percentage error of the predicted value relative to the true value:
[0115]
[0116] Those of ordinary skill in the art will appreciate that the units and method steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described in terms of function in the above description. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the present invention.
[0117] In the several embodiments provided in the present application, it should be understood that the disclosed methods and systems can be implemented in other ways. For example, the division of the units described above is only a logical function division, and there may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. The above-mentioned units may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the embodiments of the present invention.
[0118] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or replace some or all of the technical features therein by equivalents. These modifications or replacements do not make the essence of the corresponding technical solutions deviate from the scope of the technical solutions of the embodiments of the present invention, and they should all be included in the scope of the claims and specification of the present invention.
[0119] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principle of the present invention should be included in the protection scope of the present invention.
Claims
1. A subway station passenger flow prediction method considering the impact of multiple events, characterized in that: include: Integrate historical data of subway passenger flow with external factors and pre-process the data; Based on the processed data, the temporal, spatial and external influence characteristics are extracted to construct a comprehensive input matrix, while at the same time enhancing the historical patterns and dynamic change characteristics; Using the input matrix generated by feature engineering, we design a multi-branch fusion model that combines long short-term memory networks with attention mechanisms; Ensure efficient model convergence during training by using improved loss functions, dynamic learning rate strategies, and model interpretability analysis; Use the trained model combined with real-time updated external factors to make adaptive predictions, and verify the applicability and prediction effect of the model in multiple scenarios through actual data.
2. The subway station passenger flow prediction method considering the influence of multiple factors according to claim 1 is characterized in that: The historical data and external factors of subway passenger flow include: Subway passenger flow data: extract historical passenger flow data from the subway ticketing system, divide it into time granularity, and record the number of inbound and outbound passengers in each period; External influence data: collect weather data, holiday data, and other potential influencing factors; The weather data includes temperature, precipitation, wind speed and weather type, and the holiday data includes public holidays and special events.
3. The subway station passenger flow prediction method considering the influence of multiple factors according to claim 1 is characterized in that: Based on the processed data, the time, space and external influence characteristics are extracted to construct a comprehensive input matrix, while enhancing the historical patterns and dynamic change characteristics, including: Construct the time feature matrix Pt, including short-term dependency and long-term dependency features: P t ={x t-24 ,x t-168 }; Among them, x t-24 represents the passenger flow at the same time of the previous day; x t-168 Indicates the passenger flow at the same time of the previous week; Combine weather and holiday data to construct the external feature matrix Wt: W t ={T t ,R t ,V t ,H t }; in, T t Indicates the temperature of the current period; R t Indicates the precipitation in the current period; V t Indicates the wind speed in the current period; H t Indicates the holiday status of the current period; Construct the comprehensive input matrix Xt through the sliding window technique: X t ={x t-k+1 ,x t-k+2 ,...,x t ,P t ,W t }; Among them, k represents the sliding window size and indicates the length of the historical time series included.
4. The subway station passenger flow prediction method considering the influence of multiple factors according to claim 1 is characterized in that: The input matrix generated by feature engineering is used to design a multi-branch fusion model combining long short-term memory network and attention mechanism, including: Use LSTM to extract the time series features of the input matrix Xt: h t =LSTM(X t ); Among them, h t Represents the time series feature vector at the current moment; The external feature matrix Wt is processed through a fully connected network to generate an embedded feature vector Ft′: F′ t =σ(W f W t +b f ); Among them, W f 、b f represents the weight and bias parameters of the external feature branch; σ represents the activation function; Dynamically calculate the weights αi of time series features: e i =tanh(W a h t +b a ); Among them, α i represents the weight coefficient of the i-th time step; W a 、b a Represents the weight and bias parameters of the attention mechanism; Fusion of time series and external features: Among them, h′ t Represents the fused feature vector, which contains time series information and the influence of external factors; Generate passenger flow forecasts for future time periods through a fully connected network: Among them, the predicted passenger flow in the t+k period, W o 、b o Represents the weights and bias parameters of the output layer.
5. The subway station passenger flow prediction method considering the influence of multiple factors according to claim 1 is characterized in that: The improved loss function, dynamic learning rate strategy and model interpretability analysis are used to ensure efficient convergence of the model during training, including: An improved mean square error loss function with dynamic weights is introduced to improve adaptability to special scenarios: Among them, y i is the actual passenger flow; To predict passenger flow; w i It is a dynamic weight, which is related to characteristics such as holidays and peak periods:
6. The subway station passenger flow prediction method considering the influence of multiple factors according to claim 1 is characterized in that: The method uses the trained model combined with external factors updated in real time to make adaptive predictions, and verifies the applicability and prediction effect of the model in multiple scenarios through actual data, including: Used to measure the squared error between the predicted value and the true value: It is used to measure the average percentage error of the predicted value relative to the true value:
7. An electronic device, comprising a processor and a memory connected to the processor for storing instructions executable by the processor, characterized in that: The processor is used to execute the subway station passenger flow prediction method considering the influence of multiple factors as described in any one of claims 1-6 above.
8. A server, characterized in that: It includes at least one processor and a memory communicatively connected to the processor, wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the processor so that the at least one processor executes the subway station passenger flow prediction method considering the influence of multiple factors as described in any one of claims 1-6.
9. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the method for predicting passenger flow at a subway station taking into account the influence of multiple events as described in any one of claims 1 to 6 is implemented.
Citation Information
Cited By
Subway ventilation demand dynamic decision-making method and system fused with people flow prediction
CN120106616A