Multimodal primitive learning-based traffic prediction methods, systems, devices, and storage media for anomaly events
By constructing a time-varying adjacency matrix and conditional decoding using a multimodal primitive learning method, the problem of prediction accuracy and correlation representation in existing traffic prediction models under abnormal events is solved, and high-precision traffic state prediction for emergencies is achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- NANJING HYDRAULIC RES INST
- Filing Date
- 2026-04-23
- Publication Date
- 2026-07-17
AI Technical Summary
Existing traffic prediction models struggle to effectively model the long-term impact of external disturbances on traffic evolution trajectories when faced with sudden and abnormal scenarios. Furthermore, they suffer from decreased prediction accuracy and negative migration issues when samples are scarce. In particular, they are unable to flexibly represent drastic shifts in local road network relationships under abnormal events.
By acquiring multi-source heterogeneous correlation data and prior information of future events, dynamic edge weight components are generated using multimodal primitive learning methods. Combined with static adjacency matrices for topological mask constraints, a time-varying adjacency matrix is constructed. Graph propagation operations are performed and the results are merged with prior information of future events for conditional decoding, outputting the prediction results of future traffic conditions.
It improves the model's ability to capture spatial correlations and its prediction accuracy under abnormal disturbances, enabling reliable prediction of traffic conditions in complex scenarios and allowing for early detection of the impact of abnormal events on traffic flow.
Smart Images

Figure CN122090622B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the fields of intelligent transportation and artificial intelligence technology, and in particular to a multimodal primitive learning traffic prediction method, system, device and storage medium for abnormal events. Background Technology
[0002] With the acceleration of urbanization and the popularization of intelligent transportation systems, accurate traffic condition prediction has become a key support for traffic flow guidance, urban planning, and emergency response. Under normal traffic conditions, traffic flow exhibits strong periodicity and smoothness. However, when urban road networks are affected by extreme weather such as typhoons and rainstorms, or by scheduled events such as major sporting events and statutory holidays, traffic conditions often exhibit drastic nonlinear fluctuations. Researching how to accurately capture the evolution trends of traffic elements under complex and ever-changing external environmental interventions is of significant technical importance for improving road network operational efficiency and ensuring public travel safety.
[0003] Currently, mainstream traffic prediction research is largely based on deep learning models, extracting spatiotemporal features through convolutional neural networks or recurrent neural networks. In recent years, graph neural networks have been widely used to characterize the spatial topological relationships of road networks. Existing techniques typically utilize predefined static physical road network structures or globally learned connection weights to construct spatial models. When processing external environmental information, simple feature concatenation methods are often used, employing attributes such as weather and events as auxiliary inputs. Furthermore, at the model training level, conventional methods often rely on massive amounts of historical samples, using optimization algorithms such as stochastic gradient descent to uniformly update all parameters to fit the global data distribution.
[0004] However, existing technologies still face significant challenges in dealing with sudden and abnormal scenarios. Due to the low frequency of abnormal events and the complexity of the traffic mechanisms they induce, existing methods struggle to effectively model the long-term impact of external disturbances on traffic evolution trajectories in the time domain, and to flexibly represent the drastic shifts in local road network relationships under abnormal conditions in the spatial domain. Furthermore, general prediction models often suffer from slow convergence or negative transfer problems due to distributional differences between tasks when faced with anomalous tasks with scarce samples. Therefore, it is necessary to investigate a traffic prediction scheme that can improve the ability to represent spatial correlation evolution in complex environments and its rapid adaptability to multi-task scenarios. Summary of the Invention
[0005] The purpose of this invention is to provide a multimodal primitive learning traffic prediction method, system, device, and storage medium for abnormal events, in order to solve at least one of the aforementioned problems in the prior art.
[0006] Technical solution: A multimodal primitive learning-based traffic prediction method for anomaly events, comprising:
[0007] Acquire multi-source heterogeneous correlation data of the target road network, prior information of future events, and pre-stored static adjacency matrix;
[0008] Feature extraction is performed on multi-source heterogeneous correlation data to obtain a multimodal latent representation set, which includes at least the traffic latent representation extracted from traffic state sequences;
[0009] Dynamic edge weight components are generated based on traffic implicit representation. Topological mask constraints are applied to the dynamic edge weight components using static adjacency matrix to determine the time-varying adjacency matrix of the target road network for this period.
[0010] The time-varying adjacency matrix is used to perform graph propagation operation on the traffic latent representation to obtain enhanced spatial features. These features are then aggregated with the remaining latent representations in the multimodal latent representation set to obtain a fused node representation.
[0011] The prior information of future events is converted into a prospective conditional representation, which is then merged with the fusion node representation for conditional decoding and prediction, outputting the future traffic state prediction results of the target road network.
[0012] Optionally, acquire multi-source heterogeneous association data of the target road network, prior information on future events, and a pre-stored static adjacency matrix, including:
[0013] Acquire multi-source heterogeneous correlation data, which includes traffic state sequences, environmental context sequences, historical event indication sequences, historical time features, and static node attributes of the target road network within the historical observation period;
[0014] Acquire prior information about future events, including indications of future events within the target prediction period and future time characteristics;
[0015] Obtain the pre-stored static adjacency matrix, which contains directly connected edges constructed based on physical connectivity, as well as non-directly connected redundant edges pre-supplemented based on preset correlation rules.
[0016] Optionally, the time-varying adjacency matrix of the target road network for this time segment can be determined using any of the following methods:
[0017] The first determination method is to directly determine the graph structure obtained by applying topological mask constraints to the dynamic edge weight components using the static adjacency matrix as the time-varying adjacency matrix.
[0018] The second determination method is to use the graph structure obtained by applying topological mask constraints to the dynamic edge weight components using the static adjacency matrix as the initial dynamic graph, and to use the extracted event-guided features to perform local incremental correction on the initial dynamic graph, and to determine the corrected graph structure as the time-varying adjacency matrix.
[0019] Optionally, dynamic edge weight components are generated based on traffic implicit representation, including:
[0020] Extract the corresponding node-level features from the traffic latent representation;
[0021] For node pairs with connected edges in the static adjacency matrix, extract and concatenate the corresponding node-level features, and input the concatenation result into a pre-configured feature mapping network to output scalar edge weights;
[0022] The calculated scalar edge weights for each node are spatially assembled to obtain dynamic edge weight components.
[0023] Optionally, the prior information of future events is converted into a look-ahead conditional representation, and then merged with the fused node representation for conditional decoding prediction, including:
[0024] Extract future event indication information and future time features from the prior information of future events, and concatenate and map the two to generate a prospective conditional representation;
[0025] Based on the preset prediction time step length, the fused node representation is expanded by temporal dimension replication to obtain the extended node representation;
[0026] The forward conditional representation and the extended node representation are concatenated and merged into the decoder input features. The pre-configured conditional decoding module is then used to decode the decoder input features to obtain the future traffic state prediction results.
[0027] Optionally, the model that performs feature extraction, determines the time-varying adjacency matrix, and performs conditional decoding prediction is pre-trained through the following steps:
[0028] The pre-collected and stored historical training samples are divided into multiple meta-task sequences in chronological order;
[0029] The network parameters of the model are divided into a backbone feature parameter group for time series prediction, a structure correction parameter group for graph generation, and an event association parameter group for event encoding.
[0030] The inner loop adapts and updates the data one by one using mini-batch samples from multiple meta-task sequences.
[0031] During the outer loop update, group parameter updates based on parameter differences are performed independently according to the pre-configured outer loop step size of the main feature parameter group, the structure correction parameter group, and the event association parameter group.
[0032] Optionally, an inner loop adaptation update can be performed sequentially using mini-batch samples from multiple meta-task sequences, including:
[0033] For any given meta-task sequence, its internal samples are divided into a support set and a query set according to a preset ratio;
[0034] The support set and the query set are combined to form a mini-batch fitting sample;
[0035] Based on the current shared parameters of the model, the inner loop calculation is performed using a small batch of adapted samples to obtain the task-level adapted parameters, and the prediction error signal corresponding to the query set is used to evaluate the effect of the inner loop adaptation update, thereby supporting the subsequent outer loop update process.
[0036] A multimodal primitive learning-based traffic prediction system for anomaly events includes:
[0037] The data acquisition module is used to acquire multi-source heterogeneous correlation data of the target road network, prior information of future events, and pre-stored static adjacency matrix;
[0038] The latent representation extraction module is used to extract features from multi-source heterogeneous associated data to obtain a multimodal latent representation set, which includes at least the traffic latent representation extracted from traffic state sequences.
[0039] The graph structure determination module is used to generate dynamic edge weight components based on traffic implicit representation, apply topological mask constraints to the dynamic edge weight components using the static adjacency matrix, and determine the time-varying adjacency matrix of the target road network for this period.
[0040] The propagation and fusion module is used to perform graph propagation operations on the traffic latent representation using the time-varying adjacency matrix to obtain enhanced spatial features, and then aggregates them with the remaining latent representations in the multimodal latent representation set to obtain fused node representations.
[0041] The condition prediction module is used to convert prior information of future events into a prospective condition representation, and then merge it with the fusion node representation to perform conditional decoding prediction, outputting the future traffic state prediction results of the target road network.
[0042] An electronic device includes a memory and a processor. The memory stores a computer program, and when the processor executes the computer program, it implements the method steps of any one of the above-described multimodal primitive learning traffic prediction methods for abnormal events.
[0043] A computer-readable storage medium having a computer program stored thereon, wherein the computer program, when executed by a processor, implements the method steps of any one of the above-described methods for multimodal primitive learning traffic prediction oriented towards anomalous events.
[0044] Beneficial effects: This invention improves the model's spatial correlation capture capability and prediction accuracy under abnormal interference by deep coupling of multimodal features, constrained dynamic graph evolution modeling, and forward-looking conditional decoding, thus achieving reliable prediction of traffic conditions in complex scenarios. Attached Figure Description
[0045] Figure 1This is a schematic diagram of the overall process of a multimodal primitive learning traffic prediction method for abnormal events provided in an embodiment of this application.
[0046] Figure 2 This is a schematic diagram of the process for obtaining multi-source heterogeneous association data of the target road network, prior information of future events, and pre-stored static adjacency matrix provided in the embodiments of this application.
[0047] Figure 3 This is a schematic diagram of the process for generating dynamic edge weight components based on traffic implicit representation provided in the embodiments of this application.
[0048] Figure 4 This is a schematic diagram of the preprocessing steps for converting prior information of future events into a look-ahead conditional representation and merging it with the fusion node representation for conditional decoding, provided in an embodiment of this application. Detailed Implementation
[0049] Example 1: To address the technical problems of spatial correlation shift and decreased prediction accuracy in existing traffic prediction models under the influence of abnormal events, a multimodal primitive learning-based traffic prediction method for abnormal events is provided, such as... Figure 1 As shown, the main steps include the following:
[0050] Step 101: Obtain multi-source heterogeneous association data of the target road network, prior information of future events, and pre-stored static adjacency matrix.
[0051] In this embodiment, specifically, the multi-source heterogeneous correlation data may include traffic flow speed sequences, road load indices, real-time weather observations, historical abnormal event records, and spatial coordinate attributes of the nodes to which the sensors belong during the historical observation period. Multi-source heterogeneous correlation data refers to traffic-related datasets from different sources, with varying data dimensions and structures, and correlated in the spatiotemporal dimensions. Prior information on future events refers to predetermined events that are known in advance at the start of the prediction and will occur within the target prediction period. For example, prior information on future events may include typhoon path warnings issued by meteorological departments for the next 24 hours, schedules of large-scale sporting events filed by traffic management departments, or officially released statutory holiday arrangements. By introducing prior information on future events, the model can obtain deterministic input about future environmental disturbances before performing decoding predictions. The static adjacency matrix is used to characterize the basic spatial connectivity between traffic nodes in the target road network.
[0052] Step 102: Extract features from the multi-source heterogeneous correlation data to obtain a multimodal latent representation set. The multimodal latent representation set includes at least the traffic latent representation extracted from the traffic state sequence.
[0053] This step can also specifically involve extracting features from multi-source heterogeneous correlated data to obtain a multimodal latent representation set, which includes traffic latent representations extracted from traffic state sequences and at least one other latent representation extracted from other modal data.
[0054] In this embodiment, feature extraction from multi-source heterogeneous correlated data is achieved through multiple parallel dedicated coding branches. Specifically, a first sequence coding module is used to process traffic state sequences. This first sequence coding module can be implemented using a gated recurrent unit network (GRU), which converts historical time-series data into a fixed-dimensional vector sequence through nonlinear mapping, thus obtaining the traffic latent representation. This traffic latent representation can preserve the dynamic changes in traffic flow or speed in the time domain.
[0055] Furthermore, the multimodal latent representation set can also include event latent representations obtained by encoding historical anomalous event records using a multi-head attention mechanism, and static node features obtained by extracting spatial features from node static attributes using graph convolution operators. By mapping the original data of different modalities to a unified latent space, heterogeneous information in multi-source data can be effectively preserved.
[0056] Step 103: Generate dynamic edge weight components based on traffic implicit representation, and apply topological mask constraints to the dynamic edge weight components using static adjacency matrix to determine the time-varying adjacency matrix of the target road network for this period.
[0057] In this embodiment, the dynamic edge weight component is used to characterize the changes in traffic logical association strength beyond the static road network structure caused by abnormal events. The process of determining the time-varying adjacency matrix involves inputting the traffic latent representation into the edge weight estimator. Specifically, the feature vectors of each node in the traffic latent representation at the last historical moment are extracted, and the features of nodes with connected relationships are concatenated. The concatenated features are then mapped through a fully connected layer to obtain scalar values representing the real-time association degree between nodes.
[0058] Furthermore, a topological mask constraint is implemented using a static adjacency matrix as a spatial connectivity reference. Topological mask constraints, achieved through point-to-point matrix multiplication, limit dynamically generated edge weights to within the limits allowed by the static road network topology. For example, if there is no physical or logical connection between node i and node j in the static adjacency matrix, the corresponding mask value is 0, forcing the dynamic edge weight at that location to be set to 0. This design prevents the model from generating logically chaotic dense connections in the early stages of training, ensuring that the generated time-varying adjacency matrix conforms to the physical constraints of the traffic system.
[0059] Step 104: Use the time-varying adjacency matrix to perform graph propagation operation on the traffic latent representation to obtain enhanced spatial features, and then aggregate the enhanced spatial features with the remaining latent representations in the multimodal latent representation set to obtain the fused node representation.
[0060] In this embodiment, the graph propagation operation refers to using a defined time-varying adjacency matrix as a weight operator to perform neighborhood feature aggregation on the traffic latent representation. Through this process, the representation vector of each node will incorporate the time-varying traffic state information of its neighboring nodes, resulting in enhanced spatial features.
[0061] Building upon this foundation, aggregation processing is performed to achieve deep integration of cross-modal information. Specifically, the enhanced spatial features are tensor-concatenated with the environmental latent representations, historical event latent representations, and static node features extracted in the preceding steps. A feature fusion module, such as a two-layer fully connected network or a gated fusion unit, is then used to output a fused node representation. This fused node representation not only incorporates the spatial propagation characteristics of the road network but also couples environmental contextual information such as weather and events, providing comprehensive feature support for subsequent high-precision prediction.
[0062] Step 105: Convert the prior information of future events into a look-ahead conditional representation, and merge the look-ahead conditional representation with the fused node representation for conditional decoding prediction, and output the future traffic state prediction result of the target road network.
[0063] In this embodiment, the prior information of future events is converted into a look-ahead conditional representation, which involves nonlinearly embedding the future event category encoding with future time features. For example, the category label of "typhoon red warning" is mapped to a 64-dimensional embedding vector. The look-ahead conditional representation and the fusion node representation are merged along the feature dimension. In this embodiment, the merging operation can specifically be represented as concatenation or weighted summation of feature vectors. The merged feature sequence is input into the conditional decoder, which performs multi-step predictions of future traffic indicators, such as average speed or traffic flow index, based on the future environmental disturbance signals provided by the look-ahead conditional representation. The final output of the future traffic state prediction result can reflect the advanced impact of abnormal events on traffic flow. For example, at the time before a typhoon makes landfall, the model can predict a sharp drop in traffic speed based on the look-ahead conditional representation, improving the prediction reliability in abnormal scenarios.
[0064] The following describes the working process of this invention through a typical application scenario. Assume a city's road network is at the end of a historical observation window, a typhoon warning signal has been issued, and the prior information for future events includes a typhoon red warning category label. Step 101: Obtain the historical 12-hour traffic state sequence, meteorological data, and historical event records, while simultaneously obtaining typhoon warning event information for the next 8 hours. Step 102: Obtain the traffic latent representation by Bi-GRU encoding the historical traffic sequence, capturing the temporal characteristic that the speed within the historical window has shown a decreasing trend. Step 103: Generate dynamic edge weights reflecting the current direction of congestion spread based on the traffic latent representation, and determine the time-varying adjacency matrix by combining it with static adjacency matrix constraints; the edge weights between nodes within the typhoon-affected area are significantly increased, reflecting enhanced regional linkage. Step 104: Obtain enhanced spatial features that integrate the congestion status of the neighborhood through graph propagation, and aggregate them with the meteorological latent representation to form a fused node representation. Step 105 concatenates the typhoon red warning category embedding vector with the time features of the next 8 hours to form a look-ahead conditional representation. Based on this, the conditional decoder outputs a speed prediction curve that is earlier and has a larger drop compared to the version without look-ahead conditions, which is consistent with the speed drop trend actually caused by the typhoon's landfall.
[0065] Example 2: Based on the above examples, this example further describes how to pre-set redundant edges to cope with abnormal detour scenarios when determining the target road network spatial structure, and the specific implementation logic of each branch coding module in the multimodal implicit representation set. For example... Figure 2 As shown.
[0066] Step 201: Obtain multi-source heterogeneous correlation data, which includes traffic state sequences, environmental context sequences, historical event indication sequences, historical time features, and static node attributes of the target road network during the historical observation period.
[0067] In this embodiment, the traffic state sequence can specifically be a multi-dimensional time-series tensor composed of average vehicle speed, traffic flow, or road occupancy collected by road network sensors. The environmental context sequence includes external environmental parameters related to traffic operation, such as real-time rainfall, visibility, road surface humidity, or air pressure. The historical event indication sequence is used to record the types of abnormal events that have occurred within the observation period and their duration, such as accidents, construction, or traffic control status represented by one-hot encoding. Historical time features include the periodicity attributes of the corresponding data sampling time, such as the current time belonging to the hour index 0 to 23 of a day, or the day index 1 to 7 of a week. Static node attributes characterize the inherent physical characteristics of the traffic nodes themselves, such as the speed limit, number of lanes, gradient, and the area to which they belong. By acquiring the above-mentioned multi-source heterogeneous correlation data, multi-dimensional prior feature inputs can be established for subsequent models.
[0068] Step 202: Obtain prior information on future events, which includes indications of future events and future time characteristics within the target prediction period.
[0069] In this embodiment, future event indication information is a predefined description of known disturbances that are about to occur. For example, in a task for predicting traffic during holidays, future event indication information includes the start and end points of statutory holidays. Future time features are temporal attribute descriptions of each time step within the target prediction window, ensuring that the model can perceive the relative position of the prediction target on the time axis during the decoding phase.
[0070] Step 203: Obtain the pre-stored static adjacency matrix. The static adjacency matrix contains directly connected edges constructed based on physical connectivity, as well as non-directly connected redundant edges pre-supplemented based on preset correlation rules.
[0071] In this embodiment, the static adjacency matrix not only considers the physical connectivity between road segments in the road network, but also introduces a redundant edge mechanism to improve the model's spatial adaptability in abnormal scenarios. Specifically, based on preset correlation rules, the system calculates the historical traffic flow correlation coefficient or Euclidean distance between nodes that are not directly physically connected.
[0072] If the historical traffic flow correlation coefficient between two nodes is greater than a preset correlation threshold, or their physical distance is less than a preset distance threshold, a non-directly connected edge is pre-added to the static adjacency matrix. The correlation threshold and distance threshold can be determined through statistical analysis based on the specific road network density and node deployment. For example, redundant edges can be set between two parallel but not directly connected main roads. When one road becomes congested due to an accident, causing vehicles to detour to the other road, the time-varying adjacency matrix can dynamically increase the weight of the redundant edge to capture regional linkage effects that are not originally visible in the physical topology.
[0073] Step 204: Map the historical time features using a pre-configured time encoder to obtain the historical time embedding.
[0074] In this embodiment, the time encoder uses a fully connected linear layer to project discrete temporal features into a high-dimensional continuous space. For example, the hour index from 0 to 23 is converted into a 64-dimensional temporal embedding vector, a process that allows the model to better learn the smoothness of the temporal distribution.
[0075] Step 205: The traffic state sequence is merged with the historical time embedding and input into the first sequence encoding module for temporal feature extraction to obtain the traffic latent representation.
[0076] In this embodiment, the traffic state sequence and historical time are embedded in the feature dimension and then concatenated. The first sequence encoding module preferably employs a bidirectional gated recurrent unit (Bi-GRU) or a long short-term memory (LSTM) network. Through temporal encoding, the traffic latent representation is extracted to capture the trend features of historical traffic flow evolution.
[0077] Step 206: The environmental context sequence and historical time embedding are merged and input into the second sequence encoding module for temporal feature extraction to obtain the environmental latent representation.
[0078] In this embodiment, the second sequence coding module uses a time-series network with the same structure as the first sequence coding module to process environmental data such as meteorology and extract environmental latent representations.
[0079] Step 207: The historical event indication sequence is merged with the historical time embedding and input into the feature association module for feature extraction based on the attention mechanism to obtain the historical event latent representation.
[0080] In this embodiment, the feature association module specifically employs a self-attention layer. By calculating the association weights between events at different historical moments, key anomalous nodes with long-term impact are identified and mapped to latent representations of historical events.
[0081] Step 208: Using the pre-configured graph feature extraction module, with the static adjacency matrix as the spatial structure reference, spatial aggregation encoding is performed on the static node attributes to obtain static node features.
[0082] In this embodiment, the graph feature extraction module employs a single-layer graph convolutional neural network (GCN) or the graph sampling and aggregation (GraphSAGE) operator. Under the topological constraints defined by the static adjacency matrix, each node aggregates attribute information such as road segment speed limits and lane numbers within its neighborhood to generate static node features.
[0083] Step 209: Combine the traffic latent representation, environmental latent representation, historical event latent representation, and static node feature set into a multimodal latent representation set.
[0084] In this embodiment, by packaging the feature vectors output from each of the above branches, a complete multimodal latent representation set is constructed, providing an input basis for dynamic graph learning in the subsequent step 103.
[0085] Example 3 further describes how, while ensuring dimensional self-consistency, a basic time-varying adjacency matrix is constructed using traffic branch features and a static topological mask, while simultaneously improving the applicability of the model in large-scale road network scenarios by reducing computational complexity.
[0086] Step 301, determine the time-varying adjacency matrix of the target road network for this period, including: directly determining the graph structure obtained by applying topological mask constraints to the dynamic edge weight components using the static adjacency matrix as the time-varying adjacency matrix.
[0087] In this embodiment, the time-varying adjacency matrix is a numerical matrix used to describe the real-time correlation strength between traffic nodes at the current prediction time. Specifically, this step maps and fuses dynamically generated edge weight information with pre-stored static road network topology to obtain a spatial weight structure that reflects the real-time congestion diffusion pattern. Topological mask constraint refers to using the static adjacency matrix as a structural operator to perform an element-wise multiplication masking operation on the dynamically generated edge weights, ensuring that the final determined time-varying adjacency matrix does not deviate from the physical or logical connectivity of the road network in terms of structure.
[0088] Step 302: Generate dynamic edge weight components based on traffic implicit representation, such as... Figure 3 As shown, this specifically includes: extracting corresponding node-level features from the traffic latent representation.
[0089] In this embodiment, the traffic latent representation is the hidden feature matrix output by the traffic sequence after processing by the temporal coding module. Since the prediction task focuses on the latest traffic state evolution, this step preferably extracts the feature vector corresponding to the last historical moment from the traffic latent representation as the node-level feature. For example, if the traffic latent representation has dimensions (N, L, d), where N is the number of nodes, L is the historical window length, and d is the feature dimension, extracting the cross-sectional matrix at the Lth moment yields a node-level feature matrix of dimension (N, d).
[0090] Step 303: For node pairs with edge relationships in the static adjacency matrix only, extract and concatenate the corresponding node-level features, and input the concatenation result into the pre-configured feature mapping network to output scalar edge weights.
[0091] In this embodiment, to address the excessive complexity caused by calculating all node pairs in the graph, a reduced-order computation strategy based on static topology is adopted. Specifically, the system traverses the static adjacency matrix and identifies all node pairs (i,j) corresponding to non-zero elements. For each identified node pair, the feature vector h of node i is extracted from the node-level feature matrix. i With the eigenvector h of node j j The feature concatenation operation is performed to obtain a 2D concatenated vector. The feature mapping network is specifically a two-layer fully connected neural network, using the ReLU activation function in between. After the concatenated vector is input into this network, the linear mapping unit of the output layer calculates a scalar edge weight w representing the strength of the node's real-time association with the network. ij .
[0092] Step 304 involves assembling the calculated scalar edge weights for each node in terms of spatial location to obtain dynamic edge weight components.
[0093] In this embodiment, the assembly process refers to filling the calculated scalar edge weights into the corresponding matrix positions according to the index coordinates (i,j) of the node pair, thereby constructing a dynamic edge weight component matrix W with dimension (N,N).
[0094] For node positions that have no connection to any other node in the static adjacency matrix, they can be directly assigned zero in this step, reducing the computational complexity from O(N) to O(N). 2 The number of edges is reduced to O(|E|), where |E| is the number of non-zero edges in the static adjacency matrix.
[0095] In some optional implementations, to ensure the numerical stability of the dynamic edge weights, after obtaining the assembled matrix, the Sigmoid function can be used to perform a nonlinear mapping on the non-zero elements of the matrix, limiting their numerical range to between 0 and 1. The specific calculation formula is as follows:
[0096] w ij =Sigmoid(MLP edge ([h i ||h j ]));
[0097] Among them, w ij Let be the scalar edge weight between node i and node j, and let sigmoid be the nonlinear mapping function. MLP edge For a pre-trained feature mapping network, h i with h j are the node-level feature vectors of node i and node j, respectively, and || is the concatenation operator on the feature dimension.
[0098] Furthermore, the calculation logic for topological mask constraints when determining the time-varying adjacency matrix is as follows:
[0099] A t_dyn =W*A0;
[0100] Among them, A t_dyn The final time-varying adjacency matrix is defined by W, the assembled dynamic edge weight component matrix, A0, the pre-stored static adjacency matrix, and *, which is the position-wise multiplication operator for matrix elements (Hadamard Product). This operation ensures that only the positions of pre-defined edges (including physical and redundant edges) on the static topology retain non-zero dynamic weights. This basic path calculation is efficient and can accurately capture the dynamic increase or decrease of local weights in the road network under abnormal events.
[0101] Example 4: Based on the above examples, this example describes how, in an abnormal event scenario, an incremental correction mechanism guided by event features can be introduced to achieve local dynamic evolution modeling of spatiotemporal relationships while maintaining static topological constraints.
[0102] Step 401, determining the time-varying adjacency matrix of the target road network for this period, includes: using the graph structure obtained by applying topological mask constraints to the dynamic edge weight components using the static adjacency matrix as the initial dynamic graph, using event-guided features extracted from the multimodal latent representation set to perform local incremental correction on the initial dynamic graph, and determining the corrected graph structure as the time-varying adjacency matrix.
[0103] In this embodiment, the initial dynamic graph refers to the intermediate graph structure generated through Embodiment 3, which reflects the dynamic correlation of the road network infrastructure. Local incremental correction refers to the targeted adjustment of the node connection weights in the affected areas of the road network based on predetermined abnormal events occurring at the current time. For example, when a large-scale gathering occurs in a certain area, this step can generate positive weight increments between road segments in that area to reflect the enhanced regional linkage caused by the event.
[0104] Step 402: Obtain the event feature vector and time feature vector of the current abnormal event, and generate the node influence intensity vector by combining the pre-configured node position attributes.
[0105] Specifically, this step can also involve extracting the event feature vector of the current abnormal event from the multimodal latent representation set, obtaining the time feature vector corresponding to the current moment from multi-source heterogeneous correlation data, and generating a node influence intensity vector by combining the pre-configured node position attributes.
[0106] In this embodiment, the event feature vector is the hidden state representation output by the event encoding branch. Node location attributes may include the node's topological centrality or geographic coordinate priors within the road network. By concatenating the event feature vector, time feature vector, and node location attributes, and inputting this concatenation into the nonlinear mapping module, a node influence strength vector is output. The specific calculation formula is as follows:
[0107] s t =Sigmoid(MLP s (e t ||τ t ||p i ));
[0108] Among them, s t The generated node influence intensity vector, Sigmoid is the activation function, and MLP is used. s For a multi-layer fully connected network, e t Let τ be the event feature vector at the current moment. t p is the time feature vector.i is the node location attribute, and || is the concatenation operator. This vector is used to characterize the distribution of the impact of the current event on each traffic node.
[0109] Step 403: Perform low-rank decomposition operation based on traffic latent representation and event feature vector to generate low-rank increment matrix.
[0110] In this embodiment, to reduce the parameter degrees of freedom in dynamic graph correction and improve training stability, a low-rank decomposition method is used to generate the correction increment. Specifically, two low-dimensional matrices are generated using two linear mapping layers, and the low-rank increment matrix is obtained by multiplying these two low-dimensional matrices. The specific calculation formula is as follows:
[0111] ΔA t =U t *V t T ;
[0112] Where, ΔA t U is a low-rank increment matrix. t With V t The generated low-dimensional feature matrix has dimensions (N, r), where N is the number of nodes, r is a preset low-rank dimension and satisfies that r is much smaller than N, V t T For matrix V t The transpose of .
[0113] Specifically, the traffic latent representation can first be averaged along the historical time sequence dimension to obtain a node-level representation of dimension (N,d). Then, the event feature vector is broadcast to each node and concatenated with it to form a representation of dimension (N,d+d). e The fusion representation of ) d e This represents the dimension of the event feature vector. Then, two independent linear mapping layers are used to map this fused representation to a matrix U of dimension (N, r). t With V t The above-described input combination method is a standard practice in this field, and those skilled in the art can make adaptive adjustments based on the actual model design.
[0114] The low-rank dimension r is a preset hyperparameter whose value is much smaller than the number of road network nodes N. It can be determined on the validation set through conventional hyperparameter tuning methods, such as grid search or Bayesian optimization.
[0115] Step 404: Expand the node influence intensity vector into an edge-level influence matrix, and construct a multi-hop allowed edge mask based on the topological connection relationship of the static adjacency matrix.
[0116] In this embodiment, the edge-level influence matrix is obtained by calculating the outer product of the node influence intensity vectors, which is used to determine the adjustment factor for the correction weight between each pair of nodes. Simultaneously, matrix exponentiation or breadth-first search is performed based on the static adjacency matrix to determine the neighborhood range within k hops of a known edge on the topology, generating a multi-hop allowed edge mask. Elements in the multi-hop allowed edge mask take values of 0 or 1, used to define candidate regions where structural corrections are permitted. The number of hops k in the multi-hop neighborhood can be determined based on the actual topological density of the road network and the typical influence radius of abnormal events; for example, k can be an integer between 1 and 3, selected by evaluating the spatial coverage rationality of graph corrections on a validation set.
[0117] Step 405: Using the edge-level influence matrix and the multi-hop allowed edge mask, spatial masking constraints are applied to the low-rank increment matrix to obtain the localization correction matrix.
[0118] In this embodiment, the low-rank increment matrix, the edge-level influence matrix, and the multi-hop allowed edge mask are multiplied positionally to obtain the localized correction matrix. This process ensures that the correction increment only appears in local regions affected by events and conforming to topological neighborhood constraints, avoiding invalid corrections across the entire graph.
[0119] Step 406 involves structurally fusing the localization correction matrix with the initial dynamic graph to obtain the corrected graph structure. This specifically includes the following process:
[0120] Using preset topology preservation coefficients, the initial dynamic graph is weighted and merged with the localization correction matrix after nonlinear activation processing;
[0121] Perform a sparsification filtering operation on the merged graph matrix row by row, so that each row of the graph matrix retains at most a preset number of the maximum weight elements and sets the remaining elements to zero, and the resulting sparsified matrix is used as the corrected graph structure.
[0122] In this embodiment, after applying activation processing to the localization correction matrix, a weighted sum is performed with the initial dynamic graph to obtain the fused matrix. Furthermore, to ensure the sparsity of the graph structure, row-wise sparsity filtering is performed on the fused matrix; that is, only the K elements with the largest weights are retained in each row, and the remaining elements are set to zero, resulting in the corrected graph structure. The specific calculation formula is as follows:
[0123] A t =TopK(β*A t_dyn +(1-β)*Sigmoid(ΔA t_loc ),K);
[0124] Among them, A t For the corrected graph structure, TopK is the row-wise sparsification operator, β is the preset static topology preservation coefficient, and A t_dynFor the initial dynamic graph, ΔA t_loc For localization correction matrix, K is the maximum number of adjacencies retained in each row. The larger the β value, the more the correction result is biased towards preserving the topological weights of the initial dynamic graph; the (1-β) term gives greater influence weight to event-driven local corrections.
[0125] The topology retention coefficient β and the maximum number of adjacencies K retained per row can be determined through cross-validation experiments on the validation set. The value of β is usually between 0 and 1, and the value of K can be adaptively set according to the average degree of the road network nodes. Those skilled in the art can determine the appropriate value without creative effort.
[0126] Furthermore, in performing the above correction process, this embodiment also introduces structural constraint regularization terms to guide model optimization. The structural constraint regularization terms include sparse constraint terms and topological constraint terms. The sparse constraint term penalizes non-zero elements in the matrix by calculating the norm of the low-rank increment matrix. The topological constraint term restricts the correction increment from deviating from a preset allowed neighborhood by calculating the values of the low-rank increment matrix outside the multi-hop allowed edge mask. Through this constrained correction mechanism, the model can effectively characterize the time-varying spatial dependency shift induced by anomalous events.
[0127] Example 5: Based on the above examples, this example describes how, after obtaining the fused node representation, conditional decoding is performed in conjunction with prior information about future events to achieve forward-looking prediction of traffic conditions under known future abnormal disturbances. For example... Figure 4 As shown.
[0128] Step 501: Extract future event indication information and future time features from the prior information of future events, and concatenate and map the two to generate a look-ahead conditional representation.
[0129] In this embodiment, the future event indication information is a quantitative description of the category and intensity of events expected to occur within the target prediction period. Specifically, if the prediction period involves a planned major sporting event, the start time, end time, and expected impact level of the event are extracted, such as being mapped to numerical values from 1 to 5. The future time features include the timestamp attribute corresponding to each prediction step in the future, such as the specific hour index of the prediction step within 24 hours or whether it belongs to a public holiday. The system uses a pre-trained linear embedding layer to map the above information to a high-dimensional continuous space, and obtains the look-ahead conditional representation by concatenating the category embedding vector and the time attribute vector.
[0130] Step 502: According to the preset prediction time step length, the fusion node representation is expanded by temporal dimension copying to obtain the extended node representation.
[0131] In this embodiment, the fused node representation is a static node state matrix that aggregates multimodal features at the end of the historical window. Since the prediction task aims to output the traffic state for the next H consecutive time steps, and the fused node representation only corresponds to a single moment in the time domain, temporal dimension replication expansion is required. Specifically, let the dimension of the fused node representation be (N, d), where N is the number of nodes and d is the feature dimension; if the preset prediction time step length H is 8, then the matrix is repeatedly replicated 8 times in the newly added temporal dimension to generate an expanded node representation with dimension (H, N, d), providing the decoder with initial spatial feature references for each prediction moment.
[0132] Step 503: The look-ahead condition representation and the extended node representation are concatenated and merged into the decoder input features. The pre-configured conditional decoding module is used to decode the decoder input features to obtain the future traffic state prediction results.
[0133] In this embodiment, the splicing operation refers to merging the look-ahead conditional representation corresponding to each prediction step with the extended node representation at the corresponding time step along the feature channel dimension to generate decoder input features containing future event constraint information. The conditional decoding module preferably employs a multi-layer recurrent neural network or an attention-based decoding network. The decoder performs nonlinear evolution processing on the initial features in the extended node representation based on future event signals (such as upcoming traffic control or rainfall start times) contained in the look-ahead conditional representation. The final output future traffic state prediction result includes traffic index values for each future time step, such as the average driving speed of each node in the road network or the Traffic Performance Index (TPI).
[0134] In some optional implementations, to enhance the model's ability to capture sudden velocity drops under the influence of unexpected events, the conditional decoding prediction is calculated as follows:
[0135] Y pred =Decoder(H ext ||E cond );
[0136] Among them, Y pred To obtain the predicted future traffic conditions, the Decoder is a pre-configured conditional decoding module, H ext For the generated extended node representation, E cond Here, || represents the look-ahead condition, and || is the concatenation operator on the feature dimension. Using this method, the model can adjust the evolution trajectory of traffic indicators in advance, given the known existence of future anomalies, making the predictions more consistent with actual observation trends under abnormal scenarios.
[0137] Example 6: Based on the above examples, this example describes how to divide the training data into a sequence of meta-tasks and combine it with a parameter grouping and support set / query set concatenation adaptation mechanism to enable the model to quickly transfer under conditions of a small number of abnormal samples.
[0138] Step 601: Divide the pre-collected and stored historical training samples into multiple meta-task sequences in chronological order.
[0139] In this embodiment, the meta-task sequence refers to a set of temporally continuous subsets of data obtained by segmenting the dataset according to a time window. Specifically, the overall training set is divided into 10 sequential meta-tasks, each containing traffic observations, environmental context, and event records within a predetermined time period. For example, the first meta-task might correspond to data from April to May 2018, the second meta-task to data from May to June 2018, and so on. This temporal segmentation allows the model to learn the distributional drift characteristics of the road network state over time, providing diverse task contexts for subsequent processing of anomalous and sudden scenarios.
[0140] Traffic state sequences in historical training samples can be derived from public traffic datasets, such as the PeMS series datasets and the METR-LA dataset, or acquired through conventional road network sensor acquisition methods in this field. Meteorological data and event records can be obtained from public meteorological observation databases and public event records from traffic management departments, respectively. Appropriate training samples can be selected based on the specific application scenario and the availability of public or private data sources.
[0141] Step 602: Divide the network parameters of the model into a backbone feature parameter group for time series prediction, a structure correction parameter group for graph generation, and an event association parameter group for event encoding.
[0142] In this embodiment, the parameter partitioning is determined based on the functional differences of each module during the abnormal scenario adaptation process. The backbone feature parameter group includes the weight parameters in the traffic branch encoder, environment branch encoder, and decoder, which are responsible for capturing general spatiotemporal evolution patterns. The structure correction parameter group includes parameters for generating dynamic edge weight components and performing constrained incremental graph correction, which are responsible for characterizing the spatial correlation changes caused by abnormal events. The event correlation parameter group includes parameters from the event encoding branch and gating fusion module, which are responsible for parsing the semantic features of abnormal events. This decoupled partitioning allows different update strategies to be applied to different functional modules during the training phase.
[0143] Step 603 involves sequentially performing inner loop adaptation updates using mini-batch samples from multiple meta-task sequences to obtain the task-level adaptation parameters corresponding to each meta-task. Specifically, this includes:
[0144] For any given meta-task sequence, its internal samples are divided into a support set and a query set according to a preset ratio;
[0145] The support set and the query set are combined to form a mini-batch fitting sample;
[0146] Based on the current shared parameters of the model, the inner loop calculates task-level adaptation parameters using mini-batch adapted samples, and evaluates the effectiveness of the inner loop adaptation update using the prediction error signal corresponding to the query set, thereby supporting the subsequent outer loop update process. Specifically, the task-level adaptation parameters are output to the outer loop update step to calculate the parameter difference between them and the current shared parameters in order to perform group parameter updates.
[0147] In this embodiment, inner loop adaptation is a rapid parameter adjustment process performed on a single meta-task. For example, for any meta-task sequence, its internal samples are divided into a support set and a query set according to a preset ratio of 80% and 20%, respectively. The support set and query set constitute a mini-batch adaptation sample. During inner loop updates, based on the model's current shared parameters, a small number of gradient descent calculations are performed using the mini-batch adaptation sample to obtain the task-level adaptation parameters.
[0148] Step 604: When performing the outer loop update, the group parameter update based on parameter difference is performed independently according to the pre-configured outer loop step size of the main feature parameter group, the structure correction parameter group, and the event association parameter group.
[0149] This step can also be further described as follows: when performing the outer loop update, based on the pre-configured outer loop step size of the main feature parameter group, the structure correction parameter group, and the event association parameter group, and based on the parameter difference between the task-level adaptation parameters and the current shared parameters, the group parameter update based on the parameter difference is performed independently.
[0150] In this embodiment, the outer loop update uses parameter differencing to evolve the model initialization parameters. Specifically, the difference between the task-level adaptation parameters and the current shared parameters for each parameter group is calculated and multiplied by the corresponding outer loop step size. The calculation formula is as follows:
[0151] θ k =θ k +ε k *(1 / M)*∑(θ k_m -θ k );
[0152] Where, θ k θ is the current shared parameter of the k-th group of parameters. k_m For the set of parameters after the m-th meta-task completes its inner loop update, ε kLet M be the outer loop step size corresponding to the k-th parameter group, and M be the total number of meta-tasks in the current batch. In this embodiment, it is preferable to set the outer loop step size of the structure correction parameter group and the event association parameter group to be greater than the outer loop step size of the backbone feature parameter group, so that the model can more sensitively capture structural changes. The above summation operation traverses all M meta-tasks in the current batch, and its implementation is a conventional batch gradient aggregation operation in the art. The value of M can be set according to the actual batch size.
[0153] Step 605: Use the prediction error signal corresponding to the query set to evaluate the effect of the inner loop adaptation update, thereby supporting the subsequent outer loop update process.
[0154] In this embodiment, the query set is not directly used for gradient calculation but serves as a validation set to monitor the model's generalization performance on the current meta-task. After the inner loop adaptation is complete, the prediction loss is calculated on the query set using the updated task-level adaptation parameters. This loss signal not only reflects the effectiveness of the current adaptation path but also serves as a basis for triggering adaptive scaling of the outer loop step size or executing early stopping logic, ensuring the convergence stability of the meta-training process.
[0155] Example 7: Based on the above examples, this example describes how to construct a hierarchical tree using scene metadata during the meta-learning outer loop update process, and how to determine the joint conflict degree by fusing scene semantic similarity and gradient geometric similarity, thereby achieving adaptive scaling of learning rate or step size for different parameter groups.
[0156] The outer loop update process also includes an adaptive control step based on multi-scenario semantic anti-forgetting, specifically including:
[0157] Step 701: Extract scene metadata corresponding to each meta-task sequence, and calculate scene semantic similarity between different meta-tasks based on the scene metadata.
[0158] In this embodiment, scene metadata refers to a set of labels describing the traffic environment characteristics to which the meta-task belongs. Specifically, scene metadata includes time type, event type, time period label, and seasonal attribute. Time types include weekdays, weekends, and public holidays; event types include no events, typhoons, rainstorms, major sporting events, and road construction; time period labels include morning rush hour, evening rush hour, and off-peak hours; and seasonal attributes include spring, summer, autumn, and winter. The system uses a pre-trained two-layer fully connected scene encoder to vectorize the above labels.
[0159] Step 702: Use the pre-configured scene encoder to map the scene metadata to obtain the scene semantic embedding.
[0160] In this embodiment, the scene semantic embedding is the high-dimensional continuous vector z output by the scene encoder. mMapping discrete scene labels to an embedding space can characterize the semantic relationships between different tasks. For example, typhoon scenes and rainstorm scenes are semantically close, while typhoon scenes and regular weekday scenes are far apart.
[0161] Step 703: Based on the preset scene category division rules, construct a scene category hierarchy tree containing the progressive relationship from the global scene to the specific event category, and calculate the hierarchical distance between the two in the scene category hierarchy tree according to the scene meta information of different meta tasks.
[0162] In this embodiment, the scene category hierarchy tree is a pre-defined prior knowledge structure. The top layer of this tree structure represents all scenes; the second layer is divided into normal scenes and abnormal scenes; the third layer is further subdivided into specific categories such as extreme weather, public holidays, and large-scale events; and the bottom layer represents specific events, such as typhoons, the Mid-Autumn Festival holiday, and a concert at a stadium. The hierarchy distance d... hier This refers to the sum of the path lengths taken by two task nodes to reach their common ancestor node in a tree structure. For example, the hierarchical distance between typhoons and rainstorms, both belonging to extreme weather conditions, is less than the hierarchical distance between typhoons and the Mid-Autumn Festival holiday.
[0163] Step 704: Calculate the scene semantic similarity by combining the differences in vector representations of the scene semantic embedding with the spatial decay effect corresponding to the hierarchical distance.
[0164] In this embodiment, the formula for calculating scene semantic similarity is as follows:
[0165] sim sem_m_n =cos(z m ,z n )*exp(-λ h *d hier_m_n );
[0166] Where, sim sem_m_n To calculate the scene semantic similarity between task m and task n, cos is the cosine similarity operator, and z m With z n These are the scene semantic embedding vectors corresponding to task m and task n, respectively, where exp is the natural exponential function, and λ is the vector. h d is the preset attenuation coefficient for hierarchical distance. hier_m_n Let be the hierarchical distance between task m and task n. Introducing the hierarchical distance decay effect allows the model to consider both vector features and class hierarchy priors when evaluating semantic associations.
[0167] Step 705: Obtain the task gradients generated by adapting each network parameter group of the model under different meta-tasks during the inner loop adaptation and update process, and calculate the gradient geometric similarity between the task gradients of different tasks.
[0168] In this embodiment, the task gradient refers to the gradient vector generated by the model parameters during the inner loop adaptation process. Gradient geometric similarity is characterized by the consistency of gradient directions by calculating the cosine angle between the gradient vectors of two tasks. The calculation formula is as follows:
[0169] sim geo_k_m_n =cos(g k_m ,g k_n );
[0170] Where, sim geo_k_m_n Let g be the gradient geometric similarity of the k-th parameter set between task m and task n. k_m With g k_n These are the gradient vectors generated by the k-th parameter set under the corresponding task.
[0171] Step 706: Combine scene semantic similarity and gradient geometric similarity to evaluate the joint conflict degree of the corresponding network parameter groups.
[0172] In this embodiment, the joint conflict degree is used to identify harmful interference that is semantically irrelevant and has conflicting gradient directions. The calculation is as follows:
[0173] c k =Avg(max(0,τ0-sim geo_k_m_n )*(1-sim sem_m_n ));
[0174] Among them, c k Let Avg be the joint conflict degree of the k-th parameter group, Avg be the operator that averages the values of all task pairs in the current batch, max be the maximum value function, and τ0 be a preset conflict threshold used to define the boundary for determining gradient direction conflicts. The specific value can be determined through validation set experiments based on the actual gradient distribution. In this embodiment, τ0 is set to 0. geo_k_m_n For gradient geometric similarity, sim sem_m_n This represents the semantic similarity between scenes.
[0175] Step 707: Based on the joint conflict degree, adaptively scale the outer loop step size or learning rate of the corresponding network parameter group.
[0176] The scaled outer loop step size or learning rate is then obtained and used for updating the group parameters of the corresponding parameter group in the outer loop update.
[0177] In this embodiment, a scaling factor is generated based on the joint conflict degree. The calculation formula is as follows:
[0178] α k =max(α min ,1-γ*ck );
[0179] Where, α k α is the scaling factor for the k-th parameter group. min The minimum scaling lower bound is set, for example, 0.1, and γ is the conflict adjustment coefficient. The scaling coefficient is multiplied by the original learning rate or outer loop step size to adaptively adjust the parameter update magnitude. This mechanism can suppress harmful gradient conflicts between semantically distant scenes while preserving beneficial differences between semantically similar scenes.
[0180] The following typical scenario illustrates the actual effect of the above mechanism. For typhoon warning tasks and torrential rain warning tasks, which belong to the extreme weather subclass, the semantic similarity of the scenarios is high (both belong to the nearest neighbor leaf nodes). Although there may be some conflict in the gradient directions of the two types of tasks, due to the moderating effect of scenario semantic similarity, the joint conflict degree calculated by the system is at a low level. This allows the outer loop step size of the corresponding parameter group to retain a large proportion of the update intensity, avoiding excessive pruning of normal feature differences between semantically similar tasks and preserving the model's ability to perceive the differences in traffic impact patterns of the two extreme weather events.
[0181] Example 8: Based on the above examples, this example describes how to construct a joint loss function that includes prediction loss and multiple structural constraint regularization terms, and how to solve the prediction lag problem in the abnormal mutation process by dynamically adjusting the smoothing constraint weights during the fine-tuning stage of the target abnormal scenario.
[0182] Before outputting the future traffic state prediction results, the process also includes a step of fine-tuning the network of the model performing the corresponding prediction operation for the target abnormal scenario. Specifically, this includes the following steps:
[0183] Step 801: Construct a joint loss function, which includes a prediction loss term for evaluating the prediction results of future traffic conditions, and a structure constraint regularization term containing a smoothing constraint term.
[0184] In this embodiment, the joint loss function is the overall objective function, used to guide model parameter optimization. Specifically, the prediction loss term measures the deviation between the model output and the actual observations, including a joint evaluation of vehicle speed and traffic operation index. The smoothing constraint term constrains the variation between adjacent prediction times to ensure the continuity of the prediction curve. The structural constraint regularization term further includes constraint components to guide the evolution of the dynamic graph. The specific calculation is as follows:
[0185] L total =L pred +λ sparse *L sparse +λ topo *L topo +λsmooth *L smooth ;
[0186] Among them, L total For the constructed joint loss function, L pred To predict the loss term, L sparse For sparse constraint terms, L topo For topological constraint terms, L smooth This is a smoothing constraint term. λ sparse , λ topo , λ smooth These are the weight coefficients for the corresponding constraint terms, used to balance the contribution of each term to model optimization.
[0187] λ sparse , λ topo , λ smooth These are the weight coefficients of the corresponding constraint terms, which can be determined through cross-validation on the validation set. In an optional implementation, the above coefficients can be initialized to 0.01, 0.01 and 0.01 respectively, and adaptively adjusted according to the order of magnitude of each loss term during actual training.
[0188] Step 802: In the transitional stage where the abnormal scenario of the target, indicated by the prior information of future events, induces a sharp change in traffic status, the constraint weights corresponding to the smoothing constraint terms are dynamically reduced or set to zero, so as to remove the numerical suppression of the smoothing constraint terms on the prediction and tracking of the sudden change process.
[0189] In this embodiment, the transition phase refers to a predetermined moment when traffic indicators experience a nonlinear sharp drop or rise, such as the period when a typhoon makes landfall causing the average road network speed to plummet from 50 km / h to 20 km / h. Since the smoothing constraint tends to penalize drastic numerical fluctuations, maintaining a high λ at this time... smooth This can lead to over-smoothing of prediction results, making it difficult to track the actual abrupt changes in a timely manner, resulting in prediction lag. Specifically, the system monitors the prediction gradient or historical deviation signal in real time. When abnormal abrupt change characteristics are identified, a weight control instruction is executed to adjust λ... smooth The value is dynamically reduced from the normal range (e.g., 0.01) to a preset weight lower limit (e.g., 0.001), or directly set to zero. In this way, the penalty for numerical changes imposed by the smoothing constraint is removed, allowing the model to sensitively capture sudden changes in traffic conditions.
[0190] In one optional implementation, the transition phase can be identified by calculating the difference between the moving average of the prediction error at the current moment and the historical average: when this difference exceeds a preset abrupt change detection threshold, it is determined that the current stage is in a transition phase and a weight reduction operation is triggered; alternatively, it can be achieved by monitoring the changes in traffic indicators between adjacent prediction steps, triggering a change when the rate of change in a single step exceeds a preset multiple of the historical normal fluctuation range. The preset abrupt change detection threshold can be determined through validation set experiments based on the historical speed fluctuation statistical characteristics of the target road network. The above-described abrupt change detection method is a conventional time series anomaly detection technique in the field, and an appropriate detection method can be selected according to the actual application scenario.
[0191] Step 803: Based on the joint loss function after weight adjustment, perform gradient fine-tuning on the model based on a small number of outlier samples.
[0192] Specifically, based on the joint loss function after weight adjustment, the model is fine-tuned by gradient adjustment based on a small number of abnormal samples pre-collected for the target abnormal scenario, resulting in a fine-tuned model for the target abnormal scenario, and the fine-tuned model is used to predict future traffic conditions.
[0193] In this embodiment, gradient fine-tuning refers to performing a small number of iterative updates based on the initial parameters obtained from meta-learning, using limited labeled samples collected under the target anomalous scenario. Since the joint loss function has already adjusted the weight distribution according to the mutation requirements, the model can preferentially fit the nonlinear fluctuation pattern induced by the anomalous event during the optimization process.
[0194] Furthermore, when the event-guided constrained incremental graph correction mechanism is enabled, the sparse constraint terms and topological constraint terms in the structural constraint regularization terms execute the following logic.
[0195] Step 804, sparse constraint term, is used to penalize the non-zero elements in the generated low-rank increment matrix with absolute values to suppress the over-denseness of the dynamic graph.
[0196] In this embodiment, the sparse constraint term is implemented by calculating the L1 norm of the low-rank increment matrix. The calculation is as follows:
[0197] L sparse =||ΔA t ||1;
[0198] Among them, L sparse For sparse constraint terms, ΔA t For the generated low-rank increment matrix, ||·||1 is the L1 norm operator. This term guides the model to generate physically meaningful sparse corrections, preventing the dynamic graph from degenerating into an unordered dense matrix.
[0199] Step 805, topological constraint term, used to penalize correction increments in the low-rank increment matrix that exceed the allowed neighborhood range based on static topological expansion, using a multi-hop allowed edge mask.
[0200] In this embodiment, the topological constraint term is used to force the graph correction behavior to be restricted to a preset topological neighborhood. The specific calculation logic is as follows:
[0201] L topo =||ΔA t *(1-M k )||1;
[0202] Among them, L topo For topological constraint terms, ΔA t M is a low-rank increment matrix. k Let be the k-hop allowed edge mask matrix constructed based on static topology, and * denote the positional multiplication operator for matrix elements. This term is defined by the mask allowable range (M). k The increment generated beyond the value of 1 (corresponding to 1-M) k A value of 1) applies a penalty to ensure that the correction result does not deviate from the constraints of the road network infrastructure.
[0203] Furthermore, in this embodiment, the smoothing constraint term L smooth The calculation formula is as follows:
[0204] ;
[0205] in, Let H be the traffic state prediction output for the t-th prediction time, where H is the total number of prediction time steps, and ||·||2 is the L2 norm operator.
[0206] According to one aspect of this application, a multimodal primitive learning-based traffic prediction system for anomalous events is provided. The system includes:
[0207] The data acquisition module is used to acquire multi-source heterogeneous correlation data of the target road network, prior information of future events, and pre-stored static adjacency matrix.
[0208] The latent representation extraction module is used to extract features from multi-source heterogeneous associated data to obtain a multimodal latent representation set. The multimodal latent representation set includes at least the traffic latent representation extracted from the traffic state sequence; specifically, the multimodal latent representation set includes the traffic latent representation extracted from the traffic state sequence and at least one other latent representation extracted from other modal data.
[0209] The graph structure determination module is used to generate dynamic edge weight components based on traffic implicit representation, and apply topological mask constraints to the dynamic edge weight components using the static adjacency matrix to determine the time-varying adjacency matrix of the target road network at this time. It further includes an optional event-guided local incremental correction submodule, which is used to perform low-rank incremental correction on the initial dynamic graph in abnormal event scenarios.
[0210] The propagation and fusion module is used to perform graph propagation operations on the traffic latent representation using a time-varying adjacency matrix to obtain enhanced spatial features, and then aggregates the enhanced spatial features with the remaining latent representations in the multimodal latent representation set to obtain fused node representations.
[0211] The condition prediction module is used to convert prior information of future events into a look-ahead condition representation, and then merge the look-ahead condition representation with the fused node representation to perform condition decoding prediction, outputting the future traffic state prediction results of the target road network.
[0212] Through logical connections and data transmission between modules, the system achieves closed-loop processing from raw perception data to traffic state prediction results in abnormal scenarios.
[0213] In this embodiment, an electronic device is also provided. The device includes at least one processor and a memory communicatively connected to the processor. The memory stores a computer program, which, when invoked and executed by the processor, implements any of the method steps in the multimodal primitive learning traffic prediction method for abnormal events described in Embodiments 1 to 8.
[0214] As an example, the processor may be a graphics processing unit (GPU) that supports parallel tensor operations or a dedicated neural network accelerator to accelerate matrix operations of graph neural networks, and the memory may include random access memory (RAM) and non-volatile auxiliary memory.
[0215] Furthermore, this embodiment provides a computer-readable storage medium storing executable instructions, i.e., a computer program, which, when executed by a processor, implements the aforementioned logical flow of a multimodal primitive learning traffic prediction method for abnormal events.
[0216] According to one aspect of this application, an alternative implementation of a multimodal primitive learning-based traffic prediction method for anomalous events is provided, comprising the following steps:
[0217] Collect and preprocess multi-source data, including historical traffic conditions, weather / environmental context, abnormal event indication information, time features, static node attributes, and road network static adjacency matrix;
[0218] Specialized encodings are applied to time features, traffic sequences, weather sequences, historical event sequences, and static node attributes to obtain multimodal implicit representations;
[0219] In the basic implementation, starting from the last-moment features of the encoded traffic branches, a time-varying adjacency matrix is learned by combining static topological constraints, and the traffic sequence is propagated through a graph. In the optional enhanced implementation, an event-guided constrained incremental graph correction mechanism can also be used.
[0220] The graph-enhanced traffic sequence, weather sequence, historical event sequence, and static node sequence are then fused to obtain a fused node representation.
[0221] The future event indication information and future time features are encoded and used as decoding conditions, which are then concatenated with the fusion node representation to output the future traffic status.
[0222] Transferable initialization is obtained through sequential meta-learning training, and fine-tuning is performed in a few rounds under the target abnormal scenario; in the optional enhancement implementation, the parameter grouping Reptile (a meta-learning algorithm) outer loop update and HS-GCAS (gradient conflict avoidance and suppression) conflict control mechanism can be further adopted.
[0223] To verify the effectiveness of the method of this invention, comparative experiments were conducted on an urban road network dataset containing data from periods of abnormal events such as typhoons and rainstorms. The results showed that during periods of abnormal events, the method of this invention improved the mean absolute error (MAE) compared to the static graph baseline method, and significantly improved the prediction and tracking accuracy of traffic state change peaks compared to the ablation model without look-ahead conditional decoding. Those skilled in the art will understand that the specific improvement may vary depending on the application scenario and the dataset.
[0224] This application addresses the bias caused by traditional prediction models' lack of predictive ability for future disturbances by acquiring prior information about future events and transforming it into a look-ahead conditional representation. In the spatial dimension, by performing low-rank incremental graph correction guided by event features and generating a time-varying adjacency matrix under the joint constraints of a static topological mask and a multi-hop neighborhood mask, it not only reduces the computational complexity of dynamic graph generation but also accurately characterizes the enhanced local road network associations caused by abnormal detours, avoiding physical distortion caused by excessive topological freedom. This solves the problem of drastic shifts in traffic evolution patterns under abnormal events.
[0225] Furthermore, this application employs a sequential meta-learning training strategy with parameter grouping and utilizes a scene semantic hierarchy tree to calculate the joint conflict degree between different tasks. It achieves adaptive scaling of the learning rate for each parameter group, effectively suppressing harmful gradient conflicts between semantically distant scenes while preserving beneficial differences in similar scenes. This allows the model to achieve rapid convergence during the fine-tuning phase, relying only on a small number of anomalous samples. Simultaneously, by dynamically adjusting the smoothing constraint weights at abrupt inflection points in traffic indicators, the lag effect of the regularization term on sudden numerical changes is eliminated, keeping the prediction errors of anomalous peaks and abrupt changes at a low level, thus improving the reliability of decision support for intelligent transportation systems under extreme conditions. This addresses the technical pain point of low model adaptation efficiency in anomalous scenarios.
[0226] It should be noted that the various specific technical features described in the above embodiments can be combined in any suitable manner without contradiction. To avoid unnecessary repetition, the present invention will not describe the various possible combinations separately.
Claims
1. A multimodal primitive learning-based traffic prediction method for anomalous events, characterized in that, include: Acquire multi-source heterogeneous correlation data of the target road network, prior information of future events, and pre-stored static adjacency matrix; Feature extraction is performed on multi-source heterogeneous correlation data to obtain a multimodal latent representation set, which includes at least the traffic latent representation extracted from traffic state sequences; Dynamic edge weight components are generated based on traffic implicit representation. Topological mask constraints are applied to the dynamic edge weight components using static adjacency matrix to determine the time-varying adjacency matrix of the target road network for this time period. The time-varying adjacency matrix is used to perform graph propagation operation on the traffic latent representation to obtain enhanced spatial features. These features are then aggregated with the remaining latent representations in the multimodal latent representation set to obtain a fused node representation. The prior information of future events is converted into a prospective conditional representation, which is then merged with the fusion node representation for conditional decoding and prediction, outputting the future traffic state prediction results of the target road network. The prior information of future events is converted into a lookahead conditional representation, and then merged with the fusion node representation for conditional decoding prediction, including: Extract future event indication information and future time features from the prior information of future events, and concatenate and map the two to generate a prospective conditional representation; Based on the preset prediction time step length, the fused node representation is expanded by temporal dimension replication to obtain the extended node representation; The forward conditional representation and the extended node representation are concatenated and merged into the decoder input features. The pre-configured conditional decoding module is then used to decode the decoder input features to obtain the future traffic state prediction results. The model that performs feature extraction, determines the time-varying adjacency matrix, and performs conditional decoding prediction is pre-trained through the following steps: The pre-collected and stored historical training samples are divided into multiple meta-task sequences in chronological order; The network parameters of the model are divided into a backbone feature parameter group for time series prediction, a structure correction parameter group for graph generation, and an event association parameter group for event encoding. The inner loop adapts and updates the data one by one using mini-batch samples from multiple meta-task sequences. When performing outer loop updates, group parameter updates based on parameter differences are performed independently according to the pre-configured outer loop step size of the main feature parameter group, the structure correction parameter group, and the event association parameter group. The inner loop adaptation update is performed sequentially using mini-batch samples from multiple meta-task sequences, including: For any given meta-task sequence, its internal samples are divided into a support set and a query set according to a preset ratio; The support set and the query set are combined to form a mini-batch fitting sample; Based on the current shared parameters of the model, the inner loop calculation is performed using a small batch of adapted samples to obtain the task-level adapted parameters, and the prediction error signal corresponding to the query set is used to evaluate the effect of the inner loop adaptation update, thereby supporting the subsequent outer loop update process.
2. The method according to claim 1, characterized in that, Acquire multi-source heterogeneous association data of the target road network, prior information on future events, and a pre-stored static adjacency matrix, including: Acquire multi-source heterogeneous correlation data, which includes traffic state sequences, environmental context sequences, historical event indication sequences, historical time features, and static node attributes of the target road network within the historical observation period; Acquire prior information about future events, including indications of future events within the target prediction period and future time characteristics; Obtain the pre-stored static adjacency matrix, which contains directly connected edges constructed based on physical connectivity, as well as non-directly connected redundant edges pre-supplemented based on preset correlation rules.
3. The method according to claim 1, characterized in that, Determine the time-varying adjacency matrix of the target road network for this time segment, including any of the following determination methods: The first determination method is to directly determine the graph structure obtained by applying topological mask constraints to the dynamic edge weight components using the static adjacency matrix as the time-varying adjacency matrix. The second determination method is to use the graph structure obtained by applying topological mask constraints to the dynamic edge weight components using the static adjacency matrix as the initial dynamic graph, and to use the extracted event-guided features to perform local incremental correction on the initial dynamic graph, and to determine the corrected graph structure as the time-varying adjacency matrix.
4. The method according to claim 3, characterized in that, Dynamic edge weight components are generated based on traffic implicit representation, including: Extract the corresponding node-level features from the traffic latent representation; For node pairs with connected edges in the static adjacency matrix, extract and concatenate the corresponding node-level features, and input the concatenation result into a pre-configured feature mapping network to output scalar edge weights; The calculated scalar edge weights for each node are spatially assembled to obtain dynamic edge weight components.
5. A multimodal primitive learning traffic prediction system for abnormal events, characterized in that, For performing the method as described in claim 1, comprising: The data acquisition module is used to acquire multi-source heterogeneous correlation data of the target road network, prior information of future events, and pre-stored static adjacency matrix; The latent representation extraction module is used to extract features from multi-source heterogeneous associated data to obtain a multimodal latent representation set, which includes at least the traffic latent representation extracted from traffic state sequences. The graph structure determination module is used to generate dynamic edge weight components based on traffic implicit representation, apply topological mask constraints to the dynamic edge weight components using the static adjacency matrix, and determine the time-varying adjacency matrix of the target road network for this period. The propagation and fusion module is used to perform graph propagation operations on the traffic latent representation using the time-varying adjacency matrix to obtain enhanced spatial features, and then aggregates them with the remaining latent representations in the multimodal latent representation set to obtain fused node representations. The condition prediction module is used to convert prior information of future events into a prospective condition representation, and then merge it with the fusion node representation to perform conditional decoding prediction, outputting the future traffic state prediction results of the target road network.
6. An electronic device, characterized in that, It includes a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the multimodal primitive learning traffic prediction method for abnormal events as described in any one of claims 1 to 4.
7. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the multimodal primitive learning traffic prediction method for abnormal events as described in any one of claims 1 to 4.