Obstacle detection method, device, computer equipment and storage medium
By using multi-scale segmentation and deep learning network to extract features in LiDAR obstacle detection, the problem of low detection accuracy in the existing technology is solved and higher-precision obstacle detection is achieved.
Patent Information
- Application Number
- CN202011630173.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-12-31
- Publication Date
- 2024-09-20
- Estimated Expiration
- 2040-12-31
AI Technical Summary
Existing lidar obstacle detection algorithms, especially the Voxel-based algorithm, cannot effectively improve detection accuracy because its three-dimensional pattern division of point clouds is too simple, resulting in low detection accuracy.
The point cloud data is segmented using a preset number of segmentation scales of different sizes, the voxel feature vectors of each segmentation scale are extracted, and feature extraction and adjustment are performed through the deep learning network structure to form point cloud features with multi-scale information, and then Project it to a convolutional neural network model for obstacle prediction.
Through multi-scale segmentation and feature extraction, point cloud shape information can be better retained and the precision and accuracy of obstacle detection can be improved.
Smart Images

Figure CN112712089B
Abstract
Description
Technical Field
[0001] The present application relates to the field of artificial intelligence technology, and in particular to an obstacle detection method, device, computer equipment and storage medium. Background Art
[0002] LiDAR has powerful three-dimensional spatial resolution capabilities. For autonomous driving, it is very necessary to use LiDAR to achieve fast and high-precision obstacle detection.
[0003] At present, LiDAR target detection algorithms are mainly divided into two categories: voxel-based and point-based. Point-based algorithms extract point cloud features adaptively through the density and three-dimensional pattern of point clouds, but the amount of calculation is large and the operation time is long, making it difficult to apply in actual environments. Therefore, voxel-based algorithms are usually used for obstacle detection. However, the detection method of voxel-based algorithms is to evenly divide the point cloud into three-dimensional voxels with equal spacing and independently extract feature vectors for each voxel. However, this process only uses voxels of a single size to divide the entire point cloud, which will break the three-dimensional pattern of the point cloud and limit the improvement of detection accuracy.
[0004] Therefore, the current obstacle detection accuracy is low. Summary of the invention
[0005] Based on this, it is necessary to provide an obstacle detection method, device, computer equipment and storage medium that can improve the obstacle detection accuracy in response to the above technical problems.
[0006] An obstacle detection method, the method comprising:
[0007] Obtain the collected point cloud data;
[0008] Segmenting the point cloud data using preset segmentation scales of different sizes to obtain voxels at each segmentation scale;
[0009] Extracting feature vectors of voxels at each segmentation scale to obtain shape features;
[0010] Adjust the size of each shape feature to obtain shape features to be spliced of the same size;
[0011] The shape features to be spliced are combined to obtain point cloud features with multi-scale information;
[0012] Projecting the point cloud features onto a horizontal plane to form a two-dimensional tensor;
[0013] The two-dimensional tensor is input into a convolutional neural network model to predict obstacles and determine prediction results.
[0014] In one embodiment, the predetermined number of segmentation scales with different sizes is determined as follows:
[0015] According to the various types of obstacles and the size ranges corresponding to the various types, segmentation scales with different preset numbers are determined.
[0016] In one embodiment, the step of extracting the feature vectors of the voxels at each segmentation scale to obtain each shape feature includes:
[0017] The voxels of each segmentation scale are input into a corresponding feature extraction network for feature extraction to obtain various shape features.
[0018] In one embodiment, the feature extraction network is a deep learning network structure.
[0019] In one embodiment, the step of adjusting the size of each shape feature to obtain shape features to be spliced of the same size includes:
[0020] The trilinear interpolation method is used to adjust the size of each shape feature to obtain shape features to be spliced with the same size.
[0021] In one embodiment, the step of projecting the point cloud features onto a horizontal plane to form a two-dimensional tensor comprises:
[0022] The reshape function is called to project the point cloud features onto a horizontal plane to form a two-dimensional tensor.
[0023] In one embodiment, the step of inputting the two-dimensional tensor into a convolutional neural network model to predict an obstacle and determining a prediction result comprises:
[0024] Inputting the two-dimensional tensor into the backbone network of the convolutional neural network model for calculation to obtain a calculation result;
[0025] The calculation results are input into the head network of the convolutional neural network model to predict the bounding box and obstacle type, and determine the coordinates of the center point of the obstacle, the length, width and height of the obstacle, the orientation angle of the obstacle and the type of the obstacle.
[0026] An obstacle detection device, comprising:
[0027] A data acquisition module, used to acquire the collected point cloud data;
[0028] A segmentation module, used to segment the point cloud data using a preset number of segmentation scales of different sizes to obtain voxels at each segmentation scale;
[0029] A feature extraction module, used to extract feature vectors of voxels at each segmentation scale to obtain various shape features;
[0030] A shape adjustment module is used to adjust the size of each shape feature to obtain shape features to be spliced that have the same size;
[0031] A splicing module, used for splicing and combining the shape features to be spliced to obtain point cloud features with multi-scale information;
[0032] A projection module, used for projecting the point cloud features onto a horizontal plane to form a two-dimensional tensor;
[0033] The prediction module is used to input the two-dimensional tensor into the convolutional neural network model to predict the obstacle and determine the prediction result.
[0034] A computer device comprises a memory and a processor, wherein the memory stores a computer program, and the processor implements the steps of the method when executing the computer program.
[0035] A computer-readable storage medium stores a computer program, which implements the steps of the method when executed by a processor.
[0036] The above obstacle detection method, device, computer equipment and storage medium obtain the collected point cloud data; segment the point cloud data using a preset number of different segmentation scales to obtain voxels of each segmentation scale; can better retain the point cloud shape information at different scales and provide better point cloud features; extract the feature vectors of the voxels of each segmentation scale to obtain each shape feature; adjust the size of each shape feature to obtain each shape feature to be spliced of the same size; splice and combine each shape feature to be spliced to obtain a point cloud feature with multi-scale information; project the point cloud feature onto a horizontal plane to form a two-dimensional tensor; input the two-dimensional tensor into a convolutional neural network model to predict obstacles and determine the prediction results, thereby improving the obstacle detection accuracy. BRIEF DESCRIPTION OF THE DRAWINGS
[0037] Figure 1 is a schematic diagram of a flow chart of an obstacle detection method in an embodiment;
[0038] Figure 2 A schematic diagram of segmenting point cloud data at different segmentation scales in one embodiment;
[0039] Figure 3 FIG. 4 is a structural block diagram of an obstacle detection device in an embodiment. DETAILED DESCRIPTION
[0040] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0041] In one embodiment, Figure 1 As shown, an obstacle detection method is provided, comprising the following steps:
[0042] Step S220, acquiring the collected point cloud data.
[0043] Among them, point cloud data is a three-dimensional point cloud generated by a laser radar. For example, a 128-line laser radar installed generates a three-dimensional point cloud based on the detection target range. Generally, there are about 120,000 points (laser reflection points), covering a range of 50 meters in front, behind, left and right, and the height is generally between -5 and 3 meters.
[0044] Step S240 , segmenting the point cloud data using preset segmentation scales of different sizes to obtain voxels at each segmentation scale.
[0045] Among them, the segmentation scale is the scale used to divide the point cloud data. The size of the segmentation scale can be expressed as (x i ,y i , z i ), where i is the scale number, x is the length, y is the width, and z is the height. Voxel is the abbreviation of volume pixel. By analogy with pixel, voxel is a three-dimensional concept, while pixel is a two-dimensional concept. The voxels of each segmentation scale refer to that each segmentation scale segments the point cloud data to obtain the voxels segmented at each segmentation scale. For example, if the length of the point cloud data is l, the width is w, and the height is h, then the number of voxels divided at each segmentation scale is l / x. i , w / y i , h / z i .
[0046] In one embodiment, the method for determining the preset number of segmentation scales of different sizes is: according to the various types of obstacles and the size ranges corresponding to the various types, the preset number of segmentation scales of different sizes are determined. For example, the obstacles to be predicted include people, cars and buses. The length, width and height of a person are generally (0.73, 0.67, 1.77) meters, with an average value of 1 meter; the length, width and height of a car are (4.63, 1.97, 1.74) meters, with an average value of 2.78 meters; the length, width and height of a bus are (10.5, 2.94, 3.47) meters, with an average value of 5.63 meters. The designer can set the number of segmentation scales that he wants to predict based on his own experience. How many parts are cut into each direction of the length, width and height of the obstacle? For example, a designer believes that the voxels obtained by roughly cutting the length, width and height into 10 parts according to the average value are sufficient to express the shape of the obstacle. Then the designer can choose 0.1 meter, 0.278 meter, and 0.563 meter as the segmentation scales to divide the point cloud according to the average values of the above three obstacles. These three scales are the selected segmentation scales. In the above example, the size span of the three obstacles is relatively large, so they are divided into 3 scales. If the predicted obstacle sizes are not so different, fewer scales can be divided.
[0047] Step S260: extracting feature vectors of voxels at each segmentation scale to obtain shape features.
[0048] In one embodiment, the step of extracting feature vectors of voxels at each segmentation scale to obtain each shape feature includes: inputting the voxels at each segmentation scale into a corresponding feature extraction network to perform feature extraction to obtain each shape feature.
[0049] Among them, a feature extraction network is trained for each voxel of each segmentation scale to extract the feature vector of the voxel of the corresponding segmentation scale. The points in the voxel of each segmentation scale are passed into the corresponding feature extraction network to extract the shape features and obtain different feature vectors, which are expressed as (C i , l / x i , w / y i , h / z i ), where C i is the dimension of the feature vector. The feature extraction network is a deep learning network structure, that is, after each point in the voxel passes through the fully connected network, the shape feature of the entire voxel is obtained using maxpooling (pooling operation).
[0050] Step S280, adjusting the size of each shape feature to obtain shape features to be spliced that have the same size.
[0051] Among them, at least one of the length, width, height and number of each shape feature is different. Therefore, in order to be able to splice, it is necessary to adjust the shape features to the same length, width, height and number to facilitate the subsequent splicing. Figure 2 As shown in the figure, the point cloud data is segmented using three different segmentation scales. The Rubik's Cube-like object represents the entire point cloud data. The segmentation scale used in segmentation scale 1 is relatively large, and the length, width and height of the point cloud data are each cut into two parts, such as Figure 2 The segmentation result of segmentation scale 1 in ; segmentation scale 2, the length, width and height of the point cloud data are divided into 3 parts, such as Figure 2 The segmentation result of the segmentation scale 2 in ; the segmentation scale 3 divides the length, width and height of the point cloud data into 4 parts, such as Figure 2 The segmentation scale 3 segmentation result in , generally each voxel will be extracted into a feature vector consisting of 64 numbers, so Figure 2 The characteristic shapes of the three segmentation scales are (64, 2, 2, 2), (64, 3, 3, 3) and (64, 4, 4, 4) respectively. Therefore, it is necessary to use the trilinear interpolation method to adjust the characteristic shapes of the three segmentation scales to the shape features of (64, 4, 4, 4). After the characteristic shapes of the three segmentation scales are adjusted, they are the shape features of the same size to be spliced.
[0052] In one embodiment, the step of adjusting the size of each shape feature to obtain shape features to be spliced of the same size includes:
[0053] The size of each shape feature is adjusted by trilinear interpolation to obtain shape features of the same size to be spliced. The shape features of the same size to be spliced can be expressed as (C i , l0, w0, h0), where l0 is the length of the shape feature to be spliced, w0 is the width of the shape feature to be spliced, and h0 is the height of the shape feature to be spliced.
[0054] Among them, the trilinear interpolation method is a method of performing linear interpolation on the tensor product grid of three-dimensional discrete sampling data.
[0055] Step S300: Combine and splice the shape features to be spliced to obtain point cloud features with multi-scale information.
[0056] Among them, the shape features to be spliced are combined to obtain the point cloud feature f with multi-scale information. The shape is expressed as (C1+C2+ ... +C n , l0, w0, h0), C1+C2+ ... +C n Recorded as C, the point cloud feature f obtained in this step has a shape of (C, l0, w0, h0).
[0057] Step S320, projecting the point cloud features onto a horizontal plane to form a two-dimensional tensor.
[0058] In one embodiment, the step of projecting the point cloud features onto a horizontal plane to form a two-dimensional tensor includes: calling a reshape function to project the point cloud features onto a horizontal plane to form a two-dimensional tensor.
[0059] Among them, the point cloud feature f has a shape of (C, l0, w0, h0). It is necessary to project f onto the horizontal plane. The projection operation can use the reshape operation to transform it into a feature f' with a shape of (C*l0, w0, h0), that is, a two-dimensional tensor. The reshape function is a function that transforms a specified matrix into a matrix of a specific dimension.
[0060] Step S340: input the two-dimensional tensor into the convolutional neural network model to predict the obstacle and determine the prediction result.
[0061] In one embodiment, a two-dimensional tensor is input into a convolutional neural network model to predict an obstacle, and the step of determining a prediction result includes: inputting the two-dimensional tensor into a backbone network of the convolutional neural network model for calculation to obtain a calculation result; inputting the calculation result into a head network of the convolutional neural network model to predict a bounding box and an obstacle type, and determining the coordinates of the center point of the obstacle, the length, width, and height of the obstacle, the orientation angle of the obstacle, and the type of the obstacle.
[0062] Among them, the structure of the convolutional neural network model is divided into two parts: the backbone network and the head network. The backbone network has a total of 16 convolutional layers, which are divided into 3 stages. The number of convolutional layers in each stage is 4, 6 and 6 respectively. The first convolutional layer in each stage is downsampled. The number of convolutional layer channels in the three stages is 64, 128 and 256 respectively. The output (i.e., the calculation result) calculated by the backbone network is used as the input of the head network. The head network is divided into two branches. The first branch is used to predict the bounding box, which specifically includes the coordinates of the center point of the obstacle, the length, width and height of the obstacle, and the orientation angle of the obstacle. The second branch is used to predict the type of obstacle. The output of the two branches is the prediction result, which includes the coordinates of the center point of the obstacle, the length, width and height of the obstacle, the orientation angle of the obstacle and the type of obstacle. The types of obstacles include: pedestrians, bicycles, cars, or buses.
[0063] The above obstacle detection method obtains the collected point cloud data; segments the point cloud data using a preset number of different segmentation scales to obtain voxels of each segmentation scale; can better retain the point cloud shape information at different scales and provide better point cloud features; extracts the feature vectors of the voxels of each segmentation scale to obtain each shape feature; adjusts the size of each shape feature to obtain each shape feature to be spliced of the same size; splices and combines each shape feature to be spliced to obtain a point cloud feature with multi-scale information; projects the point cloud feature onto a horizontal plane to form a two-dimensional tensor; inputs the two-dimensional tensor into a convolutional neural network model to predict obstacles, determines the prediction result, and improves the obstacle detection accuracy.
[0064] It should be understood that although Figure 1 The steps in the flowchart are shown in sequence as indicated by the arrows, but these steps are not necessarily executed in the order indicated by the arrows. Unless otherwise specified in this document, there is no strict order restriction for the execution of these steps, and these steps can be executed in other orders. Moreover, Figure 1 At least part of the steps may include multiple sub-steps or multiple stages. These sub-steps or stages are not necessarily executed at the same time, but can be executed at different times. The execution order of these sub-steps or stages is not necessarily sequential, but can be executed in turn or alternately with other steps or at least part of the sub-steps or stages of other steps.
[0065] In one embodiment, Figure 3 As shown, an obstacle detection device is provided, including: a data acquisition module 310, a segmentation module 320, a feature extraction module 330, a shape adjustment module 340, a splicing module 350, a projection module 360 and a prediction module 370.
[0066] The data acquisition module 310 is used to acquire the collected point cloud data.
[0067] The segmentation module 320 is used to segment the point cloud data using a preset number of segmentation scales of different sizes to obtain voxels at each segmentation scale.
[0068] The feature extraction module 330 is used to extract the feature vectors of the voxels at each segmentation scale to obtain various shape features.
[0069] The shape adjustment module 340 is used to adjust the size of each shape feature to obtain shape features to be spliced that have the same size.
[0070] The splicing module 350 is used to splice and combine the shape features to be spliced to obtain point cloud features with multi-scale information.
[0071] The projection module 360 is used to project the point cloud features onto a horizontal plane to form a two-dimensional tensor.
[0072] The prediction module 370 is used to input the two-dimensional tensor into the convolutional neural network model to predict obstacles and determine the prediction results.
[0073] In one embodiment, the method for determining the preset number of segmentation scales of different sizes is:
[0074] According to the various types of obstacles and the size ranges corresponding to the various types, segmentation scales with different preset numbers are determined.
[0075] In one embodiment, the feature extraction module 330 is further used to: input the voxels of each segmentation scale into the corresponding feature extraction network for feature extraction to obtain various shape features.
[0076] In one embodiment, the feature extraction network is a deep learning network structure.
[0077] In one embodiment, the shape adjustment module 340 is further used to: use trilinear interpolation to adjust the size of each shape feature to obtain shape features to be spliced that have the same size.
[0078] In one embodiment, the projection module 360 is further used to call a reshape function to project the point cloud features onto a horizontal plane to form a two-dimensional tensor.
[0079] In one embodiment, the prediction module 370 is also used to: input the two-dimensional tensor into the backbone network of the convolutional neural network model for calculation to obtain the calculation result; input the calculation result into the head network of the convolutional neural network model to predict the bounding box and obstacle type, and determine the center point coordinates of the obstacle, the length, width and height of the obstacle, the orientation angle of the obstacle and the type of obstacle.
[0080] For the specific definition of the obstacle detection device, please refer to the definition of the obstacle detection method above, which will not be repeated here. Each module in the above obstacle detection device can be implemented in whole or in part by software, hardware and a combination thereof. The above modules can be embedded in or independent of the processor in the computer device in the form of hardware, or can be stored in the memory of the computer device in the form of software, so that the processor can call and execute the operations corresponding to the above modules.
[0081] In one embodiment, a computer device is provided, including a memory and a processor, wherein the memory stores a computer program, and the processor implements the steps of the above obstacle detection method when executing the computer program.
[0082] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the steps of the above obstacle detection method are implemented.
[0083] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided in this application can include non-volatile and / or volatile memory. Non-volatile memory may include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory may include random access memory (RAM) or external cache memory. As an illustration and not limitation, RAM is available in many forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).
[0084] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0085] The above-mentioned embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the invention patent. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the patent of the present application shall be subject to the attached claims.
Claims
1. An obstacle detection method, characterized in that: The method comprises: Obtain the collected point cloud data; The point cloud data is segmented using a preset number of segmentation scales of different sizes to obtain voxels of each segmentation scale, wherein the preset number of segmentation scales of different sizes is determined by: determining the preset number of segmentation scales of different sizes according to various types of obstacles and size ranges corresponding to the various types; Extracting feature vectors of voxels at each segmentation scale to obtain shape features; Adjust the size of each shape feature to obtain shape features to be spliced of the same size; The shape features to be spliced are combined to obtain point cloud features with multi-scale information; Projecting the point cloud features onto a horizontal plane to form a two-dimensional tensor; Inputting the two-dimensional tensor into a convolutional neural network model to predict obstacles and determine prediction results; The step of extracting the feature vectors of the voxels at each segmentation scale to obtain each shape feature comprises: Inputting the voxels of each segmentation scale into a corresponding feature extraction network for feature extraction to obtain various shape features, wherein the feature extraction network is a deep learning network structure; The step of adjusting the size of each shape feature to obtain shape features to be spliced of the same size includes: The trilinear interpolation method is used to adjust the size of each shape feature to obtain shape features to be spliced with the same size.
2. The method according to claim 1, characterized in that The step of projecting the point cloud features onto a horizontal plane to form a two-dimensional tensor comprises: The reshape function is called to project the point cloud features onto a horizontal plane to form a two-dimensional tensor.
3. The method according to claim 1, characterized in that: The step of inputting the two-dimensional tensor into the convolutional neural network model to predict obstacles and determining the prediction results includes: Inputting the two-dimensional tensor into the backbone network of the convolutional neural network model for calculation to obtain a calculation result; The calculation results are input into the head network of the convolutional neural network model to predict the bounding box and obstacle type, and determine the coordinates of the center point of the obstacle, the length, width and height of the obstacle, the orientation angle of the obstacle and the type of the obstacle.
4. An obstacle detection device, characterized in that: The device comprises: A data acquisition module, used to acquire the collected point cloud data; A segmentation module is used to segment the point cloud data using segmentation scales of different preset numbers to obtain voxels of each segmentation scale, wherein the segmentation scales of different preset numbers are determined by: determining the segmentation scales of different preset numbers according to various types of obstacles and size ranges corresponding to the various types; A feature extraction module, used to extract feature vectors of voxels at each segmentation scale to obtain various shape features; A shape adjustment module is used to adjust the size of each shape feature to obtain shape features to be spliced that have the same size; A splicing module, used for splicing and combining the shape features to be spliced to obtain point cloud features with multi-scale information; A projection module, used for projecting the point cloud features onto a horizontal plane to form a two-dimensional tensor; A prediction module, used for inputting the two-dimensional tensor into a convolutional neural network model to predict obstacles and determine a prediction result; The feature extraction module is also used to: input the voxels of each segmentation scale into the corresponding feature extraction network for feature extraction to obtain various shape features, wherein the feature extraction network is a deep learning network structure; The shape adjustment module is also used to: use trilinear interpolation to adjust the size of each shape feature to obtain shape features to be spliced that have the same size.
5. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 3 are implemented.
6. A 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 method according to any one of claims 1 to 3 are implemented.
