Abnormality detection method and device, electronic equipment, chip and medium

By high-dimensional mapping and clustering of bottleneck features generated by the twin autoencoder network, combined with feature extraction of the twin network, the problems of large noise interference and low accuracy in abnormal detection are solved, and efficient abnormal image detection is achieved.

CN119649111APending Publication Date: 2025-03-18CHINA MOBILE GROUP SICHUAN +1
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202411705450.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-26
Publication Date
2025-03-18

AI Technical Summary

Technical Problem

In the prior art, the noise interference in abnormal detection is large, resulting in low detection accuracy. Especially when the reconstruction error of normal data and some abnormal data is close, it is difficult to distinguish, and noise interference leads to large error of reconstruction images, which is wrongly classified as abnormal data.

Method used

By performing high-dimensional mapping of bottleneck features generated by the twin autoencoder network, clustering normal data, avoiding manually setting reconstruction thresholds, and using the twin network to better extract normal data features during training, reducing noise interference.

Benefits of technology

It effectively resists noise interference, improves the accuracy of abnormal detection, reduces the probability of misjudgment of normal data, and does not require manual threshold setting, achieving accurate distinction of abnormal images.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119649111A_ABST
    Figure CN119649111A_ABST
Patent Text Reader

Abstract

The invention provides an anomaly detection method and device, electronic equipment, a chip and a medium, and relates to the technical field of anomaly detection. The anomaly detection method comprises the steps of obtaining a to-be-detected image set; extracting high-dimensional features from the to-be-detected image set by using an encoder of the twin auto-encoder network and high-dimensional mapping, and clustering the high-dimensional features into a first clustering center and a second clustering center; according to the distance between the normal clustering center and the first clustering center and the distance between the normal clustering center and the second clustering center, a normal cluster center and an abnormal cluster center are determined, and the normal clustering center is generated through normal image data clustering processed by a twin auto-encoder network; and determining an abnormal image from the to-be-detected image set based on the normal cluster center and the abnormal cluster center. Through the technical scheme provided by the invention, the problems of large noise interference and low accuracy in anomaly detection are solved, the anomaly detection accuracy is improved, and the noise interference is reduced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of anomaly detection, and in particular to an anomaly detection method, device, electronic device, chip and medium. Background Art

[0002] In the related art, the accuracy of the anomaly detection algorithm using dual autoencoders depends on the dividing line between the reconstruction errors of normal data and abnormal data, that is, the setting of the threshold. However, in many cases, the reconstruction error obtained by the trained autoencoder on normal data is very close to the reconstruction error of some abnormal data, making it difficult to distinguish, and even overlapping, so this part of the abnormal data is difficult to detect successfully. In theory, in order to obtain a completely accurate dividing line, it is necessary to know all the abnormal data, but most of the anomalies in real life are unknown and difficult to predict. On the other hand, if there is some noise in the original picture, such as small black spots, when reconstructing, the reconstructed image will often have large errors due to the inability to accurately reconstruct the noise part, and then be mistakenly classified as abnormal data.

[0003] In other words, with regard to anomaly detection, the related technologies have the problem of large noise interference and low accuracy of anomaly detection. Summary of the invention

[0004] The present disclosure provides an anomaly detection method, device, electronic device, chip and medium to solve the problems of large noise interference and low accuracy in anomaly detection. By further performing high-dimensional mapping on the bottleneck features generated by the encoder, the high-dimensional features of the sample features are obtained and then the normal data is clustered, without the need to manually find a suitable reconstruction threshold. At the same time, the twin network is used during training to better extract the features of normal data, reduce noise interference, and reduce the probability of misjudgment of normal data.

[0005] A first aspect of the present disclosure provides an anomaly detection method, the method comprising:

[0006] Obtain a set of images to be detected;

[0007] Utilizing the encoder and high-dimensional mapping of the twin autoencoder network, high-dimensional features are extracted from the set of images to be detected, and the high-dimensional features are clustered into a first cluster center and a second cluster center;

[0008] Determine the normal cluster center and the abnormal cluster center according to the distance between the normal cluster center and the first cluster center and the second cluster center, wherein the normal cluster center is generated by clustering the normal image data processed by the twin autoencoder network;

[0009] Based on the normal cluster center and the abnormal cluster center, the abnormal image is determined from the set of images to be detected.

[0010] In one embodiment of the present disclosure, before comparing the first distance between the normal cluster center and the first cluster center and the second distance between the normal cluster center and the first cluster center, the method further includes:

[0011] Based on the sample images in the training image set, the bottleneck features of the sample images are extracted through the encoder of the twin autoencoder network;

[0012] The bottleneck features are mapped into reference high-dimensional features through high-dimensional mapping;

[0013] Based on the bottleneck features, the sample image is reconstructed into the target sample image through the decoder of the twin autoencoder network;

[0014] According to the sample image and the twin autoencoder network, the parameter set of the twin autoencoder network is updated by the gradient descent algorithm until the reconstruction error between the sample image and the target sample image converges, thereby obtaining a high-dimensional feature set composed of reference high-dimensional features;

[0015] Cluster the high-dimensional feature set into a target cluster, and use the center of the target cluster as the normal clustering center.

[0016] In one embodiment of the present disclosure, a twin autoencoder network includes two identical autoencoders that share a parameter set. The autoencoders include an input layer, a feature encoding layer, a feature decoder, and an output layer. The distance between reference high-dimensional features between the autoencoders is used as a similarity measure, and the weighted sum of the reconstruction error and the similarity measure is the loss function.

[0017] In one embodiment of the present disclosure, determining a normal cluster center and an abnormal cluster center according to the distances between the normal cluster center and the first cluster center and the second cluster center includes:

[0018] Determine a first distance between the normal cluster center and the first cluster center;

[0019] determining a second distance between the normal cluster center and the second cluster center;

[0020] Compare the numerical values ​​of the first distance and the second distance. If the first distance is less than or equal to the second distance, the cluster center corresponding to the first distance is used as the normal cluster center, and the cluster center corresponding to the second distance is used as the abnormal cluster center. If the first distance is greater than the second distance, the cluster center corresponding to the first distance is used as the abnormal cluster center, and the cluster center corresponding to the second distance is used as the normal cluster center.

[0021] In one embodiment of the present disclosure, based on the normal cluster center and the abnormal cluster center, determining an abnormal image from a set of images to be detected includes:

[0022] Obtain a target image from a set of images to be detected;

[0023] Encode the target image as the first bottleneck feature using the encoder of the Siamese autoencoder network;

[0024] Map the first bottleneck feature into a target high-dimensional feature;

[0025] According to the distance values ​​between the target high-dimensional features and the centers of the normal cluster and the abnormal cluster, the target label of the target image is determined, and the target label includes a normal image and an abnormal image.

[0026] In one embodiment of the present disclosure, determining a label of a target image according to the distance values ​​between the target high-dimensional feature and the normal cluster center and the abnormal cluster center includes:

[0027] The distance between the target high-dimensional feature and the center of the normal cluster is taken as the first target distance;

[0028] The distance between the target high-dimensional feature and the center of the abnormal cluster is taken as the second target distance;

[0029] The numerical values ​​of the first target distance and the second target distance are compared. If the first target distance is greater than or equal to the second target distance, the target label is set as an abnormal image. If the first target distance is less than the second target distance, the target label is set as a normal image.

[0030] A second aspect of the present disclosure provides an abnormality detection device, the device comprising:

[0031] An acquisition module, used to acquire a set of images to be detected;

[0032] A clustering module, for extracting high-dimensional features from a set of images to be detected using an encoder and a high-dimensional mapping of a twin autoencoder network, and clustering the high-dimensional features into a first clustering center and a second clustering center;

[0033] A determination module, used to determine a normal cluster center and an abnormal cluster center according to the distance between the normal cluster center and the first cluster center and the second cluster center, wherein the normal cluster center is generated by clustering the normal image data processed by the twin autoencoder network;

[0034] The classification module is used to determine abnormal images from the set of images to be detected based on the normal cluster center and the abnormal cluster center.

[0035] The third aspect embodiment of the present disclosure proposes an electronic device, comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute any one of the methods in the first aspect embodiment of the present disclosure.

[0036] The fourth aspect embodiment of the present disclosure proposes a non-transitory computer-readable storage medium storing computer instructions, characterized in that the computer instructions are used to enable a computer to execute the method in the first aspect embodiment of the present disclosure.

[0037] The fifth aspect embodiment of the present disclosure proposes a computer program product, characterized in that it includes a computer program, and when the computer program is executed by a processor, it implements any method in the first aspect embodiment of the present disclosure.

[0038] The sixth aspect embodiment of the present disclosure proposes a chip, comprising at least one processor and a communication interface; the communication interface is used to receive signals input into the chip or signals output from the chip, the processor communicates with the communication interface and implements any one of the methods in the first aspect embodiment of the present disclosure through logic circuits or execution code instructions.

[0039] In summary, according to the anomaly detection method proposed in the present disclosure, the following beneficial effects can be achieved:

[0040] The image set to be detected is obtained to provide detection objects for anomaly detection; the encoder and high-dimensional mapping of the twin autoencoder network are used to extract high-dimensional features from the image set to be detected, and the high-dimensional features are clustered into a first cluster center and a second cluster center, thereby extracting high-dimensional features that effectively resist noise interference and providing preparation for the clear division of abnormal data and normal data; the normal cluster center and the abnormal cluster center are determined according to the distance between the normal cluster center and the first cluster center and the second cluster center, wherein the normal cluster center is generated by clustering the normal image data processed by the twin autoencoder network, and a reference quantity that can clearly distinguish abnormal data from normal data in terms of distance is obtained; based on the normal cluster center and the abnormal cluster center, the abnormal image is determined from the image set to be detected, without manually setting a threshold, and the data in the abnormal image is effectively distinguished through better detection capabilities. The accuracy of anomaly detection is improved and noise interference is reduced.

[0041] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS

[0042] The drawings herein are incorporated into and constitute a part of the specification, illustrate embodiments consistent with the present disclosure, and together with the description are used to explain the principles of the present disclosure, and do not constitute improper limitations on the present disclosure.

[0043] Figure 1 is a flow chart of an abnormality detection method according to an embodiment of the present disclosure;

[0044] Figure 2A flowchart of determining a normal cluster center according to an embodiment of the present disclosure;

[0045] Figure 3 is a schematic diagram of an autoencoder according to an embodiment of the present disclosure;

[0046] Figure 4 A schematic diagram of a twin autoencoder network according to an embodiment of the present disclosure;

[0047] Figure 5 A flowchart of an embodiment of the present disclosure for determining a normal cluster center and an abnormal cluster center according to distances between a normal cluster center and a first cluster center and a second cluster center;

[0048] Figure 6 A flowchart of determining an abnormal image from a set of images to be detected based on a normal cluster center and an abnormal cluster center according to an embodiment of the present disclosure;

[0049] Figure 7 A flowchart of an embodiment of the present disclosure for determining a label of a target image according to distance values ​​between a target high-dimensional feature and a normal cluster center and an abnormal cluster center;

[0050] Figure 8 A flow chart of determining a normal cluster center using a clustering algorithm according to an embodiment of the present disclosure;

[0051] Fig. 9 It is a structural schematic diagram of an abnormality detection device according to an embodiment of the present disclosure;

[0052] Fig.10 is a block diagram of an electronic device for implementing the abnormality detection method disclosed herein according to an exemplary embodiment;

[0053] Fig.11 It is a schematic diagram of the structure of the chip of the embodiment of the present disclosure. DETAILED DESCRIPTION

[0054] Embodiments of the present disclosure are described in detail below, and examples of the embodiments are shown in the accompanying drawings, wherein the same or similar reference numerals throughout identify the same or similar originals or elements having the same or similar functions. The embodiments described below with reference to the accompanying drawings are exemplary and are intended to be used to explain the present disclosure, and should not be construed as limiting the present disclosure.

[0055] Anomaly detection is a key technology that aims to identify abnormal data and events that do not conform to normal patterns or behaviors. It can detect illegal intrusions and provide early warnings for timely combating network attacks. Various anomaly detection models are widely used in video anomalies, fraud detection, medical detection, and text detection. In recent years, the rapid development of deep learning has attracted great attention to anomaly detection methods based on autoencoders.

[0056] The autoencoder consists of an encoder and a decoder. First, the autoencoder model is trained using normal samples. The encoder maps the input data to a low-dimensional representation to obtain the bottleneck features after sample compression; the decoder then reconstructs the sample from the bottleneck features. When performing anomaly detection, the error between the original features of the sample and the reconstructed sample is used to determine whether it is abnormal data. By only receiving normal data for training, the autoencoder has an advantage in reconstructing normal data, with better reconstruction effect and smaller reconstruction error, while the reconstruction effect for abnormal data is worse. Therefore, there is a threshold between the reconstruction error of normal data and abnormal data in theory. The reconstruction error of normal data is less than the threshold, and the reconstruction error of abnormal data is greater than the threshold. When performing anomaly detection, the relationship between the compared anomaly score and the threshold can be used to determine whether it is abnormal data.

[0057] On the one hand, the accuracy of the anomaly detection algorithm using dual autoencoders depends on the dividing line between the reconstruction errors of normal data and abnormal data, that is, the setting of the threshold. However, in many cases, the reconstruction errors obtained by the trained autoencoder on normal data are very close to the reconstruction errors of some abnormal data, making it difficult to distinguish them, and even overlapping. Therefore, this part of the abnormal data is difficult to detect successfully. In theory, in order to obtain a completely accurate dividing line, all the abnormal data must be known, but most of the anomalies in real life are unknown and difficult to predict.

[0058] On the other hand, if there is some noise in the original image, such as small black dots, during reconstruction, the reconstructed image will often have large errors due to the inability to accurately reconstruct the noise part, and will be mistakenly classified as abnormal data.

[0059] To solve the above problems, this proposal proposes a clustering anomaly detection method based on autoencoders. By further performing high-dimensional mapping on the bottleneck features generated by the encoder, the high-dimensional features of the sample features are obtained and then the normal data is clustered. There is no need to manually find a suitable reconstruction threshold. At the same time, the twin network is used during training to better extract the features of normal data, reduce noise interference, and reduce the probability of misjudgment of normal data.

[0060] The method proposed in the present disclosure is applied to anomaly detection tasks, and its application has a wide range of scenarios. In the financial field, it can be used for fraud detection. In the case of credit card transactions, loan applications, etc., the technology is used to identify potential fraudulent behavior, and abnormal transactions are discovered in a timely manner by analyzing transaction images or data patterns. In the security field, it can be used in network security scenarios to monitor network traffic and user behavior, and identify abnormal behavior by analyzing image data (such as images taken by surveillance cameras) to prevent network attacks or intrusions. In the medical field, it can be used in disease monitoring scenarios. In medical image analysis, the technology is used to detect diseased tissues or abnormal physiological parameters to help doctors quickly identify potential health problems. In the field of traffic monitoring, it can be used in illegal behavior identification scenarios. Through traffic monitoring video analysis, traffic violations such as running red lights and speeding can be identified, and traffic management efficiency can be improved through abnormal detection of image data. In the e-commerce field, it can be used in malicious activity monitoring scenarios. In e-commerce platforms, the technology is used to identify malicious order brushing, false evaluation and other behaviors, and the normal operation of the platform is maintained by analyzing transaction images and user behavior patterns. In the manufacturing industry, it can be used in quality control scenarios. On the production line, by detecting anomalies in product images, production defects or unqualified products can be discovered in a timely manner, thereby improving product quality and production efficiency. In the field of ecological monitoring, it can be used in environmental protection scenarios. By performing anomaly detection on images taken by satellites or drones, abnormal phenomena in the ecological environment, such as illegal logging and pollution, can be identified to provide data support for environmental protection. In the field of research and development, it can be used in scenarios for new feature discovery. In scientific research, by analyzing images of experimental data, new features or patterns can be discovered to provide a basis for subsequent research. This technical solution extracts high-dimensional features and clusters them through a twin autoencoder network, effectively distinguishing between normal and abnormal images, and providing strong support for applications in various fields. The application scenarios are not limited in the disclosed embodiments.

[0061] The anomaly detection method provided by the present disclosure is described in detail below with reference to the accompanying drawings.

[0062] Figure 1 FIG. 1 is a flow chart of an abnormality detection method according to an embodiment of the present disclosure. Figure 1 In the illustrated embodiment, the anomaly detection method comprises:

[0063] Step 101: Obtain a set of images to be detected.

[0064] The image set to be detected refers to a data set consisting of a large number of images, including normal images and abnormal images. The image set to be detected can be downloaded from the Internet or compiled by oneself.

[0065] Step 102, using the encoder and high-dimensional mapping of the twin autoencoder network, extract high-dimensional features from the set of images to be detected, and cluster the high-dimensional features into a first cluster center and a second cluster center.

[0066] The twin autoencoder network refers to a special neural network architecture consisting of two identical autoencoders that share the same weights and parameters. This design allows the network to maintain consistency and symmetry when processing input data. Each autoencoder is responsible for extracting features from the input data, usually by compressing a low-dimensional space (encoding) and reconstructing it back to the original space (decoding), which helps to learn the potential representation of the input data. High-dimensional mapping refers to the process of converting data from a low-dimensional space to a high-dimensional space. This mapping is usually used to solve the problem of linear inseparability in low-dimensional space, so that data can be linearly separated in high-dimensional space. High-dimensional features usually refer to the case where the number of features is greater than three, which represents the image data in a high-dimensional space. The first cluster center refers to a cluster center formed by clustering high-dimensional features, and the second cluster center refers to another cluster center formed by clustering high-dimensional features, which is opposite to the first cluster center. The encoder of the twin autoencoder network is used to obtain the encoded image data and map it to a high-dimensional space. The high-dimensional features are extracted from the representation of the image data of the image set to be detected in the high-dimensional space. Based on this high-dimensional feature, clustering is performed into two categories, one is the first cluster center, and the other is the second cluster center.

[0067] Step 103, determining the normal cluster center and the abnormal cluster center according to the distance between the normal cluster center and the first cluster center and the second cluster center, wherein the normal cluster center is generated by clustering the normal image data processed by the twin autoencoder network.

[0068] The normal cluster center refers to the cluster center position of the normal image obtained by the clustering algorithm after the twin autoencoder network completes model training. The normal cluster center refers to the position in the high-dimensional feature set of the normal image, and the abnormal cluster center refers to the position in the high-dimensional feature set of the abnormal image. The normal cluster center and the abnormal cluster center can be obtained by comparing the distance between the normal cluster center and the first cluster center and the distance between the normal cluster center and the second cluster center.

[0069] Step 104: determine abnormal images from the set of images to be detected based on the normal cluster center and the abnormal cluster center.

[0070] Abnormal images refer to images that are significantly different from the expected normal mode in part or as a whole. These differences may appear as abnormalities in color, texture, shape or other visual features, usually reflecting potential problems or defects. The high-dimensional features of the image to be detected are used to classify the image to be detected and the distance between the center of the normal cluster and the center of the abnormal cluster, so as to detect abnormal images.

[0071] In summary, according to the anomaly detection method proposed in the present disclosure, a set of images to be detected is obtained, providing a detection object for anomaly detection; high-dimensional features are extracted from the set of images to be detected by using the encoder and high-dimensional mapping of the twin autoencoder network, and the high-dimensional features are clustered into a first cluster center and a second cluster center, thereby extracting high-dimensional features that effectively resist noise interference and providing preparation for the clear division of abnormal data and normal data; according to the distance between the normal cluster center and the first cluster center and the second cluster center, the normal cluster center and the abnormal cluster center are determined, wherein the normal cluster center is generated by clustering the normal image data processed by the twin autoencoder network, and a reference quantity that can clearly distinguish abnormal data from normal data in terms of distance is obtained; based on the normal cluster center and the abnormal cluster center, abnormal images are determined from the set of images to be detected, without manually setting a threshold, and the data in the abnormal images are effectively distinguished through better detection capabilities. The accuracy of anomaly detection is improved and noise interference is reduced.

[0072] Figure 2 The present invention is a flowchart for determining a normal cluster center according to an embodiment of the present invention. Figure 2 Yes Figure 1 The instructions given before step 103 are based on Figure 2 The embodiment shown comprises the following steps:

[0073] Step 201, based on the sample image of the training image set, extract the bottleneck features of the sample image through the encoder of the twin autoencoder network.

[0074] The sample image refers to any image in the training image set. The bottleneck feature refers to the feature of the sample after compression obtained by mapping the input data of the sample to a low-dimensional representation. Before determining the normal cluster center and the abnormal cluster center based on the distance between the normal cluster center and the first cluster center and the second cluster center, it is necessary to first have the normal cluster center, and based on all the sample images in the training image set, use the encoder of the twin autoencoder network to extract the bottleneck feature of the sample image.

[0075] Step 202: The bottleneck feature is converted into a reference high-dimensional feature through high-dimensional mapping.

[0076] Reference high-dimensional features refer to the features formed by low-dimensional bottleneck features through high-dimensional mapping. In order to obtain deeper feature information, the bottleneck features are mapped to reference high-dimensional features through high-dimensional mapping.

[0077] Step 203: Based on the bottleneck features, the sample image is reconstructed into a target sample image through the decoder of the twin autoencoder network.

[0078] The target sample image refers to the image reconstructed by the sample image through the autoencoder. Based on the bottleneck features extracted from the sample image by the encoder of the autoencoder, the sample image is reconstructed into the target sample image through the decoder of the twin autoencoder network. This reconstruction process is achieved by minimizing the reconstruction error during training.

[0079] Step 204, based on the sample image and the twin autoencoder network, update the parameter set of the twin autoencoder network through the gradient descent algorithm until the reconstruction error between the sample image and the target sample image converges, and obtain a high-dimensional feature set composed of reference high-dimensional features.

[0080] The high-dimensional feature set refers to a set of high-dimensional features obtained by encoding and high-dimensional mapping the target table sample images of the training image set in the process of training the encoder twin model through the target sample images and the twin autoencoder network. According to the sample images of the training image set and the twin autoencoder network, the parameter set of the twin autoencoder network is updated by the gradient descent algorithm until the reconstruction error between the sample image and the target sample image converges, and a high-dimensional feature set formed by high-dimensional features can be obtained. Optionally, the gradient descent algorithm includes stochastic gradient descent, batch gradient descent, and mini-batch gradient descent. Preferably, the gradient descent algorithm uses stochastic gradient descent.

[0081] Step 205: cluster the high-dimensional feature set into a target cluster, and use the center of the target cluster as a normal clustering center.

[0082] The target cluster refers to the clustering result obtained by using a clustering algorithm to take a high-dimensional feature set as the input data of the clustering algorithm and clustering it into a category. The center of the target cluster is used as the normal clustering center. Optionally, in the present disclosure, clustering is performed by a K-means algorithm.

[0083] In one implementation of this embodiment, the encoder twin model is trained through the following steps.

[0084] Step 1: Input training image set X train ={x1, x2, ..., x n}, n represents the number of images in the training data set;

[0085] Step 2: Obtain the bottleneck feature z1 of the training image through the encoder E; z1 is further transformed into the high-dimensional feature X1 through high-dimensional mapping;

[0086] Step 3: Get the reconstructed image through decoder D

[0087] Step 4: Set the values ​​of α and β, and update the parameter set θ using the following formula and stochastic gradient descent method: E ,θD ,θ map ;

[0088]

[0089] In the formula, α and β represent the weights of each loss function. They are hyperparameters set manually during the model training process and can be set according to the experimental results.

[0090] Step 5: After all training is completed, use the K-means algorithm to find the normal image cluster center c normal (K=1).

[0091] In this embodiment, normal clustering centers that can be used to define abnormal images and normal images are obtained by training the twin autoencoder network.

[0092] In one embodiment of the present disclosure, a twin autoencoder network includes two identical autoencoders that share a parameter set. The autoencoders include an input layer, a feature encoding layer, a feature decoder, and an output layer. The distance between reference high-dimensional features between the autoencoders is used as a similarity measure, and the weighted sum of the reconstruction error and the similarity measure is the loss function.

[0093] Figure 3 Schematic diagram of an autoencoder according to an embodiment of the present disclosure. Figure 3 As shown in the figure, the autoencoder extracts features by reconstructing the image. The features of the input image are compressed and stored in a hidden layer that describes the nonlinear representation of the sample. The nonlinear representation of the image sample is called the bottleneck feature. The autoencoder minimizes the input sample x and the reconstructed sample The error between them is used to gradually update the parameters of the encoder and decoder, where the encoding process uses f θ (·) indicates that the decoding process is represented by g θ (·) indicates that. In the autoencoder part, the input sample x is passed through the encoder to obtain the bottleneck feature z, and then decoded according to the learned bottleneck feature to obtain the reconstructed sample The specific calculation process is expressed as follows, where θ represents the parameter group of the encoder and decoder.

[0094] z=f θ (x)

[0095]

[0096] In order to make the autoencoder better at reconstructing normal data, it is only necessary to minimize the reconstruction error during training. That's it.

[0097] Figure 4 Schematic diagram of a twin autoencoder network of an embodiment of the present disclosure. Figure 4 As shown, input normal image x i Training is performed by minimizing the difference between the reconstruction error and the high-dimensional features between normal images, taking the MNIST dataset as an example.

[0098] Assuming that the images of category "9" in the MNIST dataset are normal data, first, the model in this scheme enables the encoder to obtain better bottleneck features by minimizing the reconstruction error of the samples, thereby obtaining better reconstructed samples through the decoder, which is specifically expressed as follows, where and To reconstruct the sample, θ E ,θ D are the parameter sets for the encoder and decoder respectively.

[0099]

[0100] Secondly, although all images of "9" are different, they should be classified as normal data. From another perspective, the representations of different "9" samples in high-dimensional space should be similar. In the figure above, two different "9" samples are obtained after passing through the encoder to obtain their respective bottleneck features, and then the high-dimensional features of the corresponding samples are obtained through high-dimensional mapping. In order to make the spatial distance of normal samples more concentrated, their distance should be shortened as much as possible during the training process, as shown below, where θ map The parameter set represents the high-dimensional mapping. Encoders E1 and E2 share a set of parameter sets, and decoders D1 and D2 share a set of parameter sets.

[0101]

[0102] Therefore, the model training goal of this method is to minimize the following loss function. α and β represent the weights of each loss function. They are hyperparameters set artificially during the model training process and can be set according to the experimental results.

[0103]

[0104] In this embodiment, during the training process, by using the twin autoencoder network, similar samples can be clustered more closely together in high-dimensional space, which helps the encoder to more accurately extract the high-dimensional features of the data. This way of focusing on the overall characteristics of normal samples allows the encoder to ignore noise interference such as small black dots. In this way, the twin autoencoder network can improve the anomaly detection system's ability to distinguish normal samples, reduce the risk of misjudgment, and enhance sensitivity to real abnormal situations.

[0105] Figure 5The present invention is a flowchart of an embodiment of the present invention for determining a normal cluster center and an abnormal cluster center according to the distances between the normal cluster center and the first cluster center and the second cluster center. Figure 5 Yes Figure 1 The specific description of step 103 is based on Figure 5 The embodiment shown comprises the following steps:

[0106] Step 501: determine a first distance between a normal cluster center and a first cluster center.

[0107] The first distance refers to the distance between two high-dimensional vectors, specifically the first distance between the normal cluster center and the first cluster center. Optionally, it is represented by Euclidean distance, Manhattan distance, cosine similarity, etc. Preferably, it is represented by Euclidean distance. The first distance reflects the distance between the first cluster center and the normal cluster center.

[0108] Step 502: Determine a second distance between the normal cluster center and the second cluster center.

[0109] The second distance refers to the second distance between the normal cluster center and the second cluster center. Similar to the first distance, the second distance reflects the distance between the second cluster center and the normal cluster center.

[0110] Step 503, compare the numerical values ​​of the first distance and the second distance. If the first distance is less than or equal to the second distance, the cluster center corresponding to the first distance is used as the normal cluster center, and the cluster center corresponding to the second distance is used as the abnormal cluster center. If the first distance is greater than the second distance, the cluster center corresponding to the first distance is used as the abnormal cluster center, and the cluster center corresponding to the second distance is used as the normal cluster center.

[0111] After determining the first distance and the second distance, compare the numerical values ​​of the first distance and the second distance. If the first distance is less than or equal to the second distance, it means that the first cluster center is closer to the normal cluster center, and the cluster center corresponding to the first distance, that is, the first cluster center, is used as the normal cluster center; the cluster center corresponding to the second distance, that is, the second cluster center, is used as the abnormal cluster center. If the first distance is greater than the second distance, it means that the second cluster center is closer to the normal cluster center, and the second cluster center is used as the normal cluster center, and the first cluster center is used as the abnormal cluster center.

[0112] In this embodiment, by determining the normal cluster center and the abnormal cluster center, a reference quantity that can clearly distinguish abnormal data from normal data in terms of distance is obtained, without presetting a fixed threshold, and adaptive generation of the dividing line in abnormal detection is achieved.

[0113] Figure 6The present invention is a flowchart of an embodiment of the present invention for determining abnormal images from a set of images to be detected based on normal cluster centers and abnormal cluster centers. Figure 6 Yes Figure 1 The specific description of step 104 is based on Figure 6 The embodiment shown comprises the following steps:

[0114] Step 601: Acquire a target image in a set of images to be detected.

[0115] The target image is any image to be detected for anomaly in the set of images to be detected. An image is obtained from the set of images to be detected as the target image.

[0116] Step 602, using the encoder of the twin autoencoder network to encode the target image into a first bottleneck feature.

[0117] The first bottleneck feature refers to the feature data extracted by the encoder of the autoencoder from the input target image. The encoder of the twin autoencoder network is used to extract features (encode) the target image as the first bottleneck feature.

[0118] Step 603: Map the first bottleneck feature to a target high-dimensional feature in high-dimensional form.

[0119] The target high-dimensional feature refers to the mapping result of the first bottleneck feature in the high-dimensional space. The first bottleneck feature is mapped to the high-dimensional space through high-dimensional mapping to form the target high-dimensional feature.

[0120] Step 604, determining a target label of the target image according to the distance values ​​between the target high-dimensional feature and the normal cluster center and the abnormal cluster center, where the target label includes a normal image and an abnormal image.

[0121] The target label refers to the classification result of the target image, including normal images and abnormal images. According to the comparison of the distance value between the target high-dimensional feature and the center of the normal cluster and the distance value between the center of the abnormal cluster, the target label of the target image can be determined and the result of abnormality detection can be obtained.

[0122] Figure 7 The present invention is a flowchart of an embodiment of the present invention for determining a label of a target image according to distance values ​​between a target high-dimensional feature and a normal cluster center and an abnormal cluster center. Figure 7 Yes Figure 6 The specific description of step 604 is based on Figure 7 The embodiment shown comprises the following steps:

[0123] Step 701: The distance between the target high-dimensional feature and the center of the normal cluster is taken as the first target distance.

[0124] When performing anomaly detection on an image, first, the distance between the target high-dimensional feature and the center of the normal cluster is calculated as the first target distance.

[0125] Step 702: The distance between the target high-dimensional feature and the center of the abnormal cluster is used as the second target distance.

[0126] Secondly, the distance between the target high-dimensional feature and the center of the abnormal cluster is calculated as the second target distance.

[0127] Step 703, compare the numerical values ​​of the first target distance and the second target distance. If the first target distance is greater than or equal to the second target distance, set the target label as an abnormal image; if the first target distance is less than the second target distance, set the target label as a normal image.

[0128] The target label refers to the abnormal detection result of the image to be detected. After determining the first target distance and the second target distance, compare the numerical values ​​of the first target distance and the second target distance. If the first target distance is greater than or equal to the second target distance, it means that the target high-dimensional feature is closer to the center of the abnormal cluster, then the target label is set to the abnormal image. If the first target distance is less than the second target distance, it means that the target high-dimensional feature is closer to the center of the normal cluster, then the target label is set to the normal image.

[0129] In this embodiment, based on the comparison between the distance between the target high-dimensional feature and the center of the normal cluster and the distance between the target high-dimensional feature and the center of the abnormal cluster, the target label of the image corresponding to the target high-dimensional feature, i.e., the classification result, is obtained, thereby realizing the abnormal detection of the image, improving the accuracy of the abnormal detection, and reducing the noise interference.

[0130] Figure 8 FIG. 1 is a flow chart of using a clustering algorithm to determine a normal cluster center according to an embodiment of the present disclosure. Figure 8 As shown,

[0131] Use the K-means algorithm to cluster the existing normal data, set the number of classification clusters to 1, that is, K = 1, so as to find the cluster center C of the high-dimensional features of all normal samples normal The center obtained by clustering is the cluster center of the normal data in the current data set. When performing anomaly detection, it is only necessary to perform K-means clustering on all test sample data and set the number of classification clusters to 2, that is, K = 2. The purpose is to divide the test image into two different clusters, normal and abnormal, through the clustering algorithm. After clustering is completed, compare the two cluster centers with C normal The distance between them is , and a cluster with a closer distance is selected, and the data in this cluster is judged as normal data.

[0132] When performing anomaly detection, follow the steps below:

[0133] Step 1: Input the test image set X to be tested test ={x1, x2, ..., x N}, N represents the number of test images;

[0134] Step 2: Obtain the high-dimensional features X of all images through the encoder and high-dimensional mapping j ;

[0135] Step 3: Use K-Means algorithm to transform X in step 2 j , (j=1,2,…,N) for clustering, setting the number of clusters of the algorithm to K=2, and obtaining two different cluster centers C1 and C2;

[0136] Step 4: Compare C1, C2 and the cluster center C of the normal data obtained by training normal If |C1-C normal ||<||C2-C normal ||, then C1 is the normal image set X normal The cluster center of C2 is the abnormal image set X abnormal The cluster center; if ||C1-C normal ||<||C2-C normal || Then c2 is the normal image set X normal The cluster center of C1 is the abnormal image set X abnormal The cluster center of

[0137] Step 5: Output normal image dataset X normal and abnormal image dataset X abnormal .

[0138] Using this scheme for image anomaly detection tasks can better extract high-dimensional features of image samples, thereby effectively resisting noise interference, and solving the problems of unclear reconstruction errors between normal data and abnormal data and difficult threshold determination, thereby improving the detection accuracy of abnormal images.

[0139] The disclosed embodiment proposes an anomaly detection method, which obtains a set of images to be detected, and provides a detection object for anomaly detection; uses the encoder and high-dimensional mapping of the twin autoencoder network to extract high-dimensional features from the set of images to be detected, and clusters the high-dimensional features into a first cluster center and a second cluster center, extracts high-dimensional features that effectively resist noise interference, and provides preparation for the clear division of abnormal data and normal data; determines the normal cluster center and the abnormal cluster center according to the distance between the normal cluster center and the first cluster center and the second cluster center, wherein the normal cluster center is generated by clustering the normal image data processed by the twin autoencoder network, and obtains a reference quantity that can clearly distinguish abnormal data from normal data in terms of distance; based on the normal cluster center and the abnormal cluster center, determines the abnormal image from the set of images to be detected, without manually setting a threshold, and effectively distinguishes the data in the abnormal image through better detection capabilities. The accuracy of anomaly detection is improved and noise interference is reduced.

[0140] Corresponding to the methods provided in the above-mentioned embodiments, the present disclosure also provides an anomaly detection device. Since the device provided in the embodiment of the present disclosure corresponds to the methods provided in the above-mentioned embodiments, the implementation method of the method is also applicable to the device provided in this embodiment and will not be described in detail in this embodiment.

[0141] Fig. 9 FIG. 9 is a schematic diagram of the structure of an abnormality detection device 900 according to an embodiment of the present disclosure. Fig. 9 As shown, the abnormality detection device includes:

[0142] An acquisition module 910 is used to acquire a set of images to be detected;

[0143] A clustering module 920 is used to extract high-dimensional features from the set of images to be detected using the encoder and high-dimensional mapping of the twin autoencoder network, and cluster the high-dimensional features into a first cluster center and a second cluster center;

[0144] A determination module 930, configured to determine a normal cluster center and an abnormal cluster center according to distances between the normal cluster center and the first cluster center and the second cluster center, wherein the normal cluster center is generated by clustering normal image data processed by the twin autoencoder network;

[0145] The classification module 940 is used to determine abnormal images from the set of images to be detected based on the normal cluster centers and the abnormal cluster centers.

[0146] In some embodiments, before determining the normal cluster center and the abnormal cluster center according to the distances between the normal cluster center and the first cluster center and the second cluster center, the determination module 930 is further configured to:

[0147] Based on the sample images in the training image set, the bottleneck features of the sample images are extracted through the encoder of the twin autoencoder network;

[0148] The bottleneck features are mapped into reference high-dimensional features through high-dimensional mapping;

[0149] Based on the bottleneck features, the sample image is reconstructed into the target sample image through the decoder of the twin autoencoder network;

[0150] According to the sample image and the twin autoencoder network, the parameter set of the twin autoencoder network is updated by the gradient descent algorithm until the reconstruction error between the sample image and the target sample image converges, thereby obtaining a high-dimensional feature set composed of reference high-dimensional features;

[0151] Cluster the high-dimensional feature set into a target cluster, and use the center of the target cluster as the normal clustering center.

[0152] In some embodiments, the twin autoencoder network includes two identical autoencoders, which share a parameter set. The autoencoders include an input layer, a feature encoding layer, a feature decoder and an output layer. The distance of reference high-dimensional features between the autoencoders is used as a similarity measure, and the weighted sum of the reconstruction error and the similarity measure is the loss function.

[0153] In some embodiments, the determination module 930 is used to:

[0154] Determine a first distance between the normal cluster center and the first cluster center;

[0155] determining a second distance between the normal cluster center and the second cluster center;

[0156] Compare the numerical values ​​of the first distance and the second distance. If the first distance is less than or equal to the second distance, the cluster center corresponding to the first distance is used as the normal cluster center, and the cluster center corresponding to the second distance is used as the abnormal cluster center. If the first distance is greater than the second distance, the cluster center corresponding to the first distance is used as the abnormal cluster center, and the cluster center corresponding to the second distance is used as the normal cluster center.

[0157] In some embodiments, the classification module 940 is used to:

[0158] Obtain a target image from a set of images to be detected;

[0159] Encode the target image as the first bottleneck feature using the encoder of the Siamese autoencoder network;

[0160] Map the first bottleneck feature into a target high-dimensional feature;

[0161] According to the distance values ​​between the target high-dimensional features and the centers of the normal cluster and the abnormal cluster, the target label of the target image is determined, and the target label includes a normal image and an abnormal image.

[0162] In some embodiments, the classification module 940 determines the label of the target image according to the distance values ​​between the target high-dimensional feature and the normal cluster center and the abnormal cluster center in the following manner:

[0163] The distance between the target high-dimensional feature and the center of the normal cluster is taken as the first target distance;

[0164] The distance between the target high-dimensional feature and the center of the abnormal cluster is taken as the second target distance;

[0165] The numerical values ​​of the first target distance and the second target distance are compared. If the first target distance is greater than or equal to the second target distance, the target label is set as an abnormal image. If the first target distance is less than the second target distance, the target label is set as a normal image.

[0166] In summary, through the anomaly detection device, a set of images to be detected is obtained; the encoder and high-dimensional mapping of the twin autoencoder network are used to extract high-dimensional features from the set of images to be detected, and the high-dimensional features are clustered into the first cluster center and the second cluster center; the normal cluster center and the abnormal cluster center are determined according to the distance between the normal cluster center and the first cluster center and the second cluster center, wherein the normal cluster center is generated by clustering the normal image data processed by the twin autoencoder network; based on the normal cluster center and the abnormal cluster center, the abnormal image is determined from the set of images to be detected. This device solves the problems of large noise interference and low accuracy in anomaly detection, improves the accuracy of anomaly detection, and reduces noise interference.

[0167] In the above embodiments provided by the present disclosure, the methods and devices provided by the embodiments of the present disclosure are introduced. In order to implement the functions in the methods provided by the above embodiments of the present disclosure, the electronic device may include a hardware structure and a software module, and implement the above functions in the form of a hardware structure, a software module, or a hardware structure plus a software module. One of the above functions may be executed in the form of a hardware structure, a software module, or a hardware structure plus a software module.

[0168] Fig.10 is a block diagram of an electronic device 1000 for implementing the above abnormality detection method according to an exemplary embodiment.

[0169] For example, the electronic device 1000 may be a mobile phone, a computer, a messaging device, a game console, a tablet device, a medical device, a fitness device, a personal digital assistant, etc.

[0170] Reference Fig.10, the electronic device 1000 may include one or more of the following components: a processing component 1002 , a memory 1004 , a power component 1006 , a multimedia component 1008 , an audio component 1010 , an input / output (I / O) interface 1012 , a sensor component 1014 , and a communication component 1016 .

[0171] The processing component 1002 generally controls the overall operation of the electronic device 1000, such as operations associated with display, phone calls, data communications, camera operations, and recording operations. The processing component 1002 may include one or more processors 1020 to execute instructions to complete all or part of the steps of the above-mentioned method. In addition, the processing component 1002 may include one or more modules to facilitate the interaction between the processing component 1002 and other components. For example, the processing component 1002 may include a multimedia module to facilitate the interaction between the multimedia component 1008 and the processing component 1002.

[0172] The memory 1004 is configured to store various types of data to support operations on the electronic device 600. Examples of such data include instructions for any application or method operating on the electronic device 1000, contact data, phone book data, messages, pictures, videos, etc. The memory 1004 can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic disk or optical disk.

[0173] The power supply component 1006 provides power to various components of the electronic device 1000. The power supply component 1006 may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power to the electronic device 1000.

[0174] The multimedia component 1008 includes a screen that provides an output interface between the electronic device 1000 and the user. In some embodiments, the screen may include a liquid crystal display (LCD) and a touch panel (TP). If the screen includes a touch panel, the screen may be implemented as a touch screen to receive input signals from the user. The touch panel includes one or more touch sensors to sense touch, slide, and gestures on the touch panel. The touch sensor may not only sense the boundaries of the touch or slide action, but also detect the duration and pressure associated with the touch or slide operation. In some embodiments, the multimedia component 1008 includes a front camera and / or a rear camera. When the electronic device 1000 is in an operating mode, such as a shooting mode or a video mode, the front camera and / or the rear camera may receive external multimedia data. Each front camera and rear camera may be a fixed optical lens system or have a focal length and optical zoom capability.

[0175] The audio component 1010 is configured to output and / or input audio signals. For example, the audio component 1010 includes a microphone (MIC), and when the electronic device 1000 is in an operation mode, such as a call mode, a recording mode, and a voice recognition mode, the microphone is configured to receive an external audio signal. The received audio signal can be further stored in the memory 1004 or sent via the communication component 1016. In some embodiments, the audio component 1010 also includes a speaker for outputting audio signals.

[0176] I / O interface 1012 provides an interface between processing component 1002 and peripheral interface modules, such as keyboards, click wheels, buttons, etc. These buttons may include but are not limited to: home button, volume button, start button, and lock button.

[0177] The sensor assembly 1014 includes one or more sensors for providing various aspects of status assessment for the electronic device 1000. For example, the sensor assembly 1014 can detect the open / closed state of the electronic device 1000, the relative positioning of components, such as the display and keypad of the electronic device 1000, and the sensor assembly 1014 can also detect the position change of the electronic device 1000 or a component of the electronic device 1000, the presence or absence of user contact with the electronic device 1000, the orientation or acceleration / deceleration of the electronic device 1000, and the temperature change of the electronic device 1000. The sensor assembly 1014 may include a proximity sensor configured to detect the presence of nearby objects without any physical contact. The sensor assembly 1014 may also include an optical sensor, such as a CMOS or CCD image sensor, for use in imaging applications. In some embodiments, the sensor assembly 1014 may also include an acceleration sensor, a gyroscope sensor, a magnetic sensor, a pressure sensor, or a temperature sensor.

[0178] The communication component 1016 is configured to facilitate wired or wireless communication between the electronic device 1000 and other devices. The electronic device 1000 can access a wireless network based on a communication standard, such as WiFi, 2G or 3G, 4G LTE, 5G NR (NewRadio) or a combination thereof. In an exemplary embodiment, the communication component 1016 receives a broadcast signal or broadcast-related information from an external broadcast management system via a broadcast channel. In an exemplary embodiment, the communication component 1016 also includes a near field communication (NFC) module to facilitate short-range communication. For example, the NFC module can be implemented based on radio frequency identification (RFID) technology, infrared data association (IrDA) technology, ultra-wideband (UWB) technology, Bluetooth (BT) technology and other technologies.

[0179] In an exemplary embodiment, the electronic device 1000 may be implemented by one or more application-specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field programmable gate arrays (FPGAs), controllers, microcontrollers, microprocessors, or other electronic components to perform the above methods.

[0180] In an exemplary embodiment, a non-transitory computer-readable storage medium including instructions is also provided, such as a memory 1004 including instructions, and the instructions can be executed by the processor 1020 of the electronic device 1000 to complete the above method. For example, the non-transitory computer-readable storage medium can be a ROM, a random access memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, etc.

[0181] The embodiments of the present disclosure further provide a non-transitory computer-readable storage medium storing computer instructions, wherein the computer instructions are used to enable a computer to execute the anomaly detection method described in the above embodiments of the present disclosure.

[0182] An embodiment of the present disclosure further provides a computer program product, including a computer program, which executes the anomaly detection method described in the above embodiment of the present disclosure when a processor executes the computer program.

[0183] Fig.11 is a schematic structural diagram of a chip 1100 for implementing the above abnormality detection method according to an exemplary embodiment.

[0184] Reference Fig.11The chip 1100 includes at least one communication interface 1101 and a processor 1102; the communication interface 1101 is used to receive a signal input to the chip 1100 or a signal output from the chip 1100, and the processor 1102 communicates with the communication interface 1101 and implements the abnormality detection method described in the above embodiment through a logic circuit or executing code instructions.

[0185] It should be noted that the terms "first", "second", etc. in the specification and claims of the present disclosure and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present disclosure described herein can be implemented in an order other than those illustrated or described herein. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present disclosure. Instead, they are merely examples of devices and methods consistent with some aspects of the present disclosure as detailed in the appended claims.

[0186] In the description of this specification, the description with reference to the terms "one embodiment", "some embodiments", "illustrative embodiments", "examples", "specific examples" or "some examples" etc. means that the specific features, structures, materials or characteristics described in conjunction with the embodiments or examples are included in at least one embodiment or example of the present disclosure. In this specification, the schematic representations of the above terms do not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described may be combined in any one or more embodiments or examples in a suitable manner.

[0187] Any process or method description in a flowchart or otherwise described herein may be understood to represent a module, segment or portion of code that includes one or more executable instructions for implementing the steps of a specific logical function or process, and the scope of the preferred embodiments of the present disclosure includes alternative implementations in which functions may not be performed in the order shown or discussed, including performing functions in a substantially simultaneous manner or in the reverse order depending on the functions involved, which should be understood by those skilled in the art to which the embodiments of the present disclosure belong.

[0188] The logic and / or steps represented in the flowchart or otherwise described herein, for example, can be considered as an ordered list of executable instructions for implementing logical functions, and can be embodied in any computer-readable medium for use by an instruction execution system, device or apparatus (such as a computer-based system, a system including a processing module, or other system that can fetch instructions from an instruction execution system, device or apparatus and execute instructions), or in combination with these instruction execution systems, devices or apparatuses. For the purposes of this specification, "computer-readable medium" can be any device that can contain, store, communicate, propagate or transmit a program for use by an instruction execution system, device or apparatus, or in combination with these instruction execution systems, devices or apparatuses. More specific examples of computer-readable media (a non-exhaustive list) include the following: an electrical connection with one or more wires (control method), a portable computer disk box (magnetic device), a random access memory (RAM), a read-only memory (ROM), an erasable and programmable read-only memory (EPROM or flash memory), a fiber optic device, and a portable compact disk read-only memory (CDROM). In addition, the computer-readable medium may even be paper or other suitable medium on which the program is printed, since the program may be obtained electronically, for example, by optically scanning the paper or other medium and then editing, interpreting or otherwise processing in a suitable manner if necessary, and then stored in a computer memory.

[0189] It should be understood that the various parts of the embodiments of the present disclosure can be implemented by hardware, software, firmware or a combination thereof. In the above embodiments, multiple steps or methods can be implemented by software or firmware stored in a memory and executed by a suitable instruction execution system. For example, if implemented by hardware, as in another embodiment, it can be implemented by any one of the following technologies known in the art or their combination: a discrete logic circuit having a logic gate circuit for implementing a logic function for a data signal, a dedicated integrated circuit having a suitable combination of logic gate circuits, a programmable gate array (PGA), a field programmable gate array (FPGA), etc.

[0190] A person skilled in the art may understand that all or part of the steps in the method for implementing the above-mentioned embodiment may be completed by instructing related hardware through a program, and the program may be stored in a computer-readable storage medium, which, when executed, includes one or a combination of the steps of the method embodiment.

[0191] In addition, each functional unit in each embodiment of the present disclosure may be integrated into a processing module, or each unit may exist physically separately, or two or more units may be integrated into one module. The above-mentioned integrated module may be implemented in the form of hardware or in the form of a software functional module. If the integrated module is implemented in the form of a software functional module and sold or used as an independent product, it may also be stored in a computer-readable storage medium. The above-mentioned storage medium may be a read-only memory, a disk or an optical disk, etc.

[0192] Although the embodiments of the present disclosure have been shown and described above, it is to be understood that the above embodiments are exemplary and are not to be construed as limitations of the present disclosure. A person skilled in the art may make changes, modifications, substitutions and variations to the above embodiments within the scope of the present disclosure.

Claims

1. An anomaly detection method, characterized in that: The method comprises: Obtain a set of images to be detected; Utilizing the encoder and high-dimensional mapping of the twin autoencoder network, extracting high-dimensional features from the set of images to be detected, and clustering the high-dimensional features into a first clustering center and a second clustering center; Determine a normal cluster center and an abnormal cluster center according to the distance between the normal cluster center and the first cluster center and the second cluster center, wherein the normal cluster center is generated by clustering the normal image data processed by the twin autoencoder network; Based on the normal cluster center and the abnormal cluster center, an abnormal image is determined from the set of images to be detected.

2. The method according to claim 1, characterized in that Before determining the normal cluster center and the abnormal cluster center according to the distances between the normal cluster center and the first cluster center and the second cluster center, the method further includes: Based on a sample image of a training image set, extracting bottleneck features of the sample image through an encoder of the twin autoencoder network; Mapping the bottleneck feature into a reference high-dimensional feature through high-dimensional mapping; Based on the bottleneck feature, reconstructing the sample image into a target sample image through a decoder of the twin autoencoder network; According to the sample image and the twin autoencoder network, a parameter set of the twin autoencoder network is updated by a gradient descent algorithm until the reconstruction error of the sample image and the target sample image converges, thereby obtaining a high-dimensional feature set composed of the reference high-dimensional features; The high-dimensional feature set is clustered into a target cluster, and the center of the target cluster is used as the normal cluster center.

3. The method according to claim 2, characterized in that: The twin autoencoder network includes two identical autoencoders, the parameter set is shared between the autoencoders, the autoencoders include an input layer, a feature encoding layer, a feature decoder and an output layer, the distance of the reference high-dimensional features between the autoencoders is used as a similarity measure, and the weighted sum of the reconstruction error and the similarity measure is the loss function.

4. The method according to claim 1, characterized in that The determining of the normal cluster center and the abnormal cluster center according to the distance between the normal cluster center and the first cluster center and the second cluster center includes: Determine a first distance between the normal cluster center and the first cluster center; Determine a second distance between the normal cluster center and the second cluster center; Compare the numerical values ​​of the first distance and the second distance. If the first distance is less than or equal to the second distance, the cluster center corresponding to the first distance is used as the normal cluster center, and the cluster center corresponding to the second distance is used as the abnormal cluster center. If the first distance is greater than the second distance, the cluster center corresponding to the first distance is used as the abnormal cluster center, and the cluster center corresponding to the second distance is used as the normal cluster center.

5. The method according to claim 1, characterized in that The determining of abnormal images from the set of images to be detected based on the normal cluster center and the abnormal cluster center includes: Acquire a target image from the set of images to be detected; Encoding the target image as a first bottleneck feature using an encoder of the twin autoencoder network; Mapping the first bottleneck feature into a target high-dimensional feature; According to the distance values ​​between the target high-dimensional feature and the normal cluster center and the abnormal cluster center, a target label of the target image is determined, and the target label includes a normal image and an abnormal image.

6. The method according to claim 5, characterized in that The step of determining the label of the target image according to the distance values ​​between the target high-dimensional feature and the normal cluster center and the abnormal cluster center includes: The distance between the target high-dimensional feature and the center of the normal cluster is taken as the first target distance; The distance between the target high-dimensional feature and the center of the abnormal cluster is taken as the second target distance; Compare the numerical values ​​of the first target distance and the second target distance. If the first target distance is greater than or equal to the second target distance, set the target label to the abnormal image; if the first target distance is less than the second target distance, set the target label to the normal image.

7. An abnormality detection device, characterized in that: The device comprises: An acquisition module, used to acquire a set of images to be detected; A clustering module, used to extract high-dimensional features from the set of images to be detected by using the encoder and high-dimensional mapping of the twin autoencoder network, and cluster the high-dimensional features into a first clustering center and a second clustering center; A determination module, configured to determine a normal cluster center and an abnormal cluster center according to distances between a normal cluster center and the first cluster center and the second cluster center, wherein the normal cluster center is generated by clustering normal image data processed by the twin autoencoder network; A classification module is used to determine abnormal images from the set of images to be detected based on the normal cluster center and the abnormal cluster center.

8. An electronic device, characterized in that: include: at least one processor; as well as a memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the method according to any one of claims 1 to 6.

9. A non-transitory computer-readable storage medium storing computer instructions, characterized in that: The computer instructions are used to cause the computer to execute the method according to any one of claims 1-6.

10. A computer program product, characterized in that The invention comprises a computer program which, when executed by a processor, implements the method according to any one of claims 1 to 6.

11. A chip, characterized in that: It includes at least one processor and a communication interface; the communication interface is used to receive a signal input to the chip or a signal output from the chip, and the processor communicates with the communication interface and implements the method according to any one of claims 1-6 through a logic circuit or executing code instructions.

Citation Information

Cited By

  • Display content anomaly detection method and system

    CN120451686A