Multimodal data fusion 3D object detection method based on attention mechanism
Through the multi-modal data fusion 3D target detection network based on the attention mechanism, using point cloud and image features, the problem of low 3D target detection accuracy in the existing technology is solved, and higher detection accuracy and reliability are achieved.
Patent Information
- Application Number
- CN202210816612.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-07-12
- Publication Date
- 2024-09-06
- Estimated Expiration
- 2042-07-12
AI Technical Summary
Existing three-dimensional target detection algorithms have low detection accuracy when multiple targets appear in local space, and multi-modal data fusion methods fail to fully utilize the feature information of different modal data, resulting in inaccurate positioning.
A multi-modal data fusion three-dimensional target detection network based on the attention mechanism is used. Through the point cloud feature learning module and the Transformer feature extraction module, the features of the candidate area are initially extracted and multi-modal data fusion is performed, using the spatial position information of the point cloud and Semantic information of images to avoid error accumulation and adapt to different types of data through encoding and decoding structures.
The accuracy of three-dimensional target detection is improved, especially when multiple targets exist in local space, the error is reduced, and the reliability and accuracy of detection are enhanced.
Smart Images

Figure CN115082674B
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of machine vision and autonomous driving technology, and relates to a target detection method, specifically to a multimodal data fusion three-dimensional target detection method based on an attention mechanism, which can be applied to autonomous driving, robots, AR, VR and other fields. Background Art
[0002] With the continuous iteration of vehicle-mounted sensor equipment, traditional two-dimensional target detection can no longer meet the needs of application scenarios such as autonomous driving. In order to enhance the environmental perception and positioning capabilities of autonomous driving vehicles, three-dimensional target detection algorithms are needed to detect the spatial information of objects in the environment, such as the position of objects in space, and the length, width, height and rotation angle of objects. Three-dimensional target detection algorithms require more types of sensor information to improve detection accuracy, among which commonly used sensors are mainly lidar and cameras. However, different sensors obtain information in different forms and have different advantages and disadvantages. Laser point clouds contain accurate spatial distance information, but the data is disordered and sparse, the texture and color information is insufficient, and it is greatly affected by rainy and foggy weather; images have high-resolution pixels and rich textures, but the accurate distance between objects cannot be obtained and they are greatly affected by light. Therefore, in order to improve the accuracy of three-dimensional target detection algorithms, multimodal data fusion is generally used to improve the algorithm's perception of the surrounding environment.
[0003] Multimodal data fusion is to map and splice information of different sensor data in the same scene. Usually, data fusion methods are divided into data fusion, feature fusion and result fusion according to the timing and method of multi-sensor data fusion. These methods are collectively referred to as strong fusion. In addition, there are some methods that only use the slight data advantages of other modal data to supplement their own data deficiencies. These methods are called weak fusion. How to effectively fuse the data between lidar and camera to achieve the effect of complementing each other's strengths and weaknesses and obtain more reliable detection results is one of the difficulties in autonomous driving technology.
[0004] Although some current multi-sensor fusion algorithms have improved the average detection accuracy of three-dimensional target detection to a certain extent, they do not fully utilize the feature information of different modal data, and may even lead to inaccurate positioning. For example, in the paper "MVX-Net: Multimodal VoxelNet for 3D Object Detection" published by Sindagi et al. at the International Conference on Robotics and Automation in 2019, a three-dimensional target detection method that fuses point cloud data and images was disclosed. This method uses a calibration matrix to fuse image information with original point cloud data, and uses a designed feature extraction network to extract features from the fused information, effectively improving the three-dimensional target detection accuracy of the model. However, this method fuses all pixels in the image with the point cloud data without distinction. The fusion process is rough and prone to error accumulation. When multiple targets appear in the local space, there will be problems with inconsistent classification confidence and positioning, resulting in low three-dimensional target detection accuracy of the model. Summary of the invention
[0005] The purpose of the present invention is to overcome the shortcomings of the prior art and propose a three-dimensional target detection method based on multi-sensor fusion to solve the technical problem of low detection accuracy when multiple targets appear in a local space in the prior art.
[0006] To achieve the above object, the technical solution adopted by the present invention includes the following steps:
[0007] (1) Obtain training sample set E1 and test sample set E2:
[0008] Obtain T labeled RGB images with dimensions W×H, labeled point cloud data with dimensions N×K in the scene corresponding to each RGB image, and calibration data of both from the public dataset, and preprocess each point cloud data. Then, the preprocessed T1 point cloud data and their corresponding RGB images form the training sample set E1, and the remaining T2 preprocessed point cloud data and their corresponding RGB images form the test sample set E2, where T≥5000, T1>T2, T1+T2=T;
[0009] (2) Multimodal data fusion 3D object detection network based on attention mechanism:
[0010] (2a) Construct the structure of multimodal data fusion 3D object detection network D based on attention mechanism:
[0011] Construct a three-dimensional object detection network D including a sequentially connected point cloud feature learning module, a multimodal data fusion module, and a Transformer-based feature extraction module, wherein the point cloud feature learning module includes a sequentially connected three-dimensional sparse convolutional network and a regional regression network; the Transformer-based feature extraction module includes a sequentially connected encoder and decoder;
[0012] (2b) Define the loss function L of the 3D object detection network D:
[0013] The definition includes the confidence loss L conf and the 3D target loss L rpn The loss function L of the three-dimensional object detection network D is:
[0014] L=L conf +L rpn ;
[0015] (3) Iteratively train the 3D object detection network D:
[0016] (3a) The number of initialization iterations is r, the maximum number of iterations is R, and the current 3D object detection network model is D r The weight parameter is θ r , and let r = 1, D r =D;
[0017] (3b) Randomly select B training samples from the training sample set E1 without replacement as the network model D r The input is forward propagated, and the implementation steps are:
[0018] (3b1) The training sample set E1 is used as the 3D object detection network D r The 3D sparse convolutional network in the point cloud feature learning module performs 3D feature learning on each training sample. The regional regression network in the point cloud feature learning module generates regions for the 3D features output by the 3D sparse convolutional network, and obtains S candidate regions containing a total of T1 point cloud data. And each candidate region contains at least one point cloud data, where S ≥ 1000, and Respectively represent the center point coordinate value of each candidate area, l rpn 、w rpn and h rpn Respectively represent the length, width and height of each candidate region, θ rpn Indicates the rotation angle value of each candidate region;
[0019] (3b2) The multimodal data fusion module performs multimodal data splicing on all points in the point cloud data of each candidate region RPN and their corresponding RGB image information to obtain N fused point cloud data P = {p i ,Δp i c ,Δp i j ,f i}, i = 1, 2, ..., n, where p i represents n points in the candidate area, Δp i c Represents the distance from each point in the candidate area to the center point of the candidate area, Δp i j represents the distance from each point in the candidate area to the eight corner points, f i Represents the RGB three-channel value of the corresponding image pixel found by each point in the candidate area after conversion by the calibration matrix;
[0020] (3b3) In the Transformer-based feature extraction module, the encoder extracts features from T1 fused point cloud data P to obtain the point cloud features of P; the decoder performs channel-weighted decoding on the point cloud features of P to obtain the predicted 3D target box x in T1 point cloud data. pre ={x pre ,y pre ,z pre ,l pre ,w pre ,h pre}, and the angle value θ corresponding to the three-dimensional target frame pre , classification probability y, confidence probability c and direction probability dir;
[0021] (3c) Use the loss function L of the 3D object detection network D and calculate the confidence loss value L according to the confidence probability c conf , according to the predicted three-dimensional target value x pre , predicted angle value θ pre , the predicted classification probability y and the predicted direction probability dir calculate the three-dimensional target loss value L rpn , and then the stochastic gradient descent method is used to calculate the L of the three-dimensional object detection network D conf With L rpn The sum of the weight parameters θ r The partial derivative of θ r Update to get the three-dimensional target detection network model D of this iteration r ;
[0022] (3d) Determine whether r = R. If so, obtain the trained multimodal data fusion 3D target detection network model D based on the attention mechanism. * , otherwise let r=r+1, D r =D, and execute step (3b);
[0023] (4) Obtain the detection results of the three-dimensional target:
[0024] The test sample set E2 is used as the trained multimodal data fusion 3D target detection network model D based on the attention mechanism. * The input is forward propagated to obtain the 3D target detection result of each test sample, including the predicted 3D target box x in each test sample. pre , and the angle value θ corresponding to the three-dimensional target frame pre and target category.
[0025] Compared with the prior art, the present invention has the following advantages:
[0026] First, the present invention first uses a feature learning network to preliminarily extract some candidate areas, and then fuses the point cloud data, point position features and corresponding image information in the candidate areas, making full use of the regularized spatial position information of the point cloud, the refined spatial structure information of the point features and the semantic information of the image, avoiding the defect of error accumulation caused by the existing technology due to the fusion of all pixels and point cloud data, and can effectively improve the detection accuracy of three-dimensional targets when multiple targets appear in the local space.
[0027] Second, the present invention uses the Transformer encoding and decoding method, which has powerful feature extraction capabilities. Since the self-attention structure of this method can adapt to various types of data, it performs better in multimodal fusion. BRIEF DESCRIPTION OF THE DRAWINGS
[0028] Figure 1 It is a flow chart of the implementation of the present invention;
[0029] Figure 2 It is a structural schematic diagram of the three-dimensional target detection network of the present invention. DETAILED DESCRIPTION
[0030] The present invention is further described in detail below in conjunction with the accompanying drawings and specific embodiments.
[0031] Reference Figure 1 , the present invention comprises the following steps:
[0032] Step 1) Get the training sample set E1 and the test sample set E2:
[0033] Obtain T labeled RGB images with dimensions of W×H, labeled point cloud data with dimensions of N×K in the scene corresponding to each RGB image, and calibration data of the two from the public data set, and preprocess each point cloud data. During the denoising process, point cloud data with a height of more than 4.2 meters are defined as noise data; the point cloud data are randomly flipped horizontally, the random seed is set to 688, and the minimum number of points is set to 1000 during the downsampling process; then the preprocessed T1 point cloud data and their corresponding RGB images are used to form the training sample set E1, and the remaining T2 preprocessed point cloud data and their corresponding RGB images are used to form the test sample set E2, where W=1224, H=370, N=10000, K=4, T1=7481, T2=7518, and T=14999;
[0034] In this example, the KITTI dataset jointly produced by Karlsruhe Institute of Technology and Toyota Research Institute of America is used. It contains real image data collected in scenes such as urban areas, rural areas, and highways. Each image contains up to 15 vehicles and 30 pedestrians, a total of 80,256 labeled targets, and various degrees of occlusion and truncation. The first dimension of the labeled data represents the category, the second dimension represents whether it is a truncated image, and the third dimension uses four numbers to represent the degree of occlusion, representing fully visible, partially occluded, large-scale occlusion, and unknown. The public part of the dataset is divided into a training set and a test set, where the training set and the test set contain 7481 RGB images and point cloud data in the corresponding scenes, and 7518 RGB images and point cloud data in the corresponding scenes, respectively.
[0035] Step 2) 3D object detection network based on multimodal data fusion with attention mechanism:
[0036] Step 2a) Construct the structure of the multimodal data fusion 3D object detection network D based on the attention mechanism:
[0037] A three-dimensional object detection network D is constructed, which includes a sequentially connected point cloud feature learning module, a multimodal data fusion module, and a Transformer-based feature extraction module. The point cloud feature learning module includes a sequentially connected three-dimensional sparse convolutional network and a regional regression network; the Transformer-based feature extraction module includes a sequentially connected encoder and decoder; the overall architecture of the Transformer can be divided into four modules: an input module, an encoding module, a decoding module, and an output module, and the encoder module is generally composed of N encoder layers stacked together.
[0038] Point cloud feature learning module, the three-dimensional sparse convolution network it contains includes 8 three-dimensional sparse convolution structures connected in sequence; each three-dimensional sparse convolution structure includes a sub-manifold three-dimensional sparse convolution layer, a batch normalization layer and a Relu activation layer connected in sequence; the regional regression network includes four composite layers connected in sequence and two fully connected layers, each composite layer includes a three-dimensional sparse convolution layer, a normalization layer and a Relu activation layer connected in sequence, and the two fully connected layers are connected to the output end of the fourth composite layer; the convolution kernel size of the convolution layer in the four composite layers is 3, the number of convolution kernels is 256, the convolution step size of the first convolution layer is 2, and the convolution step sizes of the second, third and fourth convolution layers are all 1;
[0039] The multimodal data fusion module first uses the farthest point sampling method for all points in the point cloud data in each candidate region RPN. In the experimental setting, the number of sampling points is 256. If it is less than this threshold, no sampling is performed. Then the pixel color information in the image is added to the point cloud. Specifically, all points in the candidate box are mapped to the image through the spatial transformation matrix to obtain the RGB channel value of the corresponding point. After sampling, the points and their corresponding RGB image information are obtained.
[0040] For all data sets downloaded from the KITTI official website, you can find calibration files containing camera intrinsic and extrinsic parameters; the following shows part of the calibration file "calib_velo_to_cam.txt", which shows the relative position relationship between the lidar and the left camera; calib_time:15-Mar-201211:37:16R:7.533745e-03-9.999714e-01-6.166020e-04 1.480249e-027.280733e-04-9.998902e-01 9.998621e-01 7.523790e-031.480755e-02T:-4.069766e-03-7.631618e-02-2.717806e-01; The matrix R and vector T provide us with the external parameters of the camera. Of course, in order to complete the mapping of the 3D point cloud to the camera image, we also need the intrinsic parameters of the camera. They are saved in the "calib_cam_to_cam.txt" file, and the relevant content is as follows:calib_time:09-Jan-2012 13:57:47;R_rect_00:9.999239e-01 9.837760e-03-7.445048e-03-9.869795e-03 9.999421e-01-4.278459e-03 7.402527e-03 4.351614e-03 9.999631e-01;P_rect_00:7.215377e+020.000000e+006.095593e+02 0.000000e+00 0.000000e+00 7.215377e+02 1.728540e+020.000000e+00 0.000000e+00 0.000000e+00 1.000000e+00 0.000000e+00; The matrix R_rect_00 is a 3*3 correction rotation matrix used to make the camera images coplanar, for example, to align multiple cameras of a stereo vision platform. For this KITTI data collection car, there are two cameras. This can be done by aligning a row of pixels from the left camera directly to another row of pixels from the right camera, rather than two inclined lines intersecting the two camera planes. Since we are currently focusing on MONO single-channel cameras, we will not delve into the basic theory of the above alignment operation - but if you are interested, you can search for epipolar geometry for more relevant content. The matrix P_rect_00 contains the intrinsic parameters of the camera, which we call KK.The following formula shows how to use the homogeneous coordinate system to map the lidar 3D point cloud X in the KITTI dataset to the 2D camera image point Y of the left camera, using the notation in the Kittireadme file.
[0041] Y=P_rect_xx*R_rect_00*(R|T)_velo_to_cam*X
[0042] To map the point cloud X in the KITTI dataset to the camera's 2D camera image point Y, the following steps are performed in the program: when traversing the lidar point cloud information, convert each 3D point into homogeneous coordinates and store them in the 4D variable X; apply the mapping formula to map X to the camera's image plane and store the result in the variable Y; convert the variable Y from the homogeneous coordinate system back to the Euclidean coordinate system to obtain the corresponding pixel position in the image, and store the result in the point cloud data P.
[0043] Calculate the distance from each point in the candidate area to the center point of the candidate area, using Δp i c =p i -p c Indicates that p i represents the coordinates of the candidate region points, p c Represents the coordinates of the center point of the candidate region, and then calculates the distance from each sampling point in the candidate region to the center point of the candidate region; calculates the distance from the sampling point of the candidate region to the eight corner points of the candidate region, using Δp i j =p i -p j ,j=1,2,…,8 means, p j Represents the coordinates of the eight corner points of the candidate area; after multimodal data splicing, the fused point cloud data is obtained
[0044] P = {p i ,Δp i c ,Δp i j ,f i}, (i = 1, 2, ..., n), where p i represents n points in the candidate area, f i Represents the RGB three-channel value of the corresponding image pixel found by each point in the candidate area after conversion by the calibration matrix;
[0045] The feature extraction module based on Transformer contains an encoder including three stacked feature encoding modules, each of which includes two linear layers, three Dropout layers and two normalization layers. The specific structure is: 1st linear layer->1st Dropout layer->2nd linear layer->1st normalization layer->2nd normalization layer->2nd Dropout layer->3rd Dropout layer; the input and output channel numbers of the 1st linear layer are 256 and 512 respectively, the input and output channel numbers of the 2nd linear layer are 512 and 256 respectively, the input dimension of the normalization layer is 256, and the probability value of each Dropout layer is 0.1;
[0046] The feature extraction module based on Transformer includes a decoder containing 3 convolutional layers, 3 linear layers, 3 Dropout layers and 4 normalization layers; the input dimensions of the 3 convolutional layers are all 256, the convolution kernels are all 1, and the stride is all 1; the input and output dimensions of the first linear layer are 64 and 1 respectively, the input and output dimensions of the second linear layer are 256 and 512 respectively, and the input and output dimensions of the third linear layer are 512 and 256 respectively; the probability values of the three Dropout layers are all 0.1; the input dimensions of the four normalization layers are all 256; the specific structure of the decoder is: the first convolutional layer->the second convolutional layer->the third convolutional layer->the first linear layer->the second linear layer->the first Dropout layer->the third linear layer->the first normalization layer->the second normalization layer->the third normalization layer->the second Dropout layer->the third Dropout layer->the fourth normalization layer.
[0047] Step 2b) Define the loss function L of the 3D object detection network D:
[0048] The loss function L of the 3D object detection network D is the confidence loss L of the 3D object. conf and the 3D target loss L rpn The sum of is as follows. The classification loss uses the focal loss formula, which was originally proposed by He Kaiming and was originally used in the image field to solve the model performance problem caused by data imbalance.
[0049] L=L conf +L rpn ;
[0050] L conf = -clog(c)-(1-c)log(1-c)
[0051]
[0052] L rpn =β1Lcls +β2(L reg-θ +L reg-other )+β3L dir
[0053] L cls = -α(1-y) γ log(y)
[0054] L reg-θ =SmoothL1(sin(θ pre -θ))
[0055] L reg-other =SmoothL1(sin(x pre -x))
[0056]
[0057] L dir =-α(1-dir) γ log(dir)
[0058] Among them, IoU is the intersection over union ratio of the predicted target box and the true target box, α F , α B They represent the intersection-over-union ratio of foreground and background respectively, β1=0.3, β2=0.4, β3=0.3 represent weights, and L cls represents the classification loss, α=0.6 and γ=0.9 are the classification loss L cls The hyperparameters, SmoothL1 represents the regression loss function, L reg-θ represents the angle loss, θ represents the actual angle value, L reg-other represents the target box regression value loss, x is the real target box, L dir is the classification loss of the direction.
[0059] Step 3) Iteratively train the 3D object detection network D:
[0060] Step 3a) Initialize the number of iterations to r, the maximum number of iterations to 120, and the current 3D object detection network model to D r The weight parameter is θ r , and let r = 1, D r =D;
[0061] Step 3b) Randomly select 2 training samples from the training sample set E1 without replacement as the network model D r The input is forward propagated, and the implementation steps are:
[0062] Step 3b1) Use the selected two training samples as the 3D object detection network D rThe 3D sparse convolutional network in the point cloud feature learning module performs 3D feature learning on each training sample. The regional regression network in the point cloud feature learning module generates regions for the 3D features output by the 3D sparse convolutional network, and obtains S candidate regions containing a total of T1 point cloud data. And each candidate region contains at least one point cloud data, where S ≥ 1000, and Respectively represent the center point coordinate value of each candidate area, l rpn 、w rpn and h rpn Respectively represent the length, width and height of each candidate region, θ rpn Indicates the rotation angle value of each candidate region;
[0063] Step 3b2) The multimodal data fusion module performs multimodal data splicing on all points in the point cloud data of each candidate region RPN and their corresponding RGB image information to obtain T1 fused point cloud data P = {p i ,Δp i c ,Δp i j ,f i}, (i = 1, 2, ..., n), where p i represents n points in the candidate area, Δp i c Represents the distance from each point in the candidate area to the center point of the candidate area, Δp i j represents the distance from each point in the candidate area to the eight corner points, f i Represents the RGB three-channel value of the corresponding image pixel found by each point in the candidate area after conversion by the calibration matrix;
[0064] Step 3b3) Based on the feature extraction module of Transformer, the encoder extracts features from T1 fused point cloud data P to obtain the point cloud features of P; the decoder performs channel weighted decoding on the point cloud features of P to obtain the predicted 3D target box x in T1 point cloud data. pre ={x pre ,y pre ,z pre ,l pre ,w pre ,h pre}, and the angle value θ corresponding to the three-dimensional target frame pre , classification probability y, confidence probability c and direction probability dir;
[0065] Step 3c) Use the loss function L of the 3D object detection network D and calculate the confidence loss value L according to the confidence probability cconf , according to the predicted three-dimensional target value x pre , predicted angle value θ pre , the predicted classification probability y and the predicted direction probability dir calculate the three-dimensional target loss value L rpn , and then the stochastic gradient descent method is used to calculate the L of the three-dimensional object detection network D conf With L rpn The sum of the weight parameters θ r The partial derivative of θ r Update to get the three-dimensional target detection network model D of this iteration r ;
[0066] Step 3d) Determine whether r=120 is true. If so, obtain the trained multimodal data fusion 3D target detection network model D based on the attention mechanism. * , otherwise let r=r+1, D r =D, and execute step (3b);
[0067] Step 4) Obtain the detection result of the three-dimensional target:
[0068] The test sample set E2 is used as the trained multimodal data fusion 3D target detection network model D based on the attention mechanism. * The input is forward propagated to obtain the 3D target detection result of each test sample, including the predicted 3D target box x in each test sample. pre , and the angle value θ corresponding to the three-dimensional target frame pre , the category of the three-dimensional target. In this example, there are two categories of targets, namely vehicles and pedestrians. The three-dimensional target detection accuracy in the KITTI test set uses mAP as an indicator; mAP (mean Average Precision) represents the mean average precision, that is, the AP mean of multiple categories, which is mainly used to measure the overall accuracy performance of the model on all categories. Average Precision (AP) represents the area under the PR curve, corresponding to the three calculation methods of IOU. The AP value is mainly used to measure the detection accuracy of the model on a single category. The larger the AP value, the higher the detection accuracy of this category.
[0069] The technical effects of the present invention are further described below in conjunction with simulation experiments.
[0070] 1. Simulation conditions and contents:
[0071] The simulation experiment was carried out on the Ubuntu 18.04 system. The model training used the pytorch 1.6 deep learning framework and two NVIDIA RTX 2080Ti graphics cards with a total video memory of 22GB.
[0072] The dataset used in the simulation experiment is the KITTI dataset, which is automobile sensor data jointly produced by Karlsruhe Institute of Technology in Germany and Toyota Research Institute of America. The number of point clouds in a single frame is more than 60,000, the image size is 1243×375, and it contains 9 types of targets. This simulation only tests two types of targets, cars and pedestrians, as detection objects. In the simulation experiment, 7518 samples were selected as test samples.
[0073] During the training and inference processes, two preprocessed samples are input into the 3D target detection model in this method each time. The point cloud learning module learns the point cloud features in the test samples to obtain the region candidate box. The fusion module performs fine fusion of the point cloud data in the region candidate box with the image data to obtain the fused point cloud data, in which the dimension of each point is expanded from the original 4 dimensions to 16 dimensions. The 16-dimensional point cloud data is then input into the Transformer-based feature extraction module, and after encoding and decoding processing, the 3D target detection result is obtained.
[0074] 2. Analysis of simulation results:
[0075] The method proposed in the present invention is compared with other public three-dimensional target detection methods. Table 1 shows the detection effects of the present invention and the prior art MVX-Net method on vehicle and pedestrian targets in the KITTI dataset.
[0076] Table 1
[0077]
[0078] It can be seen from the experimental results in Table 1 that the present invention has higher three-dimensional target detection accuracy in both vehicle and pedestrian detection than the prior art. The present invention has achieved better results in vehicle and pedestrian categories, especially at the medium sample level of the vehicle category, which is 7.74% higher than MVX-Net. According to the analysis of the experimental results, it is believed that processing the original information in the refinement stage, rather than relying on artificially designed features or fused features, can better parse the target structure. In addition, the accuracy in the pedestrian category is a bit lower, which may be because the points selected by each candidate box are too sparse, resulting in the loss of details.
[0079] The above description is only a specific example of the present invention and does not constitute any limitation to the present invention. It is obvious that for professionals in this field, after understanding the content and principles of the present invention, it is possible to make various modifications and changes in form and details without departing from the principles and structures of the present invention. However, these modifications and changes based on the ideas of the present invention are still within the scope of protection of the claims of the present invention.
Claims
1. A multimodal data fusion 3D object detection method based on attention mechanism, It is characterized in that The steps include: (1) Obtain training sample set E 1 And the test sample set E 2 : We obtain T labeled RGB images with dimensions W×H, labeled point cloud data with dimensions N×K in the scene corresponding to each RGB image, and calibration data of both from the public dataset, and preprocess each point cloud data. 1 Point cloud data and their corresponding RGB images constitute the training sample set E 1 , the remaining T 2 The preprocessed point cloud data and their corresponding RGB images constitute the test sample set E 2 , where T ≥ 5000, T 1 >T 2 , T 1 +T 2 =T; (2) Multimodal data fusion 3D object detection network based on attention mechanism: (2a) Construct the structure of multimodal data fusion 3D object detection network D based on attention mechanism: Construct a three-dimensional object detection network D including a sequentially connected point cloud feature learning module, a multimodal data fusion module, and a Transformer-based feature extraction module, wherein the point cloud feature learning module includes a sequentially connected three-dimensional sparse convolutional network and a regional regression network; the Transformer-based feature extraction module includes a sequentially connected encoder and decoder; (2b) Define the loss function L of the 3D object detection network D: The definition includes the confidence loss L conf and the 3D target loss L rpn The loss function L of the three-dimensional object detection network D is: L=L conf +L rpn ; (3) Iteratively train the 3D object detection network D: (3a) The number of initialization iterations is r, the maximum number of iterations is R, and the current 3D object detection network model is D r The weight parameter is θ r , and let r = 1, D r =D; (3b) From the training sample set E 1 The training samples are selected without replacement as the network model D r The input is forward propagated, and the implementation steps are: (3b1) The training sample set E 1 As a 3D object detection network D r The 3D sparse convolutional network in the point cloud feature learning module performs 3D feature learning on each training sample, and the regional regression network in the point cloud feature learning module generates regions for the 3D features output by the 3D sparse convolutional network. 1 S candidate regions of point cloud data And each candidate region contains at least one point cloud data, where S ≥ 1000, and Respectively represent the center point coordinate value of each candidate area, l rpn 、w rpn and h rpn Respectively represent the length, width and height of each candidate region, θ rpn Indicates the rotation angle value of each candidate region; (3b2) The multimodal data fusion module performs multimodal data splicing on all points in the point cloud data of each candidate region RPN and their corresponding RGB image information to obtain N fused point cloud data P = {p i ,Δp i c ,Δp i j ,f i }, i = 1, 2, ..., n, where p i represents the i points in the candidate area, Δp i c Represents the distance from each point in the candidate area to the center point of the candidate area, Δp i j represents the distance from each point in the candidate area to the eight corner points, f i Represents the RGB three-channel value of the corresponding image pixel found by each point in the candidate area after conversion by the calibration matrix; (3b3) The encoder pair T in the Transformer-based feature extraction module 1 The fused point cloud data P is subjected to feature extraction to obtain the point cloud features of P; the decoder performs channel weighted decoding on the point cloud features of P to obtain T 1 The predicted 3D object box x in the point cloud data pre ={x pre ,y pre ,z pre ,l pre ,w pre ,h pre }, and the angle value θ corresponding to the three-dimensional target frame pre , classification probability y, confidence probability c and direction probability dir; (3c) Use the loss function L of the 3D object detection network D and calculate the confidence loss value L according to the confidence probability c conf , according to the predicted three-dimensional target value x pre , predicted angle value θ pre , the predicted classification probability y and the predicted direction probability dir calculate the three-dimensional target loss value L rpn , and then the stochastic gradient descent method is used to calculate the L of the three-dimensional object detection network D conf With L rpn The sum of the weight parameters θ r The partial derivative of θ r Update to get the three-dimensional target detection network model D of this iteration r ; (3d) Determine whether r = R. If so, obtain the trained multimodal data fusion 3D target detection network model D based on the attention mechanism. * , otherwise let r=r+1, D r =D, and execute step (3b); (4) Obtain the detection results of the three-dimensional target: The test sample set E 2 As a trained multimodal data fusion 3D object detection network model based on attention mechanism D * The input is forward propagated to obtain the 3D target detection result of each test sample, including the predicted 3D target box x in each test sample. pre , and the angle value θ corresponding to the three-dimensional target frame pre and target category.
2. The method for three-dimensional target detection based on multimodal data fusion based on attention mechanism according to claim 1, It is characterized in that The preprocessing of each point cloud data in step (1) is implemented by: denoising the point cloud data corresponding to each RGB image, randomly horizontally flipping each denoised point cloud data, and then downsampling the point cloud data after random horizontal flipping to obtain T preprocessed point cloud data.
3. The method for three-dimensional target detection based on multimodal data fusion based on attention mechanism according to claim 1, It is characterized in that The three-dimensional object detection network D described in step (2a), wherein: Point cloud feature learning module, the three-dimensional sparse convolution network it contains includes 8 three-dimensional sparse convolution structures connected in sequence; each three-dimensional sparse convolution structure includes a sub-manifold three-dimensional sparse convolution layer, a batch normalization layer and a Relu activation layer connected in sequence; the regional regression network includes four composite layers connected in sequence and two fully connected layers, each composite layer includes a three-dimensional sparse convolution layer, a normalization layer and a Relu activation layer connected in sequence, and the two fully connected layers are connected to the output end of the fourth composite layer; the convolution kernel size of the convolution layer in the four composite layers is 3, the number of convolution kernels is 256, the convolution step size of the first convolution layer is 2, and the convolution step sizes of the second, third and fourth convolution layers are all 1; The feature extraction module based on Transformer contains an encoder including three stacked feature encoding modules, each of which includes two linear layers, three Dropout layers and two normalization layers. The specific structure is: 1st linear layer->1st Dropout layer->2nd linear layer->1st normalization layer->2nd normalization layer->2nd Dropout layer->3rd Dropout layer; the input and output channel numbers of the 1st linear layer are 256 and 512 respectively, the input and output channel numbers of the 2nd linear layer are 512 and 256 respectively, the input dimension of the normalization layer is 256, and the probability value of each Dropout layer is 0.1; The feature extraction module based on Transformer includes a decoder containing 3 convolutional layers, 3 linear layers, 3 Dropout layers and 4 normalization layers; the input dimensions of the 3 convolutional layers are all 256, the convolution kernels are all 1, and the stride is all 1; the input and output dimensions of the first linear layer are 64 and 1 respectively, the input and output dimensions of the second linear layer are 256 and 512 respectively, and the input and output dimensions of the third linear layer are 512 and 256 respectively; the probability values of the three Dropout layers are all 0.1; the input dimensions of the four normalization layers are all 256; the specific structure of the decoder is: the first convolutional layer->the second convolutional layer->the third convolutional layer->the first linear layer->the second linear layer->the first Dropout layer->the third linear layer->the first normalization layer->the second normalization layer->the third normalization layer->the second Dropout layer->the third Dropout layer->the fourth normalization layer.
4. The method for three-dimensional target detection based on multimodal data fusion based on attention mechanism according to claim 1, It is characterized in that The confidence loss L described in step (2b) conf and the 3D target loss L rpn , whose expressions are: L conf =-clog(c)-(1-c)log(1-c) L rpn =b 1 L cls +b 2 (L reg-θ +L reg-other )+b 3 L dir L cls =-α(1-y) γ log(y) <h2 style=";text-align:left;direction:ltr">L<h2 style=";text-align:left;direction:ltr"> reg-θ <h2 style=";text-align:left;direction:ltr"> =SmoothL1(sin(θ<h2 style=";text-align:left;direction:ltr"> pre <h2 style=";text-align:left;direction:ltr"> -θ)) L reg-other =SmoothL1(sin(x pre -x)) L dir =-α(1-dir) γ log(dir) Among them, IoU is the intersection over union ratio of the predicted target box and the true target box, α F , α B Respectively represent the intersection-over-union ratio thresholds of foreground and background, β 1 , β 2 , β 3 represents the weight, L cls represents the classification loss, α and γ are the classification loss L cls The hyperparameters, SmoothL1 represents the regression loss function, L reg-θ represents the angle loss, θ represents the actual angle value, L reg-other represents the target box regression value loss, x is the real target box, L dir is the classification loss of the direction.
