A special-shaped bushing defect detection method and system based on generative adversarial network

By using generative adversarial network technology, the problems of automation and intelligence in the detection of defects on the outer surface of irregular bushings have been solved, achieving efficient and accurate defect identification and detection, and improving production efficiency and product quality.

CN118365646BActive Publication Date: 2024-10-01YANTAI DONGZE AUTO PARTS
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410796193.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-06-20
Publication Date
2024-10-01
Estimated Expiration
2044-06-20

AI Technical Summary

Technical Problem

Traditional methods for detecting defects on the outer surface of irregular bushings rely on manual visual inspection, which is inefficient, susceptible to subjective factors, lacks automation and intelligence, and cannot accurately identify minute defects.

Method used

A generative adversarial network-based approach is adopted to generate point cloud data from image data, use Euclidean clustering algorithm for denoising, construct generator and discriminator, and introduce attention mechanism and cross-entropy loss function for model training and defect detection.

Benefits of technology

It enables automated and intelligent detection of defects on the outer surface of irregular bushings, improves defect identification capabilities and detection efficiency, reduces labor costs, and enhances rapid detection and positioning capabilities on the production line.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118365646B_ABST
    Figure CN118365646B_ABST
Patent Text Reader

Abstract

The present invention relates to the field of defect detection technology, and in particular to a method and system for defect detection of special-shaped bushings based on a generative adversarial network. The method comprises acquiring image data containing the outer surface of the special-shaped bushing, and generating point cloud data using the image data; preprocessing the generated point cloud data, including denoising the point cloud data using a Euclidean clustering algorithm; constructing an adversarial network model using the preprocessed point cloud data, including constructing a generator, a discriminator, and a loss function; training the model based on the constructed adversarial network model, including training the generator and the discriminator; performing defect detection of the model using the preprocessed point cloud data and the adversarial network model; and recording defects according to the defect detection results. The present invention can better focus on and utilize important information in point cloud data by introducing a generative adversarial network with an attention mechanism, thereby improving the accuracy and efficiency of defect detection.
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 method and system for detecting defects in special-shaped bushings based on a generative adversarial network. Background Art

[0002] In the prior art, special-shaped bushings are a key component used in engineering and manufacturing, and are usually used to reduce friction, wear or vibration in mechanical devices. The quality of their outer surface is crucial to ensure the operating stability and life of the equipment. However, there are some challenges in the traditional method of detecting defects on the outer surface of special-shaped bushings, mainly including the following aspects:

[0003] Reliance on manual inspection: Currently, most surface defect detection of special-shaped bushings still relies on manual visual inspection, which is time-consuming, labor-intensive, inefficient, and easily affected by subjective factors.

[0004] Lack of automation and intelligence: Traditional detection methods lack automation and intelligence and cannot meet the needs of modern manufacturing for efficient and accurate detection.

[0005] Limited defect recognition capability: Due to the complexity of the outer surface of special-shaped bushings, traditional methods are often unable to accurately identify tiny defects or shape deviations on the surface. At this stage, a special-shaped bushing defect detection method and system based on a generative adversarial network is needed. Summary of the invention

[0006] In order to solve the problem of low detection efficiency and recognition accuracy in the detection of defects on the outer surface of special-shaped bushings, the present invention provides a special-shaped bushing defect detection method and system based on a generative adversarial network, which can realize automated and intelligent operation and effectively improve the defect recognition capability.

[0007] In the first aspect, the present invention provides a method for detecting defects in special-shaped bushings based on a generative adversarial network, which adopts the following technical solution:

[0008] A defect detection method for special-shaped bushings based on a generative adversarial network, comprising:

[0009] Acquire image data including the outer surface of the special-shaped bushing, and generate point cloud data using the image data;

[0010] Preprocessing the generated point cloud data, including denoising the point cloud data using the Euclidean clustering algorithm;

[0011] Use the preprocessed point cloud data to build an adversarial network model, including building a generator, a discriminator, and a loss function;

[0012] Perform model training based on the constructed adversarial network model, including training the generator and discriminator;

[0013] Use preprocessed point cloud data and adversarial network models to detect model defects;

[0014] Defect records are made based on the defect detection results.

[0015] Furthermore, the point cloud data is generated by using the image data, including selecting a plurality of different acquisition angles and directions to cover various parts and features of the bushing, setting the position and posture of the depth camera according to the determined acquisition angles and directions, and obtaining the principal point c of the depth camera. x 、c y ,focal length and the camera's image resolution , calculate the coordinates (x, y) of the normalized plane, and calculate the point cloud coordinates according to the coordinates of the normalized plane. The formula for calculating the coordinates (x, y) of the normalized plane is:

[0016] ,

[0017] ,

[0018] Among them, u and v are the horizontal and vertical pixel coordinates, respectively, and W and H are the image width and height, respectively.

[0019] Furthermore, the point cloud data is denoised using the Euclidean clustering algorithm, including determining the clustering radius using the K nearest neighbor method, calculating the Euclidean distance of each point in the point cloud data with all other points, grouping two points whose Euclidean distance is less than the clustering radius into one cluster, determining noise points based on the number of points in each cluster, and marking the noise points in the original point cloud data using NaN.

[0020] Furthermore, the use of the preprocessed point cloud data to construct an adversarial network model includes constructing a generator, using noise points to generate a random noise vector as an input of the generator, using a generator function to map the random noise vector and the attention matrix to point cloud data, introducing an attention mechanism in the generator based on the attention matrix, calculating the attention weight for each node according to the attention mechanism, and updating the feature vector of the node using the calculated attention weight. The calculation formula is:

[0021] ,

[0022] in, is a fully connected layer learned from the noise vector z, used to generate node features; is the feature vector of node i The inner product with the learned attention weight parameter g calculates the importance of the node; Function is used to normalize the attention weights.

[0023] Furthermore, the method of constructing an adversarial network model using the preprocessed point cloud data also includes constructing a discriminator, and using the discriminator function to map the input point cloud data to the probability of real data, using the cross entropy loss function as the adversarial loss to calculate the similarity between the generated point cloud data and the real data, and using the Chamfer distance loss function as an auxiliary loss to assist the generator in learning the features of the point cloud data, and obtaining the overall loss function using the weighted sum of the adversarial loss and the auxiliary loss.

[0024] Furthermore, the model training is performed based on the constructed adversarial network model, including optimizing the generator parameters by minimizing the overall loss function, optimizing the discriminator parameters by minimizing the adversarial loss function, alternately training the generator and the discriminator, and iterating repeatedly until the loss function converges, thereby prompting the generator to generate realistic point cloud data.

[0025] Furthermore, the use of preprocessed point cloud data and the adversarial network model to perform model defect detection includes using a generator to generate a large number of bushing surface samples, comparing the generated samples with the actual bushing surface for defect detection, evaluating the detection results, and adjusting and optimizing model parameters based on the detection results.

[0026] In the second aspect, a special-shaped bushing defect detection system based on a generative adversarial network comprises:

[0027] The data acquisition module is configured to: acquire image data including the outer surface of the special-shaped bushing, and generate point cloud data using the image data;

[0028] The preprocessing module is configured to: preprocess the generated point cloud data, including denoising the point cloud data using a Euclidean clustering algorithm;

[0029] The model building module is configured to: construct an adversarial network model using the preprocessed point cloud data, including constructing a generator, a discriminator, and a loss function;

[0030] The model training module is configured to: perform model training based on the constructed adversarial network model, including training the generator and the discriminator;

[0031] The defect detection module is configured to: perform defect detection of the model using the preprocessed point cloud data and the adversarial network model;

[0032] The recording module is configured to: record defects according to defect detection results.

[0033] In a third aspect, the present invention provides a computer-readable storage medium storing a plurality of instructions, wherein the instructions are suitable for being loaded and executed by a processor of a terminal device, a method for detecting defects of special-shaped bushings based on a generative adversarial network.

[0034] In a fourth aspect, the present invention provides a terminal device, including a processor and a computer-readable storage medium, the processor being used to implement various instructions; the computer-readable storage medium being used to store multiple instructions, the instructions being suitable for being loaded by the processor and executing the method for detecting special-shaped bushing defects based on a generative adversarial network.

[0035] In summary, the present invention has the following beneficial technical effects:

[0036] 1. The present invention can better focus on and utilize important information in point cloud data by introducing a generative adversarial network with an attention mechanism, thereby improving the accuracy and efficiency of defect detection. The generative adversarial network technology is used to realize automatic detection of defects on the outer surface of special-shaped bushings without the need for human intervention, thus reducing labor costs. The invention also has intelligent characteristics and can automatically learn and adapt to different defect characteristics.

[0037] 2. The generator part of the present invention utilizes the attention mechanism to generate more realistic and high-quality point cloud data samples. These samples can be used to train and improve the defect detection model, improve the generalization ability and robustness of the model, and through the automated method of detecting defects on the outer surface of special-shaped bushings, it is possible to quickly detect and locate surface defects of bushings on the production line, discover and solve problems in the production process in advance, and improve production efficiency and product quality. BRIEF DESCRIPTION OF THE DRAWINGS

[0038] Figure 1 It is a schematic diagram of the overall process of a method for detecting defects in a special-shaped bushing based on a generative adversarial network in Example 1 of the present invention. DETAILED DESCRIPTION

[0039] The present invention is further described in detail below in conjunction with the accompanying drawings.

[0040] Example 1

[0041] Reference Figure 1 , a defect detection method for a special-shaped bushing based on a generative adversarial network in this embodiment includes:

[0042] Acquire image data including the outer surface of the special-shaped bushing, and generate point cloud data using the image data;

[0043] Preprocessing the generated point cloud data, including denoising the point cloud data using the Euclidean clustering algorithm;

[0044] Use the preprocessed point cloud data to build an adversarial network model, including building a generator, a discriminator, and a loss function;

[0045] Perform model training based on the constructed adversarial network model, including training the generator and discriminator;

[0046] Use preprocessed point cloud data and adversarial network models to detect model defects;

[0047] Defect records are made based on the defect detection results.

[0048] Specifically, a defect detection method for a special-shaped bushing based on a generative adversarial network in this embodiment includes the following steps:

[0049] S1. acquiring image data of the outer surface of the special-shaped bushing, and generating point cloud data using the image data;

[0050] (1) In-depth data collection:

[0051] like Figure 1 As shown, using a depth camera, select multiple different angles and directions to cover various parts and features of the bushing; according to the determined acquisition angle and direction, set the position and posture of the depth camera to ensure data collection of the bushing from different perspectives; after collecting data at each angle and direction, adjust the position and posture of the camera to collect data at the next angle. Repeat this process until data collection is completed at all predetermined angles and directions.

[0052] (2) Point cloud data generation:

[0053] Get the principal point c of the depth camera x 、c y ,focal length and the camera's image resolution , calculate the coordinates (x, y) of the normalized plane, and calculate the point cloud coordinates according to the coordinates of the normalized plane. The formula for calculating the coordinates (x, y) of the normalized plane is:

[0054] ,

[0055] ,

[0056] Among them, u and v are the horizontal and vertical pixel coordinates, respectively, and W and H are the image width and height, respectively.

[0057] The formula for calculating point cloud coordinates is:

[0058] ,

[0059] in, For depth, is the depth scale.

[0060] S2. Preprocessing the generated point cloud data, including denoising the point cloud data using a Euclidean clustering algorithm;

[0061] Point cloud data denoising based on Euclidean clustering, using The nearest neighbor method determines the cluster radius, and the formula is as follows:

[0062] ,

[0063] Among them, r is the cluster radius, k is a constant with a value of 3, It is the average distance of all points in the point cloud data.

[0064] For each point p i , calculate with all other points p j The Euclidean distance d(p i , p j )if , then Classify The specific calculation formula for the cluster is as follows:

[0065] ,

[0066] in, and Yes and Point The coordinates of .

[0067] The number of points n in each cluster is used to determine whether the cluster contains noise points. n is a dynamically learned value. If the number of points in a cluster is much smaller than the average number of points in other clusters, it indicates that the cluster contains noise points.

[0068] Points considered as noise points are marked with NaN in the original point cloud data so that they can be distinguished in subsequent processing.

[0069] S3. Use the preprocessed point cloud data to build an adversarial network model, including constructing a generator, a discriminator, and a loss function;

[0070] 1. Generator Design

[0071] Generate realistic point cloud data from random noise vectors, introduce attention mechanism to improve the quality of data generation, use graph convolutional network to construct the generator network structure, and effectively process the topological structure and local relationship of point cloud data.

[0072] (1) Generator function

[0073] The generator function converts the random noise vector And the attention matrix A is mapped to point cloud data , the calculation formula is as follows:

[0074] ,

[0075] Among them, G is the generator function that accepts the random noise vector Z and the attention matrix A as input and generates point cloud data as output.

[0076] (2) Attention mechanism design

[0077] Introducing the attention mechanism into the generator enables the generator to Dynamically adjust the degree of attention paid to different local areas of the bushing to generate more realistic and accurate point cloud data.

[0078] For each node i, the attention weight It can be calculated by the following formula:

[0079] ,

[0080] in, is a fully connected layer learned from the noise vector z, used to generate node features; is the feature vector of node i The inner product with the learned attention weight parameter g calculates the importance of the node; Function is used to normalize the attention weights.

[0081] (3) Node feature update

[0082] According to the calculated attention weight, update the feature vector of the node , the calculation formula is as follows:

[0083] ,

[0084] Among them, N(i) is the set of neighbor nodes of node i, W is the learned weight matrix, is the activation function.

[0085] 2. Discriminator Design

[0086] The discriminator is responsible for distinguishing whether the generated point cloud data is real or forged, and whether it is a normal or defective bushing surface.

[0087] The discriminator function takes the input point cloud data Mapped to probability, indicating the probability of it being real data, as follows:

[0088] ,

[0089] in, represents a real sample of point cloud data, Represents the point cloud data sample generated by the generator, Prob represents the probability, Represented as input point cloud data is the probability of the real data, and D is represented as the discriminator function. It is represented as the probability that the input point cloud data is judged by the discriminator D as real data.

[0090] 3. Loss Function Design

[0091] (1) Fighting against losses

[0092] To measure whether the point cloud data generated by the generator can deceive the discriminator, that is, the similarity between the generated point cloud data and the real data, this application uses the cross entropy loss function, which can be specifically expressed as:

[0093] ,

[0094] is the discriminator for the real point cloud data The output, Represents the point cloud data generated by the generator using random noise z as input, and They are respectively the real point cloud data and the expected value of the random noise z, Measuring the discriminator's ability to identify real point cloud data The effect of It is a measure of the discriminator's ability to identify the data generated by the generator. effect.

[0095] (2) Auxiliary loss

[0096] To assist the generator in learning point cloud data features, this application uses the Chamfer distance loss function, which can be specifically expressed as:

[0097] ,

[0098] (3) Total loss function

[0099] The total loss of the generator consists of a weighted sum of the adversarial loss and the auxiliary loss, as follows:

[0100] ,

[0101] in, and is the weighting constant.

[0102] The total loss of the discriminator is the adversarial loss, which can be expressed as:

[0103] ,

[0104] in, Denote as the loss function of the discriminator.

[0105] S4. Perform model training based on the constructed adversarial network model, including training the generator and the discriminator;

[0106] (1) Generator training

[0107] The goal of the generator is to deceive the discriminator as much as possible so that the discriminator cannot accurately distinguish the generated point cloud data from the real data. The generator parameters are optimized by minimizing the overall loss function, which can be specifically expressed as:

[0108] ,

[0109] in, Expressed as the loss function of the generator, Expressed as the loss function of the generator Perform the minimize operation.

[0110] (2) Discriminator training

[0111] The discriminator objective is to distinguish the generated point cloud data from the real data as much as possible, and optimize the discriminator parameters by minimizing the adversarial loss function, which can be specifically expressed as:

[0112] ,

[0113] in, Expressed as the loss function of the discriminator, Expressed as the loss function of the discriminator Perform the minimize operation.

[0114] During the training process, the generator and the discriminator are trained alternately, first updating the generator and then updating the discriminator, and iterating repeatedly until the loss function converges, prompting the generator to generate realistic point cloud data while improving the discriminator's ability to distinguish.

[0115] S5. Use the preprocessed point cloud data and adversarial network model to perform defect detection on the model;

[0116] The generative adversarial network model is trained using the prepared point cloud dataset. The generator attempts to generate realistic defect surfaces to deceive the discriminator, while the discriminator tries to distinguish between real defect surfaces and generated defect surfaces as much as possible. After the model training is completed, the generator is used to generate a large number of bushing surface samples, and the generated samples are compared with the actual bushing surface to detect the differences. The detection results are evaluated, and the model parameters are adjusted and optimized according to relevant needs to improve the accuracy and stability of detection.

[0117] S6. Record defects according to defect detection results;

[0118] Record the defect data detected in S5 and transmit it back to S3 as auxiliary data to help generate adversarial network model training. Continuously monitor the model training process and adjust the model training strategy and parameter settings according to the effect of the defect data transmitted back.

[0119] Example 2

[0120] The difference between this embodiment and embodiment 1 is that this embodiment provides a special-shaped bushing defect detection system based on a generative adversarial network, including:

[0121] The data acquisition module is configured to: acquire image data including the outer surface of the special-shaped bushing, and generate point cloud data using the image data;

[0122] The preprocessing module is configured to: preprocess the generated point cloud data, including denoising the point cloud data using a Euclidean clustering algorithm;

[0123] The model building module is configured to: construct an adversarial network model using the preprocessed point cloud data, including constructing a generator, a discriminator, and a loss function;

[0124] The model training module is configured to: perform model training based on the constructed adversarial network model, including training the generator and the discriminator;

[0125] The defect detection module is configured to: perform defect detection of the model using the preprocessed point cloud data and the adversarial network model;

[0126] The recording module is configured to: record defects according to defect detection results.

[0127] A computer-readable storage medium stores a plurality of instructions, wherein the instructions are suitable for being loaded and executed by a processor of a terminal device, a method for detecting defects of a special-shaped bushing based on a generative adversarial network.

[0128] A terminal device includes a processor and a computer-readable storage medium, wherein the processor is used to implement various instructions; the computer-readable storage medium is used to store multiple instructions, wherein the instructions are suitable for being loaded and executed by the processor to implement a method for detecting defects in a special-shaped bushing based on a generative adversarial network.

[0129] 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 special-shaped bushing defect detection method based on generative adversarial network, characterized in that: include: Acquire image data including the outer surface of the special-shaped bushing, and generate point cloud data using the image data; Preprocessing the generated point cloud data, including denoising the point cloud data using the Euclidean clustering algorithm; The adversarial network model is constructed using the preprocessed point cloud data, including constructing a generator, a discriminator and a loss function. Specifically, the generator is constructed as follows: generating realistic point cloud data from a random noise vector, and introducing an attention mechanism to improve the quality of data generation. The generator network structure is constructed using a graph convolutional network. A random noise vector is generated using noise points as the input of the generator. The random noise vector and the attention matrix are mapped to point cloud data using a generator function. An attention mechanism is introduced into the generator based on the attention matrix. The attention weight of each node is calculated according to the attention mechanism. The feature vector of the node is updated using the calculated attention weight. The attention weight a i The calculation formula is: , in, is a fully connected layer learned from the noise vector z, used to generate node features; is the feature vector of node i The inner product with the learned attention weight parameter g calculates the importance of the node; The function is used to normalize the attention weights; It also includes building a discriminator and using the discriminator function to map the input point cloud data to the probability of real data, and using the cross entropy loss function as the adversarial loss to calculate the similarity between the generated point cloud data and the real data. The cross entropy loss function can be specifically expressed as: , is the discriminator for the real point cloud data The output, Represents the point cloud data generated by the generator using random noise z as input, and They are respectively the real point cloud data and the expected value of the random noise z, Measuring the discriminator's ability to identify real point cloud data The effect of It is a measure of the discriminator's ability to identify the data generated by the generator. The Chamfer distance loss function is used as an auxiliary loss to assist the generator in learning the features of point cloud data. The weighted sum of the adversarial loss and the auxiliary loss is used to obtain the overall loss function, where the Chamfer distance loss function can be specifically expressed as: ; Perform model training based on the constructed adversarial network model, including training the generator and discriminator; Use preprocessed point cloud data and adversarial network models to detect model defects; Defect records are made based on the defect detection results.

2. According to claim 1, a method for detecting defects in special-shaped bushings based on a generative adversarial network is characterized in that: The method of generating point cloud data using image data includes selecting a plurality of different acquisition angles and directions to cover various parts and features of the bushing, setting the position and posture of the depth camera according to the determined acquisition angles and directions, and obtaining the principal point c of the depth camera. x 、c y ,focal length And the image resolution W×H of the camera, calculate the coordinates (x, y) of the normalized plane, and calculate the point cloud coordinates according to the coordinates of the normalized plane. The formula for calculating the coordinates (x, y) of the normalized plane is: , , Among them, u and v are the horizontal and vertical pixel coordinates, respectively, and W and H are the image width and height, respectively.

3. The method for detecting special-shaped bushing defects based on a generative adversarial network according to claim 2 is characterized in that: The method of using the Euclidean clustering algorithm to denoise the point cloud data includes using the K nearest neighbor method to determine the clustering radius, calculating the Euclidean distance between each point in the point cloud data and all other points, classifying two points whose Euclidean distance is less than the clustering radius into one cluster, determining the noise points according to the number of points in each cluster, and marking the noise points with NaN in the original point cloud data.

4. The method for detecting special-shaped bushing defects based on a generative adversarial network according to claim 3 is characterized in that: The model training is performed based on the constructed adversarial network model, including optimizing the generator parameters by minimizing the overall loss function, optimizing the discriminator parameters by minimizing the adversarial loss function, alternately training the generator and the discriminator, and iterating repeatedly until the loss function converges, thereby prompting the generator to generate realistic point cloud data.

5. The method for detecting defects of special-shaped bushings based on generative adversarial networks according to claim 4 is characterized in that: The method of using the preprocessed point cloud data and the adversarial network model to perform defect detection on the model includes using a generator to generate a large number of bushing surface samples, comparing the generated samples with the actual bushing surface for defect detection, evaluating the detection results, and adjusting and optimizing the model parameters based on the detection results.

6. A defect detection system for special-shaped bushings based on a generative adversarial network, executing the method according to any one of claims 1 to 5, characterized in that: include: The data acquisition module is configured to: acquire image data including the outer surface of the special-shaped bushing, and generate point cloud data using the image data; The preprocessing module is configured to: preprocess the generated point cloud data, including denoising the point cloud data using a Euclidean clustering algorithm; The model building module is configured to: construct an adversarial network model using the preprocessed point cloud data, including constructing a generator, a discriminator, and a loss function; The model training module is configured to: perform model training based on the constructed adversarial network model, including training the generator and the discriminator; The defect detection module is configured to: perform defect detection of the model using the preprocessed point cloud data and the adversarial network model; The recording module is configured to: record defects according to defect detection results.

7. A computer-readable storage medium storing a plurality of instructions, characterized in that: The instructions are suitable for being loaded by a processor of a terminal device and executed by a method for detecting defects of special-shaped bushings based on a generative adversarial network as described in claim 1.

8. A terminal device, comprising a processor and a computer-readable storage medium, wherein the processor is used to implement each instruction; and the computer-readable storage medium is used to store multiple instructions, characterized in that: The instructions are suitable for being loaded by a processor and executing a method for detecting defects in special-shaped bushings based on a generative adversarial network as described in claim 1.