CN-121999607-A - Federal traffic flow prediction method based on track-driven directed relation modeling
Abstract
The invention discloses a federal traffic flow prediction method based on track-driven directed relation modeling, which comprises the following steps of 1) generating basic hidden representation, 2) reinforcing directionality of traffic flow, 4) mapping inflow and outflow representations to shared potential space and achieving direction semantic alignment through contrast loss, 5) constructing a directed relation graph subjected to minimum and maximum normalization, 6) generating time sequence features and uploading the time sequence features to a server, 7) dynamically updating the directed relation graph, 8) executing multi-layer structure propagation on the time sequence features of a client by using the updated relation graph to obtain space enhancement features and returning the space enhancement features to the client, 9) transmitting client model parameters along the directed relation graph by the server to obtain personalized aggregation models and issuing the personalized aggregation models to the client, and enabling the relation graph structure and a prediction model to keep combined optimization in the federal training process. The invention can construct a directed relation structure conforming to the dependence of traffic direction, and realize fairer, more stable and more accurate federal traffic flow prediction.
Inventors
- FAN QILIN
- FANG KE
- ZHENG RONGHAO
- FU SHU
- WANG YUEYANG
- GAO MIN
- XIONG QINGYU
Assignees
- 重庆大学
Dates
- Publication Date
- 20260508
- Application Date
- 20251229
Claims (10)
- 1. The federal traffic flow prediction method based on track-driven directed relation modeling is characterized by comprising the following steps of: Step 1) encoding a vehicle track sequence to generate a basic hidden representation; step 2) applying complementary direction masks to the underlying hidden representations for each time step, respectively, generating upstream and downstream hidden states from the masked future sequences and past sequences, respectively, noted as ; Step 3) calculating the output of a next-step prediction task according to the upstream hiding state, and calculating the output of a previous-step direction prediction task according to the downstream hiding state; step 4) mapping the upstream hidden state and the downstream hidden state to a shared potential space, normalizing, and calculating the similarity of inflow and outflow representations after normalization; step 5) for each time step Constructing a positive sample set And negative sample set And uses positive sample sets And negative sample set The method comprises the steps of carrying out joint optimization on a direction prediction target and a contrast alignment target so as to construct a pre-trained directed client relationship diagram, wherein a loss function in the optimization process is determined by the similarity of upstream and downstream hidden states and inflow and outflow representations after normalization; step 6) modeling the time sequence characteristics of the client to generate a client characteristic matrix; step 7) dynamically updating the directed client relationship graph; step 8) executing based on the client characteristic matrix and the dynamically updated directed client relationship graph Layer directed structure propagation, generating graph enhanced spatiotemporal features; Step 9) aggregating client model parameters along the dynamically updated directed relation graph to generate an initial model to be trained; Step 10), training an initial model to be trained in turn by taking the prediction errors of all clients as optimization targets, and generating a self-adaptive directed relation diagram driven by a joint optimization target and a task; And 11) predicting the traffic flow of the vehicle by using the self-adaptive directed relation graph of the joint optimization target and the task driver.
- 2. The method for federal traffic flow prediction based on trajectory-driven directed-relation modeling according to claim 1, wherein in step 1), the sequence of vehicle trajectories is encoded by a transducer encoder Encoding to generate a basic hidden representation, wherein the subscript Indicating the position in the access sequence, In order to correspond to the time stamp, Indexing for the accessed client; 。
- 3. The method for federal traffic flow prediction based on trajectory-driven directional relationship modeling according to claim 1, wherein in step 2), the direction masks are respectively as follows: in the formula, For an outflow mask, modeling an upstream outflow pattern of the client; For an inflow mask, modeling a downstream inflow pattern of the client; In step 3), the output of the next-step and the last-step direction prediction tasks are respectively as follows: in the formula, Is a hidden state dimension; two embedded vocabularies that are Transformer; 、 predicting the output of the task for the next and the last steps; A hidden state for the downstream inflow mode and the upstream outflow mode.
- 4. The method of federal traffic flow prediction based on trajectory-driven directed relationship modeling of claim 1, wherein in step 4), the step of calculating the similarity of the normalized inflow and outflow representations comprises: Step 4.1) utilizing a projector Concealing upstream and downstream states, respectively 、 Mapping to a potential space; Step 4.2) normalizing the mapped upstream and downstream representations to obtain: in the formula, 、 For normalized inflow and outflow representations; Step 4.3) calculating the similarity of the normalized inflow and outflow representations The method comprises the following steps: Wherein the method comprises the steps of Is a learnable temperature.
- 5. The method for predicting federal traffic flow based on trajectory-driven directed graph modeling of claim 1, wherein in step 5), the loss function in the optimization process is as follows: Wherein the method comprises the steps of Index sets for all valid positions; 、 、 Is a weight coefficient; 、 negative log likelihood loss for the next and last steps; Is a contrast loss; a loss function in the optimization process; 、 Is the similarity; 、 for a given hidden state 、 The following conditional probabilities.
- 6. The method for federal traffic flow prediction based on trajectory-driven directed relationship modeling of claim 1, wherein in step 5), the adjacency matrix of the pre-trained directed client relationship graph is as follows: wherein S is a pairwise similarity matrix between the outgoing representation and the incoming representation of the client level; Is an adjacency matrix; In step 6), the client feature matrix is as follows: in the formula, The method comprises the steps of (1) setting a client characteristic matrix; Is a client feature.
- 7. The method for federal traffic flow prediction based on trajectory-driven directed relationship modeling of claim 1, wherein in step 7), the step of dynamically updating the directed client relationship graph comprises: Step 7.1) computing the original adjacency matrix based on the updated embedding ; Step 7.2) adopting exponential sliding average to carry out smooth update on the directed client relation graph, wherein the adjacency matrix of the directed client relation graph after the smooth update is as follows: Wherein the method comprises the steps of , Is a momentum super parameter and is used for controlling the update speed; adjacency matrices for different iteration runs; step 7.3) alignment of adjacency matrix Performing row-by-row Top-k normalization to generate a sparse adjacency matrix Thereby realizing dynamic updating of the relation graph to the client; wherein the adjacency matrix The elements of (2) are as follows: in the formula, Is most relevant And a set of neighbors.
- 8. The method for federal traffic flow prediction based on trajectory-driven directed relationship modeling of claim 1, wherein in step 8), the graph-enhanced spatiotemporal features are as follows: Wherein, the Elements of (2) The following is shown: Wherein, the As a layer-to-layer transformation matrix that can be learned, Is a nonlinear activation function.
- 9. The method for federal traffic flow prediction based on trajectory-driven directed relationship modeling of claim 1, wherein in step 9), the step of generating the initial model to be trained comprises: Step 9.1) constructing a flattened local model parameter matrix of all clients, namely: in the formula, Is a local model parameter matrix; Is a local model parameter; step 9.2) execution by dynamically updated directed graph The parameter matrix after the parameter propagation is as follows: in the formula, The parameter matrix is the parameter matrix after being transmitted; step 9.3) after multiple propagation, determining a personalized aggregation model of each client; Wherein, the client side The personalized aggregate model of (2) is as follows: in the formula, To pass by Parameter matrix after secondary parameter transmission; Is a client Is a personalized aggregate model parameter; step 9.4) taking the personalized aggregation model of the client as an initial model to be trained, namely: in the formula, Is the initial model parameter to be trained.
- 10. The method for federal traffic flow prediction based on trajectory-driven directed relationship modeling according to claim 1, wherein in step 10), the optimization objective is as follows: in the formula, Is a local timing feature; A predictive function for each client; As a loss function; Is a global feature; To predict target truth values.
Description
Federal traffic flow prediction method based on track-driven directed relation modeling Technical Field The invention relates to the field of federal traffic flow prediction, in particular to a federal traffic flow prediction method based on track-driven directed relation modeling. Background Federal traffic flow prediction is a core support technology of a modern internet-driven urban travel ecosystem, and provides Guan Jianneng force for map services, network about vehicles, logistics networks and other applications. Efficient traffic prediction relies on accurate modeling of urban-level complex traffic dynamics, but the relevant data is typically scattered between traffic authorities, network about car companies and public transportation operators. Due to commercial competition and privacy protection limitations, the original data cannot be summarized intensively, and federal learning (FEDERATED LEARNING, FL) becomes a core paradigm for realizing collaborative modeling across clients on the premise of protecting data privacy. Under the background, the federal traffic flow prediction problem can be formed by cooperatively training a traffic prediction model on heterogeneous and non-independent clients with the same distribution, and considering prediction accuracy, performance fairness and stability of the training process. To achieve efficient collaboration across clients, existing federal methods typically rely on a client relationship graph to guide parameter aggregation and spatial encoding. However, how to construct a relationship graph structure that reflects traffic propagation characteristics remains a key challenge. The existing client relationship graph is mainly constructed based on two types of correlation sources. The first type is a structural correlation diagram. Such methods determine the correlation between clients based on static structural attributes such as geographic distance, road connection pattern, or administrative division. Each client has only one fixed structural feature and builds a relationship graph with static similarity measures, which generates a graph that is essentially an undirected structure. Such graph structure is fixed and simple, and cannot express the dynamics and directed dependence of traffic flow. The second type is a model correlation diagram. Such methods utilize signals (e.g., model parameter similarity, representation vector embedding, prototype spatial distribution, or time series patterns) in a model training process to dynamically generate a relationship graph. Although the specific implementations vary, they each assign a single representation vector to each client and utilize a symmetrical similarity function. Thus, the resulting graph structure is still symmetrical and undirected. In addition, even if part of the method introduces the combination of the static image and the dynamic image, the dynamic image part is still generated by single embedding similarity, and the problem of directional deficiency can not be fundamentally solved. More importantly, the graph structure lacks direct support for actual traffic semantics, and expresses only feature similarity, rather than flow dependence in real existence among areas. Although the two types of methods differ in terms of structural origin and dynamics, they have the common limitation of constructing undirected graphs based on symmetrical similarity, which modeling assumption does not match the physical properties of the traffic flow. The urban traffic propagation presents directionality, asymmetry and time variability essentially, and the undirected graph cannot express the directional dependence, so that the training process is easy to generate association relations inconsistent with traffic rules, and further clients which are irrelevant in semantics are mutually interfered in an aggregation stage, and the unfairness of performance and unstable training under the non-independent and same-distribution environment are aggravated. Disclosure of Invention The invention aims to provide a federal traffic flow prediction method based on track-driven directed relation modeling, which comprises the following steps: Step 1) encoding a vehicle track sequence to generate a basic hidden representation; step 2) applying complementary direction masks to the underlying hidden representations for each time step, respectively, generating upstream and downstream hidden states from the masked future sequences and past sequences, respectively, noted as ; Step 3) calculating the output of a next-step prediction task according to the upstream hiding state, and calculating the output of a previous-step direction prediction task according to the downstream hiding state; step 4) mapping the upstream hidden state and the downstream hidden state to a shared potential space, normalizing, and calculating the similarity of inflow and outflow representations after normalization; step 5) for each time step Constructing a positive s