SLGA-YOLO: A Lightweight Castings Surface Defect Detection Method Based on Fusion-Enhanced Attention Mechanism and Self-Architecture
Abstract
:1. Introduction
- SlimNeck is used to optimize the model neck module, reducing model complexity whilst increasing accuracy.
- The fusion of SimAM and LSKA strengthens the attention mechanism to enhance the three-bit weight extraction capability of the model, as well as to enhance the multiscale feature extraction capability.
- YOLO-P2 is used to replace the original model to improve the efficiency of model detection of small targets. At the same time, some of the basic convolutional blocks (CBSs) are optimized as self-defined design GCML modules to improve the convergence speed of the model and enhance the feature extraction capability.
- The Alpha-EIoU loss function is constructed to accelerate the regression fitting process of the real frame and prediction frame, thus maintaining sufficient flexibility and strong generalization.
2. Related Works
2.1. Traditional Defect Detection
2.2. Deep Learning-Based Defect Detection
2.3. Summary
3. Design for SLGA-YOLO
3.1. Improved YOLOv8 Neck Module Based on SlimNeck
3.2. Attention Module
3.2.1. LSKA Attentional Mechanism
3.2.2. SimAM Attention Mechanism
3.3. Optimization Model Based on GCM Module
3.4. Build Loss Function Based on Alpha-EIoU
4. Experimental Results and Analysis
4.1. Dataset Processing
4.2. Training Environment Setup
4.3. Assessment of Indicators
4.4. Comparison of Experimental Results
4.4.1. Ablation Experiments
4.4.2. Experimental Results with an Improved Version of YOLOv8 (SLGA-YOLO)
4.4.3. Comparison of Experiments on Public Datasets
4.4.4. Comparison of Results of Different Models Experiments
5. Conclusions
Author Contributions
Funding
Institutional Review Board Statement
Informed Consent Statement
Data Availability Statement
Conflicts of Interest
Correction Statement
References
- Shabani, M.O.; Baghani, A.; Mobasherpour, I.; Razavi, M.; Rahimipour, M.R.; Salahi, E. The Influence of the Casting Methods and Variables on the Microstructural Properties of A356–SiC Nanocomposite. Inter Met. 2024, 1–15. [Google Scholar] [CrossRef]
- Hu, C.; Wang, Y. An Efficient Convolutional Neural Network Model Based on Object-Level Attention Mechanism for Casting Defect Detection on Radiography Images. IEEE Trans. Ind. Electron. 2020, 67, 10922–10930. [Google Scholar] [CrossRef]
- Tulbure, A.-A.; Tulbure, A.-A.; Dulf, E.-H. A Review on Modern Defect Detection Models Using DCNNs—Deep Convolutional Neural Networks. J. Adv. Res. 2022, 35, 33–48. [Google Scholar] [CrossRef] [PubMed]
- Zheng, Y.; Han, Y.; Hu, G. Research on the Calibration Method of Industrial Robot Vision System Based on VisionPro. In Proceedings of the 2023 4th International Conference on Computer Vision, Image and Deep Learning (CVIDL), Zhuhai, China, 12–14 May 2023; pp. 693–696. [Google Scholar]
- Liu, W.; Anguelov, D.; Erhan, D.; Szegedy, C.; Reed, S.; Fu, C.-Y.; Berg, A.C. SSD: Single Shot MultiBox Detector. In Proceedings of the Computer Vision—ECCV, Amsterdam, The Netherlands, 11–14 October 2016; Leibe, B., Matas, J., Sebe, N., Welling, M., Eds.; Springer International Publishing: Cham, Switzerland, 2016; pp. 21–37. [Google Scholar]
- You Only Look Once: Unified, Real-Time Object Detection|IEEE Conference Publication|IEEE Xplore. Available online: https://ieeexplore.ieee.org/document/7780460 (accessed on 24 January 2024).
- Redmon, J.; Farhadi, A. YOLO9000: Better, Faster, Stronger. In Proceedings of the 2017 IEEE Conference on Computer Vision and Pattern Recognition (CVPR), Honolulu, HI, USA, 21–26 July 2017; pp. 6517–6525. [Google Scholar]
- He, K.; Gkioxari, G.; Dollar, P.; Girshick, R. Mask R-CNN. In Proceedings of the IEEE International Conference on Computer Vision (ICCV), Venice, Italy, 22–29 October 2017; pp. 2961–2969. [Google Scholar]
- Shi, J.; Zhou, Y.; Zhang, W.X.Q. Target Detection Based on Improved Mask Rcnn in Service Robot. In Proceedings of the 2019 Chinese Control Conference (CCC), Guangzhou, China, 27–30 July 2019; pp. 8519–8524. [Google Scholar]
- Zhang, H.; Huang, W.; Qi, J. Design and Implementation of Object Image Detection Interface System Based on PyQt5 and Improved SSD Algorithm. In Proceedings of the 2022 IEEE 10th Joint International Information Technology and Artificial Intelligence Conference (ITAIC), Chongqing, China, 17–19 June 2022; Volume 10, pp. 2086–2090. [Google Scholar]
- Wang, Q.; Liao, Z.; Xu, M. Wire Insulator Fault and Foreign Body Detection Algorithm Based on YOLO v5 and YOLO V7. In Proceedings of the 2023 IEEE International Conference on Electrical, Automation and Computer Engineering (ICEACE), Changchun, China, 29–31 December 2023; pp. 1412–1417. [Google Scholar]
- Lan, Y.; Lin, S.; Du, H.; Guo, Y.; Deng, X. Real-Time UAV Patrol Technology in Orchard Based on the Swin-T YOLOX Lightweight Model. Remote Sens. 2022, 14, 5806. [Google Scholar] [CrossRef]
- Ge, Z.; Liu, S.; Wang, F.; Li, Z.; Sun, J. YOLOX: Exceeding YOLO Series in 2021. Available online: https://arxiv.org/abs/2107.08430v2 (accessed on 6 March 2024).
- Liu, Z.; Lin, Y.; Cao, Y.; Hu, H.; Wei, Y.; Zhang, Z.; Lin, S.; Guo, B. Swin Transformer: Hierarchical Vision Transformer Using Shifted Windows. In Proceedings of the IEEE/CVF International Conference on Computer Vision, Montreal, QC, Canada, 10–17 October 2021; pp. 10012–10022. [Google Scholar]
- Hurtik, P.; Molek, V.; Hula, J.; Vajgl, M.; Vlasanek, P.; Nejezchleba, T. Poly-YOLO: Higher Speed, More Precise Detection and Instance Segmentation for YOLOv3. Neural Comput. Appl. 2022, 34, 8275–8290. [Google Scholar] [CrossRef]
- Yuan, X.; Wu, L.; Peng, Q. An Improved Otsu Method Using the Weighted Object Variance for Defect Detection. Appl. Surf. Sci. 2015, 349, 472–484. [Google Scholar] [CrossRef]
- Capizzi, G.; Lo Sciuto, G.; Napoli, C.; Tramontana, E.; Woźniak, M. Automatic Classification of Fruit Defects Based on Co-Occurrence Matrix and Neural Networks. In Proceedings of the 2015 Federated Conference on Computer Science and Information Systems (FedCSIS), Lodz, Poland, 13–16 September 2015; pp. 861–867. [Google Scholar]
- Li, W.; Lu, C.; Zhang, J. A Local Annular Contrast Based Real-Time Inspection Algorithm for Steel Bar Surface Defects. Appl. Surf. Sci. 2012, 258, 6080–6086. [Google Scholar] [CrossRef]
- Li, X.; Tso, S.K.; Guan, X.-P.; Huang, Q. Improving Automatic Detection of Defects in Castings by Applying Wavelet Technique. IEEE Trans. Ind. Electron. 2006, 53, 1927–1934. [Google Scholar] [CrossRef]
- Tang, Z.; Tian, E.; Wang, Y.; Wang, L.; Yang, T. Nondestructive Defect Detection in Castings by Using Spatial Attention Bilinear Convolutional Neural Network. IEEE Trans. Ind. Inform. 2021, 17, 82–89. [Google Scholar] [CrossRef]
- Hao, X.; Yu, B.; He, Y. Casting Defect Detection Based on Improved DETR. In Proceedings of the 2023 IEEE 7th Information Technology and Mechatronics Engineering Conference (ITOEC), Chongqing, China, 15–17 September 2023; Volume 7, pp. 1621–1625. [Google Scholar]
- Jiang, X.; Wang, X.F.; Chen, D. Research on Defect Detection of Castings Based on Deep Residual Network. In Proceedings of the 2018 11th International Congress on Image and Signal Processing, BioMedical Engineering and Informatics (CISP-BMEI), Beijing, China, 13–15 October 2018; pp. 1–6. [Google Scholar]
- Du, W.; Shen, H.; Fu, J.; Zhang, G.; He, Q. Approaches for Improvement of the X-Ray Image Defect Detection of Automobile Casting Aluminum Parts Based on Deep Learning. NDT E Int. 2019, 107, 102144. [Google Scholar] [CrossRef]
- Parlak, İ.E.; Emel, E. Deep Learning-Based Detection of Aluminum Casting Defects and Their Types. Eng. Appl. Artif. Intell. 2023, 118, 105636. [Google Scholar] [CrossRef]
- Li, H.; Li, J.; Wei, H.; Liu, Z.; Zhan, Z.; Ren, Q. Slim-Neck by GSConv: A Better Design Paradigm of Detector Architectures for Autonomous Vehicles. Available online: https://arxiv.org/abs/2206.02424v2 (accessed on 11 January 2024).
- Lau, K.W.; Po, L.-M.; Rehman, Y.A.U. Large Separable Kernel Attention: Rethinking the Large Kernel Attention Design in CNN. Expert Syst. Appl. 2024, 236, 121352. [Google Scholar] [CrossRef]
- Guo, M.-H.; Lu, C.-Z.; Liu, Z.-N.; Cheng, M.-M.; Hu, S.-M. Visual Attention Network. Comp. Vis. Media 2023, 9, 733–752. [Google Scholar] [CrossRef]
- He, K.; Zhang, X.; Ren, S.; Sun, J. Spatial Pyramid Pooling in Deep Convolutional Networks for Visual Recognition. IEEE Trans. Pattern Anal. Mach. Intell. 2015, 37, 1904–1916. [Google Scholar] [CrossRef] [PubMed]
- Yang, L.; Zhang, R.-Y.; Li, L.; Xie, X. SimAM: A Simple, Parameter-Free Attention Module for Convolutional Neural Networks. In Proceedings of the 38th International Conference on Machine Learning, PMLR, Virtual, 18–24 July 2021; pp. 11863–11874. [Google Scholar]
- Woo, S.; Park, J.; Lee, J.-Y.; Kweon, I.S. CBAM: Convolutional Block Attention Module 2018. In Proceedings of the European Conference on Computer Vision (ECCV), Munich, Germany, 8–14 September 2018. [Google Scholar]
- Han, K.; Wang, Y.; Tian, Q.; Guo, J.; Xu, C.; Xu, C. GhostNet: More Features from Cheap Operations. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, Seattle, WA, USA, 13–19 June 2020; pp. 1580–1589. [Google Scholar]
- Misra, D. Mish: A Self Regularized Non-Monotonic Activation Function 2020. arXiv 2020, arXiv:1908.08681. [Google Scholar]
- Zhang, Y.-F.; Ren, W.; Zhang, Z.; Jia, Z.; Wang, L.; Tan, T. Focal and Efficient IOU Loss for Accurate Bounding Box Regression. Available online: https://arxiv.org/abs/2101.08158v2 (accessed on 11 January 2024).
- He, J.; Erfani, S.; Ma, X.; Bailey, J.; Chi, Y.; Hua, X.-S. Alpha-IoU: A Family of Power Intersection over Union Losses for Bounding Box Regression 2022. Adv. Neural Inf. Process. Syst. 2021, 34, 20230–20242. [Google Scholar]
- Song, K.; Yan, Y. A Noise Robust Method Based on Completed Local Binary Patterns for Hot-Rolled Steel Strip Surface Defects. Appl. Surf. Sci. 2013, 285, 858–864. [Google Scholar] [CrossRef]
- Ren, S.; He, K.; Girshick, R.; Sun, J. Faster R-CNN: Towards Real-Time Object Detection with Region Proposal Networks. IEEE Trans. Pattern Anal. Mach. Intell. 2017, 39, 1137–1149. [Google Scholar] [CrossRef] [PubMed]
- Feng, C.; Zhong, Y.; Gao, Y.; Scott, M.R.; Huang, W. TOOD: Task-Aligned One-Stage Object Detection. In Proceedings of the IEEE Computer Society, Montreal, BC, Canada, 1 October 2021; pp. 3490–3499. [Google Scholar]
- Zhang, H.; Li, F.; Liu, S.; Zhang, L.; Su, H.; Zhu, J.; Ni, L.M.; Shum, H.-Y. DINO: DETR with Improved DeNoising Anchor Boxes for End-to-End Object Detection 2022. arXiv 2022, arXiv:2203.03605. [Google Scholar]
- Lin, T.-Y.; Goyal, P.; Girshick, R.; He, K.; Dollár, P. Focal Loss for Dense Object Detection. arXiv 2018, arXiv:1708.02002. [Google Scholar] [CrossRef]
Class | Defect Name | Datasets | Number of Labels |
---|---|---|---|
Hole | Sand hole | 458 | 465 |
sag | Shrinkage depression | 575 | 642 |
crack | Casting crack | 181 | 182 |
Imperfect | Normal-casting | 525 | 640 |
Shrinkage | Shrinkage | 151 | 151 |
Piece punch | Piece punch | 996 | 2671 |
Surface punch | Surface punch | 1514 | 2408 |
Round punch | Round punch | 568 | 670 |
Class | Defect Name | Datasets | Number of Labels |
---|---|---|---|
Hole | Sand hole | 514 | 523 |
sag | Shrinkage depression | 1260 | 1333 |
crack | Casting crack | 596 | 598 |
Imperfect | Normal-casting | 527 | 642 |
Shrinkage | Shrinkage | 448 | 448 |
Piece punch | Piece punch | 1169 | 3041 |
Surface punch | Surface punch | 1770 | 2774 |
Round punch | Round punch | 594 | 704 |
Parameters | Setup |
---|---|
Batch size | 200 |
Image size | 640 × 640 |
Initial learning rate | 0.01 |
Final learning rate | 0.01 |
Weight-decay | 0.0005 |
Momentum | 0.937 |
Model | mAP0.5/% | FPS | Params | FLOPs/G |
---|---|---|---|---|
A | 83.2 | 105 | 3,007,208 | 8.1 |
B | 83.7 | 88 | 2,922,096 | 12.2 |
C | 85.3 | 97 | 2,922,096 | 12.2 |
D | 84.7 | 141 | 3,007,056 | 12.1 |
E | 86.2 | 133 | 2,787,760 | 10.9 |
Model | [email protected] | FPS | FLOPs/G | Params | ||||||
---|---|---|---|---|---|---|---|---|---|---|
All | Cr | Pa | In | PS | RS | Sc | ||||
YOLOv5n | 0.66 | 0.50 | 0.90 | 0.81 | 0.50 | 0.33 | 0.90 | 43.5 | 7.1 | 2504114 |
YOLOv8n | 0.64 | 0.44 | 0.90 | 0.82 | 0.49 | 0.39 | 0.82 | 48.4 | 8.1 | 3007209 |
SLGA-YOLO | 0.72 | 0.51 | 0.90 | 0.83 | 0.74 | 0.40 | 0.95 | 76.9 | 10.9 | 2787760 |
Model | YOLOv5n | YOLOv8n | Mask-RCNN | Faster-RCNN | TOOD | DINO | RetinaNet | SLGA-YOLO |
---|---|---|---|---|---|---|---|---|
[email protected] | 0.827 | 0.832 | 0.846 | 0.835 | 0.854 | 0.831 | 0.783 | 0.862 |
Params/M | 2.50 | 3.01 | 44.03 | 41.39 | 32.04 | 47.56 | 4.88 | 2.79 |
FLOPs/G | 7.1 | 8.1 | 261 | 208.0 | 199.0 | 274.0 | 8.0 | 10.9 |
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. |
© 2024 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
Wang, C.; Wang, Y. SLGA-YOLO: A Lightweight Castings Surface Defect Detection Method Based on Fusion-Enhanced Attention Mechanism and Self-Architecture. Sensors 2024, 24, 4088. https://doi.org/10.3390/s24134088
Wang C, Wang Y. SLGA-YOLO: A Lightweight Castings Surface Defect Detection Method Based on Fusion-Enhanced Attention Mechanism and Self-Architecture. Sensors. 2024; 24(13):4088. https://doi.org/10.3390/s24134088
Chicago/Turabian StyleWang, Chengjun, and Yifan Wang. 2024. "SLGA-YOLO: A Lightweight Castings Surface Defect Detection Method Based on Fusion-Enhanced Attention Mechanism and Self-Architecture" Sensors 24, no. 13: 4088. https://doi.org/10.3390/s24134088
APA StyleWang, C., & Wang, Y. (2024). SLGA-YOLO: A Lightweight Castings Surface Defect Detection Method Based on Fusion-Enhanced Attention Mechanism and Self-Architecture. Sensors, 24(13), 4088. https://doi.org/10.3390/s24134088