1 of 52

Anomaly Detection

5/21

2 of 52

Outline

  • What is Anomaly Detection
  • Classic Method
    • With Classifier
    • GMM (Gaussian Mixture Model)
    • Auto-Encoder
    • PCA
    • Isolation Forest
    • Summary
  • Anomaly Detection on image
    • AnoGAN
    • EGBAD
    • GANomaly
    • Summary
  • Anomaly Detection on Audio
    • GMGAN

3 of 52

What is Anomaly Detection

4 of 52

What is Anomaly

  • Training Data

Anomaly

Anomaly

5 of 52

Classic Method

6 of 52

With Classifier

7 of 52

With Classifier

8 of 52

GMM (Gaussian Mixture Model)

1-dim Gaussian Mixtures

http://speech.ee.ntu.edu.tw/DSP2019Autumn/Slides/2.0.pptx

9 of 52

GMM (Gaussian Mixture Model)

2-dim Gaussian

http://speech.ee.ntu.edu.tw/DSP2019Autumn/Slides/2.0.pptx

10 of 52

GMM (Gaussian Mixture Model)

N-dim Gaussian Mixtures

http://speech.ee.ntu.edu.tw/DSP2019Autumn/Slides/2.0.pptx

11 of 52

GMM (Gaussian Mixture Model)

12 of 52

GMM (Gaussian Mixture Model)

13 of 52

GMM (Gaussian Mixture Model)

14 of 52

GMM (Gaussian Mixture Model)

15 of 52

GMM (Gaussian Mixture Model)

16 of 52

Auto-Encoder

17 of 52

Auto-Encoder

18 of 52

PCA

http://speech.ee.ntu.edu.tw/~tlkagk/courses/ML_2017/Lecture/PCA%20(v3).pdf

19 of 52

PCA

20 of 52

PCA

21 of 52

PCA

22 of 52

PCA

23 of 52

Isolation Forest

  • Use tree like structure to split data

24 of 52

Isolation Forest

25 of 52

Isolation Forest

26 of 52

Isolation Forest

27 of 52

Isolation Forest

28 of 52

Summary of classic method

  • With Classifier
  • GMM (Gaussian Mixture Model)
  • Auto-Encoder
  • PCA
  • Isolation Forest

29 of 52

Anomaly detection on image

30 of 52

Typical GANs

31 of 52

Typical GANs

https://arxiv.org/pdf/1906.11632.pdf

32 of 52

Example

33 of 52

AnoGAN

  • Train a standard GAN only on positive samples

https://arxiv.org/pdf/1906.11632.pdf

34 of 52

AnoGAN

  • Anomaly Score

  • for 𝛾 = 1, 2, … 𝜞 find proper z

https://arxiv.org/pdf/1905.13147.pdf

35 of 52

AnoGAN

  • Pros
    • Showed that GANs can be used for anomaly detection
    • Introduced a new mapping scheme from latent space to input data space.
    • Used the same mapping scheme to define an anomaly score.
  • Cons
    • Requires Γ optimization steps for every new input: bad test-time performance
    • The GAN objective has not been modified to take into account the need for the inverse mapping learning.
    • The anomaly score is difficult to interpret, not being in the probability range.

https://arxiv.org/pdf/1906.11632.pdf

36 of 52

EGBAD (Efficient GAN-Based Anomaly Detection)

  • Train a Bi-GAN only on positive samples

https://arxiv.org/pdf/1906.11632.pdf

37 of 52

EGBAD (Efficient GAN-Based Anomaly Detection)

  • Pros
    • The Encoder E can learns how to encode image while adversarial training.
    • Therefore, it can bypass Γ optimization steps of AnoGAN while calculating anomaly score.

38 of 52

GANomaly

  • Generator is composed of encoder GE, decoder GD, and encoder E
  • Trained on only normal data.

  • Anomaly score

https://arxiv.org/pdf/1906.11632.pdf

https://arxiv.org/pdf/1905.13147.pdf

39 of 52

GANomaly

  • Pros
    • An encoder is learned during the training process, so it can bypass the Γ optimization.
    • Using an autoencoder like architecture (no use of noise prior) makes the entire learning process faster.
    • The contextual loss can be used to localize the anomaly.
  • Cons
    • Defines a new anomaly score.
    • It allows to detect anomalies both in the image space and in the latent space, but the results couldn’t match:
      • a higher anomaly score, that’s computed only in the latent space, can be associated with a generated sample with a low contextual loss value and thus very similar to the input - and vice versa.

https://arxiv.org/pdf/1906.11632.pdf

40 of 52

Evaluation Metric

  • TPR (True Positive Rate)

  • FPR (False Positive Rate)

41 of 52

Comparison

42 of 52

Summary of GANs

AnoGAN EGBAD GANomaly

43 of 52

Reference

44 of 52

Anomaly detection on Audio

45 of 52

GMGAN (Gaussian Mixture GAN)

https://arxiv.org/pdf/2002.01107.pdf

46 of 52

GMGAN (Gaussian Mixture GAN)

  • Adversarial loss

  • Image reconstruction loss

  • Latent representation loss

https://arxiv.org/pdf/2002.01107.pdf

47 of 52

GMGAN (Gaussian Mixture GAN)

  • Estimation loss
  • is a K-dimensional vector and.� denotes the input belongs to� the kth distribution.
  • Calculate the component of kth mixture.

https://arxiv.org/pdf/2002.01107.pdf

48 of 52

GMGAN (Gaussian Mixture GAN)

  • Estimation loss

https://arxiv.org/pdf/2002.01107.pdf

49 of 52

GMGAN (Gaussian Mixture GAN)

https://arxiv.org/pdf/2002.01107.pdf

50 of 52

GMGAN (Gaussian Mixture GAN)

51 of 52

Outline

  • What is Anomaly Detection
  • Classic Method
    • With Classifier
    • GMM (Gaussian Mixture Model)
    • Auto-Encoder
    • PCA
    • Isolation Forest
    • Summary
  • Anomaly Detection with GAN
    • AnoGAN
    • EGBAD
    • GANomaly
    • Summary
  • Anomaly Detection on Audio
    • GMGAN

52 of 52

More Reference