#1 Introduction
1.semi-supervised anomaly detection
Employ adversarial autoencoder within an encoder-decoder-encoder pipeline and using a conditional generative adversarial network, capturing the data distribution with both images and latent vector.
2.efficacy
Yielding both statistically and computationally better performance.
3.reproducibility
It can be reproduced via the code made publicly available.
#2 Related Work
-
AnoGAN :Training a generator and discriminator using only normal images and utilizing the pre-trained generator and discriminator by freezing the wights and remap to the latent vector by optimizing the GAN based on the z vector. However, the model has a computational complexity.
-
BiGAN: Examining joint training to map from image space to latent space simultaneously, and vice-versa.
#3 Approach
Basic knowledge
1.GAN: The generator learns the distribution of input data from a latent space while the discriminator network has a classical classification architecture to determine input image validity
2.AAE: Being consisted of encoder and decoder which is beneficial in reconstruction and control latent space
3.GAN with Inference: Exploiting latent space variables which means uses an additional encoder mapping from image to latent space
1.The first sub-network
-
The generator G first reads the input image x and forward-passes to encoder network $G_E$, and the z has the smallest dimension containing the best representation of x :
$$
G_E=;convolutional;layers;+;batch;norm;+;leaky;ReLU()
$$ -
The decoder $G_D$ upscales the vector z to reconstruct x
$$
G_D=;convolutional;layers;+;batch;norm;+;leaky;ReLU();+;tanh layer
$$
2.The second sub-network ★
- The encoder compresses the image $\overset\wedge x$ reconstructed by the network G.This E explicitly learns to minimize the distance with its parametrization
3.The third sub-network
- Discriminator network D: To classify the input and the output as real or fake
##3.2 Loss function
-
Adversarial loss
Compute the distance between the feature representation of the original and the generated images:
$$
L_{adv};=;E_{x\sim p_X};\parallel f(x)-;E_{x\sim p_X};f(G(x)\parallel_2
$$ -
Contextual loss
Learning the contextual information about input data($L_1$ will have a better perfornmance than $L_2$)
$$
L_{con};=;E_{x\sim p_X};\parallel x-;G(x)\parallel_1
$$
-
Encoder loss
Minimize the distance between the bottleneck feature of the input and the encoded features of the generated image
$$
L_{enc};=;E_{x\sim p_X};\parallel G_E(x)-;E(;f(G(x);)\parallel_2
$$
Overall, the objective function is:
$$
L;=;w_{adv}L_{adv};+;w_{con}L_{con};+;w_{enc}L_{enc}
$$
##3.3 Model Testing
For the test sample $\overset\wedge x$ the anomaly score is defined as:
$$
A(x);=;\parallel G_E(x)-;E(;G(x);)\parallel_1\
$$
To evaluate the overall anomaly performance, the anomaly score for the final evaluation of the set will be defined as:
$$
s_i^';=;\frac{s_i-min(s)}{max(s)-min(s)}
$$
#4 Result
- The GANomaly model achieves higher AUC than EGBAN and AnoGAN
- The reason for getting relatively lower quantitative results for a selected abnormal category, there exists a normal class that is similar to the abnormal
- (a) show the size of the latent vector will affect the overall performance of the model and the best size is 100
- (b) show the best wight of the loss function is:$w_{bce}$ = 1, $w_{rec}$ = 50,$w_{enc}$ = 1
- a shows the histogram of the scores for normal and abnormal test samples
- b shows features extracted from the last conv
- The image shows the model is unable to produce abnormal objects
References
Samet Akcay. GANomaly: Semi-Supervised Anomaly
Detection via Adversarial Training