Neural network-based casting surface point cloud contour extraction method
By introducing a point cloud edge detection network with attention module in UNet++ neural network, the problems of insufficient point cloud extraction and noise interference in the prior art are solved, and accurate identification of the contour of the casting surface part and efficient adaptation to complex industrial scenarios are achieved.
Patent Information
- Application Number
- CN202510129908.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-02-05
- Publication Date
- 2025-05-30
- Estimated Expiration
- 2045-02-05
AI Technical Summary
The existing point cloud extraction technology has problems such as insufficient feature extraction, easy to be disturbed by noise, and difficult to adapt to the diversity of target shapes in industrial scenarios, which makes it difficult to accurately identify various parts of the casting surface, making it impossible for the robot to efficiently perform the cleaning of the castings.
A point cloud edge detection network based on UNet++ neural network is used. After preprocessing the point cloud data on the casting surface, the point cloud edge detection network is trained to extract the contours of each part of the casting surface. The network includes an input layer, an encoder module, a feature extraction module, an attention module, a decoder module and an output layer. The attention module enhances the capture ability of the target point cloud detail features through the space and channel attention modules.
The accuracy of the robot to identify different shapes of the casting surface is improved, and its adaptability to complex industrial scenarios is enhanced. The improved model shows higher accuracy and robustness when detecting point cloud edges.
Smart Images

Figure CN120070483A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of machine vision-assisted robot casting cleaning, and particularly to a method for extracting the point cloud contour of a casting surface based on a neural network. Background Art
[0002] Castings have many advantages such as low production cost and wide adaptability, and are widely used in various industries. Before a casting is put into formal use, it is necessary to clean all parts of its surface to meet the usage requirements. Today, with the booming development of automation technology, people have gradually started to use robots instead of manual labor to clean castings, so as to reduce labor intensity and improve production efficiency. The prerequisite for using a robot to automatically clean a casting is to accurately identify all parts of the casting surface.
[0003] Three-dimensional point cloud data can preserve the specific information of an object in three-dimensional space, and the information is more detailed and rich than that of a two-dimensional image. Using three-dimensional point cloud can well retain the information of all parts of the casting surface. As a computational model, neural networks have been widely used in the fields of machine learning, artificial intelligence, image recognition, etc. Combining point cloud processing algorithms with neural networks to extract the point cloud contour of the casting surface parts, so as to accurately identify the contours of all parts of the casting surface. This technology is very important for using robots to achieve automatic cleaning of castings. However, in the application of existing point cloud extraction technologies in industrial scenarios, there are mainly problems such as insufficient feature extraction, being easily affected by noise interference, and being difficult to adapt to the diversity of target shapes, which in turn leads to difficulty in accurately identifying all parts of the casting surface, making it impossible for robots to efficiently perform the cleaning work on castings. Summary of the Invention
[0004] The present invention provides a method for extracting the point cloud contour of a casting surface based on a neural network to overcome the technical problems that in the application of existing point cloud extraction technologies in industrial scenarios, there are mainly problems such as insufficient feature extraction, being easily affected by noise interference, and being difficult to adapt to the diversity of target shapes, which in turn leads to difficulty in accurately identifying all parts of the casting surface, making it impossible for robots to efficiently perform the cleaning work on castings.
[0005] To achieve the above object, the technical solution of the present invention is as follows:
[0006] A method for extracting the point cloud contour of a casting surface based on a neural network, the specific steps include:
[0007] S1: Obtain the point cloud data of the casting surface;
[0008] S2: Preprocess the point cloud data of the casting surface to obtain the processed point cloud data;
[0009] S3: Build a point cloud edge detection network based on the UNet++ neural network, and train the point cloud edge detection network with the processed point cloud data to obtain a trained point cloud edge detection network;
[0010] The point cloud edge detection network includes an input layer, an encoder module, a feature extraction module, an attention module, a decoder module, and an output layer connected in sequence;
[0011] The input layer is used to receive the processed point cloud data and transmit it to the encoder module;
[0012] The encoder module is used to encode the processed point cloud data to obtain encoded point cloud data and transmit it to the feature extraction module;
[0013] The feature extraction module is used to extract the center point features of the encoded point cloud data and transmit them to the attention module;
[0014] The attention module is used to extract the attention features in the center point features and transmit them to the decoder module;
[0015] The decoder module is used to decode the attention features and transmit the decoded attention features to the output layer;
[0016] The output layer is used to output the contours of each part of the casting surface according to the decoded attention features;
[0017] S4: Based on the trained point cloud edge detection network, extract the contours of the actual casting surface point cloud data to identify the contours of each part of the casting surface.
[0018] Further, the attention module includes a spatial attention module and a channel attention module connected in sequence;
[0019] The spatial attention module includes a downsampling layer, a feature region construction unit, a first fully connected layer, a max pooling layer, and a first sigmoid activation function;
[0020] The spatial attention module is used to extract the regional attention features of the center point features, and the process is as follows:
[0021] Downsample the center point features through the downsampling layer to obtain several center points and a total of k neighborhood points in the spherical neighborhood around each center point;
[0022] Preliminarily construct a feature region through the feature region construction unit, and its expression is as follows:
[0023] e ij =(x i, x j -x i , desnity(x j ))
[0024] Wherein, x i represents the center point, and x j is the j-th neighborhood point within the spherical neighborhood around the center point obtained through downsampling. desnity(x j ) represents the average value of the distances between the neighborhood point x j and m neighborhood points;
[0025] Process the feature region to obtain the weight matrix W j of the neighborhood point x i around the center point, and its form is as follows:
[0026] W i = σ 1 (Max(F c (e i )))
[0027] Wherein, e i represents the feature region constructed by the center point and a total of k neighborhood points within the surrounding spherical neighborhood; F c represents the first fully connected layer, Max represents the max pooling layer, and σ 1 represents the first sigmoid activation function;
[0028] Wherein, the feature region is convolved through the first fully connected layer to obtain spatial convolution features, which are transmitted to the max pooling layer;
[0029] The max pooling layer performs pooling processing on the spatial convolution features to obtain pooling features, which are transmitted to the first sigmoid activation function;
[0030] The first sigmoid activation function normalizes each weight of the pooling features between 0 and 1 to obtain the weight matrix W i with a dimension of (k, 1); and multiplies each weight coefficient in the weight matrix W i by the feature values of all channels of the corresponding neighborhood points to obtain the region attention features of the center point features.
[0031] Furthermore, the channel attention module includes an average pooling layer, a second fully connected layer, a first ReLu activation function, a third fully connected layer, and a second sigmoid activation function;
[0032] The channel attention module is used to extract the channel attention features from the region attention features, including:
[0033] The expression of the channel attention module is as follows:
[0034] x out = F scale (σ 3 (F 2 (σ 2 (F 1 (Avg(x in ))))), p)
[0035] In the formula, x in is the region attention feature, F 1 and F 2 respectively represent the second fully connected layer and the third fully connected layer, F scale represents weighting the features, σ 2 and σ 3 respectively represent the first ReLu activation function and the second sigmoid activation function; Avg is the average pooling layer; p is the number of feature channels;
[0036] Among them, the dimension (n, c in ) of the input data x 1 is reduced to (1, c 1 ) through the average pooling layer to obtain the first dimension-reduced feature, which is transmitted to the second fully connected layer; n represents the total number of points, and c 1 is the number of feature channels for each point;
[0037] The first dimension-reduced feature is convolved through the second fully connected layer to obtain a first convolutional feature with a dimension of (1, c 2 ), which is transmitted to the first ReLu activation function;
[0038] The first convolutional feature is non-linearly transformed through the first ReLu activation function to obtain a first non-linear feature, which is transmitted to the third fully connected layer;
[0039] The first non-linear feature is convolved through the third fully connected layer to obtain a second convolutional feature with a dimension of (1, c 1 ), which is transmitted to the second sigmoid activation function;
[0040] Each weight of the second convolutional feature is normalized between 0 and 1 through the second sigmoid activation function to obtain a channel weight matrix with a dimension of (1, c 1 ); and the weight coefficients in the channel weight matrix are multiplied by the feature channels corresponding to the point clouds in the region attention feature to obtain the channel attention feature in the region attention feature.
[0041] Furthermore, in S2, the process of preprocessing the cast surface point cloud data includes:
[0042] S21: Background filtering is performed on the point cloud data of the surface of the casting to obtain first-filtered point cloud data;
[0043] S22: Gaussian statistical filtering is used to process the first-filtered point cloud data to obtain second-filtered point cloud data;
[0044] S23: Downsampling is performed on the second-filtered point cloud data to obtain the processed point cloud data.
[0045] Further, in S21, the process of performing background filtering on the point cloud data of the surface of the casting to obtain first-filtered point cloud data is as follows:
[0046] Obtain the distance bounds [M 1 , M 2 , [M' 1 , M' 2 , and [M'' 1 , M'' 2 of the point cloud data of the surface of the casting in each spatial dimension;
[0047] Set the distance thresholds [m 1 , m 2 , [m' 1 , m' 2 , and [m'' 1 , m'' 2 in the corresponding spatial dimensions according to the distance bounds, and M 2 > m 2 , m 1 > M 1 ; M' 2 > m' 2 , m' 1 > M' 1 ; M'' 2 > m'' 2 , m'' 1 > M'' 1 ; Only retain the point cloud data within [m 1 , m 2 , [m' 1 , m' 2 , and [m'' 1 , m'' 2 to obtain the first-filtered point cloud data.
[0048] Further, in S22, the process of using Gaussian statistical filtering to process the first-filtered point cloud data to obtain second-filtered point cloud data is as follows:
[0049] For any point in the first filtered point cloud data, calculate the sum of its distances from the remaining k neighboring points in the neighborhood, and calculate the average distance D based on the sum of the distances n , and the calculation formula is as follows:
[0050]
[0051] In the formula, x’, y’, z’ are the three-dimensional coordinates of any point in the first filtered point cloud data; x i , y i , z i are the coordinates of any neighboring point;
[0052] Calculate the average value m and the standard deviation δ based on the average distances of the total N points in the first filtered point cloud data, and the calculation formulas are as follows:
[0053]
[0054] Calculate the segmentation threshold L based on the standard deviation δ, and the calculation formula is:
[0055] L = m + m t * δ
[0056] In the formula, m t is the multiple factor;
[0057] Traverse the first filtered point cloud data, and compare the numerical magnitudes of the average value D n of each point therein with the segmentation threshold. If D n < L, retain the corresponding point, otherwise remove the corresponding point;
[0058] Finally, obtain the second filtered point cloud data.
[0059] Beneficial effects: The present invention constructs a point cloud edge detection network, adds an attention module on the basis of the UNet++ neural network, is used to extract the attention features of the central point features, enhances the ability to capture the detailed features of the target point cloud, and at the same time has stronger robustness to sparse point clouds and noisy point clouds. By using the point cloud edge detection network to extract the point cloud contour of the casting surface part, the accuracy of the robot in identifying different shaped parts of the casting surface is improved, and it has better adaptability in complex industrial scenarios. Description of the Drawings
[0060] In order to more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the following will briefly introduce the drawings required for use in the description of the embodiments or the prior art. Obviously, the drawings in the following description are some embodiments of the present invention. For those of ordinary skill in the art, other drawings can be obtained according to these drawings without creative efforts.
[0061] Figure 1 This is a flowchart of a method for extracting the point cloud contour of the surface of a casting based on a neural network in the present invention. Specific implementation mode
[0062] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention. Apparently, the described embodiments are some, but not all, of the embodiments of the present invention. All other embodiments obtained by those of ordinary skill in the art based on the embodiments of the present invention without creative efforts shall fall within the protection scope of the present invention.
[0063] This embodiment provides a method for extracting the point cloud contour of the surface of a casting based on a neural network. As Figure 1 shown, the specific steps include:
[0064] S1: Obtain the point cloud data of the surface of the casting;
[0065] Specifically, the point cloud data of the surface of the casting is obtained by a 3D binocular camera;
[0066] S2: Preprocess the point cloud data of the surface of the casting to obtain the processed point cloud data;
[0067] S3: Build a point cloud edge detection network UANet++ based on the UNet++ neural network, and train the point cloud edge detection network with the processed point cloud data to obtain the trained point cloud edge detection network;
[0068] The point cloud edge detection network includes an input layer, an encoder module, a feature extraction module, an attention module, a decoder module, and an output layer connected in sequence;
[0069] The input layer is used to receive the processed point cloud data and transmit it to the encoder module;
[0070] The encoder module is used to encode the processed point cloud data to obtain the encoded point cloud data and transmit it to the feature extraction module;
[0071] The feature extraction module is used to extract the central point feature of the encoded point cloud data and transmit it to the attention module;
[0072] The attention module is used to extract the attention feature in the central point feature and transmit it to the decoder module;
[0073] The decoder module is used to decode the attention feature and transmit the decoded attention feature to the output layer;
[0074] The output layer is used to output the contours of each part of the casting surface according to the decoded attention features;
[0075] S4: Based on the trained point cloud edge detection network, contour extraction is performed on the actual casting surface point cloud data, so as to identify the contours of each part of the casting surface.
[0076] In a specific embodiment, the attention module includes a spatial attention module and a channel attention module connected in sequence;
[0077] The spatial attention module includes a downsampling layer, a feature region construction unit, a first fully connected layer, a max pooling layer, and a first sigmoid activation function; the spatial attention module is used to extract the regional attention features of the center point features, and the process is as follows:
[0078] The center point features are downsampled through the downsampling layer to obtain several center points and k neighborhood points within the spherical neighborhood around each center point;
[0079] The feature region is preliminarily constructed through the feature region construction unit, and its expression is as follows:
[0080] e ij =(x i ,x j -x i ,desnity(x j ))
[0081] In the formula, x i represents the center point, x j is the j-th neighborhood point within the spherical neighborhood around the center point obtained through downsampling. According to x i and x j , the feature region is constructed. The x j -x i in the feature region contains the position information of the neighborhood point x j relative to the center point x i . desnity(x j ) represents the average value of the distances between the neighborhood point x j and m neighborhood points. To a certain extent, it indicates the complexity of the shape around the neighborhood point. The value of desnity(x j ) may be higher at more complex shapes;
[0082] The feature region is processed to obtain the weight matrix W i of the neighborhood point x j within the spherical neighborhood around the center point, and its form is as follows:
[0083] W i =σ 1(Max(F c (e i )))
[0084] where e i represents the feature region constructed by a total of k neighborhood points within the central point and the surrounding spherical neighborhood, F c represents the first fully connected layer, Max represents the max pooling layer, and σ 1 represents the first sigmoid activation function;
[0085] wherein, the feature region is subjected to convolution processing through the first fully connected layer to obtain spatial convolution features, which are transmitted to the max pooling layer;
[0086] the max pooling layer performs pooling processing on the spatial convolution features to obtain pooled features, which are transmitted to the first sigmoid activation function;
[0087] the first sigmoid activation function normalizes each weight of the pooled features between 0 and 1 to obtain a weight matrix W i with dimensions (k, 1); and multiplies each weight coefficient in the weight matrix W i by the feature values of all channels of the corresponding neighborhood points, thereby obtaining the region attention features of the central point features.
[0088] Specifically, in this embodiment, since the local shape features of the point cloud need to be learned through the surrounding neighborhood points of the central point, the selection of neighborhood points has a great impact on the accuracy of point cloud edge detection. Therefore, a spatial attention module is added to the UNet++ neural network in this embodiment. The spatial attention module can learn a spatial weight matrix according to the relative position relationship between each neighborhood point in the neighborhood and the central point and the point distribution around the neighborhood point itself, assign a weight to each neighborhood point, and at the same time, the spatial attention module can take into account that the importance of points in different positions in the neighborhood space is different, thereby increasing the attention of the model to the more critical neighborhood points around the query point and generating a weight matrix of the neighborhood points around the central point.
[0089] In a specific embodiment, since different channels in the region features represent different features and these features contribute differently to edge detection, a channel attention module is added to the UNet++ neural network. The channel attention module includes an average pooling layer, a second fully connected layer, a first ReLu activation function, a third fully connected layer, and a second sigmoid activation function;
[0090] The channel attention module is used to extract the channel attention features in the region attention features, including:
[0091] The expression of the channel attention module is as follows:
[0092] x out = F scale (σ 3 (F 2 (σ 2 (F 1 (Avg(x in ))))), p)
[0093] In the formula, x in is the regional attention feature, F 1 and F 2 respectively represent the second fully connected layer and the third fully connected layer, F scale represents assigning weights to the features, σ 2 and σ 3 respectively represent the first ReLu activation function and the second sigmoid activation function; Avg is the average pooling layer; p is the number of feature channels;
[0094] Among them, the input data x in with dimensions (n, c 1 ) is reduced to (1, c 1 ) through the average pooling layer to obtain the first dimensionality-reduced feature, which is transmitted to the second fully connected layer; n represents the total number of points, and c 1 is the number of feature channels for each point;
[0095] The first dimensionality-reduced feature is convolved through the second fully connected layer to obtain a first convolutional feature with dimensions (1, c 2 ), which is transmitted to the first ReLu activation function;
[0096] The first convolutional feature is non-linearly transformed through the first ReLu activation function to obtain a first non-linear feature, which is transmitted to the third fully connected layer;
[0097] The first non-linear feature is convolved through the third fully connected layer to obtain a second convolutional feature with dimensions (1, c 1 ), which is transmitted to the second sigmoid activation function;
[0098] Each weight of the second convolutional feature is normalized between 0 and 1 through the second sigmoid activation function to obtain a channel weight matrix with dimensions (1, c 1 ); and the weight coefficients in the channel weight matrix are multiplied by the feature channels corresponding to the point clouds in the regional attention feature to obtain the channel attention feature in the regional attention feature.
[0099] Specifically, the channel attention module can learn a channel weight matrix to enhance the attention to important feature channels and reduce the attention to channels that are not very useful for the current task, thereby strengthening the ability to capture feature information.
[0100] Specifically, in this embodiment, based on the UNet++ neural network in the field of image processing, its structure is improved by adding a spatial attention module that mainly focuses on the information in the spatial domain. A spatial weight matrix is learned through the position information and density information of neighboring points to weight the neighboring points at different positions, realizing the adaptive selection of neighboring points. A channel attention module is added that mainly focuses on the information in the channel domain, and a channel weight matrix is learned for the features, thereby increasing the attention to edge features and strengthening the ability to capture feature information. Finally, a point cloud edge detection network UANet++ is formed to extract the contour of the processed casting surface point cloud data.
[0101] In a specific embodiment, since the obtained casting surface point cloud data contains many noise point clouds such as outliers and redundant points, for complex point cloud data, in order to quickly extract the target point cloud, it is necessary to preprocess the casting surface point cloud data to remove the redundant point clouds, thereby improving the speed of the algorithm and obtaining more accurate and less effective point cloud data, ensuring the accuracy of the extracted point cloud data information, and reducing the interference to the subsequent processing process.
[0102] In a specific embodiment, in S2, the process of preprocessing the casting surface point cloud data includes:
[0103] S21: Perform background filtering on the casting surface point cloud data to obtain the first filtered point cloud data;
[0104] In a specific embodiment, in S21, the process of performing background filtering on the casting surface point cloud data to obtain the first filtered point cloud data is as follows:
[0105] The casting surface point cloud data collected in this embodiment has three dimensions of x, y, and z. Obtain the distance limits [M 1 , M 2 , [M' 1 , M' 2 , and [M" 1 , M" 2 of the casting surface point cloud data in each spatial dimension;
[0106] Set the distance thresholds [m 1 , m 2 , [m' 1 , m' 2 , and [m" 1 , m" 2 for the corresponding spatial dimensions according to the distance limits, and M2 >m 2 ,m 1 >M 1 ; M' 2 >m' 2 ,m' 1 >M' 1 ; M'' 2 >m'' 2 ,m'' 1 >M'' 1 ; Only the point cloud data within [m 1 ,m 2 [m', 1 ,m' 2 and [m'' 1 ,m'' 2 is retained, thereby reducing redundant point cloud data and obtaining the first filtered point cloud data.
[0107] S22: Process the first filtered point cloud data using Gaussian statistical filtering to obtain the second filtered point cloud data;
[0108] In a specific embodiment, in S22, the process of processing the first filtered point cloud data using Gaussian statistical filtering to obtain the second filtered point cloud data is as follows:
[0109] For any point in the first filtered point cloud data, calculate the sum of its distances to the remaining k points in the neighborhood, and calculate the average distance D based on the sum of the distances n , and the calculation formula is as follows:
[0110]
[0111] In the formula, x', y', z' are the three-dimensional coordinates of any point in the first filtered point cloud data; x i ,y i ,z i are the coordinates of any neighborhood point;
[0112] Calculate the average value m and the standard deviation δ based on the average distance of the total N points in the first filtered point cloud data, and the calculation formulas are as follows:
[0113]
[0114] Calculate the segmentation threshold L based on the standard deviation δ, and the calculation formula is:
[0115] L = m + m t *δ
[0116] In the formula, m t is the multiple factor, which is set by itself according to the size of the workpiece point cloud data;
[0117] Traverse the first filtered point cloud data and compare the average value D of each point therein n with the numerical value of the segmentation threshold. If D n < L, retain the corresponding point; otherwise, remove the corresponding point;
[0118] Finally, the second filtered point cloud data is obtained.
[0119] S23: Downsample the second filtered point cloud data to obtain the processed point cloud data.
[0120] Specifically, downsampling the second filtered point cloud data is to remove redundant point clouds on the basis of not changing the overall shape of the target point cloud and not affecting subsequent measurements, and obtain more refined and effective point cloud data. According to the quantity of the second filtered point cloud data, call the point cloud processing function to divide the three-dimensional space where the point cloud data is located into cubes with equal side lengths and adjacent to each other, that is, voxel grids. Taking each voxel grid as the basic unit, successively replace all the point clouds in each voxel grid with one point, thereby realizing the reduction of the quantity of the point cloud and achieving the effect of downsampling.
[0121] In this embodiment, the improved UANet++ and the original network model are experimentally compared to prove the superiority of the improved model, and the quantitative results are as shown in Table 1;
[0122] Table 1:
[0123] Method F1 Precision Recall IOU ECD UNet++ 0.5269 0.4872 0.5736 0.3561 0.0360 UANet 0.7724 0.7198 0.8334 0.6292 0.0109
[0124] It can be seen from the data in the table that the improved UANet++ is superior to the original model in each index. Among them, the F1 value is increased by 0.2455, the precision rate is increased by 23.26%, the recall rate is increased by 25.98%, the intersection over union is increased by 27.31%, and the edge chamfer distance is increased by 0.0251, indicating that the improved UANet++ has higher precision and robustness when detecting the edge of the point cloud.
[0125] Finally, it should be noted that: the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it; although the present invention has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand that: they can still modify the technical solutions described in the foregoing embodiments, or perform equivalent replacements on some or all of the technical features; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the scope of the technical solutions of the embodiments of the present invention.
Claims
1. A method for extracting casting surface point cloud contour based on neural network, characterized in that: The specific steps include: S1: Obtain casting surface point cloud data; S2: preprocessing the casting surface point cloud data to obtain processed point cloud data; S3: constructing a point cloud edge detection network based on the UNet++ neural network, and training the point cloud edge detection network through the processed point cloud data to obtain a trained point cloud edge detection network; The point cloud edge detection network includes an input layer, an encoder module, a feature extraction module, an attention module, a decoder module and an output layer connected in sequence; The input layer is used to receive the processed point cloud data and transmit it to the encoder module; The encoder module is used to encode the processed point cloud data to obtain the encoded point cloud data and transmit it to the feature extraction module; The feature extraction module is used to extract the center point features of the encoded point cloud data and transmit them to the attention module; The attention module is used to extract the attention feature from the center point feature and transmit it to the decoder module; The decoder module is used to decode the attention feature and transmit the decoded attention feature to the output layer; The output layer is used to output the contours of various parts of the casting surface according to the decoded attention features; S4: Based on the trained point cloud edge detection network, contour extraction is performed on the actual casting surface point cloud data, so as to identify the contours of various parts of the casting surface.
2. The method for extracting casting surface point cloud contour based on neural network according to claim 1, characterized in that: The attention module includes a spatial attention module and a channel attention module connected in sequence; The spatial attention module includes a downsampling layer, a feature region construction unit, a first fully connected layer, a maximum pooling layer and a first sigmoid activation function; The spatial attention module is used to extract the regional attention features of the center point features, and the process is: Down-sampling the center point feature through the down-sampling layer to obtain a number of center points and a total of k neighborhood points in a spherical neighborhood around each center point; The feature region is initially constructed through the feature region construction unit, and its expression is as follows: e ij =(x i ,x j -x i ,desnity(x j )) In the formula, x i represents the center point, x j is the jth neighborhood point in the spherical neighborhood around the center point obtained by downsampling, desnity(x j ) represents the neighborhood point x j The average distance to m domain points; The feature area is processed to obtain the neighborhood point x in the spherical neighborhood around the center point j The weight matrix W i , which has the following form: W i =σ1(Max(F v (e i ))) Among them, e i F represents the feature region constructed by the center point and the k neighboring points in the surrounding spherical neighborhood; c represents the first fully connected layer, Max represents the maximum pooling layer, and σ1 represents the first sigmoid activation function; The feature region is convolved by the first fully connected layer to obtain spatial convolution features, which are then transmitted to the maximum pooling layer; The maximum pooling layer performs pooling processing on the spatial convolutional features to obtain pooling features, and transmits them to the first sigmoid activation function; The first sigmoid activation function normalizes each weight of the pooled feature to between 0 and 1, obtaining a weight matrix W with a dimension of (k, 1) i ; and the weight matrix W i Each weight coefficient in is multiplied by the feature values of all channels of the corresponding neighborhood points to obtain the regional attention features of the center point features.
3. The method for extracting casting surface point cloud contour based on neural network according to claim 2, characterized in that: The channel attention module includes an average pooling layer, a second fully connected layer, a first ReLu activation function, a third fully connected layer, and a second sigmoid activation function; The channel attention module is used to extract the channel attention features in the regional attention features, including: The expression of the channel attention module is as follows: x out =F scale (σ3(F2(σ2(F1(Avg(x in ))))),p) In the formula, x in is the regional attention feature, F1 and F2 represent the second fully connected layer and the third fully connected layer respectively, and F scale Indicates the weighting of features, σ2 and σ3 represent the first ReLu activation function and the second sigmoid activation function respectively; Avg is the average pooling layer; p is the number of feature channels; Among them, the input data x is pooled through the average pooling layer in The dimension (n, c1) is reduced to (1, c1), the first dimensionality reduction feature is obtained, and transmitted to the second fully connected layer; n represents the total number of points, and c1 is the number of feature channels of each point; Performing convolution processing on the first dimension reduction feature through a second fully connected layer to obtain a first convolution feature with a dimension of (1, c2), and transmitting it to a first ReLu activation function; Performing a nonlinear transformation on the first convolution feature through the first ReLu activation function to obtain a first nonlinear feature, and transmitting the first nonlinear feature to the third fully connected layer; The first nonlinear feature is convolved through a third fully connected layer to obtain a second convolution feature with a dimension of (1, c1), and transmitted to a second sigmoid activation function; Each weight of the second convolutional feature is normalized to between 0 and 1 through a second sigmoid activation function to obtain a channel weight matrix with a dimension of (1, c1); and the weight coefficient in the channel weight matrix is multiplied by the feature channel corresponding to the point cloud in the regional attention feature to obtain the channel attention feature in the regional attention feature.
4. The method for extracting casting surface point cloud contour based on neural network according to claim 3, characterized in that: In S2, the process of preprocessing the casting surface point cloud data includes: S21: performing background filtering on the casting surface point cloud data to obtain first filtered point cloud data; S22: Processing the first filtered point cloud data using Gaussian statistical filtering to obtain second filtered point cloud data; S23: Downsampling the second filtered point cloud data to obtain the processed point cloud data.
5. The method for extracting casting surface point cloud contour based on neural network according to claim 4, characterized in that: In S21, the process of performing background filtering on the casting surface point cloud data to obtain the first filtered point cloud data is as follows: Obtain the distance limits [M1, M2], [M'1, M'2] and [M"1, M"2] of the casting surface point cloud data in each spatial dimension; According to the distance limit, the distance thresholds [m1, m2], [m'1, m'2] and [m'1, m'2] of the corresponding spatial dimensions are set. [m"1,m"2], and M2>m2,m1>M1; M'2>m'2,m'1>M'1; M"2>m"2,m"1>M"1; only the point cloud data within [m1,m2], [m'1,m'2] and [m"1,m"2] are retained to obtain the first filtered point cloud data.
6. The method for extracting casting surface point cloud contour based on neural network according to claim 4, characterized in that: In S22, the process of using Gaussian statistical filtering to process the first filtered point cloud data to obtain the second filtered point cloud data is as follows: For any point in the first filtered point cloud data, calculate the sum of its distances to the remaining k neighboring points in the neighborhood, and calculate the average distance D based on the sum of the distances n , the calculation formula is as follows: Where x', y', z' are the three-dimensional coordinates of any point in the first filtered point cloud data; i ,y i ,z i is the coordinate of any neighborhood point; The average value m and standard deviation δ are calculated based on the average distance of N points in the first filtered point cloud data. The calculation formula is as follows: The segmentation threshold L is calculated based on the standard deviation δ, and the calculation formula is: L=m+m t *δ In the formula, m t is the multiplication factor; Traverse the first filtered point cloud data and compare the average value D of each point therein n with the numerical value of the segmentation threshold. If D n < L, retain the corresponding point; otherwise, remove the corresponding point; Finally, the second filtered point cloud data is obtained.
Citation Information
Patent Citations
Analysis method and system for nail black line dermatoscope image
CN113012138A
Surface crack identification method and device
CN116452944A
Far small target point cloud data feature enhancement method based on attention mechanism
CN116824533A
Part edge feature extraction method and device, electronic equipment and storage medium
CN116994000A
Coronary artery image segmentation method and system based on deep learning
CN117495876A
Cited By
Casting riser image recognition method based on machine learning
CN121033528A