Traffic Incident Detection Method Based on Multi-Vehicle Interaction Modeling and Risk Propagation
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-07-08
- Publication Date
- 2026-08-11
AI Technical Summary
[0007]本申请提供一种基于多车交互建模与风险传播的交通事件检测方法,用以解决现有方法多车交互建模不足、风险演化过程刻画缺失、事件检测精度与预警提前量不足的问题
[0055] This application provides a traffic incident detection method based on multi-vehicle interaction modeling and risk propagation. The method acquires traffic monitoring video data and decodes it to obtain continuous video frame images. These video frame images are then input into a trained target detection model for analysis and processing to obtain vehicle detection results. A target tracking model is used to correlate the vehicle detection results of the same vehicle in different video frame images to obtain the vehicle's motion trajectory, and the vehicle's motion state information is determined based on the trajectory. A vehicle interaction spatiotemporal graph is constructed, and vehicle risk scores are determined based on the time-series features of the graph and the vehicle's motion trajectory. The vehicle risk scores are then propagated and updated using the interaction relationships between vehicles. Finally, abnormal traffic behaviors are identified based on the final vehicle risk score, motion state information, and pre-set traffic scenario constraints, thus improving the accuracy of traffic incident detection.
Smart Images

Figure CN122551568A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of intelligent transportation systems, and in particular to a traffic incident detection method based on multi-vehicle interaction modeling and risk propagation. Background Technology
[0002] With the continuous expansion of urban traffic, road traffic conditions are becoming increasingly complex, and various traffic anomalies such as vehicle collisions, wrong-way driving, illegal parking, traffic congestion, and vehicle fires or rollovers occur frequently. These anomalies not only affect road traffic efficiency but may also trigger secondary accidents, even causing serious casualties and property damage. Therefore, the automatic detection and identification of abnormal traffic events in traffic surveillance videos is of great significance for improving traffic management efficiency and road safety.
[0003] Currently, traffic incident detection methods primarily rely on the analysis of traffic surveillance video data. Traditional methods typically judge abnormal events based on statistical characteristics such as changes in vehicle speed, distances between vehicles, or traffic flow, using manually set rules or thresholds. However, the applicability of such methods in complex traffic scenarios remains limited, making it difficult to accurately identify various types of abnormal traffic events.
[0004] With the development of computer vision and deep learning technologies, some studies have utilized deep learning models to detect vehicle targets in traffic monitoring images and combined them with multi-object tracking algorithms to obtain vehicle trajectories, thereby analyzing vehicle behavior. However, most existing methods focus on the analysis of single-vehicle motion features, and are insufficient in modeling the interaction relationships between multiple vehicles. In real-world traffic scenarios, many traffic anomalies are often caused by the interaction behaviors between multiple vehicles, such as rear-end collisions or the propagation of traffic congestion. Relying solely on single-vehicle features is insufficient to fully reflect complex traffic behaviors.
[0005] In recent years, graph neural networks have been applied to the field of traffic behavior analysis. By representing vehicles as nodes in a graph structure and using the connections between nodes to describe the interaction behavior between vehicles, multi-vehicle relationship modeling can be achieved. However, existing methods typically only use the graph structure for feature aggregation and lack the ability to model the propagation process of traffic risks between vehicles, thus making it difficult to accurately depict the evolution of traffic anomalies in traffic scenarios.
[0006] Therefore, how to accurately detect vehicle targets and obtain stable vehicle trajectories in traffic monitoring videos, effectively model the spatiotemporal interaction relationships between vehicles, and conduct traffic risk propagation analysis based on this, so as to achieve accurate identification of various abnormal traffic events, remains a technical problem that urgently needs to be solved in the field of traffic incident detection. Summary of the Invention
[0007] This application provides a traffic incident detection method based on multi-vehicle interaction modeling and risk propagation, which addresses the problems of insufficient multi-vehicle interaction modeling, lack of characterization of risk evolution process, and insufficient incident detection accuracy and early warning lead time in existing methods.
[0008] Firstly, this application provides a traffic incident detection method based on multi-vehicle interaction modeling and risk propagation, the method comprising:
[0009] Acquire traffic monitoring video data and decode the traffic monitoring video data to obtain continuous video frame images;
[0010] The video frame images are input into the trained target detection model for analysis and processing to obtain vehicle detection results.
[0011] The vehicle motion trajectory is obtained by associating the vehicle detection results of the same vehicle in different video frame images using a target tracking model, and the vehicle motion state information is determined based on the vehicle motion trajectory.
[0012] Construct a vehicle interaction spatiotemporal graph, determine vehicle risk scores based on the time series characteristics of the vehicle interaction spatiotemporal graph and vehicle motion trajectories, and use the interaction relationships between vehicles to propagate and update the vehicle risk scores.
[0013] Traffic anomalies are identified based on the vehicle's final risk score, motion status information, and pre-defined traffic scenario constraints.
[0014] Optionally, the target detection model is an RT-DETR target detection model based on the Transformer structure. The step of inputting video frame images into the trained target detection model for analysis and processing to obtain vehicle detection results includes:
[0015] Video frame images are input into a feature extraction network for multi-scale feature extraction to obtain feature maps of different resolutions.
[0016] Feature maps of different resolutions are input into the feature fusion module for fusion processing to obtain a fused feature map.
[0017] The fused feature map is input into the query selector for feature sampling to obtain the target query;
[0018] The target query is input into the Transformer decoder for target prediction, resulting in the vehicle's bounding box location, category information, and state classification results.
[0019] Optionally, constructing the vehicle interaction spatiotemporal graph includes:
[0020] Each vehicle in the traffic scene is represented as a node in a graph structure. Each node contains the vehicle's state attribute information, including its position coordinates, speed, and direction of movement.
[0021] The adjacency relationship between nodes is established based on the spatial distance between vehicles. When the Euclidean distance between any two vehicles is less than the preset neighborhood threshold, a connection edge is established between the corresponding two nodes.
[0022] Weight values are assigned to the connecting edges based on the differences in relative distance, relative speed, and direction of motion between the vehicles;
[0023] Based on the nodes, the connecting edges, and the weight values, a vehicle interaction spatiotemporal graph is constructed.
[0024] Optionally, the step of determining the vehicle risk score based on the time-series features of the vehicle interaction spatiotemporal graph and vehicle motion trajectory, and using the interaction relationships between vehicles to propagate and update the vehicle risk score, includes:
[0025] The vehicle's historical trajectory sequence is modeled using a long short-term memory network to extract the time-series features of the vehicle's motion. The historical trajectory sequence includes the vehicle's position coordinates, speed, and direction of motion in multiple consecutive frames.
[0026] Based on the vehicle interaction spatiotemporal graph, a graph attention network is used to learn the features of the interaction relationships between vehicles and extract the spatial interaction features of vehicles.
[0027] By fusing the time-series features of vehicle motion with the spatial interaction features of the vehicle, a comprehensive behavioral feature of the vehicle is obtained.
[0028] The initial risk score of a vehicle is calculated based on its comprehensive behavioral characteristics, and the risk is propagated and updated among neighboring vehicles based on the vehicle interaction spatiotemporal graph to obtain the final risk score of each vehicle. The initial risk score is obtained by mapping the comprehensive behavioral characteristics through a fully connected neural network.
[0029] Optionally, the risk propagation update based on the vehicle interaction spatiotemporal graph among neighboring vehicles satisfies the following formula:
[0030]
[0031] in, Indicates vehicle In the Risk scoring during rounds of iteration Indicates vehicle The collection of vehicles in the neighboring area As a risk maintenance factor, This represents the interaction weight between vehicle i and vehicle j. , This represents the Euclidean distance between the two vehicles. This is the distance attenuation parameter.
[0032] Optionally, the identification of abnormal traffic behavior based on the vehicle's final risk score, motion state information, and preset traffic scenario constraint rules includes:
[0033] Collision risk events are determined based on the change in vehicle distance between adjacent frames and the vehicle's final risk score.
[0034] The determination of a vehicle driving in the wrong direction is based on the vehicle's direction of movement and the prescribed direction of travel on the road.
[0035] Vehicle parking violations are determined based on vehicle speed, vehicle location, and predefined no-parking zones.
[0036] Traffic congestion events are determined based on the average speed of multiple vehicles within the road area;
[0037] Traffic accident events are determined based on the vehicle state classification results output by the target detection model.
[0038] Optionally, the step of using a target tracking model to correlate vehicle detection results of the same vehicle in different video frame images to obtain the vehicle motion trajectory includes:
[0039] Obtain the historical state sequence of each vehicle tracking trajectory established in the previous frame, the historical state sequence including trajectory position information of the most recent N frames;
[0040] Gaussian filtering and Gaussian weighted interpolation are performed sequentially on the historical state sequence to obtain the optimized trajectory prediction position;
[0041] The two-stage association strategy based on the ByteTrack algorithm associates and matches the detection results of the current frame with the optimized trajectory prediction position, and updates the trajectory according to the association and matching results.
[0042] Secondly, this application provides a traffic incident detection device based on multi-vehicle interaction modeling and risk propagation, comprising:
[0043] The acquisition module is used to acquire traffic monitoring video data;
[0044] The first processing module is used to decode traffic monitoring video data to obtain continuous video frame images;
[0045] The second processing module is used to input video frame images into the trained target detection model for analysis and processing to obtain vehicle detection results.
[0046] The second processing module is further configured to use the target tracking model to correlate the vehicle detection results of the same vehicle in different video frame images to obtain the vehicle motion trajectory, and determine the vehicle motion state information based on the vehicle motion trajectory;
[0047] The second processing module is also used to construct a vehicle interaction spatiotemporal graph, determine the vehicle risk score based on the time series features of the vehicle interaction spatiotemporal graph and the vehicle motion trajectory, and use the interaction relationship between vehicles to propagate and update the vehicle risk score.
[0048] The second processing module is also used to identify abnormal traffic behaviors based on the vehicle's final risk score, motion state information, and preset traffic scenario constraint rules.
[0049] Thirdly, this application provides a traffic incident detection device based on multi-vehicle interaction modeling and risk propagation, comprising:
[0050] Memory;
[0051] processor;
[0052] The memory stores computer-executed instructions;
[0053] The processor executes computer execution instructions stored in the memory to implement the traffic incident detection method based on multi-vehicle interaction modeling and risk propagation as described in the first aspect and various possible implementations of the first aspect above.
[0054] Fourthly, this application provides a computer storage medium storing a computer program thereon, the computer program being executed by a processor to implement the traffic incident detection method based on multi-vehicle interaction modeling and risk propagation as described in the first aspect and various possible implementations of the first aspect above.
[0055] This application provides a traffic incident detection method based on multi-vehicle interaction modeling and risk propagation. The method acquires traffic monitoring video data and decodes it to obtain continuous video frame images. These video frame images are then input into a trained target detection model for analysis and processing to obtain vehicle detection results. A target tracking model is used to correlate the vehicle detection results of the same vehicle in different video frame images to obtain the vehicle's motion trajectory, and the vehicle's motion state information is determined based on the trajectory. A vehicle interaction spatiotemporal graph is constructed, and vehicle risk scores are determined based on the time-series features of the graph and the vehicle's motion trajectory. The vehicle risk scores are then propagated and updated using the interaction relationships between vehicles. Finally, abnormal traffic behaviors are identified based on the final vehicle risk score, motion state information, and pre-set traffic scenario constraints, thus improving the accuracy of traffic incident detection. Attached Figure Description
[0056] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this application and, together with the description, serve to explain the principles of this application.
[0057] Figure 1 A flowchart illustrating the traffic incident detection method based on multi-vehicle interaction modeling and risk propagation provided in this application embodiment;
[0058] Figure 2 A schematic diagram of the structure of a traffic incident detection device based on multi-vehicle interaction modeling and risk propagation provided in an embodiment of this application;
[0059] Figure 3 This is a schematic diagram of the structure of a traffic incident detection device based on multi-vehicle interaction modeling and risk propagation, provided in an embodiment of this application.
[0060] The accompanying drawings illustrate specific embodiments of this application, which will be described in more detail below. These drawings and descriptions are not intended to limit the scope of the concept in any way, but rather to illustrate the concept of this application to those skilled in the art through reference to particular embodiments. Detailed Implementation
[0061] To make the objectives, technical solutions, and advantages of this application clearer, the technical solutions of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0062] The terms "first," "second," "third," "fourth," etc. (if present) in the specification, claims, and accompanying drawings of this invention are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that embodiments of the invention described herein can be implemented in orders other than those illustrated or described herein.
[0063] In this application, the terms "exemplary" or "for example" are used to indicate examples, illustrations, or descriptions. Any embodiment or design described as "exemplary" or "for example" in this application should not be construed as being more preferred or advantageous than other embodiments or designs. Specifically, the use of terms such as "exemplary" or "for example" is intended to present the relevant concepts in a specific manner.
[0064] The technical solution of this application and how the technical solution of this application solves the above-mentioned technical problems are described in detail below with specific embodiments. These specific embodiments can be combined with each other, and the same or similar concepts or processes may not be described again in some embodiments. The embodiments of this application will now be described with reference to the accompanying drawings.
[0065] Figure 1 This is a flowchart illustrating the traffic incident detection method based on multi-vehicle interaction modeling and risk propagation provided in an embodiment of this application. Figure 1 As shown, the traffic incident detection method based on multi-vehicle interaction modeling and risk propagation provided in this embodiment includes:
[0066] S1: Acquire traffic monitoring video data and decode the traffic monitoring video data to obtain continuous video frame images.
[0067] Specifically, the original video stream is obtained from the traffic monitoring system and decoded to obtain consecutive video frame images arranged in chronological order. In an optional embodiment, after obtaining the original frame images, preprocessing operations are performed: First, noise filtering is performed, using Gaussian filtering or median filtering to remove random noise introduced by uneven lighting, sensor thermal noise, etc., in the monitoring image, so as to avoid interference with subsequent feature extraction; second, color space conversion is performed, converting the original BGR format to RGB or YUV format to match the color space used during model training, eliminating color shift problems caused by inconsistent color spaces; finally, image normalization is performed to a fixed resolution, uniformly scaling frame images from different sources and of different sizes to the input size required by the model, and normalizing pixel values to the [0,1] or [−1,1] interval, so that the input data distribution is consistent with that during model training, thereby ensuring the stability and accuracy of inference.
[0068] S2: Input the video frame images into the trained target detection model for analysis and processing to obtain vehicle detection results.
[0069] The target detection model is the RT-DETR target detection model based on the Transformer structure.
[0070] Specifically, the video frame images are input into the trained target detection model for analysis and processing to obtain vehicle detection results. This includes: inputting the video frame images into a feature extraction network for multi-scale feature extraction to obtain feature maps of different resolutions; inputting the feature maps of different resolutions into a feature fusion module for fusion processing to obtain a fused feature map; inputting the fused feature map into a query selector for feature sampling to obtain a target query; and inputting the target query into a Transformer decoder for target prediction to obtain the vehicle's bounding box position, category information, and state classification results.
[0071] In an optional embodiment, the training process of the object detection model includes:
[0072] (1) Dataset Creation: Traffic monitoring image frames were extracted from public datasets or self-collected data and labeled using data annotation tools (such as LabelImg, Roboflow, etc.). The annotation categories included three types: normal vehicles, vehicles on fire, and overturned vehicles. The bounding box coordinates (x, y, u, h) and category label of each vehicle were annotated for each image. The dataset was ensured to cover various challenging scenarios such as lighting, weather, and occlusion to improve the robustness of the model.
[0073] (2) Model Training: The RT-DETR detection network architecture was implemented in the PyTorch deep learning framework. The training hyperparameters were set as follows: initial learning rate of 0.01, decayed using a cosine annealing strategy, with the learning rate coefficient decreasing by 0.1 every 20 epochs; batch size of 32-64; AdamW optimizer (weight decay of 10⁻⁴); and training epochs of 100-150. The loss function was a weighted combination of GTFocalLoss and GIoULoss to enhance the learning ability for small targets and difficult samples.
[0074] (3) Model evaluation: After training, the performance of the model is evaluated using a test set, and adjustments and optimizations are made based on the evaluation results.
[0075] S3: Use the target tracking model to correlate the vehicle detection results of the same vehicle in different video frame images to obtain the vehicle motion trajectory, and determine the vehicle motion state information based on the vehicle motion trajectory.
[0076] Specifically, the vehicle motion trajectory is obtained by associating the vehicle detection results of the same vehicle in different video frame images using a target tracking model, and the vehicle motion state information is determined based on the vehicle motion trajectory, including the following steps:
[0077] S31: Obtain the historical state sequence of each vehicle tracking trajectory established in the previous frame.
[0078] The historical state sequence includes trajectory position information from the most recent N frames.
[0079] S32: Perform Gaussian filtering and Gaussian weighted interpolation on the historical state sequence in sequence to obtain the optimized trajectory prediction position.
[0080] S33: The two-stage association strategy based on the ByteTrack algorithm associates and matches the detection results of the current frame with the optimized trajectory prediction position, and updates the trajectory according to the association matching results.
[0081] Specifically, the ByteTrack algorithm uses a cascaded matching algorithm to associate data. It calculates the similarity between targets based on their motion and appearance features, and matches the targets in the current frame with existing trajectories. The ByteTrack algorithm updates the trajectory based on the results of the data association. For targets that are successfully matched, the trajectory is extended. For targets that are not matched, they are treated as new targets and new trajectories are created.
[0082] In an optional embodiment, the training process of the target tracking model includes:
[0083] A trained object detection model is used to detect objects in consecutive video frames. The detection boxes of the same vehicle in adjacent frames are connected to form an initial trajectory. The trajectories are manually labeled or automatically stitched together, and each trajectory is assigned a unique ID to form a tracking dataset containing trajectory IDs, bounding box sequences, and timestamps.
[0084] Furthermore, the extracted feature vectors and annotation information are used to train the ByteTrack network. The model weights are initialized with weights that have been pre-trained on a large-scale dataset. Then, the model is trained on the tracking dataset constructed above. After training, the performance of the model is evaluated using a test set, and adjustments and optimizations are made based on the evaluation results.
[0085] S4: Construct a vehicle interaction spatiotemporal graph, determine the vehicle risk score based on the time series characteristics of the vehicle interaction spatiotemporal graph and vehicle motion trajectory, and use the interaction relationship between vehicles to propagate and update the vehicle risk score.
[0086] Specifically, constructing a vehicle interaction spatiotemporal graph includes: representing each vehicle in the traffic scene as a node in a graph structure, with each node containing the vehicle's state attribute information, including position coordinates, speed, and direction of movement; establishing adjacency relationships between nodes based on the spatial distance between vehicles, and establishing a connection edge between the corresponding two nodes when the Euclidean distance between any two vehicles is less than a preset neighborhood threshold; assigning weight values to the connection edges based on the differences in relative distance, relative speed, and direction of movement between vehicles, with the weight values representing the interaction strength between the two vehicles; and constructing a vehicle interaction spatiotemporal graph based on nodes, connection edges, and weight values, which is used to describe the dynamic interaction relationships between vehicles in the traffic scene.
[0087] The weight values of the connecting edges can be calculated in the following ways: the distance between vehicles is weighted by the Gaussian radial basis function based on Euclidean distance, or weighted according to speed similarity and direction consistency, so that the weight values of the connecting edges between vehicle pairs that are closer in distance, have similar speeds, and have consistent directions are larger.
[0088] Specifically, vehicle risk scores are determined based on the time-series characteristics of vehicle interaction spatiotemporal graphs and vehicle motion trajectories, and the vehicle risk scores are propagated and updated using the interaction relationships between vehicles, including:
[0089] S41: Use a long short-term memory network to model the historical trajectory sequence of vehicles and extract the time series features of vehicle motion.
[0090] The historical trajectory sequence includes the vehicle's position coordinates, speed, and direction of motion across multiple consecutive frames.
[0091] Specifically, a Long Short-Term Memory (LSTM) network is used to encode the vehicle trajectory sequence to extract dynamic change features in the time dimension. The hidden layer dimension of the LSTM network is set to 256, and the time-dependent representation is obtained by inputting sequence features frame by frame.
[0092] More specifically, the trajectory sequences of each vehicle are first cropped and normalized to a fixed length T (e.g., 64 frames) using a sliding window method. For samples with insufficient trajectory length, zero-padding or linear interpolation is used to pad them to ensure that the input sequence length is consistent.
[0093] Furthermore, multi-dimensional motion features are extracted from the vehicle detection bounding box and trajectory information of each frame, including: (a) the vehicle center coordinate sequence (x... t ,y t (b) Detect changes in the width and height of the detection frame (w) t ,h t (c) Vehicle velocity and acceleration vector (v) t ,a t (d) Vehicle motion direction angle θ t The velocity and acceleration are calculated by the position difference between adjacent frames.
[0094] The above features are concatenated along the time dimension to form a time series feature matrix:
[0095]
[0096] Where T represents the time series length (T=64) and D represents the feature dimension.
[0097] S42: Based on the vehicle interaction spatiotemporal graph, a graph attention network is used to learn the features of the interaction relationships between vehicles and extract the spatial interaction features of the vehicles.
[0098] Specifically, the Graph Attention Network (GAT) uses four attention heads, each with a hidden layer dimension of 256. It uses an attention mechanism to weighted aggregate information from neighboring nodes to obtain a spatial interaction feature representation of the vehicle.
[0099] More specifically, nodes With nodes The attention weights between them satisfy the following formula:
[0100]
[0101] in, Represents a node The set of neighboring nodes, For nodes With nodes Attention score between them.
[0102] Understandably, using graph neural networks to represent the spatial distance and motion relationships between vehicles avoids the limitations of traditional methods that only focus on the characteristics of a single vehicle, and can accurately capture conflicts and risks in the process of multi-vehicle interaction.
[0103] S43: The time series features and spatial interaction features are fused to obtain the comprehensive behavioral features of the vehicle.
[0104] In the feature fusion stage, the temporal features extracted by LSTM and the spatial features learned by GAT are integrated in the fusion layer. Specifically, a multi-head self-attention mechanism is used to weight and fuse the two types of features to obtain the comprehensive spatiotemporal feature vector of the vehicle.
[0105] S44: Calculate the initial risk score of the vehicle based on the comprehensive behavioral characteristics, and update the risk score among neighboring vehicles based on the vehicle interaction spatiotemporal graph to obtain the final risk score of each vehicle.
[0106] Specifically, the initial risk score is obtained by mapping the comprehensive behavioral features through a fully connected neural network, satisfying the following formula:
[0107]
[0108] in, Indicates vehicle The comprehensive behavioral feature vector, This is the network weight matrix. For the weight vector, For bias terms, For activation function, The sigmoid function is used to make the risk score output range [0,1].
[0109] In an optional embodiment, the fully connected neural network is trained in an end-to-end manner, and the loss function is defined as:
[0110]
[0111] in, To predict losses using risk scoring, mean squared error (MSE) is used for calculation; This is the regression regularization term, used to suppress model overfitting. During training, the Adam optimizer is used for parameter updates, with a learning rate of 0.0005, a batch size of 32, and 100 training epochs.
[0112] Specifically, risk propagation updates are achieved through iterative diffusion on the vehicle interaction spatiotemporal graph, with the iterative formula being:
[0113]
[0114] in, Indicates vehicle In the Risk score during round iteration (within the range of [0,1]). Indicates vehicle The collection of vehicles in the neighboring area As a risk maintenance factor, , This represents the interaction weight between vehicle i and vehicle j. , This represents the Euclidean distance between the two vehicles. This is the distance attenuation parameter.
[0115] Through multiple iterations (e.g., K=3 rounds), potential risks in traffic scenarios can be dynamically propagated in the vehicle interaction network, thereby more accurately reflecting the risk evolution process in complex traffic environments.
[0116] S5: Identify abnormal traffic behaviors based on the vehicle's final risk score, motion status information, and preset traffic scenario constraint rules.
[0117] After obtaining vehicle risk scores and their temporal changes, traffic anomalies are identified and classified by combining the relative motion relationships between vehicles and traffic rules. Using the vehicle risk scores obtained in the above steps as prior information, and combining vehicle trajectory characteristics and traffic scenario constraints, different types of traffic events are determined.
[0118] Specifically, setting up vehicles At any moment Risk score ,vehicle With vehicles The Euclidean distance between them is The vehicle speed is The direction of vehicle movement is By performing time-series analysis on the above indicators, it is possible to detect various traffic anomalies, including:
[0119] (a) Collision risk detection
[0120] When the relative distance between two vehicles decreases rapidly within a short period of time, and the vehicle risk score is high, it is considered a potential collision risk. The specific determination rules are as follows:
[0121] and
[0122] in, This represents the change in distance between vehicles, when it is less than a threshold. This indicates that the distance between vehicles is rapidly decreasing; This represents the vehicle's overall risk score. When the above conditions are met consecutively for several frames (e.g., 3 frames), it is determined to be a collision risk event.
[0123] (b) Reverse detection
[0124] Driving against the flow of traffic is determined by the angle between the vehicle's direction of movement and the lane direction. Let the lane direction be... The direction of vehicle movement is When the included angle between the two satisfies:
[0125]
[0126] Furthermore, if this state persists for more than 10 consecutive frames, it can be determined that the vehicle is driving in the wrong direction. To reduce false judgments caused by short-term detection errors, the detection results are smoothed through a time window, and the wrong-way driving event alarm is triggered only when the conditions are met consecutively.
[0127] (c) Illegal parking detection
[0128] Vehicle parking violations are determined through a comprehensive assessment of vehicle speed, position changes, and area constraints. When the vehicle speed meets the following criteria:
[0129]
[0130] If the vehicle's center position changes by less than a set threshold within a certain time period, and this change lasts for more than 60 seconds, while the vehicle is located within a predefined no-parking zone, then the vehicle is deemed to have committed illegal parking. No-parking zones are typically predefined using area markings or map information provided by road management authorities and are loaded during the system initialization phase.
[0131] (d) Congestion detection
[0132] Congestion events are determined by the overall traffic conditions of a road segment. Let the set of vehicles within a certain monitored area be denoted as . Then the region at time The average vehicle speed is:
[0133]
[0134] When the average speed of vehicles in the area meets the following conditions:
[0135]
[0136] If the duration of this state is greater than or equal to 30 seconds, a traffic congestion event is determined to have occurred on that road segment. To avoid misjudgments caused by instantaneous traffic fluctuations, a sliding time window is used to smooth the calculation of the average speed.
[0137] (e) Accident detection: Mark fire or rollover states directly identified by the target detection model as accidents.
[0138] Understandably, combining specific quantitative criteria with deep learning scoring avoids the problems of overly rigid rules or insufficient generalization ability of learning models in traditional methods, and can more effectively distinguish between legal driving behavior and abnormal events.
[0139] In an optional embodiment, the trained detection, tracking, and risk calculation models are exported in ONNX format. They are then optimized using inference engines such as TensorRT or OpenVINO and deployed on roadside edge computing devices (GPUs or dedicated chips). The real-time processing flow is as follows: video frame capture and preprocessing, RT-DETR detection inference, ByteTrack tracking and association, LSTM+GAT feature extraction and risk scoring, and event rule judgment and alarm. The total end-to-end latency is controlled within 200ms, meeting the 30fps video processing requirements. Difficult example data is continuously collected during online operation, and the model is regularly updated and iteratively optimized.
[0140] The traffic incident detection method based on multi-vehicle interaction modeling and risk propagation provided in this application involves acquiring traffic monitoring video data and decoding the video data to obtain continuous video frame images. These video frame images are then input into a trained target detection model for analysis and processing to obtain vehicle detection results. A target tracking model is used to correlate the vehicle detection results of the same vehicle in different video frame images to obtain the vehicle's motion trajectory, and the vehicle's motion state information is determined based on the vehicle's motion trajectory. A vehicle interaction spatiotemporal graph is constructed, and a vehicle risk score is determined based on the time-series features of the vehicle interaction spatiotemporal graph and the vehicle's motion trajectory. The vehicle risk score is then propagated and updated using the interaction relationships between vehicles. Finally, abnormal traffic behaviors are identified based on the vehicle's final risk score, motion state information, and preset traffic scenario constraint rules, thereby improving the accuracy of traffic incident detection.
[0141] Figure 2 This is a schematic diagram of a traffic incident detection device based on multi-vehicle interaction modeling and risk propagation, provided as an embodiment of this application. Figure 2 As shown, the traffic incident detection device 200 based on multi-vehicle interaction modeling and risk propagation provided in this embodiment includes:
[0142] Module 201 is used to acquire traffic monitoring video data;
[0143] The first processing module 202 is used to decode traffic monitoring video data to obtain continuous video frame images;
[0144] The second processing module 203 is used to input video frame images into the trained target detection model for analysis and processing to obtain vehicle detection results.
[0145] The second processing module 203 is further configured to use the target tracking model to associate the vehicle detection results of the same vehicle in different video frame images to obtain the vehicle motion trajectory, and determine the vehicle motion state information based on the vehicle motion trajectory;
[0146] The second processing module 203 is also used to construct a vehicle interaction spatiotemporal graph, determine the vehicle risk score based on the vehicle interaction spatiotemporal graph and the time series features of the vehicle motion trajectory, and use the interaction relationship between vehicles to propagate and update the vehicle risk score.
[0147] The second processing module 203 is also used to identify abnormal traffic behaviors based on the vehicle's final risk score, motion state information, and preset traffic scenario constraint rules.
[0148] The traffic incident detection device based on multi-vehicle interaction modeling and risk propagation provided in this embodiment can execute the traffic incident detection method based on multi-vehicle interaction modeling and risk propagation provided in the above method embodiment. Its implementation principle and technical effect are similar, and will not be described in detail here.
[0149] Figure 3 This is a schematic diagram of the structure of a traffic incident detection device based on multi-vehicle interaction modeling and risk propagation, provided as an embodiment of this application. Figure 3 As shown in the embodiment of this application, the traffic incident detection device based on multi-vehicle interaction modeling and risk propagation is provided. The traffic incident detection device 300 based on multi-vehicle interaction modeling and risk propagation includes: a receiver 301, a transmitter 302, a processor 303, and a memory 304.
[0150] Receiver 301 is used to receive instructions and data;
[0151] Transmitter 302 is used to send commands and data;
[0152] Memory 304 is used to store computer-executed instructions;
[0153] The processor 303 is used to execute computer execution instructions stored in the memory 304 to implement the various steps of the traffic incident detection method based on multi-vehicle interaction modeling and risk propagation in the above embodiments. For details, please refer to the relevant descriptions in the foregoing embodiments of the traffic incident detection method based on multi-vehicle interaction modeling and risk propagation.
[0154] Optionally, the memory 304 can be either standalone or integrated with the processor 303.
[0155] When the memory 304 is set up independently, the electronic device also includes a bus for connecting the memory 304 and the processor 303.
[0156] This application embodiment also provides a computer storage medium storing computer execution instructions. When the processor executes the computer execution instructions, it implements the traffic incident detection method based on multi-vehicle interaction modeling and risk propagation as described above by the traffic incident detection device based on multi-vehicle interaction modeling and risk propagation.
[0157] It will be understood by those skilled in the art that all or some of the steps, systems, or apparatuses disclosed above, and their functional modules / units, can be implemented as software, firmware, hardware, or suitable combinations thereof. In hardware implementations, the division between functional modules / units mentioned in the above description does not necessarily correspond to the division of physical components; for example, a physical component may have multiple functions, or a function or step may be performed collaboratively by several physical components. Some or all physical components may be implemented as software executed by a processor, such as a central processing unit, digital signal processor, or microprocessor, or as hardware, or as an integrated circuit, such as an application-specific integrated circuit (ASIC). Such software may be distributed on a computer-readable medium, which may include computer storage media (or non-transitory media) and communication media (or transient media). As is known to those skilled in the art, the term computer storage media includes volatile and non-volatile, removable and non-removable media implemented in any method or technology for storing information (such as computer-readable instructions, data structures, program modules, or other data). Computer storage media include, but are not limited to, RAM, ROM, EEPROM, flash memory or other memory technologies, CD-ROM, digital versatile disc (DVD) or other optical disc storage, magnetic cartridges, magnetic tape, disk storage or other magnetic storage devices, or any other medium that can be used to store desired information and can be accessed by a computer. Furthermore, it is well known to those skilled in the art that communication media typically contain computer-readable instructions, data structures, program modules, or other data in modulated data signals such as carrier waves or other transmission mechanisms, and may include any information delivery medium.
[0158] Other embodiments of this application will readily occur to those skilled in the art upon consideration of the specification and practice of the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of this application that follow the general principles of this application and include common knowledge or customary techniques in the art not disclosed herein. The specification and examples are to be considered exemplary only, and the true scope and spirit of this application are indicated by the following claims.
[0159] It should be understood that this application is not limited to the precise structure described above and shown in the accompanying drawings, and various modifications and changes can be made without departing from its scope. The scope of this application is limited only by the appended claims.
Claims
1. A traffic incident detection method based on multi-vehicle interaction modeling and risk propagation, characterized in that, The method includes: Acquire traffic monitoring video data and decode the traffic monitoring video data to obtain continuous video frame images; The video frame images are input into the trained target detection model for analysis and processing to obtain vehicle detection results. The vehicle motion trajectory is obtained by associating the vehicle detection results of the same vehicle in different video frame images using a target tracking model, and the vehicle motion state information is determined based on the vehicle motion trajectory. Construct a vehicle interaction spatiotemporal graph, determine vehicle risk scores based on the time series features of the vehicle interaction spatiotemporal graph and vehicle motion trajectories, and use the interaction relationships between vehicles to propagate and update the vehicle risk scores. Traffic anomalies are identified based on the vehicle's final risk score, motion status information, and pre-defined traffic scenario constraints.
2. The method according to claim 1, characterized in that, The target detection model is an RT-DETR target detection model based on the Transformer structure. The process of inputting video frame images into the trained target detection model for analysis and processing yields vehicle detection results, including: Video frame images are input into a feature extraction network for multi-scale feature extraction to obtain feature maps of different resolutions. Feature maps of different resolutions are input into the feature fusion module for fusion processing to obtain a fused feature map. The fused feature map is input into the query selector for feature sampling to obtain the target query; The target query is input into the Transformer decoder for target prediction, resulting in the vehicle's bounding box location, category information, and state classification results.
3. The method according to claim 1, characterized in that, The construction of the vehicle interaction spatiotemporal graph includes: Each vehicle in the traffic scene is represented as a node in a graph structure. Each node contains the vehicle's state attribute information, including its position coordinates, speed, and direction of movement. The adjacency relationship between nodes is established based on the spatial distance between vehicles. When the Euclidean distance between any two vehicles is less than the preset neighborhood threshold, a connection edge is established between the corresponding two nodes. Weight values are assigned to the connecting edges based on the differences in relative distance, relative speed, and direction of motion between the vehicles; Based on the nodes, the connecting edges, and the weight values, a vehicle interaction spatiotemporal graph is constructed.
4. The method according to claim 3, characterized in that, The process of determining vehicle risk scores based on time-series features of vehicle interaction spatiotemporal graphs and vehicle motion trajectories, and using the interaction relationships between vehicles to propagate and update vehicle risk scores, includes: The vehicle's historical trajectory sequence is modeled using a long short-term memory network to extract the time-series features of the vehicle's motion. The historical trajectory sequence includes the vehicle's position coordinates, speed, and direction of motion in multiple consecutive frames. Based on the vehicle interaction spatiotemporal graph, a graph attention network is used to learn the features of the interaction relationships between vehicles and extract the spatial interaction features of vehicles. By fusing the time-series features of vehicle motion with the spatial interaction features of the vehicle, a comprehensive behavioral feature of the vehicle is obtained. The initial risk score of a vehicle is calculated based on its comprehensive behavioral characteristics, and the risk is propagated and updated among neighboring vehicles based on the vehicle interaction spatiotemporal graph to obtain the final risk score of each vehicle. The initial risk score is obtained by mapping the comprehensive behavioral characteristics through a fully connected neural network.
5. The method according to claim 4, characterized in that, The risk propagation update based on the vehicle interaction spatiotemporal graph among neighboring vehicles satisfies the following formula: in, Indicates vehicle In the Risk scoring during rounds of iteration Indicates vehicle The collection of vehicles in the neighboring area As a risk maintenance factor, This represents the interaction weight between vehicle i and vehicle j. , This represents the Euclidean distance between the two vehicles. This is the distance attenuation parameter.
6. The method according to claim 2, characterized in that, The identification of abnormal traffic behavior based on the vehicle's final risk score, motion state information, and preset traffic scenario constraint rules includes: Collision risk events are determined based on the change in vehicle distance between adjacent frames and the vehicle's final risk score. The determination of a vehicle driving in the wrong direction is based on the vehicle's direction of movement and the prescribed direction of travel on the road. Vehicle parking violations are determined based on vehicle speed, vehicle location, and predefined no-parking zones. Traffic congestion events are determined based on the average speed of multiple vehicles within the road area; Traffic accident events are determined based on the vehicle state classification results output by the target detection model.
7. The method according to claim 1, characterized in that, The method of using a target tracking model to correlate vehicle detection results of the same vehicle in different video frame images to obtain the vehicle motion trajectory includes: Obtain the historical state sequence of each vehicle tracking trajectory established in the previous frame, the historical state sequence including trajectory position information of the most recent N frames; Gaussian filtering and Gaussian weighted interpolation are performed sequentially on the historical state sequence to obtain the optimized trajectory prediction position; The two-stage association strategy based on the ByteTrack algorithm associates and matches the detection results of the current frame with the optimized trajectory prediction position, and updates the trajectory according to the association and matching results.
8. A traffic incident detection device based on multi-vehicle interaction modeling and risk propagation, characterized in that, The device includes: The acquisition module is used to acquire traffic monitoring video data; The first processing module is used to decode traffic monitoring video data to obtain continuous video frame images; The second processing module is used to input video frame images into the trained target detection model for analysis and processing to obtain vehicle detection results. The second processing module is further configured to use the target tracking model to correlate the vehicle detection results of the same vehicle in different video frame images to obtain the vehicle motion trajectory, and determine the vehicle motion state information based on the vehicle motion trajectory; The second processing module is also used to construct a vehicle interaction spatiotemporal graph, determine the vehicle risk score based on the time series features of the vehicle interaction spatiotemporal graph and the vehicle motion trajectory, and use the interaction relationship between vehicles to propagate and update the vehicle risk score. The second processing module is also used to identify abnormal traffic behaviors based on the vehicle's final risk score, motion state information, and preset traffic scenario constraint rules.
9. A traffic incident detection device based on multi-vehicle interaction modeling and risk propagation, characterized in that, The device includes: Memory; processor; The memory stores computer-executed instructions; The processor executes the computer execution instructions stored in the memory to implement the traffic incident detection method based on multi-vehicle interaction modeling and risk propagation as described in any one of claims 1-7.
10. A computer storage medium, characterized in that, The computer storage medium stores computer execution instructions, which, when executed by a processor, are used to implement the traffic incident detection method based on multi-vehicle interaction modeling and risk propagation as described in any one of claims 1-7.