<p>There is this interesting paper <a href="https://arxiv.org/pdf/1802.06222.pdf" rel="nofollow noreferrer">Efficient GAN-based anomaly detection</a>.<br />
To evaluate the anomaly detection, they use the following experimental setting</p>
<blockquote>
<p>MNIST: We generated 10 different datasets from MNIST by successively
making each digit class an anomaly and treating the remaining 9 digits
as normal examples. The training set consists of 80% of the normal data
and the test set consists of the remaining 20% of normal data and all
of the anomalous data. All models were trained only with normal data and
tested with both normal and anomalous data.</p>
</blockquote>
Anomaly detection with GAN
<p>There's something about GAN's training that i don't understand. I am making a GAN for Anomaly Detection. To start I followed this guide <a href="https://www.tensorflow.org/tutorials/generative/dcgan" rel="nofollow noreferrer">here</a> to create a DCGAN (and understand how it works) and then move into the Anomaly Detection stuff.</p>
<p>I understand how the two training's phases work for GANs and after nearly 2000 epochs the generator generate some good fake images. The problem is that the discriminator is not good to detect anomalies: if i try to give in input a real image, it produce a value between 0.5 and 1, no matter if the image has anomaly or not.</p>
<p>So basically, the discriminator is good to distinguish real images from fake images, but not good to discriminate real images with anomalies.</p>
<p>I tried to train the model some more but the results won't change (instead, it seems worst than before!). The two losses keep varing around 0 and 1, for example now the model has:</p>
<pre><code>gen_loss: 0.97844017, disc_loss: 0.9973822
</code></pre>
<p>What should I do to improve my net and make anomaly detection? It needs to be trained even more to make a better discriminator or for make anomaly detection should i add something more?</p>
<p>Thanks in advice, i'm definitely doing something wrong. If needed i can post some code and more information about my net.</p>
<p>P.S. My notebook is very similar to the one i linked before, the only difference is that i tried to feed test images to the discriminator after the training.</p>