Improved YOLOv5 Network for Steel Surface Defect Detection
Steel surface defect detection is crucial for ensuring steel quality. The traditional detection algorithm has low detection probability. This paper proposes an improved algorithm based on the YOLOv5 model to enhance detection probability. Firstly, deformable convolution is introduced in the backbone...
Main Authors: | , , , , , , |
---|---|
Format: | Article |
Language: | English |
Published: |
MDPI AG
2023-08-01
|
Series: | Metals |
Subjects: | |
Online Access: | https://www.mdpi.com/2075-4701/13/8/1439 |
_version_ | 1828715324620406784 |
---|---|
author | Bo Huang Jianhong Liu Xiang Liu Kang Liu Xinyu Liao Kun Li Jian Wang |
author_facet | Bo Huang Jianhong Liu Xiang Liu Kang Liu Xinyu Liao Kun Li Jian Wang |
author_sort | Bo Huang |
collection | DOAJ |
description | Steel surface defect detection is crucial for ensuring steel quality. The traditional detection algorithm has low detection probability. This paper proposes an improved algorithm based on the YOLOv5 model to enhance detection probability. Firstly, deformable convolution is introduced in the backbone network, and a traditional convolution module is replaced by deformable convolution; secondly, the <i>CBAM</i> attention mechanism is added to the backbone network; then, <i>Focal EIOU</i> is used instead of the <i>CIOU</i> loss function in YOLOv5; lastly, the <i>K-means</i> algorithm is used to cluster the Anchor box, and the Anchor box parameters that are more suitable for this paper are obtained. The experimental results show that using deformable convolution instead of traditional convolution can get more feature information, which is more conducive to the learning of the network. This paper uses the <i>CBAM</i> attention mechanism, and the heat map of the attention mechanism shows that the <i>CBAM</i> attention mechanism is beneficial for feature extraction. <i>Focal EIOU</i> is optimized in high and wide loss compared with the <i>CIOU</i> loss function, which accelerates the convergence of the model. The Anchor box is more favorable for feature extraction. The improved algorithm achieved a detection probability of 78.8% in the NEU-DET dataset, which is 4.3% better than the original YOLOv5 network, and the inference time of each image is only increased by 1 ms; therefore, the optimized algorithm proposed in this paper is effective. |
first_indexed | 2024-03-10T23:44:28Z |
format | Article |
id | doaj.art-41e70a4488434925993cbdc422726677 |
institution | Directory Open Access Journal |
issn | 2075-4701 |
language | English |
last_indexed | 2024-03-10T23:44:28Z |
publishDate | 2023-08-01 |
publisher | MDPI AG |
record_format | Article |
series | Metals |
spelling | doaj.art-41e70a4488434925993cbdc4227266772023-11-19T02:11:12ZengMDPI AGMetals2075-47012023-08-01138143910.3390/met13081439Improved YOLOv5 Network for Steel Surface Defect DetectionBo Huang0Jianhong Liu1Xiang Liu2Kang Liu3Xinyu Liao4Kun Li5Jian Wang6College of Mechanical Engineering, Sichuan University of Science and Engineering, Yibin 644000, ChinaCollege of Mechanical Engineering, Sichuan University of Science and Engineering, Yibin 644000, ChinaCollege of Mechanical Engineering, Sichuan University of Science and Engineering, Yibin 644000, ChinaCollege of Mechanical Engineering, Sichuan University of Science and Engineering, Yibin 644000, ChinaCollege of Mechanical Engineering, Sichuan University of Science and Engineering, Yibin 644000, ChinaCollege of Mechanical Engineering, Sichuan University of Science and Engineering, Yibin 644000, ChinaCollege of Mechanical Engineering, Sichuan University of Science and Engineering, Yibin 644000, ChinaSteel surface defect detection is crucial for ensuring steel quality. The traditional detection algorithm has low detection probability. This paper proposes an improved algorithm based on the YOLOv5 model to enhance detection probability. Firstly, deformable convolution is introduced in the backbone network, and a traditional convolution module is replaced by deformable convolution; secondly, the <i>CBAM</i> attention mechanism is added to the backbone network; then, <i>Focal EIOU</i> is used instead of the <i>CIOU</i> loss function in YOLOv5; lastly, the <i>K-means</i> algorithm is used to cluster the Anchor box, and the Anchor box parameters that are more suitable for this paper are obtained. The experimental results show that using deformable convolution instead of traditional convolution can get more feature information, which is more conducive to the learning of the network. This paper uses the <i>CBAM</i> attention mechanism, and the heat map of the attention mechanism shows that the <i>CBAM</i> attention mechanism is beneficial for feature extraction. <i>Focal EIOU</i> is optimized in high and wide loss compared with the <i>CIOU</i> loss function, which accelerates the convergence of the model. The Anchor box is more favorable for feature extraction. The improved algorithm achieved a detection probability of 78.8% in the NEU-DET dataset, which is 4.3% better than the original YOLOv5 network, and the inference time of each image is only increased by 1 ms; therefore, the optimized algorithm proposed in this paper is effective.https://www.mdpi.com/2075-4701/13/8/1439YOLOv5deformable convolutionattention mechanism<i>Focal EIOU</i><i>K-means</i> |
spellingShingle | Bo Huang Jianhong Liu Xiang Liu Kang Liu Xinyu Liao Kun Li Jian Wang Improved YOLOv5 Network for Steel Surface Defect Detection Metals YOLOv5 deformable convolution attention mechanism <i>Focal EIOU</i> <i>K-means</i> |
title | Improved YOLOv5 Network for Steel Surface Defect Detection |
title_full | Improved YOLOv5 Network for Steel Surface Defect Detection |
title_fullStr | Improved YOLOv5 Network for Steel Surface Defect Detection |
title_full_unstemmed | Improved YOLOv5 Network for Steel Surface Defect Detection |
title_short | Improved YOLOv5 Network for Steel Surface Defect Detection |
title_sort | improved yolov5 network for steel surface defect detection |
topic | YOLOv5 deformable convolution attention mechanism <i>Focal EIOU</i> <i>K-means</i> |
url | https://www.mdpi.com/2075-4701/13/8/1439 |
work_keys_str_mv | AT bohuang improvedyolov5networkforsteelsurfacedefectdetection AT jianhongliu improvedyolov5networkforsteelsurfacedefectdetection AT xiangliu improvedyolov5networkforsteelsurfacedefectdetection AT kangliu improvedyolov5networkforsteelsurfacedefectdetection AT xinyuliao improvedyolov5networkforsteelsurfacedefectdetection AT kunli improvedyolov5networkforsteelsurfacedefectdetection AT jianwang improvedyolov5networkforsteelsurfacedefectdetection |