Anomaly Detection of GAN Industrial Image Based on Attention Feature Fusion
Abstract
:1. Introduction
- It proposes a novel module of an encoder–decoder GAN based on attention feature fusion, which can detect anomaly images accurately while never depending on an anomaly sample.
- We made an attention feature fusion for the corresponding convolutional layers of both the encoder and decoder, so as to retain the channel features of different dimensions. In addition, we added extra image augmentation to simulate an anomaly for the purpose of dataset enhancement.
- Compared with the experimental results of other similar modules, it is verified that, in the aspect of anomaly classification, our method has achieved superior performance.
2. Related Work
3. Propoosed Method
3.1. Network Architecture
3.1.1. Generative Network
3.1.2. Discrimination Network
3.1.3. Attention Feature Fusion
3.2. Data Augmentation
3.3. Training Objectives
3.4. Anomaly Detection
4. Experiment
4.1. Datasets
4.2. Training Details
4.3. Evaluation
4.4. Experimental Results
4.4.1. Anomaly Classification
4.4.2. Anomaly Localization
4.5. Ablation Studies
4.6. Comparative Experiment
5. Conclusions
Author Contributions
Funding
Institutional Review Board Statement
Informed Consent Statement
Data Availability Statement
Acknowledgments
Conflicts of Interest
References
- Pang, G.; Shen, C.; Cao, L.; Hengel, A.V.D. Deep Learning for Anomaly Detection: A Review. ACM Comput. Surv. 2021, 54, 1–38. [Google Scholar] [CrossRef]
- Ahmed, M.; Mahmood, A.N.; Islam, R. A survey of anomaly detection techniques in financial domain. Future Gener. Comput. Syst. 2016, 55, 278–288. [Google Scholar] [CrossRef]
- Atefeh, F.; Khreich, W. A Survey of Techniques for Event Detection in Twitter. Comput. Intell. 2015, 31, 132–164. [Google Scholar] [CrossRef]
- Abdallah, A.; Maarof, M.A.; Zainal, A. Fraud detection system: A survey. J. Netw. Comput. Appl. 2016, 68, 90–113. [Google Scholar] [CrossRef]
- Alvarenga, T.A.; Carvalho, A.L.; Honorio, L.M.; Cerqueira, A.S.; Filho, L.M.A.; Nobrega, R.A. Detection and classification system for rail surface defects based on Eddy current. Sensors 2021, 21, 7937. [Google Scholar] [CrossRef] [PubMed]
- Sultani, W.; Chen, C.; Shah, M. Real-World Anomaly Detection in Surveillance Videos. In Proceedings of the 2018 IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), Salt Lake City, UT, USA, 18–22 June 2018; IEEE: Piscataway, NJ, USA, 2018; pp. 6479–6488. [Google Scholar]
- Schlegl, T.; Seeböck, P.; Waldstein, S.M.; Schmidt-Erfurth, U.; Langs, G. Unsupervised anomaly detection with generative adversarial networks to guide marker discovery. In Proceedings of the International Conference on Information Processing in Medical Imaging, Boone, NC, USA, 25–30 June 2017; Springer: Cham, Switzerland, 2017; pp. 146–157. [Google Scholar]
- Chen, Y.; Ding, Y.; Zhao, F.; Zhang, E.; Wu, Z.; Shao, L. Surface defect detection methods for industrial products: A review. Appl. Sci. 2021, 11, 7657. [Google Scholar] [CrossRef]
- Goodfellow, I.; Pouget-Abadie, J.; Mirza, M.; Bing, X.; David, W.F.; Sherjil, O.; Courville Aaron, C. Generative adversarial nets. In Proceedings of the Advances in Neural Information Processing Systems, Montreal, QC, Canada, 8–13 December 2014; pp. 2672–2680. [Google Scholar]
- Bergmann, P.; Fauser, M.; Sattlegger, D.; Steger, C. MVTec AD—A comprehensive real-world dataset for unsupervised anomaly detection. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, Long Beach, CA, USA, 15–20 June 2019; pp. 9592–9600. [Google Scholar]
- Schlegl, T.; Seeböck, P.; Waldstein, S.M.; Langs, G.; Schmidt-Erfurth, U. f-AnoGAN: Fast unsupervised anomaly detection with generative adversarial networks. Med. Image Anal. 2019, 54, 30–44. [Google Scholar] [CrossRef] [PubMed]
- Arjovsky, M.; Chintala, S.; Bottou, L. Wasserstein generative adversarial networks. In Proceedings of the International Conference on Machine Learning—PMLR, Sydney, Australia, 6–11 August 2017; pp. 214–223. [Google Scholar]
- Akcay, S.; Atapour-Abarghouei, A.; Breckon, T.P. Ganomaly: Semi-supervised anomaly detection via adversarial training. In Proceedings of the Asian Conference on Computer Vision, Perth, Australia, 2–6 December 2018; Springer: Cham, Switzerland, 2018; pp. 622–637. [Google Scholar]
- Ronneberger, O.; Fischer, P.; Brox, T. U-net: Convolutional networks for biomedical image segmentation. In Proceedings of the International Conference on Medical Image Computing and Computer-Assisted Intervention, Munich, Germany, 5–9 October 2015; Springer: Cham, Switzerland, 2015; pp. 234–241. [Google Scholar]
- Akçay, S.; Atapour-Abarghouei, A.; Breckon, T.P. Skip-ganomaly: Skip connected and adversarially trained encoder-decoder anomaly detection. In Proceedings of the 2019 International Joint Conference on Neural Networks (IJCNN), Budapest, Hungary, 14–19 July 2019; IEEE: Piscataway, NJ, USA, 2019; pp. 1–8. [Google Scholar]
- Zaheer, M.Z.; Lee, J.; Astrid, M.; Lee, S.I. Old is gold: Redefining the adversarially learned one-class classifier training paradigm. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, Seattle, WA, USA, 13–19 June 2020; pp. 14183–14193. [Google Scholar]
- Bergmann, P.; Fauser, M.; Sattlegger, D.; Steger, C. Uninformed students: Student-teacher anomaly detection with discriminative latent embeddings. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, Seattle, WA, USA, 13–19 June 2020; pp. 4183–4192. [Google Scholar]
- Li, C.L.; Sohn, K.; Yoon, J.; Pfister, T. Cutpaste: Self-supervised learning for anomaly detection and localization. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, Nashville, TN, USA, 20–25 June 2021; pp. 9664–9674. [Google Scholar]
- Fei, Y.; Huang, C.; Cao, J.; Li, M.; Zhang, Y.; Lu, C. Attribute Restoration Framework for Anomaly Detection. IEEE Trans. Multimed. 2020, 24, 116–127. [Google Scholar]
- Li, X.; Zheng, Y.; Chen, B.; Zheng, E. Dual Attention-Based Industrial Surface Defect Detection with Consistency Loss. Sensors 2022, 22, 5141. [Google Scholar] [CrossRef] [PubMed]
- Tang, T.-W.; Kuo, W.-H.; Lan, J.-H.; Ding, C.-F.; Hsu, H.; Young, H.-T. Anomaly detection neural network with dual auto-encoders GAN and its industrial inspection applications. Sensors 2020, 20, 3336. [Google Scholar] [CrossRef] [PubMed]
- Wang, J.; Yi, G.; Zhang, S.; Wang, Y. An unsupervised generative adversarial network-based method for defect inspection of texture surfaces. Appl. Sci. 2020, 11, 283. [Google Scholar] [CrossRef]
- Chen, L.; Li, Y.; Deng, X.; Liu, Z.; Lv, M.; Zhang, H. Dual Auto-Encoder GAN-Based Anomaly Detection for Industrial Control System. Appl. Sci. 2022, 12, 4986. [Google Scholar] [CrossRef]
- Donahue, J.; Krähenbühl, P.; Darrell, T. Adversarial feature learning. In Proceedings of the International Conference on Learning Representations, Toulon, France, 24–26 April 2017; pp. 24–26. [Google Scholar]
- Carrara, F.; Amato, G.; Brombin, L.; Falchi, F.; Gennaro, C. Combining gans and autoencoders for efficient anomaly detection. In Proceedings of the 2020 25th International Conference on Pattern Recognition (ICPR), Milan, Italy, 10–15 January 2021; IEEE: Piscataway, NJ, USA, 2021; pp. 3939–3946. [Google Scholar]
- Ioffe, S.; Szegedy, C. Batch normalization: Accelerating deep network training by reducing internal covariate shift. In Proceedings of the International Conference on Machine Learning—PMLR, Lille, France, 7–9 July 2015; pp. 448–456. [Google Scholar]
- Radford, A.; Metz, L.; Chintala, S. Unsupervised representation learning with deep convolutional generative adversarial networks. arXiv 2015, arXiv:1511.06434. [Google Scholar]
- Dai, Y.; Gieseke, F.; Oehmcke, S.; Wu, Y.; Barnard, K. Attentional feature fusion. In Proceedings of the IEEE/CVF Winter Conference on Applications of Computer Vision, Virtual, 5–9 January 2021; pp. 3560–3569. [Google Scholar]
- Zavrtanik, V.; Kristan, M.; Skočaj, D. Reconstruction by inpainting for visual anomaly detection. Pattern Recognit. 2021, 112, 107706. [Google Scholar] [CrossRef]
- Zhong, Z.; Zheng, L.; Kang, G.; Li, S.; Yang, Y. Random erasing data augmentation. Proc. AAAI Conf. Artif. Intell. 2020, 34, 13001–13008. [Google Scholar] [CrossRef]
- Kingma, D.P.; Ba, J. Adam: A method for stochastic optimization. arXiv 2014, arXiv:1412.6980. [Google Scholar]
- Ling, C.X.; Huang, J.; Zhang, H. AUC: A statistically consistent and more discriminating measure than accuracy. In Proceedings of the IJCAI, Acapulco, Mexico, 9–15 August 2003; Volume 3, pp. 519–524. [Google Scholar]
Category | Train | Test (Normal) | Test (Anomaly) | Defect Types | Image Side | |
---|---|---|---|---|---|---|
Textures | Carpet | 280 | 28 | 89 | 5 | 1024 |
Grid | 264 | 21 | 57 | 5 | 1024 | |
Leather | 245 | 32 | 92 | 5 | 1024 | |
Tile | 230 | 33 | 84 | 5 | 840 | |
Wood | 247 | 19 | 60 | 5 | 1024 | |
Total | 1266 | 133 | 382 | 25 | - | |
Objects | Bottle | 209 | 20 | 63 | 3 | 900 |
Cable | 224 | 58 | 92 | 8 | 1024 | |
Capsule | 219 | 23 | 109 | 5 | 1000 | |
Hazelnut | 391 | 40 | 70 | 4 | 1024 | |
Metal nut | 220 | 22 | 93 | 4 | 700 | |
Pill | 267 | 26 | 141 | 7 | 800 | |
Screw | 320 | 41 | 119 | 5 | 1024 | |
Toothbrush | 60 | 12 | 30 | 1 | 1024 | |
Transistor | 213 | 60 | 40 | 4 | 1024 | |
Zipper | 240 | 32 | 119 | 7 | 1024 | |
Total | 236 | 334 | 876 | 48 | - |
Category | AnoGAN | GANomaly | Skip-GANomaly | DAGAN | CBiGAN | Dual- Attention GAN | Ours | |
---|---|---|---|---|---|---|---|---|
Texture | Carpet | 37.7 | 82.1 | 79.5 | 90.3 | 55.0 | 91.0 | 93.7 |
Grid | 87.1 | 74.3 | 65.7 | 86.7 | 99.0 | 94.0 | 99.4 | |
Leather | 45.1 | 80.8 | 90.8 | 94.4 | 83.0 | 95.0 | 96.1 | |
Tile | 40.1 | 72.0 | 85.0 | 96.1 | 91.0 | 80.0 | 97.9 | |
Wood | 56.7 | 92.0 | 91.9 | 97.9 | 95.0 | 95.0 | 100 | |
Average | 53.3 | 80.2 | 80.2 | 93.1 | 84.6 | 91.0 | 97.4 | |
Object | Bottle | 80.0 | 79.4 | 93.7 | 98.3 | 87.0 | 94.0 | 100 |
Cable | 47.7 | 71.1 | 67.4 | 66.5 | 81.0 | 88.0 | 96.3 | |
Capsule | 44.2 | 72.1 | 71.8 | 68.7 | 56.0 | 85.0 | 83.0 | |
Hazelnut | 25.9 | 87.4 | 90.6 | 100 | 77.0 | 95.0 | 93.7 | |
Metal nut | 28.4 | 69.4 | 79.0 | 81.5 | 63.0 | 69.0 | 85.1 | |
Pill | 71.1 | 67.1 | 75.8 | 76.8 | 81.0 | 89.0 | 98.7 | |
Screw | 10.0 | 100 | 100 | 100 | 58.0 | 100 | 90.3 | |
Toothbrush | 43.9 | 70.0 | 68.9 | 95.0 | 94.0 | 100 | 98.3 | |
Transistor | 69.2 | 80.8 | 81.4 | 79.4 | 77.0 | 88.0 | 91.3 | |
Zipper | 71.5 | 74.4 | 66.3 | 78.1 | 53.0 | 91.0 | 89.9 | |
Average | 49.2 | 77.2 | 79.5 | 84.4 | 72.7 | 89.9 | 92.7 | |
Average | 50.6 | 78.2 | 80.5 | 87.3 | 76.7 | 90.2 | 94.3 |
Category | State1 | State2 | State3 | State4 | |
---|---|---|---|---|---|
Texture | Carpet | 52.1 | 56.0 | 54.3 | 93.7 |
Grid | 83.2 | 78.9 | 93.3 | 99.4 | |
Leather | 64.3 | 70.1 | 64.6 | 96.1 | |
Tile | 73.3 | 73.6 | 96.9 | 97.9 | |
Wood | 96.4 | 96.0 | 99.7 | 100 | |
Average | 73.9 | 74.9 | 81.8 | 97.4 | |
Object | Bottle | 84.7 | 91.9 | 72.4 | 100 |
Cable | 78.8 | 77.8 | 53.3 | 96.3 | |
Capsule | 71.3 | 70.1 | 80.0 | 83.0 | |
Hazelnut | 82.4 | 79.3 | 86.5 | 93.7 | |
Metal nut | 55.6 | 58.0 | 55.2 | 85.1 | |
Pill | 78.3 | 80.7 | 99.7 | 98.7 | |
Screw | 67.1 | 70.6 | 100 | 90.3 | |
Toothbrush | 94.7 | 86.4 | 93.1 | 98.3 | |
Transistor | 80.5 | 78.7 | 82.0 | 91.3 | |
Zipper | 69.4 | 71.3 | 66.1 | 89.9 | |
Average | 76.3 | 76.5 | 78.8 | 92.7 | |
Average | 75.5 | 76.0 | 79.8 | 94.3 |
Category | Struc1 | Struc2 | Struc3 | Struc4 | |
---|---|---|---|---|---|
Texture | Carpet | 91.1 | 89.0 | 84.8 | 93.7 |
Grid | 86.0 | 81.5 | 94.2 | 99.4 | |
Leather | 81.8 | 82.6 | 85.8 | 96.1 | |
Tile | 90.2 | 83.6 | 99.3 | 97.9 | |
Wood | 93.4 | 98.2 | 98.4 | 100 | |
Average | 88.5 | 87.0 | 92.5 | 97.4 | |
Object | Bottle | 93.7 | 89.8 | 99.8 | 100 |
Cable | 83.3 | 83.7 | 75.5 | 96.3 | |
Capsule | 68.4 | 87.2 | 83.2 | 83.0 | |
Hazelnut | 70.7 | 79.9 | 81.2 | 93.7 | |
Metal nut | 71.6 | 71.9 | 73.1 | 85.1 | |
Pill | 77.2 | 94.7 | 96.3 | 98.7 | |
Screw | 100 | 100 | 99.3 | 90.3 | |
Toothbrush | 93.1 | 87.8 | 99.7 | 98.3 | |
Transistor | 96.8 | 77.2 | 89.1 | 91.3 | |
Zipper | 97.4 | 85.6 | 91.2 | 89.9 | |
Average | 85.2 | 85.8 | 88.8 | 92.7 | |
Average | 86.3 | 86.2 | 90.1 | 94.3 |
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content. |
© 2022 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
Zhang, L.; Dai, Y.; Fan, F.; He, C. Anomaly Detection of GAN Industrial Image Based on Attention Feature Fusion. Sensors 2023, 23, 355. https://doi.org/10.3390/s23010355
Zhang L, Dai Y, Fan F, He C. Anomaly Detection of GAN Industrial Image Based on Attention Feature Fusion. Sensors. 2023; 23(1):355. https://doi.org/10.3390/s23010355
Chicago/Turabian StyleZhang, Lin, Yang Dai, Fuyou Fan, and Chunlin He. 2023. "Anomaly Detection of GAN Industrial Image Based on Attention Feature Fusion" Sensors 23, no. 1: 355. https://doi.org/10.3390/s23010355