Metal surface defect identification method, device and equipment

Through the collection of point cloud data by 3D line laser profiler and recognition by dynamic image convolutional neural network, the real-time accuracy problem of metal surface defect detection is solved, the detection efficiency and accuracy are improved, and the limitation of poor image definition of 2D camera acquisition is overcome. .

CN118799649AActive Publication Date: 2024-10-18XIAN SIXTH MIRROR NETWORK TECH CO LTD

Patent Information

Application Number
CN202411158104.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-08-22
Publication Date
2024-10-18
Estimated Expiration
2044-08-22

AI Technical Summary

Technical Problem

During the rolling process of metal materials, metal surface defects caused by aging production processes and equipment are difficult to detect in a timely manner. Traditional manual inspection methods are inefficient and inaccurate, and it is difficult for 2D cameras to collect clear images in real time on high-speed moving products, affecting inspection. Out rate.

Method used

A 3D line laser profiler is used to collect metal surface point cloud data, the defect point set is determined through template matching and distance clustering algorithms, and a dynamic graph convolutional neural network is used to identify defect types to improve detection accuracy.

Benefits of technology

It achieves high-accuracy real-time identification of metal surface defects, avoids the problem of poor image definition with 2D cameras, obtains point cloud data with richer information, and improves detection accuracy and efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118799649A_ABST
    Figure CN118799649A_ABST
Patent Text Reader

Abstract

The invention discloses a metal surface defect identification method, device and equipment, and relates to the technical field of defect detection. The point cloud data corresponding to the preset metal surface standard contour and the point cloud data corresponding to the metal surface contour in the machining process are firstly obtained, the metal surface contour in the machining process is represented through the three-dimensional point cloud data, and the problem that the definition of a metal surface image is poor due to exposure of a 2D camera is solved through collection of the point cloud data; then template matching of the metal surface contour and the standard contour in the machining process is carried out based on the point cloud data, defect three-dimensional points can be obtained through clear comparison, the point cloud data corresponding to the defect area is further obtained after distance clustering is carried out on the defect three-dimensional points, and compared with image data acquired by a 2D camera, the accuracy of the point cloud data is improved. The information amount of the point cloud data corresponding to the defect area is richer, so that the accuracy of metal surface defect identification is further improved when defect identification is carried out based on the point cloud data corresponding to each defect area.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of defect detection, and in particular to a metal surface defect recognition method, device and equipment. Background Art

[0002] Generally, during the rolling process of metal materials, various defects such as scratches, cracks, rolling scars, pits, etc. will inevitably form on the metal surface due to production processes, equipment aging and other reasons. If these defects cannot be detected in time, the yield rate of the factory's products will be greatly reduced, resulting in significant economic losses. In the traditional metallurgical industry, factories usually use manual inspection to detect surface defects of rolled products. However, in actual production, the surface defects of these metals are often small in size (millimeter level), and manual inspection is difficult and time-consuming. In addition, most metal materials are in high-speed running state on the processing production line. Manual inspection is difficult to perform online real-time inspection, and the detection point is lagging, so defects cannot be detected in time, and the remedy for economic cost losses is relatively limited. Therefore, it is extremely important to develop an algorithm that can identify metal surface defects in real time online.

[0003] With the development of deep learning, automatic metal surface defect recognition solutions based on machine vision have received widespread attention. Considering the low cost of 2D cameras and the relatively mature related image processing algorithms, most existing technologies use 2D cameras to take real-time photos of products moving at high speed on the production line and collect their surface data. After that, deep learning algorithms are used to analyze the collected data and detect and classify defects on the product surface.

[0004] However, in most production lines, products are moving at high speeds, so 2D cameras need to adjust the exposure time to a very short time in order to capture metal surface images without motion blur. But when the exposure time is very low, the aperture of the camera will become smaller accordingly, resulting in a significant reduction in the amount of light entering the camera, unclear imaging, and difficulty in capturing many texture details, which affects the detection rate. Summary of the invention

[0005] Based on this, it is necessary to provide a metal surface defect recognition method, device and equipment to address the technical problem of low accuracy in collecting and detecting surface data of products using 2D cameras.

[0006] The present invention adopts the following technical solutions:

[0007] The present invention provides a metal surface defect recognition method, comprising:

[0008] Respectively acquiring first point cloud data of the metal surface contour during processing and second point cloud data of a preset metal surface standard contour;

[0009] For each 3D point in the first point cloud data, determine the nearest neighbor point of the 3D point in the second point cloud data according to the distance between the 3D point and each 3D point in the second point cloud data, so as to match and align the metal surface contour during processing with the metal surface standard contour;

[0010] Determine a defective three-dimensional point set corresponding to the defect from the first point cloud data according to the distance between each three-dimensional point in the first point cloud data and the nearest neighbor point in the second point cloud data and a preset error threshold; when the distance between the three-dimensional point in the first point cloud data and its nearest neighbor point in the second point cloud data is greater than the preset error threshold, it indicates that the metal surface profile is different from the standard profile of the metal surface at the three-dimensional point and there is a defect;

[0011] The defect 3D point set is clustered by using the distance clustering algorithm to obtain the defect 3D point corresponding to each defect;

[0012] The defect 3D points corresponding to each defect are input into the pre-trained classifier to identify the type of each defect.

[0013] Optionally, clustering the defect three-dimensional point set by a distance clustering algorithm to obtain the defect three-dimensional point corresponding to each defect specifically includes:

[0014] For each defective 3D point in the defective 3D point set, determine a neighbor point within a preset search radius of the defective 3D point;

[0015] Classify the neighboring points whose Euclidean distance to the defective 3D point is less than a preset clustering distance threshold and the defective 3D point as defective 3D points of the same type;

[0016] Determine neighboring points within a preset search radius of each similar defective 3D point among similar defective 3D points of the defective 3D point, and classify the neighboring points whose Euclidean distance to the similar defective 3D point is less than a preset clustering distance threshold with the defective 3D point as similar defective 3D points;

[0017] The final similar defect 3D point of the defect 3D point is determined through multiple rounds of iterative calculation until no new similar defect 3D point can be obtained, and the defect 3D point and its similar defect 3D point are determined to be defect 3D points corresponding to one defect.

[0018] Optionally, determining the cluster distance threshold specifically includes:

[0019] Determine, based on the first point cloud data and the second point cloud data, a contour spacing between a metal surface contour during processing and a standard contour of the metal surface;

[0020] According to the contour spacing and the collection spacing between two adjacent points of the standard metal surface contour, the clustering distance threshold is determined by the following formula:

[0021] d = 2 × max (A, B);

[0022] Among them, d is the clustering distance threshold, A is the contour spacing, and B is the collection spacing.

[0023] Optionally, the method further comprises:

[0024] For each 3D point in the first point cloud data, the error distance between the metal surface profile during processing and the standard metal surface profile at the 3D point is determined by the following formula according to the normal vector of the nearest neighbor point of the 3D point in the second point cloud data and the distance between the 3D point and its nearest neighbor point:

[0025] Er_Dis(a j )=nor(b i )×dis(a j , b i ), a j ∈J,b i ∈I;

[0026] Among them, J is the first point cloud data, a j is the jth 3D point in the first point cloud data, I is the second point cloud data, b i is the i-th 3D point in the second point cloud data, and the 3D point b i is the 3D point a in the second point cloud data j The nearest neighbor point, nor(b i ) is the 3D point b in the second point cloud data i The normal vector at the position, dis(a j , b i ) is a three-dimensional point a j Its nearest neighbor 3D point b i The Euclidean distance, Er_Dis(a j ) is a three-dimensional point a j The error distance between the metal surface profile J and the metal surface standard profile I during the machining process.

[0027] Optionally, the step of inputting the defect three-dimensional points corresponding to each defect into a pre-trained classifier to identify the type of each defect specifically includes:

[0028] The combination of the three-dimensional coordinates of the defective three-dimensional point corresponding to each defect and the error distance between the metal surface contour and the standard metal surface contour during processing at the defective three-dimensional point is used as the representation of the defective three-dimensional point;

[0029] For each defect, the three-dimensional defect point corresponding to the defect is input into the pre-trained dynamic graph convolutional network as a classifier to extract the type geometric features of the defect, and the type of the defect is identified based on the extracted type geometric features.

[0030] Optionally, training the dynamic graph convolutional network specifically includes:

[0031] Acquire historically collected metal surface contour point cloud data as initial point cloud data, and perform continuous transformation operations on the initial point cloud data to construct a point cloud sequence, wherein the transformation operations include at least one of rotation, translation, and scaling;

[0032] Constructing a dynamic graph convolution online network and a dynamic graph convolution target network, obtaining first sample data corresponding to the dynamic graph convolution online network from the point cloud sequence, obtaining second sample data corresponding to the dynamic graph convolution target network, and performing spatial enhancement on the first sample data and the second sample data;

[0033] Inputting the spatially enhanced first sample data into the dynamic graph convolution online network for feature mapping to obtain features of the first sample data after being transformed by the dynamic graph convolution online network, and inputting the spatially enhanced second sample data into the dynamic graph convolution target network for feature mapping to obtain features of the second sample data after being transformed by the dynamic graph convolution target network;

[0034] By adding a predictor, the mean square error between the features of the first sample data after being transformed by the dynamic graph convolution online network and the features of the second sample data after being transformed by the dynamic graph convolution target network is calculated according to the following formula:

[0035]

[0036] The spatially enhanced second sample data is fed into the dynamic graph convolution online network, and the spatially enhanced first sample data is fed into the dynamic graph convolution target network. The loss in the mean square error is symmetric, and the total loss is calculated by the following formula:

[0037]

[0038] For each training step, the parameters of the dynamic graph convolution online network are updated with the goal of minimizing the total loss. After completing the step training, the parameters of the dynamic graph convolution target network are updated according to the moving average of the dynamic graph convolution online network parameters.

[0039] in, is the mean square error between the features of the first sample data after being transformed by the dynamic graph convolution online network and the features of the second sample data after being transformed by the dynamic graph convolution target network, r(z θ ) is the feature of the first sample data after being transformed by the dynamic graph convolution online network, is the feature of the second sample data after being transformed by the dynamic graph convolution target network, is the loss in the mean square error after symmetry, is the total loss.

[0040] Optionally, the method further comprises:

[0041] Performing outlier filtering on the first point cloud data by using a filtering algorithm to remove outlier points in the first point cloud data;

[0042] Determine the nearest neighbor point pair of the metal surface profile and the metal surface standard profile during the processing according to the first point cloud data and the second point cloud data;

[0043] Calculate the absolute error distance between the nearest neighbor point pairs, and determine whether the absolute error distance is less than a preset update threshold;

[0044] If yes, then the average values ​​of the non-travel direction coordinate values ​​of the first point cloud data and the second point cloud data during the machining process are calculated, and the second point cloud data corresponding to the standard profile of the metal surface is updated;

[0045] If not, the second point cloud data corresponding to the standard contour of the metal surface is not updated through the first point cloud data.

[0046] Optionally, the method further comprises:

[0047] When the nearest neighbor point of the standard contour of the metal surface cannot be found in the first point cloud data corresponding to the contour of the metal surface during processing, determining whether the amount of missing three-dimensional points in the first point cloud data corresponding to the contour of the metal surface during processing is greater than a preset missing threshold;

[0048] If yes, the second point cloud data corresponding to the standard contour of the metal surface is not updated through the first point cloud data;

[0049] If not, three-dimensional point interpolation is performed on the first point cloud data corresponding to the metal surface contour during the processing, and the nearest neighbor point of the metal surface standard contour is re-determined from the first point cloud data corresponding to the metal surface contour during the processing.

[0050] The present invention provides a metal surface defect recognition device, wherein each module in the metal surface defect recognition device is used to execute the above-mentioned metal surface defect recognition method.

[0051] The present invention provides a computer-readable storage medium, wherein the storage medium stores a computer program, and when the computer program is executed by a processor, the above-mentioned metal surface defect identification method is implemented.

[0052] The present invention provides a computer device, comprising a memory, a processor and a computer program stored in the memory and executable on the processor, wherein the processor implements the above-mentioned metal surface defect identification method when executing the program.

[0053] The above technical solution adopted by the present invention can achieve the following beneficial effects:

[0054] First, the point cloud data corresponding to the preset metal surface standard contour and the metal surface contour during the processing are obtained, and then the two contours are template matched based on the point cloud data of the two to determine the closest 3D point pairs in the two contours. Then, the defect 3D point set in the metal surface contour during the processing is determined according to the distance between the 3D point pairs and a distance clustering analysis is performed on it to obtain the defect 3D points corresponding to each defect, and finally the type of each defect is identified based on the classifier.

[0055] The present invention uses three-dimensional point cloud data to represent the metal surface contour during the processing process. The collection of point cloud data avoids the problem of poor metal surface image clarity caused by exposure of a 2D camera. At the same time, template matching of the metal surface contour and the standard contour during the processing is performed based on the point cloud data, so that the defective three-dimensional points can be clearly compared. After distance clustering of the defective three-dimensional points, point cloud data corresponding to the defective area is further obtained. Compared with the image data collected by a 2D camera, the point cloud data corresponding to the defective area has richer information, thereby improving the accuracy of metal surface defect recognition. BRIEF DESCRIPTION OF THE DRAWINGS

[0056] The drawings described herein are used to provide a further understanding of the present invention and constitute a part of the present invention. The exemplary embodiments of the present invention and their descriptions are used to explain the present invention and do not constitute an improper limitation of the present invention. In the drawings:

[0057] Figure 1 A schematic diagram of a metal surface defect identification method provided by the present invention;

[0058] Figure 2 A schematic diagram of a point cloud profile image of a hot-rolled rail in motion captured by a 3D line laser profiler provided by the present invention;

[0059] Figure 3 A schematic diagram of comparison before and after filtering the first point cloud data by a filtering algorithm provided by the present invention;

[0060] Figure 4 A schematic diagram of comparison before and after interpolation of first point cloud data provided by the present invention;

[0061] Figure 5 A schematic diagram of a point cloud self-supervised representation learning network structure provided by the present invention;

[0062] Figure 6 A schematic diagram of a comprehensive process for metal surface defect identification provided by the present invention;

[0063] Figure 7A schematic diagram of a metal surface defect identification device provided by the present invention. DETAILED DESCRIPTION

[0064] In order to make the purpose, technical solution and advantages of the present invention clearer, the technical solution of the present invention will be clearly and completely described below in conjunction with the specific embodiments of the present invention and the corresponding drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present invention.

[0065] At present, because products in most production lines are moving at high speed, 2D cameras need to adjust the exposure time to a very short time in order to capture metal surface images without motion blur. However, when the exposure time is very low, the aperture of the camera will become smaller accordingly, resulting in a significant reduction in the amount of light entering the camera, unclear imaging, and many texture details that are difficult to capture, which affects the detection rate. In addition, 2D cameras cannot obtain depth information on the metal surface. For metal surface defects, the depth difference information from the surface is an important feature, which is of great reference significance for the classification and grading of defects. The lack of this information will lead to poor classification accuracy of defects and difficulty in grading defects.

[0066] The present invention discloses a method for identifying metal surface defects. Considering the shortcomings of the above-mentioned metal surface defect detection based on 2D vision, the method of the present invention does not use a 2D camera to collect metal surface data, but uses a 3D line laser profiler to collect metal surface data. The 3D line laser profiler has the advantages of not being easily affected by light, the point cloud imaging effect is less affected by metal movement, and can accurately capture the depth information of the metal surface. Correspondingly, the present invention also proposes a metal surface defect recognition algorithm that matches the 3D data acquisition scheme. Specifically, due to the high real-time requirements of industrial detection and the large amount of metal surface point cloud data, considering the running speed problem, the present invention does not use 3D object detection or segmentation methods to detect and classify defects, but first uses the template matching algorithm to detect defect points on the point cloud contour data, and then uses the distance clustering algorithm to cluster defects, and then sends the clustered defect data to the deep learning model Dynamic Graph Convolutional Neural Network (Dynamic Graph CNN, DGCNN) for specific defect point recognition and classification.

[0067] The technical solutions provided by various embodiments of the present invention are described in detail below in conjunction with the accompanying drawings.

[0068] Figure 1 The present invention is a schematic flow chart of a metal surface defect identification method, which specifically includes the following steps:

[0069] S101: Acquire first point cloud data of a metal surface contour during processing and second point cloud data of a preset metal surface standard contour respectively.

[0070] Generally, during the rolling process of metal materials, the metal materials can move at high speed in the direction of travel on the production line and be processed through various processes. During the process of metal materials, the surface information can be collected by a pre-installed 3D laser profiler to obtain point cloud data corresponding to the surface of the metal material.

[0071] Therefore, the server of the business platform can obtain the first point cloud data J of the metal surface contour during the processing process collected by the 3D laser profiler, and obtain the second point cloud data I of the preset metal surface standard contour, so as to subsequently use the metal surface standard contour as a template to perform template matching on the metal surface contour during the processing process to determine the data information corresponding to the metal surface defects.

[0072] Among them, the preset metal surface standard profile can be set according to the detection user experience. Of course, it can also be converted into point cloud data as the metal surface standard profile through a Computer-Aided Design (CAD) model. The preset metal surface standard profile can be pre-stored in the storage device of the server and obtained from the storage device when executing the metal surface defect identification method.

[0073] Figure 2 It is a schematic diagram of using a 3D line laser profiler to capture a point cloud profile image of a moving hot-rolled rail in the present invention.

[0074] Furthermore, during the rolling process, metal materials will usually experience small deformations such as thermal expansion due to heating and other process reasons. Taking thermal expansion as an example, the thermal expansion of metal materials during processing is usually normal, but since the point cloud data corresponding to the CAD model is an absolute standard contour, there is a difference between the metal surface contour during the actual processing after thermal expansion, which may lead to the misidentification of defect points when the metal surface contour during processing is subsequently matched with the standard metal surface contour as a template.

[0075] Therefore, in one or more embodiments of the present invention, after acquiring the first point cloud data and the second point cloud data, the server may also update the standard profile of the metal surface in real time based on the metal surface profile during processing according to the first point cloud data and the second point cloud data.

[0076] Specifically, the server may first filter the first point cloud data for outliers through a filtering algorithm to remove outliers in the first point cloud data. For the metal surface contour during the processing process, due to the influence of the shooting environment and the changes in the metal surface, there may be three-dimensional point displacement, missing, noise points in the point cloud data at certain point positions. Therefore, the server may first filter the first point cloud data to remove abnormal outliers. Figure 3 It is a schematic diagram of comparison before and after filtering the first point cloud data by a filtering algorithm in the present invention. Figure 3 The left side of the figure shows the metal surface contour during the processing corresponding to the first point cloud data before filtering, and the right side shows the metal surface contour during the processing corresponding to the first point cloud data after filtering. It can be seen that the outliers in the rectangular frame are filtered out after filtering.

[0077] Then, the server can determine the nearest neighbor point pair of the metal surface contour and the metal surface standard contour during the processing according to the first point cloud data and the second point cloud data. Assume that the first point cloud data is J = {a j}, a j =(x j ,y j , z j ), the second point cloud data is I = {b i}, b i =(x i ,y i , z i ). The server can first determine the point closest to the second point cloud data I from the first point cloud data J, and then determine the point closest to the first point cloud data J from the second point cloud data I. The two points are the nearest neighbor point pair of the metal surface contour and the metal surface standard contour during the processing.

[0078] Finally, the server can calculate the absolute error distance between the nearest neighbor point pairs and determine whether the absolute error distance is less than the preset update threshold. Here, the absolute error distance between the nearest neighbor point pairs is used to characterize the degree of difference between the metal surface profile and the standard metal surface profile during the processing process. The absolute error distance between the nearest neighbor point pairs is positively correlated with the degree of difference between the metal surface profile and the standard metal surface profile during the processing process. The preset update threshold can be set according to business needs, and the present invention is not limited to this.

[0079] If so, the average value of the coordinate values ​​of the first point cloud data and the second point cloud data in the non-movement direction during the processing is calculated, and the second point cloud data corresponding to the standard contour of the metal surface is updated. When the absolute error distance is less than the preset update threshold, it means that the difference between the metal surface contour and the standard contour of the metal surface during the processing is small. At this time, the standard contour of the metal surface can be dynamically updated based on the metal surface contour during the processing. Assuming that the metal material moves along the y-axis during the processing, the x-axis coordinate value and the z-axis coordinate value of each three-dimensional point of the second point cloud data corresponding to the standard contour of the metal surface should fluctuate within a certain range. At this time, the server can calculate the average value of the x-axis coordinate value and the z-axis coordinate value between each corresponding three-dimensional point pair of the metal surface contour and the metal surface standard contour during the processing, and update the x-axis coordinate value and z-axis coordinate value of the three-dimensional point in the point cloud data of the standard contour of the metal surface according to the average value.

[0080] If not, the second point cloud data corresponding to the standard metal surface contour is not updated through the first point cloud data. When the absolute error distance is greater than or equal to the preset update threshold, it means that the difference between the metal surface contour and the standard metal surface contour during the processing is large. At this time, the dynamic update of the standard metal surface contour based on the metal surface contour during the processing can be abandoned.

[0081] By dynamically updating the standard contour of the metal surface based on the metal surface contour during the processing corresponding to the first point cloud data, the interference of the normal influence of the processing procedure on the metal surface on the identification of metal surface defects is reduced, and the influence of defect identification caused by the jitter of the production equipment can be at least partially eliminated, thereby improving the accuracy of the defects of the metal surface contour in the subsequent identification process.

[0082] The server mentioned in the present invention may be a server set on a business platform, or a device such as a desktop computer, a notebook computer, etc. that can execute the solution of the present invention. For the convenience of description, the following description is only based on the server as the execution subject.

[0083] S102: For each 3D point in the first point cloud data, determine the nearest neighbor point of the 3D point in the second point cloud data according to the distance between the 3D point and each 3D point in the second point cloud data, so as to match and align the metal surface contour during processing with the standard metal surface contour.

[0084] S103: Determine a defective three-dimensional point set corresponding to the defect from the first point cloud data according to the distance between each three-dimensional point in the first point cloud data and its nearest neighbor point in the second point cloud data and a preset error threshold; when the distance between a three-dimensional point in the first point cloud data and its nearest neighbor point in the second point cloud data is greater than the preset error threshold, it indicates that the metal surface contour at the three-dimensional point is different from the standard contour of the metal surface and there is a defect.

[0085] S104: clustering the defect three-dimensional point set by using a distance clustering algorithm to obtain the defect three-dimensional point corresponding to each defect.

[0086] S105: Input the defect three-dimensional points corresponding to each defect into a pre-trained classifier based on a neural network model to identify the type of each defect.

[0087] After acquiring the first point cloud data of the metal surface contour during the processing and the second point cloud data of the preset metal surface standard contour, the server can perform template matching on the metal surface contour during the processing based on the metal surface standard contour.

[0088] First, the server may determine, for each 3D point in the first point cloud data, the nearest neighbor point of the 3D point in the second point cloud data according to the distance between the 3D point and each 3D point in the second point cloud data.

[0089] Then, the server can determine the defective three-dimensional point set corresponding to the defect from the first point cloud data according to the distance between each three-dimensional point in the first point cloud data and its nearest neighbor point and the preset error threshold. That is, the metal surface contour and the standard metal surface contour during the processing are matched. Here, the distance between the three-dimensional point in the first point cloud data and its nearest neighbor point represents the degree of matching of the two contours at this point. The distance between the three-dimensional point in the first point cloud data and its nearest neighbor point is negatively correlated with the degree of matching of the two contours at the three-dimensional point. That is, the higher the degree of matching of the two contours at a certain three-dimensional point, the more the two contours overlap at the three-dimensional point, and the smaller the distance between the three-dimensional point and its nearest neighbor point should be, and vice versa. The error threshold here can be set specifically as needed, and the present invention does not limit this.

[0090] For example, the server may set the error threshold to α, then the defective 3D point set is:

[0091] error_point = {a j , dis>α}

[0092] Among them, error_point is the defect 3D point set, a j is a 3D point in the first point cloud data, and dis is the distance between the 3D point in the first point cloud data and its nearest neighbor in the second point cloud data.

[0093] Afterwards, the server can cluster the defect 3D point set by using a distance clustering algorithm to obtain the defect 3D points corresponding to each defect. The distance clustering algorithm here can be a Euclidean distance clustering algorithm or a DBCAN distance clustering algorithm, etc. The present invention does not limit the specific distance clustering algorithm used.

[0094] Taking the Euclidean distance clustering algorithm as an example, in one or more embodiments of the present invention, the server may first determine the neighboring points within the preset search radius of the defective 3D point for each defective 3D point in the defective 3D point set. Then, the neighboring points whose Euclidean distance to the defective 3D point is less than the preset clustering distance threshold and the defective 3D point are classified as defective 3D points of the same type. Afterwards, the neighboring points within the preset search radius of each defective 3D point of the same type are determined, and the neighboring points whose Euclidean distance to the defective 3D point of the same type is less than the preset clustering distance threshold and the defective 3D point are classified as defective 3D points of the same type. Thus, the final defective 3D point of the same type is determined through multiple rounds of iterative calculations until no new defective 3D points of the same type can be obtained, and the defective 3D point and its defective 3D points of the same type are determined to be defective 3D points corresponding to one defect. By adopting the Euclidean distance clustering algorithm, the defective 3D point corresponding to each defect can be determined conveniently and quickly.

[0095] Furthermore, in one or more embodiments of the present invention, the server may determine the above clustering distance threshold through the following steps.

[0096] The server may first determine the contour spacing between the metal surface contour and the metal surface standard contour during the processing according to the first point cloud data and the second point cloud data. Then, the server may determine the clustering distance threshold according to the contour spacing and the acquisition spacing between two adjacent points of the metal surface standard contour by the following formula:

[0097] d = 2 × max (A, B)

[0098] Where d is the cluster distance threshold, A is the contour spacing, and B is the acquisition spacing. By setting an appropriate cluster distance threshold, the clustering accuracy of the defect 3D points of each defect is further improved.

[0099] Finally, the server can input the defect 3D points corresponding to each defect into a pre-trained classifier based on a neural network model, so as to identify the type of each defect through the classifier. The classifier mentioned here can be a relatively mature classifier algorithm model, such as a support vector machine (SVM) model, a dynamic graph convolution network (LDGCNN) model or a linked dynamic graph convolution network (LDGCNN) model, etc. The specific classification model can be determined according to needs, and the present invention does not limit this.

[0100] Taking the DGCNN model as an example, in one or more embodiments of the present invention, the server can input the three-dimensional defect points corresponding to each defect into a pre-trained DGCNN model, extract the type geometric features of the defect, and identify the type of the defect based on the extracted type geometric features.

[0101] The dynamic graph convolutional network is a convolutional neural network that can directly extract features from point clouds and perform classification tasks. Its core module is the 3D graph convolution layer. i And the neighbor of this point {a j :(i, j)∈ε}, then after the mth 3D graph convolution layer:

[0102]

[0103] Among them, θ m and φ m is the learnable parameter of the mth 3D graph convolution layer, which is updated during the network training process. The dynamic convolution network is constructed by stacking 3D graph convolution layers. The neighbors of fixed nodes in each layer of the dynamic graph convolution network change dynamically according to the change of the distance metric, and the graph structure of each layer is dynamically generated, so that the network can well maintain the arrangement invariance of the point cloud and can well capture the local geometric features of the point cloud, improve the model's ability to express and describe the point cloud structure, and improve the recognition effect of defects.

[0104] based on Figure 1 The metal surface defect recognition method shown in the figure first obtains a preset metal surface standard contour and a metal surface contour during processing collected by a 3D laser profiler, then performs template matching on the two contours to determine the closest three-dimensional point pairs in the two contours, and then determines the defective three-dimensional point set in the metal surface contour during processing based on the distance between the three-dimensional point pairs and performs distance clustering analysis on it, so as to obtain the defective three-dimensional points corresponding to each defect, and finally identifies the type of each defect based on a classifier.

[0105] The present invention adopts a 3D laser profiler to collect the metal surface contour during the processing, thereby avoiding the problem of poor metal surface image clarity caused by exposure of a 2D camera. At the same time, template matching of the metal surface contour and the standard contour during the processing is performed based on point cloud data, so that the defective three-dimensional points can be clearly compared and obtained. After distance clustering of the defective three-dimensional points, point cloud data corresponding to the defective area is further obtained. Compared with the image data collected by a 2D camera, the point cloud data corresponding to the defective area has richer information, thereby improving the accuracy of metal surface defect recognition.

[0106] When applying the metal surface defect identification method provided by the present invention, it is not necessary to Figure 1The steps are executed in the order shown. The specific execution order of the steps can be determined according to needs, and the present invention does not limit this.

[0107] In addition, in one or more embodiments of the present invention, when the nearest neighbor point of the standard metal surface contour cannot be found in the first point cloud data corresponding to the metal surface contour during the processing, the server can determine that there are three-dimensional point missing in the metal surface contour during the processing. At this time, the server can further analyze the missing situation, that is, determine whether the amount of three-dimensional point missing in the first point cloud data corresponding to the metal surface contour during the processing is greater than a preset missing threshold. The preset missing threshold here can be set specifically according to business needs, and the present invention does not limit this.

[0108] If yes, the second point cloud data corresponding to the standard contour of the metal surface is not updated through the first point cloud data. When the amount of missing three-dimensional points in the first point cloud data is greater than the preset missing threshold, the server can determine that the first point cloud data has serious missing three-dimensional points. At this time, the server can give up updating the second point cloud data corresponding to the standard contour of the metal surface through the first point cloud data.

[0109] If not, three-dimensional point interpolation is performed on the first point cloud data corresponding to the metal surface contour during the processing, and the nearest neighbor point of the standard contour of the metal surface is re-determined from the first point cloud data corresponding to the metal surface contour during the processing. When the amount of missing three-dimensional points in the first point cloud data is less than or equal to the preset missing threshold, the server can determine that the first point cloud data may have sparse three-dimensional points in some areas. At this time, the server can use an interpolation algorithm to interpolate the metal surface contour during the processing.

[0110] Assume that for two points M(x1, z1) and N(x2, z2) in the area where three-dimensional points are missing in the first point cloud data corresponding to the metal surface contour during a certain frame of processing, the server can first calculate the coordinate difference between the two points by the following formula:

[0111] nor=(x1-x2)+(z1-z2)

[0112] Then, the server can calculate the distance difference between points A and B using the following formula:

[0113]

[0114] Of course, the server can further calculate the unit coordinate difference using the following formula:

[0115] nor_d=nor / dis

[0116] Afterwards, the server may determine that if dis is greater than a preset interpolation threshold (eg, 0.2 mm), no interpolation processing is performed; otherwise, the server may perform interpolation according to the following formula:

[0117] Insertion point coordinates = M + nor_d * 0.05

[0118] That is, the server can insert a 3D point every 0.05nor_d. Figure 4 is a schematic diagram of comparison before and after interpolation of the first point cloud data in the present invention, Figure 4 The left side of the figure shows the first point cloud data before interpolation. It can be seen that there are missing 3D points in the three rectangular boxes. Figure 4 The middle right side is an illustration of the interpolation of the first point cloud data. It can be seen that the 3D points in the three rectangular box areas corresponding to the left side are supplemented, and there is no missing 3D point anymore.

[0119] In addition, since metal materials are three-dimensional materials, they may have abnormal defects such as dents, scratches, and bulges. The point cloud data collected by the 3D laser profiler is three-dimensional data. When performing template matching based on the standard profile of the metal surface and the profile of the metal surface during processing, it may be difficult to determine the specific defect only by the distance between the corresponding three-dimensional point pairs.

[0120] Therefore, in one or more embodiments of the present invention, before performing the distance cluster analysis in step S103, the server may also determine, for each 3D point in the first point cloud data, the error distance between the metal surface profile during processing and the standard metal surface profile at the 3D point according to the normal vector of the nearest neighbor point of the 3D point in the second point cloud data and the distance between the 3D point and its nearest neighbor point, by the following formula:

[0121] Er_Dis(a j )=nor(b i )×dis(a j , b i )

[0122] a j ∈J,b i ∈I

[0123] Among them, J is the first point cloud data, a j is the jth 3D point in the first point cloud data, I is the second point cloud data, b i is the i-th 3D point in the second point cloud data, and the 3D point b i is the 3D point a in the second point cloud data j The nearest neighbor point, nor(b i ) is the 3D point b in the second point cloud data i The normal vector at the position, dis(a j , b i ) is a three-dimensional point a j Its nearest neighbor 3D point b iThe Euclidean distance, Er_Dis(a j ) is a three-dimensional point a j The error distance between the metal surface profile J and the metal surface standard profile I during the processing process. Through the error distance between the three-dimensional point pairs of the two profiles, the error direction of the defective three-dimensional point in the metal surface profile during the processing process can be further judged, so as to facilitate the judgment of whether the defect corresponds to a convex or concave form.

[0124] Furthermore, in one or more embodiments of the present invention, the server may use the combination of the three-dimensional coordinates of the defective three-dimensional point corresponding to each defect and the error distance between the metal surface contour and the standard metal surface contour during the processing at the defective three-dimensional point as the representation of the defective three-dimensional point. Then, for each defect, the defective three-dimensional point corresponding to the defect is input into the pre-trained dynamic graph convolution network to identify the type of the defect. The error distance between the metal surface contour and the standard metal surface contour during the processing is added to further improve the accuracy of metal surface defect recognition.

[0125] In addition, due to the small amount of point cloud defect data and unclear defect features, the classifier model may have shortcomings such as poor recognition accuracy and generalization after direct training.

[0126] Therefore, in one or more embodiments of the present invention, the server may perform distance clustering analysis on the first point cloud data of the metal surface contour during the multi-frame processing, so as to obtain a relatively dense point cloud data representation of each defect. For example, the distance clustering analysis may be performed on the first point cloud data of the metal surface contour during the processing of every 1000 frames.

[0127] Furthermore, in one or more embodiments of the present invention, the server may utilize the method of Self-supervised Representation Learning for Point Clouds (STRL) to improve the representation learning and generalization capabilities of the model, taking a dynamic graph convolutional network as an example.

[0128] Specifically, the server may first obtain historically collected metal surface contour point cloud data as initial point cloud data, and perform continuous transformation operations on the initial point cloud data to construct a point cloud sequence, where the transformation operations include at least one of rotation, translation, and scaling.

[0129] Then, the server can construct a dynamic graph convolution online network and a dynamic graph convolution target network, obtain first sample data corresponding to the dynamic graph convolution online network from the point cloud sequence, obtain second sample data corresponding to the dynamic graph convolution target network, and perform spatial enhancement on the first sample data and the second sample data.

[0130] Secondly, the server can input the first sample data after spatial enhancement into the dynamic graph convolution online network for feature mapping to obtain the features of the first sample data after transformation by the dynamic graph convolution online network, and input the second sample data after spatial enhancement into the dynamic graph convolution target network for feature mapping to obtain the features of the second sample data after transformation by the dynamic graph convolution target network.

[0131] Next, the server can calculate the mean square error between the features of the first sample data after being transformed by the dynamic graph convolution online network and the features of the second sample data after being transformed by the dynamic graph convolution target network by using the additional predictor according to the following formula:

[0132]

[0133] Afterwards, the server can feed the spatially enhanced second sample data to the dynamic graph convolution online network, and feed the spatially enhanced first sample data to the dynamic graph convolution target network, symmetrize the loss in the mean square error, and calculate the total loss by the following formula:

[0134]

[0135] In each training step, the parameters of the dynamic graph convolution online network are updated with the goal of minimizing the total loss. After completing the step training, the parameters of the dynamic graph convolution target network are updated according to the moving average of the dynamic graph convolution online network parameters.

[0136] in, is the mean square error between the features of the first sample data after being transformed by the dynamic graph convolution online network and the features of the second sample data after being transformed by the dynamic graph convolution target network, r(z θ ) is the feature of the first sample data after being transformed by the dynamic graph convolution online network, is the feature of the second sample data after being transformed by the dynamic graph convolution target network, is the loss in the mean square error after symmetry, is the total loss.

[0137] For example, the server can form a point cloud continuous change sequence based on a point cloud p0 by continuously rotating, translating, scaling, etc. Among them, the superscript u represents the first sample data of the corresponding dynamic graph convolution online network, the superscript v represents the second sample data of the corresponding dynamic graph convolution target network, {P} is a set of 3D point cloud sequences, Γ and E are time samplers and spatial enhancement functions. Then, this series of point clouds is spatially enhanced: random cropping, random jitter, downsampling, etc. are used to generate a series of online point cloud data sets (transform data): a u, a v ∈E,x u =a u (p u ), x t =a v (p v ), where x u As the input of the dynamic graph convolution online network, a u is the spatial enhancement function corresponding to the dynamic graph convolution online network, p u is the point cloud dataset corresponding to the dynamic graph convolution online network, x t As the input of the dynamic graph convolution target network, a v is the spatial enhancement function corresponding to the dynamic graph convolution target network, p v This is the point cloud dataset corresponding to the dynamic graph convolution target network. The DGCNN (excluding the MLP layer) dynamic graph convolution method is used as the encoder. g θ , followed by a multi-layer perceptron (MLP) with activation and batch normalization for spatial projection f θ , Preferably, since most defect data are small, the cropping jitter ratio can be set to 0.2. When the number of original point cloud data does not meet the downsampling setting parameters, the server can use repeated random sampling to meet the same number of data points. The predictor r is implemented by a linear layer with activation and batch normalization, and the dynamic graph convolution target network parameters are calculated by the dynamic graph convolution online network parameters. To update, where τ∈[0,1] is the decay rate of the moving average, which is related to the model training rounds. The higher the training rounds, the smaller the decay rate. is the target network parameter of the dynamic graph convolution, and θ is the online network parameter of the dynamic graph convolution. Table 1 is a comparative table showing whether self-supervised representation learning is adopted in the present invention.

[0138] Table 1 Comparison results

[0139] method Acc Directly train DGCNN 89.72% Self-supervised representation learning + DGCNN 94.03%

[0140] In addition, in one or more embodiments of the present invention, the distance clustering algorithm may also use DBCAN distance clustering. The classifier based on the neural network model for type identification of defects may also use a machine learning algorithm SVM or a deep learning related model LDGCNN, etc., and the self-supervised representation learning method may also use deep-cluster and other methods. The present invention does not limit this, and the specific method can be determined according to needs.

[0141] Figure 5 Schematic diagram of a point cloud self-supervised representation learning network structure in the present invention. Figure 5 For each part, please refer to the corresponding description above.

[0142] Figure 6 The figure is a schematic diagram of a comprehensive process of metal surface defect identification in the present invention. Figure 6 It can be seen that the server can dynamically update the standard contour based on the real-time acquisition of each frame of 3D contour data, dynamically generate the second point cloud data of the standard contour of the metal surface, and then perform template matching on the metal surface contour and the standard contour of the metal surface during the processing to determine the defective three-dimensional points in the first point cloud data. Then, a cluster analysis is performed based on the first point cloud data of the metal surface contour during every thousand frames of the processing to obtain the defective three-dimensional points corresponding to each defect. Finally, the point cloud data of each defect is classified through the classification model and the classification result is output.

[0143] The present invention does not use the traditional 2D method to detect steel defects, but uses a 3D defect detection method to avoid the impact of motion blur caused by high-resolution images on defect detection. Furthermore, instead of using the traditional 3D object detection or segmentation method for defect detection, a template matching algorithm is used to eliminate the real-time problem caused by the model running rate. Instead of using the traditional CAD model to convert into point cloud data as a template, a dynamic template generation method is used to reduce the impact of thermal expansion of hot rails and irregular impact of point cloud data caused by other factors. The directional distance algorithm can also be used to calculate the positive and negative difference between the defect and the template, so that the classification model can obtain more information. Furthermore, due to the difficulty in labeling defect data sets and the small amount of data, self-supervised representation learning can also be used to improve model learning and generalization capabilities.

[0144] The above is a metal surface defect recognition method provided by one or more embodiments of the present invention. Based on the same idea, the present invention also provides a corresponding metal surface defect recognition device, such as Figure 7 shown.

[0145] Figure 7 A schematic diagram of a metal surface defect identification device provided by the present invention includes:

[0146] An acquisition module 201 is used to respectively acquire first point cloud data of a metal surface profile during processing and second point cloud data of a preset metal surface standard profile;

[0147] A determination module 202 is used to determine, for each 3D point in the first point cloud data, a nearest neighbor point of the 3D point in the second point cloud data according to the distance between the 3D point and each 3D point in the second point cloud data, so as to match and align the metal surface contour during processing with the metal surface standard contour;

[0148] The defect determination module 203 is used to determine a defective three-dimensional point set corresponding to the defect from the first point cloud data according to the distance between each three-dimensional point in the first point cloud data and the nearest neighbor point in the second point cloud data and a preset error threshold; when the distance between the three-dimensional point in the first point cloud data and its nearest neighbor point in the second point cloud data is greater than the preset error threshold, it indicates that the metal surface profile is different from the standard metal surface profile at the three-dimensional point and there is a defect;

[0149] The clustering module 204 is used to cluster the defect three-dimensional point set by using a distance clustering algorithm to obtain the defect three-dimensional point corresponding to each defect.

[0150] Identification module 205 is used to input the defect 3D points corresponding to each defect into the pre-trained classifier to identify the type of each defect

[0151] Optionally, the clustering module 204 determines, for each defective 3D point in the defective 3D point set, neighbor points within a preset search radius of the defective 3D point, and classifies the neighboring points whose Euclidean distance to the defective 3D point is less than a preset clustering distance threshold as similar defective 3D points together with the defective 3D point, determines, among similar defective 3D points of the defective 3D point, neighbor points within a preset search radius of each similar defective 3D point, and classifies the neighboring points whose Euclidean distance to the similar defective 3D point is less than a preset clustering distance threshold as similar defective 3D points together with the defective 3D point, and determines the final similar defective 3D point of the defective 3D point through multiple rounds of iterative calculation until no new similar defective 3D point can be obtained, and determines that the defective 3D point and its similar defective 3D points are defective 3D points corresponding to one defect.

[0152] Optionally, the clustering module 203 determines the contour spacing between the metal surface contour and the standard contour of the metal surface during the processing process based on the first point cloud data and the second point cloud data, and determines the clustering distance threshold according to the contour spacing and the collection spacing between two adjacent points of the standard contour of the metal surface by the following formula: d=2×max(A, B), where d is the clustering distance threshold, A is the contour spacing, and B is the collection spacing.

[0153] Optionally, the clustering module 203 determines, for each 3D point in the first point cloud data, the error distance between the metal surface profile during processing and the standard metal surface profile at the 3D point according to the normal vector of the nearest neighbor point of the 3D point in the second point cloud data and the distance between the 3D point and its nearest neighbor point by the following formula: Er_Dis(a j )=nor(b i )×dis(a j , b i ), a j ∈J,b i ∈I, where J is the first point cloud data, aj is the jth 3D point in the first point cloud data, I is the second point cloud data, b i is the i-th 3D point in the second point cloud data, and the 3D point b i is the 3D point a in the second point cloud data j The nearest neighbor point, nor(b i ) is the 3D point b in the second point cloud data i The normal vector at the position, dis(a j , b i ) is a three-dimensional point a j Its nearest neighbor 3D point b i The Euclidean distance, Er_Dis(a j ) is a three-dimensional point a j The error distance between the metal surface profile J and the metal surface standard profile I during the machining process.

[0154] Optionally, the identification module 205 uses a combination of the three-dimensional coordinates of the defective three-dimensional point corresponding to each defect and the error distance between the metal surface contour and the standard metal surface contour during processing at the defective three-dimensional point as a representation of the defective three-dimensional point, and for each defect, inputs the defective three-dimensional point corresponding to the defect into a pre-trained dynamic graph convolutional network to extract the type geometric features of the defect, and performs type identification of the defect based on the extracted type geometric features.

[0155] Optionally, the device also includes a training module, which is used to obtain historically collected metal surface contour point cloud data as initial point cloud data, perform continuous transformation operations on the initial point cloud data to construct a point cloud sequence, the transformation operation includes at least one of rotation, translation and scaling, construct a dynamic graph convolution online network and a dynamic graph convolution target network, obtain the first sample data corresponding to the dynamic graph convolution online network from the point cloud sequence, and obtain the second sample data corresponding to the dynamic graph convolution target network, and perform spatial enhancement on the first sample data and the second sample data, input the spatially enhanced first sample data into the dynamic graph convolution online network for feature mapping, and obtain the features of the first sample data after the dynamic graph convolution online network transformation, and input the spatially enhanced second sample data into the dynamic graph convolution target network for feature mapping, and obtain the features of the second sample data after the dynamic graph convolution target network transformation, and calculate the mean square error between the features of the first sample data after the dynamic graph convolution online network transformation and the features of the second sample data after the dynamic graph convolution target network transformation according to the following formula through an additional predictor: The spatially enhanced second sample data is fed into the dynamic graph convolution online network, and the spatially enhanced first sample data is fed into the dynamic graph convolution target network. The loss in the mean square error is symmetric, and the total loss is calculated by the following formula: For each training step, the parameters of the dynamic graph convolution online network are updated with the goal of minimizing the total loss. After completing the step training, the parameters of the dynamic graph convolution target network are updated according to the moving average of the dynamic graph convolution online network parameters, where: is the mean square error between the features of the first sample data after being transformed by the dynamic graph convolution online network and the features of the second sample data after being transformed by the dynamic graph convolution target network, r(z θ ) is the feature of the first sample data after being transformed by the dynamic graph convolution online network, is the feature of the second sample data after being transformed by the dynamic graph convolution target network, is the loss in the mean square error after symmetry, is the total loss.

[0156] Optionally, the acquisition module 201 filters outliers on the first point cloud data through a filtering algorithm to remove outliers in the first point cloud data, determines the nearest neighbor point pairs of the metal surface contour and the metal surface standard contour during the processing process based on the first point cloud data and the second point cloud data, calculates the absolute error distance between the nearest neighbor point pairs, and determines whether the absolute error distance is less than a preset update threshold. If so, calculates the average value of the non-travel direction coordinate values ​​of the first point cloud data and the second point cloud data during the processing process, and updates the second point cloud data corresponding to the metal surface standard contour. If not, the second point cloud data corresponding to the metal surface standard contour is not updated through the first point cloud data.

[0157] Optionally, when the nearest neighbor point of the standard contour of the metal surface cannot be found in the first point cloud data corresponding to the metal surface contour during the processing, the acquisition module 201 determines whether the amount of missing three-dimensional points in the first point cloud data corresponding to the metal surface contour during the processing is greater than a preset missing threshold. If so, the second point cloud data corresponding to the standard contour of the metal surface is not updated through the first point cloud data; if not, three-dimensional point interpolation is performed on the first point cloud data corresponding to the metal surface contour during the processing, and the nearest neighbor point of the standard contour of the metal surface is re-determined from the first point cloud data corresponding to the metal surface contour during the processing.

[0158] For the specific definition of the metal surface defect identification device, please refer to the definition of the metal surface defect identification method above, which will not be repeated here. Each module in the above-mentioned metal surface defect identification device can be implemented in whole or in part by software, hardware and a combination thereof. The above-mentioned modules can be embedded in or independent of the processor in the computer device in the form of hardware, or can be stored in the memory of the computer device in the form of software, so that the processor can call and execute the operations corresponding to the above modules.

[0159] The present invention also provides a computer-readable storage medium, which stores a computer program, which can be used to execute the above Figure 1 A metal surface defect identification method is provided.

[0160] The present invention also provides a computer device. At the hardware level, the computer device includes a processor, an internal bus, a network interface, a memory, and a non-volatile memory. Of course, it may also include hardware required for other services. The processor reads the corresponding computer program from the non-volatile memory into the memory and then runs it to achieve the above Figure 1 A metal surface defect identification method is provided.

[0161] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided by the present invention can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory or optical memory, etc. Volatile memory can include random access memory (RAM) or external cache memory. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM).

[0162] The technical features of the above embodiments may be arbitrarily combined. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of the present invention.

Claims

1. A method for identifying metal surface defects, characterized in that: include: Respectively acquiring first point cloud data of the metal surface contour during processing and second point cloud data of a preset metal surface standard contour; For each 3D point in the first point cloud data, determine the nearest neighbor point of the 3D point in the second point cloud data according to the distance between the 3D point and each 3D point in the second point cloud data, so as to match and align the metal surface contour during processing with the metal surface standard contour; Determine a defective three-dimensional point set corresponding to the defect from the first point cloud data according to the distance between each three-dimensional point in the first point cloud data and the nearest neighbor point in the second point cloud data and a preset error threshold; when the distance between the three-dimensional point in the first point cloud data and its nearest neighbor point in the second point cloud data is greater than the preset error threshold, it indicates that the metal surface profile is different from the standard metal surface profile at the three-dimensional point and there is a defect; The defect 3D point set is clustered by using the distance clustering algorithm to obtain the defect 3D point corresponding to each defect; The defect 3D points corresponding to each defect are input into a pre-trained classifier to identify the type of each defect.

2. The metal surface defect identification method according to claim 1, characterized in that: The method of clustering the defect three-dimensional point set by using the distance clustering algorithm to obtain the defect three-dimensional points corresponding to each defect specifically includes: For each defective 3D point in the defective 3D point set, determine a neighbor point within a preset search radius of the defective 3D point; Classify the neighboring points whose Euclidean distance to the defective 3D point is less than a preset clustering distance threshold and the defective 3D point as defective 3D points of the same type; Determine neighboring points within a preset search radius of each similar defective 3D point among similar defective 3D points of the defective 3D point, and classify the neighboring points whose Euclidean distance to the similar defective 3D point is less than a preset clustering distance threshold with the defective 3D point as similar defective 3D points; The final similar defect 3D point of the defect 3D point is determined through multiple rounds of iterative calculation until no new similar defect 3D point can be obtained, and the defect 3D point and its similar defect 3D point are determined to be defect 3D points corresponding to one defect.

3. The metal surface defect identification method according to claim 2, characterized in that: Determining the cluster distance threshold specifically includes: Determine, based on the first point cloud data and the second point cloud data, a contour spacing between a metal surface contour during processing and a standard contour of the metal surface; According to the contour spacing and the collection spacing between two adjacent points of the standard metal surface contour, the clustering distance threshold is determined by the following formula: d = 2 × max (A, B); Among them, d is the clustering distance threshold, A is the contour spacing, and B is the collection spacing.

4. The metal surface defect identification method according to claim 1, characterized in that: The method further comprises: For each 3D point in the first point cloud data, the error distance between the metal surface profile during processing and the standard metal surface profile at the 3D point is determined by the following formula according to the normal vector of the nearest neighbor point of the 3D point in the second point cloud data and the distance between the 3D point and its nearest neighbor point: Er_Dis(a j )=nor(b i )×dis(a j ,b i ),a j ∈J,b i ∈I; Among them, J is the first point cloud data, a j is the jth 3D point in the first point cloud data, I is the second point cloud data, b i is the i-th 3D point in the second point cloud data, and the 3D point b i is the 3D point a in the second point cloud data j The nearest neighbor point, nor(b i ) is the 3D point b in the second point cloud data i The normal vector at the position, dis(a j ,b i ) is a three-dimensional point a j Its nearest neighbor 3D point b i The Euclidean distance, Er_Dis(a j ) is a three-dimensional point a j The error distance between the metal surface profile J and the metal surface standard profile I during the machining process.

5. The metal surface defect identification method according to claim 4, characterized in that: The three-dimensional defect points corresponding to each defect are input into a pre-trained classifier to identify the type of each defect, specifically including: The combination of the three-dimensional coordinates of the defective three-dimensional point corresponding to each defect and the error distance between the metal surface contour and the standard metal surface contour during processing at the defective three-dimensional point is used as the representation of the defective three-dimensional point; For each defect, the three-dimensional defect point corresponding to the defect is input into the pre-trained dynamic graph convolutional network as a classifier to extract the type geometric features of the defect, and the type of the defect is identified based on the extracted type geometric features.

6. The metal surface defect identification method according to claim 5, characterized in that: Training the dynamic graph convolutional network specifically includes: Acquire historically collected metal surface contour point cloud data as initial point cloud data, and perform continuous transformation operations on the initial point cloud data to construct a point cloud sequence, wherein the transformation operations include at least one of rotation, translation, and scaling; Constructing a dynamic graph convolution online network and a dynamic graph convolution target network, obtaining first sample data corresponding to the dynamic graph convolution online network from the point cloud sequence, obtaining second sample data corresponding to the dynamic graph convolution target network, and performing spatial enhancement on the first sample data and the second sample data; Inputting the spatially enhanced first sample data into the dynamic graph convolution online network for feature mapping to obtain features of the first sample data after being transformed by the dynamic graph convolution online network, and inputting the spatially enhanced second sample data into the dynamic graph convolution target network for feature mapping to obtain features of the second sample data after being transformed by the dynamic graph convolution target network; By adding a predictor, the mean square error between the features of the first sample data after being transformed by the dynamic graph convolution online network and the features of the second sample data after being transformed by the dynamic graph convolution target network is calculated according to the following formula: The spatially enhanced second sample data is fed into the dynamic graph convolution online network, and the spatially enhanced first sample data is fed into the dynamic graph convolution target network. The loss in the mean square error is symmetric, and the total loss is calculated by the following formula: For each training step, the parameters of the dynamic graph convolution online network are updated with the goal of minimizing the total loss. After completing the step training, the parameters of the dynamic graph convolution target network are updated according to the moving average of the dynamic graph convolution online network parameters. in, is the mean square error between the features of the first sample data after being transformed by the dynamic graph convolution online network and the features of the second sample data after being transformed by the dynamic graph convolution target network, r(z θ ) is the feature of the first sample data after being transformed by the dynamic graph convolution online network, is the feature of the second sample data after being transformed by the dynamic graph convolution target network, is the loss in the mean square error after symmetry, is the total loss.

7. The metal surface defect identification method according to claim 1, characterized in that: The method further comprises: Performing outlier filtering on the first point cloud data by using a filtering algorithm to remove outlier points in the first point cloud data; Determine the nearest neighbor point pair of the metal surface profile and the metal surface standard profile during the processing according to the first point cloud data and the second point cloud data; Calculate the absolute error distance between the nearest neighbor point pairs, and determine whether the absolute error distance is less than a preset update threshold; If yes, then the average values ​​of the non-travel direction coordinate values ​​of the first point cloud data and the second point cloud data during the machining process are calculated, and the second point cloud data corresponding to the standard profile of the metal surface is updated; If not, the second point cloud data corresponding to the standard contour of the metal surface is not updated through the first point cloud data.

8. The metal surface defect identification method according to claim 7, characterized in that: The method further comprises: When the nearest neighbor point of the standard contour of the metal surface cannot be found in the first point cloud data corresponding to the contour of the metal surface during processing, determining whether the amount of missing three-dimensional points in the first point cloud data corresponding to the contour of the metal surface during processing is greater than a preset missing threshold; If yes, the second point cloud data corresponding to the standard contour of the metal surface is not updated through the first point cloud data; If not, three-dimensional point interpolation is performed on the first point cloud data corresponding to the metal surface contour during the processing, and the nearest neighbor point of the metal surface standard contour is re-determined from the first point cloud data corresponding to the metal surface contour during the processing.

9. A metal surface defect identification device, characterized in that: include: An acquisition module, used to respectively acquire first point cloud data of a metal surface contour during processing and second point cloud data of a preset metal surface standard contour; A determination module, for determining, for each 3D point in the first point cloud data, a nearest neighbor point of the 3D point in the second point cloud data according to the distance between the 3D point and each 3D point in the second point cloud data, so as to match and align the metal surface contour during processing with the metal surface standard contour; A defect determination module is used to determine a defective three-dimensional point set corresponding to a defect from the first point cloud data according to the distance between each three-dimensional point in the first point cloud data and the nearest neighbor point in the second point cloud data and a preset error threshold; when the distance between a three-dimensional point in the first point cloud data and its nearest neighbor point in the second point cloud data is greater than the preset error threshold, it indicates that the metal surface profile is different from the standard metal surface profile at the three-dimensional point and there is a defect; The clustering module is used to cluster the defect 3D point set by using the distance clustering algorithm to obtain the defect 3D point corresponding to each defect; The recognition module is used to input the three-dimensional defect points corresponding to each defect into a pre-trained classifier to identify the type of each defect.

10. A computer device, characterized in that: The method comprises a memory, a processor and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, the method described in any one of claims 1 to 8 is implemented.

Citation Information

Patent Citations

  • 3D printing product three-dimensional defect detection method based on a grating projection multi-step phase shift method

    CN109242828A

  • Surface defect detection and three-dimensional modeling

    CN109345523A

  • Workpiece defect detection method and system and computer readable storage medium

    CN112669460A

  • Industrial part pose estimation method and system

    CN113128610A

  • Three-dimensional point cloud-based surface defect detection method and device and storage medium

    CN113205486A

Cited By

  • A surface corrugation defect repair method and online repair system for electric upsetting parts

    CN119753666A

  • Flaw detection method and system for large mold production based on machine vision

    CN121724935A

  • Navigation path generation method and system, electronic equipment and readable storage medium

    CN122281939A