Passenger flow prediction method based on artificial intelligence
By introducing the regularization items of matrix and soft threshold functions in the passenger traffic prediction method, and the model of the causal convolution layer and the LSTM layer, it solves the low accuracy, poor robustness, and short -term change response capabilities in existing technologies. Insufficient problems have achieved higher prediction accuracy and robustness.
Patent Information
- Application Number
- CN202411255287.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-09
- Publication Date
- 2025-01-28
- Estimated Expiration
- 2044-09-09
AI Technical Summary
Existing passenger flow prediction methods cannot accurately capture the potential structure and trends of the data, resulting in low prediction accuracy, poor robustness, insufficient response ability to short-term changes, resulting in large prediction errors.
Introduce the PICC and Frobenius Found of the Matrix SChatten-P Famille, the target function of the regularization neck definition of the Frobenius model, the soft-threshold function is used to process the noise, and the Ragrak Ragrak multiplied and punishment coefficient is updated to iterate. The passenger traffic prediction model of the LSTM layer has a design loss function to reduce the effects of single errors.
It improves the accuracy of the low rank of historical passenger traffic data, enhances the robustness of noise and irregular data, and improves the response ability and predictive accuracy of short -term passenger traffic changes.
Smart Images

Figure CN118761339B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of traffic prediction, and in particular to a passenger traffic prediction method based on artificial intelligence. Background Art
[0002] Passenger flow forecasting is a technology that predicts passenger flow through models and algorithms, aiming to provide accurate flow estimates to help with subsequent effective decision-making and optimization. However, general passenger flow forecasting methods are unable to accurately capture the underlying structure and trend of passenger flow data, resulting in low accuracy of flow forecasts, and low robustness to noise and irregular data in passenger flow data, resulting in poor adaptability of forecasts; general passenger flow forecasting methods have insufficient responsiveness and recognition capabilities to changes in passenger flow in the short term, and excessive focus on error types, resulting in large forecast errors. Summary of the invention
[0003] In view of the above situation, in order to overcome the defects of the prior art, the present invention provides a passenger flow prediction method based on artificial intelligence. In view of the fact that the general passenger flow prediction method cannot accurately capture the potential structure and trend of passenger flow data, resulting in low accuracy of flow prediction, and low robustness to noise and irregular data in passenger flow data, resulting in poor adaptability of prediction, this solution introduces the p-th power of the matrix Schatten-p norm and the square of the Frobenius norm to define the objective function, ensuring that the predicted historical passenger flow data has a more accurate low-rank representation; a soft threshold function is used to process noise, and the Lagrange multiplier and penalty coefficient are iteratively updated to make the optimization process of passenger flow data converge faster, thereby improving the robustness and accuracy of the flow prediction results; in view of the fact that the general passenger flow prediction method has insufficient responsiveness and recognition ability to changes in passenger flow in the short term, and excessive attention to the error type leads to large prediction errors, this solution constructs a passenger flow prediction model architecture by introducing a causal convolutional layer to improve the sensitivity of the model to the short-term pattern of flow data; the model loss function is designed by introducing the predicted rate of change error to reduce the impact of single-aspect errors on model training; thereby ensuring the accuracy of passenger flow prediction.
[0004] The technical solution adopted by the present invention is as follows: The passenger flow prediction method based on artificial intelligence provided by the present invention comprises the following steps:
[0005] Step S1: data collection;
[0006] Step S2: data preprocessing;
[0007] Step S3: data optimization;
[0008] Step S4: Establishing a passenger flow prediction model;
[0009] Step S5: Passenger flow prediction.
[0010] Furthermore, in step S1, the data collection is to collect historical passenger flow data; the historical passenger flow data includes daily flow, seasonal flow, holiday flow, time data, weather data, population density data, traffic data, passenger preference data and passenger flow level; the passenger flow level is used as a data label, and the higher the level, the higher the passenger flow.
[0011] Furthermore, in step S2, the data preprocessing is to perform data cleaning, data conversion and data set division on the collected data; the data cleaning is to process missing values, duplicate values and outliers; the data conversion is to convert the cleaned data into vector form and perform standardization processing; the data set division is to divide the standardized data into a test set and a training set.
[0012] Furthermore, in step S3, the data optimization specifically includes the following steps:
[0013] Step S31: define the objective function;
[0014] Step S32: Optimization; specifically including:
[0015] Step S321: Optimizing the matrix P;
[0016] Step S322: Optimizing the matrix Z;
[0017] Step S323: Optimize the regularization term S; optimize by introducing the Schatten-p norm and the auxiliary variable J;
[0018] Step S324: Optimizing the noise matrix E;
[0019] Step S33: iterative update; update the Lagrange multiplier and penalty coefficient. When the objective function converges, the iteration ends, the data optimization ends, and a low-rank representation of the historical passenger flow data, i.e., the optimized data set, is obtained; otherwise, return to step S32 to continue the optimization;
[0020] Furthermore, in step S4, the establishment of the passenger flow prediction model specifically includes the following steps:
[0021] Step S41: Model architecture design; the established passenger flow prediction model includes a causal convolution layer, which is used to extract local features in historical passenger flow data; an LSTM layer, which is used to process the features extracted by the causal convolution layer and capture the long-term dependencies in the historical passenger flow data; a fully connected layer, which is used to map the output of the LSTM to the final prediction result; and an output layer, which is used to output the predicted passenger flow level;
[0022] Step S42: defining a loss function; constructing a loss function based on the prediction error of the passenger flow and the error of the passenger flow change rate;
[0023] Step S43: model training; update parameters using the Adam optimizer; when the loss function converges to the training set, the passenger flow prediction model training is completed; if the maximum number of iterations is reached, adjust the model parameters and retrain the model;
[0024] Step S44: model determination; a correctness threshold is pre-set. When the prediction accuracy of the trained passenger flow prediction model for the test set is higher than the correctness threshold, the passenger flow prediction model is established; otherwise, the data set training model is re-divided.
[0025] Furthermore, in step S5, the passenger flow prediction is based on the established passenger flow prediction model, and real-time collection of daily flow, seasonal flow, holiday flow, time data, weather data, population density data, traffic data and passenger preference data is performed, and after preprocessing and data optimization, the data is input into the passenger flow prediction model, and the passenger flow level output by the passenger flow prediction model is used as the passenger flow prediction result.
[0026] The beneficial effects achieved by the present invention using the above scheme are as follows:
[0027] (1) In view of the fact that general passenger flow prediction methods cannot accurately capture the potential structure and trend of passenger flow data, resulting in low accuracy of flow prediction and low robustness to noise and irregular data in passenger flow data, resulting in poor adaptability of prediction, this scheme introduces the p-th power of the matrix Schatten-p norm and the square of the Frobenius norm to define the objective function, ensuring that the predicted historical passenger flow data has a more accurate low-rank representation; a soft threshold function is used to process noise, and the Lagrange multiplier and penalty coefficient are iteratively updated to make the optimization process of passenger flow data converge faster, thereby improving the robustness and accuracy of the flow prediction results.
[0028] (2) In view of the fact that general passenger flow prediction methods have insufficient responsiveness and recognition capabilities to short-term changes in passenger flow, and excessive focus on error types leading to large prediction errors, this scheme introduces a causal convolutional layer to construct a passenger flow prediction model architecture to improve the model's sensitivity to short-term patterns of flow data; by introducing the predicted rate of change error to design the model loss function, the impact of single-aspect errors on model training is reduced; thereby ensuring the accuracy of passenger flow prediction. BRIEF DESCRIPTION OF THE DRAWINGS
[0029] Figure 1 A schematic diagram of the process of the passenger flow prediction method based on artificial intelligence provided by the present invention;
[0030] Figure 2 is a schematic flow chart of step S3;
[0031] Figure 3 It is a schematic diagram of the process of step S4.
[0032] The accompanying drawings are used to provide further understanding of the present invention and constitute a part of the specification. They are used to explain the present invention together with the embodiments of the present invention and do not constitute a limitation of the present invention. DETAILED DESCRIPTION
[0033] The technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, rather than all the embodiments; based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present invention.
[0034] In the description of the present invention, it should be understood that terms such as “upper”, “lower”, “front”, “back”, “left”, “right”, “top”, “bottom”, “inside” and “outside” indicating directions or positional relationships are based on the directions or positional relationships shown in the accompanying drawings, and are only for the convenience of describing the present invention and simplifying the description, rather than indicating or implying that the device or element referred to must have a specific direction, be constructed and operated in a specific direction, and therefore should not be understood as limiting the present invention.
[0035] Example 1, see Figure 1 The present invention provides a passenger flow prediction method based on artificial intelligence, which comprises the following steps:
[0036] Step S1: data collection, collecting historical passenger flow data;
[0037] Step S2: Data preprocessing, data cleaning, data conversion and data set division of the collected data;
[0038] Step S3: data optimization, introducing the p-th power of the matrix Schatten-p norm and the square of the Frobenius norm to define the objective function, using the soft threshold function to process the noise, and designing an iterative optimization process for data optimization;
[0039] Step S4: Establish a passenger flow prediction model, construct a passenger flow prediction model architecture by introducing a causal convolutional layer, design a model loss function by introducing a predicted rate of change error, and then complete the establishment of the passenger flow prediction model;
[0040] Step S5: Passenger flow prediction: passenger flow prediction is performed based on the established passenger flow prediction model.
[0041] Example 2, see Figure 1 This embodiment is based on the above embodiment. In step S1, the historical passenger flow data includes daily flow, seasonal flow, holiday flow, time data, weather data, population density data, traffic data, passenger preference data and passenger flow level; the passenger flow level is used as a data label, and the higher the level, the higher the passenger flow.
[0042] Example 3, see Figure 1 This embodiment is based on the above embodiment. In step S2, data cleaning is to process missing values, duplicate values and outliers; data conversion is to convert the cleaned data into vector form and standardize it; data set partitioning is to divide the standardized data into a test set and a training set.
[0043] Example 4, see Figure 1 and Figure 2 This embodiment is based on the above embodiment. In step S3, data optimization specifically includes the following steps:
[0044] Step S31: define the objective function; the formula used is as follows:
[0045] ;
[0046] ;
[0047] ;
[0048] Where Z is the low-rank representation matrix of the predicted historical passenger flow data, is the low-rank representation matrix element; P is the projection space; E is the noise matrix; is the p-th power of the Schatten-p norm of the matrix, where p is 2; T is the matrix transpose; X is the data matrix, x i is the data matrix element; is the regularization parameter, ranging from 0.1 to 1; is the 2,1 norm of the matrix; is the p-th power of the singular values of the matrix Z; is the identity matrix; d is the matrix dimension; is the square of the L2 norm;
[0049] Step S32: Optimization; specifically including:
[0050] Step S321: Optimize the matrix P; introduce generalized Stiefel manifold optimization, which is expressed as follows:
[0051] ;
[0052] ;
[0053] Where trace(·) is the trace of the matrix; is the weighting matrix; is the fitting parameter of the equilibrium passenger flow data, ranging from 0.1 to 1; L1 is the matrix difference; Y1 is the Lagrange multiplier matrix associated with L1; is the optimized matrix; is the square of the Frobenius norm;
[0054] Step S322: Optimize the matrix Z; expressed as follows:
[0055] ;
[0056] ;
[0057] ;
[0058] ;
[0059] In the formula, is the optimization of the matrix Z; I is the identity matrix; L2 and L3 are intermediate variables; S is an auxiliary variable; Y2 is the Lagrange multiplier that handles the constraint Z=S;
[0060] Step S323: Optimize the regularization term S; optimize by introducing the Schatten-p norm and the auxiliary variable J, as shown below:
[0061] ;
[0062] ;
[0063] In the formula, It is an optimization of S; is the distance element, Q is the distance matrix;
[0064] Step S324: Optimize the noise matrix E; expressed as follows:
[0065] ;
[0066] ;
[0067] In the formula, It is the optimization of the noise matrix E; is the soft threshold function, τ is a built-in parameter, x is the function input; sign(·) is the sign function.
[0068] Step S33: iterative update; update the Lagrange multiplier and penalty coefficient. When the objective function converges, the iteration ends, the data optimization ends, and the low-rank representation of the historical passenger flow data, i.e., the optimized data set, is obtained; otherwise, return to step S32 to continue the optimization; the formula used is as follows:
[0069] ;
[0070] ;
[0071] ;
[0072] ;
[0073] In the formula, , , and The updated , , and ; is the growth factor, ranging from 1 to 2; The largest in history .
[0074] By performing the above operations, in view of the fact that general passenger flow prediction methods cannot accurately capture the potential structure and trend of passenger flow data, resulting in low accuracy of flow prediction, and low robustness to noise and irregular data in passenger flow data, resulting in poor adaptability of prediction, this scheme introduces the p-th power of the matrix Schatten-p norm and the square of the Frobenius norm to define the objective function, ensuring that the predicted historical passenger flow data has a more accurate low-rank representation; a soft threshold function is used to process noise, and the Lagrange multiplier and penalty coefficient are iteratively updated to make the optimization process of passenger flow data converge faster, thereby improving the robustness and accuracy of the flow prediction results.
[0075] Example 5, see Figure 1 and Figure 3 This embodiment is based on the above embodiment. In step S4, establishing a passenger flow prediction model specifically includes the following steps:
[0076] Step S41: Model architecture design; the established passenger flow prediction model includes a causal convolution layer, which is used to extract local features in historical passenger flow data; an LSTM layer, which is used to process the features extracted by the causal convolution layer and capture the long-term dependencies in the historical passenger flow data; a fully connected layer, which is used to map the output of the LSTM to the final prediction result; and an output layer, which is used to output the predicted passenger flow level;
[0077] Step S42: define a loss function; construct a loss function based on the prediction error of passenger flow and the error of passenger flow change rate; the formula used is as follows:
[0078] ;
[0079] Where Dloss is the loss value of the passenger flow prediction model; and are the actual passenger flow level and predicted passenger flow level at the i1th time step, respectively; and They are the actual passenger flow level change and the predicted passenger flow level change at the i1th time step respectively; and is the parameter for balancing the loss weight, which takes values of 0.6 and 0.4 respectively; N is the total number of time steps, which takes a value of 500;
[0080] Step S43: model training; update parameters using the Adam optimizer; when the loss function converges to the training set, the passenger flow prediction model training is completed; if the maximum number of iterations is reached, adjust the model parameters and retrain the model;
[0081] Step S44: model determination; a correctness threshold is pre-set. When the prediction accuracy of the trained passenger flow prediction model for the test set is higher than the correctness threshold, the passenger flow prediction model is established; otherwise, the data set training model is re-divided.
[0082] By performing the above operations, in view of the fact that general passenger flow prediction methods have insufficient responsiveness and recognition capabilities to short-term passenger flow changes, and excessive focus on error types leading to large prediction errors, this solution introduces a causal convolutional layer to construct a passenger flow prediction model architecture to improve the model's sensitivity to short-term patterns of flow data; by introducing the predicted rate of change error to design the model loss function, the impact of single-aspect errors on model training is reduced; thereby ensuring the accuracy of passenger flow prediction.
[0083] Example 6, see Figure 1 This embodiment is based on the above embodiment. In step S5, the passenger flow prediction is based on the established passenger flow prediction model. Daily flow, seasonal flow, holiday flow, time data, weather data, population density data, traffic data and passenger preference data are collected in real time. After preprocessing and data optimization, they are input into the passenger flow prediction model, and the passenger flow level output by the passenger flow prediction model is used as the passenger flow prediction result.
[0084] It should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device.
[0085] While the embodiments of the present invention have been shown and described, it will be appreciated by those skilled in the art that many changes, modifications, substitutions and variations can be made to the embodiments without departing from the principles and spirit of the invention.
[0086] The present invention and its embodiments are described above, and such description is not restrictive. The drawings show only one embodiment of the present invention, and the actual structure is not limited thereto. In short, if ordinary technicians in the field are inspired by it, without departing from the purpose of the invention, they can design a structure and embodiment similar to the technical solution without creativity, which should belong to the protection scope of the present invention.
Claims
1. A passenger flow prediction method based on artificial intelligence, characterized by: The method comprises the following steps: Step S1: data collection, collecting historical passenger flow data; Step S2: Data preprocessing, data cleaning, data conversion and data set division of the collected data; Step S3: data optimization, introducing the p-th power of the matrix Schatten-p norm and the square of the Frobenius norm to define the objective function, using the soft threshold function to process the noise, and designing an iterative optimization process for data optimization; Step S4: Establish a passenger flow prediction model, construct a passenger flow prediction model architecture by introducing a causal convolutional layer, design a model loss function by introducing a predicted rate of change error, and then complete the establishment of the passenger flow prediction model; Step S5: passenger flow prediction, performing passenger flow prediction based on the established passenger flow prediction model; In step S1, the historical passenger flow data includes daily flow, seasonal flow, holiday flow, time data, weather data, population density data, traffic data, passenger preference data and passenger flow level; the passenger flow level is used as a data label, and the higher the level, the higher the passenger flow; In step S3, data optimization specifically includes the following steps: Step S31: define the objective function; the formula used is as follows: ; ; ; Where Z is the low-rank representation matrix of the predicted historical passenger flow data, is the low-rank representation matrix element; P is the projection space; E is the noise matrix; is the p-th power of the matrix Schatten-p norm, where p is 2; T is the matrix transpose; X is the data matrix, x i is the data matrix element; is the regularization parameter, ranging from 0.1 to 1; is the 2,1 norm of the matrix; is the p-th power of the singular values of the matrix Z; is the identity matrix; d is the matrix dimension; is the square of the L2 norm; Step S32: Optimization; specifically including: Step S321: Optimize the matrix P; introduce generalized Stiefel manifold optimization, which is expressed as follows: ; ; Where trace(·) is the trace of the matrix; is the weighting matrix; is the fitting parameter of the equilibrium passenger flow data, ranging from 0.1 to 1; L1 is the matrix difference; Y1 is the Lagrange multiplier matrix associated with L1; is the optimized matrix; is the square of the Frobenius norm; Step S322: Optimize the matrix Z; expressed as follows: ; ; ; ; In the formula, is the optimization of the matrix Z; I is the identity matrix; L2 and L3 are intermediate variables; S is an auxiliary variable; Y2 is the Lagrange multiplier that handles the constraint Z=S; Step S323: Optimize the regularization term S; optimize by introducing the Schatten-p norm and the auxiliary variable J, as shown below: ; ; In the formula, It is an optimization of S; is the distance element, Q is the distance matrix; Step S324: Optimize the noise matrix E; expressed as follows: ; ; In the formula, It is the optimization of the noise matrix E; is the soft threshold function, τ is a built-in parameter, x is the function input; sign(·) is the sign function; In step S4, establishing a passenger flow prediction model specifically includes the following steps: Step S41: Model architecture design; the established passenger flow prediction model includes a causal convolution layer, which is used to extract local features in historical passenger flow data; an LSTM layer, which is used to process the features extracted by the causal convolution layer and capture the long-term dependencies in the historical passenger flow data; a fully connected layer, which is used to map the output of the LSTM to the final prediction result; and an output layer, which is used to output the predicted passenger flow level; Step S42: define a loss function; construct a loss function based on the prediction error of passenger flow and the error of passenger flow change rate; the formula used is as follows: ; Where Dloss is the loss value of the passenger flow prediction model; and are the actual passenger flow level and predicted passenger flow level at the i1th time step, respectively; and They are the actual passenger flow level change and the predicted passenger flow level change at the i1th time step respectively; and is the parameter for balancing the loss weight, which takes values of 0.6 and 0.4 respectively; N is the total number of time steps, which takes a value of 500; Step S43: model training; update parameters using the Adam optimizer; when the loss function converges to the training set, the passenger flow prediction model training is completed; if the maximum number of iterations is reached, adjust the model parameters and retrain the model; Step S44: model determination; a correctness threshold is pre-set. When the prediction accuracy of the trained passenger flow prediction model for the test set is higher than the correctness threshold, the passenger flow prediction model is established; otherwise, the data set training model is re-divided.
2. The passenger flow prediction method based on artificial intelligence according to claim 1, characterized in that: In step S5, the passenger flow prediction is based on the established passenger flow prediction model, and real-time collection of daily flow, seasonal flow, holiday flow, time data, weather data, population density data, traffic data and passenger preference data are input into the passenger flow prediction model after preprocessing and data optimization. The passenger flow level output by the passenger flow prediction model is used as the passenger flow prediction result.
3. The passenger flow prediction method based on artificial intelligence according to claim 1, characterized in that: In step S2, the data cleaning is to process missing values, duplicate values and outliers; the data conversion is to convert the cleaned data into vector form and standardize it; the data set partitioning is to divide the standardized data into a test set and a training set.
Citation Information
Patent Citations
Greenhouse environment energy-saving control method based on second-order Wollaston model prediction
CN114488811A
Image clustering method based on projection distance regularization low-rank representation
CN117095191A