Urban expressway vehicle conflict risk prediction method and device, equipment and medium
By acquiring and preprocessing the vehicle trajectory and traffic flow data of urban expressways, combining membership function and fuzzy rules, extracting and fusion of time and space characteristics, high-accuracy prediction of vehicle conflict risks is achieved, and the problem of low accuracy of risk prediction in the prior art is solved.
Patent Information
- Application Number
- CN202411914615.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-24
- Publication Date
- 2025-04-15
- Estimated Expiration
- 2044-12-24
AI Technical Summary
In the prior art, the accuracy of predicting conflict risk of urban expressway vehicles is not high, mainly due to the limited equipment deployment and the one-sidedness of risk judgment indicators.
A method for predicting conflict risk of urban expressway vehicles is proposed. By obtaining the first data set including vehicle trajectory data and traffic flow data, pre-processing is performed to obtain conflict severity indicators and conflict risk probability indicators, integrating it with membership function and fuzzy rules, temporal and spatial characteristics are extracted, and fusion is performed to predict risk at future moments of the vehicle.
It effectively improves the accuracy of predicting vehicle conflict risks on urban expressways, can more comprehensively analyze vehicle conflict risks, reduce the incidence of traffic accidents, and improve the level of road traffic safety.
Smart Images

Figure CN119832730A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of traffic data processing, and in particular to a method and device, equipment and medium for predicting vehicle conflict risks on urban expressways. Background Art
[0002] In related technologies, the analysis and warning of vehicle conflict risks mainly rely on the data collected by roadside monitoring equipment and vehicle-mounted equipment for analysis. However, the deployment of such equipment is limited, so it can only collect data on specific sections of the road, which may lead to low accuracy of risk warnings for the entire road section. In addition, the current conflict risk judgment usually uses safety alternative indicators such as TTC (Time to Collision) and PET (Post-Encroachment Time), but these indicators are somewhat one-sided, which also leads to low accuracy of road section risk warnings.
[0003] In summary, the technical problems existing in the relevant technologies need to be improved. Summary of the invention
[0004] The main purpose of the embodiments of the present application is to propose a method and device, equipment and medium for predicting vehicle conflict risks on urban expressways, which can effectively improve the accuracy of predicting vehicle conflict risks on urban expressways.
[0005] To achieve the above-mentioned purpose, one aspect of an embodiment of the present application provides a method for predicting the risk of vehicle collision on an urban expressway, the method comprising the following steps:
[0006] Acquire a first data set of an urban expressway, wherein the first data set includes vehicle trajectory data and traffic flow data;
[0007] Preprocessing the data in the first data set to obtain a conflict severity index and a conflict risk occurrence probability index;
[0008] Integrate the conflict severity index and the conflict risk occurrence probability index based on the membership function and the fuzzy rule to obtain a current risk index;
[0009] Extracting temporal features and spatial features of the data in the first data set;
[0010] The time feature and the space feature are integrated to obtain a time-space feature;
[0011] The risk of the vehicle at a future moment is predicted based on the current risk index and the spatiotemporal characteristics.
[0012] In some embodiments, obtaining a first data set of urban expressways includes:
[0013] Obtain vehicle trajectory video data on urban expressways;
[0014] Performing vehicle detection on the vehicle trajectory video data by using a preset target detection model to obtain a target vehicle;
[0015] Tracking and analyzing the target vehicle to obtain a target vehicle trajectory;
[0016] extracting traffic flow data from the vehicle trajectory video data according to the vehicle trajectory;
[0017] The first data set is constructed according to the target vehicle trajectory and the traffic flow data.
[0018] In some embodiments, the preprocessing of the data in the first data set to obtain a conflict severity index and a conflict risk occurrence probability index includes:
[0019] Preprocessing the data in the first data set to obtain a second data set;
[0020] Calculating a plurality of indicators to be selected according to the second data set;
[0021] A target indicator is selected from the plurality of candidate indicators according to indicator relevance and risk factors, wherein the target indicator includes the conflict severity indicator and the conflict risk occurrence probability indicator.
[0022] In some embodiments, preprocessing the data in the first data set includes:
[0023] Deleting duplicate data in the first data set;
[0024] The data with abnormal speed in the first data set is cleaned by using the Sigma criterion.
[0025] In some embodiments, the calculation process of the conflict risk occurrence probability index is as follows:
[0026]
[0027] In the formula, Δa represents the acceleration difference between the front and rear vehicles; Δv represents the speed difference between the front and rear vehicles, and d represents the initial distance between the front and rear vehicles.
[0028] In some embodiments, the conflict severity index and the conflict risk occurrence probability index are integrated based on the membership function and the fuzzy rule to obtain the current risk index, including:
[0029] Constructing a first membership function and a second membership function;
[0030] Calculating a first membership degree according to the conflict severity index and the first membership function;
[0031] Calculating a second membership degree according to the conflict risk occurrence probability index and the second membership degree function;
[0032] constructing fuzzy logic according to the fuzzy rules;
[0033] The current risk index is determined according to the first membership degree, the second membership degree and the fuzzy logic.
[0034] In some embodiments, extracting temporal features and spatial features of data in the first data set includes:
[0035] Extracting temporal features of the data in the first data set by using an attention long-term and short-term network model;
[0036] The spatial features of the data in the first data set are extracted through a graph convolutional network model.
[0037] To achieve the above-mentioned purpose, another aspect of the embodiment of the present application provides a device for predicting the risk of vehicle collision on an urban expressway, the device comprising:
[0038] A first module is used to obtain a first data set of urban expressways, wherein the first data set includes vehicle trajectory data and traffic flow data;
[0039] The second module is used to pre-process the data in the first data set to obtain a conflict severity index and a conflict risk occurrence probability index;
[0040] The third module is used to integrate the conflict severity index and the conflict risk occurrence probability index based on the membership function and the fuzzy rule to obtain the current risk index;
[0041] A fourth module is used to extract temporal features and spatial features of the data in the first data set;
[0042] A fifth module is used to fuse the time feature and the space feature to obtain a spatiotemporal feature;
[0043] The sixth module is used to predict the risk of the vehicle at a future moment according to the current risk index and the spatiotemporal characteristics.
[0044] To achieve the above object, another aspect of an embodiment of the present application provides an electronic device, including:
[0045] at least one processor;
[0046] at least one memory for storing at least one program;
[0047] When the at least one program is executed by the at least one processor, the at least one processor implements the above method.
[0048] To achieve the above objective, another aspect of an embodiment of the present application provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and the computer program implements the above method when executed by a processor.
[0049] The embodiments of the present application include at least the following beneficial effects: The present application provides a method and apparatus, device and medium for predicting vehicle conflict risks on urban expressways. The scheme obtains a first data set including vehicle trajectory data and traffic flow data in the urban expressway, pre-processes the data in the first data set to obtain a conflict severity index and a conflict risk occurrence probability index, and then integrates the conflict severity index and the conflict risk occurrence probability index based on a membership function and a fuzzy rule to obtain a current risk index. At the same time, after extracting the time characteristics and spatial characteristics of the data in the first data set, the time characteristics and spatial characteristics are fused to obtain spatiotemporal characteristics, and then the risk of the vehicle at future moments is predicted based on the current risk index and spatiotemporal characteristics, thereby effectively improving the accuracy of vehicle conflict risk prediction on urban expressways. BRIEF DESCRIPTION OF THE DRAWINGS
[0050] Figure 1 is a flow chart of a method for predicting vehicle conflict risks on urban expressways provided in an embodiment of the present application;
[0051] Figure 2 This is a schematic diagram of the photographing effect of a city expressway provided in an embodiment of the present application;
[0052] Figure 3 It is a schematic diagram of the vehicle recognition effect provided by the embodiment of the present application;
[0053] Figure 4 It is a schematic diagram of the vehicle trajectory tracking effect provided by an embodiment of the present application;
[0054] Figure 5 is a schematic diagram of TTC data distribution provided in an embodiment of the present application;
[0055] Figure 6 This is a data distribution diagram of MTTC provided in an embodiment of the present application;
[0056] Figure 7 It is a data distribution diagram of the PSD provided in the embodiment of the present application;
[0057] Figure 8 It is a data distribution diagram of THW provided in an embodiment of the present application;
[0058] Fig. 9is a schematic diagram of the correlation of time measurement indicators provided in an embodiment of the present application;
[0059] Fig.10 is a schematic diagram of fuzzy logic provided in an embodiment of the present application;
[0060] Fig.11 It is a schematic diagram of the fusion of time features and space features provided in the embodiment of the present application;
[0061] Fig.12 It is a structural schematic diagram of a device for predicting vehicle conflict risks on urban expressways provided in an embodiment of the present application;
[0062] Fig.13 It is a schematic diagram of the hardware structure of the electronic device provided in the embodiment of the present application. DETAILED DESCRIPTION
[0063] In order to make the purpose, technical solutions and advantages of the present application clearer, the present application is further described in detail below in conjunction with the accompanying drawings and examples. It should be understood that the specific embodiments described herein are only used to explain the present application and are not intended to limit the present application. When the following description refers to the drawings, unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the embodiments of the present application, they are only examples of devices and methods consistent with some aspects of the embodiments of the present application.
[0064] It is understood that the terms "first", "second", etc. used in this application can be used to describe various concepts in this article, but unless otherwise specified, these concepts are not limited by these terms. These terms are only used to distinguish one concept from another concept. For example, without departing from the scope of the embodiment of the present application, the first information may also be referred to as the second information, and similarly, the second information may also be referred to as the first information. Depending on the context, the words "if" and "if" as used herein can be interpreted as "at the time of" or "when" or "in response to determination".
[0065] The terms "at least one", "multiple", "each", "any", etc. used in this application, at least one includes one, two or more, multiple includes two or more, each refers to each of the corresponding multiple, and any refers to any one of the multiple.
[0066] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those commonly understood by those skilled in the art to which this application belongs. The terms used herein are only for the purpose of describing the embodiments of this application and are not intended to limit this application.
[0067] In the related technologies, since the data collection of vehicle-mounted and roadside equipment depends on advanced sensor technology and a stable communication network, it is impossible to obtain all the data affecting the risk of vehicle conflict on the road section in a timely and accurate manner, which leads to low accuracy in predicting the risk of vehicle conflict. In addition, most algorithms only focus on the behavioral characteristics in the time series and the data is too single, which leads to low accuracy in predicting the risk of vehicle conflict.
[0068] In view of this, an embodiment of the present application provides a method and apparatus, equipment and medium for predicting vehicle conflict risks on urban expressways. After obtaining a first data set including vehicle trajectory data and traffic flow data in an urban expressway, the present application pre-processes the data in the first data set to obtain a conflict severity index and a conflict risk occurrence probability index, and then integrates the conflict severity index and the conflict risk occurrence probability index based on a membership function and a fuzzy rule to obtain a current risk index. At the same time, after extracting the time characteristics and spatial characteristics of the data in the first data set, the time characteristics and spatial characteristics are fused to obtain spatiotemporal characteristics, and then the risk of the vehicle at future moments is predicted based on the current risk index and spatiotemporal characteristics, thereby effectively improving the accuracy of vehicle conflict risk prediction on urban expressways.
[0069] The urban expressway vehicle conflict risk prediction method provided in the embodiment of the present application relates to the field of traffic data processing technology. The urban expressway vehicle conflict risk prediction method provided in the embodiment of the present application can be applied to a terminal, can also be applied to a server, and can also be software running in a terminal or a server. In some embodiments, the terminal can be a smart phone, a tablet computer, a laptop computer, a desktop computer, a smart speaker, a smart watch, and a vehicle-mounted terminal, etc., but is not limited to this; the server side can be configured as an independent physical server, or it can be configured as a server cluster or a distributed system composed of multiple physical servers, and can also be configured as a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, CDN, and big data and artificial intelligence platforms. The server can also be a node server in a blockchain network; the software can be an application that implements the urban expressway vehicle conflict risk prediction method, etc., but is not limited to the above forms.
[0070] The present application can be used in many general or special computer system environments or configurations. For example: personal computers, server computers, handheld or portable devices, tablet devices, multiprocessor systems, microprocessor-based systems, set-top boxes, programmable consumer electronics, network PCs, minicomputers, mainframe computers, distributed computing environments including any of the above systems or devices, etc. The present application can be described in the general context of computer-executable instructions executed by a computer, such as program modules. Generally, program modules include routines, programs, objects, components, data structures, etc. that perform specific tasks or implement specific abstract data types. The present application can also be practiced in distributed computing environments, in which tasks are performed by remote processing devices connected through a communication network. In a distributed computing environment, program modules can be located in local and remote computer storage media including storage devices.
[0071] Figure 1 is an optional flow chart of the method for predicting the risk of vehicle conflict on urban expressways provided in an embodiment of the present application. Figure 1 The method may include but is not limited to steps S101 to S106.
[0072] Step S110, obtaining a first data set of an urban expressway, wherein the first data set includes vehicle trajectory data and traffic flow data;
[0073] Step S120, pre-processing the data in the first data set to obtain a conflict severity index and a conflict risk occurrence probability index;
[0074] Step S130: integrating the conflict severity index and the conflict risk occurrence probability index based on the membership function and the fuzzy rule to obtain the current risk index;
[0075] Step S140, extracting time features and spatial features of data in the first data set;
[0076] Step S150: fusing the time feature and the space feature to obtain the space-time feature;
[0077] Step S160: predict the risk of the vehicle at a future time based on the current risk index and spatiotemporal characteristics.
[0078] In an embodiment of the present application, the process of obtaining the first data set of the urban expressway can be carried out by obtaining vehicle trajectory video data of the urban expressway, performing vehicle detection on the vehicle trajectory video data through a preset target detection model to obtain a target vehicle, then tracking and analyzing the target vehicle to obtain the target vehicle trajectory, extracting traffic flow data from the vehicle trajectory video data according to the vehicle trajectory, and then constructing the first data set based on the target vehicle trajectory and the traffic flow data.
[0079] It is understandable that the present embodiment can use drones to shoot vehicle trajectories on urban expressways within legal and compliant airspace and time to obtain vehicle trajectory video data. Specifically, in order to ensure the comprehensive collection of vehicle trajectory videos on urban expressways, the present embodiment uses drones to shoot highway sections with heavy traffic, and the shooting range covers main straight lines, curves, long distances, and areas with a large number of lanes. At the same time, focus on collecting scenes such as intersections, entry and exit ramps, tunnel entrances and exits, and accident-prone sections, such as inflows, outflows, and speed limit changes. Each video data segment will cover at least one complete scene, with a length of 400-800 meters, a total duration of 2-3 hours, a resolution of 3840x2160, a frequency of 30hz, and a drone altitude of no more than 300m. Data collection will cover peak and off-peak periods, so that the risk of vehicle conflict in different traffic environments can be comprehensively analyzed. Among them, the specific shooting effects are as follows: Figure 2 shown.
[0080] In an embodiment of the present application, after the vehicle trajectory video data is captured, the vehicle trajectory video data can be preliminarily edited and format converted to facilitate the subsequent supplementary data processing process. Then, the target vehicle is identified and tracked based on the vehicle trajectory video data after format conversion to obtain the target vehicle trajectory. Specifically, the present embodiment can identify the target vehicle through the YoloV8 target detection model. Among them, the YoloV8 target detection model can directly predict the position, category and confidence of the target through a regression method, without the need for multi-step processing like the RCNN series. The YOLO algorithm directly feeds the image into the neural network, completes the prediction of the target border, category and confidence at one time, and realizes an end-to-end operation process. It can be understood that the present embodiment can track the target vehicle through the DeepSORT model. Among them, DeepSORT is a multi-target tracking algorithm based on deep learning, which is developed on the basis of the original SORT algorithm. DeepSORT extracts the appearance features of the target by introducing deep learning, thereby improving the tracking accuracy in complex scenes. Due to its high efficiency and robustness, DeepSORT has been widely used in many fields such as video surveillance, intelligent transportation systems, and crowd behavior analysis. Especially in situations where precise tracking of multiple targets is required and the scenes are complex and changeable, DeepSORT has demonstrated its unique advantages.
[0081] In the embodiment of the present application, this embodiment uses YOLOv8 for vehicle detection, and its output bounding box and vehicle features can be used as input for DeepSORT. This seamless integration makes the YOLOv8+DeepSORT model perform well in multi-target vehicle tracking. Specifically, in the application process of this embodiment, Python, PyTorch, OpenCV and other dependent libraries are first installed, and the repositories of YOLOv8 and DeepSORT are cloned from GitHub. After installing the required dependencies, the YOLOv8 pre-trained model is loaded and the detection parameters are set, the collected vehicle trajectory video data is pre-processed, and YOLOv8 is used for vehicle detection to obtain bounding boxes and confidence levels. Next, the bounding box of each detected vehicle is extracted, and the DeepSORT tracker is initialized. The detection results and features are passed to DeepSORT for data association and tracking status updates. Repeat this process on each frame of the video, and visualize the tracking results. Finally, adjust the parameters according to the actual application scenario to optimize performance. Among them, the vehicle recognition effect of this embodiment Figure 3 As shown in Figure 2, the vehicle trajectory tracking effect is as follows: Figure 4 shown.
[0082] After completing the identification of the target vehicle and the tracking of the vehicle trajectory, this embodiment can extract the traffic flow data from the vehicle trajectory video data to form a preliminary vehicle trajectory data set. The preliminary vehicle trajectory data set contains the following information: the serial number of each frame of video, the unique identifier of the vehicle, the horizontal and vertical coordinate positions of the four vertices of the vehicle border, and the length and width of the vehicle. Using the data in the preliminary vehicle trajectory data set, traffic parameters such as the real-time speed, acceleration and deceleration, and headway of the vehicle can be calculated. Combining these calculated parameters with the preliminary vehicle trajectory data set will construct a more comprehensive and rich first data set.
[0083] In the embodiment of the present application, the process of preprocessing the data in the first data set to obtain the conflict severity index and the conflict risk occurrence probability index includes but is not limited to the following steps:
[0084] Step S210, preprocessing the data in the first data set to obtain a second data set;
[0085] Step S220, calculating and obtaining a plurality of indicators to be selected according to the second data set;
[0086] Step S230: selecting a target indicator from a number of candidate indicators according to indicator relevance and risk factors, wherein the target indicator includes a conflict severity indicator and a conflict risk occurrence probability indicator.
[0087] It is understandable that since the collection of the first data set may be affected by various factors, such as shooting weather, environmental conditions, vehicle trajectory target detection and tracking algorithm errors, etc., the first data set inevitably has certain errors. In order to improve the data quality and the accuracy of the analysis, this embodiment cleans and preprocesses the first data set to identify and correct these errors. Specifically, this embodiment first deletes the duplicate records in the first data set to avoid redundancy. Then, the data of the vehicle temporarily parked on the lane in the first data set is removed, and the data of the vehicle driving too slowly is cleaned according to the 3σ principle. For data points with abnormal speed changes, such as an instantaneous drop from high speed to zero, the missing speed value is estimated by calculating the distance and time interval between adjacent data points. At the same time, the data with abnormal speed in the first data set is further cleaned using the 3σ principle. In addition, for the data in the first data set where the longitude and latitude continue to change and the speed is displayed as zero, the speed value is corrected by calculating the distance and time difference between adjacent coordinate points. Finally, for the repeated measurement data of the same vehicle at the same time point, the first valid data record is retained to ensure the consistency of the data.
[0088] It is understandable that the 3σ (sigma) criterion is also called the Laida criterion. It first assumes that a set of test data contains only random errors, calculates and processes them to obtain the standard deviation, and then determines an interval according to a certain probability. It is believed that any error exceeding this interval is not a random error but a gross error, and the data with gross errors are eliminated. The specific comparison process is as follows:
[0089] μ-3σ <X<μ+3σ;
[0090] In the formula, μ represents the mean of the data, σ represents the standard error of the data, and X represents a single data point in the data set.
[0091] In the embodiment of the present application, since the time measurement index combines the distance and speed factors, the present embodiment uses the time measurement index for conflict analysis. Specifically, the time measurement index includes but is not limited to TTC, MTTC, TIT, PSD, THW, MTC, DRAC, IMTTC, etc. Among them, TTC (Time to Collision) is the collision time, which means the time required for the vehicle to reach the collision point with the obstacle in front (such as another vehicle, pedestrian or other fixed obstacle) at the current speed and driving direction of the vehicle if the driving state is not changed. Its data distribution is as follows: Figure 5 The specific calculation process is as follows:
[0092]
[0093] In the formula, TTC represents the collision time; x r and vr , respectively represent the relative distance and relative speed of the front and rear vehicles; x i and x p represent the positions of the rear of the front car and the front of the rear car respectively, and x p >x i ;v l and v p Represent the speed of the front and rear vehicles respectively.
[0094] It is understandable that TTC has many derivative indicators. MTTC (modified time-to-collision) is a variant of TTC. Compared with TTC, MTTC takes into account the acceleration and speed of the following vehicle and the leading vehicle, making MTTC more robust. Its data distribution is as follows: Figure 6 As shown. In MTTC, the conditions for vehicle collision are as follows:
[0095]
[0096] In the formula, v f and v1 represent the speeds of the front and rear vehicles respectively, a f and a1 represent the acceleration of the leading and trailing vehicles respectively.
[0097] The calculation formula of MTTC is as follows:
[0098]
[0099] In the formula, Δa represents the acceleration difference between the front and rear vehicles; Δv represents the speed difference between the front and rear vehicles, and d represents the initial distance between the front and rear vehicles.
[0100] TIT (Time Integrated TTC) is used to measure the severity of traffic conflicts. Its calculation formula is as follows:
[0101]
[0102] In the formula, t represents the time step; T represents the research time period, TTC * Indicates TTC threshold, TTC i (t) represents the TTC value of vehicle i at time t, τ sc Indicates a time interval.
[0103] PSD (Potential Safety Distance) is a concept used to evaluate the safety margin when following a vehicle. It is the ratio of the actual distance between the two vehicles to the distance required to avoid a collision at the Maximum Available Deceleration Rate (MADR). Its data distribution is as follows: Figure 7A PSD value greater than 1 indicates that the actual distance is sufficient to avoid a collision at the maximum available deceleration, while a PSD value less than 1 indicates that the distance is insufficient and there is a risk of collision. The PSD calculation formula is as follows:
[0104]
[0105] In the formula, D represents the current distance between the vehicle and the vehicle in front, v represents the current speed of the vehicle, and a max Represents the maximum deceleration that the vehicle can exert (usually set to 3.924m / s to take into account friction and gravity).
[0106] THW (time headway) is an important indicator for evaluating driving safety. It reflects the time interval between the front ends of two consecutive vehicles passing through a certain section in a vehicle queue traveling on the same lane. Its data distribution is as follows: Figure 8 The calculation formula of THW is as follows:
[0107]
[0108] In the formula, D represents the distance between the front vehicles and v represents the speed of the rear vehicle.
[0109] It is understandable that the correlation of the above time metrics is as follows Fig. 9 As shown. Due to the high correlation among some conflict risk indicators (time measurement indicators), they may reflect the same aspect of the data, resulting in information redundancy. At the same time, it may cause multicollinearity problems, making the indicator estimation of the model unstable and difficult to interpret. Therefore, before the next step of conflict analysis, this embodiment comprehensively considers the correlation of indicators to ensure the validity, accuracy and practicality of the analysis results. For example, TTC cannot well represent the conflict risk when the speeds of the front and rear vehicles are close, and cannot serve as a conflict risk indicator in some cases. In addition, the selection of conflict risk indicators should be based on the severity of the conflict and the probability of the occurrence of the conflict risk. Based on this, this embodiment selects THW as the conflict severity indicator and MTTC as the conflict risk probability indicator.
[0110] In the embodiment of the present application, the process of integrating the conflict severity index and the conflict risk occurrence probability index based on the membership function and the fuzzy rule to obtain the current risk index includes but is not limited to the following deficiencies:
[0111] Step S310, constructing a first membership function and a second membership function;
[0112] Step S320, calculating a first membership degree according to the conflict severity index and the first membership function;
[0113] Step S330: Calculate the second membership degree according to the conflict risk occurrence probability index and the second membership function;
[0114] Step S340: Construct fuzzy logic according to fuzzy rules;
[0115] Step S350: Determine the current risk index according to the first membership degree, the second membership degree and the fuzzy logic.
[0116] It can be understood that the first membership function is as follows:
[0117]
[0118] In the formula, x represents the upper limit constant, which can be determined according to the actual situation.
[0119] In this embodiment, the first membership degree can be calculated according to the conflict severity index. Specifically, when MTTC > 6s, it is determined as a low risk occurrence probability. When MTTC is between 6 seconds and infinity, the first membership degree starts to increase from 0 and reaches 1 when exceeding a certain threshold (for example, reaching 1). When 4s < MTTC ≤ 6s, it is determined as a medium risk occurrence probability. When MTTC is between 4 seconds and 6 seconds, the first membership degree increases from 0 to 1. When MTTC ≤ 4, it is determined as a high risk occurrence probability. When MTTC is between 0 and 4 seconds, the first membership degree decreases from 1 to 0.
[0120] The second membership function is as follows:
[0121]
[0122] In this embodiment, the second membership degree can be calculated according to the conflict risk occurrence probability index. Specifically, when THW > 2s, it is regarded as safe. When 1.1s < THW ≤ 2s, it is determined as a medium risk severity. When THW is between 1.1 seconds and 2 seconds, the second membership degree increases from 0 to 1. When THW ≤ 1.1s, it is determined as a high risk severity. When THW is between 0 and 1.1 seconds, the second membership degree decreases from 1 to 0.
[0123] In this embodiment, through the above membership functions, the previous data is quantified into the degree of belonging to the fuzzy sets (L, M, H), so as to synthesize the two indexes of conflict frequency and conflict severity into an overall risk index as the current risk index through fuzzy logic.
[0124] In the embodiment of the present application, the formulation of fuzzy rules mainly complies with the following three criteria: when the conflict frequency and conflict severity are both low, the overall risk index is also low; when the conflict frequency is low and the conflict severity is high, or when the conflict frequency is high and the conflict severity is low, the overall risk index is medium; when the conflict frequency and conflict severity are both high, the overall risk index is high. Based on the above three criteria, 9 fuzzy rules are formulated. The specific fuzzy logic is as follows: Fig.10 shown.
[0125] It is understandable that the propagation of vehicle conflict risk is not only continuous in time, but also diffuse in space. Therefore, in order to more accurately predict and prevent vehicle conflict risks, this embodiment comprehensively considers the propagation characteristics of the time dimension and the space dimension, and predicts and optimizes the vehicle conflict risk in an all-round and multi-angle manner, thereby improving the accuracy of risk prediction and effectively reducing the probability of traffic accidents. Specifically, this embodiment first divides the data in the first data set into a training set, a validation set, and a test set at a ratio of 70%, 15%, and 15%, to facilitate the training of subsequent models.
[0126] For the prediction of time series, since the vehicle conflict risk data is a dynamic time series, this embodiment extracts time features from the time correlation of consecutive frames in the sequence. Specifically, traditional neural networks have difficulty in dealing with long-term dependency problems in time series, while RNN can capture this dependency to a certain extent through its cyclic structure. Although the basic RNN has the problem of gradient disappearance or explosion, improved variants such as LSTM (Long Short-Term Memory Network) can handle long-term dependency more effectively.
[0127] Among them, LSTM is a solution proposed to overcome the short-term memory problem. It introduces an internal mechanism called "gate" to regulate the information flow. Therefore, the present invention chooses to use LSTM to extract spatial features. The LSTM unit includes three gates, where the input gate is used to determine which information in the current input data needs to be updated to the cell state, the forget gate determines which information needs to be discarded from the cell state, and determines which information in the cell state needs to be output to the next hidden state.
[0128] Forget gate: f t =σ(W f ·[h t-1 ,x t ]+b f );
[0129] Input gate: i t =σ(W i ·[h t-1 ,x t ]+b i );
[0130] Output gate: o t =σ(W o ·[h t-1 ,x t ]+b o );
[0131] New candidate cell state:
[0132] Cell Status:
[0133] Hidden state:
[0134] In the formula, W f , W i , W o is the weight matrix, b f 、b i 、b o is the bias value, ⊙ is the element-wise multiplication operation, and tanh is the hyperbolic tangent function.
[0135] In addition, this embodiment chooses to add an attention layer on the basis of LSTM to build a new attention-LSTM model to achieve better prediction results. Among them, the attention mechanism allows the network to selectively focus on specific time steps when processing the input sequence. This mechanism can help the network better understand and utilize the key information in the input sequence.
[0136] During the application process, this embodiment first converts the input data into a three-dimensional array with the dimensions [number of samples, time steps, number of features]. Next, a Sequential model is created and an LSTM layer is added to it. Each LSTM layer needs to specify the number of neurons and the shape of the input. Through cross-validation, the model performance is best when the number of neurons is set to 128 and the time step is 3s. After the LSTM layer, an attention layer is added after the LSTM layer. This embodiment chooses to use the Attention layer provided by TensorFlow Addons to assign different weights to the outputs of different time steps, and then applies the softmax function to ensure that the sum of the weights is 1. Add a fully connected layer as the output layer after the attention layer. The number of neurons in this layer should match the dimension of the output result. After completing the model structure, the mean square error loss function and the Adam optimizer are used to compile the model. Then, the model is trained by calling the fit method of the model, passing in the training data and labels, as well as the defined batch size, number of training rounds and other training parameters to obtain the time features.
[0137] For the spatial feature prediction of the spatial dimension, this embodiment uses a graph convolutional network model. Among them, the graph convolutional network model is a neural network that performs convolution operations on the graph, which can automatically learn the feature representation of the graph structure and realize feature extraction and classification on the graph. The graph convolutional network model has the ability to process large-scale graph data and has good scalability and efficiency. In traffic conflict analysis, it is usually necessary to process a large amount of trajectory data. The graph convolutional network model can efficiently process this data and improve the speed and accuracy of the analysis. Specifically, the graph convolutional network model is as follows:
[0138]
[0139] In the formula, H (l) Represents the node feature matrix of the lth layer; Represents the adjacency matrix of the graph; W (l) is the weight matrix of the lth layer; σ(·) represents the activation function.
[0140] Specifically, this embodiment first divides the data in the first data set into several regions according to lanes and lengths, numbers each region, and converts the input data into a three-dimensional array whose dimensions are [lane, region, number of features]. Next, a graph convolutional network model is created and a graph convolutional layer is added to it. Each graph convolutional layer needs to specify the number and size of filters, as well as the shape of the input. Through cross-validation, the model performance is best when the number of filters is set to 32 and the filter size is 3x3. After the graph convolutional layer, a global average pooling layer is added to summarize the spatial features of each sample. Subsequently, a fully connected layer is added as the output layer, and the number of neurons in this layer should match the dimension of the output result. After completing the model structure, the Adam optimizer is used to compile the model. Then, the model is trained by calling the fit method of the model, passing in the training data and labels, as well as the defined batch size, number of training rounds and other training parameters to obtain spatial features.
[0141] It can be understood that, after obtaining the time feature and the space feature, the present embodiment Fig.11 As shown in the figure, the time feature (Time) and the spatial feature (spatial) are fused, and the output result can be input into the fully connected layer to map the fused features to the category space, and then the probability distribution of each type of risk can be obtained, and then the probability of the risk that may occur in the future can be predicted in combination with the current risk index. Specifically, the output result of the fully connected layer is a vector of size (N,3), where N represents the batch size, each row corresponds to the output vector of an input sample, and 3 represents the three vehicle conflict risk levels L, M, and H. The maximum probability in the category is the result of the conflict risk prediction.
[0142] From the above content, it can be seen that the method provided in the embodiment of the present application has the following beneficial effects:
[0143] This application uses the high-altitude perspective and flexible maneuverability of drones to obtain more comprehensive and real-time traffic flow data, so that vehicle conflict risks can be analyzed more comprehensively. This data set provides important data support for the analysis of vehicle conflict risks on urban expressways, and can be used to develop more accurate and practical vehicle conflict risk prediction models, thereby effectively reducing the incidence of traffic accidents and improving road traffic safety. In addition, this embodiment can more comprehensively reflect the propagation characteristics of vehicle conflict risks in the time and space dimensions by fusing time features and space features, thereby more accurately predicting potential conflict risks and providing an important reference for traffic management and decision-making.
[0144] Reference Fig.12 The embodiment of the present application provides a device for predicting vehicle conflict risks on urban expressways, the device comprising:
[0145] The first module 1210 is used to obtain a first data set of an urban expressway, wherein the first data set includes vehicle trajectory data and traffic flow data;
[0146] The second module 1220 is used to pre-process the data in the first data set to obtain a conflict severity index and a conflict risk occurrence probability index;
[0147] The third module 1230 is used to integrate the conflict severity index and the conflict risk occurrence probability index based on the membership function and the fuzzy rule to obtain the current risk index;
[0148] The fourth module 1240 is used to extract the time characteristics and spatial characteristics of the data in the first data set;
[0149] The fifth module 1250 is used to fuse the time feature and the space feature to obtain the time-space feature;
[0150] The sixth module 1260 is used to predict the risk of the vehicle at a future moment based on the current risk index and spatiotemporal characteristics.
[0151] It can be understood that the contents of the above method embodiments are all applicable to the present device embodiments, the functions specifically implemented by the present device embodiments are the same as those of the above method embodiments, and the beneficial effects achieved are also the same as those achieved by the above method embodiments.
[0152] The embodiment of the present application also provides an electronic device, the electronic device includes a memory and a processor, the memory stores a computer program, and the processor implements the above-mentioned urban expressway vehicle conflict risk prediction method when executing the computer program. The electronic device can be any smart terminal including a tablet computer, a car computer, etc.
[0153] It can be understood that the contents of the above method embodiments are all applicable to the present device embodiments, the functions specifically implemented by the present device embodiments are the same as those of the above method embodiments, and the beneficial effects achieved are also the same as those achieved by the above method embodiments.
[0154] See also Fig.13 , Fig.13 The hardware structure of an electronic device of another embodiment is illustrated, and the electronic device includes:
[0155] The processor 1310 may be implemented by a general-purpose CPU (Central Processing Unit), a microprocessor, an application-specific integrated circuit (ASIC), or one or more integrated circuits, and is used to execute relevant programs to implement the technical solutions provided in the embodiments of the present application;
[0156] The memory 1320 can be implemented in the form of a read-only memory (ROM), a static storage device, a dynamic storage device, or a random access memory (RAM). The memory 1320 can store an operating system and other application programs. When the technical solution provided in the embodiment of this specification is implemented by software or firmware, the relevant program code is stored in the memory 1320, and the processor 1310 calls and executes the urban expressway vehicle conflict risk prediction method of the embodiment of this application;
[0157] Input / output interface 1330, used to implement information input and output;
[0158] The communication interface 1340 is used to realize the communication interaction between the device and other devices. The communication can be realized through a wired manner (such as USB, network cable, etc.) or a wireless manner (such as mobile network, WIFI, Bluetooth, etc.);
[0159] bus 1350 , which transmits information between the various components of the device (e.g., processor 1310 , memory 1320 , input / output interface 1330 , and communication interface 1340 );
[0160] The processor 1310 , the memory 1320 , the input / output interface 1330 , and the communication interface 1340 are connected to each other in communication within the device via a bus 1350 .
[0161] An embodiment of the present application also provides a computer-readable storage medium, which stores a computer program. When the computer program is executed by a processor, the above-mentioned urban expressway vehicle conflict risk prediction method is implemented.
[0162] It can be understood that the contents of the above method embodiments are all applicable to the present storage medium embodiments, the functions specifically implemented by the present storage medium embodiments are the same as those of the above method embodiments, and the beneficial effects achieved are also the same as those achieved by the above method embodiments.
[0163] The memory, as a non-transient computer-readable storage medium, can be used to store non-transient software programs and non-transient computer executable programs. In addition, the memory may include a high-speed random access memory, and may also include a non-transient memory, such as at least one disk storage device, a flash memory device, or other non-transient solid-state storage device. In some embodiments, the memory may optionally include a memory remotely disposed relative to the processor, and these remote memories may be connected to the processor via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0164] The embodiments described in the embodiments of the present application are intended to more clearly illustrate the technical solutions of the embodiments of the present application and do not constitute a limitation on the technical solutions provided in the embodiments of the present application. Those skilled in the art will appreciate that with the evolution of technology and the emergence of new application scenarios, the technical solutions provided in the embodiments of the present application are also applicable to similar technical problems.
[0165] Those skilled in the art will appreciate that the technical solutions shown in the figures do not constitute a limitation on the embodiments of the present application, and may include more or fewer steps than shown in the figures, or a combination of certain steps, or different steps.
[0166] The device embodiments described above are merely illustrative, and the units described as separate components may or may not be physically separated, that is, they may be located in one place or distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0167] Those skilled in the art will appreciate that all or some of the steps in the methods disclosed above, and the functional modules / units in the systems and devices may be implemented as software, firmware, hardware, or a suitable combination thereof.
[0168] The terms "first", "second", "third", "fourth", etc. (if any) in the specification of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0169] It should be understood that in the present application, "at least one (item)" means one or more, and "plurality" means two or more. "And / or" is used to describe the association relationship of associated objects, indicating that three relationships may exist. For example, "A and / or B" can mean: only A exists, only B exists, and A and B exist at the same time, where A and B can be singular or plural. The character " / " generally indicates that the objects associated before and after are in an "or" relationship. "At least one of the following" or similar expressions refers to any combination of these items, including any combination of single or plural items. For example, at least one of a, b or c can mean: a, b, c, "a and b", "a and c", "b and c", or "a and b and c", where a, b, c can be single or multiple.
[0170] In the several embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the above units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0171] The units described above as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0172] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0173] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including multiple instructions to enable a computer device (which can be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods of various embodiments of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (Read-Only Memory, referred to as ROM), random access memory (Random Access Memory, referred to as RAM), disk or optical disk and other media that can store programs.
[0174] The preferred embodiments of the present invention are described above with reference to the accompanying drawings, but the scope of the rights of the present invention is not limited thereto. Any modification, equivalent substitution and improvement made by a person skilled in the art without departing from the scope and essence of the present invention should be within the scope of the rights of the present invention.
Claims
1. A method for predicting vehicle conflict risks on urban expressways, characterized in that: The method comprises the following steps: Acquire a first data set of an urban expressway, wherein the first data set includes vehicle trajectory data and traffic flow data; Preprocessing the data in the first data set to obtain a conflict severity index and a conflict risk occurrence probability index; Integrate the conflict severity index and the conflict risk occurrence probability index based on the membership function and the fuzzy rule to obtain a current risk index; Extracting temporal features and spatial features of the data in the first data set; The time feature and the space feature are integrated to obtain a time-space feature; The risk of the vehicle at a future moment is predicted based on the current risk index and the spatiotemporal characteristics.
2. The method according to claim 1, characterized in that The step of obtaining a first data set of urban expressways includes: Obtain vehicle trajectory video data on urban expressways; Performing vehicle detection on the vehicle trajectory video data by using a preset target detection model to obtain a target vehicle; Tracking and analyzing the target vehicle to obtain a target vehicle trajectory; extracting traffic flow data from the vehicle trajectory video data according to the vehicle trajectory; The first data set is constructed according to the target vehicle trajectory and the traffic flow data.
3. The method according to claim 1, characterized in that The preprocessing of the data in the first data set to obtain a conflict severity index and a conflict risk occurrence probability index includes: Preprocessing the data in the first data set to obtain a second data set; Calculating a plurality of indicators to be selected according to the second data set; A target indicator is selected from the plurality of candidate indicators according to indicator relevance and risk factors, wherein the target indicator includes the conflict severity indicator and the conflict risk occurrence probability indicator.
4. The method according to claim 3, characterized in that The preprocessing of the data in the first data set includes: Deleting duplicate data in the first data set; The data with abnormal speed in the first data set is cleaned by using the Sigma criterion.
5. The method according to claim 3, characterized in that: The calculation process of the conflict risk probability index is as follows: In the formula, Δa represents the acceleration difference between the front and rear vehicles; Δv represents the speed difference between the front and rear vehicles, and d represents the initial distance between the front and rear vehicles.
6. The method according to claim 1, characterized in that The conflict severity index and the conflict risk occurrence probability index are integrated based on the membership function and the fuzzy rule to obtain the current risk index, including: Constructing a first membership function and a second membership function; Calculating a first membership degree according to the conflict severity index and the first membership function; Calculating a second membership degree according to the conflict risk occurrence probability index and the second membership degree function; constructing fuzzy logic according to the fuzzy rules; The current risk index is determined according to the first membership degree, the second membership degree and the fuzzy logic.
7. The method according to claim 1, characterized in that The extracting the temporal features and spatial features of the data in the first data set includes: Extracting temporal features of the data in the first data set by using an attention long-term and short-term network model; The spatial features of the data in the first data set are extracted through a graph convolutional network model.
8. A device for predicting vehicle conflict risks on urban expressways, characterized in that: The device comprises: A first module is used to obtain a first data set of urban expressways, wherein the first data set includes vehicle trajectory data and traffic flow data; The second module is used to pre-process the data in the first data set to obtain a conflict severity index and a conflict risk occurrence probability index; The third module is used to integrate the conflict severity index and the conflict risk occurrence probability index based on the membership function and the fuzzy rule to obtain the current risk index; A fourth module is used to extract temporal features and spatial features of the data in the first data set; A fifth module is used to fuse the time feature and the space feature to obtain a spatiotemporal feature; The sixth module is used to predict the risk of the vehicle at a future moment according to the current risk index and the spatiotemporal characteristics.
9. An electronic device, characterized in that: include: at least one processor; at least one memory for storing at least one program; When the at least one program is executed by the at least one processor, the at least one processor implements the method according to any one of claims 1 to 7.
10. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the method according to any one of claims 1 to 7 is implemented.
Citation Information
Patent Citations
Mountainous area double-lane highway hidden danger section traffic conflict risk dynamic evaluation method
CN112508392A
Method for predicting short-time traffic risk of road section by utilizing roadside observation data
CN113436432A
Complex scene driving risk prediction method based on multiple time-space diagrams
CN113762473A
Risk assessment method and device for driving scene and computer readable storage medium
CN114162133A
Road section traffic risk identification method based on intra-region conflict space-time correlation characteristics
CN114882699A