Unsupervised industrial image anomaly detection model establishment method, detection method and system

By establishing and training source domain and target domain neural networks, and using mapping neural networks for unsupervised industrial image anomaly detection, we solve the problems of abnormal data annotation and diverse types of abnormal samples in industrial images, and achieve efficient anomaly detection that can adapt to different needs. The testing needs of various types of industrial products have improved the level of automated testing of production lines.

CN114170138BActive Publication Date: 2024-10-15HUAZHONG UNIV OF SCI & TECH
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202111310242.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-11-05
Publication Date
2024-10-15
Estimated Expiration
2041-11-05

AI Technical Summary

Technical Problem

It is difficult for the existing technology to effectively annotate abnormal data and detect a wide variety of abnormal samples in industrial image anomaly detection, especially in the early stages of the production line due to insufficient abnormal samples.

Method used

Establish and train the source domain neural network and the target domain neural network, realize the mapping between the source domain depth features and the target domain depth features through the mapping neural network, use L2 loss to optimize parameters, and build an unsupervised industrial image anomaly detection model, using only qualified Images of industrial samples are trained and mapping errors are used to detect anomalies.

Benefits of technology

It improves the performance of unsupervised industrial image anomaly detection, has strong adaptability, reduces labor costs, improves the quality inspection automation level and detection efficiency of the production line, and solves the cold start problem.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114170138B_ABST
    Figure CN114170138B_ABST
Patent Text Reader

Abstract

The present invention discloses an unsupervised industrial image anomaly detection model establishment method, detection method and system, which belong to the field of industrial image processing, including: establishing and training a source domain neural network and a target domain neural network for deep feature extraction, and establishing a mapping neural network to obtain an initial unsupervised industrial image anomaly detection model, wherein the mapping neural network is used to realize the mapping between the source domain deep feature map extracted by the source domain neural network and the target domain deep feature map extracted by the target domain neural network; inputting the training samples in the industrial image data set into the source domain neural network and the target domain neural network, with the goal of minimizing the L2 loss of the training samples, optimizing the parameters of the mapping neural network, and obtaining the trained unsupervised industrial image anomaly detection model, wherein the training samples are images of qualified industrial samples. The performance of unsupervised industrial image anomaly detection is improved, labor costs are reduced, and the automation and intelligent level of production line quality inspection is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the field of industrial image processing, and more specifically, relates to an unsupervised industrial image anomaly detection model establishment method, a detection method and a system. Background Art

[0002] With the introduction of development models such as Industry 4.0, digitalization, and intelligent manufacturing, the demand for automation and intelligent upgrading of industrial production lines continues to increase. Automated testing of product quality is an indispensable link, such as detecting abnormal conditions such as product appearance damage and dislocation. At present, most industries still rely mainly on manual experience to test product quality, such as the 3C industry, semiconductor, and textile industries. Long-term work by testers is prone to fatigue, resulting in low efficiency and deviations in testing. Therefore, industrial image anomaly detection technology based on image processing has been developed to replace manual effective quality testing of products, which can improve the product quality detection performance and production efficiency of production lines.

[0003] The process of industrial image anomaly detection based on image processing includes image data acquisition, image feature extraction, image feature encoding, anomaly scoring and detection. Traditional image feature extraction methods often rely on the long-term experience and knowledge of industry experts to design, and are difficult to generalize in different scenarios. Industrial image detection technology based on deep learning does not rely on manually designed feature extraction, and directly trains and analyzes the acquired industrial product image data. However, the frequency of abnormal data of industrial products is often low, and it is difficult to obtain and collect, especially in the early stage of production line operation, when the production equipment is in good operating condition and most of the images collected are images of normal products. It is often difficult to form a supervised classification training method with sufficient data to train deep neural networks for abnormal data discrimination. Therefore, it is necessary to solve the problem of anomaly detection in industrial images where there is no abnormal data annotation and the types of abnormal samples are complex and unknown. Summary of the invention

[0004] In view of the defects of the prior art and the need for improvement, the present invention provides a method for establishing an unsupervised industrial image anomaly detection model, a detection method and a system, which aim to improve the performance of unsupervised industrial image anomaly detection, reduce labor costs, and improve the level of automation and intelligence of production line quality inspection.

[0005] To achieve the above-mentioned purpose, according to one aspect of the present invention, a method for establishing an unsupervised industrial image anomaly detection model is provided, comprising: S1, establishing and training a source domain neural network and a target domain neural network for deep feature extraction, and establishing a mapping neural network to obtain an initial unsupervised industrial image anomaly detection model, wherein the mapping neural network is used to realize the mapping between the source domain deep feature map extracted by the source domain neural network and the target domain deep feature map extracted by the target domain neural network; S2, inputting the training samples in the industrial image data set into the source domain neural network and the target domain neural network, optimizing the parameters of the mapping neural network with the goal of minimizing the L2 loss of the training samples, and obtaining the trained unsupervised industrial image anomaly detection model, wherein the training samples are images of qualified industrial samples.

[0006] Furthermore, the mapping neural network is a unidirectional mapping neural network, which is used to unidirectionally map the source domain depth feature map to the target domain depth feature map, and the L2 loss is:

[0007]

[0008] Among them, Loss DFM is the L2 loss of the training sample under the one-way mapping neural network, is the feature map of the source domain depth feature map after being transformed by the mapping neural network, F T is the target domain depth feature map, w and h are the width and height of the feature map respectively, c T is the number of channels of the target domain deep feature map, and ||·||2 is the L2 norm.

[0009] Furthermore, the mapping neural network is a single-layer bidirectional mapping neural network, which is used for single-layer bidirectional mapping between the source domain deep features and the target domain deep features, and the L2 loss is:

[0010]

[0011] Among them, Loss B-DFM is the L2 loss of the training sample under the bidirectional mapping neural network, F T 、F S They are the target domain depth feature map and the source domain depth feature map, c T 、c S F T 、F S The number of channels, F T 、F S The feature map after the mapping neural network conversion, w and h are the width and height of the feature map, respectively, and ||·||2 is the L2 norm.

[0012] Furthermore, the mapping neural network is a multi-layer bidirectional mapping neural network, which is used for multi-level bidirectional mapping between the source domain deep features and the target domain deep features, and the L2 loss is:

[0013]

[0014]

[0015]

[0016] Among them, Loss MB-DFM is the L2 loss of the training sample under the multi-layer bidirectional mapping neural network, w k and h k are the width and height of the feature map of the kth level, respectively. They are the target domain deep feature map and source domain deep feature map of the kth level respectively. They are The number of channels, They are The feature map after conversion by the k-th level bidirectional mapping neural network, is the mapping neural network parameter from the source domain depth feature map to the target domain depth feature map in the k-th level bidirectional mapping neural network, MNN(·;·) is the mapping neural network model from the source domain depth feature map to the target domain depth feature map, is the mapping neural network parameter from the target domain deep feature map to the source domain deep feature map in the k-th level bidirectional mapping neural network, RMNN(·;·) is the mapping neural network from the target domain deep feature map to the source domain deep feature map, k=1,2,…,K, K is the total number of layers of the multi-layer bidirectional mapping neural network, K>1, ||·||2 is the L2 norm.

[0017] Furthermore, the mapping neural network is used to calculate a score map of the image input to the unsupervised industrial image anomaly detection model:

[0018]

[0019]

[0020] Wherein, AS is the score map, which is used to characterize the abnormality distribution of the image input to the unsupervised industrial image anomaly detection model; AS kis the mapping error output by the kth level in the mapping neural network; K is the total number of layers of the mapping neural network, K=1 indicates that the mapping neural network is a single-layer mapping neural network, and K>1 indicates that the mapping neural network is a multi-layer mapping neural network; resize(·) is a bilinear interpolation function; the value of λ is 0 or 1, λ=0 indicates that the mapping neural network is a unidirectional mapping neural network, and λ=1 indicates that the mapping neural network is a bidirectional mapping neural network; They are the target domain deep feature map and source domain deep feature map of the kth level respectively. They are The feature map after the k-th level bidirectional mapping neural network conversion, ||·||2 is the L2 norm.

[0021] Furthermore, the mapping neural network is also used to determine whether the image input to the unsupervised industrial image anomaly detection model is abnormal based on the size relationship between the score map and the anomaly score threshold.

[0022] Furthermore, the mapping neural network is also used to calculate the maximum value of the score map, and determine whether the image input to the unsupervised industrial image anomaly detection model is abnormal based on the size relationship between the maximum value and the anomaly score threshold.

[0023] According to another aspect of the present invention, an unsupervised industrial image anomaly detection method is provided, comprising: inputting an image of an industrial sample to be detected into an unsupervised industrial image anomaly detection model obtained by the unsupervised industrial image anomaly detection model establishment method as described above, and obtaining an anomaly judgment result of the industrial sample to be detected.

[0024] According to another aspect of the present invention, there is provided an unsupervised industrial image anomaly detection model establishment system, comprising: an establishment module, used to establish and train a source domain neural network and a target domain neural network for deep feature extraction, and establish a mapping neural network to obtain an initial unsupervised industrial image anomaly detection model, wherein the mapping neural network is used to achieve mapping between a source domain deep feature map extracted by the source domain neural network and a target domain deep feature map extracted by the target domain neural network; a training module, used to input training samples in an industrial image data set into the source domain neural network and the target domain neural network, with the goal of minimizing the L2 loss of the training samples, optimizing the parameters of the mapping neural network, and obtaining a trained unsupervised industrial image anomaly detection model, wherein the training samples are images of qualified industrial samples.

[0025] According to another aspect of the present invention, an unsupervised industrial image anomaly detection system is provided, comprising: an input module and an unsupervised industrial image anomaly detection model obtained by the unsupervised industrial image anomaly detection model establishment method as described above, wherein the input module is used to input an image of an industrial sample to be detected into the unsupervised industrial image anomaly detection model to obtain an anomaly judgment result of the industrial sample to be detected.

[0026] In general, the above technical scheme conceived by the present invention can achieve the following beneficial effects: two different deep feature extraction networks are established, and a mapping network between the extracted features of the two deep feature extraction networks is established. In the training stage, only the images of qualified industrial samples are used to train the mapping network. Based on this, in the use stage, the deep features of the images of unqualified industrial samples cannot be mapped between the deep features through the trained mapping network, thereby generating a higher mapping error, so as to detect whether the industrial samples are abnormal; there is no need to label abnormal data in the parameter optimization stage, which can be used to solve the cold start problem of the production line in the early stage due to insufficient abnormal samples, and it is adaptable to abnormality detection of images of different types of industrial products, thereby improving the performance of unsupervised industrial image anomaly detection, and effectively improving the automation level and detection efficiency of production line quality inspection based on image analysis, which can provide services for subsequent supervised anomaly detection and abnormality diagnosis, and reduce manufacturing costs. BRIEF DESCRIPTION OF THE DRAWINGS

[0027] Figure 1 A flowchart of a method for establishing an unsupervised industrial image anomaly detection model provided by an embodiment of the present invention;

[0028] Figure 2 A schematic diagram of unsupervised industrial image anomaly detection using a one-way mapping neural network provided by an embodiment of the present invention;

[0029] Figure 3 A schematic diagram of unsupervised industrial image anomaly detection using a one-way mapping neural network provided in an embodiment of the present invention;

[0030] Figure 4 A schematic diagram of unsupervised industrial image anomaly detection using a single-layer bidirectional mapping neural network provided by an embodiment of the present invention;

[0031] Figure 5 A schematic diagram of unsupervised industrial image anomaly detection using a single-layer bidirectional mapping neural network provided in an embodiment of the present invention;

[0032] Figure 6 A schematic diagram of unsupervised industrial image anomaly detection using a multi-layer bidirectional mapping neural network provided in an embodiment of the present invention;

[0033] Figure 7A block diagram of a system for establishing an unsupervised industrial image anomaly detection model provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0034] In order to make the purpose, technical solutions and advantages of the present invention more clearly understood, the present invention is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not intended to limit the present invention. In addition, the technical features involved in the various embodiments of the present invention described below can be combined with each other as long as they do not conflict with each other.

[0035] In the present invention, the terms "first", "second", etc. (if any) in the present invention and the accompanying drawings are used to distinguish similar objects but not necessarily to describe a specific order or sequence.

[0036] Figure 1 A flowchart of a method for establishing an unsupervised industrial image anomaly detection model provided by an embodiment of the present invention. Figure 1 , combined with Figure 2-Figure 6 , the method for establishing an unsupervised industrial image anomaly detection model in this embodiment is described in detail, and the method includes operations S1-operation S2.

[0037] Operation S1, establish and train a source domain neural network and a target domain neural network for deep feature extraction, and establish a mapping neural network to obtain an initial unsupervised industrial image anomaly detection model, wherein the mapping neural network is used to realize the mapping between the source domain deep feature map extracted by the source domain neural network and the target domain deep feature map extracted by the target domain neural network.

[0038] In this embodiment, after the source domain neural network and the target domain neural network are established, supervised classification training is performed on a large-scale data set, so that the trained source domain neural network and the target domain neural network can both achieve deep feature extraction, have powerful feature extraction capabilities and high discriminability, and can be effectively used as feature extraction tools for industrial images.

[0039] The pre-trained source domain neural network and target domain neural network are defined as SNN(·; Θ S ) and TNN(·; Θ T ), Θ S and θ T are the network parameters of the source domain neural network and the target domain neural network, respectively, and the extracted deep feature space is marked as the source domain φ S and the target domain φ T . and The image x is passed through the source domain neural network SNN(·; Θ S ) and the target domain neural network TNN(·; ΘT ) extracted deep feature maps, belonging to the source domain φ S and the target domain φ T :

[0040] F S =SNN(x; Θ S )

[0041] F T =TNN(x;Q T )

[0042] For all training normal image sets ∪x, two deep feature map sets can be constructed through the source domain neural network and the target domain neural network. and Since the source domain neural network and the target domain neural network are pre-trained for supervised classification on large-scale images, the image can be effectively mapped into a compact and highly discriminative deep feature space.

[0043] Operation S2, inputs the training samples in the industrial image data set into the source domain neural network and the target domain neural network, optimizes the parameters of the mapping neural network with the goal of minimizing the L2 loss of the training samples, and obtains the trained unsupervised industrial image anomaly detection model, wherein the training samples are images of qualified industrial samples.

[0044] Assume there is a mapping that can transform the collection From the source domain space φ S One-to-one mapping to the target space φ T The collection in However, due to the complexity of the parameters, this assumed mapping is difficult to solve. Therefore, we can use the powerful nonlinear mapping ability of neural networks to approximately solve this mapping model:

[0045]

[0046] In this embodiment, the KL divergence D between the actual mapping distribution and the model fitting mapping distribution is minimized. KL To optimize the parameters of the mapping neural network:

[0047]

[0048] Among them, lg represents the logarithmic function, KL divergence D KL The first term is related to the data but not to the mapping neural network. It is a constant term and can be ignored in the actual optimization process. The equivalent optimization is as follows:

[0049]

[0050] After equivalence, D KLThe second term of is also irrelevant to the mapping neural network, only related to the training data, and can be ignored in the parameter optimization process. Assuming the conditional distribution is a Gaussian distribution, then optimize D KL It can be expressed as follows:

[0051]

[0052] Where D represents the feature f T The dimension of μ(f S ) and δ(f S ) represent the mean and variance of Gaussian distribution respectively. In this embodiment, it is assumed that the variance δ(f S ) is related to the actual collected data and is a constant, which is ignored in the optimization process. The features after mapping by mapping neural network To represent the Gaussian distribution mean μ(f S ), then the actual optimization process is equivalent to the following:

[0053]

[0054]

[0055] Based on the above analysis, minimize the KL divergence D between the actual mapping distribution and the model fitting mapping distribution KL It can be equivalent to optimizing the L2 loss of all normal training samples, based on which the neural network is trained and optimized.

[0056] In one embodiment of the present invention, the mapping neural network is a unidirectional mapping neural network, such as Figure 2 and Figure 3 The unidirectional mapping neural network is used to unidirectionally map the source domain depth feature map to the target domain depth feature map, that is, to unidirectionally map the source domain depth feature map to the target domain φ T , but cannot map the target domain deep feature map to the source domain φ S The L2 loss is:

[0057]

[0058] Among them, Loss DFM is the L2 loss of the training sample under the one-way mapping neural network, is the feature map of the source domain depth feature map after being transformed by the mapping neural network, F T is the target domain depth feature map, w and h are the width and height of the feature map respectively, c T is the number of channels of the target domain deep feature map, and ||·||2 is the L2 norm.

[0059] The source domain neural network and the target domain neural network are different pre-trained models, which are not mandatory, and the mapping can be bidirectional. The one-way mapping neural network only uses the mapping from the source domain space to the target domain space, ignoring the mapping information in the other direction.

[0060] In another embodiment of the present invention, the mapping neural network is a single-layer bidirectional mapping neural network, such as Figure 4 and Figure 5 As shown. The single-layer bidirectional mapping neural network is used for single-level bidirectional mapping between source domain deep features and target domain deep features. To solve the unsupervised industrial image anomaly detection principle diagram using deep feature bidirectional mapping, SMU is a shared information processing unit. It is assumed that some parameters can be shared in the bidirectional mapping. The bidirectional mapping can improve the detection performance while reducing the number of model parameters.

[0061] Specifically, a bidirectional mapping channel is constructed and a reverse mapping neural network model is added.

[0062]

[0063] The use of bidirectional mapping information can be strengthened to effectively improve the anomaly detection performance in the reasoning stage. The bidirectional mapping is expressed as follows:

[0064]

[0065] The L2 loss of the training sample under the bidirectional mapping neural network is:

[0066]

[0067] Among them, Loss B-DFM is the L2 loss of the training sample under the bidirectional mapping neural network, F T 、F S They are the target domain depth feature map and the source domain depth feature map, c T 、c S F T 、F S The number of channels, F T 、F S The feature map after the mapping neural network conversion, w and h are the width and height of the feature map, respectively, and ||·||2 is the L2 norm.

[0068] The structure of a deep neural network model that performs supervised classification training on a large-scale dataset is generally divided into multiple feature processing levels. Generally, the shallow layer can capture the underlying structural information of the image, and the deep layer can capture the semantic information of the image. Therefore, this embodiment integrates multi-level features, performs multi-level bidirectional deep feature mapping, constructs a bidirectional mapping neural network model for each level, and optimizes the model parameters by optimizing the multi-level KL divergence.

[0069] In another embodiment of the present invention, the mapping neural network is a multi-layer bidirectional mapping neural network, such as Figure 6 As shown. The multi-layer bidirectional mapping neural network is used for multi-level bidirectional mapping between source domain deep features and target domain deep features. It can fuse multi-layer feature information. Deep features can alleviate the problem of insufficient semantics and discriminability of shallow features, while shallow features are helpful for pixel-level segmentation of anomalies due to their higher resolution, thus further improving the performance of anomaly detection. The L2 loss of the training sample under the multi-layer bidirectional mapping neural network is:

[0070]

[0071]

[0072]

[0073] Among them, Loss MB-DFM is the L2 loss of the training sample under the multi-layer bidirectional mapping neural network, w k and h k are the width and height of the feature map of the kth level, respectively. They are the target domain deep feature map and source domain deep feature map of the kth level respectively. They are The number of channels, They are The feature map after conversion by the k-th level bidirectional mapping neural network, is the mapping neural network parameter from the source domain depth feature map to the target domain depth feature map in the k-th level bidirectional mapping neural network, MNN(·;·) is the mapping neural network model from the source domain depth feature map to the target domain depth feature map, is the mapping neural network parameter from the target domain deep feature map to the source domain deep feature map in the k-th level bidirectional mapping neural network, RMNN(·;·) is the mapping neural network from the target domain deep feature map to the source domain deep feature map, k=1,2,…,K, K is the total number of layers of the multi-layer bidirectional mapping neural network, K>1, ||·||2 is the L2 norm.

[0074] Taking a multi-layer bidirectional mapping neural network as an example, during the training phase, the normal training images are mapped to multi-level feature spaces through the source domain neural network and the target domain neural network, and a multi-level bidirectional mapping model is constructed. The parameters of the mapping neural network are optimized by minimizing the KL divergence of each level to establish a bidirectional deep feature mapping of the source domain feature space and the target domain feature space at each level. Since only the deep features of the normal image participate in the optimization of the mapping model at each level during the training phase, the deep features of the abnormal image cannot be mapped between the deep features through the optimized mapping model, resulting in a higher mapping error, which causes the abnormal score of the abnormal area to be much higher than that of the normal area. The mapping error is thus used to evaluate the anomaly score. Thus, the mapping neural network is used to calculate the score map of the image input into the unsupervised industrial image anomaly detection model:

[0075]

[0076]

[0077] Among them, AS is the score map, which is used to characterize the abnormality distribution of the image input to the unsupervised industrial image anomaly detection model; AS k is the mapping error of the k-th level output in the mapping neural network; K is the total number of layers of the mapping neural network, K=1 means that the mapping neural network is a single-layer mapping neural network, K>1 means that the mapping neural network is a multi-layer mapping neural network; resize(·) is a bilinear interpolation function; the value of λ is 0 or 1, λ=0 means that the mapping neural network is a unidirectional mapping neural network, and λ=1 means that the mapping neural network is a bidirectional mapping neural network; They are the target domain deep feature map and source domain deep feature map of the kth level respectively. They are The feature map after the k-th level bidirectional mapping neural network conversion, ||·||2 is the L2 norm.

[0078] According to one embodiment of the present invention, the mapping neural network is also used to determine whether the image input to the unsupervised industrial image anomaly detection model is abnormal based on the size relationship between the score map AS and the anomaly score threshold. For example, when there is a value greater than the anomaly score threshold in the score map AS, it indicates that the industrial sample corresponding to the score map AS is an abnormal sample.

[0079] According to another embodiment of the present invention, the mapping neural network is also used to calculate the maximum value S=max(AS) of the score map AS, and judge whether the image input to the unsupervised industrial image anomaly detection model is abnormal based on the size relationship between the maximum value S and the anomaly score threshold. For example, when the maximum value S is greater than the anomaly score threshold, it indicates that the industrial sample corresponding to the score map AS is an abnormal sample. In this embodiment, the value of the anomaly score threshold can be designed according to the specific application scenario.

[0080] Figure 7 A block diagram of a system for establishing an unsupervised industrial image anomaly detection model provided by an embodiment of the present invention. Figure 7 The unsupervised industrial image anomaly detection model building system 700 includes a building module 710 and a training module 720.

[0081] The establishment module 710, for example, performs operation S1, which is used to establish and train a source domain neural network and a target domain neural network for deep feature extraction, and establish a mapping neural network to obtain an initial unsupervised industrial image anomaly detection model, wherein the mapping neural network is used to realize the mapping between the source domain deep feature map extracted by the source domain neural network and the target domain deep feature map extracted by the target domain neural network.

[0082] The training module 720, for example, performs operation S2, which is used to input the training samples in the industrial image data set into the source domain neural network and the target domain neural network, with the goal of minimizing the L2 loss of the training samples, optimizing the parameters of the mapping neural network, and obtaining a trained unsupervised industrial image anomaly detection model, wherein the training samples are images of qualified industrial samples.

[0083] The unsupervised industrial image anomaly detection model establishment system 700 is used to perform the above Figure 1-Figure 6 The unsupervised industrial image anomaly detection model establishment method in the embodiment shown. For details not covered in this embodiment, please refer to the aforementioned Figure 1-Figure 6 The method for establishing the unsupervised industrial image anomaly detection model in the illustrated embodiment will not be described in detail here.

[0084] The embodiment of the present invention also provides an unsupervised industrial image anomaly detection method, comprising: inputting an image of an industrial sample to be detected into the aforementioned Figure 1-Figure 6 In the unsupervised industrial image anomaly detection model obtained by the unsupervised industrial image anomaly detection model establishment method in the illustrated embodiment, an abnormality judgment result of the industrial sample to be detected is obtained.

[0085] In this embodiment, the working principle of the unsupervised industrial image anomaly detection model is the same as that described above. Figure 1-Figure 6 The working principle of the unsupervised industrial image anomaly detection model established in the unsupervised industrial image anomaly detection model establishment method in the illustrated embodiment is the same and will not be repeated here.

[0086] The embodiment of the present invention also provides an unsupervised industrial image anomaly detection system, comprising: an input module and the aforementioned Figure 1-Figure 6 The unsupervised industrial image anomaly detection model obtained by the unsupervised industrial image anomaly detection model establishment method in the illustrated embodiment. The input module is used to input the image of the industrial sample to be detected into the unsupervised industrial image anomaly detection model to obtain the anomaly judgment result of the industrial sample to be detected.

[0087] In this embodiment, the working principle of the unsupervised industrial image anomaly detection model is the same as that described above. Figure 1-Figure 6 The working principle of the unsupervised industrial image anomaly detection model established in the unsupervised industrial image anomaly detection model establishment method in the illustrated embodiment is the same and will not be repeated here.

[0088] It will be easily understood by those skilled in the art that the above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions and improvements made within the spirit and principles of the present invention should be included in the protection scope of the present invention.

Claims

1. A method for establishing an unsupervised industrial image anomaly detection model, It is characterized in that include: S1, establishing and training a source domain neural network and a target domain neural network for deep feature extraction, and establishing a mapping neural network to obtain an initial unsupervised industrial image anomaly detection model, wherein the mapping neural network is used to achieve mapping between a source domain deep feature map extracted by the source domain neural network and a target domain deep feature map extracted by the target domain neural network; S2, inputting the training samples in the industrial image data set into the source domain neural network and the target domain neural network, optimizing the parameters of the mapping neural network with the goal of minimizing the L2 loss of the training samples, and obtaining a trained unsupervised industrial image anomaly detection model, wherein the training samples are images of qualified industrial samples; The mapping neural network is a unidirectional mapping neural network, which is used to unidirectionally map the source domain depth feature map to the target domain depth feature map, and the L2 loss is: Among them, Loss DFM is the L2 loss of the training sample under the one-way mapping neural network, is the feature map of the source domain depth feature map after being transformed by the mapping neural network, F T is the target domain depth feature map, w and h are the width and height of the feature map respectively, c T is the number of channels of the target domain deep feature map, ||·|| 2 is the L2 norm.

2. The method for establishing an unsupervised industrial image anomaly detection model according to claim 1, It is characterized in that The mapping neural network is a single-layer bidirectional mapping neural network, which is used for single-layer bidirectional mapping between the source domain deep features and the target domain deep features, and the L2 loss is: Among them, Loss B-DFM is the L2 loss of the training sample under the bidirectional mapping neural network, F T 、F S They are the target domain depth feature map and the source domain depth feature map, c T 、c S F T 、F S The number of channels, F T 、F S The feature map after the mapping neural network conversion, w and h are the width and height of the feature map, respectively, ||·|| 2 is the L2 norm.

3. The method for establishing an unsupervised industrial image anomaly detection model according to claim 1, It is characterized in that The mapping neural network is a multi-layer bidirectional mapping neural network, which is used for multi-level bidirectional mapping between the source domain deep features and the target domain deep features, and the L2 loss is: Among them, Loss MB-DFM is the L2 loss of the training sample under the multi-layer bidirectional mapping neural network, w k and h k are the width and height of the feature map of the kth level, respectively. They are the target domain deep feature map and source domain deep feature map of the kth level respectively. They are The number of channels, They are The feature map after conversion by the k-th level bidirectional mapping neural network, is the mapping neural network parameter from the source domain depth feature map to the target domain depth feature map in the k-th level bidirectional mapping neural network, MNN(·;·) is the mapping neural network model from the source domain depth feature map to the target domain depth feature map, is the mapping neural network parameter from the target domain deep feature map to the source domain deep feature map in the k-th level bidirectional mapping neural network, RMNN(·;·) is the mapping neural network from the target domain deep feature map to the source domain deep feature map, k=1,2,…,K, K is the total number of layers of the multi-layer bidirectional mapping neural network, K>1,||·|| 2 is the L2 norm.

4. The method for establishing an unsupervised industrial image anomaly detection model according to any one of claims 1 to 3, It is characterized in that The mapping neural network is used to calculate the score map of the image input to the unsupervised industrial image anomaly detection model: Wherein, AS is the score map, which is used to characterize the abnormality distribution of the image input to the unsupervised industrial image anomaly detection model; AS k is the mapping error output by the kth level in the mapping neural network; K is the total number of layers of the mapping neural network, K=1 indicates that the mapping neural network is a single-layer mapping neural network, and K>1 indicates that the mapping neural network is a multi-layer mapping neural network; resize(·) is a bilinear interpolation function; the value of λ is 0 or 1, λ=0 indicates that the mapping neural network is a unidirectional mapping neural network, and λ=1 indicates that the mapping neural network is a bidirectional mapping neural network; They are the target domain deep feature map and source domain deep feature map of the kth level respectively. They are The feature map after conversion by the k-th level bidirectional mapping neural network, ||·|| 2 is the L2 norm.

5. The method for establishing an unsupervised industrial image anomaly detection model according to claim 4, It is characterized in that The mapping neural network is also used to determine whether the image input into the unsupervised industrial image anomaly detection model is abnormal based on the size relationship between the score map and the anomaly score threshold.

6. The method for establishing an unsupervised industrial image anomaly detection model according to claim 4, It is characterized in that The mapping neural network is also used to calculate the maximum value of the score map, and determine whether the image input to the unsupervised industrial image anomaly detection model is abnormal based on the size relationship between the maximum value and the anomaly score threshold.

7. An unsupervised industrial image anomaly detection method, It is characterized in that include: The image of the industrial sample to be detected is input into the unsupervised industrial image anomaly detection model obtained by the unsupervised industrial image anomaly detection model establishment method as described in any one of claims 1 to 6 to obtain the anomaly judgment result of the industrial sample to be detected.

8. An unsupervised industrial image anomaly detection model building system, It is characterized in that include: Establishing a module for establishing and training a source domain neural network and a target domain neural network for deep feature extraction, and establishing a mapping neural network to obtain an initial unsupervised industrial image anomaly detection model, wherein the mapping neural network is used to achieve mapping between a source domain deep feature map extracted by the source domain neural network and a target domain deep feature map extracted by the target domain neural network; A training module, used for inputting training samples in the industrial image data set into the source domain neural network and the target domain neural network, optimizing the parameters of the mapping neural network with the goal of minimizing the L2 loss of the training samples, and obtaining a trained unsupervised industrial image anomaly detection model, wherein the training samples are images of qualified industrial samples; The mapping neural network is a unidirectional mapping neural network, which is used to unidirectionally map the source domain depth feature map to the target domain depth feature map, and the L2 loss is: Among them, Loss DFM is the L2 loss of the training sample under the one-way mapping neural network, F MS is the feature map of the source domain depth feature map after being transformed by the mapping neural network, F T is the target domain depth feature map, w and h are the width and height of the feature map respectively, c T is the number of channels of the target domain deep feature map, ||·|| 2 is the L2 norm.

9. An unsupervised industrial image anomaly detection system, It is characterized in that include: An input module and an unsupervised industrial image anomaly detection model obtained by the unsupervised industrial image anomaly detection model establishment method as described in any one of claims 1 to 6, wherein the input module is used to input the image of the industrial sample to be detected into the unsupervised industrial image anomaly detection model to obtain the anomaly judgment result of the industrial sample to be detected.