Skip to main content
Log in

RAMFAE: a novel unsupervised visual anomaly detection method based on autoencoder

  • Original Article
  • Published:
International Journal of Machine Learning and Cybernetics Aims and scope Submit manuscript

Abstract

Traditional methods of visual anomaly detection based on reconstruction often use normal data to train autoencoder. Then the metric distance detection method is used to estimate whether the samples of detection belong to the exception class. However, this method has some problems that the autoencoder produces blurry images to cause false detection of normal pixel points. The model may still be able to fully reconstruct the undiscovered defects due to the large capacity of autoencoder, even if it is trained only on normal samples. Then, the metric distance detection method would ignore local key information. To solve this problem, this paper comes up with the random anomaly multi-scale feature focused autoencoder (RAMFAE), an innovative unsupervised visual anomaly detection technique, which incorporates three novel concepts. First, a multi-scale feature focused extraction (MFFE) network structure is designed and added between the encoder and decoder, which effectively solves the problem of reconstructing image blur and effectively improves the sensitivity of the model to normal regions. Second, this article employs Delete Paste, a novel data augmentation strategy for generating two different types of random anomalies, which pastes the cut part into a random location, while the pixels in the original position are filled with 0. In spite of the input anomalous images, the strategy makes the model be able to produce normal images to avoid the phenomenon of anomaly reconstruction, and then enables defect localization based on the error between the measured image and the reconstructed image. Third, the study adopts the image quality assessment with combining gradient magnitude similarity deviation (GMSD) and structural similarity (SSIM) to solve the problem that local key information and texture detail information are not easy to be paid attention to by the model, and alleviate the training pressure caused by Delete Paste enhancement. We perform an extensive evaluation on the challenging MVTec AD data set and compare it with the advanced visual anomaly detection methods in recent years as well. The AUC final result of RAMFAE in this text reaches 94.5, which is 3.6, 2.5 and 0.8 higher than the advanced IGD, FCDD and RIAD detection methods.

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

Similar content being viewed by others

Data availability

The data are available from the corresponding author on reasonable request.

References

  1. Bergmann P, Löwe S, Fauser M et al (2018) Improving unsupervised defect segmentation by applying structural similarity to autoencoders. arXiv:1807.02011

  2. Bergmann P, Fauser M, Sattlegger D et al (2021) Mvtec ad-a comprehensive real-world dataset for unsupervised anomaly detection. Int J Comput Vis 129:1038–1059

    Article  Google Scholar 

  3. Bochkovskiy A, Wang CY, Liao HYM (2020) Yolov4: optimal speed and accuracy of object detection. arXiv:2004.10934

  4. Cao Y, Zhao N, Xu N et al (2022) Minimal-approximation-based adaptive event-triggered control of switched nonlinear systems with unknown control direction. Electronics 11:33–86

    Article  Google Scholar 

  5. Chen P, Liu S, Zhao H et al (2020) Gridmask data augmentation. arXiv:2001.04086

  6. Chen Y, Tian Y, Pang G et al (2022) Deep one-class classification via interpolated gaussian descriptor, vol 36, pp 383–392

  7. Chung H, Park J, Keum J et al (2020) Unsupervised anomaly detection using style distillation. IEEE Access 8:221494–221502

    Article  Google Scholar 

  8. Deecke L, Vandermeulen R, Ruff L et al (2018) Anomaly detection with generative adversarial networks, vol 11051, pp 3–17

  9. DeVries T, Taylor GW (2017) Improved regularization of convolutional neural networks with cutout. arXiv:1708.04552

  10. Glorot X, Bordes A, Bengio Y (2011) Deep sparse rectifier neural networks, vol 15, pp 315–323

  11. Golan I, El-Yaniv R (2018) Deep anomaly detection using geometric transformations. arXiv:1805.10917

  12. Gong D, Liu L, Le V et al (2019) Memorizing normality to detect anomaly: memory-augmented deep autoencoder for unsupervised anomaly detection. arXiv:1904.02639

  13. Goodfellow I, Pouget-Abadie J, Mirza M et al (2020) Generative adversarial networks. Commun ACM 63:139–144

    Article  Google Scholar 

  14. Hendrycks D, Mazeika M, Kadavath S et al (2019) Using self-supervised learning can improve model robustness and uncertainty. Advances in neural information processing systems, p 32

  15. Hinton GE, Zemel R (1993) Autoencoders, minimum description length and Helmholtz free energy. Advances in neural information processing systems, p 6

  16. Hou Q, Zhou D, Feng J (2021) Coordinate attention for efficient mobile network design. arXiv:2103.02907

  17. Hu J, Shen L, Sun G (2017) Squeeze-and-excitation networks. IEEE Trans Pattern Anal Mach Intell 42:2011–2023

    Article  Google Scholar 

  18. Ioffe S, Szegedy C (2015) Batch normalization: accelerating deep network training by reducing internal covariate shift, vol 37, pp 448–456

  19. Kang X, Zhang X, Li S et al (2017) Hyperspectral anomaly detection with attribute and edge-preserving filters. IEEE Trans Geosci Remote Sens 55:5600–5611

    Article  Google Scholar 

  20. Kingma DP, Welling M (2014) Auto-encoding variational Bayes. arXiv:1312.6114

  21. Li CL, Sohn K, Yoon J et al (2021) Cutpaste: self-supervised learning for anomaly detection and localization. arXiv:2104.04015

  22. Li H, Zhu F, Qiu J (2018) Cg-diqa: no-reference document image quality assessment based on character gradient. arXiv:1807.04047

  23. Lin D, Cao Y, Zhu W et al (2020) Few-shot defect segmentation leveraging abundant normal training samples through normal background regularization and crop-and-paste operation. arXiv:2007.09438

  24. Liu X, Yang L, Chen J et al (2022) Region-to-boundary deep learning model with multi-scale feature fusion for medical image segmentation. Biomed Signal Process Control 71:103–165

    Article  Google Scholar 

  25. Liznerski P, Ruff L, Vandermeulen RA et al (2020) Explainable deep one-class classification. arXiv:2007.01760

  26. Russakovsky O, Deng J, Su H et al (2015) Imagenet large scale visual recognition challenge. Int J Comput Vis 115:211–252

    Article  MathSciNet  Google Scholar 

  27. Schlegl T, Seeböck P, Waldstein SM et al (2017) Unsupervised anomaly detection with generative adversarial networks to guide marker discovery, pp 146–157. arXiv:1703.05921

  28. Schlegl T, Seeböck P, Waldstein SM et al (2019) f-anogan: fast unsupervised anomaly detection with generative adversarial networks. Med Image Anal 54:30–44

    Article  Google Scholar 

  29. Schlüter HM, Tan J, Hou B et al (2022) Natural synthetic anomalies for self-supervised anomaly detection and localization, pp 474–489. arXiv:2109.15222

  30. Simonyan K, Zisserman A (2014) Very deep convolutional networks for large-scale image recognition. arXiv:1409.1556

  31. Tack J, Mo S, Jeong J et al (2020) Csi: novelty detection via contrastive learning on distributionally shifted instances. Adv Neural Inf Process Syst 33:11839–11852

    Google Scholar 

  32. Tang TW, Kuo WH, Lan JH et al (2020) Anomaly detection neural network with dual auto-encoders gan and its industrial inspection applications. Sensors 20:33–36

    Article  Google Scholar 

  33. Tao X, Wang Z, Zhang Z et al (2018) Wire defect recognition of spring-wire socket using multitask convolutional neural networks. IEEE Trans Compon Packag Manuf Technol 8:689–698

    Article  Google Scholar 

  34. Veit A, Wilber MJ, Belongie S (2016) Residual networks behave like ensembles of relatively shallow networks. Advances in neural information processing systems, p 29

  35. Wang Z, Bovik AC, Sheikh HR et al (2004) Image quality assessment: from error visibility to structural similarity. IEEE Trans Image Process 13:600–612

    Article  Google Scholar 

  36. Woo S, Park J, Lee JY et al (2018) Cbam: convolutional block attention module, vol 11211, pp 3–19

  37. Xue W, Zhang L, Mou X et al (2013) Gradient magnitude similarity deviation: a highly efficient perceptual image quality index. IEEE Trans Image Process 23:684–695

    Article  MathSciNet  Google Scholar 

  38. Yan X, Zhang H, Xu X et al (2021) Learning semantic context from normal samples for unsupervised anomaly detection, vol 35, pp 3110–3118

  39. Yang H, Zhou Q, Song K et al (2020) An anomaly feature-editing-based adversarial network for texture defect visual inspection. IEEE Trans Ind Inf 17:2220–2230

    Article  Google Scholar 

  40. Yang J, Shi Y, Qi Z (2020b) Dfr: deep feature reconstruction for unsupervised anomaly segmentation. arXiv:2012.07122

  41. Yang Z, Bozchalooi IS, Darve E (2020c) Regularized cycle consistent generative adversarial network for anomaly detection. arXiv:2001.06591

  42. Zavrtanik V, Kristan M, Skočaj D (2021) Reconstruction by inpainting for visual anomaly detection. Pattern Recognit 112:107706–107722

    Article  Google Scholar 

  43. Zhang H, Cisse M, Dauphin YN et al (2017) mixup: beyond empirical risk minimization. arXiv:1710.09412

  44. Zhou K, Xiao Y, Yang J et al (2020) Encoding structure-texture relation with p-net for anomaly detection in retinal images, vol 12365, pp 360–377

Download references

Acknowledgements

This work was supported by the National Nature Science Foundation (61503038, 61403042); Scientific research project of Education Department of Liaoning Province (LQ2020013, LJKMZ20221484); a grant from Bohai University Teaching Reform Program (No. YJG20210023); a grant from Ministry of Education industry-University Cooperative Education Program (202102599009, 202101332004, 202101337001, 220504643183656); Application Basic Research Plan of Liaoning Province (2022JH2/101300282);Liaoning Natural Science Foundation under Grant (No. 2023-MS-294).

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Jian Wang.

Additional information

Publisher's Note

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

Rights and permissions

Springer Nature or its licensor (e.g. a society or other partner) holds exclusive rights to this article under a publishing agreement with the author(s) or other rightsholder(s); author self-archiving of the accepted manuscript version of this article is solely governed by the terms of such publishing agreement and applicable law.

Reprints and permissions

About this article

Check for updates. Verify currency and authenticity via CrossMark

Cite this article

Sun, Z., Wang, J. & Li, Y. RAMFAE: a novel unsupervised visual anomaly detection method based on autoencoder. Int. J. Mach. Learn. & Cyber. 15, 355–369 (2024). https://doi.org/10.1007/s13042-023-01913-7

Download citation

  • Received:

  • Accepted:

  • Published:

  • Issue Date:

  • DOI: https://doi.org/10.1007/s13042-023-01913-7

Keywords

Navigation