Adaptive Traffic Flow Prediction Method Based on Machine Learning and Collaborative Filtering

By constructing a multi-model library and collaborative filtering algorithm, and combining machine learning and deep learning models LSTMs, the problem of high computing power and time cost of deep learning models in traffic flow prediction is solved, and efficient and accurate road traffic prediction is achieved.

CN116343472BActive Publication Date: 2025-10-31SHANGHAI YANZHICHEN TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202310017413.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-01-06
Publication Date
2025-10-31
Estimated Expiration
2043-01-06

AI Technical Summary

Technical Problem

Existing deep learning models have excessively high computational and time costs in short-term traffic flow prediction, making it difficult to achieve efficient and accurate traffic flow prediction on different roads and at different times.

Method used

We employ a machine learning and collaborative filtering approach. By constructing a multi-model library, we utilize non-parametric machine learning models and deep learning models LSTMs, combined with collaborative filtering algorithms, to recommend suitable models based on road traffic characteristics and similarity. This reduces the number of training iterations for deep learning models, improves prediction accuracy, and saves computing power.

Benefits of technology

It achieves high-precision traffic flow prediction on different roads and at different times, reduces computing power and training time costs, and improves the applicability and efficiency of the model.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116343472B_ABST
    Figure CN116343472B_ABST
Patent Text Reader

Abstract

This invention discloses an adaptive traffic flow prediction method based on machine learning and collaborative filtering. It utilizes a data-driven nonparametric machine learning model library to predict urban road traffic flow by entrance and time period. Instead of a globally optimal prediction model, it selects the best model from multiple options, ensuring optimal prediction results for each entrance at different times. Furthermore, it incorporates high-performance deep learning models (LSTMs) into the model library, improving the upper limit of prediction accuracy. By employing the concept of collaborative filtering, this invention achieves the effect of obtaining the optimal model for all entrances by training only a subset of entrances with the full model. This avoids training deep learning models for all entrances, saving computational power and training time.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to an adaptive prediction method for short-term traffic flow on urban roads based on machine learning models and collaborative filtering algorithms, belonging to the field of intelligent transportation, and particularly to the field of traffic flow prediction technology in intelligent transportation. Background Technology

[0002] With social and economic development and rapid urbanization, the number of motor vehicles in cities is growing rapidly, leading to increasingly serious traffic congestion. To ensure the healthy and stable operation of urban transportation, intelligent transportation systems (ITS) have emerged. Short-term traffic flow prediction technology is a key component of ITS, applied to modules such as real-time signal control, route guidance, and automatic navigation.

[0003] Short-term traffic flow prediction typically refers to the prediction of traffic flow within a short period, usually limited to 15 minutes. After decades of research and development, many models have emerged in the field of short-term traffic flow prediction, such as historical trend averaging models based on simple rules, parametric models based on mathematical models like linear regression and Kalman filtering, and data-driven nonparametric machine learning models. With the rapid development and widespread application of traffic detectors in recent years, and the improvement in traffic data storage and processing capabilities, research on machine learning-based short-term traffic flow prediction has become a hot topic. Major nonparametric machine learning models include K-nearest neighbors, support vector regression, and neural networks. Stacked Long Short-Term Memory Networks (LSTMs) are a variant of recurrent neural networks, belonging to deep learning models. They have certain advantages in time series modeling problems, possessing long-term memory capabilities and are commonly used for traffic flow prediction. Deep learning models generally have higher prediction accuracy than other machine learning models, but require more data and longer training time, placing high demands on computing power.

[0004] Collaborative filtering is a widely used recommendation algorithm. This algorithm discovers user preferences by mining historical user behavior data, then categorizes users and recommends products to users of similar categories.

[0005] Most existing short-term traffic flow prediction methods aim to find a globally optimal model to solve the traffic flow prediction problem for all roads. However, in reality, different roads have significant differences in grade and function, leading to markedly different traffic flow patterns. Furthermore, the traffic flow characteristics of the same road also vary significantly at different times. Therefore, different models have varying applicability to different roads and different time periods. While deep learning models have achieved excellent results in short-term traffic flow prediction in existing research, their training in practical applications places excessive demands on server computing power and takes too long, significantly increasing the barrier to entry and time costs. Therefore, while utilizing deep learning models to improve prediction accuracy, saving computing power and time costs has become an urgent problem to be solved. Summary of the Invention

[0006] The technical problem to be solved by this invention is: how to save computing power and time costs while using deep learning models to improve the accuracy of traffic flow prediction.

[0007] To address the aforementioned technical problems, the present invention provides a traffic flow adaptive prediction method based on machine learning and collaborative filtering, characterized by comprising the following steps:

[0008] Step 1: Create training and test sets for training machine learning models;

[0009] Step 2: Construct a feature matrix for inputting the machine learning model based on the training set and the test set. This feature matrix includes traffic information, weekday / non-working day information for the corresponding time period, and the corresponding time period information.

[0010] Step 3: Establish the formula for calculating the model accuracy p, as shown in the following formula:

[0011]

[0012] In the formula, MAPE is the model accuracy index calculated based on the mean absolute percentage error conversion.

[0013] Step 4: Build a model library containing multiple nonparametric machine learning models and one deep learning model;

[0014] Step 5: Determine the dominant model for traffic flow forecasting at different inlets and time periods, including the following steps:

[0015] Step 501: Divide the N inlet lanes into two inlet lane sets, denoted as inlet lane set C1 and inlet lane set C2 respectively;

[0016] Step 502: For the import channels belonging to the import channel set C1, train all models in the model library using the training set; after training, calculate the prediction accuracy of the model using the test set for T time periods, and obtain the three-dimensional array P of the prediction accuracy of each import channel in the import channel set C1 under each model for different time periods. i*m*t Where i is the import lane number, i∈C1; m represents the m-th model in the model library; t is the time period type, t∈T;

[0017] For each import lane in import lane set C2, train all models in the model library except for deep learning models using the training set. After training, calculate the prediction accuracy of the model using the test set over T time periods. This yields the prediction accuracy array P for each import lane in import lane set C2 under different time periods using models other than deep learning models. j*m*t Where j is the import channel number, j∈C2; m represents the m-th model in the model library other than deep learning models; t is the time period type, t∈T;

[0018] Step 503: Obtain the dominant model based on the prediction accuracy array and save the dominant model. Finally, obtain the dominant models for traffic flow prediction of different inlet channels belonging to inlet channel set C1 and inlet channel set C2 at different time periods.

[0019] Step 6: Calculate the similarity between the approach lanes using the Pearson correlation coefficient formula:

[0020]

[0021]

[0022]

[0023] In the formula, S i*j p represents the similarity between import channel i in import channel set C1 and import channel j in import channel set C2. imt p jmt Let i and j be the traffic prediction accuracy of import lane i and import lane j based on prediction model m in prediction period t, respectively, i∈C1, j∈C2; These are the average accuracy values ​​of inlet track i and inlet track j, respectively; n M The number of nonparametric machine learning models in the model library, n T Number of time periods;

[0024] Step 7: Based on the similarity calculated in Step 6, obtain the similarity matrix S between import lane i in import lane set C1 and import lane j in import lane set C2. i*j Traverse the similarity matrix Si*j Each column yields the final advantage model For the similarity matrix S i*j The current column in the table contains:

[0025] Obtain the similarity matrix S i*j Given the maximum value V of the current column and the corresponding inlet channel number, i = n1, j = n2, if V ≥ the threshold, then inlet channel i = n1 is considered to be a similar inlet channel j = n2; if V < the threshold, then there is no inlet channel j = n2 in the inlet channel set C1.

[0026] If similar inbound lanes exist for inbound lane j = n2, then a deep learning model recommendation is made based on the set of advantageous models for inbound lane i = n1: To determine whether a deep learning model is one of its advantageous models, the specific steps are as follows:

[0027] like Then the import channel j=n2 maintains the original advantageous model strategy.

[0028] like Then, the LSTMs in the model library are trained using the inlet channel j=n2 to obtain the prediction accuracy. Update the advantage model for inlet flow forecasting

[0029] If no similar entry lane exists for entry lane j = n2, then the same entry lane j = n2 is used to train LSTMs in the model library to obtain the prediction accuracy. Update the advantage model for inlet flow forecasting

[0030] Preferably, step 1 includes the following steps:

[0031] Step 101: Determine the spatial range of traffic flow prediction, the time range of data collection, the traffic flow statistics interval, and the prediction time interval; collect the traffic flow data set of the entrance lanes of urban road intersections within the specified spatial and time range for subsequent traffic flow data extraction.

[0032] Step 102: Perform data preprocessing on the acquired checkpoint vehicle passage data to obtain the preprocessed checkpoint vehicle passage dataset. Perform traffic flow statistics on the preprocessed checkpoint vehicle passage dataset according to the statistical interval to obtain the traffic flow dataset for each approach lane of each intersection.

[0033] Step 103: Divide the traffic dataset into a training set and a test set.

[0034] Preferably, in step 2, the traffic information is normalized using a standardized formula.

[0035] Preferably, in step 2, the workday / non-workday information and the corresponding time period information are normalized using one-hot encoding.

[0036] Preferably, in step 3, the calculation formula for the model accuracy index MAPE is:

[0037]

[0038] In the formula, y t This represents the actual traffic volume during time period t. denoted as the predicted flow rate for time period t; N represents the number of time periods in the statistics; ∈ represents a local minimum.

[0039] Preferably, in step 501: if N is even, then the first N / 2 inlet channels form the inlet channel set C1, and the last N / 2 inlet channels form the inlet channel set C2; if N is odd, then the first (N+1) / 2 inlet channels form the inlet channel set C1, and the last (N-1) / 2 inlet channels form the inlet channel set C2.

[0040] Preferably, in step 503, the logic for selecting the dominant model is as follows: assuming that the two models with the highest accuracy in predicting the flow rate at a certain inlet are m1 and m2, with accuracies of p1 and p2 respectively, and p1 ≥ p2:

[0041] If both m1 and m2 are nonparametric machine learning models, then the model with the highest accuracy, m1, is selected as the dominant model.

[0042] If m2 is a deep learning model, then model m1 is the dominant model;

[0043] If m1 is a deep learning model and Then model m1 is the dominant model. Then m2 is the dominant model.

[0044] Compared with the prior art, the present invention has the following beneficial effects:

[0045] 1) Improved prediction accuracy.

[0046] This study utilizes a data-driven, nonparametric machine learning model library to predict urban road traffic flow by entrance and time period. It abandons the globally optimal prediction model approach, selecting the best among multiple models to ensure optimal prediction results for each entrance at different times. Furthermore, it incorporates LSTMs, a deep learning model with superior prediction performance, into the model library, thereby improving the upper limit of prediction accuracy.

[0047] 2) Saves computing power and training time.

[0048] By utilizing the concept of collaborative filtering, only a subset of the input channels need to be used for full model training to achieve the effect of obtaining the optimal model for all input channels. This avoids training a deep learning model for all input channels, saving computing power and training time. Attached Figure Description

[0049] Figure 1 Example of a superior model;

[0050] Figure 2 This is the overall process of the present invention. Detailed Implementation

[0051] The present invention will be further illustrated below with reference to specific embodiments. It should be understood that these embodiments are for illustrative purposes only and are not intended to limit the scope of the invention. Furthermore, it should be understood that after reading the teachings of this invention, those skilled in the art can make various alterations or modifications to the invention, and these equivalent forms also fall within the scope defined by the appended claims.

[0052] This embodiment discloses a traffic flow adaptive prediction method based on machine learning models and collaborative filtering, which includes the following steps:

[0053] Step S-1: First, determine the spatial range of traffic flow prediction, the time range of data collection, the traffic flow statistics interval, and the prediction time interval. Then, within the specified spatial and time range, collect the traffic flow data at the entrance lanes of urban road intersections for subsequent traffic flow data extraction.

[0054] Step S-2: Perform data preprocessing on the acquired checkpoint vehicle passage data, including removing abnormal data and deleting duplicate data, to obtain the preprocessed checkpoint vehicle passage dataset.

[0055] Step S-3: Perform traffic flow statistics on the preprocessed checkpoint vehicle data set according to the statistical interval to obtain the traffic flow data set for each approach lane of each intersection.

[0056] Step S-4: Divide the traffic data for subsequent machine learning model training.

[0057] First, the traffic dataset is arranged chronologically. Then, it is split into training and test sets in an 8:2 ratio. This ratio can be adjusted according to the actual situation, but in principle, the majority is for training and the smaller portion is for testing. The training set data is used for model training and validation during training, while the test set is used for calculating the prediction accuracy after training.

[0058] Step S-5: Feature matrix construction.

[0059] The feature matrix input to the machine learning model should include traffic flow information, as well as weekday / non-weekday information and the corresponding time period. Each type of information is normalized using a different method. Normalization unifies the data scale across different information types, which helps accelerate model training and improve prediction accuracy.

[0060] Step S-5 further includes the following steps:

[0061] Step S-5-1: Traffic data is continuous, therefore the training and test sets are normalized using a standardization formula. The standardization formula is:

[0062]

[0063]

[0064] In the formula, X represents traffic data, X * For standardized data, X is the mean of the training set data, σ is the standard deviation of the training set data, and X is the mean of the training set data. i Let be the i-th sample in the training set, and n be the number of samples in the training set.

[0065] Step S-5-2: Weekday / non-weekday information and time period information are categorized data, typically normalized using one-hot encoding. Time periods are divided into nighttime (23:00-6:00), morning peak (7:00-9:00), off-peak (6:00-7:00, 9:00-17:00, 19:00-23:00), and evening peak (17:00-19:00). The encoding rules are shown in Tables 1 and 2 below:

[0066] Time period characteristics Encoded value at night 1 0 0 0 Morning rush hour 0 1 0 0 Peak 0 0 1 0 Evening rush hour 0 0 0 1

[0067] Table 1

[0068]

[0069] Table 2

[0070] Step S-6-2: Calculate the accuracy metric for the prediction model using the test set data to evaluate its predictive performance. The accuracy metric is calculated based on the Mean Absolute Percentage Error (MAPE). MAPE ranges from [0, ∞), with a higher MAPE indicating lower prediction accuracy. The MAPE calculation formula is as follows:

[0071]

[0072] In the formula, y tThis represents the actual traffic volume during time period t. is the predicted flow rate for time period t; N is the number of time periods counted; ∈ is a minimum value, which is 0.0000l in this embodiment.

[0073] To transform the evaluation of prediction model error into an evaluation of prediction model accuracy, MAPE is converted into model accuracy p according to the following formula. The model accuracy p ranges from [0, 1], and the higher the accuracy, the better the prediction performance of the prediction model.

[0074]

[0075] Step S-6: Construct a model library containing multiple nonparametric machine learning models and deep learning models. This invention selects several common machine learning and deep learning models and constructs a model library including K-Nearest Neighbors (KNN), Multilayer Perceptron (MLP), Support Vector Regression (SVR), and Stacked Long Short-Term Memory Networks (LSTMs) for subsequent training and prediction.

[0076] Step S-7: Determine the dominant model for traffic flow forecasting at different inlets during different time periods, further including the following steps:

[0077] Step S-7-1: Divide the import lane set.

[0078] Assume there are N inlet lanes in total. The inlet lanes are randomly sorted and numbered sequentially. The first N / 2 inlet lanes form the inlet lane set C1 = {1, 2, ..., N / 2} (if N is odd, then take (N+1) / 2; for convenience, this embodiment assumes N is even); the last N / 2 inlet lanes form the inlet lane set C2 = {N / 2+1, ..., N}.

[0079] Step S-7-2: For the entrance lanes belonging to entrance lane set C1, train all models in the model library using the training set. After training, calculate the prediction accuracy of the model using the test set in four time periods. The four time periods are: Morning Peak (MP, 7:00-9:00), Evening Peak (EP, 17:00-19:00), Off-Peak (OP, 6:00-7:00, 9:00-17:00, 19:00-23:00), and Night (NT, 23:00-6:00). The three-dimensional array of prediction accuracy for each entrance lane under each model in different time periods is P. i*m*t , i is the import lane number, i∈C1, m is the model type, m∈{KNN, MLP, SVR, LSTMs}, t is the time period type, t∈{MP, EP, OP, NT}.

[0080] Step S-7-2: For the import lanes belonging to the import lane set C2, train the other models in the model library (excluding LSTMs) using the training set. After training, calculate the prediction accuracy for different time periods using the test set, obtaining the prediction accuracy array P for each import lane under the first three machine learning models at different time periods. j*m*t j is the inlet lane number, j∈C2, m∈{KNN, MLP, SVR}, t∈{MP, EP, OP, NT}.

[0081] Step S-7-3: Obtain the dominant model based on the prediction accuracy array and save the dominant model.

[0082] For each time period of the import channel for each predicted object, there exists a dominant model. For traditional machine learning models, the one with the highest prediction accuracy is the dominant model. However, LSTMs are deep learning models with high training costs, so efficiency must be considered when selecting the dominant model. When other machine learning models have similar prediction accuracy to LSTMs, the machine learning model with lower training costs is considered the dominant model; when the prediction accuracy of LSTMs is significantly higher than that of traditional machine learning models, then LSTMs are considered the dominant model.

[0083] The logic for selecting the superior model is as follows: Assume that the two models with the highest accuracy in predicting the flow rate at a certain inlet are m1 and m2, and their accuracies are p1 and p2, respectively, with p1 ≥ p2:

[0084] If m1 and m2 are both general machine learning models, then the model with the highest accuracy, m1, is selected as the dominant model.

[0085] If m2 is an LSTMs, then model m1 is the dominant model;

[0086] If m1 is an LSTMs and Then model m1 is the dominant model. Then m2 is the dominant model.

[0087] Ultimately, we can obtain the superior models for predicting traffic flow at different inlets at different time periods.

[0088] Step S-8: The main idea behind user-based collaborative filtering is that similar users tend to make similar choices when faced with the same problem. For example, in shopping, collaborative filtering algorithms use users' historical behavior data to obtain their level of liking for products and quantify this liking. Based on different users' preferences for the same products, the similarity between users is calculated. This allows for product recommendations among users with similar preferences.

[0089] Using the user-based collaborative filtering algorithm, if we consider the predicted inbound channels as users and the prediction model as a product, then the traffic prediction accuracy is like the user's rating of the product. Therefore, the prediction accuracy P is the inbound channel's rating of the prediction model. The similarity S between the inbound channel sets C1 and C2 is then calculated using the prediction accuracy. i*j The calculation is performed. Then, model recommendations can be made based on the set of advantageous models for similar import lanes in import lane set C1 to the import lanes in import lane set C2.

[0090] Step S-8 specifically includes the following steps:

[0091] Step S-8-1: To assess the similarity between the entrance channels of the predicted objects, this invention uses the Pearson correlation coefficient, a commonly used statistical metric, as the similarity measure. The Pearson correlation coefficient is widely used to measure the correlation between two variables, with a value range of [-1, 1]. A larger coefficient indicates a stronger correlation between the two variables. The formula for calculating this coefficient is:

[0092]

[0093] In the formula: r is the Pearson correlation coefficient; X i Y i For sample values ​​of two variables; is the sample mean, and n is the number of samples.

[0094] Step S-8-2: Calculate the similarity between the approach lanes using the Pearson correlation coefficient formula:

[0095]

[0096]

[0097]

[0098] In the formula S i*j p represents the similarity between import channel i in import channel set C1 and import channel j in import channel set C2. imt p jmt Let i and j be the traffic prediction accuracy of import lane i and import lane j based on prediction model m in prediction period t, respectively, i∈C1, j∈C2, m∈{KNN, MLP, SVR}, t∈{MP, EP, OP, NT}; Let n be the average accuracy of inlet track i and inlet track j, respectively, where n is the average accuracy of inlet track i and inlet track j. M The number of models in the model library after removing deep learning models LSTMs, n T This represents the number of time periods.

[0099] Step S-9: Update the current dominant model for inlet traffic flow forecasting, including the following steps:

[0100] Step S-9-1: Based on the similarity calculated in step S-8, determine the similar import lanes in import lane set C1 and import lane set C2.

[0101] From step S-8, we can obtain the similarity matrix S between import lane i in import lane set C1 and import lane j in import lane set C2. i*j Obtain the similarity matrix S. i*j The maximum value V of a certain column and the corresponding inlet channel number (i = n1, j = n2). If V ≥ 0.5, then inlet channel i = n1 is considered to be a similar inlet channel j = n2; if V < 0.5, then there is no inlet channel j = n2 in the inlet channel set C1.

[0102] Step S-9-2: If similar entry lanes exist for entry lane j = n2, then recommend LSTM models based on similar entry lanes i = n1. This is done according to the set of advantageous models for entry lane i = n1. The specific steps to determine whether LSTMs are one of its advantageous models are as follows:

[0103] like Then the import channel j=n2 maintains the original advantageous model strategy.

[0104] like Then, the LSTMs in the model library are trained using the inlet channel j=n2 to obtain the prediction accuracy. Update the dominant model for inlet flow prediction according to step S-7-3.

[0105] Step S-9-3: If no similar entrance lane exists for entrance lane j=n2, then train the LSTMs in the model library for the same entrance lane j=n2 to obtain the prediction accuracy. Update the dominant model for inlet flow prediction according to step S-7-3.

[0106] Step S-10: Refer to step S-9 to calculate the similarity S i*j By iterating through each column of the matrix, the final advantage model can be obtained. The final prediction model scheme is as follows Figure 1 As shown in the figure, the dominant model is highlighted in bold, and each inlet can predict traffic flow according to its own dominant model at different times.

Claims

1. A traffic flow adaptive prediction method based on machine learning and collaborative filtering, characterized in that, Includes the following steps: Step 1: Create training and test sets for training machine learning models; Step 2: Construct a feature matrix for inputting the machine learning model based on the training set and the test set. This feature matrix includes traffic information, weekday / non-working day information for the corresponding time period, and the corresponding time period information. Step 3: Establish the formula for calculating the model accuracy p, as shown in the following formula: In the formula, MAPE is the model accuracy index calculated based on the mean absolute percentage error conversion. Step 4: Build a model library containing multiple nonparametric machine learning models and one deep learning model; Step 5: Determine the dominant model for traffic flow forecasting at different inlets and time periods, including the following steps: Step 501: Divide the N inlet lanes into two inlet lane sets, denoted as inlet lane set C1 and inlet lane set C2 respectively; Step 502: For the import channels belonging to the import channel set C1, train all models in the model library using the training set; after training, calculate the prediction accuracy of the model using the test set for T time periods, and obtain the three-dimensional array P of the prediction accuracy of each import channel in the import channel set C1 under each model for different time periods. i*m*t Where i is the import lane number, i∈C1; m represents the m-th model in the model library; t is the time period type, t∈T; For each import lane in import lane set C2, train all models in the model library except for deep learning models using the training set. After training, calculate the prediction accuracy of the model using the test set over T time periods. This yields the prediction accuracy array P for each import lane in import lane set C2 under different time periods using models other than deep learning models. j*m*t Where j is the import channel number, j∈C2; m represents the m-th model in the model library other than deep learning models; t is the time period type, t∈T; Step 503: Obtain the dominant model based on the prediction accuracy array and save the dominant model. Finally, obtain the dominant models for traffic flow prediction of different inlet channels belonging to inlet channel set C1 and inlet channel set C2 at different time periods. Step 6: Calculate the similarity between the approach lanes using the Pearson correlation coefficient formula: In the formula, S i*j p represents the similarity between import channel i in import channel set C1 and import channel j in import channel set C2. imt p jmt Let i and j be the traffic flow prediction accuracy of import lane i and import lane j based on prediction model m in prediction period t, respectively, i∈C1, j∈C2; These are the average accuracy values ​​of inlet track i and inlet track j, respectively; n M The number of nonparametric machine learning models in the model library, n T Number of time periods; Step 7: Based on the similarity calculated in Step 6, obtain the similarity matrix S between import lane i in import lane set C1 and import lane j in import lane set C2. i*j Traverse the similarity matrix S i*j Each column yields the final advantage model For the similarity matrix S i*j The current column in the table contains: Obtain the similarity matrix S i*j Given the maximum value V of the current column and the corresponding inlet channel number, i = n1, j = n2, if V ≥ the threshold, then inlet channel i = n1 is considered to be a similar inlet channel j = n2; if V < the threshold, then there is no inlet channel j = n2 in the inlet channel set C1. If similar inbound lanes exist for inbound lane j = n2, then a deep learning model recommendation is made based on the set of advantageous models for inbound lane i = n1: To determine whether a deep learning model is one of its advantageous models, the specific steps are as follows: like Then the import channel j=n2 maintains the original advantageous model strategy. like Then, the LSTMs in the model library are trained using the inlet channel j=n2 to obtain the prediction accuracy. Update the advantage model for inlet flow forecasting If no similar entry lane exists for entry lane j = n2, then the same entry lane j = n2 is used to train LSTMs in the model library to obtain the prediction accuracy. Update the advantage model for inlet flow forecasting 2. The traffic flow adaptive prediction method based on machine learning and collaborative filtering as described in claim 1, characterized in that, Step 1 includes the following steps: Step 101: Determine the spatial range of traffic flow prediction, the time range of data collection, the traffic flow statistics interval, and the prediction time interval; collect the traffic flow data set of the entrance lanes of urban road intersections within the specified spatial and time range for subsequent traffic flow data extraction. Step 102: Perform data preprocessing on the acquired checkpoint vehicle passage data to obtain the preprocessed checkpoint vehicle passage dataset. Perform traffic flow statistics on the preprocessed checkpoint vehicle passage dataset according to the statistical interval to obtain the traffic flow dataset for each approach lane of each intersection. Step 103: Divide the traffic dataset into a training set and a test set.

3. The traffic flow adaptive prediction method based on machine learning and collaborative filtering as described in claim 1, characterized in that, In step 2, the traffic information is normalized using a standardized formula.

4. The traffic flow adaptive prediction method based on machine learning and collaborative filtering as described in claim 1, characterized in that, In step 2, the workday / non-workday information and the corresponding time period information are normalized using one-hot encoding.

5. The traffic flow adaptive prediction method based on machine learning and collaborative filtering as described in claim 1, characterized in that, In step 3, the formula for calculating the model accuracy index MAPE is as follows: In the formula, y t This represents the actual traffic volume during time period t. t represents the predicted flow rate for time period t; N represents the number of time periods included in the statistics. ∈ is a local minimum.

6. The traffic flow adaptive prediction method based on machine learning and collaborative filtering as described in claim 1, characterized in that, In step 501: If N is even, then the first N / 2 inlet channels form the inlet channel set C1, and the last N / 2 inlet channels form the inlet channel set C2; if N is odd, then the first (N+1) / 2 inlet channels form the inlet channel set C1, and the last (N-1) / 2 inlet channels form the inlet channel set C2.

7. The traffic flow adaptive prediction method based on machine learning and collaborative filtering as described in claim 1, characterized in that, In step 503, the logic for selecting the dominant model is as follows: assuming that the two models with the highest accuracy in predicting the flow rate at a certain inlet are m1 and m2, with accuracies of p1 and p2 respectively, and p1 ≥ p2: If both m1 and m2 are nonparametric machine learning models, then the model with the highest accuracy, m1, is selected as the dominant model. If m2 is a deep learning model, then model m1 is the dominant model; If m1 is a deep learning model and Then model m1 is the dominant model. Then m2 is the dominant model.