# Fv-AD: F-AnoGAN Based Anomaly Detection in Chromatic Process for Smart Manufacturing
## 2 Related Work
### GAN & AnoGAN  
GAN is a model from a paper titled \"Generative Adversarial Nets\" [1] that captures patterns or features of a dataset and then creates new data with similar distributions. GAN can learn generative models that generate realistic images in detail. In addition, learning such as a GAN system using noise for image generation is possible [19]. Accordingly, GAN is divided into two models: the generator and the discriminator. The generator generates \"fake\" images that are similar to \"real\" images and the discriminator successfully distinguishes between the \"fake\" and \"real\" images generated by the generator. As the learning progresses, the generator attempts to outperform the discriminator, and the discriminator attempts to outperform the generator. Subsequently, the performance of the discriminator finally reaches 50%, and the equilibrium is maintained. The formula given below is the result of formulating the competitive learning models of the generator and the discriminator.  
\[\min_{G}\max_{D}V(D,G)=\mathbb{E}_{\mathbf{x}\sim p_{\text{data}}(\mathbf{x})} [\log D(\mathbf{x})]+\mathbb{E}_{\mathbf{z}\sim p_{z}(\mathbf{z})}[\log(1-D(G( \mathbf{z})))], \tag{1}\]  
This paper, first published in 2014, has been followed by numerous follow-up studies in 2022. This GAN is used by AnoGAN for unsupervised anomaly detection. Anomaly detection using AnoGAN targets normal images of MNIST: for example, generative models are generated using normal images from MNIST. After creating a discriminator model that determines whether the image created by this generative model is real or fake, the anomaly score is quantitatively obtained. Subsequently, based on this anomaly score, unlabeled data are passed through the model to determine if they are anomalous. In addition, the Wasserstein GAN (WGAN) was used in this study, and an improved WGAN [20] training was proposed in 2017 [21].  
\[\mathcal{L}(\mathbf{z}_{\gamma})=(1-\lambda)\cdot\mathcal{L}_{R}(\mathbf{z}_{ \gamma})+\lambda\cdot\mathcal{L}_{D}(\mathbf{z}_{\gamma}).\quad(\lambda=0.1) \tag{2}\]  
The loss function in AnoGAN is a combination of both loss and reduction loss, and when two losses are added, the \(\mathbf{z}\) is updated. This is because existing supervised learning has limitations and, in this case, it is with weight. The generator and discriminator must have been trained before the latent z can be learned. However, as explained in Section 2.2, the problem is there is a large amount of data that are not labeled in the field, and the time and cost of creating additional datasets are limited. GAN, however, belongs to unsupervised learning and can be learned without the labels used in supervised learning. It also presents a significant advantage in directly generating data. Since then, new models based on various GAN models such as Deep Convolutional Generative Adversarial Network (DCGAN) [22], Least Squares Generative Adversarial Network (LSGAN) [23], Progressive Growing of Generative Adversarial Network (PGGAN) [24], and Super Resolution Generative Adversarial Network (SRGAN) [25], have been proposed, and AnoGAN is one such model. Figure 3[9] shows the architecture of the model of AnoGAN, which is based on the model of Fv-AnoGAN proposed in this paper.  
Figure 2: Anomaly Detection for Time series.