Three-dimensional target object detection method, device, electronic equipment and storage medium

CN113658100BActive Publication Date: 2024-09-06HANGZHOU HIKVISION DIGITAL TECHNOLOGY CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202110807099.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-07-16
Publication Date
2024-09-06
Estimated Expiration
2041-07-16

Smart Images

  • Figure CN113658100B
    Figure CN113658100B
Patent Text Reader

Abstract

The present invention provides a three-dimensional target object detection method, device, electronic device and storage medium, belonging to the field of point cloud data processing technology, the method includes: obtaining three-dimensional point cloud data associated with at least one three-dimensional target object; extracting features from the three-dimensional point cloud data to obtain original feature data, and position encoding the three-dimensional point cloud data to obtain position encoding information; fusing the position encoding information with the original feature data to obtain point cloud features, and inputting the point cloud features into a neural network model based on a self-attention mechanism to obtain first feature data outputted by it; inputting the first feature data into a feedforward neural network model to obtain second feature data outputted by it, and the second feature data indicates the attribute information of the at least one three-dimensional target object detected. The three-dimensional target detection method, device, storage medium and electronic device disclosed in the present invention are simple to implement and have good detection performance.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of point cloud data processing, and in particular to a three-dimensional target object detection method, device, electronic equipment and storage medium. Background Art

[0002] With the development of 3D data acquisition technology, 3D data collected by 3D sensors can provide rich geometry, shape and scale information. 3D data is usually represented in different formats. For example, the point cloud data output by LiDAR retains the original geometry and position information of the target object in 3D space and does not require any discrete processing. Therefore, point cloud data is the preferred 3D data representation format.

[0003] In the current 3D object detection method, the prior art generally adopts a pure point cloud bird's eye view (BEV) method, that is, a bird's eye view BEV is generated based on point cloud data, and then the target object is detected by feature extraction based on the BEV. However, the above prior art solutions have the following problems:

[0004] (1) Generating BEV based on point cloud data will result in data loss, leading to reduced detection performance;

[0005] (2) The original characteristics of point cloud data, such as rotation invariance and disorder, are not considered;

[0006] (3) Anchors (i.e., candidate boxes) need to be set in advance, which makes subsequent processing time-consuming and affects the detection performance of multiple categories. Summary of the invention

[0007] The present invention provides a three-dimensional target object detection method, device, electronic device and storage medium to solve the problems existing in the pure point cloud bird's-eye view method used in the prior art, which realizes the simple implementation of three-dimensional target object detection and has good detection performance.

[0008] The present invention provides a three-dimensional target object detection method, comprising:

[0009] Acquiring three-dimensional point cloud data associated with at least one three-dimensional target object;

[0010] Performing feature extraction on the three-dimensional point cloud data to obtain original feature data, and performing position encoding on the three-dimensional point cloud data to obtain position encoding information;

[0011] The position encoding information and the original feature data are combined to obtain a point cloud feature, and the point cloud feature is input into a neural network model based on a self-attention mechanism to obtain a first feature data outputted by the neural network model, wherein the first feature data is used to represent a feature of a target object corresponding to the point cloud data;

[0012] The first feature data is input into a feedforward neural network model to obtain second feature data outputted by the model, wherein the second feature data indicates attribute information of the at least one three-dimensional target object detected.

[0013] Exemplarily, in the three-dimensional target object detection method described in the present invention, the three-dimensional point cloud data is point cloud data output by a laser radar, and the attribute information of the three-dimensional target object includes at least the spatial size and position information of the three-dimensional target object.

[0014] Exemplarily, in the three-dimensional target object detection method of the present invention, the step of extracting features from the three-dimensional point cloud data to obtain original feature data includes:

[0015] A multi-level feature extraction operation is performed using the full set of the three-dimensional point cloud data as the initial input feature point set, and the feature point set output by the last level of feature extraction operation is used as the original feature data, wherein the feature point set output by the previous level of feature extraction operation is the input of the next level of feature extraction operation, and each level of feature extraction operation includes:

[0016] Selecting a plurality of points from the entire set of input feature points, each of the points defining the centroid of a local area where the point is located;

[0017] For each of the centroids, construct a local area point set based on adjacent points near the centroid;

[0018] Each of the local area point sets is encoded to obtain feature points corresponding to each local area point set, and all of the feature points constitute an output feature point set.

[0019] Exemplarily, in the three-dimensional target object detection method of the present invention, the step of selecting a plurality of points from the entire set of input feature points includes:

[0020] By using the iterative farthest point sampling algorithm from the full set of input feature points {x1,x2,...,x n}Select a subset

[0021] in, is the distance set The farthest point.

[0022] Exemplarily, in the three-dimensional target object detection method according to the present invention, the step of constructing a local area point set based on adjacent points near each centroid includes:

[0023] Based on the input feature point set of size N×(d+C) and the centroid set of size N′×d, N′×K×(d+C) feature points are obtained, and the feature points constitute N′ local area point sets;

[0024] Among them, N represents the number of point cloud data, N' represents the number of local areas, C represents the feature dimension, d represents the coordinate dimension, each local area point set corresponds to a local area, and K represents the number of adjacent points of each centroid point.

[0025] Exemplarily, in the three-dimensional target object detection method of the present invention, the step of encoding each of the local area point sets to obtain feature points corresponding to each local area point set includes:

[0026] Based on the input N' local area point sets containing N'×K×(d+C) feature points and encoding the centroid and the adjacent points of the centroid contained in each local area point set to abstract the local features of the local area indicated by the local area point set, an output feature point set containing N'×(d+C') feature points is obtained;

[0027] Where N' represents the number of local regions, K represents the number of adjacent points of each centroid point, d represents the coordinate dimension, C represents the feature dimension, C' represents the new local feature dimension, and C'>C.

[0028] Exemplarily, in the three-dimensional target object detection method of the present invention, the step of position encoding the three-dimensional point cloud data to obtain position encoding information includes:

[0029] Get the coordinates of the preset key points;

[0030] Subtract the coordinates of the preset key point from the position coordinates of each point of the three-dimensional point cloud data to obtain the relative coordinates of each point of the three-dimensional point cloud data;

[0031] Based on the relative coordinates, the position encoding information is generated.

[0032] Exemplarily, in the three-dimensional target object detection method of the present invention, the step of fusing the position coding information with the original feature data to obtain point cloud features includes:

[0033] Mapping the coordinates of each point of the three-dimensional point cloud data to the feature dimension of the original feature data;

[0034] The generated position encoding information is added to the original feature data through a feedforward fully connected neural network to obtain the point cloud feature.

[0035] Exemplarily, in the three-dimensional target object detection method of the present invention, the step of inputting the point cloud features into a neural network model based on a self-attention mechanism to obtain the first feature data outputted by the neural network model includes:

[0036] Inputting the point cloud features into the multi-head self-attention layer of the encoder of the neural network model based on the self-attention mechanism, and processing them by the multi-head self-attention function set in the multi-head self-attention layer to obtain self-attention features;

[0037] Inputting the self-attention feature into the decoder of the neural network model based on the self-attention mechanism for decoding to output the first feature data;

[0038] Among them, the neural network model based on the self-attention mechanism includes an encoder and a decoder, the encoder includes multiple encoder layers, each encoder layer includes a first sublayer and a second sublayer, each of the first sublayers is a multi-head self-attention layer, each of the second sublayers is a feedforward fully connected neural network, and each encoding layer encodes the point cloud features in parallel.

[0039] Exemplarily, in the three-dimensional target object detection method of the present invention, the step of inputting the point cloud features into a neural network model based on a self-attention mechanism to obtain the first feature data outputted by the neural network model further includes:

[0040] The multi-head attention layer of the decoder of the neural network model based on the self-attention mechanism receives the self-attention feature and the position encoding information; and

[0041] Decoding the self-attention feature based on the self-attention feature and the position encoding information to output the first feature data;

[0042] Among them, the decoder includes multiple decoder layers, each decoder layer includes a first sublayer, a second sublayer and a third sublayer, the first sublayer is a multi-head self-attention layer, the second sublayer is a multi-head attention layer, the third sublayer is a feedforward fully connected neural network, and each decoding layer decodes the self-attention features in parallel.

[0043] Exemplarily, in the three-dimensional target object detection method of the present invention, the step of inputting the first feature data into a feedforward neural network model to obtain the second feature data outputted by the feedforward neural network model comprises:

[0044] Determine, based on the input first feature data, the center coordinates, length, width, height and angle parameters of the prediction box associated with the first feature data via the feedforward neural network model;

[0045] Based on the center coordinates, length, width, height and angle parameters of the prediction box, a preset function is used to determine the category label of the three-dimensional target object associated with the prediction box, and the size, position and category label of each prediction box are output;

[0046] The size, position and category label of each prediction box constitute the second feature data, and the category label includes a special category label indicating that no three-dimensional target object is detected.

[0047] Exemplarily, the three-dimensional target object detection method described in the present invention also includes: training the first neural network model and the second neural network model using three-dimensional point cloud data of known three-dimensional target objects before the neural network model based on the self-attention mechanism and the feedforward neural network model implement three-dimensional target object detection.

[0048] Exemplarily, the three-dimensional target object detection method of the present invention further includes:

[0049] Before the multi-head attention layer of the decoder of the neural network model based on the self-attention mechanism receives the self-attention feature and the position encoding information, the multi-head self-attention of the decoder of the neural network model based on the self-attention mechanism receives input preset target parameters, and the preset target parameters are used to limit the amount of output second feature data.

[0050] The present invention also provides a three-dimensional target object detection device, comprising:

[0051] a feature extraction and position encoding module, for acquiring three-dimensional point cloud data associated with at least one three-dimensional target object, then performing feature extraction on the three-dimensional point cloud data to obtain original feature data, performing position encoding on the three-dimensional point cloud data to obtain position encoding information, and fusing the position encoding information with the original feature data to obtain point cloud features;

[0052] A first processing module, configured to input the point cloud features into a neural network model based on a self-attention mechanism to obtain first feature data outputted by the neural network model, wherein the first feature data is used to represent features of a target object corresponding to the point cloud data;

[0053] The second processing module is used to input the first feature data into a feedforward neural network model to obtain second feature data outputted by the model, wherein the second feature data indicates attribute information of the at least one three-dimensional target object detected.

[0054] The present invention also provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, the steps of any of the above-mentioned three-dimensional target object detection methods are implemented.

[0055] The present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of any of the above-mentioned three-dimensional target object detection methods.

[0056] The three-dimensional target object detection method, device, electronic device and storage medium provided by the present invention process point clouds through a point cloud feature network, take into account the position information of the point clouds, encode and decode the point cloud features through an introduced self-attention network, and finally output the detection information of the position and category of each target object through a feedforward neural network (FFN) to determine the final predicted target, avoiding the design of anchors (candidate boxes). In addition, the three-dimensional target object detection method, device, electronic device and storage medium described in the present invention are simple to implement and have good detection performance. BRIEF DESCRIPTION OF THE DRAWINGS

[0057] In order to more clearly illustrate the technical solutions in the present invention or the prior art, a brief introduction will be given below to the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.

[0058] Figure 1 It is a flow chart of the three-dimensional target object detection method provided by the present invention;

[0059] Figure 2 It is a schematic diagram of the process of extracting features from point clouds provided by the present invention;

[0060] Figure 3 It is a schematic diagram of the principle of the feature extraction method proposed in the present invention;

[0061] Figure 4 It is a schematic diagram of the process of position encoding of point cloud provided by the present invention;

[0062] Figure 5 It is a schematic diagram of the process of encoding point cloud features provided by the present invention;

[0063] Figure 6 It is a schematic diagram of the process of decoding point cloud features provided by the present invention;

[0064] Figure 7 It is a schematic diagram of the structure of the self-attention network provided by the present invention;

[0065] Figure 8 It is a structural schematic diagram of the multi-head self-attention mechanism provided by the present invention;

[0066] Fig. 9It is a flowchart of the step of inputting the first characteristic data into the second neural network model to obtain the second characteristic data provided by the present invention;

[0067] Fig.10 is a schematic structural diagram of a three-dimensional target object detection device provided by the present invention;

[0068] Fig.11 is a schematic diagram of an exemplary three-dimensional target object detection architecture provided by the present invention;

[0069] Fig.12 It is a structural schematic diagram of the electronic device provided by the present invention. DETAILED DESCRIPTION

[0070] In order to make the purpose, technical solution and advantages of the present invention clearer, the technical solution of the present invention will be clearly and completely described below in conjunction with the drawings of the present invention. Obviously, the described embodiments are 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.

[0071] The terms "first", "second", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the numbers used in this way can be interchanged where appropriate, so that the embodiments described herein can be implemented in an order other than that shown or described herein.

[0072] The existing three-dimensional target object detection methods are based on pure point cloud BEV (bird's eye view) methods, such as VoxelNet (voxel 3D detection network), SECOND (voxel 3D detection network using sparse convolution), PointPillars (voxel 3D detection network that only performs 2D grid division), etc. These methods all generate point clouds in the form of bird's eye view BEV, then design deep learning networks under the BEV representation, and finally detect or predict the target.

[0073] In order to solve the problems of data loss, low detection performance and failure to consider the original features of point clouds (such as rotation invariance and disorder) in the prior art due to the use of a pure point cloud bird's-eye view method, the present invention provides a three-dimensional target object detection method, device, electronic device and storage medium, which directly process the original point cloud using the deep learning network architecture proposed in the present invention. The deep learning network architecture proposed in the present invention fully considers the original features and position information of the point cloud, and introduces a self-attention mechanism to achieve effective detection of three-dimensional target objects, while avoiding the pre-setting of anchors.

[0074] Combine the following Figure 1-Figure 12 The present invention describes a three-dimensional target object detection method, device, electronic device and storage medium.

[0075] Figure 1 is a flow chart of the three-dimensional target object detection method provided by the present invention, such as Figure 1 As shown, the three-dimensional target object detection method includes:

[0076] Step 101: Acquire three-dimensional point cloud data associated with at least one three-dimensional target object.

[0077] Optionally, the three-dimensional point cloud data is point cloud data output by a laser radar.

[0078] Step 102: extract features from the three-dimensional point cloud data to obtain original feature data, and perform position encoding on the three-dimensional point cloud data to obtain position encoding information.

[0079] Step 103: merge the position coding information and the original feature data to obtain point cloud features, and input the point cloud features into a first neural network model to obtain first feature data output by the first neural network model, wherein the first feature data is used to represent the features of the target object corresponding to the point cloud data.

[0080] Optionally, the first neural network model is a neural network model based on a self-attention mechanism.

[0081] Step 104: input the first feature data into a second neural network model to obtain second feature data output by the second neural network model, wherein the second feature data indicates attribute information of the at least one three-dimensional target object detected.

[0082] Optionally, the second neural network model is a feedforward neural network model.

[0083] Optionally, the attribute information of the three-dimensional target object includes at least spatial size and position information of the three-dimensional target object.

[0084] The above steps 102 to 104 are described in detail below.

[0085] Figure 2 is a schematic diagram of the process of extracting features from point clouds provided by the present invention, Figure 3 It is a schematic diagram of the principle of the feature extraction method proposed in the present invention, such as Figure 2 , Figure 3As shown, in the three-dimensional target object detection method proposed in the present invention, the pointnet++ network model is used for feature extraction. The pointnet++ network model uses the idea of ​​hierarchical feature extraction. The feature extraction network model consists of a series of point set abstraction layers, and each point set abstraction layer consists of three key layers: sampling layer, grouping layer, and feature extraction layer (PointNet).

[0086] For example, if the input of a point set extraction layer is a feature point set of size N×(d+C) (the feature point set represents N points, each point has coordinates of d dimensions and point features of C dimensions), then the output of the point set extraction layer is a feature point set of size N'×(d+C'), where the coordinate dimension represented by d remains unchanged.

[0087] Specifically, in step 102, the step of extracting features from the three-dimensional point cloud data to obtain original feature data includes:

[0088] A multi-level feature extraction operation is performed using the full set of the three-dimensional point cloud data as the initial input feature point set, and the feature point set output by the last level of feature extraction operation is used as the original feature data, wherein the feature point set output by the previous level of feature extraction operation is the input of the next level of feature extraction operation, and each level of feature extraction operation includes:

[0089] Step 201 : Select multiple points from the entire set of input feature points, each of which defines the centroid of the local area where the point is located.

[0090] Specifically, by using the iterative farthest point sampling algorithm (FPS) from the full set of input feature points {x1, x2, ..., x n}Select a subset in, is the distance set relative to the rest of the point cloud The farthest point.

[0091] The above FPS algorithm is a sampling algorithm that can ensure uniform sampling of samples, that is, it can better cover the entire sampling space.

[0092] The principle of the FPS algorithm is: first randomly select a point, then select the point farthest from this point to add to the starting point, and then continue to iterate until the required number is selected.

[0093] Step 202: for each of the centroids, construct a local area point set based on adjacent points near the centroid.

[0094] Specifically, based on the input feature point set of size N×(d+C) and the centroid set of size N′×d, N′×K×(d+C) feature points are obtained, and the feature points constitute N′ local area point sets.

[0095] Among them, N represents the number of point cloud data, N' represents the number of local areas, C represents the feature dimension, d represents the coordinate dimension, each local area point set corresponds to a local area, and K represents the number of adjacent points of each centroid point.

[0096] Optionally, the point cloud data is sampled using the centroid as a representative sample, which is calculated as the average of all data points in the same cluster.

[0097] Step 203: Encode each of the local area point sets to obtain feature points corresponding to each local area point set, and all of the feature points constitute an output feature point set.

[0098] Specifically, based on the input N' local area point sets containing N'×K×(d+C) feature points and by encoding the centroid and the adjacent points of the centroid contained in each local area point set to abstract the local features of the local area indicated by the local area point set, an output feature point set containing N'×(d+C') feature points is obtained. The above N' corresponds to Figure 2 N1 in.

[0099] Among them, N' represents the number of local areas, K represents the number of adjacent points of each centroid point, d represents the coordinate dimension, C represents the feature dimension, and C' represents the new local feature dimension.

[0100] Where C' represents a new local feature dimension (C'>C), and each local region is abstracted by its centroid and local features encoding the neighboring points of the centroid. Based on the variation of K between groups, the feature extraction layer is able to convert a flexible number of points into a vector of local region features of fixed length. The above C' corresponds to Figure 2 C1 in.

[0101] Specifically, step 203 is to convert the coordinates of the points in the K local regions into coordinates relative to the center point of the region, and use them as the feature extraction layer PointNet (such as Figure 3 The input of (described above) is used to obtain local features.

[0102] The present invention adopts Figure 3The feature extraction method shown has the advantages of being able to extract features from disordered point clouds and being highly efficient. By extracting relatively important points from dense point cloud data as the center points of each local area, the center points obtained in each layer are subsets of the center points of the previous layer, and as the number of layers increases, the number of center points decreases, but each center point contains more and more information, which can prevent information loss caused by sampling point cloud data. In addition, by determining the neighborhood range (i.e., local area) of each center point, the problem of uneven sampling density when collecting point cloud data can be solved.

[0103] Figure 4 The schematic diagram of the process of position encoding of point cloud provided by the present invention is shown in the figure. In the above step 102, the step of position encoding the three-dimensional point cloud data to obtain position encoding information includes:

[0104] Step 401, obtaining the coordinates of preset key points.

[0105] Step 402 : subtract the coordinates of the preset key point from the position coordinates of each point of the three-dimensional point cloud data to obtain the relative coordinates of each point of the three-dimensional point cloud data.

[0106] Step 403: Generate the position coding information based on the relative coordinates.

[0107] Optionally, the present invention may map the relative coordinates of each point to the original feature data through a feed-forward neural network (FFN), and then add the generated position encoding information to the point cloud features.

[0108] Furthermore, in the above step 103, the fusion of the position coding information and the original feature data to obtain the point cloud feature includes:

[0109] Mapping the coordinates of each point of the three-dimensional point cloud data to the feature dimension of the original feature data;

[0110] The generated position encoding information is added to the original feature data through a feedforward fully connected neural network to obtain the point cloud feature.

[0111] The present invention adopts the above-mentioned position encoding method, which has the advantages of being simple and effective. That is, it only needs to map the coordinates of each point to the feature dimension, and then add the generated position encoding to the point cloud feature, and for all position encodings, first subtract the coordinates of the key points, then use the relative position as the input of the position encoding, and then use a simple fully connected network to map the relative coordinates to the feature dimension.

[0112] Figure 5 It is a schematic diagram of the process of encoding point cloud features provided by the present invention, such as Figure 5 In the above step 103, the step of inputting the point cloud features into the first neural network model to obtain the first feature data output by the first neural network model includes:

[0113] Step 501, input the point cloud features into the multi-head self-attention layer of the encoder of the neural network model based on the self-attention mechanism, and process them by the multi-head self-attention function set in the multi-head self-attention layer to obtain self-attention features.

[0114] Step 502: input the self-attention feature into the decoder of the neural network model based on the self-attention mechanism for decoding to output the first feature data.

[0115] Among them, the neural network model based on the self-attention mechanism includes an encoder and a decoder, the encoder includes multiple encoder layers, each encoder layer includes a first sublayer and a second sublayer, each of the first sublayers is a multi-head self-attention layer, each of the second sublayers is a feedforward fully connected neural network, and each encoding layer encodes the point cloud features in parallel.

[0116] Optionally, the multi-head self-attention layer includes multiple single-head self-attention structures, and the self-attention function corresponding to each single-head self-attention structure can be described as mapping a query and a set of key-value pairs to an output, where query, key, value, and output are all vectors. Exemplarily, the output is calculated as the weighted sum of the values, where the weight assigned to each value is calculated by a compatibility function of the query and the corresponding key. The self-attention function corresponding to a single-head self-attention structure is calculated by the following formula:

[0117]

[0118] Among them, Q, K, and V are the matrices of query, key, and value respectively. k Is the dimension of the key.

[0119] The self-attention score is obtained by multiplying the query with each key result. The preset function (such as the softmax function) normalizes the self-attention score to obtain each score value, and then directly multiplies each score value with its own value, and then sums them up to get the first output value.

[0120] Since linearly projecting the query, key, and value h times using different linear projections is more efficient than using a single self-attention function, the present invention uses a multi-head self-attention mechanism. The self-attention function is executed in parallel on each projected version of the query, key, and value to produce d vdimensional output values. They are concatenated and projected again to get the final value, where the multi-head self-attention function is calculated as follows:

[0121] MuultiHead(Q,K,V)=Concat(head1,...,head h )W O

[0122]

[0123] Specifically, the multi-head self-attention mechanism is as follows Figure 8 As shown in the figure, V, K, and Q are fixed single values, while there are 3 Linear layers and 3 Scaled Dot-Product Attention layers, that is, h is equal to 3 multi-heads; finally, they are cancatted together, and then the Linear layer is converted into an output value that is the same as a single head; similar to integration. The difference between multi-head and single-head is that multiple single heads are copied, but the weight coefficients are different; it is similar to a neural network model and multiple identical neural network models. Due to different initializations, the weights will be different, and then the results will be integrated.

[0124] From the above multi-head self-attention function, we can see that the input of the attention function changes from the original Q, K, V to That is, the three Ws are all different; Q, K, and V are changed from the original 512 dimensions to 64 dimensions (assuming 8 multiple heads are used); and then they are spliced ​​together to become 512 dimensions, and W is used to calculate the dimensions of the original 512 dimensions. O Perform a linear transformation to obtain the final multi-head self-attention value, that is, the multi-head self-attention is calculated by multiple independent attentions.

[0125] It should be noted that the multi-head self-attention layer is an operation on its own input, and the multi-head self-attention layer is affected by other inputs as weights.

[0126] Figure 7 It is shown that the present invention transmits position encoding information in each multi-head self-attention layer. Exemplarily, the point cloud features from the feature extraction network model are encoded by the self-attention encoder, and the position encoding information is also added to the keys and queries of each multi-head self-attention layer.

[0127] Optionally, each level of each sublayer of each multi-head self-attention layer adopts residual connection (skipconnect), and then performs feature addition and layer normalization (Layer Norm) processing, that is, the output of each sublayer is LayerNorm(x+Sublayer(x)), where Sublayer(x) is the function implemented by the sublayer itself.

[0128] It should be understood that the idea of ​​residual connection is to express the output as a linear superposition of the input and a nonlinear transformation of the input. For example, a nonlinear change function is used to describe the input and output of a network, that is, the input is X, the output is F(x), and F includes operations such as convolution and activation. When an input is added to the output of the function, G(x) can still be used to describe the relationship between the input and the output, but G(x) can be split into the linear superposition of F(x) and X.

[0129] Among them, four types of normalization are commonly used in deep learning: GroupNorm (GN), LayerNorm (LN), InstanceNorm (IN) and BatchNorm (BN). The neural network model based on the self-attention mechanism adopted in the present invention adopts the layer normalization LayerNorm (LN) method.

[0130] Optionally, the neural network model based on the self-attention mechanism adopted by the present invention can also adopt other normalization methods. Among them, batch normalization BN is the normalization of a single neuron between different data to be processed, and layer normalization LN is the normalization of a single data to be processed between all neurons in a certain layer, that is, layer normalization LN normalizes all neurons in an intermediate layer. The advantage of layer normalization LN is that the distribution of input data in each layer of the network is relatively stable, which accelerates the model processing or learning speed.

[0131] Optionally, the calculation process of layer normalization LN includes: first, calculating the mean; then calculating the variance; then normalizing to a mean of 0 and a variance of 1; and finally performing a change reconstruction to restore the distribution to be learned by this layer of the network.

[0132] Figure 6 It is a schematic diagram of the process of decoding point cloud features provided by the present invention, such as Figure 6 In the above step 103, the step of inputting the point cloud features into the first neural network model to obtain the first feature data output by the first neural network model also includes:

[0133] Step 601, before the multi-head attention layer of the decoder of the neural network model based on the self-attention mechanism receives the self-attention feature and the position encoding information, the multi-head self-attention layer of the decoder of the neural network model based on the self-attention mechanism receives an input preset target parameter, and the preset target parameter is used to limit the amount of the output second feature data.

[0134] The preset target parameter is used to limit the number of output category predictions. According to the input point cloud data, the prediction target is output, and there may be many output prediction targets, but not all of them are required by the user. Therefore, the number of category predictions output by the feedforward neural network (FFN) can be limited by setting the input preset target parameter.

[0135] In step 602, the multi-head attention of the decoder of the neural network model based on the self-attention mechanism receives the self-attention feature and the position encoding information, and decodes the self-attention feature based on the self-attention feature and the position encoding information to output the first feature data.

[0136] Among them, Figure 7 As shown, the self-attention decoder includes multiple decoder layers, each decoder layer includes three sublayers, namely a first sublayer, a second sublayer and a third sublayer, the first sublayer is a multi-head self-attention layer, the second sublayer is a multi-head attention layer, the third sublayer is a feedforward neural network (FFN), and each decoding layer can decode multiple target objects in parallel.

[0137] That is, in addition to the two sublayers that are the same as the two sublayers of each encoder layer, the self-attention decoder also has another sublayer, namely a multi-head attention layer, which performs a multi-head attention operation on the output of the encoder stack. Similar to the self-attention encoder, each sublayer of the self-attention decoder also uses a residual connection, and then performs feature addition and layer normalization processing. Each decoder layer of the self-attention decoder set by the present invention can decode N target objects in parallel.

[0138] It should be noted that in order to ensure that both the self-attention encoder and the self-attention decoder have corresponding position encoding information, the position encoding information output from the position encoding module can also be used as the input of the self-attention decoder.

[0139] In summary, the present invention adopts an encoder based on a self-attention mechanism for encoding to output first feature data, and adopts a decoder based on a self-attention mechanism for decoding to output second feature data, and a multi-head self-attention mechanism is used in the encoder and the decoder, so that the training speed of the neural network model based on the self-attention mechanism of the present invention is faster than other neural network models in the prior art.

[0140] Fig. 9 is a flow chart of the step of inputting the first feature data into the second neural network model to obtain the second feature data provided by the present invention, such as Fig. 9 In the above step 104, the step of inputting the first feature data into the feedforward neural network model to obtain the second feature data outputted by the feedforward neural network model includes:

[0141] Step 901, based on the input first feature data, determine the center coordinates, length, width, height and angle parameters of the prediction box associated with the first feature data via the feedforward neural network model.

[0142] Optionally, the feedforward neural network (FFN) is composed of a three-layer perceptron with a hidden layer size of d, a ReLU (activation) layer, and a linear projection layer.

[0143] Step 902, based on the center coordinates, length, width, height and angle parameters of the prediction box, use a preset function (e.g., a softmax function) to determine the category label of the three-dimensional target object associated with the prediction box, and output the size, position and category label of each prediction box.

[0144] The size, position and category label of each prediction box constitute the second feature data, and the category label includes a special category label indicating that no three-dimensional target object is detected.

[0145] Optionally, the prediction box ( Figure 1 The scale of the "predicted 3D box" shown in the figure is defined by the following parameters (x, y, z, w, l, h, θ), where (x, y, z) represents the coordinates of the center point of the box, and (w, l, h, θ) represents the width, length, height and angle of the box. In other words, a vector is used to represent the parameters (x, y, z, w, l, h, θ) of the predicted box corresponding to each target object.

[0146] Although the present invention predicts a set of N bounding boxes of fixed size, N is usually much larger than the number of objects of interest, so an additional special class label is needed to indicate that no object is detected. This class has a similar role to the background class in the standard object detection method.

[0147] In summary, the present invention uses the feedforward neural network model to output the position prediction and category prediction of each target, and finally determines the final prediction target through the score threshold. Since the feedforward neural network model has a simple structure (that is, its adjacent layers are fully connected, and there are no same-layer connections and cross-layer connections), there is no need to pre-set the anchor (candidate box), and it has good detection performance.

[0148] Specifically, the three-dimensional target object detection method disclosed in the present invention further includes: using the three-dimensional point cloud data of a known three-dimensional target object to train the neural network model based on the self-attention mechanism and the feedforward neural network model before the neural network model based on the self-attention mechanism and the feedforward neural network model implement the three-dimensional target object detection. The three-dimensional target object detection device provided by the present invention is described below, and the three-dimensional target object detection device described below and the three-dimensional target object detection method described above can be referred to each other.

[0149] Fig.10 is a schematic diagram of the structure of the three-dimensional target object detection device provided by the present invention, such as Fig.10 The three-dimensional target object detection device 1000 of the present invention includes a feature extraction and position encoding module 1010, a first processing module 1020 and a second processing module 1030, wherein:

[0150] The feature extraction and position encoding module 1010 is used to obtain three-dimensional point cloud data associated with at least one three-dimensional target object, then perform feature extraction on the three-dimensional point cloud data to obtain original feature data, perform position encoding on the three-dimensional point cloud data to obtain position encoding information, and merge the position encoding information with the original feature data to obtain point cloud features.

[0151] The first processing module 1020 is used to input the point cloud features into a first neural network model to obtain first feature data output by the first neural network model.

[0152] The second processing module 1030 is used to input the first feature data into a second neural network model to obtain second feature data output by the second neural network model, wherein the second feature data indicates attribute information of the at least one three-dimensional target object detected.

[0153] The three-dimensional target object detection device of the present invention is described in detail below by using an example.

[0154] Fig.11 is a schematic diagram of an exemplary three-dimensional target object detection architecture provided by the present invention, such as Fig.11The three-dimensional target object detection device proposed in the present invention includes: a feature extraction and position encoding module, a first processing module and a second processing module.

[0155] It should be understood that there are generally four forms of representation of three-dimensional data: (1) Point cloud: composed of N D-dimensional points. When D = 3, it generally represents the coordinates of (x, y, z). Of course, it can also include some normal vectors, intensity and other features. (2) Mesh: composed of triangular patches and square patches. (3) Voxel: a three-dimensional grid represents objects with 0 and 1. (4) Multi-angle RGB images or RGB-D images. Since point clouds are closer to the original representation of objects (for example, radar scanning of objects directly generates point clouds), and the expression of point clouds is simpler, an object is represented by only an N×D matrix.

[0156] Point clouds can be acquired through data collection by 3D laser radar, or through 3D reconstruction by 2D images, and point clouds can be acquired during the reconstruction process, or point clouds can be acquired through calculation by 3D models. Point clouds are data sets of points in a certain coordinate system. Points contain rich information, including 3D coordinates X, Y, Z, color, classification value, intensity value, time, etc.

[0157] Optionally, the three-dimensional point cloud data described in the present invention is point cloud data output by a laser radar, and the attribute information of the three-dimensional target object at least includes the spatial size and position information of the three-dimensional target object.

[0158] Among them, the feature extraction and position encoding module includes a feature extraction unit and a position encoding unit, which are used to obtain three-dimensional point cloud data associated with at least one three-dimensional target object, then perform feature extraction on the three-dimensional point cloud data to obtain original feature data, and perform position encoding on the three-dimensional point cloud data to obtain position encoding information, and merge the position encoding information and the original feature data to obtain point cloud features.

[0159] Among them, the first processing module includes a self-attention encoder and a self-attention decoder, which are used to input the point cloud features into a first neural network model to obtain first feature data output by the first neural network model.

[0160] Optionally, the first neural network model is a neural network model based on a self-attention mechanism. Specifically, the first neural network model includes an encoder and a decoder. The encoder is used to process point cloud features to obtain self-attention features. The input of the decoder includes two parts, one part is the self-attention features output by the encoder; the other part is a preset target parameter, and the preset target parameter is used to limit the number of output category predictions.

[0161] Furthermore, the decoder outputs a decoded feature (ie, the first feature data) of each target object based on the self-attention feature and the input preset target parameters.

[0162] Among them, the second processing module includes a feedforward fully connected neural network, which is used to input the first feature data into a second neural network model to obtain second feature data output by the second neural network model, and the second feature data indicates the attribute information of the at least one three-dimensional target object detected.

[0163] Optionally, the second neural network model is a feedforward neural network model.

[0164] The second neural network model outputs the position prediction and category prediction of each target object through a feedforward neural network (FFN) according to the decoded features of each target object (i.e., the first feature data), and then determines the final prediction target (i.e., the second feature data, such as Figure 1 The preset threshold (or confidence level) is used to filter targets, and different confidence levels have different outputs. For example, a low confidence level can be set for target filtering.

[0165] Optionally, the classifier of the feedforward neural network (FFN) can give the probability of predicting the category, and the reliability of the result of the classifier itself is evaluated based on the confidence. Assuming that there are multiple classifiers for decision fusion, it is necessary to weight the results given by each classifier (the result can be a probability or a category label) by the confidence. Then, these weighted single classifier results are fused through different decision criteria (such as DS, LOP, LOGP) to give the final classification detection result.

[0166] The second neural network model may be a traditional feedforward neural network (FNN) model, and of course may also be a neural network model with other structures, which is not limited in the present invention.

[0167] Other aspects of the three-dimensional target object detection device proposed by the present invention are the same or similar to the three-dimensional target object detection method described above, and will not be repeated here.

[0168] In summary, the three-dimensional target object detection device provided by the present invention has a simple structure and can effectively improve the performance of three-dimensional target detection.

[0169] like Fig.12As shown, the present invention also proposes an electronic device, which includes: a processor (processor) 1210, a communication interface (Communications Interface) 1220, a memory (memory) 1230 and a communication bus 1240, wherein the processor 1210, the communication interface 1220, and the memory 1230 communicate with each other through the communication bus 1240. The processor 1210 can call the logic instructions in the memory 1230 to execute any of the three-dimensional target object detection methods described above.

[0170] Exemplarily, the logic instructions in the above-mentioned memory 1230 can be implemented in the form of a software functional unit, and when sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on such an understanding, the technical solution of the present invention is essentially or the part that contributes to the prior art or the part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions to enable a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a disk or an optical disk.

[0171] On the other hand, the present invention further provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements any of the three-dimensional target object detection methods described above.

[0172] In summary, the three-dimensional target object detection method, device, electronic device and storage medium provided by the present invention can directly process point cloud data without designing any additional candidate boxes, and are suitable for predicting targets of various scales. Moreover, the present invention uses an attention network for three-dimensional target detection, which can effectively improve the detection performance of three-dimensional targets. In addition, the three-dimensional detection based on the self-attention network of the present invention does not have complex data processing operations, and can realize the detection of target objects based on the traditional feedforward neural network (FFN).

[0173] The device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Ordinary technicians in this field can understand and implement it without paying creative labor.

[0174] Through the description of the above implementation methods, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus a necessary general hardware platform, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solution is essentially or the part that contributes to the prior art can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a disk, an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or some parts of the embodiments.

[0175] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims

1. A three-dimensional target object detection method, characterized in that: include: Acquire three-dimensional point cloud data associated with a plurality of three-dimensional target objects, wherein the three-dimensional point cloud data includes a feature point set of N×(d+C), where N represents the number of point cloud data, d represents the coordinate dimension, and C represents the feature dimension; Performing feature extraction on the three-dimensional point cloud data to obtain original feature data, and performing position encoding on the three-dimensional point cloud data to obtain position encoding information, wherein the original feature data includes a feature point set of N'×(d+C'), where N' represents the number of local regions, d represents the coordinate dimension, C represents the feature dimension, C' represents the new local feature dimension, and C'>C; Merging the position coding information with the original feature data to obtain point cloud features; Input the point cloud features and the position encoding information into the multi-head self-attention layer of the encoder of the neural network model based on the self-attention mechanism to obtain the self-attention features, the point cloud features are used as the input values ​​of the query Q and the key value KV, and the position encoding information is used as the input value of the query Q and the key K; Inputting a preset target parameter into a first sublayer of a decoder of a neural network model based on a self-attention mechanism, wherein the preset target parameter is used to limit the amount of output second feature data, and the first sublayer of the decoder is a multi-head self-attention layer; The self-attention feature, the position encoding information, the feature output by the first sublayer and the preset target parameter are input to the second sublayer of the decoder of the neural network model based on the self-attention mechanism to obtain the first feature data output by it, wherein the first feature data is used to represent the feature of the target object corresponding to the point cloud data, the self-attention feature is used as the input value of the key value KV, the position encoding information is used as the input value of the key K, the feature output by the first sublayer and the preset target parameter are used as the input value of the query Q, and the second sublayer of the decoder is a multi-head attention layer; The first feature data is input into a feedforward neural network model to obtain second feature data outputted by the model, wherein the second feature data indicates attribute information of the plurality of three-dimensional target objects detected.

2. The three-dimensional target object detection method according to claim 1, characterized in that: The step of extracting features from the three-dimensional point cloud data to obtain original feature data comprises: A multi-level feature extraction operation is performed using the full set of the three-dimensional point cloud data as the initial input feature point set, and the feature point set output by the last level of feature extraction operation is used as the original feature data, wherein the feature point set output by the previous level of feature extraction operation is the input of the next level of feature extraction operation, and each level of feature extraction operation includes: Selecting a plurality of points from the entire set of input feature points, each of the points defining the centroid of a local area where the point is located; For each of the centroids, construct a local area point set based on adjacent points near the centroid; Each of the local area point sets is encoded to obtain feature points corresponding to each local area point set, and all of the feature points constitute an output feature point set.

3. The three-dimensional target object detection method according to claim 2, characterized in that: The step of selecting a plurality of points from the entire set of input feature points comprises: By using the iterative farthest point sampling algorithm from the full set of input feature points {x1,x2,...,x n }Select a subset in, is the distance set The farthest point.

4. The three-dimensional target object detection method according to claim 2, characterized in that: The step of constructing a local area point set based on adjacent points near each centroid comprises: Based on the input feature point set of size N×(d+C) and the centroid set of size N′×d, N′×K×(d+C) feature points are obtained, and the feature points constitute N′ local area point sets; Among them, N represents the number of point cloud data, N' represents the number of local areas, C represents the feature dimension, d represents the coordinate dimension, each local area point set corresponds to a local area, and K represents the number of adjacent points of each centroid point.

5. The three-dimensional target object detection method according to claim 2, characterized in that: The step of encoding each of the local area point sets to obtain feature points corresponding to each of the local area point sets comprises: Based on the input N' local area point sets containing N'×K×(d+C) feature points and encoding the centroid and the adjacent points of the centroid contained in each local area point set to abstract the local features of the local area indicated by the local area point set, an output feature point set containing N'×(d+C') feature points is obtained; Where N' represents the number of local regions, K represents the number of adjacent points of each centroid point, d represents the coordinate dimension, C represents the feature dimension, C' represents the new local feature dimension, and C'>C.

6. The three-dimensional target object detection method according to claim 1, characterized in that: The step of position encoding the three-dimensional point cloud data to obtain position encoding information comprises: Get the coordinates of the preset key points; Subtract the coordinates of the preset key point from the position coordinates of each point of the three-dimensional point cloud data to obtain the relative coordinates of each point of the three-dimensional point cloud data; Based on the relative coordinates, the position encoding information is generated.

7. The three-dimensional target object detection method according to claim 1, characterized in that: The step of fusing the position coding information with the original feature data to obtain point cloud features comprises: Mapping the coordinates of each point of the three-dimensional point cloud data to the feature dimension of the original feature data; The generated position encoding information is added to the original feature data through a feedforward fully connected neural network to obtain the point cloud feature.

8. The three-dimensional target object detection method according to claim 2, characterized in that: The step of inputting the point cloud features and the position encoding information into a multi-head self-attention layer of an encoder of a neural network model based on a self-attention mechanism to obtain a self-attention feature comprises: Inputting the point cloud features and the position encoding information into the multi-head self-attention layer of the encoder of the neural network model based on the self-attention mechanism, and processing them by the multi-head self-attention function set in the multi-head self-attention layer to obtain self-attention features; Among them, the neural network model based on the self-attention mechanism includes an encoder and a decoder, the encoder includes multiple encoder layers, each encoder layer includes a first sublayer and a second sublayer, each of the first sublayers is a multi-head self-attention layer, each of the second sublayers is a feedforward fully connected neural network, and each encoding layer encodes the point cloud features in parallel.

9. The three-dimensional target object detection method according to claim 8, characterized in that: The decoder includes multiple decoder layers, each decoder layer includes a first sublayer, a second sublayer and a third sublayer, the first sublayer is a multi-head self-attention layer, the second sublayer is a multi-head attention layer, the third sublayer is a feedforward fully connected neural network, and each decoding layer decodes the self-attention features in parallel.

10. The three-dimensional target object detection method according to claim 1, characterized in that: The step of inputting the first feature data into the feedforward neural network model to obtain the second feature data outputted by the feedforward neural network model comprises: Determine, based on the input first feature data, the center coordinates, length, width, height and angle parameters of the prediction box associated with the first feature data via the feedforward neural network model; Based on the center coordinates, length, width, height and angle parameters of the prediction box, a preset function is used to determine the category label of the three-dimensional target object associated with the prediction box, and the size, position and category label of each prediction box are output; The size, position and category label of each prediction box constitute the second feature data, and the category label includes a special category label indicating that no three-dimensional target object is detected.

11. The three-dimensional target object detection method according to claim 1, characterized in that: The method further comprises: Before the neural network model based on the self-attention mechanism and the feedforward neural network model implement three-dimensional target object detection, the neural network model based on the self-attention mechanism and the feedforward neural network model are trained using three-dimensional point cloud data of known three-dimensional target objects.

12. A three-dimensional target object detection device, characterized in that: include: A feature extraction and position encoding module, for acquiring three-dimensional point cloud data associated with a plurality of three-dimensional target objects, wherein the three-dimensional point cloud data includes a feature point set of N×(d+C), where N represents the number of point cloud data, d represents the coordinate dimension, and C represents the feature dimension, then performing feature extraction on the three-dimensional point cloud data to obtain original feature data, performing position encoding on the three-dimensional point cloud data to obtain position encoding information, and fusing the position encoding information with the original feature data to obtain point cloud features, wherein the original feature data includes a feature point set of N'×(d+C'), where N' represents the number of local regions, d represents the coordinate dimension, C represents the feature dimension, and C' represents a new local feature dimension, where C'>C; A first processing module, for inputting the point cloud features and the position encoding information into the multi-head self-attention layer of the encoder of the neural network model based on the self-attention mechanism to obtain the self-attention features, the point cloud features are used as the input values ​​of the query Q and the key value KV, and the position encoding information is used as the input values ​​of the query Q and the key K; inputting the preset target parameter into the first sublayer of the decoder of the neural network model based on the self-attention mechanism, the preset target parameter is used to limit the number of output second feature data, and the first sublayer of the decoder is a multi-head self-attention layer; inputting the self-attention features, the position encoding information, the features output by the first sublayer and the preset target parameter into the second sublayer of the decoder of the neural network model based on the self-attention mechanism to obtain the first feature data outputted by it, the first feature data is used to represent the features of the target object corresponding to the point cloud data, the self-attention features are used as the input values ​​of the key value KV, the position encoding information is used as the input value of the key K, the features output by the first sublayer and the preset target parameter are used as the input values ​​of the query Q, and the second sublayer of the decoder is a multi-head attention layer; The second processing module is used to input the first feature data into a feedforward neural network model to obtain second feature data outputted by the model, wherein the second feature data indicates attribute information of the plurality of three-dimensional target objects detected.

13. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the program, the steps of the three-dimensional target object detection method according to any one of claims 1 to 11 are implemented.

14. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the three-dimensional target object detection method according to any one of claims 1 to 11 are implemented.