Anomaly Detection Using GANs for Visual Inspection in Noisy Training Data

Masanari Kimura,Takashi Yanagihara
DOI: https://doi.org/10.48550/arXiv.1807.01136
2018-11-07
Abstract:The detection and the quantification of anomalies in image data are critical tasks in industrial scenes such as detecting micro scratches on product. In recent years, due to the difficulty of defining anomalies and the limit of correcting their labels, research on unsupervised anomaly detection using generative models has attracted attention. Generally, in those studies, only normal images are used for training to model the distribution of normal images. The model measures the anomalies in the target images by reproducing the most similar images and scoring image patches indicating their fit to the learned distribution. This approach is based on a strong presumption; the trained model should not be able to generate abnormal images. However, in reality, the model can generate abnormal images mainly due to noisy normal data which include small abnormal pixels, and such noise severely affects the accuracy of the model. Therefore, we propose a novel anomaly detection method to distort the distribution of the model with existing abnormal images. The proposed method detects pixel-level micro anomalies with a high accuracy from 1024x1024 high resolution images which are actually used in an industrial scene. In this paper, we share experimental results on open datasets, due to the confidentiality of the data.
Computer Vision and Pattern Recognition
What problem does this paper attempt to address?
The problem that this paper attempts to solve is to use Generative Adversarial Networks (GANs) for image anomaly detection in the presence of noisy training data. Specifically, traditional methods only use normal images to model the distribution of normal images when training GANs, but these normal images may contain a small number of abnormal pixels, which will cause the model to erroneously learn abnormal features, thus affecting the accuracy of anomaly detection. Therefore, this paper proposes a new anomaly detection method, which adjusts the learning framework of the model by using known abnormal images to improve the detection accuracy of small anomalies. ### Main contributions of the paper: 1. **Solve the failure cases in previous studies**: Aiming at the problems existing in the research on anomaly detection using GANs, especially when the training data contains noise, the model may generate abnormal images. 2. **Propose a new anomaly detection method**: This method not only uses normal images, but also uses known abnormal images to train the model, thereby improving the robustness and accuracy of the model. 3. **Successfully detect small anomalies in high - resolution images**: This method can detect pixel - level small anomalies in 1024×1024 high - resolution images in actual industrial scenarios. ### Method overview: - **Problem background**: Traditional GAN anomaly detection methods assume that the trained generator can only generate normal images, but in reality, if the training data contains noise, the generator may generate abnormal images. - **Solution**: By introducing known abnormal images and adding a penalty term for abnormal images in the loss function, adjust the learning objective of the model so that the generator is more inclined to generate normal images. - **Technical details**: By redefining the objective function of GAN, introducing the distribution of abnormal images, and minimizing the difference between the real distribution and the mixed distribution by optimizing the Jensen - Shannon divergence (JSD). ### Experimental results: - **MNIST dataset**: The experimental results show that this method can almost perfectly generate images belonging to the normal category, but it cannot generate abnormal - category and normal - category - with - noise images well. - **Caltech - 256 dataset**: Under different numbers of normal categories, the F1 score of this method is better than other methods, especially when the number of normal categories increases, the performance is still stable. - **IR - MNIST dataset**: The experimental results show that for the number 3 not in the normal category, this method can detect a large difference, thereby effectively identifying anomalies. ### Conclusion: This paper proposes a Generative Adversarial Network method using normal images and known abnormal images. By adjusting the data distribution, the model is more focused on learning the ideal normal data distribution, thereby improving the accuracy and robustness of anomaly detection. The experimental results prove the effectiveness and superiority of this method on multiple datasets.