An artificial stroke-based lesion image data augmentation method
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- NORTHWESTERN POLYTECHNICAL UNIV
- Filing Date
- 2023-12-15
- Publication Date
- 2026-08-07
AI Technical Summary
[0005]为解决上述技术问题,本发明提出了一种基于人工笔划的损伤图像数据增强方法,基于人工笔划并利用深度学习的图像生成技术生成新的损伤图像,从根本上解决损伤样本数量少、损伤种类分布不均的问题;同时克服主流基于机器视觉的损伤检测模型受限于损伤图像样本数量而精度偏低、泛化能力差的问题
[0036]本发明可以通过构建卷积生成对抗网络,得到可通过随机噪声生成类似损伤的生成器;基于裁剪的损伤图像提取用户笔划信息,形成二值化的用户笔划图像;构建先验网络,同时微调生成网络;利用先验网络和生成网络产生新的损伤,通过改进的泊松融合将增强后的损伤图像与背景图像融合,得到最终的损伤图像。可以人工笔划生成用户想要的各种损伤图像,有效解决了现有损伤样本量少,损伤样本类别分布不均的问题;可以生成任意数量的损伤图像,提供了一种有效的损伤图像数据增强方法,应用于深度学习的损伤检测模型训练可以大大提高模型的精度和泛化能力;可以加快高精度、高性能智能损伤检测模型构建,促进先进智能损伤检测技术的发展和快速落地应用,进一步提高工业装备制造及生产水平。
Smart Images

Figure CN117689563B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of image processing technology, specifically relating to a method for enhancing damaged image data based on manual strokes. Background Technology
[0002] In recent years, image intelligent recognition technology based on machine vision has developed unprecedentedly, and technologies involving image / video target recognition, such as facial recognition and autonomous driving, have been widely used in daily life. Currently, image recognition is also appearing in industrial equipment manufacturing and production processes. In particular, the borehole inspection of large and complex thermodynamic machinery (such as gas turbines and aero engines) has gradually shifted from manual borehole inspection to machine-assisted intelligent borehole inspection. The core algorithms of these intelligent borehole inspection methods are similar to deep learning-based target detection / semantic segmentation / instance segmentation algorithms. The construction of intelligent detection models relies on a large number of damage image samples. Even with the most advanced neural network structures and deep learning algorithms, it is useless without sufficient damage image training samples for repeated model training.
[0003] In terms of image sample size, the number of images in everyday scenarios such as facial recognition and autonomous driving is enormous. However, for industrial equipment manufacturing and production, collecting sufficient borehole damage image samples during in-situ borehole inspection of machinery is extremely difficult. The limited number of borehole damage samples greatly restricts the development of intelligent borehole inspection technology. To achieve satisfactory damage detection accuracy, various image data augmentation methods have been proposed to artificially increase the number of training images, such as geometric transformations, color transformations, random cropping, random erasure, and neural style transfer. Although these methods can expand the training images, they only change the appearance and position of the target and cannot generate new targets. They still cannot fundamentally solve the problems of insufficient damage sample size and uneven distribution of damage types.
[0004] Therefore, it is necessary to develop new damage image data enhancement methods, which can generate new borehole damage images based on manual strokes and using deep learning image generation technology. This will fundamentally solve the problems of small number of damage samples and uneven distribution of damage types, improve the accuracy of damage detection models, and enable the rapid application of intelligent borehole detection. Summary of the Invention
[0005] To address the aforementioned technical problems, this invention proposes a damage image data enhancement method based on manual strokes. This method generates new damage images based on manual strokes and utilizes deep learning image generation technology, fundamentally solving the problems of insufficient damage sample quantity and uneven distribution of damage types. At the same time, it overcomes the problem that mainstream machine vision-based damage detection models suffer from low accuracy and poor generalization ability due to the limited number of damage image samples.
[0006] To achieve the above-mentioned objectives, the technical solution adopted by this invention is: a method for enhancing damaged image data based on manual strokes, comprising the following steps:
[0007] S1. Construct a convolutional generative adversarial network and train the convolutional generative adversarial network using a real damage image of a specific size to obtain a generator G(z) that can generate similar damage through random noise z.
[0008] S2. Extract user stroke information from the cropped damaged image to form a binarized user stroke image I. shape , will the user's stroke image I shape Image pairs are formed with the original damaged image and used as new training data;
[0009] S3. Construct a priori network P, using p = P(I shape ,θ P The prior network P is trained, while the generator network G is fine-tuned so that G can generate damage with a specified shape; p is a shape prior vector that encodes the shape information of the user's strokes; θ P Represents the parameters of the prior network;
[0010] S4. Using the prior network P and generator network G trained in step S3, through... From a given user stroke image I shape New damage x′ is generated in the process; among which, It is random Gaussian noise;
[0011] S5. The enhanced damaged image x′ is fused with the background image using an improved Poisson fusion method to obtain the final damaged image.
[0012] Preferably, in step S1, the convolutional generative adversarial network includes a generator network G and an adversarial network D, and is configured using the following objective function:
[0013]
[0014] In the formula, x represents the real damage; z represents random noise; G(z) represents the damage distribution generated by the random noise through the generator network; D(x) represents the probability of classifying the real damage as real; and D(G(z)) represents the probability of classifying the generated fake damage as real.
[0015] Preferably, in step S2, a binarized user stroke image I is formed. shape The specific method is as follows: Canny edge detection, morphological dilation, and morphological closure are sequentially performed on the cropped damaged image to find the maximum connectivity region and generate the final binarized user stroke image I. shape .
[0016] Preferably, the process of training the prior network P and fine-tuning the generator network G is as follows:
[0017] S31. Construct the overall training network model: Connect the prior network P to the generator network G, and connect the first four convolutional layers of the VGG16 network after the generator network G and output the model.
[0018] S32. Assign the initial weights of the generator obtained in step S1 to the generator network G, freeze the weights of the generator network G, and train the prior network P using the training data obtained in step S2.
[0019] S33. Jointly adjust the prior network P and the generator network G: Unfreeze the weights of the generator network G and train the overall training network model according to the training settings parameters in step S32.
[0020] Preferably, in step S32, the user stroke image I shape Input the prior network P, and input the user's stroke image I shape The corresponding real damage images are input into the VGG16 network; the training epoch is set to 200, the number of input images per batch is 32, the initial learning rate r is 0.001, and the network is trained using the gradient descent algorithm.
[0021] Preferably, the process of step S4 is as follows:
[0022] S41. Draw the required damage outline shape using manual strokes, and resize the manual stroke image to 64×64.
[0023] S42. Set n = 255, and use the PyTorch function torch.randn() to generate a value with a mean of 0 and a variance of . A random Gaussian noise vector of dimension 2048;
[0024] S43. Input the artificial stroke image into the prior network P, output the shape prior vector p, and add the corresponding elements of the shape prior vector p to the random Gaussian noise vector of dimension 2048. Input the vector obtained by the addition into the generator network G, and output the required damaged image x′.
[0025] Preferably, the improved Poisson fusion in step S5 is given by the following formula:
[0026]
[0027]
[0028] Where g represents the generated damage; g' represents the area generated within region g by adjusting the area of g at a ratio of 0.8; f* represents the background image; Ω represents the transition region between g and g'; f is the fused image; and v is the gradient of g. It is a gradient operator; and It is the boundary between g and g'.
[0029] Accordingly, the image data enhancement method is applied in the fields of thermomechanical borehole detection, steel surface defect detection and weld detection, and fabric surface defect detection.
[0030] Accordingly, an electronic device includes:
[0031] One or more processors;
[0032] Storage device for storing one or more programs;
[0033] When the one or more programs are executed by the one or more processors, the one or more processors implement the image data enhancement method.
[0034] Accordingly, a computer-readable medium stores a computer program, characterized in that: when the computer program is executed by a processor, it implements the image data enhancement method.
[0035] Compared with the prior art, the present invention has the following beneficial effects:
[0036] This invention constructs a convolutional generative adversarial network (GAN) to generate a generator capable of producing damage-like images from random noise. It extracts user stroke information from cropped damage images to form a binarized user stroke image. A prior network is constructed while the generator network is fine-tuned. New damage is generated using both the prior and generator networks, and the enhanced damage image is fused with the background image using an improved Poisson fusion method to obtain the final damage image. This invention can generate various damage images desired by the user through manual stroke generation, effectively solving the problems of insufficient damage sample size and uneven distribution of damage sample categories. It can generate any number of damage images, providing an effective damage image data augmentation method. Applying this method to deep learning damage detection model training can significantly improve the model's accuracy and generalization ability. It can accelerate the construction of high-precision, high-performance intelligent damage detection models, promote the development and rapid application of advanced intelligent damage detection technology, and further improve the level of industrial equipment manufacturing and production. Attached Figure Description
[0037] Figure 1 This is the overall flowchart of the damage image data enhancement method based on manual strokes of the present invention;
[0038] Figure 2This is an overall structural diagram of the deep convolutional generative adversarial network of this invention;
[0039] Figure 3 This is a structural example diagram of the prior network P of this invention;
[0040] Figure 4 This is a structural example diagram of the overall training network model of the present invention;
[0041] Figure 5 This is an example diagram of the improved Poisson fusion method of the present invention. Detailed Implementation
[0042] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Unless otherwise specified, the technical means used in the embodiments are conventional means well known to those skilled in the art.
[0043] like Figure 1-5 As shown, a method for enhancing damaged image data based on manual strokes mainly includes the following steps:
[0044] S1. Construct a convolutional generative adversarial network (GAN), train the GAN using a real damage image of a specific size, and obtain a generator G(z) that can generate similar damage through random noise z.
[0045] In step S1, the convolutional generative adversarial network (GAN) includes a generator network G (i.e., the generator) and an adversarial network D (i.e., the discriminator). The training process of the generator network G is the same as that proposed in GANs, with the generator G and the discriminator D trained alternately. G is the forger, generating fake images to deceive D. Meanwhile, D is the judge, distinguishing between fake and real images. The generator and discriminator use the following objective function to perform a two-player min-max game:
[0046]
[0047] In the formula, E represents the mathematical expectation of the random variable under a specific functional transformation; x represents the actual damage, whose distribution satisfies P data (x), where data represents all damage data, and the distribution indicates that x follows the general damage distribution characteristics; z represents random noise, i.e., the input data of the generator network, which follows a random distribution P. z (z); G(z) represents the damage distribution generated by the generator network from random noise; D(·) represents the output of the discriminator network; D(x) represents the probability of classifying a real damage as real; D(G(z)) represents the probability of classifying a generated fake damage as real; 1-D(G(z)) represents the probability of classifying a fake damage as fake.
[0048] This invention provides a specific convolutional generative adversarial network, in which the generative network is constructed from a deconvolutional decoding network, such as... Figure 2 As shown in (a), each layer of the deconvolution decoding network consists of a set of deconvolution, batch normalization (BN), and tangent activation functions connected sequentially. The generator network given here has 5 layers, and the stride of the deconvolution operation is 2. Different numbers of deconvolution groups, activation functions, and layers can be set according to requirements. The input of the generator network is a set of random noise z, and the output is a fixed-size three-channel color image (i.e., the generated fake damage image).
[0049] Furthermore, the discriminant network is a standard 5-layer binary classification deep convolutional neural network. The hidden layers consist of convolutions, activations, and batch normalizations connected sequentially. Each convolution, batch normalization, and activation is connected together to form a convolutional layer. The kernel size for the convolution operation is 3×3, the stride is 2, and the padding size is 1. The activation function is LeakyReLU. Therefore, this sub-network contains one input layer, three convolutional layers, and one output layer. After each convolutional layer, the feature map is downsampled, its size becoming half of its original size. The final convolutional layer does not include batch normalization or LeakyReLU activation, and the kernel size is equal to the length and width of the input feature map, aiming to map it as a feature vector rather than a three-dimensional matrix. The discriminant network finally outputs a binary classification softmax layer. See [link to specific structure] for details. Figure 2 (b). The input to the discriminator network is the real damage image x and the generated damage image G(z), and the output is the probability of the real damage image, which is used to distinguish between the real and fake input damage images.
[0050] Furthermore, after building the generative adversarial network (GAN) as described above using a Python program, the GAN was trained using real damage images. The training samples were preprocessed damage images collected during borehole probing. First, a certain number of borehole damage images (more than 200) were collected. The damage images were cropped using rectangular frames. The resulting damage images varied in size, requiring resizing to a fixed size. We chose a fixed size of 64×64. For damage images larger than 64×64, downsampling was used to resize them to 64×64. For damage images smaller than 64×64, cubic spline interpolation was used to resize them to 64×64. To improve the generator's performance, common image data augmentation methods (random flipping, rotation, brightness adjustment, contrast adjustment, sharpness adjustment, stretching, scaling, distortion, etc.) were used to augment the fixed-size damage images, increasing the data volume by five times. Using enhanced fixed-size damaged images and setting appropriate training parameters such as training step size (epoch), batch size (batch size), and learning rate (r), a generative adversarial network is trained using the gradient descent algorithm, and the initial weights of the damaged image generator are finally obtained.
[0051] S2. Extract user stroke information from the cropped damaged image to form a binarized user stroke image I. shape , will the user's stroke image I shape The original damaged image is used to form an image pair, which serves as new training data.
[0052] In step S2, a binarized user stroke image I is formed. shape The specific method is as follows: Canny edge detection, morphological dilation, and morphological closure are sequentially performed on the cropped damaged image to find the maximum connectivity region and generate the final binarized user stroke image I. shape .
[0053] The specific implementation process is as follows: For each cropped and damaged image, adjust the minimum threshold T of Canny edge detection. min =50 (can be adjusted as needed), maximum threshold T max =200 (can be adjusted as needed). A 5×5 square is used as the structuring element in the morphological dilation operation to generate the dilated image. Then, a morphological closure operation is performed on the enlarged image to generate the final binarized user stroke image I by finding the maximum connected region. shape .
[0054] S3. Construct a priori network P, using p = P(I shape ,θ PThe prior network P is trained, while the generator network G is fine-tuned so that G can generate damage with a specified shape; p is a shape prior vector that encodes the shape information of the user's strokes; θ P The parameters of the prior network, such as θ, represent the parameters of the data after a function transformation. P Similar to the weight matrix of a function.
[0055] A shape prior vector p encodes the shape information of the user's strokes. A pre-trained generative network G can generate damage with shapes similar to the user's strokes based on p. As the training epochs deepen, the network parameters of the generative network G are fine-tuned, and the quality of the generated damage images with shapes similar to the user's strokes improves. Let x′ represent the shape of the damage generated by G... (p) The resulting damage, y represents the actual damage. User stroke image I shape Extracted from the actual damage y, obtained in step S2. The distance between the generated damage x′ and the actual damage y should be small enough to ensure that x′ resembles y. Therefore, it forces the prior network P to process the user stroke image I. shape The shape information is encoded, and a shape prior vector p is generated. x′ and y are then input into the VGG16 network, and the output F is obtained from the fourth convolutional layer of VGG16. x’ and F y , respectively, come from x′ and y. Using F x’ and F y The L2 distance between x′ and y is used to evaluate the similarity between them. The optimization of the prior network P can be obtained by the following formula:
[0056]
[0057] Where N is the number of training image pairs.
[0058] The prior network P is constructed from a convolutional autoencoder network. Here, a convolutional autoencoder network structure is given, such as... Figure 3 As shown, this convolutional autoencoder network has 5 layers. Each layer consists of convolution, batch normalization (BN), and Leaky ReLU activation functions connected sequentially. The stride of the convolution operation is 2, the kernel size is 3×3, and the network input is a 64×64 single-channel grayscale image (user stroke image I). shape After five layers of convolution operations, it becomes a 2×2×512 three-dimensional vector. Finally, it undergoes a one-dimensional stretching of the vector to become a one-dimensional vector containing 2048 numbers, represented as the shape prior vector p.
[0059] Furthermore, the process of training the prior network P and fine-tuning the generator network G is as follows:
[0060] S31. Construct the overall training network model: Connect the prior network P to the generator network G, and then connect the first four convolutional layers of the VGG16 network after the generator network G for output. Construct the overall training network model in this way. The structure of the overall training network model is as follows: Figure 4 As shown.
[0061] S32. Assign the initial weights of the generator obtained in step S1 to the generator network G, freeze the weights of the generator network G, and train the prior network P using the training data obtained in step S2.
[0062] Specifically, the user's stroke image I shape Input the prior network P, and input the user's stroke image I shape The corresponding real damage images are input into the VGG16 network; the training epoch is set to 200, the batch size of input images is 32, and the initial learning rate r is 0.001 (training parameters are set according to computing hardware resources and experience), and the network is trained using the gradient descent algorithm.
[0063] S33. Jointly adjust the prior network P and the generator network G: Unfreeze the weights of the generator network G and train the overall training network model according to the training settings in step S32. Set the training termination condition to end training if the loss no longer decreases after 6 consecutive training iterations.
[0064] S4. Using the prior network P and generator network G trained in step S3, through... From a given user stroke image I shape New damage x′ is generated in the process; among which, It uses random Gaussian noise. The training termination condition is set to end the training if the loss no longer decreases after 6 consecutive training iterations.
[0065] The specific implementation process is as follows:
[0066] S41. Use manual strokes to draw the shape of the damage outline to be generated. For example, the crack damage stroke is a line of arbitrary length and width. Resize the manual stroke image to 64×64.
[0067] S42. Set n = 255 (based on experience, generally an integer multiple of the maximum pixel value), and use the PyTorch function torch.randn() to generate a value with a mean of 0 and a variance of... A random Gaussian noise vector of dimension 2048;
[0068] S43. Input the artificial stroke image into the prior network P, output the shape prior vector p, and add the corresponding elements of the shape prior vector p to the random Gaussian noise vector of dimension 2048. Input the vector obtained by the addition into the generator network G, and output the required damaged image x′.
[0069] S5. The enhanced damage image x′ is fused with the background image using improved Poisson fusion to obtain the final damage image. Specifically, the intact borehole image is taken as the background image, and data augmentation is performed on the damage image x′ obtained in step four (common data augmentation methods include rotation, flipping, brightness / contrast adjustment, scaling, etc.). The enhanced damage image is then fused with the background image using improved Poisson fusion to obtain the final borehole damage image.
[0070] The improved Poisson fusion in step S5 is given by the following formula:
[0071]
[0072]
[0073] Where g represents the generated damage; g' represents the area generated within region g by adjusting the area of g at a ratio of 0.8; f* represents the background image; Ω represents the transition region between g and g'; f is the fused image; and v is the gradient of g. It is a gradient operator; and is the boundary between g and g'; st is the constraint condition. This equation ensures that the transition region has the same texture as the generated damage. These two constraints ensure that the fused image f has the same texture as the generated damage. and They have the same pixel values f* and g. It's worth noting that g is related to the user's stroke damage image, and it can be updated by adjusting the user's stroke damage image. The improved Poisson fusion not only preserves the original pixels of the fusion region but also smooths the fusion boundaries.
[0074] Accordingly, the image data enhancement method disclosed in this invention can be applied to other machine vision-based detection problems, such as thermomechanical borehole detection, steel surface defect detection and weld detection, and fabric surface defect detection. By generating training image samples, the number of training samples is effectively increased, solving the drawbacks of poor detection performance caused by insufficient training data sample size and imbalanced distribution.
[0075] The present invention also discloses an electronic device, comprising: one or more processors; a storage device for storing one or more programs; wherein, when the one or more programs are executed by the one or more processors, the one or more processors implement the image data enhancement method. The electronic device in this embodiment may include, but is not limited to, mobile terminals such as mobile phones, laptops, digital broadcast receivers, PDAs (personal digital assistants), PADs (tablet computers), PMPs (portable multimedia players), and in-vehicle terminals (e.g., in-vehicle navigation terminals), as well as fixed terminals such as digital TVs and desktop computers.
[0076] The present invention also discloses a computer-readable medium storing a computer program that, when executed by a processor, implements the image data enhancement method described above. Embodiments of this disclosure include a computer program product comprising a computer program carried on a non-transitory computer-readable medium, the computer program containing instructions for performing a process. Figure 1-5 The program code for the method shown.
[0077] It should be noted that the computer-readable medium of this disclosure may be a computer-readable signal medium or a computer-readable storage medium, or any combination thereof. A computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples of a computer-readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination thereof.
[0078] In this disclosure, a computer-readable storage medium can be any tangible medium that contains or stores a program that can be used by or in connection with an instruction execution system, apparatus, or device. In this disclosure, a computer-readable signal medium can include a data signal propagated in baseband or as part of a carrier wave, carrying computer-readable program code. Such propagated data signals can take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. A computer-readable signal medium can also be any computer-readable medium other than a computer-readable storage medium, which can send, propagate, or transmit a program for use by or in connection with an instruction execution system, apparatus, or device. The program code contained on the computer-readable medium can be transmitted using any suitable medium, including but not limited to: wires, optical fibers, RF (radio frequency), etc., or any suitable combination thereof.
[0079] In some implementations, clients and servers can communicate using any currently known or future-developed network protocol, such as HTTP (Hypertext Transfer Protocol), and can interconnect with digital data communication (e.g., communication networks) of any form or medium. Examples of communication networks include local area networks (“LANs”), wide area networks (“WANs”), the Internet (e.g., the Internet of Things), and peer-to-peer networks (e.g., ad hoc peer-to-peer networks), as well as any currently known or future-developed networks.
[0080] The aforementioned computer-readable medium may be included in the aforementioned electronic device; or it may exist independently and not assembled into the electronic device.
[0081] The embodiments described above are merely preferred embodiments of the present invention and are not intended to limit the scope of the present invention. Any modifications, alterations, substitutions, or variations made by those skilled in the art to the technical solutions of the present invention without departing from the spirit of the present invention shall fall within the protection scope defined by the claims of the present invention.
Claims
1. A method for enhancing damaged image data based on manual strokes, characterized in that: Including the following steps: S1. Construct a convolutional generative adversarial network (GAN), train the GAN using a real damage image of a specific size, and obtain a generator that can generate damage-like data using random noise z. ; S2. Extract user stroke information from the cropped damaged image to form a binarized user stroke image I. shape , will use the user's stroke image I shape Image pairs are formed with the original damaged image and used as new training data; S3. Construct the prior network P, through... Train the prior network P, and fine-tune the generator network G so that the generator network G can generate damage with a specified shape. It is a shape prior vector that encodes the shape information of the user's strokes; Represents the parameters of the prior network; S4. Using the prior network P and generator network G trained in step S3, through... From a given user stroke image I shape New damage is generated in the middle. ;in, It is random Gaussian noise; S5. Enhanced damage image through improved Poisson fusion. The image is then fused with the background image to obtain the final damaged image. In step S1, the convolutional generative adversarial network includes a generator network G and an adversarial network D, and is executed using the following objective function: In the formula, x represents the actual damage; z represents random noise; This represents the damage distribution generated by a generator network from random noise. This represents the probability of classifying a real injury as real. This represents the probability of classifying a generated fake damage as real; In step S2, a binarized user stroke image I is formed. shape The specific method is as follows: Canny edge detection, morphological dilation, and morphological closure are sequentially performed on the cropped damaged image to find the maximum connectivity region and generate the final binarized user stroke image I. shape ; The process of training the prior network P and fine-tuning the generator network G is as follows: S31. Construct the overall training network model: Connect the prior network P to the generator network G, and connect the first four convolutional layers of the VGG16 network after the generator network G and output the model. S32. Assign the initial weights of the generator obtained in step S1 to the generator network G, freeze the weights of the generator network G, and train the prior network P using the training data obtained in step S2. S33. Jointly adjust the prior network P and the generator network G: Unfreeze the weights of the generator network G and train the overall training network model according to the training settings parameters in step S32.
2. The method for enhancing damaged image data based on manual strokes according to claim 1, characterized in that: In step S32, the user stroke image I shape Input the prior network P, and input the user's stroke image I shape The corresponding real damage images are input into the VGG16 network; the training epoch is set to 200, the number of input images per batch is 32, the initial learning rate r is 0.001, and the network is trained using the gradient descent algorithm.
3. The method for enhancing damaged image data based on manual strokes according to claim 2, characterized in that: The process of step S4 is as follows: S41. Draw the required damage outline shape using manual strokes, and resize the manual stroke image to 64×64. S42. Set n=255, and use the PyTorch function torch.randn() to generate a value with a mean of 0 and a variance of . A random Gaussian noise vector of dimension 2048; S43. Input the handwritten stroke image into the prior network P, and output the shape prior vector. Furthermore, a random Gaussian noise vector of dimension 2048 and a shape prior vector are combined. The corresponding elements are added together, and the resulting vector is input into the generator network G to output the desired damage image. .
4. The method for enhancing damaged image data based on manual strokes according to claim 1, characterized in that: The improved Poisson fusion in step S5 is given by the following formula: ; Where g represents the damage generated; g' represents the area generated within region g by adjusting the area of g at a ratio of 0.8; and f* represents the background image. represents the transition region between g and g'; f is the fused image; v is the gradient of g; It is a gradient operator; and It is the boundary between g and g'.
5. The application of the image data enhancement method as described in any one of claims 1-4 in the fields of thermomechanical borehole detection, steel surface defect detection and weld detection, and fabric surface defect detection.
6. An electronic device, characterized in that: include: One or more processors; Storage device for storing one or more programs; When the one or more programs are executed by the one or more processors, the one or more processors implement the image data enhancement method as described in any one of claims 1-4.
7. A computer-readable medium storing a computer program, characterized in that: When the computer program is executed by a processor, it implements the image data enhancement method as described in any one of claims 1-4.
Citation Information
Patent Citations
Data enhancement method and device based on deep convolutional adversarial network and Poisson fusion
CN114119386A
Aero-engine blade image defect intelligent detection method based on adversarial learning
CN116740020A