A method for predicting passenger flow in urban rail transit
By repairing AFC data and combining PSO-SVR and BP neural network algorithms to construct a passenger flow prediction model, the problem of accuracy in urban rail transit passenger flow prediction was solved, achieving high-precision passenger flow prediction and providing support for the operation optimization of urban rail transit.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-03-14
- Publication Date
- 2026-04-03
AI Technical Summary
Existing technologies struggle to accurately predict urban rail transit passenger flow, especially due to its nonlinear, non-stationary, and stochastic characteristics. Traditional methods and models have low prediction accuracy, and numerous influencing factors lead to model overfitting or an inability to fully reflect changes in passenger flow.
An approximate data repair method was used to repair abnormal and missing data in the AFC data of rail transit. A passenger flow prediction model was constructed by combining the PSO-SVR algorithm and the BP neural network algorithm. The initial parameters were adjusted by the entropy weight method, and the mean square error and relative accuracy index were used for comprehensive evaluation.
It enables accurate prediction of urban rail transit passenger flow, provides support for optimizing operation organization and network planning, and improves prediction accuracy and overall model performance.
Smart Images

Figure CN118504375B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of intelligent transportation technology, and more specifically, to a method for predicting passenger flow in urban rail transit. Background Technology
[0002] The diverse sources and massive scale of passenger flow data in my country's urban rail transit system, such as data from Automatic Fare Collection (AFC) systems, smart cards, and mobile phone signaling, provide a data foundation for accurate passenger flow forecasting. However, urban rail transit passenger flow is characterized by nonlinearity, non-stationarity, and randomness, and is influenced by various internal and external factors, making accurate forecasting challenging. With the widespread application of emerging technologies such as big data, artificial intelligence, and cloud computing in the rail transit field, analyzing passenger travel behavior, rail transit network, line and cross-sectional passenger flow characteristics based on big data, and utilizing intelligent algorithms for rail transit travel demand forecasting, is of great significance for optimizing rail transit organization, scheduling, and staffing.
[0003] Current research on urban rail transit passenger flow forecasting has yielded substantial results in terms of influencing factors and forecasting methods. Regarding influencing factors, urban rail transit passenger flow varies with time and space, and is also affected by various external factors such as weather conditions, holiday schedules, and large-scale events. However, an excessive number of influencing factors as input variables can lead to model overfitting, while a limited number cannot fully reflect the relationships between passenger flow changes. As for forecasting methods, due to the nonlinear, non-stationary, and stochastic characteristics of urban rail transit passenger flow, traditional forecasting methods and models often struggle to capture the patterns and intrinsic relationships of passenger flow changes, resulting in low forecasting accuracy. Furthermore, some research based on intelligent algorithms lacks sufficient analysis of the structural optimization and parameter adjustment of forecasting models, thus the accuracy of forecasting models needs improvement. Summary of the Invention
[0004] The purpose of this invention is to provide a method for predicting passenger flow in urban rail transit.
[0005] The present invention aims to solve the problems existing in the prior art.
[0006] Compared with the prior art, the technical solution of the present invention and its beneficial effects are as follows:
[0007] A method for predicting passenger flow in urban rail transit includes: using a data approximation repair method to repair abnormal and missing passenger flow data in the automatic fare collection (AFC) system of rail transit; selecting influencing variables for rail transit passenger flow prediction; constructing a rail transit passenger flow prediction model based on the PSO-SVR algorithm; constructing a rail transit passenger flow prediction model based on the BP neural network algorithm; setting initial parameters for the rail transit passenger flow prediction model; calculating the urban rail transit passenger flow prediction results using the entropy weight method; and using mean square error and relative accuracy indicators to comprehensively evaluate the performance of the rail transit passenger flow prediction model.
[0008] The beneficial effects of this invention are as follows:
[0009] This invention addresses the problem of urban rail transit passenger flow prediction. Based on urban rail AFC card swiping data, it selects passenger flow influencing factors such as time period information, weekday type, and weather, and proposes an urban rail transit passenger flow prediction model that integrates the PSO-SVR algorithm and the BP neural network algorithm. This model achieves accurate prediction of rail transit passenger flow and provides support for optimizing urban rail transit operation organization, network planning, and emergency dispatch. Attached Figure Description
[0010] Figure 1 This is a schematic diagram of a passenger flow prediction method for urban rail transit provided in an embodiment of the present invention.
[0011] Figure 2 This is a schematic diagram of the predicted passenger flow of rail transit provided in an embodiment of the present invention.
[0012] Figure 3 This is a schematic diagram of the error in predicting passenger flow in rail transit provided in an embodiment of the present invention. Detailed Implementation
[0013] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of the present invention, not all of them. Therefore, the following detailed description of the embodiments of the present invention provided in the accompanying drawings is not intended to limit the scope of the claimed invention, but merely to represent selected embodiments of the invention. All other embodiments obtained by those skilled in the art based on the embodiments of the present invention without inventive effort are within the scope of protection of the present invention.
[0014] In the description of this invention, the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of indicated technical features. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of that feature. In the description of this invention, "a plurality of" means two or more, unless otherwise explicitly specified.
[0015] Reference Figures 1 to 3 As shown,
[0016] A method for predicting passenger flow in urban rail transit includes: using a data approximation repair method to repair abnormal and missing passenger flow data in the automatic fare collection (AFC) system of rail transit; selecting influencing variables for rail transit passenger flow prediction; constructing a rail transit passenger flow prediction model based on the PSO-SVR algorithm; constructing a rail transit passenger flow prediction model based on the BP neural network algorithm; setting initial parameters for the rail transit passenger flow prediction model; calculating the urban rail transit passenger flow prediction results using the entropy weight method; and using mean square error and relative accuracy indicators to comprehensively evaluate the performance of the rail transit passenger flow prediction model.
[0017] The automatic fare collection (AFC) system for rail transit records the card swiping transaction information of each passenger entering and exiting the station. The card swiping transaction information includes, but is not limited to, the card number, user card type, entry time, entry line code, entry station code, exit time, exit line code, and exit station code.
[0018] The following table shows an example of AFC data for rail transit:
[0019]
[0020]
[0021] The data collected by the AFC system of urban rail transit is usually affected by factors such as the performance of the rail transit system and the data transmission network, and there are outliers such as loss, duplication and garbled characters.
[0022] The method of approximate data repair is used to repair abnormal and missing passenger flow data in the Automatic Fare Collection (AFC) system of rail transit, including:
[0023] The identified abnormal data was deleted, and the neighborhood mean interpolation method from the data approximation repair method was used to repair the abnormal and missing passenger flow data in the Automatic Fare Collection (AFC) system of rail transit. The calculation formula is as follows:
[0024]
[0025] In the formula, Here is the restored rail transit passenger flow data at time t; x t-1 The data represents passenger flow at time t-1; x t+1 This is the passenger flow data at time t+1.
[0026] The selected variables affecting the prediction of rail transit passenger flow include, but are not limited to, weather (sunny, foggy, rainy, snowy, windy, etc.), time period (in 1-hour units, whether it is during morning or evening peak hours), and date type (weekday, weekend, holiday).
[0027] The construction of the rail transit passenger flow prediction model based on the PSO-SVR algorithm includes:
[0028] The method for constructing a rail transit passenger flow prediction model based on the PSO-SVR algorithm is as follows:
[0029] First, we introduce the Support Vector Regression (SVR) model. SVR prediction is a machine learning model based on supervised learning. Its core idea is to introduce a kernel function φ(x) = (φ1(x), φ2(x), ..., φ...). l (x)) T The nonlinear prediction problem of rail passenger flow is mapped to a linear prediction problem in l-dimensional space. The optimization model is as follows:
[0030]
[0031]
[0032] In the formula: w is the normal vector that determines the direction of the hyperplane; b is the offset of the hyperplane from the origin; l is the total number of samples; x i Input passenger flow data for urban rail transit sections; y i To segment the passenger flow output data, the basic idea of the SVR model is to find a regression plane that minimizes all sample data points to this plane, and to introduce a slack variable ξ to reduce the fluctuation range of the cross-sectional passenger flow prediction results. The mathematical expression is as follows:
[0033]
[0034]
[0035] In the formula: C is the penalty factor, reflecting the degree of penalty imposed by the short-term passenger flow prediction model on sample data where |yf(x)|>ε; φ(x) is the kernel function. Introducing the Lagrangian function transforms the above formula into its dual form. Solving this nonlinear regression problem maps the low-dimensional SVR fitting function to a high-dimensional form:
[0036]
[0037] In the formula: α i and α' i These are Lagrange multipliers. Simultaneously, the inner product x is modified by combining it with a Gaussian radial basis kernel function, which has good universality and noise resistance. i *x j The space is transformed into a linear space.
[0038] The SVR model expression is then:
[0039]
[0040] In the formula: K(x) i ,x) is the power-law kernel formula for the Gaussian radial basis kernel function; g is the bandwidth of the Gaussian kernel, g>0.
[0041] Secondly, the SVR model is optimized based on the Particle Swarm Optimization (PSO) algorithm. The algorithm first treats the position information of each particle in the swarm as a potential solution set (C, g), continuously updates the movement speed and spatial position based on the particle fitness value, and finally determines the optimal values of the SVR model parameters by the maximum number of iterations and the best fitness threshold. The principle for updating the particle speed and position is as follows:
[0042]
[0043] In the formula: Let be the moving speed of particle i in the k-th and k+1-th iterations; Let be the spatial position of particle i in different iterations; ω is the inertial weight, ω∈[0,1.4]; is the optimal position of particle i in the k-th iteration and the entire particle swarm; c1 and c2 are learning factors, representing the local and global optimization capabilities of PSO, respectively, usually taking the value 2; r1 and r2 are random numbers, r1 and r2∈[0,1].
[0044] By comparing the fitness values of all particles, the optimal position update rule strategy for the entire particle swarm is obtained:
[0045]
[0046] In the formula, g(X) is the fitness function.
[0047] In summary, a rail transit passenger flow prediction model based on the PSO-SVR algorithm is constructed.
[0048] Constructing a rail transit passenger flow prediction model based on the BP neural network algorithm, including:
[0049] The BP neural network model iteratively adjusts the weights ω based on the mean square error between the model output value y and the target output value t, minimizing the model's mean square error. The calculation formula is as follows:
[0050] minE(e T e)=minE[(ty) T (ty)]
[0051] The BP neural network model uses Calculate the mean square error, i.e.:
[0052]
[0053] Calculate the sensitivity coefficient s using the chain rule. m :
[0054]
[0055] In the formula, m is the number of network layers;
[0056] The formulas for adjusting the weights and thresholds are as follows:
[0057] W m (k+1)=W m (k)-αs m (y m-1 ) T
[0058] b m (k+1)=b m (k)-αs m
[0059] In the formula, α is the learning rate.
[0060] The method of comprehensively evaluating the performance of the rail transit passenger flow prediction model by selecting mean square error and relative accuracy indicators includes:
[0061] To evaluate the performance of the proposed passenger flow prediction model, mean square error and relative accuracy were used for comprehensive evaluation.
[0062] Let the actual value of the cross-sectional passenger flow be y. i The passenger flow forecast value is y' i If the sample size is n, then the formula for calculating the evaluation index is:
[0063]
[0064]
[0065] In the formula, r represents the range threshold of absolute percentage error, r = 10%.
[0066] Considering that the PSO-SVR model and the BP neural network model each have their own advantages and disadvantages in urban rail transit passenger flow prediction analysis, the entropy weight method is used to adjust and optimize the prediction results.
[0067] The initial parameters of the urban rail transit passenger flow prediction model are set, and the passenger flow prediction results are calculated using the entropy weight method, including:
[0068] The formula for calculating entropy weight is:
[0069]
[0070] Where m is the number of network size prediction models, x i H i and w i The result calculated for the i-th model, along with its entropy and entropy weight;
[0071] The prediction results of the BP neural network model are adjusted using the entropy weight vector and the traffic demand method. The calculation formula is as follows:
[0072]
[0073] Taking Beijing Metro Line 4 as a case study, we selected rail AFC transaction data and weather data from 07:00 to 19:00 on October 11 to 21, 2019 for passenger flow prediction analysis. We selected 15 minutes as the length of a passenger flow statistics time segment, for a total of 48 time segments / day * 11 days = 528 time segments. The time segment data was divided into training set and test set at a ratio of 10:1.
[0074] Initial parameter settings for the model. The PSO-SVR model requires the following preset parameters: maxgen = 200, sizepop = 20, c1 = 1.5, c2 = 1.7, ω = 1, r1 = r2 = 1, eps = 0.0001, X Cmin =0.1, X Cmax =100, X gmin =0.01, X gmax =1000. The BP neural network model uses the softmax function as the activation function and selects a two-hidden-layer structure.
[0075] Based on the cross-sectional passenger flow training set data and corresponding influencing factor data, parameter optimization was performed on the PSO-SVR initial prediction model and the BP neural network model. Based on the fitting results, the optimal penalty coefficient C = 4.5604 and kernel function parameter g = 0.8474 were set for the PSO-SVR model; the number of neurons in each hidden layer of the BP neural network model was (5, 20, 10).
[0076] The PSO-SVR passenger flow prediction model and the BP neural network passenger flow prediction model, trained using test set passenger flow data and data from three influencing factors, are combined with the entropy weight method to achieve urban rail transit passenger flow prediction based on a comprehensive intelligent algorithm. The final rail transit passenger flow prediction results are as follows: Figure 2 and Figure 3 As shown.
[0077] based on Figure 2 and Figure 3 The results show that the overall trend of the model's predictions is basically consistent with the actual data, with low fluctuation and deviation in the predicted values. It can effectively predict and characterize the distribution characteristics and patterns of urban rail transit passenger flow. Furthermore, the overall prediction error of the model proposed in this invention is relatively small, indicating that the prediction analysis of urban rail transit cross-section passenger flow by integrating multiple influencing factors is closer to the actual results. However, the prediction errors for time periods with higher passenger flow intensity are higher than those for time periods with lower passenger flow intensity, suggesting that the prediction errors will be larger during peak hours and other periods with high passenger volume.
[0078] To compare and illustrate the performance of the cross-sectional passenger flow prediction proposed in this invention, SVR and Long Short-Term Memory (LSTM) networks were selected as comparative models for analysis. Relevant urban rail passenger flow prediction data were input into different models for training and prediction, resulting in passenger flow prediction results for each model. Passenger flow prediction values and model evaluation index values are shown in the table.
[0079] Table 1. Evaluation Indicators of Passenger Flow Prediction at Different Cross-Sections Using Different Models
[0080]
[0081] Based on the model evaluation results, the prediction performance of the SVR and LSTM models is inferior to that of the integrated intelligent algorithm model proposed in this invention. This may be because, although other models can, to some extent, uncover the nonlinear impact of multidimensional features on passenger flow, or learn the temporal influence of multiple features on passenger flow in urban rail transit sections, their accuracy in predicting passenger flow under multi-factor coupling still needs improvement. This verifies the superiority of the integrated intelligent algorithm model. The algorithm of this invention provides support for the planning, design, operation organization, and scheduling optimization of urban rail transit.
[0082] The above embodiments are only used to explain the technical solutions of the present invention and are not intended to limit it. Those skilled in the art should understand that any modifications and equivalent substitutions that do not depart from the spirit and scope of the present invention should fall within the protection scope of the claims of the present invention.
Claims
1. A method for predicting passenger flow in urban rail transit, characterized in that, include: An approximate data repair method was used to repair abnormal and missing passenger flow data in the Automatic Fare Collection (AFC) system of rail transit. Select the influencing variables for rail transit passenger flow forecasting; Construct a rail transit passenger flow prediction model based on the PSO-SVR algorithm; Construct a rail transit passenger flow prediction model based on the BP neural network algorithm; The initial parameters of the rail transit passenger flow prediction model are set, and the passenger flow prediction results of urban rail transit are calculated using the entropy weight method. The performance of the rail transit passenger flow prediction model was comprehensively evaluated by using mean square error and relative accuracy indicators. The method of using approximate data repair to repair abnormal and missing passenger flow data in the Automatic Fare Collection (AFC) system of rail transit includes: The identified abnormal data was deleted, and the neighborhood mean interpolation method from the data approximation repair method was used to repair the abnormal and missing passenger flow data in the Automatic Fare Collection (AFC) system of rail transit. The calculation formula is as follows: In the formula, for t Real-time updated rail transit passenger flow data; for t Passenger flow data at time -1; for t Passenger flow data at time +1; The construction of the rail transit passenger flow prediction model based on the PSO-SVR algorithm includes: The SVR model expression is: In the formula: K ( x i ,x ) is the power-law kernel formula for the Gaussian radial basis function; g For the bandwidth of the Gaussian kernel, g >0; and is the Lagrange multiplier; b is the offset of the hyperplane from the origin; C is the penalty factor; Constructing a rail transit passenger flow prediction model based on the BP neural network algorithm, including: The BP neural network model is based on the model output value y With target output value t The mean square error between the weights is adjusted cyclically. To minimize the mean squared error of the model, the calculation formula is: The BP neural network model uses Calculate the mean square error, i.e.: e ( k ) Calculate the sensitivity coefficient using the chain rule. : ; In the formula, m The number of network layers; The formulas for adjusting the weights and thresholds are as follows: In the formula, α For learning rate; The method of comprehensively evaluating the performance of the rail transit passenger flow prediction model by selecting mean square error and relative accuracy indicators includes: Let the actual passenger flow at the cross-section be... y i Passenger flow forecast value y i ', sample size is n The formula for calculating the evaluation index is: In the formula, r This represents the range threshold for the absolute percentage error. r =10%; The initial parameters of the urban rail transit passenger flow prediction model are set, and the passenger flow prediction results are calculated using the entropy weight method, including: The formula for calculating entropy weight is: ; in, q The number of models for predicting network size. x i , H i and w i For the first i The results calculated by the model, along with its entropy and entropy weights; The prediction results of the BP neural network model are adjusted using the entropy weight vector and the traffic demand method. The calculation formula is as follows: 。 2. The method for predicting passenger flow in urban rail transit according to claim 1, characterized in that, The automatic fare collection (AFC) system for rail transit records the card swiping transaction information of each passenger entering and exiting the station. The card swiping transaction information includes, but is not limited to, the card number, user card type, entry time, entry line code, entry station code, exit time, exit line code, and exit station code.
3. The method for predicting passenger flow in urban rail transit according to claim 1, characterized in that, The selected variables affecting rail transit passenger flow forecasting include, but are not limited to, weather, time period, and date type.
Citation Information
Patent Citations
Short-term traffic flow prediction method based on PSO-SVR-LSTM
CN117408424A