Traffic state identification method and system considering vehicle space characteristics
By extracting and processing vehicle trajectory data from aerial videos, building multi-dimensional spatial feature parameters, and combining machine learning algorithms, the problem of existing traffic state recognition methods relying on a single indicator is solved, and accurate identification and detailed description of traffic states are achieved.
Patent Information
- Application Number
- CN202411416412.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-11
- Publication Date
- 2025-02-18
AI Technical Summary
The existing traffic state recognition methods mainly rely on single indicators such as speed and cannot accurately reflect traffic state under different time and space conditions, resulting in inaccurate identification results.
By extracting the initial vehicle trajectory data and road calibration information of the target vehicle from the aerial video, more accurate target vehicle trajectory data are calculated and multi-dimensional spatial characteristic parameters are constructed, such as lane change interference rate and direction fluctuation index, combining velocity and density parameters. , use the XGBOOST algorithm to identify traffic states.
Accurate identification of traffic states is achieved, the accuracy and meticulousness of identification are improved, and the mutual influence and spatial chaos of vehicles under different traffic states can be better reflected.
Smart Images

Figure CN119478764A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of intelligent transportation technology, and in particular to a traffic state recognition method and system taking vehicle space characteristics into consideration. Background Art
[0002] Given a traffic video of a specific road section, the task of traffic state recognition is to classify and identify the traffic state of the road section at a certain moment by analyzing the traffic video of the specific road section and based on the traffic information in the video. Traffic state recognition is of great significance in traffic congestion control and induction, optimizing traffic signal control, improving road traffic efficiency, and responding to and handling emergency events.
[0003] In current traffic state classification research, the basic traffic flow parameters are generally extracted from the video, and the state classification is mainly based on a single indicator - speed. However, the unified absolute metric often cannot accurately reflect the actual traffic state of the road section under different time and space conditions, and the results of state recognition based on speed may not be accurate enough. Therefore, how to use the spatial characteristics of vehicles to achieve more accurate traffic state recognition needs further in-depth research.
[0004] The existing traffic state recognition methods are mainly divided into: index threshold-based division, machine learning and the combination of the two. Index threshold-based division is mainly to collect and analyze historical traffic flow data, establish the relationship between traffic status and various characteristic parameters (such as speed, traffic density and traffic flow, etc.), set a series of predefined thresholds to divide different traffic states, such as setting speed thresholds to distinguish between smooth, slow and congested; machine learning uses data-driven thinking to deeply mine the implicit information in the data, is sensitive to abnormal feature values and changes, trains a large amount of sample data labeled with traffic status, and builds a model that can automatically identify traffic status; the combination of the two methods often first obtains traffic flow parameters such as flow, density, speed, etc., first defines and divides the traffic state, and then uses machine learning algorithms to mine data features, train samples with feature parameters and state true values, and realize traffic state recognition.
[0005] Existing methods all extract the most basic flow speed density parameters from traffic video data as feature parameters. In actual road scenes, the specific position and distribution of vehicles in the road space can be clearly obtained, as well as the changes in vehicle movement. Simple flow speed density parameters cannot reflect the spatial characteristics of vehicles and the interaction between vehicles. The interaction between vehicles will affect the evolution of traffic conditions. In order to reflect the role of the interaction between vehicles and the degree of chaos of vehicles in the road space in traffic state recognition, it is necessary to find a new feature parameter that can better describe the spatial characteristics of vehicles and provide more detailed feature parameters for traffic state recognition. Summary of the invention
[0006] The main purpose of the embodiments of the present invention is to provide a traffic state recognition method and system taking into account the spatial characteristics of vehicles, so as to realize accurate recognition of traffic states.
[0007] To achieve the above object, an embodiment of the present invention provides a method for traffic state recognition considering vehicle spatial characteristics, comprising the following steps:
[0008] Extract the initial vehicle trajectory data of the target vehicle from the aerial video and obtain the road calibration information;
[0009] Calculating more accurate target vehicle trajectory data according to the initial vehicle trajectory data and the road calibration information;
[0010] Constructing multi-dimensional spatial feature parameters according to the target vehicle trajectory data;
[0011] Traffic status recognition is performed according to the spatial characteristic parameters to obtain a traffic status recognition result.
[0012] In some embodiments, the calculating of more accurate target vehicle trajectory data based on the initial vehicle trajectory data and the road calibration information comprises the following steps:
[0013] When collecting drone videos, we place black and white checkerboard-shaped markers as size references, and use the ratio of their size in the video image to the actual size to restore the real-time position and true size of the vehicle. At the same time, we record the video image size, frame rate, number of lanes in the video, and pixel range as road calibration information.
[0014] Based on the improved YOLOv8s-OBB method, a directed boundary detection box is used to detect the outline of the vehicle to determine the position and tilt angle of the target vehicle; wherein the attributes of the directed boundary detection box include the center point coordinates, the width of the detection box, the height of the detection box, and the tilt angle;
[0015] In the regression of angles, the rotating rectangular box is modeled as a Gaussian rectangular box, and the distance between two Gaussian rectangular boxes is used as the regression loss to output the prediction of the vehicle's driving angle.
[0016] After detecting the vehicle, the BoTSORT algorithm is used as the vehicle target tracking algorithm. As the initial vehicle trajectory data, combined with the road calibration information, the target vehicle trajectory data is calculated. The target vehicle trajectory data includes the frame number, the center point coordinates x and y, the width of the detection frame, the height of the detection frame, the tilt angle, and the vehicle category.
[0017] In some embodiments, the step of calculating more accurate target vehicle trajectory data based on the initial vehicle trajectory data and the road calibration information further includes the following steps:
[0018] Calculate the average speed and traffic density of the road section per second according to the target vehicle trajectory data;
[0019] The calculation formula for the average speed per second of a road section is: The calculation formula for traffic density is: in, represents the average speed per second; v i represents the vehicle speed of the i-th vehicle; n represents the total number of vehicles passing through the road section during the time period; D represents the traffic density; N represents the total number of vehicles on the road section; and L represents the length of the road section.
[0020] In some embodiments, constructing multi-dimensional spatial feature parameters according to the target vehicle trajectory data comprises the following steps:
[0021] According to the rotation angle information obtained by the directed bounding box, the characteristic parameters describing the complex interactions and dynamic changes of the vehicles in the spatial distribution are constructed, specifically:
[0022] Calculating a vehicle lane change rate and a vehicle interference rate, wherein the vehicle lane change rate is used to quantify how often a vehicle changes lanes in a traffic flow; and the vehicle interference rate is used to measure the degree of influence of other vehicles on the driving path and speed selection of a specific vehicle;
[0023] According to the vehicle lane change rate and vehicle interference rate, the vehicle safety space is used to calculate whether the safety space of the target vehicle overlaps with that of the adjacent vehicles, i.e., the intersection-and-union ratio, so as to determine whether the vehicle is in an interfered state at a certain moment;
[0024] The boundary size of the vehicle's buffer zone is determined by the vehicle's own length and width, driving speed, reaction time and lateral safety distance, and the four-point coordinates of the vehicle's safety space are calculated.
[0025] In some embodiments, the vehicle lane change rate R CThe calculation formula of (t) is: Among them, n C (t) is the total number of vehicles changing lanes in the entire scene at time t; n(t) is the total number of vehicles;
[0026] The vehicle interference rate R I The calculation formula of (t) is: Among them, n I (t) is the total number of vehicles in the interference state in the entire scene at time t.
[0027] In some embodiments, the method further comprises:
[0028] The vehicle direction fluctuation index is used to characterize the chaotic driving condition of the vehicle under high interference conditions;
[0029] The vehicle direction fluctuation index is obtained by summing the maximum value differences of the driving direction angles of all vehicles in a road section within a certain time interval;
[0030] Among them, the vehicle direction fluctuation index The calculation formula is:
[0031]
[0032] Where N is the total number of vehicles in the time interval, θ i is the set of angle values of vehicle i at all time points during the observation period, max(θ i ) is the angle value set θ of vehicle i i The maximum value, min(θ i ) is the angle value θ of vehicle i i The minimum value in a collection.
[0033] In some embodiments, the performing traffic state recognition according to the spatial feature parameters to obtain a traffic state recognition result includes:
[0034] According to the spatial feature parameters, the machine learning algorithm XGBOOST is used to perform traffic state recognition to obtain traffic state recognition results, and the traffic state recognition results include unimpeded state, stable state, congested state, and blocked state.
[0035] Another aspect of the embodiment of the present invention further provides a traffic state recognition system considering vehicle spatial characteristics, including:
[0036] The first module is used to extract the initial vehicle trajectory data of the target vehicle from the aerial video and obtain the road calibration information;
[0037] A second module is used to calculate more accurate target vehicle trajectory data based on the initial vehicle trajectory data and the road calibration information;
[0038] The third module is used to construct multi-dimensional spatial feature parameters according to the target vehicle trajectory data;
[0039] The fourth module is used to identify the traffic state according to the spatial characteristic parameters to obtain a traffic state identification result.
[0040] Another aspect of an embodiment of the present invention further provides an electronic device, including a processor and a memory;
[0041] The memory is used to store programs;
[0042] The processor executes the program to implement the method described above.
[0043] Another aspect of an embodiment of the present invention further provides a computer-readable storage medium, wherein the storage medium stores a program, and the program is executed by a processor to implement the method described above to achieve the above-mentioned purpose.
[0044] The embodiment of the present invention also discloses a computer program product or a computer program, which includes a computer instruction stored in a computer-readable storage medium. A processor of a computer device can read the computer instruction from the computer-readable storage medium, and the processor executes the computer instruction, so that the computer device executes the above method.
[0045] The embodiments of the present invention include at least the following beneficial effects: the present invention provides a method and system for traffic state recognition considering vehicle spatial characteristics, the scheme extracts the initial vehicle trajectory data of the target vehicle from the aerial video, and obtains the road calibration information; according to the initial vehicle trajectory data and the road calibration information, more accurate target vehicle trajectory data is calculated; according to the target vehicle trajectory data, multi-dimensional spatial characteristic parameters are constructed; according to the spatial characteristic parameters, traffic state recognition is performed to obtain traffic state recognition results. The present invention can realize accurate recognition of traffic state. BRIEF DESCRIPTION OF THE DRAWINGS
[0046] Figure 1 It is a schematic diagram of an implementation environment provided by an embodiment of the present invention;
[0047] Figure 2 is a flow chart of the overall steps provided by an embodiment of the present invention;
[0048] Figure 3 It is a specific implementation process diagram provided by an embodiment of the present invention;
[0049] Figure 4 is a schematic diagram of a directed bounding box of a vehicle provided by an embodiment of the present invention;
[0050] Figure 5 is a directed bounding box vehicle detection and tracking flow chart provided by an embodiment of the present invention;
[0051] Figure 6 is a schematic diagram of a vehicle in a lane changing state provided by an embodiment of the present invention;
[0052] Figure 7 is a schematic diagram of a vehicle safety space and a vehicle in an interference state provided by an embodiment of the present invention;
[0053] Figure 8 It is a schematic diagram of the hardware structure of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0054] In order to make the purpose, technical solutions and advantages of the present invention more clearly understood, the present invention is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not intended to limit the present invention. 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 invention. They are only examples of devices and methods consistent with some aspects of the embodiments of the present invention as detailed in the attached claims.
[0055] It is understood that the terms "first", "second", etc. used in the present invention may be used herein to describe various concepts, but unless otherwise specified, these concepts are not limited by these terms. These terms are only used to distinguish one concept from another. For example, without departing from the scope of the embodiments of the present invention, 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 may be interpreted as "at the time of" or "when" or "in response to determining".
[0056] The terms "at least one", "multiple", "each", "any", etc. used in the present invention, 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.
[0057] 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 the present invention belongs. The terms used herein are only for the purpose of describing the embodiments of the present invention and are not intended to limit the present invention.
[0058] The traffic state recognition method and system considering the spatial characteristics of vehicles provided in the embodiment of the present invention relate to the field of intelligent transportation technology. The traffic state recognition method considering the spatial characteristics of vehicles provided in the embodiment of the present invention 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 a server cluster or 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 traffic state recognition method considering the spatial characteristics of vehicles, etc., but is not limited to the above forms.
[0059] The present invention 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 electronic devices, network PCs, minicomputers, mainframe computers, distributed computing environments including any of the above systems or devices, etc. The present invention 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 invention 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.
[0060] like Figure 1 FIG. 1 is a schematic diagram of an implementation environment provided by an embodiment of the present invention. Figure 1 The implementation environment includes at least one terminal 102 and a server 101. The terminal 102 and the server 101 can be connected to a network wirelessly or wired to complete data transmission and exchange.
[0061] Server 101 can be an independent physical server, or a server cluster or distributed system composed of multiple physical servers. It can also be 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 (Content Delivery Network), as well as big data and artificial intelligence platforms.
[0062] In addition, the server 101 can also be a node server in the blockchain network. Blockchain is a new application model of computer technologies such as distributed data storage, peer-to-peer transmission, consensus mechanism, and encryption algorithm.
[0063] The terminal 102 may be a smart phone, a tablet computer, a laptop computer, a desktop computer, a smart speaker, a smart watch, etc. The terminal 102 may also be a vehicle-mounted terminal of various device types described above, but is not limited thereto. The terminal 102 and the server 101 may be directly or indirectly connected via wired or wireless communication, which is not limited in this embodiment of the present invention.
[0064] Based on the example Figure 1 In the implementation environment shown, an embodiment of the present invention provides a traffic state recognition method taking into account vehicle spatial characteristics. The following is an example of applying the traffic state recognition method taking into account vehicle spatial characteristics in the server 101. It can be understood that the method can also be applied to the terminal 102.
[0065] Reference Figure 2 , Figure 2 The flowchart of the traffic state recognition method considering the vehicle space characteristics applied to the server provided by the embodiment of the present invention, the execution subject of the method can be any of the aforementioned computer devices (including servers or terminals). Figure 2 , the method may include the following steps:
[0066] Extract the initial vehicle trajectory data of the target vehicle from the aerial video and obtain the road calibration information;
[0067] Calculating more accurate target vehicle trajectory data according to the initial vehicle trajectory data and the road calibration information;
[0068] Constructing multi-dimensional spatial feature parameters according to the target vehicle trajectory data;
[0069] Traffic status recognition is performed according to the spatial characteristic parameters to obtain a traffic status recognition result.
[0070] In some embodiments, the calculating of more accurate target vehicle trajectory data based on the initial vehicle trajectory data and the road calibration information comprises the following steps:
[0071] When collecting drone videos, we place black and white checkerboard-shaped markers as size references, and use the ratio of their size in the video image to the actual size to restore the real-time position and true size of the vehicle. At the same time, we record the video image size, frame rate, number of lanes in the video, and pixel range as road calibration information.
[0072] Based on the improved YOLOv8s-OBB method, a directed boundary detection box is used to detect the outline of the vehicle to determine the position and tilt angle of the target vehicle; wherein the attributes of the directed boundary detection box include the center point coordinates, the width of the detection box, the height of the detection box, and the tilt angle;
[0073] In the regression of angles, the rotating rectangular box is modeled as a Gaussian rectangular box, and the distance between two Gaussian rectangular boxes is used as the regression loss to output the prediction of the vehicle's driving angle.
[0074] After detecting the vehicle, the BoTSORT algorithm is used as the vehicle target tracking algorithm. As the initial vehicle trajectory data, combined with the road calibration information, the target vehicle trajectory data is calculated. The target vehicle trajectory data includes the frame number, the center point coordinates x and y, the width of the detection frame, the height of the detection frame, the tilt angle, and the vehicle category.
[0075] In some embodiments, the step of calculating more accurate target vehicle trajectory data based on the initial vehicle trajectory data and the road calibration information further includes the following steps:
[0076] Calculate the average speed and traffic density of the road section per second according to the target vehicle trajectory data;
[0077] The calculation formula for the average speed per second of a road section is: The calculation formula for traffic density is: in, represents the average speed per second; v i represents the vehicle speed of the i-th vehicle; n represents the total number of vehicles passing through the road section during the time period; D represents the traffic density; N represents the total number of vehicles on the road section; and L represents the length of the road section.
[0078] In some embodiments, constructing multi-dimensional spatial feature parameters according to the target vehicle trajectory data comprises the following steps:
[0079] According to the rotation angle information obtained by the directed bounding box, the characteristic parameters describing the complex interactions and dynamic changes of the vehicles in spatial distribution are constructed, specifically:
[0080] Calculating a vehicle lane change rate and a vehicle interference rate, wherein the vehicle lane change rate is used to quantify how often a vehicle changes lanes in a traffic flow; and the vehicle interference rate is used to measure the degree of influence of other vehicles on the driving path and speed selection of a specific vehicle;
[0081] According to the vehicle lane change rate and vehicle interference rate, the vehicle safety space is used to calculate whether the safety space of the target vehicle overlaps with that of the adjacent vehicles, i.e., the intersection-and-union ratio, so as to determine whether the vehicle is in an interfered state at a certain moment;
[0082] The boundary size of the vehicle's buffer zone is determined by the vehicle's own length and width, driving speed, reaction time and lateral safety distance, and the four-point coordinates of the vehicle's safety space are calculated.
[0083] In some embodiments, the vehicle lane change rate R C The calculation formula of (t) is: Among them, n C (t) is the total number of vehicles changing lanes in the entire scene at time t; n(t) is the total number of vehicles;
[0084] The vehicle interference rate R I The calculation formula of (t) is: Among them, n I (t) is the total number of vehicles in the interference state in the entire scene at time t.
[0085] In some embodiments, the method further comprises:
[0086] The vehicle direction fluctuation index is used to characterize the chaotic driving condition of the vehicle under high interference conditions;
[0087] The vehicle direction fluctuation index is obtained by summing the maximum value differences of the driving direction angles of all vehicles in a road section within a certain time interval;
[0088] Among them, the vehicle direction fluctuation index The calculation formula is:
[0089]
[0090] Where N is the total number of vehicles in the time interval, θ i is the set of angle values of vehicle i at all time points during the observation period, max(θ i ) is the angle value set θ of vehicle i i The maximum value, min(θ i ) is the angle value θ of vehicle i i The minimum value in a collection.
[0091] In some embodiments, the performing traffic state recognition according to the spatial feature parameters to obtain a traffic state recognition result includes:
[0092] According to the spatial feature parameters, the machine learning algorithm XGBOOST is used to perform traffic state recognition to obtain traffic state recognition results, and the traffic state recognition results include unimpeded state, stable state, congested state, and blocked state.
[0093] The specific implementation process of the present invention is described in detail below in conjunction with the accompanying drawings:
[0094] In view of the problems existing in the prior art, the present invention provides a traffic status recognition method taking into account the spatial characteristics of vehicles. First, a deep learning target detection method is used to perform oriented bounding box (OBB) detection on the vehicle. Then, combined with a target tracking algorithm, vehicles in different frames are tracked to obtain individual vehicle fine trajectory data. Based on the oriented bounding box, vehicle spatial feature parameters - lane change interference rate and direction fluctuation index - are constructed. Four dimensional feature parameters, including speed, density, lane change interference rate and direction fluctuation index, are combined to achieve accurate recognition of traffic status.
[0095] Specifically, the present invention studies and implements a traffic state recognition method that takes into account the spatial characteristics of vehicles. First, in order to address the problem that there may be overlaps between vehicle detection frames in the general horizontal detection frame, thereby affecting the acquisition of vehicle size and precise position, it is proposed to use a rotating detection frame to detect the vehicle and accurately obtain the vehicle's coordinate information and tilt angle; by combining the YOLOv8s-OBB rotating frame target detection algorithm and the BoTSORT target tracking method, individual vehicle trajectory data is extracted from aerial videos, and individual vehicle and road section traffic flow parameters are calculated; in order to address the problem that traditional traffic parameters cannot fully reflect the differences in vehicle behavior and spatial chaos in the road space, characteristic parameters that describe the vehicle's state in the road space are proposed - lane change interference rate and direction fluctuation index, combined with the commonly used average speed and traffic density parameters, and the XGBOOST (eXtremeGradient Boosting) algorithm is used to achieve accurate identification of four traffic operation states. The overall flow chart is as follows: Figure 3 shown.
[0096] In the method, first Figure 4The outline of the vehicle shown is detected and tracked, and the YOLOv8s-OBB algorithm proposed by Jocher G et al. is used as the vehicle target detection algorithm. The directed bounding box detection box - center point coordinates, detection box width, height, tilt angle (x, y, w, h, θ, angle range is [-90°, 90°]) is used to detect the vehicle to more accurately capture the position and tilt angle of the vehicle target. In the regression of the angle, the rotated rectangular box is modeled as a Gaussian rectangular box, and the distance between two Gaussian rectangular boxes is used as the regression loss to output the prediction of the angle. After the vehicle is detected, the BoTSORT algorithm proposed by AHARON N et al. is selected as the vehicle target tracking algorithm to obtain the continuous position information of each vehicle in continuous video frames, that is, the vehicle trajectory data. The directed bounding box vehicle detection and tracking process is as follows: Figure 5 shown.
[0097] After obtaining the vehicle trajectory data, the basic traffic flow characteristic parameters are calculated using the vehicle trajectory data. First, the average speed per second of the road section is calculated according to formulas (1) and (2). and traffic density D, as basic characteristic parameters.
[0098]
[0099]
[0100] Among them, v i is the speed of the ith vehicle (km / h), n is the total number of vehicles passing through the road segment during the time period, N is the total number of vehicles on the road segment, and L is the length of the road segment (km).
[0101] Next, based on the rotation angle information obtained from the directed bounding box, the characteristic parameters describing the complex interactions and dynamic changes of vehicles in spatial distribution are constructed. First, the vehicle lane change interference rate R CI (t), lane change rate R C (t) is used to quantify the frequency of vehicles changing lanes in traffic flow, which is directly related to the autonomous change of the spatial position of individual vehicles. Using the angle information of vehicles at different times, it is possible to determine whether the vehicle is in a lane-changing state at a certain moment. Figure 6 The interference rate R I (t) measures the degree of influence of other vehicles on the driving path and speed selection of a specific vehicle. The vehicle safety space is used to calculate whether the safety space of the vehicle and the adjacent vehicles overlap, that is, the intersection-and-union ratio. If there is overlap, it means that there is mutual interference between the vehicles at that moment. It can be judged whether the vehicle is in an interference state at a certain moment ( Figure 7 Right). The vehicle safety space is the buffer zone of the vehicle, and the size of the boundary is determined by the length and width of the vehicle itself, the driving speed, the reaction time and the lateral safety distance. Figure 7 The left side shows the vehicle safety space, where w is the vehicle length, h is the vehicle width, τ is the vehicle's reaction time in an emergency, v is the vehicle's speed, τv is the lateral safety distance between the vehicle and the following vehicle, and W C is the lateral safety distance between the vehicle and the adjacent vehicle. Set τ to 0.5s, W C It is 1.4m, and the four-point coordinates of the vehicle’s safety space (x1, y1, x2, y2, x3, y3, x4, y4) can be calculated.
[0102] Therefore, the vehicle lane change interference rate R CI The calculation formulas of (t) are as follows (3), (4), and (5):
[0103] R CI (t) = R C (t)+R I (t) (3)
[0104]
[0105]
[0106] Where n C (t) is the total number of vehicles changing lanes in the entire scene at time t, n I (t) is the total number of vehicles in the interference state in the entire scene at time t, and n(t) is the total number of vehicles.
[0107] In order to more accurately reflect the phenomenon of chaotic driving of vehicles under high interference conditions, a vehicle direction fluctuation index is proposed. The sum of the maximum and minimum differences of the driving direction angles of all vehicles in a road section within a certain time interval (when the vehicle's driving direction is parallel to the horizontal lane line, the driving angle is 0) is used to obtain an overall road section direction fluctuation index. This index is used to quantify the changes in the space of vehicle groups on the road section, thereby reflecting the degree of dynamic disorder of the vehicle group. It is also used as one of the characteristic parameters for traffic state identification. Direction Fluctuation Index The calculation formula (6) is as follows:
[0108]
[0109] Where N is the total number of vehicles in the time interval, θ i is the set of angle values of vehicle i at all time points during the observation period, max(θ i ) is the angle value set θ of vehicle i i The maximum value, min(θ i ) is the angle value θ of vehicle i i The minimum value in a collection.
[0110] After obtaining the four characteristic parameters, the machine learning algorithm XGBOOST is used to identify four types of traffic conditions (smooth, stable, crowded, and blocked). The process of the XGBOOST algorithm is as follows:
[0111] I. Initial model, first initialize a simple model;
[0112] II. Calculate the residuals, which are the differences between the predicted values of this simple model and the actual values;
[0113] III. Train a new tree. Train a new decision tree to predict the residual. The goal of the new tree is to minimize the residual.
[0114] IV. Update the model and add the new tree to the existing model so that the new model can better predict the target value.
[0115] V. Repeat steps, repeat the above process, and continue to add new trees, making the model's prediction more accurate each time, until the predetermined number of trees is reached or the error falls within an acceptable range, terminate, and output the traffic status corresponding to each time interval.
[0116] In summary, the present invention has the following characteristics:
[0117] (1) The present invention proposes and implements a traffic state recognition method that takes into account the spatial characteristics of vehicles for aerial video traffic scenes.
[0118] (2) By using a directed bounding box to accurately detect vehicles in the video, the vehicle's tilt angle information is obtained. Combined with the vehicle tracking algorithm, stable and continuous vehicle trajectory information can be extracted, enriching the vehicle's spatial angle information and providing new data for the detailed study of microscopic traffic behavior.
[0119] (3) By constructing vehicle space characteristic parameters, namely, lane change interference rate and direction fluctuation index, the chaos characteristic parameters describing the road space traffic state are obtained. Finally, the XGBOOST algorithm is used to combine the four-dimensional characteristic parameters, including speed, density, lane change interference rate and direction fluctuation index, to achieve accurate recognition of the traffic state with high recognition accuracy.
[0120] (4) The degree of chaos in road space under different traffic conditions is refined, and it is clarified that it can be reflected by the lane change interference rate and direction fluctuation index.
[0121] Compared with the prior art, the present invention has the following advantages:
[0122] The present invention extracts the directed bounding box information of the vehicle, constructs the vehicle space characteristic parameters - lane change interference rate and direction fluctuation index, obtains the chaos characteristic parameters describing the road space traffic state, and finally uses the XGBOOST algorithm to combine four dimensional characteristic parameters, including speed, density, lane change interference rate and direction fluctuation index, to achieve accurate identification of the traffic state. The present invention expands the use of only vehicle speed and density as characteristic parameters to characteristic parameters combined with vehicle space characteristics, which can better reflect the mutual influence and spatial chaos degree of vehicles under different traffic conditions.
[0123] Another aspect of the embodiment of the present invention further provides a traffic state recognition system considering vehicle spatial characteristics, including:
[0124] The first module is used to extract the initial vehicle trajectory data of the target vehicle from the aerial video and obtain the road calibration information;
[0125] A second module is used to calculate more accurate target vehicle trajectory data based on the initial vehicle trajectory data and the road calibration information;
[0126] The third module is used to construct multi-dimensional spatial feature parameters according to the target vehicle trajectory data;
[0127] The fourth module is used to perform traffic state recognition according to the spatial characteristic parameters to obtain a traffic state recognition result.
[0128] It can be understood that the contents of the above method embodiments are all applicable to the present system embodiments, the functions specifically implemented by the present system 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.
[0129] The embodiment of the present invention further provides an electronic device, the electronic device comprising a memory and a processor, the memory storing a computer program, and the processor implementing the above-mentioned traffic state recognition method considering vehicle space characteristics when executing the computer program. The electronic device can be any intelligent terminal including a tablet computer, a vehicle-mounted computer, etc.
[0130] 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.
[0131] See also Figure 8 , Figure 8 The hardware structure of an electronic device of another embodiment is illustrated, and the electronic device includes:
[0132] The processor 801 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 invention.
[0133] The memory 802 may 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 802 may store an operating system and other application programs. When the technical solution provided in the embodiments of this specification is implemented by software or firmware, the relevant program code is stored in the memory 802, and the processor 801 calls and executes the traffic state recognition method considering the vehicle space characteristics in the embodiment of the present invention;
[0134] Input / output interface 803, used to implement information input and output;
[0135] The communication interface 804 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.);
[0136] A bus 805 that transmits information between the various components of the device (e.g., the processor 801, the memory 802, the input / output interface 803, and the communication interface 804);
[0137] The processor 801 , the memory 802 , the input / output interface 803 and the communication interface 804 are connected to each other in communication within the device via a bus 805 .
[0138] An embodiment of the present invention further provides a computer-readable storage medium, which stores a computer program. When the computer program is executed by a processor, the method for identifying traffic status considering the spatial characteristics of the vehicle is implemented.
[0139] 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.
[0140] 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.
[0141] It should be noted that in various specific embodiments of the present invention, when it comes to the need to perform relevant processing based on data related to user identity or characteristics such as user information, user behavior data, user historical data, and user location information, the user's permission or consent will be obtained first, and the collection, use, and processing of these data will comply with relevant laws, regulations, and standards. In addition, when the embodiment of the present invention needs to obtain the user's sensitive personal information, it will obtain the user's separate permission or consent through a pop-up window or jump to a confirmation page, and after clearly obtaining the user's separate permission or consent, it will obtain the necessary user-related data for the normal operation of the embodiment of the present invention.
[0142] The embodiments described in the embodiments of the present invention are intended to more clearly illustrate the technical solutions of the embodiments of the present invention, and do not constitute a limitation on the technical solutions provided by the embodiments of the present invention. Those skilled in the art can appreciate that with the evolution of technology and the emergence of new application scenarios, the technical solutions provided by the embodiments of the present invention are also applicable to similar technical problems.
[0143] Those skilled in the art will appreciate that the technical solutions shown in the figures do not limit the embodiments of the present invention and may include more or fewer steps than shown in the figures, or a combination of certain steps, or different steps.
[0144] 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.
[0145] 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.
[0146] The terms "first", "second", "third", "fourth", etc. (if any) in the specification of the present invention 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 interchanged where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0147] It should be understood that in the present invention, "at least one (item)" refers to one or more, and "plurality" refers to 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 represent: 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 previous and next associated objects are in an "or" relationship. "At least one of the following items" or similar expressions refers to any combination of these items, including any combination of single items or plural items. For example, at least one of a, b or c can represent: 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.
[0148] In the several embodiments provided by the present invention, 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.
[0149] 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.
[0150] In addition, each functional unit in each embodiment of the present invention 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.
[0151] 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 invention, in essence, 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. The computer software product is stored in a storage medium, including multiple instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the methods of various embodiments of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM), random access memory (RAM), disk or optical disk, etc., various media that can store programs.
[0152] The preferred embodiments of the present invention are described above with reference to the accompanying drawings, but the scope of the rights of the embodiments of the present invention is not limited thereby. Any modification, equivalent substitution and improvement made by those skilled in the art without departing from the scope and essence of the embodiments of the present invention shall be within the scope of the rights of the embodiments of the present invention.
Claims
1. A traffic state recognition method considering vehicle spatial characteristics, characterized in that: The following steps are involved: Extract the initial vehicle trajectory data of the target vehicle from the aerial video and obtain the road calibration information; Calculating more accurate target vehicle trajectory data according to the initial vehicle trajectory data and the road calibration information; Constructing multi-dimensional spatial feature parameters according to the target vehicle trajectory data; Traffic status recognition is performed according to the spatial characteristic parameters to obtain a traffic status recognition result.
2. The method for traffic state recognition considering vehicle spatial characteristics according to claim 1, characterized in that: The step of calculating more accurate target vehicle trajectory data based on the initial vehicle trajectory data and the road calibration information comprises the following steps: When collecting drone videos, we place black and white checkerboard-shaped markers as size references, and use the ratio of their size in the video image to the actual size to restore the real-time position and true size of the vehicle. At the same time, we record the video image size, frame rate, number of lanes in the video, and pixel range as road calibration information. Based on the improved YOLOv8s-OBB method, a directed boundary detection box is used to detect the outline of the vehicle to determine the position and tilt angle of the target vehicle; wherein the attributes of the directed boundary detection box include the center point coordinates, the width of the detection box, the height of the detection box, and the tilt angle; In the regression of angles, the rotating rectangular box is modeled as a Gaussian rectangular box, and the distance between two Gaussian rectangular boxes is used as the regression loss to output the prediction of the vehicle's driving angle. After detecting the vehicle, the BoTSORT algorithm is used as the vehicle target tracking algorithm. As the initial vehicle trajectory data, combined with the road calibration information, the target vehicle trajectory data is calculated. The target vehicle trajectory data includes the frame number, the center point coordinates x and y, the width of the detection frame, the height of the detection frame, the tilt angle, and the vehicle category.
3. The method for traffic state recognition considering vehicle spatial characteristics according to claim 2, characterized in that: The step of calculating more accurate target vehicle trajectory data based on the initial vehicle trajectory data and the road calibration information further includes the following steps: Calculate the average speed and traffic density of the road section per second according to the target vehicle trajectory data; The calculation formula for the average speed per second of a road section is: The calculation formula for traffic density is: in, represents the average speed per second; v i represents the vehicle speed of the i-th vehicle; n represents the total number of vehicles passing through the road section during the time period; D represents the traffic density; N represents the total number of vehicles on the road section; and L represents the length of the road section.
4. The method for traffic state recognition considering vehicle spatial characteristics according to claim 1, characterized in that: The step of constructing multi-dimensional spatial feature parameters according to the target vehicle trajectory data comprises the following steps: According to the rotation angle information obtained by the directed bounding box, the characteristic parameters describing the complex interactions and dynamic changes of the vehicles in the spatial distribution are constructed, specifically: Calculating a vehicle lane change rate and a vehicle interference rate, wherein the vehicle lane change rate is used to quantify how often a vehicle changes lanes in a traffic flow; and the vehicle interference rate is used to measure the degree of influence of other vehicles on the driving path and speed selection of a specific vehicle; According to the vehicle lane change rate and vehicle interference rate, the vehicle safety space is used to calculate whether the safety space of the target vehicle overlaps with that of the adjacent vehicles, i.e., the intersection-and-union ratio, so as to determine whether the vehicle is in an interfered state at a certain moment; The boundary size of the vehicle's buffer zone is determined by the vehicle's own length and width, driving speed, reaction time and lateral safety distance, and the four-point coordinates of the vehicle's safety space are calculated.
5. The method for traffic state recognition considering vehicle spatial characteristics according to claim 4, characterized in that: The vehicle lane change rate R C The calculation formula of (t) is: Among them, n C (t) is the total number of vehicles changing lanes in the entire scene at time t; n(t) is the total number of vehicles; The vehicle interference rate R I The calculation formula of (t) is: Among them, n I (t) is the total number of vehicles in the interference state in the entire scene at time t.
6. The method for traffic state recognition considering vehicle spatial characteristics according to claim 1, characterized in that: The method further comprises: The vehicle direction fluctuation index is used to characterize the chaotic driving condition of the vehicle under high interference conditions; The vehicle direction fluctuation index is obtained by summing the maximum value differences of the driving direction angles of all vehicles in a road section within a certain time interval; Among them, the vehicle direction fluctuation index The calculation formula is: Where N is the total number of vehicles in the time interval, θ i is the set of angle values of vehicle i at all time points during the observation period, max(θ i ) is the angle value set θ of vehicle i i The maximum value, min(θ i ) is the angle value θ of vehicle i i The minimum value in a collection.
7. The method for traffic state recognition considering vehicle spatial characteristics according to claim 1, characterized in that: The performing traffic state recognition according to the spatial characteristic parameters to obtain a traffic state recognition result includes: According to the spatial feature parameters, the machine learning algorithm XGBOOST is used to perform traffic state recognition to obtain traffic state recognition results, and the traffic state recognition results include unimpeded state, stable state, congested state, and blocked state.
8. A traffic state recognition system considering vehicle spatial characteristics, characterized in that: include: The first module is used to extract the initial vehicle trajectory data of the target vehicle from the aerial video and obtain the road calibration information; A second module is used to calculate more accurate target vehicle trajectory data based on the initial vehicle trajectory data and the road calibration information; The third module is used to construct multi-dimensional spatial feature parameters according to the target vehicle trajectory data; The fourth module is used to identify the traffic state according to the spatial characteristic parameters to obtain a traffic state identification result.
9. An electronic device, characterized in that: including a processor and a memory; The memory is used to store programs; The processor executes the program to implement the method according to any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that: The storage medium stores a program, and the program is executed by a processor to implement the method according to any one of claims 1 to 7.
Citation Information
Cited By
Traffic control equipment binding method, vehicle and storage medium
CN121415603A