Defect Detection in Steel Using a Hybrid Attention Network
Abstract
:1. Introduction
- Introduce the CBAM to Backbone to enhance the learning capability of the whole network.
- Take advantage of ASFF in the Neck section to enhance the extraction of multi-scale semantic information of defects.
- The loss function of CIOU is incorporated to address the issue of poor generalization and enhance the model training process.
2. Related Work
2.1. Defect Detection Based on Traditional Machine Vision
- Background Phase Subtraction: Subtracts the background image without defects estimated or calculated in advance from the background image, leaving a residual image containing defects and random noise.
- Traditional methods of image processing using filtering techniques. Guan et al. used a non-static algorithm for batch-by-batch detection [22]. With the help of the significance of textile defects, this algorithm was used to detect defects in textiles located in the color space of HSV. It estimated the defects of different textiles better and also had good generalization and generality. To study randomly textured color images, Shafarenko et al. proposed a measurement of color similarity based on the watershed algorithm [23], which achieved automatic detection of defects on surfaces in randomly textured color images based on color, texture, edges, and other features of different images. Hoang et al. investigated how to detect defects on leather surfaces [24]. Firstly, the corrosion operation was used, then automatic image segmentation was performed using the method of OTSu. Finally, a clustering algorithm was used to classify various defects, which was based on the Euclidean distance, and the experimental results showed the effectiveness of this method.
- Feature detection based on manual features. Furthermore, these features were utilized to train the classifier of machine learning and achieved the final defect detection.
2.2. Defect Detection Based on Deep Learning
3. Baseline
3.1. Feature Extraction Network
3.2. Feature Fusion Network
3.3. YOLOX-Head
4. Our Methods
- CBAM is introduced into the Backbone to enhance the learning capability of the whole network. CBAM is a hybrid attention mechanism that combines the advantages of the attention of the bath channel and the spatial domain for feature detection. It improves the ability of the model to extract deep features.
- ASFF is taken advantage of in the Neck section to enhance the extraction of multi-scale semantic information of defects. ASFF is implemented in the feature fusion network, which allows the model to learn the semantic information from different feature layers and assign appropriate weights to each feature map layer. It can improve the accuracy of the network detection.
- The loss function of CIOU is incorporated to address the issue of poor generalization and enhance the model training process.
4.1. Convolution Block Attention Module
4.2. Adaptively Spatial Feature Fusion
4.3. Loss Function of CIOU
5. Experimental Results and Analysis
5.1. Dataset
5.2. Image Preprocessing
5.3. Evaluation Metrics
5.4. Experimental Environment
5.5. Ablation Experiment
5.6. Comparative Experiments
6. Conclusions
Author Contributions
Funding
Acknowledgments
Conflicts of Interest
References
- Weiwei, L.; Yunhui, Y.; Jun, L.; Yao, Z.; Hongwei, S. Automated On-Line Fast Detection for Surface Defect of Steel Strip Based on Multivariate Discriminant Function. In Proceedings of the 2008 Second International Symposium on Intelligent Information Technology Application, Shanghai, China, 20–22 December 2008; pp. 493–497. [Google Scholar]
- Luo, Q.; Sun, Y.; Li, P.; Simpson, O.; Tian, L.; He, Y. Generalized Completed Local Binary Patterns for Time-Efficient Steel Surface Defect Classification. IEEE Trans. Instrum. Meas. 2019, 68, 667–679. [Google Scholar] [CrossRef] [Green Version]
- Ai, Y.H.; Xu, K. Surface detection of continuous casting slabs based on curvelet transform and kernel locality preserving projections. J. Iron Steel Res. Int. 2013, 20, 80–86. [Google Scholar] [CrossRef]
- Medina, R.; Gayubo, F.; González-Rodrigo, L. Automated visual classification of frequent defects in flat steel coils. Int. J. Adv. Manuf. Technol. 2011, 57, 1087–1097. [Google Scholar] [CrossRef]
- Girshick, R.; Donahue, J.; Darrell, T. Rich Feature Hierarchies for Accurate Object Detection and Semantic Segmentation. In Proceedings of the 2014 IEEE/CVF Conference on Computer Vision and Pattern Recognition, Columbus, OH, USA, 24–27 June 2014; pp. 580–587. [Google Scholar]
- Girshick, R. Fast R-CNN. In Proceedings of the IEEE International Conference on Computer Vision, Santiago, Chile, 7–13 December 2015; pp. 1440–1448. [Google Scholar]
- Ren, S.; He, K.; Girshick, R. 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] [Green Version]
- Cai, Z.; Vasconcelos, N. Cascade R-CNN: Delving into High Quality Object Detection. In Proceedings of the 2018 IEEE/CVF Conference on Computer Vision and Pattern Recognition, Salt Lake City, UT, USA, 18–22 June 2018; pp. 6154–6162. [Google Scholar]
- Redmon, J.; Divvala, S.; Girshick, R. You only look once: Unified, real-time object detection. In Proceedings of the 2016 IEEE/CVF Conference on Computer Vision and Pattern Recognition, Las Vegas, NV, USA, 26 June–1 July 2016; pp. 779–788. [Google Scholar]
- Redmon, J.; Farhadi, A. YOLO9000: Better, faster, stronger. In Proceedings of the 2017 IEEE/CVF Conference on Computer Vision and Pattern Recognition, Honolulu, HI, USA, 21–26 July 2017; pp. 7263–7271. [Google Scholar]
- Bochkovskiy, A.; Wang, C.Y.; Liao, H.Y.M. Yolov4: Optimal speed and accuracy of object detection. arXiv 2020, arXiv:2004.10934. [Google Scholar]
- Wang, C.Y.; Bochkovskiy, A.; Liao, H.Y.M. Scaled-yolov4: Scaling cross stage partial network. In Proceedings of the 2021 IEEE/CVF Conference on Computer Vision and Pattern Recognition, Online, 19–25 June 2021; pp. 13029–13038. [Google Scholar]
- Ge, Z.; Liu, S.T.; Wang, F. YOLOX: Exceeding yolo series in 2021. arXiv 2021, arXiv:2107.08430. [Google Scholar]
- Liu, W.; Anguelov, D.; Erhan, D. SSD: Single shot multi-box detector. In Computer Vision—ECCV 2016, Proceedings of the 14th European Conference, Amsterdam, The Netherlands, 11–14 October 2016; Springer International Publishing: Cham, Switzerland, 2016; pp. 21–37. [Google Scholar]
- Tian, Z.; Shen, C.; Chen, H. FCOS: Fully convolutional one-stage object detection. In Proceedings of the 2019 IEEE/CVF International Conference on Computer Vision, Seoul, Republic of Korea, 27 October–2 November 2019; pp. 9627–9636. [Google Scholar]
- Zhang, S.; Chi, C.; Yao, Y. Bridging the gap between anchor-based and anchor-free detection via adaptive training sample selection. In Proceedings of the 2020 IEEE/CVF Conference on Computer Vision and Pattern Recognition, Seattle, WA, USA, 13–19 June 2020; pp. 9759–9768. [Google Scholar]
- Yu, H.; Li, J.S.; Liu, Y.J. Cascaded neural network-based surface defect detection algorithm for steel sections. Comput. Appl. 2023, 43, 232–241. [Google Scholar]
- Ma, Z.X.; Li, Y.B.; Huang, M.H. A lightweight detector based on attention mechanism for aluminum strip surface defect detection. Comput. Ind. 2022, 136, 103585. [Google Scholar] [CrossRef]
- Guo, Z.; Wang, C.; Yang, G. MSFT-YOLO: Improved YOLOv5 based on transformer for detecting defects of steel surface. Sensors 2022, 22, 3467. [Google Scholar] [CrossRef]
- Sun, Q.X.; He, N.; Zhang, J.Z. A lightweight human pose estimation method based on non-local high-resolution networks. Comput. Appl. 2022, 42, 1398–1406. [Google Scholar]
- Hu, H.; Du, H.C.; Wang, S.Q. Improved YOLOX method for detecting surface defects of pharmaceutical blister aluminum foil. J. Graphol. 2022, 43, 803–814. [Google Scholar]
- Guan, S. Fabric defect delaminating detection based on visual saliency in HSV color space. J. Text. Inst. 2018, 109, 1560–1573. [Google Scholar] [CrossRef]
- Shafarenko, L.; Petrou, M.; Kittler, J. Automatic watershed segmentation of randomly textured color images. IEEE Trans. Image Process. 1997, 6, 1530–1544. [Google Scholar] [CrossRef]
- Hoang, L.; Wen, W.; Nachimuthu, A.; Jiang, X.L. Achieving automation in leather surface inspection. Comput. Ind. 1997, 34, 43–54. [Google Scholar] [CrossRef]
- Chen, J.; Liu, Z.; Wang, H.; Nuñez, A.; Han, Z. Automatic Defect Detection of Fasteners on the Catenary Support Device Using Deep Convolutional Neural Network. IEEE Trans. Instrum. Meas. 2018, 67, 257–269. [Google Scholar] [CrossRef] [Green Version]
- Tao, X.; Zhang, D.; Ma, W.; Liu, X.; Xu, D. Automatic Metallic Surface Defect Detection and Recognition with Convolutional Neural Networks. Appl. Sci. 2018, 8, 1575. [Google Scholar] [CrossRef] [Green Version]
- Lan, M.; Zhang, Y.; Zhang, L.; Du, B. Defect Detection from UAV Images based on Region-Based CNNs. arXiv 2018, arXiv:1811.09473. [Google Scholar]
- Yang, Y.-X.; Zhao, M. CNN-based strip steel surface defect detection. Heavy Mach. 2019, 2, 25–29. [Google Scholar] [CrossRef]
- Zhang, X. Research and Implementation of Steel Surface Defect Detection Method Based on Improved RCNN; Northeastern University: Shenyang, China, 2019. [Google Scholar] [CrossRef]
- Cheng, J.; Duan, X.; Zhu, W. Research on Metal Surface Defect Detection by Improved YOLOv3. Comput. Eng. Appl. 2021, 57, 252–258. [Google Scholar] [CrossRef]
- Li, S.; Wang, X.Q. YOLOv5-based Defect Detection Model for Hot Rolled Strip Steel. J. Phys. Conf. Ser. 2022, 2171, 012040. [Google Scholar] [CrossRef]
- Woo, S.; Park, J.; Lee, J.Y. CBAM: Convolutional block attention module. In Computer Vision—ECCV 2018, Proceedings of the 15th European Conference, Munich, Germany, 8–14 September 2018; Springer International Publishing: Cham, Switzerland, 2018; pp. 3–19. [Google Scholar]
- Liu, S.T.; Huang, D.; Wang, Y.H. Learning spatial fusion for single-shot object detection. arXiv 2019, arXiv:1911.09516. [Google Scholar]
- Zheng, Z.H.; Wang, P.; Liu, W. Distance–IoU loss: Faster and better learning for bounding box regression. Proc. AAAI Conf. Artif. Intell. 2020, 34, 12993–13000. [Google Scholar] [CrossRef]
Setting | Parameters |
---|---|
CPU | Intel Core i7-12700H (Intel Corporation, Santa Clara, CA, USA) |
GPU | NVIDIA RTX 3060 Laptop |
System | Windows 11 |
Pytorch | Torch 1.12 |
IOU | 0.5 |
Epoch | 300 |
Batch size | 8 |
Optimizer | SGD |
Parameter | Value |
---|---|
num-classes | 6 |
input-shape | [224,224] |
mosaic-prob | 0.5 |
mixup-prob | 0.5 |
special-avg-ratio | 0.7 |
max-epoch | 300 |
freeze-batch-size | 16 |
unfreeze-batch-size | 8 |
learning-rate | 0.01 |
momentum | 0.937 |
weight-decay | 0.0005 |
num-workers | 2 |
Methods | AP (%) | mAP | |||||||
---|---|---|---|---|---|---|---|---|---|
CBAM | ASFF | CIOU | Cr | In | Pa | Ps | Rs | Sc | (%) |
41.45 | 84.52 | 95.24 | 92.55 | 69.68 | 90.82 | 79.04 | |||
√ | 42.03 | 82.90 | 93.35 | 95.54 | 72.15 | 98.15 | 80.69 | ||
√ | 58.59 | 87.39 | 93.14 | 93.44 | 77.89 | 97.30 | 84.62 | ||
√ | 58.89 | 88.78 | 94.80 | 94.86 | 72.09 | 96.99 | 84.40 | ||
√ | √ | 61.12 | 87.09 | 93.68 | 94.13 | 79.61 | 97.05 | 85.45 | |
√ | √ | 63.53 | 89.91 | 93.66 | 92.40 | 74.96 | 95.71 | 85.03 | |
√ | √ | 67.08 | 86.43 | 93.94 | 92.95 | 74.91 | 95.59 | 85.08 | |
√ | √ | √ | 63.65 | 89.00 | 93.89 | 94.14 | 77.63 | 95.48 | 85.63 |
Algorithm | AP (%) | mAP (%) | |||||
---|---|---|---|---|---|---|---|
Cr | In | Pa | Ps | Rs | Sc | ||
VGG | 30.73 | 79.52 | 93.15 | 86.98 | 61.01 | 89.06 | 73.41 |
DenseNet | 31.18 | 73.96 | 73.71 | 82.27 | 49.90 | 85.81 | 69.47 |
GhostNet | 12.98 | 66.29 | 76.02 | 78.76 | 31.21 | 59.73 | 54.16 |
ResNet50 | 29.68 | 78.92 | 91.36 | 84.42 | 53.95 | 85.56 | 70.65 |
SSD | 33.30 | 80.18 | 94.74 | 88.43 | 64.68 | 80.22 | 73.59 |
EnfficientNet | 21.30 | 70.04 | 83.51 | 77.46 | 44.71 | 65.61 | 60.44 |
Yolov3 | 25.98 | 75.48 | 89.94 | 85.43 | 60.39 | 88.12 | 70.89 |
Yolov5 | 34.75 | 81.81 | 90.92 | 86.98 | 66.09 | 90.50 | 75.17 |
Baseline | 41.45 | 84.52 | 95.24 | 92.55 | 69.68 | 90.82 | 79.04 |
Ours | 63.65 | 89.00 | 93.89 | 94.14 | 77.63 | 95.48 | 85.63 |
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. |
© 2023 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
Zhou, M.; Lu, W.; Xia, J.; Wang, Y. Defect Detection in Steel Using a Hybrid Attention Network. Sensors 2023, 23, 6982. https://doi.org/10.3390/s23156982
Zhou M, Lu W, Xia J, Wang Y. Defect Detection in Steel Using a Hybrid Attention Network. Sensors. 2023; 23(15):6982. https://doi.org/10.3390/s23156982
Chicago/Turabian StyleZhou, Mudan, Wentao Lu, Jingbo Xia, and Yuhao Wang. 2023. "Defect Detection in Steel Using a Hybrid Attention Network" Sensors 23, no. 15: 6982. https://doi.org/10.3390/s23156982
APA StyleZhou, M., Lu, W., Xia, J., & Wang, Y. (2023). Defect Detection in Steel Using a Hybrid Attention Network. Sensors, 23(15), 6982. https://doi.org/10.3390/s23156982