A strip steel surface defect detection method based on improved YOLOv11
By improving the YOLOv11 model, introducing deformable convolution and hybrid channel attention mechanisms, and optimizing the YOLOv11 model structure, the problems of accurately identifying extremely small defects and insufficient robustness in strip surface defect detection are solved, achieving efficient defect detection and quality control.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- NORTHEASTERN UNIV CHINA
- Filing Date
- 2025-06-06
- Publication Date
- 2026-07-03
AI Technical Summary
Existing YOLO algorithms have limitations in detecting surface defects on steel strips. They struggle to accurately identify extremely small defects when processing high-resolution images and massive amounts of data, and they lack robustness under complex backgrounds and varying lighting conditions.
By improving the YOLOv11 model, we introduce the C3k2_MDConv module with deformable convolution mechanism, the C2PSA module with hybrid local channel attention, and the bounding box localization loss function to optimize the model structure and enhance the ability to capture features at different scales and improve detection accuracy.
It enables rapid and accurate identification of surface defects in strip steel, improves product qualification rate, and provides a reliable quality control solution.
Smart Images

Figure CN120746939B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of steel plate defect detection technology, and relates to a method for detecting surface defects in strip steel based on an improved YOLOv11. Background Technology
[0002] Metallic materials are undoubtedly the cornerstone of modern industrial and social development, and steel sheet and strip materials are a key supporting force within it. In the production of steel sheet and strip, the rolling process is crucial, as it precisely shapes the dimensional accuracy and surface quality of the material to meet the increasingly stringent demands of high-end manufacturing. However, during the rolling process, due to the interplay of factors such as the precision of the rolling equipment, the complexity of process parameters, and subtle differences in raw material properties, various defects, such as scratches, inclusions, and pitting, are easily generated on the surface of the sheet and strip. These defects can have a significant impact on the quality of the finished product.
[0003] In recent years, with the development of deep learning, Convolutional Neural Networks (CNNs) have become one of the important means to solve surface defect detection. They possess the ability to automatically and accurately extract image features, replacing the tedious and complex manual feature extraction process in traditional methods. They can directly and accurately locate and classify defects of various styles and scales from massive and complex strip surface image data. In the field of defect detection, CNN-based strip surface detection methods can be divided into single-stage detection methods represented by the YOLO series of algorithms and two-stage detection methods represented by the R-CNN series of algorithms. Among them, the YOLO algorithm, with its high efficiency, speed, and good accuracy, has received widespread attention in the industry and has become a subject of extensive research by scholars.
[0004] Although the YOLO algorithm is favored for its simple model structure, fast processing capabilities, and high efficiency in strip surface defect detection, it still faces several challenges in practical applications. First, when dealing with extremely high-resolution images or massive amounts of data, while YOLO maintains a high detection speed, it performs poorly in accurately identifying extremely small defects or complex and varied morphologies, easily leading to missed detections or false positives. Second, under complex strip surface backgrounds and varying lighting conditions, the YOLO algorithm exhibits certain limitations; its robustness is insufficient to ensure consistently high-precision detection results under various working conditions. Summary of the Invention
[0005] To address the aforementioned technical problems, the purpose of this invention is to provide a method for detecting surface defects in strip steel based on an improved YOLOv11.
[0006] This invention provides a method for detecting surface defects in strip steel based on an improved YOLOv11, comprising:
[0007] Step 1: Acquire image data of defects in the strip steel and perform preprocessing;
[0008] Step 2: Divide the preprocessed strip defect image data into a training set and a validation set in an 8:2 ratio;
[0009] Step 3: Construct a strip defect detection model based on the improved YOLOv11;
[0010] Step 4: Train the improved YOLOv11 strip defect detection model using the training set data;
[0011] Step 5: Evaluate the performance of the strip defect detection model based on the improved YOLOv11 using the validation set;
[0012] Step 6: Collect strip surface image data at the rolling site, use the trained strip defect detection model based on improved YOLOv11 to detect strip surface defects, and output the defect location and defect type.
[0013] Furthermore, the preprocessing in step 1 specifically includes:
[0014] Labelme software was used to annotate the defect locations and types in strip defect image data to obtain a strip defect image dataset.
[0015] Furthermore, the strip defect detection model based on the improved YOLOv11 in step 3 has been improved as follows:
[0016] (1) A deformable convolution mechanism was introduced into the backbone and neck network of the YOLOv11 model, and the original C3k2 module was optimized into the C3k2_MDConv module, so that the model can dynamically adjust the size of the receptive field and capture feature information at different scales more effectively.
[0017] (2) A hybrid local channel attention mechanism was introduced into the original C2PSA module of the backbone network to form a new hybrid channel attention C2PSA module, thereby enhancing the model’s attention to key features;
[0018] (3) For the backbone network of the YOLOv11 model, the original SPPF module is replaced with the intra-scale feature interaction module AIFI to enhance the interaction capability between multi-scale features.
[0019] (4) Adopt a bounding box localization loss function that considers the influence of the inherent properties of the bounding box's shape and scale on the bounding box regression to improve the accuracy of the model in bounding box prediction;
[0020] (5) Hybrid Channel Attention (MLCA) modules were added to the small target detection layer, medium target detection layer and large target detection layer of the head network to enhance the model’s detection performance for targets of different sizes.
[0021] Furthermore, the strip defect detection model based on the improved YOLOv11 includes: a backbone network, a neck network, and a head network;
[0022] The backbone network includes two basic convolutional modules, four C3k2_MDConv modules, three convolutional downsampling modules based on convolutional operations, one AIFI module, and one hybrid channel attention C2PSA module. The two basic convolutional modules in the backbone network are layers 0 and 1, respectively; the four C3k2_MDConv modules are layers 2, 5, 7, and 9, respectively; the three convolutional downsampling modules are layers 3, 6, and 8, respectively; the AIFI module is layer 10; and the hybrid channel attention C2PSA module is layer 11. The original strip defect image data is sequentially input into the first convolutional module, the second convolutional module, the first C3k2_MDConv module, the first convolutional downsampling module, the second C3k2_MDConv module, the second convolutional downsampling module, the third C3k2_MDConv module, the third convolutional downsampling module, the fourth C3k2_MDConv module, the AIFI module, and the hybrid channel attention C2PSA module of the backbone network for feature extraction.
[0023] Furthermore, in the C3k2_MDConv module, the input feature map is processed by convolution and then copied into two identical parts. The first part of the feature map is input into multiple sequentially connected Bottleneck modules containing variable convolutions for processing. The output of the first part is concatenated with the result of the second part of the feature map after convolution. The concatenated feature map is then convolved and output. The Bottleneck module containing variable convolutions incorporates variable convolutions into the original Bottleneck module. In the Bottleneck module containing variable convolutions, the input feature map is first processed by convolution and the MDConv module, and then concatenated with the input feature map to obtain the output result.
[0024] Furthermore, the hybrid channel attention C2PSA module introduces a hybrid local channel attention mechanism into its PSA module to form an MLCA_PSA module based on the original C2PSA module. In the hybrid channel attention C2PSA module, the input feature map is convolved and then copied into two identical parts. The first part of the feature map is input into multiple MLCA_PSA modules connected in sequence for processing. The output of the first part of the feature map is concatenated with the second part of the feature map. The concatenated feature map is then convolved and output.
[0025] Each MLCA_PSA module, based on the original PSA module, optimizes the original Attention module into a hybrid channel attention MLCA module in the first separation operation to better capture local and global features. In the hybrid channel attention MLCA module, the input feature map is sequentially processed by local average pooling and global average pooling for feature extraction. After local and global feature extraction, the features are rearranged and then convolved. Local features are depooled after convolution to restore their original spatial dimensions. Global features, after convolution, are converted into a form suitable for addition with local features, and then weighted and summed with local features according to preset weights to generate the final attention map. This attention map is then depooled and multiplied with the original input feature map.
[0026] Furthermore, the neck network includes: four C3k2_MDConv modules, four Concat modules, two upsampling modules, and two convolutional modules; the feature map processed by the C2PSA module of the backbone network with hybrid channel attention is used as the input of the first upsampling module; the output of the first upsampling module is concatenated with the output of the third C3k2_MDConv module in the first Concat module; the concatenated result is concatenated with the output of the fifth C3k2_MDConv module, the second upsampling module, and the second C3k2_MDConv module in the second Concat module; the concatenated result is concatenated with the output of the fifth C3k2_MDConv module after passing through the sixth C3k2_MDConv module and the third convolutional module in the third Concat module; the concatenated result is concatenated with the output of the fifth C3k2_MDConv module after passing through the seventh C3k2_MDConv module and the fourth convolutional module in the fourth Concat module; and the concatenated result is input to the eighth C3k2_MDConv module.
[0027] Furthermore, the head network includes three hybrid channel attention (MLCA) modules and three detection modules.
[0028] The feature map processed by the sixth C3k2_MDConv module in the neck network is processed by the first hybrid channel attention MLCA module of the head network to output a small-sized target prediction result; the feature map processed by the seventh C3k2_MDConv module is processed by the second hybrid channel attention MLCA module to output a medium-sized target prediction result; the feature map processed by the eighth C3k2_MDConv module is processed by the third hybrid channel attention MLCA module to output a large-sized target prediction result.
[0029] Furthermore, the bounding box localization loss function is specifically as follows:
[0030] Loss ShapeIoU =1-IoU+d shape +0.5×Ω shape
[0031] Among them, Loss ShapeIoU The bounding box localization loss function is represented by IoU, which represents the intersection-union ratio between the predicted bounding box and the ground truth bounding box. Shape The distance term representing shape loss; Ω Shape Shape terms representing shape loss;
[0032]
[0033] Where B represents the predicted bounding box and Bgt represents the ground truth bounding box;
[0034]
[0035] Where w and h represent the width and height of the predicted loss box, w gt and h gt Indicates the width and height of the annotation box, x c y c Indicates the center coordinates of the prediction box. The coordinates of the center of the bounding box are represented by , c represents the straight-line distance between the center coordinates of the predicted box and the center coordinates of the bounding box, and scale is the scale factor, which is set to 1.2;
[0036]
[0037] Where t represents the width or height of the loss box, ωt represents the weight of the shape similarity loss, and θ is a constant term.
[0038] The present invention provides a method for detecting surface defects in strip steel based on an improved YOLOv11, which has the following advantages:
[0039] This invention proposes an improved YOLOv11 network by creating a C3k2_MDConv2 module through the fusion of the C3k2 module and a deformable convolution mechanism. This module replaces the original C3k2 module in the backbone network, thereby expanding the receptive field of the convolutional kernel and enhancing the network's ability to capture features of defects of different sizes on the surface of the strip. Furthermore, the AIFI module replaces the original pyramid pooling layer SPPF to further optimize the fusion process of multi-scale features. Simultaneously, this invention combines the C2PSA module with the Hybrid Local Channel Attention (MLCA) module to form a hybrid channel attention C2PSA module, which effectively combines local and global features, as well as spatial and channel information, improving the model's understanding of the overall content. The MLCA module is introduced into the large, medium, and small target detection layers in the head, allowing contextual information to be fused with attention mechanisms for targets of different sizes, enhancing the predictive performance of the detection layers. Additionally, this invention uses ShapeIoU as the loss function, which considers the influence of bounding box shape and scale, improving the accuracy of localization regression. This invention enables rapid and accurate identification of various surface defects during the production of strip and sheet products, timely issuance of alarms, and effectively improves the product qualification rate, providing enterprises with a reliable quality control solution. Attached Figure Description
[0040] Figure 1 This is a flowchart of a strip steel surface defect detection method based on the improved YOLOv11 according to the present invention;
[0041] Figure 2 This is the overall framework diagram of the strip steel defect detection model based on the improved YOLOv11 of the present invention;
[0042] Figure 3 This is a structural diagram of the C3k2_MDConv module of the present invention;
[0043] Figure 4 This is a structural diagram of the AIFI module of the present invention.
[0044] Figure 5 This is a structural diagram of the C2PSA module for hybrid channel attention of the present invention;
[0045] Figure 6 This is a structural diagram of the Hybrid Channel Attention (MLCA) module of the present invention. Detailed Implementation
[0046] like Figure 1 As shown, the present invention provides a method for detecting surface defects in strip steel based on an improved YOLOv11, comprising:
[0047] Step 1: Acquire image data of defects in the strip steel and perform preprocessing, specifically:
[0048] Obtain a public dataset, taking the NEU-DET dataset as an example. This dataset mainly contains six typical defects in the strip production process, namely iron oxide scale, stains, cracks, scratches, inclusions and surface corrosion. The dataset contains a total of 1,800 images, with 300 images for each type of defect.
[0049] Labelme software was used to annotate the defect locations and types in strip defect image data to obtain a strip defect image dataset.
[0050] Step 2: Divide the preprocessed strip defect image data into training set and validation set in an 8:2 ratio.
[0051] Step 3: Construct a strip defect detection model based on the improved YOLOv11.
[0052] In specific implementation, the strip defect detection model based on the improved YOLOv11 of this invention makes the following improvements to the YOLOv11 model:
[0053] (1) A deformable convolution mechanism was introduced into the backbone and neck network of the YOLOv11 model, and the original C3k2 module was optimized into the C3k2_MDConv module, which enables the model to dynamically adjust the size of the receptive field and capture feature information at different scales more effectively.
[0054] (2) A hybrid local channel attention mechanism was introduced into the original C2PSA module of the backbone network to form a new hybrid channel attention C2PSA module, thereby enhancing the model’s attention to key features.
[0055] (3) For the backbone network of the YOLOv11 model, the original SPPF module is replaced with the intra-scale feature interaction module AIFI to enhance the interaction capability between multi-scale features.
[0056] (4) A bounding box localization loss function that considers the influence of the inherent properties of the bounding box's shape and scale on the bounding box regression is adopted to improve the accuracy of the model in bounding box prediction.
[0057] (5) A hybrid channel attention (MLCA) module was added to the small target detection layer, medium target detection layer and large target detection layer of the head network to enhance the model’s detection performance for targets of different sizes.
[0058] like Figure 2 As shown, the strip defect detection model based on the improved YOLOv11 includes: a backbone network, a neck network, and a head network.
[0059] The backbone network includes two basic convolutional modules, four C3k2_MDConv modules, three convolutional downsampling modules based on convolutional operations, one AIFI module, and one hybrid channel attention C2PSA module. The two basic convolutional modules in the backbone network are layers 0 and 1, respectively; the four C3k2_MDConv modules are layers 2, 5, 7, and 9, respectively; the three convolutional downsampling modules are layers 3, 6, and 8, respectively; the AIFI module is layer 10; and the hybrid channel attention C2PSA module is layer 11.
[0060] The original strip defect image data is sequentially input into the first convolutional module, the second convolutional module, the first C3k2_MDConv module, the first convolutional downsampling module, the second C3k2_MDConv module, the second convolutional downsampling module, the third C3k2_MDConv module, the third convolutional downsampling module, the fourth C3k2_MDConv module, the AIFI module, and the C2PSA module with hybrid channel attention for feature extraction.
[0061] like Figure 3 The diagram shows the network structure of the C3k2_MDConv module. In the C3k2_MDConv module, the input feature map undergoes a convolution operation and is then duplicated into two identical parts. The first part of the feature map is fed into multiple sequentially connected Bottleneck modules containing variable convolutions for processing. Its output is then concatenated with the result of the second part of the feature map after a convolution operation. The concatenated feature map is then convolved and output. The Bottleneck module with variable convolutions incorporates variable convolutions into the original Bottleneck module. In this module, the input feature map is first processed by convolution and the MDConv module before being concatenated with the input feature map to obtain the output.
[0062] Specifically, when processing the feature maps input to the C3k2_MDConv module, a standard convolution operation is performed first. This process uses a 3×3 kernel with a stride of 1, compressing the original number of channels to half. After this ordinary convolution, the newly generated feature map is copied into two parts: one part is prepared for subsequent processing, and the other part is planned for later concatenation with the processed results. The part of the features intended for subsequent processing is fed into a series of Bottleneck modules containing variable convolutions for in-depth processing. Within these Bottleneck modules, the input feature map first undergoes a standard convolution operation, followed by more complex variable convolution processing in the MDConv module. This design allows the model to dynamically adjust the position of the convolution kernel sampling points, thereby capturing target details that are difficult to cover by traditional fixed-shape convolution kernels. Furthermore, at the end of each Bottleneck module containing variable convolutions, a residual connection operation is performed, adding the processed result to the input features. This effectively alleviates the gradient vanishing problem in deep networks and improves the efficiency and accuracy of information transmission. The other part of the copied features is resized using specific convolutional operations to ensure it has the same shape as the output features processed by several Bottleneck modules containing variable convolutions. Subsequently, these two parts—the depth-processed portion and the resized portion—are concatenated. After concatenation, the final feature representation needs to be adjusted by an additional convolutional layer to ensure the output feature map has the specified number of output channels, thus meeting the requirements of downstream tasks.
[0063] like Figure 4 The image shows the AIFI module for intra-scale feature interaction. Based on a multi-head attention mechanism, the AIFI module allows the model to establish connections between different parts of the input sequence, enhancing its understanding of information at different locations in the image. After attention processing, the input is residually connected to the original input through a Dropout layer. Subsequently, the feature map passes through a feedforward neural network consisting of two sets of linear transformations, and is added to the previous feature map to form the output. Through these optimizations, the model's ability to handle complex scenes is significantly improved. In particular, by enhancing the multi-scale information capture capability during the feature extraction stage, the AIFI module can help the original YOLO algorithm more accurately locate and classify targets of different sizes.
[0064] When input features enter the AIFI module, a standard layer normalization operation is performed first. This process ensures a more stable numerical distribution of the input feature map, providing a good foundation for subsequent calculations. Subsequently, the normalized features generate two grid coordinate systems based on the width and height of the input feature map. These coordinates are then converted into embedding vectors through a series of mathematical transformations (including sine and cosine functions). These position embedding matrices are added to the input feature map to generate new features, enhancing its spatial awareness. The new feature map is then fed into a multi-head attention mechanism for further processing. During this process, the input feature map is first flattened and rearranged into a new form to facilitate the operation of the multi-head attention mechanism. Furthermore, to prevent overfitting, the AIFI module introduces a Dropout operation, randomly discarding some neurons during training to improve the model's generalization ability. The feature map processed by the multi-head attention mechanism undergoes another layer normalization operation to maintain numerical stability. Subsequently, the feature map is fed into a fully connected layer for further feature transformation, and non-linear characteristics are introduced through the GELU activation function. This series of operations helps to extract higher-level abstract features and improve the model's expressive power. Next, a Dropout operation and fully connected layer calculation are performed to further optimize the feature representation. Finally, the processed feature map needs to be restored to its original spatial dimension through a Reshape operation for use in subsequent tasks.
[0065] like Figure 5 As shown, the hybrid channel attention C2PSA module, based on the original C2PSA module, introduces a hybrid local channel attention mechanism into its PSA module to form the MLCA_PSA module. In the hybrid channel attention C2PSA module, the input feature map is convolved and then duplicated into two identical parts. The first part of the feature map is input into multiple sequentially connected MLCA_PSA modules for processing. The output of this first part is concatenated with the second part of the feature map. The concatenated feature map is then convolved again to adjust the number of channels back to the original input channel number before being output. This process not only preserves the original feature information but also integrates the feature representation enhanced by the attention mechanism, thereby improving the model's ability to understand the input data.
[0066] Each MLCA_PSA module, based on the original PSA module, optimizes the original Attention module into a hybrid channel attention MLCA module in the first separation operation to better capture local and global features.
[0067] like Figure 6As shown, in the Hybrid Channel Attention (MLCA) module, the input feature map is sequentially processed by local average pooling and global average pooling for feature extraction. After local and global feature extraction, the features are rearranged and then convolved. Local features are depooled to restore their original spatial dimensions. Global features, after convolution, are converted into a form suitable for addition with local features, and then weighted and summed with local features according to preset weights to generate the final attention map. This attention map is then depooled and multiplied with the original input feature map.
[0068] Specifically, during the initialization phase, the Hybrid Channel Attention (MLCA) module first defines convolutional layers for capturing local information and those for processing global information. These two convolutional layers have the same structure but different parameters, and are responsible for extracting local and global contextual information from the input feature map, respectively. The module also sets up local average pooling and global average pooling to extract the average values of local and global features from the input feature map, serving as the basis for subsequent operations. During forward propagation, the MLCA module first performs local extraction on the input feature map using local average pooling, obtaining a scaled-down feature map that retains the local structural information of the original image. Then, global average pooling is used to further extract from the local feature map, obtaining a single global descriptor, which helps capture the overall characteristics of the entire image. Subsequently, the local and global features are rearranged and fed into their respective convolutional layers for processing. Specifically, local features are restored to their original spatial dimensions after local convolution through a series of transformations; while global features are directly processed by convolution and transformed into a form suitable for addition with local features, ensuring that the two types of features can be effectively fused in the same spatial dimension. Finally, the Hybrid Channel Attention (MLCA) module sums the local and global attention maps according to preset weights to generate the final attention map, which is applied back to the original input feature map to adjust the importance of its parts. This method can not only highlight those features that are key to the task, but also suppress irrelevant interference information, thereby improving the model's recognition accuracy and robustness.
[0069] like Figure 2As shown, the neck network includes: four C3k2_MDConv modules, four Concat modules, two upsampling modules, and two convolutional modules. The feature map processed by the C2PSA module with hybrid channel attention of the backbone network is used as the input of the first upsampling module. The output of the first upsampling module is concatenated with the output of the third C3k2_MDConv module in the first Concat module. The concatenated result is then concatenated with the output of the fifth C3k2_MDConv module, the second upsampling module, and the second C3k2_MDConv module in the second Concat module. The concatenated result is then concatenated with the output of the fifth C3k2_MDConv module in the third Concat module after passing through the sixth C3k2_MDConv module and the third convolutional module. The concatenated result is then concatenated with the output of the fifth C3k2_MDConv module in the third Concat module after passing through the seventh C3k2_MDConv module and the fourth convolutional module. The concatenated result is then concatenated with the output of the C2PSA module with hybrid channel attention in the fourth Concat module. The concatenated result is then input to the eighth C3k2_MDConv module.
[0070] The head network includes three hybrid channel attention (MLCA) modules and three detection modules. The feature map processed by the sixth C3k2_MDConv module in the neck network is then processed by the first hybrid channel attention (MLCA) module in the head network to output a small-sized target prediction result; the feature map processed by the seventh C3k2_MDConv module is processed by the second hybrid channel attention (MLCA) module to output a medium-sized target prediction result; and the feature map processed by the eighth C3k2_MDConv module is processed by the third hybrid channel attention (MLCA) module to output a large-sized target prediction result.
[0071] Step 4: Train the improved YOLOv11 strip defect detection model using the training set of strip defect image data.
[0072] This example model was trained on a server with an RTX 4090 graphics card. The training batch size was 64, the initial learning rate was 0.0001, and the optimization function was SGD. Mosaic data augmentation was disabled in the last 10 epochs of training. The model used bounding box localization loss function during training, the specific formula of which is as follows:
[0073] Loss ShapeIoU =1-IoU+d shape +0.5×Ω shape
[0074] Among them, Loss ShapeIoU The bounding box localization loss function is represented by IoU, which represents the intersection-union ratio between the predicted bounding box and the ground truth bounding box. Shape The distance term representing shape loss; ΩShape Shape terms representing shape loss;
[0075]
[0076] Where B represents the prediction box, B gt Represents a real bounding box;
[0077]
[0078] Where w and h represent the width and height of the predicted loss box, w gt `hgt` represents the width and height of the annotation box, and `x` represents the height of the annotation box. c y c Indicates the center coordinates of the prediction box. The coordinates of the center of the bounding box are represented by , c represents the straight-line distance between the center coordinates of the predicted box and the center coordinates of the bounding box, and scale is the scale factor, which is set to 1.2;
[0079]
[0080] Where t represents the width or height of the loss box, ωt represents the weight of the shape similarity loss, and θ is a constant term.
[0081] Step 5: Evaluate the performance of the strip defect detection model based on the improved YOLOv11 using the validation set.
[0082] Images of surface defects on the strip steel from the validation set were input into the trained improved YOLOv11 strip steel defect detection model for validation. The model performance was evaluated using accuracy, recall, and average detection precision (mAP@0.5) at an intersection-over-union threshold of 0.5 as evaluation criteria.
[0083] Step 6: Collect strip surface image data at the rolling site, use the trained strip defect detection model based on improved YOLOv11 to detect strip surface defects, and output the defect location and defect type.
[0084] To verify the feasibility of the above optimization, two sets of experiments were conducted in this example: one set based on the YOLOv11 model and the other set using the improved YOLOv11 strip defect detection model of this invention. The training and validation sets of all models used the same set of data, and the results are shown in Table 1 below.
[0085] Table 1
[0086]
[0087] The comparison shows that the improved YOLOv11 model proposed in this invention improves mAP@50 by 3.94% compared with the YOLOv11 model, and its precision, recall and mAP@50:95 evaluation indicators are also improved.
[0088] This invention innovatively proposes an optimized and improved YOLOv11 network. Regarding the improvement in network structure, the C3k2 module and deformable convolution mechanism are cleverly integrated to successfully create the C3k2_MDConv module. This module is used to replace the original C3k2 module in the backbone network, which effectively expands the receptive field of the convolution kernel and significantly enhances the network's ability to capture various sizes of defect features on the surface of the strip.
[0089] In optimizing multi-scale feature fusion, the original pyramid pooling layer SPPF module was replaced by a new AIFI module, further improving the efficiency and rationality of the multi-scale feature fusion process. To enhance the model's understanding of the overall content, this invention organically combines the C2PSA module with the Hybrid Local Channel Attention (MLCA) module, forming the C2PSA_MLCA module. This module effectively integrates local and global features, while fusing spatial and channel information, making the model's understanding of image content more comprehensive and in-depth. Regarding improvements to the target detection layer, the MLCA module was introduced into the large, medium, and small target detection layers in the head. This operation achieves deep fusion of contextual information and attention mechanisms for targets of different sizes, significantly enhancing the predictive performance of the detection layer. For the loss function, this invention uses ShapeIoU. This function fully considers the influence of bounding box shape and scale, significantly improving the accuracy of localization regression.
[0090] The above description is only a preferred embodiment of the present invention and is not intended to limit the ideas of the present invention. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the protection scope of the present invention.
Claims
1. A method for detecting surface defects in strip steel based on an improved YOLOv11, characterized in that, include: Step 1: Acquire image data of defects in the strip steel and perform preprocessing; Step 2: Divide the preprocessed strip defect image data into a training set and a validation set in an 8:2 ratio; Step 3: Construct a strip defect detection model based on the improved YOLOv11; Step 4: Train the improved YOLOv11 strip defect detection model using the training set data; Step 5: Evaluate the performance of the strip defect detection model based on the improved YOLOv11 using the validation set; Step 6: Collect strip surface image data at the rolling site, use the trained strip defect detection model based on improved YOLOv11 to detect strip surface defects, and output the defect location and defect type; The strip defect detection model based on the improved YOLOv11 in step 3 has been improved as follows: (1) A deformable convolution mechanism was introduced into the backbone network and neck network of the YOLOv11 model, and the original C3k2 module was optimized into the C3k2_MDConv module, so that the model can dynamically adjust the size of the receptive field and capture feature information at different scales more effectively. (2) A hybrid local channel attention mechanism was introduced into the original C2PSA module of the backbone network to form a new hybrid channel attention C2PSA module, thereby enhancing the model’s attention to key features; (3) For the backbone network of the YOLOv11 model, the original SPPF module is replaced with the intra-scale feature interaction module AIFI to enhance the interaction capability between multi-scale features. (4) Adopt a bounding box localization loss function that considers the influence of the inherent properties of the bounding box's shape and scale on the bounding box regression to improve the accuracy of the model in bounding box prediction; (5) A hybrid channel attention (MLCA) module was added to the small target detection layer, medium target detection layer and large target detection layer of the head network to enhance the model’s detection performance for targets of different sizes.
2. The method for detecting surface defects in strip steel based on the improved YOLOv11 as described in claim 1, characterized in that, The preprocessing in step 1 specifically includes: Labelme software was used to annotate the defect locations and types in strip defect image data to obtain a strip defect image dataset.
3. The method for detecting surface defects in strip steel based on the improved YOLOv11 as described in claim 1, characterized in that, The strip defect detection model based on the improved YOLOv11 includes: a backbone network, a neck network, and a head network; The backbone network includes two basic convolutional modules, four C3k2_MDConv modules, three convolutional downsampling modules based on convolutional operations, one AIFI module, and one hybrid channel attention C2PSA module. The two basic convolutional modules in the backbone network are layers 0 and 1, respectively; the four C3k2_MDConv modules are layers 2, 5, 7, and 9, respectively; the three convolutional downsampling modules are layers 3, 6, and 8, respectively; the AIFI module is layer 10; and the hybrid channel attention C2PSA module is layer 11. The original strip defect image data is sequentially input into the first convolutional module, the second convolutional module, the first C3k2_MDConv module, the first convolutional downsampling module, the second C3k2_MDConv module, the second convolutional downsampling module, the third C3k2_MDConv module, the third convolutional downsampling module, the fourth C3k2_MDConv module, the AIFI module, and the hybrid channel attention C2PSA module of the backbone network for feature extraction.
4. The method for detecting surface defects in strip steel based on the improved YOLOv11 as described in claim 3, characterized in that, In the C3k2_MDConv module, the input feature map is processed by convolution and then copied into two identical parts. The first part of the feature map is input into multiple sequentially connected Bottleneck modules containing variable convolutions for processing. The output of the first part is concatenated with the result of the second part of the feature map after convolution. The concatenated feature map is then convolved and output. The Bottleneck module containing variable convolutions incorporates variable convolutions into the original Bottleneck module. In the Bottleneck module containing variable convolutions, the input feature map is first processed by convolution and the MDConv module, and then concatenated with the input feature map to obtain the output result.
5. The strip steel surface defect detection method based on the improved YOLOv11 as described in claim 3, characterized in that, The hybrid channel attention C2PSA module is based on the original C2PSA module. It introduces a hybrid local channel attention mechanism into its PSA module to form an MLCA_PSA module. In the hybrid channel attention C2PSA module, the input feature map is convolved and then copied into two identical parts. The first part of the feature map is input into multiple MLCA_PSA modules connected in sequence for processing. The output of the first part of the feature map is concatenated with the second part of the feature map. The concatenated feature map is then convolved and output. Each MLCA_PSA module, based on the original PSA module, optimizes the original Attention module into a hybrid channel attention MLCA module in the first separation operation to better capture local and global features. In the hybrid channel attention MLCA module, the input feature map is sequentially processed by local average pooling and global average pooling for feature extraction. After local and global feature extraction, the features are rearranged and then convolved. Local features are depooled after convolution to restore their original spatial dimensions. Global features, after convolution, are converted into a form suitable for addition with local features, and then weighted and summed with local features according to preset weights to generate the final attention map. This attention map is then depooled and multiplied with the original input feature map.
6. The method for detecting surface defects in strip steel based on the improved YOLOv11 as described in claim 3, characterized in that, The neck network comprises: four C3k2_MDConv modules, four Concat modules, two upsampling modules, and two convolutional modules. The feature map processed by the C2PSA module with hybrid channel attention of the backbone network is used as the input of the first upsampling module. The output of the first upsampling module is concatenated with the output of the third C3k2_MDConv module in the first Concat module. The concatenated result is then concatenated with the output of the fifth C3k2_MDConv module, the second upsampling module, and the second C3k2_MDConv module in the second Concat module. The concatenated result is then concatenated with the output of the sixth C3k2_MDConv module and the third convolutional module in the third Concat module. The concatenated result is then concatenated with the output of the fifth C3k2_MDConv module in the fourth Concat module after passing through the seventh C3k2_MDConv module and the fourth convolutional module. The concatenated result is then concatenated with the output of the C2PSA module with hybrid channel attention in the fourth Concat module. The concatenated result is then input into the eighth C3k2_MDConv module.
7. The method for detecting surface defects in strip steel based on the improved YOLOv11 as described in claim 6, characterized in that, The head network includes three hybrid channel attention (MLCA) modules and three detection modules. The feature map processed by the sixth C3k2_MDConv module in the neck network is processed by the first hybrid channel attention MLCA module of the head network to output a small-sized target prediction result; the feature map processed by the seventh C3k2_MDConv module is processed by the second hybrid channel attention MLCA module to output a medium-sized target prediction result; the feature map processed by the eighth C3k2_MDConv module is processed by the third hybrid channel attention MLCA module to output a large-sized target prediction result.