Steel surface defect detection method, device and equipment and storage medium

By improving the backbone and neck network of the YOLOv11 network and integrating the attention mechanism LSKA module, an ECS-YOLOv11s model was constructed, which solved the problems of low accuracy and large computational load in the existing technology for complex defect identification, and realized efficient and real-time steel surface defect detection on mobile devices.

CN121120578APending Publication Date: 2025-12-12UNIV OF SCI & TECH LIAONING

Patent Information

Application Number
CN202511273597.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-09-08
Publication Date
2025-12-12

AI Technical Summary

Technical Problem

In existing technologies, deep learning-based methods for detecting surface defects in steel have low accuracy in identifying complex defects and require a large amount of computation, making them difficult to deploy on mobile devices and unable to meet real-time detection requirements.

Method used

The backbone and neck network of the YOLOv11 network are improved, and the attention mechanism LSKA module is integrated. An ECS-YOLOv11s model is constructed using a multi-scale feature fusion method. Edge and spatial information features are extracted through the EIE module, and deep features of steel surface defects are extracted through the C3MSC module. The multi-scale feature fusion module SPPL is combined with new equipment, materials, processes, or combinations. The technical means implemented include: improving the backbone and neck network of the YOLOv11 network and integrating the attention mechanism LSKA module. An ECS-YOLOv11s model is constructed using a multi-scale feature fusion method. The model is trained using a defect augmentation dataset until the loss function converges.

Benefits of technology

It improves the accuracy and robustness of steel surface defect detection, reduces computational load and parameters, meets the deployment requirements of mobile devices, and enables real-time detection.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121120578A_ABST
    Figure CN121120578A_ABST
Patent Text Reader

Abstract

The invention provides a steel surface defect detection method and device, equipment and a storage medium. Relates to the technical field of image recognition. The method comprises the following steps: collecting steel surface defect images, and performing data enhancement processing on the steel surface defect images to obtain a data set after data enhancement; a backbone and neck network of a reference model YOLOv11s network is improved, an ECS-YOLOv11s model is constructed by adopting a multi-scale feature fusion mode, a data set after data enhancement is input into the ECS-YOLOv11s model to train and shoot and collect steel surface images in real time, the steel surface images are input into the trained ECS-YOLOv11s model, and a steel surface defect detection result is obtained. According to the method, the steel surface defects can be accurately and efficiently recognized, meanwhile, the needed calculation amount and parameters are reduced, and the requirement for deployment on mobile equipment can be met.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of image recognition technology, and in particular to a method, apparatus, equipment and storage medium for detecting defects on the surface of steel. Background Technology

[0002] Steel has extremely wide applications in various fields and plays a crucial role in people's daily lives. During steel production and processing, due to limitations in production technology and the uncertainties of the actual production environment, various defects such as cracks, scratches, and blemishes are prone to appear on the surface of steel. These defects can seriously affect the physical properties of the final product. Therefore, defect detection of steel is of great significance. Early detection and timely handling of defects help ensure the quality of steel products and enhance their stability.

[0003] Traditional methods for detecting surface defects in steel mainly include manual inspection, eddy current testing, and ultrasonic testing. Manual inspection relies heavily on worker experience, and after prolonged use, it is prone to false positives and false negatives, resulting in low efficiency. Furthermore, eddy current testing and ultrasonic testing cannot meet the real-time requirements of steel surface inspection and are unsuitable for complex defects. In recent years, thanks to the rapid development of computer technology, deep learning-based defect detection technology has become the mainstream research method. Existing technologies have proposed various improved networks. For example, Chen Bin et al. developed a steel surface defect detection method based on the YOLOv8 multi-scale convolutional attention mechanism. First, they introduced a multi-scale convolutional attention mechanism (MSCA) module into the backbone network. Second, they proposed a novel deformable convolutional C2fDCNv2 module to replace the original C2f module. Finally, they adopted the Wiou loss function instead of the original loss function to accurately measure the similarity between target frames, improving the model's defect detection performance. Existing technologies have improved the YOLOv8n network by introducing a global attention module, SPD-Conv convolution, and adding a small target prediction head, thereby reducing the false negative rate and enhancing the model's low-resolution image detection capabilities. These technologies have optimized and improved the one-stage target detection network from different directions, effectively improving the network's detection accuracy in steel surface defect detection tasks. However, the improved network still has low accuracy in identifying complex defects, and the network parameters and computational load have also increased. In practical applications, deployment is difficult due to the computational resource limitations of mobile terminal devices, thus affecting the performance of detection tasks. Summary of the Invention

[0004] This application provides a method, apparatus, equipment, and storage medium for detecting surface defects in steel, which can accurately and efficiently identify surface defects in steel while reducing the required computation and parameters, and can meet the needs of deployment on mobile devices.

[0005] In a first aspect, this application provides a method for detecting surface defects in steel, comprising:

[0006] Obtain the original dataset, which includes images of steel surface defects. Label each steel surface defect image with data, and perform data augmentation processing on the divided training set separately to obtain the defect augmentation dataset.

[0007] Based on the YOLOv11 network, the backbone and neck networks of the YOLOv11 network are improved, and the attention mechanism LSKA module is integrated. The ECS-YOLOv11s model is constructed by using a multi-scale feature fusion method.

[0008] The ECS-YOLOv11s model is trained using the defect augmentation dataset until the loss function converges, resulting in a trained ECS-YOLOv11s model.

[0009] The real-time acquired images of the steel surface are input into the trained ECS-YOLOv11s model to obtain the detection results of steel surface defects.

[0010] In one possible design, the data enhancement processing includes horizontal and vertical image flipping, adjusting image brightness and contrast, image sharpening, and image blurring.

[0011] In one possible design, based on the YOLOv11 network, the backbone and neck networks of the YOLOv11 network are improved, and the attention mechanism LSKA module is integrated. An ECS-YOLOv11s model is constructed using a multi-scale feature fusion approach, including:

[0012] Based on the YOLOv11 network, the two shallowest downsampling modules Conv in the backbone network of the YOLOv11 network are improved into modules EIE, which are beneficial for extracting edge and spatial information features. The Bottleneck module in C3k2, which is the deepest feature extraction module in the backbone and neck network of the YOLOv11 network, is improved into a multi-channel parallel convolution, resulting in module C3MSC, which is beneficial for multi-scale feature fusion. The SPPF module in the backbone network of YOLOv11, which is used for multi-scale feature fusion, is improved into SPPL, a multi-scale feature fusion module that incorporates the attention mechanism LSKA.

[0013] In one possible design, the module EIE, which facilitates the extraction of edge and spatial information features, is used for deep extraction of edge and spatial information features of steel surface defects. The specific process of deep extraction of edge and spatial information features of steel surface defects includes:

[0014] The input image information is used as the input feature image of the edge and spatial information feature extraction (EIE) module. The input feature map is subjected to convolutional layer dimensionality reduction, batch normalization, and activation function processing to obtain a preliminary feature map.

[0015] For each channel of the input feature map, the Scharr convolution operator is used to independently perform edge detection in the height and width directions, extract edge features, and superimpose the height and width directions to enhance the ability to capture edges in multiple directions, thus obtaining an edge information feature map.

[0016] The input feature map is subjected to max pooling to extract the spatial salient region map, thus obtaining the spatial information feature map.

[0017] The obtained preliminary feature map, spatial information feature map and edge information feature map are concatenated by channels. After concatenation, downsampling, batch normalization and activation function processing are performed to obtain intermediate feature maps. The intermediate feature maps are then residually connected with the output of the original image after resizing by average pooling and adjusting the number of channels by unit convolution, and unit convolution operation is performed to obtain the edge and spatial information feature maps of the steel surface defect image.

[0018] In one possible design, the C3MSC module, which facilitates multi-scale feature fusion, is used to extract deep features of steel surface defects. The specific process for extracting deep features of steel surface defects includes:

[0019] The input from the previous layer is divided into four groups. Three of these groups are processed independently using convolution with different kernel sizes. The remaining group is left unprocessed, preserving the detailed information from the previous layer, and thus the feature maps for each group are obtained.

[0020] The feature maps of each group are concatenated by channels. After concatenation, dimensionality reduction, batch normalization and activation function processing are performed. Then, a unit convolution kernel is used for convolution. The output obtained after convolution is residually connected with the input and unit convolution is performed to obtain a multi-scale feature fusion information map of the steel surface defect image.

[0021] In one possible design, the LSKA module, which facilitates multi-scale feature fusion, is used to extract deep features of steel surface defects. The specific process for extracting deep features of steel surface defects includes:

[0022] The LSKA module is placed at the end of the SPPF module, and the output formula of the LSKA module is:

[0023]

[0024] In the formula, It is attention map A C and input feature map F CThe Hadamard product, which is also the output of the attention mechanism, This represents the Hadamard product operation, where A C =W 1×1 *Z C W 1×1 It is a 1*1 core. The output of the depthwise convolution is *, where * indicates the convolution operation.

[0025] In one possible design, the loss function used when training the ECS-YOLOv11s model using the aforementioned defect augmentation dataset is expressed as:

[0026]

[0027] In the formula, α is a parameter used to balance the proportions, v is a parameter used to measure the proportional consistency between the anchor box and the target box, and w and h are the width and height of the predicted detection box, respectively. gt and h gt ρ represents the width and height of the ground truth bounding boxes, respectively. IOU is the ratio of the overlap area between the predicted and ground truth bounding boxes to the area of ​​the ground truth bounding boxes. 2 (b,b gt ) represents the Euclidean distance between the center points of the predicted bounding box and the ground truth bounding box, c represents the diagonal distance of the smallest closure region that simultaneously contains both the predicted and ground truth bounding boxes, and L represents the distance between the center points of the predicted bounding box and the ground truth bounding box. CIoU This represents a loss.

[0028] Secondly, this application provides a steel surface defect detection device, the device comprising:

[0029] The data construction module is configured to acquire the original dataset, which includes images of steel surface defects, to annotate each steel surface defect image, and to perform data augmentation processing on the divided training set separately to obtain a defect augmentation dataset.

[0030] The model building module is configured to build the ECS-YOLOv11 model based on the YOLOv11 network, improve the backbone and neck network of the YOLOv11 network, and integrate the attention mechanism LSKA module, using a multi-scale feature fusion method.

[0031] The model training module is configured to train the ECS-YOLOv11s model using the defect augmentation dataset until the loss function converges, thereby obtaining the trained ECS-YOLOv11s model.

[0032] The defect detection module is configured to input real-time acquired images of the steel surface into a trained ECS-YOLOv11s model to obtain the detection results of steel surface defects.

[0033] Thirdly, embodiments of this application provide an electronic device, including: at least one processor and a memory; the memory stores computer execution instructions; the at least one processor executes the computer execution instructions stored in the memory, causing the at least one processor to perform the steel surface defect detection method as described in the first aspect and various possible designs of the first aspect.

[0034] Fourthly, embodiments of this application provide a computer-readable storage medium storing computer-executable instructions. When a processor executes the computer-executable instructions, it implements the steel surface defect detection method described in the first aspect and various possible designs of the first aspect.

[0035] Fifthly, embodiments of this application provide a computer program product, including a computer program that, when executed by a processor, implements the steel surface defect detection method described in the first aspect and various possible designs of the first aspect.

[0036] The steel surface defect detection method, apparatus, equipment, and storage medium provided in this application have at least the following beneficial effects:

[0037] This application presents a steel surface defect detection method based on deep learning technology. It improves the two shallowest downsampling modules (Conv) in the backbone of the YOLOv11 network by replacing them with modules (EIE) that facilitate the extraction of edge and spatial information features. This results in richer edge and detail information, retaining more useful information and thus improving the model's accuracy in classifying complex targets. Furthermore, it improves the deepest feature extraction module (C3k2) in the backbone and neck networks of the YOLOv11 network by replacing it with module (C3MSC) that facilitates multi-scale feature fusion. This reduces computational cost and parameters while better extracting multi-scale feature information of steel surface defects. Finally, it improves the multi-scale feature fusion module (SPPF) in the YOLOv11 backbone network by replacing it with a multi-scale feature fusion module (SPPL) that incorporates the attention mechanism (LSKA). This enhances feature expressiveness, reduces interference from irrelevant information in the image, and effectively improves the model's generalization ability and robustness. Therefore, this application further improves the accuracy of real-time detection of defects on steel surfaces while reducing the model parameters and computational load, and has higher robustness and generalization ability, giving it a significant advantage over conventional models in practical applications. Attached Figure Description

[0038] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this application and, together with the description, serve to explain the principles of this application.

[0039] Figure 1 A flowchart illustrating a method for detecting surface defects in steel provided in this application embodiment;

[0040] Figure 2 A schematic diagram of the ECS-YOLOv11s convolutional neural network model provided in the embodiments of this application;

[0041] Figure 3 A schematic diagram of the EIE module provided in an embodiment of this application;

[0042] Figure 4 A schematic diagram of the C3MSC module provided in an embodiment of this application;

[0043] Figure 5 A schematic diagram of the LSKA module provided in an embodiment of this application;

[0044] Figure 6 A schematic diagram comparing the detection results of the steel surface defect detection method provided in this application embodiment with the benchmark model YOLOv11s network model;

[0045] Figure 7 This is a structural diagram of the steel surface defect detection device provided in the embodiments of this application.

[0046] The accompanying drawings illustrate specific embodiments of this application, which will be described in more detail below. These drawings and descriptions are not intended to limit the scope of the concept in any way, but rather to illustrate the concept of this application to those skilled in the art through reference to particular embodiments. Detailed Implementation

[0047] Exemplary embodiments will now be described in detail, examples of which are illustrated in the accompanying drawings. When the following description relates to the drawings, unless otherwise indicated, the same numbers in different drawings denote the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with this application. Rather, they are merely examples of apparatuses and methods consistent with some aspects of this application as detailed in the appended claims.

[0048] The collection, storage, use, processing, transmission, provision, and disclosure of financial data or user data involved in the technical solution of this application all comply with the provisions of relevant laws and regulations and do not violate public order and good morals.

[0049] It should be noted that in the embodiments of this application, certain software, components, models and other existing solutions in the industry may be mentioned. These should be regarded as exemplary and are only intended to illustrate the feasibility of implementing the technical solution of this application. However, it does not mean that the applicant has used or necessarily used the solution.

[0050] The technical solution of this application and how the technical solution of this application solves the above-mentioned technical problems are described in detail below with specific embodiments. These specific embodiments can be combined with each other, and the same or similar concepts or processes may not be described again in some embodiments. The embodiments of this application will now be described with reference to the accompanying drawings.

[0051] This application provides a method for detecting surface defects in steel, such as... Figure 1 As shown, the method for detecting defects on the surface of steel includes the following steps S100-S400.

[0052] S100: Obtain the original dataset, which includes images of steel surface defects. Label each steel surface defect image with data, and perform data augmentation processing on the divided training set separately to obtain the defect augmentation dataset.

[0053] In this embodiment, images of steel surface defects are collected to obtain the original dataset. Each image is labeled with data, and the dataset is divided into a training set, a validation set, and a test set in a ratio of 8:1:1. Then, data augmentation processing is performed to obtain the defect augmentation dataset. The data augmentation processing in this invention includes: horizontal and vertical image flipping, adjusting image brightness and contrast, image sharpening, and image blurring.

[0054] S200: Based on the YOLOv11 network, the backbone and neck networks of the YOLOv11 network are improved, and the attention mechanism LSKA module is integrated to construct the ECS-YOLOv11s model using a multi-scale feature fusion method.

[0055] In this embodiment, as Figure 2 As shown, to improve the detection accuracy of complex targets, based on the YOLOv11 network, the backbone and neck networks of the YOLOv11 network are improved, and the attention mechanism LSKA module is integrated. A multi-scale feature fusion method is used to construct the ECS-YOLOv11s model. Specifically, defects such as cracks and pitting in steel surface defect images are difficult to capture using traditional spatial feature maps, such as... Figure 3As shown, by improving the two shallowest downsampling modules (Conv) in the backbone of the YOLOv11 network to the module EIE, which is better at extracting edge and spatial information features, richer edge and detail information is obtained, more useful information is retained, and the model focuses more on learning edge information, thereby improving the accuracy and performance of the model in classifying complex targets. The backbone network is responsible for deep feature extraction of steel surface defect images, used to capture semantic, detail, and contextual information in the steel surface defect images, providing a foundation for subsequent target classification. Composed of convolutional layers, pooling layers, and activation layers, it can effectively transform the original pixel information (640×640×3 RGB image) into high-level semantic feature maps step by step. The neck network is a core component connecting the backbone and the head. Through bidirectional top-down and bottom-up paths, it fuses features from different levels, achieving multi-scale feature fusion and enhancement of features extracted from the backbone network. This directly determines the model's ability to detect small targets and targets with varying scales. To improve the performance of the backbone and neck networks in the YOLOv11s model, such as... Figure 4 As shown, by improving the Bottleneck module in the deepest feature extraction module C3k2 of the YOLOv11 backbone and neck network to a multi-channel parallel convolution module MSC that facilitates multi-scale feature fusion, the computational cost and parameters of the network model are reduced. This feature extraction method allows the model to more effectively capture the deep feature information of steel surface defects. By fusing the multi-scale feature information of steel surface defects, the detection performance of the model can be further enhanced. As the network deepens, the original information undergoes multiple convolution operations, which leads to the loss of feature information of small target features in the steel surface defect image in the deep feature map. Therefore, the multi-scale feature fusion module SPPF in the YOLOv11 backbone network is improved to a multi-scale feature fusion module SPPL that incorporates the attention mechanism LSKA. The principle diagram is shown below. Figure 5 As shown, spatial attention through large kernel convolution generates an attention map and weights the original features of the image. This reduces computational complexity while enhancing the model's ability to perceive key regions. It also covers the global context, enhances the saliency of small targets, and thus improves the model's detection accuracy.

[0056] In some embodiments, the module EIE, which is advantageous for extracting edge and spatial information features, is used to deeply extract the edge and spatial information features of defects on the steel surface, which can be achieved through the following steps A.1 to A.4.

[0057] Step A.1: Use the input image information as the input to the Edge and Spatial Information Feature Extraction (EIE) module. Perform convolutional layer dimensionality reduction, batch normalization, and activation function processing on the input feature image to obtain a preliminary feature map.

[0058] Step A.2: Perform edge detection in the height and width directions independently on each channel of the input image information using the Scharr convolution operator, extract edge features, and superimpose the height and width directions to enhance the ability to capture edges in multiple directions, thereby obtaining an edge information feature map.

[0059] Step A.3: Perform max pooling on the input image information to extract the spatially salient region map and reduce the amount of computation required for subsequent steps, thereby obtaining the spatial information feature map.

[0060] Step A.4: Concatenate the obtained preliminary feature map, spatial information feature map, and edge information feature map by channel. Then, perform downsampling, batch normalization, and activation function processing on a 3*3 convolutional layer. Next, perform residual connection between the output and the output of the original image, which has been resized by average pooling and adjusted by a 1*1 kernel convolution to adjust the number of channels. Finally, perform convolution with a 1*1 kernel to adjust the number of channels, and obtain the edge and spatial information feature maps of the steel surface defect image.

[0061] In some embodiments, the C3MSC module, which facilitates multi-scale feature fusion, is used to extract deep features from images of surface defects in steel, which can be achieved through the following steps B.1 to B.2.

[0062] Step B.1: Divide the input from the previous layer into 4 groups. Perform convolution processing on three groups independently with kernels of 3*3, 5*5, and 7*7. Leave the remaining group unprocessed and retain the detailed information from the previous layer to obtain the feature maps of each group.

[0063] Step B.2: Channel stitching is performed on the feature maps of each group. Then, dimensionality reduction, batch normalization and activation function processing are performed by convolutional layer. Then, a 1*1 convolution kernel is used for convolution. The output obtained after convolution is residually connected with the input. Finally, a 1*1 convolution kernel is used for convolution to obtain the multi-scale feature fusion information map of the steel surface defect image.

[0064] In some embodiments, the LSKA module, which facilitates multi-scale feature fusion, is used to extract deep features of surface defects in steel. The specific process is as follows:

[0065] The LSKA module is placed at the end of the SPPF module, where the output formula of the LSKA attention mechanism is:

[0066]

[0067] In the formula It is attention map A C and input feature map F C The Hadamard product, which is also the output of the attention mechanism, This represents the Hadamard product operation, where A C =W 1×1 *Z C W 1×1 It is a 1*1 core. The output of the depthwise convolution is *, where * indicates the convolution operation.

[0068] S300: Train the ECS-YOLOv11s model using the defect augmentation dataset until the loss function converges, thus obtaining the trained ECS-YOLOv11s model.

[0069] In this embodiment, the augmented dataset is input into the ECS-YOLOv11s model for training until the loss function CIOU converges, thus completing the training of the ECS-YOLOv11s model.

[0070] In some embodiments, the CIOU loss function is expressed as:

[0071]

[0072] In the formula, α is a parameter used to balance the proportions, v is a parameter used to measure the proportional consistency between the anchor box and the target box, and w and h are the width and height of the predicted detection box, respectively. gt and h gt ρ represents the width and height of the ground truth bounding boxes, respectively. IOU is the ratio of the overlap area between the predicted and ground truth bounding boxes to the area of ​​the ground truth bounding boxes. 2 (b,b gt ) represents the Euclidean distance between the center points of the predicted bounding box and the ground truth bounding box, c represents the diagonal distance of the smallest closure region that simultaneously contains both the predicted and ground truth bounding boxes, and L represents the distance between the center points of the predicted bounding box and the ground truth bounding box. CIoU This represents a loss.

[0073] S400: Input the real-time acquired images of the steel surface into the trained ECS-YOLOv11s model to obtain the detection results of steel surface defects.

[0074] To further illustrate the feasibility and advancement of the method proposed in this application, the results of this method and the benchmark model YOLOv11s network for detecting surface defects in steel are analyzed using model evaluation indicators.

[0075] The model evaluation metrics used include precision (P), recall (R), mean average precision (mAP), and average precision (AP). The formulas for calculating these metrics are as follows:

[0076]

[0077] Where TP (truepositive) represents the number of positive samples predicted as positive samples; FP (falsepositive) represents the number of negative samples predicted as positive samples; and FN (truenegative) represents the number of positive samples predicted as negative samples. The steel surface defect detection method based on ECS-YOLOv11s designed in this invention achieves Precision, Recall, and mAP0.5 scores of 0.8009, 0.7164, and 0.8012 on the test set, respectively, while the baseline model YOLOv11s achieves Precision, Recall, and mAP0.5 scores of 0.7433, 0.71, and 0.77 on the test set, respectively. The method proposed in this application improves Precision, Recall, and mAP0.5 by 5.76%, 0.64%, and 3.12% compared to the baseline model YOLOv11s detection method. Furthermore, as... Figure 6 As shown, this application improves the prediction accuracy of various defects on steel surface defect images, such as cracks, inclusions, patches, pits, indented oxide scale, and scratches, compared to the benchmark model YOLOv11s, and can meet the requirements of real-time monitoring.

[0078] This application also provides a steel surface defect detection device, such as... Figure 7 As shown, the steel surface defect detection device includes:

[0079] The data construction module 701 is configured to acquire the original dataset, which includes images of steel surface defects. Each steel surface defect image is labeled with data, and the divided training set is subjected to data augmentation processing separately to obtain a defect augmentation dataset.

[0080] The model building module 702 is configured to build the ECS-YOLOv11 model based on the YOLOv11 network, improve the backbone and neck network of the YOLOv11 network, and integrate the attention mechanism LSKA module, and use a multi-scale feature fusion method.

[0081] The model training module 703 is configured to train the ECS-YOLOv11s model using the defect augmentation dataset until the loss function converges, thereby obtaining the trained ECS-YOLOv11s model.

[0082] The defect detection module 704 is configured to input real-time acquired images of the steel surface into the trained ECS-YOLOv11s model to obtain the detection results of steel surface defects.

[0083] This application provides an electronic device. The electronic device may include a processor and a memory, wherein the processor and the memory can communicate; exemplarily, the processor and the memory communicate via a communication bus.

[0084] The processor executes computer execution instructions stored in memory, causing the processor to perform the scheme in the above embodiments. The processor can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components.

[0085] The communication bus can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. The system bus can be divided into address bus, data bus, control bus, etc. Transceivers are used to enable communication between database access devices and other computers (e.g., clients, read-write libraries, and read-only libraries). Memory may include random access memory (RAM) and may also include non-volatile memory.

[0086] The electronic device provided in this application embodiment can be the terminal device described in the above embodiments.

[0087] This application also provides a computer-readable storage medium storing computer instructions. When the computer instructions are executed on a computer, the computer performs the technical solution of the steel surface defect detection method described in the above embodiment.

[0088] This application also provides a computer program product, which includes a computer program stored in a computer-readable storage medium. At least one processor can read the computer program from the computer-readable storage medium. When the at least one processor executes the computer program, it can implement the technical solution of the steel surface defect detection method in the above embodiments.

[0089] In the several embodiments provided in this application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are merely illustrative; for instance, the division of modules is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple modules may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be indirect coupling or communication connection through some interfaces, devices, or modules, and may be electrical, mechanical, or other forms.

[0090] The modules described as separate components may or may not be physically separate. The components shown as modules may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to implement the solution of this embodiment according to actual needs.

[0091] Furthermore, the functional modules in the various embodiments of this application can be integrated into one processing unit, or each module can exist physically separately, or two or more modules can be integrated into one unit. The unit composed of the above modules can be implemented in hardware or in the form of hardware plus software functional units.

[0092] The integrated modules described above, implemented as software functional modules, can be stored in a computer-readable storage medium. These software functional modules, stored in a storage medium, include several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) or processor to execute some steps of the methods of the various embodiments of this application.

[0093] It should be understood that the aforementioned processor can be a Central Processing Unit (CPU), or other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), etc. A general-purpose processor can be a microprocessor or any conventional processor. The steps of the method disclosed in this invention can be directly manifested as being executed by a hardware processor, or executed by a combination of hardware and software modules within the processor.

[0094] The memory may include high-speed RAM, and may also include non-volatile storage (NVM), such as at least one disk storage device, and may also be a USB flash drive, external hard drive, read-only memory, disk or optical disc, etc.

[0095] Buses can be Industry Standard Architecture (ISA) buses, Peripheral Component Interconnect (PCI) buses, or Extended Industry Standard Architecture (EISA) buses, etc. Buses can be categorized into address buses, data buses, control buses, etc.

[0096] The aforementioned storage medium can be implemented from any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic storage, flash memory, magnetic disk, or optical disk. The storage medium can be any available medium accessible to general-purpose or special-purpose computers.

[0097] An exemplary storage medium is coupled to a processor, enabling the processor to read information from and write information to the storage medium. Alternatively, the storage medium can be an integral part of the processor. The processor and storage medium can reside in an Application Specific Integrated Circuit (ASIC). Alternatively, the processor and storage medium can exist as discrete components in an electronic control unit or main control device.

[0098] Those skilled in the art will understand that all or part of the steps of the above-described method embodiments can be implemented by hardware related to program instructions. The aforementioned program can be stored in a computer-readable storage medium. When executed, the program performs the steps of the above-described method embodiments; and the aforementioned storage medium includes various media capable of storing program code, such as ROM, RAM, magnetic disks, or optical disks.

[0099] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit them. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some or all of the technical features therein. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of this application.

Claims

1. A method for detecting surface defects in steel, characterized in that, The method includes: Obtain the original dataset, which includes images of steel surface defects. Label each steel surface defect image with data, and perform data augmentation processing on the divided training set separately to obtain the defect augmentation dataset. Based on the YOLOv11 network, the backbone and neck networks of the YOLOv11 network are improved, and the attention mechanism LSKA module is integrated. The ECS-YOLOv11s model is constructed by using a multi-scale feature fusion method. The ECS-YOLOv11s model is trained using the defect augmentation dataset until the loss function converges, resulting in a trained ECS-YOLOv11s model. The real-time acquired images of the steel surface are input into the trained ECS-YOLOv11s model to obtain the detection results of steel surface defects.

2. The method for detecting surface defects in steel according to claim 1, characterized in that, The data enhancement processing includes horizontal and vertical image flipping, adjusting image brightness and contrast, image sharpening, and image blurring.

3. The method for detecting surface defects in steel according to claim 1, characterized in that, Based on the YOLOv11 network, the backbone and neck networks of the YOLOv11 network are improved, and the attention mechanism LSKA module is integrated. A multi-scale feature fusion approach is used to construct the ECS-YOLOv11s model, including: Based on the YOLOv11 network, the two shallowest downsampling modules Conv in the backbone network of the YOLOv11 network are improved into modules EIE, which are beneficial for extracting edge and spatial information features. The Bottleneck module in C3k2, which is the deepest feature extraction module in the backbone and neck network of the YOLOv11 network, is improved into a multi-channel parallel convolution, resulting in module C3MSC, which is beneficial for multi-scale feature fusion. The SPPF module in the backbone network of YOLOv11, which is used for multi-scale feature fusion, is improved into SPPL, a multi-scale feature fusion module that incorporates the attention mechanism LSKA.

4. The method for detecting surface defects in steel according to claim 3, characterized in that, The module EIE, which facilitates the extraction of edge and spatial information features, is used for deep extraction of edge and spatial information features of steel surface defects. The specific process of deep extraction of edge and spatial information features of steel surface defects includes: The input image information is used as the input feature image of the edge and spatial information feature extraction (EIE) module. The input feature map is subjected to convolutional layer dimensionality reduction, batch normalization, and activation function processing to obtain a preliminary feature map. For each channel of the input feature map, the Scharr convolution operator is used to independently perform edge detection in the height and width directions, extract edge features, and superimpose the height and width directions to enhance the ability to capture edges in multiple directions, thus obtaining an edge information feature map. The input feature map is subjected to max pooling to extract the spatial salient region map, thus obtaining the spatial information feature map. The obtained preliminary feature map, spatial information feature map and edge information feature map are concatenated by channels. After concatenation, downsampling, batch normalization and activation function processing are performed to obtain intermediate feature maps. The intermediate feature maps are then residually connected with the output of the original image after resizing by average pooling and adjusting the number of channels by unit convolution, and unit convolution operation is performed to obtain the edge and spatial information feature maps of the steel surface defect image.

5. The method for detecting surface defects in steel according to claim 4, characterized in that, The C3MSC module, which facilitates multi-scale feature fusion, is used to extract deep features of steel surface defects. The specific process for extracting deep features of steel surface defects includes: The input from the previous layer is divided into four groups. Three of these groups are processed independently using convolution with different kernel sizes. The remaining group is left unprocessed, preserving the detailed information from the previous layer, and thus the feature maps for each group are obtained. The feature maps of each group are concatenated by channels. After concatenation, dimensionality reduction, batch normalization and activation function processing are performed. Then, a unit convolution kernel is used for convolution. The output obtained after convolution is residually connected with the input and unit convolution is performed to obtain a multi-scale feature fusion information map of the steel surface defect image.

6. The method for detecting surface defects in steel according to claim 1, characterized in that, The LSKA module, which facilitates multi-scale feature fusion, is used to extract deep features of steel surface defects. The specific process for extracting deep features of steel surface defects includes: The LSKA module is placed at the end of the SPPF module, and the output formula of the LSKA module is: In the formula, It is attention map A C and input feature map F C The Hadamard product, which is also the output of the attention mechanism, This represents the Hadamard product operation, where A C =W 1×1 *Z C W 1×1 It is a 1*1 core. The output of the depthwise convolution is *, where * indicates the convolution operation.

7. The method for detecting surface defects in steel according to claim 1, characterized in that, When training the ECS-YOLOv11s model using the aforementioned defect augmentation dataset, the loss function used is expressed as follows: In the formula, α is a parameter used to balance the proportions, v is a parameter used to measure the proportional consistency between the anchor box and the target box, and w and h are the width and height of the predicted detection box, respectively. gt and h gt ρ represents the width and height of the ground truth bounding boxes, respectively. IOU is the ratio of the overlap area between the predicted and ground truth bounding boxes to the area of ​​the ground truth bounding boxes. 2 (b,b gt ) represents the Euclidean distance between the center points of the predicted bounding box and the ground truth bounding box, c represents the diagonal distance of the smallest closure region that simultaneously contains both the predicted and ground truth bounding boxes, and L represents the distance between the center points of the predicted bounding box and the ground truth bounding box. CIoU This represents a loss.

8. A steel surface defect detection device, characterized in that, The device includes: The data construction module is configured to acquire the original dataset, which includes images of steel surface defects, to annotate each steel surface defect image, and to perform data augmentation processing on the divided training set separately to obtain a defect augmentation dataset. The model building module is configured to build the ECS-YOLOv11 model based on the YOLOv11 network, improve the backbone and neck network of the YOLOv11 network, and integrate the attention mechanism LSKA module, using a multi-scale feature fusion method. The model training module is configured to train the ECS-YOLOv11s model using the defect augmentation dataset until the loss function converges, thereby obtaining the trained ECS-YOLOv11s model. The defect detection module is configured to input real-time acquired images of the steel surface into a trained ECS-YOLOv11s model to obtain the detection results of steel surface defects.

9. An electronic device, characterized in that, include: A processor, and a memory communicatively connected to the processor; The memory stores computer-executed instructions; The processor executes the computer execution instructions stored in the memory to implement the steel surface defect detection method as described in any one of claims 1-7.

10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer-executable instructions, which, when executed by a processor, are used to implement the steel surface defect detection method as described in any one of claims 1-7.

Citation Information

Patent Citations

  • Steel surface defect detection method based on YOLOv7-ECD

    CN116468716A

  • PPY-YOLO-based steel surface defect detection method and system

    CN119672031A

  • Steel surface defect detection method and system

    CN119941724A

  • Surface defect small target detection method based on multi-scale feature interaction

    CN120374613A

Cited By

  • Visual detection method and system for tea impurities, electronic equipment and storage medium

    CN121329970A

  • A method, system, electronic device, and storage medium for visually detecting impurities in tea leaves.

    CN121329970B

  • Steel structure weld defect identification method and system

    CN121482059A

  • Steel part hole identification method and system based on multi-scale image identification

    CN121686013A

  • Real-time detection method, device and equipment for service state of pipeline fastening equipment and storage medium

    CN122073008A