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

Steel surface defect detection based on multi-layer fusion networks

관련 필름·전자재료 · (13) 프리즘 필름

기본 정보

저자
  1. Hanlin Li — Shandong University of Science and Technology, College of Electrical Engineering and Automation, Qingdao, 266590, China
  2. Ming Liu — Shandong University of Science and Technology, College of Electrical Engineering and Automation, Qingdao, 266590, China. skd992365@sdust.edu.cn|||Shandong University of Science and Technology, College of Electrical Engineering and Automation, Qingdao, 266590, China
  3. Yanfang Yin — Shandong University of Science and Technology, College of Electrical Engineering and Automation, Qingdao, 266590, China
  4. Weiliang Sun — Shandong University of Science and Technology, College of Electrical Engineering and Automation, Qingdao, 266590, China
DOI
10.1038/s41598-024-74601-3
저널
Scientific Reports
발행년도
2025
발행기관
Nature Portfolio
피인용수
6
라이선스
cc-by-nc-nd
논문 유형
–
언어
–
원문 페이지
https://doi.org/10.1038/s41598-024-74601-3
토픽
Surface Roughness and Optical Measurements
OpenAlex ID
W4408877509

평가 내용

관련도
관련
사업분야
필름·전자재료 · (13) 프리즘 필름
부 분야
–
R&D 측면
–
확신도
–
근거 용어
–
판단 근거
임베딩 유사도 기반 평가로 '필름·전자재료 > 프리즘 필름' 분야에 선정된 논문입니다.
R&D 활용 포인트
–
평가 입력
–

초록

Detecting defects on steel surfaces is crucial for ensuring product quality and production safety in industrial settings. Object detection using deep learning, particularly the YOLOv5 model, has become a widely adopted method for this purpose. However, the complex shapes of current steel surface defects pose challenges for precise detection, especially when using low-cost recognition devices with small resolution images. To address these challenges, we integrated the RepBi-PAN fusion network into YOLOv5, enhancing the detection capability for large targets in complex backgrounds. To mitigate issues related to the premature introduction of shallow features and decrease in Precision, we optimized the model structure by incorporating the DenseNet structure into the backbone for improved feature extraction. Additionally, we introduced the Normalized Attention Module (NAM) to enhance the detection capability for small targets. Experimental results demonstrate the effectiveness of the enhanced model, showing a 4.1% increase in mean average precision (mAP), a 3.2% improvement in precision, and a 2.4% enhancement in recall. The improved algorithm outperforms the original in complex backgrounds and recognizing small targets, addressing limitations of the Rep-Bi network. Compared to other YOLO algorithms, our approach achieves optimal values for recall and mAP while maintaining a smaller model size. When compared to YOLOv9, which is the best-performing algorithm in the YOLO series on the dataset used in this study, our model demonstrates several advantages. Specifically, it maintains superior overall performance with fewer parameters and lower computational requirements compared to deeper YOLOv9 variants. Furthermore, when compared to YOLOv9s, our model exhibits better performance in terms of precision, recall, and mAP, while also having fewer GFLOPs, a smaller parameter count, and a reduced model size.

본문 58,498자

본문 펼치기
## OPEN # Steel surface defect detection based on multi‑layer fusion networks Hanlin Li, Ming Liu <sup>*</sup> , Yanfang Yin & Weiliang Sun Detecting defects on steel surfaces is crucial for ensuring product quality and production safety in industrial settings. Object detection using deep learning, particularly the YOLOv5 model, has become a widely adopted method for this purpose. However, the complex shapes of current steel surface defects pose challenges for precise detection, especially when using low-cost recognition devices with small resolution images. To address these challenges, we integrated the RepBi-PAN fusion network into YOLOv5, enhancing the detection capability for large targets in complex backgrounds. To mitigate issues related to the premature introduction of shallow features and decrease in Precision, we optimized the model structure by incorporating the DenseNet structure into the backbone for improved feature extraction. Additionally, we introduced the Normalized Attention Module (NAM) to enhance the detection capability for small targets. Experimental results demonstrate the effectiveness of the enhanced model, showing a 4.1% increase in mean average precision (mAP), a 3.2% improvement in precision, and a 2.4% enhancement in recall. The improved algorithm outperforms the original in complex backgrounds and recognizing small targets, addressing limitations of the Rep-Bi network. Compared to other YOLO algorithms, our approach achieves optimal values for recall and mAP while maintaining a smaller model size. When compared to YOLOv9, which is the best-performing algorithm in the YOLO series on the dataset used in this study, our model demonstrates several advantages. Specifically, it maintains superior overall performance with fewer parameters and lower computational requirements compared to deeper YOLOv9 variants. Furthermore, when compared to YOLOv9s, our model exhibits better performance in terms of precision, recall, and mAP, while also having fewer GFLOPs, a smaller parameter count, and a reduced model size. Keywords YOLOv5, Attention mechanism, Multi-layer fusion network, Defect detection, Deep learning The steel industry is a vital sector that finds applications in a various industries, such as construction, automotive, aerospace, and mechanical manufacturing. Steel’s exceptional qualities, including high strength, corrosion resistance, and ease of processing, make it indispensable in these fields. However, defects in steel can significantly impact product appearance, quality, reliability, and even pose safety risks and economic losses if left unaddressed. Surface defects represent a significant category of steel defects and their definition and classification lack a standardized approach. Different production processes and processing methods contribute to variations in surface defects among different types of steel. Even steel produced suing the same method can exhibit different surface defects. For instance, hot-rolled strip steel may feature scratches, voids, pits and scabs, while structural steel may have overlaps, scratches, pits, and ­depressions <sup>1</sup> . Various methods are employed for surface defect detection, including magnetic particle detection, infiltration detection, eddy current detection, ultrasonic detection, manual detection and machine vision detection. The magnetic particle detection method stands out for its high sensitivity and ease of operation, but it requires a well-prepared surface and is susceptible to external electromagnetic interference. Infiltration detection method can identify small surface defects but may introduce contamination to the measured object’s surface and environmental pollution. Eddy current detection offers high sensitivity and broad applicability, but surface quality requirements, such as vulnerable to surface roughness and oxide layer thickness, influence its effectiveness. Ultrasonic detection boasts high accuracy, and speed, but specialized skills and equipment are ­necessary <sup>2</sup> .Manual inspection relying on visual observation by trained personnel, achieves high accuracy but is labor-intensive, prone to fatigue, and susceptible to missed inspection errors. Shandong University of Science and Technology, College of Electrical Engineering and Automation, Qingdao 266590, China. <sup>*</sup> email: skd992365@sdust.edu.cn In recent years, advancements in computer technology have expanded the use of vision techniques in defect detection. This involves traditional machine vision algorithms and deep learning. Hu et al. <sup>3</sup> introduced the AdaBoost algorithm to enhance the accuracy of detecting uncommon defects on steel plate surfaces. This algorithm improves accuracy by increasing combinable weak classifiers through a filtering mechanism. Xu et al. <sup>4</sup> utilized the Tetrolet transform to decompose hot-rolled steel plate surface images, extracting features for defect classification with support vector machines. Zhou et al. <sup>5</sup> employed the scale-invariant feature transformation (SIFT) operator for surface defect identification in medium-thickness sheets. Classical vision algorithms rely on manual feature extraction and object localization, which can be less effective in complex defect scenes, requiring manual annotation and resulting in a high workload. Deep learning, in particular, benefits from extensive training using vast production datasets. This training enhances detection accuracy by enabling the model to grasp universal and abstract features, allowing it to discern variations between various steel defects. Furthermore, deep learning offers the advantage of real-time detection and feedback. This capability not only saves time but also reduces costs, as defects can be instantly identified on the production line, streamlining subsequent processing. Applying deep learning to recognition tasks in the production domain is both feasible and efficient. When compared to other algorithms, the YOLO series excels due to its exceptional real-time performance, capacity to detect various object types, rapid training speed, and the availability of compact, deployable models that are easy to use. Within the YOLO series, YOLOv5 is especially favored for its outstanding practicality. In the last two years, YOLOv7 and YOLOv8 were introduced, building upon the YOLOv5 framework with module modifications, but the fundamental architecture remained unchanged. Despite enhancements in versions v7 and v8, they face challenges. YOLOv7 lacks proper data preprocessing and overly emphasizes accuracy, while YOLOv8 demands substantial computational resources due to its deeper backbone network and prolonged training times. In the domain of steel surface defect detection, conventional algorithms often require high computational power. However, many small and medium-sized enterprises use devices with limited computing resources. YOLOv5, with its simpler structure and reduced computational demands, is ideal for these devices, especially those with modest computational capacities. Unlike newer versions, YOLOv5 has undergone continuous enhancements and validations, solidifying its reliability in surface defect detection. Its lightweight design allows efficient deployment, particularly in embedded systems where computing resources are scarce. Furthermore, the evolution of v7 and v8 based on YOLOv5 highlights the reliability and flexibility of YOLOv5’s architecture. The YOLOv5 network consists of four components: an input module with Mosaic data augmentation, adaptive anchor computation, and image scaling; CSPDarknet53 as the backbone network extracting essential features; a Neck network for multi-scale feature fusion; and a Head module for regression predictions. Detecting defects on steel surfaces using YOLOv5 still poses several challenges. The existence of various defect types, each with distinct characteristics, leads to variations in detection accuracy for different defects. Detecting small targets can also be problematic. Moreover, the complex background of steel surface defects and the presence of overlapping and intersecting targets further complicate the task of identifying defects. In low-resolution images, this situation is even more prevalent. To address these challenges, this paper enhances the accuracy of the object detection framework by introducing the Rep-Bi PAN fusion network as a foundation. It proposes a solution to mitigate the Precision reduction issue caused by this fusion network. In the end, a Multi-Layer Fusion Networks based on the YOLOv5 architecture is obtained, specifically designed for the recognition of steel surface defects in industrial low-resolution images. The main contributions of this work are as follows: 1. Built upon YOLOv5, specialized Multi-Layer Fusion Networks have been developed specifically for lowresolution images and devices, designed to facilitate cost-effective steel surface defect recognition. 2. To resolve the issue of reduced precision caused by the Rep-Bi PAN fusion network, solution and optimization method have been proposed. 3. Addressed the challenge of inaccurate detection for large targets in complex steel surface backgrounds and the tendency to lose small targets in the YOLOv5 small model. Related works Deep learning approaches for surface defect detection fall into three main categories: pure image classification, semantic segmentation, and target-based ­detection <sup>6</sup> . Pure image classification methods focus solely on identifying the presence or absence of surface defects without providing object location or boundary details. Semantic segmentation assigns predefined semantic categories to different image regions, labeling each pixel with a corresponding category for dense pixel-wise classification. ­Tao <sup>7</sup> introduced a cascaded self-encoder (CASAE) architecture for metal defect detection, utilizing semantic segmentation to convert input defect images into prediction masks and employing a compact CNN to classify defect regions into specific classes. Experimental results on industrial datasets demonstrated successful metal defect detection under various conditions. In a similar vein, Liu et al. <sup>8</sup> proposed a low-pass U-Net to enhance existing methods for detecting and segmenting surface defects in steel strips. By applying an adaptive variance Gaussian low-pass filter before downsampling in the encoder, aliasing is prevented, and high-frequency information is separated, leading to improved defect segmentation. Pure image classification and semantic segmentation methods alone cannot provide precise boundary information and defect locations on steel surfaces. When detecting defects, it is crucial to determine both the location and type of defect. Target detection methods can directly locate and identify defects. Target detection aims to automatically identify and locate specific objects in images or videos. Deep learningbased target detection algorithms can be broadly categorized into two types: two-stage target detection algorithms and one-stage target detection algorithms, depending on the presence of a candidate image generation phase. Faster R-CNN <sup>9</sup> serves as the foundational framework in two-stage target detection algorithms for detecting material surface defects. Wang et al. <sup>10</sup> employed Faster R-CNN as the core for a surface defect detection network in strip steel. They integrated ResNet101 as the feature extraction network and utilized transfer learning, resulting in high accuracy, significant recall rates, and fast detection speeds. Wang et al. <sup>11</sup> introduced a multi-layer feature fusion Faster R-CNN algorithm by merging various levels of feature maps extracted from VGG-16. This fusion enriched both positional and semantic information, enabling swift and precise detection of defects across different scales and types. Additionally, Zhao et al. <sup>12</sup> enhanced Fast R-CNN by introducing deformation convolution to strengthen feature extraction capabilities. They also introduced a feature pyramidal network for extracting deep semantic features, aiding in the identification of small-scale target defects on steel surfaces. Following the introduction of the ­DETR <sup>13</sup> algorithm, sparse detection frameworks have gained prominence, focusing on sparse candidates and feature interaction. Sparse R-CNN <sup>14</sup>, an extension of Faster R-CNN, adopts sparse region convolution, concentrating on specific image regions. This reduces complexity, speeds up processing, and maintains comparable or superior detection performance in certain contexts. Single-stage target detection algorithms offer significant advantages in detection speed over two-stage counterparts, making them well-suited for real-time applications. SSD (Single Shot MultiBox Detector), introduced by Liu et al. <sup>15</sup>, stands out as a detection framework,surpassing Faster R-CNN in speed. Liu et al. <sup>16</sup> integrated SSD with ResNet as the feature extraction network and incorporated a channel attention mechanism. This innovation reduced computational complexity while enhancing detection speed for surface defects in hot-rolled strips. ­RetinaNet <sup>17</sup>, developed after SSD, combines Focal Loss with a feature pyramid-based network, addressing issues like sample imbalance in single-stage target detection. Akhyar et al. <sup>18</sup> harnessed RetinaNet for high accuracy and swift detection in steel plate surface defect detection tasks. Single-stage target detection algorithms generally exhibit faster training speeds compared to their two-stage counterparts. The efficiency arises from end-to-end training and the utilization of a single CNN model for prediction, allowing seamless parallel computing and distributed training. YOLO (You Only Look Once) stands out for its swift training, thanks to its straightforward prediction approach and clean design. Furthermore, YOLO benefits from versatile training data generation methods, including random cropping and color transformations, enhancing the model’s generalization capabilities. DETR (DEtection TRansformer) represents a groundbreaking method in object detection, diverging from conventional two-stage or one-stage algorithms. It leverages attention mechanisms and set prediction techniques, allowing for the direct prediction of object positions and categories across the entire image. Unlike traditional approaches reliant on anchor boxes or candidate boxes, DETR eradicates the need for non-maximum suppression (NMS) or manually crafted anchors. This streamlines the detection process significantly. In specific scenarios, DETR has demonstrated accuracy and runtime performance comparable to Faster R-CNN. The YOLO family of detectors, proposed since YOLOv1 by Redmon et al. <sup>19</sup> in 2016 has evolved and improved over time. YOLOv1 used a fully convolutional neural network for target detection, which was fast but less accurate and limited in predicting the number of objects. ­YOLOv2 <sup>20</sup> borrowed the idea of anchor boxes from RPN, utilized k-mean clustering and introduced techniques such as batch normalization to enhance the overall performance of the model. ­YOLOv3 <sup>21</sup> employed the Darknet-53 architecture to deepen the network and extract more complex features. ­YOLOv4 <sup>22</sup> introduced new modules and techniques, including mosaic data augmentation and C-IOU to improve model accuracy. In the same year, Ultralytics released YOLOv5, which achieved the fastest inference speed while maintaining performance similar to YOLOv4.YOLOv5 also significantly improved the model training speed, and the model size could be controlled by two parameters to control its depth and the number of convolution kernels. YOLOv7 <sup>23</sup> largely builds upon the architecture, configuration settings, training, inference, and validation processes of YOLOv5. It incorporates the SimOTA strategy from YOLOX for positive sample matching and integrates recent advancements like efficient aggregation networks, reparameterized convolutions, auxiliary head detection, and model scaling. On the other hand, ­YOLOv8 <sup>24</sup> modifies the YOLOv5 architecture and adopts the Decoupled-Head introduced by YOLOX, effectively separating classification and regression tasks. It employs BCE Loss for classification and DFL Loss + CIOU Loss for regression, replacing Anchor-Based designs with Anchor-Free alternatives. The model utilizes the Task-Aligned Assigner sample allocation strategy and improves training by disabling Mosaic data augmentation in the final 10 rounds, thereby enhancing accuracy. The YOLO algorithm has excelled in surface defect detection. Yan et al. <sup>25</sup> enhanced YOLOv5 by incorporating an attention mechanism, refining the CSP module, and modifying the feature mAP fusion model. This optimized model enabled real-time detection of multiple fruit targets in apple-picking robots. In comparison experiments, Wang et al. <sup>26</sup> demonstrated YOLOv5’s superior accuracy for tile surface defects, outperforming Faster R-CNN, SSD, and YOLOv4. Chen et al. <sup>27</sup> achieved real-time detection at 96.8 FPS by employing MobileNet as the feature extractor in YOLOv3 and addressing boundary mismatch with an extended pyramid network and added loss function. Liu et al. <sup>28</sup> proposed an improved R-Tiny-YOLOv3 incorporating residual networks and SPP modules, achieving 71.5% defect accuracy and 39.8 FPS detection speed, suitable for embedded devices. Guo et al. <sup>29</sup> elevated YOLOv5’s performance by integrating the TRANS module, achieving a 5% improvement in mAP. Their strategies, including multi-scale feature fusion, ensured accurate real-time detection in challenging scenarios. Liu et al. <sup>30</sup> enhanced yolov5s with variable convolution and double attention modules, maintaining a detection speed of 60.51 FPS and improving accuracy to 0.974mAP. Wang et al. <sup>31</sup> integrated the ConvNeXt module and attention mechanism into YOLOv7, successfully enabling the detection and identification of surface defects on strip steel. Lastly, Liu et al. <sup>32</sup> proposed YOLO-IMF, an improved YOLOv8 algorithm, addressing surface defect recognition on aluminum sheets by enhancing bounding box regression with the EIOU loss function, resulting in a 1.2% increase in mAP. In the field of object detection, significant advancements have been made beyond the experimental applications and articles based on the YOLO algorithm. In 2023, RT-DETR <sup>33</sup>, based on the DETR framework without NMS, achieved important progress. RT-DETR introduced a convolution-based backbone network and an efficient hybrid encoder, which not only achieved high accuracy but also addressed the issue of detection speed. Furthermore, in 2024, ­YOLOv9 <sup>34</sup> was introduced, featuring the new GELAN (Generalized Efficient Layer Aggregation Network) module, which maintains the network’s lightweight nature and speed. YOLOv9 also proposed PGI (Programmable Gradient Information), enhancing the gradient feedback paths during network training and reducing information loss throughout the training process. In the same year, ­YOLOv10 <sup>35</sup> emerged, building on the RT-DETR framework. This model introduced Consistent Dual Assignments for NMS-free Training and optimized various components, thereby reducing computational overhead. Method RepBi‑PAN Improved fusion networks can ensure effective information fusion between feature maps at different scales in order to transfer information between different levels of feature maps. Figure 1 shows the overall structure of RepBi-PAN as a fusion network after combining the other two optimization methods. RepBi-PAN fusion networks with large-size feature maps introduced earlier in the Neck network can mitigate the information loss and provide more information details to improve the accuracy of the detection frame. Figure 2 shows the structure of RepBi-PAN. RepBi-PAN <sup>36</sup> introduces the RepBlock to replace the original CSP module in the PAN module. While preserving the PANET structure, RepBi-PAN performs convolutional downsampling on same-scale and large-scale feature mAPs. For large-scale feature mAPs, a 3x3 convolution is used for downsampling, while for small-scale feature mAPs, a transposed convolution is used for upsampling. The resulting feature mAPs are then concatenated and reduced in dimensionality using a 1x1 convolution, ensuring effective multi-scale feature fusion. In YOLOv5, due to its different network structure, convolutional dimensionality reduction is not necessary when processing feature mAPs of the same size. Therefore, in this paper, a 1x1 convolution is employed to enhance the feature representation instead of performing dimensionality reduction on same-scale feature mAPs. The operations for large and small feature mAPs remain the same as in the original structure.The connection in YOLO is shown in Fig. 3. When expanding YOLOv5 to include this fusion network, the improved performance is accompanied by a slight trade-off in Precision. This compromise arises from the early integration of shallow features into the network, diminishing the model’s ability to recognize small targets. This observation has been substantiated in subsequent experiments. To tackle this challenge, we can enhance the feature extraction capability and overall performance of the backbone network by introducing DenseNet. DenseNet excels in efficiently utilizing information from large feature maps at each network level, leading to an overall improvement in feature effectiveness. DenseNet DenseNet has been widely used in target detection, demonstrating its effectiveness in tasks such as ­apple <sup>37</sup> and cotton ­boll <sup>38</sup> identification in agricultural production, as well as remote sensing target ­detection <sup>39</sup> and steel strip defect ­identification <sup>40</sup> in industrial production. This network structure not only enhances feature propagation, promotes feature reuse and improves network performance but also overcomes challenges such as occlusion and dense target distribution. Figure 4 shows how this structure is connected. Let the single image passed through the convolutional network be x0 . The network contains l layers, each of which implements the nonlinear transformation Hl(.), where l indexes the layer and Hl(.) can be a composite function using operations such as batch normalisation(BN), linear correction unit(ReLU), pooling, or convolution(Conv). Denote the output of layer _l_ as xl . A conventional convolutional feed-forward network connects the output of layer _l_ as input to layer _l_ +1, resulting in the following transformation. xl = Hl(xl−1) (1) ResNet bypasses the nonlinear transformation by adding a skip connection through the constant function. The gradients can flow directly from the back layers to the front layers via the constant mAPping function but the combination of the constant mAPping function and the output of Hl by summation may impede the flow of information in the network. xl = Hl(xl−1) + xl−1 (2) To further improve the information flow between layers, ­DenseNet <sup>41</sup> uses a different connection model: direct connections are introduced so that each layer is connected to all subsequent layers, and Fig. 2 shows the layout of the resulting DenseNet. As shown, layer l receives the feature mAPs of all previous layers. x0,...,xl are used as inputs: xl = Hl([x0, ..., xl−1]) (3) where [x0, ..., xl−1] is the concatenation of feature mAPs generated in layers 0,..., _l_ -1. For ease of implementation, multiple inputs of Hl in the above equation are concatenated into a single tensor. The concatenation operation in the equation is not viable when the size of the feature-mAPs changes. However, an essential part of the convolutional network is down-sampling layer that changes the size of the feature Fig. 1. Improved YOLOv5 structure,It featuring three new paths with the RepBi-PAN fusion network. The original C3 module is replaced with Dense_C3, integrating dense connectivity. Attention mechanisms are introduced following each C3 module. mAP. To facilitate down-sampling in our architecture, the network can be divided into multiple densely connected dense blocks, as in the original DenseNet architecture, convolution and pooling were used as the conversion layers between densely connected blocks. The original DenseNet defines Hl as a composite function of BN, Conv, ReLU, which is replaced in this paper using yolov5’s CBS convolution layer (Fig. 1). At the same time, in order to ensure the feasibility of the tandem formula this paper chooses to improve the BottleNeck residual block in the original C3module to replace it with Fig. 2. RepBi-PAB. ( a ) is the overall network of the RepBi-PAN, and ( b ) is the structure of the BIC. Fig. 3. Network structure improvement. The left is original structure, while the right side illustrates the new structure after the introduction of additional paths and convolutions. the DenseBlock (Fig. 1) densely connected layer, which not only ensures the feasibility of the formula, but also allows the network parameters to be adjusted by controlling the number of DenseBlocks to control the network depth and increase the flexibility of the network. Combining DenseNet with a fusion network enhances feature reusability, but it may lead to a drawback by overlooking small targets, especially in scenarios with complex backgrounds and low resolutions, such as detecting surface defects in steel materials. The deepening network allocates fewer pixels to small targets, causing them to be masked by deeper features, known as “feature suppression.” To address this issue, incorporating an attention mechanism is a potential solution. Normalization‑based attention module In recent years, attention mechanisms like ­SE <sup>42</sup>, ­SimAM <sup>43</sup>, ­CBAM <sup>44</sup>, and NAM have emerged as excellent solutions.In the experiments, the NAM attention mechanism outperforms other methods in the task of defect detection on steel surfaces. Therefore, NAM is chosen as the optimized attention algorithm. The NAM attention mechanism emulates the human visual system by assigning varying attention weights to input data, enabling the network to focus on crucial information. When integrated into the feature extraction module, this mechanism enhances the model’s detection performance. It enables the extraction of fundamental location details from relevant defects, aiding tasks like identifying localized ­insulators <sup>45</sup> or traffic ­objects <sup>46</sup> . The introduction of this attention mechanism aims to enhance the network’s ability to extract and represent image features, making it more expressive without increasing its depth. Figure 5 shows its channel attention structure. NAM extends the CBAM attention module, recognized for its efficiency and lightweight design through normalized adjustments in the channel and spatial attention ­submodules <sup>47</sup> . Unlike prior attention methods that enhance neural networks by suppressing unimportant weights, NAM emphasizes crucial features using Fig. 4. Dense Connect.A 5-layer dense block with a growth rate of k=4.Each layer takes all preceding featuremaps as input. Fig. 5. Channel attention module. a variance measure of training model weights. It conveys weight importance through normalized scaling and reduces irrelevant channel and pixel information in the image. Bout = BN(Bin) = <sup><u>Bin −</u></sup> <sup><u>µβ</u></sup> + β (4) σβ <sup>2</sup> <sup>+ ε</sup> <u>�</u> + β β <sup>2</sup> <sup>+ ε</sup> where µβ and σβ are the mean and standard deviation of small batches of β, γ and β are trainable affine transformation parameters (scaling and offset).The channel attention mechanism sub-module and equations for NAM are as follows, and Mc is the output feature. For the input feature mAP F1, the scale factor of F1 channels γ0,...γn is first calculated by BN normalization.γn ,and then calculate the scale factor of each channel of F1 by Eq. (6), the weight value of the channel is derived from Eq. (5), the weight acts as a penalty term on F1, and the final image output feature Mc is obtained by sigmoid activation. the weight is derived from the following equation: <u>γi</u> Wγ = (5) <u>�j=0</u> <sup>γj</sup> MC = sigmoid(Wγ (BN(F1))) (6) Experiment Datsets The dataset utilized in this thesis is sourced from the Northeastern University Steel Surface Defects Dataset (NEU-DET). This dataset comprises six distinct types of defects: crazing, inclusion, patches, pitted surface, rolled-in scale and scratches. Each defect category consists of 300 samples, resulting in a total of 1800 grayscale images. Each image has dimensions of 200 × 200 pixels and may contain multiple instances of defects. Figure 6 illustrates the six defects of the dataset. The dataset was randomly divided into training, validation, and test sets with a ratio of 8:1:1. This resulted in 1,260 samples for the training set, 270 samples for the validation set, and 270 samples for the test set. To prevent uneven distribution of samples across different categories, an equal number of samples from each defect category were extracted. The distribution of different categories within the training set is illustrated in the following Fig. 7. Experiment setup The detection model proposed in this study was trained on an NVIDIA GTX 1080Ti (12G) GPU running the Ubuntu 20.04 operating system. The training environment was configured as outlined in Table 1. A total of 500 training rounds were performed, with a batch-size of 32 to maximize GPU utilization and match the image resolution of the dataset. The initial learning rate was set to 0.01, and a weight decay of 0.0005 was applied. Further details can be found in Table 2 Evaluations metrics In target detection tasks, Precision (P) and Recall (R) are commonly used to evaluate the performance of target detection models, while the mAP is used to assess the overall model performance. Precision and Recall are calculated based on a confusion matrix (Table 3), where each column represents the predicted category and each row represents the true classification of the data. The elements in the confusion matrix are defined as follows: TP (True Positive): The model correctly identifies a positive sample. FN (False Negative): The model fails to identify a positive sample. FP (False Positive): The model incorrectly identifies a negative sample as positive. TN (True Negative): The model correctly identifies a negative sample. Precision is the ratio of correctly predicted positive samples to all predicted positive samples, calculated as:: Precision = TP/(TP + FP) (7) Recall is the proportion correctly predicted positive samples out of all true positive samples and is calculated as: <u>TP</u> Recall = (8) (TP + FN) The Precision-Recall(P-R) curve is obtained by plotting Precision as the vertical axis and Recall as the horizontal axis. The Average Precision (AP) is then calculated as the area under the P-R curve. �0 1 AP = p(r)dr (9) - 1 p(r)dr 0 1 Fig. 6. NEU-DET dataset defects. Different colors are used for different categories. Fig. 7. Distribution of training sets: ( a ) shows the number of defect type targets in the training set, ( b ) shows the ratio of defects to the whole graph, ( c ) shows the location of the defect centroid in relation to the graph. <u>OS</u> <u>Ubuntu20.04</u> <u>CUDA</u> <u>11.3</u> <u>GPU</u> <u>NVIDIA GTX 1080Ti(12G)</u> <u>Python</u> <u>3.8</u> <u>Pytorch</u> <u>1.7.1</u> <u>Pycharm</u> <u>2022.3.3</u> Table 1. Experiment environment. <u>Batch size</u> <u>Momentum</u> <u>Initial learning rate</u> <u>Weight decay</u> <u>Epochs</u> <u>32</u> <u>0.937</u> <u>0.01</u> <u>0.0005</u> <u>500</u> Table 2. Initialization parameters. Finally, the mean average precision(mAP) is obtained by averaging the AP values of all categories, where Nc represents the number of categories in which defects are detected <u>i=1</u> <sup><u>APi)</u></sup> <u>�</u> Nc Nc mAP = <sup>(</sup> <u>i=1</u> <sup><u>APi)</u></sup> (10) <u>�</u> Nc Nc Actual <u>Prediction</u> <u>Positive</u> <u>Negative</u> <u>Ture</u> <u>TP</u> <u>TN</u> <u>False</u> <u>FP</u> <u>FN</u> Table 3. Confusion Matrix. Selection of the attention mechanism We employed various attention mechanisms for training and recognition tasks, and the results are summarized in Table 4. Notably, NAM stands out with exceptional precision, recall, and mAP values, demonstrating outstanding detection performance, especially against both ordinary and complex backgrounds. Its ability to recognize small targets is particularly noteworthy. Detailed comparative detection examples are provided in Fig. 8 for reference. Integrating the NAM attention mechanism during training yielded optimal results in Precision and mAP. In comparison to CBAM, Recall decreased by only 2.2%, yet the accuracy was 5% higher than CBAM. Moreover, for detection tasks, the utilization of the NAM attention mechanism showcased superior recognition capabilities for small targets. Experiment result The results of the ablation experiments carried out to verify the effectiveness of the improved structure are as Tablel 5. Figures 9, 10, 11 present a comparison of the mAP, P, and R values between the improved model and yolov5s during training.Upon analyzing the graph and table, it becomes evident that our modifications have resulted in noteworthy improvements. <u>Model</u> <u>P (%)</u> <u>R (%)</u> <u>mAP (%)</u> <u>SE</u> <u>74.7</u> <u>74.7</u> <u>76.4</u> <u>SimAM</u> <u>76.4</u> <u>69.3</u> <u>74.6</u> <u>CBAM</u> <u>71.6</u> <u>75.4</u> <u>77</u> <u>NAM</u> <u>76.6</u> <u>73.2</u> <u>77.5</u> Table 4. Comparison of attention mechanisms. Fig. 8. Comparison of Defect Identification. Fig. 9. mAP. Fig. 10. Precision. Fig. 11. Recall. <u>RepBi-PAN</u> <u>C3_Dense</u> <u>NAM</u> <u>AP(%)</u> <u>CR</u> <u>IN</u> <u>PA</u> <u>PS</u> <u>RS</u> <u>SC</u> <u>P(%)</u> <u>R(%)</u> <u>mAP(%)</u> <u>34.8</u> <u>80.3</u> <u>92.3</u> <u>78.7</u> <u>70.9</u> <u>91.3</u> <u>73.8</u> <u>71</u> <u>74.7</u> ✓ <u>48</u> <u>80.6</u> <u>89.2</u> <u>82.2</u> <u>63.8</u> <u>92.2</u> <u>72.1</u> <u>73.4</u> <u>76</u> ✓ ✓ <u>54.1</u> <u>88.3</u> <u>82.9</u> <u>86</u> <u>69.1</u> <u>87.8</u> <u>78</u> <u>73.2</u> <u>76.8</u> ✓ ✓ <u>45.9</u> <u>77.5</u> <u>81.1</u> <u>87.3</u> <u>61.3</u> <u>87.8</u> <u>73.5</u> <u>71.7</u> <u>75.9</u> ✓ ✓ ✓ <u>58.5</u> <u>80.3</u> <u>81.3</u> <u>84.2</u> <u>74.3</u> <u>83.4</u> <u>77</u> <u>73.4</u> <u>78.8</u> Table 5. Ablation experiments. When assessing the accuracy of individual detection categories, a notable enhancement of 23.7% is observed in recognizing targets amidst the complex background of Crazing (CR). Furthermore, the vulnerabilities associated with Pitted Surface (PS) and Rolled in Scale (RS), which are inclined to be overlooked when dealing with small targets, saw improvements of 5.5% and 3.4%, respectively. This underscores that the improved model has effectively bolstered the recognition capability for both complex backgrounds and small targets. During the ablation experiments, the extension of the fusion network using RepBi-PAN resulted in improvements in both Recall and mAP compared to the original network. This affirms that the Rep-Bi fusion network indeed enhances the detection accuracy of the detection box, leading to an elevated mAP and achieving an overall performance improvement compared to the original structure. However, as mentioned earlier, the premature introduction of shallow feature networks in this fusion network led to a decrease in Precision, dropping from 73.8% to 72.1%. When examining the combined structure of RepBi and Dense, the network’s Precision increased by 5.9% compared to using RepBi alone, indicating that the introduction of the Dense structure is highly effective in addressing the issue of insufficient feature extraction caused by the standalone introduction of the fusion network.The ablation experiments included separate trials for RepBi and attention mechanisms, further underscoring the effectiveness of Dense in enhancing feature extraction capabilities. The introduction of an attention mechanism, following the incorporation of RepBi and Dense structures, produced optimal experimental results. In comparison to the original YOLOv5, Precision increased by 3.2%, Recall increased by 2.4%, and mAP increased by 4.1%. This not only improves the detection ability of the bounding boxes (Recall) but also enhances the model’s Precision and mAP. These enhancements are clearly evident in the detection results, as depicted in Fig. 12, indicating an improved recognition capability of the enhanced model in complex backgrounds and for small-sized targets. The early introduction of large feature maps has also fortified the localization ability for large targets. To further demonstrate the superiority of the proposed improved YOLOv5 model in this paper, it was compared against other single-stage target detection algorithms, particularly YOLOv8.The results, obtained from training on the same dataset for 500 epochs, are presented in the Table6. Analyzing the comparative data reveals that the enhanced YOLOv5 model avoids exhibiting biases or extremes in Precision (P) and Recall (R) performances. Instead, it demonstrates a more comprehensive coverage of positive instances, effectively capturing instances of the positive class. As a result, the improved model outperforms overall, boasting a 3.2% increase in precision, a 2.5% enhancement in recall, and a notable 4.1% rise in mAP, surpassing all algorithms within the YOLO series.When compared to other detection models, the proposed improved model’s size advantage is noteworthy. It proves to be smaller than all YOLOv8 series models and, when contrasted with the smallest YOLOv5s model, only experiences a marginal increase of 3.9MB after the integration of DenseNet.Simultaneously, it retains a relatively low number of parameters, experiencing only a modest increase of 2.42M compared to YOLOv5, which is approximately 1/7th of the YOLOv8x model. Although the GFLOPs are slightly larger than YOLOv8’s small model, they still remain significantly smaller than its large model. In the dataset employed in this study, there are notable performance differences between Yolov9 and Yolov10. Among the five models of Yolov9, an overall performance improvement is observed compared to other series, with the Yolov9-e model standing out particularly. This model achieved the highest mean Average Precision (mAP) score, while also demonstrating strong Precision and Recall. Conversely, despite the reduction in computational complexity and parameter count for the five Yolov10 models, their performance on the smaller resolution dataset used in this study did not reach the outstanding levels observed on the COCO dataset. When considering the s models across the entire Yolo series as a baseline, the improved model presented in this study exhibits a 2.5% increase in Precision, a 1% increase in Recall, and a 0.8% increase in mAP compared to Yolov9-s. Moreover, the proposed model not only achieves superior overall performance but also maintains lower computational complexity and parameter count than Yolov9-s. Although the Yolov10-s model has slightly lower GFLOPS, parameter count, and model file size compared to the improved model in this study, the latter significantly outperforms Yolov10-s in terms of Precision and mAP metrics. To assess the model’s generalization capability, another dataset, GC10-DET, containing various metal defects, was used for training. The dataset includes ten types of defects: crease, crescent gap, inclusion, oil spot, punching hole, rolled pit, silk spot, waist folding, water spot, and welding line. Given that the total number of images in GC10-DET is relatively large, the training set size was increased while slightly reducing the proportion of the test set. This adjustment allows the model to learn more features from the training data while still retaining a sufficient test set for model evaluation. The defects are represented as shown in Fig. 13. To assess the generalization capability of the YOLOv5-improved model on a low-resolution dataset, the resolution of the current dataset was modified to 420 x 210. Training and testing were subsequently conducted on this adjusted dataset. <u>Model</u> <u>P(%)</u> <u>R(%)</u> <u>mAP(%)</u> <u>GFLOPs</u> <u>Param</u> <u>Model File</u> <u>Efficient</u> <u>82.3</u> <u>52.6</u> <u>67.7</u> <u>11.5</u> <u>6.6M</u> <u>15.7MB</u> <u>Retainet</u> <u>78.0</u> <u>49.6</u> <u>62.4</u> <u>20.33</u> <u>36.4M</u> <u>139MB</u> <u>SSD</u> <u>72.6</u> <u>60.8</u> <u>71.3</u> <u>61.3</u> <u>24.3M</u> <u>93.1MB</u> <u>DETR-resnet50</u> <u>52.15</u> <u>73.1</u> <u>71.36</u> <u>10.3</u> <u>36.7M</u> <u>166.5MB</u> <u>DETR-resnet101</u> <u>44.3</u> <u>78.9</u> <u>71.24</u> <u>17.7</u> <u>55.7M</u> <u>242.8MB</u> <u>RT-DETR-resnet50</u> <u>73.7</u> <u>63.7</u> <u>69.4</u> <u>125.6</u> <u>41.9M</u> <u>86.1MB</u> <u>RT-DETR-resnet101</u> <u>70.6</u> <u>67.4</u> <u>70.4</u> <u>186.3</u> <u>60.9M</u> <u>124.3MB</u> <u>RT-DETR-l</u> <u>66.4</u> <u>67.6</u> <u>71.1</u> <u>103.5</u> <u>32.0M</u> <u>66.2MB</u> <u>RT-DETR-x</u> <u>71.0</u> <u>63.5</u> <u>69.2</u> <u>222.5</u> <u>65.5M</u> <u>135.5MB</u> <u>YOLOv3</u> <u>80.7</u> <u>62.8</u> <u>75.7</u> <u>19.0</u> <u>61.6M</u> <u>235MB</u> <u>YOLOv5s</u> <u>73.8</u> <u>70.9</u> <u>74.7</u> <u>15.8</u> <u>7.0M</u> <u>14.3MB</u> <u>YOLOv7</u> <u>76.7</u> <u>66.7</u> <u>76.7</u> <u>12.9</u> <u>37.2M</u> <u>142MB</u> <u>YOLOv8n</u> <u>72.1</u> <u>69.7</u> <u>75.5</u> <u>28.4</u> <u>11.1M</u> <u>22.5MB</u> <u>YOLOv8s</u> <u>68.8</u> <u>72.3</u> <u>74.7</u> <u>28.4</u> <u>11.1M</u> <u>21.4MB</u> <u>YOLOv8m</u> <u>73.5</u> <u>71.6</u> <u>73.6</u> <u>78.7</u> <u>25.8M</u> <u>49.5MB</u> <u>YOLOv8l</u> <u>76.3</u> <u>70.2</u> <u>76.4</u> <u>164.8</u> <u>43.6M</u> <u>83.5MB</u> <u>YOLOv8x</u> <u>77.5</u> <u>73.1</u> <u>78.7</u> <u>257.4</u> <u>68.1M</u> <u>130MB</u> <u>YOLOv9t</u> <u>74.8</u> <u>69.3</u> <u>77.5</u> <u>10.7</u> <u>2.6M</u> <u>5.9MB</u> <u>YOLOv9s</u> <u>74.5</u> <u>72.4</u> <u>78.0</u> <u>38.7</u> <u>9.6M</u> <u>19.8MB</u> <u>YOLOv9m</u> <u>74.4</u> <u>73.4</u> <u>77.6</u> <u>130.7</u> <u>32.5M</u> <u>64.7MB</u> <u>YOLOv9c</u> <u>73.7</u> <u>73.3</u> <u>77.7</u> <u>236.7</u> <u>50.7M</u> <u>100MB</u> <u>YOLOv9e</u> <u>73.7</u> <u>73.5</u> <u>79.2</u> <u>240.7</u> <u>68.5M</u> <u>136MB</u> <u>YOLOv10n</u> <u>69.6</u> <u>68.8</u> <u>74.4</u> <u>8.2</u> <u>2.7M</u> <u>5.8MB</u> <u>YOLOv10s</u> <u>67.6</u> <u>71.6</u> <u>73.1</u> <u>24.5</u> <u>8.0M</u> <u>16.6MB</u> <u>YOLOv10m</u> <u>72.3</u> <u>66.9</u> <u>72.8</u> <u>63.4</u> <u>16.5M</u> <u>35.5MB</u> <u>YOLOv10b</u> <u>78.4</u> <u>66.5</u> <u>76.5</u> <u>98.0</u> <u>20.4M</u> <u>41.4MB</u> <u>YOLOv10l</u> <u>69.0</u> <u>67.9</u> <u>72.1</u> <u>126.4</u> <u>25.7M</u> <u>52.2MB</u> <u>YOLOv10x</u> <u>71.3</u> <u>70.4</u> <u>76.3</u> <u>169.8</u> <u>31.6M</u> <u>64.1MB</u> <u>YOLOv5s-Improved</u> <u>77</u> <u>73.4</u> <u>78.8</u> <u>34.4</u> <u>9.42M</u> <u>18.2MB</u> Table 6. Algorithm comparison. Fig. 12. Comparison of detection result.The first row displays the original image, the second row depicts the test results using YOLOv5, and the third row illustrates the test results using the improved YOLOv5. Fig. 13. GC10-DET dataset defects. Table 7 demonstrates the sustained superior performance of the YOLOv5-improved model, even after changing to another low-resolution dataset, surpassing smaller models like YOLOv5s and YOLOv8s. This affirms the enhanced model’s robust generalization capabilities. In the detection comparison presented in Fig. 14, especially for identifying larger defects in low-resolution images, the YOLOv5-improved model excels, successfully detecting defects overlooked by YOLOv5s.This further substantiates the improved model’s proficiency in detecting large objects in complex backgrounds. Conclusion To address the challenges associated with steel surface defect detection, this paper introduces an enhanced YOLOv5 model that integrates multiple advanced techniques. These enhancements encompass the utilization of the RepBi-PAN fusion network to introduce shallower layers for extracting more extensive feature maps. Additionally, feature fusion is enhanced to improve bounding box detection, and the detection capability for large targets in complex backgrounds is heightened. To mitigate the decrease in accuracy resulting from the introduction of the fusion network, structural improvements have been implemented. The DenseNet structure is incorporated into the backbone to augment feature extraction capabilities and overall performance. Concurrently, the NAM attention mechanism is integrated to enhance the detection capability for small targets. The experimental results on the low-resolution dataset affirm the efficacy of the proposed method, demonstrating the enhanced YOLOv5 model’s accuracy, recall, and mAP values at 77%, 73.4%, and 78.8%, respectively. These results indicate that the improved model surpasses the original YOLOv5 model in terms of precision, recall, and mAP. When compared to the latest YOLOv9 and YOLOv10 series models, the proposed model shows a mAP that is only 0.4% lower than YOLOv9x. However, our model outperforms YOLOv9x in both precision and recall, while having significantly lower computational requirements and parameter count. Additionally, it maintains a compact Fig. 14. Comparison of detection result in GC10-DET.The first row displays the recognition images obtained by YOLOv5 detection, while the second row presents the results obtained by YOLOv5-improved detection. <u>Model</u> <u>P (%)</u> <u>R (%)</u> <u>mAP (%)</u> <u>GFLOPs</u> <u>Param</u> <u>Model file</u> <u>YOLOv5s</u> <u>64.9</u> <u>59.2</u> <u>63.4</u> <u>23.8</u> <u>9.1M</u> <u>18.5MB</u> <u>YOLOv8s</u> <u>62.1</u> <u>64.8</u> <u>65.6</u> <u>28.5</u> <u>11.1M</u> <u>22.5MB</u> <u>YOLOv9s</u> <u>68.2</u> <u>67.7</u> <u>70.2</u> <u>38.8</u> <u>9.6M</u> <u>20.3MB</u> <u>YOLOv10s</u> <u>61.2</u> <u>66.9</u> <u>66.4</u> <u>8.2</u> <u>2.6M</u> <u>5.8MB</u> <u>YOLOv5s-improved</u> <u>71.9</u> <u>68.4</u> <u>71.0</u> <u>34.4</u> <u>9.2M</u> <u>18.8MB</u> Table 7. Generalizability comparison. model size compared to other variants.In particular, the enhanced YOLOv5 model convincingly demonstrates superior detection capabilities in scenarios involving complex backgrounds and small target detection, effectively addressing the limitations of the original algorithm in these challenging conditions. This confirms the feasibility and effectiveness of the proposed method. Compared to the YOLOv10 model, which has undergone training, computational, and network optimizations, our model shows a notable improvement in performance.Overall, in scenarios involving complex backgrounds and small target detection, our model also exhibits exceptional detection capabilities, effectively overcoming the limitations of the original algorithm. This further validates the practicality and efficacy of the proposed algorithm. In addition, another dataset was employed to validate the model’s generalization performance after reducing the image resolution. Comparative analysis with YOLOv8s YOLOv9s, and YOLOv10s demonstrated the improved YOLOv5 model’s superior performance. This further supports the algorithm’s generalization ability, highlighting its effectiveness across different datasets, particularly in scenarios involving complex backgrounds and small target recognition. Future research will concentrate on mitigating the constraints in single defect type detection precision and performance at high IOU thresholds to meet specific production requirements. Data availability All data generated or analyzed during this study are included in this published article and its supplementary information files. Received: 25 December 2023; Accepted: 27 September 2024 References 1. Tang, B. et al. Review of surface defect detection of steel products based on machine vision. _IET Image Process._ 17 (2), 303–322 (2023). 2. Li, S. et al. Review of development and application of defect detection technology. _Acta Automatica Sinica_ 46 (11), 2319–2336 (2020). 3. Hu, L. et al. Modeling and recognition of steel-plate surface defects based on a new backward boosting algorithm. _Int. J. Adv._ _Manuf. Technol._ 94, 4317–4328 (2018). 4. Xu, K., Wang, L. & Wang, J. Surface defect recognition of hot-rolled steel plates based on Tetrolet transform. _J. Mech. Eng._ 52 (4), 13 (2016). 5. Zhou, P., Xu, K. & Yang, C. L. Surface defect recognition method of medium and thick plate based on SIFT. _J. Tsinghua Univ. (Sci._ _Technol.)_ 58 (10), 881–887 (2018). 6. Wang, L. Design and Implementation of Steel Surface Defect Detection System Based on Semantic Segmentation. M.S. thesis, Huazhong University of Science and Technology, (2022). 7. Tao, X. et al. Automatic metallic surface defect detection and recognition with convolutional neural networks. _Appl. Sci._ 8 (9), 1575 (2018). 8. Liu, B. et al. Low-pass U-Net: a segmentation method to improve strip steel defect detection. _Meas. Sci. Technol._ 34 (3), 035405 (2022). 9. Girshick R. Fast R-CNN. In _Proceedings of the IEEE International Conference on Computer Vision_, 1440–1448 (2015) 10. Wang, L. Surface Defect Detection of Strip Steel Based on Deep Learning. M.S. thesis, Xi’an Engineering University, (2018). 11. Wang, H., Wang, J. & Luo, F. Research on surface defect detection of metal plate and strip based on faster R-CNN with multi-level features fusion. _J. Mech. Sci. Technol._ 40 (2), 262–269 (2021). 12. Zhao, W. et al. A new steel defect detection algorithm based on deep learning. _Comput. Intell. Neurosci._ 1–13 (2021) 13. Carion, N. et al. End-to-end object detection with transformers. In _European Conference on Computer Vision_ . (Springer Interna tional Publishing, 2020). 14. Sun, P. et al. Sparse R-CNN: end-to-end object detection with learnable proposals. In _Proceedings of the IEEE/CVF Conference on_ _Computer Vision and Pattern Recognition_, (2021). 15. Liu, W. et al. SSD: single shot multibox detector. In _Computer Vision – ECCV 2016: 14th European Conference, Amsterdam, The_ _Netherlands, October 11–14, 2016, Proceedings, Part I_, 21–37 (Springer International Publishing, 2016). 16. Liu, X. & Gao, J. Surface defect detection method of hot rolling strip based on improved SSD model. In _Database Systems for_ _Advanced Applications. DASFAA 2021 International Workshops: BDQM, GDMA, MLDLDSA, MobiSocial, and MUST, Taipei,_ _Taiwan, April 11–14, 2021, Proceedings_, 209–222 (Springer International Publishing, 2021). 17. Lin, T. Y. et al. Focal loss for dense object detection. In _Proceedings of the IEEE International Conference on Computer Vision_, 2980–2988. (2017). 18. Akhyar, F. et al. High efficient single-stage steel surface defect detection. In _2019 16th IEEE International Conference on Advanced_ _Video and Signal Based Surveillance (AVSS)_, 1–4. (2019). 19. Redmon, J. et al. You only look once: unified, real-time object detection. In _Proceedings of the IEEE Conference on Computer Vision_ _and Pattern Recognition_, 779–788 (2016). 20. Redmon, J. & Farhadi, A. YOLO9000: better, faster, stronger. In _Proceedings of the IEEE Conference on Computer Vision and Pattern_ _Recognition, Hawaii Convention Center, Honolulu, HI, USA_, 7263–7271 (2017). 21. Redmon, J. & Farhadi, A. _Yolov3: An Incremental Improvement_ [. arXiv preprint arXiv:​1804.​02767, (2018).](http://arxiv.org/abs/1804.02767) 22. Bochkovskiy, A., Wang, C. Y., Liao, H. Y. M. _Yolov4: Optimal Speed and Accuracy of Object Detection_ [. arXiv preprint arXiv:​2004.​](http://arxiv.org/abs/2004.10934) [10934, (2020).](http://arxiv.org/abs/2004.10934) 23. Wang, C.-Y., Alexey, B., & Hong-Yuan, M. L.. YOLOv7: Trainable bag-of-freebies sets new state-of-the-art for real-time object detectors. In _Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, Vancouver, Canada_, (2023). [24. Jocher, G., Chaurasia, A. & Qiu, J. YOLO by Ultralytics (Version 8.0.0) [Computer software]. Retrieved from https://​github.​com/​](https://github.com/ultralytics/ultralytics) [ultra​lytics/​ultra​lytics (2023).](https://github.com/ultralytics/ultralytics) 25. Yanan, S. et al. Rail surface defect detection method based on YOLOv3 deep learning networks. In _Proceedings of the 2018 Chinese_ _Automation Congress (CAC), Xi’an, China_, 1563–1568 (2018). 26. Wang, S., Dun, W., Huang, J. & Wang, N. Defect detection on ceramic tile surfaces based on YOLOv5. _Packaging Eng._ 43 (09), 217–224 (2022). 27. Chen, X. et al. Online detection of surface defects based on improved YOLOv3. _Sensors_ 22 (3), 817 (2022). 28. Liu, L. Research on Industrial Steel Defect Detection Based on Deep Learning. M.S. thesis, Anhui Jianzhu University, (2021). 29. Guo, Z. et al. MSFT-YOLO: improved YOLOv5 based on transformer for detecting defects of steel surface. _Sensors_ 22 (9), 3467 (2022). 30. Liu, Y. et al. Surface defect detection of steel products based on improved YOLOv5. In _2022 41st Chinese Control Conference (CCC),_ _Hefei, China, 2022_, 5794–5799. 31. Wang, Y. et al. Development of an improved YOLOv7-based model for detecting defects on strip steel surfaces. _Coatings_ 13 (3), 536 (2023). 32. Liu, Y. & Ye, K. YOLO-IMF: an improved YOLOv8 algorithm for surface defect detection in industrial manufacturing field. In _International Conference on Metaverse_ (Springer Nature Switzerland, 2023). 33. Zhao, Y. et al. Detrs beat yolos on real-time object detection. In _Proceedings of the IEEE/CVF Conference on Computer Vision and_ _Pattern Recognition_, 16965–16974. (2024). 34. Wang, C. Y., Yeh, I. H. & Liao, H. Y. M. Yolov9: Learning what you want to learn using programmable gradient information. arXiv [preprint arXiv:​2402.​13616, (2024).](http://arxiv.org/abs/2402.13616) [35. Wang, A., Chen, H., Liu, L. et al. Yolov10: Real-time end-to-end object detection. arXiv preprint arXiv:​2405.​14458, (2024).](http://arxiv.org/abs/2405.14458) [36. Li, C., Li, L., Geng, Y. et al. YOLOv6 v3.0: A Full-Scale Reloading. arXiv preprint arXiv:​2301.​05586, (2023).](http://arxiv.org/abs/2301.05586) 37. Tian, Y. et al. Apple detection during different growth stages in orchards using the improved YOLO-V3 model. _Comput. Electron._ _Agric._ 157, 417–426 (2019). 38. Zhang, Y. et al. An improved YOLO network for unopened cotton boll detection in the field. _J. Intell. Fuzzy Syst._ 42 (3), 2193–2206 (2022). 39. Xu, D. & Wu, Y. Improved YOLO-V3 with DenseNet for multi-scale remote sensing target detection. _Sensors_ 20 (15), 4276 (2020). 40. Zhang, J. et al. Surface defect detection of steel strips based on classification priority YOLOv3-dense network. _Ironmaking &_ _Steelmaking_ 48 (5), 547–558 (2021). 41. Huang, G. et al. Densely connected convolutional networks. In _Proceedings of the IEEE Conference on Computer Vision and Pattern_ _Recognition_, 4700–4708 (2017) 42. Hu, J., Shen, L. & Sun, G. Squeeze-and-excitation networks. In _Proceedings of the IEEE Conference on Computer Vision and Pattern_ _Recognition_, (2018). 43. Yang, L. et al. SIMAM: a simple, parameter-free attention module for convolutional neural networks. In _Proceedings of the Inter-_ _national Conference on Machine Learning_, (PMLR, 2021). 44. Woo, S. et al. CBAM: convolutional block attention module. In _Proceedings of the European Conference on Computer Vision (ECCV)_, (2018). 45. Qi, Y., Li, Y. & Du, A. Research on an insulator defect detection method based on improved YOLOv5. _Appl. Sci._ 13 (9), 5741 (2023). 46. Li, A. et al. A multi-scale traffic object detection algorithm for road scenes based on improved YOLOv5. _Electronics_ 12 (4), 878 (2023). [47. Liu, Y. et al. NAM: Normalization-based attention module, arXiv preprint arXiv:​2111.​12419, (2021).](http://arxiv.org/abs/2111.12419) Author contributions LI conducted the primary experiments, drafted the manuscript, and prepared the figures. Liu and Yin provided guidance in direction, technical expertise, and writing assistance. Sun assisted in the experiments. All authors, including LI, Liu, Yin, and Sun, participated in reviewing the manuscript. Competing interests The authors declare no competing interests. Additional information Supplementary Information [The online version contains supplementary material available at https://​doi.​org/​](https://doi.org/10.1038/s41598-024-74601-3) [10.​1038/​s41598-​024-​74601-3.](https://doi.org/10.1038/s41598-024-74601-3) Correspondence and requests for materials should be addressed to M.L. Reprints and permissions information is available at www.nature.com/reprints. Publisher’s note Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations. Open Access This article is licensed under a Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International License, which permits any non-commercial use, sharing, distribution and reproduction in any medium or format, as long as you give appropriate credit to the original author(s) and the source, provide a link to the Creative Commons licence, and indicate if you modified the licensed material. You do not have permission under this licence to share adapted material derived from this article or parts of it. The images or other third party material in this article are included in the article’s Creative Commons licence, unless indicated otherwise in a credit line to the material. If material is not included in the article’s Creative Commons licence and your intended use is not permitted by statutory regulation or exceeds the permitted use, you will need to obtain [permission directly from the copyright holder. To view a copy of this licence, visit http://​creat​iveco​mmons.​org/​](http://creativecommons.org/licenses/by-nc-nd/4.0/) [licen​ses/​by-​nc-​nd/4.​0/.](http://creativecommons.org/licenses/by-nc-nd/4.0/) © The Author(s) 2025

섹션 본문 74문단 · 34,719자

(제목 없음)

1Detecting defects on steel surfaces is crucial for ensuring product quality and production safety in industrial settings.Object detection using deep learning, particularly the YOLOv5 model, has become a widely adopted method for this purpose.However, the complex shapes of current steel surface defects pose challenges for precise detection, especially when using low-cost recognition devices with small resolution images.To address these challenges, we integrated the RepBi-PAN fusion network into YOLOv5, enhancing the detection capability for large targets in complex backgrounds.To mitigate issues related to the premature introduction of shallow features and decrease in Precision, we optimized the model structure by incorporating the DenseNet structure into the backbone for improved feature extraction.Additionally, we introduced the Normalized Attention Module (NAM) to enhance the detection capability for small targets.Experimental results demonstrate the effectiveness of the enhanced model, showing a 4.1% increase in mean average precision (mAP), a 3.2% improvement in precision, and a 2.4% enhancement in recall.The improved algorithm outperforms the original in complex backgrounds and recognizing small targets, addressing limitations of the Rep-Bi network.Compared to other YOLO algorithms, our approach achieves optimal values for recall and mAP while maintaining a smaller model size.When compared to YOLOv9, which is the best-performing algorithm in the YOLO series on the dataset used in this study, our model demonstrates several advantages.Specifically, it maintains superior overall performance with fewer parameters and lower computational requirements compared to deeper YOLOv9 variants.Furthermore, when compared to YOLOv9s, our model exhibits better performance in terms of precision, recall, and mAP, while also having fewer GFLOPs, a smaller parameter count, and a reduced model size.

21. Built upon YOLOv5, specialized Multi-Layer Fusion Networks have been developed specifically for lowresolution images and devices, designed to facilitate cost-effective steel surface defect recognition.2. To resolve the issue of reduced precision caused by the Rep-Bi PAN fusion network, solution and optimization method have been proposed.3. Addressed the challenge of inaccurate detection for large targets in complex steel surface backgrounds and the tendency to lose small targets in the YOLOv5 small model.

Related works

3Deep learning approaches for surface defect detection fall into three main categories: pure image classification, semantic segmentation, and target-based detection 6 .Pure image classification methods focus solely on identifying the presence or absence of surface defects without providing object location or boundary details.Semantic segmentation assigns predefined semantic categories to different image regions, labeling each pixel with a corresponding category for dense pixel-wise classification.Tao 7 introduced a cascaded self-encoder (CASAE) architecture for metal defect detection, utilizing semantic segmentation to convert input defect images into prediction masks and employing a compact CNN to classify defect regions into specific classes.Experimental results on industrial datasets demonstrated successful metal defect detection under various conditions.In a similar vein, Liu et al. 8 proposed a low-pass U-Net to enhance existing methods for detecting and segmenting surface defects in steel strips.By applying an adaptive variance Gaussian low-pass filter before downsampling in the encoder, aliasing is prevented, and high-frequency information is separated, leading to improved defect segmentation.

4Pure image classification and semantic segmentation methods alone cannot provide precise boundary information and defect locations on steel surfaces.When detecting defects, it is crucial to determine both the location and type of defect.Target detection methods can directly locate and identify defects.

5Target detection aims to automatically identify and locate specific objects in images or videos.Deep learningbased target detection algorithms can be broadly categorized into two types: two-stage target detection algorithms and one-stage target detection algorithms, depending on the presence of a candidate image generation phase.

6Faster R-CNN 9 serves as the foundational framework in two-stage target detection algorithms for detecting material surface defects.Wang et al. 10 employed Faster R-CNN as the core for a surface defect detection network in strip steel.They integrated ResNet101 as the feature extraction network and utilized transfer learning, resulting in high accuracy, significant recall rates, and fast detection speeds.Wang et al. 11 introduced a multi-layer feature fusion Faster R-CNN algorithm by merging various levels of feature maps extracted from VGG-16.This fusion enriched both positional and semantic information, enabling swift and precise detection of defects across different scales and types.

7Additionally, Zhao et al. 12 enhanced Fast R-CNN by introducing deformation convolution to strengthen feature extraction capabilities.They also introduced a feature pyramidal network for extracting deep semantic features, aiding in the identification of small-scale target defects on steel surfaces.

8Following the introduction of the DETR 13 algorithm, sparse detection frameworks have gained prominence, focusing on sparse candidates and feature interaction.Sparse R-CNN 14 , an extension of Faster R-CNN, adopts sparse region convolution, concentrating on specific image regions.This reduces complexity, speeds up processing, and maintains comparable or superior detection performance in certain contexts.

9Single-stage target detection algorithms offer significant advantages in detection speed over two-stage counterparts, making them well-suited for real-time applications.SSD (Single Shot MultiBox Detector), introduced by Liu et al. 15 , stands out as a detection framework,surpassing Faster R-CNN in speed.Liu et al. 16 integrated SSD with ResNet as the feature extraction network and incorporated a channel attention mechanism.This innovation reduced computational complexity while enhancing detection speed for surface defects in hot-rolled strips.RetinaNet 17 , developed after SSD, combines Focal Loss with a feature pyramid-based network, addressing issues like sample imbalance in single-stage target detection.Akhyar et al. 18 harnessed RetinaNet for high accuracy and swift detection in steel plate surface defect detection tasks.

10Single-stage target detection algorithms generally exhibit faster training speeds compared to their two-stage counterparts.The efficiency arises from end-to-end training and the utilization of a single CNN model for prediction, allowing seamless parallel computing and distributed training.YOLO (You Only Look Once) stands out for its swift training, thanks to its straightforward prediction approach and clean design.Furthermore, YOLO benefits from versatile training data generation methods, including random cropping and color transformations, enhancing the model's generalization capabilities.

11DETR (DEtection TRansformer) represents a groundbreaking method in object detection, diverging from conventional two-stage or one-stage algorithms.It leverages attention mechanisms and set prediction techniques, allowing for the direct prediction of object positions and categories across the entire image.Unlike traditional approaches reliant on anchor boxes or candidate boxes, DETR eradicates the need for non-maximum suppression (NMS) or manually crafted anchors.This streamlines the detection process significantly.In specific scenarios, DETR has demonstrated accuracy and runtime performance comparable to Faster R-CNN.

12The YOLO family of detectors, proposed since YOLOv1 by Redmon et al. 19 in 2016 has evolved and improved over time.YOLOv1 used a fully convolutional neural network for target detection, which was fast but less accurate and limited in predicting the number of objects.YOLOv2 20 borrowed the idea of anchor boxes from RPN, utilized k-mean clustering and introduced techniques such as batch normalization to enhance the overall performance of the model.YOLOv3 21 employed the Darknet-53 architecture to deepen the network and extract more complex features.YOLOv4 22 introduced new modules and techniques, including mosaic data augmentation and C-IOU to improve model accuracy.In the same year, Ultralytics released YOLOv5, which achieved the fastest inference speed while maintaining performance similar to YOLOv4.YOLOv5 also significantly improved the model training speed, and the model size could be controlled by two parameters to control its depth and the number of convolution kernels.

13YOLOv7 23 largely builds upon the architecture, configuration settings, training, inference, and validation processes of YOLOv5.It incorporates the SimOTA strategy from YOLOX for positive sample matching and integrates recent advancements like efficient aggregation networks, reparameterized convolutions, auxiliary head detection, and model scaling.On the other hand, YOLOv8 24 The YOLO algorithm has excelled in surface defect detection.Yan et al. 25 enhanced YOLOv5 by incorporating an attention mechanism, refining the CSP module, and modifying the feature mAP fusion model.This optimized model enabled real-time detection of multiple fruit targets in apple-picking robots.In comparison experiments, Wang et al. 26 demonstrated YOLOv5's superior accuracy for tile surface defects, outperforming Faster R-CNN, SSD, and YOLOv4.Chen et al. 27 achieved real-time detection at 96.8 FPS by employing MobileNet as the feature extractor in YOLOv3 and addressing boundary mismatch with an extended pyramid network and added loss function.Liu et al. 28 proposed an improved R-Tiny-YOLOv3 incorporating residual networks and SPP modules, achieving 71.5% defect accuracy and 39.8 FPS detection speed, suitable for embedded devices.Guo et al. 29 elevated YOLOv5's performance by integrating the TRANS module, achieving a 5% improvement in mAP.Their strategies, including multi-scale feature fusion, ensured accurate real-time detection in challenging scenarios.Liu et al. 30 enhanced yolov5s with variable convolution and double attention modules, maintaining a detection speed of 60.51 FPS and improving accuracy to 0.974mAP.Wang et al. 31 integrated the ConvNeXt module and attention mechanism into YOLOv7, successfully enabling the detection and identification of surface defects on strip steel.Lastly, Liu et al. 32 proposed YOLO-IMF, an improved YOLOv8 algorithm, addressing surface defect recognition on aluminum sheets by enhancing bounding box regression with the EIOU loss function, resulting in a 1.2% increase in mAP.

14In the field of object detection, significant advancements have been made beyond the experimental applications and articles based on the YOLO algorithm.In 2023, RT-DETR 33 , based on the DETR framework without NMS, achieved important progress.RT-DETR introduced a convolution-based backbone network and an efficient hybrid encoder, which not only achieved high accuracy but also addressed the issue of detection speed.

15Furthermore, in 2024, YOLOv9 34 was introduced, featuring the new GELAN (Generalized Efficient Layer Aggregation Network) module, which maintains the network's lightweight nature and speed.YOLOv9 also proposed PGI (Programmable Gradient Information), enhancing the gradient feedback paths during network training and reducing information loss throughout the training process.In the same year, YOLOv10 35 emerged, building on the RT-DETR framework.This model introduced Consistent Dual Assignments for NMS-free Training and optimized various components, thereby reducing computational overhead.

RepBi-PAN

16Improved fusion networks can ensure effective information fusion between feature maps at different scales in order to transfer information between different levels of feature maps.Figure 1 shows the overall structure of RepBi-PAN as a fusion network after combining the other two optimization methods.RepBi-PAN fusion networks with large-size feature maps introduced earlier in the Neck network can mitigate the information loss and provide more information details to improve the accuracy of the detection frame.Figure 2 shows the structure of RepBi-PAN.

17RepBi-PAN 36 introduces the RepBlock to replace the original CSP module in the PAN module.While preserving the PANET structure, RepBi-PAN performs convolutional downsampling on same-scale and large-scale feature mAPs.For large-scale feature mAPs, a 3x3 convolution is used for downsampling, while for small-scale feature mAPs, a transposed convolution is used for upsampling.The resulting feature mAPs are then concatenated and reduced in dimensionality using a 1x1 convolution, ensuring effective multi-scale feature fusion.

18In YOLOv5, due to its different network structure, convolutional dimensionality reduction is not necessary when processing feature mAPs of the same size.Therefore, in this paper, a 1x1 convolution is employed to enhance the feature representation instead of performing dimensionality reduction on same-scale feature mAPs.The operations for large and small feature mAPs remain the same as in the original structure.The connection in YOLO is shown in Fig. 3.

19When expanding YOLOv5 to include this fusion network, the improved performance is accompanied by a slight trade-off in Precision.This compromise arises from the early integration of shallow features into the network, diminishing the model's ability to recognize small targets.This observation has been substantiated in subsequent experiments.To tackle this challenge, we can enhance the feature extraction capability and overall performance of the backbone network by introducing DenseNet.DenseNet excels in efficiently utilizing information from large feature maps at each network level, leading to an overall improvement in feature effectiveness.

DenseNet

20DenseNet has been widely used in target detection, demonstrating its effectiveness in tasks such as apple 37 and cotton boll 38 identification in agricultural production, as well as remote sensing target detection 39 and steel strip defect identification 40 in industrial production.This network structure not only enhances feature propagation, promotes feature reuse and improves network performance but also overcomes challenges such as occlusion and dense target distribution.Figure 4 shows how this structure is connected.

21Let the single image passed through the convolutional network be x 0 .The network contains l layers, each of which implements the nonlinear transformation H l (.), where l indexes the layer and H l (.) can be a com- posite function using operations such as batch normalisation(BN), linear correction unit(ReLU), pooling, or convolution(Conv).Denote the output of layer l as x l .A conventional convolutional feed-forward network con- nects the output of layer l as input to layer l+1, resulting in the following transformation.

22ResNet bypasses the nonlinear transformation by adding a skip connection through the constant function.The gradients can flow directly from the back layers to the front layers via the constant mAPping function but the combination of the constant mAPping function and the output of H l by summation may impede the flow of information in the network.

23To further improve the information flow between layers, DenseNet 41 uses a different connection model: direct connections are introduced so that each layer is connected to all subsequent layers, and Fig. 2 shows the layout of the resulting DenseNet.As shown, layer l receives the feature mAPs of all previous layers.x 0 ,...,x l are used as inputs:

24where [x 0 , ..., x l−1 ] is the concatenation of feature mAPs generated in layers 0,...,l-1.For ease of implementation, multiple inputs of H l in the above equation are concatenated into a single tensor.

25The concatenation operation in the equation is not viable when the size of the feature-mAPs changes.However, an essential part of the convolutional network is down-sampling layer that changes the size of the feature (1) www.nature.com/scientificreports/mAP.To facilitate down-sampling in our architecture, the network can be divided into multiple densely connected dense blocks, as in the original DenseNet architecture, convolution and pooling were used as the conversion layers between densely connected blocks.The original DenseNet defines H l as a composite function of BN, Conv, ReLU, which is replaced in this paper using yolov5's CBS convolution layer (Fig. 1).At the same time, in order to ensure the feasibility of the tandem formula this paper chooses to improve the BottleNeck residual block in the original C3module to replace it with www.nature.com/scientificreports/ the DenseBlock (Fig. 1) densely connected layer, which not only ensures the feasibility of the formula, but also allows the network parameters to be adjusted by controlling the number of DenseBlocks to control the network depth and increase the flexibility of the network.

26Combining DenseNet with a fusion network enhances feature reusability, but it may lead to a drawback by overlooking small targets, especially in scenarios with complex backgrounds and low resolutions, such as detecting surface defects in steel materials.The deepening network allocates fewer pixels to small targets, causing them to be masked by deeper features, known as "feature suppression." To address this issue, incorporating an attention mechanism is a potential solution.

Normalization-based attention module

27In recent years, attention mechanisms like SE 42 , SimAM 43 , CBAM 44 , and NAM have emerged as excellent solutions.In the experiments, the NAM attention mechanism outperforms other methods in the task of defect detection on steel surfaces.Therefore, NAM is chosen as the optimized attention algorithm.

28The NAM attention mechanism emulates the human visual system by assigning varying attention weights to input data, enabling the network to focus on crucial information.When integrated into the feature extraction module, this mechanism enhances the model's detection performance.It enables the extraction of fundamental location details from relevant defects, aiding tasks like identifying localized insulators 45 or traffic objects 46 .The introduction of this attention mechanism aims to enhance the network's ability to extract and represent image features, making it more expressive without increasing its depth.Figure 5 shows its channel attention structure.

29NAM extends the CBAM attention module, recognized for its efficiency and lightweight design through normalized adjustments in the channel and spatial attention submodules 47 .Unlike prior attention methods that enhance neural networks by suppressing unimportant weights, NAM emphasizes crucial features using where µ β and σ β are the mean and standard deviation of small batches of β , γ and β are trainable affine transfor- mation parameters (scaling and offset).The channel attention mechanism sub-module and equations for NAM are as follows, and Mc is the output feature.

30For the input feature mAP F1, the scale factor of F1 channels γ 0 ,...γ n is first calculated by BN normalization.γn ,and then calculate the scale factor of each channel of F1 by Eq. ( 6), the weight value of the channel is derived from Eq. ( 5), the weight acts as a penalty term on F1, and the final image output feature Mc is obtained by sigmoid activation.the weight is derived from the following equation:

Experiment Datsets

31The dataset utilized in this thesis is sourced from the Northeastern University Steel Surface Defects Dataset (NEU-DET).This dataset comprises six distinct types of defects: crazing, inclusion, patches, pitted surface, rolled-in scale and scratches.Each defect category consists of 300 samples, resulting in a total of 1800 grayscale images.Each image has dimensions of 200 × 200 pixels and may contain multiple instances of defects.Figure 6 illustrates the six defects of the dataset.

32The dataset was divided into training, validation, and test sets with a ratio of 8:1:1.This resulted in 1,260 samples for the training set, 270 samples for the validation set, and 270 samples for the test set.To prevent uneven distribution of samples across different categories, an equal number of samples from each defect category were extracted.The distribution of different categories within the training set is illustrated in the following Fig. 7.

Experiment setup

33The detection model proposed in this study was trained on an NVIDIA GTX 1080Ti (12G) GPU running the Ubuntu 20.04 operating system.The training environment was configured as outlined in Table 1.A total of 500 training rounds were performed, with a batch-size of 32 to maximize GPU utilization and match the image resolution of the dataset.The initial learning rate was set to 0.01, and a weight decay of 0.0005 was applied.Further details can be found in Table 2

Evaluations metrics

34In target detection tasks, Precision (P) and Recall (R) are commonly used to evaluate the performance of target detection models, while the mAP is used to assess the overall model performance.Precision and Recall are calculated based on a confusion matrix (Table 3), where each column represents the predicted category and each row represents the true classification of the data.The elements in the confusion matrix are defined as follows:

35TP Precision is the ratio of correctly predicted positive samples to all predicted positive samples, calculated as::

36Recall is the proportion correctly predicted positive samples out of all true positive samples and is calculated as:

37The Precision-Recall(P-R) curve is obtained by plotting Precision as the vertical axis and Recall as the horizontal axis.The Average Precision (AP) is then calculated as the area under the P-R curve.

Selection of the attention mechanism

38We employed various attention mechanisms for training and recognition tasks, and the results are summarized in Table 4. Notably, NAM stands out with exceptional precision, recall, and mAP values, demonstrating outstanding detection performance, especially against both ordinary and complex backgrounds.Its ability to recognize small targets is particularly noteworthy.Detailed comparative detection examples are provided in Fig. 8 for reference.

39Integrating the NAM attention mechanism during training yielded optimal results in Precision and mAP.In comparison to CBAM, Recall decreased by only 2.2%, yet the accuracy was 5% higher than CBAM.Moreover, for detection tasks, the utilization of the NAM attention mechanism showcased superior recognition capabilities for small targets.

Experiment result

40The results of the ablation experiments carried out to verify the effectiveness of the improved structure are as Tablel 5.

41Figures 9, 10, 11 present a comparison of the mAP, P, and R values between the improved model and yolov5s during training.Upon analyzing the graph and table, it becomes evident that our modifications have resulted in noteworthy improvements.www.nature.com/scientificreports/When assessing the accuracy of individual detection categories, a notable enhancement of 23.7% is observed in recognizing targets amidst the complex background of Crazing (CR).Furthermore, the vulnerabilities associated with Pitted Surface (PS) and Rolled in Scale (RS), which are inclined to be overlooked when dealing with small targets, saw improvements of 5.5% and 3.4%, respectively.This underscores that the improved model has effectively bolstered the recognition capability for both complex backgrounds and small targets.

42During the ablation experiments, the extension of the fusion network using RepBi-PAN resulted in improvements in both Recall and mAP compared to the original network.This affirms that the Rep-Bi fusion network indeed enhances the detection accuracy of the detection box, leading to an elevated mAP and achieving an overall performance improvement compared to the original structure.However, as mentioned earlier, the premature introduction of shallow feature networks in this fusion network led to a decrease in Precision, dropping from 73.8% to 72.1%.When examining the combined structure of RepBi and Dense, the network's Precision increased by 5.9% compared to using RepBi alone, indicating that the introduction of the Dense structure is highly effective in addressing the issue of insufficient feature extraction caused by the standalone introduction of the fusion network.The ablation experiments included separate trials for RepBi and attention mechanisms, further underscoring the effectiveness of Dense in enhancing feature extraction capabilities.

43The introduction of an attention mechanism, following the incorporation of RepBi and Dense structures, produced optimal experimental results.In comparison to the original YOLOv5, Precision increased by 3.2%, Recall increased by 2.4%, and mAP increased by 4.1%.This not only improves the detection ability of the bounding boxes (Recall) but also enhances the model's Precision and mAP.These enhancements are clearly evident in the detection results, as depicted in Fig. 12, indicating an improved recognition capability of the enhanced model in complex backgrounds and for small-sized targets.The early introduction of large feature maps has also fortified the localization ability for large targets.

44To further demonstrate the superiority of the proposed improved YOLOv5 model in this paper, it was compared against other single-stage target detection algorithms, particularly YOLOv8.The results, obtained from training on the same dataset for 500 epochs, are presented in the Table6.Analyzing the comparative data reveals that the enhanced YOLOv5 model avoids exhibiting biases or extremes in Precision (P) and Recall (R) performances.Instead, it demonstrates a more comprehensive coverage of positive instances, effectively capturing instances of the positive class.As a result, the improved model outperforms overall, boasting a 3.2% increase in precision, a 2.5% enhancement in recall, and a notable 4.1% rise in mAP, surpassing all algorithms within the YOLO series.When compared to other detection models, the proposed improved model's size advantage is noteworthy.It proves to be smaller than all YOLOv8 series models and, when contrasted with the smallest YOLOv5s model, only experiences a marginal increase of 3.9MB after the integration of DenseNet.Simultaneously, it retains a relatively low number of parameters, experiencing only a modest increase of 2.42M compared to YOLOv5, which is approximately 1/7th of the YOLOv8x model.Although the GFLOPs are slightly larger than YOLOv8's small model, they still remain significantly smaller than its large model.

45In the dataset employed in this study, there are notable performance differences between Yolov9 and Yolov10.Among the five models of Yolov9, an overall performance improvement is observed compared to other series, with the Yolov9-e model standing out particularly.This model achieved the highest mean Average Precision (mAP) score, while also demonstrating strong Precision and Recall.Conversely, despite the reduction in computational complexity and parameter count for the five Yolov10 models, their performance on the smaller resolution dataset used in this study did not reach the outstanding levels observed on the COCO dataset.

46When considering the s models across the entire Yolo series as a baseline, the improved model presented in this study exhibits a 2.5% increase in Precision, a 1% increase in Recall, and a 0.8% increase in mAP compared to Yolov9-s.Moreover, the proposed model not only achieves superior overall performance but also maintains lower computational complexity and parameter count than Yolov9-s.Although the Yolov10-s model has slightly lower GFLOPS, parameter count, and model file size compared to the improved model in this study, the latter significantly outperforms Yolov10-s in terms of Precision and mAP metrics.

47To assess the model's generalization capability, another dataset, GC10-DET, containing various metal defects, was used for training.The dataset includes ten types of defects: crease, crescent gap, inclusion, oil spot, punching hole, rolled pit, silk spot, waist folding, water spot, and welding line.Given that the total number of images in GC10-DET is relatively large, the training set size was increased while slightly reducing the proportion of the test set.This adjustment allows the model to learn more features from the training data while still retaining a sufficient test set for model evaluation.The defects are represented as shown in Fig. 13.To assess the generalization capability of the YOLOv5-improved model on a low-resolution dataset, the resolution of the current dataset was modified to 420 x 210.Training and testing were subsequently conducted on this adjusted dataset.Table 7 demonstrates the sustained superior performance of the YOLOv5-improved model, even after changing to another low-resolution dataset, surpassing smaller models like YOLOv5s and YOLOv8s.This affirms the enhanced model's robust generalization capabilities.In the detection comparison presented in Fig. 14, especially for identifying larger defects in low-resolution images, the YOLOv5-improved model excels, successfully detecting defects overlooked by YOLOv5s.This further substantiates the improved model's proficiency in detecting large objects in complex backgrounds.

Conclusion

48To address the challenges associated with steel surface defect detection, this paper introduces an enhanced YOLOv5 model that integrates multiple advanced techniques.These enhancements encompass the utilization of the RepBi-PAN fusion network to introduce shallower layers for extracting more extensive feature maps.Additionally, feature fusion is enhanced to improve bounding box detection, and the detection capability for large targets in complex backgrounds is heightened.To mitigate the decrease in accuracy resulting from the introduction of the fusion network, structural improvements have been implemented.The DenseNet structure is incorporated into the backbone to augment feature extraction capabilities and overall performance.Concurrently, the NAM attention mechanism is integrated to enhance the detection capability for small targets.

49The experimental results on the low-resolution dataset affirm the efficacy of the proposed method, demonstrating the enhanced YOLOv5 model's accuracy, recall, and mAP values at 77%, 73.4%, and 78.8%, respectively.These results indicate that the improved model surpasses the original YOLOv5 model in terms of precision, recall, and mAP.

50When compared to the latest YOLOv9 and YOLOv10 series models, the proposed model shows a mAP that is only 0.4% lower than YOLOv9x.However, our model outperforms YOLOv9x in both precision and recall, while having significantly lower computational requirements and parameter count.Additionally, it maintains a compact www.nature.com/scientificreports/model size compared to other variants.In particular, the enhanced YOLOv5 model convincingly demonstrates superior detection capabilities in scenarios involving complex backgrounds and small target detection, effectively addressing the limitations of the original algorithm in these challenging conditions.This confirms the feasibility and effectiveness of the proposed method.Compared to the YOLOv10 model, which has undergone training, computational, and network optimizations, our model shows a notable improvement in performance.Overall, in scenarios involving complex backgrounds and small target detection, our model also exhibits exceptional detection capabilities, effectively overcoming the limitations of the original algorithm.This further validates the practicality and efficacy of the proposed algorithm.In addition, another dataset was employed to validate the model's generalization performance after reducing the image resolution.Comparative analysis with YOLOv8s YOLOv9s, and YOLOv10s demonstrated the improved YOLOv5 model's superior performance.This further supports the algorithm's generalization ability, highlighting its effectiveness across different datasets, particularly in scenarios involving complex backgrounds and small target recognition.

51Future research will concentrate on mitigating the constraints in single defect type detection precision and performance at high IOU thresholds to meet specific production requirements.

52modifies the YOLOv5 architecture and adopts the Decoupled-Head introduced by YOLOX, effectively separating classification and regression tasks.It employs BCE Loss for classification and DFL Loss + CIOU Loss for regression, replacing Anchor-Based designs with Anchor-Free alternatives.The model utilizes the Task-Aligned Assigner sample allocation strategy and improves training by disabling Mosaic data augmentation in the final 10 rounds, thereby enhancing accuracy.

Fig. 1 .

53Fig. 1.Improved YOLOv5 structure,It featuring three new paths with the RepBi-PAN fusion network.The original C3 module is replaced with Dense_C3, integrating dense connectivity.Attention mechanisms are introduced following each C3 module.

Fig. 2 .

54Fig. 2. RepBi-PAB.(a) is the overall network of the RepBi-PAN, and (b) is the structure of the BIC.

Fig. 3 .

55Fig. 3. Network structure improvement.The left is original structure, while the right side illustrates the new structure after the introduction of additional paths and convolutions.

Fig. 4 .

56Fig. 4. Dense Connect.A 5-layer dense block with a growth rate of k=4.Each layer takes all preceding featuremaps as input.

Fig. 5 .

57Fig. 5. Channel attention module.

58(True Positive): The model correctly identifies a positive sample.FN (False Negative): The model fails to identify a positive sample.FP (False Positive): The model incorrectly identifies a negative sample as positive.TN (True Negative): The model correctly identifies a negative sample.

( 7 )Fig. 6 .Fig. 7 .

59Fig. 6.NEU-DET dataset defects.Different colors are used for different categories.

Fig. 8 .

60Fig. 8.Comparison of Defect Identification.

Fig. 9 .Fig. 10 .Fig. 11 .

61Fig. 9. mAP.

Fig. 12 .

62Fig. 12.Comparison of detection result.The first row displays the original image, the second row depicts the test results using YOLOv5, and the third row illustrates the test results using the improved YOLOv5.

Fig. 13 .

63Fig. 13.GC10-DET dataset defects.

Fig. 14 .

64Fig. 14.Comparison of detection result in GC10-DET.The first row displays the recognition images obtained by YOLOv5 detection, while the second row presents the results obtained by YOLOv5-improved detection.

Table 1 .

65Experiment environment.

Table 2 .

66Initialization parameters.

67Vol:.(1234567890) Scientific Reports | (2025) 15:10371 | https://doi.org/10.1038/s41598-024-74601-3www.nature.com/scientificreports/

Table 3 .

68Confusion Matrix.

Table 4 .

69Comparison of attention mechanisms.

70Model P (%) R (%) mAP (%)

Table 5 .

71Ablation experiments.

Table 7 .

72Generalizability comparison.

73Model P (%) R (%) mAP (%)

GFLOPs Param Model file

74Vol.:(0123456789) Scientific Reports | (2025) 15:10371 | https://doi.org/10.1038/s41598-024-74601-3

참고문헌 36건

  1. Fast R-CNN 2015 10.1109/iccv.2015.169
  2. SSD: Single Shot MultiBox Detector Lecture notes in computer science · Springer Science+Business Media · 2016 10.1007/978-3-319-46448-0_2
  3. Surface Defect Recognition of Hot-rolled Steel Plates Based on Tetrolet Transform Journal of Mechanical Engineering · Chinese Journal of Mechanical Engineering · 2016 10.3901/jme.2016.04.013
  4. YOLO9000: Better, Faster, Stronger 2017 10.1109/cvpr.2017.690
  5. Squeeze-and-Excitation Networks 2018 10.1109/cvpr.2018.00745
  6. Modeling and recognition of steel-plate surface defects based on a new backward boosting algorithm The International Journal of Advanced Manufacturing Technology · Springer Science+Business Media · 2017 10.1007/s00170-017-1113-4
  7. CBAM: Convolutional Block Attention Module Lecture notes in computer science · Springer Science+Business Media · 2018 10.1007/978-3-030-01234-2_1
  8. Automatic Metallic Surface Defect Detection and Recognition with Convolutional Neural Networks Applied Sciences · Multidisciplinary Digital Publishing Institute · 2018 10.3390/app8091575
  9. Apple detection during different growth stages in orchards using the improved YOLO-V3 model Computers and Electronics in Agriculture · Elsevier BV · 2019 10.1016/j.compag.2019.01.012
  10. Rail Surface Defect Detection Method Based on YOLOv3 Deep Learning Networks 2018 10.1109/cac.2018.8623082
  11. You Only Look Once: Unified, Real-Time Object Detection 2016 10.1109/cvpr.2016.91
  12. Focal Loss for Dense Object Detection 2017 10.1109/iccv.2017.324
  13. Densely Connected Convolutional Networks 2017 10.1109/cvpr.2017.243
  14. High Efficient Single-stage Steel Surface Defect Detection 2019 10.1109/avss.2019.8909834
  15. Improved YOLO-V3 with DenseNet for Multi-Scale Remote Sensing Target Detection Sensors · Multidisciplinary Digital Publishing Institute · 2020 10.3390/s20154276
  16. Surface defect detection of steel strips based on classification priority YOLOv3-dense network Ironmaking & Steelmaking Processes Products and Applications · Taylor & Francis · 2020 10.1080/03019233.2020.1816806
  17. End-to-End Object Detection with Transformers Lecture notes in computer science · Springer Science+Business Media · 2020 10.1007/978-3-030-58452-8_13
  18. SSD: Single Shot MultiBox Detector Lecture notes in computer science · Springer Science+Business Media · 2016 10.1007/978-3-319-46448-0_2
  19. 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
  20. A New Steel Defect Detection Algorithm Based on Deep Learning Computational Intelligence and Neuroscience · Hindawi Publishing Corporation · 2021 10.1155/2021/5592878
  21. SimAM: A Simple, Parameter-Free Attention Module for Convolutional Neural Networks International Conference on Machine Learning · 2021
  22. Sparse R-CNN: End-to-End Object Detection with Learnable Proposals 2021 10.1109/cvpr46437.2021.01422
  23. An improved YOLO network for unopened cotton boll detection in the field Journal of Intelligent & Fuzzy Systems · IOS Press · 2021 10.3233/jifs-211514
  24. Online Detection of Surface Defects Based on Improved YOLOV3 Sensors · Multidisciplinary Digital Publishing Institute · 2022 10.3390/s22030817
  25. MSFT-YOLO: Improved YOLOv5 Based on Transformer for Detecting Defects of Steel Surface Sensors · Multidisciplinary Digital Publishing Institute · 2022 10.3390/s22093467
  26. ACTA Automatica SINICA IEEE Transactions on Automation Science and Engineering · Institute of Electrical and Electronics Engineers · 2006 10.1109/tase.2006.885284
  27. Review of surface defect detection of steel products based on machine vision IET Image Processing · Institution of Engineering and Technology · 2022 10.1049/ipr2.12647
  28. Low-pass U-Net: a segmentation method to improve strip steel defect detection Measurement Science and Technology · IOP Publishing · 2022 10.1088/1361-6501/aca34a
  29. Surface Defect Detection of Steel Products Based on Improved YOLOv5 2022 41st Chinese Control Conference (CCC) · 2022 10.23919/ccc55666.2022.9902037
  30. A Multi-Scale Traffic Object Detection Algorithm for Road Scenes Based on Improved YOLOv5 Electronics · Multidisciplinary Digital Publishing Institute · 2023 10.3390/electronics12040878
  31. Development of an Improved YOLOv7-Based Model for Detecting Defects on Strip Steel Surfaces Coatings · Multidisciplinary Digital Publishing Institute · 2023 10.3390/coatings13030536
  32. Research on an Insulator Defect Detection Method Based on Improved YOLOv5 Applied Sciences · Multidisciplinary Digital Publishing Institute · 2023 10.3390/app13095741
  33. YOLOv7: Trainable Bag-of-Freebies Sets New State-of-the-Art for Real-Time Object Detectors 2023 10.1109/cvpr52729.2023.00721
  34. YOLO-IMF: An Improved YOLOv8 Algorithm for Surface Defect Detection in Industrial Manufacturing Field Lecture notes in computer science · Springer Science+Business Media · 2023 10.1007/978-3-031-44754-9_2
  35. DETRs Beat YOLOs on Real-time Object Detection 2024 10.1109/cvpr52733.2024.01605
  36. YOLOv9: Learning What You Want to Learn Using Programmable Gradient Information Lecture notes in computer science · Springer Science+Business Media · 2024 10.1007/978-3-031-72751-1_1