Industrial defect image generation method and device, storage medium and electronic equipment

Through the encoding and decoding process based on the Transformer structure, industrial defect images are generated, which solves the problem of insufficient defect image data in industrial scenarios, improves the accuracy of detection and recognition, and improves the generalization ability of the model.

CN118887128AActive Publication Date: 2024-11-01XIAN SHUHE INFORMATION TECH CO LTD

Patent Information

Application Number
CN202411085575.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-08-08
Publication Date
2024-11-01
Estimated Expiration
2044-08-08

AI Technical Summary

Technical Problem

Inadequate image sample data of industrial defects in industrial scenarios, resulting in insufficient training data of machine learning models, affecting the accuracy of detection and recognition.

Method used

Using the encoding and decoding process based on the Transformer structure, industrial defect images are generated through forward diffusion and reverse noise reduction, and context information is extracted using the CoT-TransDDPM model to generate high-quality industrial defect images.

Benefits of technology

The training data of the defect analysis model has been expanded, the accuracy of industrial defect detection and recognition has been improved, and the generalization ability of the model has been improved, and the generated image quality is high and the details are performed well.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118887128A_ABST
    Figure CN118887128A_ABST
Patent Text Reader

Abstract

The invention provides an industrial defect image generation method, an industrial defect image generation device, a computer readable storage medium and electronic equipment, and relates to the technical field of image processing. The industrial defect image generation method comprises the following steps: executing a coding processing process on a to-be-denoised industrial defect image to obtain an intermediate feature; the coding processing process comprises at least one first down-sampling process and at least one second down-sampling process, the first down-sampling process comprises an operation of extracting context information, and the second down-sampling process is realized based on a Transform structure; performing a decoding process on the intermediate feature to generate a de-noised industrial defect image; the decoding processing process comprises at least one first up-sampling process and at least one second up-sampling process, the first up-sampling process is realized based on a Transform structure, and the second up-sampling process comprises an operation of extracting context information. According to the invention, the industrial defect image can be generated, and the sample data of model training can be expanded.
Need to check novelty before this filing date? Find Prior Art

Description

Background Art

[0002] In modern industrial scenarios, machine learning can be used to analyze possible industrial defects in industrial images to guide production and R&D. The performance of machine learning models depends largely on the diversity and richness of training data.

[0003] However, it is currently difficult to accumulate a large number of industrial defect images in industrial scenarios, resulting in insufficient sample data for training machine learning models.

[0004] It should be noted that the information disclosed in the above background technology section is only used to enhance the understanding of the background of the present disclosure, and therefore may include information that does not constitute the prior art known to ordinary technicians in the field. Summary of the invention

[0005] The purpose of the present disclosure is to provide an industrial defect image generation method, an industrial defect image generation device, a computer-readable storage medium and an electronic device, thereby overcoming the problem of insufficient industrial defect image sample data at least to a certain extent.

[0006] According to a first aspect of the present disclosure, a method for generating an industrial defect image is provided, comprising: acquiring an industrial defect image to be denoised; performing an encoding process on the industrial defect image to be denoised to obtain intermediate features; wherein the encoding process comprises at least one first downsampling process and at least one second downsampling process, the first downsampling process comprises an operation of extracting context information, and the second downsampling process is implemented based on a Transformer structure; performing a decoding process on the intermediate features to generate a denoised industrial defect image corresponding to the industrial defect image to be denoised; wherein the decoding process comprises at least one first upsampling process and at least one second upsampling process, the first upsampling process is implemented based on a Transformer structure, and the second upsampling process comprises an operation of extracting context information.

[0007] Optionally, obtaining the industrial defect image to be denoised includes: obtaining an original industrial defect image; performing forward diffusion on the original industrial defect image to generate a plurality of Gaussian noise images; wherein the industrial defect image to be denoised is any one of the plurality of Gaussian noise images.

[0008] Optionally, performing an encoding process on the denoised industrial defect image to obtain intermediate features, including: performing an encoding process on the denoised industrial defect image to generate encoding features; performing at least one global feature extraction process on the encoding features to obtain intermediate features.

[0009] Optionally, the global feature extraction process is implemented based on a Transformer structure with unchanged feature map resolution.

[0010] Optionally, the first downsampling process and / or the second upsampling process is implemented based on a convolution block, the convolution block includes two residual convolution units, each residual convolution unit includes a linear layer, a convolution layer and two context information extraction layers.

[0011] Optionally, the Transformer structure includes a multi-layer perceptron unit, a multi-head self-attention unit, and a normalization operator.

[0012] Optionally, the industrial defect image generation method further includes: connecting a processing process having the same feature map resolution as the encoding processing process and the decoding processing process.

[0013] According to a second aspect of the present disclosure, an industrial defect image generating device is provided, comprising: an image acquisition module, used to acquire an industrial defect image to be denoised; an image encoding module, used to perform an encoding process on the industrial defect image to be denoised to obtain intermediate features; wherein the encoding process includes at least one first downsampling process and at least one second downsampling process, the first downsampling process includes an operation of extracting context information, and the second downsampling process is implemented based on a Transformer structure; an image generation module, used to perform a decoding process on the intermediate features to generate a denoised industrial defect image corresponding to the industrial defect image to be denoised; wherein the decoding process includes at least one first upsampling process and at least one second upsampling process, the first upsampling process is implemented based on a Transformer structure, and the second upsampling process includes an operation of extracting context information.

[0014] Optionally, the image acquisition module is configured to: acquire an original industrial defect image; perform forward diffusion on the original industrial defect image to generate multiple Gaussian noise images; wherein the industrial defect image to be denoised is any one of the multiple Gaussian noise images.

[0015] Optionally, the image encoding module is configured to: perform an encoding process on the industrial defect image to be denoised to generate encoding features; and perform at least one global feature extraction process on the encoding features to obtain intermediate features.

[0016] Optionally, the global feature extraction process is implemented based on a Transformer structure with unchanged feature map resolution.

[0017] Optionally, the first downsampling process and / or the second upsampling process is implemented based on a convolution block, the convolution block includes two residual convolution units, each residual convolution unit includes a linear layer, a convolution layer and two context information extraction layers.

[0018] Optionally, the Transformer structure includes a multi-layer perceptron unit, a multi-head self-attention unit, and a normalization operator.

[0019] Optionally, the encoding process and the decoding process having the same feature map resolution are connected.

[0020] According to a third aspect of the present disclosure, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, any of the above-mentioned industrial defect image generation methods is implemented.

[0021] According to a fourth aspect of the present disclosure, an electronic device is provided, comprising: a processor; and a memory for storing executable instructions of the processor; the processor is configured to implement any of the above-mentioned industrial defect image generation methods by executing the executable instructions.

[0022] In the technical solutions provided by some embodiments of the present disclosure, on the one hand, the present disclosure generates industrial defect images by computer itself, which solves the problem of insufficient number of defect images in actual industrial scenarios. In this case, it helps to expand the training data of the defect analysis model, thereby improving the accuracy of industrial defect detection, recognition, and analysis, and is conducive to improving the generalization ability of the model. On the other hand, the extraction operation of context information and the attention mechanism of Transformer are added to the image processing process of the present disclosure, so that the generated image is of high quality and good detail performance.

[0023] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS

[0024] The accompanying drawings herein are incorporated into the specification and constitute a part of the specification, illustrate embodiments consistent with the present disclosure, and together with the specification are used to explain the principles of the present disclosure. Obviously, the accompanying drawings described below are only some embodiments of the present disclosure, and for ordinary technicians in this field, other accompanying drawings can be obtained based on these accompanying drawings without creative work.

[0025] Figure 1 A schematic diagram showing the processing stages involved in the image generation scheme of an embodiment of the present disclosure.

[0026] Figure 2 A schematic diagram of forward diffusion according to an embodiment of the present disclosure is shown.

[0027] Figure 3 A flowchart of a method for generating an industrial defect image according to an exemplary embodiment of the present disclosure is schematically shown.

[0028] Figure 4 A schematic diagram showing the encoding process and the decoding process of an embodiment of the present disclosure is shown.

[0029] Figure 5 A schematic diagram is shown for explaining the encoding and decoding process of an embodiment of the present disclosure in combination with the reverse noise reduction stage.

[0030] Figure 6 A schematic diagram of the structure of a convolution block according to an embodiment of the present disclosure is shown.

[0031] Figure 7 A schematic diagram of the structure of the Transformer module of an embodiment of the present disclosure is shown.

[0032] Figure 8 A schematic diagram of the entire network structure including encoding and decoding according to an embodiment of the present disclosure is shown.

[0033] Fig. 9 A comparison diagram of the effects of industrial defect images generated by an embodiment of the present disclosure is schematically shown, wherein A is the original industrial defect image, B is the industrial defect image generated by using a network without adding context information extraction operations and Transformer structure, and C is the industrial defect image generated by applying the image generation scheme of an embodiment of the present disclosure.

[0034] Fig.10 A block diagram of an industrial defect image generating device according to an exemplary embodiment of the present disclosure is schematically shown.

[0035] Fig.11 A block diagram of an electronic device according to an exemplary embodiment of the present disclosure is schematically shown. DETAILED DESCRIPTION

[0036] Example embodiments will now be described more fully with reference to the accompanying drawings. However, example embodiments can be implemented in a variety of forms and should not be construed as being limited to the examples set forth herein; on the contrary, these embodiments are provided so that the present disclosure will be more comprehensive and complete, and the concepts of the example embodiments are fully conveyed to those skilled in the art. The described features, structures, or characteristics may be combined in one or more embodiments in any suitable manner. In the following description, many specific details are provided to provide a full understanding of the embodiments of the present disclosure. However, those skilled in the art will appreciate that the technical solutions of the present disclosure may be practiced while omitting one or more of the specific details, or other methods, components, devices, steps, etc. may be adopted. In other cases, known technical solutions are not shown or described in detail to avoid obscuring various aspects of the present disclosure.

[0037] In addition, the accompanying drawings are only schematic illustrations of the present disclosure and are not necessarily drawn to scale. The same reference numerals in the figures represent the same or similar parts, and their repeated description will be omitted. Some of the block diagrams shown in the accompanying drawings are functional entities and do not necessarily correspond to physically or logically independent entities. These functional entities can be implemented in software form, or implemented in one or more hardware modules or integrated circuits, or implemented in different networks and / or processor devices and / or microcontroller devices.

[0038] The flowcharts shown in the accompanying drawings are only exemplary and do not necessarily include all the steps. For example, some steps may be decomposed, while some steps may be combined or partially combined, so the actual execution order may change according to the actual situation. In addition, all the terms "first", "second", etc. below are only for the purpose of distinction and should not be used as limitations of the present disclosure.

[0039] The embodiment of the present disclosure provides an industrial defect image generation solution based on CoT-TransDDPM. In order to make the present disclosure easy to understand, some terms are explained below.

[0040] DDPM (Denoising Diffusion Probabilistic Model), also known as the diffusion model, is a model that can be used to implement artificial intelligence content generation. The theoretical basis of DDPM is to train a parameterized Markov chain through variational inference. The diffusion model can be divided into two stages, namely the forward diffusion stage and the reverse denoising stage. The forward diffusion stage is used to give the initial data distribution and continuously add Gaussian noise to the distribution. The forward diffusion stage is a Markov process. The reverse denoising stage is used to continuously restore the noise to the initial data. Specifically, the noise added at each step is predicted, and the noise is removed to gradually restore the noise-free image.

[0041] The CoT module combines convolution and self-attention mechanisms, and the CoT module can be used to extract contextual information.

[0042] The Transformer module can integrate technologies such as self-attention mechanism, position encoding and residual connection, which helps to improve the performance and stability of the model.

[0043] The CoT-TransDDPM mentioned in the embodiments of the present disclosure is a diffusion model including a CoT module and a Transformer module, that is, the CoT module and the Transformer module are integrated on the basis of the DDPM model to enhance the attention mechanism. The present disclosure uses this model to implement a generation scheme for industrial defect images.

[0044] It should be noted that the industrial defect images referred to in the present disclosure refer to images of defects in various industrial objects, which may include but are not limited to PCB (Printed Circuit Board) defect images, impeller defect images, weld (or weldment) defect images, etc.

[0045] Figure 1 FIG. 1 is a schematic diagram showing the processing stages involved in the image generation scheme of an embodiment of the present disclosure. Figure 1 The image generation scheme of the embodiment of the present disclosure may include a forward diffusion stage 11 and a reverse noise reduction stage 12.

[0046] Before implementing the disclosed solution, a data set may be prepared. Specifically, original industrial defect images with high definition may be obtained. The disclosure does not limit the number of images included in the data set and the resolution of the images. For example, the data set may include 693 images with a resolution of 3034×1586.

[0047] For the forward diffusion stage 11, the original industrial defect image can be recorded as X0, and Gaussian noise is gradually added to the image until an almost pure noise image X T This process can be defined as a Markov process, that is, the noise image at the noise addition time n only depends on the noise image at the noise addition time n-1. Each noise image generated in this process can be used as a training set.

[0048] Figure 2 FIG. 1 is a schematic diagram showing the forward diffusion of an embodiment of the present disclosure. Figure 2 Taking the PCB image as an example, based on image X0, by continuously adding noise, we can get image X1, image X2, ..., image X T-2 、ImageX T-1 and image X T .

[0049] By X n-1 To X n The conditional probability parameters involved in the noise addition process are shown in Formula 1:

[0050]

[0051] Among them, N is a normal distribution, β nis the variance at the noise addition time n, and I represents the identity matrix.

[0052] α n =1-β n Substituting into formula 1, we can get any X n The noise image generated at is shown in Formula 2:

[0053]

[0054] Among them, ∈ n ~N(0,1) is the noise sampled from a normal distribution.

[0055] For the reverse denoising stage 12, the random Gaussian noise image X n To image X n-1 Reverse recursive denoising until the corresponding new X is generated n-1 Among them, the conditional probability parameters involved can be shown in formula 3:

[0056]

[0057] The industrial defect image generation scheme of the embodiment of the present disclosure can be implemented by an electronic device. That is, each step of the industrial defect image generation method of the embodiment of the present disclosure can be performed by an electronic device, and the following industrial defect image generation device can be configured in the electronic device. The present disclosure does not limit the type of electronic device, which can be, for example, an industrial server, a smart terminal, a personal computer, etc.

[0058] Figure 3 The flowchart of the industrial defect image generation method according to an exemplary embodiment of the present disclosure is schematically shown. Figure 3 , the industrial defect image generation method may include the following steps:

[0059] S32. Obtain an industrial defect image to be denoised.

[0060] It should be understood that the present disclosure may be directed to different industrial objects, which may include but are not limited to PCB circuit boards, impellers, weldments, pipe fittings, etc. Different industrial objects have different corresponding defect types, which are not limited by the present disclosure.

[0061] According to some embodiments of the present disclosure, the electronic device can obtain an original industrial defect image shot based on an industrial site, and forward diffuse the original industrial defect image to generate multiple Gaussian noise images. The industrial defect image to be denoised in the present disclosure can be any one of these Gaussian noise images.

[0062] According to other embodiments of the present disclosure, after capturing the original industrial defect image of the industrial site, the R&D personnel may manually add noise to the original industrial defect image through computer technology to obtain the industrial defect image to be denoised.

[0063] S34. Perform an encoding process on the industrial defect image to be denoised to obtain intermediate features; wherein the encoding process includes at least one first downsampling process and at least one second downsampling process, the first downsampling process includes an operation of extracting context information, and the second downsampling process is implemented based on a Transformer structure.

[0064] In an exemplary embodiment of the present disclosure, each first downsampling process includes processing by a CoT module to implement an operation of extracting context information.

[0065] Taking the industrial defect image to be denoised as input, at least one first downsampling process and at least one second downsampling process in cascade are sequentially performed to obtain intermediate features.

[0066] According to some embodiments of the present disclosure, the output of the last second downsampling process is used as an intermediate feature.

[0067] According to some other embodiments of the present disclosure, a coding process is performed on the industrial defect image to be denoised, and the output of the last second downsampling process is used as a coding feature. At least one global feature extraction process is performed on the coding feature to obtain an intermediate feature.

[0068] Specifically, each global feature extraction process can be implemented based on a Transformer structure with unchanged feature map resolution. Specifically, the Transformer structure is a non-sampling Transformer structure, and non-sampling means that the parameters involved in the Transformer structure are set to null in the code.

[0069] S36. Perform a decoding process on the intermediate features to generate a denoised industrial defect image corresponding to the industrial defect image to be denoised; wherein the decoding process includes at least one first upsampling process and at least one second upsampling process, the first upsampling process is implemented based on the Transformer structure, and the second upsampling process includes an operation of extracting context information.

[0070] In an exemplary embodiment of the present disclosure, each second upsampling process includes processing by a CoT module to implement an operation of extracting context information.

[0071] The processing procedures involved in step S34 and step S36 are described below with reference to the accompanying drawings.

[0072] Figure 4The schematic diagram of the encoding process and the decoding process of the embodiment of the present disclosure is shown. Figure 4 The encoding process includes at least one first downsampling process and at least one second downsampling process, and the decoding process includes at least one first upsampling process and at least one second upsampling process.

[0073] The first downsampling process and / or the second upsampling process may be implemented based on a convolution block, which may include two residual convolution units, each of which includes a linear layer, a convolution layer, and two context information extraction layers. The context information extraction layer is the above-mentioned CoT module.

[0074] The second downsampling process and / or the first upsampling process may be implemented based on a Transformer structure, which may include a MultiLayer Perceptron (MLP) unit, a Multi-head Self-Attention (MSA) unit, and a Layer Normalization (LN) operator.

[0075] For the encoding process and the decoding process, the process with the same feature map resolution may be connected to improve the estimation accuracy.

[0076] Figure 5 FIG. 2 shows a schematic diagram for explaining the encoding and decoding process of the embodiment of the present disclosure in combination with the reverse noise reduction stage. Figure 4 The encoding process and decoding process shown in are referred to as the encoding and decoding process. Figure 5 , each noise reduction process can be implemented using the above encoding and decoding process.

[0077] In addition, it should be noted that due to the intervention of the algorithm, the image content of the image in the reverse denoising process is usually not completely consistent with the image at the corresponding position in the forward diffusion. Figure 5 The image generated in is the new image.

[0078] Figure 6 FIG. 4 is a schematic diagram showing the structure of a convolution block in an embodiment of the present disclosure. Figure 6 The convolution block includes two residual convolution parts connected to each other, each of which includes a linear layer, a convolution layer, two CoT modules and two adders. For the convolution layer, it can be a spatial filter with a size of 3×3 and a stride of 1, which is used to learn the local semantic information of the input features. The addition of the CoT module can make full use of the local context information and prevent the problem of feature loss.

[0079] Figure 7 FIG. 4 is a schematic diagram showing the structure of the Transformer module in an embodiment of the present disclosure. Figure 7 The Transformer module corresponds to the Transformer structure mentioned in the present disclosure, which may specifically include a multi-head self-attention unit, a multi-layer perceptron unit, two normalization operators and two adders.

[0080] It should be noted that Figure 6 and Figure 7 This is only an exemplary description, and the convolutional blocks and Transformer modules used in the present disclosure are not limited to this.

[0081] Figure 8 A schematic diagram of the entire network structure including encoding and decoding according to an embodiment of the present disclosure is shown.

[0082] refer to Figure 8 ,First, the denoised industrial defect image can enter the encoding process. Specifically, after passing the input convolution layer, it passes through two ,downsampling convolution blocks to extract early features. The above convolution blocks can learn early local ,features from the high-resolution input image.

[0083] Next, four consecutive downsampling Transformer structures and three consecutive unsampling Transformer structures are used to learn global features from low-resolution features, that is, to generate the intermediate features mentioned in this paper.

[0084] Then, the intermediate features enter the decoding process. Specifically, they go through four consecutive upsampling Transformer structures and two upsampling convolution blocks to restore the original feature map resolution.

[0085] Subsequently, two parameter convolution layers are used to obtain noise parameters and variance coefficients, so as to recursively remove Gaussian noise to a noise-free image and generate a new industrial defect image.

[0086] Among them, a shortcut connection can be used to connect the encoding process and the decoding process of the same resolution, so as to better transmit the high-resolution information from the encoding end to the decoding end to improve the estimation accuracy. The parameters in the training process are estimated through the CoT-TransDDPM model, including the estimated mean and the estimated variance.

[0087] In addition, the output of the convolution layer and the Timstep is passed to the subsequent convolution layer so that each convolution block can learn the feature information on the Timestep. Each convolution layer can apply a group normalization (GN) and SiLu function, and a residual connection is adopted between the convolution layer and the output.

[0088] In addition, for the training process of the above model, the alternating training method of generative adversarial training can be used, using the AdamW optimizer. The parameters are set as follows: the image size is 256×256, the learning rate is 0.00002, the batch size (batchsize) is 4, the weight decay is 0.0001, and the time step, i.e., the number of noise addition rounds, is set to 3500 times. In other words, Figure 8 The t in Timestept is set to 3500.

[0089] The experiment showed that the CoT-TransDDPM model constructed by the embodiment of the present disclosure has a better effect in generating images than the DDPM model. According to the FID index evaluation, the FID index of the DDPM model under the same conditions is 81.96, while the FID index of the CoT-TransDDPM model using the embodiment of the present disclosure is 34.17.

[0090] Take PCB defect image as an example, Fig. 9 A comparison diagram of the effects of industrial defect images generated by an embodiment of the present disclosure is schematically shown, wherein A is the original industrial defect image, B is the industrial defect image generated by using a network without adding context information extraction operations and Transformer structure, and C is the industrial defect image generated by applying the image generation scheme of an embodiment of the present disclosure.

[0091] like Fig. 9 As shown, compared with Figure B, Figure C is closer to Figure A and the details of Figure C are clearer, which shows that the embodiment of the present disclosure has a better image generation effect.

[0092] It should be noted that although the steps of the method in the present disclosure are described in a specific order in the drawings, this does not require or imply that the steps must be performed in this specific order, or that all the steps shown must be performed to achieve the desired results. Additionally or alternatively, some steps may be omitted, multiple steps may be combined into one step, and / or one step may be decomposed into multiple steps, etc.

[0093] Furthermore, this example embodiment also provides an industrial defect image generating device.

[0094] Fig.10 FIG. 1 schematically shows a block diagram of an industrial defect image generating device according to an exemplary embodiment of the present disclosure. Fig.10 According to an exemplary embodiment of the present disclosure, the industrial defect image generating device 10 may include an image acquiring module 101 , an image encoding module 103 , and an image generating module 105 .

[0095] Specifically, the image acquisition module 101 can be used to acquire the industrial defect image to be denoised; the image encoding module 103 can be used to perform an encoding process on the industrial defect image to be denoised to obtain intermediate features; wherein the encoding process includes at least one first downsampling process and at least one second downsampling process, the first downsampling process includes an operation of extracting context information, and the second downsampling process is implemented based on the Transformer structure; the image generation module 105 can be used to perform a decoding process on the intermediate features to generate a denoised industrial defect image corresponding to the industrial defect image to be denoised; wherein the decoding process includes at least one first upsampling process and at least one second upsampling process, the first upsampling process is implemented based on the Transformer structure, and the second upsampling process includes an operation of extracting context information.

[0096] According to an exemplary embodiment of the present disclosure, the image acquisition module 101 can be configured to: acquire an original industrial defect image; perform forward diffusion on the original industrial defect image to generate multiple Gaussian noise images; wherein the industrial defect image to be denoised is any one of the multiple Gaussian noise images.

[0097] According to an exemplary embodiment of the present disclosure, the image encoding module 103 may be configured to: perform an encoding process on the industrial defect image to be denoised to generate encoding features; and perform at least one global feature extraction process on the encoding features to obtain intermediate features.

[0098] According to an exemplary embodiment of the present disclosure, the global feature extraction process is implemented based on a Transformer structure with unchanged feature map resolution.

[0099] According to an exemplary embodiment of the present disclosure, the first downsampling process and / or the second upsampling process is implemented based on a convolution block, and the convolution block includes two residual convolution units, each residual convolution unit includes a linear layer, a convolution layer and two context information extraction layers.

[0100] According to an exemplary embodiment of the present disclosure, the Transformer structure includes a multi-layer perceptron unit, a multi-head self-attention unit, and a normalization operator.

[0101] According to an exemplary embodiment of the present disclosure, a process having the same feature map resolution as that of an encoding process and a decoding process is connected.

[0102] Since the functional modules of the industrial defect image generating device of the embodiment of the present disclosure are the same as those in the above-mentioned method embodiment, they will not be described again here.

[0103] In an exemplary embodiment of the present disclosure, a computer-readable storage medium is also provided, on which a program product capable of implementing the above method of the present specification is stored. In some possible implementations, various aspects of the present disclosure may also be implemented in the form of a program product, which includes a program code, and when the program product is run on a terminal device, the program code is used to enable the terminal device to execute the steps according to various exemplary implementations of the present disclosure described in the above "Exemplary Method" section of the present specification.

[0104] The program product for implementing the above method according to the embodiment of the present disclosure can adopt a portable compact disk read-only memory (CD-ROM) and include program code, and can be run on a terminal device, such as a personal computer. However, the program product of the present disclosure is not limited thereto, and in this document, a readable storage medium can be any tangible medium containing or storing a program, which can be used by or in combination with an instruction execution system, an apparatus or a device.

[0105] The program product may use any combination of one or more readable media. The readable medium may be a readable signal medium or a readable storage medium. The readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples (non-exhaustive list) of readable storage media include: an electrical connection with one or more wires, a portable disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical disk, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above.

[0106] Computer readable signal media may include data signals propagated in baseband or as part of a carrier wave, in which readable program code is carried. Such propagated data signals may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. Readable signal media may also be any readable medium other than a readable storage medium, which may send, propagate, or transmit a program for use by or in conjunction with an instruction execution system, apparatus, or device.

[0107] The program code embodied on the readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wired, optical cable, RF, etc., or any suitable combination of the foregoing.

[0108] Program code for performing the operations of the present disclosure may be written in any combination of one or more programming languages, including object-oriented programming languages ​​such as Java, C++, etc., and conventional procedural programming languages ​​such as "C" or similar programming languages. The program code may be executed entirely on the user computing device, partially on the user device, as a separate software package, partially on the user computing device and partially on a remote computing device, or entirely on a remote computing device or server. In cases involving a remote computing device, the remote computing device may be connected to the user computing device through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computing device (e.g., through the Internet using an Internet service provider).

[0109] In an exemplary embodiment of the present disclosure, an electronic device capable of implementing the above method is also provided.

[0110] Those skilled in the art will appreciate that various aspects of the present disclosure may be implemented as systems, methods or program products. Therefore, various aspects of the present disclosure may be specifically implemented in the following forms, namely: complete hardware implementation, complete software implementation (including firmware, microcode, etc.), or a combination of hardware and software, which may be collectively referred to herein as "circuits", "modules" or "systems".

[0111] Refer to the following Fig.11 1100 according to this embodiment of the present disclosure is described. Fig.11 The electronic device 1100 shown is merely an example and should not bring any limitation to the functions and scope of use of the embodiments of the present disclosure.

[0112] like Fig.11 As shown, the electronic device 1100 is in the form of a general computing device. The components of the electronic device 1100 may include, but are not limited to: the at least one processing unit 1110, the at least one storage unit 1120, a bus 1130 connecting different system components (including the storage unit 1120 and the processing unit 1110), and a display unit 1140.

[0113] The storage unit stores a program code, which can be executed by the processing unit 1110, so that the processing unit 1110 performs the steps according to various exemplary embodiments of the present disclosure described in the above "Exemplary Method" section of this specification. For example, the processing unit 1110 can perform various steps of the industrial defect image generation method of the embodiment of the present disclosure.

[0114] The storage unit 1120 may include a readable medium in the form of a volatile storage unit, such as a random access storage unit (RAM) 11201 and / or a cache storage unit 11202 , and may further include a read-only storage unit (ROM) 11203 .

[0115] The storage unit 1120 may also include a program / utility 11204 having a set (at least one) of program modules 11205, such program modules 11205 including but not limited to: an operating system, one or more application programs, other program modules, and program data, each of which or some combination may include an implementation of a network environment.

[0116] Bus 1130 may represent one or more of several types of bus structures, including a memory unit bus or memory unit controller, a peripheral bus, an accelerated graphics port, a processing unit, or a local bus using any of a variety of bus architectures.

[0117] The electronic device 1100 may also communicate with one or more external devices 1200 (e.g., keyboards, pointing devices, Bluetooth devices, etc.), one or more devices that enable a user to interact with the electronic device 1100, and / or any device that enables the electronic device 1100 to communicate with one or more other computing devices (e.g., routers, modems, etc.). Such communication may be performed through an input / output (I / O) interface 1150. Furthermore, the electronic device 1100 may also communicate with one or more networks (e.g., a local area network (LAN), a wide area network (WAN), and / or a public network, such as the Internet) through a network adapter 1160. Fig.11 As shown, the network adapter 1160 communicates with other modules of the electronic device 1100 via the bus 1130. It should be understood that, although not shown in the figure, other hardware and / or software modules can be used in conjunction with the electronic device 1100, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems.

[0118] Through the description of the above implementation, it is easy for those skilled in the art to understand that the example implementation described here can be implemented by software, or by software combined with necessary hardware. Therefore, the technical solution according to the implementation of the present disclosure can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (which can be a CD-ROM, a USB flash drive, a mobile hard disk, etc.) or on a network, including several instructions to enable a computing device (which can be a personal computer, a server, a terminal device, or a network device, etc.) to execute the method according to the implementation of the present disclosure.

[0119] In addition, the above-mentioned figures are only schematic illustrations of the processes included in the method according to the exemplary embodiments of the present disclosure, and are not intended to be limiting. It is easy to understand that the processes shown in the above-mentioned figures do not indicate or limit the time sequence of these processes. In addition, it is also easy to understand that these processes can be performed synchronously or asynchronously, for example, in multiple modules.

[0120] It should be noted that, although several modules or units of the device for action execution are mentioned in the above detailed description, this division is not mandatory. In fact, according to the embodiments of the present disclosure, the features and functions of two or more modules or units described above can be embodied in one module or unit. On the contrary, the features and functions of one module or unit described above can be further divided into multiple modules or units to be embodied.

[0121] Those skilled in the art will readily appreciate other embodiments of the present disclosure after considering the specification and practicing what is disclosed herein. This application is intended to cover any variations, uses, or adaptations of the present disclosure that follow the general principles of the present disclosure and include common knowledge or customary technical means in the art that are not disclosed in the present disclosure. The specification and embodiments are to be considered merely as exemplary, and the true scope and spirit of the present disclosure are indicated by the claims.

[0122] It should be understood that the present disclosure is not limited to the exact structures that have been described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof. The scope of the present disclosure is limited only by the appended claims.

Claims

1. A method for generating an industrial defect image, characterized in that: include: Acquire an industrial defect image to be denoised; Performing an encoding process on the industrial defect image to be denoised to obtain intermediate features; wherein the encoding process includes at least one first downsampling process and at least one second downsampling process, the first downsampling process includes an operation of extracting context information, and the second downsampling process is implemented based on a Transformer structure; A decoding process is performed on the intermediate features to generate a denoised industrial defect image corresponding to the industrial defect image to be denoised; wherein the decoding process includes at least one first upsampling process and at least one second upsampling process, the first upsampling process is implemented based on a Transformer structure, and the second upsampling process includes an operation of extracting context information.

2. The industrial defect image generation method according to claim 1, characterized in that: Obtaining industrial defect images to be denoised includes: Get original industrial defect images; Performing forward diffusion on the original industrial defect image to generate a plurality of Gaussian noise images; Wherein, the industrial defect image to be denoised is any one of the multiple Gaussian noise images.

3. The industrial defect image generation method according to claim 1, characterized in that: Performing an encoding process on the industrial defect image to be denoised to obtain intermediate features, including: Performing a coding process on the industrial defect image to be denoised to generate coding features; At least one global feature extraction process is performed on the encoding feature to obtain the intermediate feature.

4. The industrial defect image generation method according to claim 3, characterized in that: The global feature extraction process is implemented based on a Transformer structure with unchanged feature map resolution.

5. The industrial defect image generation method according to claim 1, characterized in that: The first downsampling process and / or the second upsampling process are implemented based on a convolution block, the convolution block includes two residual convolution units, each of the residual convolution units includes a linear layer, a convolution layer and two context information extraction layers.

6. The industrial defect image generation method according to claim 1, characterized in that: The Transformer structure includes a multi-layer perceptron unit, a multi-head self-attention unit and a normalization operator.

7. The industrial defect image generation method according to any one of claims 1 to 6, characterized in that: The industrial defect image generation method further comprises: The encoding process is connected to the processing process having the same feature map resolution as the decoding process.

8. An industrial defect image generating device, characterized in that: include: An image acquisition module, used to acquire the industrial defect image to be denoised; An image encoding module, configured to perform an encoding process on the industrial defect image to be denoised to obtain intermediate features; wherein the encoding process includes at least one first downsampling process and at least one second downsampling process, the first downsampling process includes an operation of extracting context information, and the second downsampling process is implemented based on a Transformer structure; An image generation module is used to perform a decoding process on the intermediate features to generate a denoised industrial defect image corresponding to the industrial defect image to be denoised; wherein the decoding process includes at least one first upsampling process and at least one second upsampling process, the first upsampling process is implemented based on a Transformer structure, and the second upsampling process includes an operation of extracting context information.

9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the industrial defect image generating method according to any one of claims 1 to 7 is implemented.

10. An electronic device, characterized in that: include: processor; as well as A memory, configured to store executable instructions of the processor; The processor is configured to implement the industrial defect image generating method according to any one of claims 1 to 7 by executing the executable instructions.

Citation Information

Patent Citations

  • Data enhancement model and method suitable for power grid information attack detection

    CN116522326A

  • Workpiece surface topography generation method and device based on multi-modal image generation

    CN116977652A

  • Industrial visual anomaly detection system based on simplex diffusion model

    CN117095199A

  • Industrial defect image generation method

    CN117315387A

  • Imaging equipment positioning target defect detection method, image segmentation model and device

    CN117372395A

Cited By

  • Task pushing method and device based on foundation pit and storage medium

    CN119992447A