Steel surface defect detection method based on improved YOLOv8n

By replacing the backbone network, neck network and detection head modules in the YOLOv8n model, an improved PEHead detection head is formed, which solves the problems of high computational complexity and slow inference speed in the prior art, and achieves high efficiency and accuracy in steel surface defect detection.

CN119624901APending Publication Date: 2025-03-14XIJING UNIV
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202411687295.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-25
Publication Date
2025-03-14

AI Technical Summary

Technical Problem

The prior art has problems such as high computational complexity and slow inference speed in the detection of steel surface defects, which is difficult to meet the real-time detection needs of industrial production.

Method used

By replacing the SPPF module with RFEM module in the backbone network of the YOLOv8n model, the deepest C2f module in the neck network is replaced with ASFM module, and using the SEAM feature extraction module in the detection head, forming an improved PEHead detection head to reduce network complexity and calculation amount.

Benefits of technology

It improves the efficiency and accuracy of steel surface defect detection, enhances the model's anti-interference ability and multi-scale feature extraction ability of background noise, which is suitable for real-time detection needs of industrial production.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119624901A_ABST
    Figure CN119624901A_ABST
Patent Text Reader

Abstract

The invention discloses a steel surface defect detection method based on improved YOLOv8n, and the method comprises the following steps: 1, carrying out the preprocessing of a steel surface defect data set, and dividing the data set into a training set, a verification set and a test set; 2, replacing an SPPF module in an original YOLOv8n model backbone network with an RFEM module, replacing a deepest C2f module in a neck network with an ASFM module, and replacing a 3 * 3 convolution module located behind a CBS block in a detection head with an SEAM feature extraction module so as to form a PEHead detection head, and constructing an improved YOLOv8n model; 3, firstly setting parameters, then performing iterative training on the improved YOLOv8n model by using the training set, and performing tuning on hyper-parameters of the improved YOLOv8n model by using the verification set in the training process to obtain an optimal model based on the improved YOLOv8n; and 4, detecting surface defects of steel to be detected by using the optimal improved YOLOv8n model, and outputting a detection result. According to the invention, the complexity and the calculation amount of the network are reduced, and the detection efficiency and the detection precision of steel surface defects are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of target detection, and specifically is a steel surface defect detection method based on improved YOLOv8n. Background Art

[0002] Steel materials are widely used in many fields such as construction, bridges, automobiles, aerospace, energy, etc. During the production process, due to the influence of various factors such as production technology, improper human operation, the quality of the materials used, the precision and stability of production equipment, and the temperature of the production environment, various defects such as cracks, inclusions, scratches and rust may occur on the surface of industrial products. These defects will not only reduce the mechanical properties, corrosion resistance and service life of steel, but may also pose a potential threat to the quality and safety of downstream products. Therefore, in order to obtain high-quality industrial steel products, quality control and inspection in the steel production process should be strengthened to detect and deal with defects in a timely manner.

[0003] As an indispensable part of industrial production, defect detection is of great significance for improving product quality, reducing quality management costs, improving production efficiency, ensuring product safety and adapting to diversified needs. The two most common detection methods in the field of industrial defect detection include human visual detection method and machine vision-based detection method. Among them: human visual detection can flexibly adapt to different detection environments and product characteristics, but is greatly affected by factors such as the experience, fatigue, and vision of the detection personnel, resulting in low accuracy and consistency of the detection results. Moreover, with the expansion of production scale, human visual detection has become increasingly difficult to meet the needs of efficient production; machine vision-based detection methods improve detection efficiency and avoid the influence of subjective factors, but require manual extraction of defect features and design of corresponding algorithms, which increases the workload, and the non-end-to-end learning method involved may cause error accumulation.

[0004] In recent years, deep learning has achieved encouraging results in various fields. The target detection method based on deep learning has shown its advantages in automation and accuracy in the surface defect detection of various industrial products. The target detection method based on deep learning can be roughly divided into two categories: one is a two-stage detector represented by Faster R-CNN, and the other is a single-stage detector represented by the YOLO series and SSD series. The workflow of the two-stage detector includes: first generating candidate regions, and then classifying and regressing these candidate regions. This staged processing helps to more accurately identify and locate targets, but the two-stage detector has high computational complexity and high time overhead. It is not suitable for real-time detection tasks and usually requires more computing resources. In contrast, YOLO has the advantages of high real-time and accuracy, which is more in line with the dual requirements of accuracy and real-time of industrial equipment. It has become a hot spot in current target detection research. For example: Chinese invention patent 202410615467.0 discloses a steel surface defect detection method based on improved YOLOv5. The SimAM attention mechanism is added to the backbone network of the original YOLOv5s model to improve the representation ability of the convolutional network, and the GSF module is used to replace all the C3 modules in the original network in the original YOLOv5s model to reduce the problem of too many parameters in the original convolution. Then, grouped convolution and channel shuffling operations are used to ensure that the network is lightweight while allowing effective interaction between channel information. At the same time, the SSFF module is introduced into the neck network in the original YOLOv5s model to combine the high-dimensional information of the deep feature map and the detailed information of the shallow feature map, so that the network can better learn the input features. Although it improves the detection accuracy of steel surface defects to a certain extent, the overall number of parameters of the improved network is relatively large, and the inference speed is slow, which is not conducive to deployment in factory equipment. Summary of the invention

[0005] In view of the shortcomings of the prior art, the purpose of the present invention is to provide a steel surface defect detection method based on improved YOLOv8n, which reduces the complexity and calculation amount of the network and improves the detection efficiency and detection accuracy of steel surface defects.

[0006] In order to achieve the above object, the present invention adopts the following technical solutions:

[0007] A steel surface defect detection method based on improved YOLOv8n comprises the following steps:

[0008] Step 1: Preprocess the images in the steel surface defect dataset, and then divide the preprocessed dataset into a training set, a validation set, and a test set;

[0009] Step 2: Build a steel surface defect detection model based on improved YOLOv8n. The specific process is as follows:

[0010] First, the SPPF module in the backbone network of the original YOLOv8n model is replaced with the RFEM module, and then the deepest C2f module in the neck network is replaced with the ASFM module. Then, the 3×3 convolution module behind the CBS block in the detection head is replaced with the SEAM feature extraction module to form the PEHead detection head.

[0011] Step 3: first set the parameters, then use the training set to iteratively train the steel surface defect detection model based on the improved YOLOv8n, and use the validation set to tune the hyperparameters of the steel surface defect detection model based on the improved YOLOv8n during the training process to obtain the optimal steel surface defect detection model based on the improved YOLOv8n;

[0012] Step 4: Use the optimal steel surface defect detection model based on improved YOLOv8n to detect the surface defects of the steel to be detected and output the detection results.

[0013] Furthermore, the steel surface defect dataset in step 1 is a NEU-DET dataset, which includes six types of steel surface defects, namely cracks, inclusions, plaques, pits, rolling scale and scratches.

[0014] Furthermore, the process of preprocessing the images in the steel surface defect dataset in step 1 is: using a conversion script to convert the labels in the XML format in the dataset into labels in the TXT format containing category and location information.

[0015] Furthermore, the step 1 divides the preprocessed data set into a training set, a validation set and a test set according to a sample quantity ratio of 8:1:1.

[0016] Furthermore, the process of setting the hyperparameters in step 2 is: the momentum parameter is set to 0.937, the learning rate control convergence speed is set to 0.001, the weight decay is set to 0.0005, the epoch is set to 200, the BatchSize is set to 8, and the optimizer is set to Adam.

[0017] Furthermore, the processing process of the input feature map by the RFEM module in step 2 is as follows: first, a 1×1 convolution operation is performed on the input feature map, and then three MaxPool2d layers of 5×5 size, stride 1 and padding 2 are used in sequence to perform pooling processing on the feature map after the 1×1 convolution operation, and then the input feature map, the feature map after the 1×1 convolution operation and the feature map after each pooling processing are spliced ​​and fused using a 1×1 convolution module to obtain a fused feature map, and then the fused feature map is convolved through a cascade of 1×3 depth convolution, 3×1 depth convolution, 1×5 depth expansion convolution and 5×1 depth expansion convolution in sequence, and then the feature map output by the 5×1 depth expansion convolution is multiplied with the fused feature map, and finally, the multiplied feature map is subjected to a 1×1 convolution operation to obtain the output feature map of the RFEM module.

[0018] Furthermore, the processing process of the input feature map by the ASFM module in step 2 is as follows: first use a 1×1 convolution module to perform feature fusion on the input feature map, then pass through the BN layer and the SiLU activation function in sequence to obtain an intermediate feature map, and then split the intermediate feature map into two parts, one part is directly passed to the Concat block, and the other part is passed to the MSBlock. The feature map processed by the MSBlock and the feature map directly transferred to the Concat block are spliced ​​in the channel dimension to form a fused feature map, and finally a 1×1 convolution layer is used to perform a convolution operation on the fused feature map to obtain the output feature map of the ASFM module.

[0019] Furthermore, the processing process of the PEHead detection head of step 2 on the input feature map is: first, the input feature map is extracted through a convolution layer with a convolution kernel size of 3×3 and a step size of 1, and then the input feature maps on different channels are mixed in turn using the BN layer and the SiLU activation function to obtain a mixed feature map F, and then the mixed feature map F is processed using the SEAM feature extraction module, and then the output feature map of the SEAM feature extraction module is adjusted for channel and feature fusion using 1×1 convolution.

[0020] Furthermore, the process of the SEAM feature extraction module processing the mixed feature map is as follows: the mixed feature map F passes through 3×3 depth convolution, GELU activation function and BN layer in sequence, and is output as an intermediate feature map F1; the intermediate feature map F1 and the mixed feature map F are added to obtain a smoothed feature map; the smoothed feature map passes through 1×1 point-by-point convolution, GELU activation function and BN layer in sequence, and is output as a feature map F2; after adding the feature map F2 and the mixed feature map F, they pass through the AdaptiveAvgPool2d module, Linear module, ReLU activation function, Linear module and Sigmoid activation function in sequence to output a feature map F3; the feature map F3 is multiplied by the mixed feature map F to obtain the output feature map of the SEAM feature extraction module.

[0021] Compared with the prior art, the present invention has the following technical effects:

[0022] The present invention can effectively improve the detection efficiency and accuracy of steel surface defects by improving the original YOLOv8n model. The reasons are as follows: 1) The RFEM module is used to replace the SPPF module of the original network in the backbone network of the original YOLOv8n model, which can effectively expand the receptive field of the backbone network and greatly enhance the model's anti-interference ability to background noise, so that the model can learn accurate and rich features, effectively capture the difference and connection between background and defects, and effectively solve the difficulties faced by steel surface defect detection. Compared with the original YOLOv8n model, it has stronger adaptability; 2) The introduced ASFM module further enriches the neck through more branches The gradient flow of the network can promote the feature fusion network to learn global information, thereby effectively improving the multi-scale feature extraction capability of the model, realizing the effective fusion of high-level semantic information of the backbone network and the neck network, enhancing the global perception capability of the network, and reducing the interference caused by background noise in steel surface defect detection; 3) Replace the original detection head with the PEHead detection head. The PEHead detection head uses the SEAM module to replace the Conv module in the original network, which reduces the complexity and computational complexity of the network, and can improve the network's detection performance and recall rate for multi-scale targets, thereby achieving a balance between accuracy and efficiency, and well meeting the requirements of steel surface defect detection tasks in industrial production. BRIEF DESCRIPTION OF THE DRAWINGS

[0023] Figure 1 This is a flow chart of steel surface defect detection based on the improved YOLOv8n model of the present invention;

[0024] Figure 2 This is a schematic diagram of the structure of the improved YOLOv8n model of the present invention;

[0025] Figure 3This is a schematic diagram of the structure of the SPPF module in the original YOLOv8n model;

[0026] Figure 4 This is a schematic diagram of the structure of the RFEM module of the present invention;

[0027] Figure 5 This is a schematic diagram of the structure of the C2f detection head in the original YOLOv8n model;

[0028] Figure 6 It is a structural schematic diagram of the ASFM module of the present invention;

[0029] Figure 7 It is a schematic diagram of the structure of the PEHead detection head of the present invention;

[0030] Figure 8 This is a schematic diagram of the structure of the detection head in the original YOLOv8n model;

[0031] Fig. 9 This is the change chart of the detection result indicators of the original YOLOv8n model;

[0032] Fig.10 The detection result index change diagram of the improved YOLOv8n model of the present invention;

[0033] Fig.11 The detection result diagram of the improved YOLOv8n model on the test set is shown in the figure. DETAILED DESCRIPTION

[0034] The specific contents of the present invention are further explained in detail below in conjunction with embodiments.

[0035] like Figure 1 As shown, a steel surface defect detection method based on improved YOLOv8n is characterized by comprising the following steps:

[0036] Step 1: Preprocess the images in the steel surface defect dataset, and then divide the preprocessed dataset into a training set, a validation set, and a test set, where:

[0037] The steel surface defect dataset is the NEU-DET dataset, which includes six typical types of steel surface defects, namely cracks, inclusions, plaques, pits, rolling scale and scratches;

[0038] The process of preprocessing the images in the steel surface defect dataset is as follows: using a conversion script to convert the XML format labels in the dataset into TXT format labels containing category and location information, obtaining the preprocessed dataset to meet the annotation file type of the YOLOv8n network model, and then dividing the preprocessed dataset into training set, validation set and test set according to the sample number ratio of 8:1:1;

[0039] Step 2: Build Figure 2 The steel surface defect detection model based on improved YOLOv8n shown in the figure has the following specific process:

[0040] Step 2.1, replace all SPPF modules in the backbone network of the original YOLOv8n model with RFEM modules to effectively enhance the receptive field of the backbone network. The RFEM module uses the idea of ​​large kernel convolution and multi-branch structure to decompose the two-dimensional convolution kernel of the deep convolution layer into cascaded horizontal and vertical one-dimensional convolution kernels, so that the deep convolution layer with large convolution kernels can be directly used in the attention module without the need for additional modules. By combining the cascaded convolution with the multi-branch structure, the problem of insufficient receptive field in the original SPPF module can be effectively solved. The attention mechanism composed of the cascaded convolution layers can effectively integrate the fused multi-branch gradient flow and capture richer semantic information and detailed positioning information; the structures of the SPPF module and the RFEM module are as follows: Figure 3 and Figure 4 As shown in the figure, the RFEM module processes the input characteristic diagram as follows:

[0041] Step 2.1.1. Use 1×1 convolution to adjust the number of channels of the feature map input to the RFEM module to c_ and perform feature fusion, where: c_=c1 / 2, c_ is half of the number of input channels c1 of the feature map, and the other half is used as hidden channels;

[0042] Step 2.1.2, use three MaxPool2d layers of size 5×5, stride 1 and padding 2 to pool the feature map after the 1×1 convolution operation. Through three stacked pooling layers, the receptive field of the model can be effectively expanded and the dependency relationship between long-distance pixels can be established;

[0043] Step 2.1.3, concatenate the feature map of the input RFEM module, the feature map after the 1×1 convolution operation, the feature map after the first pooling process, the feature map after the second pooling process, and the feature map after the third pooling process, and fuse them using the 1×1 convolution module to achieve full information interaction and adjust the number of channels from 4×c_ to the number of output channels c2 to obtain the fused feature map;

[0044] Step 2.1.4, convolve the fused feature map through cascaded 1×3 depth convolution, 3×1 depth convolution, 1×5 depth expansion convolution and 5×1 depth expansion convolution in turn to obtain a feature map with a larger receptive field of view;

[0045] Step 2.1.5: Multiply the feature map output by the 5×1 depth dilated convolution with the fused feature map. Then, perform a 1×1 convolution operation on the multiplied feature map to obtain the output feature map of the RFEM module, which achieves the focus on global information.

[0046] Step 2.2, replace the deepest C2f module in the neck network of the original YOLOv8n model with the ASFM module. The MSBlock module in the ASFM module divides the input features and passes them to multiple branches. Each branch processes a different feature subset, and then fuses the features of these branches through 1x1 convolution to integrate the information of each branch. This hierarchical feature fusion strategy improves the model's detection performance for targets of various sizes. At the same time, the multi-branch structure in ASFM can converge rich gradient flows, thereby realizing feature interaction and fusion. The C2f module and ASFM module are respectively as follows: Figure 5 and Figure 6 As shown in the figure, the processing process of the ASFM module on the input feature map is:

[0047] Step 2.2.1, first use the 1×1 convolution module to fuse the input feature map, then pass it through the BN layer to accelerate the training process of the neural network, and then activate the feature map through the SiLU activation function to obtain the intermediate feature map;

[0048] Step 2.2.2, split the intermediate feature map into two parts, one part is directly passed to the Concat block, and the other part is passed to MSBlock. The feature map processed by MSBlock and the feature map directly transferred to the Concat block are spliced ​​in the channel dimension to form a fused feature map, realizing multi-scale feature interaction;

[0049] Step 2.2.3, use a 1×1 convolutional layer to perform a convolution operation on the fused feature map to obtain the output feature map of the ASFM module;

[0050] Step 2.3, replace the 3×3 convolution module behind the CBS block in the original YOLOv8n model detection head with the SEAM feature extraction module to form the PEHead detection head. The original YOLOv8n model detection head and the PEHead detection head are as follows: Figure 8 and Figure 7As shown in the figure, compared with the problem of too large parameters and computational complexity of the detection head in the original network, the 3×3 convolution module in the original YOLOv8n model detection head is replaced with the SEAM feature extraction module in YOLO-FaceV2, so that it can sensitively perceive the changes in defect scales and effectively identify the characteristics of different defects, while suppressing background interference and improving the recall rate of the model. At the same time, PEHead can significantly reduce model parameters, thereby reducing the complexity and computational complexity of the model, which is conducive to deploying the model on the production line. The processing process of the PEHead detection head on the input feature map is:

[0051] Step 2.3.1, use a convolution layer with a convolution kernel size of 3×3 and a stride of 1 to extract the feature map input to the PEHead detection head, and then use the BN layer and SiLU activation function in turn to mix the input feature maps on different channels to obtain the mixed feature map F;

[0052] Step 2.3.2: Use the SEAM feature extraction module to process the mixed feature map F. The specific process is as follows:

[0053] Step 2.3.2.1, the mixed feature map F passes through 3×3 depth convolution, GELU activation function and BN layer in turn, and the output is the intermediate feature map F1;

[0054] Step 2.3.2.2, add the intermediate feature map F1 and the mixed feature map F to obtain a smoothed feature map;

[0055] Step 2.3.2.3, the smoothed feature map is sequentially subjected to 1×1 point-by-point convolution, GELU activation function and BN layer, and the output is feature map F2;

[0056] Step 2.3.2.4, add the feature map F2 and the mixed feature map F;

[0057] Step 2.3.2.5, pass the feature map added in step 2.3.2.4 through the AdaptiveAvgPool2d module, Linear module, ReLU activation function, Linear module and Sigmoid activation function in sequence, and output feature map F3;

[0058] Step 2.3.2.6, multiply the feature map F3 and the mixed feature map F to obtain the output feature map of the SEAM feature extraction module;

[0059] Step 2.3.3, use 1×1 convolution to adjust the channels and fuse the features of the output feature map of the SEAM feature extraction module;

[0060] Step 3: first set the parameters, then use the training set to iteratively train the steel surface defect detection model based on the improved YOLOv8n, and use the validation set to tune the hyperparameters of the steel surface defect detection model based on the improved YOLOv8n during the training process to obtain the optimal steel surface defect detection model based on the improved YOLOv8n;

[0061] When the training set is used to train the steel surface defect detection model based on the improved YOLOv8n, the specific parameters set include: the momentum parameter is set to 0.937, the learning rate control convergence speed is set to 0.001, the weight decay is set to 0.0005, the epoch is set to 200, the BatchSize is set to 8, and the optimizer is set to Adam; in order to meet the model input requirements, the image size is uniformly set to 640×640 pixels;

[0062] Step 4: Use the optimal steel surface defect detection model based on improved YOLOv8n to detect the surface defects of the steel to be inspected and output the detection results.

[0063] In order to evaluate the performance of the steel surface defect detection method based on the improved YOLOv8n proposed in this embodiment, the original YOLOv8n model and the steel surface defect detection model based on the improved YOLOv8n are tested using the test set. The test results are shown in Table 1. Figures 9 to 11 As shown;

[0064] The evaluation indicators in Table 1 include parameter quantity (Parameter), mean average precision (mAP, mean AveragePrecision), number of frames per second (FPS, Frames Per Second), precision (Precision) and recall (Recall), where: precision refers to the number of correctly predicted positive samples in the prediction data set divided by the number of positive samples predicted by the model, and recall refers to the number of correctly predicted positive samples in the prediction data set divided by the number of actual positive samples. It can be seen from Table 1 that the mean average precision (mAP) is related to precision (Precision) and recall (Recall), and the improved YOLOv8n network model has an average precision of 3.5% higher than the original YOLOv8n.

[0065] Table 1 Test results of the original YOLOv8n model and the improved YOLOv8n model

[0066] Methods Params↓ FPS↑ <![CDATA[mAP 50 ↑]]> P↑ R↑ YOLOv8n 3.15 198.1 74.6 0.668 0.710 This article's algorithm 3.09 125.4 78.2 0.709 0.745

[0067] During the test, when the test results are not ideal, the learning rate is adjusted and retrained. After the test meets the requirements, the NEU-DET data set is input into the trained original YOLOv8n model and the improved YOLOv8n model respectively. The location and category information of the surface defects of steel materials, the detection result indicators of the two models change as follows: Fig. 9 and Fig.10 As shown in the figure, by comparison, it is found that the improved YOLOv8n network model has basically significantly improved the average detection accuracy of the six types of defects in the NEU-DET dataset. Overall, its average detection accuracy of the six common defects has increased by 3.6%.

[0068] Fig.11 Some detection results of the improved YOLOv8n model on the test set are shown. It can be seen that the surface defects of steel have the characteristics of large scale changes and dispersion. The improved YOLOv8n network model has greatly improved the detection accuracy of these defects and can effectively avoid the missed detection of small target defects.

Claims

1. A steel surface defect detection method based on improved YOLOv8n, characterized in that: The steps include: Step 1: Preprocess the images in the steel surface defect dataset, and then divide the preprocessed dataset into a training set, a validation set, and a test set; Step 2: Build a steel surface defect detection model based on improved YOLOv8n. The specific process is as follows: First, the SPPF module in the backbone network of the original YOLOv8n model is replaced with the RFEM module, and then the deepest C2f module in the neck network is replaced with the ASFM module. Then, the 3×3 convolution module behind the CBS block in the detection head is replaced with the SEAM feature extraction module to form the PEHead detection head. Step 3: first set the parameters, then use the training set to iteratively train the steel surface defect detection model based on the improved YOLOv8n, and use the validation set to tune the hyperparameters of the steel surface defect detection model based on the improved YOLOv8n during the training process to obtain the optimal steel surface defect detection model based on the improved YOLOv8n; Step 4: Use the optimal steel surface defect detection model based on improved YOLOv8n to detect the surface defects of the steel to be inspected and output the detection results.

2. The steel surface defect detection method based on improved YOLOv8n according to claim 1 is characterized in that: The steel surface defect dataset in step 1 is the NEU-DET dataset, which includes six types of steel surface defects, namely cracks, inclusions, plaques, pits, rolling scale and scratches.

3. The steel surface defect detection method based on improved YOLOv8n according to claim 1 is characterized in that: The process of preprocessing the images in the steel surface defect dataset in step 1 is: using a conversion script to convert the labels in the XML format in the dataset into labels in the TXT format containing category and location information.

4. The steel surface defect detection method based on improved YOLOv8n according to claim 1, characterized in that: The step 1 divides the preprocessed data set into a training set, a validation set and a test set according to a sample quantity ratio of 8:1:

1.

5. The steel surface defect detection method based on improved YOLOv8n according to claim 1, characterized in that: The process of setting the hyperparameters in step 2 is: the momentum parameter is set to 0.937, the learning rate control convergence speed is set to 0.001, the weight decay is set to 0.0005, the epoch is set to 200, the BatchSize is set to 8, and the optimizer is set to Adam.

6. The steel surface defect detection method based on improved YOLOv8n according to claim 1, characterized in that: The processing process of the input feature map by the RFEM module in step 2 is as follows: first, a 1×1 convolution operation is performed on the input feature map, and then three MaxPool2d layers of 5×5 size, stride 1 and padding 2 are used in sequence to perform pooling processing on the feature map after the 1×1 convolution operation, and then the input feature map, the feature map after the 1×1 convolution operation and the feature map after each pooling processing are spliced ​​and fused using a 1×1 convolution module to obtain a fused feature map, and then the fused feature map is convolved through a cascade of 1×3 depth convolution, 3×1 depth convolution, 1×5 depth expansion convolution and 5×1 depth expansion convolution in sequence, and then the feature map output by the 5×1 depth expansion convolution and the fused feature map are multiplied, and finally, the multiplied feature map is subjected to a 1×1 convolution operation to obtain the output feature map of the RFEM module.

7. The steel surface defect detection method based on improved YOLOv8n according to claim 1, characterized in that: The processing process of the input feature map by the ASFM module in step 2 is as follows: first use a 1×1 convolution module to perform feature fusion on the input feature map, then pass it through a BN layer and a SiLU activation function in sequence to obtain an intermediate feature map, and then split the intermediate feature map into two parts, one part is directly passed to the Concat block, and the other part is passed to the MSBlock. The feature map processed by the MSBlock and the feature map directly transferred to the Concat block are spliced ​​in the channel dimension to form a fused feature map, and finally a 1×1 convolution layer is used to perform a convolution operation on the fused feature map to obtain the output feature map of the ASFM module.

8. The steel surface defect detection method based on improved YOLOv8n according to claim 1 is characterized in that: The processing process of the input feature map by the PEHead detection head in step 2 is as follows: first, the input feature map is extracted through a convolution layer with a convolution kernel size of 3×3 and a step size of 1, and then the input feature maps on different channels are mixed using the BN layer and the SiLU activation function in turn to obtain a mixed feature map F, and then the mixed feature map F is processed using the SEAM feature extraction module, and then the output feature map of the SEAM feature extraction module is adjusted for channel and feature fusion using a 1×1 convolution.

9. The steel surface defect detection method based on improved YOLOv8n according to claim 8, characterized in that: The process of the SEAM feature extraction module processing the mixed feature map is as follows: the mixed feature map F passes through 3×3 depth convolution, GELU activation function and BN layer in sequence, and is output as an intermediate feature map F1; the intermediate feature map F1 and the mixed feature map F are added to obtain a smoothed feature map; the smoothed feature map passes through 1×1 point-by-point convolution, GELU activation function and BN layer in sequence, and is output as a feature map F2; after adding the feature map F2 and the mixed feature map F, they pass through the AdaptiveAvgPool2d module, Linear module, ReLU activation function, Linear module and Sigmoid activation function in sequence to output a feature map F3; the feature map F3 is multiplied by the mixed feature map F to obtain the output feature map of the SEAM feature extraction module.

Citation Information

Patent Citations

  • Steel surface defect detection system and method based on improved YOLOv5s

    CN118570138A