Federal learning traffic prediction method based on traffic mode classification

By introducing traffic mode classification and cluster analysis into federated learning, the accuracy and reliability problems of federated learning in processing complex and diverse traffic data are solved, and more efficient and accurate traffic predictions are achieved.

CN119314329AActive Publication Date: 2025-01-14ZHEJIANG UNIV
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
CN202411356989.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-27
Publication Date
2025-01-14
Estimated Expiration
2044-09-27

AI Technical Summary

Technical Problem

When building traffic prediction models, Federal Learning faces the challenge of different data between different traffic data management centers and the complex changes in data collection of traffic data management centers, which leads to the inability to effectively utilize different data sources, affecting the accuracy and reliability of prediction results.

Method used

The federated learning method based on traffic mode classification is used to identify different traffic modes through clustering algorithms, build a multi-layer perceptron traffic mode classification model, and use the gated cyclic unit GRU for prediction, combining federated learning and cluster analysis to achieve distribution Data training and pattern recognition.

Benefits of technology

It effectively reduces the prediction inaccuracy caused by differences in data distribution, improves the accuracy and adaptability of traffic prediction, can better respond to mode changes in traffic time series data, and improves the reliability of prediction.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119314329A_ABST
    Figure CN119314329A_ABST
Patent Text Reader

Abstract

The invention discloses a federated learning traffic prediction method based on traffic mode classification, and the method comprises the steps: firstly carrying out the clustering of the traffic data of a to-be-predicted traffic data management center, constructing a label according to a clustering result, and constructing a traffic mode classification model based on a multi-layer perceptron; then model parameters of the traffic mode classification model are shared to other traffic data management centers, the other traffic data management centers classify local traffic data, and then each category of data set after classification is utilized to train a gating cycle unit GRU according to a federated learning framework to obtain model parameters of each category of GRU; and finally, classifying the future traffic flow of the to-be-predicted traffic data management center, and predicting the future traffic flow of the to-be-predicted traffic data management center by using the model parameters of the GRU of the corresponding category.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of traffic flow prediction, and in particular to a federated learning traffic prediction method based on traffic mode classification. Background Art

[0002] With the acceleration of urbanization and the rapid development of social economy, the number of private cars and public transportation has increased rapidly. Traffic congestion has become a major problem for urban residents, especially during holidays and rush hours. Smart cities can greatly improve traffic conditions and thus improve urban travel efficiency by using modern information technologies such as big data, the Internet of Things, cloud computing and artificial intelligence. Real-time and effective traffic forecasting is an important part of smart city traffic management. Through comprehensive analysis of data such as traffic flow, vehicle speed, road conditions, etc., traffic forecasting can provide a scientific basis for traffic management departments, helping them to optimize traffic signal control and vehicle diversion, thereby effectively improving traffic operation efficiency and reducing congestion time.

[0003] In intelligent transportation systems, accurate traffic flow prediction is crucial for traffic management and planning. Traditional traffic prediction methods mainly rely on statistical models, which have limitations when dealing with complex and dynamically changing traffic networks. In recent years, machine learning methods have gradually become a research hotspot in the field of traffic prediction. These methods not only have strong generalization capabilities, but also can capture and learn more complex nonlinear relationships, so as to better adapt to changing traffic conditions. In particular, the rapid development of deep learning technology has made it possible to build multi-level neural networks, thus achieving unprecedented accuracy and robustness in traffic prediction. Secondly, many traffic flow deep learning prediction methods often rely on centralized data collection and processing, which not only poses the risk of data privacy leakage, but also makes it difficult to adapt to the dynamic changes of traffic patterns. Federated learning allows devices to train prediction models locally without transmitting raw data to centralized servers. Each device only needs to share its trained model parameters. This approach not only effectively reduces the cost of data transmission and storage, but also improves data privacy and security, because the data always remains on the local device, reducing the risk of data leakage.

[0004] However, when constructing traffic prediction models, federated learning faces the challenges of different data between different traffic data management centers and the complex changes in the data collected by traffic data management centers. This may result in the model being unable to effectively utilize data from different traffic data management centers, which in turn affects the accuracy and reliability of the prediction results. Although federated learning helps protect data privacy, it still has limitations in dealing with the complexity and diversity of traffic data, and further research and improvement of model building methods are needed to adapt to actual application needs. Summary of the invention

[0005] In view of the shortcomings of the prior art, the present invention proposes a federated learning traffic prediction method based on traffic mode classification. The specific technical solution is as follows:

[0006] A traffic prediction method based on federated learning of traffic mode classification, the method comprising the following steps:

[0007] S1: Clustering the traffic data of the traffic data management center to be predicted using a clustering algorithm to identify different traffic modes;

[0008] S2: Based on the clustering results, construct labels and build a traffic mode classification model based on a multi-layer perceptron

[0009] r = f c (x; D A1 ,D A2 ,…,D Ai ,…,D AK )

[0010] Among them, x represents the input traffic time series data, r represents the corresponding output category, and D Ai represents the traffic data of the i-th category;

[0011] S3: sharing the model parameters of the traffic mode classification model of the traffic data management center to be predicted with other traffic data management centers, and the other traffic data management centers classify local traffic data according to the model parameters; using the classified data sets of each category to train the gated recurrent unit GRU respectively according to the federated learning framework to obtain the model parameters of the gated recurrent unit GRU of each category;

[0012] S4: classify the future traffic flow of the traffic data management center to be predicted, and use the model parameters of the gated recurrent unit GRU of the corresponding category to predict the future traffic flow of the traffic data management center to be predicted.

[0013] Furthermore, in S3, after the other traffic data management center classifies the local traffic data according to the model parameters, the uncertainty of the sample classification result is calculated for each category of samples, and valid samples with uncertainty below a threshold are extracted;

[0014] The calculation formula of uncertainty is as follows:

[0015]

[0016] Among them, p i represents the predicted probability of the model for category i; H is the entropy of quantifying uncertainty, and ∈ is a constant.

[0017] Furthermore, the classified data sets of each category are used to train the gated recurrent unit GRU according to the federated learning framework, which specifically includes the following sub-steps:

[0018] (1) Other traffic data management centers classify local traffic data into K categories based on the model parameters of the shared traffic mode classification model, that is, the processed data is D ij ,i∈[1,N],j∈[1,K]; where N is the number of traffic data management centers;

[0019] (2) Initialize the parameters of K global models;

[0020] (3) Share the parameters of K global models among all traffic data management centers;

[0021] (4) Each traffic data management center uses its own K types of traffic data to train the gated recurrent unit GRU of the corresponding category to obtain updated local model parameters;

[0022] (5) Aggregate the updated local model parameters of all traffic data management centers to obtain updated global model parameters;

[0023] (6) Repeat steps (3) to (5) until the model converges and obtain the model parameters of the gated recurrent unit GRU for each category.

[0024] Furthermore, each traffic data management center uses the classified data sets to train the loss function of the gated recurrent unit GRU as follows:

[0025]

[0026] Among them, L ij represents the loss function of the j-th data training model of the i-th traffic data management center, q ij Indicates data D ij The number of samples you have, x n represents the true value, represents the model prediction value; w ij represents the parameters of the jth local model of the i-th traffic data management center;

[0027] Updated local model parameters w i ′ j The expression is:

[0028]

[0029] Among them, w i ′ jrepresents the model parameters after local training and update of the j-th type of data in the ith traffic data management center, and α represents the learning rate.

[0030] Furthermore, the calculation formula for aggregating the updated local model parameters of all traffic data management centers is as follows:

[0031]

[0032] Among them, w g ′ j Represents the updated global model parameters of the jth class.

[0033] Furthermore, in S1, a hierarchical clustering method is used, each data point is regarded as a separate cluster, and the distance matrix between all clusters is calculated. The two clusters with the closest distance are found in the distance matrix, and the two clusters are merged into a new cluster; then, the distance matrix is ​​updated to reflect the distance between the new cluster and other clusters; and larger clusters are gradually formed through an iterative merging process.

[0034] Furthermore, when the gated recurrent unit GRU is trained separately using the classified data sets according to the federated learning framework, the loss function is minimized by the Adam algorithm.

[0035] The beneficial effects of the present invention are as follows:

[0036] (1) In view of the distribution differences of data from different clients, the traffic prediction method of the present invention uses cluster analysis to identify and respond to different traffic modes, thereby reducing the inaccurate prediction caused by model aggregation due to data distribution when directly using federated learning;

[0037] (2) The present invention combines federated learning with cluster analysis. Through the distributed data training mechanism of federated learning and the pattern recognition ability of cluster analysis, data from different regions can be integrated while ensuring privacy. The model can not only perform deep mining under different modes, but also improve the accuracy and adaptability of traffic prediction, and can better cope with pattern changes in traffic time series data, thereby improving the accuracy and reliability of prediction. BRIEF DESCRIPTION OF THE DRAWINGS

[0038] Figure 1 It is a schematic diagram of the classification model based on traffic mode of the present invention.

[0039] Figure 2 It is a schematic diagram of the federated learning traffic prediction method based on traffic mode classification of the present invention. DETAILED DESCRIPTION

[0040] The present invention will be described in detail below based on the accompanying drawings and preferred embodiments, and the purpose and effects of the present invention will become more clear. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not used to limit the present invention.

[0041] The traffic prediction method based on traffic mode classification of the present invention adopts the method of federated learning and comprehensively utilizes traffic data from different regions. In addition, considering the pattern changes of traffic time series data, the federated learning is combined with cluster analysis to effectively overcome the influence of data distribution differences.

[0042] like Figure 1 As shown, the traffic prediction method based on federated learning of traffic mode classification of the present invention comprises the following steps:

[0043] Step 1: Cluster the traffic data of the traffic data management center to be predicted using a clustering algorithm to identify different traffic modes.

[0044] In this embodiment, the clustering method used is hierarchical clustering. Hierarchical clustering does not require the number of clusters to be specified in advance, but organizes data by building a cluster hierarchy. Initially, each data point is regarded as a separate cluster, and the distance matrix between all clusters is calculated. The two clusters with the closest distance are found in the distance matrix, and the two clusters are merged into a new cluster. Then, the distance matrix is ​​updated to reflect the distance between the new cluster and other clusters. Larger clusters are gradually formed through an iterative merging process.

[0045] Of course, the clustering in step 1 may also adopt other clustering methods, such as K-means clustering.

[0046] Step 2: Based on the clustering results, construct labels and build a traffic mode classification model based on a multi-layer perceptron

[0047] r = f c (x; D A1 ,D A2 ,…,D Ai ,…,D AK )

[0048] Among them, x represents the input traffic time series data, r represents the corresponding output category, and D Ai Represents the traffic data of the i-th category.

[0049] Step 3: Share the model parameters of the traffic mode classification model of the traffic data management center to be predicted with other traffic data management centers, and other traffic data management centers classify local traffic data according to the model parameters; use the classified data sets of each category to train the gated recurrent unit GRU separately according to the federated learning framework to obtain the model parameters of the gated recurrent unit GRU of each category.

[0050] The sharing here can be uploading the model parameters to the cloud, and other traffic data management centers (such as B) download the model parameters from the cloud to establish a local classification model B. According to the classification model B and its local data B, the local data B can be classified, and the gated recurrent unit GRU can be trained separately using the classified data sets according to the federated learning framework, and the trained model parameters are then uploaded to the corresponding server. Figure 2 shown.

[0051] Among them, the gated recurrent unit GRU is trained separately according to the federated learning framework using the classified data sets of each category, which specifically includes the following sub-steps:

[0052] (1) Other traffic data management centers classify local traffic data into K categories based on the model parameters of the shared traffic mode classification model, that is, the processed data is D ij ,i∈[1,N],j∈[1,K]; where N is the number of traffic data management centers;

[0053] (2) Initialize the parameters of K global models;

[0054] (3) Sharing the parameters of the K global models among all traffic data management centers; for example, each traffic data management center downloads the parameters of the K global models from the corresponding server, and these parameters will be used for the initial setting of the local model to ensure that all traffic data management centers start from the same baseline for prediction tasks:

[0055] w ij =w gj ,i∈[1,N],j∈[1,K]

[0056] Among them, w ij represents the j-th local model parameter downloaded by the i-th traffic data management center, w gj Represents the j-th global model parameter on the server side.

[0057] (4) Each traffic data management center uses its own K types of traffic data to train the corresponding category of gated recurrent unit GRU to obtain updated local model parameters so that the model can more accurately reflect the local traffic conditions. During training, the Adam algorithm is used to minimize the loss function. The loss function is calculated as:

[0058]

[0059] Among them, L ij represents the loss function of the j-th data training model of the i-th traffic data management center, q ij Indicates data D ij The number of samples you have, x n represents the true value, represents the model prediction value; w ij represents the parameters of the jth local model of the i-th traffic data management center;

[0060] Updated local model parameters w i ′ j The expression is:

[0061]

[0062] Among them, w i ′ j represents the model parameters after local training and update of the j-th type of data in the ith traffic data management center, and α represents the learning rate.

[0063] (5) Aggregate the updated local model parameters of all traffic data management centers to obtain the updated global model parameters of the corresponding category. For example, all traffic data management centers upload the locally updated model parameters to the corresponding server. Each category server can obtain the latest model parameters w of the corresponding category of each traffic data management center. i ′ j , for further processing; after receiving the updated parameters uploaded by all traffic data management centers, the server will aggregate these parameters:

[0064]

[0065] Among them, w g ′ j Represents the updated global model parameters of the jth class.

[0066] By aggregating the model parameters of all traffic data management centers, new global model parameters can be generated, thereby improving the accuracy and reliability of the entire traffic prediction system. The updated global model parameters will be distributed to each organization again and enter the next iteration cycle.

[0067] (6) Repeat steps (3) to (5) until the model converges and obtain the model parameters of the gated recurrent unit GRU for each category.

[0068] In addition, in order to screen samples of each category, other traffic data management centers classify local traffic data according to model parameters, and then calculate the uncertainty of sample classification results for each category of samples, extract valid samples with uncertainty below the threshold, and update each category data set.

[0069] The uncertainty is calculated as follows:

[0070]

[0071] Among them, p i represents the predicted probability of the model for category i; H is the entropy of quantifying uncertainty, and ∈ is a constant.

[0072] Step 4: Classify the future traffic flow of the traffic data management center to be predicted, and use the model parameters of the gated recurrent unit GRU of the corresponding category to predict the future traffic flow of the traffic data management center to be predicted.

[0073] The following is an experiment combining traffic data to illustrate the superiority of the method of the present invention. The experiment used the METR-LA dataset. The METR-LA dataset records the traffic speed information of 207 loop detectors on Los Angeles County highways. The recording time is from March 1, 2012 to June 30, 2012, and the data points are sampled every 5 minutes. In order to ensure the consistency and comparability of the data, we use the Z-score method to process the data. In the experiment of traffic speed prediction, we use the data of the past 12 time steps (i.e. 60 minutes) to predict the speed of the next 3 time steps (i.e. 15 minutes). This setting can capture short-term traffic trends and changes, thereby improving the accuracy of the prediction.

[0074] For comparison, the local model (Local) and the federated average model (Fedavg) are also used to predict traffic flow, and the results are shown in Table 1.

[0075] Table 1 Experimental results of the federated learning traffic prediction method based on traffic mode classification

[0076] method Local Fedavg Ours RMSE 6.9916 7.0317 6.8932 R2 0.9014 0.9002 0.9041

[0077] From the results shown in Table 1, it can be seen that the traffic prediction method based on traffic mode classification of the present invention can effectively utilize the information of each data source while protecting data privacy, thereby improving the overall performance of the model. By comparing the results with the Fedavg method, we can see that the traffic prediction method based on traffic mode classification of the federated learning can effectively handle the complexity of traffic data, give full play to the advantages of model aggregation, and improve the accuracy and reliability of prediction.

[0078] Those skilled in the art can understand that the above are only preferred examples of the invention and are not intended to limit the invention. Although the invention is described in detail with reference to the above examples, those skilled in the art can still modify the technical solutions recorded in the above examples or replace some of the technical features therein with equivalents. Any modification, equivalent replacement, etc. made within the spirit and principle of the invention shall be included in the protection scope of the invention.

Claims

1. A federated learning traffic prediction method based on traffic mode classification, characterized in that: The Method The following steps are involved: S1: Clustering the traffic data of the traffic data management center to be predicted using a clustering algorithm to identify different traffic modes; S2: Based on the clustering results, construct labels and build a traffic mode classification model based on a multi-layer perceptron r=f c (x;D A1 ,D A2 ,…,D Ai ,…,D AK ) Among them, x represents the input traffic time series data, r represents the corresponding output category, and D Ai represents the traffic data of the i-th category; S3: sharing the model parameters of the traffic mode classification model of the traffic data management center to be predicted with other traffic data management centers, and the other traffic data management centers classify local traffic data according to the model parameters; using the classified data sets of each category to train the gated recurrent unit GRU respectively according to the federated learning framework to obtain the model parameters of the gated recurrent unit GRU of each category; S4: classify the future traffic flow of the traffic data management center to be predicted, and use the model parameters of the gated recurrent unit GRU of the corresponding category to predict the future traffic flow of the traffic data management center to be predicted.

2. The method for traffic prediction based on federated learning of traffic mode classification according to claim 1 is characterized in that: In S3, after the other traffic data management center classifies the local traffic data according to the model parameters, the uncertainty of the sample classification result is calculated for each category of samples, and valid samples with uncertainty below a threshold are extracted; The calculation formula of uncertainty is as follows: Among them, p i represents the predicted probability of the model for category i; H is the entropy of quantifying uncertainty, and ∈ is a constant.

3. The method for traffic prediction based on federated learning of traffic mode classification according to claim 2 is characterized in that: The classified data sets of each category are used to train the gated recurrent unit GRU according to the federated learning framework, which specifically includes the following sub-steps: (1) Other traffic data management centers classify local traffic data into K categories based on the model parameters of the shared traffic mode classification model, that is, the processed data is D ij ,i∈[1,N],j∈[1,K]; where N is the number of traffic data management centers; (2) Initialize the parameters of K global models; (3) Share the parameters of K global models among all traffic data management centers; (4) Each traffic data management center uses its own K types of traffic data to train the gated recurrent unit GRU of the corresponding category to obtain updated local model parameters; (5) Aggregate the updated local model parameters of all traffic data management centers to obtain updated global model parameters; (6) Repeat steps (3) to (5) until the model converges and obtain the model parameters of the gated recurrent unit GRU for each category.

4. The method for traffic prediction based on federated learning of traffic mode classification according to claim 3 is characterized in that: Each traffic data management center uses the classified data sets to train the gated recurrent unit GRU with a loss function of: Among them, L ij represents the loss function of the j-th data training model of the i-th traffic data management center, q ij Indicates data D ij The number of samples you have, x n represents the true value, represents the model prediction value; w ij represents the parameters of the jth local model of the i-th traffic data management center; Updated local model parameters w i ' j The expression is: Among them, w i ' j represents the model parameters after local training and update of the j-th type of data in the ith traffic data management center, and α represents the learning rate.

5. The method for traffic prediction based on federated learning of traffic mode classification according to claim 1 is characterized in that: The calculation formula for aggregating the updated local model parameters of all traffic data management centers is as follows: Among them, w g ' j Represents the updated global model parameters of the jth class.

6. The method for traffic prediction based on federated learning of traffic mode classification according to claim 1, characterized in that: In S1, a hierarchical clustering method is used, each data point is regarded as a separate cluster, and the distance matrix between all clusters is calculated. The two clusters with the closest distance are found in the distance matrix, and the two clusters are merged into a new cluster; then, the distance matrix is ​​updated to reflect the distance between the new cluster and other clusters; and larger clusters are gradually formed through an iterative merging process.

7. The method for traffic prediction based on federated learning of traffic mode classification according to claim 1, characterized in that: When using the classified data sets of each category to train the gated recurrent unit GRU separately according to the federated learning framework, the loss function is minimized by the Adam algorithm.

Citation Information

Patent Citations

  • A traffic flow pattern recognition method based on density peak clustering algorithm

    CN109255384A

  • Urban traffic flow space-time prediction method based on federated learning

    CN114757389A

  • Federal learning method and system for classification prediction of connection data of Internet of Vehicles terminal

    CN116227631A

  • Intelligent traffic management method for adjustment based on traffic flow

    CN117351702A

  • Method and device for identifying unknown traffic data based dynamic network environment

    US11658989B1