Attention Autoencoder for Generative Latent Representational Learning in Anomaly Detection
Abstract
:1. Introduction
- This paper proposes combining a dual network of encoder and decoder into an autoencoder to model the latent-space representation of data and its reconstruction for abnormality detection.
- The proposed model applies Luong’s concatenation attention [9] to the autoencoder’s low-dimensional bottleneck, prompting extensive focus on specific complex data points and saliency activations into a fixed-size context vector.
- The VAE model is applied to normalize the mean and standard deviation of the encoded Gaussian distribution for the decoder’s generative reconstruction.
2. Related Work
2.1. Anomaly Detection
2.2. Machine Learning Models
2.3. Autoencoders
3. Attention Autoencoder Latent Representational Model
3.1. Concat Attention Autoencoder (CAT-AE)
3.1.1. Encoder
3.1.2. Attention Mechanism
3.1.3. Decoder
3.1.4. Loss Function
3.2. Variational Autoencoder (VAE)
Loss Function
3.3. Reconstructional Anomaly Detection
3.4. Long Short-Term Memory Model
4. Experimental Analysis
4.1. Dataset
4.2. Metrics
- Accuracy: measures how correct a model prediction is to the true label, and it is measured as the ratio of all the correctly predicted observations to the total observations, as displayed in Equation (17).
- Precision: computes the ratio of correctly predicted positive observations to the sum of all the predicted positive observations. It measures the accuracy of the positively predicted observations shown in Equation (18).
- Recall: shown in Equation (19), it computes the ratio of correctly predicted positive observations to the sum of all observations classified in their true class.
- F1 Score: considers both the recall and precision of a model by accounting for false positives and false negatives. F1 Score is best suited for uneven class distribution and is shown in Equation (20).
Model | Accuracy | Recall | Precision | F1-Score |
---|---|---|---|---|
Hierarchical [39] | 0.955 | 0.946 | 0.958 | 0.946 |
Spectral [39] | 0.958 | 0.951 | 0.947 | 0.947 |
Val-thresh [40] | 0.968 | - | - | 0.957 |
VRAE+Wasserstein [40] | 0.951 | - | - | 0.946 |
VRAE + k-Means [40] | 0.959 | - | - | 0.952 |
VAE | 0.952 | 0.925 | 0.984 | 0.954 |
AE-Without-Attention | 0.97 | 0.955 | 0.988 | 0.971 |
CAT-AE | 0.972 | 0.956 | 0.992 | 0.974 |
LSTM | 0.990 | 0.989 | 0.993 | 0.991 |
4.3. Training Details
4.4. Experimental Results
4.4.1. CAT-AE
4.4.2. AE without Attention
4.4.3. LSTM
5. Conclusions
Author Contributions
Funding
Institutional Review Board Statement
Informed Consent Statement
Data Availability Statement
Conflicts of Interest
References
- Lei, Y.; Yang, B.; Xinwei, J.; Jia, F.; Li, N.; Nandi, A. Applications of machine learning to machine fault diagnosis: A review and roadmap. Mech. Syst. Signal Process. 2020, 138, 106587. [Google Scholar] [CrossRef]
- Karim, F.; Majumdar, S.; Darabi, H.; Chen, S. LSTM Fully Convolutional Networks for Time Series Classification. IEEE Access 2018, 6, 1662–1669. [Google Scholar] [CrossRef]
- Rasheed, W.; Tang, T. Anomaly Detection of Moderate Traumatic Brain Injury Using Auto-Regularized Multi-Instance One-Class SVM. IEEE Trans. Neural Syst. Rehabil. Eng. 2020, 28, 83–93. [Google Scholar] [CrossRef] [PubMed]
- Brotherton, T.; Johnson, T. Anomaly detection for advanced military aircraft using neural networks. In Proceedings of the 2001 IEEE Aerospace Conference Proceedings, Big Sky, MT, USA, 10–17 March 2001; pp. 3113–3123. [Google Scholar]
- Ahmad, M.; Mazzara, M.; Distefano, S. Regularized CNN Feature Hierarchy for Hyperspectral Image Classification. Remote Sens. 2021, 13, 2275. [Google Scholar] [CrossRef]
- Ahmad, M.; Shabbir, S.; Roy, S.K.; Hong, D.; Wu, X.; Yao, J.; Khan, A.M.; Mazzara, M.; Distefano, S.; Chanussot, J. Hyperspectral Image Classification—Traditional to Deep Models: A Survey for Future Prospects. arXiv 2021, arXiv:2101.06116. [Google Scholar]
- Oluwasanmi, A.; Aftab, M.U.; Alabdulkreem, E.A.; Kumeda, B.; Baagyere, E.Y.; Qin, Z. CaptionNet: Automatic End-to-End Siamese Difference Captioning Model With Attention. IEEE Access 2019, 7, 106773–106783. [Google Scholar] [CrossRef]
- Oluwasanmi, A.; Aftab, M.U.; Shokanbi, A.; Jackson, J.; Kumeda, B.; Qin, Z. Attentively Conditioned Generative Adversarial Network for Semantic Segmentation. IEEE Access 2020, 8, 31733–31741. [Google Scholar] [CrossRef]
- Luong, T.; Pham, H.; Manning, C.D. Effective Approaches to Attention-based Neural Machine Translation. arXiv 2015, arXiv:1508.04025. [Google Scholar]
- Karim, F.; Majumdar, S.; Darabi, H.; Harford, S. Multivariate LSTM-FCNs for Time Series Classification. Neural Netw. 2019, 116, 237–245. [Google Scholar] [CrossRef] [Green Version]
- Raghavendra, C.; Sanjay, C. Deep Learning for Anomaly Detection: A Survey. arXiv 2019, arXiv:1901.03407. [Google Scholar]
- Chen, Y.; Zhang, H.; Wang, Y.; Yang, Y.; Zhou, X.; Jonathan, Q.M. MAMA Net: Multi-Scale Attention Memory Autoencoder Network for Anomaly Detection. IEEE Trans. Med. Imaging 2021, 40, 1032–1041. [Google Scholar] [CrossRef]
- Alghushairy, O.; Alsini, R.; Soule, T.; Ma, X. A Review of Local Outlier Factor Algorithms for Outlier Detection in Big Data Streams. Big Data Cogn. Comput. 2021, 5, 1. [Google Scholar] [CrossRef]
- Oluwasanmi, A.; Frimpong, E.; Aftab, M.U.; Baagyere, E.Y.; Qin, Z.; Ullah, K. Fully Convolutional CaptionNet: Siamese Difference Captioning Attention Model. IEEE Access 2019, 7, 175929–175939. [Google Scholar] [CrossRef]
- Arnaud, A.; Forbes, F.; Coquery, N.; Collomb, N.; Lemasson, B.; Barbier, E.L. Fully Automatic Lesion Localization and Characterization: Application to Brain Tumors Using Multiparametric Quantitative MRI Data. IEEE Trans. Med. Imaging 2018, 37, 1678–1689. [Google Scholar] [CrossRef] [Green Version]
- Maimon, O.; Rokach, L. Data Mining And Knowledge Discovery Handbook; Springer: Berlin/Heidelberg, Germany, 2005. [Google Scholar]
- Rajpurkar, P.; Hannun, A.Y.; Haghpanahi, M.; Bourn, C.; Ng, A. Cardiologist-Level Arrhythmia Detection with Convolutional Neural Networks. arXiv 2017, arXiv:1707.01836. [Google Scholar]
- Bai, M.; Liu, J.; Ma, Y.; Zhao, X.; Long, Z.; Yu, D. Long Short-Term Memory Network-Based Normal Pattern Group for Fault Detection of Three-Shaft Marine Gas Turbine. Energies 2020, 14, 13. [Google Scholar] [CrossRef]
- Hochreiter, S.; Schmidhuber, J. Long Short-Term Memory. Neural Comput. 1997, 9, 1735–1780. [Google Scholar] [CrossRef]
- Lu, Y.; Wang, J.; Liu, M.; Zhang, K.; Gui, G.; Ohtsuki, T.; Adachi, F. Semi-supervised Machine Learning Aided Anomaly Detection Method in Cellular Networks. IEEE Trans. Veh. Technol. 2020, 69, 8459–8467. [Google Scholar] [CrossRef]
- Khorram, A.; Khalooei, M.; Rezghi, M. End-to-end CNN+LSTM deep learning approach for bearing fault diagnosis. Appl. Intell. 2020, 51, 736–751. [Google Scholar] [CrossRef]
- Liang, K.; Qin, N.; Huang, D.; Fu, Y. Convolutional Recurrent Neural Network for Fault Diagnosis of High-Speed Train Bogie. Complex 2018, 2018, 4501952:1–4501952:13. [Google Scholar] [CrossRef] [Green Version]
- Goodfellow, I.; Pouget-Abadie, J.; Mirza, M.; Xu, B.; Warde-Farley, D.; Ozair, S.; Courville, A.; Bengio, Y. Generative Adversarial Nets. Adv. Neural Inf. Process. Syst. 2014, 27. Available online: https://proceedings.neurips.cc/paper/2014/file/5ca3e9b122f61f8f06494c97b1afccf3-Paper.pdf (accessed on 9 December 2021).
- Vahdat, A.; Kautz, J. NVAE: A Deep Hierarchical Variational Autoencoder. arXiv 2020, arXiv:2007.03898. [Google Scholar]
- Malhotra, P.; Vishnu, T.; Vig, L.; Agarwal, P.; Shroff, G. M TimeNet: Pre-trained deep recurrent neural network for time series classification. arXiv 2017, arXiv:1706.08838. [Google Scholar]
- Jia, F.; Lei, Y.; Lin, J.; Zhou, X.; Lu, N. Deep neural networks: A promising tool for fault characteristic mining and intelligent diagnosis of rotating machinery with massive data. Mech. Syst. Signal Process. 2016, 72, 303–315. [Google Scholar] [CrossRef]
- Lu, C.; Wang, Z.; Qin, W.; Ma, J. Fault diagnosis of rotary machinery components using a stacked denoising autoencoder-based health state identification. Signal Process. 2017, 130, 377–388. [Google Scholar] [CrossRef]
- Ma, M.; Sun, C.; Chen, X. Deep Coupling Autoencoder for Fault Diagnosis With Multimodal Sensory Data. IEEE Trans. Ind. Inform. 2018, 14, 1137–1145. [Google Scholar] [CrossRef]
- Haidong, S.; Hongkai, J.; Ke, Z.; Dongdong, W.; Xingqiu, L. A novel tracking deep wavelet auto-encoder method for intelligent fault diagnosis of electric locomotive bearings. Mech. Syst. Signal Process. 2018, 110, 193–209. [Google Scholar] [CrossRef]
- Yang, Z.; Wang, X.; Zhong, J. Representational Learning for Fault Diagnosis of Wind Turbine Equipment: A Multi-Layered Extreme Learning Machines Approach. Energies 2016, 9, 397. [Google Scholar] [CrossRef] [Green Version]
- Tien, C.; Huang, T.; Chen, P.; Wang, J. Using Autoencoders for Anomaly Detection and Transfer Learning in IoT. Computers 2021, 10, 88. [Google Scholar] [CrossRef]
- Agarap, A.F. Deep Learning using Rectified Linear Units (ReLU). arXiv 2018, arXiv:1803.08375. [Google Scholar]
- Wang, W.; Lu, Y. Analysis of the Mean Absolute Error (MAE) and the Root Mean Square Error (RMSE) in Assessing Rounding Model. In Proceedings of the IOP Conference Series: Materials Science and Engineering, Nanjing, China, 13–14 August 2018. [Google Scholar]
- Fan, Y.; Wen, G.; Li, D.; Qiu, S.; Levine, M.D. Video Anomaly Detection and Localization via Gaussian Mixture Fully Convolutional Variational Autoencoder. Comput. Vis. Image Underst. 2020, 195, 102920. [Google Scholar] [CrossRef] [Green Version]
- Qiao, J.; Tian, F. Abnormal Condition Detection Integrated with Kullback Leibler Divergence and Relative Importance Function for Cement Raw Meal Calcination Process. In Proceedings of the 2020 2nd International Conference on Industrial Artificial Intelligence (IAI), Shenyang, China, 24–26 July 2020; pp. 1–5. [Google Scholar]
- Tai, K.S.; Socher, R.; Manning, C.D. Improved Semantic Representations From Tree-Structured Long Short-Term Memory Networks. arXiv 2015, arXiv:1503.00075. [Google Scholar]
- Goldberger, A.L.; Amaral, L.A.; Glass, L.; Hausdorff, J.M.; Ivanov, P.C.; Mark, R.G.; Mietus, J.E.; Moody, G.B.; Peng, C.K.; Stanley, H.E. PhysioBank, PhysioToolkit, and PhysioNet: Components of a new research resource for complex physiologic signals. Circulation 2000, 101, E215–E220. [Google Scholar] [CrossRef] [Green Version]
- Chen, Y.; Hao, Y.; Rakthanmanon, T.; Zakaria, J.; Hu, B.; Keogh, E.J. A general framework for never-ending learning from time series streams. Data Min. Knowl. Discov. 2014, 29, 1622–1664. [Google Scholar] [CrossRef] [Green Version]
- Pereira, J.; Silveira, M. Learning Representations from Healthcare Time Series Data for Unsupervised Anomaly Detection. In Proceedings of the 2019 IEEE International Conference on Big Data and Smart Computing (BigComp), Kyoto, Japan, 27 February–2 March 2019; pp. 1–7. [Google Scholar]
- Matias, P.A.; Folgado, D.; Gamboa, H.; Carreiro, A. Robust Anomaly Detection in Time Series through Variational AutoEncoders and a Local Similarity Score. Biosignals 2021, 91–102. [Google Scholar]
Model | Accuracy | Recall | Precision | F1-Score |
---|---|---|---|---|
VAE | 0.948 | 0.932 | 0.978 | 0.954 |
AE-Without-Attention | 0.956 | 0.950 | 0.970 | 0.960 |
CAT-AE | 0.958 | 0.946 | 0.977 | 0.946 |
LSTM | 0.984 | 0.998 | 0.973 | 0.986 |
Publisher’s Note: MDPI stays neutral with regard to jurisdictional claims in published maps and institutional affiliations. |
© 2021 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (https://creativecommons.org/licenses/by/4.0/).
Share and Cite
Oluwasanmi, A.; Aftab, M.U.; Baagyere, E.; Qin, Z.; Ahmad, M.; Mazzara, M. Attention Autoencoder for Generative Latent Representational Learning in Anomaly Detection. Sensors 2022, 22, 123. https://doi.org/10.3390/s22010123
Oluwasanmi A, Aftab MU, Baagyere E, Qin Z, Ahmad M, Mazzara M. Attention Autoencoder for Generative Latent Representational Learning in Anomaly Detection. Sensors. 2022; 22(1):123. https://doi.org/10.3390/s22010123
Chicago/Turabian StyleOluwasanmi, Ariyo, Muhammad Umar Aftab, Edward Baagyere, Zhiguang Qin, Muhammad Ahmad, and Manuel Mazzara. 2022. "Attention Autoencoder for Generative Latent Representational Learning in Anomaly Detection" Sensors 22, no. 1: 123. https://doi.org/10.3390/s22010123
APA StyleOluwasanmi, A., Aftab, M. U., Baagyere, E., Qin, Z., Ahmad, M., & Mazzara, M. (2022). Attention Autoencoder for Generative Latent Representational Learning in Anomaly Detection. Sensors, 22(1), 123. https://doi.org/10.3390/s22010123