Zero-sample pseudo-anomaly image synthesis method and device based on cross-domain anomaly injection

By constructing a real cross-domain exception data set and using cross-domain exception injection method, the exception blocks are scaled and injected into the target image, the problem of difficult to synthesize realistic pseudo-exception images in the existing technology is solved, and efficient and economical pseudo-exception image synthesis is achieved, improving the authenticity of the image.

CN119444591BActive Publication Date: 2025-03-25NAT UNIV OF DEFENSE TECH
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202510035738.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-01-09
Publication Date
2025-03-25
Estimated Expiration
2045-01-09

AI Technical Summary

Technical Problem

The prior art is difficult to efficiently synthesize realistic pseudo-exception images without reference to specific domain anomaly images, and the existing model-based zero-sample anomaly synthesis technology requires long-term training, which is costly and cannot solve the authenticity problem.

Method used

By collecting real exception images, a real cross-domain exception data set is constructed, and using a method based on cross-domain exception injection, the exception blocks of the source image are scaled and injected into the specified locations in the target image to generate a pseudo-exception image. This method includes source-target matching and multi-scale exception synthesis to ensure that the injected exception block size is appropriate, and minimize gradient differences through Poisson editing to achieve a natural injection effect.

Benefits of technology

It realizes efficient synthesis of realistic pseudo-exception images without the need for reference to specific domain anomaly images, avoids the need for long-term training, reduces costs, and improves the authenticity of pseudo-exception images.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119444591B_ABST
    Figure CN119444591B_ABST
Patent Text Reader

Abstract

The present invention provides a zero-sample pseudo-abnormal image synthesis method and device based on cross-domain abnormal injection, comprising the following steps: collecting real abnormal images and constructing a real cross-domain abnormal data set; selecting any abnormal image in the real cross-domain abnormal data set as a source image, and obtaining a binary mask of the source image, wherein the binary mask of the source image represents the region of the abnormal block in the source image; obtaining a target image based on a given target domain normal image set, extracting the binary mask of the target image to represent the foreground; scaling the abnormal block of the source image based on the binary mask of the source image and the target image, injecting it into a designated position in the target image, and synthesizing a pseudo-abnormal image. The present invention can ensure that the scaled abnormal block can be naturally and quickly injected into the target image of the target domain to synthesize a realistic pseudo-abnormal image; and a large number of realistic pseudo-abnormal images can be generated without long-term training.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of anomaly synthesis, and in particular to a zero-sample pseudo-anomaly image synthesis method and device based on cross-domain anomaly injection. Background Art

[0002] Industrial image anomaly detection (IAD) is a research topic of great value. Due to the nature of anomalies, real anomalies (i.e., anomalies in a specific domain) are usually too rare to be collected in the modern industrial field. For example, the incidence of anomalies on mature production lines may be below 0.1%, which seriously hinders the development of IAD. Therefore, zero-shot anomaly synthesis technology (ZSAS) has become an important technology for IDA. ZSAS refers to the ability to synthesize pseudo-anomaly images without abnormal images in a specific domain. On the one hand, in the existing technology, ZSAS either crops image blocks from itself as the source of abnormal textures, or crops image blocks from existing datasets that are not related to anomaly detection as the source of anomalies; since the existing technology cannot use a simple method to seamlessly integrate the existing abnormal textures into the normal images of a specific domain to synthesize realistic pseudo-anomaly images, and since there is no reference to real abnormal textures, realistic pseudo-anomaly images cannot be obtained in the existing technology. On the other hand, existing technologies, such as diffusion-based or GAN-based model anomaly generation methods, naturally require long-term training and need to refer to abnormal images in a specific domain, and cannot achieve ZSAS; existing model-based ZSAS also requires long-term training, which is not only costly but also cannot solve the authenticity problem.

[0003] Therefore, a technical solution is needed to more efficiently synthesize more realistic abnormal images without referring to abnormal images in a specific domain. Summary of the invention

[0004] In view of the deficiencies in the prior art, the present invention provides a zero-sample pseudo-anomaly image synthesis method and device based on cross-domain anomaly injection.

[0005] To achieve the above purpose, the technical solution adopted by the present invention is as follows:

[0006] On the one hand, the present invention provides a zero-sample pseudo-anomaly image synthesis method based on cross-domain anomaly injection, comprising the following steps:

[0007] Collect real abnormal images and build a real cross-domain abnormal dataset;

[0008] Select any abnormal image in the real cross-domain abnormal dataset as the source image , and get the binary mask of the source image , the binary mask of the source image represents the abnormal blocks in the source image area;

[0009] Based on a given set of normal images in the target domain, obtain the target image , extract the target image The binary mask of Indicates prospects;

[0010] Based on the binary masks of the source image and the target image, the abnormal block of the source image is scaled and injected into a specified position in the target image to synthesize a pseudo abnormal image.

[0011] Furthermore, the collecting of real abnormal images and the construction of a real cross-domain abnormal data set include the following steps:

[0012] Collect real abnormal images;

[0013] Classify the collected real anomalies according to the anomaly type and annotate each real anomaly image with a binary mask;

[0014] Based on the classified real anomaly images annotated with binary masks, a real cross-domain anomaly dataset is constructed.

[0015] Furthermore, labeling each real abnormal image with a binary mask comprises the following steps:

[0016] For real abnormal images where binary masks cannot be directly obtained, EISeg is used for pixel-level annotation;

[0017] For a real abnormal image for which a binary mask can be directly obtained, the binary mask of the real abnormal image is directly obtained.

[0018] Further, the abnormal block scaling of the source image includes source-target matching and multi-scale abnormal synthesis;

[0019] The source-target matching includes:

[0020] Use source image The binary mask of and the target image The binary mask of Calculate the scale of the abnormal blocks of the source image separately and the scale of the foreground , and calculate the original source-target ratio ,

[0021] ;

[0022] ;

[0023] ;

[0024] in, Returns the height and width of the smallest bounding box that contains the non-zero pixels of the input binary mask;

[0025] Based on the original source-target ratio The abnormal blocks of the source image are divided into four scale types: tiny, small, medium and large; For tiny, For small, For the middle, for greatness;

[0026] Pseudo-anomaly blocks generated based on multi-scale anomaly synthesis , calculate pseudo exception block The scale , and calculate the synthetic source-target ratio ,

[0027] ;

[0028] ;

[0029] Based on the synthetic source-target ratio The pseudo-anomaly blocks are divided into three scale types: small, medium and large; For small, For the middle, for greatness;

[0030] According to the proportion Scale the abnormal block of the source image to generate a scaled abnormal block ;

[0031] Multi-scale anomaly synthesis includes:

[0032] Based on the source image, a clear number of Large, medium and small pseudo-anomaly blocks.

[0033] Furthermore, the .

[0034] Furthermore, the predetermined rule is:

[0035] Tiny outlier blocks of the source image are not used to synthesize pseudo outlier blocks;

[0036] The abnormal block of the source image cannot be synthesized into a pseudo abnormal block whose scale is larger than the scale of the abnormal block of the source image itself.

[0037] Further, the designated position in the injection target image is determined according to the following steps:

[0038] The specified location Defined as target image Inject scaled exception block center of which For the target image The coordinates of

[0039] Determine the candidate set for the specified location ;

[0040] ;

[0041] ;

[0042] ;

[0043] in, Exception block for scaling In the target image China-Israel The area occupied when it is the center; Used for judgment Is it completely contained in the target image? middle;

[0044] Select a position in the specified position candidate set as the specified position in the target image .

[0045] Further, the abnormal block of the source image is scaled and injected into a specified position in the target image according to the following steps:

[0046] The exception block that will be scaled Paste the injection into the specified position in the target image ; During the injection process, the pseudo-anomaly images are minimized according to the following method Exception block with scaling The gradient difference is:

[0047] ;

[0048] in, Processing for gradient calculation;

[0049] At the same time, according to the following formula, the area The boundaries are constrained:

[0050] ;

[0051] in, Indicates area The boundary of the injection process is realized by scaling the exception block The boundary and target image Smooth transition of region boundaries;

[0052] By foreground binary mask Filter out the abnormal blocks outside the foreground area in the injected and scaled abnormal blocks to obtain a pseudo abnormal image .

[0053] Further, the pseudo abnormal image , calculate the exception mask according to the following steps :

[0054] Calculate the pixel difference map between the pseudo-anomaly image and the target image ;

[0055] ;

[0056] Get the anomaly mask of the pseudo anomaly image ;

[0057] ;

[0058] in, For the binary processing, is the preset threshold.

[0059] On the other hand, the present invention provides a zero-sample pseudo-abnormal image synthesis device based on cross-domain abnormality injection, comprising:

[0060] The first module is used to collect real abnormal images and build a real cross-domain abnormal dataset;

[0061] The second module is used to select any abnormal image in the real cross-domain abnormal dataset as the source image , and get the binary mask of the source image , the binary mask of the source image represents the abnormal blocks in the source image area;

[0062] The third module is used to obtain the target image based on the given target domain normal image set. , extract the target image The binary mask of Indicates prospects;

[0063] The fourth module is used to scale the abnormal block of the source image based on the binary mask of the source image and the target image, and inject it into a specified position in the target image to synthesize a pseudo abnormal image.

[0064] Compared with the prior art, the technical effects that the present invention can produce are:

[0065] The zero-sample pseudo-anomaly image synthesis and device based on cross-domain anomaly injection provided by the present invention collects real anomaly images, classifies the collected real anomaly images according to the anomaly types, and annotates a binary mask for each real anomaly image, thereby efficiently constructing an expandable real cross-domain anomaly dataset.

[0066] The present invention calculates the original source-target ratio , classify the scales of the abnormal blocks, and then constrain them with predetermined rules to generate a clear number of large, medium and small pseudo abnormal blocks in turn, and calculate the synthetic source-target ratio based on the pseudo abnormal blocks ; Based on the original source-target ratio Compared with synthetic source-target ratio The scaling ratio is determined, and the abnormal block of the source image is scaled to obtain the scaled abnormal block. The pseudo abnormal block generation is constrained by a predetermined rule, thereby ensuring that the scaling ratio is appropriate and the scaled abnormal block is not too small or too blurred.

[0067] The present invention minimizes the gradient difference between the abnormal image and the scaled abnormal block in the process of pasting the scaled abnormal block into the specified position of the target image, and The boundary of the area occupied by the image when it is the center is constrained, so as to achieve a smooth transition between the boundary of the scaled abnormal block and the target image during the injection process, and ensure that the scaled abnormal block can be naturally and quickly injected into the target image of the target domain.

[0068] The zero-sample pseudo-abnormal image synthesis and device based on cross-domain abnormality injection provided by the present invention can synthesize realistic pseudo-abnormal images, and can generate a large number of realistic pseudo-abnormal images without long-term training. BRIEF DESCRIPTION OF THE DRAWINGS

[0069] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on the structures shown in these drawings without paying creative work.

[0070] Figure 1 A schematic diagram of the principle of a zero-sample pseudo-anomaly image synthesis method based on cross-domain anomaly injection provided by an embodiment;

[0071] Figure 2 A schematic diagram of a process for constructing a real cross-domain anomaly dataset provided by an embodiment. DETAILED DESCRIPTION

[0072] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0073] Reference Figure 1 An embodiment provides a zero-sample pseudo-anomaly image synthesis method based on cross-domain anomaly injection, comprising the following steps:

[0074] Collect real abnormal images and build a real cross-domain abnormal dataset;

[0075] Select any abnormal image in the real cross-domain abnormal dataset as the source image , and get the binary mask of the source image , the binary mask of the source image represents the abnormal blocks in the source image area;

[0076] Based on a given set of normal images in the target domain, obtain the target image , extract the target image The binary mask of Indicates prospects;

[0077] Based on the binary masks of the source image and the target image, the abnormal block of the source image is scaled and injected into a specified position in the target image to synthesize a pseudo abnormal image.

[0078] in, , , , , Reason The image blocks indexed by the non-zero elements of is the set of real numbers, is the size of the source image, is the size of the target image;

[0079] The target image is extracted by the following formula The binary mask of ;

[0080] ;

[0081] in, Represents the object mask returned by the cutout technique.

[0082] The method of collecting real abnormal images and constructing a real cross-domain abnormal data set includes the following steps:

[0083] Collect real abnormal images;

[0084] Classify the collected real anomalies according to the anomaly type and annotate each real anomaly image with a binary mask;

[0085] Based on the classified real anomaly images annotated with binary masks, a real cross-domain anomaly dataset is constructed.

[0086] The step of labeling each real abnormal image with a binary mask comprises the following steps:

[0087] For real abnormal images where binary masks cannot be directly obtained, EISeg is used for pixel-level annotation;

[0088] For a real abnormal image for which a binary mask can be directly obtained, the binary mask of the real abnormal image is directly obtained.

[0089] Reference Figure 2 In one embodiment, the domain-independent real anomalies are collected in the following ways: searching "industrial scratches" online on an Internet search engine to obtain real anomaly images; using common portable shooting devices, such as digital cameras or mobile phones, to take real photos to collect real anomaly images; collecting real anomaly images from existing datasets (IAD datasets). Through the above methods, a total of about 6,000 real anomaly images were collected as the data basis for building a real cross-domain anomaly dataset.

[0090] The collected real abnormal images are divided into multiple abnormal categories according to the abnormality types, including: holes, cracks, pores, stains, scratches, dents, impurities, and wear. After the collected real abnormal images are classified, a binary mask is annotated for each real abnormal image to indicate the area of ​​the abnormal block in each real abnormal image; for real abnormal images that cannot directly obtain binary masks, EISeg is used for pixel-level annotation; for real abnormal images that can directly obtain binary masks, the binary mask of the real abnormal image is directly obtained. In this way, an scalable real cross-domain abnormal dataset is efficiently constructed.

[0091] Reference Figure 1 , the abnormal block scaling of the source image includes source-target matching and multi-scale abnormal synthesis;

[0092] The source-target matching includes:

[0093] Use source image The binary mask of and the target image The binary mask of Calculate the scale of the abnormal blocks of the source image separately and the scale of the foreground , and calculate the original source-target ratio ,

[0094] ;

[0095] ;

[0096] ;

[0097] in, Returns the height and width of the smallest bounding box that contains the non-zero pixels of the input binary mask;

[0098] Based on the original source-target ratio The abnormal blocks of the source image are divided into four scale types: tiny, small, medium and large; For tiny, For small, For the middle, for greatness;

[0099] Pseudo-anomaly blocks generated based on multi-scale anomaly synthesis , calculate pseudo exception block The scale , and calculate the synthetic source-target ratio ,

[0100] ;

[0101] ;

[0102] Based on the synthetic source-target ratio The pseudo-anomaly blocks are divided into three scale types: small, medium and large; For small, For the middle, for greatness;

[0103] According to the proportion Scale the abnormal block of the source image to obtain the scaled source image and the binary mask of the scaled source image , generating scaled exception blocks .

[0104] Multi-scale anomaly synthesis includes:

[0105] Based on the source image, a clear number of Large, medium and small pseudo-anomaly blocks.

[0106] In one embodiment, .

[0107] In order to avoid inappropriate resizing of the abnormal blocks of the source image, so as to prevent the injected abnormal blocks from being too small or too blurred, a predetermined rule is used to constrain the generation of pseudo abnormal blocks. The predetermined rule is:

[0108] Tiny outlier blocks of the source image are not used to synthesize pseudo outlier blocks;

[0109] The abnormal blocks of the source image cannot be synthesized into pseudo abnormal blocks whose scale is larger than the scale of the abnormal blocks of the source image itself; for example, medium-sized abnormal blocks can be used to synthesize medium-sized and small pseudo abnormal blocks, but cannot be used to generate large pseudo abnormal blocks.

[0110] The generation of pseudo abnormal blocks is constrained by predetermined rules, which ensures the visibility and clarity of the abnormal blocks injected into the target image.

[0111] The designated position in the injection target image is determined according to the following steps:

[0112] The specified location Defined as target image Inject scaled exception block center of which For the target image The coordinates of

[0113] A legally designated location Two conditions need to be met:

[0114] (1) Because the anomalies in the foreground are more meaningful, Should be Zhongyou In the foreground area formed by the marked non-zero pixels;

[0115] (2) The scaled exception block that should satisfy the full injection Not exceeding the boundary; that is, The center of the minimum bounding box of the scaled exception block is placed at this position Will not exceed boundary range.

[0116] Therefore, according to the above conditions, the candidate set of the specified position is determined ;

[0117] ;

[0118] ;

[0119] ;

[0120] in, Exception block for scaling In the target image China-Israel The area occupied when it is the center; Used for judgment Is it completely contained in the target image? middle;

[0121] Select a position in the specified position candidate set as the specified position in the target image , .

[0122] Existing model-free ZSAS are usually injected by direct pasting or smooth blending, which can cause significant artifacts (such as pixel discontinuity or blur), thereby reducing the realism of pseudo-anomaly images; at the same time, artifacts also provide a "shortcut" for model training, distracting the IAD model from learning useful anomaly features.

[0123] The present invention introduces Poisson editing to seamlessly inject abnormal blocks into the target image to obtain a pseudo abnormal image. The abnormal blocks of the source image are scaled and injected into a specified position in the target image according to the following steps:

[0124] The exception block that will be scaled Paste the injection into the specified position in the target image ; During the injection process, the pseudo-anomaly images are minimized according to the following method Exception block with scaling The gradient difference is:

[0125] ;

[0126] in, Processing for gradient calculation;

[0127] At the same time, according to the following formula, the area The boundaries are constrained:

[0128] ;

[0129] in, Indicates area The boundary of the injection process is realized by scaling the exception block The boundary and target image Smooth transition of region boundaries;

[0130] By foreground binary mask Filter out the abnormal blocks outside the foreground area in the injected and scaled abnormal blocks to obtain a pseudo abnormal image .

[0131] For the pseudo abnormal image , calculate the exception mask according to the following steps :

[0132] Calculate the pixel difference map between the pseudo-anomaly image and the target image ;

[0133] ;

[0134] Get the anomaly mask of the pseudo anomaly image ;

[0135] ;

[0136] in, For the binary processing, is the preset threshold.

[0137] Through the above processing, a smooth transition of the regional boundary between the pseudo abnormal image and the target image during the injection process is achieved, ensuring that the scaled abnormal block can be naturally and quickly injected into the target image in the target domain, thereby generating a realistic pseudo abnormal image.

[0138] In one embodiment, a zero-sample pseudo-anomaly image synthesis device based on cross-domain anomaly injection is provided, comprising:

[0139] The first module is used to collect real abnormal images and build a real cross-domain abnormal dataset;

[0140] The second module is used to select any abnormal image in the real cross-domain abnormal dataset as the source image , and get the binary mask of the source image , the binary mask of the source image represents the abnormal blocks in the source image area;

[0141] The third module is used to obtain the target image based on the given target domain normal image set. , extract the target image The binary mask of Indicates prospects;

[0142] The fourth module is used to scale the abnormal block of the source image based on the binary mask of the source image and the target image, and inject it into a specified position in the target image to synthesize a pseudo abnormal image.

[0143] Matters not covered by the present invention are known technologies.

[0144] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0145] The above-described embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the invention. It should be pointed out that, for a person of ordinary skill in the art, several modifications and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the attached claims.

[0146] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. For those skilled in the art, the present invention may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.

Claims

1. A zero-sample pseudo-anomaly image synthesis method based on cross-domain anomaly injection, characterized in that: The following steps are involved: Collect real abnormal images and build a real cross-domain abnormal dataset; Select any abnormal image in the real cross-domain abnormal dataset as the source image , and get the binary mask of the source image , the binary mask of the source image represents the abnormal blocks in the source image area; Based on a given set of normal images in the target domain, obtain the target image , extract the target image The binary mask of Indicates prospects; Based on the binary masks of the source image and the target image, the abnormal block of the source image is scaled and injected into a specified position in the target image to synthesize a pseudo abnormal image; The abnormal block scaling of the source image includes source-target matching and multi-scale abnormal synthesis; The source-target matching includes: Use source image The binary mask of and the target image The binary mask of Calculate the scale of the abnormal blocks of the source image separately and the scale of the foreground , and calculate the original source-target ratio , ; ; ; in, Returns the height and width of the smallest bounding box that contains the non-zero pixels of the input binary mask; Based on the original source-target ratio The abnormal blocks of the source image are divided into four scale types: tiny, small, medium and large; For tiny, For small, For the middle, for greatness; Pseudo-anomaly blocks generated based on multi-scale anomaly synthesis , calculate pseudo exception block The scale , and calculate the synthetic source-target ratio , ; ; Based on the synthetic source-target ratio The pseudo-anomaly blocks are divided into three scale types: small, medium and large; For small, For the middle, for greatness; According to the proportion Scale the abnormal block of the source image to generate a scaled abnormal block ; Multi-scale anomaly synthesis includes: Based on the source image, a clear number of Large, medium and small pseudo-anomaly blocks.

2. The zero-sample pseudo-anomaly image synthesis method based on cross-domain anomaly injection as claimed in claim 1, characterized in that: The method of collecting real abnormal images and constructing a real cross-domain abnormal data set includes the following steps: Collect real abnormal images; Classify the collected real anomalies according to the anomaly type and annotate each real anomaly image with a binary mask; Based on the classified real anomaly images annotated with binary masks, a real cross-domain anomaly dataset is constructed.

3. The zero-sample pseudo-anomaly image synthesis method based on cross-domain anomaly injection as claimed in claim 2, characterized in that: The step of labeling each real abnormal image with a binary mask comprises the following steps: For real abnormal images where binary masks cannot be directly obtained, EISeg is used for pixel-level annotation; For a real abnormal image for which a binary mask can be directly obtained, the binary mask of the real abnormal image is directly obtained.

4. The zero-sample pseudo-anomaly image synthesis method based on cross-domain anomaly injection as claimed in claim 1, characterized in that: Said .

5. The zero-sample pseudo-anomaly image synthesis method based on cross-domain anomaly injection according to claim 1, characterized in that: The predetermined rules are: Tiny outlier blocks of the source image are not used to synthesize pseudo outlier blocks; The abnormal block of the source image cannot be synthesized into a pseudo abnormal block whose scale is larger than the scale of the abnormal block of the source image itself.

6. The zero-sample pseudo-anomaly image synthesis method based on cross-domain anomaly injection as claimed in claim 1, characterized in that: The designated position in the injection target image is determined according to the following steps: The specified location Defined as target image Inject scaled exception block center of which For the target image The coordinates of Determine the candidate set for the specified location , ; ; ; in, Exception block for scaling In the target image China-Israel The area occupied when it is the center; Used for judgment Is it completely contained in the target image? middle; Select a position from the specified position candidate set as the specified position in the target image .

7. The zero-sample pseudo-anomaly image synthesis method based on cross-domain anomaly injection as claimed in claim 1, characterized in that: The abnormal block of the source image is scaled and injected into the specified position of the target image according to the following steps: The exception block that will be scaled Paste the injection into the specified position in the target image ; During the injection process, the pseudo-anomaly images are minimized according to the following method Exception block with scaling The gradient difference is: ; in, Processing for gradient calculation; At the same time, according to the following formula, the area The boundaries are constrained: ; in, Indicates area The boundary of the injection process is realized by scaling the exception block The boundary and target image Smooth transition of the border; By foreground binary mask Filter out the abnormal blocks outside the foreground area in the injected scaled abnormal blocks to obtain a pseudo abnormal image .

8. The zero-sample pseudo-anomaly image synthesis method based on cross-domain anomaly injection as claimed in claim 7, characterized in that: For the pseudo abnormal image , calculate the exception mask according to the following steps : Calculate the pixel difference map between the pseudo-anomaly image and the target image , ; Get the anomaly mask of the pseudo anomaly image , ; in, For the binary processing, is the preset threshold.

9. A zero-sample pseudo-anomaly image synthesis device based on cross-domain anomaly injection, characterized in that: include: The first module is used to collect real abnormal images and build a real cross-domain abnormal dataset; The second module is used to select any abnormal image in the real cross-domain abnormal dataset as the source image , and get the binary mask of the source image , the binary mask of the source image represents the abnormal blocks in the source image area; The third module is used to obtain the target image based on the given target domain normal image set. , extract the target image The binary mask of Indicates prospects; A fourth module is used to scale the abnormal block of the source image based on the binary mask of the source image and the target image, and inject it into a specified position in the target image to synthesize a pseudo abnormal image; The abnormal block scaling of the source image includes source-target matching and multi-scale abnormal synthesis; The source-target matching includes: Use source image The binary mask of and the target image The binary mask of Calculate the scale of the abnormal blocks of the source image separately and the scale of the foreground , and calculate the original source-target ratio , ; ; ; in, Returns the height and width of the smallest bounding box that contains the non-zero pixels of the input binary mask; Based on the original source-target ratio The abnormal blocks of the source image are divided into four scale types: tiny, small, medium and large; For tiny, For small, For the middle, for greatness; Pseudo-anomaly blocks generated based on multi-scale anomaly synthesis , calculate pseudo exception block The scale , and calculate the synthetic source-target ratio , ; ; Based on the synthetic source-target ratio The pseudo-anomaly blocks are divided into three scale types: small, medium and large; For small, For the middle, for greatness; According to the proportion Scale the abnormal block of the source image to generate a scaled abnormal block ; Multi-scale anomaly synthesis includes: Based on the source image, a clear number of Large, medium and small pseudo-anomaly blocks.

Citation Information

Patent Citations

  • Restoration type self-supervision defect detection method and device and storage medium

    CN116563250A

  • Manipulable object synthesis in 3D medical images with structured image decomposition

    US20210082107A1