Subway network OD passenger flow classification prediction method based on multi-dimensional feature input

Through multi-dimensional feature input and two-stage clustering, combined with ARIMA and improved Attention-LSTM model, the problems of low accuracy and redundant calculations in the existing subway passenger flow prediction methods are solved, and more refined OD classification and more efficient passenger flow forecast.

CN118917453APending Publication Date: 2024-11-08BEIJING JIAOTONG UNIV
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202410797691.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-06-20
Publication Date
2024-11-08

AI Technical Summary

Technical Problem

The existing subway passenger flow prediction methods have low prediction accuracy and generate a large number of redundant calculations in large-scale subway networks. They cannot effectively consider the time information of passenger flow and distinguish the categories of OD pairs, resulting in waste of computing resources and prediction errors.

Method used

The OD passenger flow classification prediction method of subway network based on multi-dimensional feature input is adopted. By quantitatively analyzing influencing factors, two-stage clustering and time series data evaluation are carried out, and ARIMA and improved Attention-LSTM models are used for prediction, reducing redundant calculations and improving Prediction accuracy.

Benefits of technology

It realizes more refined OD classification, improves prediction accuracy and efficiency, reduces computing resource consumption, reduces overfitting risks, and captures customer flow dynamics more accurately.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118917453A_ABST
    Figure CN118917453A_ABST
Patent Text Reader

Abstract

The invention discloses a metro network OD passenger flow classification prediction method based on multi-dimensional feature input, and particularly relates to the field of passenger flow prediction methods. Comprising the following steps: S1, carrying out quantitative analysis on multiple factors influencing the OD passenger flow, and determining a feature set of the influencing factors as an input condition of a prediction model; s2, performing two-stage clustering processing on all OD passenger flows in the subway network to ensure that each type of OD passenger flow has similar scales and time-varying laws; s3, performing time sequence data predictability evaluation on different types of OD passenger flows in the subway network, and detecting similarity and stability of the OD passenger flows; and S4, aiming at different types of OD passenger flows, respectively adopting a prediction model based on ARIMA and a prediction model based on improved Attention-LSTM to carry out passenger flow prediction. According to the technical scheme, the problems that an existing subway passenger flow prediction method is low in prediction precision and generates a large amount of redundant calculation are solved, and the passenger flow prediction precision is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of passenger flow prediction methods, and in particular to a subway network OD passenger flow classification prediction method based on multi-dimensional feature input. Background Art

[0002] In the subway network, OD passenger flow refers to the passenger flow between two stations, which is usually described by a matrix. Accurate OD passenger flow prediction is an important condition for the refined management of the subway network. In reality, with the continuous expansion of the scale of the subway network, the spatiotemporal law of OD passenger flow has become extremely complex. On the one hand, the number of ODs in the entire subway network is huge, and the spatiotemporal distribution of different OD passenger flows is different. Different types of OD passenger flows are random, and different prediction methods need to be selected; on the other hand, there are many factors that affect OD passenger flow, and the mechanisms of different factors on OD passenger flow are also different, and there are very complex correlations between different factors. Therefore, OD passenger flow prediction for large-scale subway networks faces great challenges.

[0003] Traditional subway passenger flow prediction methods mainly include: statistical prediction methods and nonlinear theory-based prediction methods. Among them, the statistical prediction method is simple to calculate and easy to understand, but this method is based on linear theory and is difficult to apply to OD passenger flow prediction problems with complex influencing factors and large randomness; and the prediction method based on nonlinear theory is also difficult to apply in large-scale subway networks due to its high computational complexity. In recent years, prediction methods based on deep learning have been widely used in subway passenger flow prediction, including recurrent neural networks, convolutional neural networks, and long short-term memory neural networks. However, these methods still have some shortcomings when predicting OD passenger flow in subway networks. First, these methods cannot consider the time information of passenger flow, such as date, time period, etc., but this information will affect the spatiotemporal characteristics of OD passenger flow; on the other hand, the existing methods do not distinguish the categories of OD pairs, and use the same method for all OD passenger flow predictions, which not only cannot guarantee the prediction accuracy, but also increases a large amount of invalid calculations. In addition, the existing methods all assume that there is spatial correlation between OD passenger flow, that is, any OD passenger flow will be affected by all other OD passenger flows. This assumption is not in line with reality and will cause a lot of redundancy in calculations. Summary of the invention

[0004] The present invention aims to provide a subway network OD passenger flow classification prediction method based on multi-dimensional feature input, which solves the problem that the existing subway passenger flow prediction method has low prediction accuracy and generates a large amount of redundant calculations.

[0005] In order to achieve the above object, the technical solution of the present invention is as follows: a subway network OD passenger flow classification prediction method based on multi-dimensional feature input comprises the following steps:

[0006] S1. Quantitatively analyze the multiple factors that affect OD passenger flow and determine the feature set of influencing factors as the input conditions of the prediction model;

[0007] S2, perform two-stage clustering on all OD passenger flows in the subway network to ensure that each type of OD passenger flow has similar scale and time-varying pattern;

[0008] S3, evaluate the predictability of time series data for different types of OD passenger flows in the subway network and detect the similarity and stability of OD passenger flows;

[0009] S4. For different types of OD passenger flows, the ARIMA-based prediction model and the improved Attention-LSTM-based prediction model are used to predict passenger flow.

[0010] Furthermore, the method for selecting predictive variable features in step S1 is as follows: starting from the set containing all features, gradually remove the weakest performing features, and iterate repeatedly until the set feature subset size is reached. In each round of iteration, the features are reordered using the feature importance evaluated by the linear regression model, and the features removed are those with the lowest importance scores.

[0011] Furthermore, the two-stage clustering method of step S2 is as follows:

[0012] S2.1. Based on the trend data of OD passenger flow distribution, the first stage of OD passenger flow clustering is performed to ensure that the ODs within the cluster have similar passenger flow change patterns;

[0013] S2.2. Based on the clustering in step S2.1, OD two-stage clustering is performed based on the passenger flow size data to ensure that the OD passenger flow within the class has similar passenger flow change trends and passenger flow sizes.

[0014] Furthermore, the fuzzy C-means clustering method is used for the passenger flow characteristic index of step S2.1. The specific steps are as follows:

[0015] Step 1: Calculate the initial membership matrix;

[0016] Step 2: Calculate o cluster centers;

[0017] Step 3: Calculate the objective function value. If this value is less than a specific threshold or its change is lower than the set threshold, the algorithm terminates; otherwise, update the membership matrix again and return to step 2 to continue iterating.

[0018] Furthermore, in step S2.2, the K-Means algorithm is used to perform the second-stage classification of the OD passenger flow of the entire network. The specific method is as follows: the "elbow method" is used to determine the number of clusters; then the K-Means clustering analysis method is used to perform the second-stage clustering of the OD pairs based on the first-stage clustering results of the OD pairs and the hourly passenger flow of the OD.

[0019] Furthermore, in step S3, the time series similarity measurement model is as follows:

[0020] The Pearson correlation coefficient method is used to test the similarity between the current passenger flow and the historical passenger flow data for the same period of the same week with the help of the correlation coefficient matrix. The correlation coefficient method is as follows:

[0021]

[0022] In the formula, is the OD passenger flow vector, U t For the tth OD pair u, i and j are week numbers, and e is the day of the week, calculate the passenger flow correlation coefficient between any two days and obtain a seventh-order correlation coefficient matrix R U (i e ,j e ), as shown below:

[0023]

[0024] Calculate the average correlation coefficient of OD As shown below:

[0025]

[0026] In the formula, the order l of the correlation coefficient matrix is ​​7,

[0027] For each OD category k, calculate the average correlation coefficient C of all OD pairs in this category ke , as follows:

[0028]

[0029] C ke The value of is [0,1]. The larger the value, the higher the similarity between passenger flow sequences. For this type of OD passenger flow, the time series model can be used to predict it. ke When is smaller, more complex deep learning models are adopted for prediction.

[0030] Furthermore, in step S3, the time series stationarity test model is as follows:

[0031] The stationarity test technology is used to evaluate the stability of the OD passenger flow data series, and its calculation model is:

[0032]

[0033] In the formula, a is a constant, b is the coefficient of the time trend, t is the time variable, and n is the lag order of the autoregressive process.

[0034] The constant a and time trend b are added to the model, and the AIC criterion is used to determine the lag order n of the autoregressive process.

[0035] After clarifying the model structure, perform an ADF test on the passenger flow time series of each OD pair for seven consecutive days from Monday to Sunday to obtain the corresponding P value, as shown in the following formula:

[0036] P U =(P1,P2,…,P U )

[0037] For each OD passenger flow of category k, calculate the average probability of all OD pairs in the category:

[0038]

[0039] The P value is between 0 and 1, and its size reflects the strength of the stationarity of the passenger flow data series. If the P value is lower than the preset significance level threshold, it indicates that the passenger flow time series has statistically significant stability at this significance level and can be used for short-term prediction.

[0040] Furthermore, the specific method of step S4 is as follows:

[0041] S4.1. Propose a data structure reconstruction strategy to reduce the impact of the minimum value in OD passenger flow data through data structure reconstruction and restoration operations, and achieve better prediction accuracy;

[0042] S4.2. Construct an ARIMA-based OD prediction model, which is used to predict the OD pairs that perform best in the time series predictability evaluation model. This type of OD has the best stability and similarity.

[0043] S4.3. For OD pairs that perform poorly in the time series predictable evaluation model, a passenger flow prediction model based on the improved Attention-LSTM is constructed, and multivariate input is considered to improve the prediction accuracy of the model for such OD.

[0044] Furthermore, the data structure reconstruction method of step S4.1 is as follows:

[0045] S4.1.1, set the minimum threshold ε,

[0046] S4.1.2 For each The historical average passenger flow matrix m ij Compared with the threshold value in step S4.1.1, the labeling matrix mij Only the element positions above the threshold are retained The data at these positions in the dataset are obtained as follows:

[0047]

[0048] S4.1.3. The valid data in is prepended, and the mask value is used to fill the end of the sequence to obtain the reconstructed data:

[0049]

[0050] S4.1.4. After the prediction is completed, the data structure is restored according to the element position information retained by the formula in step S4.1.2.

[0051] Compared with the prior art, this solution has the following beneficial effects:

[0052] (1) In order to classify OD pairs more finely, a two-stage OD pair classification method is established, which can more accurately classify OD pairs with similar passenger flow distribution trends and similar passenger flow sizes; a time series predictability evaluation model is established to evaluate the classified OD pairs from the perspective of stability and similarity. According to the evaluation results, OD is reclassified and its applicable OD prediction model is determined. The method of establishing an applicable prediction model based on OD classification can better fit the actual passenger flow pattern, reduce the consumption of computing resources, improve prediction efficiency, reduce the risk of overfitting, and save economic costs.

[0053] (2) The prediction model is based on historical OD information input. The input OD is one-dimensional data. In order to improve the prediction accuracy, the multiple factors affecting OD are considered. The historical OD information, OD site attribute information, and land use information are effectively used as the input of the prediction model to enhance the prediction effect.

[0054] (3) The input of multiple variables and the addition of the attention mechanism greatly improve the model accuracy. The model dynamically optimizes the prediction results by combining the outputs of these two branches. Such a parallel architecture design not only enhances the model's ability to process large-scale passenger flow data and improves the accuracy and efficiency of prediction, but also reduces the prediction error that may be caused by ignoring small passenger flows.

[0055] (4) An OD prediction model based on the improved Attention-LSTM was established, and multiple influencing factors of OD were taken into consideration. An improved Attention-LSTM prediction model under multivariate conditions was constructed. By integrating multiple influencing factors, the model can capture the passenger flow dynamics more comprehensively and more accurately characterize the short-term OD passenger flow distribution. BRIEF DESCRIPTION OF THE DRAWINGS

[0056] Figure 1 is a flow chart of the subway network OD passenger flow classification prediction method of this embodiment;

[0057] Figure 2 is a flow chart of the two-stage clustering of OD passenger flow in the subway network in this embodiment;

[0058] Figure 3 It is the ARIMA model prediction flow chart in this embodiment;

[0059] Figure 4 It is a framework diagram of the improved LSTM prediction model in this embodiment;

[0060] Figure 5 : is a prediction model framework diagram of the improved Attention-LSTM in this embodiment;

[0061] Figure 6 is a trend graph of the classification loss function in this embodiment;

[0062] Figure 7 This is a statistical chart of passenger flow in and out of Nanjing rail transit throughout the week in this embodiment;

[0063] Figure 8 This is a first-stage classification result diagram of the OD pairs of the entire rail transit network in this embodiment;

[0064] Fig. 9 It is a diagram of the classification effect of the two-stage OD pair in this embodiment;

[0065] Fig.10 It is the ACF and PACF graph in this embodiment;

[0066] Fig.11 This is a comparison chart of the prediction effects of Maigaoqiao-Zhujiang Road in different time periods on different operating days in this embodiment;

[0067] Fig.12 This is a comparison chart of the prediction effects of Jiqingmen Street-Youfang Bridge in different time periods on different operating days in this embodiment;

[0068] Fig.13 This is a comparison chart of the prediction effects of different time periods on different operating days for Tianlong Temple-Sanshan Street in this embodiment;

[0069] Fig.14 This is a comparison chart of the prediction effects of Xiongzhou-Getang in different time periods on different operating days in this embodiment;

[0070] Fig.15 This is a comparison chart of the prediction effects of Changfu Street-Tianrun City in different time periods on different operating days in this embodiment;

[0071] Fig.16 This is a comparison chart of the prediction effects of Nanjing Station and Nanjing South Station in different time periods on different operating days in this embodiment;

[0072] Fig.17 This is a comparison chart of the prediction effects of different time periods on different operating days of Jingtian Road-Maqun in this embodiment;

[0073] Fig.18 This is a comparison chart of the prediction effects of Chunjiang Road-Youfang Bridge in different time periods on different operating days in this embodiment;

[0074] Fig.19 This is a comparison chart of passenger flow prediction errors of the three models in the case analysis. DETAILED DESCRIPTION

[0075] The present invention is further described in detail below through specific embodiments:

[0076] Example

[0077] like Figure 1 As shown in FIG. 1 , the subway network OD passenger flow classification prediction method based on multi-dimensional feature input includes the following steps:

[0078] S1. Quantitatively analyze the multiple factors that affect OD passenger flow, determine the feature set of the influencing factors, and use it as the input condition of the prediction model, thereby determining the input data set of the prediction model.

[0079] The correlation between these factors and OD passenger flow is calculated for factors such as operating day, operating period, previous passenger flow, historical passenger flow in the same period, OD station inbound and outbound passenger flow, OD station attributes, line attributes, and OD station land use indicators. The characteristic values ​​of influencing factors with strong correlation are used as input conditions for passenger flow prediction.

[0080] (1) Classification of operating days

[0081] First, the system clustering method is used to determine the number of clusters and cluster centers of passenger flow data on different operating days, and then the K-Means clustering algorithm is used to classify the OD passenger flow on different operating dates. The specific steps are as follows:

[0082] Step 1: Use hierarchical clustering to perform preliminary clustering of OD distribution data and detect outliers in the data set. If outliers are found, remove them; otherwise, continue to perform hierarchical clustering until no outliers appear.

[0083] Step 2: Input the initial number of clusters and cluster centers obtained by system clustering into the K-Means algorithm.

[0084] Step 3: Use the K-Means clustering algorithm to complete the classification of OD passenger flow on the operating day. The specific steps are as follows:

[0085] Step 3.1: Assume that the sample data set is m, and randomly select k objects (0<k≤m) from it as the initial cluster center z i (i=1,2,…,k);

[0086] Step 3.2: Calculate the sample set data one by one to the initial cluster center z i (i=1,2,…,k) j ,z i ), where j = 1, 2, ..., m, i = 1, 2, ..., k;

[0087] According to the calculated distance results, find the nearest cluster center of each data point, classify it and the nearest cluster center into one category, and determine the cluster center as k categories;

[0088] Step 3.3: Reclassify each data point so that each data point can be placed in the closest category, then recalculate the cluster mean of the data point and obtain a new cluster center;

[0089] Step 3.4: Repeat steps 3.2 and 3.3. When convergence, stop the calculation and get the final cluster center z i (i=1,2,…,k).

[0090] (2) Classification of operating hours

[0091] The optimal segmentation method is used to cluster the ordered continuous OD passenger flow samples. The specific steps are as follows:

[0092] First, the sample data is sorted according to S1, S2, …, S x ,S y ,…,S n Sorting, n is the sample size, and the sample order is not broken during classification. Assume that category R contains samples {S x ,S x+1 ,…,S y}(y>x), the calculation formula of the class diameter is:

[0093]

[0094] In the formula, D(S x ,S y ) is the diameter distance of category R, is the mean vector of category R.

[0095] According to D(S x ,S y ) The sum of squares of the inter-class deviations of category G is D n×n , indicating the difference between samples.

[0096] Assuming that the optimal partitioning method is b(n,k), the partitioned set is:

[0097]

[0098] In the formula, k is the number of partitioned sets, x2,…,x k The classification points for classification.

[0099] The classification loss function is defined as formula (3):

[0100]

[0101] The purpose of optimal partitioning is to find a classification method b(n,k) that minimizes L[b(n,k)], that is, the smaller the sum of squares of deviations of each category, the optimal method is denoted as p(n,k).

[0102] The recursive formula of the classification loss function is formula (4):

[0103]

[0104] In the formula, k>2, 3≤g≤n.

[0105] From formula (4), we can see that only when x-1 samples are divided into k-1 categories can the optimal segmentation method p(n,k) be found.

[0106] Combining formula (2) and formula (4), we can deduce the classification point labeling matrix J of the optimal classification method p(n,k) n×n , backtrack to find the actual optimal classification solution, J n×n The element j(g,k) in represents the classification point number of the k-th sample set in the classification method b(g,k).

[0107] (3) Previous passenger flow and historical passenger flow during the same period

[0108] The Pearson coefficient is calculated to test the correlation between the predicted point and the passenger flow at several previous moments. The Pearson coefficient calculation formula is as follows:

[0109]

[0110] Where, X i is the current passenger flow; S X is the variance of the current passenger flow; is the average value of the current passenger flow; Y i is the previous passenger flow; S Y is the variance of the previous passenger flow; is the average value of the previous passenger flow. The value range of r is [-1,1]. The larger the |r| is, the stronger the correlation between the two variables is.

[0111] (4) Passenger flow in and out of OD stations

[0112] First, the Z-score normalization method is used to normalize the station inbound and outbound passenger flow data. The calculation formula is as shown in the formula:

[0113]

[0114] In the formula, x′ is the standardized value, x is the original data, μ is the sample mean, and σ is the sample standard deviation.

[0115] Then, Pearson correlation analysis was performed on the OD passenger flow and the entry volume at the starting point and the exit volume at the terminal.

[0116] (5) OD site attributes

[0117] Define the average daily OD passenger flow between different types of stations (after Z-score):

[0118]

[0119] Where U kab is the average daily OD passenger flow of the a-th station and the b-th station within the continuous operation date k, u kmn is the daily OD passenger flow of the mth station in the ath type station and the nth station in the bth type station, n a 、n b are the number of type a stations and type b stations respectively, k is the number of operating days under study, m and n are the mth station in type a stations and the nth station in type b stations respectively.

[0120] If the average daily OD passenger volume of a certain type of OD station is greater than the average OD volume of all types of OD stations, the variable is taken as 1, otherwise it is taken as 0.

[0121] (6) Line attributes

[0122] Set a 0-1 variable, which takes the value of 1 when both point O and point D are on the urban line, and 0 otherwise.

[0123] (7) OD site spacing

[0124] According to the geographic coordinates of each station in the subway network, the straight-line distance between OD stations is calculated, and combined with the number of OD pairs, it is divided into three levels: far, medium, and near.

[0125] (8) Are the OD sites on the same line?

[0126] Set a 0-1 variable. If the OD site is on the same line, the variable takes the value of 1; otherwise, it takes the value of 0.

[0127] (9) Land use classification

[0128] According to the Urban Land Classification and Planning and Construction Land Standards (GB 50137-2011), five major land use types closely related to station passenger flow are selected, as shown in the following table.

[0129] Table 1 Classification and representation of land use types around subway stations

[0130]

[0131] (10) OD site characteristic indicators for different land use categories

[0132] The facility density of various types of land within the 800-meter service range of the station is used as the characteristic index. The characteristic index is obtained by calculating the ratio of the number of various POIs within a specific range to the area of ​​the range, as shown in Table 2.

[0133] Table 2 Summary of OD site land use indicators

[0134]

[0135]

[0136] The method for selecting OD prediction variable features is as follows: Use the backward recursive elimination method to gradually remove the variables that contribute the least to the model prediction until only the variables that have a significant impact on OD passenger flow prediction are retained. The specific steps are as follows: Starting from the set containing all features, gradually remove the weakest performing features, and iterate repeatedly until the set feature subset size is reached. In each round of iteration, the features are reordered using the feature importance evaluated by the linear regression model, and the features with the lowest importance scores are removed. The basic form of the linear regression model is:

[0137] f(X)=ω1x1+ω2x2+…+ω d x d +b (8)

[0138] Where, X=(x1;x2;…;x d ), x i is the value of X on the ith attribute.

[0139] For the linear regression model, after the input features are normalized, the coefficient W in front of each feature variable is W = (ω1; ω2; ...; ω d ) can more intuitively reflect the importance of each feature. The larger the absolute value of the coefficient, the more important the feature is.

[0140] According to the idea of ​​stepwise regression, the statistic is introduced Where S is the residual standard deviation, P i is the partial regression sum of squares. If the statistic |T i |≥t α , then we think ω d is significantly different from zero, so the corresponding x is retained d .

[0141] S2. Perform two-stage clustering processing on all OD passenger flows in the subway network to complete the preliminary classification of OD passenger flows and ensure that each type of OD passenger flow has similar scale and time-varying law.

[0142] The specific method is as follows:

[0143] S2.1. Based on the trend data of OD passenger flow distribution, the first stage of OD passenger flow clustering is performed to ensure that the ODs within the cluster have similar passenger flow change patterns;

[0144] Calculate OD passenger flow characteristic indicators:

[0145] ① Full-day OD passenger flow

[0146] The total OD passenger flow from station i to station j on a certain day is:

[0147]

[0148] In the formula, is the full-day OD passenger flow from starting point i to end point j on operation day k, is the time-divided OD passenger flow from starting point i to end point j during operating period t on operating day k.

[0149] ② Morning and evening peak and off-peak hour coefficients

[0150] The morning peak period is defined as 7:00-9:00, the off-peak period is defined as 12:00-14:00, and the evening peak period is defined as 17:00-19:00. The ratio of the OD passenger flow during the morning, evening peak, and off-peak periods to the total daily passenger flow is calculated for all OD pairs, and the morning, evening peak, and off-peak hour coefficients are calculated.

[0151] ③OD attraction

[0152] The OD attraction is introduced to measure the attraction between a specific starting point and a destination. It is defined as an indicator of the average passenger flow between OD pairs in different time periods over a period of time, as shown in the following formula:

[0153]

[0154] In the formula, is the passenger flow attraction intensity of starting point i and end point j in time period t, is the passenger flow between OD pair ij in the tth time period on the kth day, and n is the number of study days.

[0155] The first stage classification based on OD passenger flow distribution indicators:

[0156] Based on the passenger flow characteristic indicators given above, the fuzzy C-means clustering method is used to perform the first-stage classification of the OD passenger flow of the entire network.

[0157] Assume that the sample set is W, and use x i =(x i1 ,x i2 ,...,x ij ) represents the clustering index corresponding to sample i, where x ij For the j-th eigenvalue of sample i, determine the initial matrix of the following form:

[0158] W={x1,x2,...,x i ,...,x n} (11)

[0159] Assuming the number of clusters is O, the j-th class sample is Then the j-th cluster center is in is the average value of the kth feature, as follows:

[0160]

[0161] The optimal number of clusters O is determined by the F statistic, which follows an F distribution with degrees of freedom (r-1, nr). If F>F α (r-1,nr)(α=0.05), the difference between classes is significant, and the classification result is feasible. The larger the F value, the better the classification effect. The calculation of F statistic is as follows:

[0162]

[0163] In the formula, for and The distance between For sample With its center spacing.

[0164] The sample set is fuzzy processed, and the membership of the data point takes the value [0,1], which is expressed as the probability that the data point belongs to a certain category. The objective function J of fuzzy C-means clustering m In the following form:

[0165]

[0166] In the formula, o i is the cluster center of fuzzy group i; w ij is the jth data point x j The degree of membership to the i-th category; ||o i -x j || is the cluster center o of the jth data and the i-th fuzzy group i Euclidean distance; m is the fuzzy coefficient, and its value is m∈[1,∞).

[0167] Based on formula (14), the new objective function is constructed as follows:

[0168]

[0169] In the formula, λ j (j=1,2,…,n) represents the Lagrange multipliers of n constraint equations.

[0170] Derivation of formula (15) yields two necessary conditions for satisfying the minimum value:

[0171]

[0172] From equations (16) and (17), we can get the cluster center o i And the membership matrix W.

[0173] The specific steps of the fuzzy C-means clustering method are as follows:

[0174] Step 1: Calculate the initial membership matrix W;

[0175] Step 2: Calculate o cluster centers o according to the necessary conditions of formula (16) i (i=1,2,...,o);

[0176] Step 3: Calculate the objective function value If this value is less than a specific threshold or its change is lower than the set threshold, the algorithm terminates; otherwise, the membership matrix W is updated again and returns to step 2 to continue iteration.

[0177] S2.2, based on the clustering in step S2.1, perform OD two-stage clustering based on passenger flow size data to ensure that the OD passenger flow within the class has similar passenger flow change trends and passenger flow scales. The model framework of the two-stage clustering of subway network OD passenger flow is as follows: Figure 2 shown.

[0178] Two-stage classification based on OD passenger flow scale:

[0179] Based on the first-stage OD pair classification, the K-Means algorithm is used to perform the second-stage classification of the OD passenger flow of the entire network. First, the "elbow method" is used to determine the number of clusters; then, the K-Means cluster analysis method is used to perform the second-stage clustering of OD pairs based on the first-stage clustering results of OD pairs and the hourly passenger flow of OD.

[0180] S3. Evaluate the predictability of time series data of different types of OD passenger flows in the subway network and detect the similarity and stability of OD passenger flows.

[0181] A model for evaluating the predictability of OD time series data is proposed. The model consists of two parts: similarity measurement and stationarity detection.

[0182] (1) Time series similarity measurement model

[0183] The Pearson correlation coefficient method is used to test the similarity between the current passenger flow and the historical passenger flow data for the same period of the same week with the help of the correlation coefficient matrix. The correlation coefficient method is as follows:

[0184]

[0185] In the formula, is the OD passenger flow vector, U t is the t-th OD pair u, i and j are week numbers, and e is the day of the week.

[0186] Calculate the passenger flow correlation coefficient of any two days and obtain a seventh-order correlation coefficient matrix R U (i e ,j e ), as shown below:

[0187]

[0188] Calculate the average correlation coefficient of OD As shown below:

[0189]

[0190] In the formula, the order l of the correlation coefficient matrix is ​​7.

[0191] For each OD category k, calculate the average correlation coefficient C of all OD pairs in this category ke , as follows:

[0192]

[0193] C ke The value of is [0,1]. The larger the value, the higher the similarity between passenger flow sequences. For this type of OD passenger flow, the time series model can be used to predict it.ke When is smaller, more complex deep learning models are adopted for prediction.

[0194] (2) Time series stationarity test model

[0195] The stability test technology is used to evaluate the stability of the OD passenger flow data series, namely ADF (Augmented Dickey-Fuller), and its calculation model is:

[0196]

[0197] Where a is a constant, b is the coefficient of the time trend, t is the time variable, and n is the lag order of the autoregressive process.

[0198] The constant a and time trend b are added to the model, and the AIC criterion (Akaike Information Criterion) is used to determine the lag order n of the autoregressive process.

[0199] After clarifying the model structure, perform an ADF test on the passenger flow time series of each OD pair for seven consecutive days from Monday to Sunday to obtain the corresponding P value, as shown in the following formula:

[0200] P U =(P1,P2,...,P U ) (twenty three)

[0201] For each OD passenger flow of category k, calculate the average probability P of all OD pairs in the category k :

[0202]

[0203] The P value is between 0 and 1, and its size reflects the strength of the stationarity of the passenger flow data series. If the P value is lower than the preset significance level threshold, it indicates that the passenger flow time series has statistically significant stability at this significance level and can be used for short-term prediction.

[0204] (3) Time series predictability evaluation model

[0205] The final evaluation criteria of the predictability assessment model are: if at a given similarity and stationarity level, the time series of a specific category of OD at a given time granularity shows excellent similarity and stationarity, it indicates that this type of OD has significant time series characteristics and can be predicted using time series methods; if the similarity and stationarity tests of this type of OD cannot simultaneously reach a good level, then this type of OD should consider using a more complex prediction model in subsequent predictions.

[0206] S4. For different types of OD passenger flows, the ARIMA-based prediction model and the improved Attention-LSTM-based prediction model are used to predict passenger flow.

[0207] Applicable prediction models are constructed for different types of OD, including:

[0208] S4.1. Propose a data structure reconstruction strategy to reduce the impact of the minimum value in OD passenger flow data through data structure reconstruction and restoration operations, and achieve better prediction accuracy;

[0209] The method of data structure reconstruction is as follows:

[0210] In order to improve the impact of the sparsity of OD passenger flow distribution sequence, a data structure reconstruction method is introduced, which can not only improve the prediction accuracy but also reduce the amount of calculation.

[0211] First, define the OD passenger flow matrix Q of the line network in the tth period on the kth day k,t , is of the following form:

[0212]

[0213] Where i is the entry station, j is the exit station, k is the date, t is the time period number, and q is the passenger flow.

[0214] Calculate the historical OD average passenger flow matrix M t , and the OD matrix Q k,t Correspondingly, M t The calculation formula is:

[0215]

[0216] Where n is the number of days of historical data.

[0217] Passenger flow of a single OD in different time periods during a day It can be expressed as:

[0218]

[0219] The corresponding single historical OD average passenger flow matrix is:

[0220]

[0221] The structure of the input data is reconstructed by the following steps:

[0222] S4.1.1, set the minimum threshold ε, for the historical average passenger flow matrix of a single OD When m ij At time t When it is less than ε, its historical OD data The value at time t It will not be included in the model, but a general model will be used for prediction. When the time granularity is 15 minutes, set ε = 1, when the time granularity is 30 minutes, set ε = 2, and when the time granularity is 60 minutes, set ε = 4.

[0223] S4.1.2 For each The historical average passenger flow matrix m ij Compared with the threshold value of S4.1.1, the marking matrix m ij Only the element positions above the threshold are retained The data at these positions in the dataset are obtained as follows:

[0224]

[0225] S4.1.3. The valid data in is prepended and the mask value (usually 0) is used to fill the end of the sequence to obtain the reconstructed data:

[0226]

[0227] S4.1.4. After the prediction is completed, the data structure is restored according to the element position information retained by the formula in step S4.1.2.

[0228] S4.2. Construct an ARIMA-based OD prediction model, which is used to predict the OD pairs that perform best in the time series predictability evaluation model. This type of OD has the best stability and similarity.

[0229] OD prediction model based on ARIMA:

[0230] For the OD pair type that performs best in the time series predictability test, the ARIMA-based time series model forecasting method is used for forecasting.

[0231] The core purpose of the ARIMA model is to use the inherent autocorrelation and difference mechanism of the data to extract the potential laws of the time series and predict future data accordingly. The ARIMA model can be expressed as ARIMA (p, d, q). There are three parameters that need to be set in the model to represent the prediction structure of the model, where p is the number of regression terms, d is the number of differences required to become a stationary series, and q is the number of moving average terms. The model calculation is as follows:

[0232] (1) d represents the order of the difference (I, Integrated) link, that is, the number of difference operations required to achieve sequence stability. If the data obtained after a difference of the original data is still not stable, it is necessary to perform a difference again until the data becomes stable. The first-order expression is formula (31) and the second-order expression is formula (32):

[0233] d1=y t -y t-1 (31)

[0234] d2=(y t -y t-1 )-(y t-1 -y t-2 ) (32)

[0235] Where d1 and d2 are differential integration values, y t It is the OD value of the current period.

[0236] (2)q is the order of the moving average (MA) part, that is, the number of historical forecast error terms included in the model. The calculation of the q-order autoregressive process is as follows:

[0237]

[0238] In the formula, u is the mean, ε t is the error term, θ i is the moving average coefficient, and q is the number of moving average terms. The value of q is determined by the autocorrelation function (ACF). The autocorrelation function (ACF) is used to determine the relationship between the current value in a time series and its past values.

[0239] (3) p defines the order of the autoregressive (AR) part, that is, the number of historical observations considered in the model, which is used to predict the current value based on the previous observations, reflecting the dependence of the time series on its own historical values ​​and revealing its long-term dependence. The calculation of the p-order autoregressive model is as follows:

[0240]

[0241] In the formula, γ i is the autoregressive coefficient and p is the regression order. The value of p is determined by the partial autocorrelation function (PACF). The partial autocorrelation function is used to determine the relationship between the current value of the time series and its past error terms.

[0242] (4) The values ​​of p and q are usually analyzed by introducing the autocorrelation function (ACF) and partial autocorrelation function (PACF), and the truncation or tailing characteristics of the data are identified with the help of ACF and PACF graphs. Truncation refers to the situation where the correlation coefficient of the time series suddenly drops to zero and remains unchanged after a certain delay order, while tailing refers to the situation where the correlation coefficient gradually decreases after reaching a certain order and eventually tends to zero.

[0243] Adding the above three formulas together, we get the ARIMA model, as shown below:

[0244]

[0245] Where p is the order, q is the error order, and k is a constant.

[0246] The process of using the ARIMA model to predict OD passenger flow can be constructed as follows: Figure 3 shown.

[0247] S4.3. For OD pairs that perform poorly in the time series predictable evaluation model, a passenger flow prediction model based on the improved Attention-LSTM is constructed, and multivariate input is considered to improve the prediction accuracy of the model for such OD.

[0248] OD prediction model based on improved Attention-LSTM:

[0249] For the OD pair types that perform suboptimally in the time series predictability test, the improved Attention-LSTM model is used for prediction. The model has two parallel LSTM branches, each consisting of a two-layer LSTM network. One branch processes the OD passenger flow matrix after data structure reconstruction, with the aim of ignoring small passenger flow data during the prediction process and restoring the output results after the prediction is completed. The other branch directly performs prediction analysis on the original OD passenger flow data. The model architecture is as follows: Figure 4 .

[0250] From the two-layer network structure of LSTM, we can see that the processed sequence output is taken from the LSTM unit of the final time step. At the same time, the model also generates hidden states for each time step. However, due to the influence of the time step, different time steps contribute to the current prediction state to different degrees, which may lead to the limited ability of the model to remember and utilize early information when processing long time series. Adding the attention mechanism to the LSTM model can significantly enhance the performance and flexibility of the model and enhance the model's ability to process long sequence data.

[0251] The attention mechanism is added after the two layers of LSTM to build an OD prediction model based on the improved Attention-LSTM. In the OD passenger flow prediction model, the input of the attention mechanism is a series of hidden states H = [h1,h2,…,h n ], the calculation steps of attention value are as follows:

[0252] Step 1: For each hidden layer state value h i ,i∈[1,n], calculate the attention score S i :

[0253] S i =tanh(W i h i +b i ) (36)

[0254] Where W i ,h i are weights and biases.

[0255] Step 2: Use SoftMax to calculate the attention score S i Perform normalization to obtain the weight coefficient α of the corresponding element i :

[0256]

[0257] Step 3: Set the weight coefficient α i For the hidden layer state value h i Weighted summation gives the output value h′ of the attention mechanism:

[0258]

[0259] The multi-feature variables selected above are used as model variables to construct a multi-variable OD passenger flow prediction model. The calculation process is as follows: Figure 5 shown.

[0260] Case Study:

[0261] The OD passenger flow data of Nanjing Rail Transit from March 4 to March 24, 2018 is used as the training set to build a short-term prediction model, and the data from March 25 to March 31, 2018 is used as the test set to evaluate the effectiveness of the prediction model at different time granularities. The time granularity of OD passenger flow data is 15 minutes, 30 minutes and 60 minutes. Among them, the data with 15-minute granularity is used for training and evaluating the model, while the data with 30-minute and 60-minute granularity is used to evaluate the OD prediction effect at different time granularities.

[0262] S1. Quantitatively analyze the multiple factors that affect OD passenger flow, determine the feature set of the influencing factors, and use it as the input condition of the prediction model, thereby determining the input data set of the prediction model.

[0263] The operating hours of Nanjing Metro are from 6:00 to 23:00, and the number of stations is 150. Each operating day includes 17 150×150 OD matrices, and the whole day is divided into 17 segments with a granularity of 60 minutes. Each operating day has a 22350×17 data set. The data range is 31 consecutive operating days, and there are 31 22350×17 data sets in total.

[0264] The system clustering module in SPSS was used for preliminary classification. The results showed that when the number of clusters was set to 3, a better classification effect could be obtained. The results of the system clustering were used as the initial value of the subsequent K-Means clustering. Finally, the 31 operating days were divided into 3 categories through K-Means clustering. The specific classification results are shown in Table 3.

[0265] Table 3 Classification results of operation days

[0266]

[0267] Based on the principle of the optimal segmentation method, this embodiment divides the operating time periods. Taking the operating day D.Type1 as an example, the operating time periods are divided as follows:

[0268] (1) Calculate the classification loss function

[0269] Calculate the classification loss function L[b(n,k)] corresponding to each cluster number k, and obtain the descending curve of the classification loss function, such as Figure 6 shown.

[0270] (2) Determine the optimal number of categories

[0271] The optimal number of classifications k is determined by the inflection point of the L[b(n,k)] curve. Figure 6 It can be seen that when the number of classifications k≤5, the classification loss function decreases rapidly; when the number of classifications k≥10, the classification loss function decreases gently, and the inflection point appears in the range of 5<k<10. Combined with the elbow method, the optimal number of classifications k=7 for operating day D.Type1 is determined, and the classification loss function value L[p(n,k)]=140 at this time.

[0272] (3) Divide the operating time

[0273] According to the classification point labeling matrix J when k=7 n×n, backtrack to find the optimal classification scheme p(n,k), and then get the time period division result of D.Type1 on the operating day. Apply the same method to divide the operating time periods of D.Type2 and D.Type3, and finally get the clustering results of the operating time periods on different operating days. The operating time period category is represented by P·Type, as shown in Table 4.

[0274] Table 4 Results of operating period division for different types of operating days

[0275]

[0276] According to Table 4, we can see that: (1) From the time division results of operating day D·Type1, it has obvious morning peak period (7:00-9:00) and evening peak period (18:30-20:30). (2) Operating day D·Type2 roughly uses 15:15 as the dividing line. The division results before the boundary are consistent with those of operating day 1, and the division results after the boundary are highly similar to those of operating day 3. (3) From the time division results of operating day D·Type3, it is not possible to clearly divide the morning and evening peak and non-peak periods, indicating that the travel time of passengers on weekends is highly random.

[0277] The Pearson analysis results of the OD passenger flow data and the OD data of the previous different time periods are shown in Table 5. It can be seen that the Pearson correlation coefficients are all high, indicating that these factors are significantly correlated with the current OD passenger flow.

[0278] Table 5 Correlation analysis results of previous passenger flow

[0279] variable Pearson correlation Significance (two-sided) OD volume in the first 15 minutes 0.913 0.000 OD volume in the first 30 minutes 0.876 0.000 OD volume in the first 45 minutes 0.792 0.000 OD volume in the first 60 minutes 0.684 0.000

[0280] Similarly, the Pearson correlation coefficient is used to measure the correlation between historical passenger flow and current passenger flow, and to test the correlation between variables. The correlation coefficients and significance of the three OD pairs of Maigaoqiao-Xinjiekou, Youfangqiao-Jiqingmen Street, and Liuzhou East Road-Xiaoshi at the time granularity of 30 minutes and 45 minutes are shown in Table 6.

[0281] Table 6 Correlation between historical passenger flow and current passenger flow

[0282]

[0283] It can be seen that: (1) The correlation between the historical passenger flow and the current passenger flow in the three OD pairs of Maigaoqiao-Xinjiekou, Youfangqiao-Jiqingmen Street, and Liuzhou East Road-Xiaoshi at the time granularity of 30 minutes and 45 minutes is greater than 0.85, and the significance P<0.001, indicating that there is a strong correlation between the two, indicating that the historical passenger flow in the same period of the week can largely represent the current passenger flow. (2) From the perspective of the type of operating day, the correlation coefficient of OD passenger flow on weekdays is greater than that on weekends, indicating that the distribution of OD passenger flow on weekdays is more stable and has a strong similarity; while the passenger flow correlation on Friday is lower than that on Monday, which may be due to the fact that Friday is close to the weekend, the travel activities of passengers change, and the regularity of travel is weakened; the passenger flow correlation on weekends is lower than that on weekdays, indicating that passengers have more flexibility in travel on weekends, and the travel for entertainment activities increases significantly, and the passenger flow fluctuation will be more obvious. (3) From the perspective of different time granularities, the correlation with a time granularity of 45 minutes is stronger than the correlation with a time granularity of 30 minutes.

[0284] Then, Pearson correlation analysis was performed on the OD volume and the entry and exit volumes at the starting and ending points, respectively. Taking Zhujiang Road-Maigao Bridge and Youfang Bridge-Jiqingmen Street as examples, the Pearson correlation analysis results of the OD volume and the entry and exit volumes at the starting and ending points are shown in Table 7.

[0285] Table 7 Correlation analysis results

[0286]

[0287] Taking the average OD passenger flow of Nanjing Rail Transit for one week from March 5 to March 11 as an example, the daily average passenger flow of each type of OD starting and ending stations is calculated, and the relationship between the starting and ending station types and OD volume on each type of operating day is analyzed according to the results of the operation day division.

[0288] If the average daily OD passenger flow of a certain type of origin and destination station is greater than the average OD volume of all types of origin and destination stations, the variable is taken as 1, otherwise it is taken as 0. The quantitative results of the relationship between the OD volume and the origin and destination station types under D·Type1, D·Type2, and D·Type3 on the operating day are calculated, as shown in Tables 8 to 10, where S1 to S6 are residential-oriented, employment-oriented, job-housing dislocation, dislocation-biased residential, dislocation-biased employment, and hub-comprehensive stations, respectively.

[0289] Table 8 Quantification of the daily passenger flow of different OD station types on the operating day D·Type1

[0290]

[0291]

[0292] Table 9 Quantification of the daily passenger flow of different OD station types on the operating day D·Type2

[0293]

[0294] Table 10 Quantification of the daily passenger flow of different OD station types on the operating day D·Type3

[0295]

[0296] It can be seen that: (1) On the operating day D·Type1, the OD volume of stations with residential-oriented and employment-oriented starting and ending stations is large, while the passenger flow from various stations to hub-type stations is small. This is because the purpose of passengers' travel on weekdays from Monday to Friday is mainly commuting, so the OD volume between residential-oriented, employment-oriented, dislocated residential-oriented and dislocated employment-oriented stations will be large. On the operating day D·Type2, all OD type stations have obvious passenger flow, indicating that the travel purpose and mode of the main passenger flow on Friday have changed significantly, and some passengers go to hub-type comprehensive stations, resulting in the dispersion of passenger flow aggregation characteristics. (2) On weekends, the OD volume between residential-oriented stations and employment-oriented stations is significantly reduced, while the passenger flow of hub-type comprehensive starting and ending points is significantly increased, indicating that the purpose of passengers' travel on weekends is mostly for travel and other activities; in addition, there are also some obvious passenger flows at the work-residence dislocation type and dislocation-oriented type stations, indicating that the travel purpose and mode of passengers on weekends are more diverse, and the passenger flow distribution is more dispersed than that on commuting days.

[0297] Statistics on the daily passenger flow of all 10 Nanjing rail transit lines from Monday to Sunday from March 5 to March 11: Figure 7 shown.

[0298] Depend on Figure 7 It can be seen that from the passenger flow change trend within a week, the passenger flow changes of Line 1, Line 2 and Line 3 are similar every day in a week, with slight fluctuations from Monday to Thursday, and a significant increase on Friday, which is the largest in a week, and a significant decrease on weekends, with the smallest passenger flow on Sunday; the passenger flow trends of Line 4 and Line 10 are relatively similar in a week, with small fluctuations from Monday to Friday, and a significant decreasing trend on Saturday, with the smallest passenger flow on Sunday; while the passenger flow of S1, S3, S7, S8 and S9 remains basically unchanged within a week.

[0299] Judging from the passenger flow of each line, the passenger flow of Line 1, Line 2, and Line 3 is much greater than that of other lines, indicating that these three lines bear a large part of the passenger flow in the subway network, and their distribution also has a great impact on the passenger flow of the entire network, and can reflect the distribution characteristics of the passenger flow of the entire network to a certain extent. However, the passenger flow of Line S3, Line S7, and Line S9 is obviously very low because they are located on the edge of the city and bear less passenger flow pressure. This article roughly divides the Nanjing rail transit network into urban lines and suburban lines according to whether it passes through the city center and the size of the passenger flow. The classification results are shown in Table 11 below.

[0300] Table 11 Types of Nanjing rail transit lines

[0301]

[0302] According to Table 11, the origin and destination line types are divided into: urban line-urban line, urban line-suburban line, suburban line-urban line and suburban line-suburban line. The OD information corresponding to different line types is shown in Table 12.

[0303] Table 12 OD information of different line types

[0304]

[0305] Finally, the backward recursive feature elimination method based on the linear regression model was used to eliminate the least important feature factors, and the final prediction variables were summarized as shown in Table 13. These variables will be used as input indicators for the subsequent OD prediction model.

[0306] Table 13 Final selection results of predictor variables

[0307]

[0308]

[0309] S2. Perform two-stage clustering on all OD passenger flows of the subway network to complete the initial classification of OD passenger flows.

[0310] The distribution characteristic indicators of OD pairs are selected: morning peak hour coefficient, evening peak hour coefficient, off-peak hour coefficient and OD attraction. With 15 minutes as the time granularity, 18882 5×1 data are clustered to obtain OD pair categories with similar passenger flow change patterns.

[0311] First, fuzzy C-means clustering is used to perform the first-stage clustering of OD passenger flow, and the classification results are shown in Table 14.

[0312] Table 14 OD classification results for the first stage

[0313]

[0314] like Figure 8 As shown in the figure, the clustering effect is analyzed by taking the first-stage classification results of the OD pairs of the entire Nanjing rail transit network on March 5 as an example. It can be seen from the results that all OD pairs within the class show highly similar passenger flow change patterns throughout the day, while there are significant differences in passenger flow change trends between classes.

[0315] Then, according to the passenger flow size of OD in different time periods, the 1st to 4th ODs are clustered in the second stage. The category, corresponding number and representative OD pair results of each type of OD are shown in Table 15.

[0316] Table 15 Final results of OD classification

[0317]

[0318] Fig. 9 The two-stage classification results of all OD pairs are divided into 12 categories of OD. In each subcategory, all ODs in the category have similar change trends and passenger flow scales.

[0319] S3. Evaluate the predictability of time series data of different types of OD passenger flows in the subway network and detect the similarity and stability of OD passenger flows.

[0320] According to the type of operating day, the similarity of the data of different operating days in four consecutive weeks is analyzed, and the stability of the data on different days of the same week is tested, as shown in Table 16.

[0321] Table 16 Predictability evaluation model data

[0322]

[0323]

[0324] The similarity threshold is set to 0.90, and the significance level is set to 0.01. If the correlation coefficient of the passenger flow time series of all operating days exceeds 0.90 and the P value is less than 0.01 at the time granularity of 15 minutes, it is determined that the passenger flow series has obvious time series characteristics and meets the predictability evaluation. The evaluation results are shown in Table 17.

[0325] Table 17 Similarity and stability measurement results of various ODs

[0326]

[0327] Based on the above analysis, the OD class is reclassified according to the predictability evaluation model, and different models are used for prediction. The classification results are shown in Table 18.

[0328] Table 18 Reclassification of OD categories based on predictability assessment

[0329]

[0330] S4. For different types of OD passenger flows, the ARIMA-based prediction model and the improved Attention-LSTM-based prediction model are used to predict passenger flow.

[0331] (1) ARIMA model parameter setting

[0332] First, the OD pair A1 (classes 1-1, 2-1, and 4-1) used for ARIMA time series forecasting has passed the ADF test and the effect is good, meeting the requirements of time series stability. The P value of the white noise sequence data after the first-order difference of the A1 class OD pair is less than 0.01, indicating that there is no unit root at the 1% significance level, and the original hypothesis is rejected, proving that the data after the first-order difference is stable. Therefore, d=1 in ARIMA(p,d,q).

[0333] Secondly, to explore the value of neutralization, it is necessary to observe the autocorrelation diagram (ACF) and partial autocorrelation diagram (PACF) of the time series data and draw the ACF diagram and PACF diagram of the data after the first-order difference, such as Fig.10 As shown. The judgment basis is that if PACF is truncated after the order, the last non-zero value of the PACF graph is set to q; if ACF is basically zero after the order, the last non-zero value of the ACF graph is set to q. Therefore, the parameters are set to p = 3, q ​​= 3.

[0334] According to the above analysis, the model is defined as ARIMA(3,1,3), which will be used to predict the OD pairs of category A1 (category 1-1, 2-1, and 4-1) later.

[0335] (2) Improved Attention-LSTM model parameter settings

[0336] The parameter settings involved in the LSTM prediction model mainly include: the number of hidden layer nodes, Epoch, loss function and Dropout rate.

[0337] According to the model evaluation indicators, the experimental prediction effects of different numbers of hidden layer nodes and Epoch values ​​are compared, the MAE and MAPE values ​​of different loss functions are calculated, and the prediction errors under different combinations of parameter settings are obtained, as shown in Table 19.

[0338] Table 19 Error experiment of parameter settings

[0339]

[0340]

[0341] As can be seen from the table, when the number of hidden layer nodes is 100 and the Epoch value is 80, the prediction model error MAE and MAPE values ​​can generally reach a low level. The overfitting rates OverfitRatio (MAE) and OverfitRatio (MAPE) corresponding to the parameter values ​​are calculated, and the results are 10.42% and 8.97% respectively. The overfitting rates are both lower than 30%, and the training effect is good. Therefore, based on the above experimental results, the loss function is selected as MAPE, and the number of hidden layer nodes is set to 100 and the Epoch is set to 80.

[0342] The most important thing when using Dropout is to set the Dropout Rate. Let the probability of dropping a neuron be p. In order to find the optimal Dropout parameter value for the passenger flow distribution data set and LSTM network structure in this article, it is necessary to conduct experimental tests on different Dropout values, and compare the model error values ​​under different Dropout parameter values ​​when Epoch is 50, 80, 100, and 120 to select the optimal Dropout rate. The experimental results are shown in Table 20.

[0343] Table 20 Dropout parameter setting experiment

[0344]

[0345] It can be seen from Table 20 that after using Dropout, the prediction error MAE and MAPE values ​​are reduced to varying degrees. This phenomenon shows that the setting of the Dropout rate helps to improve the prediction accuracy of the model. This adjustment method not only enhances the model's processing and learning capabilities for OD passenger flow data, but also effectively avoids the model's excessive specific dependence on data features, thereby improving the model's generalization ability.

[0346] Experiments show that the model errors are slightly different under the three given Dropout rates. Combined with the Epoch value of 80 in the previous article and the prediction error data in Table 20, the Dropout value is set to 0.5.

[0347] In summary, in the OD prediction model based on Attention-LSTM, the loss function is set to MAPE, the number of hidden layer nodes is set to 100, the Epoch is set to 80, and the Dropout value is set to 0.5.

[0348] (3) Analysis of prediction effects of different ODs

[0349] For the OD pairs with the best predictability evaluation (A1 category), the ARIMA-based OD prediction time series model is used; for the OD pairs with the second-best predictability evaluation (A2 category), the improved Attention-LSTM network OD prediction model is used. The OD of Nanjing Rail Transit is predicted for the full week from March 25 to March 31, 2018, and the prediction errors of each prediction model are compared by considering the type of operating day.

[0350] Taking the 15-minute time granularity as an example, the overall prediction effect of A1 type OD pairs under different types of operating days is compared based on the ARIMA time series forecasting model. The prediction effect is shown in Table 21.

[0351] Table 21 Forecast errors of different OD categories on different operating days based on ARIMA forecasts

[0352]

[0353] From Table 21 we can see that:

[0354] (1) The MAE values ​​of the prediction error on the operation day (D.Type3) are smaller than those on the operation day (D.Type1) and the operation day (D.Type2). The possible reason is that the operation day 3 is the weekend, and the passenger flow is generally smaller than that on weekdays. (2) The MAPE values ​​of the prediction error on the operation day 3 are larger than those on the operation days 1 and 2, indicating that the passengers on the operation day 3 travel more flexibly and the passenger flow is not very regular. (3) The MAE values ​​of the three types of OD pairs are between 3 and 6, and the MAPE values ​​are between 0.15 and 0.35. The reason is that these three types of OD pairs are all OD pairs with large passenger flow and stable time series characteristics. The large passenger flow leads to a larger MAE value, and the obvious and easy-to-predict time series characteristics lead to a smaller MAPE value.

[0355] One OD pair is selected from each of the 1-1, 2-1, and 4-1 OD categories, namely Maigaoqiao-Zhujiang Road, Jiqingmen Street-Youfangqiao, and Tianlong Temple-Sanshan Street, and the prediction effects of the true value and predicted value of a single OD pair are compared for the whole day and time periods, such as Figure 11 to Figure 13 shown.

[0356] from Figure 11 to Figure 13 It can be seen that:

[0357] ① The OD prediction effect of Maigaoqiao-Zhujiang Road on the three types of operating days is good. The real value time period curve and the predicted value time period curve are almost completely fitted, and the prediction error is small, indicating that the time series stability of this type of OD is good, and the ARIMA time series prediction model can achieve good results.

[0358] ② The OD prediction effect of Jiqingmen Street-Youfangqiao on the three types of operating days is good, and the passenger flow distribution curves of the actual value and the predicted value are almost fitted, indicating that the time series stability of this type of OD is also good, and the ARIMA time series prediction model can achieve good results.

[0359] ③ The OD pair Tianlong Temple-Sanshan Street shows bimodal characteristics on operation day 1 and operation day 2, and multimodal characteristics on operation day 3. Its prediction effect is better during the peak hours of operation days 1 and 2, and secondly during the off-peak hours, indicating that the OD pair has better passenger flow stability during the morning and evening peak hours on weekdays, and worse during the off-peak hours. Overall, the prediction effect of this OD pair can also reach a good level.

[0360] In summary, the ARIMA-based time series OD prediction model can achieve good results in OD pair category A1, which also shows that for the prediction of OD pairs with particularly obvious time series characteristics, a simple time series model can achieve good results.

[0361] For OD pairs with unstable time series features, it is necessary to use the improved Attention-LSTM to predict in order to improve the prediction precision and accuracy. Taking the 15-minute time granularity as an example, the prediction effect of the A2 OD pair is compared based on the improved Attention-LSTM model. The prediction effect is shown in Table 22.

[0362] Table 22 Prediction effect of different categories of OD on different operating days based on improved Attention-LSTM

[0363]

[0364]

[0365] It can be seen from Table 22 that:

[0366] ① The prediction error MAE values ​​of the operating day (D.Type3) are smaller than those of the operating day (D.Type1) and the operating day (D.Type2). The possible reason is that the operating day 3 is the weekend, and the overall passenger flow will be smaller than that of the weekday.

[0367] ② The forecast error MAPE value of operation day 3 is larger than that of operation day 1 and operation day 2, which indicates that passengers on operation day 3 travel more flexibly and passenger flow is not very regular.

[0368] ③Except for 3-1, which is an OD pair with large passenger flow, the MAE values ​​of the other four OD pairs are between 0.5 and 2, and the MAPE values ​​are between 0.15 and 0.5. It can be seen from the MAE and MAPE values ​​that the prediction accuracy of these four categories of OD pairs is good, but because their time series characteristics are not as obvious as those of the A1 OD pairs, there is a slight increase in the error in the MAPE value.

[0369] One OD pair is selected from each of the five OD categories, namely Xiongzhou-Getang, Changfu Street-Tianrun City, Nanjing Station-Nanjing South Station, Jingtian Road-Maqun, and Chunjiang Road-Youfang Bridge. A time-based passenger flow comparison curve is drawn to compare the actual passenger flow with the predicted passenger flow. The prediction effect of the actual value and predicted value of a single OD pair is compared in different time periods. Figure 14 to Figure 18 shown.

[0370] from Figure 14 to Figure 18 It can be seen that:

[0371] ① The prediction effects of various OD pairs on operation day 1 and operation day 2 are generally better than those on operation day 3, indicating that the passenger flow on weekdays is more stable and has stronger temporal characteristics.

[0372] ② The prediction effect of OD pairs Xiongzhou-Getang and Changfu Street-Tianrun City is better than that of the other three OD pairs. The actual curves and predicted curves of Xiongzhou-Getang and Changfu Street-Tianrun City can basically fit, indicating that the prediction effect is better for such OD pairs with obvious morning and evening peaks. For OD pairs with multiple peaks, no peaks, and small passenger flow double peaks, the prediction error is relatively large.

[0373] In summary, the OD prediction model based on the improved Attention-LSTM can basically achieve good results in OD pair category A2, which also shows that the improved neural network model can improve the prediction accuracy of OD pairs with unclear time series characteristics to a certain extent, but its prediction performance for OD pairs with smaller passenger flow still needs to be improved.

[0374] (5) Comparison of prediction effects of different models

[0375] Since OD for category A2 (1-2, 2-2, 3-1, 3-2, 4-2) performs suboptimally in the time series predictability assessment and has less obvious time series characteristics, the prediction of this type of OD and the previous prediction are implemented in the Attention-LSTM model under multivariate conditions. In order to verify the superiority of the improved Attention-LSTM prediction model under multivariate conditions, the improved LSTM model under univariate conditions, the improved LSTM model under multivariate conditions, and the improved Attention-LSTM model under multivariate conditions are compared and analyzed together to verify the prediction performance of the improved model.

[0376] The above three models are used to predict OD at three time granularities of 15 minutes, 30 minutes, and 60 minutes, and the prediction results of each model are obtained. Finally, the prediction accuracy of each model is calculated. The comparison of OD passenger flow prediction errors of these three models is shown in Figure 2. Fig.19 shown.

[0377] from Fig.19 It can be seen that:

[0378] ① Comparing the prediction effects of model 1 with models 2 and 3, the OD prediction model that considers multiple influencing factors under multivariate conditions obtains better prediction effects. Both OD prediction models under multivariate conditions have a certain degree of reduction in prediction errors compared with the OD prediction model under single-factor conditions. The reason is that the consideration of multiple factors can enable the model to obtain more beneficial feature inputs, thereby reducing the prediction error and making the prediction results closer to the actual situation. This also shows that the passenger flow prediction model that considers multiple influencing factors of OD is superior.

[0379] ② Comparing the prediction results of Model 2 and Model 3, both consider multiple influencing factors of OD passenger flow, but Model 3 adds an attention mechanism after the second hidden layer, which makes the model more focused on the time periods, regions or features that have an important impact on the prediction results, and can capture effective data information. After improving the model structure, the model accuracy is improved to a certain extent.

[0380] The above are only embodiments of the present invention, and the common knowledge such as the known specific structures and / or characteristics in the scheme are not described in detail here. It should be pointed out that for those skilled in the art, several deformations and improvements can be made without departing from the structure of the present invention, which should also be regarded as the protection scope of the present invention, and these will not affect the effect of the implementation of the present invention and the practicality of the patent. The scope of protection required by this application shall be based on the content of its claims, and the specific implementation methods and other records in the specification can be used to interpret the content of the claims.

Claims

1. A subway network OD passenger flow classification prediction method based on multi-dimensional feature input, Features: The steps include: S1. Quantitatively analyze the multiple factors that affect OD passenger flow and determine the feature set of influencing factors as the input conditions of the prediction model; S2, perform two-stage clustering on all OD passenger flows in the subway network to ensure that each type of OD passenger flow has similar scale and time-varying pattern; S3, evaluate the predictability of time series data for different types of OD passenger flows in the subway network and detect the similarity and stability of OD passenger flows; S4. For different types of OD passenger flows, the ARIMA-based prediction model and the improved Attention-LSTM-based prediction model are used to predict passenger flow.

2. According to the subway network OD passenger flow classification prediction method based on multi-dimensional feature input according to claim 1, Features: The method for selecting predictive variable features in step S1 is as follows: starting from the set containing all features, gradually remove the weakest performing features, and iterate repeatedly until the set feature subset size is reached. In each round of iteration, the features are reordered using the feature importance evaluated by the linear regression model, and the features removed are those with the lowest importance scores.

3. According to the subway network OD passenger flow classification prediction method based on multi-dimensional feature input according to claim 1, Features: The two-stage clustering method of step S2 is as follows: S2.

1. Based on the trend data of OD passenger flow distribution, the first stage of OD passenger flow clustering is performed to ensure that the ODs within the cluster have similar passenger flow change patterns; S2.

2. Based on the clustering in step S2.1, OD two-stage clustering is performed based on the passenger flow size data to ensure that the OD passenger flow within the class has similar passenger flow change trends and passenger flow sizes.

4. According to claim 3, the subway network OD passenger flow classification prediction method based on multi-dimensional feature input, Features: The fuzzy C-means clustering method is used for the passenger flow characteristic index of step S2.

1. The specific steps are as follows: Step 1: Calculate the initial membership matrix; Step 2: Calculate o cluster centers; Step 3: Calculate the objective function value. If this value is less than a specific threshold or its change is lower than the set threshold, the algorithm terminates; otherwise, update the membership matrix again and return to step 2 to continue iterating.

5. According to claim 4, the subway network OD passenger flow classification prediction method based on multi-dimensional feature input, Features: In step S2.2, the K-Means algorithm is used to perform the second-stage classification of the OD passenger flow of the entire network. The specific method is as follows: the "elbow method" is used to determine the number of clusters; then the K-Means clustering analysis method is used to perform the second-stage clustering of the OD pairs based on the first-stage clustering results of the OD pairs and the hourly passenger flow of the OD.

6. According to the subway network OD passenger flow classification prediction method based on multi-dimensional feature input as described in claim 1, Features: In step S3, the time series similarity measurement model is as follows: The Pearson correlation coefficient method is used to test the similarity between the current passenger flow and the historical passenger flow data for the same period of the same week with the help of the correlation coefficient matrix. The correlation coefficient method is as follows: In the formula, is the OD passenger flow vector, U t is the t-th OD pair u, i and j are week numbers, e is the day of the week, Calculate the passenger flow correlation coefficient of any two days and obtain a seventh-order correlation coefficient matrix R U (i e ,j e ), as shown below: Calculate the average correlation coefficient of OD As shown below: In the formula, the order l of the correlation coefficient matrix is ​​7, For each OD category k, calculate the average correlation coefficient C of all OD pairs in this category ke , as follows: C ke The value of is [0,1]. The larger the value, the higher the similarity between passenger flow sequences. For this type of OD passenger flow, the time series model can be used to predict it. ke When is smaller, more complex deep learning models are adopted for prediction.

7. According to the subway network OD passenger flow classification prediction method based on multi-dimensional feature input as described in claim 6, Features: In step S3, the time series stationarity test model is as follows: The stationarity test technology is used to evaluate the stability of the OD passenger flow data series, and its calculation model is: In the formula, a is a constant, b is the coefficient of the time trend, t is the time variable, and n is the lag order of the autoregressive process. The constant a and time trend b are added to the model, and the AIC criterion is used to determine the lag order n of the autoregressive process. After clarifying the model structure, perform an ADF test on the passenger flow time series of each OD pair for seven consecutive days from Monday to Sunday to obtain the corresponding P value, as shown in the following formula: P U =(P 1 ,P 2 ,…,P U ) For each OD passenger flow of category k, calculate the average probability of all OD pairs in the category: The P value is between 0 and 1, and its size reflects the strength of the stationarity of the passenger flow data series. If the P value is lower than the preset significance level threshold, it indicates that the passenger flow time series has statistically significant stability at this significance level and can be used for short-term prediction.

8. According to the subway network OD passenger flow classification prediction method based on multi-dimensional feature input as described in claim 1, Features: The specific method of step S4 is as follows: S4.

1. Propose a data structure reconstruction strategy to reduce the impact of the minimum value in OD passenger flow data through data structure reconstruction and restoration operations, and achieve better prediction accuracy; S4.

2. Construct an ARIMA-based OD prediction model, which is used to predict the OD pairs that perform best in the time series predictability evaluation model. This type of OD has the best stability and similarity. S4.

3. For OD pairs that perform poorly in the time series predictable evaluation model, a passenger flow prediction model based on the improved Attention-LSTM is constructed, and multivariate input is considered to improve the prediction accuracy of the model for such OD.

9. According to the subway network OD passenger flow classification prediction method based on multi-dimensional feature input as described in claim 8, Features: The data structure reconstruction method of step S4.1 is as follows: S4.1.1, set the minimum threshold ε, S4.1.2 For each The historical average passenger flow matrix m ij Compared with the threshold value in step S4.1.1, the labeling matrix m ij Only the element positions above the threshold are retained The data at these positions in the dataset are obtained as follows: S4.1.

3. The valid data in is prepended, and the mask value is used to fill the end of the sequence to obtain the reconstructed data: S4.1.

4. After the prediction is completed, the data structure is restored according to the element position information retained by the formula in step S4.1.2.

Citation Information

Cited By

  • Battery sorting method and automatic battery sorting equipment

    CN119259515A