Skip to main content
Log in

Unsupervised abnormal detection using VAE with memory

  • Data analytics and machine learning
  • Published:
Soft Computing Aims and scope Submit manuscript

Abstract

Anomaly detection based on generative models usually uses the reconstruction loss of samples for anomaly discrimination. However, there are two problems in semi-supervised or unsupervised learning. One is that the generalizing ability of the generator is too strong, which may reduce the reconstruction loss of some outliers. The other is that the background statistics will interfere with the reconstruction loss of outliers. Both of them will reduce the effectiveness of anomaly detection. In this paper, we propose an anomaly detection method called MHMA (Multi-headed Memory Autoencoder). The variational autoencoder is used as the generation model, and the vector in potential space is limited by the memory module, which increases the reconstruction error of abnormal samples. Moreover, the MHMA uses the multi-head structure to divide the last layer of the decoder into multiple branches to learn and generate a diverse sample distribution, which keeps the generalization capability of the model within a reasonable range. In the process of calculating outliers, a likelihood ratio method is employed to obtain correct background statistics according to the background model, thus enhancing the specific features in the reconstructed samples. The effectiveness and universality of MHMA are tested on different types of datasets, and the results show that the model achieves 99.5\(\%\) recall, 99.9\(\%\) precision, 99.69\(\%\) F1 and 98.12\(\%\) MCC on the image dataset and it achieves 98.61\(\%\) recall, 98.73\(\%\) precision, 98.67\(\%\) F1 and 95.82\(\%\) MCC on the network security dataset.

This is a preview of subscription content, log in via an institution to check access.

Access this article

Price excludes VAT (USA)
Tax calculation will be finalised during checkout.

Instant access to the full article PDF.

Fig. 1
Fig. 2
Fig. 3
Fig. 4
Fig. 5
Fig. 6
Fig. 7
Fig. 8
Fig. 9
Fig. 10
Fig. 11
Fig. 12
Fig. 13
Fig. 14
Fig. 15
Fig. 16
Fig. 17
Fig. 18
Fig. 19

Similar content being viewed by others

Data availibility

The datasets generated during and/or analysed during the current study are available from the corresponding author on reasonable request.

References

  • Abdallah A, Maarof MA, Zainal A (2016) Fraud detection system: a survey. J Netw Comput Appl 68:90–113

    Article  Google Scholar 

  • Ahmed M, Naser Mahmood A, Hu J (2016) A survey of network anomaly detection techniques. J Netw Comput Appl 60:19–31

    Article  Google Scholar 

  • Ahmed M, Mahmood AN, Islam MR (2016) A survey of anomaly detection techniques in financial domain. Future Gener Comput Syst 55:278–288

    Article  Google Scholar 

  • Akcay S, Atapour-Abarghouei A, Breckon TP (2018) Ganomaly: semisupervised anomaly detection via adversarial training. arXiv:1805.06725

  • An J, Cho S (2015) Variational autoencoder based anomaly detection using reconstruction probability. Technical Report. SNU Data Mining Center, pp 1–18

  • Bengio Y, Lamblin P, Popovici D, Larochelle H (2007) Greedy layer-wise training of deep networks. Adv Neural Inf Process Syst 153-160

  • Chandola V, Banerjee A, Kumar V (2009) Anomaly detection. ACM Comput Surv 41(3):1-58, I, II

  • Chollet (2015) Francois and others. Keras, GitHub. https://github.com/keras-team/keras

  • Cui W et al (2019) Semi-supervised brain lesion segmentation with an adapted mean teacher model. In: Information processing in medical imaging [J]. IPMI 2019. Lecture Notes in Computer Science, vol 11492. Springer, Cham, pp 554–565

  • Dong C, Xue T, Wang C (2018) The feature representation ability of variational autoencoder [C]. In: 2018 IEEE 3rd international conference on data science in cyberspace (DSC), Guangzhou, pp 680–684

  • Duc TN et al. (2019) Consistency-based anomaly detection with adaptive multiple-hypotheses predictions. In: Proceedings of the 36th international conference on machine learning (ICML), Long Beach, California, PMLR 97

  • Gong, Liu D, Le L, Saha V, Mansour B, Venkatesh M, Hengel S, Anton (2019) Memorizing Normality to Detect Anomaly: Memory-augmented Deep Autoencoder for Unsupervised Anomaly Detection [C]. ICCV 2019

  • Goodfellow I, Pouget-Abadie J, Mirza M, Xu B, Warde-Farley D, Ozair S, Courville A, Bengio Y (2014) Generative adversarial nets. Adv Neural Inf Process Syst 2672–2680

  • Goodfellow I, Pouget-Abadie J, Mirza M, Xu B, Warde-Farley D, Ozair S, Courville A, Bengio Y (2014) Generative adversarial nets. In: Advances in neural information processing systems. pp 2672–2680

  • Google. 2016. TensorFlow, An open-source machine learning framework for everyone. 2016. https://www.tensorflow.org

  • Hodge V, Austin J (2004) A survey of outlier detection methodologies. Artif Intell Rev 22(2):85–126

    Article  Google Scholar 

  • Ian G, Yoshua B, Aaron C (2016) Deep learning. MIT Press, Cambridge

    MATH  Google Scholar 

  • Kawachi Y, Koizumi Y, Harada N (2018) Complementary set variational autoencoder for supervised anomaly detection. In: Proceedings of the ICASSP

  • Keller F, Muller E, Bohm K (2012) Hics: high contrast subspaces for densitybased outlier ranking. In: International conference on data engineering, pp 1037–1048. IEEE

  • Kingma DP, Ba J (2014) Adam: a method for stochastic optimization. arXiv:1412.6980

  • Kiran BR, Thomas DM, Parakkal R (2018) An overview of deep learning based methods for unsupervised and semi-supervised anomaly detection in videos. J Imaging 4(2):36, I, II

  • LeCun Y (1998) The mnist database of handwritten digits. http://yann.lecun.com/exdb/mnist/

  • Leglaive S, Girin L, Horaud R (2018) A variance modeling framework based on variational autoencoders for speech enhancement. In: IEEE 28th international workshop on machine learning for signal processing (MLSP). Aalborg 2018:1–6

  • Lichman M et al (2013) Uci machine learning repository

  • Liu FT, Ting KM, Zhou Z-H (2008) Isolation forest. In: International conference on data mining, pp 413-422. IEEE

  • Markou M, Singh S (2003) Novelty detection: a review-part 1: statistical approaches. Signal Processing 83(12):2481–2497

    Article  Google Scholar 

  • Markou M, Singh S (2003) Novelty detection: a review-part 2: neural network based approaches. Signal Process 83(12):2499–2521

    Article  Google Scholar 

  • Pimentel MA, Clifton DA, Clifton L, Tarassenko L (2014) A review of novelty detection. Signal Process 99:215-249, I, II

  • Schlegl T, Seebšck P, Waldstein SM, Schmidt-Erfurth U, Langs G (2017) Unsupervised anomaly detection with generative adversarial networks to guide marker discovery. Lecture notes in computer science (including subseries lecture notes in artificial intelligence and lecture notes in bioinformatics), vol 10265 LNCS, pp 146–147

  • Schölkopf B, Williamson RC, Smola AJ, ShaweTaylor J, Platt JC (2000) Support vector method for novelty detection. In: Advances in neural information processing systems, pp 582–588

  • Tan SC, Ting KM, Liu TF (2011) Fast anomaly detection for streaming data. IJCAI Proc Int Joint Conf Artif Intell 22:1511

    Google Scholar 

  • Xie X, Wang B, Wan T, Tang W (2020) Multivariate abnormal detection for industrial control systems using 1D CNN and GRU. IEEE Access 8:88348–88359

    Article  Google Scholar 

  • Yan S, Smith JS, Lu W et al (2020) Abnormal event detection from videos using a two-stream recurrent variational autoencoder. IEEE Trans Cognit Develop Syst 12(1):30–42

  • Yang X, Huang K, Goulermas JY, Zhang R (2017) Joint learning of unsupervised dimensionality reduction and gaussian mixture model. Neural Process Lett 45(3):791–806

    Article  Google Scholar 

  • Zenati H, Foo CS, Lecouat B, Manek G, Chandrasekhar VR (2018) Efficient gan-based anomaly detection. arXiv:1802.06222

  • Zhai S, Cheng Y, Lu W, Zhang Z (206) Deep structured energy based models for anomaly detection. arXiv:1605.07717

  • Zong B, Song Q, Min MR, Cheng W, Lumezanu C, Cho D, Chen H (2018) Deep autoencoding gaussian mixture model for unsupervised anomaly detection. In: International conference on learning representations

Download references

Funding

This work is supported by the National Natural Science Foundation of China, under Grant No. 62162026, the Science and Technology Key Research and Development Program of Jiangxi Province, under Grant No. 20202BBEL53004, and Science and Technology Project supported by education department of Jiangxi Province, under Grant No. GJJ210611. Conflict of Interest: The authors declare that they have no conflict of interest.

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Bin Wang.

Ethics declarations

Ethical approval

This article does not contain any studies with human participants or animals performed by any of the authors.

Additional information

Publisher's Note

Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.

Rights and permissions

Reprints and permissions

About this article

Check for updates. Verify currency and authenticity via CrossMark

Cite this article

Xie, X., Li, X., Wang, B. et al. Unsupervised abnormal detection using VAE with memory. Soft Comput 26, 6219–6231 (2022). https://doi.org/10.1007/s00500-022-07140-6

Download citation

  • Accepted:

  • Published:

  • Issue Date:

  • DOI: https://doi.org/10.1007/s00500-022-07140-6

Keywords

Navigation