A method for extracting the contour of point cloud on the surface of castings based on neural networks

By using an improved UNet++ neural network, combined with spatial and channel attention modules, the problems of insufficient point cloud extraction and noise interference in existing technologies are solved, enabling accurate identification and efficient cleaning of casting surface areas.

CN120070483BActive Publication Date: 2026-05-26CRRC TECH INNOVATION (BEIJING) CO LTD +1

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
CRRC TECH INNOVATION (BEIJING) CO LTD
Filing Date
2025-02-05
Publication Date
2026-05-26

AI Technical Summary

Technical Problem

Existing point cloud extraction technologies are insufficient for feature extraction in industrial scenarios, are easily affected by noise, and are difficult to adapt to the diversity of target shapes. This makes it difficult for robots to accurately identify various parts of the casting surface, affecting the efficiency of casting cleaning.

Method used

A point cloud edge detection network based on UNet++ neural network is adopted, which combines spatial attention module and channel attention module to perform preprocessing and feature extraction of point cloud data on casting surface, including background filtering, Gaussian statistical filtering and downsampling, and construct point cloud edge detection network UANet++.

Benefits of technology

It improves the accuracy of surface part identification of castings and the adaptability to complex industrial scenarios, enhances the ability to capture detailed features of target point clouds, reduces noise interference, and improves the efficiency of robot cleaning of castings.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120070483B_ABST
    Figure CN120070483B_ABST
Patent Text Reader

Abstract

This invention discloses a method for extracting the contours of point clouds on the surface of castings based on neural networks. The method comprises the following steps: S1: acquiring point cloud data of the casting surface; S2: preprocessing the point cloud data; S3: constructing a point cloud edge detection network based on a UNet++ neural network and training the network 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; S4: identifying the contours of various parts of the casting surface based on the trained point cloud edge detection network. This invention enhances the ability to capture detailed features of the target point cloud by constructing a point cloud edge detection network and extracting attention features of the center point features, while also exhibiting stronger robustness to sparse and noisy point clouds. Extracting the point cloud contours of parts on the casting surface using the point cloud edge detection network improves the accuracy of robots in identifying different shaped parts of the casting surface and provides better adaptability in complex industrial scenarios.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of machine vision-assisted robot casting cleaning technology, and in particular to a method for extracting the point cloud contour of casting surfaces based on neural networks. Background Technology

[0002] Castings have many advantages, such as low production cost and wide adaptability, and are widely used in various industries. Before being put into use, castings need to be cleaned on all parts of their surface to meet operational requirements. With the rapid development of automation technology, people are gradually using robots to replace manual labor in cleaning castings, reducing labor intensity and improving production efficiency. However, the prerequisite for automating the cleaning of castings with robots is the accurate identification of each part of the casting surface.

[0003] 3D point cloud data can preserve the specific information of a target in three-dimensional space, and this information is more detailed and richer than that of two-dimensional images. 3D point clouds can effectively retain information about various parts of a casting surface. Neural networks, as a computational model, are widely used in machine learning, artificial intelligence, and image recognition. Combining point cloud processing algorithms with neural networks to extract the point cloud contours of casting surfaces allows for accurate identification of the contours of various parts of the casting surface. This technology is crucial for automating the cleaning of castings using robots. However, existing point cloud extraction technologies in industrial applications mainly suffer from insufficient feature extraction, susceptibility to noise interference, and difficulty adapting to the diversity of target shapes. These issues lead to inaccurate identification of various parts of the casting surface, preventing robots from efficiently performing the cleaning work. Summary of the Invention

[0004] This invention provides a neural network-based method for extracting the contour of point cloud on the surface of castings. This method overcomes the problems of insufficient feature extraction, susceptibility to noise interference, and difficulty in adapting to the diversity of target shapes in existing point cloud extraction technologies used in industrial applications. These problems lead to difficulties in accurately identifying various parts of the casting surface, making it difficult for robots to efficiently perform the cleaning work on the castings.

[0005] To achieve the above objectives, the technical solution of the present invention is as follows:

[0006] A method for extracting the contour of point cloud on the surface of a casting based on a neural network, comprising the following steps:

[0007] S1: Acquire point cloud data of the casting surface;

[0008] S2: Preprocess the point cloud data of the casting surface to obtain processed point cloud data;

[0009] S3: Construct a point cloud edge detection network based on the UNet++ neural network, and train the point cloud edge detection network using the processed point cloud data to obtain the 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 then 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 attention features from 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 various parts of the casting surface based on the decoded attention features;

[0017] S4: Based on the trained point cloud edge detection network, the contour of the actual casting surface point cloud data is extracted to identify the contour of each part of the casting surface.

[0018] Furthermore, 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 region attention features of the center point features, and the process is as follows:

[0021] The downsampling layer downsamples the features of the center point to obtain several center points and a total of k neighboring points in a spherical neighborhood around each center point.

[0022] The feature region is initially constructed using a feature region construction unit, and its expression is as follows:

[0023] e ij =(x i,x j -x i ,desnity(x j ))

[0024] In the formula, x i Let x represent the center point. j It is the j-th neighboring point within the spherical neighborhood around the center point obtained after downsampling, desnity(x) j ) represents the neighborhood point x j The average distance to m neighborhood points;

[0025] The feature region is processed to obtain the neighborhood points x within the spherical neighborhood around the center point. j The weight matrix W i Its form is as follows:

[0026] W i =σ1(Max(F) c (e i )))

[0027] Among them, e i F represents the characteristic region constructed by the center point and k neighboring points within its surrounding spherical neighborhood; c σ1 represents the first fully connected layer, Max represents the max pooling layer, and σ1 represents the first sigmoid activation function.

[0028] Specifically, the feature region is convolved through a first fully connected layer to obtain spatial convolutional features, which are then transmitted to the max pooling layer.

[0029] The max pooling layer performs pooling processing on the spatial convolutional features to obtain pooled features, which are then transmitted to the first sigmoid activation function.

[0030] The first sigmoid activation function normalizes each weight of the pooling feature to a value between 0 and 1, resulting in a weight matrix W of dimension (k,1). i ; and the weight matrix W i Each weight coefficient in the algorithm is multiplied by the feature values ​​of all channels of the corresponding neighboring point to obtain the regional attention feature of the center point.

[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 channel attention features from the region attention features, including:

[0033] The expression for the channel attention module is as follows:

[0034] x out =F scale (σ3(F2(σ2(F1(Avg(x in ))))),p)

[0035] In the formula, x in For the region attention features, F1 and F2 represent the second fully connected layer and the third fully connected layer, respectively. scale This indicates that weights are assigned to the features, where σ2 and σ3 represent the first ReLU activation function and the second sigmoid activation function, respectively; Avg is the average pooling layer; and p is the number of feature channels.

[0036] The input data x is processed through an average pooling layer. in The dimension (n, c1) is reduced to (1, c1), resulting in the first dimensionality-reduced feature, which is then transmitted to the second fully connected layer; n represents the total number of points, and c1 is the number of feature channels for each point;

[0037] The first dimensionality-reduced feature is convolved by the second fully connected layer to obtain the first convolutional feature with dimension (1, c2), and then transmitted to the first ReLU activation function.

[0038] The first convolutional feature is nonlinearly transformed by the first ReLU activation function to obtain the first nonlinear feature, which is then transmitted to the third fully connected layer.

[0039] The first nonlinear feature is convolved by the third fully connected layer to obtain the second convolutional feature with dimension (1, c1), and then transmitted to the second sigmoid activation function.

[0040] The second sigmoid activation function is used to normalize each weight of the second convolutional feature to a range between 0 and 1, resulting in a channel weight matrix of dimension (1, c1). The weight coefficients in the channel weight matrix are then multiplied by the feature channels corresponding to the point clouds within the region attention feature to obtain the channel attention feature in the region attention feature.

[0041] Furthermore, in S2, the preprocessing of the point cloud data on the surface of the casting includes:

[0042] S21: Background filtering is performed on the point cloud data of the casting surface to obtain the first filtered point cloud data;

[0043] S22: The first filtered point cloud data is processed by Gaussian statistical filtering to obtain the second filtered point cloud data;

[0044] S23: Downsample the second filtered point cloud data to obtain the processed point cloud data.

[0045] Further, in S21, the process of obtaining the first filtered point cloud data by performing background filtering on the point cloud data of the casting surface is as follows:

[0046] Obtain the distance limits [M1, M2], [M’1, M’2], and [M”1, M”2] of the point cloud data of the casting surface in each spatial dimension;

[0047] Set the distance thresholds [m1, m2], [m’1, m’2], and [m”1, m”2] for the corresponding spatial dimensions according to the distance limits, and M2 > m2, m1 > M1; M’2 > m’2, m’1 > M’1; M”2 > m”2, m”1 > M”1; only retain the point cloud data within [m1, m2], [m’1, m’2], and [m”1, m”2] to obtain the first filtered point cloud data.

[0048] Further, in S22, the process of obtaining the second filtered point cloud data by processing the first filtered point cloud data using Gaussian statistical filtering is as follows:

[0049] For any point in the first filtered point cloud data, calculate the sum of the distances between it and the remaining k neighborhood 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 neighborhood 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 values of the average value D of each point therein n with the segmentation threshold. If D n < L, retain the corresponding point; otherwise, remove the corresponding point;

[0058] Finally, the second filtered point cloud data is obtained.

[0059] Beneficial Effects: This invention constructs a point cloud edge detection network, adding an attention module to the UNet++ neural network to extract attention features of the center point, enhancing the ability to capture detailed features of the target point cloud, and also improving robustness to sparse and noisy point clouds. By extracting the point cloud contours of casting surface areas through the point cloud edge detection network, the accuracy of robots in recognizing different shaped parts of the casting surface is improved, demonstrating better adaptability in complex industrial scenarios. Attached Figure Description

[0060] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0061] Figure 1 This is a flowchart of a method for extracting the point cloud contour of a casting surface based on a neural network, as described in this invention. Detailed Implementation

[0062] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0063] This embodiment provides a method for extracting the point cloud contour of a casting surface based on a neural network, such as... Figure 1 As shown, the specific steps include:

[0064] S1: Acquire point cloud data of the casting surface;

[0065] Specifically, point cloud data of the casting surface is acquired using a 3D binocular camera;

[0066] S2: Preprocess the point cloud data of the casting surface to obtain processed point cloud data;

[0067] S3: Construct a point cloud edge detection network UANet++ based on the UNet++ neural network, and train the point cloud edge detection network using 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 encoded point cloud data, and then transmit it to the feature extraction module.

[0071] 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;

[0072] The attention module is used to extract attention features from the center point features and transmit them to the decoder module;

[0073] The decoder module is used to decode the attention features and transmit the decoded attention features to the output layer;

[0074] The output layer is used to output the contours of various parts of the casting surface based on the decoded attention features;

[0075] S4: Based on the trained point cloud edge detection network, the contour of the actual casting surface point cloud data is extracted to identify the contour 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 region attention features of the center point features, and the process is as follows:

[0078] The downsampling layer downsamples the features of the center point to obtain several center points and k neighboring points in a spherical neighborhood around each center point.

[0079] The feature region is initially constructed using a 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 Let x represent the center point.j It is the j-th neighboring point within the spherical neighborhood around the center point obtained after downsampling, based on x. i and x j Construct a feature region, where x is located in the feature region. j -x i It contains the neighborhood point x j Relative to the center point x i Location information, desnity(x) j ) represents the neighborhood point x j The average distance to m neighboring points indicates, to some extent, the complexity of the shape surrounding the neighboring points; the more complex the shape, the higher the density (x). j The higher the value, the better;

[0082] The feature region is processed to obtain the neighborhood points x within the spherical neighborhood around the center point. j The weight matrix W i Its form is as follows:

[0083] W i =σ1(Max(F) c (e i )))

[0084] Among them, e i F represents the characteristic region constructed by the center point and k neighboring points within its surrounding spherical neighborhood. c σ1 represents the first fully connected layer, Max represents the max pooling layer, and σ1 represents the first sigmoid activation function.

[0085] Specifically, the feature region is convolved through a first fully connected layer to obtain spatial convolutional features, which are then transmitted to the max pooling layer.

[0086] The max pooling layer performs pooling processing on the spatial convolutional features to obtain pooled features, which are then transmitted to the first sigmoid activation function.

[0087] The first sigmoid activation function normalizes each weight of the pooling feature to a value between 0 and 1, resulting in a weight matrix W of dimension (k,1). i ; and the weight matrix W i Each weight coefficient in the algorithm is multiplied by the feature values ​​of all channels of the corresponding neighboring point to obtain the regional attention feature of the center point.

[0088] Specifically, in this embodiment, since the local shape features of the point cloud are learned by using the surrounding neighborhood points of the center point, the selection of neighborhood points has a significant impact on the accuracy of point cloud edge detection. Therefore, this embodiment adds a spatial attention module to the UNet++ neural network. The spatial attention module can learn a spatial weight matrix based on the relative positional relationship between each neighborhood point and the center point, as well as the distribution of points around the neighborhood point itself. Each neighborhood point is assigned a weight. At the same time, the spatial attention module can take into account the different importance of points at different positions in the neighborhood space, thereby increasing the model's attention to more critical neighborhood points around the query point and generating a weight matrix of neighborhood points around the center point.

[0089] In a specific embodiment, since different channels in the region feature 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 channel attention features from the region attention features, including:

[0091] The expression for the channel attention module is as follows:

[0092] x out =F scale (σ3(F2(σ2(F1(Avg(x in ))))),p)

[0093] In the formula, x in For the region attention features, F1 and F2 represent the second fully connected layer and the third fully connected layer, respectively. scale This indicates that weights are assigned to the features, where σ2 and σ3 represent the first ReLU activation function and the second sigmoid activation function, respectively; Avg is the average pooling layer; and p is the number of feature channels.

[0094] The input data x is processed through an average pooling layer. in The dimension (n, c1) is reduced to (1, c1), resulting in the first dimensionality-reduced feature, which is then transmitted to the second fully connected layer; n represents the total number of points, and c1 is the number of feature channels for each point;

[0095] The first dimensionality-reduced feature is convolved by the second fully connected layer to obtain the first convolutional feature with dimension (1, c2), and then transmitted to the first ReLU activation function.

[0096] The first convolutional feature is nonlinearly transformed by the first ReLU activation function to obtain the first nonlinear feature, which is then transmitted to the third fully connected layer.

[0097] The first nonlinear feature is convolved by the third fully connected layer to obtain the second convolutional feature with dimension (1, c1), and then transmitted to the second sigmoid activation function.

[0098] The second sigmoid activation function is used to normalize each weight of the second convolutional feature to a range between 0 and 1, resulting in a channel weight matrix of dimension (1, c1). The weight coefficients in the channel weight matrix are then multiplied by the feature channels corresponding to the point clouds within the region attention feature to obtain the channel attention feature in the region attention feature.

[0099] Specifically, the channel attention module can learn a channel weight matrix, enhance attention to important feature channels, and reduce attention to channels that are not of much use to the current task, thereby strengthening the ability to capture feature information.

[0100] Specifically, in this embodiment, the structure of the UNet++ neural network based on image processing is improved by adding a spatial attention module, which mainly focuses on information in the spatial domain. It learns a spatial weight matrix through the location and density information of neighboring points and assigns weights to neighboring points at different locations to achieve adaptive selection of neighboring points. A channel attention module is added, which mainly focuses on information in the channel domain. It learns a channel weight matrix for features, thereby increasing attention to edge features and enhancing the ability to capture feature information. Finally, a point cloud edge detection network UANet++ is formed, which is used to extract the contour of the processed casting surface point cloud data.

[0101] In a specific embodiment, since the acquired point cloud data of the casting surface contains many noisy point clouds such as outliers and redundant points, in order to quickly extract the target point cloud, it is necessary to preprocess the point cloud data of the casting surface to remove redundant point clouds, thereby improving the speed of the algorithm and obtaining more precise and effective point cloud data, ensuring the accuracy of the extracted point cloud data information, and reducing interference to the subsequent processing.

[0102] In a specific embodiment, S2, the process of preprocessing the point cloud data of the casting surface includes:

[0103] S21: Background filtering is performed on the point cloud data of the casting surface to obtain the first filtered point cloud data;

[0104] In a specific embodiment, in S21, the process of performing background filtering on the point cloud data of the casting surface to obtain the first filtered point cloud data is as follows:

[0105] In this embodiment, the point cloud data of the casting surface collected has three dimensions: x, y, and z. The distance limits [M1, M2], [M'1, M'2], and [M”1, M”2] of the point cloud data of the casting surface in each spatial dimension are obtained.

[0106] Based on the distance limits, set distance thresholds [m1,m2], [m'1,m'2], and [m”1,m”2] for the corresponding spatial dimensions, where M2>m2, m1>M1; M'2>m'2, m'1>M'1; M”2>m”2, m”1>M”1; retain only point cloud data within [m1,m2], [m'1,m'2], and [m”1,m”2] to reduce redundant point cloud data and obtain the first filtered point cloud data.

[0107] S22: The first filtered point cloud data is processed by Gaussian statistical filtering to obtain the second filtered point cloud data;

[0108] In a specific embodiment, 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 its neighborhood, and calculate the average distance D based on the sum of the distances. n 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 Let the coordinates be any neighboring point;

[0112] The mean m and standard deviation δ are calculated based on the average distance of N points in the first filtered point cloud data, using the following formulas:

[0113]

[0114] The segmentation threshold L is calculated based on the standard deviation δ, and the calculation formula is as follows:

[0115] L=m+m t *δ

[0116] In the formula, m t This is a multiplier factor, which can be set according to the size of the workpiece point cloud data.

[0117] Iterate through the first filtered point cloud data and compare the average value D of each point. n The magnitude of the segmentation threshold, if Dn <If L, retain the corresponding points; otherwise, remove the corresponding points.

[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, so as to obtain more refined and effective point cloud data. According to the quantity of the second filtered point cloud data, the point cloud processing function is called to divide the three-dimensional space where the point cloud data is located into a series of cubes with equal side lengths and adjacent to each other, that is, voxel grids. Taking each voxel grid as the basic unit, all the point clouds in each voxel grid are successively replaced by one point, thus realizing the reduction of the quantity of point clouds and achieving the effect of downsampling.

[0121] In this embodiment, the improved UANet++ is compared with the original network model through experiments to prove the superiority after the model improvement. The obtained 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 all indicators. Among them, the F1 value is increased by 0.2455, the precision is increased by 23.26%, the recall 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 recorded 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 neural network-based method for extracting a profile of a point cloud of a casting surface, characterized in that, The specific steps include: S1: Acquire point cloud data of the casting surface; S2: Preprocess the point cloud data of the casting surface to obtain processed point cloud data; S3: Construct a point cloud edge detection network based on the UNet++ neural network, and train the point cloud edge detection network using the processed point cloud data to obtain the 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 encoded point cloud data, and then 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 attention features from the center point features and transmit them to the decoder module; 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 max pooling layer, and a first sigmoid activation function; The spatial attention module is used to extract the region attention features of the center point features, and the process is as follows: down-sampling the center point features by the down-sampling layer to obtain a plurality of center points and a plurality of neighborhood points in a spherical neighborhood around each center point k ​ The feature region is initially constructed using a feature region construction unit, and its expression is as follows: , wherein denotes the center point, is the i-th neighbor point in a spherical neighborhood around the center point obtained by downsampling, j is the i-th neighbor point in a spherical neighborhood around the center point obtained by downsampling, denotes the neighbor point and m the average distance of the i-th neighbor point to the k-th field point. processing the feature region to obtain neighborhood points in a spherical neighborhood around the center point weight matrix of the feature region in the form , in, Represents the common area of ​​the center point and the surrounding spherical neighborhood. k A characteristic region is constructed from a number of neighboring points; This represents the first fully connected layer. Max Indicates the max pooling layer. This represents the first sigmoid activation function; Specifically, the feature region is convolved through a first fully connected layer to obtain spatial convolutional features, which are then transmitted to the max pooling layer. The max pooling layer performs pooling processing on the spatial convolutional features to obtain pooled features, which are then transmitted to the first sigmoid activation function. The first sigmoid activation function normalizes each weight of the pooling feature to a value between 0 and 1, resulting in a dimension of weight matrix ; and the weight matrix Each weight coefficient in the model is multiplied by the feature values ​​of all channels of the corresponding neighboring point to obtain the regional attention feature of the center point; The decoder module is used to decode the attention features and transmit the decoded attention features to the output layer; The output layer is used to output the contours of various parts of the casting surface based on the decoded attention features; S4: Based on the trained point cloud edge detection network, the contour of the actual casting surface point cloud data is extracted to identify the contour of each part of the casting surface.

2. The method for extracting the point cloud contour of a casting surface based on a neural network according to claim 1, 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 channel attention features from the region attention features, including: The expression for the channel attention module is as follows: , In the formula, The region attention features, and These represent the second fully connected layer and the third fully connected layer, respectively. This indicates that weights are assigned to the features. and These represent the first ReLU activation function and the second sigmoid activation function, respectively. For average pooling layers; Number of feature channels; The input data is processed through an average pooling layer. Dimensions Reduced to The first dimensionality reduction feature is obtained and transmitted to the second fully connected layer; This represents the total number of points. The number of feature channels for each point; The first dimensionality-reduced feature is convolved by a second fully connected layer to obtain a feature with dimension . The first convolutional features are then passed to the first ReLU activation function; The first convolutional feature is nonlinearly transformed by the first ReLU activation function to obtain the first nonlinear feature, which is then transmitted to the third fully connected layer. The first nonlinear feature is convolved by a third fully connected layer to obtain a dimension of The second convolutional features are then passed to the second sigmoid activation function. The second sigmoid activation function is used to normalize each weight of the second convolutional feature to a value between 0 and 1, resulting in a dimension of... The channel weight matrix is ​​obtained; and the weight coefficients in the channel weight matrix are multiplied by the feature channels corresponding to the point clouds in the region attention features to obtain the channel attention features in the region attention features.

3. The method for extracting the point cloud contour of a casting surface based on a neural network according to claim 2, characterized in that, In S2, the preprocessing of the point cloud data on the surface of the casting includes: S21: Background filtering is performed on the point cloud data of the casting surface to obtain the first filtered point cloud data; S22: The first filtered point cloud data is processed by Gaussian statistical filtering to obtain the second filtered point cloud data; S23: Downsample the second filtered point cloud data to obtain the processed point cloud data.

4. The method for extracting the point cloud contour of a casting surface based on a neural network according to claim 3, characterized in that, In S21, the process of performing background filtering on the point cloud data of the casting surface to obtain the first filtered point cloud data is as follows: Obtain the distance limits of the point cloud data of the casting surface in each spatial dimension. , and ; Set a distance threshold for the corresponding spatial dimension based on the distance limit. , and ,and , ; , ; , Only retained in , and The point cloud data within the data is used to obtain the first filtered point cloud data.

5. The method for extracting the point cloud contour of a casting surface based on a neural network according to claim 3, 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 its relationship with the remaining points in its neighborhood. The sum of distances to each neighboring point is used to calculate the average distance. The calculation formula is as follows: , In the formula, The three-dimensional coordinates of any point in the first filtered point cloud data; , , Let the coordinates be any neighboring point; According to the first filtered point cloud data, the total Calculate the average distance of each point. and standard deviation The calculation formula is as follows: , , Based on the standard deviation Calculate the segmentation threshold The calculation formula is: , In the formula, It is a multiple factor; Iterate through the first filtered point cloud data and compare the average value of each point. The magnitude of the segmentation threshold, if If the condition is met, the corresponding point is retained; otherwise, the corresponding point is removed. Finally, the second filtered point cloud data is obtained.