Adversarially Learned One Class Classifier for Novelty Detection - shubham223601/Anomaly-Detection GitHub Wiki
Referenced from http://arxiv.org/abs/1802.09088
consist of two Deep Networks, Reconstructor(refinement) and the discriminator
- Refinement stage : reconstructs the input X, by generating x' and tries to fool D, so that discriminator is not able to distinguish between the actual and reconstructed image. Refinement Network is trained using encode-decoder network on samples from target class so as to map any input to target class. This network will efficiently reconstruct the samples which shares similar features same as trained target class and for the outliers the reconstruction would be poor .
Reconstructor Encoder, Decoder structure consist of 3 Convolutional layers followed by Batch Normalization layer each both at encoder and decoder side.
- During Training discriminator has the actual image available, so this network learns to differentiate between the actual and reconstructed image. discriminator consist of sequence of convolutional layers, that are trained to distinguish the outliers. where the output is the likelihood score
During testing discriminator network identifies the outliers and role of refinement network is to support discriminator in distinguishing by adequately reconstructing the positive samples and distorting the negative samples
Difference between GAN and this implementation :
Training is performed in a slightly different way compared to GAN
- GAN aims to generate the samples that follows the same distribution as the original data by adversial learning of generator and discriminator. Here G learns to map any random vector from latent space following distribution z to a sample that follows real data distribution and D tries to discriminate between the actual and fake data
where as in the proposed solution Refinement network adds noise sampled from normal distribution to input so as to make Reconstructor robust to noise and any kind of noise present in input samples. And the role of the discriminator is to decide if the output of reconstructor follows the distribution of the target class
model is then optimized to minimize the loss function consisting of the loss of the complete network(R+D) + Lambda * loss of R. This addition loss of R is taken because we want the output of Reconstructor to as close to original sample. The stopping criteria choosen here is training is stopped when R successfully maps noise images close to originial images carrying the distribution of target class.
so effectively the training procedure can be summarized as below:
- Reconstructor(working as a denoising autoencoder) reconstructs the noise added input samples to output , which would following the distribution of target class
- for any outlier data, R maps it to the output with some unknown distribution, so the reconstruction error here would be pretty high.
- when these output are passed to discriminator, it classifies the normal sample as closely following output distribution where as for the outlier sample it classifies as 0 since it does not follow the output distribution