A vehicle collision warning method based on laser radar
By using the multi-head attention mechanism and Kalman filter algorithm in the vehicle collision warning system, combined with the two-dimensional target detection framework, the problem of real-time performance and accuracy in three-dimensional target detection and tracking technology is solved, and efficient obstacle detection is achieved. and early warning, improving driving safety.
Patent Information
- Application Number
- CN202410387189.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-04-01
- Publication Date
- 2024-09-17
- Estimated Expiration
- 2044-04-01
AI Technical Summary
Existing three-dimensional target detection methods are difficult to balance real-time performance and detection accuracy. Especially in vehicle collision warning systems, the development of three-dimensional target detection and tracking technology lags behind, making it difficult to achieve efficient obstacle detection and early warning.
A vehicle collision early warning method based on lidar is adopted, a feature extraction network for global and local feature extraction is established through a multi-head attention mechanism, three-dimensional target detection is implemented in conjunction with a two-dimensional target detection framework, and multi-target tracking is designed using Kalman filtering and Hungarian matching algorithms. method to improve detection accuracy and real-time performance.
It achieves high-precision three-dimensional target detection and tracking in the vehicle collision warning system, ensuring both real-time performance and detection accuracy, providing stable multi-target tracking capabilities and hierarchical warning strategies, and improving driving safety.
Smart Images

Figure CN118259312B
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of autonomous driving vehicles, and in particular relates to a vehicle collision warning method based on laser radar. Background Art
[0002] The vehicle collision warning system is a car safety assistance system, whose main function is to detect vehicles and obstacles on the road ahead through on-board sensors, and to warn the driver in advance in case of a possible collision, thereby improving driving safety. Most of the current vehicle collision systems are based on cameras and millimeter-wave radars for obstacle detection and ranging. As the cost of laser radars decreases, they are gradually favored by scholars. Laser radars can achieve very high-precision distance measurement and are not affected by night lighting conditions. However, three-dimensional target detection and tracking technology started later than two-dimensional target detection and tracking technology, and there is still a lot of room for development. In addition, the current three-dimensional target detection method is difficult to take into account the problems of real-time performance and detection accuracy. Therefore, the present invention designs a stable and reliable road target detection and tracking method based on laser radar, and designs a collision warning strategy adapted thereto. Summary of the invention
[0003] In order to make up for the existing technical gaps, the present invention is based on a vehicle collision warning method based on laser radar. Aiming at the problem that the current three-dimensional target detection method is difficult to balance the real-time performance and detection accuracy, the present invention establishes a feature extraction network capable of extracting global features and local features based on a multi-head attention mechanism, and then realizes three-dimensional target detection based on a two-dimensional target detection framework. The method has good detection accuracy and real-time performance. Then, based on the target detection results, a stable and reliable multi-target tracking method is designed based on Kalman filtering and Hungarian matching algorithm.
[0004] The present invention is achieved through the following technical solutions:
[0005] A vehicle collision warning method based on laser radar comprises the following steps:
[0006] S1, point cloud information is obtained by scanning by vehicle-mounted laser radar;
[0007] S2, then the point cloud information is input into the target detector for target detection and classification;
[0008] S3, then use the tracking method to track the target and obtain the relative speed and relative distance information of the relevant target;
[0009] S4. Finally, the collision time of the relevant targets is calculated, and early warning prompts are issued for targets with collision risks.
[0010] Furthermore, the specific operations of step S2 are as follows:
[0011] S2.1. Feature encoder network based on multi-head attention mechanism: First, the 3D point cloud is divided into point cloud columns, and the global features and local features of the point cloud information are extracted through the multi-head attention mechanism, and then a 2D pseudo image is generated;
[0012] S2.2, 2D convolutional neural network: The 2D pseudo-image is downsampled multiple times to obtain feature maps of different resolutions, and then the multiple downsampled feature maps are upsampled to the same size and spliced to generate the final feature map. Using only the 2D convolutional neural network can greatly speed up the detection speed;
[0013] S2.3, SSD target detection head: Generate 3D detection box and target classification for the feature map to obtain the location and type of the object.
[0014] Furthermore, the algorithm flow of step S2 includes the following steps:
[0015] (1) Taking the original point cloud data information as input, the point cloud is first represented as a uniformly distributed point cloud column: the three-dimensional point cloud information is directly obtained from the top view, and all points are discretized into a uniform square grid on the xy plane. Each point cloud column is a cubic column with infinite extension in the z-axis direction.
[0016] (2) Use the sparsity of the point cloud to create a size density tensor (D, P, N), where D represents the feature dimension of each point cloud column, P represents the number of point cloud columns, and N represents the maximum number of points in each point cloud column. When the number of points in a point cloud column exceeds N, random sampling will be performed to select N points; when the number of points is less than N, 0 samples will be used to fill the gap.
[0017] (3) After obtaining a tensor (D, P, N), it is input into a feature encoding network based on a multi-head attention mechanism for feature extraction; first, the MLP operation is used for position encoding and dimensionality upgrading, and the tensor (D, P, N) is converted into a tensor (C, P, N), where C represents the feature dimension after dimensionality upgrading; then, based on the multi-head attention mechanism, the global context features are calculated for each point cloud column and the local structural features are calculated for the points in each point cloud column, so that the point cloud information in each point cloud column has global context features and local structural features; a position encoding method combining local and global is adopted; then, the maximum pooling is used to extract the feature points that best represent the features of the point cloud column; finally, according to the point cloud column index, the point cloud is remapped to the corresponding position of the original grid to generate a 2D pseudo image of size (C, H, W), where H and W represent the height and width of the image.
[0018] (4) The generated 2D pseudo image will be input into the 2D convolutional neural network for feature learning. Finally, the detection head designed based on SSD (Single Shot Multibox Detector) is used to realize the classification and regression of 3D object detection and generate a 3D object detection box.
[0019] Furthermore, the specific operations of step S3 are as follows:
[0020] First, based on the detection results, the 3D Kalman filter predicts the state of the associated trajectory from the previous frame to the current frame; then the data association module uses the Hungarian algorithm to match the predicted trajectory from the 3D Kalman filter and the detected target in the current frame; at the same time, the 3D Kalman filter updates the state of the matching trajectory based on the matching detection; finally, when a new target appears or an old target reappears, the trajectory of the target is created, and the trajectory of the disappeared target is deleted.
[0021] Furthermore, the specific algorithm flow of step S3 is as follows:
[0022] S3.1, obtaining a detection frame of the target from the point cloud data based on the 3D detection method in step S2;
[0023] S3.2, by using a 3D Kalman filter, the state of the target in the previous frame is estimated, and then the prediction frame of the target is obtained;
[0024] S3.3. Calculate the correlation between the detection box and the prediction box based on BIoU: The correlation calculation method based on Boundary Intersection over Union (BIoU) is adopted, which comprehensively considers the position information between the detection box and the prediction box, and obtains the optimal matching result through the Hungarian matching algorithm, ensuring accurate and robust target association;
[0025] S3.4, 3D Kalman filter updates the status of all matching targets: For all successfully matched targets, use Kalman filter to update their status to obtain more accurate target motion information;
[0026] S3.5. Life cycle management for unsuccessful matching targets: For unsuccessful matching targets, life cycle management is performed to dynamically adjust their life cycles;
[0027] S3.6. Output the target bounding box with a unique ID number, which provides a clear identification for each target and keeps it consistent throughout the tracking process.
[0028] Furthermore, the specific operations of step S4 are as follows:
[0029] S4.1. Collision avoidance warning area: A distance of 1.3 meters on both the left and right sides of the vehicle body is used as the warning area, plus a supplementary warning area of 1 meter for pedestrians and cyclists. Finally, the road is divided into a warning area and a safety area; the safety area is the area more than 120 meters away from the vehicle or outside the supplementary warning area for cyclists and pedestrians.
[0030] S4.2. Vehicle collision classification warning strategy based on time to collision: Based on the TTC algorithm model, set classification warnings, that is: if TTC ≤ 1.8s, issue a secondary warning: if 1.8s < TTC ≤ 2.7s, issue a primary warning; if TTC > 2.7s, then no warning; calculate the time to collision between the vehicle and the target, and issue classification warnings for targets with collision risks.
[0031] Calculate the time to collision for targets within the warning area, that is, calculate TTC. When TTC ≤ 1.8s, it is a secondary warning, and a danger warning signal is issued. At this time, the vehicle and the target are likely to collide, and a danger warning signal needs to be issued to prompt the driver to immediately step on the brake pedal for braking or deceleration to avoid colliding with the target; when the calculation result is 1.8s < TTC ≤ 2.7s, a primary warning signal is issued. Although there is still a certain safety distance between the vehicle and the target at this time, there is a certain collision risk, and a reminder to pay attention to the target ahead needs to be issued to the driver to remind the driver to pay attention to the target ahead so that a correct driving decision can be quickly made at any time to avoid accidents; when TTC > 2.7s, then no warning is issued, and there is almost no possibility of collision with the target ahead. Within the safety area, the time to collision of targets is not calculated, and no warning is required regardless of whether there are targets or not.
[0032] Advantageous technical effects of the present invention:
[0033] (1) The target detection and tracking technology of the vehicle collision warning system mostly relies on cameras and millimeter-wave radars at present. The present invention designs a three-dimensional target detection and tracking technology based on lidar.
[0034] (2) Aiming at the problem that it is difficult to balance real-time performance and detection accuracy in current three-dimensional target detection methods, based on the multi-head attention mechanism, a feature extraction network capable of extracting global features and local features is established, and then three-dimensional target detection is realized based on the two-dimensional target detection framework. This method has good detection accuracy and real-time performance.
[0035] (3) Based on the target detection results, a stable and reliable multi-target tracking method is designed based on the Kalman filter and the Hungarian matching algorithm. Description of the Drawings
[0036] Figure 1 It is a flow chart of a vehicle collision warning method based on lidar;
[0037] Figure 2 This is the network structure diagram of the target detection algorithm;
[0038] Figure 3 It is a feature encoding network based on multi-head attention mechanism;
[0039] Figure 4 It is a flow chart of the three-dimensional multi-target tracking method;
[0040] Figure 5 It is the 2D BIoU matching association graph;
[0041] Figure 6 It is the 3D BIoU matching association map;
[0042] Figure 7 A schematic diagram of the safety area division;
[0043] Figure 8 This is the logic diagram of the vehicle collision classification warning strategy. DETAILED DESCRIPTION
[0044] The present invention is described in detail below in conjunction with the accompanying drawings. A person skilled in the art can obtain the algorithm model of the present invention and implement its basic functions according to the following method.
[0045] 1. Overall process of vehicle collision warning method based on lidar
[0046] The overall process of the vehicle collision warning method based on laser radar of the present invention is as follows: Figure 1 As shown in the figure, firstly, the vehicle-mounted laser radar scans to obtain point cloud information; then the point cloud information is input into the target detector for target detection and classification; then the tracking method is used to track the target and obtain the relative speed, relative distance and other information of the relevant target; finally, the collision time is calculated for the relevant target, and the target with collision risk is warned. The following will introduce the target detection method, multi-target tracking method and vehicle collision warning strategy in detail.
[0047] 2. 3D Object Detection Method Based on Multi-Head Attention Mechanism
[0048] 2.1. The overall network structure of the target detection method based on the multi-head attention mechanism is as follows Figure 2As shown in the figure. The algorithm consists of three parts: (1) Feature encoder network based on multi-head attention mechanism: First, the three-dimensional point cloud is divided into point cloud columns, and the global features and local features of the point cloud information are extracted through the multi-head attention mechanism, and then a 2D pseudo image is generated. (2) Two-dimensional convolutional neural network: The 2D pseudo image is downsampled multiple times to obtain feature maps of different resolutions, and then the multiple downsampled feature maps are upsampled to the same size and spliced to generate the final feature map. Using only two-dimensional convolutional neural network can greatly speed up the detection speed. (3) SSD target detection head: Generate 3D detection box and target classification for the feature map to obtain the location and type of the object.
[0049] 2.2. Overall algorithm flow:
[0050] Taking the original point cloud data information as input, the point cloud is first represented as a uniformly distributed point cloud column: the three-dimensional point cloud information is directly obtained from the top view, and all points are discretized into a uniform square grid on the xy plane. Each point cloud column is a cubic column with infinite extension in the z-axis direction of each grid.
[0051] Due to the sparsity of point clouds, most point cloud columns are empty, and non-empty point cloud columns usually have only a small number of points. This sparsity is used to create a size density tensor (D, P, N), where D represents the feature dimension of each point cloud column, P represents the number of point cloud columns, and N represents the maximum number of points in each point cloud column. When the number of points in a point cloud column exceeds N, random sampling will be performed to select N points; when the number of points is less than N, 0 samples will be used to fill it.
[0052] After obtaining a tensor of (D, P, N), it is input into the feature encoding network based on the multi-head attention mechanism for feature extraction. First, the MLP operation is used for position encoding and dimensionality upscaling, and the tensor of (D, P, N) is converted into a tensor of (C, P, N), where C represents the feature dimension after dimensionality upscaling (256); then, the global context features are calculated for each point cloud column based on the multi-head attention mechanism, and the local structural features are calculated for the points in each point cloud column, so that the point cloud information in each point cloud column has global context features and local structural features. In particular, in order to fully extract the local structural features of the point cloud, a position encoding method combining local and global is adopted; then, the maximum pooling is used to extract the feature points that best represent the features of the point cloud column; finally, according to the point cloud column index, the point cloud is remapped to the corresponding position of the original grid to generate a 2D pseudo image of size (C, H, W), where H and W represent the height and width of the image.
[0053] The generated 2D pseudo image will be input into the 2D convolutional neural network for feature learning. Finally, the detection head designed based on SSD (Single Shot Multibox Detector) is used to realize the classification and regression of 3D target detection and generate a 3D target detection box.
[0054] In this method, the cross section of each point cloud column is a square with a side length of 0.16 meters. In the actual feature encoding process, only the front view part is intercepted to generate a pseudo image. Because the real annotation information of the KITTI dataset is only annotated in the front view image taken by the camera, the points in the negative direction of the original point cloud information in the x-axis should be discarded, and the points that are too far away are removed. The maximum and minimum values of (x, y, z) in the point cloud space are: min: [0, -39.68, -3], max: [69.12, 39.68, 1], in meters; the maximum number of point cloud columns P is 16000, and the maximum number of point samples in each point cloud column N is 32. The number of layers of the multi-head attention mechanism is 4, the number of heads is 2, and a 2-layer learnable MLP is used for position encoding.
[0055] 2.3. Feature Encoding Network Based on Multi-Head Attention Mechanism
[0056] The feature encoding network structure of this algorithm is as follows Figure 3 As shown in the figure, it is a network structure based on encoder-decoder. The input of the feature encoding network is point cloud information represented by point cloud column distribution. After position encoding, a vector sequence is generated and input into the multi-head attention mechanism module for calculation; each element of the input sequence interacts with other elements in the sequence and is given different weights according to their relevance. This interaction is achieved by calculating the attention weight matrix; it is then input into the feedforward neural network module to further nonlinearly transform the output of the attention layer; in addition, in order to prevent degradation problems during the training process, the ResNet residual neural network and layer normalization (LN layer) processing (i.e.: Add&Norm) are added; the difference between the decoder and the encoder is that there is an additional multi-head attention mechanism module with added mask, and its input is the predicted output of the entire feature calculation process; the final output layer converts the output of the decoder into the final probability distribution through a linear transformation and a Softmax function to generate the prediction result. Nx represents the number of encoders and decoders, that is, the number of layers of the attention mechanism. Each layer processes the input independently and passes its output to the next layer. The core content of this feature encoding network is to use the multi-head attention mechanism module to calculate the global context features of the point cloud column and the local features of the internal structure of the point cloud column:
[0057] (1) Calculation of global text features:
[0058] The calculation formula of the global attention mechanism is:
[0059] (1)
[0060] In formula (1), Q , K , V All are point cloud column feature codes. First, calculate Q Matrix and K Dot product of matrices, divided by scale is to prevent the dot product result from overflowing, where for Q and K After calculating the dot product, the Softmax function is used to normalize the dot product into a probability distribution, and then multiplied by the matrix V The attention score matrix between different point cloud columns is obtained.
[0061] The multi-head attention mechanism allows the model to simultaneously focus on information from different point cloud columns and different positions. The representation of the multi-head attention mechanism is as follows:
[0062] (2)
[0063] in , , , ; h That is, the number of attention mechanism heads.
[0064] All non-empty point cloud columns are subjected to global context feature calculation through a multi-head attention mechanism, which can increase global attention for each point cloud column.
[0065] (2) Local feature calculation
[0066] In the process of calculating the global features of the point cloud column, local feature calculation is added, and the local geometric relationship between the center point and the adjacent points is used to effectively aggregate local features by learning attention weights. The specific method is to use a subtractive relationship and simultaneously convert the local position information δ Adding attention vector γ and the eigenvector α In the example, it is used to aggregate features, and the overall calculation expression is:
[0067] (3)
[0068] in, is a set of eigenvectors formed by the points in the point cloud column, ; It is the feature output after adding local attention; , , It is a point-by-point feature transformation function, similar to a linear projection function; it is a mapping function that generates attention. Local position information The calculation formula is: (4)
[0069] In the formula, , are the coordinates of the 3D point cloud; It consists of two ReLU functions.
[0070] After the above processing, the point cloud features after feature encoding will have global position features and local structure features, reducing the feature loss caused by feature encoding. The subsequently generated 2D pseudo image is more conducive to subsequent feature learning, thereby achieving the purpose of improving target detection accuracy.
[0071] 2.4 2D Convolutional Neural Network and SSD Detection Head
[0072] After the original point cloud information passes through the feature encoding network, a 2D pseudo image is generated, which can be easily used to learn features using a 2D convolutional neural network. The structure of a 2D convolutional neural network is as follows: Figure 2 As shown in the figure. The backbone network consists of two sub-networks: a top-down feature extraction network and a network that upsamples and performs feature concatenation. The top-down sub-network uses a gradually decreasing spatial resolution to obtain features. It consists of a series of block structures. Each block structure (Block) contains three parameters (S, L, F). Each Block contains L 3×3 2D convolutional layers, F output channels, and the stride of the convolutional layer is S. The network that performs upsampling and feature concatenation is responsible for upsampling the features from the first sub-network and applying them to the BN layer (BatchNormalization) and ReLU function to form the final output features.
[0073] The SSD detection head is used to predict the position, category, and orientation of 3D objects. The 2D intersection-over-union (IOU) is used to match the prior box with the real annotation box. Height information is not considered, but used as an additional regression target. Because in real road targets, all objects can be considered to be in the same plane in three-dimensional space, and the height difference between objects of all categories is not very large, directly using the SmoothL1 function for regression can get better results. At the same time, the FPN (Feature Pyramid Network) operation is introduced in the detection head to handle targets of different sizes. By extracting features at different scales, objects of different sizes can be more accurately located.
[0074] 2.5 Loss calculation method
[0075] Use the same Loss calculation method as the original algorithm. Each true annotation box contains (x , y , z , w , l , h , θ ) 7 parameters, among which ( x , y , z ) represents the three-dimensional coordinates of the target center; ( w , l , h ) represents the length, width and height of the annotation box. θ Represents the rotation angle. The regression residual of the positioning task between the prior box and the true annotation box is defined as:
[0076] (5)
[0077] in Indicates the label box x value; Represents the prior box x value; y, z, w, l, h, θ Similarly; Represents the diagonal distance between the length and width of the prior box, defined as: .
[0078] The total positioning loss is:
[0079] (6)
[0080] Since two prior frames with completely opposite directions cannot be completely distinguished during angle regression, it is necessary to add direction classification of the prior frames. The direction classification loss function uses the Softmax function as follows: The target classification loss function uses formula (7):
[0081] (7)
[0082] It represents the probability of predicting the prior box to belong to the positive class, =0.25, r =2. The final total loss function is:
[0083] (8)
[0084] in is the correct number of prior boxes; ; ; .
[0085] Model training and testing
[0086] Since this method belongs to a deep learning method, it needs to be trained based on data samples, and the detection accuracy of the trained model is affected by the training samples.
[0087] 3. Multi-target tracking method based on 3D Kalman filter and Hungarian matching algorithm
[0088] 3.1 Overall Algorithm Process
[0089] The complete 3D multi-target tracking process, such as Figure 4 As shown. The overall process can be divided into the following key steps, each of which plays an important role in achieving efficient and accurate multi-target tracking: (1) 3D target detector obtains the target detection frame: First, based on the 3D detection method introduced in the previous article, the target detection frame is obtained from the point cloud data. This step ensures that the position of the target in 3D space can be accurately located. (2) 3D Kalman filter obtains the target prediction frame of the previous frame: By using the Kalman filter, we can estimate the state of the target in the previous frame and then obtain the target prediction frame. This step provides an effective prediction of the target motion. (3) Calculate the correlation between the detection frame and the prediction frame based on BIoU: The present invention adopts a correlation calculation method based on boundary intersection over union (BIoU), which comprehensively considers the position information between the detection frame and the prediction frame. Through the Hungarian matching algorithm, the optimal matching result is obtained, ensuring accurate and robust target association. (4) 3D Kalman filter updates the status of all matched targets: For all successfully matched targets, the present invention uses the Kalman filter to update their status to obtain more accurate target motion information. (5) Lifecycle management for unmatched targets: For unmatched targets, we manage their lifecycle and dynamically adjust their lifecycle. This strategy helps prevent excessive ID switching and misdetection of targets. (6) Output target bounding boxes with unique ID labels: Finally, target bounding boxes with unique ID labels are output, providing a clear identification for each target to maintain consistency throughout the tracking process. Through this process, the present invention achieves efficient tracking of multiple targets in 3D scenes, and by integrating advanced technologies such as 3D Kalman filtering and BIoU calculation, it ensures accurate estimation of target position and state, providing a reliable solution for practical applications.
[0090] 3.2 3D Kalman Filter
[0091] The 3D Kalman filter is used to handle state estimation problems in three-dimensional space. Its core formulas include the state estimation equations for the prediction and update steps, the covariance update equation, and the Kalman gain calculation equation. The following is a detailed introduction to these equations:
[0092] Prediction step:
[0093] (1) State estimation prediction equation:
[0094] (9)
[0095] in, It is at the moment k The predicted estimate of the state, expressed at time k-1 Previously, predictions of system states were made based on prior information; is the system state transition matrix, which describes the system from time k-1 To time k The evolution of states between It is at the moment k-1 The estimate of the state, expressed at time k-1 The optimal estimate of the system state; is the input matrix, which describes the influence of system input on state evolution; is the control input vector of the system, which is the control variable at time k, which can be an external input or a signal controlled by the system itself. This equation describes how the system state is predicted when there is no observation.
[0096] (2) Covariance prediction equation:
[0097] (10)
[0098] in, is the covariance matrix of the predicted estimate of the state at time k-1, which represents the uncertainty of the system's state estimate in the absence of observations; Same as formula (9); is the covariance matrix of the predicted estimate of the state at time k-1, which represents the uncertainty of the estimate of the state at time k-1; It is the covariance matrix of the system process noise, which represents the uncertainty of the system in the state transition process, usually caused by the dynamics of the system itself.
[0099] Update steps:
[0100] (1) Kalman gain calculation equation:
[0101] (11)
[0102] in, is the Kalman gain, which is a weight matrix used to adjust the relative weight between the predicted state and the measured state. The gain determines how to combine the predicted state and the measured state to update the optimal estimate of the system state; Same as formula (10); is the measurement matrix, which is used to transform the system state in the state space into the measurement state in the observation space; is the covariance matrix of the measurement noise, which describes the degree of measurement error, that is, the intensity of the measurement noise.
[0103] (2) Observation residual calculation equation:
[0104] (12)
[0105] in, is the observation residual, which represents the difference between the actual observation and the predicted observation, and is the difference vector between the actual measurement and the predicted measurement; is the actual observation value, which means the real observation value measured by the sensor; Same as formula (11); Same as formula (9).
[0106] (3) State update equation:
[0107] (13)
[0108] in, It is the a posteriori state estimate, which represents the state estimate value updated and corrected based on the current measurement information and the prior state estimate. It is the state estimate value finally output by the Kalman filter. is the a priori state estimate same as formula (9); They are the Kalman gain and observation residual, which are the same as formulas (11) and (12).
[0109] (4) Covariance update equation:
[0110] (14)
[0111] in, is the posterior covariance matrix, which represents the updated and corrected covariance matrix based on the current observations and the prior covariance matrix, and reflects the uncertainty or error of the estimated state; is the prior covariance matrix, The Kalman gain and observation residual are the same as before; is the identity matrix.
[0112] The above equations describe the main computational steps of 3D Kalman filtering. In the prediction step, the system state and covariance are predicted by the system dynamic model; in the update step, the Kalman gain is calculated by fusing the measurement results and the prediction results to update the state estimate and covariance estimate. This fusion process effectively utilizes past information and real-time measurements to provide the best estimate of the system state.
[0113] In the state prediction step, when predicting the target state from the previous frame to the current frame, the constant velocity model is used to estimate the inter-frame displacement between targets. In this model, the target state is represented as a state vector containing 11 elements, which represents the position and velocity information of the target in three-dimensional space, namely:
[0114] (15)
[0115] in, Respectively represent the center point coordinates of the target; Respectively represent the 3D bounding box scale of the target; is the heading angle of the target bounding box; represents the confidence score of the current trajectory; are the targets in three-dimensional space along x , y and z The speed of movement in the axis direction.
[0116] The set of all target states in the data at the first moment is expressed as:
[0117] (16)
[0118] in, Indicates the time i target state; represents the number of targets at time. According to the target state at time, the constant speed model can be used to estimate the k The target state of the frame. The predicted position of the target is:
[0119] (17)
[0120] For each target state at time k-1 Can give k Predicted state at the moment .
[0121] In the state update step, according to the result of data association, the present invention divides the tracking target and the detection target into four categories to more comprehensively describe the target tracking status: tracking match success, detection match success, tracking match failure, and detection match failure. In each category, the state of the target and the feedback of the system have unique characteristics, which are helpful for further analysis and improvement of the tracking algorithm. For example, a successful tracking match indicates that the system can successfully predict and associate the movement of the target, while a failed detection match may indicate some local occlusion or detection error. Such classification can more clearly understand the performance of the target tracking system and provide targeted information for further optimization. Their respective specific forms are:
[0122]
[0123] in, and Indicates the tracking target and the detection target that are successfully matched; Indicates the number of successful matches at the current moment; and They represent the tracking targets and detection targets that failed to match respectively; Indicates the number of all tracking targets at the last moment; Indicates the number of detected targets at the current moment. After the matching is completed, the successfully matched targets are used. Update the corresponding target state according to the Bayesian rule.
[0124] 3.3 Hungarian algorithm based on BIoU matching
[0125] In the data association step, in order to overcome some limitations of the traditional IoU metric or Euclidean distance metric, this method adopts an innovative comprehensive metric, namely Boundary Intersection over Union (BIoU). Compared with IoU, BIoU combines Euclidean distance to construct a more comprehensive and robust metric. Specifically, BIoU consists of two parts: IoU and boundary distance penalty, forming a comprehensive distance and overlap evaluation criterion.
[0126] The design of this comprehensive metric takes into account some common problems encountered in target tracking, such as the ambiguity of target boundaries and the contact between targets. By combining the Euclidean distance, BIoU can better capture the shape differences between targets, making the metric more discriminative. At the same time, the introduction of the boundary distance penalty term can effectively deal with the situation of inaccurate target edge information and improve the stability and reliability of the metric.
[0127] The use of BIoU metric not only provides a more accurate similarity metric for target association, but also solves the problem of IoU metric failure in the case of no intersection and singularity to a certain extent. Its specific form is:
[0128]
[0129] in, It represents the intersection-over-union ratio of two bounding boxes in a general sense; is the penalty term based on the Euclidean distance of the boundary; is the penalty factor; Respectively represent the upper left vertex and lower right vertex of the minimum bounding box of the two bounding boxes; Represents the Euclidean distance between two vertices; Indicates the maximum diagonal distance of the minimum bounding box of two bounding boxes, which is used to normalize the boundary distance. It is worth mentioning that the method of using the minimum bounding box can weaken the influence of rotation on the boundary distance, making it easier to calculate the boundary distance.
[0130] Figure 5 The figure shows how to calculate 2D BIoU. The orange and blue solid boxes represent two different bounding boxes; the dashed box represents their respective minimum bounding boxes; the overlapping gray area in the middle represents ; The red line indicates the boundary distance and ; The green line indicates the maximum diagonal distance .
[0131] For 3D multi-target tracking, this method extends the above 2D BIoU definition to a 3D coordinate system, as Figure 6 As shown. The calculation formula of 3DBIoU is:
[0132]
[0133] in, Represents two 3D bounding boxes and The volume intersection ratio (gray area in the figure); the penalty term Related to the boundary distance, They are the upper and lower left front vertices and the upper and lower right rear vertices of the minimum external bounding box of the two 3D bounding boxes; the red line segment indicates the boundary distance and ; The green line segment represents the maximum diagonal distance between the two smallest bounding box vertices .
[0134] 3.4 Adaptive Lifecycle Management Strategy
[0135] In multi-target tracking, there are situations where targets may move out of the field of view or new targets may enter the field of view, so a module is needed to handle the generation and deletion of tracks. Lifecycle management is a common practice, treating unsuccessfully matched detected targets as possible new tracks. In order to avoid false positives, the target needs to be detected continuously for a period of time before it is identified as a new target track. Similarly, unsuccessfully matched tracked targets are considered tracks that are about to leave the field of view. Only after the target has been unsuccessfully matched for a certain number of consecutive frames will it be considered lost and deleted. Ideally, this strategy can retain the target tracks that have not been successfully matched due to single-frame missed detection and only delete the target tracks that have left the field of view.
[0136] However, in practical applications, false detection and missed detection of 3D target detectors are relatively common. Fixed lifecycle management strategies can lead to incorrect tracking trajectories, mainly because the strategy fails to effectively utilize the confidence information of the detected target. It performs the same cycle of inspection operations on all targets. Therefore, targets with low detection confidence (usually false detection targets) need to be tracked for multiple frames before being deleted, while targets with higher confidence may also be mistakenly deleted once they are occluded by multiple frames (usually missed detection). Therefore, the present invention adopts an adaptive lifecycle management strategy to dynamically adjust the maximum lifecycle according to the confidence information of the target detection results. Such a strategy can handle targets with different confidence levels more flexibly, thereby improving the robustness and accuracy of the tracking system:
[0137]
[0138] in, is the detection confidence of the current target; and are the scale factor and the offset factor; express Non-linear functions; is the maximum survival period; is the life cycle calculated based on the target detection confidence. and , achieving better tracking effect. Using the S-curve characteristics of the Sigmoid function, the higher the confidence of the detected target, the longer the life cycle of the target will be, thereby achieving dynamic adjustment of the life cycle.
[0139] 3.5. Implementation of multi-target tracking method
[0140] Different from the detection method, this tracking method does not belong to the deep learning method, so it does not require model training. Its tracking accuracy is mainly affected by the detection results. In actual application, the detected target point cloud information is input into the tracking algorithm to achieve target tracking.
[0141] 4. Vehicle collision classification warning strategy based on collision time
[0142] By using the above three-dimensional target detection and tracking method, the target information in front can be better identified and stably tracked, thereby obtaining the accurate distance and relative speed of the target in front. The collision time can be calculated based on the relative distance and relative speed to achieve graded warning of dangerous targets. Therefore, the present invention designs a front vehicle collision warning strategy based on the collision time.
[0143] 4.1. Collision time calculation model
[0144] The TTC (Time to Collision) algorithm is an algorithm model used to estimate the remaining collision time between a target and itself, and is usually used in computer vision, autonomous driving and other fields. The core idea of the TTC model is to estimate the collision time between the target and itself by analyzing the motion changes of the target in the previous and next frames, and then compare it with the set threshold to determine whether an early warning or further measures are needed.
[0145] The calculation formula of the TTC model is as follows:
[0146]
[0147] in, S r is the relative distance; v r is the relative speed; a r is the relative acceleration. S r Can be directly measured by LiDAR (based on collision requirements, the relative distance is taken as the point closest to the target and the vehicle); relative speed v r The relative acceleration is calculated by the tracking algorithm based on the position change of the previous and next frames using formula (23); a r Similarly, the relative speed v r The change with time is calculated.
[0148]
[0149] in express k -1 time has arrived k The relative distance change at time, express k -1 time has arrived k Moment of time.
[0150] If the threshold setting of the warning time is too long, it will cause frequent alarms and interfere with the driver. If the threshold of the warning time is set too short, the driver will not have enough reaction time, and the function of collision warning will not be achieved. After consulting relevant literature, hierarchical warning is set as shown in formula (24), that is: if TTC ≤ 1.8s, secondary warning is carried out; if 1.8s < TTC ≤ 2.7s, primary warning is carried out; if TTC > 2.7s, no warning is given;
[0151] 。
[0152] 4.2. Collision area division
[0153] Since the road targets are not single vehicles, only the vehicle targets in the same lane should be considered for collision warning during normal vehicle driving. In the face of complex traffic scenarios, calculating the time to collision for each target to judge whether warning is needed has poor robustness and low efficiency. In order to better cope with the complex traffic environment of multiple targets and multiple categories, the anti-collision warning area is divided, as Figure 7 shown.
[0154] First, considering the factor of multiple lanes, the target that needs to be warned should be the front target in this lane. Therefore, only the distance of 1.3 meters on both the left and right sides of the vehicle body is considered as the warning area. Also, considering that pedestrians and cyclists usually appear on both sides of the road, an additional warning supplementary area of 1 meter wide for pedestrians and cyclists is added. And because there is no collision risk for targets that are too far away, they do not need to be considered. Finally, the road is divided into a warning area and a safe area.
[0155] For the targets in the warning area, the time to collision needs to be calculated, that is, calculate TTC. When TTC ≤ 1.8s, it is a secondary warning, and a danger warning signal is issued. At this time, the vehicle and the target are likely to collide, and a danger warning signal needs to be issued to prompt the driver to immediately step on the brake pedal for braking or decelerating, so as to avoid colliding with the target. When the calculation result is 1.8s < TTC ≤ 2.7s, a primary warning signal is issued. Although there is still a certain safety distance between the vehicle and the target at this time, there is a certain collision risk, and a reminder to pay attention to the front target needs to be issued to the driver to remind the driver to pay attention to the front target, so that the driver can quickly make a correct driving decision at any time to avoid accidents. When TTC > 2.7s, no warning is given, and there is almost no possibility of collision with the front target at this time.
[0156] The safe area is the area more than 120 meters away from the vehicle or outside the supplementary area for cyclists and pedestrians. At this time, the vehicle is far away from the front target, and no warning is required whether there is a target or not. Therefore, in order to improve the calculation speed, the collision time of the targets in this area is not calculated.
[0157] In summary, the vehicle collision classification warning logic of the present invention is as follows: Figure 8 shown.
Claims
1. A vehicle collision warning method based on laser radar, characterized in that: The steps include: S1, point cloud information is obtained by scanning by vehicle-mounted laser radar; S2, then the point cloud information is input into the target detector for target detection and classification; S3, then use the tracking method to track the target and obtain the relative speed and relative distance information of the relevant target; S4. Finally, the collision time of the relevant targets is calculated, and an early warning is issued for the targets with collision risk; The specific operation of step S2 is as follows: S2.
1. Feature encoder network based on multi-head attention mechanism: First, the 3D point cloud is divided into point cloud columns, and the global features and local features of the point cloud information are extracted through the multi-head attention mechanism, and then a 2D pseudo image is generated; S2.2, 2D convolutional neural network: The 2D pseudo-image is downsampled multiple times to obtain feature maps of different resolutions, and then the multiple downsampled feature maps are upsampled to the same size and spliced to generate the final feature map. Using only the 2D convolutional neural network can greatly speed up the detection speed; S2.3, SSD target detection head: Generate 3D detection box and target classification for the feature map to obtain the location and type of the object.
2. The vehicle collision warning method based on laser radar according to claim 1, characterized in that: The algorithm flow of step S2 includes the following steps: (1) Taking the original point cloud data information as input, the point cloud is first represented as a uniformly distributed point cloud column: the three-dimensional point cloud information is directly obtained from the top view, and all points are discretized into a uniform square grid on the xy plane. Each point cloud column is a cubic column with infinite extension in the z-axis direction. (2) Use the sparsity of the point cloud to create a size density tensor (D, P, N), where D represents the feature dimension of each point cloud column, P represents the number of point cloud columns, and N represents the maximum number of points in each point cloud column. When the number of points in a point cloud column exceeds N, random sampling will be performed to select N points; when the number of points is less than N, 0 samples will be used to fill the gap. (3) After obtaining a tensor (D, P, N), it is input into a feature encoding network based on a multi-head attention mechanism for feature extraction; first, the MLP operation is used for position encoding and dimensionality upgrading, and the tensor (D, P, N) is converted into a tensor (C, P, N), where C represents the feature dimension after dimensionality upgrading; then, based on the multi-head attention mechanism, the global context features are calculated for each point cloud column and the local structural features are calculated for the points in each point cloud column, so that the point cloud information in each point cloud column has global context features and local structural features; a position encoding method combining local and global is adopted; then, the maximum pooling is used to extract the feature points that best represent the features of the point cloud column; finally, according to the point cloud column index, the point cloud is remapped to the corresponding position of the original grid to generate a 2D pseudo image of size (C, H, W), where H and W represent the height and width of the image; (4) The generated 2D pseudo image will be input into the 2D convolutional neural network for feature learning. Finally, the detection head designed based on SSD (Single Shot Multibox Detector) is used to realize the classification and regression of 3D target detection and generate a 3D target detection box.
3. The vehicle collision warning method based on laser radar according to claim 1, characterized in that: The specific operation of step S3 is as follows: First, based on the detection results, the 3D Kalman filter predicts the state of the associated trajectory from the previous frame to the current frame. Then, the data association module uses the Hungarian algorithm to match the predicted trajectories from the 3D Kalman filter and the detected objects in the current frame. At the same time, the 3D Kalman filter updates the state of the matched trajectories based on the matched detections. Finally, when a new object appears or an old object reappears, a trajectory for the object is created, and the trajectories of disappeared objects are deleted.
4. The vehicle collision warning method based on laser radar according to claim 3 is characterized in that: The specific algorithm flow of step S3 is as follows: S3.
1. Obtain the detection bounding box of the object from the point cloud data based on the 3D detection method in step S2. S3.
2. Estimate the state of the object in the previous frame by using a 3D Kalman filter, and then obtain the predicted bounding box of the object. S3.
3. Calculate the association degree between the detection bounding box and the predicted bounding box based on BIoU: Adopt the association degree calculation method based on the boundary intersection over union (BIoU), comprehensively consider the position information between the detection bounding box and the predicted bounding box, and obtain the optimal matching result through the Hungarian matching algorithm, ensuring accurate and robust object association. S3.
4. Update the state of all matched objects by 3D Kalman filtering: For all successfully matched objects, use the Kalman filter to update their states to obtain more accurate object motion information. S3.
5. Manage the life cycle of the objects that are not successfully matched: For the objects that are not successfully matched, manage their life cycles and dynamically adjust their life cycles. S3.
6. Output the object bounding boxes with unique ID labels, providing a clear identification for each object and keeping it consistent throughout the tracking process.
5. The vehicle collision warning method based on laser radar according to claim 1, characterized in that: The specific operation of step S4 is as follows: S4.
1. Set up the anti-collision warning area: The distance of 1.3 meters on both the left and right widths of the vehicle body is used as the warning area, plus a warning supplement area of 1 meter for pedestrians and cyclists. Finally, the road is divided into a warning area and a safe area; The safe area is the area more than 120 meters away from the vehicle or outside the warning supplement area for cyclists and pedestrians. S4.
2. Vehicle collision classification warning strategy based on the time to collision: Based on the TTC algorithm model, set up classification warnings, that is: If TTC ≤ 1.8s, issue a secondary warning; If 1.8s < TTC ≤ 2.7s, issue a primary warning; If TTC > 2.7s, then no warning is issued; Calculate the time to collision between the vehicle and the object, and issue classification warnings for the objects with collision risks. Calculate the time to collision (TTC) for the target within the warning area. When TTC ≤ 1.8 s, it is a secondary warning, and a danger warning signal is issued. At this time, there is a high probability of a collision between the host vehicle and the target, and a danger warning signal needs to be issued to prompt the driver to immediately step on the brake pedal for braking or deceleration to avoid a collision with the target. When the calculation result is 1.8 s < TTC ≤ 2.7 s, a primary warning signal is issued. Although there is still a safe distance between the host vehicle and the target at this time, there is a certain collision risk, and a reminder to pay attention to the target ahead needs to be issued to the driver to remind the driver to pay attention to the target ahead so that a correct driving decision can be quickly made at any time to avoid accidents. When TTC > 2.7 s, there is no warning, and there is almost no possibility of a collision with the target ahead. Within the safe area, the time to collision is not calculated for any target, and no warning is required regardless of whether there is a target or not.
