A cross-city federated traffic knowledge transfer method
By aligning data distributions using graph attention networks and generative adversarial networks, and combining secure aggregation protocols and differential privacy techniques, the problems of privacy leakage and data distribution discrepancies in cross-city traffic knowledge transfer are solved, enabling efficient training and accuracy improvement of traffic prediction models.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- ZHEJIANG UNIV
- Filing Date
- 2026-05-06
- Publication Date
- 2026-06-02
AI Technical Summary
Existing methods for cross-city traffic knowledge transfer suffer from privacy risks, large data distribution differences, and low-quality data issues, resulting in poor model training performance.
We employ graph attention networks and dynamic hypergraph models to complete missing data, use generative adversarial networks to align data distribution, protect data privacy through secure aggregation protocols and differential privacy techniques, and improve efficiency through federated parallel training strategies.
It enables efficient and high-quality cross-city traffic knowledge transfer while protecting privacy, improving the accuracy of traffic prediction and model generalization ability, and reducing communication overhead and computational latency.
Smart Images

Figure CN122133761A_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of federated computing technology, specifically relating to a cross-city federated transportation knowledge transfer method. Background Technology
[0002] Traffic forecasting is one of the core tasks in the development of smart cities, requiring a large amount of high-quality traffic data for model training. However, many emerging cities face data scarcity due to inadequate sensor infrastructure, making it difficult to train reliable traffic forecasting models.
[0003] Existing traffic knowledge transfer methods primarily operate within a centralized framework, requiring the exchange of raw traffic data and posing privacy risks. While federated learning enables collaborative training without sharing raw data, existing federated traffic knowledge transfer methods still face the following challenges: 1. Privacy breach; Existing methods require uploading gradients or model parameters, which are vulnerable to inference attacks and the recovery of sensitive information.
[0004] 2. Differences in cross-city data distribution; the distribution of traffic data varies significantly across different cities, reducing the effectiveness of knowledge transfer.
[0005] 3. Low-quality data: Due to sensor failure or communication loss, traffic data may be missing or unreliable, affecting the model training effect.
[0006] For example, Chinese patent application CN118840860A provides a traffic flow prediction method based on federated learning and graph neural networks. However, this method only addresses data privacy issues and does not consider the differences in data distribution across cities, resulting in limited knowledge transfer effectiveness. Chinese patent application CN115409276A provides a traffic prediction transfer learning method based on a spatiotemporal graph self-attention model, but this method requires sharing original data, posing a risk of privacy leakage. Summary of the Invention
[0007] In view of the above, the present invention provides a cross-city federal transportation knowledge transfer method, which aims to solve the three major technical problems existing in cross-city transportation knowledge transfer: privacy leakage, data distribution differences and low-quality data, and to achieve efficient and high-quality cross-city transportation knowledge transfer under the premise of strictly protecting the original data privacy of all participating parties.
[0008] A cross-city federal transportation knowledge transfer method includes the following steps: (1) In each source city client, based on the local road network map structure, graph attention network and dynamic hypergraph model are used to complete the spatiotemporal dependency of the missing local historical traffic data and generate a complete spatiotemporal view of traffic data. (2) Transform the spatiotemporal view of traffic data into a domain aligned with the traffic data distribution of the target city through a domain adapter module based on generative adversarial networks; (3) The target city server aggregates traffic data from each source city client domain after conversion through a secure aggregation protocol. The secure aggregation protocol uses a mask-based lightweight computation, so that the server can only obtain the aggregated data and cannot reverse-engineer the individual data of any client. (4) Use aggregated data to train a global traffic prediction model on the target city server, and then use the model to predict the traffic flow and speed of the target city.
[0009] Furthermore, the specific implementation of step (1) is as follows: S11: Based on the road network graph structure, traffic sensors are used as graph nodes and the connections between sensors are used as edges to construct a sensor topology graph and calculate the shortest path matrix between sensors. S12: Use graph attention network to extract sensor features, calculate spatial dependency weights between sensors, and capture spatial correlations; S13: The DyHSL (Dynamic Hypergraph Learning) model is used to model time series data as a hypergraph structure to capture long-range dependencies in the time series. S14: Based on spatial correlation and temporal dependence, linear interpolation and Gaussian process regression methods are used to complete the missing traffic data and generate a complete spatiotemporal view of traffic data. Noise is introduced during the completion process to enhance data privacy protection, and normalization processing is performed on the completed data to ensure data consistency.
[0010] Furthermore, the graph attention network employs a multi-head attention mechanism with a hidden layer dimension of 128.
[0011] Furthermore, the domain adapter module in step (2) includes a generator and a discriminator. The generator adopts a multilayer perceptron structure to map the input source city traffic data to the target city data distribution domain, output traffic prediction data of the target city domain and align it using the traffic domain data prototype. The discriminator also adopts a multilayer perceptron structure to distinguish between the real traffic data and traffic prediction data of the target city. The generator and discriminator are optimized through adversarial training, and the generator performance is optimized using a cyclic consistency loss function to ensure that the converted data conforms to the distribution of the target city domain and retains the traffic pattern characteristics of the source city. At the same time, a classification loss function is used to optimize the discriminator.
[0012] Furthermore, the specific implementation of step (3) is as follows: the source city client uses a lightweight masking algorithm to mask the converted traffic data and uploads it to the target city server; the target city server obtains new aggregated data by summing the masked data of all clients and sends it to each client.
[0013] Furthermore, the expression for the lightweight masking algorithm is as follows:
[0014] Among them: for any source city client i , This is the mask data for the client. and These are the traffic data from the current round of conversion and the traffic data from the previous round of conversion for this client, respectively. n The number of clients in the source city. This is the aggregated data from the previous round.
[0015] Furthermore, the target city server aggregates the mask data of all clients to obtain new aggregated data using the following formula;
[0016] in: This is for a new round of aggregated data.
[0017] Furthermore, in step (3), the target city server introduces differential privacy noise during the data aggregation process, and dynamically adjusts the noise variance based on the privacy budget to balance privacy protection and data accuracy.
[0018] Furthermore, the global traffic prediction model in step (4) adopts a dynamic hypergraph structure learning model, with historical traffic data as input and future traffic prediction data as output; the model training adopts a federated parallel training strategy, that is, the training process is decomposed into independent execution by the client and server through split learning, and the client and server update the model parameters in parallel.
[0019] A computer device includes a memory and a processor, the memory storing a computer program, and the processor executing the computer program to implement the above-described intercity federal transportation knowledge transfer method.
[0020] A computer-readable storage medium storing a computer program, which, when executed by a processor, implements the aforementioned cross-city federal transportation knowledge transfer method.
[0021] Based on the above technical solution, the present invention has the following beneficial technical effects: 1. Efficiently solves the problem of missing data; This invention introduces a dynamic hypergraph model based on the capture of spatial dependencies by a graph attention network, effectively modeling the complex spatiotemporal long-range dependencies of traffic data, and achieving high-precision completion of missing data, providing a high-quality and complete traffic data view for subsequent knowledge transfer.
[0022] 2. Effective alignment of cross-city data distribution; This invention innovatively designs a domain adapter module based on generative adversarial networks, which transforms source city data to target city domains through adversarial training, significantly reducing data distribution offset caused by differences in road network structure and traffic patterns between cities, and improving the effectiveness of knowledge transfer and model generalization ability.
[0023] 3. Achieve strict privacy protection; This invention constructs a multi-layered privacy protection system. First, the original data is always kept on the local client. Second, the domain adaptation process itself reduces the identifiability of the source city data. Finally, through a mask-based lightweight secure aggregation protocol, combined with differential privacy technology, it is ensured that the target city server can only obtain the aggregated statistical information and cannot retrieve any individual data from the source city, thus fundamentally avoiding the risk of privacy leakage.
[0024] 4. Improve overall system efficiency; This invention rationally splits the computational tasks into parallel execution on the client and server sides through a federated parallel training strategy, and utilizes the lightweight computing in the secure aggregation protocol to significantly reduce communication overhead and computational latency, enabling the framework to be efficiently applied to large-scale, multi-participant cross-city federated learning scenarios.
[0025] 5. End-to-end improvement in prediction performance: Based on privacy protection, distribution alignment, and data completion, this invention ultimately utilizes aggregated high-quality cross-city knowledge to train a global prediction model (such as a dynamic hypergraph learning model) on the target city server side, which can significantly improve the prediction accuracy of key indicators such as traffic flow and speed in the target city under data scarcity conditions. Attached Figure Description
[0026] Figure 1 This is a flowchart illustrating the cross-city federal transportation knowledge transfer method of the present invention. Detailed Implementation
[0027] To describe the present invention in more detail, the technical solution of the present invention will be described in detail below with reference to the accompanying drawings and specific embodiments.
[0028] like Figure 1 As shown, this embodiment provides a cross-city federated transportation knowledge transfer method. This method is executed in a federated learning system consisting of multiple source city clients and a target city server. The specific implementation process includes the following steps: (1) In each source city client, the missing local historical traffic data is completed based on the local road network map structure to generate a complete traffic data view. The specific implementation method of this step includes the following sub-steps: S11: Sensor topology construction; Based on the road network graph structure, traffic sensors are used as graph nodes and the connections between sensors are used as edges to construct a sensor topology graph and calculate the shortest path matrix between sensors.
[0029] S12: Spatial dependency capture; Using a graph attention network (GAT) to extract sensor features, calculate the spatial dependency weights between sensors, and capture spatial correlation; The GAT network adopts a multi-head attention mechanism. In this embodiment, the number of heads K=8 and the hidden layer dimension is 128.
[0030] S13: Time Dependency Capture; Using the DyHSL model, traffic time-series data is modeled as a hypergraph structure to capture long-range dependencies in the time series.
[0031] S14: Missing value completion; Based on spatial and temporal dependencies, linear interpolation and Gaussian process regression methods are used to complete missing traffic data and generate a complete spatiotemporal view of traffic data; noise is introduced during the completion process to enhance data privacy protection; normalization is performed on the completed data to ensure data consistency.
[0032] (2) The complete spatiotemporal view of traffic data is transformed into a domain aligned with the traffic data distribution of the target city through a domain adapter module (including generator and discriminator) based on generative adversarial networks. The specific implementation method of this step includes the following sub-steps: S21: Generator Training; The generator uses a multilayer perceptron (MLP) structure to map the input source city traffic data to the target city data distribution domain, output the predicted traffic data of the target city domain, and align it based on the traffic domain prototype; The generator uses residual connections and batch normalization techniques to improve the stability of model training.
[0033] S22: Discriminator Training; The discriminator adopts an MLP structure, with inputs being real target city data or generated data, used to distinguish between real traffic data and predicted traffic data (generated by the generator) in the target city, and outputs classification probabilities; The discriminator uses the LeakyReLU activation function to improve the model convergence speed.
[0034] S23: Cyclic Consistency Optimization; The generator and discriminator are optimized through adversarial training, and the generator performance is optimized using the cyclic consistency loss function to ensure that the transformed data not only conforms to the distribution of the target city region, but also retains the traffic pattern characteristics of the source city. At the same time, the discriminator is optimized using a classification loss function (such as cross-entropy); The number of training rounds is 100, and the learning rate is 0.001.
[0035] (3) Through a secure aggregation protocol, the target city server securely aggregates the domain-transformed data from clients in each source city. The secure aggregation protocol uses a mask-based lightweight computation, so that the server can only obtain the aggregation result and cannot reverse-engineer the individual data of any client. The specific implementation method of this step includes the following sub-steps: S31: Mask calculation; The client uses a lightweight mask formula to process the transformed data, specifically: Mask data = Previous round aggregated data + (Current round transformed data - Previous round transformed data) / Number of source cities; The mask mechanism ensures privacy protection through lightweight calculation, and the server can only access the global aggregated results.
[0036] S32: Secure transmission; The original data of the source city client is always kept locally, and only the masked data is uploaded to the server. The server obtains the aggregation result through the summation operation, and it is impossible to reverse the individual data.
[0037] S33: Privacy Enhancement; Introduces differential privacy noise, dynamically adjusts the noise variance based on the privacy budget, and balances privacy protection and data accuracy.
[0038] (4) Use the aggregated data to train a global traffic prediction model on the target city server. The specific implementation method of this step includes the following training part: Model configuration: The global traffic prediction model adopts the Dynamic Hypergraph Learning Model (DyHSL), with the input being 60 minutes of historical data (12 time steps) and the output being the prediction results for the next 15 minutes (3 time steps).
[0039] Data splitting: The splitting ratios for the training set, validation set, and test set are 70%, 20%, and 10%, respectively.
[0040] Training optimization: The Adam optimizer was used with a learning rate of 0.0005, a batch size of 128, and 1000 training epochs.
[0041] This implementation adopts a federated parallel training strategy to improve efficiency, including split learning (decomposing the training process into independent executions on the client and server sides) and parallel optimization (updating model parameters on the client and server sides in parallel) to reduce communication overhead and improve training speed.
[0042] This embodiment demonstrates the application of the FedTT (Federal Transportation Knowledge Transfer) framework in a single-source city transfer scenario, specifically including the following aspects: Traffic view completion: In the source city client, a graph attention network is used to expand the spatial view of traffic data, and a time series model (such as DyHSL) is used to enhance the temporal view, thereby effectively completing the missing traffic data and generating a complete traffic data sequence.
[0043] Traffic domain adaptation: By using generative adversarial networks, the traffic data distribution of the source city is transformed and aligned to the traffic domain of the target city. This process utilizes traffic domain prototypes for distribution alignment, effectively reducing the differences in data distribution across cities.
[0044] Traffic Secret Aggregation: The client uses a lightweight masking formula to process the transformed data, while the server performs secure aggregation. This mechanism ensures that the server can only obtain the global result after aggregation and cannot restore the contribution data of any single source city, thus achieving privacy protection.
[0045] Model Training and Results: In the target city, a traffic prediction model (such as DyHSL) was trained using the aggregated data processed by the above steps. Experimental results show that, compared with commonly used federated learning benchmark methods in this field (such as 2MGTCH, T-ISTGNN, etc.), the model trained by the method of this invention significantly reduces the mean square error (MAE) and root mean square error (RMSE) in the traffic flow and speed prediction tasks of the target city, verifying the effectiveness of this invention in improving prediction accuracy.
[0046] Furthermore, this embodiment also demonstrates the effectiveness of FedTT in multi-source scenarios: after multiple source city clients independently complete local data completion and data domain transformation steps, the server securely aggregates the transformed data from all clients. The results show that multi-source collaborative training, compared to single-source training, can further improve the predictive performance of the target city model, reflecting the advantages of this invention in multi-source knowledge fusion.
[0047] This embodiment targets a city with sparse sensor deployment and scarce historical data. By applying the technical solution of this invention, the model is trained using traffic knowledge from large cities (source cities) with abundant data. The results show that even under the unfavorable condition of scarce data in the target city, this invention can still effectively improve the accuracy of traffic prediction, providing a feasible solution for solving the traffic modeling problem in emerging cities.
[0048] This invention achieves significant performance improvements in traffic flow, speed, and occupancy prediction tasks. At the same time, it maintains strong privacy protection capabilities and can be widely applied in fields such as intelligent transportation systems, urban management, and public resource allocation.
[0049] The above description of the embodiments is provided to enable those skilled in the art to understand and apply the present invention. Those skilled in the art can readily make various modifications to the above embodiments and apply the general principles described herein to other embodiments without creative effort. Therefore, the present invention is not limited to the above embodiments, and any improvements and modifications made to the present invention by those skilled in the art based on the disclosure thereof should be within the scope of protection of the present invention.
Claims
1. A cross-city federal transportation knowledge transfer method, characterized in that, Includes the following steps: (1) In each source city client, based on the local road network map structure, graph attention network and dynamic hypergraph model are used to complete the spatiotemporal dependency of the missing local historical traffic data and generate a complete spatiotemporal view of traffic data. (2) Transform the spatiotemporal view of traffic data into a domain aligned with the traffic data distribution of the target city through a domain adapter module based on generative adversarial networks; (3) The target city server aggregates traffic data from each source city client domain after conversion through a secure aggregation protocol. The secure aggregation protocol uses a mask-based lightweight computation, so that the server can only obtain the aggregated data and cannot reverse-engineer the individual data of any client. (4) Use aggregated data to train a global traffic prediction model on the target city server, and then use the model to predict the traffic flow and speed of the target city.
2. The cross-city federal transportation knowledge transfer method according to claim 1, characterized in that, The specific implementation method of step (1) is as follows: S11: Based on the road network graph structure, traffic sensors are used as graph nodes and the connections between sensors are used as edges to construct a sensor topology graph and calculate the shortest path matrix between sensors. S12: Use graph attention network to extract sensor features, calculate spatial dependency weights between sensors, and capture spatial correlations; S13: Model time series data as a hypergraph structure using the DyHSL model to capture long-range dependencies in the time series; S14: Based on spatial correlation and temporal dependence, linear interpolation and Gaussian process regression methods are used to complete the missing traffic data and generate a complete spatiotemporal view of traffic data. Noise is introduced during the completion process to enhance data privacy protection, and normalization processing is performed on the completed data to ensure data consistency.
3. The cross-city federal transportation knowledge transfer method according to claim 1, characterized in that: The domain adapter module in step (2) includes a generator and a discriminator. The generator adopts a multilayer perceptron structure to map the input source city traffic data to the target city data distribution domain, output traffic prediction data of the target city domain and align it using the traffic domain data prototype. The discriminator also adopts a multilayer perceptron structure to distinguish between real traffic data and traffic prediction data of the target city. The generator and discriminator are optimized through adversarial training, and the generator performance is optimized by using a cyclic consistency loss function to ensure that the transformed data not only conforms to the distribution of the target city domain but also retains the traffic pattern characteristics of the source city. At the same time, a classification loss function is used to optimize the discriminator.
4. The cross-city federal transportation knowledge transfer method according to claim 1, characterized in that, The specific implementation of step (3) is as follows: the source city client uses a lightweight masking algorithm to mask the converted traffic data and uploads it to the target city server; the target city server obtains new aggregated data by summing the masked data of all clients and sends it to each client.
5. The cross-city federal transportation knowledge transfer method according to claim 4, characterized in that, The expression for the lightweight masking algorithm is as follows: ; Among them: for any source city client i , This is the mask data for the client. and These are the traffic data from the current round of conversion and the traffic data from the previous round of conversion for this client, respectively. n The number of clients in the source city. This is the aggregated data from the previous round.
6. The cross-city federal transportation knowledge transfer method according to claim 5, characterized in that: The target city server aggregates the mask data of all clients to obtain new aggregated data using the following formula; ; in: This is for a new round of aggregated data.
7. The cross-city federal transportation knowledge transfer method according to claim 1, characterized in that: In step (3), the target city server introduces differential privacy noise during the data aggregation process, and dynamically adjusts the noise variance based on the privacy budget to balance privacy protection and data accuracy.
8. The cross-city federal transportation knowledge transfer method according to claim 1, characterized in that: The global traffic prediction model in step (4) adopts a dynamic hypergraph structure learning model, with historical traffic data as input and future traffic prediction data as output. The model training adopts a federated parallel training strategy, which means that the training process is decomposed into independent execution by the client and the server through split learning, and the client and the server update the model parameters in parallel.
9. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that: The processor is used to execute the computer program to implement the cross-city federal transportation knowledge transfer method as described in any one of claims 1 to 8.
10. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, it implements the cross-city federal transportation knowledge transfer method as described in any one of claims 1 to 8.