Steel surface defect detection method based on improved YOLO11

CN122675729APending Publication Date: 2026-09-01XIJING UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202610704396.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-05-21
Publication Date
2026-09-01

AI Technical Summary

Technical Problem

[0010]本发明的目的在于提供基于改进YOLO11的钢表面缺陷检测方法,通过在YOLO11n颈部网络引入LCAF-D模块并采用分层Mish激活策略,能够增强多尺度特征融合、扩大感受野保留细裂纹信息、抑制背景干扰并提升深层非线性表达能力,解决了现有模型因缺陷尺度变化大、边界模糊、背景复杂导致的漏检误检问题,以及单纯堆叠模块造成复杂度增加而性能提升有限的问题

Benefits of technology

[0028]1、本发明通过引入LCAF-D模块增强YOLO11n颈部网络的多尺度特征融合能力,使模型能够更充分地融合不同层级的缺陷特征,提高对不同尺度缺陷的检测能力。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122675729A_ABST
    Figure CN122675729A_ABST
Patent Text Reader

Abstract

This invention discloses a steel surface defect detection method based on an improved YOLO11, belonging to the field of industrial vision inspection technology. The invention includes acquiring steel surface defect images and converting them to YOLO format for preprocessing; constructing a YOLO11n baseline model; designing an LCAF module to enhance multi-scale feature fusion; determining the deployment of the LCAF module in the neck network through ablation experiments; improving LCAF to an LCAF-D module with dilated convolutions; proposing a hierarchical Mish activation strategy, using Mish only in deep layers and key locations; embedding LCAF-D and hierarchical Mish into YOLO11n to construct the final model; and using the trained model for inference to output the defect category, confidence score, and bounding box. This invention, by introducing an LCAF-D module into the YOLO11n neck network and adopting a hierarchical Mish activation strategy, can enhance multi-scale feature fusion, expand the receptive field to retain fine crack information, suppress background interference, and improve the deep nonlinear expression capability.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of industrial visual inspection technology, and in particular relates to a method for detecting defects on steel surfaces based on an improved YOLO11. Background Technology

[0002] Steel is a crucial basic material in fields such as machinery manufacturing, construction engineering, transportation, and energy equipment. The surface quality of steel directly affects the mechanical properties, corrosion resistance, processing quality, and service life of products. In actual industrial production processes, various defects often appear on steel surfaces, such as crazing, inclusion, patches, pitted surface, rolled-in scale, and scrapes. If these defects are not detected and addressed in a timely manner, they can affect subsequent processing procedures and even cause product quality accidents.

[0003] Traditional methods for detecting defects on steel surfaces mainly include manual visual inspection and traditional machine vision inspection. Manual visual inspection relies on the experience of the inspectors and suffers from low efficiency, high subjectivity, poor stability, and high false negative rates, making it difficult to meet the requirements of modern industrial production lines for automation, real-time performance, and consistency. Traditional machine vision methods typically rely on manually designed features such as grayscale thresholding, edge detection, texture descriptors, and morphological processing to complete defect detection. While they can achieve certain results with simple backgrounds and regular defect shapes, their detection accuracy and generalization ability tend to decrease when the steel surface texture is complex, the defect boundaries are blurred, or the defect scale varies significantly.

[0004] With the development of deep learning technology, object detection methods based on convolutional neural networks are gradually being applied to the field of industrial defect detection. YOLO series models are widely used in industrial vision inspection tasks due to their advantages such as end-to-end detection, fast inference speed, and flexible deployment. YOLO11n, as a lightweight detection model, has certain advantages in detection speed and model complexity, but it still has the following shortcomings in steel surface defect detection tasks:

[0005] First, the scale of defects on the steel surface varies significantly. Some defects are large in area, such as patches and pitted surfaces; others are slender and have indistinct boundaries, such as crazing and scratches. Ordinary multi-scale fusion structures cannot simultaneously accommodate large-scale defects and fine crack-like defects.

[0006] Second, the background texture of steel surfaces is complex. The steel surface itself has textures, lighting variations, and noise interference, and the difference between the defect area and the background is weak, which can easily lead to false positives and false negatives.

[0007] Third, lightweight detection models have limited ability to express deep nonlinearities. Although YOLO11n has a low number of parameters and computational cost, it still suffers from insufficient feature representation for complex texture defects, weak texture defects, and blurred boundary defects.

[0008] Fourth, existing methods typically introduce attention modules or lightweight feature enhancement modules directly, but rarely analyze the relationship between module placement, branch structure design, and activation function optimization, which can easily lead to increased model complexity with limited performance improvement.

[0009] Therefore, the following solutions are proposed to address the above problems. Summary of the Invention

[0010] The purpose of this invention is to provide a steel surface defect detection method based on an improved YOLO11. By introducing an LCAF-D module into the YOLO11n neck network and adopting a hierarchical Mish activation strategy, it can enhance multi-scale feature fusion, expand the receptive field to retain fine crack information, suppress background interference, and improve the ability to express deep nonlinearity. This solves the problems of missed and false detections caused by large defect scale variations, blurred boundaries, and complex backgrounds in existing models, as well as the problem that simply stacking modules increases complexity while providing limited performance improvement.

[0011] To solve the above-mentioned technical problems, the present invention is achieved through the following technical solution:

[0012] This invention relates to a method for detecting defects on steel surfaces based on an improved YOLO11, comprising the following steps:

[0013] Acquire and preprocess images of steel surface defects;

[0014] Construct a YOLO11n baseline model;

[0015] A lightweight channel-aware fusion module LCAF was designed. Through position ablation experiments, it was determined that the improved LCAF-D module should be deployed in the neck network. The LCAF-D module includes local texture branches and hole depth separable convolution branches to replace large kernel convolution branches, which are used to expand the receptive field and retain fine-grained texture information.

[0016] A hierarchical Mish activation strategy is adopted, using the Mish activation function only in deep convolutions of the backbone network and neck key downsampling convolutions;

[0017] The LCAF-D module and the hierarchical Mish strategy are embedded into YOLO11n to obtain the final detection model;

[0018] The final detection model is used to infer the image of the steel surface to be detected, and output the defect category, confidence level and bounding box.

[0019] Furthermore, the LCAF-D module also includes: a pointwise convolutional layer for channel transformation of the input features; the local texture branch uses a small-sized convolutional kernel to extract local texture features; the depth-separable convolutional branch uses a depth-separable convolution with a preset dilation rate; the output features of the two branches are fused and then fed into a channel attention unit for weight recalibration, and then added to the input features through a residual connection for output.

[0020] Furthermore, in the hierarchical Mish activation strategy, the shallow feature extraction layer and the detection head retain the original activation function, while the convolutional layers in the deep part of the backbone network and the convolutional layers used for downsampling in the neck network adopt the Mish activation function.

[0021] Furthermore, the location ablation experiment includes testing three schemes: deploying the LCAF module in the backbone network, deploying it in the neck network, and deploying it in both the backbone network and the neck network. Based on the detection performance, it is determined that the LCAF-D module should be deployed in the neck network.

[0022] Furthermore, the depth-separable convolution branch in the LCAF-D module adopts depth-separable convolution with a hole ratio greater than 1, so as to expand the effective receptive field without significantly increasing the number of parameters.

[0023] Furthermore, after inserting the LCAF-D module into the neck network of the YOLO11n baseline model, part of the original feature fusion structure is replaced, while the detection head remains unchanged.

[0024] Furthermore, the preprocessing includes converting the images and annotation files to YOLO format, and performing size normalization and data augmentation.

[0025] Furthermore, the training process of the final detection model is optimized using the target detection loss function, and the mean accuracy is used as the evaluation metric on the validation set.

[0026] Furthermore, the method is also applicable to defect detection tasks on other metal surfaces besides steel surfaces.

[0027] The present invention has the following beneficial effects:

[0028] 1. This invention enhances the multi-scale feature fusion capability of the YOLO11n neck network by introducing the LCAF-D module, enabling the model to more fully integrate defect features from different levels and improve the detection capability of defects at different scales.

[0029] 2. This invention uses a 3×3 hole-depth separable convolution branch to replace the original large kernel branch. While expanding the receptive field, it reduces the excessive smoothing of fine-grained textures by the large kernel convolution, which is beneficial for preserving weak texture defect information such as fine cracks and scratches.

[0030] 3. This invention enhances the response of defect-related feature channels through a channel-aware mechanism, suppresses interference from complex background textures on the steel surface, and improves the model's ability to focus on defect areas.

[0031] 4. This invention proposes a hierarchical Mish activation optimization strategy, which introduces the Mish activation function only in the deep layers of the backbone network and the key downsampling layers in the neck, without blindly replacing the entire network, thereby enhancing nonlinear expressive power while maintaining training stability.

[0032] 5. This invention uses position ablation experiments to determine that the feature enhancement module is more suitable for deployment in the neck feature fusion stage, thus avoiding the problems of increased computation and performance instability caused by blindly stacking modules.

[0033] 6. The present invention achieved good detection results on the NEU-DET steel surface defect dataset. The final mAP@0.5 of the YOLO11n+LCAF-D+Mish model reached 0.767, and the mAP@0.5:0.95 reached 0.436, indicating that the method has good detection accuracy and engineering application value.

[0034] Of course, any product implementing this invention does not necessarily need to achieve all of the advantages described above at the same time. Attached Figure Description

[0035] To more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0036] Figure 1 This is a schematic flowchart of the steel surface defect detection method based on the improved YOLO11 of the present invention;

[0037] Figure 2 This is a schematic diagram of the original LCAF module structure of the present invention;

[0038] Figure 3 This is a schematic diagram of the improved LCAF-D module structure of the present invention;

[0039] Figure 4 This is a schematic diagram showing different deployment locations of the LCAF module of the present invention;

[0040] Figure 5 This is a schematic diagram of the final model structure of YOLO11n + LCAF-D + Mish in this invention;

[0041] Figure 6This is a schematic diagram comparing mAP@0.5 of different models of the present invention on typical defect categories. Detailed Implementation

[0042] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0043] Please see Figure 1 As shown, this invention is a method for detecting defects on steel surfaces based on an improved YOLO11, comprising the following steps:

[0044] Acquire and preprocess images of steel surface defects;

[0045] Construct a YOLO11n baseline model;

[0046] A lightweight channel-aware fusion module LCAF was designed. Through position ablation experiments, it was determined that the improved LCAF-D module should be deployed in the neck network. The LCAF-D module includes local texture branches and hole depth separable convolution branches to replace the large kernel convolution branches, which are used to expand the receptive field and retain fine-grained texture information.

[0047] A hierarchical Mish activation strategy is adopted, using the Mish activation function only in deep convolutions of the backbone network and neck key downsampling convolutions;

[0048] The LCAF-D module and the hierarchical Mish strategy are embedded into YOLO11n to obtain the final detection model;

[0049] The final detection model is used to infer the image of the steel surface to be detected, and output the defect category, confidence level and bounding box.

[0050] The LCAF-D module also includes: pointwise convolutional layers for channel transformation of input features; local texture branches using small-sized convolutional kernels to extract local texture features; depth-separable convolutional branches using depth-separable convolutions with a preset dilation rate; the output features of the two branches are fused and fed into the channel attention unit for weight recalibration, and then added to the input features through residual connections for output.

[0051] In the hierarchical Mish activation strategy, the shallow feature extraction layer and the detection head retain the original activation function, while the convolutional layers in the deep parts of the backbone network and the convolutional layers used for downsampling in the neck network adopt the Mish activation function.

[0052] The location ablation experiment included testing three schemes: deploying the LCAF module in the backbone network, deploying it in the neck network, and deploying it in both the backbone network and the neck network. Based on the detection performance, it was determined that the LCAF-D module should be deployed in the neck network.

[0053] The depthwise separable convolution branch in the LCAF-D module uses depthwise separable convolution with a dilatancy greater than 1 to expand the effective receptive field without significantly increasing the number of parameters.

[0054] After inserting the LCAF-D module into the neck network of the YOLO11n baseline model, part of the original feature fusion structure is replaced, while the detection head remains unchanged.

[0055] Preprocessing includes converting images and annotation files to YOLO format, and performing size normalization and data augmentation.

[0056] The training process of the final detection model is optimized using the object detection loss function, and the mean accuracy is used as the evaluation metric on the validation set.

[0057] The above method is also applicable to the detection of defects on other metal surfaces besides steel surfaces.

[0058] The specific application of this embodiment is as follows:

[0059] Step S1: Acquisition and preprocessing of steel surface defect image data

[0060] Obtain a dataset of images showing steel surface defects. The dataset can be NEU-DET, GC10-DET, or other industrial image datasets with annotations for steel and metal surface defects.

[0061] For the input image, the original annotation file is first converted to YOLO object detection format. Each image corresponds to a label file, and the label content includes the defect category number, the x-coordinate of the target center point, the y-coordinate of the target center point, the width of the target bounding box, and the height of the target bounding box. The coordinate information is normalized to the range of 0 to 1.

[0062] For steel surface defect categories, options include crazing, inclusion, patches, pitted surface, rolled-inscale, and scrapes. When applying to other metal defect datasets, the number and names of categories can be adjusted according to the specific detection task.

[0063] The image size is normalized, and the input size can be set to the range of 224×224 to 640×640. During training, data augmentation techniques such as random scaling, translation, flipping, and color perturbation can be used to improve the model's adaptability to complex industrial scenes.

[0064] The training set, validation set, and test set can be divided in a ratio of 6:2:2, 7:2:1, or 8:1:1, or you can directly use the division method of the existing dataset.

[0065] Step S2: Construct a baseline model for YOLO11n steel surface defect detection.

[0066] YOLO11n was used as the basic detection model. This model consists of three parts: a backbone network, a neck network, and a detection head.

[0067] The backbone network is used to extract multi-level features from the input steel surface image. Shallow features mainly include low-level visual information such as edges, textures, and contours; deep features mainly include semantic information about defects and category discrimination information.

[0068] The neck network is used to fuse features at different scales, enabling the model to detect both large-scale and small-scale defects simultaneously.

[0069] The detection head is used to output the predicted results of steel surface defects, including defect category, defect confidence level, and bounding box location.

[0070] During baseline model training, the input image size can be set to 224×224 to 640×640, the batch size can be set to 8 to 32, the number of training rounds can be set to 100 to 300, the initial learning rate can be set to 0.001 to 0.01, and the weight decay coefficient can be set to 0.0001 to 0.001.

[0071] Step S3: Design a lightweight channel sensing fusion module (LCAF)

[0072] To improve YOLO11n's ability to fuse multi-scale features of steel surface defects, a lightweight channel sensing fusion module (LCAF) was designed.

[0073] The LCAF module mainly includes a channel transformation layer, a local texture branch, a context-aware branch, channel attention units, and a residual connection structure. The original LCAF module structure is as follows: Figure 2 As shown.

[0074] The specific process is as follows:

[0075] First, the input features are fed into a 1×1 convolutional layer for channel transformation and alignment to reduce redundant channel information and improve the efficiency of subsequent feature fusion.

[0076] Secondly, the channel-transformed features are fed into two parallel branches. One branch uses a small convolutional kernel to extract local texture information, which is used to preserve the edges of steel surface defects, fine textures, and local morphological features; the other branch is used to obtain a wider range of contextual information, enhancing the model's ability to understand large-scale defects and complex backgrounds.

[0077] Then, the features output from the two branches are fused and fed into the channel attention unit. The channel attention unit assigns weights according to the importance of different channels for defect identification, enhancing defect-related channels and suppressing background noise channels.

[0078] Finally, the enhanced features are added to the input features through residual connections to ensure the stability of model training and reduce feature degradation problems in deep networks.

[0079] Step S4: Perform LCAF module location ablation and determine the deployment location.

[0080] To determine the optimal deployment location for the LCAF module in YOLO11n, three deployment schemes were set up.

[0081] The first approach involves inserting the LCAF module only into the backbone network. This approach is used to verify the role of the feature enhancement module in the feature extraction stage.

[0082] The second approach involves inserting the LCAF module only into the neck network. This approach is used to verify the role of the feature enhancement module in the multi-scale feature fusion stage.

[0083] The third approach involves inserting LCAF modules into both the backbone network and the neck network. A schematic diagram of each deployment location is shown below. Figure 4 As shown in the figure. This scheme is used to verify whether multi-location overlay can further improve the detection effect.

[0084] Experimental comparisons revealed that deploying the LCAF module in the neck network more effectively enhances multi-scale fusion features, resulting in a more significant improvement in steel surface defect detection performance. Therefore, this invention ultimately deploys the improved LCAF-D module in the neck feature fusion stage of YOLO11n.

[0085] Step S5: Construct the improved LCAF-D module

[0086] Based on the original LCAF module, the LCAF-D module is further proposed.

[0087] While the large kernel branch in the original LCAF module can expand the receptive field, it may cause excessive smoothing of fine-grained texture information in the detection of fine cracks on steel surfaces, thus affecting the recognition of slender defects such as crazing and scratches.

[0088] To address this issue, this invention replaces the original large-kernel depth-separable convolution branch with a dilated depth-separable convolution branch. The dilated depth-separable convolution branch uses a 3×3 convolution kernel, and the dilation rate can be set from 1 to 3, preferably 2.

[0089] This design expands the effective receptive field without significantly increasing the number of parameters, enabling the model to simultaneously acquire local texture information and a larger range of contextual information. Compared to directly using 2×2 or 4×4 convolutional branches, the 3×3 dilated branch achieves a better balance between contextual modeling capability and detail preservation capability.

[0090] The processing flow of the LCAF-D module is as follows:

[0091] The input features are first processed through a 1×1 convolution to adjust the channels;

[0092] Then it proceeds to the local texture branch and the 3×3 hole-depth separable convolution branch;

[0093] The output features of the two branches are fused;

[0094] The fused features are then subjected to channel weight recalibration via a channel attention mechanism;

[0095] Finally, the enhanced features are output through residual connections. The improved LCAF-D module structure is as follows: Figure 3 As shown.

[0096] Step S6: Design a layered Mish activation optimization strategy

[0097] To enhance YOLO11n's ability to express nonlinear defects on complex steel surfaces, this invention proposes a hierarchical Mish activation optimization strategy.

[0098] Instead of replacing all activation functions in the entire network with Mish, this strategy selectively uses the Mish activation function in deep convolutions of the backbone network and key downsampling convolutions of the neck network.

[0099] Specifically, shallow networks are mainly responsible for extracting edges, textures, and simple geometric structures, and maintaining the original activation function helps stabilize training; deep networks are mainly responsible for complex semantic expression and category differentiation, and using the Mish activation function can enhance the non-linear expression capability of the model; the neck key downsampling convolution undertakes the task of feature transformation at different scales, and introducing the Mish activation function helps improve the feature expression quality in the multi-scale fusion process.

[0100] The Mish activation function can be expressed as:

[0101]

[0102] In the formula, The input feature values ​​are used. The Mish activation function is smooth and non-monotonic, which helps to improve the ability to represent deep features.

[0103] Step S7: Construct the final YOLO11n+LCAF-D+Mish model

[0104] By jointly embedding the LCAF-D module in step S5 and the hierarchical Mish activation strategy in step S6 into YOLO11n, the final steel surface defect detection model YOLO11n+LCAF-D+Mish is obtained.

[0105] The final model structure includes:

[0106] The input terminal is used to receive images of defects on the steel surface.

[0107] The backbone network is used to extract multi-level defect features, where the deep key convolutions use the Mish activation function;

[0108] A neck network for multi-scale feature fusion is used, in which an LCAF-D module is inserted and the Mish activation function is used in the key downsampling convolution;

[0109] The detection head is used to output defect category, confidence level, and bounding box coordinates. The overall structure of the final model is as follows: Figure 5 As shown.

[0110] Step S8: Model training, validation, and inference output

[0111] During the training phase, preprocessed images of steel surface defects are input into the final model, which outputs predicted bounding boxes, class probabilities, and confidence scores. The model parameters are optimized using an object detection loss function to gradually approximate the true annotations.

[0112] During the validation phase, metrics such as Precision, Recall, mAP@0.5, mAP@0.5:0.95, number of parameters, and GFLOPs are calculated using the validation set to comprehensively evaluate the model's detection performance and complexity.

[0113] During the inference phase, the image of the steel surface to be inspected is input into the trained model, which outputs the defect category, defect confidence score, and defect bounding box location. Based on the output, a visual inspection image can be generated for defect identification and quality assessment in industrial settings.

[0114] The method of this invention has strong theoretical feasibility, mainly reflected in the following aspects:

[0115] Steel surface defect detection is essentially a problem of detecting small and multi-scale targets in complex backgrounds. YOLO11n has end-to-end detection capabilities and a relatively lightweight structure, making it suitable as a basic model for industrial inspection tasks.

[0116] Steel surface defects often contain numerous slender, poorly defined, and weakly textured defects. Ordinary convolutional structures are easily affected by background texture interference when extracting these defects. The LCAF-D module, through local texture branches and hole-depth-separable convolutional branches, simultaneously models local details and a larger range of context, helping to improve the model's ability to perceive fine cracks and complex texture defects.

[0117] Dilated convolutions can expand the receptive field without significantly increasing computational cost. Combining them with depthwise separable convolutions can balance detection performance and lightweight model requirements, making them suitable for industrial deployments.

[0118] The Mish activation function, with its smooth and non-monotonic properties, enhances the nonlinear expressive power of deep networks. Employing a layered replacement approach instead of a full network replacement can improve expressive power while reducing the risk of training instability.

[0119] Therefore, this invention enhances feature fusion capabilities through the LCAF-D module and enhances deep expression capabilities through hierarchical Mish activation. The two work together on YOLO11n to make the model more suitable for steel surface defect detection tasks.

[0120] To verify the effectiveness of the method of the present invention, an experimental comparison was conducted on the NEU-DET steel surface defect dataset.

[0121] The experimental evaluation metrics included Precision, Recall, mAP@0.5, mAP@0.5:0.95, number of parameters, and GFLOPs.

[0122] The experimental results are shown in the table below.

[0123] YOLO11n 2.583 6.3 0.733 0.662 0.730 0.405 YOLO11n+LCAF (neck) 3.259 10.2 0.641 0.743 0.742 0.423 YOLO11n+Mish 2.584 6.3 0.702 0.695 0.744 0.444 YOLO11n+LCAF-D (neck) 3.256 10.2 0.753 0.696 0.757 0.438 YOLO11n+LCAF-D+Mish 2.653 6.5 0.710 0.701 0.767 0.436

[0124] The experimental results show that the mAP@0.5 of the YOLO11n baseline model is 0.730, and the mAP@0.5:0.95 is 0.405. After introducing the LCAF-D module, the model's mAP@0.5 increases to 0.757, indicating that the LCAF-D module can effectively enhance the fusion capability of steel surface defect features.

[0125] After adopting the hierarchical Mish activation strategy, the model achieved an mAP of 0.444 at 0.5:0.95, indicating that the enhanced deep nonlinear expression ability helps to improve the detection performance of the model under more stringent localization metrics.

[0126] The final mAP@0.5 of the YOLO11n+LCAF-D+Mish model reached 0.767, an improvement of 3.7 percentage points compared to the baseline model. This demonstrates that the method of this invention can effectively improve the overall performance of steel surface defect detection. The comparison of mAP@0.5 for each model on typical defect categories is as follows: Figure 6 As shown.

[0127] Example 1

[0128] This implementation case uses the NEU-DET dataset to conduct steel surface defect detection experiments. The dataset includes six types of steel surface defects: crazing, inclusion, patches, pitted surface, rolled-inscale, and scrapes.

[0129] After converting the image annotations to YOLO format, they were input into the YOLO11n+LCAF-D+Mish model for training. The training input size was set in the range of 224×224 to 640×640, the batch size was set in the range of 8 to 32, the number of training epochs was set in the range of 100 to 300, and the initial learning rate was set in the range of 0.001 to 0.01.

[0130] After training, the detection performance is evaluated using a validation set. The final model can output the category, confidence score, and bounding box location for each defect target, and can be used for automatic detection of defects on steel surfaces.

[0131] Example 2

[0132] This implementation case deploys the LCAF-D module in the neck feature fusion stage of YOLO11n.

[0133] The input features are fused by the neck network and then fed into the LCAF-D module. The local texture branch in the LCAF-D module is used to preserve the detailed texture of the steel surface, the hole depth separable convolution branch is used to expand the receptive field and obtain contextual information, and the channel attention unit is used to enhance the response of defect-related channels.

[0134] This implementation method is suitable for steel surface inspection scenarios with large variations in defect size and complex background texture, and can improve the model's ability to identify defects of different sizes.

[0135] Example 3

[0136] This implementation uses the Mish activation function in the deep convolutions and neck key downsampling convolutions of the YOLO11n backbone network.

[0137] The shallow feature extraction layer retains the original activation function to ensure stable edge and texture feature extraction; the deep key convolution uses the Mish activation function to enhance the nonlinear expressive power of complex defect patterns.

[0138] This implementation method is applicable to detection scenarios involving complex texture defects, blurred boundary defects, and weak texture defects, and can improve detection performance with minimal increase in model complexity.

[0139] Example 4

[0140] This implementation case applies the method to the GC10-DET metal surface defect dataset.

[0141] First, the GC10-DET dataset was converted to a YOLO detection format; then, the YOLO11n+LCAF-D+Mish model was used for training and validation. This implementation method is used to verify the adaptability of the method of the present invention in different metal surface defect detection scenarios.

[0142] Experimental results show that the method still has certain stability in cross-dataset detection, indicating that the LCAF-D module and hierarchical Mish activation strategy are not only applicable to NEU-DET steel surface defect detection, but can also be extended to other metal surface defect detection tasks.

[0143] In the description of this specification, references to terms such as "an embodiment," "example," "specific example," etc., indicate that a specific feature, structure, material, or characteristic described in connection with that embodiment or example is included in at least one embodiment or example of the invention. In this specification, illustrative expressions of the above terms do not necessarily refer to the same embodiment or example. Furthermore, the specific features, structures, materials, or characteristics described may be combined in any suitable manner in one or more embodiments or examples.

[0144] The preferred embodiments of the present invention disclosed above are merely illustrative of the invention. These preferred embodiments do not exhaustively describe all details, nor do they limit the invention to the specific implementations described. Clearly, many modifications and variations can be made based on the content of this specification. This specification selects and specifically describes these embodiments to better explain the principles and practical applications of the invention, thereby enabling those skilled in the art to better understand and utilize the invention. The invention is limited only by the claims and their full scope and equivalents.

Claims

1. A method for detecting steel surface defects based on an improved YOLOv11, characterized in that, The detection method includes the following steps: Acquire and preprocess images of steel surface defects; Construct a YOLO11n baseline model; A lightweight channel-aware fusion module LCAF was designed. Through position ablation experiments, it was determined that the improved LCAF-D module should be deployed in the neck network. The LCAF-D module includes local texture branches and hole depth separable convolution branches to replace large kernel convolution branches, which are used to expand the receptive field and retain fine-grained texture information. A hierarchical Mish activation strategy is adopted, using the Mish activation function only in deep convolutions of the backbone network and neck key downsampling convolutions; The LCAF-D module and the hierarchical Mish strategy are embedded into YOLO11n to obtain the final detection model; The final detection model is used to infer the image of the steel surface to be detected, and output the defect category, confidence level and bounding box.

2. The steel surface defect detection method based on the improved YOLO11 according to claim 1, characterized in that, The LCAF-D module further includes: a pointwise convolutional layer for channel transformation of the input features; the local texture branch uses a small-sized convolutional kernel to extract local texture features; the depth-separable convolutional branch uses a depth-separable convolution with a preset dilation rate; the output features of the two branches are fused and then fed into the channel attention unit for weight recalibration, and then added to the input features through residual connection for output.

3. The steel surface defect detection method based on the improved YOLO11 according to claim 2, characterized in that, In the hierarchical Mish activation strategy, the shallow feature extraction layer and the detection head retain the original activation function, while the convolutional layers in the deep part of the backbone network and the convolutional layers used for downsampling in the neck network adopt the Mish activation function.

4. The steel surface defect detection method based on the improved YOLO11 according to claim 1, characterized in that, The location ablation experiment includes testing three schemes: deploying the LCAF module in the backbone network, deploying it in the neck network, and deploying it in both the backbone network and the neck network. Based on the detection performance, it is determined that the LCAF-D module should be deployed in the neck network.

5. The steel surface defect detection method based on the improved YOLO11 according to claim 1, characterized in that, The depth-separable convolution branch in the LCAF-D module uses depth-separable convolution with a hole ratio greater than 1 to expand the effective receptive field without significantly increasing the number of parameters.

6. The steel surface defect detection method based on the improved YOLO11 according to claim 1, characterized in that, After inserting the LCAF-D module into the neck network of the YOLO11n baseline model, part of the original feature fusion structure is replaced, while the detection head remains unchanged.

7. The method for detecting steel surface defects based on the improved YOLO11 according to claim 1, characterized in that, The preprocessing includes converting images and annotation files to YOLO format, and performing size normalization and data augmentation.

8. The steel surface defect detection method based on the improved YOLO11 according to claim 1, characterized in that, The training process of the final detection model is optimized using the target detection loss function, and the mean accuracy is used as the evaluation metric on the validation set.

9. The steel surface defect detection method based on the improved YOLO11 according to claim 1, characterized in that, The method is also applicable to the detection of defects on other metal surfaces besides steel surfaces.