A traffic prediction method and device under source data privacy protection and a storage medium

By combining federated learning and spatiotemporal graph neural networks with GraphSAGE and GRU units, we have achieved traffic prediction model transfer under the protection of source data privacy, which solves the prediction problem in areas with scarce traffic data and improves prediction accuracy and generalization ability.

CN115392552BActive Publication Date: 2026-04-24SHANGHAI JIAOTONG UNIV +2
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
SHANGHAI JIAOTONG UNIV
Filing Date
2022-08-11
Publication Date
2026-04-24

AI Technical Summary

Technical Problem

In intelligent transportation systems, the imbalance and insufficiency of traffic data lead to overfitting of deep learning models. Existing transfer learning methods have poor generalization and privacy leakage issues, making it difficult to achieve effective transfer of traffic prediction models across multiple regions.

Method used

A spatiotemporal graph neural network model is constructed using a federated learning approach. By combining a spatial correlation capture module, a temporal correlation capture module, and a prediction output module with GraphSAGE and GRU units, the traffic prediction model is transferred. The feature extractor for the target region is trained using the maximum mean difference to complete the privacy-preserving transfer of the model.

Benefits of technology

It enables the aggregation of traffic prediction models from multiple regions while protecting the privacy of source data, improves the prediction accuracy in regions with scarce traffic data, solves the problem of insufficient knowledge in a single source region, adapts to the flexible association relationship of neighboring nodes, realizes implicit feature alignment, and improves the accuracy of prediction results.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115392552B_ABST
    Figure CN115392552B_ABST
Patent Text Reader

Abstract

The application relates to a traffic prediction method and device under source data privacy protection and a storage medium, wherein the method comprises the following steps: acquiring traffic data of a source area and a target area; constructing a traffic prediction model based on a space-time graph neural network; initializing the traffic prediction model of the source area based on the traffic data of the target area; aggregating the traffic prediction model of the source area based on federated learning and the traffic data of the source area to obtain an aggregated prediction model; dividing the aggregated prediction model into a feature extractor and a predictor, fixing the predictor, initializing the feature extractor of the traffic prediction model of the target area; training the feature extractor of the traffic prediction model of the target area based on the maximum mean difference, completing model migration, and obtaining the traffic prediction model of the target area; and completing traffic prediction of the target area based on the traffic prediction model of the target area. Compared with the prior art, the application has the advantages of being capable of realizing cross-domain traffic knowledge migration under the condition of source data privacy protection.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of traffic forecasting, and in particular to a traffic forecasting method, apparatus, and storage medium with source data privacy protection. Background Technology

[0002] With the rapid development of IoT technology, diverse road network data can be collected by sensors, providing a foundation for the development of intelligent transportation systems in areas such as traffic condition prediction, accident detection, and demand analysis. Data-driven traffic flow prediction models can effectively estimate future road conditions, supporting traffic accident early warning, traffic demand forecasting, and improved traffic management.

[0003] Graph Neural Networks (GNNs) have made significant strides in learning spatial correlations in graphs. As a deep learning method, GNNs can handle data in non-Euclidean space, making them suitable for analyzing road traffic networks. Furthermore, deep learning has demonstrated excellent performance in capturing the temporal correlations of traffic flow. Compared to traditional statistical analysis methods like ARIMA, deep learning models (such as LSTM and CNN) can abstractly model traffic flow characteristics and establish complex nonlinear relationships between traffic data. However, deep learning methods require large-scale traffic data for training. In real-world intelligent transportation systems, the distribution and collection of traffic data are uneven. Insufficient traffic flow data can lead to overfitting in deep learning models. Therefore, short-term traffic flow prediction is a more challenging task when traffic data is limited.

[0004] The emergence of transfer learning technology offers a new approach to solving the aforementioned problems. Recognizing the imbalance and insufficiency of traffic data, some researchers have proposed methods for missing data completion. These studies first fill in missing traffic data based on the similarity between data points, and then perform traffic flow prediction on the completed road network. However, existing research suffers from poor generalization and relies on a single source of knowledge. In transfer learning, models obtained from source tasks can be used in related target tasks. In intelligent transportation systems, transfer learning enables the sharing and transfer of traffic data between road regions. Models can be trained from multiple data-rich related regions and then adapted to target regions with less data. Furthermore, among multiple cooperating source regions, traffic data may come from multiple different organizations, including governments and companies. The sharing and exchange of knowledge among these source data providers raises privacy concerns. Therefore, different data providers in different regions need to store data and train models locally while ensuring data privacy, ultimately exchanging privacy-protected, shareable models. This makes the transfer of GNN-based prediction models between cooperating regions quite challenging.

[0005] Federated learning can address the privacy protection issues among collaborating regions mentioned earlier. It serves as a framework that enables multiple participants to collaboratively train a model while protecting their local data. In ITS, federated learning allows each collaborating region to store its local privacy data and train its local model, while simultaneously fusing the overall model across the regions. However, transferring GNN models within a federated learning framework between regions presents several challenges: First, compared to the gridded Euclidean space of images, the non-Euclidean space processed by GNNs exhibits stronger local correlations and diversity, and the flexible relationships between neighboring nodes increase the difficulty of transfer. Second, a single source region may not provide sufficient effective knowledge, and the aggregation algorithms in the federated learning framework cannot handle topological information within the network. Third, when transferring knowledge from a source region to a target region, the source data cannot be accessed; only the source model is obtained, rendering traditional data alignment transfer methods inapplicable. Summary of the Invention

[0006] The purpose of this invention is to provide a traffic prediction method, device, and storage medium under the protection of source data privacy, which can complete the migration of traffic prediction models without directly obtaining source data, and realize traffic prediction in target areas with scarce traffic data.

[0007] The objective of this invention can be achieved through the following technical solutions:

[0008] A traffic prediction method with source data privacy protection includes the following steps:

[0009] Step 1) Obtain traffic data for the source and target regions. The traffic data includes topology data and status data. The topology data is based on a traffic graph network, which includes nodes and edges. Nodes represent road segments, and edges represent connections between road segments.

[0010] Step 2) Construct a traffic prediction model based on a spatiotemporal graph neural network. The traffic prediction model includes a spatial correlation capture module, a temporal correlation capture module, and a prediction output module.

[0011] Step 3) Initialize the traffic prediction model for the source region based on the traffic data of the target region;

[0012] Step 4) Based on federated learning and the traffic data of the source regions, aggregate the traffic prediction models of the source regions to obtain the aggregated prediction model;

[0013] Step 5) Divide the aggregated prediction model into a feature extractor and a predictor. Fix the predictor and initialize the feature extractor of the traffic prediction model for the target area based on the feature extractor in the aggregated prediction model to complete the initialization migration.

[0014] Step 6) Train the feature extractor of the traffic prediction model for the target area based on the maximum mean difference, complete the model transfer, and obtain the traffic prediction model for the target area;

[0015] Step 7) Complete the traffic forecast for the target area based on the traffic forecast model for the target area.

[0016] The spatial correlation capture module employs a two-layer GraphSAGE approach, and its message processing includes the following steps:

[0017] Step 2-1-1) Messages are passed between nodes, and the information contained in neighboring nodes is aggregated according to the aggregation function;

[0018] For all neighboring nodes N(v) of node v, v receives the embedding vectors generated in the previous layer from all nodes in N(v). k represents the current layer:

[0019]

[0020] Where AGGREGATE(·) is an aggregate function, This represents the information received by the current layer node v from its neighboring nodes. For any v belonging to V, the initial time of the node is represented as... X v This represents the actual state data of node v, where V is the set of all nodes.

[0021] Embedding vector of node v at the previous level and information from neighboring nodes received by the current layer The vectors are concatenated, and the embedding vector of node v in the current layer is obtained through a nonlinear transformation σ.

[0022]

[0023] Where CONCAT(·) is the concatenation function, W k This is the weight matrix;

[0024] Step 2-1-2) Obtain the output feature vector of each node in the traffic graph network based on the embedding vectors of each layer: Where K is the total number of layers.

[0025] The time correlation capture module uses GRU units to perform temporal correlation analysis of historical traffic data. The GRU units combine historical traffic data with the current input through a gating mechanism to predict the memory of the current time step.

[0026] The GRU unit includes two types of gate control units: update gate and reset gate. The calculation method of the GRU unit is as follows:

[0027] rg k =σ(W rg e v +U rg h k-1 ),

[0028] zg k =σ(W zg e v +U zg h k-1 ),

[0029] s k =tanh(W s e v +rg k ⊙U s h k-1 ),

[0030] h k =zg k ⊙h k-1 +(1-zg k )⊙s k ,

[0031] Where k is the current layer, rg k To update the gate, zg k To reset the door, W zg U zg W rg U rg W s U s The weight matrix is ​​obtained through backpropagation, where ⊙ is the Hamming product, σ is the activation function, and h... k For the final memory of the current layer, s k e represents the state of the current layer's memory. v Let v be the output feature vector of node v. The reset gate is a vector whose elements take values ​​in the range of (0,1), and is used to control the retention and forgetting of historical traffic data.

[0032] The prediction output module uses a two-layer fully connected network to map the outputs of the spatial correlation capture module and the temporal correlation capture module to different domains, thereby achieving multi-step prediction. Specifically, the mapping is as follows:

[0033]

[0034] Where W1 and W2 are the weight matrices of the first and second layers, respectively; b1 and b2 are the biases of the first and second layers, respectively; and P is the prediction window. The predicted traffic state sequence is given by k, where k is the current layer and h is the current layer. k This is the final memory of the current layer.

[0035] Step 3) specifically involves: training a traffic prediction model locally based on the traffic data of the target region to obtain an initialized traffic prediction model, and then uploading the initialized traffic prediction model to the server.

[0036] Step 4) includes the following steps:

[0037] Step 4-1) The server determines multiple source regions to participate in the training according to the pre-configured selection rules, and uses the initial traffic prediction model uploaded by the target region as the initial model of the aggregate prediction model.

[0038] Step 4-2) The source regions participating in the training download the current aggregated prediction model from the server as their local model, train it based on their local traffic data, update the local model, and upload the updated local model parameters to the server.

[0039] Step 4-3) The server will average and aggregate the received updated local model parameters to update the aggregated prediction model;

[0040] Step 4-4) Repeat steps 4-2)-4-3) until the server-side aggregated prediction model converges, and the aggregated prediction model is obtained.

[0041] The objective function of the feature extractor for the traffic prediction model based on the maximum mean difference training target region is:

[0042]

[0043] Where β is a hyperparameter, f t h is the predictor for the traffic prediction model of the target area. t X is the feature extractor for the traffic prediction model of the target area. t h represents the actual state data of the target region. s For feature extractors in aggregated prediction models;

[0044] L cla (·,·) measures the difference between the final prediction of the traffic forecasting model and the actual value in the target area, specifically:

[0045]

[0046] Among them, Y t The value range for the target region's status data;

[0047] L GS-MMD (·,·,·) The effect of distribution alignment is measured based on GS-MMD, specifically as follows:

[0048]

[0049] Where, x t ,∈X t T μ The number of values ​​for μ is given by μ, where μ is the Gaussian kernel parameter in GS-MMD. for h s (x t ) dimensions for h t (x t The dimension of μ t Let t be the parameter of the Gaussian kernel. GS-MMD is a method for constructing a regenerated kernel Hilbert space based on the Gaussian kernel and calculating the distance between two data with different distributions through the maximum mean difference MMD.

[0050] A traffic prediction device with source data privacy protection includes a memory, a processor, and a program stored in the memory, wherein the processor executes the program to implement the method described above.

[0051] A storage medium having a program stored thereon, which, when executed, implements the method described above.

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

[0053] (1) Based on federated learning, this invention aggregates traffic prediction models from multiple source regions. Under the premise of protecting the privacy of source data, it can transfer the traffic prediction model of the target region through the interaction of the locally trained model and model parameters, complete the traffic prediction of the target region with scarce traffic data, solve the problem that a single source region cannot provide enough effective knowledge, and make the prediction results have high accuracy.

[0054] (2) The spatial correlation capture module in the traffic prediction module of this invention adopts a two-layer GraphSAGE, which enables the model to learn a general model from a given task and apply it to new data and tasks. Compared with spectrum-based GCN, spatial GraphSAGE has a small computational cost. When a new road node appears, only the nodes connected to it need to be recalculated, which can well cope with the increased migration difficulty caused by the flexible association between neighboring nodes.

[0055] (3) The present invention uses a feature extractor for training the traffic prediction model of the target area based on the maximum mean difference, minimizes the feature distribution of the aggregated prediction model and the traffic prediction model of the target area, realizes implicit feature alignment, and solves the problem that the traditional data alignment migration method is no longer applicable under source data protection. Attached Figure Description

[0056] Figure 1 This is a flowchart of the method of the present invention;

[0057] Figure 2 This is a schematic diagram of the system framework and migration process of the present invention;

[0058] Figure 3 This is a performance comparison chart of the method of the present invention in different prediction intervals of a public dataset. Detailed Implementation

[0059] The present invention will now be described in detail with reference to the accompanying drawings and specific embodiments. These embodiments are based on the technical solution of the present invention and provide detailed implementation methods and specific operating procedures. However, the scope of protection of the present invention is not limited to the following embodiments.

[0060] A traffic prediction method with source data privacy protection, such as Figure 1 As shown in the diagram, the system framework and migration process based on the method are illustrated below. Figure 2 As shown, the framework consists of three layers: a road information perception layer, a traffic prediction layer based on federated learning and transfer learning, and a server layer.

[0061] The traffic prediction method under source data privacy protection includes the following steps:

[0062] Step 1) Obtain traffic data for the source and target regions;

[0063] In the road information perception layer, internal data of the source and target areas are acquired based on intelligent sensing devices. These intelligent sensing devices include roadside units, sensors, GPS devices, etc. The traffic data for the source and target areas includes topology data and status data. The topology data is built based on a traffic map network, which includes nodes and edges; nodes represent road segments, and edges represent connections between road segments. The status data includes vehicle speed, traffic flow, and occupancy status, etc.

[0064] Step 2) Construct a traffic prediction model based on a spatiotemporal graph neural network. The traffic prediction model includes a spatial correlation capture module, a temporal correlation capture module, and a prediction output module.

[0065] The spatial correlation capture module employs a two-layer GraphSAGE, enabling the model to learn a general model from a given task and apply it to new data and tasks. Compared to spectrum-based GCN, spatial GraphSAGE has lower computational cost, and when a new road node appears, only the nodes connected to it need to be recalculated.

[0066] The spatial correlation capture module processes messages by including the following steps:

[0067] Step 2-1-1) Messages are passed between nodes, and the information contained in neighboring nodes is aggregated according to the aggregation function;

[0068] For all neighboring nodes N(v) of node v, v receives the embedding vectors generated in the previous layer from all nodes in N(v). k represents the current layer:

[0069]

[0070] Where AGGREGATE(·) is an aggregate function, This represents the information received by the current layer node v from its neighboring nodes. For any v belonging to V, the initial time of the node is represented as... X v This represents the actual state data of node v, where V is the set of all nodes.

[0071] Embedding vector of node v at the previous level and information from neighboring nodes received by the current layer The vectors are concatenated, and the embedding vector of node v in the current layer is obtained through a nonlinear transformation σ.

[0072]

[0073] Where CONCAT(·) is the concatenation function, W k This is the weight matrix;

[0074] Step 2-1-2) Obtain the output feature vector of each node in the traffic graph network based on the embedding vectors of each layer: Where K is the total number of layers.

[0075] The time correlation capture module uses GRU units to perform temporal correlation analysis of historical traffic data. The GRU units combine historical traffic data with the current input through a gating mechanism to predict the memory of the current time step.

[0076] The GRU unit includes two types of gating units: an update gate and a reset gate. These are used to store information in the historical traffic data sequence and ensure that it will not be cleared over time or removed due to irrelevance.

[0077] The GRU cell is calculated as follows:

[0078] rg k =σ(W rg e v +U rg h k-1 ),

[0079] zg k =σ(Wzg e v +U zg h k-1 ),

[0080] s k =tanh(W s e v +rg k ⊙U s h k-1 ),

[0081] h k =zg k ⊙h k-1 +(1-zg k )⊙s k ,

[0082] Where k is the current layer, rg k To update the gate, zg k To reset the door, W zg U zg W rg U rg W s U s The weight matrix is ​​obtained through backpropagation, where ⊙ is the Hamming product, σ is the activation function, and h... k For the final memory of the current layer, s k e represents the state of the current layer's memory. v Let v be the output feature vector of node v. The reset gate is a vector whose elements take values ​​in the range of (0, 1), and is used to control the retention and forgetting of historical traffic data.

[0083] The prediction output module uses a two-layer fully connected network to map the outputs of the spatial correlation capture module and the temporal correlation capture module to different domains, thereby achieving multi-step prediction. Specifically, the mapping is as follows:

[0084]

[0085] Where W1 and W2 are the weight matrices of the first and second layers, respectively; b1 and b2 are the biases of the first and second layers, respectively; and P is the prediction window. The predicted traffic state sequence is given by k, where k is the current layer and h is the current layer. k This is the final memory of the current layer.

[0086] Step 3) Initialize the traffic prediction model for the source region based on the traffic data of the target region;

[0087] During the information aggregation phase across multiple regions, traffic status data from each region is sensitive to privacy concerns. Traditional centralized computing solutions require each region to upload its source data to the cloud for data storage and model computation, which raises privacy concerns. Therefore, a method is needed to obtain traffic prediction models without accessing source region data. In this embodiment, a federated learning-based approach is used to aggregate multi-source models. First, the traffic prediction models for the source regions are initialized: the target region trains its own traffic prediction model based on its traffic data, obtaining an initialized model, which is then uploaded to the server.

[0088] Step 4) Based on federated learning and the traffic data of the source regions, aggregate the traffic prediction models of the source regions to obtain the aggregated prediction model;

[0089] Step 4-1) The server determines multiple source regions to participate in the training according to the pre-configured selection rules, and uses the initial traffic prediction model uploaded by the target region as the initial model of the aggregate prediction model.

[0090] Step 4-2) The source regions participating in the training download the current aggregated prediction model from the server as their local model, train it based on their local traffic data, update the local model, and upload the updated local model parameters to the server.

[0091] Step 4-3) The server will average and aggregate the received updated local model parameters to update the aggregated prediction model;

[0092] Step 4-4) Repeat steps 4-2)-4-3) until the server-side aggregated prediction model converges, and the aggregated prediction model is obtained.

[0093] Steps 1)-4) provide an aggregation scheme for the traffic prediction model of the source region under the condition of data isolation in the source region, which serves as the source model for transfer learning. Steps 5)-6) complete the transfer of the traffic prediction model based on transfer learning to obtain the traffic prediction model of the target region, thereby realizing traffic prediction in the target region through step 7).

[0094] Step 5) Initialize migration

[0095] The aggregated prediction model is divided into a feature extractor and a predictor. In this embodiment, the two-layer GraphSAGE results in the spatial correlation capture module are divided into a feature extractor, and the feature extractor of the traffic prediction model for the target region is denoted as h. t The feature extractor of the aggregate prediction model is denoted as h. sThe GRU component enables gradient-preserving time-series prediction tasks. In this embodiment, the GRU component and two fully connected layers are grouped into a predictor, and the traffic prediction model for the target region is denoted as f. t The predictor of the aggregate prediction model is denoted as f. s .

[0096] The initial migration mainly involves two steps:

[0097] Step 5-1) Fix the predictor in the aggregate prediction model, i.e., f t =f s ;

[0098] Step 5-2) Use h in the aggregate prediction model s h in the initialization of the traffic prediction model for the target area t .

[0099] Step 6) Train the feature extractor of the traffic prediction model for the target area based on the maximum mean difference, complete the model transfer, and obtain the traffic prediction model for the target area;

[0100] The goal of transfer learning is to learn h from the traffic prediction model of the target region. t , such that the characteristic distribution p(h) s (X s )) and p(h t (X t ))similar.

[0101] In this embodiment, L is used cla (·,·) and l GS-MMD (·,·,·) together construct the loss function. cla (·,·) measures the difference between the final prediction of the target model and the actual value, specifically calculated using the mean squared error (MSE). Let X be the dataset for the target task. t X t After passing through h respectively s With h t The resulting feature distribution is p s and p t The maximum mean difference (MMD) can calculate the distance between two data points with different distributions.

[0102] This scheme is based on GS-MMD, which uses a Gaussian kernel to construct a regenerating kernel Hilbert space (PKHS), and then uses MMD to measure the effect of distribution alignment. The Gaussian kernel is infinite-dimensional, which matches the infinite-dimensional PKHS space. How to construct the PKHS using the Gaussian kernel is a conventional setup in this field, and will not be elaborated here to avoid obscuring the purpose of this application.

[0103] Feature distribution ps and p t After mapping in PKHS, they are respectively point P. ps and P pt Therefore, p s and p t The interval between them is transformed into the midpoint P in the PKHS space. ps With P pt The distance. Using the kernel function kf, the feature distribution p can be calculated without explicitly computing the mapping function. s and p t Calculation of the distance to the mapped point in PKHS.

[0104] The objective function of the feature extractor for the traffic prediction model based on the maximum mean difference training target region is:

[0105]

[0106] Where β is a hyperparameter, f t h is the predictor for the traffic prediction model of the target area. t X is the feature extractor for the traffic prediction model of the target area. t h represents the actual state data of the target region. s For feature extractors in aggregated prediction models;

[0107] L cla (·,·) measures the difference between the final prediction of the traffic forecasting model and the actual value in the target area, specifically:

[0108]

[0109] Among them, Y t The value range for the target region's status data;

[0110] L GS-MMD (·,·,·Based on GS-MMD, the effect of distribution alignment is measured, specifically:)

[0111]

[0112] Where, x t ,∈X t T μ The number of values ​​for μ is given by μ, where μ is the Gaussian kernel parameter in GS-MMD. for h s (x t ) dimensions for h t (x t The dimension of μ t Let t be the parameter of the t-th Gaussian kernel.

[0113] Step 7) Complete the traffic forecast for the target area based on the traffic forecast model for the target area.

[0114] Based on the methods described above, the performance of the proposed method is verified using real-world spatiotemporal correlation datasets of roads: PeMSD4, PeMSD7(M), and PeMSD8. The three datasets come from different cities, representing regions with different spatiotemporal characteristics. PeMSD4 contains data collected from 307 sensors on 29 roads in the San Francisco Bay Area. The traffic data spans from January to February 2018, containing a total of 16,992 time steps. The first 45 days of the data are training data, and the remainder are test and validation data. PeMSD7(M) contains data collected from 883 sensors in the Los Angeles Area. The traffic data spans from May 2012 to June 2018, containing a total of 12,672 time steps. The first 30 days of the data are training data. PeMSD8 contains data collected from 170 sensors on 8 roads in the San Bernardino Area. The traffic data spans from July to August 2016. It contains a total of 17,856 time steps. The first 48 days of the data are training data.

[0115] In testing, three common metrics—mean absolute error (MAE), mean absolute percentage error (MAPE), and root mean square error (RMSE)—were used to evaluate model performance. The learning rate for both the source and target tasks was set to 0.003. The optimizer was Adam. The hidden layers of the GRU units in the spatiotemporal graph neural networks for both the source and target tasks were set to 64. The time step for both the PeMSD4 and PeMSD8 datasets was 5 minutes. The history sequence length was 15 minutes, or 75 minutes. The assumption of multiple participants in the source region was simulated by partitioning the datasets. PeMSD4, PeMSD7(M), and PeMSD8 were divided into five sub-regions based on the number of nodes, in a connected graph manner, to preserve the connectivity of road regions. The number of nodes in each sub-region of the three datasets was 75, 57, and 42, respectively. During training, four sub-regions were used as the source region within each dataset, and one region was used as the target region. The portions of the target regions that were divided and corresponded to the original dataset were numbered D-4, D-7, and D-8, respectively.

[0116] This embodiment mainly analyzes the performance of the traffic prediction model proposed in this invention under three scenarios: no ISTGNN migration, intra-city migration T-ISTGNN (ic), and inter-city migration T-ISTGNN (cc), as a function of prediction step size, and compares it with the performance of the GraghSAGE model. The performance comparison chart is shown below. Figure 3 As shown, the prediction difficulty increases with the increase in the prediction interval, and the performance of the models shows a downward trend. Among them, in different prediction intervals, the transfer learning method is generally better than the non-transfer learning method. That is, for target areas with scarce traffic data, the prediction accuracy of traffic prediction using only local data is lower than the prediction accuracy of the method proposed in this invention, which verifies the superiority of the traffic prediction method based on federated learning and transfer learning proposed in this invention.

[0117] If the aforementioned functions are implemented as software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this invention, or the part that contributes to the prior art, or a part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0118] The preferred embodiments of the present invention have been described in detail above. It should be understood that those skilled in the art can make numerous modifications and variations based on the concept of the present invention without creative effort. Therefore, all technical solutions that can be obtained by those skilled in the art based on the concept of the present invention through logical analysis, reasoning, or limited experimentation on the basis of existing technology should be within the scope of protection defined by the claims.

Claims

1. A traffic prediction method under source data privacy protection, characterized in that, Includes the following steps: Step 1) Obtain traffic data for the source and target regions. The traffic data includes topology data and status data. The topology data is based on a traffic graph network, which includes nodes and edges. Nodes represent road segments, and edges represent connections between road segments. Step 2) Construct a traffic prediction model based on a spatiotemporal graph neural network. The traffic prediction model includes a spatial correlation capture module, a temporal correlation capture module, and a prediction output module. The spatial correlation capture module uses a two-layer GraphSAGE, the temporal correlation capture module uses GRU units to perform temporal correlation analysis of historical traffic data, and the prediction output module uses a two-layer fully connected network to map the outputs of the spatial correlation capture module and the temporal correlation capture module to different domains to achieve multi-step prediction. Step 3) Initialize the traffic prediction model for the source region based on the traffic data of the target region; Step 4) Based on federated learning and the traffic data of the source regions, aggregate the traffic prediction models of the source regions to obtain the aggregated prediction model; Step 5) Divide the aggregated prediction model into a feature extractor and a predictor. Divide the two-layer GraphSAGE results in the spatial correlation capture module into a feature extractor. Divide the GRU unit and the two-layer fully connected network into a predictor. Fix the predictor and initialize the feature extractor of the traffic prediction model for the target area based on the feature extractor in the aggregated prediction model to complete the initialization migration. Step 6) Train the feature extractor of the traffic prediction model for the target area based on the maximum mean difference, complete the model transfer, and obtain the traffic prediction model for the target area; Step 7) Complete the traffic forecast for the target area based on the traffic forecast model for the target area.

2. The traffic prediction method under source data privacy protection according to claim 1, characterized in that, The spatial correlation capture module processes messages by including the following steps: Step 2-1-1) Messages are passed between nodes, and the information contained in neighboring nodes is aggregated according to the aggregation function; For nodes All neighboring nodes , Receive from The embedding vectors generated by all nodes in the previous layer , For the current layer: in, It is an aggregate function. It is the current layer node The information received from neighboring nodes, for any belong The initial time of the node is represented as , For nodes Actual state data, The set of all nodes; node The embedding vector of the previous layer and information from neighboring nodes received by the current layer splicing is performed through nonlinear transformation. Get Node Embedding vector of the current layer : in, For concatenation functions, This is the weight matrix; Step 2-1-2) Obtain the output feature vector of each node in the traffic map network based on the embedding vectors of each layer: ,in, It is the total number of floors.

3. The traffic prediction method under source data privacy protection according to claim 1, characterized in that, The GRU unit uses a gating mechanism to combine historical traffic data with current input to predict the memory of the current time step.

4. The traffic prediction method under source data privacy protection according to claim 3, characterized in that, The GRU unit includes two types of gate control units: update gate and reset gate. The calculation method of the GRU unit is as follows: in, k For the current layer, To update the door, To reset the door, The weight matrix is ​​obtained through backpropagation. For the product of Han and Ming, For activation function, For the final memory of the current layer, The current layer's memory state. For nodes The output feature vector, the reset gate is a vector and the values ​​of the elements in the vector are in the range of (0,1), used to control the retention and forgetting of historical traffic data.

5. The traffic prediction method under source data privacy protection according to claim 1, characterized in that, The mapping is specifically as follows: in, and These are the weight matrices for the first and second layers, respectively. and These are the offsets for the first and second layers, respectively. For the prediction window, For the predicted traffic state sequence, k For the current layer, This is the final memory of the current layer.

6. The traffic prediction method under source data privacy protection according to claim 1, characterized in that, Step 3) specifically involves: training a traffic prediction model locally based on the traffic data of the target region to obtain an initialized traffic prediction model, and then uploading the initialized traffic prediction model to the server.

7. The traffic prediction method under source data privacy protection according to claim 6, characterized in that, Step 4) includes the following steps: Step 4-1) The server determines multiple source regions to participate in the training according to the pre-configured selection rules, and uses the initial traffic prediction model uploaded by the target region as the initial model of the aggregate prediction model. Step 4-2) The source regions participating in the training download the current aggregated prediction model from the server as their local model, train it based on their local traffic data, update the local model, and upload the updated local model parameters to the server. Step 4-3) The server will average and aggregate the received updated local model parameters to update the aggregated prediction model; Step 4-4) Repeat steps 4-2) to 4-3) until the server-side aggregated prediction model converges, and the aggregated prediction model is obtained.

8. The traffic prediction method under source data privacy protection according to claim 1, characterized in that, The objective function of the feature extractor for the traffic prediction model based on the maximum mean difference training target region is: in, For hyperparameters, For traffic prediction models in the target area, For the feature extractor of the traffic prediction model for the target area, This refers to the actual status data of the target area. For feature extractors in aggregated prediction models; The difference between the final predictions of the traffic prediction model for the target area and the actual values ​​is measured as follows: in, The value range for the target region's status data; The effectiveness of distribution alignment is measured using GS-MMD, specifically as follows: in, , for The number of possible values, The Gaussian kernel parameters in GS-MMD for Dimensions for Dimensions For the first t With Gaussian kernel parameters, GS-MMD is a method that constructs a regenerated kernel Hilbert space based on the Gaussian kernel and calculates the distance between two data points with different distributions by using the maximum mean difference.

9. A traffic prediction device with source data privacy protection, comprising a memory, a processor, and a program stored in the memory, characterized in that, When the processor executes the program, it implements the method as described in any one of claims 1-8.

10. A storage medium having a program stored thereon, characterized in that, When the program is executed, it implements the method as described in any one of claims 1-8.

Citation Information

Patent Citations

  • Model training method and system based on domain adaptation and federated learning

    CN111738440A

  • Intelligent traffic path planning method based on federated learning and digital twinning

    CN112700639A