Traffic safety risk early warning method and system based on intersection traffic flow information
By collecting and processing traffic flow data at intersections in the traffic risk early warning system, establishing a physical coordinate system and spatiotemporal grid, fusing optical flow field and velocity vector, predicting vehicle trajectories, and constructing collision probabilities, the problem of insufficient characterization of multi-vehicle interaction behavior in traditional methods is solved, and more accurate risk assessment and early warning are achieved.
Patent Information
- Application Number
- CN202511243005.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-09-02
- Publication Date
- 2025-11-18
AI Technical Summary
Existing traffic risk warning methods mostly rely on single sensors or low-dimensional data, which makes it difficult to accurately reflect the multi-vehicle interaction behavior in complex intersection scenarios. The application of optical flow methods in the traffic field lacks an effective mapping with the physical coordinate system, resulting in deviations between risk assessment results and real-world scenarios.
By collecting traffic flow data at intersections, a two-dimensional Cartesian coordinate system is established. The pixel coordinates in the camera video are converted into physical coordinates, a spatiotemporal grid is divided, a physical optical flow field is generated, velocity vectors are fused, the rate of change of direction and information entropy are calculated, vehicle trajectories are predicted, collision probabilities are constructed using Nash equilibrium game theory, risk thresholds are set for early warning, and risks are displayed through a visual interface.
It improves the accuracy of vehicle motion state representation, enhances the ability to identify vehicle directional consistency and abnormal lane-changing behavior, improves the ability to detect potential collision risks in advance, and achieves more accurate risk assessment and early warning.
Smart Images

Figure CN120977144A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of traffic safety monitoring, in particular to a traffic safety risk early warning method and system based on intersection traffic flow information. BACKGROUND
[0002] With the rapid development of intelligent transportation systems, traffic monitoring and risk warning technologies based on sensors and big data analysis have gradually become an important research direction for urban road safety management. With the widespread deployment of multi-modal sensors (including video cameras, millimeter wave radars, V2X communication modules, etc.), the collection capability of traffic flow data has been significantly improved, enabling comprehensive perception of vehicle operating conditions at intersections and arterial roads. The development of computer vision and machine learning methods has made it possible to extract kinematic features such as vehicle speed, direction, and acceleration from video data. Optical flow analysis, object detection, and trajectory prediction technologies have gradually been applied to traffic safety risk modeling, which can reflect the dynamic evolution of traffic flow to some extent.
[0003] Existing traffic risk warning methods still have certain deficiencies. Traditional methods rely heavily on single sensors or low-dimensional data, resulting in insufficient characterization of multi-vehicle interaction behavior in complex intersection scenarios and difficulty in accurately reflecting micro-traffic flow characteristics. Optical flow methods applied in the field of traffic mostly stop at pixel-level motion estimation, lack effective mapping with the physical coordinate system, and are difficult to integrate with actual vehicle motion states, resulting in deviations between risk assessment results and real scenarios. SUMMARY
[0004] In view of the above existing problems, the present application is proposed.
[0005] Therefore, the present application provides a traffic safety risk early warning method and system based on intersection traffic flow information, which solves the problem that traditional methods rely heavily on single sensors or low-dimensional data, resulting in insufficient characterization of multi-vehicle interaction behavior in complex intersection scenarios and difficulty in accurately reflecting micro-traffic flow characteristics. Optical flow methods applied in the field of traffic mostly stop at pixel-level motion estimation, lack effective mapping with the physical coordinate system, and are difficult to integrate with actual vehicle motion states, resulting in deviations between risk assessment results and real scenarios.
[0006] To solve the above technical problems, the present application provides the following technical solutions: In a first aspect, the present application provides a traffic safety risk early warning method based on intersection traffic flow information, which includes, The intersection traffic flow data is collected and preprocessed, the pixel coordinates in the camera video are converted into physical coordinates with the geometric center of the intersection as the coordinate origin, the intersection area is divided into a space-time grid, the traffic density of each grid is calculated, the pixel-level optical flow field is generated by minimizing the energy function, the pixel-level optical flow field is converted into a physical optical flow field, the physical optical flow field is mapped onto the space-time grid to generate an average optical flow vector, and the average optical flow vector and the velocity vector are fused by the least square method to generate a fused velocity vector; The direction angle is calculated by the arctangent function, the number of vehicles in each grid is counted, the probability distribution is calculated, the grid direction information entropy is calculated, the direction change rate of the vehicles in the grid is calculated by the difference of the direction angle, the grid direction information entropy is modified by linear weighting, a threshold is set, a strategy space is defined, and the grid chaos degree is generated by weighted fusion; The future trajectory of each vehicle is predicted based on the kinematic equation, the trajectory intersection time is calculated, the upper limit of the prediction time is set, the vehicles without trajectory intersection are screened out, the minimum distance between the trajectories of two vehicles is calculated, the collision probability is calculated based on the minimum distance, the game payoff function is constructed using the Nash equilibrium game, the strategy probability is iteratively updated by the gradient ascent method, the optimized strategy probability vector is obtained, the grid risk is generated by comprehensively considering the traffic density, the normalized grid chaos degree and the optimized strategy probability vector, and the overall risk of the intersection is calculated by weighted average; The overall risk of the intersection is warned, and a visual interface is constructed to display the overall risk of the intersection.
[0007] As a preferred scheme of the intersection traffic flow information-based traffic safety risk warning method, wherein: the intersection area is divided into a space-time grid, the traffic density of each grid is calculated, the pixel-level optical flow field is generated by minimizing the energy function, and the pixel-level optical flow field is converted into a physical optical flow field, comprising: A two-dimensional Cartesian coordinate system is established with the geometric center of the intersection as the coordinate origin (0, 0), and the pixel coordinates in the camera video are converted into physical coordinates through a calibration matrix; The size of the space-time grid is set using an empirical rule, the intersection area is divided into a space-time grid, each vehicle is assigned to a corresponding grid, and the vehicle ID in the space-time grid is recorded; The traffic density of each grid is calculated; Frame sequences are extracted from the camera video, and the pixel-level optical flow field is generated by minimizing the energy function; A scaling factor is calculated from the camera height and the pixel height measured by the calibration board, and the pixel-level optical flow field is converted into a physical optical flow field based on the scaling factor; Based on the physical coordinates, the physical optical flow field is mapped onto the space-time grid, and the average optical flow vector is generated by weighted averaging of the optical flow points in each grid; The velocity and direction angle are converted into velocity vectors in the intersection center coordinate system. The average optical flow vector and velocity vector are then fused using the least squares method to generate a fused velocity vector.
[0008] As a preferred embodiment of the traffic safety risk early warning method based on intersection traffic flow information described in this invention, the step of calculating the rate of change of vehicle direction within the grid through direction angle difference and correcting the grid direction information entropy through linear weighting includes: Based on the fused velocity vector, the direction angle is calculated using the arctangent function, the number of vehicles in each direction interval within each grid is counted, the probability distribution is calculated, and the grid direction information entropy is calculated based on the probability distribution. The direction change rate of vehicles within the grid is calculated by direction angle difference. Based on the direction change rate, the direction information entropy of the grid is corrected by linear weighting to generate corrected information entropy. Calculate the acceleration vector based on the velocity vector; The percentile method is used to set the threshold for judgment and direction change rate, and the strategy space is defined based on the acceleration vector and direction change rate. Statistically calculate the probabilities of acceleration and lane changing within the neighborhood of the grid; The grid disorder is generated by weighted fusion and then normalized.
[0009] As a preferred embodiment of the traffic safety risk early warning method based on intersection traffic flow information described in this invention, wherein: the calculation of collision probability involves constructing a game payoff function using Nash equilibrium game theory, iteratively updating the strategy probability using the gradient ascent method, and obtaining an optimized strategy probability vector, including: Predict the future trajectory of each vehicle based on kinematic equations; Calculate the time of trajectory intersection based on the velocity vector; Based on the fused velocity and acceleration vectors, an upper limit for the prediction time is set. Filter out points with no intersections. Calculate the minimum distance between the trajectories of the two vehicles; Calculate the collision probability based on the minimum distance; Based on the average optical flow vector and acceleration probability, a game payoff function is constructed using Nash equilibrium game theory. The policy probability is then iteratively updated using the gradient ascent method to obtain the optimized policy probability vector. The grid risk is generated by combining traffic density, normalized grid disorder, and optimized policy probability vector. The overall risk of the intersection is calculated using a weighted average.
[0010] As a preferred embodiment of the traffic safety risk early warning method based on intersection traffic flow information described in this invention, the step of providing risk early warning for the overall risk of the intersection includes: The fixed threshold method is used to set a risk threshold, the overall risk of the intersection is compared with the risk threshold, when the overall risk of the intersection is greater than or equal to the risk threshold, it is judged as an abnormal state, a warning is issued, otherwise it is judged as a normal state, and the monitoring is continued.
[0011] As a preferred scheme of the traffic safety risk early warning method based on intersection traffic flow information, the visualization interface is constructed to display the overall risk of the intersection, including: The visualization interface is constructed by using the visualization tool Matplotlib, and the overall risk of the intersection and the state detection result are displayed in real time. The user who passes the real-name verification is allowed to check.
[0012] As a preferred scheme of the traffic safety risk early warning method based on intersection traffic flow information, the intersection traffic flow data is collected and preprocessed, including: The intersection traffic flow data is collected by a multi-modal sensor, and is denoised and normalized. The traffic flow data includes camera video, speed, direction angle and acceleration data.
[0013] In a second aspect, the application provides a traffic safety risk early warning system based on intersection traffic flow information, including, The collection and processing module is used to collect the intersection traffic flow data, and to denoise and normalize the data. The grid fusion module is used to divide the intersection area into a space-time grid, convert the pixel-level optical flow field into a physical optical flow field, map the physical optical flow field onto the space-time grid, and fuse the optical flow vector and the vehicle speed vector by the least square method. The chaos degree analysis module is used to correct the grid direction information entropy, define a strategy space, and calculate the grid chaos degree. The prediction game module is used to predict the trajectory based on kinematics, calculate the minimum distance and the collision probability, and introduce the Nash equilibrium game to optimize the vehicle behavior strategy. The early warning display module is used to determine the overall risk state by threshold, and display the overall risk of the intersection and the early warning result.
[0014] In a third aspect, the application provides a computer device including a memory and a processor, the memory stores a computer program, wherein the computer program is executed by the processor to implement any step of the traffic safety risk early warning method based on intersection traffic flow information according to the first aspect of the application.
[0015] In a fourth aspect, the present application provides a computer readable storage medium having stored thereon a computer program, wherein the computer program, when executed by a processor, implements any step of the intersection traffic flow information based traffic safety risk early warning method according to the first aspect of the present application.
[0016] The present application has the beneficial effects that: the present application improves the representation accuracy of the vehicle motion state by combining the optical flow field analysis with the velocity vector fusion, enhances the recognition ability of the vehicle direction consistency and abnormal lane changing behavior by combining the direction probability distribution with the information entropy correction, and improves the early discovery ability of the potential collision risk by combining the kinematics prediction with the trajectory intersection analysis. BRIEF DESCRIPTION OF DRAWINGS
[0017] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings needed in the embodiment description will be briefly introduced as follows. Obviously, the drawings in the following description are only some embodiments of the present application, and other drawings can be obtained by those skilled in the art without creative labor.
[0018] Figure 1 The flowchart of the intersection traffic flow information based traffic safety risk early warning method in embodiment 1.
[0019] Figure 2 The schematic diagram of the intersection traffic flow information based traffic safety risk early warning system in embodiment 1. DETAILED DESCRIPTION
[0020] In order to make the above-mentioned purposes, features and advantages of the present application more apparent and easy to understand, the specific embodiments of the present application will be described in detail below with reference to the drawings of the specification.
[0021] In the following description, many specific details are set forth in order to provide a thorough understanding of the present application, but the present application can also be implemented in other ways different from those described herein, and those skilled in the art can make similar generalizations without departing from the connotation of the present application, therefore the present application is not limited to the specific embodiments disclosed below.
[0022] Secondly, the "one embodiment" or "embodiment" referred to herein means that the specific features, structures or characteristics can be included in at least one implementation of the present application. In this specification, "in one embodiment" appearing in different places does not mean the same embodiment, nor is it an independent or alternative embodiment that excludes other embodiments.
[0023] Embodiment 1, refer to Figure 1 and Figure 2For the first embodiment of the application, the embodiment provides a traffic safety risk early warning method based on intersection traffic flow information, comprising the following steps: S1, collecting intersection traffic flow data and preprocessing, taking the geometric center of the intersection as the coordinate origin, converting the pixel coordinates in the camera video to physical coordinates, dividing the intersection area into a space-time grid, calculating the traffic density of each grid, generating a pixel-level optical flow field by minimizing the energy function, converting the pixel-level optical flow field to a physical optical flow field, mapping the physical optical flow field to the space-time grid, generating an average flow vector, and generating a fused velocity vector by least squares fusion of the average flow vector and the velocity vector; Specifically, collecting intersection traffic flow data and preprocessing, including: Collecting intersection traffic flow data through multi-modal sensors and performing denoising and normalization processing; The multi-modal sensor includes a camera, a radar, and a V2X communication module sensor; The traffic flow data includes camera video, speed, direction angle, and acceleration data.
[0024] Multi-source fusion avoids the information missing problem caused by a single sensor, and denoising and normalization processing ensures the comparability between different source data and reduces the calculation deviation caused by sensor differences.
[0025] Further, the intersection area is divided into a space-time grid, the traffic density of each grid is calculated, a pixel-level optical flow field is generated by minimizing the energy function, and the pixel-level optical flow field is converted to a physical optical flow field, including: A two-dimensional Cartesian coordinate system is established with the geometric center of the intersection as the coordinate origin (0, 0), the x-axis is along the main road direction, and the y-axis is perpendicular to the x-axis. The pixel coordinates in the camera video are converted to physical coordinates through a calibration matrix, and the formula is: , Where (x, y) is the physical position, x and y are the physical positions, and represents the position of the vehicle in the two-dimensional Cartesian coordinate system with the intersection center as the origin, is the pixel coordinate of the camera image, M is the calibration matrix, which is pre-calculated through a calibration board experiment and contains internal parameters (focal length, principal point offset) and external parameters (rotation, translation), and is used to map the pixel coordinates to physical coordinates; The space-time grid size is set using an empirical rule, the intersection area is divided into a space-time grid, each vehicle is assigned to the corresponding grid, and the vehicle ID in the space-time grid is recorded; The traffic density of each grid is calculated, taking into account the vehicle residence time, and the formula is: , , wherein is the traffic density of the grid (x, y) at time t, is the residence time of vehicle i in the grid, i is the vehicle index, representing the ID of the i-th vehicle in the grid, is the normalized time unit, used to standardize the traffic density, is the time grid resolution, representing the maximum residence time limit, G is the set of vehicles in the grid, and are the times when vehicle i leaves and enters the grid, respectively; extract the frame sequence from the camera video, apply the Farneback optical flow algorithm to the consecutive video frames, use the Newton method for iterative optimization, and generate the pixel-level optical flow field by minimizing the energy function , representing the motion speed of the pixel in the x, y direction, the formula is: , where J is the energy function, representing the total energy of the optical flow field, which needs to be minimized, I(x, y, t) is the pixel intensity of the time t frame, v and u are the optical flow vector components, representing the pixel speed in the x, y direction, is the regularization parameter, and are the gradients of the optical flow components, controlling the smoothness; calculate the scaling factor by the camera height and the pixel height measured by the calibration board, the formula is: , where S is the scaling factor from pixels to physical distance, h is the camera installation height, is the pixel height of the calibration board in the image; based on the scaling factor, use linear transformation to convert the pixel-level optical flow field to the physical optical flow field, the formula is: , , wherein and are the physical optical flow vector components, f is the video frame rate; based on the physical coordinates, map the physical optical flow field to the space-time grid, and perform weighted average on each optical flow point in the grid to generate the average optical flow vector, the formula is: , wherein is the average optical flow vector of the grid (x, y) at time t, is the vector of the j-th optical flow point in the grid, j is the optical flow point index, is the set of optical flow points in the grid, N is the number of valid optical flow points (non-zero points) in the grid; The speed and direction angle are converted into a speed vector of the intersection center coordinate system, and the formula is: , wherein is the x and y components of the speed vector in the intersection coordinate system, is the speed modulus, is the speed direction angle; The average optical flow vector and the speed vector are fused by the least square method to generate a fused speed vector, and the formula is: , , wherein is the fused speed vector, is the fusion weight, is the real speed, which is set based on the mean value of historical speed data.
[0026] Discretizing the continuous traffic flow into multiple grids can significantly reduce the computational complexity. Grid division facilitates vehicle behavior statistics in a local range. The spatiotemporal grid structure enables the system to capture the time sequence dynamic characteristics of the traffic flow, thereby reflecting the change law of vehicles in different time periods. Mapping the two-dimensional pixel position to the real physical coordinate system enables the optical flow information extracted in the video to correspond to the actual spatial position of the vehicle. By introducing the residence time factor, the calculation of traffic density is more consistent with the actual traffic scene, which can distinguish the difference between fast passing and long-term staying. After conversion to the physical optical flow field, the motion information has actual physical meaning, which is convenient for fusion with vehicle speed, acceleration and other parameters. The weighted average of the mapped optical flow information can be performed in a local spatial range to avoid the interference of single-point noise. The fusion process can compensate for the scale uncertainty of the optical flow method in speed estimation, thereby improving the physical accuracy of the results.
[0027] S2, calculate the direction angle by the inverse tangent function, count the number of vehicles in each grid in the direction interval, calculate the probability distribution, calculate the grid direction information entropy, calculate the direction change rate of the vehicles in the grid by the direction angle difference, correct the grid direction information entropy by linear weighting, set a threshold, define a strategy space, and generate the grid chaos degree by weighted fusion; Specifically, the direction change rate of the vehicles in the grid is calculated by the direction angle difference, and the grid direction information entropy is corrected by linear weighting, including: Based on the fused speed vector, the direction angle is calculated by the inverse tangent function, and the formula is: , wherein is the direction angle of the i-th vehicle, and respectively the x, y components of the fusion velocity vector; The number of vehicles in each direction interval in each grid is counted, and the probability distribution is calculated, with the formula: , wherein is the probability of the direction interval , is the number of vehicles in the direction interval ; Based on the probability distribution, the grid direction information entropy is calculated, and the direction confusion degree is quantified, with the formula: , wherein is the information entropy of the grid (x, y) at time t, is the number of direction intervals; The direction change rate of the vehicles in the grid is calculated by the difference of the direction angle, with the formula: , wherein is the direction change rate, is the time interval, consistent with the time resolution of the space-time grid; Based on the direction change rate, the grid direction information entropy is modified by linear weighting, to generate the modified information entropy, with the formula: , wherein is the modified information entropy of the grid (x, y) at time t, is the linear weighting weight coefficient, balancing the contribution of the direction change to the confusion degree; Based on the velocity vector, the acceleration vector is calculated, with the formula: , wherein a is the acceleration vector; The percentile method is used to set the judgment and direction change rate threshold, and the strategy space is defined based on the acceleration vector and the direction change rate; The strategy space includes determining acceleration when the absolute value of the acceleration component is greater than the judgment threshold, determining deceleration when the absolute value of the acceleration component is less than the judgment threshold, determining maintaining when the absolute value of the acceleration component is less than or equal to the judgment threshold, and determining lane change when the direction change rate is greater than the direction change rate threshold; The probabilities of acceleration and lane change are counted in the neighborhood of the grid, with the formula: , , wherein and are the probabilities of acceleration and lane change, respectively, and are the number of acceleration and lane-changing grids in the neighborhood, respectively, is the total number of grids in the neighborhood; The grid chaos degree is generated by weighted fusion, which emphasizes the contribution of high-risk behaviors (acceleration and lane-changing) to the chaos degree and is normalized, and the formula is: , where is the chaos degree of grid (x, y) at time t.
[0028] The fusion speed vector is directly converted into a direction angle, so that each vehicle has a clear driving direction identifier in a unified coordinate system. The use of the arctangent function avoids the discontinuity problem of traditional tangent calculation at boundary angles (such as 90° or 270°), ensuring stable angle calculation. Discretizing the continuous direction angle into multiple direction intervals can effectively reduce data complexity and facilitate subsequent entropy calculation. Information entropy provides a mathematical basis for describing the order of traffic flow and can accurately reflect the complexity of traffic state. Compared with traditional judgments based on speed or density alone, information entropy can reveal potential conflicts hidden in traffic flow. The difference method can capture the direction changes of vehicles at consecutive times in real time, which is an important means of detecting lane-changing or sudden turning behaviors. The revised information entropy considers the discreteness and dynamic change trend of direction distribution, making the index more close to the real traffic flow state. The weight coefficient adjusts the contribution of direction change in the chaos degree. The acceleration vector provides the longitudinal dynamic characteristics of the vehicle, which complements the direction angle difference and can comprehensively depict driving behaviors. Through neighborhood statistics, not only the behaviors within a single grid are investigated, but also the behavior patterns of adjacent areas are considered, which conforms to the characteristics of "local group effect" in actual roads. As a comprehensive index, grid chaos degree takes into account the contribution of direction distribution, dynamic change, and high-risk behaviors, and can comprehensively reflect the local traffic safety state.
[0029] S3, based on the kinematic equation, predict the future trajectory of each vehicle, calculate the trajectory intersection time, set an upper limit for the prediction time, filter out the vehicles with no trajectory intersection, calculate the minimum distance between the trajectories of two vehicles, based on the minimum distance, calculate the collision probability, use Nash equilibrium game to build the game payoff function, update the strategy probability iteratively through gradient ascent method, obtain the optimized strategy probability vector, generate grid risk by comprehensively considering traffic flow density, normalized grid chaos degree, and optimized strategy probability vector, and calculate the overall risk of the intersection by weighted average; Specifically, the collision probability is calculated, the game payoff function is built using Nash equilibrium game, the strategy probability is updated iteratively through gradient ascent method, and the optimized strategy probability vector is obtained, including: Based on the kinematic equation, the future trajectory of each vehicle is predicted, and the formula is: , , where and are the predicted positions of the vehicles at time , is the predicted time step, is the acceleration weight coefficient, representing the quadratic contribution of acceleration to position in the kinematic equation, and are the x, y components of acceleration, respectively; Based on the velocity vector, the trajectory intersection time is calculated as: , where is the collision time of the two vehicles' trajectories, , , and are the current positions of the i-th and o-th vehicles, respectively, , , and are the x, y components of the i-th and o-th vehicles' velocities, respectively; Based on the fused velocity and acceleration vectors, the upper limit of the prediction time is set as: , where is the upper limit of the prediction time, is a small positive number to avoid division by zero, is the driver reaction time; For vehicles without trajectory intersection , the minimum distance between the two vehicles' trajectories is calculated as: , where is the minimum distance between the two vehicles' trajectories, and are the predicted positions of vehicle i at time , and are the predicted positions of vehicle o at time ; Based on the minimum distance, the collision probability is calculated as: , , where is the collision probability between vehicle i and vehicle o, is the distance parameter at time t, which is set using statistical analysis, adaptive speed parameter for time t, relative speed between vehicle i and vehicle o, road speed limit, road friction coefficient; Based on the average optical flow vector and the acceleration probability, a game payoff function is constructed using Nash equilibrium game, and the formula is: , wherein is the payoff value of the grid (x, y) at time t, reflecting the payoff of the vehicle behavior strategy, is the basic payoff coefficient, indicating the basic payoff contribution of smooth traffic flow, is the road friction influence coefficient, adjusting the contribution of road conditions to the payoff, is the adjacent grid acceleration probability at time t, is the modulus of the optical flow difference value of the adjacent grid, reflecting the conflict degree of the adjacent interaction; The strategy probability is updated iteratively by gradient ascent method to obtain the optimized strategy probability vector, and the formula is: , wherein is the strategy probability vector of the k+1 iteration, is the learning rate, balancing the convergence speed and stability, is the gradient of the payoff function; The grid risk is generated by integrating the traffic density, the normalized grid chaos degree and the optimized strategy probability vector, and the formula is: , wherein is the risk value of the grid (x, y) at time t, is the normalized grid chaos degree of the grid (x, y) at time t, and are the acceleration and lane change probabilities in the optimized strategy probability, respectively; The overall risk of the intersection is calculated by weighted average, and the formula is: , wherein is the overall intersection risk at time t.
[0030] The trajectory intersection time can identify potential conflict points in the time domain dimension, avoid misjudgment caused by relying only on the spatial distance index, make the risk judgment have spatio-temporal unity in combination with the trajectory prediction, improve the overall prediction accuracy, ensure that the trajectory prediction focuses on a reasonable range, avoid the uncertainty accumulation caused by too long prediction time, the minimum distance is an important index for measuring the potential conflict degree of two vehicles, which can be used to distinguish between "safe approach" and "dangerous approach", in combination with the predicted trajectory calculation, the one-sidedness based on the relative position at the current time is avoided, the forward-looking nature of risk identification is enhanced, the relative speed of the vehicle and the road condition (such as the friction coefficient) are taken into the modeling, so that the probability estimation has more physical meaning, the adaptive speed parameter enables the model to automatically adjust according to different traffic density and road conditions, improves the robustness, models the traffic scene as a game process, which can reflect the mutual influence between different vehicles, rather than analyzing the risk of a single vehicle in isolation, introduces the optical flow difference through the benefit function, captures the macro conflict characteristics of the vehicle flow, avoids relying only on the kinematics information of a single vehicle, and gradually approaches the Nash equilibrium through iterative optimization. The grid risk integrates three types of information: micro (single vehicle collision probability), meso (local grid chaos degree), and macro (vehicle flow density), forming a comprehensive risk index.
[0031] S4, risk warning is performed on the overall risk of the intersection, and a visual interface is constructed to display the overall risk of the intersection; Specifically, the risk warning is performed on the overall risk of the intersection, including: A fixed threshold method is used to set a risk threshold, the overall risk of the intersection is compared with the risk threshold, when the overall risk of the intersection is greater than or equal to the risk threshold, it is judged as an abnormal state, and a warning is issued, otherwise it is judged as a normal state, and continues to be monitored.
[0032] Compared with the complex adaptive threshold method, the fixed threshold method has the characteristics of small calculation amount and strong real-time, which is suitable for high-frequency monitoring of the traffic system. Through real-time warning, the traffic management system can take measures before the risk breaks out, through automatic judgment, the manual intervention time is greatly reduced, which is helpful to take measures before the accident occurs.
[0033] Further, a visual interface is constructed to display the overall risk of the intersection, including: A visual tool Matplotlib is used to construct a visual interface to display the overall risk of the intersection and the state detection results in real time; Allowing users to check through real-name verification.
[0034] The real-time change trend of the risk value with time is displayed, so that the manager can quickly perceive the intersection safety condition, the risk distribution in each direction can be displayed through the intersection grid division, through the real-name system, a traceable mechanism can be formed in the data use process, and the data is used in accordance with the regulations.
[0035] The embodiment also provides a traffic safety risk early warning system based on intersection traffic flow information, comprising: A collection processing module is configured to collect intersection traffic flow data and perform denoising and normalization processing. A grid fusion module is configured to divide an intersection area into a space-time grid, convert a pixel-level optical flow field into a physical optical flow field, map the physical optical flow field onto the space-time grid, and fuse the optical flow vector and the vehicle speed vector through a least square method. A chaos degree analysis module is configured to correct grid direction information entropy, define a strategy space, and calculate grid chaos degree. A prediction game module is configured to predict a trajectory based on kinematics, calculate minimum distance and collision probability, and introduce a Nash equilibrium game to optimize a vehicle behavior strategy. An early warning display module is configured to determine an overall risk state through a threshold value, and display intersection overall risk and early warning results.
[0036] The embodiment also provides a computer device suitable for the traffic safety risk early warning method based on intersection traffic flow information, comprising a memory and a processor.
[0037] The computer device can be a terminal, and the computer device comprises a processor, a memory, a communication interface, a display screen and an input device connected through a system bus. The processor of the computer device is configured to provide computing and control capabilities. The memory of the computer device comprises a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for running the operating system and the computer program in the non-volatile storage medium. The communication interface of the computer device is configured to perform wired or wireless communication with external terminals. The wireless communication can be achieved through WIFI, operator network, NFC (near field communication) or other technologies. The display screen of the computer device can be a liquid crystal display screen or an electronic ink display screen. The input device of the computer device can be a touch layer overlaid on the display screen, or a key, trackball or touchpad arranged on the shell of the computer device. In addition, the input device can be an external keyboard, touchpad or mouse, etc.
[0038] The embodiment also provides a storage medium, which stores a computer program, and the computer program is executed by a processor to implement the method for traffic safety risk early warning based on intersection traffic flow information according to the above embodiment; the storage medium can be implemented by any type of volatile or non-volatile storage device or combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic disk or optical disk.
[0039] To sum up, the application improves the representation accuracy of the vehicle motion state by combining the optical flow field analysis with the speed vector fusion, enhances the recognition ability of the vehicle direction consistency and abnormal lane changing behavior by combining the direction probability distribution with the information entropy correction, and improves the early discovery ability of the potential collision risk by combining the kinematics prediction with the trajectory intersection analysis.
[0040] It should be noted that the above embodiments are only used to illustrate the technical solutions of the application but not limit the application, and although the application has been described in detail with reference to the preferred embodiments, those skilled in the art should understand that the technical solutions of the application can be modified or replaced equivalently without departing from the spirit and scope of the technical solutions of the application, and all should be covered in the scope of the claims of the application.
Claims
1. A traffic safety risk early warning method based on intersection traffic flow information, characterized in that: The method comprises the following steps: Collecting intersection traffic data and preprocessing, taking the geometric center of the intersection as the coordinate origin, converting the pixel coordinates in the camera video to physical coordinates, dividing the intersection area into a space-time grid, calculating the traffic density of each grid, generating a pixel-level optical flow field by minimizing the energy function, converting the pixel-level optical flow field to a physical optical flow field, mapping the physical optical flow field to the space-time grid, generating an average flow vector, fusing the average flow vector and the velocity vector by the least square method, and generating a fused velocity vector; Calculate the direction angle by the inverse tangent function, count the number of vehicles in each grid interval, calculate the probability distribution, calculate the grid direction information entropy, calculate the direction change rate of vehicles in the grid by difference calculation of the direction angle, modify the grid direction information entropy by linear weighting, set the threshold, define the strategy space, and generate the grid chaos degree by weighted fusion; Predict the future trajectory of each vehicle based on the kinematic equation, calculate the trajectory intersection time, set the upper limit of the prediction time, filter out the vehicles without trajectory intersection, calculate the minimum distance between the trajectories of two vehicles, calculate the collision probability based on the minimum distance, use Nash equilibrium game to construct the game payoff function, update the strategy probability by gradient ascent method, get the optimized strategy probability vector, and generate the grid risk by integrating the traffic density, normalized grid chaos degree and optimized strategy probability vector, and calculate the overall risk of the intersection by weighted average; Warning the overall risk of the intersection and constructing a visual interface to display the overall risk of the intersection. 2.The traffic safety risk pre-warning method based on intersection traffic flow information according to claim 1, characterized in that: The method comprises the following steps: Taking the geometric center of the intersection as the coordinate origin (0, 0), establishing a two-dimensional Cartesian coordinate system, and converting the pixel coordinates in the camera video to physical coordinates by a calibration matrix; Using an empirical rule to set the size of the space-time grid, dividing the intersection area into a space-time grid, and assigning each vehicle to the corresponding grid to record the vehicle ID in the space-time grid; Calculate the traffic density of each grid; Extract the frame sequence from the camera video, and generate a pixel-level optical flow field by minimizing the energy function; Calculate the scaling factor based on the camera height and the pixel height measured by the calibration board, and convert the pixel-level optical flow field to a physical optical flow field based on the scaling factor; Map the physical optical flow field to the space-time grid based on the physical coordinates, and generate an average flow vector by weighted averaging of the flow points in each grid; Convert the speed and direction angle to a velocity vector in the intersection center coordinate system, fuse the average flow vector and the velocity vector by the least square method, and generate a fused velocity vector. 3.The traffic safety risk pre-warning method based on intersection traffic flow information according to claim 2, characterized in that: The method comprises the following steps: Based on the fused velocity vector, calculate the direction angle by the inverse tangent function, count the number of vehicles in each grid interval, calculate the probability distribution, and calculate the grid direction information entropy based on the probability distribution; Calculate the direction change rate of vehicles in the grid by difference calculation of the direction angle, and modify the grid direction information entropy by linear weighting based on the direction change rate to generate a modified information entropy. Calculate the acceleration vector based on the velocity vector; Set the judgment and direction change rate threshold using the percentile method, define the strategy space based on the acceleration vector and the direction change rate; Statistically calculate the acceleration and lane change probability within the neighborhood of the grid; Generate the grid chaos degree by weighted fusion and perform normalization processing. 4.The traffic safety risk pre-warning method based on intersection traffic flow information according to claim 3, characterized in that: The collision probability is calculated, a game payoff function is constructed using Nash equilibrium game, the strategy probability is iteratively updated by gradient ascent method, and an optimized strategy probability vector is obtained, including: Predict the future trajectory of each vehicle based on the kinematic equation; Calculate the trajectory intersection time based on the velocity vector; Setting an upper limit of prediction time based on fused velocity vector and acceleration vector , screening no trajectory intersection , calculating minimum distance of two vehicle trajectories Calculate the collision probability based on the minimum distance; Based on the average optical flow vector and acceleration probability, a game payoff function is constructed using Nash equilibrium game, the strategy probability is iteratively updated by gradient ascent method, and an optimized strategy probability vector is obtained; Generate the grid risk by integrating the traffic density, the normalized grid chaos degree, and the optimized strategy probability vector; Calculate the overall risk of the intersection by weighted average.
5. The traffic safety risk pre-warning method based on intersection traffic flow information according to claim 4, characterized in that: The overall risk of the intersection is risked, including: Use the fixed threshold method to set the risk threshold, compare the overall risk of the intersection with the risk threshold, and when the overall risk of the intersection is greater than or equal to the risk threshold, judge it as an abnormal state and issue a warning, otherwise judge it as a normal state and continue monitoring. 6.The traffic safety risk pre-warning method based on intersection traffic flow information according to claim 5, characterized in that: The visualization interface is constructed to display the overall risk of the intersection, including: Use the visualization tool Matplotlib to construct the visualization interface and display the overall risk of the intersection and the state detection result in real time; Allow users to check through real-name verification.
7. The traffic safety risk warning method based on intersection vehicle flow information according to claim 1, characterized in that: The intersection traffic data is collected and preprocessed, including: Collect intersection traffic data through multi-modal sensors and perform denoising and normalization processing; The traffic data includes camera video, speed, direction angle, and acceleration data.
8. A traffic safety risk warning system based on intersection traffic flow information, based on the traffic safety risk warning method based on intersection traffic flow information according to any one of claims 1-7, characterized in that: Including, The acquisition and processing module is used to collect intersection traffic data and perform denoising and normalization processing; The grid fusion module is used to divide the intersection area into a space-time grid, convert the pixel-level optical flow field into a physical optical flow field, map the physical optical flow field to the space-time grid, and fuse the optical flow vector and the vehicle velocity vector by least squares method; The chaos degree analysis module is used to correct the grid direction information entropy, define the strategy space, and calculate the grid chaos degree; The prediction game module is used to predict the trajectory based on kinematics, calculate the minimum distance and collision probability, and introduce Nash equilibrium game to optimize the vehicle behavior strategy; The warning display module is used to determine the overall risk state by threshold and display the overall risk of the intersection and the warning result. 9.A computer device, comprising a memory and a processor, wherein the memory stores a computer program, and the computer device is characterized in that: The processor executes the computer program to realize the steps of the traffic safety risk warning method based on intersection traffic information according to any one of claims 1-7.
10. A computer readable storage medium having stored thereon a computer program, characterized in that: The computer program is executed by the processor to realize the steps of the traffic safety risk warning method based on intersection traffic information according to any one of claims 1-7.
Citation Information
Cited By
Multi-modal traffic flow prediction method based on artificial intelligence and related equipment
CN121236923A