A road node traffic flow clustering and prediction method based on semantic similarity

CN122511087APending Publication Date: 2026-08-04UNIV OF ELECTRONICS SCI & TECH OF CHINA
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
UNIV OF ELECTRONICS SCI & TECH OF CHINA
Filing Date
2026-05-06
Publication Date
2026-08-04

AI Technical Summary

Technical Problem

本发明的出发点在于指出二者的潜在不足:前者灵活性不足,后者可解释性与结构先验利用不足

Benefits of technology

[0014] The beneficial effects of this invention are as follows: By analyzing the semantic similarity between road nodes, the method of this invention clusters and models traffic flow data, thereby more accurately capturing local and global spatiotemporal dependencies and significantly improving the accuracy and robustness of traffic flow prediction models. By introducing a spatial attention mechanism based on semantic similarity, the model can overcome the limitations of traditional physical adjacency relationships, intelligently identifying and aggregating node information with similar traffic patterns. This design enables the model to more accurately characterize the complex, non-local spatial dependencies in urban road networks, establishing effective connections even between spatially non-adjacent but functionally similar areas, thus achieving a deeper understanding of the global spatial structure.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122511087A_ABST
    Figure CN122511087A_ABST
Patent Text Reader

Abstract

This invention belongs to the field of intelligent transportation and artificial intelligence technology, specifically disclosing a method for traffic flow clustering and prediction based on semantic similarity of road nodes. The steps include: road traffic data modeling, node semantic vector construction, semantic similarity matrix calculation, semantic mask matrix construction, a spatial attention mechanism based on the semantic mask, and clustering and prediction output. This method analyzes the semantic similarity between road nodes to cluster and model traffic flow data, thereby more accurately capturing local and global spatiotemporal dependencies and improving the accuracy and robustness of traffic flow prediction. This technology can be widely applied in urban traffic management, route planning, congestion early warning, and other fields, providing core decision support for intelligent transportation systems.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the fields of intelligent transportation and artificial intelligence technology, specifically to a method for clustering and predicting traffic flow at road nodes based on semantic similarity. Background Technology

[0002] In traffic flow prediction research, deep learning-based models have become mainstream, especially those methods that can effectively capture spatiotemporal dependencies. The following two existing techniques represent current advanced approaches in the field of deep learning-based traffic flow prediction aimed at capturing complex spatiotemporal dependencies.

[0003] 1) Spatiotemporal Modeling Approaches Based on Graph Convolutional Networks: These techniques explicitly model traffic networks as graph structures, where nodes represent sensors or road intersections, and edges represent road connections or spatial proximity relationships. The core idea is to utilize Graph Convolutional Networks (GCNs) or their variants (such as diffusing convolutions) to explicitly capture the spatial dependencies of non-Euclidean structures within the network. Typical models include Spatiotemporal Graph Convolutional Networks (STGCNs) and Graph WaveNets. These models are typically composed of stacked spatiotemporal convolutional blocks. Within each block, graph convolutional layers aggregate information from topological neighbor nodes to learn the spatial characteristics of the nodes; subsequently, standard 1D convolutional or recurrent neural network layers (such as TCNs and GRUs) capture the temporal dynamics of the nodes themselves. This alternating structure of "graph convolution + temporal modeling" can simultaneously process spatiotemporal information.

[0004] 2) Dynamic Relationship Modeling Methods Based on Attention Mechanisms: These techniques recognize that the influence between nodes is dynamic, non-local, and has varying weights. Therefore, they introduce attention mechanisms (especially self-attention mechanisms) to dynamically learn the strength of associations between nodes without relying on a fixed graph structure. Typical models are Transformer-based spatiotemporal prediction models (such as ASTGCN, ST-Traffic Transformer) and dynamic graph convolutional networks. These models calculate attention scores between all pairs of nodes, derived from the weights used to adaptively allocate aggregated information. For example, in the spatial dimension, a node can "attention" to any other node in the entire network that is useful for its prediction, regardless of whether they are physically adjacent; in the temporal dimension, it can focus on the importance of different time steps in history. This allows it to capture long-range spatial dependencies and non-linear temporal patterns.

[0005] The two background technologies mentioned above represent two mainstream approaches: one utilizes prior topological structures, and the other utilizes dynamic weights driven by all data. The starting point of this invention is to point out the potential shortcomings of both: the former lacks flexibility, and the latter lacks interpretability and sufficient utilization of prior structural information. Existing technologies mainly suffer from two disconnects: first, a disconnect between feature extraction and relation modeling, where models either rely on fixed graph structures or implicitly learn all relations from data, lacking an explicit and interpretable "semantic relation" extraction step; second, a disconnect between the model and prior knowledge, where domain knowledge such as "similar morning rush hour inflow patterns in commercial areas" is difficult to systematically inject into the data-driven model. When encountering nodes that are "spatially discrete but have similar patterns," existing methods struggle to establish effective information interaction due to the lack of explicit semantic association guidance, leading to decreased prediction performance. Summary of the Invention

[0006] To address the problems existing in the prior art, this invention provides a road node traffic flow clustering and prediction method based on semantic similarity. This method analyzes the semantic similarity between road nodes to cluster and model traffic flow data, thereby more accurately capturing local and global spatiotemporal dependencies and improving the accuracy and robustness of traffic flow prediction. This technology can be widely applied in urban traffic management, route planning, congestion early warning, and other fields, providing core decision support for intelligent transportation systems and solving the problems mentioned in the background.

[0007] To achieve the above objectives, the present invention provides the following technical solution: a method for clustering and predicting traffic flow at road nodes based on semantic similarity, comprising the following steps: Step 1: Road traffic data modeling; Step 2: Constructing node semantic vectors; Step 3: Calculate the semantic similarity matrix; Step 4: Construct the semantic mask matrix; Step 5: Spatial attention mechanism based on semantic masking; Step 6: Clustering and Prediction Output.

[0008] Preferably, in step S1, the urban road network is represented as a graph structure. , where V is the set of road nodes, E is the road connection relationship, and A is the adjacency matrix; each node contains traffic speed, flow rate, and time feature vectors.

[0009] Preferably, in step S2, the semantic features of the nodes are extracted using a multilayer perceptron (MLP), and the node embedding representation is generated using the historical traffic state vector within the time window. This reflects the semantic attributes of the road. d Indicates the dimension of the embedding vector.

[0010] Preferably, in step S3, the semantic similarity between nodes is calculated using Fast Fourier Transform (FFT) or cosine similarity, as expressed in the following formula: ,in Sim ( i , j ) represents a node With nodes Semantic similarity between them Represents a node semantic embedding vector, Representing vectors Norm.

[0011] Preferably, in step S4, based on the set threshold The similarity matrix is ​​masked to generate a semantic mask matrix. , N This represents the mask value that exists between any two nodes, when hour, Otherwise, it is 0.

[0012] Preferably, in step S5, a semantic mask M is introduced into the spatial attention calculation of the Transformer, so that attention only propagates between nodes with high semantic similarity. The attention weight calculation formula is as follows: This enhances the interaction strength between semantically related nodes. Represents a node For nodes Spatial attention weights, i.e., node attention weights Traffic status information for predicting nodes The importance of the future state; Represents a node The query vector is composed of nodes. The features are obtained through a linear transformation, with dimensions of . ; Represents a node The key vector. Represents the key vector transpose; Represents the semantic mask matrix The Middle Line number Column elements; Indicates to Take the natural logarithm; d Indicates the dimension of the embedding vector.

[0013] Preferably, in step S6, highly similar nodes are clustered using spectral clustering or K-means to generate semantic traffic sub-regions, and the attention output of each sub-region is used to predict future traffic flow status through a convolutional mapping layer.

[0014] The beneficial effects of this invention are as follows: By analyzing the semantic similarity between road nodes, the method of this invention clusters and models traffic flow data, thereby more accurately capturing local and global spatiotemporal dependencies and significantly improving the accuracy and robustness of traffic flow prediction models. By introducing a spatial attention mechanism based on semantic similarity, the model can overcome the limitations of traditional physical adjacency relationships, intelligently identifying and aggregating node information with similar traffic patterns. This design enables the model to more accurately characterize the complex, non-local spatial dependencies in urban road networks, establishing effective connections even between spatially non-adjacent but functionally similar areas, thus achieving a deeper understanding of the global spatial structure. Attached Figure Description

[0015] Figure 1 This is a schematic diagram illustrating the steps of a traffic flow clustering and prediction method for road nodes based on semantic similarity. Figure 2 This is a schematic diagram of the overall system framework for a road node traffic flow clustering and prediction method based on semantic similarity; Figure 3 This is a comparison chart of ablation experiment results. Detailed Implementation

[0016] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0017] This invention provides a technical solution: a method for clustering and predicting traffic flow at road nodes based on semantic similarity, the overall steps of which are as follows: Figure 1 As shown, it specifically includes the following: Step 1: Road traffic data modeling, representing the urban road network as a graph structure. , where V is the set of road nodes, E is the road connection relationship, and A is the adjacency matrix. Each node contains traffic speed, flow rate, and time feature vectors.

[0018] Step 2: Node semantic vector construction. Multilayer perceptron (MLP) is used to extract node semantic features, and node embedding representations are generated using historical traffic state vectors within a time window. This reflects the semantic attributes of the road.d Indicates the dimension of the embedding vector.

[0019] Step 3: Semantic similarity matrix calculation. The semantic similarity between nodes is calculated using either Fast Fourier Transform (FFT) or cosine similarity. .in Sim ( i , j ) represents a node With nodes Semantic similarity between them Represents a node semantic embedding vector, Representing vectors Norm.

[0020] Step 4: Construct the semantic mask matrix based on the set threshold. The similarity matrix is ​​masked to generate a semantic mask matrix. , N This represents the mask value that exists between any two nodes, when hour, Otherwise, it is 0.

[0021] Step 5: A semantic mask-based spatial attention mechanism is introduced into the spatial attention calculation of the Transformer, ensuring that attention propagates only between nodes with high semantic similarity. The attention weight calculation formula is as follows: This enhances the interaction strength between semantically related nodes. Among them, Represents a node For nodes Spatial attention weights, i.e., node attention weights Traffic status information for predicting nodes The importance of the future state; Represents a node The query vector is composed of nodes. The features are obtained through a linear transformation, with dimensions of . ; Represents a node The key vector. Represents the key vector transpose; Represents the semantic mask matrix The Middle Line number Column elements; Indicates to Take the natural logarithm; d Indicates the dimension of the embedding vector.

[0022] Step 6: Clustering and Prediction Output. High-similarity nodes are clustered using spectral clustering or K-means to generate semantic traffic sub-regions. The attention output of each sub-region is then used to predict future traffic flow states through a convolutional mapping layer.

[0023] The method of this invention can be deployed in intelligent transportation data centers. By collecting data from traffic sensors, floating cars, or cameras in real time, it performs semantic modeling and clustering of traffic features of road nodes, realizing semantic sub-region division and prediction of urban road networks. Experimental results show that compared with traditional GNN and standard Transformer models, the method of this invention reduces the average prediction error by about 12%, and has higher interpretability and stability in high-dimensional complex traffic environments.

[0024] On the other hand, based on the proposed semantic similarity-based road node traffic flow clustering and prediction method, this invention is implemented through a complete intelligent traffic analysis business system. This system constructs an end-to-end business process from data input to decision support, deeply integrating advanced algorithmic cores with intuitive business operations to form a complete analytical closed loop. The overall system architecture is as follows: Figure 2 As shown, the core lies in an independent semantic feature extraction and enhancement module. The processing flow of this module is decoupled from the downstream prediction model. Its input is the raw traffic data, and its output is a semantic similarity matrix or mask. This output can be used as enhancement information input to any baseline prediction model.

[0025] System operations begin with integrated data modeling and parameter configuration. Business personnel can easily upload standardized data files containing road network structure, historical traffic flow, and speed data, or directly configure connections to real-time traffic data streams through the system's unified data access panel. Once the data is ready, users can intuitively set analysis dimensions through an interactive parameter configuration interface: adjusting semantic similarity thresholds via sliders to control clustering granularity, from identifying micro-level congestion points to dividing macro-level traffic pattern zones; switching between business scenarios such as "real-time monitoring" and "deep analysis" via the mode selector, with the system automatically matching the optimal algorithm combination; and saving frequently used configurations as business templates for rapid reproduction of high-frequency analysis tasks. This step transforms complex algorithm parameters into intuitively understandable operational instructions for business personnel, laying the foundation for subsequent analysis.

[0026] After the configuration is completed, the system automatically performs core calculations and enters the semantic clustering analysis and partition management stage. First, the system generates "semantic traffic sub-areas" based on patented methods and displays the analysis results through dual-view linkage. In the map view, different clustering areas are distinguished by distinct color blocks, intuitively presenting the traffic function partition pattern of the urban road network. At the same time, the statistical dashboard on the right dynamically displays in-depth metrics of the selected area, such as average vehicle speed, flow peak-valley characteristics, congestion frequency, etc., to help business personnel quickly identify areas with clear management significance, such as "commuting corridors", "commercial hotspots", "logistics channels", etc. The system also provides a multi-area comparison function, supporting the juxtaposition and comparison of traffic characteristic curves of different clustering areas, providing accurate data support for specific management decisions such as tidal lane setting, bus line optimization, and inspection resource allocation.

[0027] Based on the clustering partition, the system enters the real-time prediction and dynamic monitoring and warning stage, transforming the prediction ability of the algorithm into forward-looking business insights. In the prediction and deduction view, the system displays the evolution trend of the road network state in the next two hours in the form of a dynamic heat map, helping commanders anticipate the origin, diffusion path, and dissipation nodes of congestion. For key monitored sections, the system provides an independent prediction dashboard. When it is predicted that a specific section is about to reach the congestion threshold, a multi-level warning mechanism is automatically triggered, and through the message channel integrated in the system, the warning information is pushed to relevant traffic management terminals in real time, supporting the rapid activation of plans such as signal timing adjustment and diversion induction. All prediction results are continuously compared with actual data to form a feedback loop for model optimization.

[0028] The final link of the analysis process is intelligent report generation and decision support. After the analysis is completed, the system automatically integrates the results of the entire process and generates a structured multi-dimensional business report at the click of a button. The report not only includes standard content such as a summary of core findings, key indicator statistics, and prediction accuracy assessment, but also generates customized management recommendations based on the analysis results, such as "it is recommended to take dynamic flow-limiting measures during the evening peak period at the A-B connection section". The report can be exported in a standard document format and directly used for management reporting, plan preparation, and cross-departmental collaboration. At the same time, the system supports publishing semantic partition layers, prediction results, etc. generated by the analysis in the form of standardized data services, achieving seamless docking with the urban traffic command platform and digital twin system, and promoting the implementation of data-driven decision-making on a wider scale.

[0029] Through the organic integration and intelligent collaboration of these four links, the system of the present invention successfully transforms patented technology innovation into a traffic management combat platform oriented to business, intuitive in operation, and intelligent in decision-making, realizing the value closed-loop from data to insight and from insight to action, and providing an efficient and reliable digital solution for modern urban traffic governance.

[0030] Such as Figure 3As shown, ablation experiments demonstrate that the proposed full model (LSTFormer FullVersion) achieves optimal performance on traffic flow prediction tasks. In contrast, the variant model with the spatial semantic mask module removed (w / o Spatial Mask, No) performs poorly. The performance of the model showed a significant decline, with a rise in prediction error. For example, the root mean square error (RMSE) was 30.60 for the complete model, but increased to 32.10 after removing the semantic mask, a relative increase of approximately 4.9%. This comparison directly verifies the positive contribution of the semantic mask module to the overall model's prediction accuracy, demonstrating that the explicit semantic similarity-guided spatial attention mechanism can effectively enhance the accuracy of information aggregation between nodes, suppress noise interference from low-relevance nodes, and thus improve the robustness and reliability of traffic flow prediction.

[0031] The semantic extraction provided by the system module, along with the relationships learned by the benchmark model itself (such as attention weights or graph convolutional filtering), forms a synergy between "explicit semantic guidance" and "implicit data-driven approach." Experiments show that this synergy produces a "1+1>2" effect. We conducted systematic validation on multiple public datasets and various benchmark models. After introducing this module, models with different architectures all achieved significant and consistent performance improvements, strongly demonstrating the universal value and effectiveness of this module's innovation, and proving it is not merely a tuning for a specific scenario.

[0032] Ultimately, these innovative modules work collaboratively through a heterogeneous attention fusion mechanism, enabling the model to simultaneously consider multi-level features, including global and local, temporal and spatial, and physical and semantic connections. Experimental results on multiple real-world traffic datasets demonstrate that this invention consistently achieves leading performance in both single-step and multi-step prediction tasks, providing more reliable technical support for applications such as traffic management, congestion warning, and route planning in intelligent transportation systems.

[0033] It should be noted that, in this document, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Unless otherwise specified, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.

[0034] The terminology used in the embodiments of this invention is for the purpose of describing particular embodiments only and is not intended to limit the invention. The singular forms “a,” “the,” and “the” as used in the embodiments of this invention and the appended claims are also intended to include the plural forms unless the context clearly indicates otherwise.

[0035] It should be understood that the term "and / or" used in this article is merely a description of the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A existing alone, A and B existing simultaneously, and B existing alone. Additionally, the character " / " in this article generally indicates that the preceding and following related objects have an "or" relationship.

[0036] Depending on the context, the word "if" as used here can be interpreted as "when," "when," "in response to determination," or "in response to detection." Similarly, depending on the context, the phrase "if determination" or "if detection (of the stated condition or event)" can be interpreted as "when determination," "in response to determination," "when detection (of the stated condition or event)," or "in response to detection (of the stated condition or event)."

[0037] Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art can still modify the technical solutions described in the foregoing embodiments or make equivalent substitutions for some of the technical features. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the protection scope of the present invention.

Claims

1. A method for clustering and predicting traffic flow at road nodes based on semantic similarity, characterized in that, Includes the following steps: Step 1: Road traffic data modeling; Step 2: Constructing node semantic vectors; Step 3: Calculate the semantic similarity matrix; Step 4: Construct the semantic mask matrix; Step 5: Spatial attention mechanism based on semantic masking; Step 6: Clustering and Prediction Output.

2. The road node traffic flow clustering and prediction method based on semantic similarity according to claim 1, characterized in that: In step S1, the urban road network is represented as a graph structure. , where V is the set of road nodes, E is the road connection relationship, and A is the adjacency matrix; each node contains traffic speed, flow rate, and time feature vectors.

3. The road node traffic flow clustering and prediction method based on semantic similarity according to claim 1, characterized in that: In step S2, semantic features of nodes are extracted using a multilayer perceptron (MLP), and node embedding representations are generated using historical traffic state vectors within a time window. This reflects the semantic attributes of the road.

4. The road node traffic flow clustering and prediction method based on semantic similarity according to claim 1, characterized in that: In step S3, the semantic similarity between nodes is calculated using Fast Fourier Transform (FFT) or cosine similarity, as expressed in the following formula: ,in Sim ( i , j ) represents a node With nodes Semantic similarity between them Represents a node The semantic embedding vector.

5. The road node traffic flow clustering and prediction method based on semantic similarity according to claim 1, characterized in that: In step S4, based on the set threshold The similarity matrix is ​​masked to generate a semantic mask matrix. ,when hour, Otherwise, it is 0.

6. The road node traffic flow clustering and prediction method based on semantic similarity according to claim 1, characterized in that: In step S5, a semantic mask M is introduced into the spatial attention calculation of the Transformer, so that attention only propagates between nodes with high semantic similarity. The formula for calculating the attention weight is: This enhances the interaction strength between semantically related nodes.

7. The road node traffic flow clustering and prediction method based on semantic similarity according to claim 1, characterized in that: In step S6, highly similar nodes are clustered using spectral clustering or K-means to generate semantic traffic sub-regions. The attention output of each sub-region is then used to predict future traffic flow status through a convolutional mapping layer.