Method and device for realizing strip steel surface defect detection based on improved YOLOv8 model, processor and readable storage medium thereof

By introducing GhostBottleneck, dynamic convolution module and SELayerV1 in the YOLOv8 model, and using lightweight shared convolution detection heads, the GSL-YOLO improved model was solved, and the accuracy and real-time problems of steel surface defect detection in complex environments were solved. Achieve efficient and accurate detection results.

CN119477822APending Publication Date: 2025-02-18EAST CHINA UNIV OF SCI & TECH
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411489198.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-10-24
Publication Date
2025-02-18

AI Technical Summary

Technical Problem

Steel surface defect detection is difficult to achieve high accuracy and real-time under complex shapes and textures, low contrast and noise interference. Traditional methods are inefficient and have large errors, making it difficult to meet the needs of modern industrial.

Method used

Based on the improved YOLOv8 model, by introducing GhostBottleneck and dynamic convolution modules into the backbone network, combining SELayerV1 as the channel-level attention mechanism, and replacing the original detection head with a lightweight shared convolution detection head, building a GSL-YOLO improved model and improving the model adaptability and accuracy.

Benefits of technology

It realizes high accuracy and high efficiency in strip surface defect detection, reduces model memory usage and computing overhead, and is suitable for resource-constrained devices, and can achieve real-time and efficient detection.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119477822A_ABST
    Figure CN119477822A_ABST
Patent Text Reader

Abstract

The invention relates to a method for realizing strip steel surface defect detection based on an improved YOLOv8 model. The method comprises the following steps: establishing a strip steel surface defect data set; a GSL-YOLO improved model is constructed on the basis of a YOLOv8n framework; sELayerV1 is introduced into the neck network to serve as an attention mechanism of a channel type; replacing an original detection head with a lightweight shared convolution detection head LSDECD; and training the improved GSL-YOLO model, and carrying out offline detection on metal surface defects. The invention further relates to a device, a processor and a readable storage medium for strip steel surface defect detection based on the improved YOLOv8 model. By the adoption of the method and device for achieving strip steel surface defect detection based on the improved YOLOv8 model, the processor and the computer readable storage medium of the processor, the strip steel surface defect detection precision and efficiency are improved, model memory occupation and calculation expenditure are reduced, the method and device are suitable for equipment with limited resources, and real-time efficient detection can be achieved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of computer vision, in particular to the field of steel industry, and specifically refers to a method, device, processor and computer-readable storage medium thereof for realizing strip surface defect detection based on an improved YOLOv8 model. Background Art

[0002] With the development of the steel industry, steel is widely used in construction, machinery manufacturing, transportation and other fields, and its quality directly affects the performance and safety of products. However, during the production process, defects such as plaques and scratches are prone to appear on the surface of steel, which affects the appearance and reduces mechanical properties such as fatigue resistance and wear resistance, and even brings safety hazards. Traditional manual inspection is difficult to meet modern needs due to its low efficiency and large errors. Computer vision technology, with its high efficiency and precision, has gradually become an important means to assist manual inspection and improve inspection speed and accuracy.

[0003] With the development of deep learning, defect detection based on convolutional neural networks (CNN) has made significant progress in steel surface inspection. Early two-stage algorithms such as Faster R-CNN, although highly accurate, are computationally complex and slow, making it difficult to meet industrial real-time needs. Relatively speaking, single-stage algorithms such as YOLO improve detection efficiency by directly predicting location and classification, are more suitable for real-time industrial applications, and have gradually become the mainstream method for steel defect detection.

[0004] However, steel surface defect detection still faces challenges. Complex shapes and textures increase the difficulty of detection. Low contrast and noise interference may also lead to missed or false detections. In recent years, the accuracy and robustness of the model have been improved through feature fusion and attention mechanisms. With the improvement of industrial production efficiency, the model not only needs to be highly accurate, but also real-time and able to run in resource-limited environments such as embedded devices. Therefore, the development of high-precision and lightweight detection algorithms has become a key direction. By optimizing the model structure and feature extraction, not only can the detection accuracy be improved, but also its efficient operation can be ensured, which will promote the widespread application of defect detection, improve production efficiency and reduce costs. Summary of the invention

[0005] The purpose of the present invention is to overcome the shortcomings of the above-mentioned prior art and provide a method, device, processor and computer-readable storage medium for strip surface defect detection based on an improved YOLOv8 model with high full detection accuracy, high production efficiency and a wide range of applications.

[0006] In order to achieve the above-mentioned object, the method, device, processor and computer-readable storage medium thereof for realizing strip surface defect detection based on the improved YOLOv8 model of the present invention are as follows:

[0007] The method for realizing strip surface defect detection based on the improved YOLOv8 model has the following main features:

[0008] (1) Establish a data set of strip surface defects;

[0009] (2) Build the GSL-YOLO improved model based on the YOLOv8n architecture, replace the DarknetBottleneck in the C2f module with GhostBottleneck in the backbone network, and replace the CBS module in the Bottleneck module with the dynamic convolution module Dynamic Conv;

[0010] (3) Introducing SELayerV1 as a channel-type attention mechanism in the neck network;

[0011] (4) Replace the original detection head with a lightweight shared convolutional detection head LSDECD;

[0012] (5) Train the improved GSL-YOLO model and use the model with the best performance during the training process to perform offline detection of metal surface defects.

[0013] Preferably, the step (1) specifically comprises the following steps:

[0014] (1.1) The constructed data set should include different types of defects and the data set should be classified as a training set;

[0015] (1.2) Perform manual defect annotation and save the annotation file in a txt format that can be processed;

[0016] (1.3) Preprocess the dataset and crop each image in the dataset to a resolution of 640×640.

[0017] Preferably, the step (2) specifically comprises the following steps:

[0018] (2.1) Build the Ghost module;

[0019] (2.2) Design GhostBottleNeck, using the first Ghost module as the expansion layer and the second Ghost module as the contraction layer;

[0020] (2.3) Construct dynamic convolution module Dynamic Conv;

[0021] (2.4) Use the generated weights α(i) to dynamically combine different expert convolution kernels W i , get the final output;

[0022] (2.5) Build C2f-Ghost-Dynamic.

[0023] Preferably, the step (3) specifically comprises the following steps:

[0024] (3.1) After the input feature map is transformed, it is compressed into a global descriptor through global average pooling;

[0025] (3.2) The generated channel descriptors pass through two fully connected layers to reweight the channel information;

[0026] (3.3) Multiply the generated weight s by the original feature map U channel by channel to form a calibrated feature map;

[0027] (3.4) An SE block is introduced after each C2f module in the neck network to construct SELayerV1.

[0028] Preferably, the step (4) specifically comprises the following steps:

[0029] (4.1) The same convolution parameters are used in the three branches of the detection head;

[0030] (4.2) Replace ordinary convolution with detail enhancement convolution and replace batch normalization with group normalization;

[0031] (4.3) The independent regression and classification branches of each feature map are merged into a single shared structure, and a scaling layer is added to the regression branch.

[0032] Preferably, the step (5) specifically comprises the following steps:

[0033] (5.1) Set model training hyperparameters;

[0034] (5.2) Four images are randomly selected each time during training;

[0035] (5.3) Use the improved GSL-YOLO model for training.

[0036] Preferably, the step (2.1) specifically includes the following steps:

[0037] (2.1.1) Generate fewer intrinsic feature maps through standard operations;

[0038] (2.1.2) Perform a simple linear transformation on the intrinsic feature map Y' to generate more Ghost feature maps;

[0039] (2.1.3) All Ghost feature maps are concatenated with the intrinsic feature map to form the final output feature map.

[0040] Preferably, the step (2.3) specifically comprises the following steps:

[0041] (2.3.1) Perform global average pooling on the input data to fuse the information into a feature vector;

[0042] (2.3.2) Use a two-layer fully connected network to generate weights α;

[0043] (2.3.3)Weight multiple expert convolution kernels by weight α.

[0044] Preferably, the step (3.2) specifically includes the following steps:

[0045] (3.2.1) Reduce the amount of computation by reducing dimensionality;

[0046] (3.2.2) Perform dimension increase and generate weight s.

[0047] The device for realizing strip surface defect detection based on the improved YOLOv8 model has the following main features: the device comprises:

[0048] a processor configured to execute computer executable instructions;

[0049] A memory stores one or more computer executable instructions. When the computer executable instructions are executed by the processor, the various steps of the method for detecting surface defects of strip steel based on the improved YOLOv8 model are implemented.

[0050] The processor for realizing strip surface defect detection based on the improved YOLOv8 model has the main feature that the processor is configured to execute computer executable instructions. When the computer executable instructions are executed by the processor, the various steps of the method for realizing strip surface defect detection based on the improved YOLOv8 model are realized.

[0051] The computer-readable storage medium has the main feature of storing a computer program thereon, and the computer program can be executed by a processor to implement the various steps of the above-mentioned method for detecting surface defects of strip steel based on the improved YOLOv8 model.

[0052] The method, device, processor and computer-readable storage medium thereof for realizing strip surface defect detection based on the improved YOLOv8 model of the present invention are adopted, which improves the accuracy and efficiency of strip surface defect detection, reduces the model memory occupancy and computing overhead, is suitable for resource-constrained equipment, and can realize real-time and efficient detection. BRIEF DESCRIPTION OF THE DRAWINGS

[0053] Figure 1The present invention is a flow chart of a method for realizing strip surface defect detection based on an improved YOLOv8 model.

[0054] Figure 2 It is a schematic diagram of the Ghost module structure of the method for realizing strip surface defect detection based on the improved YOLOv8 model of the present invention.

[0055] Figure 3 It is a schematic diagram of the Dynamic module structure of the method for realizing strip surface defect detection based on the improved YOLOv8 model of the present invention.

[0056] Figure 4 This is a diagram of the improved C2f-Ghost-Dynamic structure of the method for realizing strip surface defect detection based on the improved YOLOv8 model of the present invention.

[0057] Figure 5 The invention discloses an SE module extrusion-excitation working mechanism for the method for realizing strip surface defect detection based on the improved YOLOv8 model.

[0058] Figure 6 It is a schematic diagram of the SELayerV1 structure of the method for realizing strip surface defect detection based on the improved YOLOv8 model of the present invention.

[0059] Figure 7 It is a schematic diagram of the LSDECD structure of the method for realizing strip surface defect detection based on the improved YOLOv8 model of the present invention.

[0060] Figure 8 This is a diagram of the improved GSL-YOLOv8 model architecture of an embodiment of the method for realizing strip surface defect detection based on the improved YOLOv8 model of the present invention. DETAILED DESCRIPTION

[0061] In order to more clearly describe the technical content of the present invention, further description is given below in conjunction with specific embodiments.

[0062] The method for realizing strip surface defect detection based on the improved YOLOv8 model of the present invention comprises the following steps:

[0063] (1) Establish a data set of strip surface defects;

[0064] (2) Build the GSL-YOLO improved model based on the YOLOv8n architecture, replace the DarknetBottleneck in the C2f module with GhostBottleneck in the backbone network, and replace the CBS module in the Bottleneck module with the dynamic convolution module Dynamic Conv;

[0065] (3) Introducing SELayerV1 as a channel-type attention mechanism in the neck network;

[0066] (4) Replace the original detection head with a lightweight shared convolutional detection head LSDECD;

[0067] (5) Train the improved GSL-YOLO model and use the model with the best performance during the training process to perform offline detection of metal surface defects.

[0068] As a preferred embodiment of the present invention, the step (1) specifically comprises the following steps:

[0069] (1.1) The constructed data set should include different types of defects and the data set should be classified as a training set;

[0070] (1.2) Perform manual defect annotation and save the annotation file in a txt format that can be processed;

[0071] (1.3) Preprocess the dataset and crop each image in the dataset to a resolution of 640×640.

[0072] As a preferred embodiment of the present invention, the step (2) specifically comprises the following steps:

[0073] (2.1) Build the Ghost module;

[0074] (2.2) Design GhostBottleNeck, using the first Ghost module as the expansion layer and the second Ghost module as the contraction layer;

[0075] (2.3) Construct dynamic convolution module Dynamic Conv;

[0076] (2.4) Use the generated weights α(i) to dynamically combine different expert convolution kernels W i , get the final output;

[0077] (2.5) Build C2f-Ghost-Dynamic.

[0078] As a preferred embodiment of the present invention, the step (3) specifically comprises the following steps:

[0079] (3.1) After the input feature map is transformed, it is compressed into a global descriptor through global average pooling;

[0080] (3.2) The generated channel descriptors pass through two fully connected layers to reweight the channel information;

[0081] (3.3) Multiply the generated weight s by the original feature map U channel by channel to form a calibrated feature map;

[0082] (3.4) An SE block is introduced after each C2f module in the neck network to construct SELayerV1.

[0083] As a preferred embodiment of the present invention, the step (4) specifically comprises the following steps:

[0084] (4.1) The same convolution parameters are used in the three branches of the detection head;

[0085] (4.2) Replace ordinary convolution with detail enhancement convolution and replace batch normalization with group normalization;

[0086] (4.3) The independent regression and classification branches of each feature map are merged into a single shared structure, and a scaling layer is added to the regression branch.

[0087] As a preferred embodiment of the present invention, the step (5) specifically comprises the following steps:

[0088] (5.1) Set model training hyperparameters;

[0089] (5.2) Four images are randomly selected each time during training;

[0090] (5.3) Use the improved GSL-YOLO model for training.

[0091] As a preferred embodiment of the present invention, the step (2.1) specifically includes the following steps:

[0092] (2.1.1) Generate fewer intrinsic feature maps through standard operations;

[0093] (2.1.2) Perform a simple linear transformation on the intrinsic feature map Y' to generate more Ghost feature maps;

[0094] (2.1.3) All Ghost feature maps are concatenated with the intrinsic feature map to form the final output feature map.

[0095] As a preferred embodiment of the present invention, the step (2.3) specifically includes the following steps:

[0096] (2.3.1) Perform global average pooling on the input data to fuse the information into a feature vector;

[0097] (2.3.2) Use a two-layer fully connected network to generate weights α;

[0098] (2.3.3)Weight multiple expert convolution kernels by weight α.

[0099] As a preferred embodiment of the present invention, the step (3.2) specifically includes the following steps:

[0100] (3.2.1) Reduce the amount of computation by reducing dimensionality;

[0101] (3.2.2) Perform dimension increase and generate weight s.

[0102] The device for realizing strip surface defect detection based on the improved YOLOv8 model of the present invention, wherein the device comprises:

[0103] a processor configured to execute computer executable instructions;

[0104] A memory stores one or more computer executable instructions. When the computer executable instructions are executed by the processor, the various steps of the method for detecting surface defects of strip steel based on the improved YOLOv8 model are implemented.

[0105] The processor of the present invention is used to implement strip surface defect detection based on the improved YOLOv8 model, wherein the processor is configured to execute computer executable instructions. When the computer executable instructions are executed by the processor, the various steps of the method for strip surface defect detection based on the improved YOLOv8 model are implemented.

[0106] The computer-readable storage medium of the present invention stores a computer program thereon, and the computer program can be executed by a processor to implement the various steps of the above-mentioned method for detecting surface defects of strip steel based on the improved YOLOv8 model.

[0107] In a specific embodiment of the present invention, a strip surface defect detection method based on improved YOLOv8 is disclosed, which relates to the field of target detection technology. Based on the YOLOv8 framework, the present invention replaces the DarknetBottleneck in the C2f module with GhostBottleneck, and replaces the CBS convolution module therein with dynamic convolution (DynamicConv), so as to achieve flexible adjustment of feature extraction and improve the adaptability and accuracy of the model. GhostBottleneck generates intrinsic feature maps by reducing convolution operations, and generates more feature maps by linear transformation, thereby reducing computational overhead. The SELayerV1 module is introduced in the neck network as a channel-level attention mechanism to adaptively adjust channel weights and enhance the ability to perceive correlation between channels. The lightweight shared convolution detection head LSDECD reduces the amount of calculation by sharing parameters, speeds up detection and reduces the number of parameters.

[0108] like Figure 1As shown, in one embodiment of the present invention, a strip surface defect detection method based on an improved YOLOv8 model is provided, and the method comprises the following steps:

[0109] S1: Establish a data set of strip surface defects;

[0110] S2: Build the GSL-YOLO improved model based on the YOLOv8n architecture. In the backbone network, replace the Conv part in the C2f module with DynamicConv, and replace the DarknetBottleneck in the C2f module with GhostBottleneck.

[0111] S3: Introduce SELayerV1 as a channel-type attention mechanism in the neck network;

[0112] S4: Replace the original detection head with a lightweight shared convolutional detection head LSDECD;

[0113] S5: Train the improved GSL-YOLO model and use the best performing model during the training process to perform offline detection of metal surface defects.

[0114] The step S1 specifically includes:

[0115] S11: The constructed data set should include different types of defects, and then the data set should be divided according to the ratio of training set: validation set: test set = 7:2:1;

[0116] S12: Manually mark defects and save the marked files in a txt format that can be processed;

[0117] S13: Preprocess the data set. First, crop each image in the data set to a resolution of 640×640.

[0118] The step S2 specifically includes:

[0119] S21: Construct Ghost module: First, generate fewer intrinsic feature maps through standard operations: Y'=X*W', where X is the input data, W' is the convolution kernel, and Y' is the fewer intrinsic feature maps. Then perform a simple linear transformation on the intrinsic feature map Y' to generate more Ghost feature maps: Finally, all Ghost feature maps are concatenated with the intrinsic feature map to form the final output feature map: Y = [y 11 ,y 12 ,...,y ms ];

[0120] S22: Design GhostBottleNeck: It mainly consists of two stacked Ghost modules. The first Ghost module acts as an expansion layer, whose main function is to enhance the representation ability of features by increasing the number of channels, thereby improving model performance. The second Ghost module acts as a contraction layer, whose main function is to reduce the number of channels to match the shortcut path. Inside GhostBottleNeck, BN and ReLU nonlinear activation functions are applied, and ReLU is not used after the second Ghost module;

[0121] S23: Construct a dynamic convolution module (Dynamic Conv): for input data X∈R C×H×W Perform global average pooling to fuse the information into a feature vector, and then use a two-layer fully connected network (MLP) to generate weights α, which will be used to weight multiple expert convolution kernels (expert convolution). The formula for generating weights is α = softmax (MLP (Pool (X)));

[0122] S24: Use the generated weights α(i) to dynamically combine different expert convolution kernels W i , the final output can be expressed as: This design allows each input to dynamically select the optimal convolution kernel combination for processing. The computational overhead introduced by this mechanism is very small, but it significantly improves the flexibility and accuracy of feature extraction.

[0123] S25: Building C2f-Ghost-Dynamic: Ghost Bottleneck is used to replace DarknetBottleneck in the traditional C2f module, and DynamicConv is introduced to replace the standard CBS module used in DarknetBottleneck. This dual-improvement design not only optimizes the use of computing resources, but also significantly enhances the model's adaptability to complex scenarios and diverse inputs.

[0124] The step S3 specifically includes:

[0125] S31: Construct SE (Squeeze Excitation) module: for feature map U∈R H×W×C Perform global pooling to generate a descriptor z of size 1×1×C: Among them, z c is the global descriptor of the c-th channel.

[0126] S32: Next, these channel information will be re-weighted. This process is completed through two fully connected layers: first, the dimensionality reduction operation is used to reduce the amount of calculation, and then the dimensionality is increased and the weight s is generated: s = σ (W2δ (W1z)). Among them, W1 and W2 are the weight matrices of the fully connected layer for dimensionality reduction and dimensionality increase, respectively, δ is the ReLU activation function, and σ is the Sigmoid activation function.

[0127] S33: Finally, the generated weight s is multiplied channel by channel with the original feature map U to form a calibrated feature map:

[0128] S34: Construct SELayerV1: The SE block is introduced after each C2f module in the neck network as a channel-level attention mechanism, which can adaptively recalibrate the weight of each channel.

[0129] The step S4 specifically includes:

[0130] S41: Referring to the idea of ​​shared convolution, using the same convolution parameters in the three branches of the detection head can reduce the time required for the forward calculation of the algorithm model and reduce the number of parameters.

[0131] S42: Detail enhancement convolution (DEConv_GN) is introduced to replace ordinary convolution, and group normalization (GroupNormalization) is used to replace batch normalization.

[0132] S43: Merge the independent regression and classification branches of each feature map into a single shared structure, and add a scaling layer to the regression branch.

[0133] The step S5 specifically includes:

[0134] S5: Set the model training hyperparameters, including: epochs of training are 400, patience is 100, batch size is 64, optimizer is SGD, momentum is 0.937, image size is 640×640, random seeds are fixed to 42, and workers are 8;

[0135] The mosaic online data augmentation method should be used during training, that is, four pictures are randomly selected each time during training to increase the diversity of training samples, which helps to improve the generalization ability of the model and its ability to handle multi-target scenes.

[0136] The improved GSL-YOLO model is used for training. The model evaluation indicators involved include mAP@0.5, Parameters, ModelSize. mAP@0.5 refers to the average precision calculated when the IoU threshold is 0.5, which is mainly used to evaluate the target positioning ability of the model. Its calculation formula is:

[0137]

[0138] Parameters is one of the important indicators to measure the complexity of the model. The more parameters, the stronger the expressive power of the model may be, but at the same time, the computing resource requirements are also higher. ModelSize refers to the storage size of the model file. Smaller models are easier to run on devices with limited memory and storage resources.

[0139] In this case, the Ghost module in step S2 can generate intrinsic feature maps through fewer convolution operations, and then use a series of cheap linear transformations. Acting on each channel, it generates more additional feature maps and improves the performance of the model. The structure of the Ghost module is as follows Figure 2 The Dynamic module introduces a slight computational overhead, but can improve the flexibility and accuracy of feature extraction. The structure of the Dynamic module is as follows Figure 3 As shown in the figure. In the C2f-Ghost-Dynamic module, Ghost Bottleneck is used to replace the DarknetBottleneck in the traditional C2f module, and DynamicConv is introduced to replace the CBS module in DarknetBottleneck. This dual improvement design not only optimizes the use of computing resources, but also significantly enhances the model's adaptability to complex scenarios and diverse inputs. The improved C2f-Ghost-Dynamic module structure is shown in the figure. Figure 4 shown.

[0140] Step S3 designs SELayerV1 to more accurately capture the key features of the target and further improve the global representation capability of the model. The structure diagram of SELayerV1 is shown in the figure. Figure 6 As shown, as a channel-level attention mechanism, the weight of each channel can be adaptively recalibrated.

[0141] Step S4 designs a lightweight shared convolutional detection head LSDECD, the structure of which is shown in the figure Figure 7 As shown in the figure, the idea of ​​shared convolution is referred to, and a scale layer is added to the regression branch to achieve fewer parameters and less computation, thereby improving detection speed and accuracy.

[0142] In this example, in order to verify the effectiveness of the method described in this solution, YOLOv8 is used as the baseline model, and ablation experiments are performed on each improved module. The following table shows the ablation experiment results. Model A represents the baseline network, model B represents the improved backbone C2f module, and model C represents the increase of attention in the neck. Model D represents the improved detection head. Model D is used to verify the final detection effect of the present invention, and its test results are shown in the following table:

[0143]

[0144] In the above example, the GSL-YOLOv8 strip steel surface defect detection method provided by the embodiment of the present invention has an improved model architecture as shown in FIG. Figure 8 As shown in the figure, based on the original YOLOv8 architecture, GhostBottleneck is introduced in the backbone network to replace DarnetBottleneck in the C2f module of the baseline model, and dynamic convolution is introduced to replace the CBS convolution module in the DarnetBottleneck module; in the YOLOv8 neck network, SELayerV1 is added before each detection head; the original detection head is replaced by a lightweight shared convolution detection head LSDECD.

[0145] The technical solution of the present invention replaces the DarknetBottleneck in the C2f module with GhostBottleneck, and replaces the CBS convolution module therein with the dynamic convolution DynamicConv; introduces SELayerV1 as a channel type attention mechanism in the neck network; and replaces the original detection head with a lightweight shared convolution detection head LSDECD.

[0146] The specific implementation scheme of this embodiment can refer to the relevant description in the above embodiment, which will not be repeated here.

[0147] It can be understood that the same or similar parts of the above embodiments can be referenced to each other, and the contents not described in detail in some embodiments can refer to the same or similar contents in other embodiments.

[0148] It should be noted that, in the description of the present invention, the terms "first", "second", etc. are only used for descriptive purposes and cannot be understood as indicating or implying relative importance. In addition, in the description of the present invention, unless otherwise specified, the meaning of "plurality" refers to at least two.

[0149] Any process or method description in a flowchart or otherwise described herein may be understood to represent a module, segment or portion of code that includes one or more executable instructions for implementing the steps of a specific logical function or process, and the scope of the preferred embodiments of the present invention includes alternative implementations in which functions may not be performed in the order shown or discussed, including performing functions in a substantially simultaneous manner or in the reverse order depending on the functions involved, which should be understood by those skilled in the art to which the embodiments of the present invention belong.

[0150] It should be understood that the various parts of the present invention can be implemented by hardware, software, firmware or a combination thereof. In the above-mentioned embodiments, a plurality of steps or methods can be implemented by software or firmware stored in a memory and executed by a suitable instruction execution device. For example, if implemented by hardware, as in another embodiment, it can be implemented by any one of the following technologies known in the art or their combination: a discrete logic circuit having a logic gate circuit for implementing a logic function for a data signal, a dedicated integrated circuit having a suitable combination of logic gate circuits, a programmable gate array (PGA), a field programmable gate array (FPGA), etc.

[0151] A person skilled in the art may understand that all or part of the steps in the method for implementing the above-mentioned embodiment may be completed by instructing related hardware through a program, and the corresponding program may be stored in a computer-readable storage medium, which, when executed, includes one of the steps of the method embodiment or a combination thereof.

[0152] In addition, each functional unit in each embodiment of the present invention may be integrated into a processing module, or each unit may exist physically separately, or two or more units may be integrated into one module. The above-mentioned integrated module may be implemented in the form of hardware or in the form of a software functional module. If the integrated module is implemented in the form of a software functional module and sold or used as an independent product, it may also be stored in a computer-readable storage medium.

[0153] The storage medium mentioned above can be a read-only memory, a magnetic disk or an optical disk, etc.

[0154] In the description of this specification, the description with reference to the terms "one embodiment", "some embodiments", "examples", "specific examples", or "some examples" means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present invention. In this specification, the schematic representation of the above terms does not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described may be combined in any one or more embodiments or examples in a suitable manner.

[0155] The method, device, processor and computer-readable storage medium thereof for realizing strip surface defect detection based on the improved YOLOv8 model of the present invention are adopted, which improves the accuracy and efficiency of strip surface defect detection, reduces the model memory occupancy and computing overhead, is suitable for resource-constrained equipment, and can realize real-time and efficient detection.

[0156] In this specification, the present invention has been described with reference to specific embodiments thereof. However, it is apparent that various modifications and variations may be made without departing from the spirit and scope of the present invention. Therefore, the specification and drawings should be regarded as illustrative rather than restrictive.

Claims

1. A method for detecting surface defects of strip steel based on an improved YOLOv8 model, characterized in that: The method comprises the following steps: (1) Establish a data set of strip surface defects; (2) Build the GSL-YOLO improved model based on the YOLOv8n architecture, replace the DarknetBottleneck in the C2f module with GhostBottleneck in the backbone network, and replace the CBS module in the Bottleneck module with the dynamic convolution module Dynamic Conv; (3) Introducing SELayerV1 as a channel-type attention mechanism in the neck network; (4) Replace the original detection head with a lightweight shared convolutional detection head LSDECD; (5) Train the improved GSL-YOLO model and use the model with the best performance during the training process to perform offline detection of metal surface defects.

2. The method for detecting surface defects of strip steel based on the improved YOLOv8 model according to claim 1 is characterized in that: The step (1) specifically comprises the following steps: (1.1) The constructed data set should include different types of defects and the data set should be classified as a training set; (1.2) Perform manual defect annotation and save the annotation file in a txt format that can be processed; (1.3) Preprocess the dataset and crop each image in the dataset to a resolution of 640×640.

3. The method for realizing strip surface defect detection based on the improved YOLOv8 model according to claim 1 is characterized in that: The step (2) specifically comprises the following steps: (2.1) Build the Ghost module; (2.2) Design GhostBottleNeck, using the first Ghost module as the expansion layer and the second Ghost module as the contraction layer; (2.3) Construct dynamic convolution module Dynamic Conv; (2.4) Use the generated weights α(i) to dynamically combine different expert convolution kernels W i , get the final output; (2.5) Build C2f-Ghost-Dynamic.

4. The method for realizing strip surface defect detection based on the improved YOLOv8 model according to claim 1 is characterized in that: The step (3) specifically comprises the following steps: (3.1) After the input feature map is transformed, it is compressed into a global descriptor through global average pooling; (3.2) The generated channel descriptors pass through two fully connected layers to reweight the channel information; (3.3) Multiply the generated weight s by the original feature map U channel by channel to form a calibrated feature map; (3.4) An SE block is introduced after each C2f module in the neck network to construct SELayerV1.

5. The method for detecting surface defects of strip steel based on the improved YOLOv8 model according to claim 1, characterized in that: The step (4) specifically comprises the following steps: (4.1) The same convolution parameters are used in the three branches of the detection head; (4.2) Replace ordinary convolution with detail enhancement convolution and replace batch normalization with group normalization; (4.3) The independent regression and classification branches of each feature map are merged into a single shared structure, and a scaling layer is added to the regression branch.

6. The method for realizing strip surface defect detection based on the improved YOLOv8 model according to claim 1 is characterized in that: The step (5) specifically comprises the following steps: (5.1) Set model training hyperparameters; (5.2) Four images are randomly selected each time during training; (5.3) Use the improved GSL-YOLO model for training.

7. The method for detecting surface defects of strip steel based on the improved YOLOv8 model according to claim 3 is characterized in that: The step (2.1) specifically comprises the following steps: (2.1.1) Generate fewer intrinsic feature maps through standard operations; (2.1.2) Perform a simple linear transformation on the intrinsic feature map Y' to generate more Ghost feature maps; (2.1.3) All Ghost feature maps are concatenated with the intrinsic feature map to form the final output feature map.

8. The method for realizing strip surface defect detection based on the improved YOLOv8 model according to claim 3 is characterized in that: The step (2.3) specifically comprises the following steps: (2.3.1) Perform global average pooling on the input data to fuse the information into a feature vector; (2.3.2) Use a two-layer fully connected network to generate weights α; (2.3.3)Weight multiple expert convolution kernels by weight α.

9. The method for realizing strip surface defect detection based on the improved YOLOv8 model according to claim 4 is characterized in that: The step (3.2) specifically comprises the following steps: (3.2.1) Reduce the amount of computation by reducing dimensionality; (3.2.2) Perform dimension increase and generate weight s.

10. A device for realizing strip surface defect detection based on an improved YOLOv8 model, characterized in that: The device comprises: a processor configured to execute computer-executable instructions; A memory storing one or more computer executable instructions, wherein when the computer executable instructions are executed by the processor, the steps of the method for detecting surface defects of strip steel based on the improved YOLOv8 model described in any one of claims 1 to 9 are implemented.

11. A processor for realizing strip surface defect detection based on an improved YOLOv8 model, characterized in that: The processor is configured to execute computer-executable instructions. When the computer-executable instructions are executed by the processor, the steps of the method for detecting surface defects of strip steel based on the improved YOLOv8 model described in any one of claims 1 to 9 are implemented.

12. A computer-readable storage medium, characterized in that: A computer program is stored thereon, and the computer program can be executed by a processor to implement the various steps of the method for detecting surface defects of strip steel based on an improved YOLOv8 model as described in any one of claims 1 to 9.