# Fv-AD: F-AnoGAN Based Anomaly Detection in Chromatic Process for Smart Manufacturing
## 4 Experiment and Results
### Results and Analysis  
When learning WGAN, the final setting value of the hyperparameter is as follows: Epoch = 100, _Lr_ = 0.0002, batch_size = 32, _b1_ = 0.6, _b2_ = 0.999, latent_dim = 100, sample_interval = 400, and the hyperparameter values you set when you learned Encoder are as follows: Epoch = 200, batch_size=32. _Lr_ = 0.0002, _b1_ = 0.5, _b2_ = 0.999, latent_dim = 100, sample_interval = 400. The learning was performed after it was set to x, and the following performance was confirmed. Figure 8 shows a histogram of the scores for normal and abnormal data. The normal image distribution of the histogram graph is 0.15 or higher and 0.06 or lower. This demonstrates that the threshold for anomaly scores was set to a value between 0.06 and 0.15. The Results for the normal and abnormal data have significant implications and are visible. Anomaly scores can be represented as important indicators of the anomaly detection results \begin{table}
\begin{tabular}{c c c c c} \hline \hline
**Type** & **Label** & **Image\_distance** & **Anomaly\_score** & **Z\_distance** & **Loss** \\ \hline Class & 1 & 0.0113228 & 0.015835 & 0.001151 & 1171.768912 \\  & 1 & 0.013555 & 0.020455 & 0.008917 & 1290.782983 \\  & 1 & 0.012377 & 0.017536 & 0.003320 & 1012.679232 \\  & 1 & 0.014349 & 0.021915 & 0.011179 & 1266.791052 \\  & 1 & 0.013614 & 0.018974 & 0.008290 & 1387.901923 \\  &... &... &... &... \\  & 1 & 0.018190 & 0.028164 & 0.005597 & 1206.969482 \\  & 1 & 0.016685 & 0.024101 & 0.003862 & 1124.322021 \\  & 1 & 0.020770 & 0.032192 & 0.020772 & 1307.966553 \\  & 1 & 0.020538 & 0.031241 & 0.005769 & 1238.942871 \\  & 1 & 0.017792 & 0.030411 & 0.002449 & 1274.199707 \\ \hline Mean & 1 & 0.013291 & 0.021593 & 0.005569 & 1143.691237 \\ \hline \hline \end{tabular}
\end{table} 
Table 1: Performance matrix of anomaly detection score for normal data. \begin{table}
\begin{tabular}{c c c c c} \hline \hline
**Type** & **Label** & **Image\_distance** & **Anomaly\_score** & **Z\_distance** & **Loss** \\ \hline Class & 0 & 0.050823 & 0.228023 & 0.076672 & 2012.108765 \\  & 0 & 0.048244 & 0.194100 & 0.060309 & 1544.944214 \\  & 0 & 0.041436 & 0.118608 & 0.090345 & 1597.007935 \\  & 0 & 0.091974 & 0.452780  
in the process. In the graph, the \(x\)-axis represents the outlier score and the \(y\)-axis represents the number. Furthermore, the proposed anomaly score in F-AnoGAN can distinguish between bad and normal data, and the comparison image obtained from the difference between the test and generated images can accurately determine the abnormal part. Figure 9 shows a graph of the loss function obtained using the F-AnoGAN model. The \(x\)-axis represents the number of data points and the \(y\)-axis represents the loss value. The above figure shows that the experimental results of F-AnoGAN and AnoGAN were excellent. The loss value of F-AnoGAN is lower than that of AnoGAN and the images created by F-AnoGAN are more sophisticated than those created by AnoGAN. The image on the left side of Figure 10 show the image data of defective products that occurred during the chromate process. The data were found to be defective due to a crack at the bottom, and anomaly detection was performed using the generated image. The middle image was created by the generator, and although it did not attain the resolution of the real image, it created a false image. The final image compares the real image learned through the encoder with the fake image generated by the generator. The darkened part of the image indicates an abnormal part can be visually identified. Figure 8: Histogram of anomaly score. Figure 9: Loss function. The leftmost image in Figure 11 show the image data of the defective product that occurred during the chromate process. These data were found to be defective by the crack at the top, and anomaly detection was performed with the generated image. The middle image represents a fake image generated by the generator.