Abstract
Anomaly detection methods are introduced to remove abnormalities from specific datasets. In the paper, mean shifted contrastive loss for anomaly detection, a new objective function named mean shifted contrastive loss (MSCL), was created to retain the pre-trained features over transfer learning which were lost in previous anomaly detection methods. MSCL stops learning after a certain epoch as the points get closer to the normalized center. The proposed work investigated that due to some noise in the extracted features from images, the points revolve around the normalized center, and the accuracy freezes after some epochs. To resolve this issue, a new loss function is proposed which has better performance. The proposed methodology obtains a highly effective AUROC score of 98.6% and 97.6% on the CIFAR-100 and CIFAR-10 datasets.
Similar content being viewed by others
References
Chen, T.; Kornblith, S.; Norouzi, M.; Hinton, G.: A Simple Framework for Contrastive Learning of Visual Representations. arXiv:2002.05790v3 (2020).
Tack, J.; Mo, S.; Jeong, J.; Shin, J.: CSI: Novelty Detection Via Contrastive Learning on Distributionally Shifted Instances. arXiv:2007.08176v2 (2020).
Scholkopf, B.; Platt, J.C.; Shawe-Taylor, J.; Smola, A.J.; Williamson, R.C.: Estimating the support of a high dimensional distribution. Neural Comput. 13(7), 1443–1471 (2001)
Parzen, E.: On estimation of a probability density function and mode. Ann. Math. Stat. 33(3), 1065–1076 (1962)
Ruff, L.; Vandermeulen, R.A.; Gornitz, N.; Deecke, L.; Siddiqui, S.A.; Binder, A.; Mullera, E.; Kloft, M.: Deep one-class classification. In: \(35^{th}\) International Conference on Machine Learning, Stockholm, Sweden, PMLR 80. (2018)
Reiss, T.; Cohen, N.; Bergman, L.; Hoshen, Y.: PANDA: Adapting Pretrained Features for Anomaly Detection and Segmentation. arXiv:2010.05903v3 (2021).
Reiss, T.; Hoshen, Y.: Mean-Shifted Contrastive Loss for Anomaly Detection. arXiv:2106.03844v1 (2021).
Aronszajn, N.: Theory of reproducing kernels. Trans. Am. Math. Soc. 68(3), 337–404 (1950)
Chen, T.; Kornblith, S.; Norouzi, M.; Hinton, G.: A simple framework for contrastive learning of visual representations. In: International Conference on Machine Learning (2020)
Liang, S.; Li, Y.; Srikant, R.: Enhancing the reliability of out-of-distribution image detection in neural networks. In: The International Conference on Learning Representations (2018).
Perera, P.; Patel, V.M.: Learning Deep Features for One-Class Classification. arXiv:1801.05365 (2019)
He, K.; Zhang, X.; Ren, S.; Sun, J.: Deep Residual Learning for Image Recognition. arXiv:1512.03385 (2015).
Hendrycks, D.; Mazeika, M.; Kadavath, S.; Song, D.: Using self-supervised learning can improve model robustness and uncertainty. In: NeurIPS (2019)
Sohn, K.; Li, C.-L.; Yoon, J.; Jin, M.; Pfister, T.: Learning and Evaluating Representations for Deep One-Class Classification. arXiv:2011.02578 (2020)
Wenpeng, H.; Wang, M.; Qin, Q.; Ma, J.; Liu, B.: Hrn: A holistic approach to one class learning. Adv. Neural Inf. Process. Syst. 33, 19111–19124 (2020)
Hou, J.; Zhang, Y.; Zhong, Q.; Xie, D.; Pu, S.; Zhou, H.: Divide-and-assemble: learning block-wise memory for unsupervised anomaly detection. In: Proceedings of the IEEE/CVF International Conference on Computer Vision (ICCV), pp. 8791–8800 (2021)
Salehi, M.; Sadjadi, N.; Baselizadeh, S.; Rohaban, M.H.; Rabiee, H.R.: Multiresolution knowledge distillation for anomaly detection. In: Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), pp. 14902–14912 (2021)
Deng, H.; Li, X.: Anomaly detection via reverse distillation from one-class embedding. In: IEEE/CVF Computer Vision and Pattern Recognition Conference (CVPR) (2022)
Bergman, L.; Hoshen, Y.: Classification-based anomaly detection for general data. In: ICLR (2020).
Bergmann, P.; Fauser, M.; Sattlegger, D.; Steger, C.: Mvtec ad-a comprehensive real-world dataset for unsupervised anomaly detection. In: Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 9592–9600 (2019)
Chen, T.; Kornblith, S.; Norouzi, M.; Hinton, G.: A Simple Framework for Contrastive Learning of Visual Representations. arXiv:2002.05709 (2020)
Chen, X.; He, K.: Exploring Simple Siamese Representation Learning. arXiv:2011.10566 (2020)
Chen, X.; Fan, H.; Girshick, R.; He, K.: Improved Baselines with Momentum Contrastive Learning. arXiv:2003.04297 (2020)
Gidaris, S.; Singh, P.; Komodakis, N.: Unsupervised Representation Learning by Predicting Image Rotations. arXiv:1803.07728 (2018)
Bergmann, P.; Fauser, M.; Sattlegger, D.; Steger, C.: Uninformed students: student teacher anomaly detection with discriminative latent embeddings (2020)
Goodfellow, I.; Pouget-Abadie, J.; Mirza, M.; Xu, B.; Warde-Farley, D.; Ozair, S.; Courville, A.; Bengio, Y.: Generative Adversarial Networks (2014)
Selvaraju, R.R.; Cogswell, M; Das, A.; Vedantam, R.; Parikh, D.; Batra, D.: Grad-cam: Visual Explanations from Deep Networks Via Gradient-Based Localization (2017)
Venkataramanan, S.; Peng, K.-C., Singh, R.V.; Mahalanobis, A.: Attention Guided Anomaly Localization in Images (2020)
Elson, J.; Douceur, J.R.; Howell, J.; Saul, J.: Asirra: a captcha that exploits interest aligned manual image categorization. In: ACM Conference on Computer and Communications Security, vol. 7, pp. 366–374 (2007).
Eskin, E.; Andrew, A.; Prerau, M.; Portnoy, L.; Stolfo, S.: A geometric framework for unsupervised anomaly detection. In: Applications of Data Mining in Computer Security, pp. 77–101. Springer (2002)
Schmidhuber, J.: Deep learning in neural networks: an overview. Neural Netw. 61, 85–117 (2015)
Author information
Authors and Affiliations
Corresponding author
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.
About this article
Cite this article
Maurya, A., Yadav, M., Yadav, G. et al. A Regularization Factor-Based Approach to Anomaly Detection Using Contrastive Learning. Arab J Sci Eng 49, 3371–3381 (2024). https://doi.org/10.1007/s13369-023-07959-7
Received:
Accepted:
Published:
Issue Date:
DOI: https://doi.org/10.1007/s13369-023-07959-7