Industrial anomaly detection method, apparatus, and device

By calculating the similarity between the information to be tested and normal and abnormal features, and combining this with a greedy algorithm to filter the feature library, the problem of low efficiency and accuracy in industrial anomaly detection in existing technologies is solved, and efficient and accurate anomaly detection is achieved.

CN115952463BActive Publication Date: 2026-02-10HANGZHOU INNOVATION RES INST OF BEIJING UNIV OF AERONAUTICS & ASTRONAUTICS
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202211719240.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-12-30
Publication Date
2026-02-10
Estimated Expiration
2042-12-30

AI Technical Summary

Technical Problem

In existing technologies, the efficiency and accuracy of industrial anomaly detection are relatively low, especially when there is a lack of anomaly samples, making it difficult to effectively utilize anomaly features for detection.

Method used

By acquiring the detection features of the information to be tested and calculating the similarity with preset normal and abnormal features respectively, the reciprocal of the similarity and the abnormality score are used to determine whether the information to be tested is abnormal. Combined with a greedy algorithm to filter the feature library, the model training cost is reduced.

Benefits of technology

It improves the accuracy and efficiency of anomaly detection, reduces the workload of normal feature-based detection, and lowers the cost of sample collection and model training.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115952463B_ABST
    Figure CN115952463B_ABST
Patent Text Reader

Abstract

The present application relates to the technical field of detection, in particular to an industrial anomaly detection method, device and equipment, in the industrial anomaly detection method, by introducing abnormal characteristics, on the basis of normal characteristic detection, the similarity of the information to be detected and abnormal characteristics is used for cooperation detection. In this way, when the similarity of the information to be detected and abnormal characteristics is high, it can be directly judged that there is an anomaly, the accuracy of anomaly detection is improved. Moreover, when the information to be detected is abnormal, the workload based on normal characteristic detection can be reduced, the efficiency of anomaly detection is greatly improved. At the same time, the principle of determining abnormal score based on similarity is used to judge whether it is abnormal, so as to avoid training a model for each category separately, reduce the sample collection cost, and be more beneficial to practical application.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of detection technology, and specifically to an industrial anomaly detection method, apparatus, and equipment. Background Technology

[0002] In fields such as network detection, signal processing, and industrial big data, it is often necessary to detect the status of the environment or equipment in order to determine whether the environment or equipment is abnormal. This is of great significance for ensuring the safe and normal operation of the environment or equipment.

[0003] In existing anomaly detection technologies, normal samples are first collected, and normal features are obtained by training a model based on the normal samples. The features of the information to be tested are compared with the normal features, and when the difference between the two is large, an anomaly is determined to exist.

[0004] However, detecting anomalies using only normal features is slow; moreover, because the number of normal features is enormous, it is impossible to obtain all of them. Therefore, when the features of the information to be tested differ significantly from the current normal features, there may not necessarily be anomalies, and the accuracy of the detection results is generally low. Therefore, there is an urgent need for a method to improve the speed and accuracy of anomaly detection. Summary of the Invention

[0005] In view of this, the purpose of the present invention is to provide an industrial anomaly detection method, apparatus and equipment to overcome the problems of low efficiency and accuracy of current anomaly detection.

[0006] To achieve the above objectives, the present invention adopts the following technical solution:

[0007] In a first aspect, this application provides an industrial anomaly detection method, comprising:

[0008] Obtain the detection features from the information to be tested;

[0009] Calculate the first similarity between the detected feature and a preset normal feature, and the second similarity between the detected feature and a preset abnormal feature; wherein the abnormal feature is extracted from a preset abnormal sample and is used to characterize the sample abnormality, and the normal feature is extracted from a normal sample;

[0010] An anomaly score for the information to be tested is determined based on the reciprocal of the first similarity and the second similarity.

[0011] If the anomaly score is greater than a preset threshold, then the information to be tested is determined to be an anomaly.

[0012] Optionally, calculating the first similarity between the detected feature and a preset normal feature includes:

[0013] Calculate the similarity between the detected feature and each normal feature in the preset normal feature library;

[0014] The normal features are ranked based on similarity, and a target number of high-similarity normal features are selected.

[0015] The average similarity between each of the highly similar normal features and the detected feature is taken as the first similarity.

[0016] Optionally, calculating the second similarity between the detected feature and the preset anomaly feature includes:

[0017] Calculate the similarity between the detected feature and each abnormal feature in the preset abnormal feature library;

[0018] The abnormal features are ranked based on similarity, and a target number of highly similar abnormal features are selected.

[0019] The average similarity between each of the highly similar abnormal features and the detected feature is taken as the second similarity.

[0020] Optionally, calculating the similarity between the detected feature and each abnormal feature in the preset abnormal feature library includes:

[0021] Calculate the Euclidean distance between the detected feature and each of the abnormal features respectively;

[0022] The Euclidean distance between the detected feature and the anomalous feature is used as the similarity value between the detected feature and the anomalous feature.

[0023] The larger the Euclidean distance value, the smaller the similarity between the detected feature and the abnormal feature.

[0024] Optionally, the number of features to be tested is multiple;

[0025] The step of determining the anomaly score of the information to be tested based on the reciprocal of the first similarity and the second similarity includes:

[0026] The reciprocals of the first similarity and the second similarity of the multiple features to be tested are normalized respectively;

[0027] The results of the normalization process are summed to obtain the anomaly score.

[0028] Optionally, the construction process of the preset abnormal feature library includes:

[0029] By using a pre-set training model, multiple abnormal features are extracted from multiple abnormal samples;

[0030] The aforementioned multiple abnormal features are combined to form the abnormal feature library.

[0031] Optionally, the construction process of the preset abnormal feature library further includes:

[0032] Based on a greedy algorithm, abnormal features in the abnormal feature library are filtered.

[0033] Optionally, the formats of the feature to be tested, the normal feature, and the abnormal feature all include images and text.

[0034] Secondly, this application also provides an industrial anomaly detection device, comprising:

[0035] The acquisition module is used to acquire detection features from the information to be tested;

[0036] The calculation module is used to calculate the first similarity between the detected feature and the preset normal feature, and the second similarity between the detected feature and the preset abnormal feature; wherein the abnormal feature is extracted from the preset abnormal sample and is used to characterize the sample abnormality, and the normal feature is extracted from the normal sample; and based on the reciprocal of the first similarity and the second similarity, the abnormality score of the information to be tested is determined.

[0037] The calculation module is further configured to determine that the information to be tested is abnormal if the abnormal score is greater than a preset threshold.

[0038] Thirdly, this application also provides an industrial anomaly detection device, including a processor and a memory, wherein the processor is connected to the memory:

[0039] The processor is used to call and execute the program stored in the memory;

[0040] The memory is used to store the program, which is at least used to execute the industrial anomaly detection method mentioned above.

[0041] The industrial anomaly detection method provided in this application introduces anomalous features and uses both normal and anomalous features to detect the information under test. Building upon the detection based on normal features, the similarity between the information under test and the anomalous features is used in conjunction with the detection. Thus, when the similarity between the information under test and the anomalous features is high, the presence of an anomaly can be directly determined, and the type of anomaly can also be identified, improving the accuracy of anomaly detection. Furthermore, when anomalies are present in the information under test, the workload of detection based on normal features is reduced, significantly improving the efficiency of anomaly detection. Attached Figure Description

[0042] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0043] Figure 1 This is a schematic flowchart of the industrial anomaly detection method provided in the embodiments of this application;

[0044] Figure 2 This is a schematic diagram of the structure of the industrial anomaly detection device provided in the embodiments of this application;

[0045] Figure 3 This is a schematic diagram of the structure of the industrial anomaly detection equipment provided in the embodiments of this application. Detailed Implementation

[0046] To make the objectives, technical solutions, and advantages of this invention clearer, the technical solutions of this invention will be described in detail below. Obviously, the described embodiments are merely some embodiments of this invention, and not all embodiments. Based on the embodiments of this invention, all other implementation methods obtained by those skilled in the art without creative effort are within the scope of protection of this invention.

[0047] Application Overview:

[0048] Anomaly detection is an important research area in machine learning. It aims to identify the boundary between normal and abnormal samples, separating them as much as possible. Anomaly detection has wide applications in various fields, such as network intrusion detection, signal processing, industrial big data analysis, abnormal behavior detection, and image and video processing.

[0049] Early anomaly detection algorithms were mostly applied to data mining. With the development of computer vision and deep learning, many studies have introduced anomaly detection into text and image processing to address target detection problems in situations of limited samples. Image anomaly detection applications are primarily concentrated in industrial defect detection, medical impact analysis, and hyperspectral image processing. Taking image anomaly detection as an example, each pixel value in the image data used for anomaly detection corresponds to an observation. Due to the diversity of pixel values ​​within an image, analyzing only the pixel value of a single point is insufficient to determine whether it is an anomaly.

[0050] Existing industrial anomaly detection methods typically train on normal samples. However, in many relevant real-world applications, a small number (e.g., one or more) of labeled anomalous samples are often available, such as defective samples found during random quality inspections or lesion images confirmed by radiologists during routine medical screenings. These anomalous samples can provide valuable information for their specific anomaly detection tasks, which unsupervised industrial anomaly detection methods cannot effectively utilize. Therefore, due to the lack of anomaly knowledge, features learned solely from normal samples are insufficient to distinguish between anomalies (especially challenging ones) and normal data, resulting in low detection accuracy. Furthermore, detection based on normal features is inefficient.

[0051] In existing technologies, anomaly detection of anomalous features faces the following challenges:

[0052] First, there is the unknown nature of anomalies. Anomalies are related to many unknown factors, such as instances with unknown sudden behaviors, data structures, and distributions. They are only known when they actually happen, such as terrorist attacks, fraud, and network intrusions. Therefore, it is unrealistic to obtain comprehensive anomaly characteristics in advance.

[0053] Second, there is the heterogeneity of anomaly classes. Anomalies are irregular, and one type of anomaly may exhibit completely different characteristics from another. For example, in video surveillance, anomalous events such as robbery, traffic accidents, and theft have significant visual differences. Therefore, it is difficult to infer all anomalies based on existing ones.

[0054] Third, there is class imbalance. Anomalies are typically rare data instances, while normal instances usually constitute the vast majority of the data. Therefore, collecting a large number of labeled anomaly instances is difficult, or even impossible. This makes it impossible to obtain large-scale labeled data in most applications. In real-world scenarios (such as industrial scenarios), anomaly samples are often hard to obtain, or even nonexistent. This forces researchers to use only a large number of normal samples for training and learning.

[0055] In addition, existing technologies train a dedicated model for each category. However, in real-world scenarios such as defect detection, it is not cost-effective to collect a large number of normal samples for each of the hundreds of industrial products that need to be processed. Furthermore, training each model individually also consumes a lot of time, resulting in high model training and deployment costs.

[0056] Method Implementation Examples:

[0057] Figure 1 This is a flowchart illustrating an industrial anomaly detection method provided in an embodiment of this application. Please refer to [link / reference]. Figure 1 This embodiment may include the following steps:

[0058] S101. Obtain the detection features from the information to be tested.

[0059] Specifically, the information to be tested can be images and text. After obtaining the images or text that need to be tested for anomalies, the features to be tested can be extracted through a pre-trained model.

[0060] S102. Calculate the first similarity between the detected feature and the preset normal feature, and the second similarity between the detected feature and the preset abnormal feature.

[0061] Among them, abnormal features are extracted from preset abnormal samples and used to characterize sample abnormalities, while normal features are extracted from normal samples.

[0062] Specifically, before detection, a large number of samples, including normal and abnormal samples, can be obtained to form a dataset. Then, using the trained model mentioned above, features are extracted from the normal and abnormal samples in the dataset to obtain normal features and abnormal features, where abnormal features are used to characterize sample abnormalities.

[0063] In actual testing, the feature to be tested is compared with normal features to obtain the first similarity, and the feature to be tested is compared with abnormal features to obtain the second similarity. It should be noted that when the similarity between the feature to be tested and normal features is high, it indicates that the feature to be tested is more normal; when the similarity between the feature to be tested and abnormal features is high, it indicates that the feature to be tested is more abnormal.

[0064] S103. Based on the reciprocal of the first similarity and the second similarity, determine the anomaly score of the information to be tested.

[0065] S104. If the abnormal score is greater than the preset threshold, the information to be tested is determined to be abnormal information.

[0066] Specifically, based on the reciprocal of the first similarity and the second similarity, the degree of similarity between the feature to be tested and the anomaly can be obtained, i.e., the anomaly score. Then, by setting an anomaly threshold, when the anomaly score of the feature to be tested is higher than the anomaly threshold, it is determined that the information to be tested has a defect; when the anomaly score of the feature to be tested is lower than the anomaly threshold, it is determined that the information to be tested does not have a defect.

[0067] The industrial anomaly detection method provided in this application introduces anomalous features and detects the information to be tested based on both normal and anomalous features. Building upon the detection based on normal features, it utilizes the similarity between the information to be tested and the anomalous features for further detection. Thus, when the similarity between the information to be tested and the anomalous features is high, the presence of an anomaly can be directly determined, and the type of anomaly can also be identified, improving the accuracy of anomaly detection. Furthermore, when anomalies are present in the information to be tested, the workload of detection based on normal features is reduced, significantly improving the efficiency of anomaly detection. Simultaneously, by determining anomaly scores based on similarity, the principle of determining whether an anomaly exists avoids training a separate model for each category, reducing sample collection costs and making it more suitable for practical applications.

[0068] It should be noted that the types of information to be tested, preset normal features, and abnormal features mentioned in this application can include images and text, i.e., anomaly detection for image data and anomaly detection for text data. In some embodiments, the pre-trained model mentioned above can be a pre-trained model on the ImageNet dataset, or a model trained using self-supervised learning, such as a ResNet pre-trained model, to extract features from image data, or a CLIP pre-trained model can be used to achieve feature extraction and anomaly detection for both image and text data through a dual-tower model.

[0069] It should be noted that in this application, comparing the feature to be tested with normal and abnormal features to obtain an anomaly score, and determining whether the information to be tested is abnormal based on the anomaly score, can be implemented by adding corresponding functions to the above-mentioned pre-trained model, or it can be implemented by using a preset calculation module or system in conjunction with the above-mentioned preset model. The principles are the same, so they are all within the protection scope of this application.

[0070] In some embodiments, the similarity between the detected feature and each normal feature in the preset normal feature library (i.e., the memory library corresponding to the model) and each abnormal feature in the preset abnormal feature library (memory library) can be calculated respectively; the normal and abnormal features are ranked based on the similarity, and a target number of high similarity normal and abnormal features are selected; the average similarity between each high similarity normal feature and the detected feature is taken as the first similarity; and the average similarity between each high similarity abnormal feature and the detected feature is taken as the second similarity.

[0071] Specifically, taking image data as the information to be tested as an example, for the normal feature library, the images marked as normal in the dataset can be sent into the ResNet network, and the model output corresponding to each image can be stored in memory library 1 to obtain the normal feature library; similarly, we also send the images marked as abnormal in the dataset into the ResNet network, and the model output corresponding to each image can be stored in memory library 2 to obtain the abnormal feature library.

[0072] The output features can be features from intermediate feature layers, such as the outputs of ResNet's layer 3 and layer 4, as well as the output after the final average pooling layer.

[0073] It is understandable that the normal feature library and the abnormal feature library mentioned above both include multiple features. For example, the normal feature library includes 500 normal features, and the abnormal feature library includes 500 abnormal features.

[0074] Additionally, it should be noted that extracting only the features used to characterize the anomaly may be quite difficult. Therefore, in some embodiments of this application, the abnormal features may include normal feature information, but the abnormal features must contain abnormal information, so they can also be used to implement the above-mentioned anomaly detection scheme.

[0075] After obtaining the normal feature library and the abnormal feature library according to the above scheme, during actual detection, the features of the information to be tested are compared with each normal feature in the normal feature library, and the similarity with each normal feature is calculated. Based on the calculated similarity, the normal features in the memory library are sorted, and a preset number, such as K1, of the most similar normal features (the K1 normal features with the highest similarity) are selected as high similarity normal features. The average of the similarity values ​​of these K1 high similarity features is taken as the first similarity.

[0076] Similarly, the principle of obtaining high similarity anomaly features of the target number and using the average similarity of the high similarity anomaly features of the target number as the second similarity is the same as the first principle mentioned above, and will not be repeated here.

[0077] In some embodiments, the similarity between a detected feature and a normal or anomalous features can be represented by Euclidean distance. That is, the similarity between the detected feature and a normal or anomalous feature is obtained by calculating the Euclidean distance between the detected feature and the normal or anomalous feature. A larger Euclidean distance value indicates a smaller similarity between the detected feature and the anomalous feature.

[0078] Therefore, the specific process for calculating the first and second similarities mentioned above can be as follows:

[0079] First, the Euclidean distance is calculated for each normal feature in the memory bank containing both the feature to be tested and normal features. Based on the calculated Euclidean distances, the normal features in the bank are sorted, and K1 normal features with the smallest Euclidean distance to the feature to be tested are selected as high-similarity normal features. Then, the Euclidean distances of these K1 normal features to the feature to be tested are summed and averaged to obtain the first similarity score.

[0080] The principle for calculating the second similarity based on Euclidean distance is the same as that for calculating the first similarity, and will not be repeated here.

[0081] Based on the above embodiments, the reciprocal of the first similarity and the second similarity can be directly added to obtain the abnormality score of the information to be tested, such as the image. When the abnormality score is greater than the abnormality threshold τ, the input image is determined to be abnormal (i.e., there is a defect), otherwise the input image is determined to be normal (i.e. there is no defect).

[0082] In some embodiments of this application, the number of features to be tested mentioned above is multiple. Thus, after obtaining the first and second similarities of multiple features to be tested, normalization processing is performed. The result of the normalization processing is used as an anomaly score, which is then compared with an anomaly threshold τ to determine whether an anomaly exists, i.e., whether a defect exists. For example, a scoring function can be trained to describe the degree of anomaly of the image to be tested and to judge whether the input image has a defect.

[0083] For example, let A1 represent the reciprocal of the first similarity of each feature to be tested, and let A2 represent the reciprocal of the second similarity of each feature. After normalizing a1 and a2, add them together, that is, a = a1 / a1.max() + a2 / a2.max(), and a is used as the anomaly score of the input image.

[0084] In practical applications, when there are too many normal and abnormal features in the training data, i.e., the memory bank mentioned above, the feature storage space is large, and it will also take a lot of time to compare the feature to be tested with the features in the memory bank later. Therefore, in some embodiments of this application, the features in the memory bank can be filtered by the greedy core set method.

[0085] For example, using a greedy coreset-based method to filter memory banks, first, set the filtering ratios s1 and s2, and let the number of features in the original normal feature memory bank 1 and the original abnormal feature memory bank 2 be N1 and N2, respectively. After filtering, the number of features in the new normal feature memory bank 1 and the new abnormal feature memory bank 2 will be (1-s1)*N1 and (1-s2)*N2, respectively (e.g., if N1 is 500 and s1 is 0.2, the number of features after filtering will be 500*0.8=400).

[0086] Specifically, taking the normal feature memory bank 1 as an example, an empty memory bank can be created. A normal feature is randomly selected from the original normal feature memory bank and placed into the newly created memory bank. Subsequently, a greedy strategy is adopted to calculate the distance between the normal features in the new memory bank and the normal features in the original normal feature memory bank. Each time, a normal feature with the smallest distance to the current normal feature in the new memory bank is selected and added to the new memory bank until the number of features in the new memory bank reaches the preset number. The newly generated memory bank is then used as the new normal feature memory bank and replaces the original normal feature memory bank.

[0087] The selection process for the abnormal feature memory bank follows the same principle as the selection process for the normal feature memory bank, and will not be elaborated upon here. Thus, the new memory bank, after selection, contains suitable feature data, which can greatly alleviate the pressure on data storage and subsequent computation.

[0088] The industrial anomaly detection method provided in this application makes good use of abnormal samples, improving the efficiency and accuracy of anomaly detection. Moreover, it scores based on feature data in the memory bank to determine whether the information to be tested is abnormal, avoiding the need to train a separate model for each category and retrain it by collecting a large number of normal samples of that category. This greatly reduces training costs and makes it easier to apply in practice.

[0089] In some embodiments, the industrial anomaly detection method provided in this application can also be applied to text data, as well as to simultaneously detect anomalies in image data and text data, which can be achieved simply by changing the preset model.

[0090] For example, in some embodiments, we can use the CLIP pre-trained model for the aforementioned feature extraction and detection. The CLIP model is a dual-tower model, consisting of two models, one corresponding to text and the other to image. During training, through contrastive learning, existing image-text pairs are brought closer together spatially, while non-paired image-text pairs are spaced further apart, thereby learning excellent image-text features.

[0091] Specifically, the image model M_Image, which is pre-trained based on the CLIP model, can be used to replace the ResNet model pre-trained on ImageNet, while a text model M_Text, which is pre-trained based on the CLIP model, can be introduced.

[0092] In practical applications, the model structure of M_Text is the same as that of M_Image, which is also a ResNet model. Similarly, memory libraries text1 and text2 are established. text1 stores the features extracted from normal description statements for the test category, that is, text1 is the normal feature memory library; text2 mainly stores the features extracted from abnormal description statements for the test category, that is, text2 is the abnormal feature memory library.

[0093] For example, for defect detection of cables, we take normal descriptions such as "a normal cable" and "a good cable" as input and input them into the M_Text model. The extracted features are stored in text1. Similarly, we take abnormal descriptions such as "a bad cable", "a bad cable with missing wire", "a bad cable with missing cable", and "a bad cable with poke insulation" as input and extract their features, storing them in text2.

[0094] In actual detection, anomaly detection is performed directly on the text data based on the above text1 and text2. The detection principle is the same as that for anomaly detection of image data, and will not be repeated here.

[0095] In other embodiments of this application, image data can also be detected simultaneously using the aforementioned image anomaly recognition and text anomaly recognition.

[0096] Specifically, when comparing test images, an anomaly score for text comparison is introduced in addition to the original anomaly score calculation: The test image extracts test features using M_Image. The extracted test features are compared with the similarity of all text features in text1, and the average similarity is taken as t1. Then, the extracted test features are compared with the similarity of all text features in text2, and the reciprocal of the average is taken as t2. The final anomaly score a = a1 / a1.max() + a2 / a2.max() + t1 / t1.max() + t2 / t2.max(), where a is the anomaly score of the input image. The final anomaly score is compared with a pre-set threshold τ. If a is greater than τ, the input image is determined to be anomaly (i.e., defective); otherwise, the input image is determined to be normal (i.e., without defects).

[0097] Device Example:

[0098] Based on the same inventive concept, this application provides an industrial anomaly detection device, such as... Figure 2 As shown, it includes:

[0099] The acquisition module 21 is used to acquire the detection features in the information to be tested;

[0100] The calculation module 22 is used to calculate the first similarity between the detected feature and the preset normal feature, and the second similarity between the detected feature and the preset abnormal feature, respectively; wherein, the abnormal feature is extracted from the preset abnormal sample and is used to characterize the sample abnormality, and the normal feature is extracted from the normal sample; and based on the reciprocal of the first similarity and the second similarity, the abnormality score of the information to be tested is determined.

[0101] The calculation module 22 is also used to determine the information to be tested as abnormal information if the abnormal score is greater than a preset threshold.

[0102] Regarding the apparatus in the above embodiments, the specific manner in which each module performs its operation has been described in detail in the embodiments related to the method, and will not be elaborated upon here.

[0103] Equipment Example:

[0104] Based on the same inventive concept, embodiments of this application provide an industrial anomaly detection device, such as... Figure 3 As shown, it includes: a processor 31 and a memory 32, with the processor 31 connected to the memory 32.

[0105] The processor 31 is used to call and execute the program stored in the memory 32; the memory 32 is used to store the program, which is used at least to execute the industrial anomaly detection method mentioned in the above method embodiments.

[0106] Regarding the device in the above embodiments, the specific manner in which each module performs its operation has been described in detail in the embodiments related to the method, and will not be elaborated upon here.

[0107] It is understood that the same or similar parts in the above embodiments can be referred to each other, and the contents not described in detail in some embodiments can be referred to the same or similar contents in other embodiments.

[0108] It should be noted that in the description of this invention, the terms "first," "second," etc., are used for descriptive purposes only and should not be construed as indicating or implying relative importance. Furthermore, in the description of this invention, unless otherwise stated, "a plurality of" means at least two.

[0109] Any process or method description in the flowchart or otherwise herein can be understood as representing a module, segment, or portion of code comprising one or more executable instructions for implementing a particular logical function or process, and the scope of the preferred embodiments of the invention includes additional implementations in which functions may be performed not in the order shown or discussed, including substantially simultaneously or in reverse order depending on the functions involved, as will be understood by those skilled in the art to which embodiments of the invention pertain.

[0110] It should be understood that various parts of the present invention can be implemented in hardware, software, firmware, or a combination thereof. In the above embodiments, multiple steps or methods can be implemented in software or firmware stored in memory and executed by a suitable instruction execution system. For example, if implemented in hardware, as in another embodiment, it can be implemented using any one or a combination of the following techniques known in the art: discrete logic circuits having logic gates for implementing logical functions on data signals, application-specific integrated circuits (ASICs) having suitable combinational logic gates, programmable gate arrays (PGAs), field-programmable gate arrays (FPGAs), etc.

[0111] Those skilled in the art will understand that all or part of the steps of the methods in the above embodiments can be implemented by a program instructing related hardware. The program can be stored in a computer-readable storage medium, and when executed, the program includes one or a combination of the steps of the method embodiments.

[0112] Furthermore, the functional units in the various embodiments of the present invention can be integrated into a processing module, or each unit can exist physically separately, or two or more units can be integrated into a module. The integrated module can be implemented in hardware or as a software functional module. If the integrated module is implemented as a software functional module and sold or used as an independent product, it can also be stored in a computer-readable storage medium.

[0113] The storage media mentioned above can be read-only memory, disk, or optical disk, etc.

[0114] In the description of this specification, references to terms such as "one embodiment," "some embodiments," "example," "specific example," or "some examples," etc., indicate that a specific feature, structure, material, or characteristic described in connection with that embodiment or example is included in at least one embodiment or example of the invention. In this specification, the illustrative expressions of the above terms do not necessarily refer to the same embodiment or example. Furthermore, the specific features, structures, materials, or characteristics described may be combined in any suitable manner in one or more embodiments or examples.

[0115] Although embodiments of the present invention have been shown and described above, it is understood that the above embodiments are exemplary and should not be construed as limiting the present invention. Those skilled in the art can make changes, modifications, substitutions and variations to the above embodiments within the scope of the present invention.

Claims

1. An industrial anomaly detection method, characterized in that, include: Acquire detection features from the information to be tested, wherein the information to be tested is an image and text; Calculate the first similarity between the detected feature and a preset normal feature, and the second similarity between the detected feature and a preset abnormal feature; wherein the abnormal feature is extracted from a preset abnormal sample and is used to characterize the sample abnormality, and the normal feature is extracted from a normal sample; An anomaly score for the information to be tested is determined based on the reciprocal of the first similarity and the second similarity. If the abnormal score is greater than a preset threshold, then the information to be tested is determined to be abnormal information; The number of detected features is multiple; determining the anomaly score of the information to be tested based on the reciprocal of the first similarity and the second similarity includes: normalizing the reciprocal of the first similarity and the second similarity of the multiple detected features respectively; and adding the results of the normalization to obtain the anomaly score.

2. The industrial anomaly detection method according to claim 1, characterized in that, The calculation of the first similarity between the detected feature and the preset normal feature includes: Calculate the similarity between the detected feature and each normal feature in the preset normal feature library; The normal features are ranked based on similarity, and a target number of high-similarity normal features are selected. The average similarity between each of the highly similar normal features and the detected feature is taken as the first similarity.

3. The industrial anomaly detection method according to claim 2, characterized in that, The calculation of the second similarity between the detected feature and the preset abnormal feature includes: Calculate the similarity between the detected feature and each abnormal feature in the preset abnormal feature library; The abnormal features are ranked based on similarity, and a target number of highly similar abnormal features are selected. The average similarity between each of the highly similar abnormal features and the detected feature is taken as the second similarity.

4. The industrial anomaly detection method according to claim 3, characterized in that, The step of calculating the similarity between the detected feature and each abnormal feature in the preset abnormal feature library includes: Calculate the Euclidean distance between the detected feature and each of the abnormal features respectively; The Euclidean distance between the detected feature and the anomalous feature is used as the similarity value between the detected feature and the anomalous feature. The larger the Euclidean distance value, the smaller the similarity between the detected feature and the abnormal feature.

5. The industrial anomaly detection method according to claim 3, characterized in that, The construction process of the preset abnormal feature library includes: By using a pre-set training model, multiple abnormal features are extracted from multiple abnormal samples; The aforementioned multiple abnormal features are combined to form the abnormal feature library.

6. The industrial anomaly detection method according to claim 5, characterized in that, The construction process of the preset anomaly feature library also includes: Based on a greedy algorithm, abnormal features in the abnormal feature library are filtered.

7. The industrial anomaly detection method according to claim 1, characterized in that, The formats of the detection features, normal features, and abnormal features all include images and text.

8. An industrial anomaly detection device, characterized in that, include: The acquisition module is used to acquire detection features in the information to be tested, wherein the information to be tested is an image and text; The calculation module is used to calculate the first similarity between the detected feature and the preset normal feature, and the second similarity between the detected feature and the preset abnormal feature; wherein the abnormal feature is extracted from the preset abnormal sample and is used to characterize the sample abnormality, and the normal feature is extracted from the normal sample; and based on the reciprocal of the first similarity and the second similarity, the abnormality score of the information to be tested is determined. The calculation module is further configured to determine that the information to be tested is abnormal if the abnormal score is greater than a preset threshold. The number of detected features is multiple; determining the anomaly score of the information to be tested based on the reciprocal of the first similarity and the second similarity includes: normalizing the reciprocal of the first similarity and the second similarity of the multiple detected features respectively; and adding the results of the normalization to obtain the anomaly score.

9. An industrial anomaly detection device, characterized in that, It includes a processor and a memory, wherein the processor is connected to the memory: The processor is used to call and execute the program stored in the memory; The memory is used to store the program, which is at least used to execute the industrial anomaly detection method according to any one of claims 1-7.

Citation Information

Patent Citations

  • Abnormal access detection method and equipment

    CN108322428A

  • Image processing method and device for anomaly detection and neural network construction method

    CN115471725A