A method and system for detecting inner surface defects of special-shaped bushings based on three-dimensional point cloud
By using multi-scale graph attention network and K nearest neighbor graph in the inner surface detection of special-shaped bushings, the problem of difficulty in detecting complex three-dimensional point cloud data with traditional methods is solved, efficient and accurate defect detection is achieved, and production efficiency and product quality.
Patent Information
- Application Number
- CN202411034502.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-31
- Publication Date
- 2024-10-18
- Estimated Expiration
- 2044-07-31
AI Technical Summary
Traditional image processing methods are difficult to effectively detect defects on the inner surface of special-shaped bushings, especially in three-dimensional point cloud data with complex geometric structures, resulting in low detection efficiency and low accuracy, which cannot meet the quality control requirements of mass production.
A multi-scale graph attention network based on three-dimensional point clouds is used to construct a K-nearest neighbor graph by acquiring three-dimensional point cloud data. An attention mechanism is introduced for feature extraction and fusion to build a multi-scale graph attention model. The cross-entropy loss function and random The gradient descent algorithm optimizes the model to realize automated detection of defects on the inner surface of special-shaped bushings.
It improves the accuracy and robustness of defect detection, enables effective detection under different noise levels, enhances the generalization ability of the model, captures local and global structural information, and improves production efficiency and reliability of product quality control.
Smart Images

Figure CN118570194B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of point cloud processing, and in particular to a method and system for detecting inner surface defects of a special-shaped bushing based on three-dimensional point cloud. Background Art
[0002] In the prior art, in the field of industrial production, defect detection on the inner surface of special-shaped bushings is one of the important links to ensure product quality. Special-shaped bushings are usually used in engineering machinery, automobiles and other equipment, and the quality of their inner surface directly affects the performance and service life of the equipment. However, traditional manual detection methods or simple image processing technologies often have problems such as low efficiency and low accuracy, and cannot meet the requirements of quality control in large-scale production. The three-dimensional point cloud data of the inner surface of the special-shaped bushing has a complex geometric structure, and traditional image processing methods are difficult to directly apply to this type of data. However, graph neural networks, as an emerging technology for processing graph structured data, have achieved remarkable results in fields such as social networks and molecular structures. Combining graph neural networks with three-dimensional point cloud data processing technology is expected to achieve automated detection of defects on the inner surface of special-shaped bushings, thereby improving production efficiency and product quality.
[0003] In recent years, with the continuous development of deep learning technology, image-based defect detection methods have made certain progress. However, for three-dimensional shape data such as the inner surface of special-shaped bushings, traditional image processing methods are obviously not directly applicable, and more flexible and efficient technologies are needed to process three-dimensional point cloud data. Three-dimensional point cloud data represents the geometric structure of the surface of an object and has rich information, so it is widely used in the fields of computer vision and machine learning. However, it is a challenging task to accurately detect surface defects from three-dimensional point cloud data. Traditional feature engineering-based methods often require a lot of manual design, and it may be difficult to effectively identify complex defects. At this stage, a method and system for defect detection of the inner surface of special-shaped bushings based on three-dimensional point clouds are needed. Summary of the invention
[0004] In order to solve the problems of complex process and difficult feature differentiation in the internal structure detection of special-shaped bushings, the present invention provides a method and system for detecting inner surface defects of special-shaped bushings based on three-dimensional point clouds. Defect detection is performed using three-dimensional point clouds and multi-scale graph attention networks to achieve automated detection of defects, reduce the need for manual intervention, and improve production efficiency and reliability of quality control.
[0005] In the first aspect, the present invention provides a method for detecting inner surface defects of a special-shaped bushing based on a three-dimensional point cloud, which adopts the following technical solution:
[0006] A method for detecting inner surface defects of a special-shaped bushing based on three-dimensional point cloud, comprising:
[0007] Acquire three-dimensional point cloud data and assign labels to each point cloud data, represent the acquired point cloud data in the form of a matrix, and perform error simulation through the acquired three-dimensional point cloud data;
[0008] A K-nearest neighbor graph is constructed based on the acquired 3D point cloud data, and a local surface change measurement method based on the K-nearest neighbor graph is defined;
[0009] A multi-scale graph attention model is built based on the K-nearest neighbor graph, including feature extraction of sub-graphs of each scale, and the introduction of an attention mechanism into the multi-scale graph attention model based on the extracted features;
[0010] Multi-scale feature fusion based on the introduced attention mechanism;
[0011] Use the built multi-scale graph attention model for defect detection and classification;
[0012] The multi-scale graph attention model is trained and optimized based on the defect detection and classification results.
[0013] Furthermore, the error simulation is performed by acquiring three-dimensional point cloud data, including generating point cloud data with surface defects through a CAD model, sampling and segmenting the generated point cloud data, and adding Gaussian noise to the sampled and segmented point cloud to simulate the measurement error, wherein the Gaussian noise obeys a normal distribution with a mean of 0, and uses standard deviation changes to simulate different noise levels. The formula for adding Gaussian noise is:
[0014] ,
[0015] in, Represents the mean coordinates of the point cloud samples, I represents the unit matrix, Represents the generation of point cloud data containing noise, Represented as a matrix containing the three-dimensional Cartesian coordinates of N points, Represented as Gaussian noise.
[0016] Furthermore, the K nearest neighbor graph is constructed based on the acquired three-dimensional point cloud data, including calculating the nearest neighbor point of each point cloud data by using the Euclidean distance, and constructing a local neighborhood by using the nearest neighbor point, reorganizing the point cloud data into a three-dimensional array, and defining a local surface change measurement method based on the KNN graph by using the covariance matrix, which is used to determine an adaptive threshold to distinguish between defective and non-defective areas. The calculation formula for defining the local surface change measurement method based on the KNN graph is:
[0017] ,
[0018] ,
[0019] in, It is expressed as the number of nearest neighbor points. is represented as the centroid of the point set X, Represented as local surface changes, , and are the three eigenvalues of the covariance matrix.
[0020] Furthermore, the construction of a multi-scale graph attention model based on the K nearest neighbor graph includes constructing subgraphs according to different scales of the K nearest neighbor graph, extracting features of the point cloud data of each subgraph using a graph convolution layer, and introducing an attention mechanism based on the graph convolution layer. The formula for introducing the attention mechanism is:
[0021] ,
[0022] ,
[0023] in, is the set of neighbor nodes of point v, is the neighbor of point v The attention weight, is the unnormalized attention score, is the weight of the attention layer, is the mapping function, Representation Node In the The feature vector of the layer, is the neighbor of point v The exponential form of the unnormalized attention score, Represents the neighbor of point v The exponential form of the unnormalized attention score .
[0024] Furthermore, the multi-scale feature fusion is performed based on the introduced attention mechanism, including fusing the features obtained on sub-graphs of different scales using the attention weighted sum strategy to obtain the final feature representation. The multi-scale feature fusion calculation formula is:
[0025] ,
[0026] in, is the attention weight of the i-th scale calculated by the softmax function, specifically:
[0027] ,
[0028] in, is a scoring function used to evaluate the importance of point v at the i-th scale, is the feature representation of point v at the i-th scale.
[0029] Furthermore, the constructed multi-scale graph attention model is used to perform defect detection and classification, including performing vector aggregation based on feature vectors on sub-graphs, and inputting the aggregated feature vectors into a fully connected layer for classifying the entire graph.
[0030] Furthermore, the training and optimization of the multi-scale graph attention model based on the defect detection and classification results includes inputting the labeled point cloud data into the multi-scale graph attention model, using the cross entropy loss function to measure the difference between the model prediction value and the true label value, and optimizing the model parameters by the stochastic gradient descent algorithm. The cross entropy loss function formula is:
[0031] ,
[0032] Where N is the number of neighbor nodes in the subgraph, is the true label of node i, is the label predicted by the model.
[0033] In a second aspect, a three-dimensional point cloud-based inner surface defect detection system for a special-shaped bushing comprises:
[0034] The data acquisition module is configured to: acquire three-dimensional point cloud data and assign a label to each point cloud data, represent the acquired point cloud data in the form of a matrix, and perform error simulation through the acquired three-dimensional point cloud data;
[0035] The conversion module is configured to: construct a K nearest neighbor graph based on the acquired three-dimensional point cloud data, and define a local surface change measurement method based on the K nearest neighbor graph;
[0036] The model module is configured to: build a multi-scale graph attention model based on the K nearest neighbor graph, including extracting features from sub-graphs of each scale, and introducing an attention mechanism into the multi-scale graph attention model based on the extracted features;
[0037] The feature fusion module is configured to: perform multi-scale feature fusion based on the introduced attention mechanism;
[0038] The detection module is configured to: use the built multi-scale graph attention model to perform defect detection and classification;
[0039] The optimization module is configured to: train and optimize the multi-scale graph attention model according to the defect detection and classification results;
[0040] In summary, the present invention has the following beneficial technical effects:
[0041] 1. The present invention simulates the measurement error of point cloud data and adds Gaussian noise, so that the model can perform effective detection under different noise levels, enhances the robustness and generalization ability of the model, and introduces KNN graph, covariance matrix, and multi-scale graph attention network to obtain raw point cloud data, which can more accurately capture and analyze surface changes, thereby improving the accuracy of defect detection.
[0042] 2. The present invention adopts a multi-scale graph attention network to learn the features of point cloud data from different scales and levels, better capture local and global structural information, and thus detect defects more comprehensively. It uses labeled training data sets for training and optimizes model parameters through cross entropy loss function and stochastic gradient descent algorithm, which helps to continuously adjust and optimize the model and improve detection accuracy and performance. BRIEF DESCRIPTION OF THE DRAWINGS
[0043] Figure 1 It is a schematic diagram of the overall process of a method for detecting inner surface defects of a special-shaped bushing based on three-dimensional point cloud according to Example 1 of the present invention. DETAILED DESCRIPTION
[0044] The present invention is further described in detail below in conjunction with the accompanying drawings.
[0045] Example 1
[0046] Reference Figure 1 , a method for detecting inner surface defects of a special-shaped bushing based on a three-dimensional point cloud in this embodiment includes:
[0047] Acquire three-dimensional point cloud data and assign labels to each point cloud data, represent the acquired point cloud data in the form of a matrix, and perform error simulation through the acquired three-dimensional point cloud data;
[0048] A K-nearest neighbor graph is constructed based on the acquired 3D point cloud data, and a local surface change measurement method based on the K-nearest neighbor graph is defined;
[0049] A multi-scale graph attention model is built based on the K-nearest neighbor graph, including feature extraction of sub-graphs of each scale, and the introduction of an attention mechanism into the multi-scale graph attention model based on the extracted features;
[0050] Multi-scale feature fusion based on the introduced attention mechanism;
[0051] Use the built multi-scale graph attention model for defect detection and classification;
[0052] The multi-scale graph attention model is trained and optimized based on the defect detection and classification results.
[0053] Specifically, a method for detecting inner surface defects of a special-shaped bushing based on a three-dimensional point cloud comprises the following steps: Figure 1 As shown, S1, acquiring three-dimensional point cloud data and assigning a label to each point cloud data, representing the acquired point cloud data in the form of a matrix, and performing error simulation through the acquired three-dimensional point cloud data;
[0054] The surface of an object is scanned using 3D laser scanning technology to obtain the original 3D point cloud data, which is usually represented in the form of a matrix. Contains the three-dimensional Cartesian coordinates x=(x,y,z) of N points. Generate a three-dimensional point cloud with surface defects through the CAD model, and then use software such as CLOUDCOMPARE to sample and segment the point cloud, ensuring that each sample contains a fixed number of points. Then, in order to simulate the measurement error of the point cloud data, add Gaussian noise to the point cloud , generate point cloud data D~ containing noise, where the noise It follows a normal distribution with a mean of 0 and a standard deviation of It varies from 0 to 0.006 units to simulate the measurement error under different noise levels. Specifically, the mathematical expression of noise addition is:
[0055] ,
[0056] in, Represents the mean coordinates of the point cloud samples, and I is the identity matrix.
[0057] S2. constructing a K nearest neighbor graph based on the acquired three-dimensional point cloud data, and defining a local surface change measurement method based on the K nearest neighbor graph;
[0058] For each point in the point cloud, find its k' nearest neighbor points according to the Euclidean distance, that is, for each point The k' nearest neighbors of all other points can be calculated and The Euclidean distance is used to find the distance between two points. and , the formula for Euclidean distance is:
[0059] ,
[0060] in, Respectively indicate points The coordinates of Respectively indicate points The coordinates of these nearest neighbor points and the center point together form a star graph, and each star graph represents a local neighborhood. The constructed KNN graph stores the local neighbor information of each point. The point cloud data is reorganized into a three-dimensional array , where N is the number of points and k'+1 represents the coordinates of each point and its k' nearest neighbors. In order to quantify the local surface variation of the defect area in the point cloud, a local surface variation metric based on the KNN graph is defined. For each point's neighborhood set , calculate its covariance matrix
[0061] ,
[0062] Where Xˉ is the centroid of the point set X. The local surface variation is then calculated using the eigenvalues of the covariance matrix , as shown in formula (1):
[0063] ,
[0064] in, are the three eigenvalues of the covariance matrix. Using the statistical properties of local surface variations, such as the upper confidence interval of the non-defective surface, an adaptive threshold is determined This threshold is used in the subsequent defect detection step by comparing the local surface variation of each point with the threshold To distinguish defective areas from non-defective areas. Based on the calculated local surface changes and adaptive thresholds, the points in the point cloud can be divided into defective points and non-defective points, providing a basis for subsequent defect classification.
[0065] S3. Building a multi-scale graph attention model based on the K-nearest neighbor graph, including extracting features from subgraphs of each scale, and introducing an attention mechanism into the multi-scale graph attention model based on the extracted features; performing multi-scale feature fusion based on the introduced attention mechanism;
[0066] The multi-scale graph attention network is a key technical component of this invention, which is used to effectively learn the feature information in 3D point cloud data. First, a graph convolution layer is applied to each scale subgraph for feature extraction. (Through the graph convolution operation, each node can aggregate the feature information of its neighboring nodes) For each point v, its feature vector It is updated by aggregating its neighbor features as shown in the following formula:
[0067] ,
[0068] in, is the set of neighbor nodes of point v, is the weight matrix of the graph convolutional layer, is the bias term, is the activation function. In order to enhance the model's awareness of the importance of different neighbors, we introduce an attention mechanism. The neighbor features of each point will be multiplied by an attention weight:
[0069] ,
[0070] ,
[0071] in, is the attention weight of point v to its neighbor u, is the unnormalized attention score, is the weight of the attention layer, is a mapping function, such as MLP (multi-layer perceptron). The features extracted at all scales will be fused to obtain the final feature representation (multi-scale feature fusion is performed through the attention weighted sum strategy to obtain feature representation). Through the attention weighted sum fusion strategy, the multi-scale fusion part can be expressed as:
[0072] ,
[0073] in, is the attention weight of the i-th scale calculated by the softmax function, specifically:
[0074] ,
[0075] Here, is a scoring function used to evaluate the importance of point v at the i-th scale, and is the feature representation of point v at the i-th scale. In this way, the model is able to adaptively highlight features of important scales while suppressing less important information.
[0076] S4. Use the built multi-scale graph attention model to perform defect detection and classification;
[0077] After the multi-scale graph attention network (S3) extracts and fuses features, each point has a feature vector. The feature vectors of these points need to be aggregated so that the features of the entire graph are represented as a whole. The aggregated graph feature vectors are input into a fully connected layer to classify the entire graph. The output of this classifier is a probability distribution, which indicates the possibility of whether there is a defect in the graph. The defect detection problem is regarded as a graph-level classification task, that is, judging whether the entire graph has defects. In this case, the features of all nodes in the graph can be aggregated, and then the entire graph can be classified through a fully connected layer or other classifiers. This method is suitable for scenarios where it is necessary to determine whether the entire profiled bushing has defects.
[0078] S5. Train and optimize the multi-scale graph attention model based on the defect detection and classification results.
[0079] In S1, a large amount of point cloud data is first collected. These data can come from different sources, such as 3D scanners, lidar, etc. Then the collected point cloud data needs to be annotated and a label is assigned to each data sample. Using the labeled training dataset, we train the designed image-level defect detection model. In order to train the classifier, the cross entropy loss function is used to measure the difference between the model prediction and the true label:
[0080] ,
[0081] Where N is the number of nodes in the graph, is the true label of node i, is the label predicted by the model. The model parameters are optimized using the stochastic gradient descent algorithm so that it can learn accurate defect detection capabilities on the training data. After the model training is completed, the model performance is evaluated by the cross-validation method. According to the evaluation results, the model is adjusted and optimized to further improve the accuracy and performance of graph-level defect detection, thereby realizing the inner surface defect detection of special-shaped bushings based on the 3D point cloud multi-scale graph attention network.
[0082] Example 2
[0083] The difference between this embodiment and embodiment 1 is that this embodiment provides a three-dimensional point cloud-based special-shaped bushing inner surface defect detection system, including:
[0084] The data acquisition module is configured to: acquire three-dimensional point cloud data and assign a label to each point cloud data, represent the acquired point cloud data in the form of a matrix, and perform error simulation through the acquired three-dimensional point cloud data;
[0085] The conversion module is configured to: construct a K nearest neighbor graph based on the acquired three-dimensional point cloud data, and define a local surface change measurement method based on the K nearest neighbor graph;
[0086] The model module is configured to: build a multi-scale graph attention model based on the K nearest neighbor graph, including extracting features from sub-graphs of each scale, and introducing an attention mechanism into the multi-scale graph attention model based on the extracted features;
[0087] The feature fusion module is configured to: perform multi-scale feature fusion based on the introduced attention mechanism;
[0088] The detection module is configured to: use the built multi-scale graph attention model to perform defect detection and classification;
[0089] The optimization module is configured to: train and optimize the multi-scale graph attention model according to the defect detection and classification results;
[0090] The above are all preferred embodiments of the present invention, and are not intended to limit the protection scope of the present invention. Therefore, any equivalent changes made based on the structure, shape, and principle of the present invention should be included in the protection scope of the present invention.
Claims
1. A method for detecting inner surface defects of special-shaped bushings based on three-dimensional point cloud, characterized in that: include: Acquire three-dimensional point cloud data and assign labels to each point cloud data, represent the acquired point cloud data in the form of a matrix, and perform error simulation through the acquired three-dimensional point cloud data; A K-nearest neighbor graph is constructed based on the acquired three-dimensional point cloud data, and a local surface change measurement method based on the K-nearest neighbor graph is defined. The K-nearest neighbor graph is constructed based on the acquired three-dimensional point cloud data, including calculating the nearest neighbor point of each point cloud data using the Euclidean distance, and constructing a local neighborhood through the nearest neighbor point, reorganizing the point cloud data into a three-dimensional array, and defining a local surface change measurement method based on the KNN graph using a covariance matrix, which is used to determine an adaptive threshold to distinguish between defective and non-defective areas. The calculation formula for defining the local surface change measurement method based on the KNN graph is: , in, It is expressed as the number of nearest neighbor points. is represented as the centroid of the point set X, Represented as local surface changes, , and are the three eigenvalues of the covariance matrix, which provide the basis for subsequent defect classification; The multi-scale graph attention model is built based on the K nearest neighbor graph, including feature extraction of sub-graphs of each scale, and the introduction of attention mechanism into the multi-scale graph attention model based on the extracted features. Multi-scale feature fusion is performed based on the introduced attention mechanism, and the graph convolution layer is applied to the sub-graphs of each scale for feature extraction. For each point v, its feature vector It is updated by aggregating its neighbor features as shown in the following formula: , in, is the set of neighbor nodes of point v, is the weight matrix of the graph convolutional layer, is the bias term, σ is the activation function, and subgraphs are constructed according to different scales of the K nearest neighbor graph. The graph convolution layer is used to extract features from the point cloud data of each subgraph, and an attention mechanism is introduced on the basis of the graph convolution layer. The neighbor features of each point will be multiplied by an attention weight. The formula for introducing the attention mechanism is: , , in, Yes The set of neighbor nodes of Yes To Neighbors The attention weight, is the unnormalized attention score, is the weight of the attention layer, is the mapping function, Representation Node In the The feature vector of the layer, is the neighbor of point v The exponential form of the unnormalized attention score, Indicate point To Neighbors The exponential form of the unnormalized attention score is used to fuse the features obtained on sub-graphs of different scales using the attention weighted sum strategy to obtain the final feature representation. Through the attention weighted sum fusion strategy, the multi-scale feature fusion calculation formula is: , in, is the attention weight of the i-th scale calculated by the softmax function, specifically: , in, is a scoring function used to evaluate the importance of point v at the i-th scale, It is the feature representation of point v at the i-th scale; Use the built multi-scale graph attention model for defect detection and classification; The multi-scale graph attention model is trained and optimized based on the defect detection and classification results.
2. The method for detecting inner surface defects of special-shaped bushings based on three-dimensional point cloud according to claim 1 is characterized in that: The error simulation is performed by acquiring three-dimensional point cloud data, including generating point cloud data with surface defects through a CAD model, sampling and segmenting the generated point cloud data, and adding Gaussian noise to the sampled and segmented point cloud to simulate the measurement error, wherein the Gaussian noise obeys a normal distribution with a mean of 0, and uses standard deviation changes to simulate different noise levels. The formula for adding Gaussian noise is: , in, Represents the mean coordinates of the point cloud samples, I represents the unit matrix, Represents the generation of point cloud data containing noise, Represented as a matrix containing the three-dimensional Cartesian coordinates of N points, Represented as Gaussian noise.
3. The method for detecting inner surface defects of a special-shaped bushing based on three-dimensional point cloud according to claim 2 is characterized in that: The constructed multi-scale graph attention model is used to perform defect detection and classification, including vector aggregation based on feature vectors on sub-graphs, and inputting the aggregated feature vectors into a fully connected layer for classifying the entire graph.
4. The method for detecting inner surface defects of a special-shaped bushing based on three-dimensional point cloud according to claim 3 is characterized in that: The training and optimization of the multi-scale graph attention model according to the defect detection and classification results includes inputting the labeled point cloud data to the multi-scale graph attention model, using the cross entropy loss function to measure the difference between the model prediction value and the true label value, and optimizing the model parameters by the stochastic gradient descent algorithm. The cross entropy loss function formula is: , Where N is the number of neighbor nodes in the subgraph, is the true label of node i, is the label predicted by the model.
5. A three-dimensional point cloud-based inner surface defect detection system for special-shaped bushings, executing the method according to claim 1, characterized in that: include: The data acquisition module is configured to: acquire three-dimensional point cloud data and assign a label to each point cloud data, represent the acquired point cloud data in the form of a matrix, and perform error simulation through the acquired three-dimensional point cloud data; The conversion module is configured to: construct a K nearest neighbor graph based on the acquired three-dimensional point cloud data, and define a local surface change measurement method based on the K nearest neighbor graph; The model module is configured to: build a multi-scale graph attention model based on the K nearest neighbor graph, including extracting features from sub-graphs of each scale, and introducing an attention mechanism into the multi-scale graph attention model based on the extracted features; The feature fusion module is configured to: perform multi-scale feature fusion based on the introduced attention mechanism; The detection module is configured to: use the built multi-scale graph attention model to perform defect detection and classification; The optimization module is configured to: train and optimize the multi-scale graph attention model according to the defect detection and classification results.
Citation Information
Patent Citations
Three-dimensional point cloud classification and segmentation method based on feature fusion
CN113393474A
3D point cloud target detection method based on graph convolution
CN113705631A
Point cloud completion method based on local covariance optimization
CN114331883A
Urban scene laser LiDAR point cloud semantic segmentation method based on graph convolution
CN116129118A
Point cloud semantic segmentation network based on dynamic graph convolution and spatial attention
CN116246073A
