Industrial anomaly detection method based on twin network

Through the unsupervised training method based on twin networks, efficient automation of industrial anomaly detection is achieved, and the problems of insufficient robustness and automation identification in the existing technology are solved, reducing costs and improving detection accuracy.

CN119848724APending Publication Date: 2025-04-18DEQING ALPHA INNOVATION RES INST
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411921644.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-25
Publication Date
2025-04-18

AI Technical Summary

Technical Problem

The existing industrial anomaly detection technology has shortcomings in robustness and automation identification, and requires a large number of abnormal samples to be marked, resulting in high cost and low efficiency.

Method used

The industrial anomaly detection method based on the twin network is adopted, and the twin network is trained through an unsupervised method, and the similarity detection is used to determine the similarity between the reference image and the actual captured image, and then determine whether there is an abnormal problem.

Benefits of technology

No abnormal samples are required, labor costs are reduced, complex production environments are adapted to, and the accuracy and automation of industrial abnormality detection are improved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119848724A_ABST
    Figure CN119848724A_ABST
Patent Text Reader

Abstract

The invention relates to an industrial anomaly detection method based on a twin network, and the method comprises the twin network and an industrial anomaly detection method, and the industrial anomaly detection method comprises the following steps: 1) collecting an industrial data set: manually classifying the data set, including normal and abnormal data; 2) data set division: constructing a training set and a verification set by a normal data set, and constructing a test set by the normal data set and an abnormal data set; 3) data preprocessing: normalization and translation enhancement are adopted to ensure that the environmental information of the input image is basically consistent; the method comprises the steps of (1) carrying out training in an unsupervised mode, (2) carrying out feature comparison, (3) carrying out multi-base screening, and (4) carrying out training in an unsupervised mode, (5) carrying out feature comparison, and (6) carrying out multi-base screening, and the screened bases are used for a test.Potential problems can be found and early warned in time, and the technical problems to be solved are that no negative sample data support model training and data labeling cost exist, and meanwhile the problem that the actual environment difference is large is considered.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of artificial intelligence technology, and in particular to an industrial anomaly detection method based on a twin network. Background Art

[0002] At present, the main industrial anomaly detection technologies include machine learning methods and deep learning methods. Among them, the machine learning method performs Gaussian blur on the captured image to reduce noise, converts the image into a grayscale image, then uses the Sobel operator to detect the edge of the grayscale image, and finally constructs a BP neural network to classify the edge image. The disadvantage is that the robustness is not high, it cannot guarantee the complete removal of interference from various complex noises, the recognition effect is unstable, and it is difficult to achieve full-automatic recognition without manual assistance. Deep learning technology often uses full convolutional neural networks, such as UNet image segmentation technology and YOLO series target detection technology. The disadvantage is that a large number of abnormal samples are required, but there are few abnormal samples in industrial scenarios, and they are supervised learning and require manpower to label the samples.

[0003] With the increasing complexity of modern industrial systems and the explosive growth of data volume, traditional monitoring and diagnosis methods have been unable to meet the needs of timely discovery and processing of various abnormal situations in industrial processes. In order to ensure the stable operation of industrial production, improve production efficiency, ensure system safety, and improve product quality, it is particularly important to monitor and identify abnormal situations in industrial operations in real time.

[0004] To this end, an industrial anomaly detection method based on twin networks is designed to overcome the above problems. Summary of the invention

[0005] The purpose of the present invention is to overcome the shortcomings of the prior art and to provide an industrial anomaly detection method based on a twin network. The present invention aims to judge the similarity between a reference image and an actual captured image based on a similarity detection method, and then judge whether there is an abnormality problem based on the similarity.

[0006] The present invention is implemented by the following technical solution: an industrial anomaly detection method based on a twin network, comprising a twin network and an industrial anomaly detection method, wherein the industrial anomaly detection method comprises the following steps:

[0007] 1) Collect industrial data sets: manually classify data sets into normal and abnormal categories;

[0008] 2) Dataset division: The normal data set is used to construct the training set and validation set, and the normal data set and the abnormal data set are used to construct the test set;

[0009] 3) Data preprocessing: Normalization and translation enhancement are used to ensure that the environmental information of the input image is basically consistent;

[0010] 4) Use unsupervised training;

[0011] 5) Feature comparison;

[0012] 6) Multi-base screening, where the screened bases are used in the testing phase.

[0013] Preferably, the twin network consists of a pair of PVT (Pyramid Vision Transformer) sub-networks receiving different inputs, namely PVT1 and PVT2. Each sub-network adopts the same architecture and parameters and shares weights, that is, the two sub-networks are mirror images of each other. Therefore, changes to the architecture, parameters, and weights of any sub-network also apply to the other sub-network, and the output G of the two sub-networks is θ1 =PVT1(x1),G θ2 =PVT2(x2) are connected together E θ {G θ1 , G θ2}, use similarity to determine whether two inputs are the same.

[0014] Preferably, the unsupervised method in step 4) is specifically:

[0015] The PVT model is pre-trained to extract image features. Each time two images are input into the model, a feature vector is obtained. The similarity is obtained by feature comparison method. The distance between each normal image is minimized, and the distance between abnormal images and normal images is further recursively maximized.

[0016] Preferably, the feature comparison in step 5) adopts the similarity measurement method of Euclidean distance, and in order to unify the dimension and facilitate learning and updating, the Euclidean distance is normalized by sigmoid, wherein the closer the normalized Euclidean distance d is to 0, the smaller the difference is, and the closer the normalized Euclidean distance d is to 1, the larger the difference is, and BCELoss is used to implement distance evaluation, wherein the smaller the cross entropy is, the closer the distance is, and the loss function can be expressed as: L = -y log p + (1-y) log (1-p);

[0017] Among them, y is the true label, p is the predicted probability, and the smaller L is, the more consistent the predicted distribution is with the true distribution.

[0018] Preferably, the multi-base screening in step 6) targets complex environmental problems, uses a neural network and a multi-base matching method, and performs maximum coverage base set screening based on a data set to ensure that the three bases selected for each target can minimize the false positive rate on the validation set. At the same time, a hit method is used for judgment, that is, a hit is considered when one of the three base maps hits.

[0019] Preferably, the hitting method is specifically:

[0020] (1) Start with a set of images whose targets are from the same location and are guaranteed to be normal images, denoted by x1, x2, ..., x n express;

[0021] (2) Algorithm output: The similarity between two images, expressed as y(v j , x i ), where column head x i For each candidate base graph, the row head v j is the picture used for testing;

[0022] (3) Screening.

[0023] Preferably, the screening in step 3) is specifically:

[0024] 1) For each candidate base test result in each column, find the minimum value s i ; Calculate the number of elements less than a certain threshold and get r i ;

[0025] 2) Criteria for judging the base's low false positives: First, i As small as possible; when the former is the same, s i As big as possible.

[0026] The beneficial effects of the present invention are as follows:

[0027] 1. No abnormal samples are required, reducing labor costs: The present invention adopts an unsupervised training method, which does not require human labor to label the data, reducing costs. The similarity detection twin network is trained with normal samples, which solves the problem of difficulty in obtaining abnormal samples and greatly shortens the data collection cycle.

[0028] 2. Adapt to the actual complex production environment: The present invention utilizes the strong generalization characteristics of neural networks and multi-base matching methods to solve the problem of complex environment and effectively improve the accuracy of industrial anomaly detection. BRIEF DESCRIPTION OF THE DRAWINGS

[0029] Figure 1 It is the overall flow chart of the present invention.

[0030] Figure 2 This is a schematic diagram of the (similarity detection) twin network in this paper. DETAILED DESCRIPTION

[0031] In order to enable those skilled in the art to more clearly understand the objectives, technical solutions and advantages of the present invention, the present invention is further described below in conjunction with the accompanying drawings and embodiments.

[0032] In the description of the present invention, it is necessary to understand that the orientation or position relationship indicated by the terms such as "up", "down", "left", "right", "inside", "outside", "horizontal" and "vertical" is based on the orientation or position relationship shown in the accompanying drawings, and is only for the convenience of describing the present invention, rather than indicating or implying that the device or original referred to must have a specific orientation, and therefore cannot be understood as a limitation on the present invention.

[0033] The present invention will be described in detail below with reference to the accompanying drawings: Figure 1-2 As shown, an industrial anomaly detection method based on a twin network includes a twin network and an industrial anomaly detection method, and the industrial anomaly detection method includes the following steps:

[0034] 1) Collect industrial data sets: manually classify data sets into normal and abnormal categories;

[0035] 2) Dataset division: The normal data set is used to construct the training set and validation set, and the normal data set and the abnormal data set are used to construct the test set;

[0036] 3) Data preprocessing: Normalization and translation enhancement are used to ensure that the environmental information of the input image is basically consistent;

[0037] 4) Use unsupervised training;

[0038] 5) Feature comparison;

[0039] 6) Multi-base screening, where the screened bases are used in the testing phase.

[0040] The twin network consists of a pair of PVT (Pyramid Vision Transformer) sub-networks that receive different inputs, namely PVT1 and PVT2. Each sub-network uses the same architecture and parameters and shares weights, that is, the two sub-networks are mirror images of each other. Therefore, changes to the architecture, parameters, and weights of any sub-network also apply to the other sub-network, and the output G of the two sub-networks is θ1 =PVT1(x1),G θ2 =PVT2(x2) are connected together E θ {G θ1 , G θ2}, use similarity to determine whether two inputs are the same.

[0041] The unsupervised method in step 4) is specifically:

[0042] The PVT model is pre-trained to extract image features. Each time two images are input into the model, a feature vector is obtained. The similarity is obtained by feature comparison method. The distance between each normal image is minimized, and the distance between abnormal images and normal images is further recursively maximized.

[0043] The feature comparison in step 5) adopts the similarity measurement method of Euclidean distance, and in order to unify the dimension and facilitate learning and updating, the Euclidean distance is normalized by sigmoid, wherein the closer the normalized Euclidean distance d is to 0, the smaller the difference is, and the closer the normalized Euclidean distance d is to 1, the larger the difference is, and BCELoss is used to implement distance evaluation, wherein the smaller the cross entropy is, the closer the distance is, and the loss function can be expressed as: L = -y log p + (1-y) log (1-p);

[0044] Among them, y is the true label, p is the predicted probability, and the smaller L is, the more consistent the predicted distribution is with the true distribution.

[0045] The multi-base screening in step 6) is aimed at complex environmental problems, and uses a neural network and a multi-base matching method. Based on the strong generalization characteristics of the pre-trained neural network, the method of the present invention can adapt to a changing environment. Specifically, the maximum coverage base set screening is performed based on the data set to ensure that the three bases selected for each target can minimize the false detection rate on the verification set. At the same time, the hit method is used for judgment, that is, one of the three base maps hits, which is a hit.

[0046] The hitting method is specifically:

[0047] (1) Start with a set of images whose targets are from the same location and are guaranteed to be normal images, denoted by x1, x2, ..., x n express;

[0048] (2) Algorithm output: The similarity between two images, expressed as y(v j , x i ), where column head x i For each candidate base graph, the row head v j is the picture used for testing;

[0049] (3) Screening:

[0050] 1) For each column (test results of each candidate base), the results are shown in Table 1, find the minimum value s i ; Calculate the number of elements less than a certain threshold (such as 0.9) and get r i ;

[0051] 2) Criteria for judging the base's low false positives: First, iAs small as possible; when the former is the same, s i As big as possible.

[0052] Table 1 Algorithm operation results

[0053] <![CDATA[x1]]> <![CDATA[x2]]> … <![CDATA[x n ]]> <![CDATA[v1]]> <![CDATA[y(v1,x1)]]> <![CDATA[y(v1,x2)]]> <![CDATA[y(v1,x...)]]> <![CDATA[y(v1,x n )]]> <![CDATA[v2]]> <![CDATA[y(v2,x1)]]> <![CDATA[y(v2,x2)]]> <![CDATA[y(v2,x...)]]> <![CDATA[y(v2,x n )]]> ... <![CDATA[y(v...,x1)]]> <![CDATA[y(v...,x2)]]> ... y(v...,xm) <![CDATA[v m ]]> <![CDATA[y(v m ,x1)]]> <h2 style=";text-align:left;direction:ltr"><![CDATA[y(v <h2 style=";text-align:left;direction:ltr"> m <h2 style=";text-align:left;direction:ltr"> ,x2)]]><h2 style=";text-align:left;direction:ltr"> <![CDATA[y(v m ,x...)]]> <![CDATA[y(v m ,x n )]]> Minimum <![CDATA[s1]]> <![CDATA[s2]]> ... <![CDATA[s n ]]> False Positives <![CDATA[r1]]> <![CDATA[r2]]> ... <![CDATA[r n ]]>

[0054] Note: Column header x i For each candidate base graph, the row head v j This is a picture used for testing.

[0055] Anyone familiar with the technology may modify or alter the above embodiments without departing from the spirit and scope of the present invention. Therefore, all equivalent modifications or alterations made by a person of ordinary skill in the art without departing from the spirit and technical concept disclosed by the present invention shall still be covered by the claims of the present invention.

Claims

1. An industrial anomaly detection method based on a twin network, comprising a twin network and an industrial anomaly detection method, characterized in that: The industrial anomaly detection method comprises the following steps: 1) Collect industrial data sets: manually classify data sets into normal and abnormal categories; 2) Dataset division: The normal data set is used to construct the training set and validation set, and the normal data set and the abnormal data set are used to construct the test set; 3) Data preprocessing: Normalization and translation enhancement are used to ensure that the environmental information of the input image is basically consistent; 4) Use unsupervised training; 5) Feature comparison; 6) Multi-base screening, where the screened bases are used in the testing phase.

2. The industrial anomaly detection method based on twin network according to claim 1 is characterized in that: The twin network consists of a pair of PVT sub-networks that receive different inputs, namely PVT1 and PVT2. Each sub-network uses the same architecture and parameters and shares weights, that is, the two sub-networks are mirror images of each other. The output G of the two sub-networks θ1 =PVT1(x1),G θ2 =PVT2(x2) are connected together E θ {G θ1 , G θ2 }, use similarity to determine whether two inputs are the same.

3. The industrial anomaly detection method based on twin network according to claim 1 is characterized in that: The unsupervised method in step 4) is specifically: The PVT model is pre-trained to extract image features. Each time two images are input into the model, a feature vector is obtained. The similarity is obtained by feature comparison method. The distance between each normal image is minimized, and the distance between abnormal images and normal images is further recursively maximized.

4. The industrial anomaly detection method based on twin network according to claim 1 is characterized in that: The feature comparison in step 5) adopts the similarity measurement method of Euclidean distance, and in order to unify the dimension and facilitate learning and updating, the Euclidean distance is normalized by sigmoid, wherein the closer the normalized Euclidean distance d is to 0, the smaller the difference is, and the closer the normalized Euclidean distance d is to 1, the larger the difference is, and BCELoss is used to implement distance evaluation, wherein the smaller the cross entropy is, the closer the distance is, and the loss function can be expressed as: L = -y log p + (1-y) log (1-p); Among them, y is the true label, p is the predicted probability, and the smaller L is, the more consistent the predicted distribution is with the true distribution.

5. The industrial anomaly detection method based on twin network according to claim 1 is characterized in that: The multi-base screening in step 6) aims at complex environmental problems, adopts neural network and multi-base matching method, and performs maximum coverage base set screening based on the data set to ensure that the three bases selected for each target can minimize the false detection rate on the verification set. At the same time, the hit method is used for judgment, that is, if one of the three base maps hits, it is considered a hit.

6. The industrial anomaly detection method based on twin network according to claim 5 is characterized in that: The hitting method is specifically: (1) Start with a set of images whose targets are from the same location and are guaranteed to be normal images, denoted by x1, x2, ..., x n express; (2) Algorithm output: The similarity between two images, expressed as y(v j , x i ), where column head x i For each candidate base graph, the row head v j For the pictures used for testing; (3) Screening.

7. The industrial anomaly detection method based on twin network according to claim 6 is characterized in that: The screening in step 3) is specifically as follows: 1) For each candidate base test result in each column, find the minimum value s i ; Calculate the number of elements less than a certain threshold and get r i ; 2) Criteria for judging the base false positives: First, i As small as possible; when the former is the same, s i As big as possible.