Rail transit multi-scale short-time passenger flow prediction method considering passenger flow external characteristics, electronic equipment and computer readable storage medium
Through a multi-scale short-term passenger flow prediction method that considers the external characteristics of passenger flow, and uses VMD and IPSO algorithms to optimize the LSTM model, it solves the problem of insufficient accuracy and adaptability of traditional models when processing complex passenger flow data, and achieves higher prediction accuracy. sex and adaptability.
Patent Information
- Application Number
- CN202410825492.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-25
- Publication Date
- 2025-01-24
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
When traditional rail transit short-term passenger flow prediction models deal with complex, unstable and nonlinear passenger flow data, it is difficult to effectively capture the impact of external features and sparse data, resulting in insufficient prediction accuracy and adaptability.
This paper proposes a multi-scale short-term passenger flow prediction method that considers the external characteristics of passenger flow. By acquiring multi-scale rail transit data, feature screening and normalization processing is performed, and the variational mode decomposition (VMD) algorithm is used to decompose the passenger flow data, combined with particle swarm The optimization (IPSO) algorithm optimizes the hyperparameters of the LSTM model and fuses multiple branch prediction data through the fully connected layer to generate short-term passenger flow prediction results.
It significantly improves the predictive accuracy and adaptability of the model. Compared with the traditional model, the average performance indicators at 45 minutes of time granularity, MAE, RMSE, and MAPE have reduced 140.645, 192.905, 7.479, respectively. Essence
Smart Images

Figure CN119357809A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of passenger flow prediction, and specifically relates to a multi-scale short-term passenger flow prediction method for rail transit taking into account external characteristics of passenger flow, an electronic device and a computer-readable storage medium. Background Art
[0002] With the increase in urbanization and the further development of high-speed rail networks, cities are becoming more closely connected. Especially during public holidays, peak tourist seasons or major events, high-speed rail stations will see a sharp increase in passenger flow. Accurately predicting the passenger flow in and out of high-speed rail stations in the short term is crucial to improving operational efficiency and resource allocation. However, due to the complexity, instability and nonlinearity of passenger flow data itself, traditional prediction models are difficult to effectively cope with this rapidly changing passenger flow situation. The main challenges currently faced by traditional prediction models are:
[0003] (1) Fusion and analysis of heterogeneous data: The prediction model first needs to deal with the heterogeneity of passenger flow data at high-speed railway passenger stations. The model will integrate data from multiple sources, such as ticket sales data, entry and exit records, special event calendars, and climate conditions. Traditional prediction models are difficult to incorporate key factors that affect passenger flow and are severely affected by noise, resulting in information loss.
[0004] (2) Processing and optimization of sparse data: Given the sparsity of large-scale passenger flow prediction data in time series, the ability of traditional prediction models to identify sparse samples needs to be improved.
[0005] (3) Mining of nonlinear trends and cyclical patterns: The prediction model needs to effectively capture the nonlinear trends and cyclical patterns in passenger flow data. Traditional prediction models are difficult to effectively capture future and past information at the same time, and it is difficult to provide a comprehensive time frame for time series prediction.
[0006] (4) Real-time and adaptability: The real-time and adaptability of traditional prediction models are poor. Traditional prediction models do not have online learning and real-time data update mechanisms and cannot automatically adjust internal parameters to adapt to new passenger flow data.
[0007] Therefore, improving the adaptability of short-term passenger flow prediction models in complex scenarios is an urgent problem to be solved. Summary of the invention
[0008] The purpose of the present invention is to overcome the shortcomings of the prior art and provide a multi-scale short-term passenger flow prediction method for rail transit that takes into account the external characteristics of passenger flow. The passenger flow prediction method of the present invention has the advantages of high accuracy, strong adaptability and good real-time performance, and can provide a scientific basis for the operation management and decision-making of high-speed railways, thereby effectively improving transportation efficiency and passenger satisfaction.
[0009] The first object of the present invention is to provide a multi-scale short-term passenger flow prediction method for rail transit considering external characteristics of passenger flow, comprising the following steps:
[0010] S1. Obtain multi-scale data of rail transit;
[0011] S2, feature screening is performed on the multi-scale rail transit data obtained in step S1 to obtain key factors related to short-term in-and-out passenger flow;
[0012] S3: normalize the key factors obtained in step S2 and the multi-scale rail transit data in step S1 to obtain normalized passenger flow entry and exit data
[0013] S4: The normalized passenger flow entry and exit data obtained in step S3 Decompose into k components And reconstruct the decomposed k components to obtain the reconstructed passenger flow time series
[0014] S5: Reconstruct the passenger flow time series obtained in step S4 As the input of the IPSO-LSTM prediction model, the output is multi-dimensional prediction data with multiple branches and different feature dimensions;
[0015] S6. The multiple branch prediction data obtained in step S5 are integrated through a fully connected layer to obtain a short-term passenger flow prediction result.
[0016] Preferably, in step S1, the rail transit multi-scale data includes train number, departure date and time, departure station, destination station, boarding station and alighting station information.
[0017] Preferably, step S2 comprises the following steps:
[0018] S21, performing Spearman correlation analysis on the multi-scale rail transit data obtained in step S1 and the passenger flow of high-speed railway passenger stations to obtain key factors related to the passenger flow of high-speed railway passenger stations;
[0019] S22. Perform a Spearman correlation analysis on the key factors obtained in step S21 and the short-term passenger flow of rail transit to obtain the key factors related to the short-term passenger flow of in-and-out stations.
[0020] Preferably, step S3 comprises the following steps:
[0021] S31, performing Spearman correlation analysis on the key factors obtained in step S2 to obtain influencing factors with significant correlation, and classifying the rail transit multi-scale data obtained in step S1 according to different time granularities to obtain classified data, and fusing the influencing factors and the classified data to obtain fused data;
[0022] S32, the fused data obtained in step S31 is supplemented with missing values by linear interpolation to obtain data to be processed, and the calculation formula for the missing value supplement is:
[0023]
[0024] Among them, (x1, y1) and (x2, y2) are two known data points;
[0025] S33: normalize the data to be processed obtained in step S32 to obtain normalized passenger flow entry and exit data The calculation formula for normalization is:
[0026]
[0027] Among them, X is the data to be processed, X min is the minimum value in the data to be processed, X max is the maximum value of the data to be processed. It is the normalized passenger entry and exit data.
[0028] Preferably, step S4 comprises the following steps:
[0029] S41, the normalized passenger flow entry and exit data obtained in step S3 Perform Hibert operation on each subsequence in to obtain the one-sided spectrum of each subsequence. The calculation formula for the one-sided spectrum of each subsequence is:
[0030]
[0031] Among them, δ(t) is the pulse function, is a subsequence of the original data, is the imaginary part, t is the independent variable;
[0032] S42, compare the one-sided spectrum of each subsequence obtained in step S41 with Multiply them together to get the baseband of each subsequence. The baseband calculation formula is:
[0033]
[0034] in, is the exponential mixing demodulation center frequency, δ(t) is the pulse function, is a subsequence of the original data, is the imaginary part, t is the independent variable;
[0035] S43, solving the baseband bandwidth of each subsequence obtained in step S42 to obtain a constrained variational model, the expression of the constrained variational model is as follows:
[0036]
[0037] in, is the short-term passenger flow sequence to be predicted, is the original passenger flow data, is the symbol of partial derivative, is the exponential mixing demodulation center frequency, δ(t) is the pulse function, is a subsequence of the original data, is the imaginary part, t is the independent variable;
[0038] S44, solving the constrained variational model obtained in step S43 to obtain an unconstrained variational model, the expression of the unconstrained variational model is as follows:
[0039]
[0040] in, is the short-term passenger flow sequence to be predicted, is the symbol of partial derivative, is the exponential mixing demodulation center frequency, δ(t) is the pulse function, is a subsequence of the original data, is the imaginary part, t is the independent variable, is the original data sequence, ω k is the center frequency corresponding to each mode, α is the quadratic penalty factor λ(t) is the Lagrangian operator;
[0041] S45, in the unconstrained variational model obtained in step S44 ω k and λ are updated to obtain the optimal solution of the unconstrained variational model. ω k The update expressions of and λ are as follows:
[0042]
[0043] in, They are Fourier transform of λ(ω), where ω is the frequency, τ is the update parameter of the Lagrange multiplier, and c is the number of iterations;
[0044] S46: Determine whether the optimal solution of the unconstrained variational model obtained in step S45 satisfies the loop termination condition. If so, terminate the loop and obtain k components. Otherwise, step S45 is repeated until the loop termination condition is met, and the loop termination condition is:
[0045]
[0046] Among them, ζ is the convergence threshold, is the value of the initial signal at the c+1th update in the mth iteration, is the value of the initial signal at the cth update during the mth iteration.
[0047] S47, k components obtained in step S46 Reconstructed by adding components to obtain the reconstructed passenger flow time series
[0048] Preferably, in step S5, the IPSO-LSTM prediction model is constructed by the following method:
[0049] S51, setting the initial particle state, initializing the particle parameters, particle position and velocity, obtaining the initial parameters of the LSTM model, inputting the original passenger flow data into the LSTM model, training the LSTM model, and obtaining a trained LSTM model;
[0050] S52, calculating the fitness value of the particle according to the trained LSTM model obtained in step S51 to obtain the fitness value of the particle;
[0051] S53, according to the fitness value of the particle obtained in step S52, compare the ratio Q of the particle to the average fitness value of all particles in the group and the average value δ of the particle's D-dimensional information;
[0052] If Q>δ, strategy 2 is used to update the particle position. If Q<δ, strategy 1 is used to update the particle position. pbest and gbest are updated according to the updated particle positions. If the iteration termination condition is met, the optimal hyperparameters of the LSTM model are determined, that is, the IPSO-LSTM prediction model is obtained. If the iteration termination condition is not met, return to step S51 and retrain the LSTM model.
[0053] Preferably, in step S53, the formulas of strategy 1 and strategy 2 are:
[0054]
[0055] Among them, Q iis the ratio of the current particle to the average fitness value of all particles in the group, δ is the average value of the D-dimensional information of each particle, is the position of the particle at the t+1th iteration, is the position of the particle at the tth iteration, is the velocity of the particle at the t+1th iteration, and ω is the inertia weight.
[0056] The update formula for updating pbest and gbest according to the updated particle position is:
[0057]
[0058] in, and are the velocity and position of the particle at the tth iteration respectively. If the problem solution space is D-dimensional, then ω is the inertia weight, c1 and c2 are learning factors, r1 and r2 are random numbers, and r1∈[0,1], r2∈[0,1], pbest is the optimal solution in the current population, gbest is the optimal solution in the entire population, and becomes the global optimal value. and are the velocity and position of the particle at the t+1th iteration respectively.
[0059] Preferably, step S6 comprises the following steps:
[0060] S61, connecting the multiple branch prediction data obtained in step S5 into comprehensive data;
[0061] S62: Input the comprehensive data obtained in step S61 into the fully connected layer for feature fusion and conversion processing to obtain a short-term passenger flow prediction result.
[0062] A second object of the present invention is to provide an electronic device, comprising:
[0063] at least one processor; and,
[0064] a memory communicatively connected to the at least one processor; wherein,
[0065] The memory stores a computer program that can be executed by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute the above-mentioned multi-scale short-term passenger flow prediction method for rail transit considering external characteristics of passenger flow.
[0066] The third object of the present invention is to provide a computer-readable storage medium storing a computer program, characterized in that when the computer program is executed by a processor, it implements the above-mentioned multi-scale short-term passenger flow prediction method for rail transit that takes into account external characteristics of passenger flow.
[0067] Compared with the prior art, the present invention has the following beneficial effects:
[0068] The multi-scale short-term passenger flow prediction method for rail transit considering the external characteristics of passenger flow provided by the present invention is to screen and re-encode the external feature data, and input it into the prediction framework together with the time series data. Thereby, the prediction accuracy and applicability of the model for complex scenarios are significantly improved. Taking the prediction of 45min time granularity as an example, the average performance indicators of the model in the three time periods are compared with ConvLSTM, and the MAE, RMSE and MAPE are reduced by 140.645, 192.905 and 7.479 respectively, and the R2 index is improved by 6.25%. Compared with the traditional single prediction model or combined model, the prediction model in the present invention is designed by the original data decomposition method based on the VMD method, the extraction of external features of passenger flow data and the One-Hot encoding method, and the global feature extraction and integration capabilities are enhanced by the fully connected layer, which significantly improves the prediction ability of the model. It is superior to the traditional single prediction model or combined model in multiple evaluation indicators, has good prediction ability, and can better cope with the short-term passenger flow prediction needs in complex scenarios. BRIEF DESCRIPTION OF THE DRAWINGS
[0069] Figure 1 A framework diagram of a multi-scale short-term passenger flow prediction model for rail transit that takes into account external characteristics of passenger flow, provided in an embodiment of the present invention;
[0070] Figure 2 A flowchart of a multi-scale short-term passenger flow prediction method for rail transit considering external characteristics of passenger flow provided by an embodiment of the present invention;
[0071] Figure 3 This is the LSTM network structure diagram;
[0072] Figure 4 This is a schematic diagram of a railway bureau's passenger dedicated line;
[0073] Figure 5 This is a graph showing the original passenger flow data for Station A;
[0074] Figure 6 This is a graph showing the original passenger flow data for Station H;
[0075] Figure 7 This is a display of the original passenger flow data of Station J;
[0076] Figure 8 This is a graph showing the original passenger flow data for Station L;
[0077] Fig. 9 This is the Spearman correlation coefficient matrix diagram before screening;
[0078] Fig.10 This is the Spearman correlation coefficient matrix diagram after screening;
[0079] Fig.11 This is the decomposition result of VMD on the passenger flow data from station A to station D;
[0080] Fig.12 This is the decomposition result of VMD on the passenger flow data from station E to station H;
[0081] Fig.13 A comparison chart of the predicted value and the actual value for each time period of each day in a week;
[0082] Fig.14 Deviation analysis diagram of one-step prediction effect for each model;
[0083] Fig.15 Deviation analysis diagram of the three-step prediction effect of each model;
[0084] Fig.16 Deviation analysis diagram of the five-step prediction effect of each model; DETAILED DESCRIPTION
[0085] The following is a description of the embodiments of the present invention. Figures 1 to 16 , the technical solutions in the embodiments of the present invention are clearly and completely described. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of them. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0086] Example 1
[0087] like Figure 1 and Figure 2 As shown, an embodiment of the present invention provides a method for predicting short-term passenger flow at multiple scales in rail transit considering external characteristics of passenger flow, which specifically includes the following steps:
[0088] S1. Obtain multi-scale data of rail transit;
[0089] The rail transit multi-scale data includes train number, departure date and time, departure station, destination station, boarding station and alighting station information.
[0090] S2. Feature screening is performed on the multi-scale rail transit data obtained in step S1 to obtain key factors related to short-term inbound and outbound passenger flow, which specifically includes the following steps:
[0091] S21, performing Spearman correlation analysis on the multi-scale rail transit data obtained in step S1 and the passenger flow of high-speed railway passenger stations to obtain key factors related to the passenger flow of high-speed railway passenger stations;
[0092] S22. Perform a Spearman correlation analysis on the key factors obtained in step S21 and the short-term passenger flow of rail transit to obtain the key factors related to the short-term passenger flow of in-and-out stations.
[0093] S3: normalize the key factors obtained in step S2 and the multi-scale rail transit data in step S1 to obtain normalized passenger flow entry and exit data The specific steps include:
[0094] S31, performing Spearman correlation analysis on the key factors obtained in step S2 to obtain influencing factors with significant correlation, and classifying the rail transit multi-scale data obtained in step S1 according to different time granularities to obtain classified data, and fusing the influencing factors and the classified data to obtain fused data;
[0095] S32. In data collection, missing values usually occur, which may affect the accuracy of subsequent analysis. The fused data obtained in step S31 is supplemented with missing values by linear interpolation to obtain data to be processed. The calculation formula for the missing value supplement is:
[0096]
[0097] Among them, (x1, y1) and (x2, y2) are two known data points;
[0098] S33, normalization processing refers to scaling the data to the same scale to eliminate the influence of different feature magnitudes. The present invention uses minimum-maximum normalization to scale the data to be processed obtained in step S32 to the interval [0,1] to obtain normalized passenger flow entry and exit data The calculation formula for normalization is:
[0099]
[0100] Among them, X is the data to be processed, X min is the minimum value in the data to be processed, X max is the maximum value of the data to be processed. It is the normalized passenger entry and exit data.
[0101] S4: The normalized passenger flow entry and exit data obtained in step S3 Decompose into k components And reconstruct the decomposed k components to obtain the reconstructed passenger flow time series
[0102] Since rail transit passenger flow is nonlinear and non-stationary, the signal decomposition method can be used to decompose railway passenger flow data into multiple stationary sequences, thereby effectively extracting features from the original passenger flow data. The VMD algorithm has significant advantages in processing non-stationary time series, and can identify and extract different frequency components in the signal, thereby significantly enhancing the ability to identify and analyze signal fluctuation characteristics. The present invention uses the VMD algorithm to convert the normalized passenger flow entry and exit data into station data. Decompose into k components That is, multiple modal functions IMF1 m For example, IMF1 m The frequencies contained in are all closely distributed around ω1, and the remaining modal function components are all closely distributed around their respective center frequencies.
[0103] Step S4 specifically includes the following steps:
[0104] S41, the normalized passenger flow entry and exit data obtained in step S3 Perform Hibert operation on each subsequence in to obtain the one-sided spectrum of each subsequence. The calculation formula for the one-sided spectrum of each subsequence is:
[0105]
[0106] Among them, δ(t) is the pulse function, is a subsequence of the original data, is the imaginary part, inversely proportional to t, t is the independent variable;
[0107] S42, compare the one-sided spectrum of each subsequence obtained in step S41 with Multiply them together to get the baseband of each subsequence. The baseband calculation formula is:
[0108]
[0109] in, is the exponential mixing demodulation center frequency, δ(t) is the pulse function, is a subsequence of the original data, is the imaginary part, inversely proportional to t, t is the independent variable;
[0110] S43. Solving the gradient of L 2 norm, and then for each obtained in step S42 The bandwidth of the baseband of the subsequence is solved to obtain the constrained variational model. The expression of the constrained variational model is as follows:
[0111]
[0112] in, is the short-term passenger flow sequence to be predicted, is the original passenger flow data, is the symbol of partial derivative, is the exponential mixing demodulation center frequency, δ(t) is the pulse function, is a subsequence of the original data, is the imaginary part, inversely proportional to t, t is the independent variable;
[0113] S44. In order to correctly solve the model in step S43, consider introducing the Lagrangian operator and the quadratic penalty factor, converting the problem in step S43 into an unconstrained problem, solving the constrained variational model obtained in step S43, and obtaining an unconstrained variational model. The expression of the unconstrained variational model is as follows:
[0114]
[0115] in, is the short-term passenger flow sequence to be predicted, is the symbol of partial derivative, is the exponential mixing demodulation center frequency, δ(t) is the pulse function, is a subsequence of the original data, is the imaginary part, t is the independent variable, is the original data sequence, ω k is the center frequency corresponding to each mode, α is the quadratic penalty factor λ(t) is the Lagrangian operator;
[0116] S45, solve the saddle point in Step 4, and calculate the unconstrained variational model obtained in step S44. ω k and λ are updated to obtain the optimal solution of the unconstrained variational model. ω k The update expressions of and λ are as follows:
[0117]
[0118]
[0119] in, They are Fourier transform of λ(ω), where ω is the frequency, τ is the update parameter of the Lagrange multiplier, and c is the number of iterations;
[0120] S46: Determine whether the optimal solution of the unconstrained variational model obtained in step S45 satisfies the loop termination condition. If so, terminate the loop and obtain k components. Otherwise, step S45 is repeated until the loop termination condition is met, and the loop termination condition is:
[0121]
[0122] Among them, ζ is the convergence threshold, is the value of the initial signal at the c+1th update in the mth iteration, is the value of the initial signal at the cth update during the mth iteration.
[0123] S47, after VMD decomposition, normalized passenger flow in and out data Decomposed into k IMF components, namely It is necessary to reconstruct the above IMF components, and for the k components obtained in step S46 Reconstruction is performed by adding components, that is, Get the reconstructed passenger flow time series
[0124] S5: Reconstruct the passenger flow time series obtained in step S4 As the input of the IPSO-LSTM prediction model, multiple branch prediction data with different feature dimensions are output;
[0125] The LSTM model improves the hidden layer of the recurrent neural network (RNN). At the same time, in order to effectively connect adjacent units, LSTM introduces the concept of time series, which effectively solves the problem of low prediction accuracy caused by the vanishing gradient of RNN. It is effective in dealing with short-term passenger flow prediction problems with long time intervals. In order to realize the transmission of information from early cells to later cells, LSTM adds a gate structure based on RNN. By reasonably setting the forget gate f t , input gate I t and output gate O t parameters to achieve selective retention of information in related sequences and complete information modification and transmission of the current cell.
[0126] The function of the forget gate is to decide whether to accept or reject relevant information by identifying the previous hidden layer state h t–1 With the current input x t , update the cell state variable C t-1 Information in C t-1 The value range is 0-1, 1 means "keep all", 0 means "discard all", expressed as:
[0127] f t =σ(W f ×[h t-1 ,x t ]+b f )
[0128] The function of the input gate is to generate a new generation of feasible solutions and determine the information that needs to be saved, so as to update the current cell state. Secondly, the sigmoid layer is used to receive input information and control its update; the tan layer is used to process the input information and generate new feasible values; finally, the dot product of the two layer outputs is calculated and C t-1 Add the dot product result of the output gate to update the cell state and get the current latest cell state C t .
[0129] i t =σ(W f ×[h t-1 ,x t ]+b i )
[0130] c t ′=tan(W c ×[h t-1 ,x t ]+b c )
[0131] c t =f t ×c t-1 +i t ×c t '
[0132] The function of the output gate is to give the state value of the adjacent hidden layer, sigmoid is used to decide the selection of key information in the cell, input the tan layer for operation, and compare the processing result with the output of the output gate. t Perform point-by-point multiplication to finally obtain the network output h t-1 , expressed as:
[0133] o t =σ(W o ×[h t-1 ,x]+b o )
[0134] h t =o t ×tan(c t )
[0135] In the above formula, tan is the tangent function, σ is the activation function of sigmoid, and W f , W i , W o are the weight matrices of the forget gate, input gate, and output gate respectively. f , b i , b o , b eis the bias vector of the forget gate, input gate, output gate, and cell state unit. The LSTM cell structure is as follows Figure 3 shown.
[0136] The IPSO-LSTM prediction model is constructed by the following method:
[0137] S51, set the initial particle state, initialize the particle parameters, particle position and speed, obtain the initial parameters of the LSTM model, input the original passenger flow data into the LSTM model, train the LSTM model, and obtain a trained LSTM model; the particle parameters include the particle group size N, the maximum number of iterations T, the particle dimension D, and the position range of each dimension [X min ,X max ], speed range in each dimension [V min ,V max ], inertia weight ω, individual learning factor c1, social learning factor c2, etc.;
[0138] Define the structure of the LSTM network, specifically including the number of nodes in the input layer, hidden layer (LSTM layer) and output layer. The architecture design of the LSTM network should fully consider the characteristics of time series data and task requirements, and ensure that the number of units and layers in the hidden layer can effectively capture the time series dependencies of the data. When initializing the model parameters, including the weight matrix and the bias vector, the present invention adopts a random initialization method to ensure the stability and convergence of the model training. During the training process, the training data is input into the LSTM model through forward propagation. The input data first passes through the input layer and then passes to the LSTM units in the hidden layer. These units use memory cells and gating mechanisms (input gates, forget gates, output gates) to process and store the time series information to capture the long-term dependencies in the data. The output of the hidden layer is then passed to the output layer to generate the final prediction result.
[0139] S52, calculating the fitness value of the particle according to the trained LSTM model obtained in step S51 to obtain the fitness value of the particle;
[0140] Each particle represents a LSTM model parameter combination, and the fitness function is used to evaluate the performance of these parameter combinations. The present invention uses mean square error (MSE) as a loss function for loss calculation. When calculating the fitness value, the parameter vector of each particle is decoded into the parameters of the LSTM model, and the LSTM model is trained with these parameters, and predictions are made on the test set. The error between the prediction result and the true value is calculated, and finally the fitness value of the particle is calculated according to the fitness function;
[0141] S53, according to the fitness value of the particle obtained in step S52, compare the ratio Q of the particle to the average fitness value of all particles in the group and the average value δ of the particle's D-dimensional information;
[0142] If Q>δ, strategy 2 is used to update the particle position. If Q<δ, strategy 1 is used to update the particle position. pbest and gbest are updated according to the updated particle position. If the iteration termination condition is met, the best hyperparameters of the LSTM model are determined, that is, the IPSO-LSTM prediction model is obtained. If the iteration termination condition is not met, return to step S51 to retrain the LSTM model.
[0143] Particle Swarm Optimization (PSO) is a swarm intelligence algorithm that simulates social behavior. Its basic concept is derived from the foraging behavior of bird flocks. In this algorithm, each "particle" represents a potential solution in the solution space and adjusts its flight trajectory by following the current individual and group optimal solutions. In the particle swarm algorithm, the velocity v of particle i is i and position x i The update formula is as follows:
[0144]
[0145] in, and are the position and velocity of the example at the tth iteration respectively. If the problem solution space is D-dimensional, then ω is the inertia weight, c1 and c2 are learning factors, r1 and r2 are random numbers, and r1∈[0,1], r2∈[0,1], pbest is the optimal solution in the current population, gbest is the optimal solution in the entire population, and becomes the global optimal value. and are the velocity and position of the particle at the t+1th iteration respectively.
[0146] Existing studies have shown that traditional particle swarm optimization may encounter problems such as slow convergence and falling into local optimal solutions during the search process. In order to overcome these limitations and improve the search efficiency of the algorithm and the quality of the solution, the present invention introduces an improved particle swarm optimization algorithm (Improved Particle Swarm Optimization, IPSO). The core of the IPSO algorithm is to optimize the dynamic adjustment mechanism, realize the dynamic adjustment of the inertia weight ω and the learning factors c1 and c2, so that the particles are updated more accurately in speed and direction, thereby speeding up the search process of the global optimal solution and improving the search efficiency of the particle swarm algorithm. The present invention improves the traditional PSO algorithm as follows:
[0147] (1) Levi flight optimization strategy
[0148] Levy flight is a random exploration method that combines short-range search with occasional long-range search, thus showing good global exploration performance. In order to improve the exploration efficiency of the particle swarm algorithm, this chapter introduces a gbest adjustment mechanism combined with Levy flight. This mechanism enhances the algorithm's search ability by enabling the particle swarm to randomly wander and explore new areas. The gbest adjustment method that integrates the Levy flight optimization strategy is:
[0149]
[0150] Levy(λ)~μ=t -λ (1<λ<3)
[0151] Among them: gbest′ is the adjusted global optimal value, is point-to-point multiplication, α is the parameter for controlling the step size, Levy (λ) is the random search path, and μ is the scale parameter used to adjust the degree of scaling.
[0152] (2) Dynamic inertia weight strategy
[0153] In the particle swarm optimization algorithm, the dynamic adjustment of the parameter ω is crucial to the performance of the algorithm. This chapter uses a nonlinear decreasing strategy to achieve dynamic optimization of the inertia weight ω, so that the algorithm can effectively take into account both global search and local search. The calculation formula of ω is as follows:
[0154]
[0155] Among them, T max is the maximum number of iterations set for the algorithm, t is the number of iterations currently executed, ω max is the maximum inertia weight, ω min is the minimum inertia weight.
[0156] (3) Dynamic Learning Factor Strategy
[0157] In addition to the above factors, the learning factor also has a significant impact on the optimization performance of particles. In view of this, this chapter adopts a dynamic learning factor strategy to replace the fixed learning factor in the traditional PSO algorithm. The update strategy of the dynamic learning factor is as follows:
[0158]
[0159] Among them, c 1max and c 1min are the maximum and minimum values of the learning factor c1, c 2max and c 2min is the maximum and minimum value of the learning factor c2, T maxis the maximum number of iterations set for the algorithm, and t is the number of iterations currently executed.
[0160] In addition, the present invention introduces the concept of average dimensional information, adaptive judgment conditions, and adaptive position update strategies based on the segmentation method of x=x+v (hereinafter referred to as strategy one) and x=ωx+(1-ω)v (hereinafter referred to as strategy two). This method further improves the search ability of particles by adjusting the speed and position update method of particles, enhances their local search accuracy and global search breadth in the search space, and thus improves the optimization efficiency and quality. The formula is as follows:
[0161]
[0162]
[0163] Among them, δ is the average value of the D-dimensional information of each particle, Q i is the ratio of the current particle to the average fitness value of all particles in the group, and f(*) is the average fitness value of the particle. In summary, the update formula of particle position and velocity in the IPSO algorithm is:
[0164]
[0165] Among them, Q i is the ratio of the current particle to the average fitness value of all particles in the group, δ is the average value of the D-dimensional information of each particle, is the position of the particle at the t+1th iteration, is the position of the particle at the tth iteration, is the velocity of the particle at the t+1th iteration, ω is the inertia weight, is the velocity of the particle at the tth iteration, c1 and c2 are learning factors, r1 and r2 are random numbers, and r1∈[0,1], r2∈[0,1], pbest is the optimal solution in the current population, and gbest is the optimal solution in the entire population.
[0166] S6, fusing the multiple branch prediction data obtained in step S5 through a fully connected layer to obtain a short-term passenger flow prediction result, specifically including the following steps:
[0167] S61, connecting the multiple branch prediction data obtained in step S5 into comprehensive data;
[0168] S62: Input the comprehensive data obtained in step S61 into the fully connected layer for feature fusion and conversion processing to obtain a short-term passenger flow prediction result.
[0169] After each branch completes its own prediction, each branch will generate a set of prediction data (i.e., prediction vectors), and the above prediction vectors may have different feature dimensions. In order to effectively fuse these multi-dimensional prediction data, the present invention introduces a fully connected layer. First, the prediction vectors of each branch are connected into a comprehensive vector to form a unified input, and then this comprehensive vector is input into the fully connected layer. The fully connected layer processes this input through linear transformation (i.e., matrix multiplication and addition of bias) and nonlinear activation function (the present invention uses sigmoid function) to complete the fusion and conversion of features. The fully connected layer can compress or expand the high-dimensional features of the input to the required output dimension. In this way, the fully connected layer can integrate the prediction information of each branch to generate a fused unified output prediction result (short-term passenger flow prediction result), thereby improving the overall prediction performance and accuracy of the model.
[0170] Example 2
[0171] An embodiment of the present invention provides an electronic device, the electronic device comprising:
[0172] at least one processor; and,
[0173] a memory communicatively connected to the at least one processor; wherein,
[0174] The memory stores a computer program that can be executed by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute the multi-scale short-term passenger flow prediction method for rail transit that considers external characteristics of passenger flow of Example 1.
[0175] Example 3
[0176] An embodiment of the present invention provides a computer-readable storage medium storing a computer program. When the computer program is executed by a processor, the method for predicting multi-scale short-term passenger flow of rail transit considering external characteristics of passenger flow of embodiment 1 is implemented.
[0177] The performance verification and effectiveness evaluation of the multi-scale short-term passenger flow prediction method for rail transit considering the external characteristics of passenger flow proposed in Example 1 of the present invention are as follows:
[0178] Given that the focus of current research on short-term passenger flow prediction is usually on the three time granularities of 15 minutes, 45 minutes and 75 minutes, this chapter will perform performance verification and effectiveness evaluation on the proposed prediction model according to these three time granularities.
[0179] 1. Method Analysis
[0180] (1) Data Source and Analysis
[0181] This chapter takes 20 stations of a railway bureau's high-speed passenger railway line as an example. The schematic diagram is as follows: Figure 4 The present invention obtains ticket sales data for a total of 150 days from January 2019 to May 2019, and analyzes the time-varying characteristics of passenger demand. The ticket sales data records the passenger's itinerary information in detail, including key information such as train number, departure date and time, departure station, destination station, boarding station and alighting station.
[0182] like Figures 5 to 8 As shown, four stations involved in the present invention are selected to display the original passenger flow data of the stations. The original passenger flow data of 105 days from January 1, 2019 to April 16, 2019 is selected as the training set, and the passenger flow data of the last 45 days, i.e., April 17, 2019 to May 31, 2019, is selected as the verification set to verify the performance of the prediction model of the present invention.
[0183] (2) Feature screening
[0184] The present invention sorts out the factors that affect short-term passenger flow and summarizes them into 5 primary indicators and 28 secondary indicators as shown in Table 1 below.
[0185] Table 1 Index system of factors affecting passenger flow at high-speed railway passenger stations
[0186]
[0187] The present invention uses SPSSPOR software to perform Spearman correlation analysis for the correlation between the 28 key factors identified in Table 1 and the passenger flow of high-speed railway passenger stations. On this basis, the present invention further calculates the correlation between the above indicators and the short-term passenger flow of rail transit. The Spearman correlation coefficient matrix before screening is as follows: Fig. 9 As shown in the figure, the depth of the color of the square corresponds to the size of the correlation coefficient. The present invention selects variables with an absolute value of the correlation coefficient not less than 0.3, recodes the above variables, and the encoding effect is shown in Table 2 below. The present invention performs Spearman correlation analysis on the selected feature variables again, eliminates factors with low correlation, and re-performs the correlation analysis. The analysis results are displayed in the form of a heat map. The analysis results are shown in Table 2. Fig.10 shown.
[0188] Table 2 Factors affecting passenger flow after screening
[0189]
[0190]
[0191] (3) Model comparison and evaluation indicators
[0192] In order to comprehensively evaluate the performance of the multi-scale short-term passenger flow prediction model for rail transit considering the external characteristics of passenger flow proposed in the present invention, the following classic single machine learning models and combined machine learning models are selected for comparison. The comparison models selected by the present invention are as follows:
[0193] (1) Historical average method (HA), which uses the average passenger flow of similar time periods in historical data for estimation.
[0194] (2) Recurrent Neural Network (RNN) is a neural network model designed specifically for processing sequence data. RNN can process data with varying sequence lengths. Its advantage is that it can pass previous information to the current processing flow, thereby effectively handling the time series dependency in passenger flow prediction problems.
[0195] (3) Time series analysis (ARIMA): The ARIMA model is specifically used for the analysis and prediction of time series data and can capture the seasonal and trend components in the data.
[0196] (4) Gated Recurrent Unit (GRU), similar to LSTM, is another variant of recurrent neural network. GRU has a simpler structure and can be applied to the processing of time series data, especially when the data set size is limited.
[0197] (5) Long Short-Term Memory (LSTM) is a special type of recurrent neural network (RNN) that can learn long-term dependency information and solve the gradient problem.
[0198] (6) Convolutional Long Short-Term Memory (ConvLSTM) is a special recurrent neural network (RNN) that combines the characteristics of convolutional neural network (CNN) and long short-term memory (LSTM) and can effectively process data sequences with spatial dimensions. Compared with traditional LSTM, ConvLSTM introduces convolution operations in its internal structure, so ConvLSTM is better suited for weather forecasting, passenger flow prediction, and other sequence data that need to capture features from the spatial dimension.
[0199] (7) M-1, a variant of the VMD-IPSO-LSTM model in the present invention, in which the VMD branch is removed, abbreviated as M-1, is used to verify the rationality of the VMD branch in the model.
[0200] (8) M-2, a variant of the VMD-IPSO-LSTM model in the present invention, in which the IPSO branch is removed, abbreviated as M-2, is used to verify the rationality of the IPSO branch in the model.
[0201] (9) M-3, another variant of the VMD-IPSO-LSTM model in the present invention, removes the input of external features in the model and only inputs the time series, which is used to verify the role of the external feature module in this model.
[0202] In order to comprehensively evaluate the performance of the VMD-IPSO-LSTM model, this chapter uses the following four evaluation indicators: Mean Absolute Error (MAE), Root Mean Square Error (RMSE), Mean Absolute Percentage Error (MAPE), and Coefficient of Determination (R 2 ), the calculation formula of the above indicators is as follows:
[0203]
[0204] Among them, N is the number of sample data, yi is the true value, is the predicted value.
[0205] The present invention implements the VMD-IPSO-LSTM model under the TensorFlow framework, and all numerical experiments are performed on computers equipped with 32GB DDR4 3200MHz RAM, Intel Core i9-12900K or AMD Ryzen 9 5900X CPU and NVIDIA RTX3080 or higher GPU. The population size of the IPSO algorithm is 100, the maximum number of iterations is 20, the number of components of the VMD algorithm is set to 10, the number of LSTM recurrent units is 64, and the remaining hyperparameters are determined by optimizing the IPSO algorithm.
[0206] (4) Decomposition results of VMD model
[0207] Existing studies have shown that the setting of the number of modes k has a great influence on the decomposition effect of the VMD algorithm. When k is small, the number of modes decomposed by the original signal is small, which will lead to the loss of key information. On the contrary, when k is large, it will cause the two center frequencies of adjacent modes to be too close, and then the mode overlap will appear. The present invention has decomposed the original data many times and found that setting the number of modes k to 10 can effectively decompose the passenger flow data. In addition, the bandwidth parameter α is set to 6000, the noise tolerance tau is set to 0, the value of the constant is set to 0, and the error control constant is set to tol = 1×10 7The present invention takes the passenger flow data of 20 stations from 6:00 am to 23:00 pm, with a time granularity of 15 minutes and a total of 68 time periods per day as an example to demonstrate the VMD decomposition effect. The frequencies of each IMF component are arranged in order from low to high. Due to limited space, the present invention selects the decomposition results of the first 8 stations for display. The passenger flow data decomposition results are as follows Fig.11 and Fig.12 As shown. Fig.11 and Fig.12 It can be seen that the low-frequency component IMF1 mainly reflects the overall change trend of the original passenger flow sequence, the several peaks in IMF2 are caused by holidays or temporary events, the medium-frequency IMF3, IMF4, IMF5 and IMF6 reflect certain periodic characteristics; the high-frequency IMF7 to IMF10 mainly reflect other fluctuation characteristics of the original passenger flow sequence.
[0208] (5) Analysis of prediction results
[0209] In order to comprehensively evaluate the prediction effect of the model at different time granularities, the present invention selects three time granularities of 15min, 45min, and 75min to test the model performance. The experimental results are shown in Tables 3 and 4 below. Compared with the classic passenger flow prediction model, the VMD-IPSO-LSTM model shows good prediction performance at various time granularities. At short time granularity, the prediction performance of the VMD-IPSO-LSTM model is more outstanding. Taking the 15min time granularity as an example, compared with the classic ConvLSTM, LSTM, and GRU models, the MAE index of VMD-IPSO-LSTM decreased by 50.073, 66.247, and 102.927, respectively, the RMSE index decreased by 57.963, 77.935, and 126.077, and the MAPE index decreased by 6.386, 7.562, and 102.927, respectively, and the determination coefficient R 2 Increased by 7.92%, 10.93% and 35.19%.
[0210] Table 3 MAE and RMSE values of various prediction models
[0211]
[0212] Table 4 MAPE and R of various prediction models 2 value
[0213]
[0214] In the prediction model selected by this invention, the historical mean method (HA) only uses the average value of historical data for statistics and prediction, and obviously lacks the ability to learn and adapt to the changing characteristics of data in time series, external feature influence, and spatial dimension. Therefore, the HA algorithm has the worst performance among the comparison algorithms selected in this article, so this invention does not further analyze the HA algorithm. The real-prediction comparison diagram of the other comparison models is shown in Figure 2. Fig.13 As shown in Figure 2, the deviation analysis of the model is as follows: Figure 14-16 As shown. Fig.13 It can be seen that at a time granularity of 15 minutes, the ARIMA model and the RNN model show high prediction accuracy. However, as the prediction time granularity increases, the performance of the above two prediction models decreases significantly. The long short-term memory network (LSTM) model can effectively capture the long-term dependencies in time series data through its cyclic structure and gating mechanism, so it has achieved significant performance improvements. At a time granularity of 45 minutes, compared with the ARIMA model and the RNN model, the MAE and RMSE indicators of the LSTM decreased by 37.357, 15.695 and 23.775, 12.229, respectively, while the determination coefficient R 2 The results show that the LSTM model's loop structure and gating mechanism improve the prediction performance of the LSTM prediction model. In addition, the ConvLSTM model introduces the network topology structure characteristics, which makes the ConvLSTM model not only have the advantages of LSTM in processing time series data, but also significantly improves the accuracy of passenger flow prediction for complex rail transit networks by introducing spatial dimension processing capabilities. Figure 14-16 It can be seen that the above model fails to effectively capture the relationship between short-term passenger flow and external influencing factors, so its applicability in dealing with complex scenarios is limited. In view of this, the multi-scale short-term passenger flow prediction model for rail transit designed by the present invention that takes into account the external characteristics of passenger flow is screened and re-encoded by the external feature data, and inputs it into the prediction framework together with the time series data. Thereby, the prediction accuracy and applicability of the model for complex scenarios are significantly improved. Taking the prediction of 45min time granularity as an example, the average performance indicators of the model of the present invention in the three time periods are compared with ConvLSTM, and MAE, RMSE and MAPE are reduced by 140.645, 192.905 and 7.479 respectively, while R 2 The index was improved by 6.25%. Compared with the traditional single prediction model or combined model, the prediction model in the present invention significantly improves the prediction ability of the model by designing the original data decomposition method based on the VMD method, extracting the external features of passenger flow data and the One-Hot encoding method, and using the fully connected layer to enhance the global feature extraction and integration capabilities. It is superior to the traditional single prediction model or combined model in multiple evaluation indicators.
[0215] In addition, the present invention further verifies the effectiveness of the model design by comparing the performance of the existing model with its three variants M-1, M-2, and M-3. At the 15-minute prediction granularity, compared with the complete model, the MAE, RMSE, and MAPE evaluation indicators of the M-1 model with the VMD branch removed increased by 41.71, 47.723, and 5.01, respectively, and the MAE, RMSE, and MAPE evaluation indicators of the M-2 model with the IPSO branch removed increased by 89.415, 105.8, and 11.672, respectively. The MAE, RMSE, and MAPE evaluation indicators of the M-3 model with the external factor input removed increased by 107.925, 133.713, and 20.232, respectively. Based on the results of the above ablation experiments, it can be proved that each module in the model plays an important role in improving the overall prediction performance, which further verifies the effectiveness and rationality of the paper model.
[0216] In summary, the embodiment of the present invention proposes a multi-scale short-term passenger flow prediction model for rail transit that takes into account the external characteristics of passenger flow. The model first processes passenger flow time series data based on the variational mode decomposition (VMD) algorithm, decomposes it into multiple intrinsic mode functions (IMFs) with different frequencies and complexities, and then uses the particle swarm optimization (IPSO) algorithm to dynamically optimize the hyperparameters of the long short-term memory neural network (LSTM), and constructs a passenger flow prediction model based on VMD-IPSO-LSTM. In addition, considering the problem that the traditional model has insufficient performance under abnormal conditions, the present invention introduces a feature extraction module for learning the impact of external environmental factors such as weather, time and special events on passenger flow. The adaptability of the model to complex environments is enhanced, and the prediction accuracy of the model is improved. Through simulation experiments, it can be seen that compared with traditional prediction models, such as ConvLSTM, LSTM, and RNN models, at a time granularity of 15 minutes, the MAE index of the prediction model in this paper decreases by 50.073, 66.247, and 103.306, while the determination coefficient R 2 They increased by 7.92%, 10.93% and 41.54% respectively. The experimental results show that the prediction model in this paper has good prediction ability and can better cope with the short-term passenger flow prediction needs in complex scenarios.
[0217] Although the embodiments of the present invention have been shown and described, it will be appreciated by those skilled in the art that various changes, modifications, substitutions and variations may be made to the embodiments without departing from the principles and spirit of the present invention, and that the scope of the present invention is defined by the claims and their equivalents.
Claims
1. A multi-scale short-term passenger flow prediction method for rail transit considering external characteristics of passenger flow, characterized in that: The following steps are involved: S1. Obtain multi-scale data of rail transit; S2, feature screening is performed on the multi-scale rail transit data obtained in step S1 to obtain key factors related to short-term in-and-out passenger flow; S3: normalize the key factors obtained in step S2 and the multi-scale rail transit data in step S1 to obtain normalized passenger flow entry and exit data S4: The normalized passenger flow entry and exit data obtained in step S3 Decompose into k components And reconstruct the decomposed k components to obtain the reconstructed passenger flow time series S5: Reconstruct the passenger flow time series obtained in step S4 As the input of the IPSO-LSTM prediction model, multiple branch prediction data with different feature dimensions are output; S6. The multiple branch prediction data obtained in step S5 are integrated through a fully connected layer to obtain a short-term passenger flow prediction result.
2. The multi-scale short-term passenger flow prediction method for rail transit considering external characteristics of passenger flow according to claim 1 is characterized in that: In step S1, the rail transit multi-scale data includes train number, departure date and time, departure station, destination station, boarding station and alighting station information.
3. The multi-scale short-term passenger flow prediction method for rail transit considering external characteristics of passenger flow according to claim 1 is characterized in that: Step S2 comprises the following steps: S21, performing Spearman correlation analysis on the multi-scale rail transit data obtained in step S1 and the passenger flow of high-speed railway passenger stations to obtain key factors related to the passenger flow of high-speed railway passenger stations; S22. Perform a Spearman correlation analysis on the key factors obtained in step S21 and the short-term passenger flow of rail transit to obtain the key factors related to the short-term passenger flow of in-and-out stations.
4. The multi-scale short-term passenger flow prediction method for rail transit considering external characteristics of passenger flow according to claim 1 is characterized in that: Step S3 includes the following steps: S31, performing Spearman correlation analysis on the key factors obtained in step S2 to obtain influencing factors with significant correlation, and classifying the rail transit multi-scale data obtained in step S1 according to different time granularities to obtain classified data, and fusing the influencing factors and the classified data to obtain fused data; S32, the fused data obtained in step S31 is supplemented with missing values by linear interpolation to obtain data to be processed, and the calculation formula for the missing value supplement is: Among them, (x1, y1) and (x2, y2) are two known data points; S33: normalize the data to be processed obtained in step S32 to obtain normalized passenger flow entry and exit data The calculation formula for normalization is: Among them, X is the data to be processed, X min is the minimum value in the data to be processed, X max is the maximum value of the data to be processed. It is the normalized passenger entry and exit data.
5. The multi-scale short-term passenger flow prediction method for rail transit considering external characteristics of passenger flow according to claim 1 is characterized in that: Step S4 comprises the following steps: S41, the normalized passenger flow entry and exit data obtained in step S3 Perform Hibert operation on each subsequence in to obtain the one-sided spectrum of each subsequence. The calculation formula for the one-sided spectrum of each subsequence is: Among them, δ(t) is the pulse function, is a subsequence of the original data, is the imaginary part and t is the independent variable. S42, compare the one-sided spectrum of each subsequence obtained in step S41 with Multiply them together to get the baseband of each subsequence. The baseband calculation formula is: in, is the exponential mixing demodulation center frequency, δ(t) is the pulse function, is a subsequence of the original data, is the imaginary part and t is the independent variable. S43, solving the baseband bandwidth of each subsequence obtained in step S42 to obtain a constrained variational model, the expression of the constrained variational model is as follows: in, is the short-term passenger flow sequence to be predicted, is the original passenger flow data, is the symbol of partial derivative, is the exponential mixing demodulation center frequency, δ(t) is the pulse function, is a subsequence of the original data, is the imaginary part and t is the independent variable. S44, solving the constrained variational model obtained in step S43 to obtain an unconstrained variational model, the expression of the unconstrained variational model is as follows: in, is the short-term passenger flow sequence to be predicted, is the symbol of partial derivative, is the exponential mixing demodulation center frequency, δ(t) is the pulse function, is a subsequence of the original data, is the imaginary part, t is the independent variable, is the original data sequence, ω k is the center frequency corresponding to each mode, α is the quadratic penalty factor, and λ(t) is the Lagrangian operator. S45, in the unconstrained variational model obtained in step S44 ω k and λ are updated to obtain the optimal solution of the unconstrained variational model. ω k The update expressions of and λ are as follows: in, They are Fourier transform of λ(ω), where ω is the frequency, τ is the update parameter of the Lagrange multiplier, and c is the number of iterations; S46: Determine whether the optimal solution of the unconstrained variational model obtained in step S45 satisfies the loop termination condition. If so, terminate the loop and obtain k components. Otherwise, step S45 is repeated until the loop termination condition is met, and the loop termination condition is: Among them, ζ is the convergence threshold, is the value of the initial signal at the c+1th update in the mth iteration, is the value of the initial signal at the cth update during the mth iteration. S47, k components obtained in step S46 Reconstructed by adding components to obtain the reconstructed passenger flow time series 6. The multi-scale short-term passenger flow prediction method for rail transit considering external characteristics of passenger flow according to claim 1, characterized in that: In step S5, the IPSO-LSTM prediction model is constructed by the following method: S51, setting the initial particle state, initializing the particle parameters, particle position and velocity, obtaining the initial parameters of the LSTM model, inputting the original passenger flow data into the LSTM model, training the LSTM model, and obtaining a trained LSTM model; S52, calculating the fitness value of the particle according to the trained LSTM model obtained in step S51 to obtain the fitness value of the particle; S53, according to the fitness value of the particle obtained in step S52, compare the ratio Q of the particle to the average fitness value of all particles in the group and the average value δ of the particle's D-dimensional information; If Q>δ, strategy 2 is used to update the particle position. If Q<δ, strategy 1 is used to update the particle position. pbest and gbest are updated according to the updated particle positions. If the iteration termination condition is met, the optimal hyperparameters of the LSTM model are determined, that is, the IPSO-LSTM prediction model is obtained. If the iteration termination condition is not met, return to step S51 to retrain the LSTM model.
7. The multi-scale short-term passenger flow prediction method for rail transit considering external characteristics of passenger flow according to claim 6, characterized in that: In step S53, the formulas of strategy 1 and strategy 2 are: Among them, Q i is the ratio of the current particle to the average fitness value of all particles in the group, δ is the average value of the D-dimensional information of each particle, is the position of the particle at the t+1th iteration, is the position of the particle at the tth iteration, is the velocity of the particle at the t+1th iteration, and ω is the inertia weight. The update formula for updating pbest and gbest according to the updated particle position is: in, and are the velocity and position of the particle at the tth iteration respectively. If the problem solution space is D-dimensional, then ω is the inertia weight, c1 and c2 are learning factors, r1 and r2 are random numbers, and r1∈[0,1], r2∈[0,1], pbest is the optimal solution in the current population, gbest is the optimal solution in the entire population, and becomes the global optimal value, v i t+1 and x i t+1 are the velocity and position of the particle at the t+1th iteration respectively.
8. The multi-scale short-term passenger flow prediction method for rail transit considering external characteristics of passenger flow according to claim 1, characterized in that: Step S6 comprises the following steps: S61, connecting the multiple branch prediction data obtained in step S5 into comprehensive data; S62: Input the comprehensive data obtained in step S61 into the fully connected layer for feature fusion and conversion processing to obtain a short-term passenger flow prediction result.
9. An electronic device, characterized in that: The electronic device comprises: at least one processor; and, a memory communicatively connected to the at least one processor; wherein, The memory stores a computer program that can be executed by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute the multi-scale short-term passenger flow prediction method for rail transit taking into account external characteristics of passenger flow as described in any one of claims 1 to 8.
10. 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 rail transit multi-scale short-term passenger flow taking into account external characteristics of passenger flow as described in any one of claims 1 to 8 is implemented.
Citation Information
Patent Citations
Holiday short-time passenger flow prediction method for urban rail transit station
CN111695722A
Scenic spot daily passenger flow volume prediction method based on feature selection and LSTM
CN111985706A
Short-term photovoltaic power prediction method based on VMD-IPSO-GRU
CN112348271A
Passenger flow travel prediction processing method and system based on twinborn scene
CN115545360A
Passenger flow prediction method and device, electronic equipment and storage medium
CN117591919A
Cited By
Rail transit multi-dimensional characteristic passenger flow prediction method and system based on artificial intelligence
CN120875948A