A three-dimensional workpiece surface defect identification method, system and storage medium
Patent Information
- Application Number
- CN202611518804.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-09-29
- Publication Date
- 2026-10-30
AI Technical Summary
[0004]为了解决现有技术中二维图像检测易受光照反射、纹理背景及颜色变化干扰,难以准确识别微小三维形貌缺陷的问题,本发明提供一种三维工件表面缺陷识别方法、系统及存储介质
[0013]本发明通过结合局部曲面变化率与欧氏距离进行迭代采样,提高几何显著区域在下采样过程中的保留概率;在局部区域构建中,基于协方差矩阵建立局部参考坐标系,并利用各向异性椭球空间筛选贴合曲面分布的局部点集;通过三轴六方向近邻搜索构建关联特征,表征多方向空间形貌变化;利用正则化马氏距离注意力权重对局部特征进行加权聚合,生成稳定的区域描述子;进一步结合跨尺度差异向量与自适应门控融合机制,增强微小三维形貌变化的表达能力,从而提高三维工件表面缺陷识别的准确性与稳定性。
Smart Images

Figure CN123015565A_ABST
Abstract
Description
Technical Field
[0001] This application belongs to the field of defect identification, and in particular relates to a method, system and storage medium for identifying defects on the surface of a three-dimensional workpiece. Background Technology
[0002] Anodized aluminum alloy parts are widely used in consumer electronics, automotive components, precision structural parts, and decorative parts. Their surfaces typically form a dense oxide film, providing wear resistance, corrosion resistance, and decorative properties. However, during the anodizing process, factors such as substrate microstructure, pretreatment quality, electrolysis parameters, dyeing and sealing conditions, and handling and assembly processes can easily lead to defects on the workpiece surface, including pitting, pinholes, scratches, indentations, dents, protrusions, film undulations, localized burn marks, color differences, and fixture imprints. These defects are usually small in scale, have blurred boundaries, and easily overlap with the high reflectivity of the metal surface, fine textures, and oxide film color variations. It is difficult to reliably distinguish between true geometric defects and light reflection, shadows, or texture interference using only two-dimensional images.
[0003] Plastic IMR decorative parts are typically manufactured using in-mold transfer or in-mold decoration processes. They have a composite structure consisting of a pattern layer, a decorative film layer, and a plastic substrate, and are commonly used for exterior parts such as appliance panels, automotive interiors, electronic product casings, and control panels. The surface of these parts may exhibit geometric defects caused by injection molding, such as shrinkage, warping, bubbles, weld lines, and particle protrusions, as well as defects such as film misalignment, wrinkles, tears, localized film peeling, decorative layer undulations, and surface ripples. Because IMR decorative parts often have high-gloss, transparent, semi-transparent, or textured surfaces, two-dimensional visual inspection is easily affected by the pattern background, film reflection, and material translucency, leading to missed or false defects. Therefore, for aluminum alloy anodized parts and plastic IMR decorative parts that have surface texture, reflective properties, and subtle three-dimensional morphological changes, there is an urgent need to utilize three-dimensional point cloud detection methods that can characterize the surface spatial geometry. By acquiring the spatial coordinates, local curvature, normal vector, and height undulation information of the workpiece surface, three-dimensional morphological features such as pits, protrusions, scratches, cracks, ripples, and film undulations can be characterized, thereby reducing the interference of lighting, color, and texture changes on the detection results and improving the accuracy and stability of surface defect identification for exterior parts. Summary of the Invention
[0004] To address the problem that existing two-dimensional image detection technologies are susceptible to interference from light reflection, texture background, and color changes, making it difficult to accurately identify minute three-dimensional morphological defects, this invention provides a method, system, and storage medium for identifying three-dimensional workpiece surface defects.
[0005] In a first aspect, the present invention provides a method for identifying surface defects on a three-dimensional workpiece, comprising the following steps:
[0006] Acquire and preprocess the original point cloud data of the 3D workpiece to obtain the target point cloud containing coordinate and normal vector information;
[0007] Multi-level feature extraction is performed on the target point cloud. Each layer involves calculating the geometric saliency based on the local surface change rate of each point, and iteratively sampling through a cost function using Euclidean distance to obtain a set of center points. For each center point, its corresponding local neighborhood covariance matrix and eigenvalue decomposition results are called. A local reference coordinate system is established based on the feature vectors, and an anisotropic ellipsoidal space is constructed based on the eigenvalues to search for a local point set. For each local point, the nearest point is searched in the six positive and negative directions of the three axes parallel to the local reference coordinate system with the local point as the reference. The features of the point itself and the nearest points in the six directions are fused to construct the three-axis association features. Mahalanobis distance attention weights are calculated based on the inverse of the regularized covariance matrix, and the three-axis association features of the local point set are weighted and aggregated accordingly to generate a local region descriptor for the center point.
[0008] The local region descriptors of each layer are propagated to the original point cloud through feature upsampling to obtain a multi-scale feature vector for each point. The feature vectors of adjacent scales are channel aligned and their absolute differences with the feature vector of the current scale are calculated to obtain a difference vector representing cross-scale changes. The adaptive gating unit is controlled to perform weighted and nonlinear fusion on the current scale feature vector and the difference vector to generate a fused feature vector. The fused feature vector is input into the point cloud segmentation network to output the defect probability.
[0009] On the other hand, the present invention also provides a three-dimensional workpiece surface defect identification system, comprising the following modules:
[0010] The acquisition module is used to acquire and preprocess the original point cloud data of the 3D workpiece to obtain the target point cloud containing coordinate and normal vector information.
[0011] The aggregation module is used to perform multi-level feature extraction on the target point cloud. Each layer of operation involves calculating the geometric saliency based on the local surface change rate of each point, and iteratively sampling through a cost function using Euclidean distance to obtain a set of center points. For each center point, its corresponding local neighborhood covariance matrix and eigenvalue decomposition results are called. A local reference coordinate system is established based on the feature vectors, and an anisotropic ellipsoidal space is constructed based on the eigenvalues to search for a local point set. For each local point, the nearest point is searched in the six positive and negative directions of the three axes parallel to the local reference coordinate system with the local point as the reference. The features of the point itself and the nearest points in the six directions are fused to construct the three-axis association features. The Mahalanobis distance attention weight is calculated based on the inverse of the regularized covariance matrix, and the three-axis association features of the local point set are weighted and aggregated accordingly to generate a local region descriptor for the center point.
[0012] The output module is used to propagate the local region descriptors of each layer to the original point cloud through feature upsampling to obtain the multi-scale feature vector of each point; perform channel alignment on the feature vectors of adjacent scales and calculate the absolute difference between them and the feature vector of the current scale to obtain the difference vector representing the cross-scale change; control the adaptive gating unit to perform weighted and nonlinear fusion on the current scale feature vector and the difference vector to generate a fused feature vector; input the fused feature vector into the point cloud segmentation network and output the defect probability.
[0013] This invention improves the retention probability of geometrically salient regions during downsampling by combining local surface change rate and Euclidean distance for iterative sampling. In local region construction, a local reference coordinate system is established based on the covariance matrix, and a set of local points conforming to the surface distribution is selected using anisotropic ellipsoidal space. Associated features are constructed through a three-axis, six-directional nearest neighbor search to characterize multi-directional spatial morphological changes. Regularized Mahalanobis distance attention weights are used to weighted aggregate local features to generate stable region descriptors. Furthermore, the cross-scale difference vector and adaptive gating fusion mechanism are combined to enhance the expressive power of minute three-dimensional morphological changes, thereby improving the accuracy and stability of three-dimensional workpiece surface defect identification. Attached Figure Description
[0014] Figure 1 A flowchart of the first embodiment;
[0015] Figure 2 A schematic diagram illustrating the principle of sampling the geometric saliency center point;
[0016] Figure 3 A schematic diagram of adaptive neighborhood construction for anisotropic ellipsoids. Detailed Implementation
[0017] To make the objectives, technical solutions, and advantages of this invention clearer, the invention will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the invention.
[0018] In the first embodiment, the present invention proposes a method for identifying three-dimensional workpiece surface defects, such as... Figure 1 As shown, it includes:
[0019] S1: Acquire and preprocess the original point cloud data of the 3D workpiece to obtain the target point cloud containing coordinate and normal vector information.
[0020] Read raw point cloud data in PLY format acquired by an industrial 3D scanner.
[0021] The original point cloud data includes three-dimensional point cloud data obtained by performing structured light scanning or laser scanning on the surfaces of aluminum alloy anodized shells, aluminum alloy anodized structural parts, plastic IMR decorative panels, and plastic IMR exterior shells.
[0022] Perform voxel filtering to remove redundant and overlapping points. Also perform a statistical outlier removal algorithm to remove isolated floating noise points.
[0023] The local covariance matrix of each point is calculated using the KDTree nearest neighbor search algorithm, and the principal component analysis (PCA) algorithm is executed to obtain the eigenvector corresponding to the smallest eigenvalue, which is then used as the unit normal vector of that point.
[0024] By stitching together three-dimensional spatial coordinates and three-dimensional normal vectors along the channel dimension, a target point cloud feature matrix with dimensions of N rows and 6 columns is formed.
[0025] In an optional embodiment, the step of acquiring and preprocessing the original point cloud data of the 3D workpiece to obtain a target point cloud containing coordinate and normal vector information includes:
[0026] The original point cloud data is divided into a three-dimensional voxel grid with a set side length.
[0027] Calculate the average coordinates of all discrete points within each voxel grid, and use this average as the centroid of the voxel grid. Reconstruct a sparse point cloud using all centroids.
[0028] For each centroid point in the sparse point cloud, the K-nearest neighbor algorithm is used to search for a set of spatial neighboring points, and the covariance matrix of the neighboring point set is calculated.
[0029] The covariance matrix is decomposed into eigenvalues, and the eigenvector corresponding to the smallest eigenvalue is extracted. The eigenvector is used as the initial normal vector of the centroid point, and the initial normal vector is adjusted for directional consistency based on the viewpoint direction to obtain the target point cloud containing coordinate and normal vector information.
[0030] Acquire the original point cloud of aluminum alloy anodized parts, plastic IMR decorative parts, industrial gears, or aero-engine blades obtained by a 3D laser scanner. , At this point, the data volume is typically in the hundreds of thousands to millions, for example, N=500,000. Among them, aluminum alloy anodized parts include metal exterior parts that have undergone anodizing, dyeing, or sealing treatments, while plastic IMR decorative parts include composite exterior parts with a decorative film layer, a printed pattern layer, and an injection-molded substrate. The entire 3D bounding box is divided into voxel sides with lengths set to... ∈[0.5,2.0]mm, for example, a three-dimensional voxel grid space with a voxel side length of 1.0mm.
[0031] Traverse each voxel grid. If there are m original points within that grid, calculate the arithmetic mean of their coordinates. A sparse point cloud with a scale of approximately 100,000 points was obtained by reconstructing the centroids of all non-empty voxels. .right any centroid To accelerate the nearest neighbor search process, a KD-Tree-based data structure is constructed, and the KNN algorithm is used to extract the K nearest neighbors in the local space to form a set. The preferred range for parameter K here is [15, 30], for example, K=20.
[0032] Calculate the neighborhood point set Given a 3×3 covariance matrix C, perform principal component analysis (EMF) on matrix C to obtain three non-negative eigenvalues and their corresponding orthogonal eigenvectors. Extract the eigenvector corresponding to the smallest eigenvalue as the centroid. initial normal vector .
[0033] Preset sensor viewpoint coordinates Assuming the scanner is located at the origin (0,0,0), calculate the vector. With normal vector The inner product of the normal vectors is used. If the inner product is less than 0, the normal vector is inverted to achieve global orientation consistency adjustment, and each point in the output is accompanied by normal vector information. The target point cloud.
[0034] S2 performs multi-level feature extraction on the target point cloud. Each layer operation calculates the geometric saliency based on the local surface change rate of each point, and combines Euclidean distance to iteratively sample through a cost function to obtain the center point set.
[0035] For each point in the current layer of the point cloud, obtain the local neighborhood covariance matrix and eigenvalue decomposition results. Divide the smallest eigenvalue by the sum of the three eigenvalues to calculate the local surface change rate, which is used as the geometric significance score for quantifying the curvature fluctuation of that point.
[0036] During the iterative sampling process, an empty set of center points is initialized. The first center point is randomly selected from the current layer point cloud and added to the center point set as the initial seed point. The cost of each subsequent candidate point selection is composed of the minimum Euclidean distance from the point to the selected center point set multiplied by its own geometric saliency score.
[0037] The FPS algorithm based on the value optimization of this generation is adopted. That is, each time all unsampled points are traversed, the point with the highest replacement value is selected and added to the center point set. This process of updating the minimum distance and searching for the maximum cost point is continuously iterated until the preset number of center point downsamplings for the current network layer is reached, thereby completing the construction of multi-level center point sets.
[0038] In an optional embodiment, the step of calculating geometric saliency based on the local surface change rate at each point, and obtaining the center point set by iterative sampling through a cost function using Euclidean distance, includes:
[0039] Based on the eigenvalue decomposition results of the covariance matrix, the first, second, and third eigenvalues are extracted in descending order. The ratio of the third eigenvalue to the sum of the three eigenvalues is taken as the local surface change rate of the corresponding point, thereby defining the geometric significance of this point.
[0040] Initialize the center point set to empty, then randomly select a point to add to the center point set;
[0041] Calculate the nearest Euclidean distance from each remaining candidate point to the set of added center points, and multiply the nearest Euclidean distance by the geometric saliency of the candidate point in a weighted manner to obtain the cost function value;
[0042] The candidate point with the largest cost function value is selected and added to the center point set. This calculation and selection process is performed iteratively until the number of points in the center point set reaches a preset threshold.
[0043] For each point in the target point cloud, the three descendingly ordered eigenvalues obtained by eigenvalue decomposition of its neighborhood covariance matrix are used. , , in Construct the formula for the rate of change of local surface This value represents the geometric significance at that point. When the point is in a flat region, the variance is mainly concentrated in two principal directions. ≈0. When the point is located in a high-frequency defect area such as an edge or corner, the variances in the three directions tend to converge. The value is increased, thus quantifying the importance of each point to the geometric shape representation. The principle of geometric saliency center point sampling is as follows: Figure 2 As shown, for pinholes, pits, indentations, and local protrusions in aluminum alloy anodized parts, and for film wrinkles, particle protrusions, shrinkage depressions, and edge warping defects in plastic IMR decorative parts, the local surface change rate is usually more prominent than that of flat background areas. Therefore, this geometric significance score can improve the probability of retaining small three-dimensional morphological anomalies during the sampling stage.
[0044] When the sampling process begins, the target center point set is initialized. Given an empty set, randomly select from a target point cloud of size N. Select a seed point join in In the middle, all remaining points are used to form a candidate point set. The cost function iterative sampling process begins. In the t-th iteration, t center points have been selected as the candidate set. any point in the middle Maintain and update a distance array The value is equal to the sum of the points in the set. The minimum Euclidean distance between all known center points in the region.
[0045] Construct a nonlinear cost function that combines spatial homogeneity and geometric saliency. The smoothing constant ϵ is preferably 0.01. The candidate point with the largest cost function value is searched and moved into the center point set. Simultaneously update the shortest distance of the remaining candidate points. This iterative process of combining farthest point sampling with feature saliency continues in a loop until the center point set is reached. When the number of internal elements reaches a preset threshold M, for example, the first layer of downsampling compresses the number of points from 4096 to 1024, obtaining a set of center points that are evenly distributed in space and cover sharp corners and defect edges.
[0046] S3: For each center point, call its corresponding local neighborhood covariance matrix and eigenvalue decomposition results, establish a local reference coordinate system based on the eigenvectors, construct an anisotropic ellipsoidal space based on the eigenvalues, and search for the local point set.
[0047] For each center point obtained by the aforementioned feature extraction layer, the local neighborhood covariance matrix and its eigenvalue decomposition results corresponding to that center point are called in the previous steps to obtain three mutually orthogonal eigenvectors and their corresponding eigenvalues.
[0048] By taking the eigenvectors corresponding to the largest eigenvalue, the intermediate eigenvalue, and the smallest eigenvalue as the X-axis, Y-axis, and Z-axis directions of the local reference coordinate system in sequence, a robust local reference coordinate system is established.
[0049] Simultaneously, these three eigenvalues are extracted and their square roots are taken as the three-dimensional semi-axis length parameters. Combined with the three coordinate axis basis vectors of the local reference coordinate system, an anisotropic ellipsoidal spatial analytical equation with the current center point as the geometric center is constructed.
[0050] Traverse the target point cloud, substitute the coordinate data into the ellipsoid equation to calculate the quadratic distance, determine whether the boundary condition of less than or equal to 1 is met, and filter out all three-dimensional points that fall on the surface and interior of the ellipsoid in the spatial distribution to form the anisotropic local point set corresponding to the center point.
[0051] In an optional embodiment, the step of constructing the anisotropic ellipsoidal space based on eigenvalues and searching for the local point set includes:
[0052] With the center point as the origin, the three eigenvectors of the covariance matrix as the axes, and the square roots of the corresponding three eigenvalues multiplied by a preset scaling factor as the semi-length of the three axes, an ellipsoidal neighborhood space surrounding the center point is constructed.
[0053] Calculate the standardized distance from each of the remaining points in the target point cloud to the center point in the ellipsoidal coordinate system. The standardized distance is the sum of the squares of the projection components of the coordinate difference vector between the candidate point and the center point along the three axes divided by the half length of the corresponding axis.
[0054] Points with a standardized distance less than or equal to 1 are selected as neighboring points, and all selected neighboring points are combined to form a local point set of the center point.
[0055] For each extracted center point The unit eigenvectors obtained by decomposing the local covariance matrix calculated in the preceding order are used. , , These represent the principal direction, secondary direction, and normal direction of the local distribution of the point cloud, respectively. A local orthogonal reference coordinate system is established using the spatial coordinates as the origin of the coordinate system.
[0056] The receptive field range is controlled by a scaling factor γ, with an optimal range of γ∈[2.0,5.0]. An example value of γ=3.0 is used. The semi-axial lengths of the local anisotropic ellipsoid in the three axes are calculated using the eigenvalues corresponding to the covariance matrix. , , Since the magnitude of the eigenvalues represents the variance of the point cloud distribution along the corresponding eigenvector direction, the ellipsoid exhibits an anisotropic bounding body shape that expands along the tangential plane of the surface and contracts along the normal direction, thus adapting to the actual curvature and topological undulations of the workpiece surface. For example... Figure 3 As shown.
[0057] When searching for neighboring points, the candidate point set after KD-Tree coarse screening within the point cloud is traversed using the maximum semi-circular radius R=max(a,b,c). For any candidate point... Calculate the coordinate difference vector The projection components of the difference vector along the three eigenvector directions are obtained using the vector dot product. , , .
[0058] Based on the principle of the ellipsoid equation in spatial analytic geometry, candidate points are calculated. The normalized squared distance relative to this ellipsoidal coordinate system Set a threshold for judgment; if the condition is met... ≤1.0, indicating point Points located inside or on the boundary of an anisotropic ellipsoid are included in the list of neighboring points. All neighboring points satisfying this criterion are aggregated into a center point. Anisotropic local point set .
[0059] S4. For each local point, search for the nearest point in the six positive and negative directions of the three axes that are based on the local point and parallel to the local reference coordinate system, and construct the three-axis correlation feature by fusing the features of the local point itself and the nearest points in the six directions.
[0060] Iterate through each local point in the aforementioned set of anisotropic local points.
[0061] Perform vector subtraction between the remaining candidate points in the local point set and the current local point to obtain the relative displacement coordinate vector. Then, using linear algebraic dot product operations, project the relative displacement coordinate vector onto the basis vectors of the X, Y, and Z axes of the local reference coordinate system.
[0062] Based on the angle or projection between the relative displacement coordinate vector and the positive and negative directions of the three principal axes of the local reference coordinate system, candidate nearest neighbor points are assigned to search regions in six directions parallel to the local reference coordinate system: +X, -X, +Y, -Y, +Z, and -Z.
[0063] Using the cKDTree spatial indexing algorithm, spatial constraint queries are performed in each of the six directional regions to find the nearest real physical point to the current local point via Euclidean distance. If the point set in a specific directional region is empty, the set is filled using the coordinates and normal vector characteristics of the current local point itself.
[0064] Extract the relative position features and normal vector features of the six nearest points in the search directions relative to the current local point, and concatenate them with the original features of the local point itself in the channel dimension.
[0065] The concatenated high-dimensional tensor is input into a multilayer perceptron (MLP) network consisting of a linear fully connected layer, a batch normalization layer, and a ReLU nonlinear activation function, to perform feature dimensionality reduction and compression and cross-directional semantic fusion operations, thereby outputting multi-channel triaxial correlation features.
[0066] In an optional embodiment, the step of searching for the nearest point within a three-axis positive and negative six-directional region based on the local point and parallel to the local reference coordinate system, and fusing its own features with the features of the six nearest points to construct three-axis associated features, includes:
[0067] Using each local point as a reference, six cone-shaped search regions are constructed, each parallel to the positive and negative directions of the three principal axes of the local reference coordinate system.
[0068] For each local point, calculate the Euclidean distance between the local point and the candidate nearest neighbor points in the corresponding six cone-shaped search areas. Select the closest point in each area as the projected neighbor point in the direction. If there is no candidate nearest neighbor point in a certain area, fill in the gap by using the local point itself as the projected neighbor point in the direction.
[0069] The local point's own features and the relative position features and normal vector features of its six projected neighboring points are extracted by a multilayer perceptron. After being concatenated along the channel dimension, the features are reduced in dimension and fused by a fully connected layer to output the three-axis correlation features of the local point.
[0070] For any local point in an anisotropic local point set Using the coordinates of this point itself as the origin, and utilizing the local reference coordinate system of its center point, its three orthogonal bases are... , , Extending along the positive and negative directions, six cone-shaped search regions are constructed in three-dimensional space, with the central direction vectors defined sequentially as follows: , , , , , .
[0071] For a specific direction among these 6 directions Where k∈{1,2,...,6}, according to the voxel side length Determine the preset query radius For example, setting , where β∈[1.5,5.0], when When =1.0mm and β=2.0, =2.0mm. (Calculated) All candidate points and direction vectors within the local neighborhood The angle between the two points is used to filter out candidate nearest neighbor points whose cosine value of the angle is greater than 0.5, i.e., the angle is less than 60°, thus forming a candidate subset in that direction.
[0072] Calculate the distance to each point within the candidate subset. The Euclidean distance is used to select the closest point as the direction by minimizing the function. Projected neighboring points If, for a certain conical region, no point satisfying the included angle threshold condition is found within the search range, such as if the point is located at the physical end of the workpiece surface edge, then the local point itself is assigned to the projection neighbor point, thereby ensuring the consistency of the data structure and the integrity of the input dimension.
[0073] After acquiring the projected neighbor points in six directions, the deep feature encoding stage begins. A multilayer perceptron neural network is constructed to encode the local point's own features and the projected neighbor point features in the six directions. The local point's own features include 3D coordinates and a normal vector, with a dimension of 6. The projected neighbor point features in each direction include the relative position feature vector of the projected neighbor point relative to the local point and its own normal vector. The multilayer perceptron neural network has a three-layer structure, with the number of neuron channels in each layer set to 16, 32, and 64, respectively. This is used to map the local point's own features to 64-dimensional central local features and to map the projected neighbor point features in the six directions to 64-dimensional directional hidden layer features. The 64-dimensional central local features and the 64-dimensional directional hidden layer features in the six directions are concatenated along the feature channel dimension to generate a joint feature matrix with a total dimension of 448.
[0074] The concatenated joint features are input into a fully connected neural network, which includes a fully connected layer with 128 output channels and a ReLU activation function. This is used to perform dimensionality reduction mapping and nonlinear cross-fusion on the 448-dimensional joint feature matrix, and output a 128-dimensional three-axis correlated feature vector to characterize the multi-directional curvature changes and spatial morphology differences around local points.
[0075] S5 calculates Mahalanobis distance attention weights based on the inverse of the regularized covariance matrix, and then performs weighted aggregation of the three-axis correlation features of the local point set to generate a local region descriptor for the center point.
[0076] Extract the local neighborhood covariance matrix C corresponding to the current center point, and calculate its matrix trace Tr(C) as a regularization scale parameter. Scale this scale parameter according to a preset regularization coefficient and multiply it by a unit diagonal matrix to obtain a diagonal regularization term with the same dimensions as the covariance matrix C. Add the covariance matrix C to the diagonal regularization term to obtain the regularized covariance matrix.
[0077] Perform the inversion operation on the summed and smoothed regularized covariance matrix, and calculate the generalized Mahalanobis distance from each local point in the local point set to the center point based on the regularized inverse matrix.
[0078] After negating all the calculated Mahalanobis distances, the results are input into the Softmax normalization function, which converts them into attention weights in the form of a non-negative probability distribution with a sum of 1. That is, the smaller the Mahalanobis distance from the center point and the more closely the local data shape conforms to the distribution of the surface structure, the larger the attention weight value is assigned.
[0079] Using the weight vector obtained by the attention kernel function mapping, matrix multiplication and weighted summation are performed on the triaxial correlation features of all points in the local point set to realize the pooling aggregation operation of local spatial features, reduce redundant information, and generate a local region descriptor of the center point with fixed channel dimension.
[0080] In an optional embodiment, the step of calculating Mahalanobis distance attention weights based on the inverse of the regularized covariance matrix, and then weighting and aggregating the triaxial correlation features of the local point set accordingly to generate a local region descriptor for the center point, includes:
[0081] Calculate the coordinate difference vector between each local point and the center point, and use the inverse matrix of the covariance matrix after adding a diagonal regularization term with the same dimensions as the covariance matrix to calculate the Mahalanobis distance of the coordinate difference vector.
[0082] The negative value of the Mahalanobis distance is then input into the Softmax function to obtain the normalized attention weights of each local point relative to the center point.
[0083] The triaxial correlation features of each local point are multiplied by the corresponding normalized attention weights, and all weighted features within the local point set are summed to generate the local region descriptor of the center point.
[0084] For any center point and associated anisotropic local point sets Extract each local point Relative to the center point The relative coordinates are used to obtain the three-dimensional coordinate difference vector. Extract the originally calculated 3×3 covariance matrix C of the point set region, calculate its matrix trace Tr(C), and set the regularization coefficient ϵ∈
[10] . -4 10 -2 Preferably, ϵ=10 -3 Construct a matrix of regularized terms with the same dimensions , where I is a 3×3 identity matrix.
[0085] The corrected regularized covariance matrix is calculated as C + ΔC, and its stable inverse matrix is obtained through numerical decomposition. Based on this inverse matrix, the Mahalanobis distance of the coordinate difference vector is calculated. This distance value is used to characterize the degree of deviation of local points from the center point under anisotropic distribution.
[0086] Based on the Mahalanobis distance value corresponding to each local point, the Mahalanobis distance value is first negative to obtain the attention score for each local point. Since the number of local points K' in the neighborhood of the anisotropic ellipsoid is not fixed, the attention scores are further input into the Softmax function for normalization to obtain the normalized attention weights. This ensures that all weights within the local point set are non-negative and sum to 1. This forms an anisotropic attention kernel function that characterizes the importance of each local point relative to the center point.
[0087] In the information aggregation phase, scalar weights are used. High-dimensional triaxial correlation features previously extracted for each local point Its channel dimension is set to 128 for element-wise channel-based broadcast scaling multiplication. This applies to all points within the local point set. The weighted and modulated feature vectors of each point are aggregated and summed along their corresponding dimensions to generate a feature vector of dimension 1×128, which serves as a local region descriptor for the center point containing anisotropic structural properties.
[0088] S6 propagates the local region descriptors of each layer to the original point cloud through feature upsampling, obtaining a multi-scale feature vector for each point.
[0089] A feature propagation network module based on inverse distance weighted interpolation is used to perform feature upsampling and decoding operations.
[0090] For each point in the densely populated unsampled point set of the previous network layer, the KNN nearest neighbor search algorithm is used to find the three nearest Euclidean distances in the sparsely populated center point set of the current network layer. The reciprocal of the square of the three-dimensional Euclidean distance from these three center points to the unsampled point is calculated as the distance interpolation weight coefficient, and each distance interpolation weight coefficient is normalized by dividing it by the sum of the three distance interpolation weight coefficients.
[0091] The local region descriptors corresponding to the three nearest neighbor center points are summed channel by channel weighted summation with the normalized interpolation weight coefficients to achieve three-dimensional spatial interpolation restoration of deep features.
[0092] The feature map obtained by interpolation is concatenated and fused with the original features of the skip connections at the same resolution level of the unsampled points in the network encoder stage to complete the fine-grained information.
[0093] The feature propagation and interpolation process is performed layer by layer upwards until the feature map space size is restored to the same high-resolution scale as the original N points of the input point cloud.
[0094] The high-dimensional feature tensors output by each layer of feature propagation module are multi-dimensionally aggregated through channel dimension concatenation to obtain multi-scale feature vectors corresponding to each point that contain both shallow fine-grained geometric edge information and deep global contextual semantic information.
[0095] S7. Channel alignment is performed on the feature vectors of adjacent scales, and the absolute difference between them and the feature vector of the current scale is calculated to obtain the difference vector representing cross-scale changes. The adaptive gating unit is controlled to perform weighted and nonlinear fusion on the current scale feature vector and the difference vector to generate a fused feature vector.
[0096] By using a one-dimensional convolutional layer with a kernel size of 1×1, linear transformation and dimensionality-upgrading mapping of the channel dimension are performed on the feature maps of each point in the point cloud at different receptive field scales in the network, thereby unifying the feature dimension size of the two.
[0097] The absolute value of the difference between two adjacent scale feature tensors after channel dimension alignment at corresponding points and corresponding channel positions is calculated, thereby generating a high-dimensional difference vector to characterize the cross-scale geometric abrupt response information at the edge of a three-dimensional surface defect.
[0098] An adaptive gated attention unit structure is constructed, consisting of two fully connected layers with scaling factors and an intermediate ReLU nonlinear activation function. The current-scale feature vector and the cross-scale difference vector are concatenated along the feature channel dimension and then used as the overall input to the adaptive gated attention unit.
[0099] The adaptive gated modulation weight vector, with a value range between 0 and 1, is calculated and output using the Sigmoid probabilistic activation function at the end of the unit network. The gated weight vector is then weighted channel-by-channel with the cross-scale difference vector using the Hadamard element-wise multiplication mechanism to obtain the weighted difference feature, which suppresses background interference features and enhances the response to cross-scale changes related to defects.
[0100] Deep nonlinear feature mapping is performed using residual convolutional blocks with LeakyReLU activation function to compensate for feature loss, thereby outputting a fused feature vector that reduces inter-scale redundancy.
[0101] In an optional embodiment, the adaptive gating unit performs weighted and nonlinear fusion on the current-scale feature vector and the difference vector to generate a fused feature vector, including:
[0102] For each point, calculate the absolute value of the element-wise subtraction between the current scale feature vector and the previous scale feature vector after channel alignment via linear mapping, and use it as the difference vector representing the feature cross-scale change.
[0103] The difference vector is concatenated with the current scale feature vector and input into an adaptive gating unit consisting of a linear mapping layer and a sigmoid activation function. The output is a gating weight vector with a range of 0 to 1 and the same number of channels as the difference vector.
[0104] The difference vector is element-wise weighted using the gated weight vector, and the weighted difference vector is added to the residual of the current scale feature vector.
[0105] The result of summing the residuals is input into a nonlinear activation function, which outputs the fused feature vector of cross-scale change perception.
[0106] Let the feature vector of the i-th point in the target point cloud at the current scale obtained in the current network layer be... The corresponding feature vector derived from the previous encoding layer, which has a sparser spatial scale and a larger receptive field, through interpolation mapping, is: .
[0107] Because the dimensions of the network channels in adjacent layers differ, The parameter matrix has a size of A 1×1 convolutional layer is used for fully connected linear mapping and channel number alignment to obtain projected reconstruction features. Based on this, the absolute difference between the numerical values of two sets of feature tensors with the same dimension at the corresponding channel element positions is calculated to obtain a cross-scale difference vector representing the loss or drastic fluctuation of geometric details of the local structure at that point between coarse and fine scales. This highlights the high-frequency abrupt response that may correspond to minute surface defects, such as scratches and pits that are smoothed at the coarse scale but appear at the fine scale, which are local anomalous signals.
[0108] Compare the cross-scale difference vector with the backbone features of the current scale. By concatenating along the channel dimensions, the total dimension size is obtained. The joint tensor is input to a specially designed adaptive gated unit neural network. The input to this adaptive gated unit neural network is a tensor with a total dimension of [value missing]. The concatenated joint tensor, the structure of this adaptive gated unit neural network, sequentially contains a two-level fully connected mapping layer with batch normalization, specifically the number of feature channels is first changed by... Compress to Perform information distillation, then expand and restore to And connects a Sigmoid activation function at the end, the output length of this adaptive gating unit neural network is Soft-gated attention weight vector Furthermore, the neuron response value on each feature channel is mapped to a range between 0 and 1.
[0109] By applying the Hadamard product operation, the gated weight vector and the cross-scale difference vector are multiplied element-wise channel-by-channel to obtain the significant difference features after attention-gated modulation. Subsequently, an identity residual connection method is used to connect the current scale features. The fusion result is added to the aforementioned significant difference features to fuse basic semantic information at the current scale and high-frequency morphological change information across scales. The fusion result is processed by the LeakyReLU nonlinear activation function, where the negative half-axis slope parameter α is set to 0.2, and the output is a fused feature vector that can characterize the changes in surface defects across scales.
[0110] S8 inputs the fused feature vectors into the point cloud segmentation network and outputs the defect probability.
[0111] The aforementioned fused feature vectors are input into the classification head of the point cloud segmentation network for decoding. The classification head consists of multiple layers of one-dimensional convolutional modules, one-dimensional batch normalization layers, and ReLU nonlinear activation functions stacked sequentially, used to perform point-by-point feature mapping and channel dimensionality reduction on the fused features.
[0112] A Dropout layer is set in the hidden layer of the classification head, and the deactivation probability of the Dropout layer is preferably 0.5. During the model training phase, the Dropout layer randomly sets the output of some hidden layer neurons to zero according to a preset probability, so as to reduce the model's dependence on local sample features and reduce the risk of overfitting to specific three-dimensional workpiece defect data.
[0113] In the final layer of the point cloud segmentation network, a linear mapping layer is set up with the number of output channels equal to the total number of defect categories. The total number of defect categories includes normal background categories and surface defect categories with three-dimensional morphological variations. Through this linear mapping layer, the fused feature vector corresponding to each original three-dimensional point is mapped to a category logical value. Optionally, the surface defect categories with three-dimensional morphological variations include one or more of the following: pitting, pinholes, scratches, indentations, dents, protrusions, film undulations, fixture imprints, shrinkage, bubbles, particle protrusions, film wrinkles, surface ripples, and edge warping.
[0114] The category logical values are probabilistically processed. For multi-category defect recognition tasks, the Softmax function is used to convert the category logical values into probability distributions for each category. Based on the probabilistic processing results, the category of each original 3D point is determined point by point, completing the point-level 3D workpiece surface defect recognition and industrial visualization segmentation.
[0115] In a second embodiment, the present invention also proposes a three-dimensional workpiece surface defect identification system, comprising:
[0116] The acquisition module is used to acquire and preprocess the original point cloud data of the 3D workpiece to obtain the target point cloud containing coordinate and normal vector information.
[0117] The aggregation module is used to perform multi-level feature extraction on the target point cloud. Each layer of operation involves calculating the geometric saliency based on the local surface change rate of each point, and iteratively sampling through a cost function using Euclidean distance to obtain a set of center points. For each center point, its corresponding local neighborhood covariance matrix and eigenvalue decomposition results are called. A local reference coordinate system is established based on the feature vectors, and an anisotropic ellipsoidal space is constructed based on the eigenvalues to search for a local point set. For each local point, the nearest point is searched in the six positive and negative directions of the three axes parallel to the local reference coordinate system with the local point as the reference. The features of the point itself and the nearest points in the six directions are fused to construct the three-axis association features. The Mahalanobis distance attention weight is calculated based on the inverse of the regularized covariance matrix, and the three-axis association features of the local point set are weighted and aggregated accordingly to generate a local region descriptor for the center point.
[0118] The output module is used to propagate the local region descriptors of each layer to the original point cloud through feature upsampling to obtain the multi-scale feature vector of each point; perform channel alignment on the feature vectors of adjacent scales and calculate the absolute difference between them and the feature vector of the current scale to obtain the difference vector representing the cross-scale change; control the adaptive gating unit to perform weighted and nonlinear fusion on the current scale feature vector and the difference vector to generate a fused feature vector; input the fused feature vector into the point cloud segmentation network and output the defect probability.
[0119] In an optional embodiment, the step of acquiring and preprocessing the original point cloud data of the 3D workpiece to obtain a target point cloud containing coordinate and normal vector information includes:
[0120] The original point cloud data is divided into a three-dimensional voxel grid with a set side length.
[0121] Calculate the average coordinates of all discrete points within each voxel grid, and use this average as the centroid of the voxel grid. Reconstruct a sparse point cloud using all centroids.
[0122] For each centroid point in the sparse point cloud, the K-nearest neighbor algorithm is used to search for a set of spatial neighboring points, and the covariance matrix of the neighboring point set is calculated.
[0123] The covariance matrix is decomposed into eigenvalues, and the eigenvector corresponding to the smallest eigenvalue is extracted. The eigenvector is used as the initial normal vector of the centroid point, and the initial normal vector is adjusted for directional consistency based on the viewpoint direction to obtain the target point cloud containing coordinate and normal vector information.
[0124] In an optional embodiment, the step of calculating geometric saliency based on the local surface change rate at each point, and obtaining the center point set by iterative sampling through a cost function using Euclidean distance, includes:
[0125] Based on the eigenvalue decomposition results of the covariance matrix, the first, second, and third eigenvalues are extracted in descending order. The ratio of the third eigenvalue to the sum of the three eigenvalues is taken as the local surface change rate of the corresponding point, thereby defining the geometric significance of this point.
[0126] Initialize the center point set to empty, then randomly select a point to add to the center point set;
[0127] Calculate the nearest Euclidean distance from each remaining candidate point to the set of added center points, and multiply the nearest Euclidean distance by the geometric saliency of the candidate point in a weighted manner to obtain the cost function value;
[0128] The candidate point with the largest cost function value is selected and added to the center point set. This calculation and selection process is performed iteratively until the number of points in the center point set reaches a preset threshold.
[0129] In an optional embodiment, the step of constructing the anisotropic ellipsoidal space based on eigenvalues and searching for the local point set includes:
[0130] With the center point as the origin, the three eigenvectors of the covariance matrix as the axes, and the square roots of the corresponding three eigenvalues multiplied by a preset scaling factor as the semi-length of the three axes, an ellipsoidal neighborhood space surrounding the center point is constructed.
[0131] Calculate the standardized distance from each of the remaining points in the target point cloud to the center point in the ellipsoidal coordinate system. The standardized distance is the sum of the squares of the projection components of the coordinate difference vector between the candidate point and the center point along the three axes divided by the half length of the corresponding axis.
[0132] Points with a standardized distance less than or equal to 1 are selected as neighboring points, and all selected neighboring points are combined to form a local point set of the center point.
[0133] In an optional embodiment, the step of searching for the nearest point within a three-axis positive and negative six-directional region based on the local point and parallel to the local reference coordinate system, and fusing its own features with the features of the six nearest points to construct three-axis associated features, includes:
[0134] Using each local point as a reference, six cone-shaped search regions are constructed, each parallel to the positive and negative directions of the three principal axes of the local reference coordinate system.
[0135] For each local point, calculate the Euclidean distance between the local point and the candidate nearest neighbor points in the corresponding six cone-shaped search areas. Select the closest point in each area as the projected neighbor point in the direction. If there is no candidate nearest neighbor point in a certain area, fill in the gap by using the local point itself as the projected neighbor point in the direction.
[0136] The local point's own features and the relative position features and normal vector features of its six projected neighboring points are extracted by a multilayer perceptron. After being concatenated along the channel dimension, the features are reduced in dimension and fused by a fully connected layer to output the three-axis correlation features of the local point.
[0137] In an optional embodiment, the step of calculating Mahalanobis distance attention weights based on the inverse of the regularized covariance matrix, and then weighting and aggregating the triaxial correlation features of the local point set accordingly to generate a local region descriptor for the center point, includes:
[0138] Calculate the coordinate difference vector between each local point and the center point, and use the inverse matrix of the covariance matrix after adding a diagonal regularization term with the same dimensions as the covariance matrix to calculate the Mahalanobis distance of the coordinate difference vector.
[0139] The negative value of the Mahalanobis distance is then input into the Softmax function to obtain the normalized attention weights of each local point relative to the center point.
[0140] The triaxial correlation features of each local point are multiplied by the corresponding normalized attention weights, and all weighted features within the local point set are summed to generate the local region descriptor of the center point.
[0141] In an optional embodiment, the adaptive gating unit performs weighted and nonlinear fusion on the current-scale feature vector and the difference vector to generate a fused feature vector, including:
[0142] For each point, calculate the absolute value of the element-wise subtraction between the current scale feature vector and the previous scale feature vector after channel alignment via linear mapping, and use it as the difference vector representing the feature cross-scale change.
[0143] The difference vector is concatenated with the current scale feature vector and input into an adaptive gating unit consisting of a linear mapping layer and a sigmoid activation function. The output is a gating weight vector with a range of 0 to 1 and the same number of channels as the difference vector.
[0144] The difference vector is element-wise weighted using the gated weight vector, and the weighted difference vector is added to the residual of the current scale feature vector.
[0145] The result of summing the residuals is input into a nonlinear activation function, which outputs the fused feature vector of cross-scale change perception.
[0146] The above are merely preferred embodiments of the present invention and are not intended to limit the present invention in any other way. Any person skilled in the art may make changes or modifications to the above-disclosed technical content to create equivalent embodiments that can be applied to other fields. However, any simple modifications, equivalent changes, and modifications made to the above embodiments based on the technical essence of the present invention without departing from the scope of the present invention shall still fall within the protection scope of the present invention.
Claims
1. A method for identifying surface defects on a three-dimensional workpiece, characterized in that, include: Acquire and preprocess the original point cloud data of the 3D workpiece to obtain the target point cloud containing coordinate and normal vector information; Multi-level feature extraction is performed on the target point cloud. Each layer involves calculating the geometric saliency based on the local surface change rate of each point, and iteratively sampling through a cost function using Euclidean distance to obtain a set of center points. For each center point, its corresponding local neighborhood covariance matrix and eigenvalue decomposition results are called. A local reference coordinate system is established based on the feature vectors, and an anisotropic ellipsoidal space is constructed based on the eigenvalues to search for a local point set. For each local point, the nearest point is searched in the six positive and negative directions of the three axes parallel to the local reference coordinate system with the local point as the reference. The features of the point itself and the nearest points in the six directions are fused to construct the three-axis association features. Mahalanobis distance attention weights are calculated based on the inverse of the regularized covariance matrix, and the three-axis association features of the local point set are weighted and aggregated accordingly to generate a local region descriptor for the center point. The local region descriptors of each layer are propagated to the original point cloud through feature upsampling to obtain a multi-scale feature vector for each point. The feature vectors of adjacent scales are channel aligned and their absolute differences with the feature vector of the current scale are calculated to obtain a difference vector representing cross-scale changes. The adaptive gating unit is controlled to perform weighted and nonlinear fusion on the current scale feature vector and the difference vector to generate a fused feature vector. The fused feature vector is input into the point cloud segmentation network to output the defect probability.
2. The method according to claim 1, characterized in that, The process of acquiring and preprocessing the original point cloud data of the 3D workpiece to obtain a target point cloud containing coordinate and normal vector information includes: The original point cloud data is divided into a three-dimensional voxel grid with a set side length. Calculate the average coordinates of all discrete points within each voxel grid, and use this average as the centroid of the voxel grid. Reconstruct a sparse point cloud using all centroids. For each centroid point in the sparse point cloud, the K-nearest neighbor algorithm is used to search for a set of spatial neighboring points, and the covariance matrix of the neighboring point set is calculated. The covariance matrix is decomposed into eigenvalues, and the eigenvector corresponding to the smallest eigenvalue is extracted. The eigenvector is used as the initial normal vector of the centroid point, and the initial normal vector is adjusted for directional consistency based on the viewpoint direction to obtain the target point cloud containing coordinate and normal vector information.
3. The method according to claim 1, characterized in that, The calculation of geometric significance based on the local surface change rate at each point, combined with Euclidean distance and iterative sampling through a cost function, to obtain the center point set includes: Based on the eigenvalue decomposition results of the covariance matrix, the first, second, and third eigenvalues are extracted in descending order. The ratio of the third eigenvalue to the sum of the three eigenvalues is taken as the local surface change rate of the corresponding point, thereby defining the geometric significance of this point. Initialize the center point set to empty, then randomly select a point to add to the center point set; Calculate the nearest Euclidean distance from each remaining candidate point to the set of added center points, and multiply the nearest Euclidean distance by the geometric saliency of the candidate point in a weighted manner to obtain the cost function value; The candidate point with the largest cost function value is selected and added to the center point set. This calculation and selection process is performed iteratively until the number of points in the center point set reaches a preset threshold.
4. The method according to claim 1 or 3, characterized in that, The process of constructing anisotropic ellipsoidal space based on eigenvalues and searching for local point sets includes: With the center point as the origin, the three eigenvectors of the covariance matrix as the axes, and the square roots of the corresponding three eigenvalues multiplied by a preset scaling factor as the semi-length of the three axes, an ellipsoidal neighborhood space surrounding the center point is constructed. Calculate the standardized distance from each of the remaining points in the target point cloud to the center point in the ellipsoidal coordinate system. The standardized distance is the sum of the squares of the projection components of the coordinate difference vector between the candidate point and the center point along the three axes divided by the half length of the corresponding axis. Points with a standardized distance less than or equal to 1 are selected as neighboring points, and all selected neighboring points are combined to form a local point set of the center point.
5. The method according to claim 1, characterized in that, The process of searching for the nearest point within a three-axis region (positive and negative six directions) parallel to the local reference coordinate system, using the local point as a reference, and constructing a three-axis correlation feature by fusing its own features with the features of the nearest points in the six directions, includes: Using each local point as a reference, six cone-shaped search regions are constructed, each parallel to the positive and negative directions of the three principal axes of the local reference coordinate system. For each local point, calculate the Euclidean distance between the local point and the candidate nearest neighbor points in the corresponding six cone-shaped search areas. Select the closest point in each area as the projected neighbor point in the direction. If there is no candidate nearest neighbor point in a certain area, fill in the gap by using the local point itself as the projected neighbor point in the direction. The local point's own features and the relative position features and normal vector features of its six projected neighboring points are extracted by a multilayer perceptron. After being concatenated along the channel dimension, the features are reduced in dimension and fused by a fully connected layer to output the three-axis correlation features of the local point.
6. The method according to claim 1, characterized in that, The calculation of Mahalanobis distance attention weights based on the inverse of the regularized covariance matrix, and the weighted aggregation of the triaxial correlation features of the local point set to generate a local region descriptor for the center point, includes: Calculate the coordinate difference vector between each local point and the center point, and use the inverse matrix of the covariance matrix after adding a diagonal regularization term with the same dimensions as the covariance matrix to calculate the Mahalanobis distance of the coordinate difference vector. The negative value of the Mahalanobis distance is then input into the Softmax function to obtain the normalized attention weights of each local point relative to the center point. The triaxial correlation features of each local point are multiplied by the corresponding normalized attention weights, and all weighted features within the local point set are summed to generate the local region descriptor of the center point.
7. The method according to claim 1, characterized in that, The adaptive gating unit performs weighted and nonlinear fusion on the current-scale feature vector and difference vector to generate a fused feature vector, including: For each point, calculate the absolute value of the element-wise subtraction between the current scale feature vector and the previous scale feature vector after channel alignment via linear mapping, and use it as the difference vector representing the feature cross-scale change. The difference vector is concatenated with the current scale feature vector and input into an adaptive gating unit consisting of a linear mapping layer and a sigmoid activation function. The output is a gating weight vector with a range of 0 to 1 and the same number of channels as the difference vector. The difference vector is element-wise weighted using the gated weight vector, and the weighted difference vector is added to the residual of the current scale feature vector. The result of summing the residuals is input into a nonlinear activation function, which outputs the fused feature vector of cross-scale change perception.
8. A three-dimensional workpiece surface defect recognition system, characterized in that, include: The acquisition module is used to acquire and preprocess the original point cloud data of the 3D workpiece to obtain the target point cloud containing coordinate and normal vector information. The aggregation module is used to perform multi-level feature extraction on the target point cloud. Each layer of operation involves calculating the geometric saliency based on the local surface change rate of each point, and iteratively sampling through a cost function using Euclidean distance to obtain a set of center points. For each center point, its corresponding local neighborhood covariance matrix and eigenvalue decomposition results are called. A local reference coordinate system is established based on the feature vectors, and an anisotropic ellipsoidal space is constructed based on the eigenvalues to search for a local point set. For each local point, the nearest point is searched in the six positive and negative directions of the three axes parallel to the local reference coordinate system with the local point as the reference. The features of the point itself and the nearest points in the six directions are fused to construct the three-axis association features. The Mahalanobis distance attention weight is calculated based on the inverse of the regularized covariance matrix, and the three-axis association features of the local point set are weighted and aggregated accordingly to generate a local region descriptor for the center point. The output module is used to propagate the local region descriptors of each layer to the original point cloud through feature upsampling to obtain the multi-scale feature vector of each point; perform channel alignment on the feature vectors of adjacent scales and calculate the absolute difference between them and the feature vector of the current scale to obtain the difference vector representing the cross-scale change; control the adaptive gating unit to perform weighted and nonlinear fusion on the current scale feature vector and the difference vector to generate a fused feature vector; input the fused feature vector into the point cloud segmentation network and output the defect probability.
9. The system according to claim 8, characterized in that, The process of acquiring and preprocessing the original point cloud data of the 3D workpiece to obtain a target point cloud containing coordinate and normal vector information includes: The original point cloud data is divided into a three-dimensional voxel grid with a set side length. Calculate the average coordinates of all discrete points within each voxel grid, and use this average as the centroid of the voxel grid. Reconstruct a sparse point cloud using all centroids. For each centroid point in the sparse point cloud, the K-nearest neighbor algorithm is used to search for a set of spatial neighboring points, and the covariance matrix of the neighboring point set is calculated. The covariance matrix is decomposed into eigenvalues, and the eigenvector corresponding to the smallest eigenvalue is extracted. The eigenvector is used as the initial normal vector of the centroid point, and the initial normal vector is adjusted for directional consistency based on the viewpoint direction to obtain the target point cloud containing coordinate and normal vector information.
10. A computer-readable storage medium storing a computer program thereon, characterized in that, The computer program, when executed by a processor, implements the method as described in any one of claims 1-7.
