Vehicle identification method and device
Through the combination of the improved YOLOv7 network model and millimeter-wave radar data, the problem of misdetection and missed tracking of vehicle identification in complex weather is solved, and the accuracy of vehicle identification and traffic status perception is improved.
Patent Information
- Application Number
- CN202311616366.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-11-30
- Publication Date
- 2024-09-17
- Estimated Expiration
- 2043-11-30
AI Technical Summary
Traditional traffic monitoring methods have problems with false detection and missed tracking in complex weather conditions. In particular, lidar cannot obtain target textures, resulting in object classification errors and inability to distinguish between moving vehicles and ground objects.
The improved YOLOv7 network model is used, combined with video images and radar data, to identify vehicles through the ACmix attention module and millimeter wave radar information, match the vehicle's position and movement trajectory, and reduce the rate of false detection and false following.
It improves the precision and accuracy of vehicle identification, avoids missed and false detections, and enhances traffic status perception and emergency response capabilities in bad weather.
Smart Images

Figure CN117593707B
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of image recognition and positioning, and in particular to a vehicle recognition method and device based on video images and radar data. Background Art
[0002] With the continuous increase in the number and speed of vehicles, traffic safety issues are becoming more and more prominent. Especially in bad weather, the incidence of road traffic accidents is higher. According to statistics, there were 14,527 traffic accidents on my country's highways in 2022. More than 85% of the accidents will cause rapid changes in traffic conditions, and the time for emergency response personnel and resources to arrive at the scene will be extended, thus affecting the effectiveness of emergency response. In order to improve the accurate perception of traffic conditions and emergency response, a variety of high-precision technical means are adopted, among which the most important ones include millimeter-wave radar technology, vehicle identification technology, video surveillance technology, road surface condition monitoring and weather condition monitoring technology. Millimeter-wave radar technology has the advantages of high precision, high sensitivity and no influence from weather, and can perform vehicle detection and speed measurement. Through millimeter-wave radar technology, vehicle information, such as location, speed and other data, can be accurately obtained to provide accurate data support for traffic status perception. In addition, it can also be used for emergency response when traffic incidents occur, such as quickly locating accident points. Vehicle identification technology can identify vehicle model, color, license plate number and other information, providing key data for tracing and recording traffic events. At the same time, it can also be used for monitoring and punishing illegal vehicles. Video surveillance technology can be used for road monitoring and image enhancement, and road surface status monitoring and weather condition monitoring technology can provide real-time road condition information and weather forecasts. However, traditional traffic monitoring methods still have shortcomings in traffic status perception and emergency handling in complex weather conditions: single-mode sensors have certain limitations and are prone to false detection and missed tracking; laser radar cannot obtain target texture, which leads to object classification errors, that is, it cannot distinguish between moving vehicles and ground objects, so new technical means need to be found to solve these problems. Summary of the invention
[0003] The object of the present invention is to provide a vehicle identification method and device, which can improve the vehicle identification accuracy.
[0004] To achieve the above object, the present invention provides the following solutions:
[0005] A vehicle identification method, the method comprising:
[0006] Acquire a video to be identified, wherein the video to be identified includes a plurality of frames of images to be identified; the images to be identified are obtained by photographing a target road with a camera;
[0007] For each of the images to be identified, the image to be identified is input into a trained vehicle identification model to identify each vehicle in the image to be identified and obtain video information; the video information includes the position information of each vehicle in the image to be identified; wherein the vehicle identification model is an improved YOLOv7 network model; the improvement includes: replacing the convolution layer in BConv in the REPConv module in the existing YOLOv7 network model with an ACmix attention module;
[0008] Determine radar information according to the point cloud data of the target road; the radar information includes the confidence, position coordinates and orientation of the vehicle on the target road;
[0009] According to the radar information and the video information, the millimeter wave radar target is matched with the vehicles in each of the images to be identified one by one to obtain target information; the target information includes the movement trajectory of each of the vehicles on the target road.
[0010] The present invention also provides a vehicle identification device based on the aforementioned vehicle identification method, the vehicle identification device comprising a video acquisition module, a radar module and a processing module;
[0011] The video acquisition module is used to acquire the video to be identified;
[0012] The radar module is used to collect point cloud data of the target road;
[0013] The processing module is used to implement the aforementioned vehicle identification method.
[0014] According to the specific embodiment provided by the present invention, the present invention discloses the following technical effects: the present invention provides a vehicle identification method and device, the method comprising: obtaining a video to be identified, the video to be identified includes several frames of images to be identified; the images to be identified are obtained by shooting a target road by a camera; for each image to be identified, the image to be identified is input into a trained vehicle identification model to identify each vehicle in the image to be identified and obtain video information; the video information includes the position information of each vehicle in the image to be identified; wherein the vehicle identification model is an improved YOLOv7 network model; radar information is determined according to the point cloud data of the target road; the radar information includes the confidence, position coordinates and orientation of the vehicle on the target road; the millimeter wave radar target is matched with the vehicle in each image to be identified one by one according to the radar information and the video information to obtain the target information; the target information includes the motion trajectory of each vehicle on the target road. The present invention adopts an improved YOLOv7 network model to identify the vehicle in the image to be identified, and further adopts the radar identification data to match the vehicle identified by the improved YOLOv7 network model, which can avoid missed detection and false detection, and improve the accuracy of vehicle identification. BRIEF DESCRIPTION OF THE DRAWINGS
[0015] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.
[0016] Figure 1 A schematic diagram of a vehicle identification method flow chart provided in Embodiment 1 of the present invention;
[0017] Figure 2 A schematic diagram of a specific implementation flow of the vehicle identification method provided in Embodiment 1 of the present invention;
[0018] Figure 3 A schematic diagram of a process for determining a size ratio Y using a millimeter wave radar provided in Embodiment 1 of the present invention;
[0019] Figure 4 A schematic diagram of a 2D image detection frame provided in Example 1 of the present invention;
[0020] Figure 5 A schematic diagram of the structure of an existing YOLOv7 network model provided in Example 1 of the present invention;
[0021] Figure 6 A schematic diagram of the information fusion effect provided by Example 1 of the present invention;
[0022] Figure 7 A schematic diagram of the separation and merging operation provided in Example 1 of the present invention;
[0023] Figure 8 A schematic diagram of the structure of the MPConv module before and after the improvement provided in Embodiment 1 of the present invention;
[0024] Fig. 9 A schematic diagram of the structure of the ACmix attention module provided in Example 1 of the present invention;
[0025] Fig.10 A schematic diagram of the intersection-and-union ratio provided in Example 1 of the present invention;
[0026] Fig.11 A schematic diagram of the test results of the improved YOLOv7 target detection model provided in Example 1 of the present invention;
[0027] Fig.12 A schematic diagram of a detection process of a vehicle target detection module based on three-dimensional space provided in Example 1 of the present invention;
[0028] Fig.13A schematic diagram of a 3D image detection frame provided in Example 1 of the present invention;
[0029] Fig.14 A schematic diagram of the PointPillars method and the VoxelPillars method process provided in Example 1 of the present invention;
[0030] Fig.15 A schematic diagram of the principle of a mean voxel encoder provided in Embodiment 1 of the present invention;
[0031] Fig.16 A schematic diagram of a voxel column feature extraction process provided in Example 1 of the present invention;
[0032] Fig.17 A schematic diagram of the structure of a feature pyramid network and an object detection head provided in Example 1 of the present invention;
[0033] Fig.18 A schematic diagram of the visualization result of vehicle detection provided in Example 1 of the present invention;
[0034] Fig.19 A schematic diagram of the process of point cloud and image fusion provided in Example 1 of the present invention;
[0035] Fig. 20 A schematic diagram of the principle of calculating the size of the mean pooling filter according to the size of the anchor frame provided in Example 1 of the present invention. DETAILED DESCRIPTION
[0036] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0037] The purpose of the present invention is to provide a vehicle recognition method and device, which uses a binocular camera to collect image information, improves the module and YOLOv7 network structure for processing, and realizes two-dimensional vehicle target detection. The improved MPConv and the introduced ACmix attention module help extract multi-scale feature information, so as to detect vehicle targets more accurately. The actual size and mapping ratio of the intersection are collected by millimeter wave radar, and the voxel column bird's-eye view and anchor point filtering strategy and feature pyramid and multi-functional target detection head are used to detect on point cloud data. Invalid anchor points are removed by conversion matrix, two-dimensional and three-dimensional features are extracted, and target regression is performed, so as to realize three-dimensional vehicle target detection based on laser point cloud. After obtaining the image and point cloud data, the detection results of the image data and point cloud data will be screened using the Hungarian algorithm, which can significantly reduce the misjudgment rate. Secondary screening is performed for the unmatched detection results to obtain more accurate fusion results. Finally, the fusion results of image visual target detection and point cloud target detection will be obtained, so as to obtain vehicle target information more comprehensively.
[0038] In order to make the above-mentioned objects, features and advantages of the present invention more obvious and easy to understand, the present invention is further described in detail below with reference to the accompanying drawings and specific embodiments.
[0039] Embodiment 1:
[0040] like Figure 1 and Figure 2 As shown, the present invention provides a vehicle identification method, the method comprising:
[0041] S1: Acquire a video to be identified, wherein the video to be identified includes a plurality of frames of images to be identified; the images to be identified are obtained by photographing a target road with a camera.
[0042] S2: For each of the images to be identified, the image to be identified is input into a trained vehicle identification model to identify each vehicle in the image to be identified and obtain video information; the video information includes the position information of each vehicle in the image to be identified; wherein the vehicle identification model is an improved YOLOv7 network model; the improvement includes: replacing the convolutional layer in BConv in the REPConv module in the existing YOLOv7 network model with an ACmix attention module.
[0043] S3: Determine radar information according to the point cloud data of the target road; the radar information includes the confidence, position coordinates and orientation of the vehicle on the target road.
[0044] S4: Matching the millimeter-wave radar target with the vehicles in each of the to-be-identified images one by one according to the radar information and the video information to obtain target information; the target information includes the movement trajectory of each of the vehicles on the target road.
[0045] The networks involved in this embodiment include: target detection network: improved YOLOv7 network (including four parts: convolution module, E-ELAN module, MPConv module and SPPCSPC module).
[0046] This embodiment does not require 3D data, multiple viewing angles or camera parameters, simulates a new viewing angle, maps the three-dimensional structure of an object from a two-dimensional image, and performs rendering.
[0047] Autoencoder: It consists of an encoder E and a generative network G. It mainly uses unsupervised learning to obtain the hidden features of the input image, including the posture and shape of the object, and uses the learned features to reconstruct the original data.
[0048] Three-dimensional sparse convolutional network: It consists of spatial sparse convolution (SparseConv3d) and submanifold sparse convolution (SubMConv3d); through sparse output features, it restores the point cloud context structure and reconstructs the shape of the three-dimensional object.
[0049] Radar-vision fusion algorithm: extracts data through millimeter-wave radar and uses the transformation matrix to map the size to the model generated after 3D reconstruction.
[0050] The above vehicle identification method is divided into four parts for specific introduction:
[0051] Part I: Data Collection:
[0052] 1.1 Get video information X:
[0053] First, a binocular camera is used to collect image information, and video data is collected at the target road intersection to obtain video information X (video to be identified) at a specific moment as the data basis for the joint calibration of point cloud and image information.
[0054] 1.2 Get the size ratio Y:
[0055] Long-distance vehicles account for a small proportion of the image field of view, and their visual information is small, making it difficult to extract discriminative features. At the same time, as the network deepens, the downsampling rate becomes larger, and its detailed information may completely disappear, resulting in low accuracy in long-distance target detection by pure visual methods. In response to the above problems, the present invention proposes a visual enhancement method based on millimeter-wave radar spatial preprocessing. The method first starts from the data level, characterizes the spatial position of potential long-distance targets based on millimeter-wave radar, and uses the characterization results to divide the long-distance target area in the camera-captured image. Then, the divided area image is reconstructed, detected, and restored to improve the visual detection accuracy of long-distance targets.
[0056] The specific process is as follows Figure 3As shown in the figure, visual enhancement based on millimeter-wave radar spatial preprocessing mainly consists of two steps: image reconstruction and image restoration. Figure 3 Part (a) shows the image reconstruction process. P1 represents the input original image, C1, C2, ..., C n Indicates the long-distance target obtained by millimeter-wave radar pre-detection, mapped to the image and divided into target candidate areas. Image reconstruction is to splice the enlarged target candidate area with the reduced-size input P1 to form a new image P2. Then, P2 is used as input to the image detection network for operation, and the result containing the image detection features after detection is P3. Next, image restoration is performed. Figure 3 Part (b) shows the image restoration process. The dotted box in P3 represents the target detection box. Image restoration is to restore the position of the detection box in P3 to the original image through coordinate transformation and output the final result P4.
[0057] Millimeter-wave radar is used as a sensing device for synchronous scanning. First, the millimeter-wave radar and binocular camera are calibrated. When the millimeter-wave radar information and the image information obtained by the binocular camera are collected from the sensor and input into the system, time synchronization must be performed first to ensure that the timestamps of the processed information are similar. Then, the millimeter-wave radar information is converted through homography transformation calibration so that the millimeter-wave radar target can be mapped to the image. Further, the calibrated millimeter-wave radar information and image information are sent to the radar fusion detection network composed of visual enhancement and radar weighted fusion framework to output the position of the vehicle target on the image. At the same time, the information fusion method based on IOU is used to match the millimeter-wave radar target with the vehicle target in the image one by one, and the distance information is added to the identified vehicle target. Sensor time synchronization is used to ensure that the system can receive different sensor data at the same time, and the mapping of three-dimensional radar data to two-dimensional image data is realized with the help of the conversion matrix, so as to collect the actual size and mapping ratio Y of the target.
[0058] Part 2: Target detection and recognition video data X based on the improved YOLOv7 network model:
[0059] The processing module of the vehicle recognition device calls the video data X obtained in the first part and inputs the improved YOLOv7 network model: the MPConv improvement module extracts the multi-scale information features of the two-dimensional image from the video data; the extracted features are passed through the ACmix attention module to enhance the network's attention to the target detection vehicle, taking into account both global and local features; through the above feature information, the CEIOU loss function is designed to accurately predict the target detection frame. After the YOLOv7 network detection, the detection result y1 is output: the image 2D detection frame, the detection frame is as follows Figure 4 As shown, save the results to the storage module.
[0060] The backbone network of the existing YOLOv7 network model is mainly composed of convolution, E-ELAN (Extended-ELAN) module, MPConv module and SPPCSPC module, such as Figure 5 shown.
[0061] 2.1. Extracting multi-scale feature information: MPConv improved module:
[0062] The improvement also includes: adding a separation and merging module between the first right branch convolution layer and the second right branch convolution layer of the right branch of the MPConv module; the separation and merging module is used to: separate the features output by the first right branch convolution layer to obtain a plurality of sub-features; splice all the sub-features in the channel dimension to obtain spliced features; and the spliced features are used to input the second right branch convolution layer.
[0063] In order to better extract multi-scale feature information, this embodiment introduces an MPConv (Multi-Pass Convolution) improvement module in the YOLOv7 network. This module is used to improve the MPConv module in the YOLOv7 network. Each module contains multiple convolution layers and activation functions to extract rich feature representations, thereby enhancing the representation ability of image features.
[0064] In the YOLOv7 network, the upper branch of the MPConv module is connected to a convolution with k=1, s=1 after the maximum pooling layer; the lower branch is connected to a convolution with k=3, s=2 after the convolution with k=1, s=1. Among them, the maximum pooling layer and the 1×1 convolution are cascaded to learn the edge and texture information of the image by selecting the local maximum, while the other branch extracts more detailed information of the image through the cascade of two convolutions. The merger of the two branches brings better information fusion effect to the network, such as Figure 6 When the convolution kernel is 3 and the stride is 2, the convolution process will cause some fine-grained loss, resulting in inefficient feature representation learning of the network.
[0065] In order to avoid the feature loss caused by the convolution with a step size of 2 for small target networks, a separation and merging operation is required. The operation principle is as follows: Figure 7 As shown in the figure, for an image with S×S pixels, it is separated into 4 sub-images of size S / 2×S / 2, and then the 4 sub-images are concatenated according to the channels. After separation and merging, the features are then convolved with 1×1 convolution to obtain features of size S / 2×S / 2×1.
[0066] The structure of the MPConv module before improvement is as follows Figure 8 As shown in (a), the structure of the improved MPConv module is as follows Figure 8 As shown in (b), the right branch is the same as before the improvement, achieving the purpose of halving the size of the feature map without causing feature loss during the operation.
[0067] 2.2. Taking into account both global and local features: Introducing the attention module (i.e., ACmix attention module): Replace the convolutional layer in BConv in the REPConv module in the existing YOLOv7 network model with the ACmix attention module.
[0068] In the attention mechanism, the convolutional attention module focuses more on the relationship between input and output, while the self-attention module focuses more on the relationship between input and input. This module combines the advantages of both self-attention and convolutional attention and introduces the ACmix attention module to enhance the network's attention to target detection vehicles. The ACmix attention module is composed of two modules, the convolutional attention module and the self-attention module, in parallel. Fig. 9 shown.
[0069] The ACmix attention module is as follows:
[0070] The H×W×C features are projected through three 1×1×C convolutions and divided into N pieces, obtaining 3×N sub-features of size (H×W×C / N).
[0071] For the upper branch (the convolution path with kernel k), the network collects information from the local receptive field like traditional convolutional attention. After the sub-features pass through the 3N×K2N fully connected layer, the generated features are shifted, aggregated, and convolved to obtain H×W×C features.
[0072] For the lower branch (self-attention path), the network considers the overall situation and focuses on the key points like self-attention. The 3 feature maps of H×W×C / N size corresponding to the 3N sub-features are used as queries, keys and values respectively, and follow the traditional multi-head self-attention model to obtain H×W×C features through shifting, aggregation and convolution.
[0073] Finally, the outputs of the two paths are concat-operated, and the strength is controlled by two learnable scalars. After the output results are merged, both global and local features are taken into account, which improves the network's detection effect on target detection vehicles.
[0074] 2.3. CEIOU loss function design:
[0075] Before inputting the image to be recognized into the trained vehicle recognition model, the method further includes: training the vehicle recognition model, specifically including:
[0076] Acquire a data set; the data set includes a plurality of frames of sample images to be identified and sample video information corresponding to each of the sample images to be identified.
[0077] The vehicle recognition model is trained using the data set using the CEIOU loss function to obtain a trained vehicle recognition model.
[0078] Specifically: This embodiment combines the characteristics of EIOU and GIOU and proposes a CEIOU as a bounding box regression loss function. The CEIOU loss function effectively improves the detection accuracy of the network at the cost of a smaller regression speed.
[0079] The schematic diagram of the intersection-and-union ratio is as follows Fig.10 As shown in the figure, the solid box represents the true value box, the dotted box represents the predicted box, and the intersection over union (IOU) represents the ratio of the intersection area of the two boxes to the union area.
[0080] In the original network SAF-FCOS, the regression loss Lreg uses GIOU (Generalized IOU), and the expression is shown in the following formula. When two bounding boxes have the same length and width and are on the same horizontal plane, GIOU will degenerate into IOU, and the regression calculation of GIOU is not accurate enough; while EIOU (Efficient IOU) calculates the difference between the width, height and center point coordinates, resulting in faster convergence speed and better positioning results, which can solve the problems of GIOU. The expression is shown in the following formula.
[0081] .
[0082] .
[0083] Among them, IOU is the intersection-over-union ratio, A is the area of the minimum bounding rectangle of the true value box and the predicted box, b is the area of the union of the true value box and the predicted box, wc, hc represent the width and height of the minimum bounding rectangle; b p , b g Represent the center point coordinates of the prediction box and the true value box respectively; w p , w g Represents the width of the prediction box and the true value box respectively; h p ,h g Represent the height of the prediction box and the true value box respectively; Indicates the Euclidean distance between the two values in the brackets, for example That is b p and b g The Euclidean distance.
[0084] In order to introduce more effective bounding box length and width information, CEIOU uses the minimum bounding box area loss in GIOU to replace the center point coordinate loss in EIOU, so that the network pays more attention to the boundary information of the target and reduces missed detection and false detection caused by unclear target boundaries and difficult to distinguish from the background in rainy and dark environments. The specific expression is as follows:
[0085] .
[0086] 2.4. Image target detection results - obtain image target information y1:
[0087] The test results of the YOLOv7 target detection model based on the attention mechanism are as follows Fig.11 As shown, the experimental results can accurately identify the vehicle target in the video data and obtain the image target information y1.
[0088] Part 3: 3D vehicle target detection and recognition size ratio Y based on laser point cloud information:
[0089] Based on the video data X, target size and mapping ratio Y obtained above, the detection process of the vehicle target detection module based on three-dimensional space in this embodiment is as follows: Fig.12 As shown in Figure 1, it includes mean voxel encoding, three-dimensional sparse convolutional network, voxel cylindrical feature pooling, feature pyramid, and multi-functional target detection head. Anchor point filtering is used in the model training stage. After the voxel cylindrical bird's-eye view and anchor point filtering strategy are used for target detection, the point cloud target information y2 can be finally obtained: the image 3D detection frame, such as Fig.13 shown.
[0090] Determining radar information according to the point cloud data of the target road specifically includes:
[0091] The point cloud features of each divided area in the bird's-eye view of the point cloud data are determined according to the point cloud data of the target road.
[0092] The point cloud features of all the divided areas are input into a radar information extraction model to obtain radar information; the radar information extraction model includes a feature pyramid network and a target detection head connected in sequence.
[0093] The feature pyramid network is used to perform feature fusion on the point cloud features of all the divided areas to obtain fused features.
[0094] The target detection head is used to predict the fusion feature to obtain the radar information.
[0095] Determining the point cloud features of each divided area in the bird's-eye view of the point cloud data according to the point cloud data of the target road specifically includes:
[0096] The point cloud data of the target road is discretized into a grid of a first coordinate plane to form a voxel columnar set, wherein the voxel columnar set includes a plurality of columnar voxels.
[0097] The columnar voxels are respectively input into a voxel encoder to obtain input features of each columnar voxel; the input features are average coordinates and average intensities of all point clouds in the columnar voxels.
[0098] A sparse convolutional neural network is used to extract features from each of the input features to obtain voxel context information of each of the columnar voxels.
[0099] For each voxel context information, the voxel context information is encoded to obtain an encoding result, and the encoding result is subjected to maximum pooling to obtain a point cloud feature; one columnar voxel corresponds to one divided area.
[0100] The above steps are as follows:
[0101] 3.1 Voxel column and feature extraction:
[0102] Drawing on the idea of point pillars, we first use 3D convolution to extract local features of point clouds, then build voxel pillars on the feature map and encode and pool the features. The construction process of VoxelPillars mainly includes: point cloud voxel encoding, 3D convolution, pillar construction, and feature extraction.
[0103] (1) Mean voxel encoding: A simplest feature encoder (i.e., voxel encoder) is used. The principle of voxel encoder (mean voxel encoder) is as follows: Fig.15 As shown in FIG. 1 , the feature mean of the point cloud set in the voxel is taken, that is, the average coordinates and average intensity of all points in it are taken as its input features. The calculation is simple and the original information can be retained to the greatest extent.
[0104] (2) 3D sparse convolutional neural network: Using 3D sparse convolution for feature extraction can reduce invalid convolution operations. The specific implementation process is as follows: first, non-empty voxels are integrated into a dense feature matrix and an input-output index rule matrix is constructed. Then, the dense features are convolved using general matrix multiplication to obtain high-dimensional features. Finally, the dense output features are mapped to sparse output features through the index rule matrix to restore the point cloud context structure.
[0105] The sparse convolution 3D feature extraction network structure has three layers, which is composed of spatial sparse convolution (SparseConv3d) and submanifold sparse convolution (SubMConv3d). Each convolution operation is added with batch normalization and activation function to prevent gradient explosion. The purpose of using two sparse convolutions at the same time is to maintain the sparsity of the normalized point cloud and obtain voxel context information by increasing the receptive field of the convolution kernel. After the voxelized point cloud is extracted through 3 layers of features, its size becomes 1 / 4 of the original size, and the actual size of each reduced voxel is 0.2m×0.2m×0.4m, and the feature map size is 400×352×11×64, where each voxel has 64 feature channels.
[0106] (3) VoxelPillars construction and feature extraction: Fig.14 As shown in (b), borrowing the idea of PointPillars algorithm, the PointPillars method is as follows Fig.14 As shown in (a), this embodiment first encodes the regularized point cloud through a parameter-sharing encoder group, then performs maximum pooling on the encoding result, and uses the pooling result as the feature of the corresponding area in the bird's-eye view of the point cloud data. The feature dimension is reduced from the initial (D, H, W, C) to (H, W, C'), where C' represents the encoder output dimension. The voxel cylindrical feature extraction process is shown in Fig.16 shown.
[0107] 3.2. Target detection head and anchor filtering strategy:
[0108] (1) Pyramid network:
[0109] The structure of feature pyramid network and target detection head is as follows Fig.17 As shown in the figure, the laser point cloud data does not have the problem of "large near and small far" vehicle size in the image, but it has the characteristics of "dense near and sparse far". A feature pyramid two-dimensional convolution model is established in the device. VoxelPillars features are used as input, and after three convolution operations, features of size 50×44×256 are obtained (features of size Y1); then deconvolution operations are performed to restore the feature maps of each size of the previous convolution to 200×176×128, and channel splicing is performed to obtain fused features of size 200×176×384 (new features of size Y).
[0110] (2) Object detection head:
[0111] The three-branch structure simultaneously outputs the target confidence, position, and orientation classification. To make the vehicle position regression easier, an anchor box is pre-set at each location in the feature map. The target position regression branch predicts the target position and angle by outputting the deviation between the anchor box and the true target. With each feature of the feature map as the center point, an anchor box of size 3.9m×1.6m×1.56m is defined, and two rotation angles of 0 and 1.57 are defined.
[0112] Each point in the feature map has two anchor boxes. The target classification branch outputs the expected probability of each anchor box, and the output size of this branch is 200×176×1; the target position branch outputs the position deviation between the anchor box and the true value, including (x, y, z, , , w, h) and other 7-dimensional deviation values. The output size of this branch is 200×176×14. The intersection-over-union prediction branch can output the positioning confidence of the target box, which can greatly improve the inconsistency between the classification confidence and the positioning confidence. The output size of this branch is 200×176×2.
[0113] (3) Invalid anchor point filtering:
[0114] The sparsity of the point cloud itself leads to a large number of blank areas in the bird's-eye view. The negative samples generated in this area are simple negative samples and do not contain semantic information. The existence of a large number of simple negative samples leads to the following two problems: 1. The loss caused by a single simple negative sample is small, but a small amount adds up to a large amount. When all simple negative samples participate in the loss calculation, the sum of the losses generated is greater than the sum of the positive sample loss values; 2. During the model training process, invalid background frames and background frames with real semantic information will be confused, resulting in a decrease in the model's ability to learn background anchor frames. At the same time, it will make the problem of uneven distribution of difficult and easy samples more serious, thereby affecting the convergence speed of the model.
[0115] In this regard, the present invention proposes a method for discarding invalid anchor points to eliminate the influence of invalid anchor frames. A simple method for determining invalid background frames is as follows:
[0116] 1) Take the absolute value of the first layer output result of the two-dimensional feature extraction network (i.e., feature pyramid network) to obtain a feature map (absolute value feature map) with a size of 200×176×64.
[0117] 2) Use the mean pooling filter to mean pool the feature map, and a feature map of size 200×176×1 can be obtained to represent the anchor box distribution, where the pooler size is 13×13×64.
[0118] 3) If the corresponding position value of any anchor box in the anchor box distribution feature map is 0, that is, there is no point cloud distribution in the area, the anchor box is considered to be an invalid background box.
[0119] This method mainly relies on a two-dimensional feature extraction network to generate an anchor box occupancy distribution map. The two-dimensional feature extraction network can make the feature value of the area without point cloud in the feature map always 0. It ensures the sparsity of the feature map through non-offset convolution operation and ReLU activation function. Whether the anchor box area contains semantic information is defined by whether the feature value of the anchor box area is all 0. To determine whether the anchor box contains semantic information, the improved method first takes the absolute value of the output result f2D of the two-dimensional convolutional network, and then performs mean pooling with a step size of 1. If the feature map is 0 somewhere after pooling, it indicates that the anchor box corresponding to that place is an invalid background box.
[0120] The process of calculating the size of the mean pooling filter according to the size of the anchor box is as follows Fig. 20 As shown, Fig. 20 The leftmost part is the local absolute value feature map, and its size is 200. 176 384, each position in the feature map corresponds to 0.4m in the real point cloud from a bird's eye view 0.4m area; the box on the right side is 3.9m long, 1.6m wide, and 4.2m diagonal length. It is the projection of the anchor box in the top view. The box is 3.9m long, 1.6m wide, and the diagonal spacing is 4.2m. According to the diagonal spacing, the receptive field of the mean pooling filter is determined to be 4.2m 4.2m, converted to the feature map scale of 10.5 10.5, if the size of the mean pooling is 10.5 10.5, the pooled feature is 0, which means that the feature values in the region are all 0, so the feature value of the anchor box region it contains must be 0. Since the size of the pooling filter must be an integer, its size is 10.5. 10.5 adjusted to 13 13, then the receptive field is 4.2m 4.2m adjusted to 5.2m 5.2m, this method can retain some invalid background frames.
[0121] 3.3. Loss function:
[0122] The loss value L of the vehicle detection algorithm in three-dimensional space det It consists of target classification loss, target box regression loss and orientation classification loss, as shown below:
[0123] .
[0124] Where N a is the total number of anchor points, N fg is the number of anchor points determined as targets; L cls (p i, c i ) is the classification loss, p i and c i are the target box detection results and category values associated with the i-th anchor point, where the background is set to 0 and the detection target is set to 1; is the target box regression loss, The target box regression loss is calculated only when the target is a vehicle. and are the predicted box and the true value box calculated based on the i-th anchor point; d i is a two-dimensional vector, representing the predicted value towards the binary classification; is the true value two-dimensional vector of the orientation category. If the target is actually facing If it is a non-negative value is [0,1], otherwise is [1,0], , , is the loss weight.
[0125] 3.4. Point cloud target detection results-obtaining point cloud target y2:
[0126] The present invention can well identify the vehicle target in the point cloud data and obtain the relevant size and proportion information y2. The vehicle detection visualization result is as follows Fig.18 As shown, the wavy shape is the original point cloud.
[0127] Part 4: Decision-level fusion based on laser point cloud and image information:
[0128] Matching the millimeter wave radar target with the vehicle in each of the to-be-identified images one by one according to the radar information and the video information specifically includes:
[0129] The Hungarian algorithm is used to match the millimeter-wave radar target with the vehicle in each of the to-be-identified images one by one according to the radar information and the video information.
[0130] After performing target detection on image data X and point cloud data Y respectively, 2D detection boxes and 3D detection boxes are generated, and the detected targets are screened and tracked for the best results to improve the detection accuracy of the system. In order to improve the mutual matching degree of the target detection results of image data and point cloud data, it is necessary to associate and map the image and point cloud to achieve the depth of image information. First, the sensor is used for detection to obtain preliminary detection data, and then the category, position and orientation data of each sensor are sent to the decision terminal. By analyzing multiple sets of data, the remaining point cloud data that is not mapped to the image is remapped to improve the matching degree of the detection results, and finally the information of the detected target is output. The steps of point cloud and image fusion are as follows: Fig.19 shown.
[0131] The steps of decision-level fusion based on laser point cloud and image information are as follows:
[0132] Step 1: Joint calibration of LiDAR and camera, mapping LiDAR point cloud data and color camera image data to two-dimensional image data using transformation matrix.
[0133] Step 2: Multi-sensor fusion algorithm: (1) Use the conversion matrix between the lidar and the camera to map the point cloud data to the image data; (2) Combine the Hungarian algorithm to screen the detection results of the image data and point cloud data, greatly reducing the misjudgment rate of the detection results. (3) Perform a secondary screening of the unmatched detection results. (4) Output the fusion results of image visual target detection and point cloud target detection.
[0134] In the present invention, the Hungarian method is used to solve the optimal matching problem between the lidar point cloud data and the color camera image data set. In this way, the data results are screened to obtain more comprehensive and accurate environmental perception information.
[0135] After acquiring radar data and video image data, a cost matrix is established for the matching problem between the image dataset and the point cloud dataset. Each element of the cost matrix represents the matching cost between the target in the image dataset and the target in the point cloud dataset, which can be calculated based on the visual or geometric features between the targets. Lower costs mean better matches. The Hungarian method solves this combinatorial optimization problem by finding the minimum cost match in the cost matrix. It ensures that each target can find a best matching target in the decision set fusion. The target information in the image and point cloud datasets can be fused. The target information of the two datasets can be fused and predicted through this decision-level data fusion algorithm, thereby obtaining more accurate and comprehensive environmental perception results.
[0136] By using the Hungarian method to complete the decision set fusion of image and point cloud data, we can make full use of visual and geometric information to obtain richer and more accurate environmental perception results. By continuously optimizing the matching algorithm and data fusion strategy, we can further improve the effect and performance of decision set fusion.
[0137] The present invention produces the following beneficial effects:
[0138] 1) The improved YOLOv7 network of the present invention introduces the MPConv (Multi-Pass Convolution) improvement module. This module adds multiple MPConv modules to the YOLOv7 network, each of which contains multiple convolutional layers and activation functions to extract rich feature representations, thereby enhancing the representation ability of image features. In the attention mechanism, the convolutional attention module focuses more on the relationship between input and output, while the self-attention module focuses more on the relationship between input and input; this module combines the advantages of both self-attention and convolutional attention, and introduces the ACmix attention module to enhance the network's attention to target detection vehicles. Combining the characteristics of EIOU and GIOU, a CEIOU is proposed as a bounding box regression loss function. The CEIOU loss function effectively improves the detection accuracy of the network at the cost of a smaller regression speed. Therefore, the present invention can better extract multi-scale feature information of vehicle images. Enhance the network's attention to target detection vehicles. Improve the accuracy of network detection.
[0139] 2) Each point in the feature map has two anchor boxes. The target classification branch outputs the expected probability of each anchor box, and the output size of this branch is 200×176×1; the target position branch outputs the position deviation between the anchor box and the true value, including (x, y, z, , , w, h) and other 7-dimensional deviation values. The output size of this branch is 200×176×14; the intersection-over-union prediction branch can output the location confidence of the target frame, which can greatly improve the problem of inconsistency between classification confidence and location confidence. The output size of this branch is 200×176×2. The sparsity of the point cloud itself leads to a large number of blank areas in the bird's-eye view. A method for discarding invalid anchor points is proposed to eliminate the influence of invalid anchor frames, which can improve the model's learning ability for background anchor frames and accelerate convergence. Therefore, based on operations such as voxel column and anchor point filtering, the original information can be retained to the greatest extent. The use of three-dimensional sparse convolution in feature extraction can reduce invalid convolution operations. There is a great improvement on the problem of inconsistency between classification confidence and location confidence. It can improve the model's learning ability for background anchor frames and accelerate convergence.
[0140] Embodiment 2:
[0141] The present invention also provides a vehicle identification device based on the aforementioned vehicle identification method, wherein the vehicle identification device comprises a video acquisition module, a radar module and a processing module; in this embodiment, the vehicle identification device comprises a storage module and a transmission module.
[0142] The video acquisition module is used to acquire the video to be identified.
[0143] The radar module is used to collect point cloud data of the target road.
[0144] The processing module is used to implement the aforementioned vehicle identification method.
[0145] The present invention provides a vehicle detection device (three-dimensional reconstruction device) which combines a two-dimensional target detection algorithm based on image information with a three-dimensional vehicle target algorithm based on point cloud information.
[0146] Among them, the two-dimensional target detection module adopts an improved YOLOv7 network structure. On the basis of this YOLOv7 network, the MPConv improved module is used to extract multi-scale information features of two-dimensional images from video data. The extracted features are enhanced by the ACmix attention module to enhance the network's attention to target detection vehicles. The CEIOU loss function is designed to improve the network detection accuracy. Experiments show that the algorithm has a good effect on vehicle target detection and can improve the accuracy of target detection in image data.
[0147] In the field of three-dimensional vehicle target detection based on point cloud, a voxel cylindrical point cloud feature extraction method and anchor box filtering strategy are proposed to address the problem of missing interactions between cylindrical features and imbalance of difficult and easy samples in the PointPillars method. Experimental results show that the improved algorithm has better target detection performance and can optimize the target detection efficiency of point cloud data.
[0148] Finally, through steps such as joint calibration of point cloud and image information and optimal matching of detection frames, the image-based target detection results and the point cloud data-based target detection results are fused at the decision level, and multi-source data is optimized and combined to improve the accuracy of vehicle target detection. Decision-level information fusion effectively improves the accuracy and adaptability of the vehicle target detection algorithm, providing feasibility guarantee for vehicle state perception.
[0149] The vehicle identification device in this embodiment may further include a data encryption module, and the data encryption module is used to encrypt data collected by the device or data obtained by calculation.
[0150] The multimodal radar-visual fusion device provided by the present invention is a traffic sensor that integrates a camera, a millimeter-wave radar and a high-performance processor. It has a relatively large lateral and longitudinal detection range, wherein the lateral detection visual angle can reach more than 90°, which can cover the monitoring angle of 6-8 lanes in both directions, and the longitudinal detection distance can reach 200 meters, or even more than 450 meters. The original video stream and the radar data stream can be simultaneously connected to the embedded processor in the all-in-one machine through the interface. AI target extraction is directly performed on the original video stream in the built-in embedded processor, and then the video target is projected into the radar coordinate system through the built-in coordinate mapping system. Finally, the video target and the radar target are fused and tracked to achieve real-time vectorization and tracking of global targets. Millimeter-wave radar can effectively make up for the defects of video images, and the radar has a longer detection range and more accurate precision. It has the function of all-weather detection and will not be affected by fog, rain, wind, ice and snow like video detection. It can accurately calibrate coordinates and determine the exact position of objects.
[0151] The present invention also applies intelligent algorithms to process and analyze data, and uses big data technology to analyze and mine traffic information implicit in the data, such as congestion, accidents and other features, thereby improving the accuracy and intelligence level of traffic status perception and emergency response.
[0152] In summary, traffic state perception and emergency response based on a variety of technical means are important means to effectively solve traffic safety problems in complex weather conditions. With the continuous advancement of technology, the application of these technical means will be more extensive, and will provide more effective technical support for highway traffic management and safety control. The invention of radar and vision fusion is a new type of traffic safety solution developed to improve the level of traffic safety. It is launched on the basis of multi-sensor fusion and can fully and accurately understand the traffic environment and potential risks around the vehicle. Therefore, it is a popular trend in modern traffic safety technology and has become an important field for improving traffic safety. It is widely used in fields such as intelligent transportation and autonomous driving.
[0153] In this specification, each embodiment is described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the embodiments can be referred to each other. For the system disclosed in the embodiment, since it corresponds to the method disclosed in the embodiment, the description is relatively simple, and the relevant parts can be referred to the method part.
[0154] The principles and implementation methods of the present invention are described in this article using specific examples. The description of the above embodiments is only used to help understand the method and core idea of the present invention. At the same time, for those skilled in the art, according to the idea of the present invention, there will be changes in the specific implementation methods and application scope. In summary, the content of this specification should not be understood as limiting the present invention.
Claims
1. A vehicle identification method, characterized in that: The method comprises: Acquire a video to be identified, wherein the video to be identified includes a plurality of frames of images to be identified; the images to be identified are obtained by photographing a target road with a camera; For each of the images to be identified, the images to be identified are input into a trained vehicle identification model to identify each vehicle in the images to be identified and obtain video information; the video information includes the position information of each vehicle in the images to be identified; wherein the vehicle identification model is an improved YOLOv7 network model; the improvement includes: replacing the convolution layer in BConv in the REPConv module in the existing YOLOv7 network model with an ACmix attention module; the improvement also includes: adding a separation and merging module between the first right branch convolution layer and the second right branch convolution layer of the right branch of the MPConv module; the separation and merging module is used to: Separating the features output by the first right branch convolutional layer to obtain a plurality of sub-features; All the sub-features are spliced in the channel dimension to obtain spliced features; the spliced features are used to input the second right branch convolutional layer; Determine radar information according to the point cloud data of the target road; the radar information includes the confidence, position coordinates and orientation of the vehicle on the target road; According to the radar information and the video information, the millimeter wave radar target is matched with the vehicles in each of the images to be identified one by one to obtain target information; the target information includes the movement trajectory of each of the vehicles on the target road.
2. The vehicle identification method according to claim 1, characterized in that: Determining radar information according to the point cloud data of the target road specifically includes: Determining point cloud features of each divided area in the bird's-eye view of the point cloud data according to the point cloud data of the target road; Inputting the point cloud features of all the divided areas into a radar information extraction model to obtain radar information; the radar information extraction model includes a feature pyramid network and a target detection head connected in sequence; The feature pyramid network is used to perform feature fusion on the point cloud features of all the divided areas to obtain fused features; The target detection head is used to predict the fusion feature to obtain the radar information.
3. The vehicle identification method according to claim 2, characterized in that: Determining the point cloud features of each divided area in the bird's-eye view of the point cloud data according to the point cloud data of the target road specifically includes: Discretizing the point cloud data of the target road into a grid on a first coordinate plane to form a voxel columnar set, wherein the voxel columnar set includes a plurality of columnar voxels; Inputting the columnar voxels into a voxel encoder respectively to obtain input features of each columnar voxel; the input features are average coordinates and average intensities of all point clouds in the columnar voxels; Using a sparse convolutional neural network to extract features from each of the input features to obtain voxel context information of each of the columnar voxels; For each voxel context information, the voxel context information is encoded to obtain an encoding result, and the encoding result is subjected to maximum pooling to obtain a point cloud feature; one columnar voxel corresponds to one divided area.
4. The vehicle identification method according to claim 1, characterized in that: Before inputting the image to be recognized into the trained vehicle recognition model, the method further includes: training the vehicle recognition model, specifically including: Acquire a data set; the data set includes a plurality of frames of sample images to be identified and sample video information corresponding to each of the sample images to be identified; The vehicle recognition model is trained using the data set to obtain a trained vehicle recognition model.
5. The vehicle identification method according to claim 4, characterized in that: The vehicle recognition model is trained using the data set to obtain a trained vehicle recognition model, specifically comprising: The vehicle recognition model is trained using the data set using the CEIOU loss function to obtain a trained vehicle recognition model.
6. The vehicle identification method according to claim 1, characterized in that: Matching the millimeter wave radar target with the vehicle in each of the to-be-identified images one by one according to the radar information and the video information specifically includes: The Hungarian algorithm is used to match the millimeter-wave radar target with the vehicle in each of the to-be-identified images one by one according to the radar information and the video information.
7. A vehicle identification device based on the vehicle identification method according to claim 1, characterized in that: The vehicle identification device includes a video acquisition module, a radar module and a processing module; The video acquisition module is used to acquire the video to be identified; The radar module is used to collect point cloud data of the target road; The processing module is used to implement the vehicle identification method described in claim 1.
