원시데이터 수집 시스템
선정목록으로

Steel Surface Defect Detection Based on SSAM-YOLO

관련 모빌리티 소재 · (4) 카시트 모듈

기본 정보

저자
  1. Tianle Yang — Sichuan University, China
  2. Jinghui Li — Sichuan University, China
DOI
10.4018/ijitsa.328091
저널
International Journal of Information Technologies and Systems Approach
발행년도
2023
발행기관
IGI Global
피인용수
3
라이선스
cc-by
논문 유형
–
언어
–
원문 페이지
https://doi.org/10.4018/ijitsa.328091
토픽
Surface Roughness and Optical Measurements
OpenAlex ID
W4385987689

평가 내용

관련도
관련
사업분야
모빌리티 소재 · (4) 카시트 모듈
부 분야
–
R&D 측면
–
확신도
–
근거 용어
–
판단 근거
임베딩 유사도 기반 평가로 '모빌리티 소재 > 카시트 모듈' 분야에 선정된 논문입니다.
R&D 활용 포인트
–
평가 입력
–

초록

The defect inspection of the steel surface is crucial to modern manufacturing and highly depends on inefficient manual work. The emergence of deep learning has prompted the development of automated defect detection methods, but the current methods perform badly in the detection of the crazing and rolled-in scale-two types of defects on steel surfaces. The difficulty in the detection of crazing and rolled-in scale is mainly due to the similarity between object regions and background regions. Based on this, the authors propose a supervised spatial-attention module (SSAM). It introduces a priori knowledge compared to the traditional spatial attention mechanism, which can enhance the supervision of relevant parameters in the attention mechanism module during network training. Finally, they introduced the SSAM to the YOLOv5 and got the SSAM-YOLO. The test result on the NEU-DET dataset shows that the proposed method has better detection accuracy, achieving improvements of 7.3% and 3.02% on the AP@0.5 for the crazing and rolled-in scale. The method also outperforms the comparative main stream algorithms for steel surface defect detection, verifying the effectiveness of our algorithm.

본문 25,366자

본문 펼치기
The defect inspection of the steel surface is crucial to modern manufacturing and highly depends on inefficient manual work.The emergence of deep learning has prompted the development of automated defect detection methods, but the current methods perform badly in the detection of the crazing and rolled-in scale-two types of defects on steel surfaces.The difficulty in the detection of crazing and rolled-in scale is mainly due to the similarity between object regions and background regions.Based on this, the authors propose a supervised spatial-attention module (SSAM).It introduces a priori knowledge compared to the traditional spatial attention mechanism, which can enhance the supervision of relevant parameters in the attention mechanism module during network training.Finally, they introduced the SSAM to the YOLOv5 and got the SSAM-YOLO.The test result on the NEU-DET dataset shows that the proposed method has better detection accuracy, achieving improvements of 7.3% and 3.02% on the AP@0.5 for the crazing and rolled-in scale.The method also outperforms the comparative main stream algorithms for steel surface defect detection, verifying the effectiveness of our algorithm. INTRODUCTION Steel is one of the most widely used metals in manufacturing, and is of great importance to the car industry, architecture work, and social infrastructure (Kang et al., 2013;Zhang et al., 2020;Gullino et al., 2019;Neogi et al., 2014).However, during the manufacturing process, numerous surface defects in the steel product will appear as a result of external causes including equipment wear and tear (Hao et al., 2021) and inappropriate temperature regulation.Figure 1 displays the most typical defects, such as crazing, patches, rolled in-scale, and more.These defects can cause serious accidents, such as car crashes, bridge collapse, and other manufacturing accidents.Therefore, the inspection of the steel surface is crucial to the industry's development.Traditional detection task is a manual process and highly depends on the workers' experience.Consequently, there are a great number of manufacturing accidents occurring due to improper judgment by factory workers.It would be ideal to have an automated detection technique that considerably increases the manufacturing effectiveness. INTRODUCTION With the spreading application of computer-aided technology in the industry (Potenza et al., 2020), the vision-based defect detection technique began to develop rapidly.Generally, an early automated detection consists of a charged coupled device (CCD) camera and an operating stage (Mordia & Arvind, 2022).The CCD camera captures the images of the steel pipes or plates, transfers the raw images to the operation stage for image processing, and generates the detection results.The defect detection contains the classification and localization of the defects.The early image processing algorithms are based on a manually designed feature extractor with a classifier.Ghorai et al. (2012) proposed an automatic detecting system composed of hardware positioned at the steel plants as well as software with a defect-predicting algorithm, whose principle is based on the relation between wavelets and the nature of different types of defects.Chu et al. (2017) designed a classification model based on different multi-type statistical features of the defect region, including a two-dimensional histogram, local binary features, and a dummy boundary.Kittler et al. (1994) put forward a defect-structure-based model to achieve higher detection accuracy of cracks, blobs, and chromatic defects in steel surfaces.Xie and Majid (2005) proposed a novel texton-based approach for defect detection with only a few samples for training, and the principle of detection is based on the micro-structures of the defect characterized by the texton model.The above algorithms can be classified into statistical, filter, and model-based approaches (Xie, X., 2008).However, these methods are all based on hand-made features, which depend on the experience of the designers and are not suitable for steel with defects of various types and configurations.In recent years, the bloom of deep learning (Li & Bo, 2023;Lin, Z. et al., 2023;P. Sun, 2023) prompts the development of various fields, including steel surface detection.The convolutional neural network (CNN) can automatically produce a feature-extracting procedure without the handmade extracting step by human, which can meet the requirement of more challenging classification and detection tasks.Zhou et al. (2017) applied a simple CNN to accomplish the defect classification task and to achieve moderate accuracy compared to concurrent methods with manually made feature extracting steps, but with much more efficiency.To solve the problem of detecting extremely large-scale and small-scale defects, scholar (Cheng, X., & Yu, J, 2020) combined RetinaNet with adaptively spatial feature fusion and channel attention mechanism, to more effectively utilize the information from the shallow layer and to improve the overall detection accuracy.Gao et al. (2020) proposed a semi-supervised learning method based on the simple design CNN, to solve the lack of labeled datasets for defects of the steel surface.X. Liu and Gao (2021) proposed the RAF-SSD model based on the SSD, in order to develop a detection model with moderate performance compared with concurrent algorithms, such as you look only once (YOLO) and region convolutional neural network (R-CNN), but with fewer parameters, which satisfies the requirements of real-time defect detection for steel surfaces.X.Sun et al. (2019) proposed an improved faster R-CNN in order to make the original faster R-CNN lighter while maintaining the detection accuracy, which can satisfy the requirement the real-time detection for steel surfaces.Kou et al. (2021) combined the YOLOv3 and the specially designed Dense_block, which can meet the speed requirement for steel surface defect detection as a result of the anchor-free mechanism of YOLOv3 as well as the higher detection accuracy compared with the baseline because of the specially designed dense block.Guo et al. (2022) put forward the MSFT-YOLO based on YOLOv5 and Transformer, which can solve the problem of scale variation in surface defect images effectively.However, the speed of the proposed method is much lower than the original YOLOv5 and is not suitable for real-time defect detection tasks.Damacharla et al. (2021) proposed the transfer learning-based U-net (TLU-Net) framework, consisting of both the residual block as well as the densely connected structure.The proposed method performs better in defect detection as well as in the segmentation of the defects.Guan et al. (2020) put forward a novel recognition algorithm named VSD, consisting of VGG19, DVGG19, SSIM, and the decision tree.The experiments show that the proposed model performs well in the detection of steel defects and has a high speed for the network to converge.However, the VSD has a huge network structure and costs considerable computational sources, which is not suitable for the real-time detection task.Y. Liu et al. (2019) put forward a periodical defect detection method based on a specially designed convolutional neural network (CNN) and long short-term memory (LSTM).The specially designed CNN is responsible for the feature-extraction work from the input images of the defects on the steel surfaces, while the LSTM needs to recognize the type of defects.The proposed model can achieve high detection accuracy but is only suitable for images of high quality, which means the method might not be suitable for the detection tasks conducted in more complicated environments. INTRODUCTION The majority of the deep learning-based techniques mentioned above merely work to increase the overall detection accuracy.The majority of researchers, however, are unaware of how difficult it is to detect crazing and rolled-in scale on steel surfaces.Most concurrent algorithms based on deep learning have detection accuracy that is already rather good for other sorts of defects, but for crazing and rolled-in scale, these algorithms have far lower detection accuracy, which could lead to major production-related catastrophes.Therefore, aiming at improving the detection accuracy of crazing and roll-in scale, we propose a supervised spatial-attention module (SSAM) and combine it with YOLOv5.We introduce the specially designed spatial-attention module with BCELoss to the YOLOv5 to strengthen the area of objects while suppressing the area of the background.Besides this, to further reduce the influence brought by the complex background, we changed the training strategy of YOLOv5 and canceled the mosaic operation.Our experiments show that the new model, named SSAM-YOLO, can reach an accuracy of 72.5% mAp@0.5 on the NEU-DET dataset, which is 3.2% higher than the original YOLOv5.Besides this, the increases of AP@0.5 for crazing and rolled-in scale are 7.3% and 3.02%. INTRODUCTION In summary, the main contributions of this paper are: INTRODUCTION 1. Addressing the unnoticed problem of low detection accuracy for crazing and rolled-in scale by the concurrent algorithms.2. Putting forward the SSAM, which can effectively strengthen the region of the defect while suppressing the region of the background. INTRODUCTION The rest of this paper is organized as follows: an introduction of the proposed algorithm, the experiments and analysis of the results, and conclusions. MeTHOD Figure 2 depicts the SSAM-YOLO's framework.We change the CSPDarknet's structure by placing the three SSAM after the backbone outputs.The mask operation will be applied to the photos first, after which the raw image with the associated masked images and labels will be loaded.To obtain the predicted feature maps and the weight matrix displayed in Figure 2, the network will be fed with the raw pictures.The predicted feature maps and the weight matrix will be used to compute the loss with the labels and the masked images. YOLOv5 YOLOv5 is an improved model based on the YOLOv4 model (Bochkovskiy, A. et al., 2020).It is the fifth version in the YOLO series (Redmon et al., 2016;Redmon & Ali, 2017, 2018) The focus part achieves the channel-extension operation by extracting the values of pixels four times, and each time the pixels are different.The existence of focus part can extend the number of channels without convolution operation and can increase the speed.The spatial pyramid pooling (SPP) block is applied in the bottom of the backbone to achieve the function of multi-scale prediction.The FPN structure takes the three outputs of the backbone and conducts the feature enhancement, producing feature maps with multi-scale information.The FPN will produce three enhanced feature maps, which will be transferred to the YOLO head for predicting the types and positions of the defects. The Supervision Spatial-Attention Module The spatial-attention mechanism (SAM) was proposed by Woo et al. in 2018Woo et al. in (2018)), which is based on the selective visual attention of humans.The attention mechanism can automatically make the network focus on the region which is supposed to be important.In the object detection of the steel surface defect, not every part of the region needs to be focused, and only the rectangular area with defects contains important features.As we can see in Figure 1, the similarities between the background region and the region of the defect are high for images of crazing and rolled-in scale, which means the detection process, like the eyes of a human, may easily ignore the existence of the defects.Therefore, in order to avoid the confusion of the background and the objects, attention is needed.The structure of the SSAM based on the spatial-attention mechanism is shown in Figure 4.The SSAM contains two steps.In the first step, the number of input image channels, with a size of H W C × × , need to be reduced.The MaxPool and AvgPool operations produce two feature maps with one channel, and then the two outputs are concatenated to produce the final onedimensional feature map called the weighted matrix.In the second step, the input is directly multiplied by the weighted matrix, and the shape of the final output is still H W C × × .The H W × pixels of the input feature consist of pixels representing the information of objects and pixels representing the information of the background.Our focus is only the area of the objects, and the weight matrix, with every element ranging from 0 to 1 can sufficiently strengthen the region of defects as well as suppress regions of background.In order to further optimize the parameter updates, we designed a loss function for the spatialattention blocks.We name the additional loss function as the spatial-attention loss (SPLoss), and the detailed process will be in the following context.In the original loss function of YOLOv5, the prediction value is the three outputs of the YOLO head, and the true value is the information about the bounding boxes and classes in the labels.For the SPLoss, we define the weight matrix as the predicted value in the computation of loss. The Supervision Spatial-Attention Module To define the true value of SPLoss, we first conduct the masking operation on the selected NEU-DET datasets.Precisely, we set the value of the pixels inside the bounding box to 255 and to 0 for other regions, and every image in the dataset has a corresponding masked image.The masking operation is shown in Figure 4. Secondly, the masked images and their corresponding images are loaded together and experience the same operations of data enhancement.Originally, the raw images, the classes of defects, and the information of bounding boxes would be loaded.Now, before the above three, the masked image will also be loaded. The Supervision Spatial-Attention Module For the weight matrix, it is hoped that the value of the pixels in the region containing the defects is 1, and 0 for other regions, by which we can suppress the useless information.In the data processing of the masked images, we finally get a matrix with a size of H W × ×1 , which has a shape as the same as the weight matrix.This matrix is defined as the reference matrix, shown in Figure 4.The value of the weight matrix after the data enhancement, ranges from 0 to 1, and is different from that of the reference matrix.It is hoped that the weight matrix can be closer to the reference matrix.Therefore, a classification loss is applied to evaluate the similarity between the weight matrix and the reference matrix. The Supervision Spatial-Attention Module More precisely, we applied binary crossentropy loss (BCELoss), because it is preferred that the value of the elements of the weight matrix is only 0 or 1.In Figure 4, we define the input with a size of H W C × × , and now we use x to denote the input.MaxPool(.)represents the maximum pooling ( ) represents the average pooling.The mathematical representation of maximum pooling is shown in Equation 1, where y k ij denotes the maximum pooled output value in the rectangular region R ij associated with the k th feature map; x k pq denotes the element in the rectangular region R ij located at (p,q) and k represents the individual layer of the C-channel feature maps.Element i, j represents the coordinates of a divided region of the feature maps.The mathematical representation of the average pooling is shown in Equation 2, where R ij represents the number of elements in the rectangular region R ij .The final weight matrix is represented by Spa(x), having H W × elements.The reference matrix is represented by y, also having H W × elements.The reference matrix y are the outputs of the masked images after the operation of data augmentation as well as the resizing to the same size as that of the weight matrix, and the process is shown in Figure 4.The BCELoss function is shown in Equation 3, where the Spa x i ( ) represents the element in the matrix Spa(x) with a size of H W × and y i represents the element of the reference matrix.The addition of the loss function can add the gradient backward for the spatial-attention module, which can help the parameter updating, thus, improving the detection accuracy: Overall Loss Function of the Proposed Method The overall loss function of our proposed method is the combination of the loss function for the original YOLOv5 and that for the spatial-attention mechanism.For the general object detection task, the class of defects and the position should be considered to completely evaluate the accuracy of detection.Precisely, the YOLO loss is composed of classification loss, localization loss, and confidence loss.For localization loss, YOLOv5 adopts the CIouLoss (Redmon et al., 2017), which is illustrated in Equation 4. Variables A and B represent the area of the prediction box and the true box, where b and b gt each denotes the centroids of the prediction box and the true box, ρ denotes the Euclidean distance between the two centroids, and c denotes the diagonal distance between the minimum closure regions of the prediction box and the true box.Variable α is the weight parameter, and v is used to measure the consistency of the aspect ratio.For classification loss, the CELoss is applied, and the equation is shown in Equation ( 5), where y i is the label of the input sample, and σ x i ( ) is the predicted value.For the localization loss, it is applied to evaluate the reliability of the prediction box, and the calculation equation is the same as the CELoss.The total loss is shown in Equation 6, where a, b, and c are, respectively, the weights of different types of loss for the original YOLOv5: eXPeRIMeNTS The experiments are all implemented on an Intel Core i9-12900H CPU (2.5GHz,3.2GBRAM) and an NVIDIA GeForce RTX 3090 GPU (CUDA version 11.6) using Python 3.8.10(PyTorch 1.13.0) in Windows 11. eXPeRIMeNTS The experiments adopt the SGD optimizer, initialize the learning rate to 0.001, and set the batch size and the epoch to 8 and 300. Computational Platform The experiments are conducted in the Windows 11 operating system.The compiled environment involves PyTorch 1.15.1,Python 3.8, and CUDA 11.5.The hardware contains the Inter Core i9-12900H and NVIDIA RTX3060. evaluation Index To test whether our purposed method can improve the detection accuracy of crazing and rolled-in scale, we use the average precision (AP), which is shown in Equation 7. Variable P represents the precision, which reflects the accuracy of prediction, and R represents the recall, which reflects the completeness of prediction.For the object detection task, the higher the mAP and AP are, the better the performance will be: evaluation Index Besides this, the detection accuracy of other types of defects is also important; thus, the mean average precision (mAP) is also considered, which is shown in Equation (8). Ablation experiments For the data enhancement of YOLOv5, it has the operations of mosaic, cutout, etc.As we have previously mentioned, the similarity between different types of defects is high.As we can see from Figure 1, these types of defects have similar gray colors, and they are all hard to distinguish from the background.Thus, the similarities between different types of defects and between the defects and the background are high.The mosaic operation in the data augmentation will cause confusion of different types of defects and needs to be canceled.The result is shown in Table 1.As we can see from Table 1, the cancellation of the mosaic operation can improve the AP@0.5 by 2.75% and 1.64% for crazing and rolled-in scale. Ablation experiments Compared with the original YOLOv5, our proposed models with different degrees of optimization have been tested on NEU-DET datasets, and the experimental results are shown in Table 2.It shows that after the addition of SAM, the APs of crazing and rolled-in scale have been increased by 4.27% and 1.26%.The improvement is a result of the feature suppression in useless regions without the defects.Then, after the addition of SSAM, the AP of crazing increases by 7.3%, and for the rolled-in scale, it increases by 3.02% compared to the baseline. Ablation experiments The reason why the change of loss function can improve the detection accuracy is naturally the optimization of the parameters' updating of the original SAM.In the YOLOv5, the loss function is only related to the parameter updating for the CSPDarknet, FPN, and YOLO head.However, no specific loss function is related to the parameters in SAM, which means the gradient propagation of SAM only depends on the direction of gradient propagation of the original network structure of YOLOv5.Therefore, the SSAM optimizes the SAM by adding a specifically designed SPLoss to the original loss function of the network, which can improve the process of the gradient propagation for the SAM, i.e., the parameters' updating of SAM is supervised. The Comparison experiments We also conducted comparable experiments on SSD (W.Liu et al., 2016), YOLOv3 (Redmon et al., 2018), and faster R-CNN on the same dataset.Each network is trained on the same training set and tested on the same test set.The experimental results are shown in Table 3.The test results are shown in Figure 5, where we can see that the SSAM-YOLO performs best in the localization of the defects among the main stream algorithms. The Comparison experiments As we can see from Table 3, our proposed method performs best among the selected main stream algorithms.For the detection accuracy of crazing and rolled-in scale, our method is superior than SSD, YOLOv3, and YOLOv7-tiny.The faster R-CNN performs better in the detection of crazing, but its accuracy of rolled-in scale is a lot lower than ours. CONCLUSION To improve the detection accuracy of the crazing and rolled-in scale in steel surface detection tasks, we proposed a supervision spatial-attention module (SSAM) and combine it with the YOLOv5, named SSAM-YOLO.The introduction of SSAM to the YOLOv5 can help strengthen the region of defects and suppress the region of the steel surfaces without defects.The addition of the SPLoss to the original loss function of YOLOv5 can optimize the process of parameters' updating of the spatial-attention module, and achieve higher detection accuracy, especially for the crazing and rolledin scale.Besides, to reduce the confusion between different types of defects and between defects and the background, we cancel the mosaic operation in the data augmentation process.By testing on the NEU-DET dataset, the SSAM-YOLO increases the AP for crazing by 7.3% and 3.02% for the rolled-in scale, which shows that our model truly improves the detection accuracy of the crazing and rolled-in scales.We also compare our model with other methods used for defect detection, such as YOLOv3 and SSD.The results show that our model has better performance than these mainstream algorithms. CONCLUSION In future studies, we will add a new type of mosaic operation that only combines the images of the same defects, by which we can enlarge the datasets without causing confusion between different types of defects.Besides this, we also need to combine our proposed SSAM with other algorithms and test the methods on other surface defect datasets to verify the robustness of our proposed module. ACKNOwLeDGMeNT The author would like to thank the editor and anonymous reviewers for their contributions to improving the quality of this paper. Figure 1 . Figure 1.Different types of surface defects of the steels: crazing, inclusion, patches, pitted surface, rolled-in scale, and scratches Figure 1 . and one of the representative one-stage object detection algorithms.The concurrent automated methods for steel surface defect detection are mainly based on machine learning and deep learning.The accuracy of the machine-learning-based algorithm depends highly on the manually designed feature-extracting model.In other words, machine-learning-based algorithms are less automatic than deep-learningbased algorithms.The network structure of YOLOv5 contains a backbone featuring pyramid networks (FPN;Lin et al., 2017) and a YOLO head.The backbone of YOLOv5 is CSPDarknet53(Redmon et al., 2018), which is responsible for extracting information from the raw images of the steel surface and outputs the feature map of images containing the information to describe the characteristics of the feature.The structure of CSPDarknet53 is shown in Figure3.The structure of the backbone is a combination of the focus part and ResBlocks.The focus part is applied to extend the number of channels of the input RGB images without losing the information, which is different from the convolution operation. Figure 2 . Figure 2. The network structure of SSAM-YOLO Figure 3 . Figure 3.The network structure of YOLOv5 Figure 4 . Figure 4.The structure of SSAM Figure 4 . is the dataset we used for training.It is a surface defect database collected by Northeastern University (NEU), containing six kinds of defects of the hot-rolled steel strip.These defects are crazing (Cr), inclusion (In), patches (Pa), pitted_surface (Ps), rolled-in_scale (Rs), and scratches (Sc).The dataset contains 1,800 images, and each defect type has 300 images.The size of the image is 200 200 × .The ratio of the training set and test set is 9:1.

섹션 본문 33문단 · 24,731자

(제목 없음)

1The defect inspection of the steel surface is crucial to modern manufacturing and highly depends on inefficient manual work.The emergence of deep learning has prompted the development of automated defect detection methods, but the current methods perform badly in the detection of the crazing and rolled-in scale-two types of defects on steel surfaces.The difficulty in the detection of crazing and rolled-in scale is mainly due to the similarity between object regions and background regions.Based on this, the authors propose a supervised spatial-attention module (SSAM).It introduces a priori knowledge compared to the traditional spatial attention mechanism, which can enhance the supervision of relevant parameters in the attention mechanism module during network training.Finally, they introduced the SSAM to the YOLOv5 and got the SSAM-YOLO.The test result on the NEU-DET dataset shows that the proposed method has better detection accuracy, achieving improvements of 7.3% and 3.02% on the AP@0.5 for the crazing and rolled-in scale.The method also outperforms the comparative main stream algorithms for steel surface defect detection, verifying the effectiveness of our algorithm.

INTRODUCTION

2Steel is one of the most widely used metals in manufacturing, and is of great importance to the car industry, architecture work, and social infrastructure (Kang et al., 2013;Zhang et al., 2020;Gullino et al., 2019;Neogi et al., 2014).However, during the manufacturing process, numerous surface defects in the steel product will appear as a result of external causes including equipment wear and tear (Hao et al., 2021) and inappropriate temperature regulation.Figure 1 displays the most typical defects, such as crazing, patches, rolled in-scale, and more.These defects can cause serious accidents, such as car crashes, bridge collapse, and other manufacturing accidents.Therefore, the inspection of the steel surface is crucial to the industry's development.Traditional detection task is a manual process and highly depends on the workers' experience.Consequently, there are a great number of manufacturing accidents occurring due to improper judgment by factory workers.It would be ideal to have an automated detection technique that considerably increases the manufacturing effectiveness.

3With the spreading application of computer-aided technology in the industry (Potenza et al., 2020), the vision-based defect detection technique began to develop rapidly.Generally, an early automated detection consists of a charged coupled device (CCD) camera and an operating stage (Mordia & Arvind, 2022).The CCD camera captures the images of the steel pipes or plates, transfers the raw images to the operation stage for image processing, and generates the detection results.The defect detection contains the classification and localization of the defects.The early image processing algorithms are based on a manually designed feature extractor with a classifier.Ghorai et al. (2012) proposed an automatic detecting system composed of hardware positioned at the steel plants as well as software with a defect-predicting algorithm, whose principle is based on the relation between wavelets and the nature of different types of defects.Chu et al. (2017) designed a classification model based on different multi-type statistical features of the defect region, including a two-dimensional histogram, local binary features, and a dummy boundary.Kittler et al. (1994) put forward a defect-structure-based model to achieve higher detection accuracy of cracks, blobs, and chromatic defects in steel surfaces.Xie and Majid (2005) proposed a novel texton-based approach for defect detection with only a few samples for training, and the principle of detection is based on the micro-structures of the defect characterized by the texton model.The above algorithms can be classified into statistical, filter, and model-based approaches (Xie, X., 2008).However, these methods are all based on hand-made features, which depend on the experience of the designers and are not suitable for steel with defects of various types and configurations.In recent years, the bloom of deep learning (Li & Bo, 2023;Lin, Z. et al., 2023;P. Sun, 2023) prompts the development of various fields, including steel surface detection.The convolutional neural network (CNN) can automatically produce a feature-extracting procedure without the handmade extracting step by human, which can meet the requirement of more challenging classification and detection tasks.Zhou et al. (2017) applied a simple CNN to accomplish the defect classification task and to achieve moderate accuracy compared to concurrent methods with manually made feature extracting steps, but with much more efficiency.To solve the problem of detecting extremely large-scale and small-scale defects, scholar (Cheng, X., & Yu, J, 2020) combined RetinaNet with adaptively spatial feature fusion and channel attention mechanism, to more effectively utilize the information from the shallow layer and to improve the overall detection accuracy.Gao et al. (2020) proposed a semi-supervised learning method based on the simple design CNN, to solve the lack of labeled datasets for defects of the steel surface.X. Liu and Gao (2021) proposed the RAF-SSD model based on the SSD, in order to develop a detection model with moderate performance compared with concurrent algorithms, such as you look only once (YOLO) and region convolutional neural network (R-CNN), but with fewer parameters, which satisfies the requirements of real-time defect detection for steel surfaces.X.Sun et al. (2019) proposed an improved faster R-CNN in order to make the original faster R-CNN lighter while maintaining the detection accuracy, which can satisfy the requirement the real-time detection for steel surfaces.Kou et al. (2021) combined the YOLOv3 and the specially designed Dense_block, which can meet the speed requirement for steel surface defect detection as a result of the anchor-free mechanism of YOLOv3 as well as the higher detection accuracy compared with the baseline because of the specially designed dense block.Guo et al. (2022) put forward the MSFT-YOLO based on YOLOv5 and Transformer, which can solve the problem of scale variation in surface defect images effectively.However, the speed of the proposed method is much lower than the original YOLOv5 and is not suitable for real-time defect detection tasks.Damacharla et al. (2021) proposed the transfer learning-based U-net (TLU-Net) framework, consisting of both the residual block as well as the densely connected structure.The proposed method performs better in defect detection as well as in the segmentation of the defects.Guan et al. (2020) put forward a novel recognition algorithm named VSD, consisting of VGG19, DVGG19, SSIM, and the decision tree.The experiments show that the proposed model performs well in the detection of steel defects and has a high speed for the network to converge.However, the VSD has a huge network structure and costs considerable computational sources, which is not suitable for the real-time detection task.Y. Liu et al. (2019) put forward a periodical defect detection method based on a specially designed convolutional neural network (CNN) and long short-term memory (LSTM).The specially designed CNN is responsible for the feature-extraction work from the input images of the defects on the steel surfaces, while the LSTM needs to recognize the type of defects.The proposed model can achieve high detection accuracy but is only suitable for images of high quality, which means the method might not be suitable for the detection tasks conducted in more complicated environments.

4The majority of the deep learning-based techniques mentioned above merely work to increase the overall detection accuracy.The majority of researchers, however, are unaware of how difficult it is to detect crazing and rolled-in scale on steel surfaces.Most concurrent algorithms based on deep learning have detection accuracy that is already rather good for other sorts of defects, but for crazing and rolled-in scale, these algorithms have far lower detection accuracy, which could lead to major production-related catastrophes.Therefore, aiming at improving the detection accuracy of crazing and roll-in scale, we propose a supervised spatial-attention module (SSAM) and combine it with YOLOv5.We introduce the specially designed spatial-attention module with BCELoss to the YOLOv5 to strengthen the area of objects while suppressing the area of the background.Besides this, to further reduce the influence brought by the complex background, we changed the training strategy of YOLOv5 and canceled the mosaic operation.Our experiments show that the new model, named SSAM-YOLO, can reach an accuracy of 72.5% mAp@0.5 on the NEU-DET dataset, which is 3.2% higher than the original YOLOv5.Besides this, the increases of AP@0.5 for crazing and rolled-in scale are 7.3% and 3.02%.

5In summary, the main contributions of this paper are:

61. Addressing the unnoticed problem of low detection accuracy for crazing and rolled-in scale by the concurrent algorithms.2. Putting forward the SSAM, which can effectively strengthen the region of the defect while suppressing the region of the background.

7The rest of this paper is organized as follows: an introduction of the proposed algorithm, the experiments and analysis of the results, and conclusions.

MeTHOD

8Figure 2 depicts the SSAM-YOLO's framework.We change the CSPDarknet's structure by placing the three SSAM after the backbone outputs.The mask operation will be applied to the photos first, after which the raw image with the associated masked images and labels will be loaded.To obtain the predicted feature maps and the weight matrix displayed in Figure 2, the network will be fed with the raw pictures.The predicted feature maps and the weight matrix will be used to compute the loss with the labels and the masked images.

YOLOv5

9YOLOv5 is an improved model based on the YOLOv4 model (Bochkovskiy, A. et al., 2020).It is the fifth version in the YOLO series (Redmon et al., 2016;Redmon & Ali, 2017, 2018) The focus part achieves the channel-extension operation by extracting the values of pixels four times, and each time the pixels are different.The existence of focus part can extend the number of channels without convolution operation and can increase the speed.The spatial pyramid pooling (SPP) block is applied in the bottom of the backbone to achieve the function of multi-scale prediction.The FPN structure takes the three outputs of the backbone and conducts the feature enhancement, producing feature maps with multi-scale information.The FPN will produce three enhanced feature maps, which will be transferred to the YOLO head for predicting the types and positions of the defects.

The Supervision Spatial-Attention Module

10The spatial-attention mechanism (SAM) was proposed by Woo et al. in 2018Woo et al. in (2018)), which is based on the selective visual attention of humans.The attention mechanism can automatically make the network focus on the region which is supposed to be important.In the object detection of the steel surface defect, not every part of the region needs to be focused, and only the rectangular area with defects contains important features.As we can see in Figure 1, the similarities between the background region and the region of the defect are high for images of crazing and rolled-in scale, which means the detection process, like the eyes of a human, may easily ignore the existence of the defects.Therefore, in order to avoid the confusion of the background and the objects, attention is needed.The structure of the SSAM based on the spatial-attention mechanism is shown in Figure 4.The SSAM contains two steps.In the first step, the number of input image channels, with a size of H W C × × , need to be reduced.The MaxPool and AvgPool operations produce two feature maps with one channel, and then the two outputs are concatenated to produce the final onedimensional feature map called the weighted matrix.In the second step, the input is directly multiplied by the weighted matrix, and the shape of the final output is still H W C × × .The H W × pixels of the input feature consist of pixels representing the information of objects and pixels representing the information of the background.Our focus is only the area of the objects, and the weight matrix, with every element ranging from 0 to 1 can sufficiently strengthen the region of defects as well as suppress regions of background.In order to further optimize the parameter updates, we designed a loss function for the spatialattention blocks.We name the additional loss function as the spatial-attention loss (SPLoss), and the detailed process will be in the following context.In the original loss function of YOLOv5, the prediction value is the three outputs of the YOLO head, and the true value is the information about the bounding boxes and classes in the labels.For the SPLoss, we define the weight matrix as the predicted value in the computation of loss.

11To define the true value of SPLoss, we first conduct the masking operation on the selected NEU-DET datasets.Precisely, we set the value of the pixels inside the bounding box to 255 and to 0 for other regions, and every image in the dataset has a corresponding masked image.The masking operation is shown in Figure 4. Secondly, the masked images and their corresponding images are loaded together and experience the same operations of data enhancement.Originally, the raw images, the classes of defects, and the information of bounding boxes would be loaded.Now, before the above three, the masked image will also be loaded.

12For the weight matrix, it is hoped that the value of the pixels in the region containing the defects is 1, and 0 for other regions, by which we can suppress the useless information.In the data processing of the masked images, we finally get a matrix with a size of H W × ×1 , which has a shape as the same as the weight matrix.This matrix is defined as the reference matrix, shown in Figure 4.The value of the weight matrix after the data enhancement, ranges from 0 to 1, and is different from that of the reference matrix.It is hoped that the weight matrix can be closer to the reference matrix.Therefore, a classification loss is applied to evaluate the similarity between the weight matrix and the reference matrix.

13More precisely, we applied binary crossentropy loss (BCELoss), because it is preferred that the value of the elements of the weight matrix is only 0 or 1.In Figure 4, we define the input with a size of H W C × × , and now we use x to denote the input.MaxPool(.)represents the maximum pooling ( ) represents the average pooling.The mathematical representation of maximum pooling is shown in Equation 1, where y k ij denotes the maximum pooled output value in the rectangular region R ij associated with the k th feature map; x k pq denotes the element in the rectangular region R ij located at (p,q) and k represents the individual layer of the C-channel feature maps.Element i, j represents the coordinates of a divided region of the feature maps.The mathematical representation of the average pooling is shown in Equation 2, where R ij represents the number of elements in the rectangular region R ij .The final weight matrix is represented by Spa(x), having H W × elements.The reference matrix is represented by y, also having H W × elements.The reference matrix y are the outputs of the masked images after the operation of data augmentation as well as the resizing to the same size as that of the weight matrix, and the process is shown in Figure 4.The BCELoss function is shown in Equation 3, where the Spa x i ( ) represents the element in the matrix Spa(x) with a size of H W × and y i represents the element of the reference matrix.The addition of the loss function can add the gradient backward for the spatial-attention module, which can help the parameter updating, thus, improving the detection accuracy:

Overall Loss Function of the Proposed Method

14The overall loss function of our proposed method is the combination of the loss function for the original YOLOv5 and that for the spatial-attention mechanism.For the general object detection task, the class of defects and the position should be considered to completely evaluate the accuracy of detection.Precisely, the YOLO loss is composed of classification loss, localization loss, and confidence loss.For localization loss, YOLOv5 adopts the CIouLoss (Redmon et al., 2017), which is illustrated in Equation 4. Variables A and B represent the area of the prediction box and the true box, where b and b gt each denotes the centroids of the prediction box and the true box, ρ denotes the Euclidean distance between the two centroids, and c denotes the diagonal distance between the minimum closure regions of the prediction box and the true box.Variable α is the weight parameter, and v is used to measure the consistency of the aspect ratio.For classification loss, the CELoss is applied, and the equation is shown in Equation ( 5), where y i is the label of the input sample, and σ x i ( ) is the predicted value.For the localization loss, it is applied to evaluate the reliability of the prediction box, and the calculation equation is the same as the CELoss.The total loss is shown in Equation 6, where a, b, and c are, respectively, the weights of different types of loss for the original YOLOv5:

eXPeRIMeNTS

15The experiments are all implemented on an Intel Core i9-12900H CPU (2.5GHz,3.2GBRAM) and an NVIDIA GeForce RTX 3090 GPU (CUDA version 11.6) using Python 3.8.10(PyTorch 1.13.0) in Windows 11.

16The experiments adopt the SGD optimizer, initialize the learning rate to 0.001, and set the batch size and the epoch to 8 and 300.

Computational Platform

17The experiments are conducted in the Windows 11 operating system.The compiled environment involves PyTorch 1.15.1,Python 3.8, and CUDA 11.5.The hardware contains the Inter Core i9-12900H and NVIDIA RTX3060.

evaluation Index

18To test whether our purposed method can improve the detection accuracy of crazing and rolled-in scale, we use the average precision (AP), which is shown in Equation 7. Variable P represents the precision, which reflects the accuracy of prediction, and R represents the recall, which reflects the completeness of prediction.For the object detection task, the higher the mAP and AP are, the better the performance will be:

19Besides this, the detection accuracy of other types of defects is also important; thus, the mean average precision (mAP) is also considered, which is shown in Equation (8).

Ablation experiments

20For the data enhancement of YOLOv5, it has the operations of mosaic, cutout, etc.As we have previously mentioned, the similarity between different types of defects is high.As we can see from Figure 1, these types of defects have similar gray colors, and they are all hard to distinguish from the background.Thus, the similarities between different types of defects and between the defects and the background are high.The mosaic operation in the data augmentation will cause confusion of different types of defects and needs to be canceled.The result is shown in Table 1.As we can see from Table 1, the cancellation of the mosaic operation can improve the AP@0.5 by 2.75% and 1.64% for crazing and rolled-in scale.

21Compared with the original YOLOv5, our proposed models with different degrees of optimization have been tested on NEU-DET datasets, and the experimental results are shown in Table 2.It shows that after the addition of SAM, the APs of crazing and rolled-in scale have been increased by 4.27% and 1.26%.The improvement is a result of the feature suppression in useless regions without the defects.Then, after the addition of SSAM, the AP of crazing increases by 7.3%, and for the rolled-in scale, it increases by 3.02% compared to the baseline.

22The reason why the change of loss function can improve the detection accuracy is naturally the optimization of the parameters' updating of the original SAM.In the YOLOv5, the loss function is only related to the parameter updating for the CSPDarknet, FPN, and YOLO head.However, no specific loss function is related to the parameters in SAM, which means the gradient propagation of SAM only depends on the direction of gradient propagation of the original network structure of YOLOv5.Therefore, the SSAM optimizes the SAM by adding a specifically designed SPLoss to the original loss function of the network, which can improve the process of the gradient propagation for the SAM, i.e., the parameters' updating of SAM is supervised.

The Comparison experiments

23We also conducted comparable experiments on SSD (W.Liu et al., 2016), YOLOv3 (Redmon et al., 2018), and faster R-CNN on the same dataset.Each network is trained on the same training set and tested on the same test set.The experimental results are shown in Table 3.The test results are shown in Figure 5, where we can see that the SSAM-YOLO performs best in the localization of the defects among the main stream algorithms.

24As we can see from Table 3, our proposed method performs best among the selected main stream algorithms.For the detection accuracy of crazing and rolled-in scale, our method is superior than SSD, YOLOv3, and YOLOv7-tiny.The faster R-CNN performs better in the detection of crazing, but its accuracy of rolled-in scale is a lot lower than ours.

CONCLUSION

25To improve the detection accuracy of the crazing and rolled-in scale in steel surface detection tasks, we proposed a supervision spatial-attention module (SSAM) and combine it with the YOLOv5, named SSAM-YOLO.The introduction of SSAM to the YOLOv5 can help strengthen the region of defects and suppress the region of the steel surfaces without defects.The addition of the SPLoss to the original loss function of YOLOv5 can optimize the process of parameters' updating of the spatial-attention module, and achieve higher detection accuracy, especially for the crazing and rolledin scale.Besides, to reduce the confusion between different types of defects and between defects and the background, we cancel the mosaic operation in the data augmentation process.By testing on the NEU-DET dataset, the SSAM-YOLO increases the AP for crazing by 7.3% and 3.02% for the rolled-in scale, which shows that our model truly improves the detection accuracy of the crazing and rolled-in scales.We also compare our model with other methods used for defect detection, such as YOLOv3 and SSD.The results show that our model has better performance than these mainstream algorithms.

26In future studies, we will add a new type of mosaic operation that only combines the images of the same defects, by which we can enlarge the datasets without causing confusion between different types of defects.Besides this, we also need to combine our proposed SSAM with other algorithms and test the methods on other surface defect datasets to verify the robustness of our proposed module.

ACKNOwLeDGMeNT

27The author would like to thank the editor and anonymous reviewers for their contributions to improving the quality of this paper.

Figure 1 .

28Figure 1.Different types of surface defects of the steels: crazing, inclusion, patches, pitted surface, rolled-in scale, and scratches

29and one of the representative one-stage object detection algorithms.The concurrent automated methods for steel surface defect detection are mainly based on machine learning and deep learning.The accuracy of the machine-learning-based algorithm depends highly on the manually designed feature-extracting model.In other words, machine-learning-based algorithms are less automatic than deep-learningbased algorithms.The network structure of YOLOv5 contains a backbone featuring pyramid networks (FPN;Lin et al., 2017) and a YOLO head.The backbone of YOLOv5 is CSPDarknet53(Redmon et al., 2018), which is responsible for extracting information from the raw images of the steel surface and outputs the feature map of images containing the information to describe the characteristics of the feature.The structure of CSPDarknet53 is shown in Figure3.The structure of the backbone is a combination of the focus part and ResBlocks.The focus part is applied to extend the number of channels of the input RGB images without losing the information, which is different from the convolution operation.

Figure 2 .

30Figure 2. The network structure of SSAM-YOLO

Figure 3 .

31Figure 3.The network structure of YOLOv5

Figure 4 .

32Figure 4.The structure of SSAM

33is the dataset we used for training.It is a surface defect database collected by Northeastern University (NEU), containing six kinds of defects of the hot-rolled steel strip.These defects are crazing (Cr), inclusion (In), patches (Pa), pitted_surface (Ps), rolled-in_scale (Rs), and scratches (Sc).The dataset contains 1,800 images, and each defect type has 300 images.The size of the image is 200 200 × .The ratio of the training set and test set is 9:1.

참고문헌 31건

  1. Detection of defects in colour texture surfaces Machine Vision and Applications · Springer Science+Business Media · 1994
  2. Development of an inspection system for planar steel surface using multispectral photometric stereo Optical Engineering · SPIE · 2013 10.1117/1.oe.52.3.039701
  3. Automatic Defect Detection on Hot-Rolled Flat Steel Products IEEE Transactions on Instrumentation and Measurement · Institute of Electrical and Electronics Engineers · 2012 10.1109/tim.2012.2218677
  4. A Review of Recent Advances in Surface Defect Detection using Texture analysis Techniques ELCVIA Electronic Letters on Computer Vision and Image Analysis · Computer Vision Center Press · 2008 10.5565/rev/elcvia.268
  5. Texture Exemplars for Defect Detection on Random Textures Lecture notes in computer science · Springer Science+Business Media · 2005 10.1007/11552499_46
  6. Review of vision-based steel surface inspection systems EURASIP Journal on Image and Video Processing · Springer Nature · 2014 10.1186/1687-5281-2014-50
  7. SSD: Single Shot MultiBox Detector Lecture notes in computer science · Springer Science+Business Media · 2016 10.1007/978-3-319-46448-0_2
  8. Feature Pyramid Networks for Object Detection 2017 10.1109/cvpr.2017.106
  9. YOLO9000: Better, Faster, Stronger 2017 10.1109/cvpr.2017.690
  10. Classification of surface defects on steel sheet using convolutional neural networks Materiali in tehnologije · Institute of Metals and Technology · 2017 10.17222/mit.2015.335
  11. Steel surface defects recognition based on multi-type statistical features and enhanced twin support vector machine Chemometrics and Intelligent Laboratory Systems · Elsevier BV · 2017 10.1016/j.chemolab.2017.10.020
  12. CBAM: Convolutional Block Attention Module Lecture notes in computer science · Springer Science+Business Media · 2018 10.1007/978-3-030-01234-2_1
  13. Review of Aluminum-To-Steel Welding Technologies for Car-Body Applications Metals · Multidisciplinary Digital Publishing Institute · 2019 10.3390/met9030315
  14. Surface Defects Recognition of Wheel Hub Based on Improved Faster R-CNN Electronics · Multidisciplinary Digital Publishing Institute · 2019 10.3390/electronics8050481
  15. You Only Look Once: Unified, Real-Time Object Detection 2016 10.1109/cvpr.2016.91
  16. Periodic Surface Defect Detection in Steel Plates Based on Deep Learning Applied Sciences · Multidisciplinary Digital Publishing Institute · 2019 10.3390/app9153127
  17. A semi-supervised convolutional neural network-based method for steel surface defect recognition Robotics and Computer-Integrated Manufacturing · Elsevier BV · 2019 10.1016/j.rcim.2019.101825
  18. A Steel Surface Defect Recognition Algorithm Based on Improved Deep Learning Network Model Using Feature Visualization and Quality Evaluation IEEE Access · Institute of Electrical and Electronics Engineers · 2020 10.1109/access.2020.2979755
  19. A robotics and computer-aided procedure for defect evaluation in bridge inspection Journal of Civil Structural Health Monitoring · Springer Science+Business Media · 2020 10.1007/s13349-020-00395-3
  20. Experimental and numerical investigation of corroded steel columns subjected to in-plane compression and bending Thin-Walled Structures · Elsevier BV · 2020 10.1016/j.tws.2020.106735
  21. A steel surface defect inspection approach towards smart industrial monitoring Journal of Intelligent Manufacturing · Springer Science+Business Media · 2020 10.1007/s10845-020-01670-2
  22. SSD: Single Shot MultiBox Detector Lecture notes in computer science · Springer Science+Business Media · 2016 10.1007/978-3-319-46448-0_2
  23. RetinaNet With Difference Channel Attention and Adaptively Spatial Feature Fusion for Steel Surface Defect Detection IEEE Transactions on Instrumentation and Measurement · Institute of Electrical and Electronics Engineers · 2020 10.1109/tim.2020.3040485
  24. Surface Defect Detection Method of Hot Rolling Strip Based on Improved SSD Model Lecture notes in computer science · Springer Science+Business Media · 2021 10.1007/978-3-030-73216-5_15
  25. Development of a YOLO-V3-based model for detecting defects on steel strip surface Measurement · Elsevier BV · 2021 10.1016/j.measurement.2021.109454
  26. TLU-Net: A Deep Learning Approach for Automatic Steel Surface Defect Detection 2021 10.1109/icapai49758.2021.9462060
  27. Visual techniques for defects detection in steel products: A comparative study Engineering Failure Analysis · Elsevier BV · 2022 10.1016/j.engfailanal.2022.106047
  28. MSFT-YOLO: Improved YOLOv5 Based on Transformer for Detecting Defects of Steel Surface Sensors · Multidisciplinary Digital Publishing Institute · 2022 10.3390/s22093467
  29. Personalized Course Resource Recommendation Algorithm Based on Deep Learning in the Intelligent Question Answering Robot Environment International Journal of Information Technologies and Systems Approach · IGI Global · 2023 10.4018/ijitsa.320188
  30. Personalized Education Resource Recommendation Method Based on Deep Learning in Intelligent Educational Robot Environments International Journal of Information Technologies and Systems Approach · IGI Global · 2023 10.4018/ijitsa.321133
  31. Method of Fault Self-Healing in Distribution Network and Deep Learning Under Cloud Edge Architecture International Journal of Information Technologies and Systems Approach · IGI Global · 2023 10.4018/ijitsa.321753