Tunnel traffic safety real-time evaluation method based on traffic state and deep learning

By collecting macroscopic traffic characteristics in tunnels in real time and using deep learning models to assess tunnel traffic safety, the problems of long data collection cycles and frequent model updates in existing technologies have been solved, enabling real-time, accurate assessment and efficient updating of tunnel traffic safety.

CN120298984BActive Publication Date: 2026-02-10UESTC (SHENZHEN) ADVANCED RES INST
View PDF 2 Cites 0 Cited by

Patent Information

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

AI Technical Summary

Technical Problem

Existing technologies for real-time traffic safety assessment in tunnels suffer from problems such as excessively long data collection cycles, reliance on vehicle collision data leading to data imbalance, difficulty in real-time evaluation of traffic safety levels, and the trade-off between frequent model updates and prediction accuracy.

Method used

A traffic state-based and deep learning-based approach is adopted to collect macroscopic traffic features in tunnels in real time. Safety level prediction is performed by a deep learning model that integrates multi-lane interaction features. Supervised learning is carried out using a pre-trained model, and online updates and accurate predictions are achieved by combining multi-head attention mechanism and residual connection.

Benefits of technology

It enables real-time and accurate traffic safety assessment in tunnels, reduces data acquisition latency to the second level, resolves the contradiction between data imbalance and the frequency of model updates and prediction accuracy, and supports efficient online updates of models under large-scale data.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120298984B_ABST
    Figure CN120298984B_ABST
Patent Text Reader

Abstract

The application discloses a tunnel traffic safety real-time evaluation method based on traffic state and deep learning, relates to the technical field of tunnel traffic safety, and comprises the following steps: inputting real-time collected macro traffic features into a pre-trained deep learning model of fused multi-lane interaction features, the model comprising a feature coding layer, a single-lane information extraction module and a safety level prediction module; and in the training stage, the deep learning model of fused multi-lane interaction features is subjected to supervised learning by using historical macro traffic features and TTC safety level labels calculated based on micro trajectory. The application builds a non-collision data-driven evaluation paradigm, the model training is free from the dependence on low-frequency collision events, a mapping mechanism of macro features and TTC safety levels is established, dynamic parameters are subjected to space-time correlation modeling through the deep learning model, and the TTC index originally dependent on micro trajectory is indirectly represented; and the application also solves the contradiction between model updating frequency and prediction accuracy in the prior art.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of tunnel traffic safety technology, and more specifically, to a real-time tunnel traffic safety assessment method based on traffic conditions and deep learning. Background Technology

[0002] Tunnels are an important part of the road network, reducing travel time and providing convenience. However, driving in dark, narrow tunnels can lead to anxiety and uncertainty, requiring extra attention and mental strain. While the probability of a traffic accident in a tunnel is lower than on an open highway, such accidents are often much more serious. Therefore, conducting real-time traffic safety assessments in narrow, dark tunnels where GPS signals may not be reliable is highly valuable.

[0003] The existing technology has the following main shortcomings:

[0004] (1) The technical data collection cycle for technologies that rely on motor vehicle collision data is too long:

[0005] Several studies have investigated the relationship between motor vehicle collisions and macroscopic traffic characteristics (i.e., traffic state data). While assessing traffic safety based on collision data (the frequency and severity of motor vehicle collisions) is the most direct and unquestionable approach, collision data collection suffers from significant limitations, including underreporting and low quality. The biggest limitation is that motor vehicle collisions are extremely rare events, often requiring lengthy collection periods for meaningful analysis. Many studies have used imbalanced datasets, where the number of collision data samples is far fewer than the number of non-collision data samples. Some existing research has attempted to mitigate the data imbalance problem using bias correction based on Firth methods, deep generative models, and focus loss. These methods allow training classification models by shifting the classification boundary towards the minority class, enabling the training of ideal models with a small proportion of collision data. This does reduce data collection time to some extent, but collecting sufficient collision data in tunnels for meaningful analysis still requires a considerable amount of time.

[0006] (2) Technologies based on traffic conflict are difficult to evaluate traffic safety levels in real time:

[0007] Traffic conflicts, as a type of "near-collision event" that occurs more frequently than actual collisions, have been studied extensively and can serve as a precursor to accidents, enabling more timely traffic safety assessments by identifying hazards before they occur. Many studies based on traffic conflicts employ the alternative safety metric, the Time-of-Collision (TTC) index, to evaluate traffic safety levels. However, the TTC index is a microscopic measure that requires specific micro-trajectory data for calculation, which is difficult to collect in real-time in tunnels. Some studies use traffic simulation software to model the outcomes of traffic conflicts and micro-trajectory data, but this is considered an unreliable method for predicting real-world vehicle collisions. Other studies combine vehicle trajectory data collected by multiple detectors (such as GPS, radar, and onboard sensors) to reduce the risk of collisions with connected cars, but this is difficult to implement in tunnels with limited space and unstable signals. Recently, some studies have extracted micro-trajectory data from traffic videos using unmanned aerial vehicles (UAVs), but this extraction process is time-consuming and requires specialized software for offline processing. Therefore, directly collecting micro-trajectory data and calculating the TTC index in real-time to evaluate safety levels in tunnels is impractical.

[0008] (3) Limitations of the current model in terms of accurate prediction and frequent updates:

[0009] Most existing technologies employ typical machine learning classification methods to predict whether traffic collisions or conflicts will occur. Among traditional machine learning methods, Gradient Boosting Decision Tree (GBDT) often achieves the best results, but its trees are non-differentiable. Therefore, the excessively frequent retraining from scratch makes GBDT inefficient in online prediction scenarios. In deep learning methods, only Multilayer Perceptrons (MLPs) and Convolutional Neural Networks (CNNs) are used to predict traffic conflicts. While their mini-batch training mode facilitates online prediction updates, they do not yield satisfactory prediction results. This increases the need for specialized real-time prediction models that can not only effectively assess traffic safety levels based on traffic conflicts but also be easily updated frequently over time. Summary of the Invention

[0010] The present invention provides a real-time assessment method for tunnel traffic safety based on traffic conditions and deep learning, which can solve the above-mentioned problems.

[0011] To solve the above problems, the technical solution adopted by the present invention is as follows:

[0012] This invention provides a real-time tunnel traffic safety assessment method based on traffic conditions and deep learning, comprising:

[0013] Real-time acquisition of macroscopic traffic characteristics in various monitoring areas within the tunnel. These macroscopic traffic characteristics include numerical attribute features, lane ID, and camera ID. The numerical attribute features include average vehicle speed, speed standard deviation, traffic density, proportion of small vehicles, proportion of medium and large vehicles, and proportion of hazardous chemical vehicles.

[0014] The real-time collected macroscopic traffic features are input into a pre-trained deep learning model that integrates multi-lane interaction features. This model includes a feature encoding layer, a single-lane information extraction module, and a safety level prediction module. The feature encoding layer maps the numerical attribute features into high-dimensional vectors and integrates the encodings of time ID, lane ID, and camera ID to generate a multi-segment joint feature matrix. The single-lane information extraction module extracts the interaction features between upstream and downstream segments of the corresponding lane based on the multi-segment joint feature matrix, using a multi-head attention mechanism and residual connections, ultimately obtaining an enhanced road segment representation carrying the spatiotemporal interaction features within the lane. The safety level prediction module integrates all enhanced road segment representations carrying the spatiotemporal interaction features within the lane and outputs the safety level prediction results for each monitored area.

[0015] The deep learning model that integrates multi-lane interaction features uses historical macro-traffic features and TTC safety level labels based on micro-trajectory calculations for supervised learning during the training phase.

[0016] Furthermore, the implementation of the feature encoding layer specifically includes: class encoding of time bin IDs and lane IDs using trainable embedding matrices; position encoding of camera IDs using sine and cosine matrices; embedding encoding of numerical attribute features after binning and discretization; adding the encoded vectors to obtain road segment-level features, and concatenating them to obtain a multi-road segment joint feature matrix.

[0017] Furthermore, the processing flow of the single-lane information extraction module specifically includes: inputting the encoded upstream and downstream road segments of the same lane into a parallel road segment module; the road segment module extracts the characteristics of its own numerical attribute features and the interaction information between different road segments in the same lane based on the feedforward FFN1, multi-head attention mechanism and residual connection; the outputs of each road segment module are fused with FFN2 through a feedforward neural network, and the original feature information is retained through residual connection, and finally an enhanced road segment representation carrying the spatiotemporal interaction features within the lane is output.

[0018] Furthermore, the safety level prediction module, based on the enhanced road segment representation carrying the spatiotemporal interaction characteristics within the lanes, first performs independent predictions for each lane to obtain independent prediction results S. single Then, an overall prediction is performed to obtain the overall prediction result S. overall Finally, the independent prediction results S are fused through linear layers. single And overall prediction results S overallThe security level prediction result is obtained through the softmax layer.

[0019] Furthermore, the deep learning model that integrates multi-lane interaction features continuously updates its parameters based on data flow during use.

[0020] Furthermore, the TTC safety level classification adopts a multi-threshold dynamic judgment, including: based on the minimum TTC value of vehicles in the monitoring area, setting three threshold levels of 1 second, 2.5 seconds, and 4 seconds to classify four safety levels.

[0021] Furthermore, the deep learning model that integrates multi-lane interaction features uses the cross-entropy loss function during training, and the Adam optimizer is used to optimize the model parameters, while weight decay is used to prevent overfitting.

[0022] Compared with the prior art, the beneficial effects of the present invention are:

[0023] (1) By supervising the learning of macro traffic features and TTC-based safety labels, a non-collision data-driven evaluation paradigm was constructed. The macro parameters such as vehicle average speed and density that can be obtained in real time by conventional tunnel monitoring equipment are used to replace the micro trajectory data and actual collision records that are necessary but difficult to obtain in traditional methods. This frees the model training from dependence on low-frequency collision events and solves the problem of model failure caused by excessively long data collection cycles and severe data imbalance in existing technologies.

[0024] (2) An innovative mapping mechanism between macroscopic features and TTC safety levels is established. A deep learning model is used to spatiotemporally correlate topological features such as camera ID and lane ID with dynamic parameters such as speed standard deviation, indirectly representing the TTC index, which originally relied on microscopic trajectories. Compared to existing technologies that require dedicated sensors or offline video processing to obtain TTC data, this invention reduces data acquisition latency from minutes to seconds while maintaining the accuracy of safety assessment, meeting the real-time early warning requirements of tunnel scenarios.

[0025] (3) A lane-level feature extraction module is constructed by using a multi-head attention mechanism and residual connection. The parallel processing structure realizes the parallel computation of multi-lane interactive features. Compared with the GBDT model and CNN model in the existing technology, it supports online updating of model parameters under incremental learning while maintaining a prediction accuracy of over 85%, thus solving the contradiction between model update frequency and prediction accuracy in the existing technology.

[0026] To make the above-mentioned objects, features and advantages of the present invention more apparent and understandable, embodiments of the present invention are described below in detail with reference to the accompanying drawings. Attached Figure Description

[0027] To more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings used in the embodiments will be briefly introduced below. It should be understood that the following drawings only show some embodiments of the present invention and should not be regarded as a limitation on the scope. For those skilled in the art, other related drawings can be obtained based on these drawings without creative effort.

[0028] Figure 1 This is a schematic diagram of TTC calculation;

[0029] Figure 2 This is a schematic diagram of the real-time tunnel safety level classification method based on TTC proposed in this invention;

[0030] Figure 3 This is a schematic diagram of the deep learning model architecture that integrates multi-lane interaction features designed in this invention;

[0031] Figure 4 This is a schematic diagram of the road segment module designed in this invention. Detailed Implementation

[0032] To make the objectives, technical solutions, and advantages of the embodiments 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 some embodiments of the present invention, but not all embodiments.

[0033] Please refer to Figure 1 This invention provides a real-time assessment method for tunnel traffic safety based on macroscopic traffic features and deep learning, comprising two parts: a real-time tunnel safety level classification method based on TTC and a deep learning model architecture that integrates multi-lane interaction features.

[0034] Among them, the real-time tunnel safety level classification method based on TTC plays different roles in the training and prediction of deep learning models that integrate multi-lane interaction features:

[0035] During training, macroscopic traffic data and microscopic trajectory data of the tunnel are extracted. The TTC is calculated using the microscopic trajectory data. The TTC is used as the basis to classify the safety level of each monitoring area of ​​the tunnel. The model is trained using macroscopic traffic data as input and safety level as label.

[0036] During the prediction process, real-time macroscopic traffic data of the rail system is extracted and fed into the model to obtain the model's prediction of the safety level of each monitored area within the tunnel, facilitating real-time early warning.

[0037] The method of the present invention will be explained below using a two-lane road in the same direction as an example:

[0038] First, the definitions of Time-of-Collision Index (TTC), camera monitoring area, safety level, macroscopic traffic characteristics, and MF-TSE problem will be explained:

[0039] (1) Time to Collision (TTC) index: defined as the time required for the target vehicle and the vehicle in front to maintain their current state of motion until a collision occurs. For example... Figure 1 Let the motion states of the target vehicle and the vehicle in front be (s) respectively. n ,v n ) and (s n+1 ,v n+1 If the TTC of vehicle n is... n The calculation formula is:

[0040]

[0041] Among them, s n V represents the distance of vehicle n from the tunnel entrance. n For the current speed, l n For vehicle length (5 meters for small cars, 12 meters for non-small cars), TTC n This represents the collision time of vehicle n.

[0042] (2) Camera Monitoring Area: This is simply called the monitoring area. A monitoring area consists of two road sections and is the basic unit for measuring the traffic safety level of a tunnel. That is, each monitoring area is assigned a safety level at any given time. Detailed settings are as follows: Figure 2 As shown, the m-th monitoring area and its downstream (m+1)-th area together comprise four road segments. Segments 0 and 1 belong to the m-th monitoring area, and segments 2 and 3 belong to the (m+1)-th monitoring area. Note that segments 0 and 2 are located in the left lane, and segments 1 and 3 are located in the right lane.

[0043] (3) Security level: Set TTC threshold. * When TTC n <TTC * At that time, the target vehicle is considered to have a traffic conflict with the vehicle in front. The minimum TTC (Traffic Traffic Flow Rate) of vehicles within the monitored area is used. min The safety level is measured. As shown in equation (2), three thresholds (1 second, 2.5 seconds, and 4 seconds) are set to divide the safety level of the monitored area into four levels: very dangerous (y=0), dangerous (y=1), risky (y=2), and safe (y=3).

[0044]

[0045] The entire tunnel consists of multiple monitoring areas, and real-time monitoring of the safety level of each area is equivalent to assessing the overall safety status of the tunnel.

[0046] (4) Macro-level traffic characteristics:

[0047] The macro-traffic characteristic mtf consists of eight variables, denoted as mtf = (v mean ,v std ,k,p1,p2,p3,c cam ,c lane (See Table 1 for specific meanings.) Assume we need to evaluate the security level y of the m-th monitored area at time t. For example... Figure 2 As shown, macroscopic traffic characteristics and lane and camera information of four road segments belonging to the m-th and (m+1)-th monitoring areas are collected during the time interval Δt before time t, denoted as x=(t b (mtf0, mtf1, mtf2, mtf4). The whole day is divided into n equal parts. time A timebox, t b The timebox ID to which t belongs, MTF i correspond Figure 2 Macroscopic traffic characteristics of the i-th road segment.

[0048] Table 1 Macroscopic Traffic Characteristics

[0049] feature meaning <![CDATA[v mean ]]> Average vehicle speed (km / h) <![CDATA[v std ]]> Vehicle speed standard deviation (km / h) k Traffic density (vehicles / km) <![CDATA[p1]]> Small cars as a percentage <![CDATA[p2]]> Proportion of mid-to-large-sized vehicles <![CDATA[p3]]> The proportion of vehicles carrying hazardous chemicals <![CDATA[c cam ]]> Current camera monitoring area ID <![CDATA[c lane ]]> Lane ID

[0050] (5) Definition of the MF-TSE Problem: Given the macroscopic traffic characteristics, lanes, cameras, and time information x of a monitored area, the MF-TSE problem aims to assess the safety level y of that area. In practice, this invention estimates the macroscopic characteristics of each monitored area using traffic video over Δt seconds and organizes them into data features x. These features are then input into a classification model to predict the safety level of each area, thereby issuing real-time warnings. The safety level of each area is updated every Δt seconds. To continuously update the model, specific trajectory data will be sent to the model as a data stream over several tens of hours (extraction of microscopic trajectory data takes several hours). The goal is to predict the safety level of each area more accurately and quickly, and to continuously update the model based on the data stream.

[0051] The deep learning model architecture integrating multi-lane interaction features designed in this embodiment of the invention is used to accurately and in real-time predict the safety level of each monitored area through macroscopic traffic features, and is required to continuously update the model based on data flow. Figure 3 As shown, the framework mainly includes: a feature encoding layer, a single-lane information extraction module, and a safety level prediction module. The framework is described below using a two-lane road as an example:

[0052] (1) Feature Encoding Layer: Responsible for mapping the numerical attribute features in macroscopic traffic features to high-dimensional vectors and injecting additional information (lane ID, camera ID, time bin). According to the macroscopic traffic feature settings in Table 1, the data sample x = (t b The vectors mtf0, mtf1, mtf2, and mtf3 are 33-dimensional vectors that will be encoded into matrices. (d is the encoding dimension). Concat(·) represents vertical matrix concatenation, and W and b represent the linear transformation matrix and bias, respectively.

[0053] 1) Time coding and lane coding: Lane ID c lane and timebox ID t b Treating it as a category attribute, define a trainable embedding matrix. and Given c lane and t b Its embedding vector can be found.

[0054] 2) Traffic Feature Coding: The six categories of macroscopic traffic features, excluding the camera monitoring area ID and lane ID, are all numerical attributes, i.e., the aforementioned numerical attribute features. For each type of numerical attribute feature x... f (e.g. v) mean ), divide its value range into equally spaced bins and initialize a trainable code for each bin. Let x f The upper and lower bounds are x max ,x min The box width is Δx f Then define the embedding matrix. Given x f0 Its box ID is If the value exceeds the range, it will be truncated.

[0055] 3) Camera code: Camera IDC cam It has spatial location characteristics, and its encoding matrix is ​​generated using positional encoding. The generation method is as follows: [eq:pe]

[0056]

[0057] Where i is the camera index and j is the dimension index.

[0058] 4) Coding fusion: For each macroscopic traffic feature x f Its final encoding is the sum of the encoded vectors:

[0059]

[0060] Each road segment contains six macroscopic traffic features, and each sample x contains four road segments. Therefore, the multi-segment joint feature matrix E = Concat(E0, E1, E2, E3) can be obtained. Let be the encoding matrix for the i-th segment.

[0061] (2) Single-lane information extraction module: This module organizes information from the macroscopic traffic characteristics themselves and extracts the interaction features between two segments of the same lane in a road tunnel. The input is the encoding matrix of the two road segments in the same lane. Output the processed matrix Note that each lane requires a single-lane information extraction module, referred to as a lane block. Next, we will first describe the processing flow of the lane block, and then introduce its underlying components in detail.

[0062] 1) Processing flow: The coding matrix E of the two road segments upstream and downstream of the same lane is... a and E b The inputs are then fed into their respective road segment modules. Finally, the outputs from both road segment modules are processed. Connect them together and input them into the feedforward god network FFN2. Finally, the output of FFN2 (using...) Add two residual connections to the representation and generate the processed encoding matrix. This yields an enhanced road segment representation carrying the spatiotemporal interaction characteristics within the same lane. The detailed process is as follows:

[0063]

[0064] 2) Road Segment Module: This module is the core component of the lane block module, used to extract the characteristics of macroscopic traffic features and the interaction information between different road segments within the same lane. It consists of two feedforward FFN1 networks, a multi-head attention module, and several residual connections, as shown in the diagram. Figure 4 As shown. The outputs of the first and second residual connections are denoted as follows: The detailed calculation process is as follows:

[0065]

[0066] scaling factor Used to control network variance fluctuations. The above process is abbreviated as follows:

[0067] 3) Underlying components:

[0068] Multi-head attention: This group is used to fuse information from two road segments. Let it contain H heads, and the input be... (n is a positive integer). The h-th head is calculated as follows:

[0069]

[0070] A (h) =SoftMax(Q (h) K (h)T ),O (h) =A (h) V (h)

[0071] in

[0072] Horizontally concatenate the outputs of all heads and perform a linear transformation:

[0073] O a =Concat horizontal ([O (1) O (2) ,…,O (H) ])W a

[0074] in This module's operation can be abbreviated as O. a =MHA(X) q ,X k ,X v ).

[0075] Feedforward God Network FFN1: This module is used for feature extraction. Let the input be... (where n is the characteristic number), the calculation process is as follows:

[0076] O1 = X F1 W1+b1,O2=Dropout(Relu(O1))

[0077] O3=O2W2+b2,O F1 =Dropout(Relu(O3))

[0078] in And d′ is usually greater than d. The operation of this module is abbreviated as O. F1 =FFN1(X F1 ).

[0079] The feedforward super-network FFN2: This module is used for feature interaction. Let the input be... (where n is the characteristic number), the calculation process is as follows:

[0080] O5 = Dropout(Relu(O4))

[0081] O6=O5W4+b4,O F2 =Dropout(Relu(O6)) T

[0082] in

[0083] This module's operation can be abbreviated as O. F2 =FFN2(X F2 This yields an enhanced road segment representation that carries the spatiotemporal interaction characteristics within the lane.

[0084] (3) Safety Level Prediction Module: This module integrates all road segment coding information (enhanced road segment representation carrying spatiotemporal interaction characteristics within lanes) to output the probability distribution of the safety level of the monitored area. Since lane changes are prohibited in tunnels, the safety level of the monitored area is determined by the road segment with the lowest safety level. Therefore, each lane is first predicted independently, and then the overall prediction results are combined. Taking a two-lane tunnel as an example (segments 0 and 2 belong to the left lane, and sections 1 and 3 belong to the right lane), the processing flow is as follows:

[0085] S left =FFN(Concat(E p0 E p2 ))W trans +b trans

[0086] S right =FFN(Concat(E p1 E p3 ))W trans +b trans

[0087] S single =Concat(E left E right W single +b single

[0088] Where FFN(·) represents FFN2(FFN1(·)), but its parameter dimensions are specially set:

[0089] Here and

[0090] To comprehensively consider all lane features, the entire embedding matrix is ​​used for overall prediction:

[0091] S overall =FFN(Concat(E p0 E p1 E p2 E p3 ))W trans +b trans

[0092] The FFN(·) parameter is set to Output

[0093] Finally, the two scores are fused through a linear layer, and the probability distribution, i.e., the security level prediction result, is obtained through a softmax layer.

[0094] S = Concathorizontal (S single ,S overall )

[0095] p = Softmax(SW) inte +b inte )

[0096] in

[0097] (4) Training of deep learning models that integrate multi-lane interaction features:

[0098] This invention trains the model based on the cross-entropy loss function, which is:

[0099]

[0100] Among them, y i p is the one-hot label of the i-th sample. i The model output is optimized using the Adam optimizer, and overfitting is prevented by weight decay.

[0101] The following are experiments on the deep learning model that integrates multi-lane interaction features as described in this invention:

[0102] The experimental dataset for this invention was collected from a highway tunnel in Shanxi, China. The speed limit in this tunnel is 70 km / h. Fourteen cameras were selected and continuously installed on the tunnel ceiling, collecting video surveillance footage for 24 hours. The cameras were spaced 150 meters apart, and each camera provided 6-megapixel video. Through video processing techniques such as target detection, multi-target tracking, and vehicle re-identification, microscopic trajectory data of 27,842 vehicles traveling inside the tunnel were ultimately obtained.

[0103] At each time t, we select the minimum TTC (Traffic Time Tolerance) of vehicles within the monitoring area of ​​each camera as the basis for classifying the safety level of that monitoring area. This time is then used as an anchor point to obtain the macroscopic traffic characteristics of the monitoring area in the preceding Δt seconds. Each vehicle is used at most once to calculate the minimum TTC time in each monitoring area. Next, we classify the safety levels based on the TTC time, obtaining 88,929 data samples. Among them, the number of data samples for safety levels 0, 1, 2, and 3 are 5,401, 31,044, 10,771, and 41,713, respectively. Finally, we divide the processed dataset into training, validation, and test sets in a 7:1:2 ratio.

[0104] To evaluate the effectiveness of these methods, we used four metrics: recall, precision, F1 score, and ROC_AUC. These metrics are widely used to evaluate the effectiveness of classification models. Because the final dataset has an unbalanced distribution of the four classes, we did not use accuracy as an evaluation metric; instead, the above metrics are weighted. It is important to note that all four metrics range from 0 to 1, and higher values ​​for recall, precision, F1 score, and ROC_AUC indicate greater method effectiveness. The test results are shown in the table below:

[0105]

[0106] Table 2 Headquarters Predicted Results

[0107] As shown in Table 2, in traditional machine learning methods, the overall performance of the two ensemble methods (RF and XGBoost) is significantly better than that of the two single learner methods (SVM and RF). In this classification task, XGBoost outperforms RF overall. Among deep learning methods, methods specifically designed for tabular data (TabNet and DANet) outperform Transformer, CNN, and MLP overall, indicating that deep learning methods optimized for tabular data are more suitable for traffic safety assessment tasks. Among all deep learning methods, our model achieves the best results across all metrics. Among all methods, XGBoost achieves the best performance on almost all metrics. However, our model's performance is comparable to XGBoost. Considering that the decision tree of the GBDT method is non-differentiable, frequent retraining from scratch in online prediction scenarios would result in extremely low learning efficiency for the GBDT method. Our model, however, is a deep learning method, and its mini-batch training mode enables efficient updates in online tasks with large-scale data. Therefore, we believe that considering both prediction performance and online learning capabilities, our model achieves the best prediction performance.

[0108] The above description is merely a preferred embodiment of the present invention and is not intended to limit the invention. Various modifications and variations can be made to the present invention by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the scope of protection of the present invention.

Claims

1. A real-time tunnel traffic safety assessment method based on traffic conditions and deep learning, characterized in that, include: Real-time acquisition of macroscopic traffic characteristics in various monitoring areas within the tunnel. These macroscopic traffic characteristics include numerical attribute features, lane ID, and camera ID. The numerical attribute features include average vehicle speed, speed standard deviation, traffic density, proportion of small vehicles, proportion of medium and large vehicles, and proportion of hazardous chemical vehicles. The macroscopic traffic features collected in real time are input into a pre-trained deep learning model that integrates multi-lane interaction features. The model includes a feature encoding layer, a single-lane information extraction module, and a safety level prediction module. The feature encoding layer is used to map the numerical attribute features into high-dimensional vectors and integrate the encoding of time box ID, lane ID, and camera ID to generate a multi-segment joint feature matrix. The single-lane information extraction module is used to extract the interaction features between the upstream and downstream road segments of the corresponding lane based on the multi-segment joint feature matrix, multi-head attention mechanism and residual connection, and finally obtain the enhanced road segment representation carrying the spatiotemporal interaction features within the lane; the safety level prediction module is used to fuse all the enhanced road segment representations carrying the spatiotemporal interaction features within the lane and output the safety level prediction results of each monitoring area. The deep learning model that integrates multi-lane interaction features uses historical macro-traffic features and TTC safety level labels based on micro-trajectory calculations for supervised learning during the training phase.

2. The method according to claim 1, characterized in that, The implementation of the feature encoding layer specifically includes: class encoding of time bin IDs and lane IDs using trainable embedding matrices; position encoding of camera IDs using sine and cosine matrices; embedding encoding of numerical attribute features after binning and discretization; adding the encoded vectors to obtain road segment-level features, and concatenating them to obtain a multi-road segment joint feature matrix.

3. The method according to claim 1, characterized in that, The processing flow of the single-lane information extraction module specifically includes: inputting the encoded upstream and downstream road segments of the same lane into a parallel road segment module; the road segment module extracts the characteristics of its own numerical attribute features and the interaction information between different road segments in the same lane based on the feedforward neural network FFN1, multi-head attention mechanism and residual connection; the outputs of each road segment module are fused with FFN2 through the feedforward neural network, and the original feature information is retained through residual connection, and finally the enhanced road segment representation carrying the spatiotemporal interaction features within the lane is obtained.

4. The method according to claim 1, characterized in that, The safety level prediction module, based on the enhanced road segment representation carrying the spatiotemporal interaction characteristics within the lanes, first performs independent predictions for each lane to obtain independent prediction results S. single Then, an overall prediction is performed to obtain the overall prediction result S. overall Finally, the independent prediction results S are fused through linear layers. single And overall prediction results S overall The security level prediction result is obtained through the softmax layer.

5. The method according to claim 1, characterized in that, It also includes an update mechanism for continuously updating the deep learning model that integrates multi-lane interaction features based on data streams.

6. The method according to claim 1, characterized in that, The TTC safety level classification adopts a multi-threshold dynamic judgment, including: based on the minimum TTC value of vehicles in the monitoring area, three threshold levels of 1 second, 2.5 seconds, and 4 seconds are set to divide the four safety levels.

7. The method according to claim 1, characterized in that, The deep learning model that integrates multi-lane interaction features uses the cross-entropy loss function during training, and uses the Adam optimizer to optimize the model parameters, while preventing overfitting through weight decay.

Citation Information

Patent Citations

  • Tunnel accident risk assessment method, system and equipment

    CN118014349A

  • Vehicle trajectory prediction method based on attention mechanism

    CN118953406A