High-quality industrial abnormal data synthesis method

Through the hybrid exception decoupling module, high-quality exception mask generation module and automatic exception data set generation module, the problem of difficulty in generating complex exception images in the existing technology is solved, and the performance improvement of high-quality exception data synthesis and industrial exception detection tasks is achieved.

CN119762908AActive Publication Date: 2025-04-04XIAMEN UNIV
View PDF 6 Cites 0 Cited by

Patent Information

Application Number
CN202411811506.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-10
Publication Date
2025-04-04
Estimated Expiration
2044-12-10

AI Technical Summary

Technical Problem

Existing industrial anomaly data synthesis methods are difficult to generate complex anomaly images, especially when it involves logical relationships or multiple types of abnormalities. The generated anomaly images and masks have poor quality and require manual filtering.

Method used

The hybrid exception decoupling module, high-quality exception mask generation module and automatic exception data set generation module are adopted to decouple the exception categories through multiple rounds of dialogue through visual language model, generate exception masks that are aligned with attributes, and synthesize high-quality exception images and mask pairs through Textual Inversion method and automatic filters.

Benefits of technology

The performance of industrial anomaly detection, positioning and classification tasks has been significantly improved, and the generated anomaly data performs excellently in the classification, positioning and detection tasks on the MvTec-AD dataset.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119762908A_ABST
    Figure CN119762908A_ABST
Patent Text Reader

Abstract

The invention discloses a high-quality industrial abnormal data synthesis method, which comprises the following steps of S1, performing multiple rounds of dialogues through a visual language model by adopting a hybrid anomaly decoupling module, and decoupling coupled anomaly categories in an abnormal data set, so that the coupled anomaly categories are converted into categories and attributes with finer granularity; s2, a high-quality abnormal mask generation module is adopted, and abnormal masks which are aligned with various attributes, accurate in position and normal in shape are generated through an abnormal mask generator, a guide area Printer and an abnormal mask locator; s3, synthesizing and screening out a high-quality abnormal image and mask pair by adopting an automatic abnormal data set generation module through a Textual Inversion method and an automatic filter; according to the method, synthesis of a high-quality abnormal image and a mask pair is realized through a mixed anomaly decoupling module, a high-quality abnormal mask generation module and an automatic abnormal data set generation module.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of computer vision and artificial intelligence, and in particular relates to a method for synthesizing high-quality industrial abnormal data. Background Art

[0002] Anomaly detection algorithms in industrial manufacturing play a key role and usually involve tasks such as anomaly detection, localization, and classification. Due to the scarcity of anomaly data, most industrial anomaly detection methods rely on unsupervised learning methods, where single-class classifiers are trained using only normal data, or rely on supervised learning methods that utilize a small amount of anomaly data. Although these algorithms perform well in anomaly detection, they often have limitations in anomaly localization tasks and cannot handle anomaly classification tasks. Therefore, it is becoming increasingly urgent to solve the problem of scarce anomaly data. The emergence of anomaly data synthesis methods provides a new way to alleviate this problem by expanding the anomaly dataset to enhance the robustness of supervised models. At present, researchers have proposed various anomaly data synthesis techniques, including traditional model-free methods, methods based on generative adversarial networks (GANs), and methods based on diffusion models.

[0003] Despite the great potential of these methods, existing methods face several major challenges: (1) Existing methods mainly focus on generating simple structural anomaly images, such as object damage or surface scratches; however, they often perform poorly for more complex anomaly image generation tasks, especially those involving logical relationships or containing multiple types of combined anomalies. (2) Most existing methods focus on generating anomaly images and ignore the key task of generating image and mask pairs. Some methods have difficulty in accurately aligning the anomaly part with its corresponding mask, and some methods generate masks with irregular shapes and fail to correctly locate the anomaly part. (3) Due to the inherent uncertainty of the generation model, the quality of the generated anomaly image and mask pairs is poor, and it needs to rely on labor-intensive manual screening to solve. Therefore, existing industrial anomaly data synthesis methods are difficult to meet actual usage needs. Summary of the invention

[0004] To solve the above problems, the present invention proposes a method for synthesizing high-quality industrial anomaly data. The method realizes the synthesis of high-quality anomaly images and mask pairs through a hybrid anomaly decoupling module, a high-quality anomaly mask generation module and an automatic anomaly dataset generation module. The synthesized anomaly data significantly improves the performance in downstream tasks such as industrial anomaly detection, positioning and classification.

[0005] To achieve the above object, the present invention adopts the following technical solutions:

[0006] A method for synthesizing high-quality industrial abnormal data comprises the following steps:

[0007] S1. Using the hybrid anomaly decoupling module, we conduct multiple rounds of dialogues through the visual language model to decouple the coupled anomaly categories in the anomaly dataset and transform the coupled anomaly categories into more fine-grained categories and attributes.

[0008] S2, using a high-quality exception mask generation module, through an exception mask generator, a guide region Printer and an exception mask locator, to generate an exception mask that is aligned with various attributes, has an accurate position and a normal shape;

[0009] S3, using the automatic anomaly dataset generation module, synthesizes and screens high-quality anomaly images and mask pairs through the Textual Inversion method and automatic filters.

[0010] Preferably, the specific process of step S1 is:

[0011] S11, abnormal image I sampled from the abnormal dataset a and its corresponding mask M a , input into the mixed anomaly decoupling module,

[0012] S12, based on abnormal image I a We design K sets of tailor-made prompts for each abnormal category in the dataset. Each set of prompts contains two different questions. Each question is personalized according to the specific abnormal category and attribute. The i-th prompt set is defined as:

[0013]

[0014] Among them, P i represents the i-th prompt set; represents the first round of prompts in the i-th prompt set; T1 represents the description of the category refinement task; C1,…,C N S represents the fine-grained anomaly category obtained by analyzing the mixed anomaly category; c represents the category selection constraint; represents the second round of prompts in the i-th prompt set; T2 represents the description of the attribute refinement task; A1, A2, A3 represent the description of abnormal attributes, which are used to represent structural abnormalities, logical abnormalities, and combined abnormalities respectively; S a Represents attribute selection constraints;

[0015] S13, abnormal image I a , mask M aThe prompt set P is input into the visual language model GPT-4, and K rounds of independent two-stage dialogue are carried out; in each round of dialogue, the visual language model GPT-4 outputs the category and attribute corresponding to the abnormal area in the mask; then, through the voting mechanism, the most frequently occurring result is selected as the final category C and attribute A, and all mixed abnormal categories are decomposed into fine-grained categories and abnormal attributes;

[0016] S14. Output dictionary D a = {I a :(M a ,C,A)} i , dictionary D a Used for high-quality anomaly mask generation module and automatic anomaly dataset generation module.

[0017] Preferably, the high-quality anomaly mask generation module in step S2 includes an AM-Generator component, a GA-RegionPrinter component and an AM-Locator component. The specific process of step S2 is:

[0018] S21, using the AM-Generator component as a mask generator based on the morphological transformation method to generate diverse structural anomaly masks;

[0019] S22, using GA-RegionPrinter component to segment the guided abnormal region of the normal sample to solve the misalignment problem between the abnormal mask and the object;

[0020] S23, using the AM-Locator component based on the exception category and attribute dictionary D obtained from the hybrid exception decoupling module a , using different region-guided strategies to synthesize high-quality anomaly masks.

[0021] Preferably, the specific process of step S21 is:

[0022] S211, mask structure optimization: For the input structural anomaly mask M, a preliminary closing operation is first performed to optimize the mask, including a dilation operation to fill small holes and connect broken areas, followed by an erosion operation to smooth the boundaries and remove tiny noise points, and then the outer contour of the mask is extracted and polygonal approximation and random perturbations are applied to generate new shape variants to enhance the diversity of mask data. The mask structure optimization process is expressed as:

[0023]

[0024] Among them, M opt represents the optimized structural mask; B1 represents the structural element used for dilation operation; B2 represents the structural element used for corrosion operation; M represents the structural anomaly mask; represents the expansion operation; represents the corrosion operation; ε represents the approximation accuracy; F(·) represents the contour extraction function; P(·,ε) represents the polygon approximation function; ΔP represents the random perturbation vector within the perturbation range;

[0025] S212, mask distribution optimization: generate anomaly mask M opt Adaptively adjust to correct the deviation so that the generated anomaly mask M opt Area A M The distribution of abnormal areas is consistent with that of the corresponding category; for areas much smaller than the average abnormal area A of the corresponding category avg The exception mask M opt , by applying the scaling factor to optimize, we get the distribution-optimized anomaly mask M G , the mask distribution optimization process is expressed as:

[0026]

[0027] Among them, M G represents the exception mask after distribution optimization; M opt represents the generated anomaly mask; α represents the adjustment parameter; A avg Indicates the average abnormal area of ​​the corresponding category; A M Indicates the generated exception mask M opt area.

[0028] Preferably, the specific process of step S22 is:

[0029] S221, by analyzing the distribution of abnormal patterns in different object categories, setting a predefined guide abnormal area for each object category

[0030] S222, use SAM to segment all models to segment the guide abnormal region R from 3 to 5 normal samples of the same object category j ;

[0031] S223, the segmented guide abnormal area R j As a hint for the SegGPT segmentation context model, it is used to infer the guided abnormal region R in the remaining normal samples of the object category. j , and generate each guide abnormal region R in all normal samples j Mask

[0032] S224, set all masks Together they form a set M regions , used for anomaly mask localization in the subsequent AM-Locator component.

[0033] Preferably, the specific process of step S23 is:

[0034] S231, for the structural anomaly attribute A, according to its anomaly category C, from the set M regions Retrieve the corresponding guided abnormal region mask MR from j ; Then from the exception mask M G Randomly select an exception mask M from g , and adjust the anomaly mask M using different region guidance strategies according to the anomaly category C g The location of the region guidance strategy includes the exception mask M g Randomly place mask MR in the guided abnormal area j Internally, randomly mask the exception M g Embedded in the guide abnormal region mask MR j Or set the exception mask M g and guide abnormal region mask MR j Align the center points of struct ;

[0035] S232: For the logical anomaly attribute A, directly use the guide anomaly region mask MR j As a logical exception mask M logic ;

[0036] S233. For the combined abnormal attribute A, according to the dictionary D a Get all decoupled fine-grained categories; randomly extract and construct different abnormal combinations from the decoupled fine-grained categories, and then merge non-overlapping mask combinations to generate a combined abnormal mask M combined .

[0037] Preferably, the specific process of step S3 is:

[0038] S31. Abnormal image generation: For each decoupled fine-grained abnormal category C j , using exception embedding The appearance information of abnormal samples is extracted by masked texture inversion method; all fine-grained abnormal categories C j Share a common position encoder E; for a pair of image masks (G j ,M j ), the exception mask M j Input into the position encoder E to obtain the position embedding e L =E(M j ), and then embed the exception and position embedding L Fusion forms fusion abnormal embedding The fused anomaly embedding e is used as the text condition of the diffusion model to guide the anomaly image generation process;

[0039] S32. Automatic anomaly filtering: using feature extractor F β Normal features are extracted from normal samples, and Gaussian noise is added to these normal features to simulate abnormal features, training the binary abnormal discriminator B D ; Then from the generated abnormal image-mask pair (I G ,M G ) and input the extracted features into the binary anomaly discriminator B D To obtain the anomaly score map S, the quality of the generated anomaly image-mask pair is evaluated by the anomaly region score, and the calculation formula is:

[0040]

[0041] Where ARS represents the abnormal region score; i represents the horizontal coordinate in the abnormal score map; j represents the vertical coordinate in the abnormal score map; H represents the height of the image; W represents the width of the image; U(·) represents upsampling; B D (·) represents a binary anomaly discriminator; F β (·) represents feature extractor; I G represents an abnormal image; ⊙ represents dot product; M G represents the abnormal mask; (i, j) represents the horizontal and vertical coordinates of each position in the abnormal score map; then the top K aligned high-quality abnormal image-mask pairs are automatically filtered out based on the abnormal area score.

[0042] After adopting the above technical scheme, the present invention has the following beneficial effects: the present invention realizes the synthesis of high-quality abnormal images and mask pairs through a hybrid abnormal decoupling module, a high-quality abnormal mask generation module and an automatic abnormal data set generation module, and the synthesized abnormal data significantly improves the performance in downstream tasks such as industrial abnormality detection, positioning and classification. Specifically, the hybrid abnormal decoupling module can decouple the coupled abnormal data set into more fine-grained categories and attributes, thereby enhancing the model's ability to generate complex abnormal images and mask pairs; the high-quality abnormal mask generation module can synthesize a large number of high-quality abnormal masks through the abnormal mask generator, the guide area Printer and the abnormal mask locator in sequence; the automatic abnormal data set generation module can synthesize and screen a large number of high-quality abnormal images and mask pairs through the Textual Inversion method and an automatic filter. The abnormal data synthesized by the high-quality industrial abnormal data synthesis method (GAA) proposed in the present invention has achieved excellent results in classification, positioning and detection tasks on the MvTec-AD dataset. BRIEF DESCRIPTION OF THE DRAWINGS

[0043] Figure 1 is a flow chart of the present invention;

[0044] Figure 2 It is a schematic diagram of the process framework of the present invention. DETAILED DESCRIPTION

[0045] In order to make the purpose, technical solution and advantages of the present invention more clearly understood, the present invention is further described in detail below in conjunction with the embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not used to limit the present invention.

[0046] like Figure 1 to Figure 2 As shown, a high-quality industrial abnormal data synthesis method includes the following steps:

[0047] S1. Using the hybrid anomaly decoupling module, we conduct multiple rounds of dialogues through the visual language model to decouple the coupled anomaly categories in the anomaly dataset and transform the coupled anomaly categories into more fine-grained categories and attributes.

[0048] The specific process of step S1 is:

[0049] S11, abnormal image I sampled from the abnormal dataset a and its corresponding mask M a , input into the mixed anomaly decoupling module,

[0050] S12, based on abnormal image I a We design K sets of tailor-made prompts for each abnormal category in the dataset. Each set of prompts contains two different questions. Each question is personalized according to the specific abnormal category and attribute. The i-th prompt set is defined as:

[0051]

[0052] Among them, P i represents the i-th prompt set; represents the first round of prompts in the i-th prompt set; T1 represents the description of the category refinement task; C1,…,C N S represents the fine-grained anomaly category obtained by analyzing the mixed anomaly category; c represents the category selection constraint; represents the second round of prompts in the i-th prompt set; T2 represents the description of the attribute refinement task; A1, A2, A3 represent the description of abnormal attributes, which are used to represent structural abnormalities, logical abnormalities, and combined abnormalities respectively; S a Represents attribute selection constraints;

[0053] S13, abnormal image I a , mask M aThe prompt set P is input into the visual language model GPT-4, and K rounds of independent two-stage dialogue are carried out; in each round of dialogue, the visual language model GPT-4 outputs the category and attribute corresponding to the abnormal area in the mask; then, through the voting mechanism, the most frequently occurring result is selected as the final category C and attribute A, and all mixed abnormal categories are decomposed into fine-grained categories and abnormal attributes;

[0054] S14. Output dictionary D a = {I a :(M a ,C,A)} i , dictionary D a For high-quality anomaly mask generation module and automatic anomaly dataset generation module;

[0055] S2, using a high-quality exception mask generation module, through an exception mask generator, a guide region Printer and an exception mask locator, to generate an exception mask that is aligned with various attributes, has an accurate position and a normal shape;

[0056] The high-quality anomaly mask generation module in step S2 includes an AM-Generator component, a GA-RegionPrinter component, and an AM-Locator component. The specific process of step S2 is as follows:

[0057] S21, using the AM-Generator component as a mask generator based on the morphological transformation method to generate diverse structural anomaly masks;

[0058] The specific process of step S21 is:

[0059] S211, mask structure optimization: For the input structural anomaly mask M, a preliminary closing operation is first performed to optimize the mask, including a dilation operation to fill small holes and connect broken areas, followed by an erosion operation to smooth the boundaries and remove tiny noise points, and then the outer contour of the mask is extracted and polygonal approximation and random perturbations are applied to generate new shape variants to enhance the diversity of mask data. The mask structure optimization process is expressed as:

[0060]

[0061] Among them, M opt represents the optimized structural mask; B1 represents the structural element used for dilation operation; B2 represents the structural element used for corrosion operation; M represents the structural anomaly mask; represents the expansion operation; represents the corrosion operation; ε represents the approximation accuracy; F(·) represents the contour extraction function; P(·,ε) represents the polygon approximation function; ΔP represents the random perturbation vector within the perturbation range;

[0062] S212, mask distribution optimization: generate anomaly mask M opt Adaptively adjust to correct the deviation so that the generated anomaly mask M opt Area A M The distribution of abnormal areas is consistent with that of the corresponding category; for areas much smaller than the average abnormal area A of the corresponding category avg The exception mask M opt , by applying the scaling factor to optimize, we get the distribution-optimized anomaly mask M G , the mask distribution optimization process is expressed as:

[0063]

[0064] Among them, M G represents the exception mask after distribution optimization; M opt represents the generated anomaly mask; α represents the adjustment parameter; A avg Indicates the average abnormal area of ​​the corresponding category; A M Indicates the generated exception mask M opt area;

[0065] S22, using GA-RegionPrinter component to segment the guided abnormal region of the normal sample to solve the misalignment problem between the abnormal mask and the object;

[0066] The specific process of step S22 is:

[0067] S221, by analyzing the distribution of abnormal patterns in different object categories, setting a predefined guide abnormal area for each object category

[0068] S222, use SAM to segment all models to segment the guide abnormal region R from 3 to 5 normal samples of the same object category j ;

[0069] S223, the segmented guide abnormal area R j As a hint for the SegGPT segmentation context model, it is used to infer the guided abnormal region R in the remaining normal samples of the object category. j , and generate each guide abnormal region R in all normal samples j Mask

[0070] S224, set all masks Together they form a set M regions , used for anomaly mask localization in the subsequent AM-Locator component;

[0071] S23, using the AM-Locator component based on the exception category and attribute dictionary D obtained from the hybrid exception decoupling module a , synthesize high-quality anomaly masks using different region-guided strategies;

[0072] The specific process of step S23 is:

[0073] S231, for the structural anomaly attribute A, according to its anomaly category C, from the set M regions Retrieve the corresponding guided abnormal region mask MR from j ; Then from the exception mask M G Randomly select an exception mask M from g , and adjust the anomaly mask M using different region guidance strategies according to the anomaly category C g The location of the region guidance strategy includes the exception mask M g Randomly place mask MR in the guided abnormal area j Internally, randomly mask the exception M g Embedded in the guide abnormal region mask MR j Or set the exception mask M g and guide abnormal region mask MR j Align the center points of struct ;

[0074] S232: For the logical anomaly attribute A, directly use the guide anomaly region mask MR j As a logical exception mask M logic ;

[0075] S233. For the combined abnormal attribute A, according to the dictionary D a Get all decoupled fine-grained categories; randomly extract and construct different abnormal combinations from the decoupled fine-grained categories, and then merge non-overlapping mask combinations to generate a combined abnormal mask M combined ;

[0076] S3, using the automatic anomaly dataset generation module, synthesizes and screens high-quality anomaly images and mask pairs through the Textual Inversion method and automatic filters;

[0077] The specific process of step S3 is:

[0078] S31. Abnormal image generation: For each decoupled fine-grained abnormal category C j , using exception embedding The appearance information of abnormal samples is extracted by masked texture inversion method; all fine-grained abnormal categories C jShare a common position encoder E; for a pair of image masks (G j ,M j ), the exception mask M j Input into the position encoder E to obtain the position embedding e L =E(M j ), and then embed the exception and position embedding L Fusion forms fusion abnormal embedding The fused anomaly embedding e is used as the text condition of the diffusion model to guide the anomaly image generation process;

[0079] S32. Automatic anomaly filtering: using feature extractor F β Normal features are extracted from normal samples, and Gaussian noise is added to these normal features to simulate abnormal features, training the binary abnormal discriminator B D ; Then from the generated abnormal image-mask pair (I G ,M G ) and input the extracted features into the binary anomaly discriminator B D To obtain the anomaly score map S, the quality of the generated anomaly image-mask pair is evaluated by the anomaly region score, and the calculation formula is:

[0080]

[0081] Where ARS represents the abnormal region score; i represents the horizontal coordinate in the abnormal score map; j represents the vertical coordinate in the abnormal score map; H represents the height of the image; W represents the width of the image; U(·) represents upsampling; B D (·) represents a binary anomaly discriminator; F β (·) represents feature extractor; I G represents an abnormal image; ⊙ represents dot product; M G represents the abnormal mask; (i, j) represents the horizontal and vertical coordinates of each position in the abnormal score map; then the top K aligned high-quality abnormal image-mask pairs are automatically filtered out based on the abnormal area score.

[0082] The effect of the present invention is further illustrated by the following simulation experiment.

[0083] 1) Simulation conditions

[0084] The present invention is developed on the Ubuntu platform, and the developed deep learning framework is based on Pytorch. The main language used in the present invention is Python.

[0085] 2) Simulation content

[0086] The experimental settings are as follows: a. Generate model training with an initial learning rate of 5e-3 , the batch size is 4, and the number of training steps is more than 310000 steps. b. The training of automatic filter, using Adam optimizer, the learning rate for the discriminator is 0.0002, the learning rate for the feature adapter is 0.0001, and the weight decay is set to 0.00001, and the training is carried out for 160 epochs with a batch size of 4.

[0087] Take the MVTec-AD dataset, train the network according to the above steps and experimental settings, and test it using the test set. In order to verify the effectiveness of the method, multiple metrics are used: (1) For the evaluation of anomaly generation, Inception Score (IS) and Intra-cluster Pairwise LPIPSDistance (IC-LPIPS) are used to evaluate the authenticity and diversity of the generated anomaly images. The Abnormal Region Score (ARS) is used to evaluate the quality of the synthesized image-mask pairs. (2) For the evaluation of anomaly detection, the area under the receiver operating characteristic curve (AUROC), average precision (AP) and maximum F1 score (F1-max) are used to evaluate the accuracy of detection and localization. The accuracy of the classification task (ACC) is also used to evaluate the accuracy of classification.

[0088] Table 1 shows the test results of the high-quality industrial abnormal data synthesis method (GAA) of the present invention and three other methods, namely Cut-Pastc, DFMGAN, and Anodiff, on the MVTec-AD dataset.

[0089] Table 1: Test results of GAA, Cut-Pastc, DFMGAN, and Anodiff on the MVTec-AD dataset

[0090]

[0091] It can be seen from the test results in Table 1 that the high-quality industrial abnormal data synthesis method (GAA) of the present invention has the best effect compared with the other three methods, namely Cut-Pastc, DFMGAN and Anodiff.

[0092] Table 2: Performance comparison results on the anomaly detection task of image sets

[0093]

[0094] Table 2 shows the performance comparison of the U-Net segmentation model trained on downstream tasks using the abnormal data synthesized by the high-quality industrial abnormal data synthesis method (GAA) of the present invention and the data generated by other abnormal synthesis methods on the abnormal detection task of the image set. Compared with other methods, GAA has the best effect.

[0095] Table 3: Performance comparison results on the pixel-level anomaly localization task

[0096]

[0097] Table 3 is a performance comparison of the U-Net segmentation model trained on downstream tasks using the abnormal data synthesized by the high-quality industrial abnormal data synthesis method (GAA) of the present invention and the data generated by other abnormal synthesis methods in the task of pixel-level anomaly localization.

[0098] Table 4: Performance comparison results on anomaly classification tasks

[0099]

[0100] Table 4 is a performance comparison of the ResNet-18 segmentation model trained on downstream tasks using the abnormal data synthesized by the high-quality industrial abnormal data synthesis method (GAA) of the present invention and the data generated by other abnormal synthesis methods in the abnormal classification task.

[0101] Table 5: Performance comparison results on the downstream task of anomaly localization

[0102]

[0103] Table 5 shows the performance comparison (AUROC-Pixel / AP) of the U-Net model trained with abnormal data synthesized by the high-quality industrial abnormal data synthesis method (GAA) of the present invention and other anomaly detection methods in the downstream task of anomaly localization.

[0104] The above is only a preferred specific embodiment of the present invention, but the protection scope of the present invention is not limited thereto. Any changes or substitutions that can be easily thought of by a person skilled in the art within the technical scope disclosed by the present invention should be included in the protection scope of the present invention. Therefore, the protection scope of the present invention should be based on the protection scope of the claims.

Claims

1. A method for synthesizing high-quality industrial abnormal data, characterized in that: The following steps are involved: S1. Using the hybrid anomaly decoupling module, we conduct multiple rounds of dialogues through the visual language model to decouple the coupled anomaly categories in the anomaly dataset and transform the coupled anomaly categories into more fine-grained categories and attributes. S2, using a high-quality exception mask generation module, through an exception mask generator, a guide region Printer and an exception mask locator, to generate an exception mask that is aligned with various attributes, has an accurate position and a normal shape; S3, using the automatic anomaly dataset generation module, synthesizes and screens high-quality anomaly images and mask pairs through the Textual Inversion method and automatic filters.

2. A high-quality industrial abnormal data synthesis method as claimed in claim 1, characterized in that: The specific process of step S1 is: S11, abnormal image I sampled from the abnormal dataset a and its corresponding mask M a , input into the mixed anomaly decoupling module, S12, based on abnormal image I a We design K sets of tailor-made prompts for each abnormal category in the dataset. Each set of prompts contains two different questions. Each question is personalized according to the specific abnormal category and attribute. The i-th prompt set is defined as: Among them, P i represents the i-th prompt set; represents the first round of prompts in the i-th prompt set; T1 represents the description of the category refinement task; C1,…,C N S represents the fine-grained anomaly category obtained by analyzing the mixed anomaly category; c represents the category selection constraint; represents the second round of prompts in the i-th prompt set; T2 represents the description of the attribute refinement task; A1, A2, A3 represent the description of abnormal attributes, which are used to represent structural abnormalities, logical abnormalities, and combined abnormalities respectively; S a Represents attribute selection constraints; S13, abnormal image I a , mask M a The prompt set P is input into the visual language model GPT-4, and K rounds of independent two-stage dialogue are carried out; in each round of dialogue, the visual language model GPT-4 outputs the category and attribute corresponding to the abnormal area in the mask; then, through the voting mechanism, the most frequently occurring result is selected as the final category C and attribute A, and all mixed abnormal categories are decomposed into fine-grained categories and abnormal attributes; S14. Output dictionary D a = {I a :(M a ,C,A)} i , dictionary D a Used for high-quality anomaly mask generation module and automatic anomaly dataset generation module.

3. A high-quality industrial abnormal data synthesis method as claimed in claim 2, characterized in that: The high-quality anomaly mask generation module in step S2 includes an AM-Generator component, a GA-RegionPrinter component, and an AM-Locator component. The specific process of step S2 is as follows: S21, using the AM-Generator component as a mask generator based on the morphological transformation method to generate diverse structural anomaly masks; S22, using GA-RegionPrinter component to segment the guided abnormal region of the normal sample to solve the misalignment problem between the abnormal mask and the object; S23, using the AM-Locator component based on the exception category and attribute dictionary D obtained from the hybrid exception decoupling module a , using different region-guided strategies to synthesize high-quality anomaly masks.

4. A high-quality industrial abnormal data synthesis method as claimed in claim 3, characterized in that: The specific process of step S21 is: S211, mask structure optimization: For the input structural anomaly mask M, a preliminary closing operation is first performed to optimize the mask, including a dilation operation to fill small holes and connect broken areas, followed by an erosion operation to smooth the boundaries and remove tiny noise points, and then the outer contour of the mask is extracted and polygonal approximation and random perturbations are applied to generate new shape variants to enhance the diversity of mask data. The mask structure optimization process is expressed as: Among them, M opt represents the optimized structural mask; B1 represents the structural element used for dilation operation; B2 represents the structural element used for corrosion operation; M represents the structural anomaly mask; represents the expansion operation; represents the corrosion operation; ε represents the approximation accuracy; F(·) represents the contour extraction function; P(·,ε) represents the polygon approximation function; ΔP represents the random perturbation vector within the perturbation range; S212, mask distribution optimization: generate anomaly mask M opt Adaptively adjust to correct the deviation so that the generated anomaly mask M opt Area A M The distribution of abnormal areas is consistent with that of the corresponding category; for areas much smaller than the average abnormal area A of the corresponding category avg The exception mask M opt , by applying the scaling factor to optimize, we get the distribution-optimized anomaly mask M G , the mask distribution optimization process is expressed as: Among them, M G Represents the exception mask after distribution optimization; M opt represents the generated anomaly mask; α represents the adjustment parameter; A avg Indicates the average abnormal area of ​​the corresponding category; A M Indicates the generated exception mask M opt area.

5. A high-quality industrial abnormal data synthesis method as claimed in claim 4, characterized in that: The specific process of step S22 is: S221, by analyzing the distribution of abnormal patterns in different object categories, setting a predefined guide abnormal area for each object category S222, use SAM to segment all models to segment the guide abnormal region R from 3 to 5 normal samples of the same object category j ; S223, the segmented guide abnormal area R j As a hint for the SegGPT segmentation context model, it is used to infer the guided abnormal region R in the remaining normal samples of the object category. j , and generate each guide abnormal region R in all normal samples j Mask S224, set all masks Together they form a set M regions , used for anomaly mask localization in the subsequent AM-Locator component.

6. A high-quality industrial abnormal data synthesis method as claimed in claim 5, characterized in that: The specific process of step S23 is: S231, for the structural anomaly attribute A, according to its anomaly category C, from the set M regions Retrieve the corresponding guided abnormal region mask MR from j ; Then from the exception mask M G Randomly select an exception mask M from g , and adjust the anomaly mask M using different region guidance strategies according to the anomaly category C g The location of the region guidance strategy includes the exception mask M g Randomly place mask MR in the guided abnormal area j Internally, randomly mask the exception M g Embedded in the guide abnormal region mask MR j Or set the exception mask M g and guide abnormal region mask MR j Align the center points of struct ; S232: For the logical anomaly attribute A, directly use the guide anomaly region mask MR j As a logical exception mask M logic ; S233. For the combined abnormal attribute A, according to the dictionary D a Get all decoupled fine-grained categories; randomly extract and construct different abnormal combinations from the decoupled fine-grained categories, and then merge non-overlapping mask combinations to generate a combined abnormal mask M combined .

7. A method for synthesizing high-quality industrial abnormal data according to claim 6, characterized in that: The specific process of step S3 is: S31. Abnormal image generation: For each decoupled fine-grained abnormal category C j , using exception embedding The appearance information of abnormal samples is extracted by masked texture inversion method; all fine-grained abnormal categories C j Share a common position encoder E; for a pair of image masks (G j ,M j ), the exception mask M j Input into the position encoder E to obtain the position embedding e L =E(M j ), and then embed the exception and position embedding L Fusion forms fusion abnormal embedding The fused anomaly embedding e is used as the text condition of the diffusion model to guide the anomaly image generation process; S32. Automatic anomaly filtering: using feature extractor F β Normal features are extracted from normal samples, and Gaussian noise is added to these normal features to simulate abnormal features, training the binary abnormal discriminator B D ; Then from the generated abnormal image-mask pair (I G ,M G ) and input the extracted features into the binary anomaly discriminator B D , to obtain the anomaly score map S; The quality of the generated anomaly image-mask pair is evaluated by the anomaly region score, which is calculated as: Where ARS represents the abnormal region score; i represents the horizontal coordinate in the abnormal score map; j represents the vertical coordinate in the abnormal score map; H represents the height of the image; W represents the width of the image; U(·) represents upsampling; B D (·) represents a binary anomaly discriminator; F β (·) represents feature extractor; I G represents an abnormal image; ⊙ represents dot product; M G represents the abnormal mask; (i, j( represents the horizontal and vertical coordinates of each position in the abnormal score map; then the first K aligned high-quality abnormal image-mask pairs are automatically filtered out based on the abnormal area score.

Citation Information

Patent Citations

  • Method for constructing image anomaly detection model based on mask multi-modal generative adversarial network

    CN116994044A

  • Anomaly detection method and device based on large visual language model

    CN117745680A

  • Visual basis model-based few-sample anomaly segmentation method and related equipment

    CN117935258A

  • Method of detecting anomalous data, machine computing unit, computer program

    EP3719711A2

  • Anomaly detection using masked auto-encoder

    US20240311987A1