Apparatus, program, and method for anomaly detection and classification

An unsupervised semantic segmentation method using a classification ANN addresses the limitations of existing anomaly detection by generating masks and applying clustering to latent features, enabling accurate anomaly classification in manufacturing environments.

JP7722159B2Active Publication Date: 2025-08-13FUJITSU LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
JP2021200390
Authority / Receiving Office
JP · JP
Patent Type
Patents
Current Assignee / Owner
Priority Date
2021-01-12
Filing Date
2021-12-09
Publication Date
2025-08-13
Estimated Expiration
2041-12-09

AI Technical Summary

Technical Problem

Existing unsupervised anomaly detection methods using artificial neural networks only detect the location of anomalies but fail to classify them, and semantic segmentation techniques struggle with anomalies that have similar shapes and colors to non-defective regions, making it difficult to improve production quality in manufacturing environments.

Method used

An unsupervised semantic segmentation method using a classification artificial neural network (ANN) that performs pixel-by-pixel analysis by generating masks to highlight anomaly locations, applying unsupervised clustering to latent feature representations, and training the ANN to classify anomalies into different classes using automatically generated labels and pseudo-labels.

Benefits of technology

Effectively identifies and classifies anomalies without labeled training data, enhancing production quality by accurately detecting and categorizing defects in manufacturing processes.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure 0007722159000001
    Figure 0007722159000001
  • Figure 0007722159000002
    Figure 0007722159000002
  • Figure 0007722159000003
    Figure 0007722159000003
Patent Text Reader

Abstract

To provide a computing device, system, method, and storage media configured to identify and classify anomalies in images.SOLUTION: A computing device that includes a classification artificial neural network (ANN) and processing instruction memory hardware, and processor hardware for executing processing instructions, executes: executing unsupervised anomaly detection on an input dataset of images to detect anomalies, and generating, for each image in the dataset, a corresponding mask image that conveys any one or more detected anomalies in the image to block non-abnormalities; and training the classification ANN. The computing device executes iterative training epochs until training conditions are satisfied, and outputs, for each image of the input dataset, an identification of each detected anomaly along with the corresponding classification in which the anomaly is classified by the classification ANN.SELECTED DRAWING: Figure 2
Need to check novelty before this filing date? Find Prior Art

Description

[Technical Field]

[0001] This application is in the field of quality control in a production environment, and specifically relates to the automatic identification and labeling of anomalies in images. [Background technology]

[0002] Anomaly detection is an interesting research topic due to its benefits to various fields, such as manufacturing and medicine. However, because defects are extremely rare, obtaining anomalous data from real-world applications is difficult. Therefore, unsupervised methods for anomaly detection are of particular interest (i.e., because supervised methods have difficulty obtaining high-quality training data). Current methods for unsupervised anomaly detection using artificial neural networks (ANNs) only detect the location of anomalies from images. This means that these methods only distinguish between good and bad pixels in an image and cannot recognize different types of defects, such as cracks, scratches, and bends. While semantic segmentation can segment clearly distinct objects, anomalies are often complex and similar to non-defective regions in terms of shape and color, making it difficult to separate defective from non-defective regions. In production environments, the causes and reasons for anomalies are often investigated in detail, and they can be fed back to other processes to improve production. Therefore, properly identifying and classifying anomalies is a key factor in improving product and process quality.

[0003] Manufacturing companies are constrained by extremely strict standards. To deliver the highest possible quality while producing ever-more complex components, they need to efficiently control their products. To do so, non-destructive testing (NDT) is intensively used. It is an analytical technique used in science to evaluate the characteristics of products, components, or systems without causing damage. However, in an automated production lane environment, the inspection process is a bottleneck. Manufacturing companies capture large amounts of data from products, but they are not labeled. Therefore, automating the inspection process is difficult. While typical unsupervised techniques can operate using only stored data without labeling, existing methods cannot provide anomaly labeling (what anomalies are). This information is useful in real-world manufacturing environments, as it improves the quality of products, processes, and human training every day. Embodiments address the shortcomings of existing techniques by providing an unsupervised technique that enables the detection of anomaly locations and classification of anomalies. Summary of the Invention

[0004] An embodiment includes a computing device configured to identify and classify anomalies in an image, the computing device having memory hardware and processor hardware, the memory hardware storing a classification artificial neural network (ANN) and processing instructions, the processor hardware configured to execute the processing instructions, which, when executed, cause the computing device to: performing unsupervised anomaly detection on an input dataset of images to detect anomalous portions in the images and generating, for each image in the dataset, a corresponding mask image that conveys any detected one or more anomalous portions in the image and blocks non-anomalous portions; training said classification ANN; Execute The training step comprises, in each training epoch: In the first process, processing a masked version of the input dataset with the classification ANN, the masked version having each image of the input dataset masked by the corresponding mask image, and training the classification ANN to classify anomalies into one of a plurality of classes by minimizing a cross-entropy loss function using automatically generated labels as ground truth; extracting from the classification ANN a latent feature representation for each image in the masked version of the input dataset; In the second process, generating a set of pseudo labels corresponding to the masked version of the input dataset by applying an unsupervised clustering algorithm to the latent feature representations to cluster each of the latent feature representations into one of a plurality of clusters, each cluster having a different associated pseudo label, to obtain a pseudo label corresponding to each image of the input dataset; training the classification ANN to minimize a loss function between classes in which each image in the input dataset is classified by the classification ANN using the pseudo-label of that image as ground truth; Including, The computer device is caused to repeatedly perform the training epochs until a training condition is satisfied, and for each image in the input dataset, the computer device is caused to output an identification of each detected anomaly along with the corresponding classification to which the anomaly is classified by the classification ANN.

[0005] Embodiments perform unsupervised semantic segmentation for anomaly detection from input images. The embodiments implement several functions, including anomaly location detection and feature extraction. The embodiments extract knowledge from input images and can identify possible defect types without requiring training with images of the defects.

[0006] Material manufacturers are constrained by extremely strict standards. To deliver the highest possible quality while producing ever-more complex components, they need to efficiently control their products. To do so, non-destructive testing (NDT) is used intensively. NDT encompasses a range of analytical techniques used in the science and technology industries to evaluate the properties of materials, components, or systems without causing damage. However, in an automated production lane environment, the inspection process is a bottleneck, increasing production costs.

[0007] Manufacturers capture a lot of data by photographing products, but they don't label them, meaning human input is required in the inspection process.

[0008] Existing technologies for automating material surface inspection can be categorized into two categories: ● First, generating large datasets of human-labeled images is tedious and limited by the annotator's experience. ● Second, we can create handcrafted algorithms. This technique applies computer vision methods to unlabeled datasets and then applies evaluation algorithms to small labeled datasets. Such techniques have the drawback that it is difficult to design effective algorithms.

[0009] Embodiments address the problem that previous approaches to anomaly detection using neural networks do not focus on the location of anomalies, and therefore can detect the location of anomalies but not classify them. The network looks at the entire image using convolutional layers, pooling, etc., to classify / segment objects that, in theory, have distinct characteristics that the network can distinguish by color and shape. For example, an anomaly may be a metal object bent in the middle, as shown in FIG. 6. In FIG. 6, the image on the left shows a product without defects, while the image on the right shows a product with a defective metal connector in the middle. If the anomaly were unknown without ground truth or knowledge, the prior art network would not be able to recognize such a defect (because the bent metal itself is not a defect, but rather the location / position where the bent metal occurs causes the defect). In the transistor example of FIG. 6, the prior art network can recognize the background and the transistor. However, the prior art network cannot classify them as good / abnormal because both images contain the characteristic of bent metal. Embodiments use the mask generated in the first anomaly detection step to train a classification artificial neural network to look at the parts of the image where anomalies occur. In other words, embodiments use anomaly location information obtained from existing unsupervised anomaly detection to look only at the anomalous parts in the image. As a result, the classification artificial neural network can classify the image using pixel-by-pixel analysis, such as segmentation.

[0010] Embodiments provide an unsupervised semantic segmentation method for anomaly detection that can identify the location and type of anomalies without relying on labeled training data.

[0011] Deep learning is known to outperform traditional methods using large labeled datasets. Embodiments leverage unsupervised deep learning to achieve anomaly detection and classification. Anomaly detection and automated testing lends itself to unsupervised deep learning techniques because the alternative, labeling large datasets, is very costly and time-consuming.

[0012] As a state-of-the-art technology, using autoencoders / GANs is a common method. Such approaches remove defects from abnormal images by training only on defect-free data. However, these methods can only detect the location of anomalies, not their type. They lack the ability to classify anomalies into types. On the other hand, general clustering algorithms can classify the type of anomaly, but they do not detect the location of anomalies on an image. Therefore, the technical task is semantic segmentation for anomaly detection, which can recognize both the type and location of anomalies. General semantic segmentation focuses on detecting object segments. Prior art AI semantic segmentation algorithms recognize objects or segments by color and shape. While their usefulness is limited to anomalies that are easy to detect by color, prior art algorithms are ineffective in scenarios where anomalies have similar colors and shapes to the background. Embodiments are effective in segmentation not only to identify the location of anomalies, but also to generate clusters of anomalies, such as semantic segmentation, as highlighted in FIG. 13.

[0013] A key issue in using deep learning for semantic segmentation is where a neural network should look in an image to detect anomalies. Prior art (supervised) neural networks extract features during the training phase using large datasets. Through supervised learning, the neural network can learn the characteristics of anomalies. However, with unsupervised learning, the neural network does not identify anomalies in the same way. Where a neural network looks—that is, the image location of pixels that feed into the neural network's output—can be explained using analysis tools such as Grad-CAM++. Figure 14 shows that in existing unsupervised techniques, the neural network takes input from the entire image rather than focusing on anomalies. There are two types of input data to support unsupervised learning for anomaly location. The input is a raw image containing both defect-free and anomalous regions. The other is a masked image that only shows the location of the anomaly. While existing unsupervised learning approaches examine a broad area around the anomaly, supervised learning specifically examines the anomaly as ground truth (GF). Embodiments enable unsupervised machine learning to properly classify anomalies through pixel-based classification local to the anomaly.

[0014] According to an embodiment, the masked version of the input data set processed by the classification ANN in the first process may be filtered by an image filter or transformed by an image transformation algorithm in addition to being masked by the corresponding mask.

[0015] Advantageously, the transformed version of the masked version of the input dataset provides additional images for training the classification ANN in the first process. Furthermore, the transformed version may highlight the characteristics of anomalies.

[0016] Optionally, the automatically generated labels are determined by image transformation algorithms or filters being applied to the versions, such that each image transformation algorithm or filter maps to a label, the values of the labels being any values different from each other. The first process effectively teaches a classification ANN to look at relevant parts of the image by applying a mask. Thus, labeling is done by dividing an image into classification While the purpose of this is to provide a basis for performing the analysis, an important functional aspect is masking, which helps to tune the ANN 210 to "see" regions of the image where abnormalities are occurring (i.e., apply higher weighting to parameters based on values from such regions).

[0017] Optionally, the image filter is an embossing image filter, or alternatively, the image transformation algorithm is an embossing image transformation algorithm.

[0018] Embossing is particularly advantageous because it highlights anomalies whose pixel value (ie, color) variations have depths that would otherwise be difficult to detect.

[0019] Optionally, the masked version of the input dataset comprises multiple versions of each member of the input dataset, the multiple versions being the image having a respective one of a selection of image transformation algorithms or image filters applied thereto.

[0020] In this case, the multiple versions provide additional content for training the classification ANN in the first process, and there may be certain anomalies that are more or less apparent to the classification ANN when subjected to certain transformations.

[0021] Optionally, the unsupervised anomaly detection is performed by an autoencoder or a generative neural network pre-trained to generate a defect-free portion of an image and to generate a mask image corresponding to the image by generating a defect-free version of the image from the input dataset and comparing the image with the generated defect-free version to generate the mask, wherein the generative neural network is a generative adversarial neural network.

[0022] The autoencoder and GAN constructed in this way provide an efficient and accurate mechanism for performing unsupervised anomaly detection. Furthermore, pre-training requires defect-free images, which are easy to obtain and do not rely on defect images, which are difficult to obtain.

[0023] Optionally, the loss function in the first process is pixel-wise cross-entropy loss. Other cross-entropy loss functions may be used. The loss function may be cross-entropy loss. The loss function may be binary cross-entropy loss, derivative cross-entropy loss, sigmoid cross-entropy loss, or categorical cross-entropy loss.

[0024] Optionally, each training epoch further includes, in a third process, generating a modified version of each image of the masked version of the input dataset as a modified masked input dataset by adding noise data to each image of the masked version of the input dataset (and by applying a transformation or filter), and further training the classification ANN to maximize mutual information as a loss function based on the classification ANN processing Input Dataset A, which is the masked input dataset, and the classification ANN processing Input Dataset B, which is the modified masked input dataset.

[0025] Advantageously, combining the three processes allows the total loss of the three processes to be used in training the classification ANN, so that at each training epoch the classification ANN is taught where to look and how to classify.

[0026] In summary, there are three losses that can be summed to train a classification ANN: Total_loss=a×Loss1+b×Loss2+c×Loss3, with Loss1 being the cross entropy of the first process, Loss2 being the cross entropy of the second process, and Loss3 being the mutual information of the third process.

[0027] Loss1 requires ground truth generated by transforming the input data: images and labels.

[0028] Loss2 requires pseudo labels as ground truth to compare with (raw*mask).

[0029] Loss3 compares (raw*mask) with (raw*mask*affin+noise) by mutual information.

[0030] Another aspect of the invention includes a system having a computing device embodiment and an imaging device configured to generate an image and store the generated image as an input data set for processing by the computing device.

[0031] Optionally, the image is an image of a production sample, and the system may further comprise a production environment for producing products or materials as production samples.

[0032] An embodiment of another aspect includes a method for identifying and classifying anomalies in an image, the method comprising: performing unsupervised anomaly detection on an input dataset of images to detect anomalous portions in the images and generating, for each image in the dataset, a corresponding mask image that conveys any detected one or more anomalous portions in the image and blocks non-anomalous portions; Training a classification artificial neural network (ANN) and The training step comprises, in each training epoch: In the first process, processing a masked version of the input dataset with the classification ANN, the masked version having each image of the input dataset masked by the corresponding mask image, and training the classification ANN to classify anomalies into one of a plurality of classes by minimizing a cross-entropy loss function using automatically generated labels as ground truth; extracting from the classification ANN a latent feature representation for each image in the masked version of the input dataset; In the second process, generating a set of pseudo labels corresponding to the masked version of the input dataset by applying an unsupervised clustering algorithm to the latent feature representations to cluster each of the latent feature representations into one of a plurality of clusters, each cluster having a different associated pseudo label, to obtain a pseudo label corresponding to each image of the input dataset; training the classification ANN to minimize a loss function between classes in which each image in the input dataset is classified by the classification ANN using the pseudo-label of that image as ground truth; Including, The method includes repeatedly performing the training epochs until a training condition is satisfied, and outputting, for each image in the input dataset, an identification of each detected anomaly along with a corresponding classification to which the anomaly is classified by the classification ANN.

[0033] Another aspect of the invention includes a computer program product that, when executed by a computing device having processor hardware and memory hardware, causes the computing device to perform an embodiment of the method described above or elsewhere herein.

[0034] Optionally, the computer program is stored on a non-transitory computer storage medium.

[0035] The embodiments will be described with reference to the accompanying drawings. [Brief explanation of the drawings]

[0036] [Figure 1] 1 illustrates the hardware architecture of an embodiment. [Figure 2] 2 shows a processing flow in an embodiment. [Figure 3] 1 illustrates the process flow and interactions with datasets and data artifacts in an embodiment. [Figure 4] 1 represents a procedure by which a neural network is pre-trained for unsupervised anomaly detection. [Figure 5] 1 illustrates the process flow and interactions with datasets and data artifacts in an embodiment. [Figure 6] 1 shows images of production samples with and without defects. [Figure 7] 2 shows a processing flow in an embodiment. [Figure 8] 2 shows a processing flow in an embodiment. [Figure 9A] The first process is shown in more detail. [Figure 9B] The procedure for automatically generating labels is presented in more detail. [Figure 10] In practice, we represent the progression of feature maps through training epochs. [Figure 11] 10 depicts a feature map in an implementation with a transistor image dataset. [Figure 12]1 is a table of results for a run with 15 different input datasets compared to a prior art method. [Figure 13] The embodiment is compared with a prior art algorithm. [Figure 14] The embodiment is compared with a prior art algorithm. [Figure 15] FIG. 1 is a block diagram of a computing device embodying the present invention. DETAILED DESCRIPTION OF THE INVENTION

[0037] 1 is a schematic diagram of a hardware configuration of an embodiment. The hardware includes processor hardware 100 and memory hardware 200. Storage of a classifier ANN 210 on the memory hardware is shown. It is noted that the processor hardware 100 and memory hardware 200 may be located in a production environment, for example, as part of a quality control mechanism. Alternatively, the processor hardware 100 and memory hardware 200 may be remote from the production environment but may be supplied with images of production samples from the production environment as an input data set.

[0038] The processor hardware 100 and the memory hardware 200 may be components of a computer system. The processor hardware 100 may be one or more interconnected CPUs. The memory hardware 200 may be volatile memory, non-volatile memory, or Volatilization 2 and 3. Memory hardware 200 may include a combination of volatile and non-volatile memory. Memory hardware 200 stores processing instructions for execution by processor hardware 100. In addition, memory hardware 200 may store data sets during execution of steps or processes such as those depicted in FIGS. 2 and 3 by processor hardware 100 in cooperation with memory hardware 200.

[0039] The classification ANN 210 is an artificial neural network for image classification. An example of such an ANN is AlexNet. The processor of the embodiment trains and implements the classification ANN 210. The classification ANN 210 may be a deep neural network (DNN).

[0040] Figure 2 illustrates a process of an embodiment. The process may be performed by hardware such as that illustrated in Figure 1. Figure 2 illustrates logic that controls whether training continues or whether the method proceeds to output step S106. The logic is the same in Figure 3, but is not illustrated to simplify the illustration and allow datasets and other artifacts to be highlighted. Figure 3 illustrates the process of Figure 2, highlighting the datasets and other artifacts (including artificial neural networks) that are processed, generated, or trained at each step.

[0041] At S101, unsupervised anomaly detection is performed on an input dataset D101 that includes multiple images of production samples from a production environment. The production samples may be, for example, industrial products manufactured in the production environment. The production samples may also be pieces of natural or industrial materials that are manufactured or otherwise processed (cut, grinded, polished, cleaned) in the production environment. Embodiments participate in quality control mechanisms by identifying the location of anomalies on the images of the production samples and classifying the identified anomalies into one of multiple groups. Because the process of the embodiments is unsupervised, labeling of anomalies by a human expert is required to train the neural network.

[0042] In addition to a comparison algorithm, unsupervised anomaly detection S101 utilizes a pre-trained autoencoder or generative adversarial neural network 220. Pre-training ("pre-training" means that it is a separate process from that depicted in FIGS. 2 and 3 and is performed before the generator neural network 220 is utilized in S101) is accomplished by feeding defect-free images (or images that are primarily defect-free) to the generative neural network 220 (referred to as generative neural network 220 to avoid confusion with the classification neural network 210, which is introduced later in the process). Training effectively adds noise or artificial defects to the defect-free training images, forcing the generative neural network 220 to learn to reconstruct images or image portions such that a discriminator cannot distinguish the reconstructions from the original defect-free training images. Further details regarding training the generative neural network 220 to perform unsupervised anomaly detection are provided, for example, in EP3739513 or at https: / / www.fujitsu.com / global / about / resources / publications / technicalreview / 2020-02 / article03.html.

[0043] S101 may be performed by any anomaly detection method that can find abnormal regions to generate a mask image for each product sample image, such as a Generative Adversarial Network (GAN) or a Convolutional Neural Network (CNN). As a pre-processing step, these networks may need to be trained before being utilized in S101.

[0044] FIG. 4 illustrates an example of a generative neural network architecture that has been trained (pre-trained) to generate defect-free portions of images of production samples. The generative neural network used in S101 may be, for example, a generative adversarial neural network (GAN) in which the generative neural network 220 generates data for discrimination from actual data by the discriminator neural network 221. The goal of the generative neural network 220 is to generate data that the discriminator neural network 221 cannot distinguish from the actual data. The output from the discriminator neural network 221 (the generated data may or may not be actual data) trains the generative neural network 220, for example, by backward error propagation. The generative neural network 220 is trained to generate data that the discriminator neural network 221 cannot distinguish from the actual data. The discriminator neural network 221 is also trained, but to distinguish between generated data and actual data. For example, the discriminator neural network 221 is notified whether it succeeds in distinguishing between real and generated data, and is trained to do so, e.g., by backward error propagation. Thus, without human or manual intervention, the generative neural network 220 and the discriminator neural network 221 train each other. Because the training data does not need to be labeled, the need for input from a human expert is eliminated.

[0045] In pre-training, the actual data may be images of a production sample (e.g., a material surface). Optionally, the actual images may be images of a production sample that, when divided into n regions (e.g., in a grid), has more defect-free regions than a threshold ratio. The threshold ratio may be, for example, 0.99, 0.95, 0.90, or may be in the range greater than 0.9 and less than or equal to 1. For example, the training images may be images of a production sample of the same product / material as the images of the input dataset to be processed in the embodiment.

[0046] The pre-training step utilizes a generative adversarial network technique, such as that depicted in FIG. 2, to learn how to reproduce images of production samples containing defects as images of production samples with reduced defects.

[0047] In S101, an image from an input dataset is processed by a generative neural network 220 that has been pre-trained to remove defects. The generated error, i.e., the difference (regardless of pre-processing) between the processed version of the image and the original input version of the image will be large at the location of the defect. Thus, a comparison (by a comparison algorithm) of pixel values between these two versions of the input image allows the location of the defect to be identified. For example, the ratio of the difference in pixel values between equivalent pixels in the two versions may be registered as an error, and an error greater than a threshold ratio in an area of a given size may be registered as a defect. S101 is thus performed by the pre-trained generative neural network 220 in conjunction with a comparison algorithm that performs a comparison between the original input version of the image and the generated version of the image.

[0048] In particular, at S101, the processor hardware 100 is configured to perform unsupervised anomaly detection on an input dataset of images of production samples to detect anomalous portions in those images, and to generate, for each image in the dataset, a corresponding mask image that conveys any detected one or more anomalous portions in that image and blocks non-anomalous portions.

[0049] The output of S101 is a mask for each image in the input dataset D101, and each image is combined with its corresponding mask to generate a masked version D102a of the input dataset (i.e., if the input dataset D101 is image A, image B, image C, etc., then the masked versions D102a are mask A*image A, mask B*image B, mask C*image C, etc.).

[0050] For each input raw image, step S101 generates a corresponding mask image. In step S102, some image processing is performed to combine the two, so that raw image A is combined with mask A, raw image B is combined with mask B, etc. When having a "raw input image A" (containing at least one defect region) from D101, unsupervised anomaly detection S101 obtains a "reconstructed image A," which is the "raw input image A" with the anomaly removed using an unsupervised method. Then, an "anomaly mask image A" is obtained by comparing the "raw input image A" with the "reconstructed image A." To generate D102a, the embodiment combines the "raw input image A" and the "anomaly mask image A." Similarly, D102a is generated using the entire input dataset D101.

[0051] Raw input image from D101: The original image including defect and non-defect areas (i.e., good and bad pixels).

[0052] Mask image provided by S101: location of anomalies by black (normal) / white (abnormal) (i.e., blocking normal pixels to convey anomalies).

[0053] Transformed image (masked version of input image) D102a: only the location of anomalies in the original image.

[0054] In embodiments, there is no strict separation between the training phase and the live phase (the exception being that pre-training of the generative neural network 220 is a separate process, as described above with reference to FIG. 4). The classification ANN 210 is trained unsupervised (i.e., no manual (i.e., expert) input or supervision of the training process is required) using live data. An epoch is called a training epoch because the classification ANN 210 is trained therein, but may also be simply called an epoch because the training is based on live data. Training epochs are repeated until a training condition is met. For example, the training condition may be a fixed number of epochs, or it may be reaching a degree of convergence of adjustable weights and biases in the classification ANN 210.

[0055] Each training epoch includes two separate processes, and optionally a third process, each of which involves some adjustment (i.e., training) of the adjustable weights and biases of the classification ANN 210. Each process has its own loss function (cross-entropy for the first and second processes, mutual information for the third process). Training may be performed by summing the three loss functions (optionally with weights applied to all three) and adjusting the adjustable weights and biases of the classification ANN by backward error propagation to minimize the sum. The first process includes steps S101 to S103. The second process includes steps S104 to S105. Thus, a training epoch includes steps S102 to S105, and the sequence of steps is repeated depending on the number of training epochs required. Each process is executed once per training epoch. The processes are described as distinct processes to facilitate understanding of the embodiments. Each process performs some training of the classification ANN 210, as indicated by the classification ANN 210 becoming classification ANN 210a after the first process and classification ANN 210b after the second process. In implementations, there may be multiple training epochs, such that classification ANN 210b from epoch n is the starting classification ANN 210 at the beginning of epoch n+1. Similarly, if there are three processes per training epoch, classification ANN 210c from epoch n is the starting classification ANN 210 at the beginning of epoch n+1. Training (i.e., adjusting the adjustable weights and biases to minimize / maximize each loss function) can be done for each process or once per epoch based on the sum of all two / three loss functions.

[0056] Training epochs continue until a training condition is satisfied. For example, the condition may be that a predefined number of training epochs are satisfied. Alternatively, the condition may be that the adjustable weights and parameters in the classification ANN 210 converge to the extent that a convergence condition is satisfied. For example, the convergence condition may be the maximum change in an adjustable parameter (by the sum of all adjustable weights and parameters) over a single or predefined number of training epochs, whereby the convergence condition is satisfied if such change falls below the maximum change. Of course, more complex metrics, such as a rolling average, may be used to quantify convergence. Similarly, although the conditions here are presented as conditions that must be met to stop training (and processing proceeds to step S106), an implementation may use inverse logic and have conditions that must be met to continue training.

[0057] At S102, the classification ANN 210 processes a masked version D102a of the input dataset. At S102, the masked version D102a of the input dataset is processed by the classification ANN 210, where the masked version D102a includes each member of the input dataset D101 masked by a corresponding mask image, and the classification ANN 210 is trained to classify the anomalies into one of a plurality of classes by minimizing a cross-entropy loss function. The classification ANN 210 classifies the masked images that make up the masked version D102a of the input dataset. Some training (i.e., adjusting adjustable weights and biases in the classification ANN 210 by backward error propagation to attempt to minimize the cross-entropy loss function) is performed so that the classification ANN 210 can reduce the loss function in the next epoch. The classification ANN 210a indicates that some training may have been performed on the classifier 210.

[0058] The classification ANN 210, sometimes referred to as a deep neural network (DNN), is trained using cross-entropy and backward error propagation as loss functions. The classification ANN 210 is trained to minimize cross-entropy, and the ground truth is the image and labels generated by transforming the input data. The ground truth is the image and the labels. This is called unsupervised or self-supervised learning because the ground truth is not a type of anomaly but must be information provided by an expert. In a first example, the ground truth is a self-generated (or automated) label that represents the transformations or anomaly locations applied to the image. Thus, for example, labels can be generated by applying different labels to each version of the same image. This is shown in FIG. 9B. First, a masked raw image (A) of only the anomaly is created using both the raw image and the masked image (a masked version of the input image from the input dataset). Then, one or more transformed masked images are created from (A) using different transformations or filters. The untransformed, masked version and the one or more transformed versions are all input data for training the classification ANN 210. Each version is assigned a different label. That is, the label is determined by the transformation applied to the image, but the mapping of transformations to labels is arbitrary (so, for example, there is no reason for the masked raw image to be a "0" and the embossed image to be a "1" as long as they are different labels). The way to label images is simply to count them. Therefore, you can label them any way you like, e.g., (A) = '0', (B) = '1', and (C) = '2'. Of course, you could also use 'A', 'B', and 'C'. The names of these labels are meaningless. The label applied to an image depends on the transformation (or lack of transformation) applied to generate that image. Therefore, any label can be used as long as the labels are separate.

[0059] An exemplary method is to create an image without raw data by changing the color of the anomalies, as this still helps the classification ANN 210 learn the anomalies (in this example, each color would correspond to a different label). However, using raw data helps the classification ANN 210 learn small differences in the anomalies' features. Additionally, the background color (normals) may be changed in some situations. If all the anomalies are black, white may be better than black.

[0060] The input (raw) image and corresponding mask may be transformed before classification by the classification ANN 210. Both transformed and untransformed versions of the masked image may be classified by the classification ANN 210. In either case, the ground truth is a self-generated (or automated) label that represents the transformation (or lack of transformation) applied to generate the version of the image. Here, the labels are generated by mapping each different transformation (or lack of transformation) to a different label. The labels are said to be "self-generated" or "automated" or "automatically generated" because they are generated by a system / algorithm / process / program / method without manual / expert input.

[0061] Classification 1: Input: Transformed * Raw * Mask Ground truth: self-generated (automated) labels Loss 1: Cross entropy

[0062] The network is trained to classify anomalies, with the goal being to extract their features. The defect-free areas (no anomalies) of the raw images are almost identical because they are masked. Therefore, the only differences are in the anomalies. The network (i.e., classification ANN 210) learns by looking only at the anomaly areas (locations). This is because the network is essentially looking for differences and classifying them. The second and third processes are influenced by this first process, since the same neural network is used in the second (and third) processes.

[0063] Training in step S102 trains the network to generate a feature set that emphasizes / extracts / highlights the differences between images (i.e., anomalies) and ignores the similarities (i.e., non-defective parts).

[0064] The masked version D102a of the input dataset 102a may be transformed prior to processing by the classification ANN 210 in S102. Any filter / transform may be selected, and since the purpose of the transformation is to highlight anomalies, the selection will be somewhat specific to the production sample being imaged. An exemplary transform / filter is embossing, which highlights differences in depth and helps the classification ANN 210 recognize the difference between different types of anomalies. The transformed version may be input instead of or in addition to the untransformed version. Similarly, more than one transformed version may be input (each with a different transformation applied).

[0065] The classification ANN 210 maps one or more input images to latent feature representations through a series of operations influenced in part by parameters, including weights and biases, that are adjustable during the training process. Changing the weights and biases during training changes the mapping of image representations to the latent feature representations, which in turn changes the output classification. The classification is the final observable representation obtained from the latent feature representations.

[0066] The latent feature representation of the input image is a set of features that represent the image and provides a set of features that allow the classification ANN 210 to classify the input image. In an embodiment, step S103 is extracting a latent feature representation of the masked version D102a of the input image from the classification ANN 210. Extraction can be achieved in one of two ways. An algorithm can be configured to monitor the classification ANN 210 as it processes the masked version D102a of the input image and extract a latent feature representation for each image during that process (i.e., the classification ANN 210 is configured to output a latent feature representation for each image, and such output is stored, where the output and storage are algorithmic). Alternatively, the layer of the classification ANN 210 between the input and the latent feature representations is separated and applied to the masked version D102a of the input image (i.e., the masked version D102a is processed by the classification ANN 210, but processing stops before classification, whereby the output is a latent feature representation for each input image).

[0067] The latent feature representations D103 are stored and made accessible to an unsupervised clustering algorithm in S104. The unsupervised clustering algorithm is used to generate a set of pseudo labels corresponding to the masked version of the input dataset by applying the unsupervised clustering algorithm to the latent feature representations to cluster each of the latent feature representations into one of a plurality of clusters, each cluster having a different associated pseudo label, to obtain a pseudo label corresponding to each member of the input dataset. Thus, step S104 uses the unsupervised clustering algorithm to map each latent feature representation to a cluster. Each cluster is associated with a pseudo label (e.g., pseudo label A, pseudo label B, pseudo label C). It can be understood that each member of the input dataset D101 is associated with a particular pseudo label, since each latent feature representation represents a different member of the masked version D102a of the input dataset.

[0068] The unsupervised clustering algorithm may be, for example, k-means, although any unsupervised clustering algorithm may be used.

[0069] The processing of a single input image of a production sample is charted: in S101, unsupervised anomaly detection is performed to obtain a corresponding masked version of the input image. In S102, the masked version is processed by a classification ANN 210, and in S103, latent feature representations of the masked version are extracted. In S104, unsupervised clustering of the latent feature representations is performed, and the latent feature representations are mapped to clusters. The clusters correspond to pseudo labels. Thus, via steps S101 to S104, each input image is mapped to a pseudo label.

[0070] At S105, the classification ANN 210a is trained to classify the masked versions D102a of the input dataset using a loss function that minimizes the loss between the classifications output by the classification ANN 210a and the pseudo labels D104 associated with the corresponding images as ground truth. S105 includes training the classification ANN 210a to minimize the loss function between the classifications in which each member of the masked versions D102a of the input dataset is classified by the classification ANN 210a using that member's pseudo label as the ground truth. That is, the pseudo labels D104 are used as the ground truth for labeling each masked version D102a of the input dataset, and the classifications of the masked versions of the input dataset produced by the classification ANN 210a are compared to the ground truth with the loss function while training (i.e., adjusting adjustable weights and parameters in the classification ANN 210a) to minimize the loss function (e.g., by backward error propagation). Classification ANN 210a is thereby modified to become classification ANN 210b.

[0071] Steps S102 through S105 form a single training epoch and are performed repeatedly, as described above, until the training conditions are met. The classification ANN 210b at the completion of the training epoch becomes the starting classification ANN 210 at the start for the next training epoch, as represented by the upward arrow between classification ANN 210b and classification ANN 210 in FIG. 5.

[0072] S106 is a final output step that is performed once the training conditions are satisfied. The exact configuration of what data is output, in what format, and to which output destinations is configurable depending on implementation requirements. S106 may include outputting, for each member of the input data set D101, an identification of each detected anomalous portion along with the corresponding classification that the anomalous portion was classified by the classification ANN 210b (specifically, by a classification ANN of a type that satisfies the training conditions).

[0073] The output may be by display on a display unit, in the form of audio through a speaker, by writing to a user interface, by writing to a memory location for access by one or more applications or user interfaces, by transmission to a defined data destination such as a message recipient, by transmission to another device in the production environment, or by storage at a predefined memory value. The effect is to identify the location of anomalies in a production sample and apply classification labels to the anomalies. Applying classification labels is useful because a single classification label may be applied to multiple anomalies across the input data set D101, and thus the assignment of semantic meaning to a classification is performed once for multiple anomalies (or once per anomaly if there were no classifications).

[0074] 5 illustrates an embodiment that includes including a third process in each training epoch. For example, the third process may include step S115 of generating a modified version D102b of each member of the masked version of the input dataset as a modified masked input dataset D102a by adding noise data (and applying a transformation or filter) to each member of the masked version of the input dataset, and further training the classification ANN to maximize mutual information as a loss function based on the classification ANN processing input dataset A, which is the masked version D102a of the input dataset, and the classification ANN processing input dataset B, which is the modified masked version D102b of the input dataset. The third process may be executed first, second, or third of the three processes per training epoch. It will be appreciated that while the second process depends on the data generated by the second processor, the third process has no such dependency.

[0075] In the third process, classification ANN 210 is further trained. This is represented by reference numeral 210c applied to classification ANN 210 in FIG. 5 , which highlights the evolution of classification ANN 210 through three training processes per training epoch, and as such, is represented as classification ANN 210aa, classification ANN 210b, and classification ANN 210c. As noted above, the order of the three processes may be reversed, and classification ANN 210c may actually be generated before classification ANN 210a, so that classification ANN 210a becomes a modified version of classifier 210c, or vice versa. As indicated by the upward arrow between classification ANN 210c and classification ANN 210 in FIG. 5 , classification ANN 210c at the completion of a training epoch becomes the starting classification ANN 210 for the next training epoch.

[0076] In the example, the two datasets input to the third process are masked versions D102a of the input datasets, i.e., input dataset A, which is raw image x mask, and input dataset B, which is raw image x mask x affine (i.e., transformed) + noise. The transformation may be, for example, an embossed image processing transformation.

[0077] 5, classification ANN 210b is used to perform a third process, during which classification ANN 210b is trained to achieve classification ANN 210c, where training includes adjusting adjustable weights and biases in classification ANN 210b by, for example, backward error propagation from maximizing a loss function, which in this example is mutual information.

[0078] Mutual information loss utilizes invariant information clustering (IIC) (see https: / / arxiv.org / pdf / 1807.06653.pdf). The input datasets are masked versions D102a of the input datasets, i.e., input dataset A, which is raw images × mask, and input dataset B, which is raw images × mask × affine (i.e., transformation) + noise. Because IIC is an unsupervised technique, no ground truth is required in this process. Using both input datasets A and B, mutual information is calculated as the loss function that training attempts to maximize. This is in contrast to the second process, which uses cross-entropy as the loss function and therefore requires ground truth (which is provided in the form of pseudo-labels from S104). The training method in the second process may be, for example, DeepCluster, as described in https: / / arxiv.org / pdf / 1807.05520.pdf.

[0079] Process 3: Calculate mutual information loss: inputs are both A (raw × mask × (filter)) and B (raw × mask × (filter) × affine (any transformation) + noise): it does not use pseudo labels from unsupervised clustering.

[0080] Input: A, B Output:P(A),P(B) Loss: I(P(A),P(B)): Mutual information

[0081] Process 2: Calculate the cross-entropy loss: The input is only A(raw × mask × (filter)), but the pseudo-labels given by unsupervised clustering are used as the ground truth.

[0082] Input: A Feature set: f(A) Pseudo-label: Q(f(A)) Loss: L(A_label, Q(f(A))): Cross entropy

[0083] The noise may be, for example, noisy data such as random or pseudo-random pixels or black pixels (or groups of pixels such as shapes) added to the image data. The classifier ANN 210 has learned to properly classify incomplete image data or images of anomalies that are incomplete or otherwise deviate from other images of similarly classified anomalies.

[0084] Following completion of training at S115, the classification ANN 210c is evaluated to determine whether the training conditions have been met, as described above in connection with S105 of FIG.

[0085] In Figure 5, double boxes are applied to datasets to which a transformation or filter may be applied as a pre-processing step before the dataset in question is processed by the classification ANN. The transformation or filter applied to each dataset may be a predetermined (i.e., fixed) parameter, or may be determined as a parameter that applies to the entire method. For example, by selecting an appropriate filter or transformation, the speed of training and / or the accuracy of classification and / or the accuracy of anomaly detection may be improved, as particular filters or transformations may be more suitable for different production sample types. While the double boxes are shown in Figure 5, they apply equally to the equivalent datasets in other figures, e.g., Figure 3.

[0086] FIG. 7 is an alternative representation of the embodiments of FIGS. 2, 3, and 5, for example. It is the nature of computer-implemented technology that different schematics and diagrams show the same procedure and emphasize different features to aid understanding. The embodiment simultaneously trains and tests the classification ANN 210 to classify types of anomalies, so the training and testing phases are not separated. That is, the input dataset D101 used to train the classification ANN 210 is a dataset of live images from a production environment. The input dataset D101 is images containing various types of anomalies. Unsupervised anomaly detection S101, as described above, is a pre-trained aspect of the system that can segment the locations of anomalies from the input image. A pixel-wise OK / NG (good or bad) masked image D102a is then obtained. A feature attractor 701 and a feature extractor 702 perform step S103, extracting latent feature representations of the masked version of the input image D102a from the classification ANN 210. The features are used to generate pseudo labels in S104 and thus to train the classification ANN 210 in step S105. As output 703, a feature map of anomalies and classified anomaly types for each input image are obtained.

[0087] Figure 8 is, for example, an alternative representation of the embodiments of Figures 2, 3, 5, and 7. Figure 8 illustrates that an input image S101 (a raw image) is processed by a pre-trained neural network to obtain a corresponding mask D101a that indicates the location of defects in the corresponding input image. The input data set D101 and the corresponding mask D101a are combined to generate a masked version D102a of the input data set. The transformer is effectively an image processor that combines versions of the image, optionally applying a transformation such as embossing, before input to the classification ANN 210 (which in this example is a deep neural network (DNN)).

[0088] Process 1, designated by reference numeral 1, is the classification of only anomaly locations to train the DNN 210 to view portions of an image containing anomalies. The input data is a raw image that has been filtered, such as an embossment. The classification ANN 210, which may be called a deep neural network (DNN), is trained in S102 using cross-entropy as a loss function and backward error propagation. The input (raw) image and corresponding mask in S102 may be transformed before classification by the classification ANN 210. Both the transformed and untransformed versions of the masked image can be classified by the classification ANN 210. In either case, the ground truth is a self-generated (automated) label that represents the transformation (or lack of transformation) applied to generate the version of the image. Here, the label is generated by mapping each different transformation (or lack of transformation) to a different label. The labels are said to be "self-generated," "automated," or "automatically generated" because they are generated by a system / algorithm / process / program / method without manual / expert input. The classification ANN 210 is trained to minimize cross-entropy, i.e., to achieve classification as close as possible to the ground truth. The input is either a masked version D102a of the input dataset, or a transformed or filtered (e.g., embossed) version thereof (or both the transformed and untransformed versions).

[0089] Process 2 is indicated by reference numeral 2, although it can be seen that a third process is also represented in FIG. 8. At S103, a feature set is extracted to obtain latent feature representations D103 of the masked version D102a. At S104, unsupervised clustering of the latent feature representations D103 is performed to map the latent feature representations D103 to clusters, which correspond to pseudo labels D104. At S105, the DNN 210 is trained based on DeepCluster with cross-entropy as the loss function to classify anomalies into groups using the pseudo labels as ground truth.

[0090] In the third process S115, classification is performed by the DNN 210. Classification can maximize mutual information between the masked version D102a and its further modified version D102b (by adding noise) to avoid predicting a single classification with certainty due to entropy minimization and problems with noisy data. The third process utilizes invariant information clustering.

[0091] S106, as described above, is an output step in which the input image is output along with the location of each of those detected anomalies and the classification applied to the detected anomalies.

[0092] Figure 9A shows the first process of Figure 8 in more detail. The raw image and a masked image of the anomaly location are used as input data. They are transformed by several filters after masking the raw image. In this example, unfiltered, embossed, and raw are used as input data for the DNN. The DNN classifies these labels by cross-entropy. Thus, the network can only see the anomalies, since other areas have the same features. Figure 9A shows the process of calculating loss 1 (i.e., cross-entropy loss in the first process). It takes the transformed raw data (raw * mask) as input and their labels (0, 1, 2 in Figure 9A). The labels are ground truths, self-generated labels that represent the transformations (or lack of transformations) applied to generate versions of the image (as shown in Figure 9B). The labels are generated by mapping each different transformation (or lack of transformation) to a different label. The labels are said to be "self-generated" or "automated" or "automatically generated" because they are generated by a system / algorithm / process / program / method without manual / expert input. The input (raw) image and corresponding mask may be transformed before classification by the classification ANN 210. Both the transformed and untransformed versions of the masked image may be classified by the classification ANN 210. The process of generating multiple versions of the input image and labeling those versions in preparation for processing by the classification ANN 210 is repeated for each image in the input dataset.

[0093] An implementation of the embodiment will now be described.

[0094] In the implementation, the MVTec AD dataset, which has 15 different categories of textures and objects segmented from real-world applications, is used. In a preprocessing step, the images are rasterized and normalized to 256 x 256 pixels. The dataset has a corresponding ground truth dataset for the location of anomalies as mask images. The implementation is applied using these ground truth mask images as input data to evaluate the technique.

[0095] Training and testing are implemented in PyTorch. A batch size of 16 images is used to test the network. The model is optimized using the SGD optimizer with learning rate = 1 × 10, momentum = 0.9, weight decay = 0, and dampening = Nesterov = False.

[0096] Figure 10 shows the results of each epoch using this technique. These are feature maps extracted from the network using two-dimensional PCA and clustered using k-means. The color of the labels in the left graph represents the ground truth, while the color of the labels in the right graph represents the accuracy. The goal of this implementation is to separate groups by distance on the feature maps. Epoch 0 is an example using an untrained network. Without training, there are roughly two groups. Once the network is trained, these groups become more distant from each other. The Silhouette Coefficient, Pseudo-F, and Davis-Bouldin Index can be used as metrics to determine when to terminate training.

[0097] Figure 11 shows the best results for a production sample transistor. The feature map on the left is shown with the sample picture. In this case, there are four classifications of anomalies and a good one (no anomalies). The predicted clustering is shown in the graph on the right.

[0098] Figure 12 shows the numerical results using 15 MVTec datasets as benchmark inputs against existing methods (PCA and unsupervised clustering, transfer learning, deep clustering https: / / arxiv.org / pdf / 1807.05520.pdf). The values are normalized mutual information, which is widely used to evaluate unsupervised clustering in this work. On all datasets, this technology outperforms existing methods.

[0099] Figure 15 is a block diagram of a computing device, such as a computing machine or server, that embodies the present invention and can be used to implement a computing device adapted to identify and classify anomalies in images of production samples, such as that depicted in Figure 1, and that performs the operations depicted in Figures 2-5 and 7-9. The computing device has a processor 993 and memory 994. Optionally, the computing device also includes a network interface 997 for communicating with the computing device, for example, with other computing devices of invention embodiments.

[0100] For example, an embodiment may consist of a network of such computing devices. Optionally, the computing devices also include one or more input mechanisms, such as a keyboard and mouse 996, and display units, such as one or more monitors 995. The components may be connectable to one another via a bus 992. The computing devices may include, or be in data communication with, imaging devices, such as cameras that capture images of production samples.

[0101] The memory 994 may include a computer-readable medium. The term computer-readable storage medium may refer to a single medium or multiple media (e.g., centralized or distributed databases and / or associated caches and servers) configured to carry computer-executable instructions or on which data structures are stored. Computer-executable instructions may include, for example, instructions and data that can be accessed by a general-purpose computer, a special-purpose computer, or a special-purpose processing device (e.g., a processor) to cause it to perform one or more functions or operations. Thus, the term "computer-readable storage medium" may also include any medium capable of storing, encoding, or carrying a set of instructions that can be executed by a machine to cause the machine to perform any one or more of the methods disclosed herein. The term "computer-readable storage medium" may therefore be understood to include, but is not limited to, solid-state memory, optical media, and magnetic media. By way of example, and not limitation, such computer-readable media may include non-transitory computer-readable storage media including random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), compact disc read-only memory (CD-ROM) or other optical disk storage, magnetic disk storage or other magnetic storage devices, flash memory devices (e.g., solid-state memory devices).

[0102] The processor 993 is configured to control a computing device to perform processing operations, e.g., execute code stored in memory to implement the various different steps of FIGS. 1, 2, 3, 5, and 6 described herein. The processor 993 may include a graphics processing unit (GPU) adapted to implement one or more neural networks, such as the generative neural network 220. The memory 994 stores data read from and written to by the processor 993. As referred to herein, a processor may include one or more general-purpose processing devices, such as a microprocessor, a central processing unit, or the like. The processor may include a multiple instruction set computing (CISC) microprocessor, a reduced instruction set computing (RISC) microprocessor, a very long instruction word (VLIW) microprocessor, or a processor implementing other instruction sets or a combination of instruction sets. A processor may also include one or more special purpose processing devices, such as an application specific integrated circuit (ASIC), a field programmable gate array (FPGA), a digital signal processor (DSP), a network processor, etc. In one or more embodiments, a processor is configured to execute instructions to perform the operations and steps described herein.

[0103] The display unit 997 may display representations of data stored by the computing device, and may also display cursors and dialog boxes and screens that allow interaction between a user and programs and data stored on the computing device. The input mechanism 996 may allow a user to input data and instructions into the computing device.

[0104] The network interface (network I / F) 997 may be connected to a network such as the Internet, and can be connected to other such computers via the network. The network I / F 997 can control data input / output with other devices via the network. Other peripheral devices such as a microphone, speaker, printer, power supply unit, fan, case, scanner, trackball, etc. may also be included in the computer device.

[0105] Methods embodying the present invention may be performed on a computing device such as that depicted in Figure 15. Such a computing device may not include all of the components depicted in Figure 15, or may consist of a subset of those components. Methods embodying the present invention may be performed by a single computing device in communication with one or more data storage servers over a network. The computing device may be data storage that itself stores the output of classification ANN 210 and S106.

[0106] Methods embodying the present invention may be performed by multiple computing devices operating in cooperation with one another, one or more of which may be data storage servers that store at least a portion of the classification ANN 210 and the above output identifications and classifications from S106.

[0107] In addition to the above, the following notes are disclosed: (Appendix 1) 1. A computing device configured to identify and classify anomalies in an image, the computing device comprising: memory hardware and processor hardware, the memory hardware storing a classification artificial neural network (ANN) and processing instructions, and the processor hardware configured to execute the processing instructions, The processing instructions, when executed, cause the computing device to: performing unsupervised anomaly detection on an input dataset of images to detect anomalous portions in the images and generating, for each image in the dataset, a corresponding mask image that conveys any detected one or more anomalous portions in the image and blocks non-anomalous portions; training said classification ANN; Execute The training step comprises, in each training epoch: In the first process, processing a masked version of the input dataset with the classification ANN, the masked version having each image of the input dataset masked by the corresponding mask image, and training the classification ANN to classify anomalies into one of a plurality of classes by minimizing a cross-entropy loss function using automatically generated labels as ground truth; extracting from the classification ANN a latent feature representation for each image in the masked version of the input dataset; In the second process, generating a set of pseudo labels corresponding to the masked version of the input dataset by applying an unsupervised clustering algorithm to the latent feature representations to cluster each of the latent feature representations into one of a plurality of clusters, each cluster having a different associated pseudo label, to obtain a pseudo label corresponding to each image of the input dataset; training the classification ANN to minimize a loss function between classes in which each image in the input dataset is classified by the classification ANN using the pseudo-label of that image as ground truth; Including, the computer device is caused to repeatedly run the training epochs until a training condition is satisfied, and to output, for each image in the input dataset, an identification of each detected anomaly along with a corresponding classification to which the anomaly is classified by the classification ANN. Computer equipment. (Appendix 2) the masked version of the input data set processed by the classification ANN in the first process is filtered by an image filter or transformed by an image transformation algorithm in addition to being masked by the corresponding mask; 2. The computing device of claim 1. (Appendix 3) the image filter is an embossed image filter, or the image transformation algorithm is an embossing image transformation algorithm; 10. The computing device of claim 2. (Appendix 4) the masked version of the input dataset comprises multiple versions of each member of the input dataset, the multiple versions being the image having applied thereto each of a selection of multiple image transformation algorithms or image filters; 10. The computing device of claim 2. (Appendix 5) the automatically generated labels are determined by the image transformation algorithms or image filters that have been applied to the versions, such that each image transformation algorithm or image filter maps to a label, and the values of the labels are arbitrary values that are different from one another; 5. The computing device of claim 4. (Appendix 6) the unsupervised anomaly detection is performed by an autoencoder or a generative neural network that is pre-trained to generate a defect-free portion of an image and to generate a mask image corresponding to the image by generating a defect-free version of the image from the input dataset and comparing the image with the generated defect-free version to generate the mask. 2. The computing device of claim 1. (Appendix 7) the generative neural network is a generative adversarial neural network; 7. The computing device of claim 6. (Appendix 8) The loss function in the first process is pixel-wise cross-entropy loss. 2. The computing device of claim 1. (Appendix 9) Each training epoch is In the third process, generating a modified version of each image of the masked version of the input dataset as a modified masked input dataset by adding noise data to each image of the masked version of the input dataset and by applying a transform or filter; further training the classification ANN to maximize mutual information as a loss function based on the classification ANN's processing of input dataset A, the masked input dataset, and the classification ANN's processing of input dataset B, the modified masked input dataset; Further comprising: 9. The computing device of any one of claims 1 to 8. (Appendix 10) a computer device according to claim 1; an imaging device configured to generate images and store the generated images as an input data set for processing by the computing device; A system having: (Appendix 11) the image is an image of a production sample; further comprising a production environment for producing the product or material as a production sample; 11. The system of claim 10. (Appendix 12) 1. A method for identifying and classifying anomalies in an image, comprising: performing unsupervised anomaly detection on an input dataset of images to detect anomalous portions in the images and generating, for each image in the dataset, a corresponding mask image that conveys any detected one or more anomalous portions in the image and blocks non-anomalous portions; Training a classification artificial neural network (ANN) and The training step comprises, in each training epoch: In the first process, processing a masked version of the input dataset with the classification ANN, the masked version having each image of the input dataset masked by the corresponding mask image, and training the classification ANN to classify anomalies into one of a plurality of classes by minimizing a cross-entropy loss function using automatically generated labels as ground truth; extracting from the classification ANN a latent feature representation for each image in the masked version of the input dataset; In the second process, generating a set of pseudo labels corresponding to the masked version of the input dataset by applying an unsupervised clustering algorithm to the latent feature representations to cluster each of the latent feature representations into one of a plurality of clusters, each cluster having a different associated pseudo label, to obtain a pseudo label corresponding to each image of the input dataset; training the classification ANN to minimize a loss function between classes in which each image in the input dataset is classified by the classification ANN using the pseudo-label of that image as ground truth; Including, The method includes repeatedly performing the training epochs until a training condition is satisfied, and outputting, for each image in the input dataset, an identification of each detected anomaly along with a corresponding classification to which the anomaly is classified by the classification ANN. method. (Appendix 13) 1. A computer program product that, when executed by a computing device having processor hardware and memory hardware, causes the computing device to perform a method for identifying and classifying anomalies in images, the computer program product comprising: The method comprises: performing unsupervised anomaly detection on an input dataset of images to detect anomalous portions in the images and generating, for each image in the dataset, a corresponding mask image that conveys any detected one or more anomalous portions in the image and blocks non-anomalous portions; Training a classification artificial neural network (ANN) and The training step comprises, in each training epoch: In the first process, processing a masked version of the input dataset with the classification ANN, the masked version having each image of the input dataset masked by the corresponding mask image, and training the classification ANN to classify anomalies into one of a plurality of classes by minimizing a cross-entropy loss function using automatically generated labels as ground truth; extracting from the classification ANN a latent feature representation for each image in the masked version of the input dataset; In the second process, generating a set of pseudo labels corresponding to the masked version of the input dataset by applying an unsupervised clustering algorithm to the latent feature representations to cluster each of the latent feature representations into one of a plurality of clusters, each cluster having a different associated pseudo label, to obtain a pseudo label corresponding to each image of the input dataset; training the classification ANN to minimize a loss function between classes in which each image in the input dataset is classified by the classification ANN using the pseudo-label of that image as ground truth; Including, The method includes repeatedly performing the training epochs until a training condition is satisfied, and outputting, for each image in the input dataset, an identification of each detected anomaly along with a corresponding classification to which the anomaly is classified by the classification ANN. Computer program. (Appendix 14) 14. A non-transitory computer-readable storage medium storing the computer program of claim 13. [Explanation of symbols]

[0108] 100 Processor Hardware 200 Memory Hardware 210 Classification ANN 220 Generative Neural Networks 221 Discriminative Neural Networks 993 processor 994 memory 997 Network Interface D101 input dataset D102a Masked Version D102b Modified masked version D103 Latent Feature Representation D104 Pseudo Label

Claims

1. 1. A computing device configured to identify and classify anomalies in an image, the computing device having memory hardware and processor hardware, the memory hardware storing a classification artificial neural network and processing instructions, and the processor hardware configured to execute the processing instructions, The processing instructions, when executed, cause the computing device to: performing unsupervised anomaly detection on an input dataset of images to detect anomalous portions in the images and generating, for each image in the input dataset, a corresponding mask image that conveys any detected one or more anomalous portions in the image and blocks non-anomalous portions; training said classification artificial neural network; Execute The training step comprises, in each training epoch: In the first process, processing a masked version of the input dataset with the classification artificial neural network, the masked version having each image of the input dataset masked by the corresponding mask image, and training the classification artificial neural network to classify anomalies into one of a plurality of classes by minimizing a cross-entropy loss function using automatically generated labels as ground truth; extracting from the classification artificial neural network a latent feature representation for each image in the masked version of the input dataset; In the second process, generating a set of pseudo labels corresponding to the masked version of the input dataset by applying an unsupervised clustering algorithm to the latent feature representations to cluster each of the latent feature representations into one of a plurality of clusters, each cluster having a different associated pseudo label, to obtain a pseudo label corresponding to each image of the input dataset; training the classification artificial neural network to minimize a loss function between classes in which each image in the input dataset is classified by the classification artificial neural network using the pseudo-label of that image as ground truth; Including, the computer device repeatedly performs the training epochs until a training condition is satisfied, and for each image in the input dataset, outputs an identification of each detected anomaly along with a corresponding classification to which the anomaly is classified by the classification artificial neural network; the masked version of the input data set processed by the classification artificial neural network in the first process is filtered by an image filter or transformed by an image transformation algorithm in addition to being masked by the corresponding mask image; the masked version of the input dataset comprises a plurality of versions of each member of the input dataset, the plurality of versions being the image having a respective one of a selection of image transformation algorithms or image filters applied thereto; the automatically generated labels are determined by the image transformation algorithms or image filters that have been applied to the versions, such that each image transformation algorithm or image filter maps to a label, and the values of the labels are arbitrary values that are different from one another; Computer equipment.

2. the image filter is an embossed image filter, or the image transformation algorithm is an embossing image transformation algorithm; The computer device of claim 1 .

3. the unsupervised anomaly detection is performed by an autoencoder or a generative neural network that is pre-trained to generate a defect-free portion of an image and to generate a mask image corresponding to the image by generating a defect-free version of the image from the input dataset and comparing the image with the generated defect-free version to generate the corresponding mask image. The computer device of claim 1 .

4. the generative neural network is a generative adversarial neural network; 4. The computer device of claim 3.

5. The loss function in the first process is pixel-wise cross-entropy loss. The computer device of claim 1 .

6. Each training epoch is In the third process, generating a modified version of each image of the masked version of the input dataset as a modified masked input dataset by adding noise data to each image of the masked version of the input dataset and by applying a transform or filter; further training the classification artificial neural network to maximize mutual information as a loss function based on the classification artificial neural network's processing of the masked input dataset, Input Dataset A, and the classification artificial neural network's processing of the modified masked input dataset, Input Dataset B; Further comprising: A computer device according to any one of claims 1 to 5.

7. A computer device according to claim 1; an imaging device configured to generate images and store the generated images as an input data set for processing by the computing device; A system having:

8. the image is an image of a production sample; further comprising a production environment for producing the product or material as a production sample; The system of claim 7.

9. A method for identifying and classifying anomalies in an image by a processor, comprising: performing unsupervised anomaly detection on an input dataset of images to detect anomalous portions in the images and generating, for each image in the input dataset, a corresponding mask image that conveys any detected one or more anomalous portions in the image and blocks non-anomalous portions; Training a classification artificial neural network and The training step comprises, in each training epoch: In the first process, processing a masked version of the input dataset with the classification artificial neural network, the masked version having each image of the input dataset masked by the corresponding mask image, and training the classification artificial neural network to classify anomalies into one of a plurality of classes by minimizing a cross-entropy loss function using automatically generated labels as ground truth; extracting from the classification artificial neural network a latent feature representation for each image in the masked version of the input dataset; In the second process, generating a set of pseudo labels corresponding to the masked version of the input dataset by applying an unsupervised clustering algorithm to the latent feature representations to cluster each of the latent feature representations into one of a plurality of clusters, each cluster having a different associated pseudo label, to obtain a pseudo label corresponding to each image of the input dataset; training the classification artificial neural network to minimize a loss function between classes in which each image in the input dataset is classified by the classification artificial neural network using the pseudo-label of that image as ground truth; Including, the method includes repeatedly performing the training epochs until a training condition is satisfied, and outputting, for each image in the input dataset, an identification of each detected anomaly along with a corresponding classification to which the anomaly is classified by the classification artificial neural network; the masked version of the input data set processed by the classification artificial neural network in the first process is filtered by an image filter or transformed by an image transformation algorithm in addition to being masked by the corresponding mask image; the masked version of the input dataset comprises a plurality of versions of each member of the input dataset, the plurality of versions being the image having a respective one of a selection of image transformation algorithms or image filters applied thereto; the automatically generated labels are determined by the image transformation algorithms or image filters that have been applied to the versions, such that each image transformation algorithm or image filter maps to a label, and the values of the labels are arbitrary values that are different from one another; method.

10. A non-transitory storage medium for storing a computer program, the computer program, when executed by a computing device having processor hardware and memory hardware, causes the computing device to perform a method for identifying and classifying anomalies in images; The method comprises: performing unsupervised anomaly detection on an input dataset of images to detect anomalous portions in the images and generating, for each image in the input dataset, a corresponding mask image that conveys any detected one or more anomalous portions in the image and blocks non-anomalous portions; Training a classification artificial neural network and The training step comprises, in each training epoch: In the first process, processing a masked version of the input dataset with the classification artificial neural network, the masked version having each image of the input dataset masked by the corresponding mask image, and training the classification artificial neural network to classify anomalies into one of a plurality of classes by minimizing a cross-entropy loss function using automatically generated labels as ground truth; extracting from the classification artificial neural network a latent feature representation for each image in the masked version of the input dataset; In the second process, generating a set of pseudo labels corresponding to the masked version of the input dataset by applying an unsupervised clustering algorithm to the latent feature representations to cluster each of the latent feature representations into one of a plurality of clusters, each cluster having a different associated pseudo label, to obtain a pseudo label corresponding to each image of the input dataset; training the classification artificial neural network to minimize a loss function between classes in which each image in the input dataset is classified by the classification artificial neural network using the pseudo-label of that image as ground truth; Including, the method includes repeatedly performing the training epochs until a training condition is satisfied, and outputting, for each image in the input dataset, an identification of each detected anomaly along with a corresponding classification to which the anomaly is classified by the classification artificial neural network; the masked version of the input data set processed by the classification artificial neural network in the first process is filtered by an image filter or transformed by an image transformation algorithm in addition to being masked by the corresponding mask image; the masked version of the input dataset comprises a plurality of versions of each member of the input dataset, the plurality of versions being the image having a respective one of a selection of image transformation algorithms or image filters applied thereto; the automatically generated labels are determined by the image transformation algorithms or image filters that have been applied to the versions, such that each image transformation algorithm or image filter maps to a label, and the values of the labels are arbitrary values that are different from one another; Non-transitory storage media.

Citation Information

Patent Citations

  • Steel pipe internal corrosion analyzer and steel pipe internal corrosion analysis method

    JP2014178328A

  • Surface defect identification method and apparatus

    JP2020187735A