Multi-scale segmentation method of automobile parts point cloud based on multi-layer attention mechanism

Through the combination of multi-layer attention mechanism and multi-source camera, the problem of low computational complexity and low robustness in automobile parts point cloud segmentation is solved, and efficient and accurate automobile part point cloud segmentation is achieved, adapting to different collection equipment and environment.

CN118429650BInactive Publication Date: 2024-08-30JILIN UNIVERSITY
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202410890311.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-07-04
Publication Date
2024-08-30
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

Existing automobile parts point cloud segmentation methods cannot handle multi-source point cloud data, have high computational complexity, low robustness and efficiency, and are difficult to adapt to differences in data characteristics under different collection equipment and environments.

Method used

A multi-layer attention mechanism is used to collect vehicle body point cloud data in combination with lidar, depth cameras and color cameras. The computational complexity is reduced through super-point algorithm and importance sampling. Features are extracted using an improved attention mechanism and the offset attention mechanism is used. Fusion of multi-scale features enables efficient segmentation of automobile parts point clouds.

Benefits of technology

It improves the accuracy and robustness of point cloud segmentation of automobile parts, enhances the ability to process some missing data, improves detection efficiency and safety, and has strong adaptability.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118429650B
    Figure CN118429650B
Patent Text Reader

Abstract

The present invention provides a multi-scale segmentation method for automobile parts point cloud based on a multi-layer attention mechanism, which adopts a laser radar, two depth cameras, and a color camera. The method includes: collecting complete body point clouds from different sources of the vehicle to be inspected to construct a data set, preprocessing the collected complete body point cloud, extracting multi-scale features from the filtered body point cloud, fusing multi-scale features on the body parts point cloud, performing maximum pooling operation and LBRD layer processing on the body parts point cloud, establishing a corresponding Gaussian distribution with a representative point set of the body parts point cloud as a Gaussian basis, upsampling the representative point set using a Gaussian sputtering method, correctly segmenting all points on the body point cloud and outputting the results, etc. The present invention can process automobile point cloud data more intelligently and better capture key feature information, thereby having a beneficial effect on the wide application of point cloud technology in the field of automobile detection and the accurate measurement of automobile size parameters.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to an automobile detection method, and in particular to a multi-scale segmentation method of automobile parts point cloud based on a multi-layer attention mechanism. Background Art

[0002] With the rapid development of 3D point cloud acquisition and processing technology, 3D point clouds have been widely used in the fields of automobile design, manufacturing and inspection. By accurately locating and segmenting the point cloud data of automobile parts, 3D reconstruction and defect detection of automobile parts can be achieved, which helps to improve the efficiency and accuracy of the automobile inspection process and ensure the safety of automobile driving. Traditional point cloud segmentation methods for automobile parts are usually limited to fixed-source data sets during training, extracting and learning features at fixed scales, while different automobile point cloud data sets have different spatial scales and distribution characteristics. Existing methods cannot achieve unified input of multi-source point clouds into the model for unified training and prediction. At the same time, when collecting automobile point clouds, due to problems such as acquisition equipment and acquisition environment, there may be point cloud missing, which will have a certain impact on the accuracy of automobile part point cloud segmentation. In addition, the collected body point cloud usually contains a very large number of points, which will lead to high computational complexity during segmentation, affecting the efficiency of automobile inspection. In order to achieve high-precision and high-efficiency inspection under multi-source acquisition equipment without being affected by the point cloud acquisition equipment during the automobile inspection process, it is necessary to provide an automobile parts point cloud segmentation method that solves the problems existing in the automobile parts point cloud segmentation method, such as single training set source, weak robustness, and low computational efficiency, so as to achieve high adaptability, strong robustness, and high efficiency for automobile parts point cloud segmentation. Summary of the invention

[0003] In order to solve the above technical problems, the present invention provides a multi-scale segmentation method of automobile parts point cloud based on a multi-layer attention mechanism, using at least one laser radar, two depth cameras, and one color camera. The two depth cameras are placed opposite to each other at shooting positions on both sides of the detection line, the laser radar is placed directly in front of the detection line, and the color camera is placed at a shooting position on one side of the detection line.

[0004] The depth camera is a three-dimensional camera with a depth measurement function.

[0005] The method comprises the following steps:

[0006] Step 1: Collect the complete body point cloud of the vehicle to be inspected from different sources to build a dataset.

[0007] The color camera obtains the complete body point cloud S of the vehicle to be inspected C (X), the depth camera obtains the complete body point cloud S of the vehicle to be inspected D (X), the laser radar obtains the complete body point cloud S of the vehicle to be inspectedL (X), X is a point in the car body point cloud.

[0008] As a preferred method, after receiving the start acquisition signal, the color camera is firstly moved around the vehicle to be inspected to collect images of the vehicle to be inspected at different viewing angles; for the images at different viewing angles, the Gaussian difference Gaussian pyramid is used to detect the local feature points of the image, and then the pixel sums in the horizontal and vertical directions of the local feature points on the image are weighted summed to obtain its regional wavelet features. Specifically, for a region of size w×w on each image, its regional wavelet features H w,x,y Calculated by the following formula:

[0009] ;in, gr ( x , y ) represents the pixel point on each image ( x , y ), w The window size representing the feature is the size of the corresponding image area. i and j Respectively represent the pixel coordinate offset within the window.

[0010] The descriptor of the local feature point is obtained by applying regional wavelet feature calculation to the area around the local feature point, and then the local feature point descriptor is matched with the adjacent frame photos of the vehicle to be inspected using the nearest neighbor matching method; the position and posture of the color camera at different time points are calculated using the PnP algorithm based on the matched local feature points and the spatial geometric constraints between adjacent frames; for the matched feature point pairs, their three-dimensional coordinates are calculated using triangulation technology, and the three-dimensional point sets of the vehicle to be inspected from different perspectives are fused into a point cloud model based on the three-dimensional coordinates of the matching points on each image to represent the reconstructed three-dimensional body shape; according to the above steps, the complete body point cloud S of the vehicle to be inspected acquired by the color camera is obtained. C (X), X is a point in the car body point cloud.

[0011] Next, the driver drives the vehicle to be inspected from the starting point of the inspection line at a constant speed of 3-4 km / h and passes through the inspection line. After the vehicle to be inspected passes the inspection line, the two depth cameras in the inspection system use the ICP method to register the point cloud to obtain the complete body point cloud S of the vehicle to be inspected obtained by the depth camera. D (X), the complete body point cloud of the vehicle to be inspected obtained by the laser radar is S L (X).

[0012] Step 2: Preprocess the collected complete vehicle body point cloud.

[0013] The complete body point cloud of the vehicle to be inspected obtained in the first step is subjected to noise reduction processing to obtain clean LiDAR point cloud data suitable for subsequent processing. , color camera point cloud data and depth camera point cloud data .

[0014] As a preferred method, the complete body point cloud S of the vehicle to be inspected obtained by the laser radar L (X) as an example, for S L Every point X in (X) i , use the KNN algorithm to find its neighborhood point set M, assuming that the neighborhood point set M includes n points, calculate the average position of the neighborhood points m i and standard deviation s i :

[0015]

[0016]

[0017] Among them, X j It's point X i A point in the neighborhood point set.

[0018] Then use the Z-score method to determine point X i Is it a noise point? , then X i is regarded as a noise point, where k It is a threshold parameter, usually between 1.0 and 2.0.

[0019] The above filtering operation removes the noise points in the complete body point cloud of the vehicle to be inspected, and obtains cleaner point cloud data suitable for subsequent processing. , the point cloud data collected by the color camera and the depth camera after filtering is obtained by the same method: , .

[0020] Step 3: Extract multi-scale features from the filtered car body point cloud.

[0021] The filtered body point cloud obtained in the second step , and The input is fed into the feature extraction network, which includes three feature extraction modules of different scales. The three feature extraction modules receive multi-source point clouds simultaneously. , and The body parts feature extraction is also performed. In each feature extraction module, there are two key operations: body point cloud downsampling based on super-point algorithm and importance sampling, and feature extraction based on improved attention mechanism.

[0022] (1) Car body point cloud downsampling based on super-point algorithm and importance sampling.

[0023] In order to reduce the computational complexity while retaining the key point information, the super point algorithm and importance sampling are used in the downsampling process to achieve the point cloud of the vehicle body obtained by the laser radar after filtering. For example, Use superpixel segmentation algorithm to divide these points into m super points, which represent the local features in the car body point cloud and serve as the initial candidate points for downsampling; for each super point P i , update the super points according to their importance, and define the loss function L(P) as:

[0024] ;in, n is the number of points in the body point cloud, X j It is j Points, oh ij It's point X j Superpoint P i The weight of d (P i X j ) represents point X j To Super Point P i The Euclidean distance is calculated and the gradient descent method is used to adjust the super point position to minimize the loss function.

[0025] After completing the superpoint update, according to the final superpoint position and their k Points in the neighborhood are used to extract a representative point set ,This step ensures that the key information in the body point cloud is retained while reducing the data scale of the body point cloud, ,providing efficient data representation for subsequent processing.

[0026] (2) Feature extraction based on improved attention mechanism.

[0027] In order to better extract the features of the body parts point cloud, the improved attention mechanism is used to extract and learn the representative point set obtained in the previous step. The local semantic features of the body parts point cloud and the global feature connections between them; first, the representative point set after downsampling Use graph convolutional neural network to obtain the global feature vector F between all sampling points of the current feature extraction module and the corresponding part classification global Next, the representative point set The input is fed into the local attention feature extraction unit and the local feature extraction unit to respectively learn the local attention features and local features of the local point cloud in the representative point set at different scales.

[0028] The local attention feature extraction unit of the body part point cloud adds the attention mechanism in the learning process. When calculating the feature representation of the body part point cloud, it can dynamically adjust the degree of attention to the point, so as to better capture the important information in the body part point cloud data. The formula is as follows:

[0029]

[0030]

[0031] in, is the representative point set of the car body point cloud, F att is the attention function, A is the calculated attention weight, g is the feature mapping function, f a-local It is the local attention feature representation of the body part point cloud obtained by weighting the attention weight.

[0032] The local feature extraction unit of the body part point cloud captures the feature information of the local area in the body point cloud data by using nonlinear convolution operation in the local area of ​​the body part point cloud, which helps to identify the features such as the local shape or texture of the body part point cloud. The formula is as follows:

[0033]

[0034] in, , are different single-layer nonlinear convolutions, It is a multi-layer nonlinear convolution. f local It is the local feature representation of the point cloud of the car body parts.

[0035] Representing the local attention features of the body parts point cloud f a-local And local feature representation of body parts point cloud f local Add together to get the local feature vector F of the body part point cloud local :

[0036]

[0037] in, Represents a sum operation.

[0038] Local feature vector F of body part point cloud local and the global eigenvector Fglobal By splicing in the feature dimension, we can obtain the joint feature representation F of the body parts point cloud collected by the LiDAR. u L Similarly, the joint feature representation F of the body parts point cloud collected by the depth camera is obtained u D And the joint feature representation of the body parts point cloud collected by the color camera F u C .

[0039] Step 4: Multi-scale feature fusion of body parts point cloud.

[0040] The joint feature representations of the body parts point clouds at three scales extracted in the third step are output separately and sent to the feature fusion module. The semantic similarity between the point cloud features of body parts at different scales is calculated through the offset attention mechanism to realize semantic modeling. The attention layer redistributes the credibility weight by fusing the feature layer of multi-layer feature and multi-dimensional information, suppresses some interference information in features of different scales, and highlights more effective hierarchical structure features.

[0041] Joint feature representation of body parts point clouds from three sources u L 、F u D 、F u C First, an offset network is used to calculate the position offset in the feature space. Taking the point cloud of the body parts collected by the LiDAR as an example, the position offset O L It is expressed by the following formula:

[0042]

[0043] Among them, OffsetNet is an offset network. Similarly, the position offset of the body part point cloud collected by the depth camera is obtained. O D And the position offset of the body parts point cloud collected by the color camera O C .

[0044] Use the resulting position offset O L , O D , O C For feature F u L 、F u D 、F u C Perform position adjustment to obtain the joint features adjusted by the position offset network , , , the adjustment process is expressed as:

[0045]

[0046]

[0047]

[0048] Next, the similarity between the adjusted features is used to calculate the semantic similarity of the body part point clouds at different scales. , For example, the formula for calculating similarity through inner product operation is as follows:

[0049]

[0050] in, Score (LD) represents the similarity score between the point cloud features of the body parts at the lidar acquisition scale and the point cloud features of the body parts at the depth camera acquisition scale, and T represents the transpose operation.

[0051] Through the Softmax operation, the weight of each scale feature is calculated according to the semantic similarity as follows, taking the weight of the scale feature of the body point cloud collected by the radar to the scale feature of the body point cloud collected by the depth camera as an example:

[0052]

[0053] in, α LD is the attention weight of the body point cloud scale features collected by the radar to the body point cloud scale features collected by the depth camera, e is a natural constant, Score(LD) represents the similarity score between the point cloud features of the body parts at the radar acquisition scale and the point cloud features of the body parts at the depth camera acquisition scale, and Score(LC) represents the similarity score between the point cloud features of the body parts at the radar acquisition scale and the point cloud features of the body parts at the color camera acquisition scale.

[0054] By redistributing the weights, the point cloud features of body parts of different scales are linearly combined to obtain the redistributed point cloud feature representation of the body parts: ;in, It is the redistributed representation of the point cloud features of the body parts at the laser radar acquisition scale. α LD , α LCare the attention weights of the body point cloud scale features collected by the lidar to the body point cloud scale features collected by the depth camera and the color camera, , , It is the joint feature adjusted by the position offset network. Similarly, the point cloud feature of the body parts under the depth camera acquisition scale is represented after redistribution And the representation of the body parts point cloud features after redistribution at the depth camera acquisition scale .

[0055] The feature representation of the body parts point cloud at the three scales after redistribution is summed to obtain the final feature fusion representation: ;in, It is the fused feature representation of the body parts point cloud.

[0056] Step 5: Perform maximum pooling operation and LBRD layer processing on the body part point cloud.

[0057] First, the fusion feature representation of the body parts point cloud obtained in the fourth step Input into the pooling layer for maximum pooling operation to extract representative features ; Then the features extracted by the maximum pooling operation are input into the LBRD layer, which combines linear transformation, batch normalization, ReLU activation function and Dropout operation. Through linear transformation, the point cloud features of the body parts after maximum pooling are mapped to a high-dimensional space. The weight matrix of the linear transformation is W, and the operation of the linear transformation is expressed as: ;in, is the point cloud feature of the car body parts after linear transformation, is the point cloud feature of the body parts extracted by the maximum pooling operation, b is the bias term.

[0058] After obtaining the linearly transformed body part point cloud features, pass them to the batch normalization layer and then apply the ReLU activation function:

[0059]

[0060]

[0061] Among them, BatchNorm represents the batch normalization operation, Relu is the activation function, It is the point cloud feature of the body parts output after batch standardization. It is the point cloud feature of the body parts output by the Relu activation function.

[0062] In order to reduce the risk of overfitting, the Dropout operation is used. p=0.5 probability to randomly discard the output of some neurons and obtain the final output feature representation: ; Among them, Dropout means random dropping operation, It is the feature representation of the final body part point cloud.

[0063] One-hot encoding is used to encode the point cloud features of each type of body parts, and the semantic label, i.e., the part category, of the representative point set of the body part point cloud input into the network is obtained.

[0064] Step 6: Establish the corresponding Gaussian distribution using the representative point set of the body part point cloud as the Gaussian basis element.

[0065] The points in the representative point cloud of the body parts are taken as 3D Gaussian primitives. For each 3D Gaussian primitive, together with its k The points in the neighborhood are represented by a matrix M, and the matrix M is expressed as:

[0066] , where x j ,y j and z j Respectively represent j The coordinates of the neighborhood points, k is the total number of points in the k-neighborhood of the representative point, and then the covariance matrix Ω is calculated by the following formula: , where k is the total number of points in the k-neighborhood of the representative point and T is the transpose operation.

[0067] Perform eigenvalue decomposition on the covariance matrix Ω, select the direction corresponding to the eigenvector with the smallest eigenvalue as the normal vector of the point, and correspond it to the semantic label assigned to each representative point calculated in the fifth step, so as to give geometric information to each point; then each Gaussian distribution G(p) is expressed as: , where p is a point in the representative point set of the body part point cloud, Ω is the covariance matrix, T is the transpose operation, and e is a natural constant.

[0068] Step 7: Use Gaussian sputtering method to upsample the representative point set.

[0069] When the points in the representative point set are used as 3D Gaussian primitives and the corresponding 3D Gaussian distribution is established, the upsampling operation is started using the Gaussian sputtering method to expand the number of points in the Gaussian primitive field and form complete vehicle body point cloud data. With the emergence of new data points, the parameters of each Gaussian distribution are continuously updated.

[0070] The weighted average is performed based on the distance between the newly added points in the Gaussian basis element neighborhood and the initial Gaussian distribution. This ensures that the center position of the Gaussian distribution is appropriately adjusted with the introduction of new data points. The mean is updated as follows:

[0071]

[0072] in, is the updated mean, oh j is the weight value obtained after weighted averaging, e is a natural constant, dis(p i ,p j ) is point p i and p j The distance between.

[0073] During upsampling, the Gaussian semantic tracking method is used to continuously track each Gaussian distribution to adapt to its changing part type and number of points. Before upsampling begins, the module records the categories and positions of all Gaussian primitives, and updates these primitives during the sampling process to reflect the current state of the Gaussian primitives during each upsampling process. The MSE loss between the initial state and the current state of the Gaussian primitive is used to ensure that the upsampling does not deviate too much from the respective primitives. The loss function φ MSE The definition is as follows:

[0074]

[0075] in, N is the total number of Gaussian primitives, G init (p) is the representation of the initial state of the Gaussian basis, G curr (p) is a representation of the current state of the Gaussian primitive, and p is a point in the Gaussian primitive.

[0076] Step 8: Correctly segment all points on the car body point cloud and output the results.

[0077] After each upsampling operation, a multilayer perceptron is used to infer the part category to which each point belongs, and the category with the highest probability is selected as the segmentation result of each point. Thus, the segmentation result of the complete car body point cloud is obtained, on which each point is correctly segmented into the corresponding part category.

[0078] Beneficial effects of the present invention:

[0079] 1. The present invention can better capture the semantic features related to auto parts and the relative relationship between them by dividing the network model into layers, with each layer processing the auto parts point cloud features of different spatial scales. This hierarchical structure can enable the model to more effectively understand the information in the auto parts point cloud, thereby improving the accuracy and robustness of the auto parts point cloud segmentation.

[0080] 2. The present invention introduces an attention mechanism to focus on the complete area and fill in the local incomplete area when processing the point cloud data of automobile parts. This mechanism enables the present invention to process automobile point cloud data more intelligently, thereby improving the processing capability of partially missing automobile part point clouds.

[0081] 3. The present invention applies the super-point algorithm to extract key points with significant features, and uses the importance evaluation method to select more representative points. This method effectively improves the representativeness of the downsampling results, so that the model can better capture key feature information. The present invention ensures the driving safety of automobiles, and has a beneficial effect on the wide application of point cloud technology in the field of automobile inspection and the accurate measurement of automobile size parameters. BRIEF DESCRIPTION OF THE DRAWINGS

[0082] Figure 1 It is a schematic diagram of the overall process of the method of the present invention.

[0083] Figure 2 Schematic diagram of the arrangement of the camera and the radar in the method of the present invention.

[0084] 1. Depth camera 2. LiDAR 3. Color camera 4. Vehicle to be inspected DETAILED DESCRIPTION

[0085] See also Figure 1 , 2 As shown, the present invention provides a multi-scale segmentation method for automobile parts point cloud based on a multi-layer attention mechanism, wherein two depth cameras 1 are placed opposite to each other at the shooting positions on both sides of the detection line, a laser radar 2 is placed in front of the detection line, and a color camera 3 is placed at the shooting position on one side of the detection line. The depth camera 1 is a three-dimensional camera with a depth measurement function, and the depth camera 1, the laser radar 2 and the color camera 3 are all existing equipment.

[0086] The method comprises the following steps:

[0087] Step 1: Collect the complete body point cloud of the vehicle to be inspected from 4 different sources to build a dataset.

[0088] After receiving the start acquisition signal, the color camera 3 is first moved around the vehicle 4 to collect images of the vehicle 4 under different viewing angles. For the images under different viewing angles, the Gaussian difference Gaussian pyramid is used to detect the local feature points of the image. Then, for a region of size w×w on each image, its regional wavelet feature is calculated by the following formula:

[0089]

[0090] in, gr ( x ,y ) represents the pixel point on each image ( x , y ), w The window size representing the feature is the size of the corresponding image area. i and j Respectively represent the pixel coordinate offset within the window.

[0091] The descriptor of the local feature point is obtained by applying regional wavelet feature calculation to the area around the local feature point, and then the local feature point descriptor is matched with the adjacent frame photos of the vehicle to be inspected 4 using the nearest neighbor matching method; the position and posture of the color camera 3 at different time points are calculated using the PnP algorithm according to the matched local feature points and the spatial geometric constraints between adjacent frames; for the matched feature point pairs, their three-dimensional coordinates are calculated using the triangulation technology, and the three-dimensional point sets of the vehicle to be inspected 4 from different perspectives are fused into a point cloud model according to the three-dimensional coordinates of the matching points on each image to represent the reconstructed three-dimensional body shape; according to the above steps, the complete body point cloud S of the vehicle to be inspected 4 acquired by the color camera 3 is obtained. C (X), X is a point in the car body point cloud.

[0092] Next, the driver drives the vehicle 4 to be inspected from the starting point of the inspection line at a constant speed of 3-4 km / h and passes through the inspection line. After the vehicle 4 to be inspected passes through the inspection line, the two depth cameras 1 in the inspection system register the point clouds using the ICP method to obtain the complete body point cloud S of the vehicle 4 to be inspected obtained by the depth camera. D (X), the complete body point cloud of the vehicle 4 to be inspected obtained by the laser radar 2 is S L (X).

[0093] Step 2: Preprocess the collected complete vehicle body point cloud.

[0094] The complete body point cloud of the vehicle to be inspected 4 obtained in the first step is subjected to noise reduction processing, and the complete body point cloud S of the vehicle to be inspected 4 obtained by the laser radar 2 is used. L (X) as an example, for S L Every point X in (X) i , use the KNN algorithm to find its neighborhood point set M, assuming that the neighborhood point set M includes n points, calculate the average position of the neighborhood points m i and standard deviation s i :

[0095]

[0096]

[0097] Among them, X j It's point X i A point in the neighborhood point set.

[0098] Then use the Z-score method to determine point X i Is it a noise point? , then X i is regarded as a noise point, where k It is a threshold parameter, usually between 1.0 and 2.0.

[0099] The above filtering operation removes the noise points in the complete body point cloud of the vehicle to be inspected 4, and obtains cleaner point cloud data suitable for subsequent processing. , the point cloud data collected by color camera 3 and depth camera 1 after filtering is obtained by the same method: , .

[0100] Step 3: Extract multi-scale features from the filtered car body point cloud.

[0101] The filtered body point cloud obtained in the second step , and The input is fed into the feature extraction network, which includes three feature extraction modules of different scales. The three feature extraction modules receive multi-source point clouds simultaneously. , and The body parts feature extraction is also performed. In each feature extraction module, there are two key operations: body point cloud downsampling based on super-point algorithm and importance sampling, and feature extraction based on improved attention mechanism.

[0102] (1) Car body point cloud downsampling based on super-point algorithm and importance sampling.

[0103] In order to reduce the computational complexity while retaining the key point information, the super point algorithm and importance sampling are used in the downsampling process to achieve the vehicle body point cloud obtained by the filtered LiDAR 2. For example, Use superpixel segmentation algorithm to divide these points into m super points, which represent the local features in the car body point cloud and serve as the initial candidate points for downsampling; for each super point P i , update the super points according to their importance, and define the loss function L(P) as: ,in, n is the number of points in the body point cloud, X j It is j Points, oh ij It's point X j Superpoint P i The weight of d (P i X j ) represents point X j To Super Point P i The Euclidean distance is calculated and the gradient descent method is used to adjust the super point position to minimize the loss function.

[0104] After completing the superpoint update, according to the final superpoint position and their k Points in the neighborhood are used to extract a representative point set ,This step ensures that the key information in the body point cloud is retained while reducing the data scale of the body point cloud, ,providing efficient data representation for subsequent processing.

[0105] (2) Feature extraction based on improved attention mechanism.

[0106] In order to better extract the features of the body parts point cloud, the improved attention mechanism is used to extract and learn the representative point set obtained in the previous step. The local semantic features of the body parts point cloud and the global feature connections between them; first, the representative point set after downsampling Use graph convolutional neural network to obtain the global feature vector F between all sampling points of the current feature extraction module and the corresponding part classification global Next, the representative point set The input is fed into the local attention feature extraction unit and the local feature extraction unit to respectively learn the local attention features and local features of the local point cloud in the representative point set at different scales.

[0107] The local attention feature extraction unit of the body part point cloud adds the attention mechanism in the learning process. When calculating the feature representation of the body part point cloud, it can dynamically adjust the degree of attention to the point, so as to better capture the important information in the body part point cloud data. The formula is as follows:

[0108]

[0109]

[0110] in, is the representative point set of the car body point cloud, F att is the attention function, A is the calculated attention weight, g is the feature mapping function, f a-local It is the local attention feature representation of the body part point cloud obtained by weighting the attention weight.

[0111] The local feature extraction unit of the body part point cloud captures the feature information of the local area in the body point cloud data by using nonlinear convolution operation in the local area of ​​the body part point cloud. The formula is as follows:

[0112]

[0113] in, , are different single-layer nonlinear convolutions, It is a multi-layer nonlinear convolution. f local It is the local feature representation of the point cloud of the car body parts.

[0114] Representing the local attention features of the body parts point cloud f a-local And local feature representation of body parts point cloud f local Add together to get the local feature vector F of the body part point cloud local : ,in, Represents a sum operation.

[0115] Local feature vector F of body part point cloud local and the global eigenvector F global By splicing in the feature dimension, the joint feature representation F of the body part point cloud collected by LiDAR 2 is obtained. u L Similarly, the joint feature representation F of the body parts point cloud collected by the depth camera 1 is obtained u D And the joint feature representation F of the body parts point cloud collected by color camera 3 u C .

[0116] Step 4: Multi-scale feature fusion of body parts point cloud.

[0117] The joint feature representations of the body parts point clouds at three scales extracted in the third step are output separately and sent to the feature fusion module. The semantic similarity between the point cloud features of body parts at different scales is calculated through the offset attention mechanism to realize semantic modeling. The attention layer redistributes the credibility weight by fusing the feature layer of multi-layer feature and multi-dimensional information, suppresses some interference information in features of different scales, and highlights more effective hierarchical structure features.

[0118] Joint feature representation of body parts point clouds from three sources u L 、F u D 、F uC First, an offset network is used to calculate the position offset in the feature space. Taking the point cloud of the body parts collected by LiDAR 2 as an example, the position offset O L It is expressed by the following formula: , where OffsetNet is the offset network. Similarly, the position offset of the body part point cloud collected by depth camera 1 is O D And the position offset of the body part point cloud collected by color camera 3 O C .

[0119] Use the resulting position offset O L , O D , O C For feature F u L 、F u D 、F u C Perform position adjustment to obtain the joint features adjusted by the position offset network , , , the adjustment process is expressed as:

[0120]

[0121]

[0122]

[0123] Next, the similarity between the adjusted features is used to calculate the semantic similarity of the body part point clouds at different scales. , For example, the formula for calculating similarity through inner product operation is as follows:

[0124]

[0125] in, Score (LD) represents the similarity score between the point cloud features of the body parts at the acquisition scale of the lidar 2 and the point cloud features of the body parts at the acquisition scale of the depth camera 1, and T represents the transpose operation.

[0126] Through the Softmax operation, the weight of each scale feature is calculated according to the semantic similarity as follows, taking the weight of the scale feature of the body point cloud collected by the radar to the scale feature of the body point cloud collected by the depth camera 1 as an example:

[0127] ,in, α LD is the attention weight of the body point cloud scale features collected by the radar to the body point cloud scale features collected by the depth camera 1, e is a natural constant, Score(LD) represents the similarity score between the point cloud features of the body parts at the radar acquisition scale and the point cloud features of the body parts at the depth camera 1 acquisition scale, and Score(LC) represents the similarity score between the point cloud features of the body parts at the radar acquisition scale and the point cloud features of the body parts at the color camera 3 acquisition scale.

[0128] By redistributing the weights, the point cloud features of body parts of different scales are linearly combined to obtain the redistributed point cloud feature representation of the body parts: ,in, It is the redistributed representation of the point cloud features of the body parts at the laser radar 2 acquisition scale. α LD , α LC are the attention weights of the scale features of the body point cloud collected by the LiDAR 2 to the scale features of the body point cloud collected by the depth camera 1 and the color camera 3, , , It is the joint feature adjusted by the position offset network. Similarly, the point cloud feature of the body parts under the acquisition scale of the depth camera 1 is represented by the redistribution And the representation of the body parts point cloud features after redistribution at the acquisition scale of the depth camera 1 .

[0129] The feature representation of the body parts point cloud at the three scales after redistribution is summed to obtain the final feature fusion representation: ,in, It is the fused feature representation of the body parts point cloud.

[0130] Step 5: Perform maximum pooling operation and LBRD layer processing on the body part point cloud.

[0131] First, the fusion feature representation of the body parts point cloud obtained in the fourth step Input into the pooling layer for maximum pooling operation to extract representative features ; Then the features extracted by the maximum pooling operation are input into the LBRD layer, which combines linear transformation, batch normalization, ReLU activation function and Dropout operation. Through linear transformation, the point cloud features of the body parts after maximum pooling are mapped to a high-dimensional space. The weight matrix of the linear transformation is W, and the operation of the linear transformation is expressed as: ,in, is the point cloud feature of the car body parts after linear transformation, is the point cloud feature of the body parts extracted by the maximum pooling operation, b is the bias term.

[0132] After obtaining the linearly transformed body part point cloud features, pass them to the batch normalization layer and then apply the ReLU activation function:

[0133]

[0134]

[0135] Among them, BatchNorm represents the batch normalization operation, Relu is the activation function, It is the point cloud feature of the body parts output after batch standardization. It is the point cloud feature of the body parts output by the Relu activation function.

[0136] In order to reduce the risk of overfitting, the Dropout operation is used. p =0.5 probability to randomly discard the output of some neurons and obtain the final output feature representation: , where Dropout represents a random dropout operation, It is the feature representation of the final body part point cloud.

[0137] One-hot encoding is used to encode the point cloud features of each type of body parts, and the semantic label, i.e., the part category, of the representative point set of the body part point cloud input into the network is obtained.

[0138] Step 6: Establish the corresponding Gaussian distribution using the representative point set of the body part point cloud as the Gaussian basis element.

[0139] The points in the representative point cloud of the body parts are taken as 3D Gaussian primitives. For each 3D Gaussian primitive, together with its k The points in the neighborhood are represented by a matrix M, and the matrix M is expressed as:

[0140]

[0141] Among them, x j ,y j and z j Respectively represent j The coordinates of the neighborhood points, k is the total number of points in the k-neighborhood of the representative point, and then the covariance matrix Ω is calculated by the following formula: , where k is the total number of points in the k-neighborhood of the representative point and T is the transpose operation.

[0142] Perform eigenvalue decomposition on the covariance matrix Ω, select the direction corresponding to the eigenvector with the smallest eigenvalue as the normal vector of the point, and correspond it to the semantic label assigned to each representative point calculated in the fifth step, so as to give geometric information to each point; then each Gaussian distribution G(p) is expressed as: , where p is a point in the representative point set of the body part point cloud, Ω is the covariance matrix, T is the transpose operation, and e is a natural constant.

[0143] Step 7: Use Gaussian sputtering method to upsample the representative point set.

[0144] When the points in the representative point set are used as 3D Gaussian primitives and the corresponding 3D Gaussian distribution is established, the upsampling operation is started using the Gaussian sputtering method to expand the number of points in the Gaussian primitive field and form complete vehicle body point cloud data. With the emergence of new data points, the parameters of each Gaussian distribution are continuously updated.

[0145] The weighted average is performed based on the distance between the newly added points in the Gaussian basis element neighborhood and the initial Gaussian distribution to ensure that the center position of the Gaussian distribution is appropriately adjusted with the introduction of new data points. The mean is updated as follows:

[0146]

[0147] in, is the updated mean, oh j is the weight value obtained after weighted averaging, e is a natural constant, dis(p i ,p j ) is point p i and p j The distance between.

[0148] During upsampling, the Gaussian semantic tracking method is used to continuously track each Gaussian distribution to adapt to its changing part type and number of points. Before upsampling begins, the module records the categories and positions of all Gaussian primitives, and updates these primitives during the sampling process to reflect the current state of the Gaussian primitives during each upsampling process. The MSE loss between the initial state and the current state of the Gaussian primitive is used to ensure that the upsampling does not deviate too much from the respective primitives. The loss function φ MSE The definition is as follows:

[0149]

[0150] in, N is the total number of Gaussian primitives, G init (p) is the representation of the initial state of the Gaussian basis, G curr (p) is a representation of the current state of the Gaussian primitive, and p is a point in the Gaussian primitive.

[0151] Step 8: Correctly segment all points on the car body point cloud and output the results.

[0152] After each upsampling operation, a multilayer perceptron is used to infer the part category to which each point belongs, and the category with the highest probability is selected as the segmentation result of each point. Thus, the segmentation result of the complete car body point cloud is obtained, on which each point is correctly segmented into the corresponding part category.

Claims

1. A multi-scale segmentation method for automobile parts point cloud based on a multi-layer attention mechanism, characterized by: Use at least one laser radar, two depth cameras and one color camera, place the depth cameras facing each other at the shooting positions on both sides of the detection line, place the laser radar in front of the detection line, and place the color camera at the shooting position on one side of the detection line; The method comprises the following steps: Step 1: Collect the complete body point cloud of the vehicle to be inspected from different sources to build a dataset The color camera obtains the complete body point cloud S of the vehicle to be inspected C (X), the depth camera obtains the complete body point cloud S of the vehicle to be inspected D (X), the laser radar obtains the complete body point cloud S of the vehicle to be inspected L (X), X is a point in the car body point cloud; Step 2: Preprocess the collected complete body point cloud The complete body point cloud of the vehicle to be inspected obtained in the first step is subjected to noise reduction processing to obtain clean LiDAR point cloud data suitable for subsequent processing. , color camera point cloud data and depth camera point cloud data ; Step 3: Extract multi-scale features from the filtered body point cloud The car body point cloud obtained in the second step , and The input is input into the feature extraction network, which includes three feature extraction modules of different scales. The three feature extraction modules receive multi-source point clouds simultaneously. , and The body parts feature extraction is also performed. In each feature extraction module, there are two key operations: body point cloud downsampling based on super-point algorithm and importance sampling, and feature extraction based on improved attention mechanism. (1) Car body point cloud downsampling based on super-point algorithm and importance sampling Car body point cloud obtained by laser radar after filtering ,right Use superpixel segmentation algorithm to divide these points into m super points, which represent the local features in the car body point cloud and serve as the initial candidate points for downsampling; for each super point P i , update the super points according to their importance, and define the loss function L(P) as: ; in, n is the number of points in the body point cloud, X j It is j Points, ω ij It's point X j Superpoint P i The weight of d (P i X j ) represents point X j To Super Point P i The Euclidean distance is calculated and the gradient descent method is used to adjust the super-point position to minimize the loss function; After completing the superpoint update, according to the final superpoint position and their k Points in the neighborhood are used to extract a representative point set ; (2) Feature extraction based on improved attention mechanism Use the improved attention mechanism to extract and learn the representative point set obtained in the previous step The local semantic features of the body parts point cloud and the global feature connections between them; first, the representative point set after downsampling Use graph convolutional neural network to obtain the global feature vector F between all sampling points of the current feature extraction module and the corresponding part classification global Next, the representative point set The input is fed into the local attention feature extraction unit and the local feature extraction unit to respectively learn the local attention features and local features of the local point cloud in the representative point set at different scales; The local attention feature extraction unit of the body part point cloud adds an attention mechanism in the learning process. The formula is as follows: ; in, is the representative point set of the car body point cloud, F att is the attention function, A is the calculated attention weight, g is the feature mapping function, f a-local It is the local attention feature representation of the body part point cloud weighted by the attention weight; The local feature extraction unit of the body part point cloud captures the feature information of the local area in the body point cloud data by using nonlinear convolution operation in the local area of ​​the body part point cloud. The formula is as follows: ; in, , are different single-layer nonlinear convolutions, It is a multi-layer nonlinear convolution. f local It is the local feature representation of the point cloud of the car body parts; Representing the local attention features of the body parts point cloud f a-local And local feature representation of body parts point cloud f local Add together to get the local feature vector F of the body part point cloud local : ; in, Represents the sum operation; Local feature vector F of body part point cloud local and the global eigenvector F global By splicing in the feature dimension, we can obtain the joint feature representation F of the body parts point cloud collected by the LiDAR. u L Similarly, the joint feature representation F of the body parts point cloud collected by the depth camera is obtained u D And the joint feature representation of the body parts point cloud collected by the color camera F u C ; Step 4: Multi-scale feature fusion of body parts point cloud The joint feature representations of the body parts point clouds at three scales extracted in the third step are outputted and sent to the feature fusion module. The joint feature representations of the body parts point clouds from three sources are F u L 、F u D 、F u C First, an offset network is used to calculate the position offset in the feature space. O L It is expressed by the following formula: ; Among them, OffsetNet is an offset network. Similarly, the position offset of the body part point cloud collected by the depth camera is obtained. O D And the position offset of the body parts point cloud collected by the color camera O C ; Use the resulting position offset O L , O D , O C For feature F u L 、F u D 、F u C Perform position adjustment to obtain the joint features adjusted by the position offset network , the adjustment process is expressed as: ; Next, the similarity between the adjusted features is used to calculate the semantic similarity of the body part point clouds at different scales. The formula for calculating similarity through inner product operation is: ; in, Score (LD) represents the similarity score between the point cloud features of the body parts at the laser radar acquisition scale and the point cloud features of the body parts at the depth camera acquisition scale, and T represents the transposition operation; Through the Softmax operation, the weight of each scale feature is calculated according to the semantic similarity as follows: the weight of the scale feature of the body point cloud collected by the radar to the scale feature of the body point cloud collected by the depth camera: ; in, α LD is the attention weight of the body point cloud scale features collected by the radar to the body point cloud scale features collected by the depth camera, e is a natural constant, Score(LD) represents the similarity score between the point cloud features of the body parts at the radar acquisition scale and the point cloud features of the body parts at the depth camera acquisition scale, and Score(LC) represents the similarity score between the point cloud features of the body parts at the radar acquisition scale and the point cloud features of the body parts at the color camera acquisition scale; By redistributing the weights, the point cloud features of body parts of different scales are linearly combined to obtain the redistributed point cloud feature representation of the body parts: ; in, It is the redistributed representation of the point cloud features of the body parts at the laser radar acquisition scale. α LD , α LC are the attention weights of the body point cloud scale features collected by the lidar to the body point cloud scale features collected by the depth camera and the color camera, It is the joint feature adjusted by the position offset network. Similarly, the point cloud feature of the body parts under the depth camera acquisition scale is represented after redistribution And the representation of the body parts point cloud features after redistribution at the depth camera acquisition scale ; The feature representation of the body parts point cloud at the three scales after redistribution is summed to obtain the final feature fusion representation: ; in, It is the fused feature representation of the body parts point cloud; Step 5: Perform maximum pooling and LBRD layer processing on the body part point cloud First, the fusion feature representation of the body parts point cloud obtained in the fourth step Input into the pooling layer for maximum pooling operation to extract representative features ; Then the features extracted by the maximum pooling operation are input into the LBRD layer. Through linear transformation, the point cloud features of the body parts after maximum pooling are mapped to the high-dimensional space. The weight matrix of the linear transformation is W, and the operation of the linear transformation is expressed as: ; in, is the point cloud feature of the car body parts after linear transformation, is the point cloud feature of the body parts extracted by the maximum pooling operation, b is the bias term; After obtaining the linearly transformed body part point cloud features, pass them to the batch normalization layer and then apply the ReLU activation function: ; Among them, BatchNorm represents the batch normalization operation, Relu is the activation function, It is the point cloud feature of the body parts output after batch standardization. It is the point cloud feature of the body parts output by the Relu activation function; Use Dropout operation to p Randomly discard the output of some neurons to get the final output feature representation: ; Among them, Dropout represents a random drop operation. It is the feature representation of the final body part point cloud; Use one-hot encoding to encode the point cloud features of each type of body parts, and obtain the semantic label, i.e., the part category, to which the representative point set of the body part point cloud input into the network belongs; Step 6: Use the representative point set of the body part point cloud as the Gaussian basis to establish the corresponding Gaussian distribution The points in the representative point cloud of the body parts are taken as 3D Gaussian primitives. For each 3D Gaussian primitive, together with its k The points in the neighborhood are represented by a matrix M, and the matrix M is expressed as: ; Among them, x j ,y j and z j Respectively represent j The coordinates of the neighborhood points, k is the total number of points in the k-neighborhood of the representative point, and then the covariance matrix Ω is calculated by the following formula: ; Where k is the total number of points in the k-neighborhood of the representative point, and T is the transpose operation; Perform eigenvalue decomposition on the covariance matrix Ω, select the direction corresponding to the eigenvector with the smallest eigenvalue as the normal vector of the point, and correspond it to the semantic label assigned to each representative point calculated in the fifth step, so as to give geometric information to each point; then each Gaussian distribution G(p) is expressed as: ; Among them, p is a point in the representative point set of the body part point cloud, Ω is the covariance matrix, T is the transpose operation, and e is a natural constant; Step 7: Upsample the representative point set using Gaussian sputtering When the points in the representative point set are used as 3D Gaussian primitives and the corresponding 3D Gaussian distribution is established, the upsampling operation is started using the Gaussian sputtering method to expand the number of points in the Gaussian primitive field to form complete vehicle body point cloud data. With the emergence of new data points, the parameters of each Gaussian distribution are continuously updated; The weighted average is performed based on the distance between the newly added points in the Gaussian base element neighborhood and the initial Gaussian distribution to ensure that the center position of the Gaussian distribution is appropriately adjusted with the introduction of new data points. The mean is updated as follows: ; in, is the updated mean, ω j is the weight value obtained after weighted averaging, e is a natural constant, dis(p i ,p j ) is point p i and p j The distance between During upsampling, the Gaussian semantic tracking method is used to continuously track each Gaussian distribution to adapt to its changing part type and number of points. Before upsampling begins, the module records the categories and positions of all Gaussian primitives, and updates these primitives during the sampling process to reflect the current state of the Gaussian primitives during each upsampling process. The MSE loss between the initial state and the current state of the Gaussian primitive is used to ensure that the upsampling does not deviate too much from the respective primitives. The loss function φ MSE The definition is as follows: ; in, N is the total number of Gaussian primitives, G init (p) is the representation of the initial state of the Gaussian basis, G curr (p) is the representation of the current state of the Gaussian primitive, and p is a point in the Gaussian primitive; Step 8: Correctly segment all points on the car body point cloud and output the results: After each upsampling operation, a multilayer perceptron is used to infer the part category to which each point belongs, and the category with the highest probability is selected as the segmentation result of each point. Thus, the segmentation result of the complete car body point cloud is obtained, on which each point is correctly segmented into the corresponding part category.

2. The multi-scale segmentation method of automobile parts point cloud based on multi-layer attention mechanism according to claim 1 is characterized in that: In the first step, after receiving the start acquisition signal, the color camera is first moved around the vehicle to be inspected to collect images of the vehicle under different viewing angles; for images under different viewing angles, the Gaussian difference Gaussian pyramid is used to detect the local feature points of the image, and then the pixel sums in the horizontal and vertical directions of the local feature points on the image are weighted and summed to obtain their regional wavelet features. H w,x,y , the calculation formula is: ; in, gr ( x , y ) represents the pixel point on each image ( x , y ), w The window size representing the feature is the size of the w×w area of ​​the image, i and j Respectively represent the pixel coordinate offset within the window; The descriptor of the local feature point is obtained by applying regional wavelet feature calculation to the area around the local feature point, and then the local feature point descriptor is matched with the adjacent frame photos of the vehicle to be inspected using the nearest neighbor matching method; the position and posture of the color camera at different time points are calculated using the PnP algorithm based on the matched local feature points and the spatial geometric constraints between adjacent frames; for the matched feature point pairs, their three-dimensional coordinates are calculated using triangulation technology, and the three-dimensional point sets of the vehicle to be inspected from different perspectives are fused into a point cloud model based on the three-dimensional coordinates of the matching points on each image to represent the reconstructed three-dimensional body shape; according to the above steps, the complete body point cloud S of the vehicle to be inspected acquired by the color camera is obtained. C (X), X is a point in the car body point cloud; Next, the driver drives the vehicle to be inspected from the starting point of the inspection line at a constant speed of 3-4 km / h and passes through the inspection line. After the vehicle to be inspected passes the inspection line, the two depth cameras in the inspection system use the ICP method to register the point cloud to obtain the complete body point cloud S of the vehicle to be inspected obtained by the depth camera. D (X), the complete body point cloud of the vehicle to be inspected obtained by the laser radar is S L (X).

3. The multi-scale segmentation method of automobile parts point cloud based on multi-layer attention mechanism according to claim 1, characterized in that: In the second step, the complete body point cloud of the vehicle to be inspected obtained in the first step is subjected to noise reduction processing. The complete body point cloud S of the vehicle to be inspected obtained by the laser radar is L (X), for S L Every point X in (X) i , use the KNN algorithm to find its neighborhood point set M, assuming that the neighborhood point set M includes n points, calculate the average position of the neighborhood points μ i and standard deviation σ i : ; Among them, X j It's point X i Points in the neighborhood point set; Then use the Z-score method to determine point X i Is it a noise point? , then X i is regarded as a noise point, where k is a threshold parameter; The above filtering operation removes the noise points in the complete body point cloud of the vehicle to be inspected, and obtains cleaner point cloud data suitable for subsequent processing. , the point cloud data collected by the color camera and the depth camera after filtering is obtained by the same method: , .

Citation Information

Patent Citations

  • Three-dimensional building fine geometric reconstruction method integrating airborne and vehicle-mounted three-dimensional laser point clouds and streetscape images

    CN111815776A

  • Photogrammetry point cloud semantic segmentation method based on deep learning

    CN113449736A