Highway tunnel congestion identification method based on dynamic graph prototype contrast learning

By combining radar and video surveillance data and using a dynamic graph prototype contrastive learning model for tunnel traffic status recognition, the problem of insufficient granularity and stability of existing tunnel traffic congestion recognition methods has been solved, achieving a detailed characterization and efficient recognition of vehicle behavior within tunnels.

CN121010951BActive Publication Date: 2026-03-03CHONGQING UNIV +1
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202511544548.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-10-28
Publication Date
2026-03-03
Estimated Expiration
2045-10-28

AI Technical Summary

Technical Problem

Existing methods for identifying traffic congestion in tunnels lack sufficient detail, have inadequate modeling of vehicle dynamic interactions, and exhibit poor stability in identification results, making them unsuitable for highway tunnels.

Method used

Vehicle data is collected by combining radar and video surveillance. Microscopic vehicle behavior is modeled through a dynamic graph prototype contrast learning model. By combining graph data augmentation module and prototype contrast learning module, the microscopic behavior of vehicles and their spatiotemporal evolution patterns are captured. A lightweight classifier is designed to identify tunnel traffic conditions.

Benefits of technology

It achieves precise identification of tunnel traffic congestion, improves the stability and accuracy of the identification results, and can effectively capture the dynamic interaction and spatiotemporal relationship between vehicles in complex tunnel environments, providing a novel research approach for tunnel traffic management.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121010951B_ABST
    Figure CN121010951B_ABST
Patent Text Reader

Abstract

The present application belongs to the technical field of tunnel traffic management, and discloses a highway tunnel congestion identification method based on dynamic graph prototype contrast learning. The method can integrate micro behaviors of vehicles at different times and dynamic interaction information thereof, capture complex space-time relationships and long-term evolution dependencies between vehicles, thereby extract multi-level traffic evolution features, and realize effective identification of tunnel congestion. The present application also proposes a dynamic graph prototype contrast learning model DGPCL. Experiments based on real tunnel radar and vision fusion data show that DGPCL is superior to the existing optimal method in various traffic state identification tasks. The proposed strategy effectively solves the deficiencies of existing methods in micro vehicle interaction modeling and space-time feature extraction, provides a new technical reference for highway tunnel congestion identification research, and has high theoretical and application value.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of tunnel traffic management technology, specifically relating to a method for identifying congestion in highway tunnels based on dynamic graph prototype comparison learning. Background Technology

[0002] Tunnels are a crucial component of mountainous highway networks. In China, the number of highway tunnels has grown rapidly over the past three decades, from 130 at the end of 1990 to 28,724 at the end of 2024. This large-scale construction has effectively solved the problem of limited road alignment in complex terrain, significantly improving the connectivity and transportation efficiency of mountainous highways. However, with the continuous increase in tunnel mileage, tunnel traffic congestion has become increasingly prominent, bringing a series of urgent safety and environmental risks. First, the relatively enclosed space of tunnels makes them highly susceptible to chain-reaction accidents such as rear-end collisions during congestion, making accident handling and rescue far more difficult than on ordinary roads. Second, frequent vehicle deceleration and even prolonged stops within tunnels not only increase fuel consumption but also prevent effective dispersion of exhaust fumes, creating high-concentration pollution "dead zones" inside the tunnels, seriously threatening the health of drivers and passengers. Third, large-scale congestion within tunnels drastically reduces vehicle evacuation efficiency, obstructing emergency vehicle and personnel passageways, delaying crucial rescue time, and further amplifying safety risks. Therefore, accurately and promptly identifying tunnel traffic congestion has become a key aspect of ensuring traffic safety, improving road operation efficiency, and supporting emergency management.

[0003] Current research primarily focuses on congestion identification in urban traffic or on ordinary highways, largely relying on data such as macroscopic traffic flow, average speed, or video monitoring. However, these methods have several shortcomings in tunnel scenarios: firstly, their granularity is relatively coarse, making it difficult to effectively capture the complex interactions between vehicles inside the tunnel; secondly, the complex environment inside tunnels means that data from a single sensor is often susceptible to interference from lighting, ventilation, and monitoring conditions, leading to insufficient stability in the identification results. Therefore, how to propose a method that can more precisely characterize vehicle behavior and effectively identify traffic congestion in the specific scenario of tunnels has become a crucial technical problem that urgently needs to be solved. Summary of the Invention

[0004] In view of this, the purpose of this invention is to provide a method for identifying congestion in highway tunnels based on dynamic graph prototype contrastive learning, which aims to solve the problems of insufficient granularity, insufficient modeling of vehicle dynamic interaction, poor stability of identification results, and unsuitability for highway tunnels in existing congestion identification methods.

[0005] This invention provides a method for identifying highway tunnel congestion based on dynamic graph prototype contrastive learning, comprising the following steps:

[0006] S1. Vehicle data inside highway tunnels is collected using a combination of radar and video surveillance.

[0007] S2. Preprocess the vehicle data collected in the highway tunnel in step S1 to generate vehicle trajectory time series data;

[0008] S3. Construct a dynamic graph prototype comparative learning model;

[0009] The dynamic graph prototype contrastive learning model includes a graph data augmentation module and a prototype contrastive learning module.

[0010] Graph data augmentation module: used to achieve fine-grained modeling of microscopic vehicle behavior;

[0011] Prototype Comparison Learning Module: Used to capture the microscopic behavior of vehicles in the tunnel and their spatiotemporal evolution patterns, while providing high-quality embeddings for subsequent prototype comparison learning;

[0012] S4. Design a downstream classification task for tunnel traffic conditions with an additional lightweight classifier to evaluate the separability and discriminative ability of the representations learned by the dynamic graph prototype contrastive learning model.

[0013] S5. Input the vehicle trajectory time series data preprocessed in step S2 into the dynamic graph prototype contrastive learning model constructed in step S3, and then input the features extracted by the dynamic graph prototype contrastive learning model into a lightweight classifier to finally obtain the traffic status of the highway tunnel.

[0014] Furthermore, the vehicle trajectory time series data in step S2 includes: a unique record number, a timestamp, a unique vehicle identifier, the vehicle type, the latitude and longitude coordinates of the vehicle's location, the instantaneous speed, the vehicle's heading angle, and the lane number of the vehicle; wherein, the unique record number is used to identify each vehicle trajectory.

[0015] Furthermore, the design of the graph data enhancement module in step S3 is as follows:

[0016] I. The graph data augmentation module takes vehicle trajectory time series data as input and converts it into a graph structure;

[0017] At each time step , construct graph ;in, This represents all vehicle nodes within the tunnel observation area at that time step; This indicates the Nth time step within the tunnel observation area. t Vehicle node; N t Indicates the number of vehicles; Indicates the spatial proximity between vehicles; This is a vehicle feature matrix, where each row contains speed, acceleration, position, heading angle, and lane number; For each vehicle, a feature dimension is defined; within a fixed time interval. Inner uniform sampling each discrete time step To form a dynamic graph sequence ;

[0018] II. Based on step I, two graph augmentation strategies are introduced to generate different views in order to improve the robustness of the model to disturbances;

[0019] The first strategy is to discard nodes, which is used to improve the robustness of the model when node information is incomplete.

[0020] By random discard ratio For the original image The vehicle nodes and their corresponding edges in the graph are sampled to obtain the augmented graph. ;

[0021]

[0022]

[0023]

[0024]

[0025] In the formula, The augmented graph obtained after the node discarding operation consists of a set of nodes. Edge set and characteristic matrix composition; It is a set of randomly sampled nodes. A subset of, and the number of its nodes, Indicates rounding down; To enhance the set of nodes in the graph, it is to start from the original set of nodes in the graph. Remove random sampling node set The set of nodes after; To enhance the edge set in the graph, it is to start from the original graph edge set. The two endpoints are selected from the middle. The edges in; To enhance the vehicle feature matrix in the image, it is derived from the original vehicle feature matrix. Selecting from The row corresponding to the node;

[0026] The second strategy is feature perturbation, which is used to improve the robustness of the model to changes in node features.

[0027] For the node feature matrix at each time step Add Gaussian noise And through the mask matrix Controlling the disturbance range and generating an enhancement map ;

[0028]

[0029]

[0030] In the formula, This indicates element-wise multiplication; To control noise intensity; It follows a mean of 0 and a covariance matrix of . The distribution is Gaussian; I is the identity matrix, used to add noise to the node feature matrix; Let be the probability of perturbation.

[0031] Furthermore, the prototype comparison learning module in step S3 is designed as follows:

[0032] The prototype contrastive learning module enhances the graph. and As input, the prototype contrastive learning module has a built-in spatiotemporal encoder, which includes a dynamic graph convolutional network Evolve-GCN and a Transformer encoder;

[0033] I. The Evolve-GCN dynamic graph convolutional network is used to capture the microscopic behavior of vehicles inside tunnels;

[0034] Evolve-GCN, a dynamic graph convolutional network, dynamically updates the weight matrix of each layer through a recursive structure. It integrates current node information with historical information:

[0035]

[0036] The updated weight matrix is ​​combined with the adjacency matrix of the current graph. With node embedding Execution graph convolution:

[0037]

[0038] The adjacency matrix consists of the set of vehicle nodes. Set of adjacent edges in space Build:

[0039]

[0040] The initial node embeddings are used as the input feature matrix. After passing through multiple graph convolutions, the node embeddings are aggregated into graph-level vectors through pooling layers.

[0041]

[0042] II. Transformer encoders are used for embedding graph sequences. Perform time-series modeling to uncover dynamic evolution patterns among vehicles;

[0043] The Transformer encoder utilizes a multi-head self-attention mechanism to globally model the graph embedding of the entire sequence. It can identify the interaction features of key vehicles at different time steps and assign dynamic weights based on their temporal importance, thereby uncovering temporal dependencies.

[0044]

[0045] In the formula, Indicates at time step At that time, after The context-enhanced representation obtained by the encoder includes not only the graph embedding information of the current time step. It also incorporates graph embedding information from other time steps. ; Indicates the current time step Image embedding information; Indicates other time steps Image embedding information;

[0046] After Transformer encoding, the hidden vectors at all time steps After fusion through fully connected layers, the final representation vector is obtained:

[0047]

[0048] in, The final representation vector is the embedding generated by the space-time encoder; FC represents the fully connected layer operation; Concat represents the concatenation operation;

[0049] Prototype Contrastive Learning (PCL) is introduced to discover potential traffic evolution patterns through self-supervised learning and enhance the discriminative power of the encoder embedding. PCL first generates prototypes for each potential pattern using a clustering algorithm. :

[0050]

[0051] Each sample embedding The original prototype The positive prototype is the closest prototype in the embedding space, and the negative prototype is the rest of the prototypes. PCL improves the discriminativeness of embeddings by optimizing the prototype contrast loss, making the same pattern embeddings closer to the positive prototype and farther away from the negative prototype.

[0052]

[0053] In the formula, The prototype-based comparison loss function; K is the number of prototypes; For temperature parameters;

[0054] In addition, multi-view embeddings generated by combining graph data augmentation PCL further enhances the encoder's robustness to disturbances through contrastive learning, enabling the encoder to stably capture traffic evolution patterns even when nodes are missing or feature noise is present.

[0055] Furthermore, in step S4, the downstream classification task of tunnel traffic status is designed as follows:

[0056] In the downstream classification task of tunnel traffic conditions, the pre-trained spatiotemporal encoder remains in a fixed state and is used as a feature extractor to extract representations from the graph time series. A lightweight classifier is then added via a fully connected layer to predict the tunnel's traffic status within the current time window; the classification head outputs the prediction results:

[0057]

[0058] In the formula, This is the weight matrix. ; For bias vectors, ; d represents the number of predefined traffic state categories; d represents the dimension.

[0059] Furthermore, the lightweight classifier is trained using the cross-entropy loss function:

[0060]

[0061] In the formula, One-hot encoding of the real label. For category The predicted probability.

[0062] Beneficial effects:

[0063] This invention fully considers the characteristics of vehicle trajectory data in highway tunnel scenarios and proposes a Dynamic Graph Prototype Comparative Learning (DGPCL) model. This method integrates the microscopic behavior and dynamic interaction information of vehicles at different times, capturing the complex spatiotemporal relationships and long-term evolutionary dependencies between vehicles, thereby extracting multi-level traffic evolution features and achieving effective identification of tunnel congestion. Experiments based on real tunnel radar-visual fusion data show that DGPCL outperforms existing state-of-the-art methods in various traffic state identification tasks. The proposed strategy effectively addresses the shortcomings of existing methods in microscopic vehicle interaction modeling and spatiotemporal feature extraction, providing a new technical reference for highway tunnel congestion identification research. Comparative experiments, ablation experiments, and case studies demonstrate that the model exhibits high recognition performance and can intuitively reveal the vehicle evolution patterns under different traffic conditions. This work provides a novel research approach for tunnel traffic congestion identification and has high theoretical and applied value.

[0064] Other advantages, objectives, and features of the invention will be set forth in part in the description which follows, and in part will be apparent to those skilled in the art from the following examination, or may be learned from practice of the invention. The objectives and other advantages of the invention can be realized and obtained through the following description. Attached Figure Description

[0065] Figure 1 This is a flowchart of a highway tunnel congestion identification method based on dynamic graph prototype contrastive learning;

[0066] Figure 2 Architecture diagram of the dynamic graph prototype-based comparative learning model;

[0067] Figure 3 A schematic diagram of data augmentation methods;

[0068] Figure 4 Number of sampling time steps Sensitivity analysis;

[0069] Figure 5 The impact of the number of traffic state categories Q in downstream tasks on model performance;

[0070] Figure 6 The vehicle speed distribution is shown for four representative tunnel test samples (sample 1 to sample 4).

[0071] Figure 7 The vehicle speed distribution is shown for two representative tunnel test samples (sample 1 and sample 5). Detailed Implementation

[0072] To make the technical solutions, advantages, and objectives of the present invention clearer, 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, not all, of the embodiments of the present invention. All other embodiments obtained by those skilled in the art based on the described embodiments of the present invention without creative effort are within the protection scope of this application.

[0073] like Figure 1 As shown, this invention provides a method for identifying highway tunnel congestion based on dynamic graph prototype contrastive learning, comprising the following steps:

[0074] S1. Vehicle data inside highway tunnels is collected using a combination of radar and video surveillance.

[0075] S2. Preprocess the vehicle data collected in the highway tunnel in step S1 to generate vehicle trajectory time series data;

[0076] The vehicle trajectory time series data in step S2 includes: unique record number, timestamp, vehicle unique identifier, vehicle type, latitude and longitude coordinates of the vehicle's location, instantaneous speed, vehicle heading angle, and lane number of the vehicle; wherein, the unique record number is used to identify each vehicle trajectory;

[0077] S3. Construct a dynamic graph prototype comparative learning model;

[0078] like Figure 2 As shown, the dynamic graph prototype contrastive learning model includes a graph data augmentation module and a prototype contrastive learning module;

[0079] Graph data augmentation module: used to achieve fine-grained modeling of microscopic vehicle behavior;

[0080] The design of the graph data augmentation module is as follows:

[0081] I. The graph data augmentation module takes vehicle trajectory time series data as input and converts it into a graph structure;

[0082] At each time step , construct graph ;in, This represents all vehicle nodes within the tunnel observation area at that time step; This indicates the Nth time step within the tunnel observation area. t Vehicle node; N t Indicates the number of vehicles; The spatial proximity relationship between vehicles is mainly based on physical distance: if two vehicles are close enough, an edge is established between the corresponding nodes to represent the potential interaction relationship; This is a vehicle feature matrix, with each row containing attributes such as speed, acceleration, position, heading angle, and lane number; For each vehicle, a feature dimension is defined. Within a fixed time interval... Inner uniform sampling each discrete time step To form a dynamic graph sequence This model is used to characterize the evolution of vehicle behavior and traffic conditions over time. In this way, the model can capture the micro-behavioral characteristics of each vehicle and their dynamic interactions, thereby achieving a detailed characterization of complex congestion patterns.

[0083] II. Building upon step I, two graph augmentation strategies were introduced to generate different views in order to improve the model's robustness to perturbations, such as... Figure 3 As shown;

[0084] First strategy: Node discarding

[0085] In graph data augmentation modules, node dropping is a common strategy used to improve the robustness of the model when node information is incomplete.

[0086] By random discard ratio For the original image The vehicle nodes and their corresponding edges in the graph are sampled to obtain the augmented graph. ;

[0087]

[0088]

[0089]

[0090]

[0091] In the formula, The augmented graph obtained after the node discarding operation consists of a set of nodes. Edge set and characteristic matrix composition; It is a set of randomly sampled nodes. a subset of And its number of nodes indicates that it is rounded down; To enhance the set of nodes in the graph, it is to start from the original set of nodes in the graph. Remove random sampling node set The set of nodes after; To enhance the edge set in the graph, it is to start from the original graph edge set. The two endpoints are selected from the middle. The edges in; To enhance the vehicle feature matrix in the image, it is derived from the original vehicle feature matrix. Selecting from The rows corresponding to the nodes are obtained. Through this operation, some vehicle nodes and their features are removed during training, forcing the model to effectively capture the spatial proximity and interaction features between vehicles even with incomplete information. This not only simulates potential perception loss or sensor failures in real tunnel traffic but also forces the encoder to learn more robust node representations, improving its generalization ability under different vehicle distributions and densities. Furthermore, the node discarding strategy prevents the model from over-relying on individual nodes or local structures, thereby reducing the risk of overfitting and enhancing the ability to identify micro-behavioral features under complex traffic conditions.

[0092] The second strategy: Feature perturbation

[0093] In the graph data augmentation module, feature noise is used to improve the model's robustness to changes in node features.

[0094] For the node feature matrix at each time step Add Gaussian noise And through the mask matrix Controlling the disturbance range and generating an enhancement map ;

[0095]

[0096]

[0097] In the formula, This indicates element-wise multiplication; To control noise intensity; It follows a mean of 0 and a covariance matrix of . The distribution is Gaussian; I is the identity matrix, used to add noise to the node feature matrix; This represents the perturbation probability. Through this operation, some node features are randomly perturbed, forcing the model to learn stable representations that are insensitive to noise during training, thereby effectively enhancing the encoder's adaptability to feature-level changes. This feature perturbation strategy can simulate sensor measurement errors, signal loss, or temporary abnormal fluctuations in real-world tunnel scenarios, enabling the model to remain robust when facing real-world data.

[0098] Two augmented graphs generated and The input is fed into a shared encoder for representation learning. By maintaining consistency between the two views, the model can not only learn high-quality spatiotemporal representations that are robust to node loss and feature perturbations, but also effectively extract microscopic traffic structure features, reflecting the dynamic interaction relationships and evolution patterns between vehicles. This strategy provides a refined input representation for the subsequent prototype contrastive learning module, thereby significantly improving the ability to identify and generalize complex traffic conditions within tunnels. Through this dual enhancement, the model can more accurately reflect vehicle behavior characteristics and traffic state evolution trends when facing dense, dynamic, and varied tunnel traffic flows.

[0099] Prototype Comparison Learning Module

[0100] In tunnel traffic congestion identification tasks, traffic conditions not only evolve continuously over time, but the interactions between vehicles are also highly complex and dynamically changing. Traditional methods struggle to capture this microscopic spatiotemporal structure, while encoders based solely on time series or static graph convolution have limited ability to model dynamic interactions and evolutionary patterns. To address this issue, this invention introduces prototype contrastive learning and designs a novel spatiotemporal encoder as a core component. The core objective of this module is to enhance the encoder's ability to represent complex dynamic graph sequences, enabling it to effectively capture the microscopic behavior of vehicles within the tunnel and their spatiotemporal evolution patterns, while simultaneously providing high-quality embeddings for subsequent prototype contrastive learning.

[0101] The core of this module lies in the spatiotemporal encoder, which mainly consists of two parts: Evolve-GCN and Transformer. First, let's discuss two key issues arising from the unique characteristics of traffic within tunnels: First, the number of vehicles within the tunnel changes over time, leading to a change in the node set... and node features The dynamic nature of nodes differs at each time step. This highly dynamic node characteristic makes it difficult for traditional models with fixed node sets to accurately characterize the micro-behavior of each vehicle, thus failing to fully reflect the evolution of traffic conditions. Secondly, traditional static graph convolutional networks typically assume a fixed graph structure, with nodes and adjacency relationships remaining unchanged throughout the sequence. However, in tunnel scenarios, the spatial proximity relationships between vehicles continuously change as vehicles move, and the distribution of edges in the graph is updated at each time step. Static graph convolutions cannot dynamically adapt to these changes in nodes and edges, resulting in insufficient modeling capabilities for real-time interactions between vehicles. This makes it difficult to capture the micro-evolutionary features and complex spatiotemporal dependencies of traffic conditions, thereby limiting the performance of fine-grained identification and prediction of congestion patterns.

[0102] To address the aforementioned issues, we employ the Evolve-GCN dynamic graph convolutional network, which dynamically updates the weight matrix of each layer through a recursive structure. It integrates current node information with historical information:

[0103]

[0104] The updated weight matrix is ​​combined with the adjacency matrix of the current graph. With node embedding Execution graph convolution:

[0105]

[0106] The adjacency matrix consists of the set of vehicle nodes. Set of adjacent edges in space Build:

[0107]

[0108] The initial node embeddings are used as the input feature matrix. After passing through multiple graph convolutions, the node embeddings are aggregated into graph-level vectors through pooling layers.

[0109]

[0110] This process not only enables dynamic characterization of vehicle spatial distribution, multidimensional features, and inter-node relationships at each time step, but also adapts to changes in vehicle quantity and adjacency relationships, achieving micro-granular representation of traffic states. Through this method, the encoder can capture local behavioral differences in vehicles, thus providing more nuanced input for modeling complex traffic states.

[0111] While Evolve-GCN effectively addresses the adaptation problem of dynamically changing nodes and edges over time and accurately characterizes the tunnel traffic state at each time step, it encodes the graph structure at a single time step, resulting in embeddings that only reflect vehicle distribution and feature information at that specific moment. However, traffic conditions within a tunnel evolve continuously over time, and there are inherent connections between the graph structures at different time steps. Vehicle behavior and interaction patterns exhibit continuity and dependency over time. Therefore, further sequence modeling of these time-step graph embeddings is needed to capture the dynamic evolution patterns between vehicles. The Transformer encoder is precisely designed for graph sequence embedding. Temporal modeling is performed to uncover dynamic evolution patterns among vehicles. It utilizes a multi-head self-attention mechanism to globally model the graph embedding of the entire sequence, identifying the interaction features of key vehicles at different time steps and assigning dynamic weights based on their temporal importance, thereby uncovering temporal dependencies.

[0112]

[0113] In the formula, Indicates at time step At that time, after The context-enhanced representation obtained by the encoder includes not only the graph embedding information of the current time step. It also incorporates graph embedding information from other time steps. ; Indicates the current time step Image embedding information; Indicates other time steps Image embedding information;

[0114] After Transformer encoding, the hidden vectors at all time steps After fusion through fully connected layers, the final representation vector is obtained:

[0115]

[0116] in, The final representation vector is the embedding generated by the space-time encoder; FC represents the fully connected layer operation; and Concat represents the concatenation operation. This not only integrates the state characteristics of each vehicle in the micro-space, but also reflects the dynamic interaction relationships between vehicles over time, achieving high-fidelity modeling of the traffic state evolution process. In this way, the improved spatiotemporal encoder can more accurately capture fine-grained traffic patterns and congestion state differences when dealing with complex and dense traffic flow in tunnels, providing high-quality and discriminative input for subsequent prototype comparative learning.

[0117] Embedded by a spatiotemporal encoder While traffic patterns already contain rich spatiotemporal information, different traffic evolution patterns (such as free flow, synchronous flow, and locally congested flow) remain difficult to distinguish naturally in high-dimensional embedding spaces. This is due to the complexity of traffic conditions: vehicle behavior and interaction patterns are influenced by vehicle speed, vehicle spacing, local disturbances, and overall flow changes, causing different patterns to intertwine in space and become difficult to distinguish directly. To address this issue, we introduce Prototype Contrastive Learning (PCL) to discover latent traffic evolution patterns through self-supervision and enhance the discriminative power of the encoder embedding. Specifically, PCL first generates prototypes for each latent pattern using a clustering algorithm. :

[0118]

[0119] Each sample embedding The original prototype The positive prototype is the closest prototype in the embedding space, and the negative prototype is the rest of the prototypes. PCL improves the discriminativeness of embeddings by optimizing the prototype contrast loss, making the same pattern embeddings closer to the positive prototype and farther away from the negative prototype.

[0120]

[0121] In the formula, The prototype-based comparison loss function; K is the number of prototypes; The temperature parameter is used. Through this mechanism, the encoder can effectively aggregate potential traffic patterns while preserving the microscopic information of the nodes, resulting in compact embedding of similar patterns and clear differentiation of dissimilar patterns. Furthermore, it combines multi-view embedding generated by graph data augmentation. PCL further enhances the encoder's robustness to disturbances through contrastive learning, enabling the encoder to stably capture traffic evolution patterns even when nodes are missing or feature noise is present.

[0122] S4. Design a downstream classification task for tunnel traffic conditions with an additional lightweight classifier to evaluate the separability and discriminative ability of the representations learned by the dynamic graph prototype contrastive learning model.

[0123] In the downstream classification task of tunnel traffic conditions, the pre-trained spatiotemporal encoder remains in a fixed state and is used as a feature extractor to extract representations from the graph time series. A lightweight classifier is then added via a fully connected layer to predict the tunnel's traffic status within the current time window; the classification head outputs the prediction results:

[0124]

[0125] In the formula, This is the weight matrix. ; For bias vectors, ; d represents the number of predefined traffic state categories; d represents the dimension.

[0126] The lightweight classifier is trained using the cross-entropy loss function:

[0127]

[0128] In the formula, One-hot encoding of the real label. For category The predicted probability is calculated. This downstream task is used to evaluate the separability and discriminative power of the representations learned by the spatiotemporal encoder. Classification accuracy and related evaluation metrics can provide an effective benchmark for comparing model performance.

[0129] S5. Input the vehicle trajectory time series data preprocessed in step S2 into the dynamic graph prototype contrastive learning model constructed in step S3, and then input the features extracted by the dynamic graph prototype contrastive learning model into a lightweight classifier to finally obtain the traffic status of the highway tunnel.

[0130] This invention employs a graph temporal method to reconstruct the input sequence. At each time step, each vehicle in the tunnel is represented as a node, containing spatiotemporal attributes such as speed, position, acceleration, and lane number. Edges reflect the spatial proximity and interaction relationships between vehicles. The graph structure of multiple time steps forms a graph temporal sequence in chronological order, thus finely characterizing the evolution of vehicle behavior, offering higher granularity compared to traditional methods based on road segments or intersections. This invention also designs a novel spatiotemporal encoder that combines dynamic graph convolution with a Transformer encoder. The dynamic graph convolutional layer can adapt to dynamic changes in the number of nodes, node features, and adjacency relationships, accurately characterizing the spatial distribution, multidimensional states, and interrelationships of vehicles at each time step. The Transformer utilizes a multi-head self-attention mechanism to capture the complex dependencies between embedded vectors across multiple time steps, enabling the model to focus on key features of vehicle interaction and extract dynamic evolution patterns and the overall spatiotemporal evolution of tunnel traffic conditions. Subsequently, the encoder integrates the temporal features into low-dimensional vectors and uses Prototype Contrastive Learning (PCL) for unsupervised clustering, bringing traffic states with similar evolution patterns closer together and distancing different states. Clustering results are incorporated into the loss function as pseudo-labels, and the feature space is iteratively optimized. This improves the discriminative feature extraction capability of the encoder without the need for real labels, thereby enabling accurate identification and classification of tunnel traffic state evolution patterns.

[0131] Experimental verification

[0132] I. Experimental Data

[0133] The highway tunnel dataset used in this invention comes from the G65 Baomao Expressway, with a collection period spanning from July to October 2024, totaling 109 days and covering over 1.51 billion traffic records involving more than 9.27 million vehicles. The raw data was preprocessed to generate 19,237 samples, each corresponding to a graph time series, used to describe the spatial distribution and dynamic evolution of vehicles within the tunnel within a specific time window. Data acquisition employed a combination of radar and video surveillance, with a sampling frequency of 10 Hz, enabling precise tracking of vehicle trajectories within the tunnel. Each record contains multi-dimensional key feature information, as shown in Table 1, including: a unique record number (RecordSerialNumber) to identify each vehicle trajectory; a timestamp (TimeStamp), accurate to milliseconds (UTC+8); a unique vehicle identifier (PicLicense), protected by encryption for privacy; vehicle type (OriginalType); the vehicle's location coordinates (Longitude, Latitude); instantaneous speed (Speed, in km / h); vehicle heading angle (CourseAngle, defined as the angle between the vehicle's direction of travel and true north); and the vehicle's lane number (LaneNum). Each variable corresponds to a column in the CSV file, and each row represents the vehicle's state at a specific time. Using these fields, vehicle nodes and their multi-dimensional feature vectors can be generated for each time step, and a dynamic graph structure can be constructed by combining the spatial proximity relationships between vehicles, forming a graph sequence describing the evolution of tunnel traffic conditions. These high-precision data not only reflect the distribution and behavioral differences of vehicles in the micro-space, but also characterize the dynamic interaction patterns between vehicles. This provides high-quality input for the improved spatiotemporal encoder and prototype contrastive learning module proposed in this invention, enabling the model to achieve fine modeling and pattern recognition of traffic state evolution in complex tunnel environments. This provides a reliable data foundation for traffic state analysis, congestion prediction, and abnormal event detection.

[0134] Table 1. Relevant parameters of the highway tunnel dataset.

[0135]

[0136] II. Experiment Setup

[0137] To verify the effectiveness of the Dynamic Graph Prototype Contrastive Learning (DGPCL) method proposed in this invention, this embodiment provides a detailed explanation of dataset partitioning, model training strategies, hyperparameter settings, and evaluation metrics. First, this experiment uses input data from different dates to conduct three types of experiments. Experiment type A covers all time periods, totaling 19,237 samples, aiming to test the model's comprehensive capabilities. Experiment type B uses data from weekends and public holidays, aiming to test the model's performance in holiday scenarios, totaling 6,541 samples. Experiment type C uses data from weekdays, aiming to test the model's performance in weekday scenarios, totaling 12,696 samples. Simultaneously, to ensure the scientific rigor and fairness of the experiment, this invention divides the above three datasets into training, validation, and test sets in a 7:1:2 ratio for model training, parameter tuning, and final performance evaluation. During the contrastive learning phase, only the training and validation sets are used for model training to ensure that the learned feature representations have strong generalization capabilities. In the downstream classification task, a pre-trained spatiotemporal encoder with frozen parameters is used to embed the graph time series. A classifier is then trained using the training and validation sets, and finally, the classification performance is evaluated using the test set. For the optimizer, this embodiment uses the Adam optimizer, with a weight decay coefficient set to 1e. -4 The momentum parameter was set to 0.9, and the batch size was 64. During the comparative learning phase of DGPCL, the total number of training epochs was 50, with the first 10 epochs using only the InfoNCE loss function for network warm-up training. The initial learning rate was set to 1e. -4 The learning rate decays to 0.1 times its original value at the 40th training epoch. In the downstream classification phase, the number of training epochs is 20, and the learning rate is fixed at 1e. -4 Regarding hyperparameter settings, this embodiment sets the following key parameters: number of sampling time steps. = 32, Gaussian noise standard deviation = 0.01, number of graph convolutional layers = 2, temperature coefficient = 0.1, Number of downstream traffic state categories = 4, probability of being dropped = 0.3, probability of perturbation = 0.3 and the number of clusters K ∈ {32, 64}. In terms of performance evaluation, this embodiment uses a linear classifier as the downstream task to test the quality of the learned feature representations. Evaluation metrics include classification accuracy and macro-average F1 score.

[0138] III. Benchmark Model and Comparison Results

[0139] To evaluate the effectiveness of the proposed model, this invention selects widely used and effective models in the field of time series representation learning in recent years as baseline models for comparison. These models cover various mainstream methods such as cluster-based contrastive learning, prototype contrastive learning, multi-scale representation modeling, and frequency domain enhancement, and can comprehensively reflect the performance advantages of the proposed method in different scenarios. Specifically, they include:

[0140] (1) CCL model: a cluster-based contrastive learning method. This method improves the discriminative power of the representation by constructing positive sample pairs from instance neighbors and cluster centers, and can better distinguish potential patterns of different categories in unsupervised scenarios.

[0141] (2) PCL model: a multi-level prototype contrastive learning framework. This method jointly learns instance-level and dataset-level prototype representations, and gradually obtains semantically richer feature embeddings through an iterative optimization process, thereby improving the semantic consistency and discriminativeness of the representations.

[0142] (3) TS2Vec model: a multi-scale time series contrastive learning method. This model constructs positive sample pairs from both contextual and instance perspectives, which can capture local patterns in time series and preserve overall semantic information, thereby improving the multi-level nature of feature expression.

[0143] (4) MHCCL model: a method that combines mask modeling and hierarchical clustering contrastive learning. This model learns instance-level and cluster-level representations simultaneously through a multi-head architecture, and improves the model's ability to extract features at multiple granularities by utilizing a hierarchical structure.

[0144] (5) TimesURL model: A contrastive learning method that combines time and frequency domain enhancements. It introduces an adaptive perturbation strategy within the momentum contrastive learning framework to improve the model's generalization ability in various complex scenarios.

[0145] Table 2 shows the performance of the baseline model and the DGPCL model in three types of experiments. As can be seen from the table, the DGPCL model of this invention significantly outperforms other baseline deep learning models in all three types of experiments (Experiments A, B, and C). Compared with instance-level contrastive learning methods, DGPCL shows a significant advantage in capturing the spatiotemporal dependencies of tunnel traffic, and can more fully model the dynamic interactions and evolution patterns between vehicles. Although methods such as TS2Vec and TimesURL have some ability in time-series feature extraction, they still struggle to capture global spatial relationships in complex tunnel traffic environments, resulting in performance lagging behind DGPCL in all three experimental types. For cluster-level contrastive learning methods, although cluster semantics are introduced to enhance representation discriminative power, they have limitations in dynamic graph modeling and hierarchical feature learning, resulting in performance inferior to DGPCL in experiments A, B, and C. In contrast, DGPCL, by fusing an improved spatiotemporal encoder and multi-level prototype contrastive learning, effectively integrates the microscopic spatial features of vehicles and their temporal evolution information, thus exhibiting stable and excellent performance under different traffic conditions. It is worth noting that even in scenario-specific experiments B and C, DGPCL maintained a high level of accuracy and discriminative ability, demonstrating its robustness and generalization ability in processing complex tunnel traffic data. In summary, the results in Table 2 fully validate the effectiveness of the DGPCL model in tunnel traffic pattern recognition tasks, providing a reliable basis for subsequent traffic state analysis and congestion management.

[0146] Table 2 Comparison of experimental results

[0147]

[0148] IV. Case Visualization Analysis

[0149] To verify the effectiveness of each component in DGPCL, this invention conducted ablation experiments. Specifically, one major component was excluded each time, and its impact on the model's performance was observed. The final results are shown in Table 3. Specifically, in... The graph data augmentation module was removed, and the corresponding Evolve-GCN was also removed. The original time series data was then directly input into the Transformer. In this approach, only Evolve-GCN is removed and replaced with static graph convolution. The Transformer encoder has been removed, and it no longer extracts the temporal relationships between graph embeddings. In this version, the PCL method is no longer used; instead, a spatiotemporal encoder is used directly for the downstream classification task. The final results are shown in Table 3. It can be seen that deleting any submodule will reduce the performance of the DGPCL model.

[0150] Table 3 Ablation Studies

[0151]

[0152] V. Model Parameter Sensitivity Experiment

[0153] Finally, this invention further explores the impact of hyperparameters on model detection performance; all sensitivity experiments were conducted on the complete dataset. Figure 4 As can be seen, when the number of sampling steps increases from 8 to 32, both the model's accuracy and F1 score significantly improve, with accuracy increasing from 75.3% to 82.1% and the F1 score rising from 0.7384 to 0.7909. This indicates that more temporal information helps the model better capture the spatiotemporal patterns of tunnel traffic. However, when the number of sampling steps is further increased to 64 and 128, the model performance slightly declines or tends to saturate, with accuracy decreasing to 81.5% and 81.8%, and the F1 score decreasing to 0.7793 and 0.7882, respectively. This suggests that excessively long sequences may introduce noise or redundant information, thus limiting the model's learning effectiveness. Overall, 32 sampling steps achieve the optimal balance between capturing sufficient temporal dynamics and computational efficiency. These results provide valuable reference for selecting appropriate temporal granularity in practical applications. Figure 5 This demonstrates the impact of the number of traffic categories. As the number of categories increases, both the model's accuracy and F1 score show a significant downward trend. Specifically, the model performs best with three categories, achieving an accuracy of 87.53% and an F1 score of 0.8454. In contrast, when the number of categories increases to eight, the accuracy drops to 66.01%, and the F1 score falls to 0.6304. This trend suggests that coarse-grained classification (such as dividing tunnel traffic conditions into "free flow," "moderate congestion," and "severe congestion") allows the model to capture clearer decision boundaries. However, fine-grained classification increases the difficulty of classification because the differences between categories are more subtle, especially in a tunnel environment where space is limited and vehicle interactions are complex. Furthermore, increasing the number of categories may lead to class imbalance, further affecting the model's generalization ability.

[0154] VI. Case Analysis

[0155] To analyze the model's performance in real-world tunnel traffic scenarios more deeply, we carefully selected five representative traffic samples from the test set for a case study. The predicted clustering labels for these five samples are 0, 1, 2, 3, and 0, corresponding to different traffic states within the tunnel. The detailed analysis is as follows:

[0156] (1) Evolution of vehicles inside tunnels under different traffic conditions

[0157] like Figure 6As shown in the diagram, Sample 1 initially shows only a small number of slow-moving vehicles (red dots) near the tunnel exit, representing the initial stage of localized congestion. Over time, the number of red slow-moving vehicles gradually increases, and the congested area begins to expand deeper into the tunnel. Eventually, most of the tunnel is covered by slow-moving vehicles, exhibiting a typical congestion formation process. This sample demonstrates the evolution of traffic flow from localized slowness to overall congestion, emphasizing the crucial role of vehicle micro-behavior in the early stages of congestion. Sample 2 initially shows a widespread distribution of red slow-moving vehicles within the tunnel, indicating a high-density, low-speed traffic environment. As time progresses, the vehicle color gradually transitions from red to green, indicating a gradual recovery in vehicle speed. During this process, the congested area gradually recedes, and tunnel traffic begins to return to normal flow, reflecting the tunnel's self-regulating ability under high-density conditions. Sample 3 represents the gradual clearing stage. Initially, only scattered red slow-moving vehicles exist within the tunnel, with relatively light overall congestion. As time progresses, the vehicle color gradually changes from red to yellow-green and then green, the number of slow-moving vehicles decreases significantly, and the traffic situation shifts from congestion relief to free flow. This sample demonstrates how micro-interactions between vehicles drive the rapid recovery of traffic conditions, highlighting the crucial role of vehicle behavior in improving overall mobility. Sample 4 shows a significant reduction in the number of vehicles inside the tunnel, with traffic flow exhibiting a low-density free-flow state. Vehicle colors are predominantly green and light green, representing high-speed operation, while low-speed vehicles are extremely rare and sparsely distributed. As time progresses, the number of vehicles further decreases, and the free-flow characteristics become more pronounced. This sample fully reflects the characteristics of reduced vehicle interaction and enhanced traffic flow stability under smooth traffic conditions. Through the analysis of these four representative samples, it is evident that there are significant differences in the micro-interactions of vehicles inside the tunnel under different traffic conditions. During the congestion formation stage, the distance between vehicles decreases, following and braking behaviors become frequent, and micro-interactions are most concentrated, leading to a rapid expansion of local congestion. As congestion gradually eases, the mutual influence between vehicles gradually weakens, speeds gradually recover, medium- and high-speed vehicles replace low-speed vehicles, and micro-interactions still exist but tend to be more orderly. Entering the free-flow stage, the distance between vehicles increases, low-speed vehicles become scarce, micro-interactions significantly weaken, and traffic flow tends to stabilize. These observations demonstrate that vehicle interaction patterns are a key factor determining traffic state evolution, clearly revealing the correlation between micro-behaviors and overall flow characteristics under different states, and providing direct evidence for refined congestion identification based on vehicle behavior.

[0158] (2) Evolution of vehicles inside tunnels under the same traffic conditions

[0159] like Figure 7As shown, Samples 1 and 5, as typical representatives of the same traffic conditions, both exhibit a concentrated distribution of low-speed vehicles (marked in red), revealing a micro-interaction pattern in the early stages of local congestion. Over time, the number of low-speed vehicles in both samples gradually increases, vehicle spacing decreases, following and braking behaviors become more frequent, and micro-interactions become highly concentrated, with the congested area gradually expanding deeper into the tunnel. Although the specific vehicle distribution locations differ, the overall evolution trend and vehicle interaction patterns are highly consistent, fully demonstrating that under the same traffic conditions, the evolution pattern of vehicles inside the tunnel has significant repeatability and group characteristics. This highly consistent micro-interaction pattern provides a solid basis for traffic congestion identification. By capturing the synchronous evolution characteristics of vehicle speed, spacing, and following behavior, the model can identify the typical evolution trajectory of traffic conditions, thereby accurately determining whether the tunnel is in a congested, easing, or free-flowing state at different time steps. Furthermore, the group behavior patterns under the same traffic conditions enable graph-based temporal modeling methods to effectively extract key interaction features, providing reliable support for refined tunnel congestion identification and prediction. This finding suggests that using vehicle micro-behavior and interaction patterns for feature extraction and cluster analysis is a feasible approach to achieving high-precision tunnel traffic condition identification.

[0160] It is hereby declared that the above embodiments are only used to illustrate the technical solutions of the present invention and are not intended to limit it. Although the present invention has been described in detail with reference to preferred embodiments, those skilled in the art should understand that modifications or equivalent substitutions can be made to the technical solutions of the present invention without departing from the spirit and scope of the present invention, and all such modifications or substitutions should be covered within the scope of the claims of the present invention.

Claims

1. A highway tunnel congestion identification method based on dynamic graph prototype contrast learning, characterized in that, The method comprises the following steps: S1. Collecting vehicle data in the highway tunnel by combining radar with video monitoring; S2. Preprocessing the vehicle data collected in the highway tunnel in step S1 to generate vehicle trajectory time series data; S3. Constructing a dynamic graph prototype contrast learning model; The dynamic graph prototype contrast learning model comprises a graph data enhancement module and a prototype contrast learning module; The graph data enhancement module is used to realize fine-grained modeling of micro-vehicle behavior; The prototype contrast learning module is used to capture the micro behavior of vehicles in the tunnel and its spatio-temporal evolution mode, and to provide high-quality embedding for subsequent prototype contrast learning; The design of the graph data enhancement module in step S3 is as follows: I. The graph data enhancement module takes the vehicle trajectory time series data as input and converts it into a graph structure; At each time step , a graph is constructed; where, represents all vehicle nodes within the tunnel observation region at this time step; represents the N t th vehicle node within the tunnel observation region at this time step; N t represents the number of vehicles; represents the spatial adjacency relationship between vehicles; is the vehicle feature matrix, each row containing speed, acceleration, position, heading angle and lane number; is the feature dimension of each vehicle; within a fixed time interval , a number of discrete time steps are uniformly sampled to form a dynamic graph sequence ; II. On the basis of step I, two graph enhancement strategies are introduced to generate different views to improve the robustness of the model to perturbations; The first strategy: node discarding, used to improve the robustness of the model in the case of incomplete node information; with a random drop ratio the original graph The vehicle nodes in the original graph and their corresponding edges are sampled to obtain an enhanced graph ; , wherein, is an enhanced graph obtained by node discarding operation, consisting of a node set , an edge set and a feature matrix ; is a randomly sampled node set, which is a subset of , and the number of nodes in , represents rounding down; is a node set in the enhanced graph, which is obtained by removing the randomly sampled node set from the node set of the original graph ; is an edge set in the enhanced graph, which is obtained by screening out edges with both endpoints in from the edge set of the original graph ; is a vehicle feature matrix in the enhanced graph, which is obtained by selecting rows corresponding to the node pairs in from the original vehicle feature matrix ; The second strategy: feature perturbation, used to improve the robustness of the model to changes in node features; For each time step of the node feature matrix , add Gaussian noise , and control the disturbance range by the mask matrix , generate enhanced graph ; where, denotes element-wise multiplication; to control the noise strength; , subject to a Gaussian distribution with mean 0 and covariance matrix I is an identity matrix used to add noise to the node feature matrix; is the perturbation probability; S4. Design a downstream classification task of tunnel traffic state with an additional lightweight classifier to evaluate the separability and discriminability of the representation learned by the dynamic graph prototype contrast learning model; S5. Input the vehicle trajectory time series data preprocessed in step S2 into the dynamic graph prototype contrast learning model constructed in step S3, then input the features extracted by the dynamic graph prototype contrast learning model into the lightweight classifier, and finally obtain the traffic state of the highway tunnel.

2. The highway tunnel congestion identification method based on dynamic graph prototypical contrastive learning according to claim 1, characterized in that: The vehicle trajectory time series data in step S2 comprises a unique record number, a timestamp, a vehicle unique identifier, a vehicle type, a latitude and longitude coordinate of the vehicle's location, an instantaneous speed, a vehicle heading angle, and a vehicle lane number; wherein the unique record number is used to identify each vehicle trajectory.

3. The highway tunnel congestion identification method based on dynamic graph prototypical contrastive learning according to claim 2, characterized in that, The design of the prototype contrast learning module in step S3 is as follows: The prototype contrast learning module takes the enhanced graph and as input, and the prototype contrast learning module is built-in with a space-time encoder, which includes an Evolve-GCN dynamic graph convolutional network and a Transformer encoder. I. The dynamic graph convolutional network Evolve-GCN is used to capture the micro behavior of vehicles in the tunnel; Dynamic Graph Convolutional Networks Evolve-GCN, dynamically update each layer weight matrix through recursive structure , fusion of current node information and historical information: The updated weight matrix is combined with the adjacency matrix of the current graph with the node embeddings performing graph convolution: where the adjacency matrix is constructed from the set of vehicle nodes with the set of spatially adjacent edges Construction: The initial node embeddings are input feature matrices, and after multi-layer graph convolution, the node embeddings are aggregated into graph-level vectors by the pooling layer: II. Transformer encoder for embedding graph sequences perform temporal modeling, mining dynamic evolving patterns among vehicles; The Transformer encoder uses a multi-head self-attention mechanism to globally model the graph embedding of the entire sequence, which can identify the interaction features of key vehicles at different time steps and assign dynamic weights according to their temporal importance, thereby mining the temporal dependencies: wherein, denotes the context-enhanced representation obtained by the encoder at time step denotes the graph embedding information at time step ; denotes the graph embedding information at time step ; denotes the graph embedding information at time step ; denotes the graph embedding information at time step ; After the Transformer encoding, the hidden vectors of all time steps After the full connection layer fusion, the final representation vector is obtained: where, is the final representation vector, i.e., the embedding generated by the spatio-temporal encoder; FC denotes a fully connected layer operation; Concat denotes a concatenation operation; The prototype contrast learning method PCL is introduced to discover the potential traffic evolution patterns in a self-supervised manner and enhance the discriminability of the encoder embedding. PCL first generates a prototype for each potential pattern by a clustering algorithm : each sample embedding positive prototypes the nearest prototype in the embedding space, and the negative prototypes are the rest of the prototypes; PCL improves the discriminativeness of the embedding by optimizing the prototype contrast loss, which pulls the embeddings of the same mode close to the positive prototypes while pushing them away from the negative prototypes: wherein, is the prototype contrast loss function; K is the number of prototypes; is the temperature parameter.

4. The highway tunnel congestion identification method based on dynamic graph prototypical contrastive learning according to claim 3, characterized in that, In step S4, the downstream classification task of tunnel traffic state is designed as follows: In the downstream classification task of tunnel traffic state, the pre-trained spatio-temporal encoder keeps a fixed state and is used as a feature extractor to extract representations from the graph time series , followed by a fully connected layer attached with a light-weight classifier to predict the traffic state of the tunnel within the current time window; the classification head outputs the prediction result: wherein, is a weight matrix, ; is a bias vector, ; denotes a predefined number of traffic state classes; d denotes the dimension.

5. The highway tunnel congestion identification method based on dynamic graph prototypical contrastive learning according to claim 4, characterized in that, The lightweight classifier is trained using a cross-entropy loss function: where, is the one-hot encoding of the true label, is the predicted probability of the class .

Citation Information

Patent Citations

  • Expressway congestion prediction method based on space-time multi-head attention mechanism

    CN115050177A

  • Traffic track anomaly detection method and device based on graph contrast learning

    CN118196534A