A weld seam position detection method, system, device and storage medium
By generating a noisy data training set using a generative adversarial network and combining it with the YOLOv5 model for weld seam target detection, the problem of insufficient accuracy of intelligent welding recognition in noisy environments is solved. This achieves efficient and accurate identification of weld seam positions, improving welding quality and efficiency.
Patent Information
- Application Number
- CN202310445034.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-04-23
- Publication Date
- 2025-11-07
- Estimated Expiration
- 2043-04-23
AI Technical Summary
Existing intelligent welding recognition technologies perform poorly in noisy environments, and the algorithms get stuck in local optima, failing to accurately identify weld locations and affecting welding quality.
Noisy data is generated using a Generative Adversarial Network (GAN) model to expand the training dataset, and then combined with the YOLOv5 model for weld seam target detection to improve recognition accuracy and precision.
By generating noise data to enhance the training set, the accuracy and precision of weld seam identification are significantly improved, thereby enhancing welding quality and efficiency. It is adaptable to different environments and has strong applicability and promotional value.
Smart Images

Figure CN116645327B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of intelligent welding recognition, and relates to a method, system, device and storage medium for weld position detection. Background Technology
[0002] The joint formed during welding, connecting two joined parts, is called a weld. The two sides of the weld are subjected to welding heat during welding, resulting in changes in microstructure and properties; this area is called the heat-affected zone (HAZ). Depending on the workpiece material, welding material, and welding current, overheating, embrittlement, hardening, or softening may occur in the weld and HAZ after welding, degrading the performance of the weldment and worsening its weldability. Therefore, adjusting welding conditions is necessary. Preheating the weld joint before welding, maintaining heat during welding, and post-weld heat treatment can improve the weld quality. Furthermore, the accuracy of automated welding heavily relies on the accuracy of radar probes in identifying the weld; therefore, improving identification accuracy becomes a crucial part of improving welding precision.
[0003] The shortcomings of existing intelligent welding recognition technology are: (1) It has poor noise resistance. Under different environments and noise conditions, the recognition effect will be greatly affected, the weld recognition ability will be greatly reduced, and the welding effect will also be worse. (2) From the algorithm level, the current algorithm is trapped in local optima, both in terms of recognition accuracy and training dataset, which makes it impossible to obtain the optimal solution. Summary of the Invention
[0004] The purpose of this invention is to overcome the shortcomings of the prior art and provide a weld position detection method, system, device and storage medium that can greatly improve the efficiency, accuracy and precision of weld identification.
[0005] To achieve the above objectives, the present invention employs the following technical solution:
[0006] A method for detecting weld location includes the following steps:
[0007] Step 1: Collect existing weld seam images of different types, and use a portion of the weld seam images as a label set S1;
[0008] Step 2: Collect existing noise during the welding process and use it as a noise training set to train the GAN model until the model generates noise, which is then used as the MG model;
[0009] Step 3: Combine the noise generated by the MG model with the label set S1 to form the sample dataset S2;
[0010] Step 4: Use data augmentation on the label set S1 and the sample dataset S2 to expand and generate the label set S1-A and the sample dataset S2-A;
[0011] Step 5: Fuse the label set S1-A and the sample data set S2-A as a fusion data set S3, and divide part of the data in the fusion data set S3 into a training set;
[0012] Step 6: Train the YOLOv5 model using the training set to obtain a weld target detection model;
[0013] Step 7: Detect the weld position using the weld target detection model.
[0014] Preferably, in step 2, the process of training the GAN model is as follows: the generator G first generates noise images that tend to be real by learning the distribution of real noise images, which are sufficient to deceive the discriminator D; then, the discriminator D discriminates the authenticity of the images generated by the generator G; the generator G improves the authenticity of the generated images to deceive the discriminator D, and the discriminator D discriminates the authenticity of the images, and through the process of constantly playing left and right, the performance of each is improved until the two networks reach a balanced state and stop training, at which time the noise image generated by the generator G tends to be the original noise, and the generator model G is saved, at which time the generated model is the noise generator M-G.
[0015] Further, the GAN model is:
[0016]
[0017] where x is the original image, z represents the noise added to the generator G, the result of G(z) is a new picture generated by the generator G network, D(x) represents the probability prediction result given by the discriminator D network to the new picture; P r and P r (z) represent the distribution of real data and the distribution of generated data, respectively; D(G(z)) is the probability of the discriminator D network judging whether the picture generated by the generator G is real.
[0018] Preferably, the noise simulation data generated by M-G is combined with the weld data, and the combined data is labeled for welds using the method in step 1, and after completion, the data is added to the label set S1 to expand it to a sample data set S2.
[0019] Preferably, in step 5, the data in the fusion data set S3 other than the training set is used as a validation set, and in step 6, after obtaining the weld target detection model, the weld target detection model is used to predict and verify the accuracy of the validation set, the parameters are adjusted, and step 6 is repeated until the generated weld target detection model meets the accuracy requirements.
[0020] Preferably, in step 1, the remaining weld picture is taken as the verification set T, in step 5, part of the data in the label set S1 is taken as the training set to perform step 6, and the contrast weld detection model is obtained. The contrast weld detection model and the weld target detection model are used to identify the data in the verification set T, and the improvement effect of the contrast identification accuracy is compared.
[0021] Further, after obtaining the contrast weld detection model by taking the remaining data in the label set S1 as the verification set, the contrast weld detection model is used to predict and verify the model accuracy of the verification set of the label set S1, the parameters are adjusted, and the generated contrast weld detection model meets the accuracy requirement.
[0022] A weld position detection system, comprising:
[0023] A label set construction module is used to collect existing different types of weld pictures, and part of the weld pictures is taken as a label set S1.
[0024] An M-G model construction module is used to collect existing noise in the welding process as a noise training set, train a GAN model, so that the model generates noise as an M-G model.
[0025] A sample data set construction module is used to combine the noise generated by the M-G model with the label set S1 to form a sample data set S2.
[0026] A data enhancement module is used to use data enhancement on the label set S1 and the sample data set S2, expand and generate the label set S1-A and the sample data set S2-A.
[0027] A fusion data set construction module is used to fuse the label set S1-A and the sample data set S2-A as a fusion data set S3, and part of the data in the fusion data set S3 is divided into a training set.
[0028] A target detection model construction module is used to train a YOLOv5 model using the training set to obtain a weld target detection model.
[0029] A weld position detection module is used to detect the position of the weld using the weld target detection model.
[0030] A computer device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the steps of the weld position detection method.
[0031] A computer readable storage medium, the computer readable storage medium stores a computer program, the computer program is executed by a processor to implement the steps of the weld position detection method.
[0032] Compared with the prior art, the present application has the following beneficial effects:
[0033] The present application firstly acquires an initial model trained by a training set of weld seams; by judging the shape of the weld seam, the initial noise and splashes are generated by using the GAN model to simulate the initial weld seam shape; and the number of the initial training set is increased; the image in the test set is fused with the initial data set in the improved YOLOv5 target detection model, which can greatly improve the accuracy and accuracy of weld seam recognition; by improving the quality of the data set, the quality and efficiency of intelligent welding are improved, a more complete and accurate database can be established, and a more solid foundation is laid for the existing intelligent welding technology to establish a more efficient and accurate mechanism; the GAN model is used to generate noise and splashes generated during welding, which can well expand the existing weld picture data and solve the problem of small data volume during welding, providing a new idea and approach for data source increase during welding; the data set generation algorithm solves the problem of huge resource consumption in traditional weld image collection; a new research method and idea are provided for the intelligent welding to adapt to the environment during model preparation, which greatly improves the generalization ability and recognition accuracy, improves the quality and efficiency of welding, has strong applicability and good popularization value. BRIEF DESCRIPTION OF DRAWINGS
[0034] Figure 1 A flowchart is established for the target detection model of the present application weld seam;
[0035] Figure 2 A schematic diagram of the training process of the present application is provided for the training process of the present application;
[0036] Figure 3 A schematic diagram of the training model of the present application is provided for the training network;
[0037] Figure 4 A schematic diagram of the construction process of the two weld seam recognition models of the present application is provided;
[0038] Figure 5 The weld seam image taken in the actual welding process;
[0039] Figure 6 The weld seam and background noise image taken in the actual welding process;
[0040] Figure 7 The simulated noise image generated by using the M-G model;
[0041] Figure 8 The number of weld seams identified by using the M1 model;
[0042] Figure 9 The number of weld seams identified by using the enhanced M3 model;
[0043] Figure 10The weld recognition accuracy identified using the M1 model;
[0044] Figure 11 The weld recognition accuracy identified using the enhanced M3 model. DETAILED DESCRIPTION
[0045] The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, rather than all the embodiments of the present application. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative work fall within the scope of protection of the present application.
[0046] It should be noted that the words "front", "back", "left", "right", "up" and "down" used in the following description refer to the directions in the drawings, and the words "in" and "out" refer to the directions towards or away from the geometric center of a particular component.
[0047] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which the present application belongs. The terminology used in the description of the present application herein only for the purpose of describing specific embodiments and is not intended to limit the present application. The term "and / or" as used herein includes any and all combinations of one or more of the associated listed items.
[0048] As shown in Figure 1 The weld position detection method described in the present application is to generate a data set to improve the recognition accuracy between different types of welds, including the following processes:
[0049] Step 1: Collect existing different types of weld pictures, as shown in Figure 5 The label set S1 corresponding to the training set and the final corresponding verification set T are made and trained, and the different labels of the ladder-shaped weld and the groove-shaped weld are marked on each picture for distinguishing different types of welds.
[0050] Step 2: Collect existing noise in the welding process as noise training set N, train GAN model until the model can generate usable noise as model M-G.
[0051] The process of training the model is as follows: the generator G first generates noise images as real as possible by learning the distribution of real noise images, which is enough to deceive the discriminator D; then, the discriminator D tries to distinguish the authenticity of the images generated by the generator G as much as possible; the generator G improves the authenticity of the generated images to deceive the discriminator D, and the discriminator D tries to distinguish the authenticity of the images, and through the process of continuous left-right game, the performance of each network is improved until the two networks reach a balanced state and stop training, at which time the noise image generated by the generator G is very close to the original noise, and the generator model G is saved, at which time the generated model is the noise generator M-G. The specific process is shown in Figure 2 The effect of generating noise is shown in Figure 6 .
[0052] The model of the generative adversarial network used in step 2 is:
[0053] The essence of GAN is a generative model, and the formula of GAN is as follows:
[0054]
[0055] Where x is the original image, z represents the noise added to the generator G, G(z) is the result of the new picture generated by the generator G network, D(·) represents the probability prediction result given by the discriminator D network to the new picture; Pr and Pz(z) represent the distribution of real data and the distribution of generated data respectively.
[0056] D(G(z)) is the probability of the discriminator D network judging whether the picture generated by the generator G is real or not, and the generator G hopes that the image it generates is more realistic, that is, the generator G hopes that D(G(z)) is as large as possible; while the discriminator D hopes to improve its discrimination ability, that is, the larger D(x) is, the smaller D(G(x)) should be; through continuous iterative learning, the Nash equilibrium state is finally realized to complete the training.
[0057] Step 3: Use the generator M-G to generate simulated noise on the existing and labeled weld data, and at the same time expand the data set and generate it as a sample data set S2.
[0058] Use the generator to generate noise simulation data and weld data combination and use the method in step 1 to label the synthesized data, and after completion, add the data to the label set S1 to expand it to a sample data set S2;
[0059] Step 4: Use rotation, cropping and other basic data augmentation on S1 to expand and generate it as a label set S1-A.
[0060] Step 5: Use rotation, cropping and other basic data augmentation on S2 to expand and generate it as a sample data set S2-A.
[0061] Step 6: Fuse the annotated and augmented S1-A and S2-A datasets as a fused dataset S3, and divide the datasets in S1 and S3 into training and validation sets: S1_train, S1_val, S3_train, and S3_val.
[0062] Step 7: As shown in Figure 4 , train the YOLOv5 model using the training dataset S1_train, adjust the YOLOv5 model parameters, and through multiple rounds of iterations, update the YOLOv5 model parameters each time, and calculate the loss value, until the loss value reaches the acceptable range, thereby obtaining the target detection model of the weld.
[0063] The main network structure of YOLOv5 is a convolutional neural network, and the process of extracting the features of the weld using the convolutional neural network is to establish a loss function between the extracted feature map and the predicted box and the real box, start training, and the training network structure is as shown in Figure 3 . Among them, the loss function of the detection network in the training process mainly includes three aspects: rectangular box loss, classification loss, and confidence loss.
[0064] yolov5 uses CIOU by default to calculate the rectangular box loss, which further considers the width-height ratio of the bounding box based on DIOU, making the predicted box more consistent with the real box, and to some extent, speeding up the regression convergence speed of the predicted box. The calculation formula of CIOU loss is:
[0065]
[0066] Among them
[0067] Among them, IoU is the intersection over union of the predicted box bounding box and the real box ground truth, d is the distance between the centers of the predicted box and the real box, and c is the diagonal length of the smallest box covering the two boxes. wgt and hgt are the width and height of the ground truth, and w and h are the width and height of the predicted bounding box, respectively.
[0068] The loss function is defined as follows:
[0069]
[0070] Among them, y is the label corresponding to the input sample, and p is the probability that the model predicts the input sample to be a real sample. As in the confidence loss calculation, the confidence of each predicted box represents its reliability, and the larger the value, the closer the predicted box is to the real box.
[0071] Step 8: Use the weld seam target detection model obtained in step 7 to predict and verify the model accuracy of the validation data set S1_val, adjust the parameters, repeat step 7 until the generated model meets the accuracy requirements, thereby obtaining the contrast weld seam detection model M1.
[0072] Here M1 using S1 as the training set is mainly for contrast, compared with S3 using GAN and simulation data, the effect of identification using M1 is as shown in Figure 7 and Figure 9 .
[0073] Step 9: Train the YOLOv5 model using the generated data set S3_train, adjust the YOLOv5 model parameters, update the YOLOv5 model parameters and calculate the loss value through multiple iterations, until the loss value reaches the acceptable range, thereby obtaining the weld seam target detection model.
[0074] Step 10: Use the weld seam target detection model obtained in step 9 to predict and verify the model accuracy of the validation data set S3_val, adjust the parameters, repeat step 9 until the generated model meets the accuracy requirements, thereby obtaining a high-precision weld seam target detection model M3.
[0075] Here S3 is the final weld seam detection model, the identification effect is as shown in Figure 8 and Figure 10 , compared with the identification effect precision of M1, there is about 40% improvement, and the number of identified weld seams is also greatly improved.
[0076] Step 11: Use weld seam detection models M1 and M3 to identify the validation set T labeled in step one respectively, and the comparison effect shows the improvement of the algorithm in identification accuracy.
[0077] Step 12: Use the weld seam target detection model M3 to detect the weld seam position.
[0078] From Figure 6 and Figure 7 , it can be seen that the noise generation model M-G used in this method has a good simulation effect on noise.
[0079] As can be seen from Figure 8 , without using this method, the model recognition rate is only about 40% in the prepared 100 test set data, while Figure 9 , after using this method, the model recognition rate in the test set is as high as 100%. It can be seen that this method can better improve the weld seam recognition rate during welding.
[0080] From Figure 10It can be seen that, in the prepared test weld picture, the mAP@.5 of the model recognition without using the method is 0.5, i.e. 50%, and the mAP@.5 of the model recognition in the test picture after using the method is 0.93, i.e. 93%. That is, the accuracy of recognition is improved by about 40%, so it can be seen that the method can better improve the recognition rate of the weld during welding. Figure 11 It can be seen that, in the prepared test weld picture, the mAP@.5 of the model recognition without using the method is 0.5, i.e. 50%, and the mAP@.5 of the model recognition in the test picture after using the method is 0.93, i.e. 93%. That is, the accuracy of recognition is improved by about 40%, so it can be seen that the method can better improve the recognition rate of the weld during welding.
[0081] Finally, the mAP@.5 of the model reaches 98.5% on the RTX A5000 GPU, and the mAP@.5 of the weld between different types also reaches 88.9%, and the Precision before and after using the enhancement is improved by up to 40%. The model accuracy is greatly improved, and the generalization ability of the model is also improved.
[0082] GAN: GAN (Generative Adversarial Networks) is a deep learning model, which is one of the most promising methods for unsupervised learning on complex distribution in recent years. The model learns through the mutual game of (at least) two modules in the framework: generative model (Generative Model) and discriminative model (Discriminative Model) to produce a very good output.
[0083] LabelImg: LabelImg is a graphical image annotation tool written in Python, which marks the object bounding box in the figure. In the present application, it is mainly used for image annotation when establishing a data set for training.
[0084] mAP@.5: mAP@.5 represents the average mAP value of each class when IoU is set to 0.5.
[0085] Precision: Precision represents accuracy, which refers to the probability of correct detection among all detected targets.
[0086] FCM clustering algorithm: FCM algorithm is a partition-based clustering algorithm, which aims to maximize the similarity between objects in the same cluster and minimize the similarity between different clusters. Fuzzy C-means algorithm is an improvement of ordinary C-means algorithm, and ordinary C-means algorithm is hard for data partition, while FCM is a flexible fuzzy partition.
[0087] The following is an apparatus embodiment of the present application, which can be used to execute the method embodiment of the present application. For details not disclosed in the apparatus embodiment, please refer to the method embodiment of the present application.
[0088] In another embodiment of the present application, a weld seam position detection system is provided, which can be used to implement the above weld seam position detection method. Specifically, the weld seam position detection system comprises a label set construction module, an M-G model construction module, a sample data set construction module, a data enhancement module, a fusion data set construction module, a target detection model construction module, and a weld seam position detection module.
[0089] The label set construction module is configured to collect existing weld seam pictures of different types, and use part of the weld seam pictures as a label set S1.
[0090] The M-G model construction module is configured to collect existing noise in the welding process as a noise training set, and train a GAN model, so that the model generates noise as an M-G model.
[0091] The sample data set construction module is configured to combine the noise generated by the M-G model with the label set S1 to form a sample data set S2.
[0092] The data enhancement module is configured to use data enhancement on the label set S1 and the sample data set S2, expand and generate the label set S1-A and the sample data set S2-A.
[0093] The fusion data set construction module is configured to fuse the label set S1-A and the sample data set S2-A as a fusion data set S3, and divide part of the data in the fusion data set S3 into a training set.
[0094] The target detection model construction module is configured to train a YOLOv5 model using the training set to obtain a target detection model of the weld seam.
[0095] The weld seam position detection module is configured to use the target detection model of the weld seam to detect the position of the weld seam.
[0096] In still another embodiment of the present application, a terminal device is provided, which comprises a processor and a memory, the memory being configured to store a computer program, the computer program comprising program instructions, and the processor being configured to execute the program instructions stored in the computer storage medium. The processor can be a central processing unit (CPU), and can also be other general-purpose processors, digital signal processors (DSP), application specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gates or transistor logic, discrete hardware components, etc., which are the computing core and control core of the terminal, and are suitable for implementing one or more instructions, and are specifically suitable for loading and executing one or more instructions to implement a corresponding method flow or a corresponding function; the processor of the embodiment of the present application can be used for the operation of the weld position detection method, comprising: step 1: collecting existing different types of weld pictures, and taking part of the weld pictures as a label set S1; step 2: collecting existing noise in the welding process and taking it as a noise training set, training a GAN model, so that the model generates noise as an M-G model; step 3: combining the noise generated by the M-G model with the label set S1 to form a sample data set S2; step 4: using data enhancement on the label set S1 and the sample data set S2, expanding and generating them as a label set S1-A and a sample data set S2-A; step 5: merging the label set S1-A and the sample data set S2-A as a merged data set S3, and dividing part of the data in the merged data set S3 into a training set; step 6: using the training set to train a YOLOv5 model to obtain a weld target detection model; and step 7: using the weld target detection model to detect the weld position.
[0097] In another embodiment, the present application also provides a computer readable storage medium (Memory), which is a memory device in a terminal device, used for storing programs and data. It can be understood that the computer readable storage medium herein can include a built-in storage medium in the terminal device, and of course can also include an expansion storage medium supported by the terminal device. The computer readable storage medium provides a storage space, which stores an operating system of the terminal. Moreover, one or more instructions suitable for being loaded and executed by the processor are also stored in the storage space, and the instructions can be one or more computer programs (including program codes). It should be noted that the computer readable storage medium herein can be a high-speed RAM memory, or a non-volatile memory such as at least one disk memory.
[0098] The one or more instructions stored in the computer readable storage medium can be loaded and executed by the processor to implement the corresponding steps of the weld position detection method in the above embodiments; the one or more instructions in the computer readable storage medium are loaded and executed by the processor to perform the following steps: step 1: collect existing different types of weld pictures, and use part of the weld pictures as a label set S1; step 2: collect existing noise in the welding process and use it as a noise training set, train a GAN model, so that the model generates noise as an M-G model; step 3: combine the noise generated by the M-G model with the label set S1 to form a sample data set S2; step 4: use data enhancement on the label set S1 and the sample data set S2, expand and generate them as a label set S1-A and a sample data set S2-A; step 5: fuse the label set S1-A and the sample data set S2-A as a fusion data set S3, and divide part of the data in the fusion data set S3 into a training set; step 6: use the training set to train a YOLOv5 model to obtain a weld target detection model; step 7: use the weld target detection model to detect the weld position.
[0099] Those skilled in the art should understand that the embodiments of the present application can be provided as a method, a system, or a computer program product. Therefore, the present application can take the form of an entirely hardware embodiment, an entirely software embodiment, or an embodiment combining software and hardware aspects. Moreover, the present application can take the form of a computer program product implemented on one or more computer usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer usable program code.
[0100] The computer program instructions can also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer-implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart block or blocks. Figure 1 one or more flow or blocks Figure 1 one or more flow or blocks
[0101] These computer program instructions can also be stored in a computer readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer readable memory produce an article of manufacture including instructions which implement the function specified in the flowchart block or blocks. Figure 1 one or more flow or blocks Figure 1 one or more flow or blocks
[0102] The computer program instructions can also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer-implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart block or blocks. Figure 1 one or more flow or blocks Figure 1 one or more flow or blocks
[0103] It should be noted that, in the present document, the terms such as first and second, etc., are used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any actual such relationship or order between such entities or operations. Also, the terms "comprises", "comprising", or any other variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but can also include other elements not expressly listed or inherent to such process, method, article, or apparatus.
[0104] It is to be understood that the above description is intended to be illustrative, and not restrictive. Many embodiments and applications other than the examples provided would be apparent to those of skill in the art upon reading the above description. The scope of the technology should be determined, not with reference to the above description, but should instead be determined with reference to the appended claims, along with the full scope of equivalents to which such claims are entitled. The disclosures of all articles and references, including patent applications and publications, are incorporated by reference for all purposes. The omission in the foregoing description of any aspect of the subject matter disclosed herein is not a disclaimer of such subject matter, nor should it be regarded that the applicant has disclaimed any such subject matter, nor should any such omission be regarded as affecting the scope of the claimed teaching.
Claims
1. A weld seam position detection method, characterized by, The method comprises the following steps: Step 1: Collect existing different types of weld pictures, and part of the weld pictures are taken as a label set S1; Step 2: Collect existing noise in the welding process as a noise training set, train a GAN model, so that the model generates noise as an M-G model; The process of training the GAN model is as follows: the GAN model comprises a generator G and a discriminator D; the generator G firstly makes the noise images generated by itself approach the real ones by learning the distribution of the real noise images, so as to deceive the discriminator D; then, the discriminator D discriminates the authenticity of the images generated by the generator G; The generator G improves the authenticity of the generated images to deceive the discriminator D, and the discriminator D discriminates the authenticity of the images, and the performance of the two networks is improved through the process of continuous left-right game until the two networks reach a balanced state and stop training, at which time the noise images generated by the generator G approach the original noise, and the generator model G is saved, and at this time, the generated model is the noise generator M-G; Step 3: Combine the noise generated by the M-G model with the label set S1 to form a sample data set S2; Step 4: Use data enhancement on the label set S1 and the sample data set S2, expand and generate the label set S1-A and the sample data set S2-A; Step 5: Fuse the label set S1-A and the sample data set S2-A as a fusion data set S3, and divide part of the data in the fusion data set S3 into a training set; Step 6: Train the YOLOv5 model using the training set to obtain a weld target detection model; Step 7: Detect the weld position by using the weld target detection model.
2. The weld joint position detection method according to claim 1, characterized by, The GAN model is as follows: where x is the original image, z represents the noise added to the generator G, and the result of G(z) is a new picture generated by the generator G network, represents the probability prediction result given by the discriminator D network for the new picture; and respectively represent the distribution of real data and the distribution of generated data; D(G(z)) is the probability that the discriminator D network judges whether the picture generated by the generator G is real.
3. The weld joint position detection method according to claim 1, characterized by, The specific process of step 3 is to combine the noise simulation data generated by the M-G and the weld data, and to label the combined data by the method in step 1, and after completion, the data is added to the label set S1 to expand into the sample data set S2.
4. The weld joint position detection method according to claim 1, characterized by, In step 5, the remaining data in the fusion data set S3 is taken as a verification set, in step 6, after the weld target detection model is obtained, the weld target detection model is used to predict and verify the model accuracy of the verification set of the fusion data set S3, the parameters are adjusted, and step 6 is repeated until the generated weld target detection model meets the accuracy requirement.
5. The weld seam position detection method according to claim 1, characterized in that, In step 1, the remaining weld pictures are taken as a verification set T, in step 5, part of the data in the label set S1 is taken as a training set to perform step 6, a comparative weld detection model is obtained, and the comparative weld detection model and the weld target detection model are used to identify the data in the verification set T, and the improvement effect of the identification accuracy is compared.
6. The weld seam position detection method according to claim 5, characterized in that After obtaining the comparative weld detection model by taking the remaining data in the label set S1 as a verification set, the comparative weld detection model is used to predict and verify the model accuracy of the verification set of the label set S1, the parameters are adjusted, and the comparative weld detection model is generated until the comparative weld detection model meets the accuracy requirement.
7. A weld seam position detection system, characterized in that It comprises: A label set construction module is used to collect existing different types of weld pictures, and part of the weld pictures are taken as a label set S1; An M-G model construction module is used to collect existing noise in the welding process as a noise training set, train a GAN model, so that the model generates noise as an M-G model; The process of training the GAN model is as follows: the GAN model comprises a generator G and a discriminator D; the generator G first generates noise images close to the real ones by learning the distribution of the real noise images, so as to deceive the discriminator D; then, the discriminator D discriminates the authenticity of the images generated by the generator G; The generator G improves the authenticity of the generated images to deceive the discriminator D, and the discriminator D discriminates the authenticity of the images, and through the process of continuous left-right game, the performance of each is improved until the two networks reach a balance state and stop training, at this time the noise image generated by the generator G tends to the original noise, and the generator model G is saved, at this time the generated model is the noise generator M-G; The sample data set construction module is used for combining the noise generated by the M-G model with the label set S1 into a sample data set S2; The data enhancement module is used for using data enhancement on the label set S1 and the sample data set S2, expanding and generating the label set S1-A and the sample data set S2-A; The fusion data set construction module is used for fusing the label set S1-A and the sample data set S2-A as a fusion data set S3, and dividing part of the data in the fusion data set S3 into a training set; The target detection model construction module is used for training the YOLOv5 model using the training set to obtain a target detection model of the weld; The weld position detection module is used for detecting the position of the weld by using the target detection model of the weld.
8. A computer device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, The processor executes the computer program to realize the steps of the weld position detection method according to any one of claims 1 to 6.
9. A computer-readable storage medium storing a computer program, the computer program comprising instructions that, when executed by a computer, cause the computer to perform the method of any one of claims 1 to 8. The computer program is executed by the processor to realize the steps of the weld position detection method according to any one of claims 1 to 6.
Citation Information
Patent Citations
Adversarial training for large scale healthcare data using machine learning system
AU2020102667A4
Image data enhancement network training method and device, medium and equipment
CN112164008A