Metal surface crack image confrontation generation method fused with physical modeling
Through the adversarial generation network method of fusion physical modeling, high-quality and diverse metal surface crack image data sets are generated, which solves the problem of small samples and low quality in the construction of crack detection data sets in the prior art, and realizes effective training of the detection model and image authenticity guarantee.
Patent Information
- Application Number
- CN202411766147.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-04
- Publication Date
- 2025-05-06
- Estimated Expiration
- 2044-12-04
AI Technical Summary
During the construction of existing crack detection data sets, there are problems such as small sample count, low quality and high manual manufacturing costs, which leads to unstable random image quality when the adversarial generation network is expanded in small samples, making it difficult to ensure the authenticity of the generated images.
Using an adversarial generation network method with fusion physics modeling, a metal surface crack image dataset is generated through the Dugdale-GAN model, and a high-quality and diverse crack image dataset is generated by combining the physical model and the adversarial generation network.
It realizes the generation of high-quality and diverse crack image data sets, improves the training data guarantee of the detection model, and ensures that the generated images have physical significance and high authenticity.
Smart Images

Figure CN119941883A_ABST
Abstract
Description
Technical Field
[0001] The invention belongs to the field of computer graphics, and in particular relates to a metal surface crack image adversarial generation method integrating physical modeling. Background Art
[0002] A crack refers to the macroscopic manifestation of elastic and plastic deformation of a material under external stress or other environmental conditions. In recent years, there has been great progress in the detection methods for cracks. In actual application scenarios, ultrasonic, eddy current, X-ray and vision-based detection methods are generally used. Among them, ultrasonic and eddy current detection methods are static detection methods, which require the object to be detected to be in a relatively static state and have poor real-time performance. X-ray detection uses the penetrating ability of rays to detect defects in objects, and its effect on area-type defect detection is not good.
[0003] Compared with acoustic and ray sensor methods, the detection method using vision has the advantages of being more intuitive and simple to operate. In recent years, with the rapid development of deep learning, crack detection algorithms have the advantages of fast detection speed and high detection accuracy, and have been widely used in automatic inspections of large industrial scenes such as ships, rails, and bridges. However, the process of constructing crack detection training data sets has always been plagued by problems such as small number of crack samples, low quality, and high cost of artificially created cracks. When using adversarial generative networks to expand small samples, the quality of the generated random images is difficult to guarantee, and sometimes cracks that are impossible to exist in reality will be generated. In severe cases, images with low quality will become adversarial samples. This poses a challenge to the subsequent detection model to identify cracks.
[0004] Many scholars have expanded and enhanced crack datasets by flipping, rotating, and adversarial generative networks. Although these methods have improved the quality of crack-generated images, they only expand crack datasets from a data perspective without considering the actual physical meaning of cracks hidden in the image, and the generated images cannot effectively reflect the physical parameter state of the cracks. Therefore, developing an adversarial network generation method that integrates physical modeling to generate crack image datasets has important research and application value. Summary of the invention
[0005] In order to overcome the defects of the above-mentioned background technology, the present invention provides a metal surface crack image adversarial generation method integrating physical modeling, which generates a large number of diverse and high-quality crack data sets by integrating physical modeling, thereby providing effective data guarantee for the training of crack detection models.
[0006] In order to solve the above technical problems, the technical solution adopted by the present invention is:
[0007] A metal surface crack image adversarial generation method integrating physical modeling, comprising:
[0008] S1, according to the metal material parameters, the current stress direction and magnitude are calculated using the crack region growth algorithm, and the crack shape of the next region is calculated according to the current crack width and stress magnitude and the parameters are updated;
[0009] S2, merging the constructed crack with the corresponding metal surface image;
[0010] S3, constructs the adversarial generative network model Dugdale-GAN that integrates the physical model;
[0011] S4, the indicator QDI for verifying the quality and diversity of the generated images is designed, the Dugdale-GAN model based on the physical model is trained, and the crack images generated by the Dugdale-GAN model are tested based on the diversity indicator QDI.
[0012] Preferably, the specific method of calculating the current stress direction and magnitude using a crack region growth algorithm according to metal material parameters, calculating the crack shape of the next region according to the current crack width and stress magnitude, and updating the parameters in S1 includes:
[0013] S11, by giving the Young's modulus parameter E of the given material, the randomly generated material stress σ and yield stress σ s , microcrack length a parameter, and use the Dugdale physical model to calculate the opening displacement δ(a) of the crack tip at the fracture point:
[0014]
[0015] The cross-sectional area A is then calculated based on the opening displacement δ(a) of the crack tip at the fracture point.
[0016]
[0017] Where δ(a) represents the opening displacement of the crack tip, E represents the Young's modulus of the material, and σ represents the stress on the material;
[0018] S12, the crack growth algorithm is designed to start from the initial crack point, and the crack growth is gradually iterated according to the opening displacement and crack area of the crack tip at the fracture point. Get a complete crack image;
[0019] Extract the crack pattern D from the original data set, randomly intercept a part of it as the crack growth base D1, and then randomly select area D2 as the crack growth area, which is divided into two types for generation. Determine whether D1 exceeds 1 / 4 of the image. If so, randomly intercept D2 in the spatial domain of D1 as the crack growth base space. If not, use all of D1 as the growth base space.
[0020] The cracks growing in the expansion area are calculated by setting parameters such as Young's modulus. Starting from the edge of the D2 area, the growth step is set, and each time the cracks are expanded outward by step pixels until D2 = D1 and the crack image is output.
[0021] S13, after the image generation is completed, it is sent to S2 for fusion with the background image, and new stress parameters are randomly generated again, and then the new stress parameters are re-generated according to the formula and The crack image is generated by calculation.
[0022] Preferably, the specific method of S2 for fusing the constructed crack with the corresponding metal surface image includes:
[0023] A fusion matrix is set up to fuse the crack pattern with the metal image background image. The image fusion weight a is selected in the range of (0, 1) and is implemented by the following formula:
[0024] C=aCr+(1-a)B
[0025] Among them, C represents the fused image vector, Cr represents the crack vector, B represents the metal material image vector, and a represents the weight of the fused image.
[0026] Preferably, the method of constructing the adversarial generative network model Dugdale-GAN for fusion physical model in S3 includes:
[0027] S31, the Dugdale-GAN architecture includes a generator 1 and a generator 2, and also includes a discriminator 1 and a discriminator 2, the generator 1 is used to generate a new image by inputting Gaussian noise, the generator 2 is used to generate a new image by inputting generated physical cracks and mixed Gaussian noise, the discriminator 1 is used to judge the quality of the image generated by the generator 1, and the texture discriminator 2 is used to control the consistency of the generated crack texture with the original crack;
[0028] S32, the generator 1 module is used to learn and obtain the distribution of images, including background images and crack textures. The specific implementation process of its loss function is as follows:
[0029]
[0030] Among them, N represents the number of samples in the data set, represents i real images, generator 1 minimizes the function, minimizes the pixel-level difference between the generated image and the real image, and the combination of adversarial loss and pixel space loss generates the loss function of the generator. The specific implementation process is as follows:
[0031] L G =Dmax(V(D,G))+λL pix
[0032] Where λ is a hyperparameter that balances the contribution of adversarial loss and pixel-space loss.
[0033] S33, the input of generator 2 is a mixed vector of random Gaussian noise and labels, and a crack image generated using a physical model. Generator 2 makes the texture of the physical crack as close to the real image as possible. The physical simulation of the crack parameters is added as a label to specify the generation domain of generator 2, and a small perturbation is made to the simulated physical crack so that its texture distribution is the same as that of the real-world crack.
[0034] Under the guidance of texture discriminator 2, the crack texture styles synthesized by generator 1 and generator 2 are consistent, while retaining the generated physical crack image style in the distribution;
[0035] Generator 2 consists of an input layer, a conversion convolution layer, and a batch normalization layer. LeakyRELU activation function is used for extraction. The loss function of generator 2 is implemented as follows:
[0036] L G2 =Dmax(V(D,G(z,p)))+λL pix
[0037] Among them, G(z,p) is the Gaussian distribution of generator 2 after a slight perturbation on the basis of generator 1,
[0038] S34, discriminator 1 controls the distribution of images generated by generator 1. When the images generated by generator 1 cannot be distinguished, the existing parameters of discriminator 1 will be updated and iteratively learned, so that generator 1 and discriminator 1 converge through continuous confrontation. The discriminator 1 module includes convolutional layers and pooling layers, which perform feature extraction and downsampling operations on the input image, and use a fully connected layer to convert the feature map into a scalar output. The scalar output represents the probability that the input image is a real image. The loss function of discriminator 1 uses cross entropy. The specific implementation process is as follows:
[0039] L D = -[logD(x)+log(1-D(G(z)))]
[0040] Where log D(x) is the log likelihood of the real image, and log(1-D(G(z))) is the log likelihood of the generated image. The discriminator 1 minimizes the loss function to maximize the log likelihood of the real image and minimize the log likelihood of the generated image.
[0041] S35, discriminator 2 is implemented by the following loss function formula,
[0042] L D2 =[log D(G(z)-G(z,p))]+||Rz -R p ||
[0043] Among them, R z represents the real image distribution, R p Represents the image distribution after inputting cracks.
[0044] Preferably, in S4, the index QDI for verifying the quality and diversity of the generated image is designed, the Dugdale-GAN model based on the physical model is trained, and the method for testing the crack image generated by the Dugdale-GAN model based on the diversity index QDI includes:
[0045] S41, training and testing the model based on the crack data set, and evaluating the model test results using an evaluation index, wherein the evaluation index is implemented by the following formula:
[0046] FID is achieved by the following formula
[0047]
[0048] QDI is achieved by the following formula
[0049]
[0050] Among them, μ t is the average value of the real image set output by the InceptionNetv3 model to the 2048-dimensional feature vector set, ∑ t is the covariance matrix, μ g is the generated image set output by the InceptionNetv3 model to the 2048-dimensional feature vector set, ∑ g is the covariance matrix of , Tr represents the trace of the matrix;
[0051] t and g represent the real image and the generated image respectively, z represents the added noise perturbation, μ t ,μ g ,μ z They represent the real image, generated image and real image after adding noise disturbance, θ is the penalty coefficient, ∑ t ,∑ g Represent the covariance matrix of the real image and the generated image feature vector, respectively, ||μ t -μ g ||2 represents μ t and μ g The 2-norm distance between them, Tr(·) represents the trace of the matrix;
[0052] S42, the experimental batch size is 32, the Gaussian noise perturbation parameter of generator 2 is 0.05, the number of training iterations is 10000 times, and the learning rate is 0.0001.
[0053] The beneficial effects of the present invention are: a complete set of crack image generation algorithms integrating physical modeling is designed. The present invention forms a complete process including crack generation, image fusion, model construction, indicator construction, model training and model testing;
[0054] The training and generation of crack images with physical and data fusion of crack images are realized. The present invention improves the physical characteristics of crack images through physical modeling and physical labeling methods, which not only improves the quality of generated images, but also can obtain more diverse crack image data sets;
[0055] The present invention selects dual generators and dual discriminators as the basic model framework to solve the problem of single generator training not converging and poor effect. In order to improve the quality of the generated image of the model, the noise vector z input by the converged G1 generator is used in generator 2 and perturbed within a small range, so that the G2 generator will converge faster and can learn the texture details of the original image well. Compared with the traditional generative model, the images generated by this model have higher quality and diversity;
[0056] The FID indicator for evaluating generated images has the characteristic of needing to make a trade-off between the quality and diversity of generated images. The QDI we designed can better evaluate the diversity characteristics of generated images without the need to make a trade-off between quality and diversity, thus making up for the shortcomings of FID. Therefore, using the FID indicator for evaluating the Dugdale-GAN model greatly improves the quality and diversity of images generated by the model. BRIEF DESCRIPTION OF THE DRAWINGS
[0057] Figure 1 It is a schematic diagram of the overall implementation process of the method of the present invention, wherein S1 is a schematic diagram of the crack generation process using the Dugdale model, S2 is a schematic diagram of the image fusion process, S3 is a schematic diagram of the Dugdale-GAN model structure, and S4 is a schematic diagram of the diversity index QDI and the Dugdale-GAN model test. DETAILED DESCRIPTION
[0058] The present invention will be further described below in conjunction with the accompanying drawings and embodiments.
[0059] This embodiment is a metal surface crack image adversarial generation method that integrates physical modeling. Model testing is completed based on the newly proposed diversity index. The implementation process includes crack generation, model construction, diversity index construction, model training and model testing. The method includes the following: S1 generates cracks using the Dugdale elastic fracture mechanics physical model based on physical parameters such as Poisson's ratio and Young's modulus of metal materials; S2 image fusion, fusing the constructed cracks with the metal surface image; S3 constructs an adversarial generative network model (Dugdale-GAN) that integrates the physical model; S4 designs an index (Diversity Reference system, QDI) to verify the quality and diversity of the generated image; and trains and tests the Dugdale-GAN model based on the physical model.
[0060] Specifically, the metal surface crack image adversarial generation method integrating physical modeling in this embodiment includes the following steps:
[0061] In S1, the Dugdale physical model is used to generate cracks. Figure 1 As shown in S1 in , the specific input features include inputting parameters such as the material of the metal material, Young's modulus, Poisson's ratio, stress magnitude, etc., calculating the current stress direction and magnitude according to the crack area growth algorithm, and then calculating the crack shape of the next area according to the current crack width and stress magnitude and updating the parameters.
[0062] Based on the Poisson's ratio, Young's modulus and Dugdale model of the acquired materials (taking steel and zinc-aluminum alloy as examples), the physical modeling of the crack generation mode is carried out. Starting from the initial state, the crack width, stress magnitude and direction of the current state are calculated, the crack image is drawn and the parameters are updated, and finally the crack image is output.
[0063] The crack growth algorithm is implemented as follows:
[0064] S11: By giving the Young's modulus parameter E of the given material, the stress σ and yield stress σ of the randomly generated material s , microcrack length a and other related parameters, the Dugdale physical model is used to calculate the opening displacement δ(a) of the crack tip at the fracture point, as shown in formula (1):
[0065]
[0066] The cross-sectional area A is then calculated based on the opening displacement δ(a) of the crack tip at the fracture point, as shown in formula (2).
[0067]
[0068] In the formula, δ(a) represents the opening displacement of the crack tip, E represents the Young's modulus of the material, and σ represents the stress on the material.
[0069] S12: Design a crack growth algorithm starting from the initial crack point, and gradually iterate the crack growth according to the opening displacement of the crack tip at the fracture point and the crack area, and finally obtain a complete crack image.
[0070] The crack pattern D is extracted from the original data set, and a part of it is randomly intercepted as the crack growth base D1. Then, the area D2 is randomly selected as the crack growth area, which is generated in two types. When D1 exceeds 1 / 4 of the image, D2 is randomly intercepted in the spatial domain of D1 as the crack growth base space, otherwise the entire D1 is used as the growth base space.
[0071] The crack growth in the expansion area is calculated by setting parameters such as Young's modulus. Starting from the edge of the D2 area, the growth step is set, and the image is expanded outward by step pixels each time until D2 = D1 and the crack image is output.
[0072] S13: After the image generation is completed, it is sent to S2 for fusion with the background image. At the same time, new stress parameters are randomly generated again, and a new crack image is calculated again according to formulas (1) and (2).
[0073] In S2, image fusion is performed based on the crack image extracted in S1, and an image fusion module is constructed based on a fusion matrix. This module converts the background image input features of the material into metal image features with cracks. An image fusion module is designed in S2, which fuses the crack image into the metal surface image as the background based on a weight matrix. The image fusion module is implemented as follows Figure 1 As shown in S2 in the figure, the implementation is as follows:
[0074] S21: Establish a fusion matrix to fuse the crack pattern with the metal image background image. The weight α of image fusion is selected in the range of (0, 1). The specific implementation process is shown in formula (3):
[0075] C=aCr+(1-a)B (3)
[0076] Where C represents the fused image vector, Cr represents the crack vector, B represents the metal material image vector, and α represents the weight of the fused image.
[0077] The Dugdale-GAN model in S3 includes two generators and two discriminator modules. This model can effectively improve the diversity and quality of generated images and simulate more realistic crack textures. The adversarial generative network model (Dugdale-GAN) that integrates the physical model in S3 is shown in Figure 2. Figure 1As shown in S3, the specific implementation is as follows:
[0078] S31: The generator part of the Dugdale-GAN model is designed and the Gaussian noise vector of generator 1 is referenced in generator 2 to make the model converge faster; the Dugdale-GAN architecture contains two generators 1 and 2, and two discriminators 1 and 2. Generator 1 generates new images by inputting Gaussian noise, while generator 2 generates new images by inputting generated physical cracks and mixed Gaussian noise. Discriminator 1 determines the quality of the image generated by generator 1, and texture discriminator 2 is used to control the consistency of the generated crack texture with the original crack.
[0079] S32: In order to make the texture of the crack fusion image more similar to the real image, an additional texture discriminator module is designed to allow generator 2 to better learn the simulated texture distribution of generator 1. In this way, while ensuring the image generation quality of the G2 generator, more attention will be paid to the texture similarity of the crack, thereby obtaining a variety of crack images with real physical meaning.
[0080] Generator 1 module is implemented. The purpose of Generator 1 is to learn and obtain a distribution that is as similar to the real image as possible, including background image and crack texture. The specific implementation process of its loss function is shown in formula (4):
[0081]
[0082] In the formula, N represents the number of samples in the dataset, represents i real images, and represents the noise vector used to generate the real image. The purpose of the generator is to minimize this function so that the pixel-level difference between the generated image and the real image is minimized. The combination of adversarial loss and pixel space loss generates the loss function of the generator. The specific implementation process is shown in formula (5):
[0083] L G =Dmax(V(D,G))+λL pix (5)
[0084] Where λ is a hyperparameter that balances the contribution of adversarial loss and pixel-space loss.
[0085] S33: Generator 2 module implementation. The difference between Generator 2 and Generator 1 is that its input is a mixed vector of random Gaussian noise and labels, as well as a crack image generated using a physical model. Generator 2 aims to make the texture of the physical crack as similar to the real image as possible. By adding physical simulation of crack parameters in the generator, such as Young's modulus and strain of the material, as labels to specify the generation domain of Generator 2, and making small perturbations to the simulated physical cracks, its texture distribution is the same as that of real-world cracks.
[0086] Under the guidance of texture discriminator 2, the crack texture styles synthesized by generator 1 and generator 2 are consistent, while retaining the generated physical crack image style in the distribution. The structure of generator 2 includes an input layer, a conversion convolution layer and a batch normalization layer, which is also extracted using the leakyRELU activation function. The specific implementation process of the loss function of generator 2 is shown in formula (6):
[0087] L G2 =Dmax(V(D,G(z,p)))+λL pix (6)
[0088] Where G(z,p) is the Gaussian distribution of the generator 2 module after a slight perturbation on the basis of the generator 1 module.
[0089] S34: Implementation of the Discriminator 1 module. The Dugdale GAN model includes two discriminators, Discriminator 1 and Discriminator 2. Discriminator 1 controls the distribution of images generated by Generator 1 to be as close to the distribution of real images as possible. When the images generated by Generator 1 are indistinguishable, the existing parameters of Discriminator 1 will be updated and learned iteratively so that Generator 1 and Discriminator 1 can converge through continuous adversarial learning. The Discriminator 1 module consists of convolutional layers and pooling layers, which perform feature extraction and downsampling operations on the input image. The batch normalization layer is also used to alleviate the problem of internal variable shift and improve the stability and convergence speed of training. Finally, a fully connected layer is used to convert the feature map into a scalar output, which represents the probability that the input image is a real image. The loss function of Discriminator 1 uses cross entropy, and the specific implementation process is shown in formula (7):
[0090] L D =-[log D(x)+log(1-D(G(z)))] (7)
[0091] Where log D(x) is the log likelihood of the real image and log(1-G(x)) is the log likelihood of the generated image. The goal of discriminator 1 is to minimize the loss function so that the log likelihood of the real image is maximized and the log likelihood of the generated image is minimized.
[0092] S35: Implementation of the Discriminator 2 module. The difference between Discriminator 2 and Discriminator 1 is that it is designed to help Generator 2 better learn the simulated texture distribution of Generator 1. If Generator 1 is left aside and Generator 2 is allowed to directly learn the real image distribution, we find that Generator 2 will not converge quickly. However, if Generator 2 uses the Gaussian vector z input by the converged Generator 1 and perturbs it in a small range, Generator 2 converges faster and can learn the texture details of the original image well. Discriminator 2 must ensure the quality of the image generated by Generator 2, while paying more attention to the similarity of the crack texture, so as to obtain physically realistic and diverse crack images. The specific implementation process of the loss function of Discriminator 2 is shown in formula (8):
[0093] L D2 =[log D(G(z)-G(z,p))]+||R z -R p || (8)
[0094] In the formula, R z represents the real image distribution, R p Represents the image distribution after inputting cracks.
[0095] The diversity index (QDI) in S4 evaluates the image by adding penalty function coefficients and 2-norm distance. This index can effectively evaluate the diversity and quality of generated images. Figure 1 As shown in S4 in the figure, the specific implementation is as follows:
[0096] S41: In S4, the model is trained and tested based on the crack dataset, and the model test results are evaluated using evaluation indicators, such as Figure 1 S4. The specific implementation of the evaluation indicators is as follows, FID is shown in formula (9), and QDI is shown in formula (10):
[0097]
[0098] In the formula, μ t is the average value of the real image set output by the “InceptionNetv3” model to the 2048-dimensional feature vector set, ∑ t is the covariance matrix, μ g It is the generated image set output by the "Inception Netv3" model to the 2048-dimensional feature vector set. ∑ g is the covariance matrix of , and Tr represents the trace of the matrix.
[0099]
[0100] Where t and g represent the real image and the generated image respectively. z represents the added noise perturbation, μ t ,μ g ,μ z Respectively represent the real image, generated image and real image after adding noise perturbation. θ is the penalty coefficient, ∑ t ,∑ g Represent the covariance matrix of the real image and the generated image feature vector, respectively, ||μ t -μ g ||2 represents μ t and μ g , Tr(·) represents the trace of the matrix.
[0101] The QDI indicator is mainly used to evaluate the diversity of generated images. If the quality and diversity of the original image are good, the input to the generative adversarial network model is more effective, and the new image generated by the model can be consistent with the original image in terms of quality and diversity; then, the value of the penalty coefficient θ will be very small. If the quality of the generated new image can be consistent with the original image, but the diversity of the original image itself is relatively poor, the value of the penalty coefficient θ will increase significantly. If there is a large difference in the quality of the feature distribution between the generated new image and the original image, the value of the penalty coefficient θ will increase further.
[0102] S42: The experimental batch size is 32, the Gaussian noise perturbation parameter of generator 2 is 0.05, the number of training iterations is 10,000, and the learning rate is 0.0001. In the early stages of training, the quality of the images generated by generator 1 may not meet the input requirements of generator 2, resulting in higher loss values. However, as the training progresses and the generators are iterated, both generators can effectively converge and generate high-quality images. The evaluation results of the model prediction results are shown in Table 1. The evaluation indicator described in S42 is the diversity indicator QDI, which comprehensively evaluates the model prediction effect from the quality and diversity of the image. The smaller the value, the higher the quality and diversity of the image.
[0103] Table 1
[0104]
[0105] Finally, it should be noted that the above embodiments are only used to illustrate the technical solution of the present invention rather than to limit it. Although the present invention has been described in detail with reference to the preferred embodiments, those skilled in the art should understand that the technical solution of the present invention can be modified or replaced by equivalents without departing from the purpose and scope of the technical solution, which should be included in the scope of the claims of the present invention.
Claims
1. A metal surface crack image adversarial generation method integrating physical modeling, characterized in that: include: S1, according to the metal material parameters, the current stress direction and magnitude are calculated using the crack region growth algorithm, and the crack shape of the next region is calculated according to the current crack width and stress magnitude and the parameters are updated; S2, merging the constructed crack with the corresponding metal surface image; S3, constructs the adversarial generative network model Dugdale-GAN that integrates the physical model; S4, the indicator QDI for verifying the quality and diversity of the generated images is designed, the Dugdale-GAN model based on the physical model is trained, and the crack images generated by the Dugdale-GAN model are tested based on the diversity indicator QDI.
2. According to the method for adversarial generation of metal surface crack images integrating physical modeling according to claim 1, it is characterized in that: The specific method of S1, calculating the current stress direction and magnitude using a crack region growth algorithm according to metal material parameters, calculating the crack shape of the next region according to the current crack width and stress magnitude, and updating the parameters includes: S11, by giving the Young's modulus parameter E of the given material, the randomly generated material stress σ and yield stress σ s , microcrack length a parameter, and use the Dugdale physical model to calculate the opening displacement δ(α) of the crack tip at the fracture point: The cross-sectional area A is then calculated based on the opening displacement δ(α) of the crack tip at the fracture point. Where δ(α) represents the opening displacement of the crack tip, E represents the Young's modulus of the material, and σ represents the stress on the material; S12, the crack growth algorithm is designed to start from the initial crack point, and the crack growth is gradually iterated according to the opening displacement and crack area of the crack tip at the fracture point. Get a complete crack image; Extract the crack pattern D from the original data set, randomly intercept a part of it as the crack growth base D1, and then randomly select area D2 as the crack growth area, which is divided into two types for generation. Determine whether D1 exceeds 1 / 4 of the image. If so, randomly intercept D2 in the spatial domain of D1 as the crack growth base space. If not, use all of D1 as the growth base space. The cracks growing in the expansion area are calculated by setting parameters such as Young's modulus. Starting from the edge of the D2 area, the growth step is set, and each time the cracks are expanded outward by step pixels until D2 = D1 and the crack image is output. S13, after the image generation is completed, it is sent to S2 for fusion with the background image, and new stress parameters are randomly generated again, and then the new stress parameters are re-generated according to the formula and The crack image is generated by calculation.
3. The method for generating metal surface crack images by integrating physical modeling according to claim 1, characterized in that: The specific method of S2 fusing the constructed crack with the corresponding metal surface image includes: A fusion matrix is set up to fuse the crack pattern with the metal image background image. The image fusion weight α is selected in the range of (0, 1) and is implemented by the following formula: C=αCr+(1-α) Among them, C represents the fused image vector, Cr represents the crack vector, B represents the metal material image vector, and α represents the weight of the fused image.
4. The method for generating metal surface crack images by integrating physical modeling according to claim 1, characterized in that: S3, a method for constructing a generative adversarial network model Dugdale-GAN that integrates a physical model includes: S31, the Dugdale-GAN architecture includes a generator 1 and a generator 2, and also includes a discriminator 1 and a discriminator 2, the generator 1 is used to generate a new image by inputting Gaussian noise, the generator 2 is used to generate a new image by inputting generated physical cracks and mixed Gaussian noise, the discriminator 1 is used to judge the quality of the image generated by the generator 1, and the texture discriminator 2 is used to control the consistency of the generated crack texture with the original crack; S32, the generator 1 module is used to learn and obtain the distribution of images, including background images and crack textures. The specific implementation process of its loss function is as follows: Among them, N represents the number of samples in the data set, represents i real images, generator 1 minimizes the function, minimizes the pixel-level difference between the generated image and the real image, and the combination of adversarial loss and pixel space loss generates the loss function of the generator. The specific implementation process is as follows: L G =Dmax(V(D,G))+λL pix Where λ is a hyperparameter that balances the contribution of adversarial loss and pixel-space loss. S33, the input of generator 2 is a mixed vector of random Gaussian noise and labels, and a crack image generated using a physical model. Generator 2 makes the texture of the physical crack as close to the real image as possible. The physical simulation of the crack parameters is added as a label to specify the generation domain of generator 2, and a small perturbation is made to the simulated physical crack so that its texture distribution is the same as that of the real-world crack. Under the guidance of texture discriminator 2, the crack texture styles synthesized by generator 1 and generator 2 are consistent, while retaining the generated physical crack image style in the distribution; Generator 2 consists of an input layer, a conversion convolution layer, and a batch normalization layer. LeakyRELU activation function is used for extraction. The loss function of generator 2 is implemented as follows: L G2 =Dmax(V(D,G(z,p)))+λL pix Among them, G(z,p) is the Gaussian distribution of generator 2 after a slight perturbation on the basis of generator 1, S34, discriminator 1 controls the distribution of images generated by generator 1. When the images generated by generator 1 cannot be distinguished, the existing parameters of discriminator 1 will be updated and iteratively learned, so that generator 1 and discriminator 1 converge through continuous confrontation. The discriminator 1 module includes convolutional layers and pooling layers, which perform feature extraction and downsampling operations on the input image, and use a fully connected layer to convert the feature map into a scalar output. The scalar output represents the probability that the input image is a real image. The loss function of discriminator 1 uses cross entropy. The specific implementation process is as follows: L D =-[log D(x)+log(1-D(G(z)))] Where logD(x) is the log likelihood of the real image, and log(1-D(G(z))) is the log likelihood of the generated image. The discriminator 1 minimizes the loss function to maximize the log likelihood of the real image and minimize the log likelihood of the generated image. S35, discriminator 2 is implemented by the following loss function formula, L D2 =-[logD(G(z)-G(z,p))]+||R z -R p || Among them, R z represents the real image distribution, R p Represents the image distribution after inputting cracks.
5. The method for adversarial generation of metal surface crack images integrating physical modeling according to claim 1, characterized in that: S4, designing an index QDI for verifying the quality and diversity of generated images, training a Dugdale-GAN model based on a physical model, and testing a crack image generated by the Dugdale-GAN model based on the diversity index QDI, including: S41, training and testing the model based on the crack data set, and evaluating the model test results using an evaluation index, wherein the evaluation index is implemented by the following formula: FID is achieved by the following formula QDI is achieved by the following formula Among them, μ t is the average value of the real image set output by the Inception Netv3 model to the 2048-dimensional feature vector set, ∑ t is the covariance matrix, μ g is the generated image set output by the Inception Netv3 model to the 2048-dimensional feature vector set, ∑ g is the covariance matrix of , Tr represents the trace of the matrix; t and g represent the real image and the generated image respectively, z represents the added noise perturbation, μ t ,μ g ,μ z They represent the real image, generated image and real image after adding noise disturbance, θ is the penalty coefficient, ∑ t ,∑ g Represent the covariance matrix of the real image and the generated image feature vector, respectively, ||μ t -μ g ||2 represents μ t and μ g The 2-norm distance between them, Tr(·) represents the trace of the matrix; S42, the experimental batch size is 32, the Gaussian noise perturbation parameter of generator 2 is 0.05, the number of training iterations is 10000 times, and the learning rate is 0.0001.
Citation Information
Patent Citations
UDWGAN++network-based airport crack image adversarial generation method
CN114049538A
Structural surface crack detection method under small sample based on generative adversarial network
CN114118362A
Metal solidification structure crack defect identification method based on position information characteristics
CN114862757A
Metal surface defect detection method based on improved Faster RCNN algorithm
CN114897802A
Crack image data generation method and system based on conditional generative adversarial network
CN116934581A