An adversarial generative method for metal surface crack images integrating physical modeling
By integrating physical modeling and generative adversarial networks, a high-quality and diverse crack image dataset is generated, which solves the problem of insufficient crack detection datasets in existing technologies and improves the training effect and image quality of the detection model.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-04
- Publication Date
- 2026-04-03
AI Technical Summary
Existing crack detection datasets suffer from problems such as insufficient sample size, low quality, and high cost of manual production. This makes it difficult to guarantee the quality of crack images generated by generative adversarial networks, and the generated images cannot reflect the actual physical meaning, affecting the recognition performance of subsequent detection models.
A fusion physical modeling approach is adopted to generate crack images through the Dugdale-GAN network. By combining crack region growth algorithm and image fusion technology, a high-quality and diverse crack dataset is generated. The quality and diversity of the generated images are evaluated using a dual generator and dual discriminator architecture and the QDI diversity index.
It achieves high-quality and diverse crack image generation, improves the training data guarantee for the detection model, and the generated images have higher physical feature consistency and detection accuracy.
Smart Images

Figure CN119941883B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of computer graphics, specifically relating to an adversarial generation method for metal surface crack images that integrates physical modeling. Background Technology
[0002] A crack is a macroscopic manifestation of elastic and plastic deformation in a material under external stress or other environmental conditions. In recent years, methods for crack detection have made significant progress. In practical applications, methods such as ultrasonic testing, eddy current testing, X-ray testing, and vision-based methods are generally employed. Among these, ultrasonic and eddy current testing methods are static methods, requiring the object being tested to be in a relatively static state, resulting in poor real-time performance. X-ray testing utilizes the penetrating power of rays to detect defects in objects, but its effectiveness in detecting area-type defects is poor.
[0003] Compared to acoustic and X-ray sensor methods, visual detection methods are more intuitive and simpler to operate. In recent years, with the rapid development of deep learning, crack detection algorithms have become increasingly faster and more accurate, leading to their widespread application in automated inspections of large industrial sites such as ships, railways, and bridges. However, the construction of crack detection training datasets has consistently faced challenges, including a limited number of crack samples, low quality, and the high cost of artificially creating cracks. When using adversarial generative networks to augment small samples, the quality of the generated random images is difficult to guarantee, sometimes resulting in cracks that are impossible in reality. In severe cases, low-quality images can even become adversarial examples. This poses a challenge to subsequent crack detection models.
[0004] Many scholars have used flipping, rotation, and adversarial generative networks to augment and enhance crack datasets. While these methods improve the quality of generated crack images, they only augment the crack dataset from a data perspective without considering the actual physical meaning hidden within the cracks in the images. Therefore, the generated images cannot effectively reflect the physical parameters of the cracks. Thus, developing an adversarial generative method that integrates physical modeling to generate crack image datasets has significant research and application value. Summary of the Invention:
[0005] To overcome the shortcomings of the aforementioned background technology, this invention provides an adversarial generation method for metal surface crack images that integrates physical modeling. By integrating physical modeling, a large number of diverse and high-quality crack datasets are generated, thereby providing effective data support for the training of crack detection models.
[0006] To solve the above-mentioned technical problems, the technical solution adopted by the present invention is as follows:
[0007] An adversarial generation method for metal surface crack images that integrates physical modeling includes:
[0008] S1, based on the metal material parameters, use the crack region growth algorithm to calculate the current stress direction and magnitude, calculate the crack shape of the next region based on the current crack width and stress magnitude, and update the parameters;
[0009] S2, fuses the constructed crack with the corresponding metal surface image;
[0010] S3, Construct Dugdale-GAN, an adversarial generative network model that integrates physical models;
[0011] S4. Design a quality and diversity index (QDI) for the generated images. Train the Dugdale-GAN model based on the physical model and test the crack images generated by the Dugdale-GAN model based on the diversity index QDI.
[0012] Preferably, the specific method for S1, which calculates the current stress direction and magnitude using a crack region growth algorithm based on the metal material parameters, and calculates the crack shape of the next region and updates the parameters based on the current crack width and stress magnitude, includes:
[0013] S11, given the Young's modulus parameter E of the material, and the randomly generated stress σ and yield stress σ of the material. s The microcrack length parameter 'a' is used to calculate the crack tip opening displacement δ(a) at the fracture point using the Dugdale physical model:
[0014]
[0015] The cross-sectional area A is then calculated based on the crack tip opening displacement δ(a) 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 iteratively grow the crack based on the crack tip displacement and crack area at the fracture point, using the formula... Obtain a complete crack image;
[0019] Extract the crack pattern D from the original dataset, randomly select a portion of it as the crack growth base D1, and then randomly select region D2 as the crack growth region. The crack growth region is generated in two ways. Determine whether D1 exceeds 1 / 4 of the image. If so, randomly select 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 crack growth in the extended region is calculated by setting parameters such as Young's modulus. Starting from the edge of region D2, the growth step size step is set, and the crack expands outward in steps of pixels each time until D2 = D1 and the crack image is output.
[0021] S13, after the image generation is complete, is sent to S2 to be fused with the background image. At the same time, new stress parameters are randomly generated again, and the process is repeated according to the formula. and Calculate and generate crack images.
[0022] Preferably, the specific method for fusing the constructed crack with the corresponding metal surface image in step S2 includes:
[0023] A fusion matrix is established to fuse the crack pattern with the metal image background. The weight 'a' for image fusion is selected within the range of (0, 1), and is achieved using the following formula:
[0024] C=aCr+(1-a)B
[0025] Where 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, in step S3, the method for constructing the Dugdale-GAN adversarial generative network model that integrates the physical model includes:
[0027] S31, the Dugdale-GAN architecture includes generator 1 and generator 2, and also includes discriminator 1 and discriminator 2. Generator 1 is used to generate a new image by inputting Gaussian noise, generator 2 is used to generate a new image by inputting generated physical cracks and mixed Gaussian noise, discriminator 1 is used to determine the quality of the image generated by generator 1, and texture discriminator 2 is used to control the consistency between the generated crack texture and the original crack.
[0028] S32, Generator 1 module is used to learn and acquire the distribution of the image, including the background image and crack texture. Its loss function is specifically implemented as follows:
[0029]
[0030] Where N represents the number of samples in the dataset, and i represents the number of real images. Generator 1 minimizes this function, which minimizes the pixel-level difference between the generated image and the real image. The combination of adversarial loss and pixel space loss produces the generator's loss function. The specific implementation process is as follows:
[0031] L G =Dmax(V(D,G))+λL pix
[0032] In the formula, λ is a hyperparameter that balances the contributions of adversarial loss and pixel space loss.
[0033] S33, the input to generator 2 is a mixture 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 as possible to the real image. This is achieved by adding physical simulations of crack parameters to generator 2 as labels to specify the generation domain of generator 2, and by applying small perturbations to the simulated physical cracks to make their texture distribution the same as that of real-world cracks.
[0034] Guided by texture discriminator 2, the crack texture styles synthesized by generator 1 and generator 2 are consistent, while the generated physical crack image style is preserved in the distribution.
[0035] Generator 2 consists of an input layer, a transformed convolutional layer, and a batch normalization layer, using the leakyReLU activation function for extraction. The specific implementation of the loss function of Generator 2 is as follows:
[0036] L G2 =Dmax(V(D,G(z,p)))+λL pix
[0037] Where G(z,p) is the Gaussian distribution of generator 2 after a small perturbation based on generator 1.
[0038] S34, Discriminator 1 controls the distribution of images generated by Generator 1. When the images generated by Generator 1 are indistinguishable, the existing parameters of Discriminator 1 are updated and iteratively learned, allowing Generator 1 and Discriminator 1 to converge through continuous adversarial learning. The Discriminator 1 module includes convolutional layers and pooling layers, performing feature extraction and downsampling operations on the input image. It uses fully connected layers 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 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. 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 using 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 true image distribution, R p This represents the image distribution after inputting the crack.
[0044] Preferably, in step S4, the method for designing and verifying the quality and diversity index (QDI) of the generated images, training a Dugdale-GAN model based on a physical model, and testing the crack images generated according to the Dugdale-GAN model based on the QDI includes:
[0045] S41, the model is trained and tested based on the crack dataset, and the model test results are evaluated using evaluation metrics, which are implemented using the following formula.
[0046] FID is achieved through the following formula.
[0047]
[0048] QDI is implemented through the following formula.
[0049]
[0050] Where, μ t ∑ is the average value of the real image set output by the InceptionNetv3 model to a 2048-dimensional feature vector set. t It is the covariance matrix, μ g It is the generated image set output by the InceptionNetv3 model to a 2048-dimensional feature vector set, ∑ g Yes, it is the covariance matrix, and 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, and μ t ,μ g ,μ z Let ∑ represent the real image, generated image, and real image after adding noise perturbation, respectively, where θ is the penalty coefficient, and ∑ t , ∑ g Let ||μ| represent the covariance matrix of the real image and the feature vector of the generated image, respectively. t -μ g ||2 represents μ t and μ g The 2-norm distance between them, where 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, and the learning rate is 0.0001.
[0053] The beneficial effects of this invention are as follows: It designs a complete crack image generation algorithm that integrates physical modeling. This invention forms a complete process including crack generation, image fusion, model construction, index construction, model training, and model testing;
[0054] This invention achieves the training and generation of crack images through physical and data fusion of crack images. By using physical modeling and physical labeling methods, the physical characteristics of crack images are enhanced, which not only improves the quality of the generated images but also allows for the acquisition of more diverse crack image datasets.
[0055] This invention selects a dual-generator, dual-discriminator model framework to address the issues of non-convergence and poor performance during single-generator training. To improve the quality of the generated images, generator 2 utilizes the noise vector z input from the converged G1 generator and perturbs it within a small range. This allows the G2 generator to converge faster and learn the texture details of the original image more effectively. Compared to traditional generative models, this model generates images with higher quality and greater diversity.
[0056] The generated image evaluation metric FID requires a trade-off between the quality and diversity of the generated images. However, our designed QDI can better evaluate the diversity of generated images without requiring a trade-off between quality and diversity, thus compensating for the shortcomings of FID. Therefore, using the generated image evaluation metric FID to evaluate the Dugdale-GAN model greatly improves the quality and diversity of the images generated by the model. Attached Figure Description
[0057] Figure 1 This 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 Implementation
[0058] The present invention will be further described below with reference to the accompanying drawings and embodiments.
[0059] This embodiment presents an adversarial generative network (GAN) method for generating images of metal surface cracks by integrating physical modeling. The method is based on a newly proposed diversity index for model testing. The implementation process includes crack generation, model construction, diversity index construction, model training, and model testing. The method includes the following steps: 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 the metal material; S2 Image fusion, fusing the constructed cracks with the metal surface image; S3 Constructing an adversarial generative network model (Dugdale-GAN) that integrates the physical model; S4 Designing and validating the quality and diversity index of the generated images (Diversity Reference System, QDI); and training and testing the Dugdale-GAN model based on the physical model.
[0060] Specifically, the adversarial generation method for metal surface crack images based on physical modeling in this embodiment includes the following:
[0061] Cracks are generated in S1 using the Dugdale physics model, such as... Figure 1 As shown in S1, the specific input features include inputting parameters such as the material of the metal, Young's modulus, Poisson's ratio, and stress magnitude. The current stress direction and magnitude are calculated based on the crack region growth algorithm, and the crack shape of the next region is calculated and the parameters are updated based on the current crack width and stress magnitude.
[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), a physical model of the crack generation method is performed. Starting from the initial state, the crack width, stress magnitude, and direction of the current state are calculated, a crack image is drawn, and the parameters are updated. Finally, the crack image is output.
[0063] The specific implementation of the crack growth algorithm is as follows:
[0064] S11: Given the Young's modulus parameter E of the material, and randomly generated stress σ and yield stress σ of the material. s The relevant parameters, such as the microcrack length a, are used to calculate the crack tip opening displacement δ(a) at the fracture point using the Dugdale physical model, as shown in equation (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: The crack growth algorithm is designed to start from the initial crack point and iteratively grow the crack based on the opening displacement of the crack tip and the crack area at the fracture point, and finally obtain a complete crack image.
[0070] Extract the crack pattern D from the original dataset, randomly select a portion of it as the crack growth basis D1, and then randomly select region D2 as the crack growth region. The generation is divided into two types. When D1 exceeds 1 / 4 of the image, D2 is randomly selected from the spatial domain of D1 as the crack growth basis space; otherwise, all of D1 is used as the growth basis space.
[0071] The crack growth in the extended region is calculated by setting parameters such as Young's modulus. Starting from the edge of region D2, the growth step size step is set, and the crack expands outward in steps of 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 to be fused with the background image. At the same time, new stress parameters are randomly generated again, and a new crack image is generated again according to formulas (1) and (2).
[0073] In S2, image fusion is performed. Based on the crack image extracted in S1, an image fusion module is constructed using a fusion matrix. This module transforms the background image input features of the material into metal image features with cracks. S2 includes an image fusion module that fuses the crack image into the background metal surface image using a weight matrix. The image fusion module achieves the following: Figure 1 As shown in S2, its specific implementation is as follows:
[0074] S21: Establish a fusion matrix to fuse the crack pattern with the metal image background. The weight α for image fusion is selected within the range of (0, 1). The specific implementation process is shown in equation (3):
[0075] C=aCr+(1-a)B (3)
[0076] In the formula, 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 generator and two discriminator modules. This model effectively improves the diversity and quality of generated images, simulating more realistic crack textures. The adversarial generative network model (Dugdale-GAN) in S3, which integrates a physical model, is as follows: Figure 1As shown in S3, the specific implementation is as follows:
[0078] S31: The generator part of the Dugdale-GAN model was designed, and the Gaussian noise vector of generator 1 was 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 judges the quality of the images generated by generator 1, and texture discriminator 2 is used to control the consistency between the generated crack texture and the original crack.
[0079] S32: To make the texture in the fused crack image more similar to the real image, an additional texture discriminator module was designed, allowing Generator 2 to better learn the simulated texture distribution of Generator 1. This ensures the image generation quality of Generator G2 while paying more attention to the texture similarity of the cracks, thus obtaining diverse crack images with realistic physical meaning.
[0080] The generator 1 module is implemented. The purpose of generator 1 is to learn and acquire a distribution that is as similar as possible to the real image, including the background image and crack texture. The specific implementation process of its loss function is shown in equation (4):
[0081]
[0082] In the formula, N represents the number of samples in the dataset, i represents the number of real images, and n represents the noise vector used to generate the real image. The generator aims to minimize this function, minimizing the pixel-level difference between the generated image and the real image. The combination of adversarial loss and pixel space loss produces the generator's loss function. The specific implementation process is shown in Equation (5):
[0083] L G =Dmax(V(D,G))+λL pix (5)
[0084] In the formula, λ is a hyperparameter that balances the contributions of adversarial loss and pixel space loss.
[0085] S33: Implementation of Generator 2 module. Generator 2 differs from Generator 1 in that its input is a mixture vector of random Gaussian noise and labels, along with a crack image generated using a physical model. The goal of Generator 2 is to make the texture of the physical crack as similar as possible to the real image. This is achieved by adding physical simulations of crack parameters, such as the material's Young's modulus and strain, to the generator, specifying the generation domain of Generator 2 as labels, and applying small perturbations to the simulated physical crack to make its texture distribution identical to that of a real-world crack.
[0086] Guided by texture discriminator 2, the crack texture styles synthesized by generator 1 and generator 2 are consistent, while preserving the generated physical crack image style in the distribution. Generator 2 consists of an input layer, a transform convolutional layer, and a batch normalization layer, which also uses the leakyRELU activation function for extraction. The specific implementation of the loss function of generator 2 is shown in equation (6):
[0087] L G2 =Dmax(V(D,G(z,p)))+λL pix (6)
[0088] In the formula, G(z,p) is the Gaussian distribution of generator module 2 after a small perturbation based on generator module 1.
[0089] S34: Implementation of 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 as possible to the distribution of real images. When the images generated by Generator 1 are indistinguishable, the existing parameters of Discriminator 1 will be updated and iteratively learned, 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. Batch normalization layers are also used to alleviate the internal variable shift problem, improving 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 Equation (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 objective of discriminator 1 is to minimize the loss function, such 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 discriminator 2 is designed to help generator 2 better learn the simulated texture distribution of generator 1. If generator 1 is ignored and generator 2 is allowed to directly learn the distribution of the real image, we find that generator 2 does not converge quickly. However, if generator 2 is perturbed by the Gaussian vector z input by the converged generator 1 within a small range, generator 2 converges faster and can learn the texture details of the original image well. Discriminator 2 should ensure the quality of the image generated by generator 2, while paying more attention to the similarity of crack textures, so as to obtain physically realistic and diverse crack images. The specific implementation process of the discriminator 2 loss function is shown in equation (8):
[0093] L D2 =[log D(G(z)-G(z,p))]+||R z -R p || (8)
[0094] In the formula, R z Represents the true image distribution, R p This represents the image distribution after inputting the crack.
[0095] In S4, the Quality Diversity Index (QDI) evaluates images by adding a penalty function coefficient and a 2-norm distance. This index effectively assesses the diversity and quality of generated images. The implementation of the QDI index and model training in S4 are as follows: Figure 1 As shown in S4, the specific implementation is as follows:
[0096] S41: In S4, the model is trained and tested based on the crack dataset, and evaluation metrics are used to evaluate the model's test results, such as... Figure 1 S4 is shown. The specific implementation of the evaluation indicators is as follows: FID is shown in Equation (9), and QDI is shown in Equation (10):
[0097]
[0098] In the formula, μ t ∑ is the average value of the real image set output by the "InceptionNetv3" model to a 2048-dimensional feature vector set. t It is the covariance matrix, μ g This is a set of generated images generated by outputting the "Inception Netv3" model to a 2048-dimensional feature vector set. ∑ g Yes, it is a covariance matrix, and Tr represents the trace of the matrix.
[0099]
[0100] In the formula, t and g represent the real image and the generated image, respectively. z represents the added noise perturbation, μ t ,μ g ,μ z Let represent the real image, the generated image, and the real image after adding noise perturbation, respectively. θ is the penalty coefficient, ∑ t , ∑ g Let ||μ| represent the covariance matrix of the real image and the feature vector of the generated image, respectively. t -μ g ||2 represents μ t and μ g The 2-norm distance between them, Tr(·) represents the trace of the matrix.
[0101] The QDI metric is primarily used to evaluate the diversity of generated images. If the original image has good quality and diversity, the input generative adversarial network (GAN) model will perform better, and the new images generated by the model will be consistent with the original image in terms of quality and diversity; in this case, the penalty coefficient θ will be very small. If the generated new image is consistent with the original image in quality, but the original image itself has relatively poor diversity, 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 penalty coefficient θ will increase further.
[0102] S42: The batch size was 32, the Gaussian noise perturbation parameter for Generator 2 was 0.05, the training iterations were 10,000, and the learning rate was 0.0001. In the early stages of training, the image quality generated by Generator 1 might not meet the input requirements of Generator 2, resulting in a higher loss value. However, as training progressed and the generators iterated, both generators converged effectively and generated high-quality images. The evaluation results of the model predictions are shown in Table 1. The evaluation metric mentioned in S42 is the QDI (Quality Diversity Index), which comprehensively evaluates the model's prediction performance based on both image quality and diversity. The smaller the QDI value, the higher the image quality and diversity.
[0103] Table 1
[0104]
[0105] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and are not intended to limit it. Although the present invention has been described in detail with reference to preferred embodiments, those skilled in the art should understand that modifications or equivalent substitutions can be made to the technical solutions of the present invention without departing from the spirit and scope of the present invention, and all such modifications or substitutions should be covered within the scope of the claims of the present invention.
Claims
1. A method for adversarial generation of metal surface crack images integrating physical modeling, characterized in that, include: S1, based on the metal material parameters, use the crack region growth algorithm to calculate the current stress direction and magnitude, calculate the crack shape of the next region based on the current crack width and stress magnitude, and update the parameters; S2, fuses the constructed crack with the corresponding metal surface image; S3, Construct Dugdale-GAN, an adversarial generative network model that integrates physical models; S4. Design a quality and diversity index (QDI) for the generated images. Train the Dugdale-GAN model based on the physical model and test the crack images generated by the Dugdale-GAN model based on the diversity index (QDI). The specific method for S1, which calculates the current stress direction and magnitude using a crack region growth algorithm based on the metal material parameters, and calculates the crack shape of the next region and updates the parameters based on the current crack width and stress magnitude, includes: S11, given the Young's modulus parameter E of the material, and the randomly generated stress σ and yield stress σ of the material. s The microcrack length parameter 'a' is used to calculate the crack tip opening displacement δ(a) at the fracture point using the Dugdale physical model: The cross-sectional area A is then calculated based on the crack tip opening displacement δ(a) at the fracture point. 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; S12, the crack growth algorithm is designed to start from the initial crack point and iteratively grow the crack based on the crack tip displacement and crack area at the fracture point, using the formula... Obtain a complete crack image; Extract the crack pattern D from the original dataset, randomly select a portion of it as the crack growth base D1, and then randomly select region D2 as the crack growth region. The crack growth region is generated in two ways. Determine whether D1 exceeds 1 / 4 of the image. If so, randomly select 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 crack growth in the extended region is calculated by setting the Young's modulus parameter. Starting from the edge of region D2, the growth step size step is set, and the crack expands outward in steps of pixels each time until D2 = D1 and the crack image is output. S13, after the image generation is complete, is sent to S2 to be fused with the background image. At the same time, new stress parameters are randomly generated again, and the process is repeated according to the formula. and Calculate and generate crack images.
2. The adversarial generation method for metal surface crack images based on physical modeling according to claim 1, characterized in that, The specific method for fusing the constructed crack with the corresponding metal surface image in S2 includes: A fusion matrix is established to fuse the crack pattern with the metal image background. The weight α for image fusion is selected within the range of (0, 1), and is implemented using the following formula: C=αCr+(1-α)B 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.
3. The adversarial generation method for metal surface crack images based on physical modeling as described in claim 1, characterized in that, The method for constructing the Dugdale-GAN adversarial generative network model that integrates physical models, as described in S3, includes: S31, the Dugdale-GAN architecture includes generator 1 and generator 2, and also includes discriminator 1 and discriminator 2. Generator 1 is used to generate a new image by inputting Gaussian noise, generator 2 is used to generate a new image by inputting generated physical cracks and mixed Gaussian noise, discriminator 1 is used to determine the quality of the image generated by generator 1, and texture discriminator 2 is used to control the consistency between the generated crack texture and the original crack. S32, Generator 1 module is used to learn and acquire the distribution of the image, including the background image and crack texture. Its loss function is specifically implemented as follows: Where N represents the number of samples in the dataset, and i represents the number of real images. Generator 1 minimizes this function, which minimizes the pixel-level difference between the generated image and the real image. The combination of adversarial loss and pixel space loss produces the generator's loss function. The specific implementation process is as follows: L G =Dmax(V(D,G))+λL pix In the formula, λ is a hyperparameter that balances the contributions of adversarial loss and pixel space loss; S33, the input to generator 2 is a mixture 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 as possible to the real image. This is achieved by adding physical simulations of crack parameters to generator 2 as labels to specify the generation domain of generator 2, and by applying small perturbations to the simulated physical cracks to make their texture distribution the same as that of real-world cracks. Guided by texture discriminator 2, the crack texture styles synthesized by generator 1 and generator 2 are consistent, while the generated physical crack image style is preserved in the distribution. Generator 2 consists of an input layer, a transformed convolutional layer, and a batch normalization layer, using the leakyReLU activation function for extraction. The specific implementation of the loss function of Generator 2 is as follows: L G2 =Dmax(V(D,G(z,p)))+λL pix Where G(z,p) is the Gaussian distribution of generator 2 after a small perturbation based on generator 1. S34, Discriminator 1 controls the distribution of images generated by Generator 1. When the images generated by Generator 1 are indistinguishable, the existing parameters of Discriminator 1 are updated and iteratively learned, allowing Generator 1 and Discriminator 1 to converge through continuous adversarial learning. The Discriminator 1 module includes convolutional layers and pooling layers, performing feature extraction and downsampling operations on the input image. It uses fully connected layers 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 as follows: L D =-[logD(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. 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 using the following loss function formula. L D2 =-[logD(G(z)-G(z,p))]+||R z -R p || Among them, R z Represents the true image distribution, R p This represents the image distribution after inputting the crack.
4. The adversarial generation method for metal surface crack images based on physical modeling according to claim 1, characterized in that, S4, designing and verifying the quality and diversity index QDI of generated images, training a Dugdale-GAN model based on a physical model, and testing crack images generated according to the Dugdale-GAN model based on the diversity index QDI includes the following methods: S41, the model is trained and tested based on the crack dataset, and the model test results are evaluated using evaluation metrics, which are implemented using the following formula. FID is achieved through the following formula. QDI is implemented through the following formula. Where, μ t ∑ is the average value of the real image set output by the InceptionNetv3 model to a 2048-dimensional feature vector set. t It is the covariance matrix, μ g It is the generated image set output by the InceptionNetv3 model to a 2048-dimensional feature vector set, ∑ g Yes, it is the covariance matrix, and 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, and μ t ,μ g ,μ z Let ∑ represent the real image, generated image, and real image after adding noise perturbation, respectively, where θ is the penalty coefficient, and ∑ t , ∑ g Let ||μ| represent the covariance matrix of the real image and the feature vector of the generated image, respectively. t -μ g ||2 represents μ t and μ g The 2-norm distance between them, where 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, and the learning rate is 0.0001.
Citation Information
Patent Citations
Generative adversarial network-assisted metal fatigue image enhancement method and system
CN117934428A