Subway station passenger flow prediction method, device, equipment, medium and computer program product
Through FIFD rapid iterative filtering decomposition algorithm and white noise inspection technology, the passenger flow data of subway stations is decomposed and predicted, solving the problem of insufficient accuracy of a single LSTM model and achieving more efficient passenger flow prediction accuracy.
Patent Information
- Application Number
- CN202411548338.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-01
- Publication Date
- 2025-02-28
AI Technical Summary
In subway station passenger flow prediction, the accuracy of the single LSTM model is not good, mainly because there are multi-scale variability characteristics in subway passenger flow data, and the residual mode obtained by the decomposition algorithm fails to make full use of effective information.
The passenger flow timing data is decomposed by FIFD fast iterative filtering decomposition algorithm, multiple modal components and residual sequences are obtained, and whether there is valid information in the residual sequence is judged through white noise test. If it exists, secondary decomposition and prediction are performed, and each prediction result is finally accumulated to obtain the final passenger flow prediction result.
It effectively reduces the impact of multi-scale variability characteristics in subway passenger flow data, makes full use of the effective information in passenger flow data, and significantly improves the accuracy of passenger flow prediction.
Smart Images

Figure CN119539861A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of urban rail transit, and in particular to a subway station passenger flow prediction method, device, equipment, medium and computer program product. Background Art
[0002] Currently, most subway stations use station terminal equipment, such as entry and exit gates, to complete passenger flow data statistics. By analyzing the passenger flow gate data of subway stations, we can analyze the passenger flow travel patterns of different subway stations in different time periods, among which the passenger flow arrival volume in different time periods is an important indicator. Relevant researchers have proposed a number of prediction models to analyze the passenger flow arrival volume of stations that changes over time, such as the autoregressive moving average (ARIMA) model, the RNN neural network model, the LSTM model, etc.
[0003] However, according to relevant research results, there is still a problem of poor accuracy when using a single LSTM model to predict the passenger flow at subway stations. The reason is that there are multi-scale variability characteristics in the statistical data of subway passenger flow, which is often ignored by many researchers. The decomposition algorithm is not used to decompose the time series data to obtain a sequence mode with strong resolution, resulting in low final prediction accuracy. On the other hand, the residual mode obtained by the decomposition algorithm is often directly removed and no longer considered, but according to experience, valid information may still be retained in the residual mode. Directly removing the residual mode may lose valid information, resulting in a decrease in prediction accuracy. Summary of the invention
[0004] The technical problem to be solved by the present invention is to provide a subway station passenger flow prediction method, device, equipment, medium and computer program product, which decomposes the passenger flow time series data into a modal sequence with strong resolution, effectively reduces the impact of the multi-scale variability characteristics of the subway passenger flow data, and introduces white noise test and residual correction at the same time, performs secondary decomposition and prediction on the residual containing effective information, thereby making full use of the passenger flow data and further improving the prediction accuracy.
[0005] In order to achieve the above object, an embodiment of the present invention provides a subway station passenger flow prediction method, comprising:
[0006] Obtaining passenger flow time series data of a subway station, and decomposing the passenger flow time series data to obtain multiple modal components and a residual sequence;
[0007] Inputting the modal component into a preset passenger flow prediction model to obtain a first prediction result output by the passenger flow prediction model;
[0008] Performing a white noise test on the residual sequence to determine whether there is valid information in the residual sequence;
[0009] If there is effective information in the residual sequence, the residual sequence is decomposed twice to obtain multiple residual modal components;
[0010] Inputting the residual modal component into the passenger flow prediction model to obtain a second prediction result output by the passenger flow prediction model;
[0011] The first prediction result and the second prediction result are accumulated to obtain the passenger flow prediction result of the subway station.
[0012] As an improvement of the above solution, the method uses FIFD fast iterative filtering decomposition algorithm to decompose the passenger flow time series data, specifically including:
[0013] The passenger flow time series data is convolved and solved by a double convolution filter to determine the moving average of the passenger flow time series data:
[0014] The passenger flow time series data is converted into discrete data, and the discrete data is iteratively decomposed according to the moving average until a preset stop condition is met, and the decomposition is stopped to obtain multiple modal components and a residual sequence.
[0015] As an improvement of the above solution, the formula for solving the convolution is:
[0016]
[0017] Where, L n (y n ) represents the moving average of passenger flow time series data; y n is the discretized expression of y(t), where y(t) represents the passenger flow time series data; L n Represents the passenger flow time series data y n The extraction operator; l represents the filter length; ω(x) represents the double convolution filter function;
[0018] The formula for the iterative decomposition is:
[0019] y imf =lim n→∞ M n (y n )=lim n→∞ [y n -L n (y n )];
[0020] In the formula, y imf Indicates sub-mode; y n+1 =M n (y n ).
[0021] As an improvement of the above solution, the stop condition is that the SD value is less than a preset threshold, and the calculation formula of the SD value is:
[0022]
[0023] In the formula, y m+1 represents the modal component sequence obtained by the m+1th decomposition; y m represents the modal component sequence obtained by the m-th decomposition.
[0024] As an improvement of the above solution, the training method of the passenger flow prediction model specifically includes:
[0025] Acquire historical passenger flow time series data of the subway station, and decompose the historical passenger flow time series data to obtain multiple historical modal components and a historical residual sequence;
[0026] Dividing each of the historical modal components into a training set and a set to be predicted, and inputting the training set of each of the historical modal components into a preset LSTM long short-term memory model for training to obtain a training model;
[0027] Inputting the to-be-predicted set of each of the historical modal components into the training model to obtain a first predicted value of each of the historical modal components output by the training model;
[0028] Accumulating the first predicted values of all the historical modal components to obtain predicted values of all the historical modal components;
[0029] The predicted value is compared with the true value, and the parameters of the training model are modified according to the comparison result to obtain a trained passenger flow prediction model.
[0030] As an improvement of the above solution, the performing of a white noise test on the residual sequence to determine whether there is valid information in the residual sequence specifically includes:
[0031] Performing a white noise test on the residual sequence and calculating the LB statistic of the residual sequence;
[0032] If the LB statistic is greater than a preset value, it is determined that there is valid information in the residual sequence;
[0033] If the LB statistic is not greater than a preset value, it is determined that no valid information exists in the residual sequence.
[0034] The embodiment of the present invention further provides a subway station passenger flow prediction device, comprising:
[0035] A first decomposition module is used to obtain the passenger flow time series data of the subway station, and decompose the passenger flow time series data to obtain multiple modal components and a residual sequence;
[0036] A first prediction module, used for inputting the modal component into a preset passenger flow prediction model to obtain a first prediction result output by the passenger flow prediction model;
[0037] A residual test module, used to perform a white noise test on the residual sequence to determine whether there is valid information in the residual sequence;
[0038] A second decomposition module, configured to perform secondary decomposition on the residual sequence to obtain a plurality of residual modal components if effective information exists in the residual sequence;
[0039] The second prediction module is used to input the residual modal component into the passenger flow prediction model to obtain a second prediction result output by the passenger flow prediction model:
[0040] The passenger flow prediction module is used to accumulate the first prediction result and the second prediction result to obtain the passenger flow prediction result of the subway station.
[0041] An embodiment of the present invention also provides a terminal device, including a processor, a memory, and a computer program stored in the memory and configured to be executed by the processor, wherein the processor implements any of the above-mentioned subway station passenger flow prediction methods when executing the computer program.
[0042] An embodiment of the present invention further provides a computer-readable storage medium, which includes a stored computer program, wherein when the computer program is running, the device where the computer-readable storage medium is located is controlled to execute any of the above-mentioned subway station passenger flow prediction methods.
[0043] An embodiment of the present invention further provides a computer program product, which includes a computer program or computer instructions. When the computer program or the computer instructions are executed by a processor, the subway station passenger flow prediction method described in any one of the above items is implemented.
[0044] Compared with the prior art, the beneficial effects of a subway station passenger flow prediction method, device, equipment, medium and computer program product provided by the embodiment of the present invention are: by obtaining the passenger flow time series data of the subway station and decomposing the passenger flow time series data, multiple modal components and a residual sequence are obtained; the modal components are input into a preset passenger flow prediction model to obtain a first prediction result output by the passenger flow prediction model; a white noise test is performed on the residual sequence to determine whether there is valid information in the residual sequence; if there is valid information in the residual sequence, the residual sequence is decomposed twice to obtain multiple residual modal components; the residual modal components are input into the passenger flow prediction model to obtain a second prediction result output by the passenger flow prediction model; the first prediction result and the second prediction result are accumulated to obtain the passenger flow prediction result of the subway station. The embodiment of the present invention integrates the FIFD fast iterative filtering decomposition algorithm with the LSTM model to construct a FIFD-LSTM model to predict the passenger flow arrival volume of the subway station, overcome the defect of poor accuracy in the traditional single prediction method, and further reduce the impact of the multi-scale variability characteristics in the subway passenger flow data. At the same time, white noise test and residual correction are introduced on the basis of FIFD modal decomposition algorithm. White noise is used to test whether valid information is retained in the residual value, and the residual containing valid information is secondary decomposed and predicted, so as to make full use of passenger flow data and further improve the prediction accuracy. Compared with traditional methods, it realizes secondary efficient utilization of effective information. BRIEF DESCRIPTION OF THE DRAWINGS
[0045] Figure 1 It is a flow chart of a preferred embodiment of a subway station passenger flow prediction method provided by the present invention;
[0046] Figure 2 It is a structural schematic diagram of an LSTM model in a subway station passenger flow prediction method provided by the present invention;
[0047] Figure 3 It is a data graph of passenger arrival volume on weekdays in a subway station passenger flow prediction method provided by the present invention;
[0048] Figure 4 It is a time series of passenger arrivals on weekdays in a subway station passenger flow prediction method provided by the present invention;
[0049] Figure 5 It is a multi-modal schematic diagram of time series decomposition in a subway station passenger flow prediction method provided by the present invention;
[0050] Figure 6 It is a schematic diagram of time series sub-modal prediction and integrated prediction results in a subway station passenger flow prediction method provided by the present invention;
[0051] Figure 7 It is a multi-modal schematic diagram of residual time series data decomposition in a subway station passenger flow prediction method provided by the present invention;
[0052] Figure 8 It is a schematic diagram of residual sub-mode and integrated residual prediction results in a subway station passenger flow prediction method provided by the present invention;
[0053] Fig. 9 It is a schematic diagram comparing the final prediction result and the true value in a subway station passenger flow prediction method provided by the present invention;
[0054] Fig.10 This is a schematic diagram of the prediction results of a single LSTM model;
[0055] Fig.11 This is a schematic diagram of the prediction results of the FIFD+LSTM model (excluding residuals);
[0056] Fig.12 It is a structural schematic diagram of a preferred embodiment of a subway station passenger flow prediction device provided by the present invention;
[0057] Fig.13 It is a structural schematic diagram of a preferred embodiment of a terminal device provided by the present invention. DETAILED DESCRIPTION
[0058] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0059] See also Figure 1 , Figure 1 The figure is a flow chart of a preferred embodiment of a subway station passenger flow prediction method provided by the present invention. The subway station passenger flow prediction method comprises:
[0060] S1, obtaining passenger flow time series data of a subway station, and decomposing the passenger flow time series data to obtain multiple modal components and a residual sequence;
[0061] S2, inputting the modal component into a preset passenger flow prediction model to obtain a first prediction result output by the passenger flow prediction model;
[0062] S3, performing a white noise test on the residual sequence to determine whether there is valid information in the residual sequence;
[0063] S4, if there is effective information in the residual sequence, performing secondary decomposition on the residual sequence to obtain a plurality of residual modal components;
[0064] S5, inputting the residual modal component into the passenger flow prediction model to obtain a second prediction result output by the passenger flow prediction model:
[0065] S6: Add the first prediction result and the second prediction result to obtain the passenger flow prediction result of the subway station.
[0066] Specifically, the embodiment of the present invention obtains the passenger flow time series data of the subway station, and decomposes the passenger flow time series data to obtain multiple modal components with specific frequencies and a residual sequence, so as to reduce the impact of the multi-scale variability characteristics existing in the subway passenger flow data. The modal components obtained by decomposition are input into the preset passenger flow prediction model to obtain the first prediction result output by the passenger flow prediction model. Then, a white noise test is performed on the residual sequence to determine whether there is valid information in the residual sequence, so as to avoid directly removing the residual sequence containing valid information, resulting in a decrease in prediction accuracy. If there is valid information in the residual sequence, the residual sequence is decomposed twice using the same decomposition algorithm as the passenger flow time series data to obtain multiple residual modal components. The residual modal components obtained by the secondary decomposition are input into the passenger flow prediction model to obtain the second prediction result output by the passenger flow prediction model. The first prediction result and the second prediction result are accumulated to obtain the passenger flow prediction result of the subway station.
[0067] The embodiment of the present invention decomposes the passenger flow time series data into a modal sequence with strong resolution, effectively reducing the impact of the multi-scale variability characteristics of the subway passenger flow data, and at the same time introduces white noise test and residual correction, and performs secondary decomposition and prediction on the residual containing effective information, thereby making full use of the passenger flow data and further improving the prediction accuracy. A method can be provided for subway passenger flow prediction, thereby facilitating the subway to respond to possible subway passenger flow peaks in a timely manner and provide diversion measures or other adjustment measures in a timely manner.
[0068] In another preferred embodiment, the method uses FIFD fast iterative filtering decomposition algorithm to decompose the passenger flow time series data, specifically including:
[0069] Convolutionally solving the passenger flow time series data through a double convolution filter to determine a moving average of the passenger flow time series data;
[0070] The passenger flow time series data is converted into discrete data, and the discrete data is iteratively decomposed according to the moving average until a preset stop condition is met, and the decomposition is stopped to obtain multiple modal components and a residual sequence.
[0071] In another preferred embodiment, the formula for solving the convolution is:
[0072]
[0073] Where, L n (y n ) represents the moving average of passenger flow time series data; y n is the discretized expression of y(t), where y(t) represents the passenger flow time series data; L n Represents the passenger flow time series data y n The extraction operator; l represents the filter length; ω(x) represents the double convolution filter function;
[0074] The formula for the iterative decomposition is:
[0075] y imf =lim n→∞ M n (y n )=lim n→∞ [y n -L n (y n )];
[0076] In the formula, y imf Indicates sub-mode; y n+1 =M n (y n ).
[0077] In another preferred embodiment, the stop condition is that the SD value is less than a preset threshold, and the calculation formula of the SD value is:
[0078]
[0079] In the formula, y m+1 represents the modal component sequence obtained by the m+1th decomposition; y m represents the modal component sequence obtained by the m-th decomposition.
[0080] Specifically, the embodiment of the present invention uses the FIFD fast iterative filtering decomposition algorithm to decompose the passenger flow time series data. The FIFD modal decomposition algorithm is optimized based on the iterative filtering decomposition algorithm (IFD). The difference between the two methods is that FIFD utilizes the discrete form of the IFD modal decomposition algorithm and uses the fast Fourier transform (FFT), which quickly decomposes the time series data into a group of modes, with faster decomposition speed and decomposition accuracy. In the embodiment of the present invention, the subway station passenger flow time series data that changes with time t is y(, t), and the iterative decomposition process is:
[0081]
[0082] In formula (1), y n is the discretized expression of y(t); L n Represents the passenger flow time series data y n The extraction operator, y n+1 =M n (y n ), through L n The moving average value L of the passenger flow time series data is determined by n (y n ).
[0083] L during decomposition n (y n ) can be solved by convolving the double convolution filter ω(x) with the passenger flow time series data:
[0084]
[0085] In formula (2), l represents the filter length.
[0086] To speed up the mode decomposition process, equation (1) can be rewritten as:
[0087] IMF=IDFT[I-diag(DFT(w))] m DFT(y) (3)
[0088] In formula (3), I represents the identity matrix; DFT represents discrete Fourier transform; IDFT represents inverse discrete Fourier transform; diag represents a diagonal matrix; and m represents the number of decompositions.
[0089] Using the above steps, a sub-modal IMF can be extracted from the passenger flow time series data, and the above process is repeated until a monotonic modal component is obtained. The time series passenger flow data is decomposed into a set of IMFs and R (residual components) in different frequency bands by FIFD, as shown below:
[0090]
[0091] In formula (4), k represents the number of IMF sub-modes obtained by decomposition. At the same time, in order to make the decomposition of modal IMF meaningful and not decompose indefinitely, a threshold SD is defined. When the SD threshold is less than the preset threshold, such as 0.2, the decomposition algorithm stops.
[0092]
[0093] In formula (5), y m+1 represents the modal sequence obtained by the m+1th decomposition, y m represents the mode sequence obtained by the mth decomposition.
[0094] It should be noted that the same decomposition algorithm as that for passenger flow time series data can be used for secondary decomposition of the residual sequence.
[0095] In another preferred embodiment, the training method of the passenger flow prediction model specifically includes:
[0096] Acquire historical passenger flow time series data of the subway station, and decompose the historical passenger flow time series data to obtain multiple historical modal components and a historical residual sequence;
[0097] Dividing each of the historical modal components into a training set and a set to be predicted, and inputting the training set of each of the historical modal components into a preset LSTM long short-term memory model for training to obtain a training model;
[0098] Inputting the to-be-predicted set of each of the historical modal components into the training model to obtain a first predicted value of each of the historical modal components output by the training model;
[0099] Accumulating the first predicted values of all the historical modal components to obtain predicted values of all the historical modal components;
[0100] The predicted value is compared with the true value, and the parameters of the training model are modified according to the comparison result to obtain a trained passenger flow prediction model.
[0101] For details, please refer to Figure 2 , Figure 2 The figure is a schematic diagram of the structure of the LSTM model in a subway station passenger flow prediction method provided by the present invention. The passenger flow prediction model in the embodiment of the present invention is trained using the LSTM long short-term memory model. LSTM is a recurrent neural network (RNN) variant, which is often used to process long-term series data and capture long-term dependencies therein. The LSTM model uses a gated output method, including an output gate, a forget gate, and an output gate, so that the neural network can selectively "remember" or "forget" some information. Its structure is as follows: Figure 2 shown.
[0102] The LSTM module has a special "cell" structure, which makes it more "smart" than the traditional memory model. The model can generate memory for the previous and next parts of the time series. The "gates" with different properties of a single module can control the state and output of the module. Useful information can be filtered out through these "gates". Each "gate" consists of a sigmoid layer and a vector dot product multiplication operation. The specific situation of the three "gates" is as follows:
[0103] <1> Forget Gate
[0104] The function of the LSTM forget gate is to decide what information to discard. This decision is made through a forget gate layer. It receives the hidden layer output h of the previous moment. t-1 and the current input x t , the sigmoid layer outputs a value (0-1) to determine which information needs to be "forgotten":
[0105] f t =σ[W f *(h t-1 , x t )+b f ] (6)
[0106] Among them, h t-1 represents the output of the hidden layer at the previous moment, x t represents the input of the current cell, σ represents the sigmoid function, W f represents the forget gate weight matrix, b f Represents the bias vector of the forget gate.
[0107] <2> Input Gate
[0108] After forgetting the information, it is necessary to clarify what information needs to be preserved. Similarly, the cell receives the hidden layer output h of the previous moment. t-1 and the current input x t , a value (0-1) is output through the sigmoid layer to determine which information needs to be "remembered":
[0109] i t =σ[W i *(h t-1 , x t )+b i ] (7)
[0110] C′ t =tanh[W C *(h t-1 , x t )+b C ] (8)
[0111] C t =f t *C t-1 +i t *C′ t (9)
[0112] Among them, W i is the weight matrix of the output gate, h t-1 represents the hidden state at the previous moment, x t represents the input at the current moment, b i is the bias vector of the input gate; C′t is the candidate cell state calculated in the update cell, which is used to update the cell state at the current moment, W C is the weight matrix of the update unit, b C is the update unit bias vector; through the calculation results of the forget gate, output gate and update unit, the cell state at the current moment can be updated, f t is the output of the forget gate, C t-1 is the unit state at the previous moment, i t is the output of the input gate, C′ t is the output of the update unit.
[0113] <3> Output Gate
[0114] The output gate of the LSTM model determines the final output. The output gate also uses a sigmoid layer to determine which information in the cell is output. The updated cell state is processed by the tanh function and multiplied by the sigmoid layer of the output gate to obtain the final output result.
[0115] O t =σ[W O *(h t-1 , x t )+b O ] (10)
[0116] h t =O t *tanh(C t ) (11)
[0117] Among them, W O is the weight matrix of the output gate, b i is the output gate bias vector. And the hidden state at the current moment is calculated through the cell state of the output gate, O t represents the output of the output gate, C t Indicates the current moment
[0118] When training the LSTM model, the embodiment of the present invention obtains the historical passenger flow time series data of the subway station, and uses the FIFD modal decomposition algorithm to decompose the historical passenger flow time series data to obtain multiple historical modal components with specific frequencies and a historical residual sequence. For each historical modal component data, it is divided into a training set and the set to be predicted Right now:
[0119]
[0120] Among them, i represents different modal components. The mapping relationship contained in the training set is input into the LSTM model for training. After the training model is obtained, the prediction set is used to predict part of the data, and the prediction result under the modal component is obtained as follows: The results obtained by using different modal components are accumulated to obtain the total predicted value of all modal components. Let the number of modal components be K, which is expressed as follows:
[0121]
[0122] In another preferred embodiment, the S3, performing a white noise test on the residual sequence to determine whether there is valid information in the residual sequence, specifically includes:
[0123] S301, performing a white noise test on the residual sequence to calculate the LB statistic of the residual sequence;
[0124] S302, if the LB statistic is greater than a preset value, determining that there is valid information in the residual sequence;
[0125] S303: If the LB statistic is not greater than a preset value, it is determined that there is no valid information in the residual sequence.
[0126] Specifically, according to formula (4), in addition to being decomposed into various modal components, the passenger flow time series data also includes a residual sequence. This residual sequence is regarded as invalid information by default in most studies. However, in fact, the residual sequence obtained by the decomposition algorithm may still contain some valid information. If it is completely ignored, the accuracy of the final prediction result will be reduced to a certain extent. Therefore, the embodiment of the present invention performs secondary processing on the residual. The process of the secondary processing is as follows:
[0127] <1> White noise test
[0128] White noise sequence is a common random process in statistics and signal processing. It has some specific characteristics that make it have uniform energy distribution at all frequencies. It is composed of a series of independent random variables with the same probability distribution. There is no correlation between these random variables, so they are completely unrelated in time, and white noise cannot show typical irregularity. If the sequence meets the white noise standard, it means that the residual of the passenger flow time series data no longer contains valid information; if it does not meet the white noise standard, it means that the residual sequence still contains valid information and needs to be processed twice. The white noise test often uses the LB statistic, as shown in the following formula:
[0129]
[0130] In formula (14), n represents the sequence length, ρ kis the sample autocorrelation coefficient, m is the number of autocorrelation coefficients, usually m = ln(T), and the null hypothesis and alternative hypothesis are given at the same time:
[0131] H 0 :ρ 1 =ρ 1 =ρ 2 =…=ρ m =0 (15)
[0132] H 2 :ρ i ≠0
[0133] when Reject the null hypothesis, that is, believe that there is some autocorrelation in the sequence, where refers to the χ with m degrees of freedom 2 The 100(1-α) quantile of the distribution, the sequence contains valid information; if Accept the null hypothesis, that is, it is believed that there is no autocorrelation in the sequence and there is no valid information in the sequence. In sequence detection, the p test value is generally given directly. When p<α, the null hypothesis is rejected. α is the significance level, which is generally 5%.
[0134] <2> Fast Iterative Filter Decomposition
[0135] If the residual sequence still contains valid information, the above-mentioned FIFD decomposition algorithm is used to perform secondary decomposition on the residual sequence.
[0136]
[0137] <3> Residual prediction
[0138] Similarly, the LSTM model is used to predict the sub-mode of the residual sequence after secondary decomposition, and the residual prediction result is accumulated with the main prediction result in formula (13) to obtain the final prediction result, as shown below:
[0139]
[0140] After obtaining the final prediction result, it is necessary to compare the predicted value with the actual value to verify the prediction accuracy of the passenger flow time series data. The embodiment of the present invention proposes the following evaluation indicators:
[0141] <1> Mean square error
[0142] The mean square error (MSE) is the standard deviation, which is a convenient and intuitive evaluation indicator to measure the average error between real data and predicted data.
[0143]
[0144] <2> Root mean square error
[0145] The RMS error is the square root of the mean squared error and measures the degree of deviation between the predicted value and the true value. Compared with the mean squared error, the RMS error gives the error in the same unit as the predicted variable, making the results easier to interpret.
[0146]
[0147] Among them, n is the number of data contained in the predicted value or true value, y i is the true value, is the predicted value.
[0148] <3> Mean absolute error
[0149] The mean absolute error (MAE) is the average of the absolute values of the differences between the actual and predicted values and is insensitive to outliers.
[0150]
[0151] <4> Coefficient of determination
[0152] Coefficient of determination (R 2 ) measures the degree of data variability, with values between 0 and 1. The closer the value is to 1, the better the model is and the easier it is to explain the data. It can be used to intuitively compare the pros and cons of the training models.
[0153]
[0154] Among them, yi represents the true value, represents the predicted value, Represents the mean of the true values.
[0155] In order to verify the advancedness of the prediction method proposed in the present invention, an example verification is required. The following is a prediction based on the measured passenger flow data of a subway station, and a melting experiment is performed on the traditional LSTM model to compare and illustrate the effectiveness of the improved prediction method proposed in the present invention.
[0156] The data set obtains the passenger flow arrival AFC data of Wushan Subway Station on Line 3 in Guangzhou in 2016. The data is collected from the full period (6:00-23:00) of 5 working days from April 4, 2016 to April 8, 2016. The data is as follows Figure 3 As shown, Figure 3 This is a data graph of passenger arrivals on weekdays in a subway station passenger flow prediction method provided by the present invention. The passenger arrival data at five work destination stations are combined to obtain a time series with periodicity, such as Figure 4 As shown, Figure 4 It is a time series of passenger arrivals on weekdays in a subway station passenger flow prediction method provided by the present invention. Figure 4It can be clearly seen that this time series not only has the characteristics of daily morning and evening peaks, but also has overall periodic volatility, and is suitable for verification and prediction using the LSTM model.
[0157] According to equations (1)-(5), the FIFD decomposition algorithm is used to obtain the IMF sub-mode of the above passenger flow time series data after decomposition. The results are as follows: Figure 5 As shown, Figure 5 It is a multi-modal schematic diagram of time series decomposition in a subway station passenger flow prediction method provided by the present invention.
[0158] The LSTM model is used to predict each modal component, and the setting parameters of LSTM are given in Table 1 below:
[0159] Table 1 LSTM model parameter settings
[0160] parameter value Number of LSTM layers 2 Number of neurons / layer 30 Activation Function "RELU" Optimization Algorithm "Adam" Learning Rate 0.01 Iteration training times 100 Batch size 64 Adjustment target "MAE" Number of mappings (N~1) N=20 Training set ratio 90% Prediction set ratio 10%
[0161] The prediction results are as follows Figure 6 As shown, Figure 6 Schematic diagram of time series modal prediction and integrated prediction results in a subway station passenger flow prediction method provided by the present invention. Figure 6 It can be seen from the integrated prediction results that the overall trends between the real data and the predicted data are basically consistent, indicating that the LSTM model can effectively capture the periodicity and volatility characteristics in the passenger arrival data.
[0162] The residual sequence R is subjected to a white noise test, and the test results are shown in Table 2 below:
[0163] Table 2 White noise test results
[0164] LB Statistics P-value LB Statistics P-value LB Statistics P-value 24.68 <![CDATA[6.16*10 -7 ]]> 625.24 <![CDATA[8.75*10 -130 ]]> 1469.15 <![CDATA[2.18*10 -304 ]]> 98.75 <![CDATA[3.58*10 -22 ]]> 989.41 <![CDATA[3.30*10 -207 ]]> 1542.31 0 170.90 <![CDATA[8.11*10 -37 ]]> 1132.50 <![CDATA[5.19*10 -237 ]]> 1552.62 0 290.40 <![CDATA[1.27*10 -61 ]]> 1134.46 <![CDATA[2.13*10 -236 ]]> 1740.91 0 510.62 <![CDATA[4.06*10 -108 ]]> 1134.57 <![CDATA[2.11*10 -235 ]]> 1827.47 0 609.96 <![CDATA[1.64*10 -128 ]]> 1324.64 <![CDATA[2.61*10 -275 ]]> 1827.55 0 611.37 <![CDATA[8.62*10 -128 ]]> 1460.82 <![CDATA[1.30*10 -303 ]]>
[0165] It can be clearly seen from Table 2 that the P values of the above noise sequences are all less than 5%, indicating that the noise contains effective autocorrelation information and is not white noise, which requires further processing. Figure 7 This is a schematic diagram of the multi-modal decomposition of residual time series data in a subway station passenger flow prediction method provided by the present invention. Similarly, the residual sub-modal after secondary decomposition is predicted using the LSTM model, and the results are as follows: Figure 8 As shown, Figure 8 It is a schematic diagram of residual sub-mode and integrated residual prediction results in a subway station passenger flow prediction method provided by the present invention.
[0166] According to formula (17), the prediction result after the first modal decomposition and the prediction result after the second residual correction are accumulated to obtain the final prediction result, which is compared with the real data. Fig. 9 As shown, Fig. 9It is a schematic diagram comparing the final prediction result and the true value in a subway station passenger flow prediction method provided by the present invention.
[0167] According to equations (18)-(21) and Fig. 9 The calculation results of the evaluation index for the final prediction result and the true value are shown in Table 3 below:
[0168] Table 3 Evaluation of prediction results
[0169] Evaluation indicators value RMSE 30.75 MSE 945.50 MAE 24.67 <![CDATA[R 2 ]]> 0.88
[0170] It can be clearly seen from Table 3 that the FIFD-LSTM-residual correction model proposed in the present invention has a high prediction accuracy for time series data, and the determination coefficient is 0.88, which is relatively close to 1, indicating that the improved model is relatively good.
[0171] In order to intuitively express the effect of the improved prediction method proposed in the present invention on the prediction accuracy of time series data, a melting experiment is required to compare the improved prediction results of the present invention with the prediction results of a single LSTM model and the prediction results of the FIFD+LSTM model (without residual correction) to illustrate the influence of the key steps of the present invention such as FIFD decomposition and residual correction on the final prediction value. The following prediction models have the same setting parameters, and the comparison results are as follows Fig.10 and Fig.11 As shown, Fig.10 This is a schematic diagram of the prediction results of a single LSTM model. Fig.11 This is a schematic diagram of the prediction results of the FIFD+LSTM model (excluding residuals).
[0172] According to equations (18)-(21) and Fig.10 The calculation results of the comparison between the prediction results obtained by a single LSTM model and the true value are shown in Table 4 below:
[0173] Table 4 Evaluation of prediction results
[0174] Evaluation indicators value RMSE 39.01 MSE 1522.191 MAE 30.32 <![CDATA[R 2 ]]> 0.74
[0175] According to equations (18)-(21) and Fig.11 The calculation results of the comparison between the prediction results obtained by the FIFD+LSTM model (without considering the residual) and the true value are shown in Table 5 below:
[0176] Table 5 Evaluation of prediction results
[0177] Evaluation indicators value RMSE 41.94 MSE 1759.38 MAE 32.80 <![CDATA[R 2 ]]> 0.63
[0178] In summary, the indicators of the above three situations are compared, and the results are shown in Table 6 below:
[0179] Table 6 Comparison of prediction results evaluation
[0180]
[0181]
[0182] Table 6 compares the prediction result evaluation indicators of the above-mentioned different methods. It is obvious from the comparison between ② and ③ that the residual correction step reduces the mean square error by 46.26%, the root mean square error by 26.68%, the mean absolute error by 24.79%, and the determination coefficient by 39.68%. The prediction accuracy is significantly improved, indicating that the residual correction step has a high effect on further improving the prediction accuracy. The comparison results between ① and ③ show that the FIFD decomposition method can effectively decompose sub-modes of different frequencies. Compared with the overall prediction of a single LSTM model, the prediction of sub-modes is more effective and has higher prediction accuracy.
[0183] In summary, the overall evaluation index of the modal decomposition + residual correction prediction model proposed in the present invention is higher in prediction accuracy than the prediction method that does not take these key processing steps, and the obtained passenger arrival volume prediction is also the most accurate, which can provide early warning for the station to take passenger flow diversion measures in time.
[0184] Correspondingly, the present invention also provides a subway station passenger flow prediction device, which can implement all processes of the subway station passenger flow prediction method in the above embodiment.
[0185] See also Fig.12 , Fig.12 The figure is a schematic diagram of a preferred embodiment of a subway station passenger flow prediction device provided by the present invention. The subway station passenger flow prediction device comprises:
[0186] The first decomposition module 1201 is used to obtain the passenger flow time series data of the subway station, and decompose the passenger flow time series data to obtain multiple modal components and a residual sequence;
[0187] A first prediction module 1202, configured to input the modal component into a preset passenger flow prediction model to obtain a first prediction result output by the passenger flow prediction model;
[0188] A residual check module 1203 is used to perform a white noise check on the residual sequence to determine whether there is valid information in the residual sequence;
[0189] A second decomposition module 1204 is configured to perform secondary decomposition on the residual sequence to obtain a plurality of residual modal components if there is effective information in the residual sequence;
[0190] A second prediction module 1205, configured to input the residual modal component into the passenger flow prediction model to obtain a second prediction result output by the passenger flow prediction model;
[0191] The passenger flow prediction module 1206 is used to accumulate the first prediction result and the second prediction result to obtain the passenger flow prediction result of the subway station.
[0192] Preferably, the first decomposition module 1201 uses a FIFD fast iterative filtering decomposition algorithm to decompose the passenger flow time series data, specifically including:
[0193] Convolutionally solving the passenger flow time series data through a double convolution filter to determine a moving average of the passenger flow time series data;
[0194] The passenger flow time series data is converted into discrete data, and the discrete data is iteratively decomposed according to the moving average until a preset stop condition is met, and the decomposition is stopped to obtain multiple modal components and a residual sequence.
[0195] Preferably, the formula for solving the convolution is:
[0196]
[0197] Where, L n (y n ) represents the moving average of passenger flow time series data; y n is the discretized expression of y(t), where y(t) represents the passenger flow time series data; L n Represents the passenger flow time series data y n The extraction operator; l represents the filter length; ω(x) represents the double convolution filter function:
[0198] The formula for the iterative decomposition is:
[0199] y imf =lim n→∞ M n (y n )=lim n→∞ [y n -L n (y n )];
[0200] In the formula, y imf Indicates sub-mode; y n+1 =M n (y n ).
[0201] Preferably, the stopping condition is that the SD value is less than a preset threshold, and the calculation formula of the SD value is:
[0202]
[0203] In the formula, y m+1represents the modal component sequence obtained by the m+1th decomposition; y m represents the modal component sequence obtained by the m-th decomposition.
[0204] Preferably, the training method of the passenger flow prediction model specifically includes:
[0205] Acquire historical passenger flow time series data of the subway station, and decompose the historical passenger flow time series data to obtain multiple historical modal components and a historical residual sequence;
[0206] Dividing each of the historical modal components into a training set and a set to be predicted, and inputting the training set of each of the historical modal components into a preset LSTM long short-term memory model for training to obtain a training model;
[0207] Inputting the to-be-predicted set of each of the historical modal components into the training model to obtain a first predicted value of each of the historical modal components output by the training model;
[0208] Accumulating the first predicted values of all the historical modal components to obtain predicted values of all the historical modal components;
[0209] The predicted value is compared with the true value, and the parameters of the training model are modified according to the comparison result to obtain a trained passenger flow prediction model.
[0210] Preferably, the residual checking module 1203 is specifically used for:
[0211] Performing a white noise test on the residual sequence and calculating the LB statistic of the residual sequence;
[0212] If the LB statistic is greater than a preset value, it is determined that there is valid information in the residual sequence;
[0213] If the LB statistic is not greater than a preset value, it is determined that no valid information exists in the residual sequence.
[0214] In the specific implementation, the working principle, control process and technical effect achieved by the subway station passenger flow prediction device provided in the embodiment of the present invention are the same as those of the subway station passenger flow prediction method in the above embodiment, and will not be repeated here.
[0215] See also Fig.13 , Fig.13 1 is a schematic diagram of a preferred embodiment of a terminal device provided by the present invention. The terminal device includes a processor 1301, a memory 1302, and a computer program stored in the memory 1302 and configured to be executed by the processor 1301. When the processor 1301 executes the computer program, the subway station passenger flow prediction method described in any of the above embodiments is implemented.
[0216] Preferably, the computer program can be divided into one or more modules / units (such as computer program 1, computer program 2, ...), and the one or more modules / units are stored in the memory 1302 and executed by the processor 1301 to complete the present invention. The one or more modules / units can be a series of computer program instruction segments that can complete specific functions, and the instruction segments are used to describe the execution process of the computer program in the terminal device.
[0217] The processor 1301 can be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor can be a microprocessor, or the processor 1301 can be any conventional processor. The processor 1301 is the control center of the terminal device, and various parts of the terminal device are connected using various interfaces and lines.
[0218] The memory 1302 mainly includes a program storage area and a data storage area, wherein the program storage area can store an operating system, an application required for at least one function, etc., and the data storage area can store related data, etc. In addition, the memory 1302 can be a high-speed random access memory, or a non-volatile memory, such as a plug-in hard disk, a smart memory card (Smart Media Card, SMC), a secure digital (Secure Digital, SD) card, and a flash card (Flash Card), etc., or the memory 1302 can also be other volatile solid-state storage devices.
[0219] It should be noted that the above terminal device may include, but is not limited to, a processor and a memory. Those skilled in the art will understand that Fig.13 The structural diagram is only an example of the above-mentioned terminal device and does not constitute a limitation of the above-mentioned terminal device. It may include more or less components than shown in the figure, or combine certain components, or different components.
[0220] An embodiment of the present invention further provides a computer-readable storage medium, which includes a stored computer program, wherein when the computer program is running, the device where the computer-readable storage medium is located is controlled to execute the subway station passenger flow prediction method described in any of the above embodiments.
[0221] An embodiment of the present invention further provides a computer program product, which includes a computer program or computer instructions. When the computer program or the computer instructions are executed by a processor, the subway station passenger flow prediction method described in any of the above embodiments is implemented.
[0222] The embodiment of the present invention provides a subway station passenger flow prediction method, device, equipment, medium and computer program product, which obtains the time series data of the passenger flow of the subway station and decomposes the time series data of the passenger flow to obtain multiple modal components and a residual sequence; the modal components are input into a preset passenger flow prediction model to obtain a first prediction result output by the passenger flow prediction model; the residual sequence is subjected to a white noise test to determine whether there is valid information in the residual sequence; if there is valid information in the residual sequence, the residual sequence is decomposed twice to obtain multiple residual modal components; the residual modal components are input into the passenger flow prediction model to obtain a second prediction result output by the passenger flow prediction model; the first prediction result and the second prediction result are accumulated to obtain the passenger flow prediction result of the subway station. The embodiment of the present invention integrates the FIFD fast iterative filtering decomposition algorithm with the LSTM model to construct a FIFD-LSTM model to predict the passenger flow arrival volume of the subway station, overcomes the defect of poor accuracy in the traditional single prediction method, and further reduces the influence of the multi-scale variability characteristics in the subway passenger flow data. At the same time, white noise test and residual correction are introduced on the basis of FIFD modal decomposition algorithm. White noise is used to test whether valid information is retained in the residual value, and the residual containing valid information is secondary decomposed and predicted, so as to make full use of passenger flow data and further improve the prediction accuracy. Compared with traditional methods, it realizes secondary efficient utilization of effective information.
[0223] It should be noted that the system embodiment described above is merely illustrative, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. In addition, in the drawings of the system embodiment provided by the present invention, the connection relationship between the modules indicates that there is a communication connection between them, which may be specifically implemented as one or more communication buses or signal lines. A person of ordinary skill in the art may understand and implement it without paying any creative effort.
[0224] The above is a preferred embodiment of the present invention. It should be pointed out that a person skilled in the art can make several improvements and modifications without departing from the principle of the present invention. These improvements and modifications are also considered to be within the scope of protection of the present invention.
Claims
1. A subway station passenger flow prediction method, characterized in that: include: Obtaining passenger flow time series data of a subway station, and decomposing the passenger flow time series data to obtain multiple modal components and a residual sequence; Inputting the modal component into a preset passenger flow prediction model to obtain a first prediction result output by the passenger flow prediction model; Performing a white noise test on the residual sequence to determine whether there is valid information in the residual sequence; If there is effective information in the residual sequence, the residual sequence is decomposed twice to obtain multiple residual modal components; Inputting the residual modal component into the passenger flow prediction model to obtain a second prediction result output by the passenger flow prediction model; The first prediction result and the second prediction result are accumulated to obtain the passenger flow prediction result of the subway station.
2. The subway station passenger flow prediction method according to claim 1, characterized in that: The method uses the FIFD fast iterative filtering decomposition algorithm to decompose the passenger flow time series data, specifically including: Convolutionally solving the passenger flow time series data through a double convolution filter to determine a moving average of the passenger flow time series data; The passenger flow time series data is converted into discrete data, and the discrete data is iteratively decomposed according to the moving average until a preset stop condition is met, and the decomposition is stopped to obtain multiple modal components and a residual sequence.
3. The subway station passenger flow prediction method according to claim 2, characterized in that: The formula for solving the convolution is: Where, L n (y n ) represents the moving average of passenger flow time series data; y n is the discretized expression of y(t), where y(t) represents the passenger flow time series data; L n Represents the passenger flow time series data y n The extraction operator; l represents the filter length; ω(x) represents the double convolution filter function; The formula for the iterative decomposition is: y imf =lim n→∞ M n (y n )=lim n→∞ [y n -L n (y n )]; In the formula, y imf Indicates sub-mode; y n+1 =M n (y n ).
4. The subway station passenger flow prediction method according to claim 3, characterized in that: The stop condition is that the SD value is less than a preset threshold, and the calculation formula of the SD value is: In the formula, y m+1 represents the modal component sequence obtained by the m+1th decomposition; y m represents the modal component sequence obtained by the m-th decomposition.
5. The subway station passenger flow prediction method according to claim 1, characterized in that: The training method of the passenger flow prediction model specifically includes: Acquire historical passenger flow time series data of the subway station, and decompose the historical passenger flow time series data to obtain multiple historical modal components and a historical residual sequence; Dividing each of the historical modal components into a training set and a set to be predicted, and inputting the training set of each of the historical modal components into a preset LSTM long short-term memory model for training to obtain a training model; Inputting the to-be-predicted set of each of the historical modal components into the training model to obtain a first predicted value of each of the historical modal components output by the training model; Accumulating the first predicted values of all the historical modal components to obtain predicted values of all the historical modal components; The predicted value is compared with the true value, and the parameters of the training model are modified according to the comparison result to obtain a trained passenger flow prediction model.
6. The subway station passenger flow prediction method according to claim 1, characterized in that: The performing white noise test on the residual sequence to determine whether there is valid information in the residual sequence specifically includes: Performing a white noise test on the residual sequence and calculating the LB statistic of the residual sequence; If the LB statistic is greater than a preset value, it is determined that there is valid information in the residual sequence; If the LB statistic is not greater than a preset value, it is determined that no valid information exists in the residual sequence.
7. A subway station passenger flow prediction device, characterized in that: include: A first decomposition module is used to obtain the passenger flow time series data of the subway station, and decompose the passenger flow time series data to obtain multiple modal components and a residual sequence; A first prediction module, used for inputting the modal component into a preset passenger flow prediction model to obtain a first prediction result output by the passenger flow prediction model; A residual test module, used to perform a white noise test on the residual sequence to determine whether there is valid information in the residual sequence; A second decomposition module, configured to perform secondary decomposition on the residual sequence to obtain a plurality of residual modal components if effective information exists in the residual sequence; A second prediction module, used for inputting the residual modal component into the passenger flow prediction model to obtain a second prediction result output by the passenger flow prediction model; The passenger flow prediction module is used to accumulate the first prediction result and the second prediction result to obtain the passenger flow prediction result of the subway station.
8. A terminal device, characterized in that: It includes a processor and a memory, wherein a computer program is stored in the memory, and the computer program is configured to be executed by the processor, and when the processor executes the computer program, the subway station passenger flow prediction method as described in any one of claims 1 to 6 is implemented.
9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, wherein when the device where the computer-readable storage medium is located executes the computer program, the subway station passenger flow prediction method according to any one of claims 1 to 6 is implemented.
10. A computer program product, characterized in that The computer program product includes a computer program or a computer instruction, and when the computer program or the computer instruction is executed by a processor, the subway station passenger flow prediction method according to any one of claims 1 to 6 is implemented.