Bus short-time passenger flow prediction method and related equipment

Through the CNN-LSTM deep learning combination model, the spatio-temporal characteristics and dynamic changes of passenger flow data at bus stations and the problems of low prediction accuracy and incomplete influencing factors in the existing technology are solved, and high-precision prediction of short-term passenger flow of buses is achieved. .

CN119168110APending Publication Date: 2024-12-20XI'AN UNIVERSITY OF ARCHITECTURE AND TECHNOLOGY
View PDF 0 Cites 2 Cited by

Patent Information

Application Number
CN202410967761.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-07-18
Publication Date
2024-12-20

AI Technical Summary

Technical Problem

The existing short-term bus passenger flow prediction model is difficult to show data characteristics when dealing with large and complex problems, resulting in a decrease in prediction accuracy, and incomplete consideration of influencing factors, and insufficient applicability of the model.

Method used

Using the short-time passenger flow prediction method of buses based on the CNN-LSTM deep learning combination model, the multi-source feature data set is constructed by collecting multi-source data for preprocessing and feature engineering, and combining convolutional neural networks and long-term memory networks to extract space-time and weather Features, high-precision prediction.

Benefits of technology

It realizes accurate prediction of short-term passenger flow at bus stops, enriches the method system for passenger flow prediction, improves the prediction accuracy and applicability, and solves the problems of incomplete influencing factors and insufficient applicability of the model.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119168110A_ABST
    Figure CN119168110A_ABST
Patent Text Reader

Abstract

The invention discloses a bus short-time passenger flow prediction method and related equipment, a multi-source feature data set is constructed by collecting bus multi-source data and comprehensively considering the influence of multiple factors such as time, space and external factors on bus passenger flow, and a comprehensive and rich data basis is provided for establishing a high-precision prediction model. And inputting the processed bus multi-source data into the bus passenger flow prediction model to obtain a bus short-time passenger flow prediction result. The public transport passenger flow prediction model provided by the invention is based on a CNN-LSTM deep learning combination model, and the combination model not only can effectively extract the spatial features of the passenger flow data of the public transport station, but also can accurately capture the dynamic change of the passenger flow data on the time sequence, thereby realizing the accurate prediction of the short-time passenger flow of the public transport station. The public transport short-time passenger flow prediction method provided by the invention enriches a method system for passenger flow prediction of a public transport station, and effectively solves the problems that the existing research does not comprehensively consider influence factors on passenger flow prediction and the model is not widely applicable.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention belongs to the technical field of public transport passenger flow prediction, and specifically relates to a public transport short-term passenger flow prediction method and related equipment. Background Art

[0002] With the continuous improvement of the urban public transportation policy system, the quality of urban public transportation services has been greatly improved. Especially under the promotion of smart transportation, the smart public transportation industry has entered a period of rapid development. However, the current passenger flow prediction at bus stops is still a technical difficulty in the urban smart public transportation system. At present, the short-term passenger flow prediction of the public transportation system still has deficiencies in multi-source data integration, handling passenger flow complexity, achieving short-term prediction, and visual display and application of prediction results, which urgently need further research and improvement.

[0003] The existing technology has the following problems: Traditional bus passenger flow prediction is mainly based on historical bus passenger flow data, which has the following problems: (1) In terms of data selection, many studies currently use fewer real and original traffic data sets. In addition to the historical bus passenger flow data directly related to the prediction, external data such as land use information (POI) around the bus station and weather information can also provide services for short-term bus passenger flow prediction. (2) In terms of passenger flow prediction factor consideration, current research is still insufficient in dealing with external influence characteristics, focusing too much on the spatiotemporal characteristics of passenger flow itself, and failing to achieve the fusion of multiple data sets. Therefore, the current prediction results are not widely applicable. (3) In terms of prediction model selection, the linear prediction model has a simple structure and high computational efficiency, but has certain limitations for short-term passenger flow prediction with strong randomness and volatility; the nonlinear prediction model can better deal with the complex nonlinear relationship in passenger flow data, but when encountering large and complex problems, it is difficult to show data characteristics, resulting in reduced prediction accuracy; and although the single deep learning model has a strong fitting ability for complex function processing and can consider more and more complex features, the model is prone to overfitting and poor generalization. Summary of the invention

[0004] The present invention provides a method for predicting short-term passenger flow of public transportation and related equipment, which solves the problem that when the existing prediction model encounters large and complex problems, it is difficult to show data characteristics, resulting in reduced prediction accuracy.

[0005] To achieve the above object, the present invention provides the following technical solutions:

[0006] A method for predicting short-term bus passenger flow, comprising:

[0007] Collect multi-source bus data and pre-process it;

[0008] The pre-processed multi-source bus data is input into the bus passenger flow prediction model, and the bus passenger flow prediction model outputs the prediction result;

[0009] Among them, the bus passenger flow prediction model is based on the CNN-LSTM deep learning combination model, which is obtained through model training and precision testing.

[0010] Preferably, the process of establishing the bus passenger flow prediction model is as follows:

[0011] Collect multi-source bus data and pre-process it;

[0012] The preprocessed multi-source bus data is constructed into a total feature data set, and feature engineering is performed to filter input features to form a feature vector;

[0013] Combine CNN and LSTM to build a CNN-LSTM deep learning combination model;

[0014] Use feature vectors to train the model and determine the optimal network structure and parameters;

[0015] The trained model is applied to the short-term passenger flow prediction of bus stops, and the mean absolute error and root mean square error are used as evaluation indicators to evaluate the prediction accuracy. If the prediction accuracy is insufficient, the data set is retrained. If the prediction accuracy meets the requirements, the model is established.

[0016] Preferably, the steps of performing feature engineering to screen input features are specifically as follows:

[0017] Filter input features through One-Hot encoding quantification, multicollinearity test and data normalization;

[0018] Among them, the multicollinearity test method is: use the variance inflation factor to detect and process multicollinearity, screen features to form the optimal input feature set, and its calculation formula is:

[0019]

[0020] In the formula, is the coefficient of determination when the j-th variable is regressed on all variables;

[0021] The data normalization calculation formula is as follows:

[0022]

[0023] In the formula, μ is the mean of all sample data, and σ is the standard deviation of all sample data.

[0024] In the CNN convolution layer, all processed data comes from the input features selected by feature engineering. Each convolution kernel performs convolution operation with the input features. Through layer-by-layer convolution, CNN gradually extracts the deep features of the data. The calculation formula is as follows:

[0025]

[0026] In the formula, is the input value of the i-th feature of the l-th layer; is the convolution kernel between the jth feature of the lth layer and the ith feature of the l-1th layer, also called the weight; M i is the local receptive field; is the bias vector of the jth feature of the lth layer;

[0027] The core function of the CNN pooling layer is to reduce the dimensionality of the input data. The calculation formula is as follows:

[0028]

[0029] In the formula, down() is the corresponding pooling function, w is the weight, and b is the vector;

[0030] The CNN fully connected layer connects each input node to all nodes in the next layer and adjusts and optimizes the connection weights. The calculation formula is as follows:

[0031]

[0032] LSTM introduces a gating mechanism and internal memory units to enable the network to retain and update information at different time granularities t. The update formula is as follows:

[0033] f t =σ(W f ·[h t-1 ,x t ]+b f )

[0034] i t =σ(W i ·[h t-1 ,x t ]+b i )

[0035]

[0036] o t =σ(W o ·[h t-1 ,x t ]+b o )

[0037]

[0038] Where W is the weight matrix, f is the forget gate, i is the input gate, o is the output gate, c is the unit state, is the current input unit state, h is the final output, is the multiplication of the elements at corresponding positions of two vectors, and σ is the sigmoid activation function.

[0039] Preferably, the construction process of the CNN-LSTM combination model is as follows:

[0040] Determine the input feature dimensions that affect passenger flow changes, construct input features for the data, and divide the processed multi-source data into training sets and test sets for model use;

[0041] The multi-dimensional feature matrix X in the training data set is input into the multi-layer CNN. The CNN component of the model is responsible for extracting spatiotemporal and weather features from the input data and capturing the regularity of passenger flow at the station. The CNN network learns to detect data patterns related to passenger flow, passenger flow data patterns under different numbers of POIs near the station, weather data and passenger flow patterns related to the time series, and finally obtains the sequence feature vector;

[0042] The obtained sequence feature vector is input into a multi-layer LSTM network to predict the time series; the LSTM component of the model is responsible for capturing the long-term dependencies of the time series in the data and training the model based on these dependencies;

[0043] During the model training process, each round of forward propagation will obtain the difference between the predicted value and the true value. Backward propagation updates the parameters of each round of the model by reverse derivation until the loss result meets the requirements and the number of iterations reaches the set maximum number of requirements. Otherwise, the model adjusts the network layer weight parameters through the Adam optimizer, resets the parameters and continues to iterate;

[0044] When the model loss function result meets the requirements and the number of iterations reaches the set maximum number of requirements, the model training is successful. The trained model is used to predict the passenger flow on the feature date in the test set, and the prediction results are evaluated using the constructed evaluation indicators.

[0045] Preferably, the multi-source data includes: bus IC card swiping data, bus line vehicle information data, bus station data, bus GPS data, station POI data, and weather data.

[0046] A public transportation short-term passenger flow prediction system, comprising:

[0047] Data processing module: collects multi-source bus data and performs pre-processing;

[0048] Prediction module: input the pre-processed bus multi-source data into the bus passenger flow prediction model, and the bus passenger flow prediction model outputs the prediction results;

[0049] Among them, the bus passenger flow prediction model is based on the CNN-LSTM deep learning combination model, which is obtained through model training and precision testing.

[0050] A computer device comprises a memory, a processor and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, the steps of a method for predicting short-term passenger flow of public transportation are implemented.

[0051] A computer-readable storage medium stores a computer program, which, when executed by a processor, implements the steps of a method for predicting short-term passenger flow of public transportation.

[0052] Compared with the prior art, the present invention has the following beneficial effects: The present invention provides a method and related equipment for predicting short-term passenger flow of buses. By collecting multi-source bus data and comprehensively considering the influence of various factors such as time, space and external factors on bus passenger flow, a multi-source feature data set is constructed, which provides a comprehensive and rich data foundation for establishing a high-precision prediction model. The processed multi-source bus data is input into the bus passenger flow prediction model to obtain the prediction result of the short-term bus passenger flow. The bus passenger flow prediction model proposed in the present invention is based on the CNN-LSTM deep learning combination model. The combination model can not only effectively extract the spatial characteristics of bus station passenger flow data, but also accurately capture its dynamic changes in time series, thereby realizing the accurate prediction of short-term passenger flow at bus stations. The short-term bus passenger flow prediction method proposed in the present invention enriches the method system of bus station passenger flow prediction, and effectively solves the problem that the existing research does not comprehensively consider the influencing factors of passenger flow prediction and the model is not widely applicable. BRIEF DESCRIPTION OF THE DRAWINGS

[0053] Figure 1 A flow chart of a method for predicting short-term passenger flow of public transportation according to the present invention;

[0054] Figure 2 This is a schematic diagram of the CNN-LSTM combined model framework of the present invention;

[0055] Figure 3 Establish a flow chart for the CNN-LSTM model of the present invention;

[0056] Figure 4 The present invention is a block diagram of a public transportation short-term passenger flow prediction system. DETAILED DESCRIPTION

[0057] In order to make the purpose, technical solutions and advantages of the embodiments of the present invention clearer, 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 part of the embodiments of the present invention, not all of the embodiments. Generally, the components of the embodiments of the present invention described and shown in the drawings here can be arranged and designed in various different configurations.

[0058] Therefore, the following detailed description of the embodiments of the present invention provided in the accompanying drawings is not intended to limit the scope of the invention claimed for protection, but merely represents selected embodiments of the present invention. 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] It should be noted that similar reference numerals and letters denote similar items in the following drawings, and therefore, once an item is defined in one drawing, further definition and explanation thereof is not required in subsequent drawings.

[0060] In order to enable those skilled in the art to better understand the technical solution of the present invention, the present invention will be further described in detail below with reference to the accompanying drawings.

[0061] like Figure 1 As shown, an embodiment of the present invention provides a method for predicting short-term passenger flow of public transportation, which includes:

[0062] S101 collects multi-source bus data and performs pre-processing;

[0063] S102 inputs the pre-processed bus multi-source data into a bus passenger flow prediction model, and the bus passenger flow prediction model outputs a prediction result;

[0064] Among them, the bus passenger flow prediction model is based on the CNN-LSTM deep learning combination model, which is obtained through model training and precision testing.

[0065] Collect IC card swiping data, line vehicle information data, station data, GPS data, and combine them with POI data, weather data, etc. to form a multi-source data set, conduct in-depth research on the changing rules of bus passenger flow, comprehensively consider the impact of spatiotemporal factors and weather factors on passenger flow, and establish a multivariate feature data set. On this basis, use the combined model of CNN and LSTM deep learning (CNN-LSTM) to predict the short-term passenger flow at bus stops.

[0066] like Figure 3 As shown, an embodiment of the present invention provides a process for establishing a CNN-LSTM combination model, which includes:

[0067] Step 1. Data collection and preprocessing: Collect data from multiple sources and use the pandas module to clean, convert and merge data.

[0068] Step 2. Feature construction: Construct the total feature data set for prediction, and filter the input features through feature engineering such as One-Hot encoding quantization, multicollinearity test, and data normalization to form a feature vector;

[0069] Step 3. Model construction: Combining the advantages of CNN and LSTM, build a CNN-LSTM deep learning combination model;

[0070] Step 4. Model training: Use the processed data set to train the model and determine the optimal network structure and parameters; during the model training process, select the ReLU function as the activation function, Adam as the optimizer of the model, and the square error loss function as the loss function.

[0071] Step 5. Prediction and evaluation: The trained model is applied to the short-term passenger flow prediction at bus stops, and MAE and RMSE are used as evaluation indicators to evaluate the prediction accuracy.

[0072] Multi-source data collection:

[0073] The collected multi-source data include: bus IC card swiping data, bus route vehicle information data, bus station data, bus GPS data, station POI (Point of Interest) data, and weather data.

[0074] One-Hot Encoding Quantization:

[0075] The Dayofwork field is encoded as: Monday (1,0,0,0,0,0,0), Tuesday (0,1,0,0,0,0,0), ..., Sunday (0,0,0,0,0,0,1);

[0076] The Weather field is coded as follows: overcast (1,0,0,0); rain (0,1,0,0); cloudy (0,0,1,0); sunny (0,0,0,1);

[0077] The is_weekend (weekend) field is coded as: weekday (0,1); weekend (1,0);

[0078] The is_holiday (holiday or non-holiday) field is coded as: holiday (1,0); non-holiday (0,1);

[0079] The Line field is encoded as: Line 1: (1,0,0....,0).

[0080] Detection and treatment of multicollinearity:

[0081]

[0082] In the formula, is the coefficient of determination when the j-th variable is regressed on all variables.

[0083] Data normalization:

[0084]

[0085] In the formula, μ is the mean of all sample data, and σ is the standard deviation of all sample data.

[0086] CNN Model:

[0087] Convolutional neural network (CNN) is a neural network model that can process raw data at a high level and in an abstract manner. It uses local connections and weight sharing strategies to achieve effective automatic extraction of internal features of data. Its core structure includes convolutional layers, pooling layers, and fully connected layers.

[0088] In the convolution layer, all processed data comes from the data output by the previous input layer. Each convolution kernel will perform convolution operation with the data output by the previous layer. Through this layer-by-layer convolution method, CNN can gradually extract the deep features of the data. The calculation formula is as follows:

[0089]

[0090] In the formula, is the input value of the i-th feature of the l-th layer; is the convolution kernel between the jth feature of the lth layer and the ith feature of the l-1th layer, also called the weight; M i is the local receptive field; is the bias vector of the j-th feature in the l-th layer.

[0091] The core function of the pooling layer is to reduce the dimensionality of the input data. This dimensionality reduction operation reduces the complexity of the data while retaining key information, which greatly facilitates subsequent calculations and processing. The calculation formula is as follows:

[0092]

[0093] In the formula, down() is the corresponding pooling function, w is the weight, and b is the vector.

[0094] The fully connected layer connects each input node to all nodes in the next layer and adjusts and optimizes the connection weights to improve the classification accuracy and generalization ability of the model. The calculation formula is as follows:

[0095]

[0096] LSTM Model:

[0097] The Long Short Term Memory Network (LSTM) is an improved recurrent neural network that can perform better in longer sequences. The model introduces a gating mechanism and internal memory units, allowing the network to retain and update information at different time granularities. The update formula of the LSTM model unit is as follows:

[0098] f t =σ(W f ·[h t-1 ,x t ]+b f )

[0099] i t =σ(W i ·[h t-1 ,x t ]+b i )

[0100]

[0101] o t =σ(W o ·[h t-1 ,x t ]+b o )

[0102]

[0103] Where W is the weight matrix, f is the forget gate, i is the input gate, o is the output gate, c is the unit state, is the current input unit state, h is the final output, is the multiplication of the elements at corresponding positions of two vectors, and σ is the sigmoid activation function.

[0104] The construction process of the CNN-LSTM combination model:

[0105] Step 1: First, determine the input feature dimensions that affect passenger flow changes, such as passenger flow, time, precipitation, temperature, POI, weekends, routes, etc., and construct input features for the data. The processed multi-source data is divided into training sets and test sets for model use.

[0106] Step 2: Input the multi-dimensional feature matrix X in the training data set into the multi-layer CNN. The CNN component of the model is responsible for extracting spatiotemporal and weather features from the input data (feature matrix X) to capture the regularity of passenger flow at the station. The CNN network can learn to detect data patterns related to passenger flow, such as passenger flow data patterns at different time periods during weekends and weeks, passenger flow data patterns under different numbers of POIs near the station, weather data and passenger flow patterns related to time series, and finally obtain sequence feature vectors.

[0107] Step 3: Input the obtained sequence feature vector into the multi-layer LSTM network to predict the time series. The LSTM component of the model is responsible for capturing the long-term dependencies of the time series in the data and training the model based on these dependencies.

[0108] Step 4: During the model training process, each round of forward propagation will obtain the difference (Loss) between the predicted value and the true value. Backward propagation updates the parameters of each round of the model by reverse derivation until the loss result meets the requirements and the number of iterations reaches the set maximum number of requirements. Otherwise, the model adjusts the network layer weight parameters through the Adam optimizer, resets the parameters and continues to iterate.

[0109] Step 5: When the model loss function result meets the requirements and the number of iterations reaches the set maximum number of requirements, the model training is successful. Use the trained model to predict the passenger flow on the feature date in the test set, and evaluate the prediction results using the constructed evaluation indicators.

[0110] Model training:

[0111] The ReLU function is used as the activation function to alleviate the problem of gradient disappearance in the neural network. Its expression is as follows:

[0112]

[0113] The square error loss function is used as the loss function for model training. The definition of this function is as follows:

[0114] L = (yf(x)) 2

[0115] In the formula, y is the true value and f(x) is the predicted value.

[0116] Evaluation indicators:

[0117] The calculation formulas for mean absolute error (MAE) and root mean square error (RMSE) are as follows:

[0118]

[0119] In the formula, y i is the actual observed value of passenger flow, is the predicted value of passenger flow, and n is the predicted sample.

[0120]

[0121] In the formula, y i is the actual observed value of passenger flow, is the predicted value of passenger flow, and n is the predicted sample.

[0122] In view of the problems of insufficient experimental quantity, incomplete consideration of influencing factors and limited applicability of models in existing studies on passenger flow prediction, this paper proposes a method for predicting short-term passenger flow at bus stops based on a combination algorithm of convolutional neural network (CNN) and long short-term memory neural network (LSTM) by using bus IC card swiping data, line vehicle information data, station data, GPS data, and POI data and weather data. During the model training process, the ReLU function is selected as the activation function, Adam is used as the optimizer of the model, and the square error loss function is used as the loss function to improve the performance of the model.

[0123] A specific application example of the present invention is given below, including:

[0124] Data collection

[0125] The data used in this invention comes from the actual operation of XX City from November 5 to December 30, 2018, a total of eight weeks. The data collected includes a bus IC card system data, bus GPS operation data, network map POI data, as well as the daily operation management data of the bus company and XX meteorological data. The data is processed by the pandas module, and the processed data are shown in Tables 1 to 6 below.

[0126] Table 1 Field table of bus IC card dataset

[0127]

[0128] Table 2 Field table of bus GPS dataset

[0129]

[0130] Table 3 Bus vehicle information table

[0131]

[0132] Table 4 Bus stop coordinate fields

[0135] Table 5 POI data fields

[0136]

[0137] Table 6 Weather data fields

[0139] Data Processing)

[0140] (1) Data Association

[0141] The present invention associates multiple tables through the common fields between intelligent public transportation data to obtain more comprehensive information than single-category data, forming a regular data entity. Finally, the boarding station data is obtained, and the processed boarding data fields are shown in Table 7.

[0142] Table 7 Boarding data fields

[0143]

[0144]

[0145] (2) Prediction time step division

[0146] According to the local passenger flow situation in XX City, the passenger flow density of XX bus operation is low and the input intensity is not high. 15min, 30min and 60min are used as the granularity of the prediction time step.

[0147] (3) Passenger flow statistics

[0148] The station name field (Station) and the up and down field (updown) in the boarding data field are merged into a new Station1 field to distinguish station data with the same station name in different up and down directions. The field "people" is added to the card swiping data set as the number of people in the prediction time step, and the data of daily bus running time is clustered into time periods of 15 minutes, 30 minutes, and 60 minutes to obtain the passenger flow in each time period.

[0149] (4) Data Fusion

[0150] The statistical boarding passenger flow data is associated with the POI data through the Station1 (station name) field, and then the associated data set (boarding data-POI data) is associated with the weather data through the DateTime (time) field. Through the two associations, a multi-source total data set of boarding station passenger flow is formed. The complete multi-source total data set fields are shown in Table 8.

[0151] Table 8 Dataset fields

[0152]

[0153]

[0154] Feature Construction

[0155] Input features are selected through feature engineering such as One-Hot encoding quantization, multicollinearity test, and data normalization. The input feature fields are shown in Table 9.

[0156] Table 9 Final input features of the model

[0157]

[0158] In order to verify that the model has a low generalization error in future predictions, the data from the first seven weeks (2018-11-05 to 2018-12-23) is used as the training set to train the model according to the periodicity of the data set, and the data from the eighth week (2018-12-24 to 2018-12-30) is used as the test set to verify the generalization error of the model. The test set does not need to be used for model training.

[0159] Model Building

[0160] like Figure 2 As shown, the embodiment of the present invention provides a framework of a CNN-LSTM combination model.

[0161] In the urban bus station passenger flow prediction model based on CNN-LSTM: CNN is a multi-layer feedforward neural network with outstanding performance in extracting hidden spatial features. CNN is used to extract the potential spatiotemporal relationship of passenger flow at the target station and capture passenger flow features to reduce prediction errors. The LSTM neural network solves the problem that CNN is not easy to handle long time series. Its unique gate structure allows the error propagation to pass directly through the gate without causing the gradient to disappear. It has good convergence and is highly practical in long time series prediction problems. The parameters (weights and bias terms) of the CNN-LSTM model are learned through the back-propagation process using gradient descent optimization, and the parameters are optimized by the Adam optimizer to speed up the convergence and minimize the difference between the predicted output value and the true value.

[0162] Model training and tuning

[0163] The CNN-LSTM model proposed in this paper is implemented with TensorFlow2.0, the operating environment is Python3.6, and the interactive implementation is implemented with jupyter notebook. The grid search method is used to select the hyperparameters in the prediction model, and all possible parameters are tried for training by enumeration. Taking the prediction of the Central Square Station as an example, the number of layers, the number of hidden nodes, the range of attempts of hyperparameters, and the final values ​​are shown in Table 10.

[0164] Table 10 Model parameter value space and final value table

[0165]

[0166]

[0167] Prediction and evaluation

[0168] The experimental sites were sampled by comprehensively considering the passenger flow at the site, the number of POIs within 500m of the site, and the site distribution area. The sites listed in Table 11 below were selected as samples for the experiment (0: up, 1: down).

[0169] Table 11 Site sampling table

[0170]

[0171] Site prediction results

[0172] In order to objectively evaluate whether the short-term bus passenger flow prediction model based on CNN-LSTM has improved in prediction accuracy, several commonly used time series prediction models were selected for comparative experiments, namely support vector regression (SVR), convolutional neural network (CNN), and long short-term memory network (LSTM) models. By applying the above algorithm model to XX bus passenger flow data, the obtained passenger flow prediction results are compared and analyzed with the model of the present invention. The experimental results of short-term bus passenger flow prediction of each model are shown in Table 12.

[0173] Table 12 Statistics of evaluation index results of different models

[0174]

[0175] It can be seen from Table 12 that under the same feature input, the combined prediction model used in the present invention has the highest accuracy at each station. Compared with traditional machine learning and the neural network currently used, the combined model can be modeled according to actual problems, combining the advantages of each model in dealing with problems, thereby improving the accuracy of passenger flow prediction at bus stations.

[0176] In addition, the present invention uses 15 minutes, 30 minutes, and 60 minutes as the prediction time step, and predicts the 5 sampled sites respectively. The prediction results are shown in Table 13.

[0177] Table 13 Statistics of prediction results of different prediction steps

[0178]

[0179] As shown in Table 13 above, the prediction accuracy is relatively good for shorter time steps. The choice of time step will depend on the specific requirements of the application and the available data.

[0180] like Figure 4 As shown, an embodiment of the present invention provides a public transportation short-term passenger flow prediction system, comprising:

[0181] Data processing module: used to collect multi-source bus data and perform pre-processing;

[0182] Prediction module: used to input the pre-processed bus multi-source data into the bus passenger flow prediction model, and the bus passenger flow prediction model outputs the prediction result;

[0183] Among them, the bus passenger flow prediction model is based on the CNN-LSTM deep learning combination model, which is obtained through model training and precision testing.

[0184] A terminal device is provided in one embodiment of the present invention. The terminal device of this embodiment includes: a processor, a memory, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, the steps in the above-mentioned method embodiments are implemented. Alternatively, when the processor executes the computer program, the functions of the modules / units in the above-mentioned device embodiments are implemented.

[0185] The computer program may be divided into one or more modules / units, and the one or more modules / units are stored in the memory and executed by the processor to accomplish the present invention.

[0186] The terminal device may be a computing device such as a desktop computer, a notebook, a PDA, a cloud server, etc. The terminal device may include but is not limited to a processor and a memory.

[0187] The processor 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.

[0188] The memory may be used to store the computer programs and / or modules, and the processor implements various functions of the terminal device by running or executing the computer programs and / or modules stored in the memory and calling the data stored in the memory.

[0189] If the module / unit integrated in the terminal device is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the present invention implements all or part of the processes in the above-mentioned embodiment method, and can also be completed by instructing the relevant hardware through a computer program. The computer program can be stored in a computer-readable storage medium, and the computer program can implement the steps of the above-mentioned various method embodiments when executed by the processor. Among them, the computer program includes computer program code, and the computer program code can be in source code form, object code form, executable file or some intermediate form. The computer-readable medium may include: any entity or device capable of carrying the computer program code, recording medium, U disk, mobile hard disk, disk, optical disk, computer memory, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), electric carrier signal, telecommunication signal and software distribution medium. It should be noted that the content contained in the computer-readable medium can be appropriately increased or decreased according to the requirements of legislation and patent practice in the jurisdiction. For example, in some jurisdictions, according to legislation and patent practice, computer-readable media do not include electric carrier signals and telecommunication signals.

[0190] Although the embodiments of the present invention are described above in conjunction with the accompanying drawings, the present invention is not limited to the above-mentioned specific embodiments and application fields, and the above-mentioned specific embodiments are only illustrative and instructive, rather than restrictive. Under the guidance of the specification, a person skilled in the art can also make many forms without departing from the scope of protection of the claims of the present invention, all of which belong to the scope of protection of the present invention.

Claims

1. A method for predicting short-term passenger flow of public transportation, characterized in that: include: Collect multi-source bus data and pre-process it; The pre-processed multi-source bus data is input into the bus passenger flow prediction model, and the bus passenger flow prediction model outputs the prediction result; Among them, the bus passenger flow prediction model is based on the CNN-LSTM deep learning combination model, which is obtained through model training and precision testing.

2. A method for predicting short-term public transportation passenger flow according to claim 1, characterized in that: The process of establishing the bus passenger flow prediction model is as follows: Collect multi-source bus data and pre-process it; The preprocessed multi-source bus data is constructed into a total feature data set, and feature engineering is performed to filter input features to form a feature vector; Combine CNN and LSTM to build a CNN-LSTM deep learning combination model; Use feature vectors to train the model and determine the optimal network structure and parameters; The trained model is applied to the short-term passenger flow prediction of bus stops, and the mean absolute error and root mean square error are used as evaluation indicators to evaluate the prediction accuracy. If the prediction accuracy is insufficient, the data set is retrained. If the prediction accuracy meets the requirements, the model is established.

3. A method for predicting short-term public transportation passenger flow according to claim 2, characterized in that: The specific steps for feature engineering to filter input features are: Filter input features through One-Hot encoding quantification, multicollinearity test and data normalization; Among them, the multicollinearity test method is: use the variance inflation factor to detect and process multicollinearity, screen features to form the optimal input feature set, and its calculation formula is as follows: In the formula, is the coefficient of determination when the j-th variable is regressed on all variables; The data normalization calculation formula is as follows: In the formula, μ is the mean of all sample data, and σ is the standard deviation of all sample data.

4. A method for predicting short-term public transportation passenger flow according to claim 2, characterized in that: The main structure and calculation formula of the CNN model are as follows: The core structure of the convolutional neural network includes convolutional layer, pooling layer, and fully connected layer; In the convolution layer, all processed data are derived from the input features selected by feature engineering. Each convolution kernel performs convolution operation with the input features. Through layer-by-layer convolution, CNN gradually extracts the deep features of the data. The calculation formula is as follows: In the formula, is the input value of the i-th feature of the l-th layer; is the convolution kernel between the jth feature of the lth layer and the ith feature of the l-1th layer, also called the weight; M i is the local receptive field; is the bias vector of the jth feature of the lth layer; The core function of the pooling layer is to reduce the dimensionality of the input data. The calculation formula is as follows: In the formula, down() is the corresponding pooling function, w is the weight, and b is the vector; The fully connected layer connects each input node to all nodes in the next layer and adjusts and optimizes the connection weights. The calculation formula is as follows:

5. A method for predicting short-term public transportation passenger flow according to claim 2, characterized in that: The main structure and update formula of the LSTM model are as follows: LSTM introduces a gating mechanism and internal memory units, which enables the network to retain and update information at different time granularities t. Its update formula is as follows: f t =σ(W f ·[h t-1 ,x t ]+b f ) i t =σ(W i ·[h t-1 ,x t ]+b i ) the t =σ(W o ·[h t-1 ,x t ]+b o ) Where W is the weight matrix, f is the forget gate, i is the input gate, o is the output gate, c is the unit state, is the current input unit state, h is the final output, is the multiplication of the elements at corresponding positions of two vectors, and σ is the sigmoid activation function.

6. A method for predicting short-term public transportation passenger flow according to claim 2, characterized in that: The construction process of the CNN-LSTM combination model is as follows: Determine the input feature dimensions that affect passenger flow changes, construct input features for the data, and divide the processed multi-source data into training sets and test sets for model use; The multi-dimensional feature matrix X in the training data set is input into the multi-layer CNN. The CNN component of the model is responsible for extracting spatiotemporal and weather features from the input data and capturing the regularity of passenger flow at the station. The CNN network learns to detect data patterns related to passenger flow, passenger flow data patterns under different numbers of POIs near the station, weather data and passenger flow patterns related to the time series, and finally obtains the sequence feature vector; The obtained sequence feature vector is input into the multi-layer LSTM network to predict the time series; The LSTM component of the model is responsible for capturing the long-term dependencies of the time series in the data and training the model based on these dependencies; During the model training process, each round of forward propagation will obtain the difference between the predicted value and the true value. Backward propagation updates the parameters of each round of the model by reverse derivation until the loss result meets the requirements and the number of iterations reaches the set maximum number of requirements. Otherwise, the model adjusts the network layer weight parameters through the Adam optimizer, resets the parameters and continues to iterate; When the model loss function result meets the requirements and the number of iterations reaches the set maximum number of requirements, the model training is successful. The trained model is used to predict the passenger flow on the feature date in the test set, and the prediction results are evaluated using the constructed evaluation indicators.

7. A method for predicting short-term public transportation passenger flow according to claim 2, characterized in that: The multi-source data includes: bus IC card swiping data, bus line vehicle information data, bus station data, bus GPS data, station POI data, and weather data.

8. A public transportation short-term passenger flow prediction system, characterized in that: include: Data processing module: collects multi-source bus data and performs pre-processing; Prediction module: input the pre-processed bus multi-source data into the bus passenger flow prediction model, and the bus passenger flow prediction model outputs the prediction results; Among them, the bus passenger flow prediction model is based on the CNN-LSTM deep learning combination model, which is obtained through model training and precision testing.

9. A computer device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the steps of a method for predicting short-term bus passenger flow as described in any one of claims 1 to 7 are implemented.

10. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the steps of a method for predicting short-term public transportation passenger flow are implemented as described in any one of claims 1 to 7.

Citation Information

Cited By

  • Bus station man-machine interaction system

    CN120066309A

  • Lightweight transportation junction passenger flow prediction system and method

    CN120633955A