A steel defect detection method based on edge feature extraction via the Sobel operator
산업용 섬유 · (9) 타이어코드
기본 정보
- 저자
- DOI
- 10.1038/s41598-024-79205-5
- 저널
- Scientific Reports
- 발행년도
- 2024
- 발행기관
- Nature Portfolio
- 피인용수
- 20
- 라이선스
- cc-by-nc-nd
- 논문 유형
- –
- 언어
- –
- 원문 페이지
- https://doi.org/10.1038/s41598-024-79205-5
- 토픽
- Surface Roughness and Optical Measurements
- OpenAlex ID
- W4404282763
평가 내용
- 관련도
- 사업분야
- 산업용 섬유 · (9) 타이어코드
- 부 분야
- –
- R&D 측면
- –
- 확신도
- –
- 근거 용어
- –
- 판단 근거
- 임베딩 유사도 기반 평가로 '산업용 섬유 > 타이어코드' 분야에 선정된 논문입니다.
- R&D 활용 포인트
- –
- 평가 입력
- –
초록
본문 71,166자
본문 펼치기
섹션 본문 75문단 · 48,996자
(제목 없음)
1Scratches and cracks in steel severely affect its service life and performance.However, owing to the irregular shapes and sizes of steel surface defects, defects within the same class may be different, whereas defects between classes may be similar.Existing methods focus only on spatial information, resulting in low detection accuracy.To alleviate these problems, this paper proposes the ECDY (EIFEM CARAFE DyHead) network to enhance the detection capability of steel defects.We first design a feature extraction module that focuses on the edge information of feature contours.This module uses the Sobel operator to extract the edge information of a feature and fuses it with the overall spatial information so that richer semantic information can be obtained.The module has improved accuracy in the YOLOv5, YOLOv8, and YOLOv10 versions, and uses fewer parameters and calculations.In particular, in YOLOv8x, mAP@0.5 increased by 2.5%, and the number of parameters was reduced by 12.4 M. Second, to retain the detailed information in the feature pyramid, and to better reconstruct features, we choose the content-aware reassembly feature method (CARAFE) as the upsampling method.Finally, the detection head was replaced with a dynamic unified detection head (DyHead) to adapt to different defect sizes and different task requirements.Compared with YOLOv8s, the proposed method improves precision by 1.6%, recall by 4%, and
2(EIEConv) by using the Sobel operator 8 in convolution.EIEConv extracts the edge contour information of the image by calculating the horizontal and vertical directions; it then removes irrelevant information and retains important structural information.The Sobel operator is a combination of Gaussian smoothing and differential operations 9 , so it has strong noise resistance and a smoothing effect on the noise in the dataset.EIFEM fuses the edge information extracted by EIEConv, and the spatial information extracted by the convolution branch, to obtain richer semantic information while ensuring a small number of parameters.The module has improved accuracy in the YOLOv5, YOLOv8, and YOLOv10 versions, and the number of parameters and calculations have been greatly reduced.
3To further improve the accuracy of steel defect detection, and reduce the number of model parameters, we design an ECDY (EIFEM CARAFE DyHead) network based on YOLOv8s.First, we replace the BottleNeck of C2f with the EIFEM module we designed.Compared with C2f, the improved module can smooth the noise in the grayscale image and obtain rich information on the fusion of edge information and spatial information; second, to obtain more accurate feature reconstructions, we replace the upsampling method with the upsampling method of content-aware reassembly features.This method can learn the convolution kernel suitable for its feature information through the encoder to guide a more accurate feature reconstruction; finally, the original detection head is replaced with a dynamic unified detection head to address different defect sizes and change positions.Because of this detection head, we can dynamically adapt to different sizes, positions, and tasks without changing the detection head.
Related work Traditional steel testing methods
4Traditional steel inspection methods include manual sampling, magnetic flux leakage inspection, and infrared inspection 10 .Manual sampling mainly involves employees taking steel samples for visual inspection.This method is not only time-consuming and labour-intensive but also has some minor defects that may be overlooked by the human eye.Magnetic flux leakage inspection mainly detects magnetic fields on steel surfaces.If the magnetic field on the surface of steel changes, that is, a magnetic flux leakage occurs, it means that there are defects on the steel surface.However, although this method is much more efficient than manual sampling, many minor defects, such as plaques and small pits, may be missed.Infrared inspection determines whether there are defects on the basis of the change in the temperature of the steel surface.Compared with the first two methods, infrared inspection is more accurate, but because steel has different infrared absorption capabilities, it may misjudge the type of defect.Traditional inspection methods not only require considerable manpower but also have extremely low efficiency and accuracy, making it difficult to detect defects in time.
Target detection methods
5In recent years, the rapid development of deep learning has set off a wave in various fields.Compared with traditional methods, deep learning-based object detection algorithms automatically extract features for defect detection through convolutional neural networks 11 , which not only saves considerable manpower but also greatly improves accuracy and real-time performance.At present, deep learning-based object detection algorithms can be divided into two main categories: two-stage detection algorithms and one-stage detection algorithms.
6A two-stage detection algorithm is divided into two stages.The first stage extracts the regions of interest and then classifies and regresses these regions.The main representative algorithms are the RCNN and Faster RCNN series.To effectively apply these target detection algorithms to the field of steel defect detection, He et al. 12 proposed a multilevel feature fusion network (MFN) to fuse multiple layers of features.This fusion operation enables richer semantic information to be obtained, and a region proposal network (RPN) is used to generate regions of interest.A defect detection dataset, NEU-DET, was established, which has promoted research on steel defects.Akhyar et al. 13 used R-CNN as the backbone network and improved it through deformable convolution and deformable RoI pooling to adapt to the location and size of the defects, and to locate the defects more accurately.To improve the detection rate, Li et al. 14 first performed a data enhancement on the NEU-DET dataset, improved the Faster R-CNN and FPN networks, and used multiscale feature fusion to encourage the reuse of low-level features, thereby enhancing the detection effect of small defects.
7Unlike the two-stage detection algorithm, the one-stage detection algorithm directly predicts the category and position of the bounding box in the network at the same time without generating candidate regions separately.This integrated design simplifies the processing flow and improves the detection speed.The main representative algorithms include SSD, RetinaNet, FCOS, CenterNet, YOLO series, etc. Akhyar et al. 15 used feature pyramid networks and focal loss optimization based on RetinaNet to alleviate the problems of too few defect targets and imbalanced foreground and background samples to a certain extent.To consider the accuracy of the defect category and location, Cheng et al. 16 embedded a novel channel attention mechanism based on RetinaNet to prevent information loss, and used an adaptive spatial feature fusion module to fuse shallow and deep features.To achieve a balance between accuracy and speed, Tian et al. 17 proposed an expansion feature enhancement model based on CenterNet, expanded the receptive field, and proposed a new centre point function for more accurate keypoint detection.Kou et al. 18 introduced their dense convolutional blocks into the YOLOv3 model to extract rich feature information and to enhance the representation ability of the network.To improve the learning ability of complex textures and defect scale changes, Guo et al. 19 added the TRANS module based on the Transformer design to the backbone network and detection head of YOLOv5, enhancing the dynamic adjustment of the detection head to defects of different sizes.Yang et al. 20 used Real-ESRGAN to enhance image resolution, effectively alleviating the tiny defect challenges in the steel defect dataset, and designed a module based on CBAM and SCSE attention to promote the fusion of channel information and spatial information, and to improve the expression ability of the model.To eliminate the negative impact of NMS on the speed and accuracy of the YOLO model, Zhao et al. 21proposed the RT-DETR model, which processes multiscale features by decoupling intrascale interactions and cross-scale fusion to improve speed, and proposed the minimum uncertainty query selection to improve accuracy.
8In summary, traditional steel inspection methods and object detection methods each have certain limitations and drawbacks.Traditional inspection methods primarily consist of manual sampling and automated methods, which are time-consuming and labor-intensive, with low detection accuracy and a propensity for false positives, making real-time defect detection challenging.Existing object detection methods, which are mainly one-stage and two-stage detection algorithms, have indeed improved detection accuracy compared to traditional methods, but there is still room for improvement.Moreover, these methods often fail to detect smaller defects.Therefore, this paper proposes a defect edge detection algorithm specifically tailored for steel defects to accurately locate imperfections.
Methods
9To learn richer image features and obtain more important edge information in steel defect detection, we propose the EIFEM module, which has been improved in YOLOv5, YOLOv8, and YOLOv10.In addition, we designed an ECDY network based on YOLOv8s, which has the highest indicators compared with those of other mainstream models.We introduce the designed EIFEM module in the first section and the designed ECDY network in the second section.
EIFEM module
10Since the steel defect detection dataset is a grayscale image, and the various defects are of different sizes and irregular shapes, special attention needs to be given to the contour information of the defects.To more effectively identify defects in steel, and accurately classify them, we propose a new EIFEM module, which is designed to be an efficient front-end module in image recognition tasks.While learning edge information, it has a certain resistance to noise in the steel defect dataset.First, the module extracts the edge contour information of the image features through the edge information extraction convolution (EIEConv), which we designed.Second, it extracts spatial information through a convolution branch, and then fuses the features extracted from the two parts to learn a richer image feature representation.The EIFEM structure diagram is shown in Fig. 1.
Edge convolution branch
11Convolutional neural networks (CNNs) are generally good at learning spatial information but may be slightly insufficient for extracting edge information from images.Despite the prowess of CNNs in feature extraction, they may introduce unwanted background details when capturing subtle or faint edges 22 .Edge information often requires a finer spatial resolution and sensitivity to detail, yet the convolutional layers of CNNs can blur certain image details 23 , especially after multiple convolutions and pooling operations.Given the presence of numerous minute defects in steel, precise localization of defect edges is crucial.The proposed algorithm in this paper targets the detection of steel defect edges to accurately pinpoint imperfections.We explicitly extract the edge contour features of the image through the edge convolution branch.Since the datasets used for steel defect detection are all grayscale images, the edge contour information is particularly important.Edge information refers mainly to the most significant grayscale changes in an image 24 .These significant changes often reflect important changes in attributes, such as surface direction discontinuity, depth discontinuity, material attribute changes, and scene light changes.Edge detection 25 is a research field in feature extraction.Image edge detection reduces a large amount of data, eliminates irrelevant information, and retains important structural attributes of the image.This approach is highly important for steel defect detection and the identification of the defects and their categories.The edge detection operator uses the sudden change in the grayscale of the image edge to detect the edge contour information.Among the various edge detection operators, the Roberts, Prewitt, Laplacian, Canny, and Sobel operators stand out.The Roberts operator, while simple, can miss edges, lacks noise suppression, and is not precise in edge localization.The Prewitt operator, though straightforward, offers some noise resistance but may result in a coarse edge representation, neglecting the impact of the proximity of neighboring pixels to the current pixel.The Laplacian operator excels at detecting subtle edges but is susceptible to noise, potentially leading to a significant noise response and the loss of directional edge information.The Canny operator is adept at producing fine edges and effectively suppresses noise, yet its complexity and computational demands are considerable.The Sobel operator, on the other hand, balances these considerations, offering superior performance on noisy images and accurate edge localization.Although it may not match the Canny operator in detection precision, its simplicity makes it ideal for real-time applications.Consequently, after a thorough evaluation, we opt for the Sobel operator to conduct edge detection.
12The Sobel operator is a classic edge detection filter 26 that can effectively capture sudden changes in the intensity of an image, thereby obtaining important edge information.The Sobel operator contains two sets of 3 × 3 filters, which extract edge-sensitive information in the horizontal and vertical directions.The Sobel operator reaches the extreme value at the edge on the basis of the weighted difference in the grayscales of the upper and lower, and the left and right, neighbouring points of the pixel 27 , thereby effectively detecting the edge.The Sobel operator is a combination of Gaussian smoothing and differential operations, so it has a smoothing effect on noise, and provides more accurate edge direction information.It is a more commonly used edge detection method.
13The edge information extraction convolution (EIEConv) we designed applies the Sobel operator to the weight of the 3D convolution to perform edge detection in the horizontal and vertical directions.The convolution structure diagram is shown in Fig. 2. The 3D convolution is chosen because the traditional convolution traverses all the channels to extract horizontal and vertical features at a slow speed.The Sobel operator contains two 3 × 3 matrices S x , S y , and S x , S y as shown in Eq. ( 1).Expanding S x , S y to five dimensions, that is, B × C × D × 3 × 3, is used as the weight of the 3D convolution W x , W y , where B is the batch size, C is the number of channels, and B and C are consistent with the input image.The input image is also added with the depth dimension to the fivedimensional image and multiplied by W x , W y ; the horizontal edge detection result is G x = W x × A ex , where A ex is the expanded original image; and the vertical edge detection result is G y = W y × A ex .Therefore, the final output after EIEConv is G = G x + G y , and the depth dimension in G is removed to return it to the dimension of the original input image, that is, B × C × H × W, the output feature size dimension is the same as the input.
Spatial convolution branch
14In addition to the edge contour information, the spatial information in the steel defect images is equally important.
15The EIFEM module extracts spatial information through an additional spatial convolution branch.Unlike the edge convolution branch, the spatial convolution branch extracts the features of the original image and can retain rich spatial details.Spatial convolution is through the CBS module, which consists of a convolution layer, a batch normalization layer, and an activation function.The spatial convolution branch plays a role in extracting Fig. 2. EIEConv structure diagram (the input features are extracted through an x-direction convolution and y-direction convolution to extract the horizontal and vertical information, respectively, and finally fused to obtain the edge contour information, and the output feature size dimension is the same as the input).
16spatial features and enhancing the model's expression capabilities in the EIFEM module.The structure of this module is shown in Fig. 3.
Feature fusion
17The edge contour information extracted by the edge convolution branch, and the spatial information extracted by the spatial convolution branch.are fused to form semantically rich feature information.These two parts of information are then added to the initial information after deeper information is extracted through convolution and then sent to the convolution module, which helps to learn the residual information and improves the training stability.This fusion operation allows the learned features to retain the structural properties of steel defects while learning rich spatial information.
ECDY network
18In response to the need for steel defect detection, we design the ECDY network to further improve the accuracy of steel defect detection and reduce the number of calculations.The model structure diagram is shown in Fig. 4.
19The network is improved on the basis of YOLOv8s.First, we replace the BottleNeck in C2F based on the EIFEM module mentioned in the first section to design the C2F_EIFEM module so that the network pays more attention to the edge contour information we need, and has a certain resistance to the noise in grayscale images.Second, to enable the adaptive and more accurate reconstruction of features, we replace the upsampling method with CARAFE, a lighter operator.Finally, a unified dynamic target detection head (DyHead) based on the attention mechanism is used in the head to dynamically adapt to steel defects of different sizes and angles and the needs of tasks.
C2F_EIFEM
20In the C2f module of YOLOv8, rich feature interactions and conversions are achieved through segmentation and multichannel design.However, C2f uses a fixed receptive field.This fixed structure feature extraction lacks the edge information needed for steel defect detection and may introduce noise during training.To solve the above
CARAFE
21The current mainstream upsampling methods are nearest neighbour interpolation and bilinear interpolation 28 , which guide information reconstruction through the feature distance between adjacent pixels.However, nearest neighbour interpolation and bilinear interpolation consider only subpixel neighbourhoods and cannot capture rich semantic information in the global context.Another method to achieve adaptive upsampling is deconvolution; however, it has two major disadvantages.First, the deconvolution operator applies the same kernel to the entire image and cannot change the convolution kernel according to the feature content, which limits the ability to respond to different image changes.Second, when a larger kernel is used, the number of parameters and computational workload will be large.In the steel defect dataset, different types of defects vary greatly in size and shape, and it is difficult for mainstream methods to adaptively respond to changes in defects and reconstruct features.CARAFE (content-aware reassembly of FEatures) 29 is an upsampling method for enhancing convolutional neural network feature maps.The core idea of CARAFE is to use the content of the input features to guide the upsampling process, thereby achieving a more accurate and efficient feature reconstruction.CARAFE can be used in processes that require fine upsampling.The steel defect detection we are conducting attaches great importance to feature details because some defects, such as cracks, are often small and difficult to detect.This method improves the detail preservation and reconstruction quality of the upsampling process, enabling the network to generate clearer and more accurate outputs.
22CARAFE predicts the recombination kernel by using the underlying information at each location and upsampling the area near the location.Owing to the introduction of the underlying information, CARAFE can use adaptive and optimized recombination kernels at different locations, so that even small defects can be considered in steel defect detection.The CARAFE consists of two steps.First, the recombination kernelσ 2 at each target location is predicted, and then, the features are recombined with the predicted kernel, The overall structure of CARAFE is shown in Fig. 6.In the reorganization kernel prediction module, for an input shape of H × W × C, we compress its number of channels to a 1 × 1 convolution C m .The compression step reduces the number of calculations.Given the upsampling ratio of σ, each source position of the input feature must correspond to, a target position.Assuming that the upsampling kernel size is k up × k up , the output we need to predict is
23, and then we expand the channel dimension in the spatial dimension to obtain σH × σW × k 2 up , an upsampling kernel of shape.Then, we normalize the obtained upsampling kernel via softmax so that the sum of the convolution kernel weights is 1.For the nuclear prediction encoder, the encoder needs to have a convolutional layer with a kernel size k encoder × k encoder .Therefore, the parameters of this nuclear prediction encoder should be k encoder × k encoder × C m × C o , which changes the compressed features into H × W × C o , and an increasing k encoder can obtain a larger receptive field and more comprehensive and complete contextual information.However, the number of calculations for increasing the kernel prediction convolution size increases accordingly, and the receptive field does not continue to increase k encoder to a certain range.Therefore, it is necessary to make a balanced adjustment between k up .
24In the feature reconstruction module, for each position of the input feature l(i, j), the corresponding N (X l , k up ) square area is removed, that is, k up × k up , the area centred on l, and the predicted upsampling kernel of the point, are dot products used to obtain the output value.For different channels at the same position, the same upsampling kernel is shared, and the correlation of the channel information is retained, which reduces part of the calculation.
DyHead
25Recent mainstream object detection heads can usually solve only a certain function required by the detection head.However, we hope to have a detection head that can adaptively handle different sizes, spaces, and tasks in a unified manner.In particular, for steel defect detection, such as dense patch defects, there are patch information of different sizes in one image, so a single size cannot meet the needs of diverse objects.Second, the positions and rotation angles of different defects under different lighting and shooting angles are different (such as horizontal scratches, vertical scratches, etc.), which requires the detection head to adapt to different spatial positions.Finally, owing to different task requirements, objects can have different representations (such as bounding boxes, centre points, etc.), and the network for extracting features may be a one-stage algorithm or a two-stage algorithm.These representations and networks have completely different goals and constraints.We expect that steel defect detection can be applied to the needs of different factories, so DyHead 30 is a good choice for our detection task.
26For the concatenation of L different levels of features in a given feature pyramid, we adjust the size of
27, the L levels of features, by upsampling or downsampling to make them close to the scale of the intermediate-level features.The rescaled feature pyramid can be represented as a four-dimensional tensor F ∈ R L×H×W ×C , where L represents the number of layers in the pyramid and H, W, and C represent the height, width, and number of channels of the intermediate-level features, respectively.To reshape the features into three dimensions, we define S = H × W as spatial information, so the reshaped features F ∈ R L×S×C .We began deploying attention mechanisms separately on each dimension.The size-aware attention module is deployed only on the horizontal dimension of the pyramid features.It enhances features at appropriate levels according to the learned information to perceive size information on the basis of the semantics of different levels of pyramidlevel features and the size of each object; the spatial-aware attention module is deployed on the spatial dimension, and the spatial attention module obtains the location information of different objects on the basis of the spatial features; the task-aware attention module is deployed on the channel, and it guides different feature channels to support different tasks according to the different convolution kernel responses of the task objects.Therefore, the attention formula can be expressed as:
28Where π C (•), π S (•), and π L (•) represent the attention functions applied to the channel dimension, spatial dimension, and horizontal dimension, respectively.The processing flow chart of DyHead is shown in Fig. 7.
29Next, we introduce the specific implementation methods of scale-aware attention, spatial-aware attention, and task-aware attention.
Scale-aware attention p L
30Dynamically fuse features at appropriate levels according to the semantic importance of different sizes.The specific formula is as follows:
31Where ϕ (x) is a hard-sigmoid function and where f(x) is a linear function approximating 1 × 1 the convolution layer.
Spatial-aware attention p S
32We use spatial awareness attention to focus on the common areas where features exist in both spatial information and hierarchical information.Because S is a fusion of H × W, we first use variable convolution to sparse a part of the learning features to reduce part of the computation and then aggregate this sparse part to the hierarchical features of the same spatial position.The formula for spatial-aware attention is as follows:
33where N is the number of positions for sparse sampling, l is the position in the horizontal dimension, d n + ∆d n is the position offset after self-learning, ∆d n is the spatial offset, c is the position in the channel dimension, ∆p n is d n an important scalar for self-learning at the position, d n + ∆d n , and ∆p n is learned from the input features of the intermediate level size of F.
Task-aware attention p C
34To adapt to the metrics of different networks and different tasks, task-aware attention is deployed at the end, which dynamically switches the ON and OFF channels of features to adapt to different tasks, Specifically:
35Where F c is the feature slice of the C-dimensional channel, and where α 1 , α 2 , β 1 , β 2 T = θ (•) is a hyperfunction that controls the activation threshold through learning.θ (•), the implementation method first performs global average pooling dimensionality reduction on the L × S dimension, then uses two fully connected layers and a normalization layer, and finally uses the shifted sigmoid function to normalize the output to [− 1,1].For any backbone network to extract feature pyramids, it is further adjusted to the same scale to form a three-dimensional tensor F ∈ R L×S×C , which is then used as the input of the dynamic head.Next, the DyHead block consisting of size perception, space perception, and task perception is stacked in sequence, and the output of the dynamic head can be used for different tasks and representations of object detection.The structure of the DyHead block is shown in Fig. 8.
Experiment
36To verify the effectiveness of our proposed EIFEM module and ECDY network, we apply the proposed EIFEM module to the YOLOv5, YOLOv8, and YOLOv10 versions, compare them with the original models, and compare the results of the ECDY network with those of the most advanced methods.
Dataset
37The dataset used in this paper is the steel defect detection dataset (NEU-DET) released by Northeastern University.The dataset contains 1,800 grayscale images, covering six typical steel surface defects 31 , namely, crazing, inclusion, patches, pitted surface, rolled-in scale, and scratches.The resolution of each image is 200 × 200, and the number of samples of each defect image is 300. Figure 9 shows sample images of six typical steel defects.The figure shows that there are great differences in the number of defects within a class.For example, the shapes of patches may differ, and scratches may come from different directions, resulting in great differences within a class.However, some interclass differences, such as oxide scales, cracks, and pitting surfaces, are very small.It is difficult for our eyes to distinguish the differences between classes from pictures.Under the influence of lighting and material, the grayscale changes of the same defect category may also differ.In addition, there are difficult samples in the dataset.Some small crack models are difficult to detect.In the experiment, the dataset is divided into a training set, a validation set, and a test set at a ratio of 8:1:1.
Evaluation metrics
38To objectively measure the detection performance of the model, this experiment uses evaluation indicators, including precision, recall, and mean average precision (mAP), to measure the accuracy of the model 32 ; parameters are used to measure the size and complexity of the model; and Gflops is used to measure the Fig. 7.The DyHead processing flow chart, that is, the feature pyramid, is reshaped first L × S × C, first through scale-aware attention, then through spatial-aware attention, and finally through task-aware attention to obtain the detection head output.
39execution time of the model 33 .Precision is the proportion of correct targets among the targets detected by the model; recall is the proportion of targets correctly identified by the model among the total number of real targets.The indicator mAP refers to the AP used to measure N categories.When the IoU is set to 0.5, it is called mAP@0.5; in this article, mAP@0.5 and mAP@0.5:0.95(the IoU threshold ranges from 0.5 to 0.95) are used as measurement indicators.The formulas for each indicator are as follows:
40P recision = T P T P + F P (6)
41TP is the number of correctly identified targets, FP is the number of incorrectly identified targets, and FN is the number of missed targets 34 .P(r) represents the smooth precision-recall curve, and the area under the smooth curve obtained by integrating it is the AP.N represents the number of detected object categories, which corresponds to the 6 different steel defects in this paper.
Implementation details
42The computer environment used in this article is composed of Python 3.8, CUDA 11.3, an NVIDIA RTX3090 GPU graphics card, and 30 GB of memory.The training hyperparameters are set as follows: the number of training rounds is 200, the batch size is set to 8, and the SGD optimizer is used.
EIFEM improvements in various models
43To verify the effectiveness of the proposed EIFEM module, we add this module to each version of YOLOv5, YOLOv8, and YOLOv10 for comparison.Specifically, YOLOv5 replaces BottleNeck in its C3 module with the EIFEM module, whereas YOLOv8 and YOLOv10 replace BottleNeck in its C2f module; however, the C2fCIB of YOLOv10 remains unchanged.Our EIFEM module is an efficient module that is mainly used to fuse edge contour features and spatial features, and it can effectively extract edge information from grayscale images.The experimental results are shown in Table 1.From the table, we can see that among the various versions of YOLOv5, only YOLOv5n and YOLOv5m have a map@0.5 that is 1.9% lower after adding EIFEM.In each version of YOLOv8, after adding the EIFEM module, map@0.5 is improved, and the number of parameters and calculations are greatly reduced, which is equivalent to using fewer parameters to achieve better results.In particular, in YOLOv8x, mAP@0.5 increases by 2.5%, and the number of parameters decreases by 12.4 M. In each version of YOLOv10, only YOLOv10l and YOLOv10x reduce their map@0.5 by 1.1% and 2.2%, respectively, but their calculations are greatly reduced in each version.
44Regarding the inferior performance of the EIFEM module when incorporated into YOLOv10 compared to YOLOv8, our analysis identified the following reasons: In YOLOv8, we replaced all BottleNeck components in the C2f with the EIFEM module.However, in YOLOv10, only the BottleNeck modules in C2f were replaced, while the original structure of C2fCIB was retained.It is also noticeable that there are structural differences in YOLOv10's s, m, l, and x models, with the quantity of C2fCIB increasing incrementally, meaning the largest model has the most C2fCIB, thus having fewer opportunities for the integration of C2f_EIFEM modules.Our observations indicate that for the s and m structures, the inclusion of the EIFEM module outperforms the original model, whereas for the l and x structures, the addition of the EIFEM module does not improve performance over the original model.This further confirms our hypothesis.Notably, our main advantage is that we can achieve good results with very few calculations and parameters.Figure 10 shows the comparison of the computational complexity, parameter count, and mAP@0.5 of the EIFEM module added to the N/S/M/L/X versions of YOLOv5, YOLOv8, and the S/M/L/X versions of YOLOv10.For various versions of YOLOv5, we find that the larger the model is, the higher the prediction accuracy will be after the EIFEM module is added, while only a small increase in the number of parameters and calculations is observed.In particular, in YOLOv5-X, mAP@0.5 directly increased by 3.8%; in various versions of YOLOv8, it is not difficult to find that the mAP@0.5 of all versions with the EIFEM module has increased substantially, but the number of calculations and parameters are much lower than before.Notably, in YOLOv8-X, the mAP@0.5 with the EIFEM module is 2.5% greater than before, whereas the number of parameters is reduced by 12.48 M. In YOLOv10, we find that the smaller the model is, the greater the mAP after the addition of the EIFEM module; however, regardless of the version, the number of parameters and calculations are greatly reduced.Therefore, although the EIFEM module designed in this paper produced good results in YOLOv5, YOLOv8, and YOLOv10, it had the best overall performance in YOLOv8.Therefore, we chose to design the ECDY network on the basis of YOLOv8s.The second version is chosen because steel defect detection has certain requirements for real-time performance, so the calculation speed must be guaranteed.
Ablation experiment
45In this section, we conduct ablation experiments to analyse the effectiveness of each key component of ECDY, namely, the edge information feature enhancement module (C2f_EIFEM), content-aware reorganization feature module (CARAFE), and dynamic detection head (DyHead).The experimental results are shown in Table 2.
461. Effectiveness of C2f_EIFEM.EIFEM extracts edge information from images and fuses it with spatial information to obtain richer semantic information about the steel defects.In the convolution of edge information extraction, the Sobel operator is used to add features extracted in the horizontal and vertical directions to reduce the number of calculations, and the Sobel operator has a certain resistance to noise in steel defect images.Through the experimental comparison of No. 0 and No. 1, the mAP@0.5 increases by 1.7%, and the Gflops decreases by 2.8%; the experimental comparison of No. 2 and No. 4 reveals that the mAP@0.5 increases by 3%, and the Gflops decreases by 2.8%; and the comparison of the results of No. 6 and No. 7 reveal that the mAP@0.5 increased by 1.9%, which confirms the effectiveness of the C2f_EIFEM module.This approach Method P (%) R (%) mAP @0.5(%) mAP @0.not only improves the accuracy index but also reduces the number of parameters and improves the running speed.2. Effectiveness of CARAFE.CARAFE guides the upsampling process through the content of the input features themselves, thereby achieving more accurate and efficient feature reconstructions, and by adaptively adjusting the size of the kernel, it accurately reconstructs features while using less computation.For steel defects, the kernel is adaptively adjusted according to the underlying information to guide upsampling so that comprehensive and rich semantic information can be obtained in the feature reconstruction process.A comparison of the No. 1 and No. 4 experiments reveals that the mAP@0.5 increases by 0.7%.Compared with the No. 3 and No. 6 experiments, the mAP@0.5 increases by 1.5%.Compared with the No. 5 and No. 7 experiments, the mAP@0.5 increases by 4.2%, which fully demonstrates the important role of CARAFE in the model.3. Effectiveness of DyHead.DyHead uses the perceptual attention of three parts to adapt to the size, angle, and task of the target; it also reduces the number of parameters and improves the computational efficiency by calculating the attention of the three parts separately.Using perceptual attention for the three parts separately enables the model to adapt to defects of different sizes and defect positions of different viewing angles and rotation directions.A comparison of experiments No. 0 and No. 3 in the table reveals that the mAP@0.5 increases by 0.6%.Compared with the results of experiments No. 2 and No. 6, the mAP@0.5 increases by 2.7%.Compared with the results of No. 4 and No. 7, the mAP@0.5 increases by 1.6%.The amount of calculation is also reduced, which shows the effectiveness and lightness of DyHead.
Comparative test
47To demonstrate the superiority of our designed ECDY network, we compared it with various mainstream models.
48The results are shown in Table 3.Most of the methods in the table are one-stage detection algorithms.According to the detection steps, we divide these methods into two groups: one-stage detection algorithms and two-stage
49No. C2f_EIFEM CARAFE DyHead P (%) R (%) mAP @0.5(%) mAP @0.detection algorithms.Among them, only Faster R-CNN is a two-stage detection algorithm.Compared with the other methods, our ECDY network improves the mAP@0.5 by 9.34%, and the number of Gflops decreases by 174.For the one-stage detection algorithm, ECDY is better than those of all the other networks, with precision reaching 93%, recall reaching 96%, mAP@0.5 reaching 81%, and mAP@0.5:0.95reaching 44.8%.Compared with other networks, ECDY uses very few parameters and calculations to achieve good results.mAP@0.5 is 4% higher than that of the network YOLOv8s on which it is based, and 4.2% higher than the mAP@0.5 of the current SOTA model RT-DETR-L in the field of target detection.mAP@0.5:0.95 is 1.6% higher, the number of parameters is 23.15 M less than it is, and the amount of computation is 24% of it.
50Figure 11 shows the change process of mAP@0.5 during the training process.The figure shows that in the first 100 rounds, the mAP fluctuates; this is because the dataset we selected is relatively complex and contains difficult samples.Before 50 rounds, the mAP of YOLOv10s increases rapidly.Between 50 and 150 rounds, each model reaches a stable state.At this time, RT-DETR-L leads the other models in terms of mAP.In the last 50 rounds, all the models almost stopped improving.The ECDY network we designed still improves.Finally, after 200 rounds of training, the mAP of the ECDY network is much greater than that of the other networks.
51Figure 12 shows the AP comparison between the ECDY network and various mainstream networks in each defect category.The figure shows that for each model, crazing is the most difficult category to predict because some cracks are small and may not be distinguished for light reasons.In addition, it can be seen in the dataset that Method P (%) R (%) mAP @0.5(%) mAP @0. the difference between the crazing and rolled-in scale classes is small, which may lead to model misjudgements.However, our model has the highest prediction accuracy for crazing among all the models.The ECDY network also has a good ability to distinguish difficult samples.Moreover, the prediction accuracy of our model in other categories also surpasses that of other models.Only in the rolled-in scale category is the predicted AP slightly lower than that of YOLOv6s, making it the second most accurate network in this category.Overall, the ECDY network has shown high accuracy in each category, reflecting the superiority of its model.
Qualitative results
52As described in the first part of Sect.3, the EIFEM improves the detection accuracy while reducing the number of parameters by fusing the edge feature information and spatial information.To evaluate the effectiveness of the EIFEM module we designed, the detection effects of YOLOv5s, YOLOv8s, and YOLOv10s with the EIFEM module are compared, and the detection results are shown in Fig. 13.In the crazing category, YOLOv5s did not detect it, but after adding the EIFEM, two bounding boxes were detected in this category.In YOLOv8s, compared with the version with the EIFEM, the inclusion category misdetected places without inclusions, and the addition of the EIFEM module improved the accuracy of the detection box.In YOLOv10s, the crazing category detected a few fewer cracks, and the rolled-in scale category was not detected; however, after adding the EIFEM module, the above problems improved.For easier categories such as inclusions, patches, and scratches, the detection results are similar, but after adding the EIFEM module, the defect location and size can be determined more accurately.In more difficult categories, such as crazing and rolled-in scales, the original model has difficulty detecting these small defects, and our EIFEM can accurately detect the location and shape of these smaller and subtle defects; this is due mainly to the edge detection ability of our module, which can retrieve the edges of subtle defects.
53To further demonstrate the utility of the edge convolutional branch and the spatial convolutional branch in the EIFEM module, we analyzed the feature maps during the feature extraction phase of YOLOv8s and ECDY by visualizing them, that is, visualizing the feature maps of the backbone network's four stages C2f and C2f_EIFEM, and selecting 16 channels of the feature maps for display.The comparison of feature map visualization is shown in Fig. 14.In the stage 2, the features extracted by YOLOv8s and ECDY are not much different, but it can be seen that the features of ECDY are more distinctly three-dimensional; in the stage 4, it can be observed that YOLOv8s blurs some features, and the spatial resolution is not as delicate as ECDY; in the stage 6 and stage 8, it can be seen that ECDY's feature extraction is more concentrated, and the depiction of defect contours is clearer.
54Figure 15 shows a comparison of the detection effects of our designed ECDY network and current mainstream object detection methods on the dataset.In the crazing category, YOLOv5s did not identify defects, YOLOv9e and YOLOv10s missed detections and detected inaccurate positions, and RT-DETR-L detected the same object multiple times, resulting in overlapping detection frames.The ECDY network proposed in this paper had almost no missed detections or false detections.In the inclusion category, YOLOv6s, YOLOv8s, and RT-DETR-L had false detections, detecting normal places as inclusions.In the patches category, YOLOv6s and RT-DETR-L had false detections, detecting some patches as inclusions, and YOLOv8s, YOLOv9e, and YOLOv10s had missed detections.In the pitted surface category, YOLOv5s does not control the size of the border as well as the other models do.Although all of them detected defects, ECDY had the highest confidence.In the rolled-in scale category, YOLOv6s, YOLOv10s, and RT-DETR-L did not detect defects, and YOLOv5s and YOLOv9e missed detections.In the scratch category, all the networks performed well.In summary, in the categories that are well detected, all the networks have good results, but our ECDY model more accurately predicts the size and position of the defect bounding box, and does not have too many predictions of the same target that would cause the detection box to overlap.For categories that are more difficult to predict, such as very small cracks and oxide rolling, many networks, even relatively large networks, have missed detections and cannot detect defects, but the ECDY network proposed in this article can still accurately determine the defect location and size.
55To intuitively analyse the attention area of the ECDY network proposed in this paper, we use a heatmap analysis, as shown in Fig. 16, where the dark red area is the area that the model focuses on.We can observe that ECDY primarily focuses on the information surrounding defects, accurately targeting the defect contours and precisely locating them.Especially in the crazing category, we can see that ECDY can accurately pinpoint very fine scratches, while YOLOv8s cannot precisely locate all defects.This is mainly thanks to our designed EIFEM module, which effectively detects edge information.Moreover, from the inclusion category, we can see that YOLOv8s pays attention to the background information on the left and mistakenly identifies it as an inclusion.In the pitted_surface category, it overly focuses on the upper left corner and the right boundary; this is because noise in these areas causes YOLOv8s to pay attention to these unnecessary backgrounds, whereas ECDY has certain resistance to noise.
Conclusion
56In this paper, we propose an edge information feature extraction module (EIFEM) to learn the edge contour information of steel defects.This module can be adaptively inserted into the network.We insert this module into the YOLOv5, YOLOv8, and YOLOv10 versions, which not only improve the accuracy of network detection but also reduce the number of parameters and calculations, demonstrating the superiority and lightness of our designed module.To further improve detection efficiency in the steel defect field, we propose the ECDY network.Specifically, we rely on YOLOv8s and replace the BottleNeck in the C2f of the YOLOv8 network with our proposed EIFEM module, so that the network pays attention to the edge contour information while paying attention to the spatial information, and fuses the two parts of the features to obtain richer semantic information; we further replace the traditional upsampling with the upsampling method of the content-aware reorganization features (CARAFE), which can better use its feature information to guide itself to accurately and efficiently reconstruct features, and retain more detailed feature information.In addition, to adapt to different defect sizes and locations, different networks, and different task requirements, we replaced the detection head with a dynamic unified detection head.This detection head uses perception attention in multiple dimensions to perform unified detection when dealing with different sizes and tasks, while ensuring computational efficiency.
57Compared with other mainstream models applied to the public dataset provided by Northeastern University, the significant accuracy improvement and fewer parameters prove the superiority of our proposed ECDY network.Therefore, the network proposed in this article is highly suitable for steel defect detection scenarios.
58The detection accuracy of crazing in this article can be improved.For each network, crazing is the most difficult category to predict.We will focus on this aspect in subsequent work.
Fig. 1 .
59Fig. 1.EIFEM structure diagram (the structure obtains richer semantic information through feature fusion of the edge information extraction convolution branch and spatial information convolution branch).
Fig. 3 .
60Fig. 3. Spatial convolution structure diagram.
Fig. 4 .
61Fig. 4. ECDY network structure diagram (compared with YOLOv8, C2f is mainly replaced by C2f_EIFEM designed in this paper, upsampling is replaced by CARAFE, and the detection head is replaced by DyHead).
Fig. 6 .
62Fig. 6.CARAFE consists of a kernel prediction module and a content-aware reconstruction module.H × W × C is upsampled to σH × σW × C, where σ is the upsampling ratio.
Fig. 5 .
63Fig. 5. Comparison between C2f_EIFEM (left) and C2f (right), mainly showing the replacement of BottleNeck in C2f with the EIFEM module designed in this paper.
Fig. 8 .
64Fig. 8. DyHead block structure diagram.In the figure, π L there are size-aware attention, π S space-aware attention, π C and task-aware attention.The three attentions make up a DyHead Block.
Fig. 9 .
65Fig. 9. Six defect categories.
Fig. 10 .
66Fig. 10.Comparison of YOLOv5, YOLOv8, and YOLOv10 with the EIFEM module in terms of the Gflops accuracy (left) and size accuracy (right) trade-offs.Each point represents the n/s/m/l/x version.
Fig. 11 .
67Fig. 11.Comparison of the mAP@0.5 curves of the different models.
Fig. 12 .
68Fig. 12. Prediction accuracy of different networks for six steel defect categories.
Fig. 13 .
69Fig. 13.Detection effects of YOLOv5s, YOLOv8s, YOLOv10s, and the EIFEM module on six steel defect categories.
Fig. 14 .
70Fig. 14.Visualization and comparison of feature maps in the feature extraction stage of YOLOv8s and ECDY.
Fig. 15 .
71Fig. 15.Detection effects of different networks on 6 steel defect categories.
Fig. 16 .
72Fig. 16.Detection heatmap of the ECDY network for six steel defect categories.
Table 1 .
73Performance comparison of the YOLOv5, YOLOv8, and YOLOv10 versions with the EIFEM module added.
Table 2 .
74Ablation studies of various components of ECDY.
Table 3 .
75Performance comparison with the most advanced methods.
참고문헌 20건
- Faster R-CNN: Towards Real-Time Object Detection with Region Proposal Networks IEEE Transactions on Pattern Analysis and Machine Intelligence · IEEE Computer Society · 2016 10.1109/tpami.2016.2577031
- Faster R-CNN: towards real-time object detection with region proposal networks Neural Information Processing Systems · 2015
- An End-to-End Steel Surface Defect Detection Approach via Fusing Multiple Hierarchical Features IEEE Transactions on Instrumentation and Measurement · Institute of Electrical and Electronics Engineers · 2019 10.1109/tim.2019.2915404
- Automated Visual Defect Detection for Flat Steel Surface: A Survey IEEE Transactions on Instrumentation and Measurement · Institute of Electrical and Electronics Engineers · 2020 10.1109/tim.2019.2963555
- Application of Multi-Scale Feature Fusion and Deep Learning in Detection of Steel Strip Surface Defect 2019 10.1109/aiam48774.2019.00136
- Grayscale image formats for edge detection and for its FPGA implementation Microprocessors and Microsystems · Elsevier BV · 2020 10.1016/j.micpro.2020.103056
- 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
- SDDNet: A Fast and Accurate Network for Surface Defect Detection IEEE Transactions on Instrumentation and Measurement · Institute of Electrical and Electronics Engineers · 2021 10.1109/tim.2021.3056744
- Development of a YOLO-V3-based model for detecting defects on steel strip surface Measurement · Elsevier BV · 2021 10.1016/j.measurement.2021.109454
- DCC-CenterNet: A rapid detection method for steel surface defects Measurement · Elsevier BV · 2021 10.1016/j.measurement.2021.110211
- MSFT-YOLO: Improved YOLOv5 Based on Transformer for Detecting Defects of Steel Surface Sensors · Multidisciplinary Digital Publishing Institute · 2022 10.3390/s22093467
- FDD: a deep learning–based steel defect detectors The International Journal of Advanced Manufacturing Technology · Springer Science+Business Media · 2023 10.1007/s00170-023-11087-9
- Interpolation and Sharpening for Image Upsampling 2022 10.1109/iccgiv57403.2022.00020
- Edge Detection via Fusion Difference Convolution Sensors · Multidisciplinary Digital Publishing Institute · 2023 10.3390/s23156883
- A deep learning model for steel surface defect detection Complex & Intelligent Systems · Springer Science+Business Media · 2023 10.1007/s40747-023-01180-7
- Overview of temporal action detection based on deep learning Artificial Intelligence Review · Springer Science+Business Media · 2024 10.1007/s10462-023-10650-w
- Cross-dimensional feature attention aggregation network for cloud and snow recognition of high satellite images Neural Computing and Applications · Springer Science+Business Media · 2024 10.1007/s00521-024-09477-5
- DCS-YOLOv8: An Improved Steel Surface Defect Detection Algorithm Based on YOLOv8 2024 10.1145/3647649.3647656
- Surface defect detection of strip steel based on GT-CutMix augmentation algorithm and improved DSSD model Measurement Science and Technology · IOP Publishing · 2024 10.1088/1361-6501/ad5b7c
- The transmission line foreign body detection algorithm based on weighted spatial attention Frontiers in Neurorobotics · Frontiers Media · 2024 10.3389/fnbot.2024.1424158