2024 Volume 32 Pages 41-51
Anomaly detection is the main topic in artificial intelligence and a crucial factor in productivity. The anomaly detection model based on generative models is a prime approach in this field, such as AnoGAN, CBiGAN. However, most of the current anomaly detection models with generative models are not accurate enough to reconstruct images. These cause differences between the detection image and reconstruction image even in normal regions of the detection image, which seriously affects the detection accuracy. To solve this problem, this paper proposes a new method for anomaly detection called ACGan. It uses CBiGAN as the generative model and adds an attention network based on the U-Net structure to find anomalous regions in images. The method can avoid errors caused by the lack of accuracy in reconstructing images by focusing the model's attention on anomalous regions. In this paper, three training methods, unsupervised learning, supervised learning and supervised learning with noise data, are designed. Experiments on the realistic dataset MVTec AD validated the effectiveness of the model. For unsupervised learning, the model has higher accuracy than CBiGAN on most product images. The models trained by supervised learning with noise data are highly robust. And the model has super high accuracy and is adequate for practical industrial needs if supervised learning is used.