Systems and methods for unsupervised anomaly detection
Embodiments described herein provide a system and method for unsupervised anomaly detection. The system receives, via a communication interface, a dataset of instances that include anomalies. The system determines, via an inlier model, a set of noisy labels. The system trains a causality-based label-noise model based at least in part on the set of noisy labels and the set of high-confidence instances. The system determines an estimated proportion of anomalies in the dataset of instances. The system retrains the inlier model based on the estimated inlier samples. The system iteratively retrains the inlier model and the trained causality-based label-noise model based on the output from the corresponding retrained models not converging within the convergence threshold. The system extracts the anomaly detection model from the iteratively trained causality-based label-noise model.
1 . A method for building an anomaly detection neural network model using an unsupervised training framework including an inlier neural network model and a causality-based label-noise neural network model mutually coupled to a respective output of each other, the method comprising:
receiving, via a communication interface, a dataset of images without any label indicating whether any image is an anomaly;
generating, via the inlier neural network model implemented on one or more processors, a set of noisy labels associated with a subset of the dataset of images that are estimated to be anomalies based on a contamination parameter indicative of a percentage of the images in the dataset being anomalies;
identifying, by the inlier neural network model, a set of high-confidence images that are determined to be either inlier samples or outlier samples with a higher-than-threshold confidence from an input of the dataset of images;
training the causality-based label-noise neural network model, implemented on the one or more processors using a combination of at least a first loss based at least in part on the set of noisy labels and at least a second loss based at least in part on the set of high-confidence images;
generating, via the trained causality-based label-noise neural network model implemented on the one or more processors, a distribution of an estimated proportion of the anomalies in the dataset of images from an input of the dataset of images;
refining the contamination parameter based on the estimated proportion;
training the inlier neural network model based on the estimated inlier samples in the dataset of images determined from the estimated proportion of the anomalies, wherein the estimated inlier samples in the dataset of images is determined based on the estimated proportion of the anomalies;
iteratively retraining the trained inlier neural network model and the trained causality-based label-noise neural network model based on outputs from each other until a first output of the retrained inlier neural network model and a second output of the trained causality-based label-noise neural network model are within a convergence threshold;
building the anomaly detection neural network model from the iteratively retrained causality-based label-noise neural network model by extracting an encoder of the iteratively retrained causality-based label-noise neural network model; and
detecting, using the built anomaly detection neural network model comprising the extracted encoder from the training and the retraining, an anomaly in a testing dataset of images.
2 . The method of claim 1 , wherein the building the anomaly detection neural network model from the iteratively trained causality-based label noise neural network model comprises:
extracting the encoder from the iteratively retrained causality-based label-noise neural network model after the output of the inlier neural network model and the causality-based label-noise neural network model coverages; and
interfacing, via the communication interface, the input/output of the encoder.
3 . The method of claim 1 , wherein the method further comprises:
determining a regularization loss based on the set of high-confidence images and a set of clean labels determined via the causality-based label-noise neural network model;
determining a cross-entropy loss based on the set of noisy labels generated via the inlier neural network model and a reconstructed set of noisy labels generated based on reconstructed input dataset of images via the causality-based label-noise neural network model; and
retraining the causality-based anomaly-detection neural network model based on minimizing the regularization loss and the cross-entropy loss.
4 . The method of claim 3 , further comprising:
determining a reconstruction loss based on the reconstructed dataset of images and the dataset of images; and
retraining the causality-based anomaly-detection neural network model based on minimizing the reconstruction loss.
5 . The method of claim 1 , wherein the determining the set of high-confidence images comprises:
determining a set of inlier images that are a percentile threshold away from a boundary layer between outliers and inliers, wherein the boundary layer is determined based on the set of noisy labels;
determining a set of outlier images that are a percentile threshold away from a boundary layer between outliers and inliers, wherein the boundary layer is determined based on the set of noisy labels; and
determining the set of high-confidence images based on the set of inlier instances and the set of outlier images.
6 . The method of claim 1 , further comprising:
receiving, via the communication interface, an initial probability of anomalies; and
initializing the inlier neural network model with the dataset of images.
7 . The method of claim 1 , further comprising:
reconstructing a reconstructed dataset of images based on the noisy label from the inlier neural network model;
determining an inlier reconstruction loss based on the estimated proportion of anomalies in the dataset; and
retraining the inlier neural network model based on the inlier reconstruction loss.
8 . The method of claim 1 , wherein determining the set of noisy labels that correspond to anomalies in the dataset of images comprises:
determining whether an image in the dataset of images is an inlier based on a boundary layer of anomalies in the inlier neural network model, wherein the boundary layer of anomalies in the inlier neural network model is trained based on a probability of anomalies;
determining a label associated with the image in the dataset of images based on the probability of anomalies; and
determining a set of noisy labels that correspond to anomalies in the dataset of images.
9 . The method of claim 8 , wherein the probability of anomalies is an initial probability of anomalies during the initialization of the inlier neural network model.
10 . The method of claim 8 , wherein the probability of anomalies is the estimated proportion of anomalies during the retraining of the inlier neural network model.
11 . A system for building an anomaly detection neural network model using an unsupervised training framework including an inlier neural network model and a causality-based label-noise neural network model mutually coupled to a respective output of each other, the system comprising:
a communication interface for receiving a dataset of images without a label indicating whether any image is an anomaly;
a memory storing a plurality of machine-readable instructions; and
a processor reading and executing the instructions from the memory to perform operations comprising:
receive, via the communication interface, the dataset of images;
generate, via the inlier neural network model implemented on one or more processors, a set of noisy labels associated with a subset of the dataset of images that are estimated to be anomalies based on a contamination parameter indicative of a percentage of the images in the dataset being anomalies;
identify, by the inlier neural network model, a set of high-confidence images that are determined to be either inlier samples or outlier samples with a higher-than-threshold confidence from an input of the dataset of images;
train the causality-based label-noise neural network model, implemented on one or more processors using a combination of at least a first loss based at least in part on the set of noisy labels and at least a second loss based at least in part on the set of high-confidence images;
generate, via the trained causality-based label-noise neural network model implemented on the one or more processors, a distribution of an estimated proportion of the anomalies in the dataset of images from an input of the dataset of images;
refine the contamination parameter based on the estimated proportion;
train the inlier neural network model based on the estimated inlier samples in the dataset of images determined from the estimated proportion of the anomalies, wherein the estimated inlier samples in the dataset of images is determined based on the estimated proportion of the anomalies;
iteratively retrain the trained inlier neural network model and the trained causality-based label-noise neural network model based on outputs from each other until a first output of the retrained inlier neural network model and a second output of the trained causality-based label-noise neural network model are within a convergence threshold;
build the anomaly detection neural network model from the iteratively trained causality-based label-noise neural network model by extracting an encoder of the iteratively retrained causality-based label-noise neural network model; and
detect, using the built anomaly detection neural network model comprising the extracted encoder from the training and the retraining, an anomaly in a testing dataset of images.
12 . The system of claim 11 , wherein the processor further performs operations comprising:
extract the encoder from the iteratively retrained causality-based label-noise neural network model after the output of the inlier neural network model and the causality-based label-noise neural network model coverages; and
interface, via the communication interface, the input/output of the encoder.
13 . The system of claim 11 , wherein the processor further performs operations comprising:
determine a regularization loss based on the set of high-confidence images and a set of clean labels determined via the causality-based label-noise neural network model;
determine a cross-entropy loss based on the set of noisy labels generated via the inlier neural network model and a reconstructed set of noisy labels generated based on reconstructed input dataset of images via the causality-based label-noise neural network model; and
retrain the causality-based anomaly-detection neural network model based on minimizing the regularization loss and the cross-entropy loss.
14 . The system of claim 11 , wherein the processor further performs operations comprising:
determine a reconstruction loss based on the reconstructed dataset of images and the dataset of images; and
retrain the causality-based anomaly-detection neural network model based on minimizing the reconstruction loss.
15 . The system of claim 11 , wherein the processor further performs operations comprising:
determine a set of inlier images that are a percentile threshold away from a boundary layer between outliers and inliers, wherein the boundary layer is determined based on the set of noisy labels;
determine a set of outlier images that are a percentile threshold away from a boundary layer between outliers and inliers, wherein the boundary layer is determined based on the set of noisy labels; and
determine the set of high-confidence images based on the set of inlier images and the set of outlier images.
16 . The system of claim 15 , wherein the processor further performs operations comprising:
receive, via the communication interface, an initial probability of anomalies; and
initialize the inlier neural network model with the dataset of images.
17 . The system of claim 11 , wherein the processor further performs operations comprising:
reconstruct a reconstructed dataset of images based on the noisy label from the inlier neural network model;
determine an inlier reconstruction loss based on the estimated proportion of anomalies in the dataset; and
retrain the inlier neural network model based on the inlier reconstruction loss.
18 . The system of claim 17 , wherein the processor further performs operations comprising:
determining whether an image in the dataset of images is an inlier based on a boundary layer of anomalies in the inlier neural network model, wherein the boundary layer of anomalies in the inlier neural network model is trained based on a probability of anomalies;
determining a label associated with the image in the dataset of images based on the probability of anomalies; and
determining a set of noisy labels that correspond to anomalies in the dataset of images.
19 . A processor-readable non-transitory storage medium storing a plurality of processor-executable instructions for building an anomaly detection neural network model using an unsupervised training framework including an inlier neural network model and a causality-based label-noise neural network model mutually coupled to a respective output of each other, the instructions being executed by one or more processors to perform operations comprising:
receiving a dataset without a label indicating whether any image in the dataset is an anomaly;
generating, via the inlier neural network model implemented on one or more processors, a set of noisy labels associated with a subset of the dataset based on a contamination parameter indicative of a percentage of the images in the dataset being anomalies;
identifying, via the inlier neural network model implemented on the one or more processors, a set of high-confidence images that are determined to be either inlier samples or outlier samples with a higher-than-threshold confidence from an input of the dataset;
training the anomaly detection neural network model implemented on the one or more processors, using a combination of at least a first loss based on the set of noisy labels that identifies an intermediate clean label set and at least a second loss based on the set of high-confidence images;
generating, via the trained anomaly detection neural network model, an intermediate probability of anomalies in the dataset;
refining the contamination parameter based on the estimated proportion;
iteratively retraining the inlier neural network model and the trained anomaly detection neural network model based on the outputs from each other until a first output of the inlier neural network model and are within a convergence threshold;
determining a refined contamination parameter associated with the anomaly detection neural network model based on the proportion of anomalies in the anomaly detection neural network model at convergence; and
detecting, using the built anomaly detection neural network model, an anomaly in a testing dataset of images.
20 . The processor-readable non-transitory storage medium of claim 19 storing a plurality of processor-executable instructions for unsupervised anomaly detection, the instructions being executed by one or more processors to perform operations further comprising:
determining, via an autoencoder, a reconstructed inlier data set based on the intermediate clean label;
determining, a reconstruction loss based on the reconstructed inlier data set and the data set; and
updating the autoencoder based on the reconstruction loss.