Industrial application-oriented steel defect detection model and detection method

By optimizing the feature extraction and fusion process of the YOLOv8n-CSG model, the problems of low detection accuracy and high complexity in steel defect detection are solved, and efficient real-time detection on embedded devices is achieved, which is suitable for industrial applications.

CN120765962APending Publication Date: 2025-10-10ANHUI UNIV OF SCI & TECH
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510584355.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-05-07
Publication Date
2025-10-10

AI Technical Summary

Technical Problem

Existing object detection models suffer from low detection accuracy and high complexity in steel defect detection, making them difficult to deploy on embedded platforms, especially due to limited computing and storage resources.

Method used

The YOLOv8n-CSG model is adopted. By introducing the CBS module, C2f_CG module, SPPF module, C2f_Star module and GSConv module, the feature extraction and fusion process are optimized to build a lightweight steel defect detection network suitable for embedded devices.

Benefits of technology

It achieves efficient real-time detection of steel defects on embedded devices, improves detection accuracy and generalization performance, reduces computing resource requirements, and is suitable for industrial applications.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120765962A_ABST
    Figure CN120765962A_ABST
Patent Text Reader

Abstract

The invention discloses a steel defect detection model and detection method for industrial application, and the structure of the steel defect detection model comprises a Backbone module which is used for carrying out the feature extraction of a target image; the Neck module is used for fusing features and constructing a multi-scale feature map; and the Head module is used for detecting and classifying the feature map and outputting a detection result. The steel defect detection method comprises the following steps: firstly, introducing a context guidance module (CG block) to design a C2fCG module to enhance the capturing capability of surrounding features and enhance information relevance; and secondly, a star network module (Star Block) is added to design a C2fStar module, input data is mapped to a high-dimensional nonlinear feature space, and rich feature representation is generated, so that the model is more effective when processing fine defects. And finally, a lightweight detection head GSEDeect integrating GSConv and EMA attention mechanisms is designed, so that the complexity is reduced while the high efficiency of the original detection head is maintained. The problems that in steel defect detection, the detection precision is low due to various defect types and obvious size difference, the complexity of an existing model is high, and the existing model is difficult to deploy on embedded equipment due to the limitation of calculation and storage resources of an embedded platform are solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of target detection, and in particular relates to a steel defect detection model and a detection method for industrial applications. Background Art

[0002] The rapid development of deep learning has led to significant breakthroughs in all aspects of computer vision, particularly in object detection. Object detection is a key research topic in computer vision and an essential component of computer vision systems. Its purpose is to identify object categories and locate their positions. It has widespread applications in autonomous driving, industrial inspection, robotics, medical image processing, target tracking, and other fields.

[0003] Traditional object detection methods primarily rely on manual visual inspection and simple physical testing. These methods suffer from low efficiency, strong subjectivity, and low detection accuracy. With the rapid development of computer vision and artificial intelligence technologies, automated detection technologies based on deep learning are becoming the mainstream trend in object detection. These methods achieve efficient and automated defect detection through image processing and feature extraction, with higher accuracy. Deep learning-based object detection algorithms can be divided into two categories:

[0004] (1) Two-stage methods based on sliding windows or candidate region generation, such as the R-CNN series (including RCNN, Fast R-CNN, and Faster R-CNN), first generate candidate regions that may contain target objects, and then perform fine classification and bounding box regression. These methods are relatively complex algorithms and slow detection speeds, making them difficult to apply in actual industrial production inspections.

[0005] (2) Single-stage methods, such as SSD, EfficientDet, and YOLO (You Only Look Once), directly predict the location and category of the target object from the input image through a single forward propagation. This simplifies the detection process while increasing the running speed, making it more suitable for industrial-grade real-time detection. However, the effect is still not ideal when dealing with complex targets.

[0006] YOLOv1 is an end-to-end detection model that formulates object detection as a regression problem. This model significantly improves detection speed, but at the expense of relatively low accuracy. Building on YOLOv1, YOLOv2 introduced nine methods, including batch normalization and a high-resolution classifier, improving YOLOv1's detection accuracy by 15.2% on the VOC2007 dataset. YOLOv3, proposed by Redmon in 2018, builds on YOLOv2 by introducing an FPN architecture to better detect objects of varying sizes. YOLOv1-v3 build upon the original YOLO network, dividing it into three parts: the backbone, the neck, and the head. Multi-scale branches are used to predict objects of varying sizes. YOLOv4 builds on YOLOv3 by introducing a bottom-up PAN architecture, the CIOU bounding box loss function, and Mosaic techniques, further improving detection accuracy. YOLOv5 integrates various state-of-the-art methods, achieving a balance of accuracy, speed, and flexibility. Subsequently, YOLO X introduced multi-positive, anchor-free, and decoupling heads, ushering in a new paradigm for YOLO model design. YOLOv6 introduced reparameterization methods to the YOLO series for the first time, proposing the EfficientRep Backbone and Rep-PAN Neck. YOLOv7 focused on analyzing the impact of gradient paths on model performance and proposed the E-ELAN architecture to enhance model capabilities without destroying the original gradient path. PP-YOLOE introduced CSPRepResStage, ET-head, and the dynamic label assignment algorithm TAL for user-friendly deployment. RTMDet, based on YOLOX, adopts a new training strategy, introduces large-kernel deep convolution, and designs a new soft label assignment algorithm, further improving detection performance. YOLOv8 absorbs the advantages of previous YOLO models and integrates them to achieve superior detection results. Gold-YOLO identified the information fusion problem of the model and proposed the GD mechanism, which improves the multi-scale feature fusion capability and achieves state-of-the-art results in the YOLO network. However, most of the above excellent detection models focus on improving the detection accuracy on large datasets such as COCO, while ignoring the deployment effect and the detection effect on other small and medium-sized datasets.

[0007] Furthermore, traditional object detection models are typically deployed on cloud servers, which places significant demands on computing and storage resources. When intelligent analysis of surveillance video is required, the video must be transmitted to the cloud server over the network. The AI ​​model in the cloud server then analyzes the video and returns the analysis results over the network. Due to network bandwidth limitations, the entire cloud computing process incurs significant transmission delays. Furthermore, the transmission of large amounts of surveillance video can cause severe network congestion. Using edge computing to distribute intelligent computing close to the data source can mitigate transmission delays and network congestion. However, edge computing typically requires processing large amounts of data, resulting in high power consumption, difficult equipment maintenance, and poor scalability. Deploying object detection models on embedded platforms avoids the challenges associated with cloud computing while enabling control devices or alarms to analyze video in real time. Furthermore, embedded devices offer low power consumption and improved maintainability. However, due to the limited computing and storage resources of embedded platforms, deploying traditional detection models on embedded devices is difficult. Summary of the Invention

[0008] The purpose of the embodiments of the present invention is to provide a steel defect detection model and detection method for industrial applications, so as to solve the problems in steel defect detection, such as low detection accuracy due to the large number of defect types and significant size differences, high complexity of existing models, and difficulty in deployment on embedded devices due to the limitations of computing and storage resources of embedded platforms.

[0009] To solve the above technical problems, the technical solution adopted by the present invention is a steel defect detection model for industrial applications, comprising:

[0010] Backbone module, used to extract features from the target image;

[0011] Neck module, used to fuse features and construct multi-scale feature maps;

[0012] Head module, used to detect and classify feature maps and output detection results;

[0013] In the Backbone module, the CBS module serves as the input end and is sequentially connected to the second CBS module, the first C2f_CG module, the third CBS module, the second C2f_CG module, the fourth CBS module, the third C2f_CG module, the fifth CBS module, the fourth C2f_CG module, and the SPPF module; the output end of the SPPF module is connected to the first Upsample module of the Neck module;

[0014] The Neck module includes a first C2f module, a second C2f module, a first C2f_Star module, and a second C2f_Star module; the output end of the second C2f module is connected to the first GSE_Detect module in the Head module, the output end of the first C2f_Star module is connected to the second GSE_Detect module in the Head module, and the output end of the second C2f_Star module is connected to the third GSE_Detect module in the Head module.

[0015] Furthermore, in the Backbone module, the output end of the second C2f_CG module is simultaneously connected to the second Concat module of the Neck module, and the output end of the third C2f_CG module is simultaneously connected to the first Concat module of the Neck module; the Neck module also includes two Upsample modules, two CBS modules, a first C2f module and four Concat modules, wherein the output of the SPPF module in the Backbone module is sequentially connected to the first Upsample module, the first Concat module, the first C2f module, the second Upsample module, the second Concat module, the second C2f module, the first CBS module, the third Concat module, the first C2f_Star module, the second CBS module, the fourth Concat module and the second C2f_Star module; and the output end of the SPPF module is simultaneously connected to the fourth Concat module, and the output end of the first C2f module is simultaneously connected to the third Concat module.

[0016] Furthermore, the C2f module is composed of a first CBS module, a Split module, n Bottleneck modules, a Concat module, and a second CBS module in series, and the output of each Bottleneck module is connected to Concat; the Bottleneck module includes two 3×3 Conv blocks; and the CBS modules are composed of a 3×3 Conv block, a BN block, and a SiLU module in series.

[0017] Furthermore, the C2f_CG module is composed of replacing the Bottleneck module in the C2f module with a CGBlock module and removing the BN block and SiLU module of the second CBS; the CG Block module is composed of a 1x1Conv module, a 3x3DConv and 3x3Conv parallel module, a Concat module, a BN+PReLU module, a GAP module, a first FC module, and a second FC module connected in series in sequence, and the output of the BN+PReLU module and the output of the second FC module are multiplied and finally output.

[0018] Furthermore, the C2f_Star module is composed of a StarBlock module replacing the Bottleneck module in the C2f module; the Star Block module is composed of a DWConv+BN module, an FC+Relu and FC parallel module, an FC+BN module, and a DWConv module in series.

[0019] Furthermore, the structure of each layer in the Head module is the same. Each layer of the GSE_Detect module is first connected by a GSConv module, an EMA module, and a Conv2d module. The working process of the GSConv module is: first, a CBS module is used to change the number of channels and then divide it into two branches, one branch passes through the DWConv module, and the other branch does not perform any operation; the outputs of these two branches are passed through the Concat module and then output through a channel shuffle operation.

[0020] The present invention also provides a detection method of a steel defect detection model for industrial applications, comprising the following steps:

[0021] Step S1: Send the target image to be detected into the Backbone module to complete the feature extraction of the target image, and send the features of different levels into the Neck module in three ways;

[0022] Let the input image be I;

[0023]

[0024] When i=1, 2, 3, 4, or 5: Represents the convolution of the i-th downsampling (stride = 2); when m = 1, 2, 3, 4: C2f_CG (m) Represents the mth C2f_CG stacking module; the three scale feature maps output are F3, F4, and F5;

[0025] In step S2, the Neck module fuses features and enriches the expressiveness of the feature map, improving the loss of detail information during the feature fusion process. At the same time, it constructs a multi-scale feature map and outputs it to the Head module. Feature fusion can be divided into two stages:

[0026] S21, top-down fusion:

[0027] T5=SPPF(F5) (20)

[0028] T4=Concat(F4,Up(T5)),P4=C2f (1) (T4) (21)

[0029] T3=Concat(F3,Up(P4)),P3=C2f (2) (T3) (22)

[0030] Where Up means upsampling;

[0031] S22, bottom-up fusion:

[0032] U4=Concat(P4,CBS(P3)),Q4=C2f_Star (1) (U4) (23)

[0033] U5=Concat(P5,CBS(Q4)),Q5=C2f_Star (2) (U5) (24)

[0034] Concat is feature concatenation; when n=1 or 2: C2f (n) Indicates the nth C2f stack module, when p=1, 2: C2f_Star (p) represents the pth C2f_Star stacking module; the final output features are Q3 = P3, Q4, Q5;

[0035] Step S3: The Head module uses the features input by the Neck module to complete the positioning and classification of the image to be detected and output the detection results;

[0036] S31. Bounding box prediction:

[0037]

[0038] S32, Category Prediction:

[0039]

[0040] S33, decoding:

[0041] b q =decode(DFL(B q )) (27)

[0042] S33, splicing:

[0043] y i =Concat(b i ,C i ) (28)

[0044] The features of each scale q = 3, 4, and 5 are regressed (reg) and classified (cls) through GSConv and EMA attention mechanism, and the final detection box and confidence are decoded (decode).

[0045] The beneficial effects of the present invention are:

[0046] The present invention proposes a universal real-time steel defect detection network model (YOLOv8n-CSG). First, the present invention analyzes the commonly used Backbone in the YOLO network, and optimizes it by introducing a context-guided module from the perspective of deployment. Secondly, the present invention conducts a large number of ablation experiments on commonly used Neck, Head, etc. to determine the network structure. The experimental results show that the network of the present invention is lightweight and powerful. The steel defect detection model YOLOv8n-CSG of the present invention has strong generalization performance and has good detection effects in different detection scenarios, which helps to promote the implementation of real-time steel defect detection in industrial applications. BRIEF DESCRIPTION OF THE DRAWINGS

[0047] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.

[0048] Figure 1 2 is a schematic diagram of the structure of the YOLOv8n-CSG model according to an embodiment of the present invention.

[0049] Figure 2 2 is a schematic structural diagram of the C2f and C2f_CG modules according to an embodiment of the present invention; the upper figure is a structural diagram of the C2f module, and the lower figure is a structural diagram of the C2f_CG module.

[0050] Figure 3 It is a structural diagram of the CG Block module in an embodiment of the present invention.

[0051] Figure 4 2 is a schematic structural diagram of a C2f_Star module according to an embodiment of the present invention.

[0052] Figure 5 2 is a schematic structural diagram of a Star Block module according to an embodiment of the present invention.

[0053] Figure 6 It is a schematic structural diagram of the Detect(a) and GSE_Detect(b) modules in an embodiment of the present invention.

[0054] Figure 7 Schematic diagram of the structure of the GSConv module of an embodiment of the present invention. DETAILED DESCRIPTION

[0055] The following will clearly and completely describe the technical solutions in the embodiments of the present invention in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of the present invention.

[0056] The present invention discloses a steel defect detection model for industrial applications, the structure of which is as follows: Figure 1 As shown in the figure, it consists of three modules: Backbone, Neck, and Head.

[0057] The backbone network consists of five CBS modules, four C2f_CG modules, and one SPPF module. The CBS module serves as the input, sequentially connected to the second CBS module, the first C2f_CG module, the third CBS module, the second C2f_CG module, the fourth CBS module, the third C2f_CG module, the fifth CBS module, the fourth C2f_CG module, and the SPPF module. The output of the SPPF module is connected to the first Upsample module of the Neck module. The output of the second C2f_CG module is also connected to the second Concat module of the Neck module. The output of the third C2f_CG module is also connected to the first Concat module of the Neck module. Feature maps of multiple sizes in the Backbone are fused with those in the Neck module, improving the detection network's performance for objects of different sizes.

[0058] The Neck module is flexibly composed of two upsampling modules, two CBS modules, two C2f modules, two C2f_Star modules, and four concatenation modules. Each CBS module consists of a 3×3 Conv, BN, and SiLU in sequence. Among them, the output of the SPPF module in the Backbone module is connected to the first Upsample module, the first Concat module, the first C2f module, the second Upsample module, the second Concat module, the second C2f module, the first CBS module, the third Concat module, the first C2f_Star module, the second CBS module, the fourth Concat module, and the second C2f_Star module in sequence; and the output end of the SPPF module is also connected to the fourth Concat module, and the output end of the first C2f module is also connected to the third Concat module; the output end of the second C2f_CG module is also connected to the second Concat module of the Neck module; the output end of the third C2f_CG module is also connected to the first Concat module of the Neck module; the output end of the second C2f module is connected to the first GSE_Detect module in the Head module, the output end of the first C2f_Star module is connected to the second GSE_Detect module in the Head module, and the output end of the second C2f_Star module is connected to the third GSE_Detect module in the Head module; the Neck module and the Head module are hierarchically connected, which can effectively fuse feature maps from different levels, which helps to capture different scale information of the target. In object detection, small objects typically appear on higher-level feature maps, while large objects appear on lower-level feature maps. This invention uses a top-down and bottom-up path fusion mechanism to enable the model to better handle objects of different sizes. Simultaneously, through the top-down path, higher-level abstract features can be utilized to enhance lower-level detail features. This allows the feature maps of each layer to be fully utilized, enhancing the expressive power of the entire network. Compared to complex multi-branch structures, this invention achieves efficient information flow through a simple path aggregation strategy. This design not only reduces the demand for computing resources but also speeds up training and inference.

[0059] The SPPF module applies pooling operations of varying sizes to feature maps, generating a set of feature representations at varying resolutions. These representations are then concatenated to form a rich, multi-scale feature vector. This module helps the model achieve better generalization and detection accuracy, particularly when processing objects of varying sizes.

[0060] The head module is divided into three layers. Each layer of the GSE_Detect module is composed of a GSConv module, an EMA module, and a Conv2d module. Using the GSConv module can reduce parameters and increase inference speed while ensuring high efficiency.

[0061] like Figure 2 As shown in Figure 1, the C2f module is a key module in YOLOv8. By introducing cross-stage partial connections and feature fusion, it significantly improves network performance and efficiency. The C2f module primarily consists of CBS, Split, and Bottleneck. While the C2f module effectively reduces computational requirements and memory usage, its basic convolution operation fails to fully exploit the interrelationships and semantic information between input features, limiting its performance in complex feature extraction. The C2f_CG module replaces the original Bottleneck module with the CG Block module, enhancing the feature extraction network's ability to incorporate surrounding feature information, thereby improving the correlation between adjacent features. Given the relatively simple dataset, excessive normalization may reduce the model's fit. Furthermore, the intra-class variation in steel defects is relatively small, making excessive nonlinear representation unnecessary. In this case, removing the BN and SiLU activation functions after the 1x1 convolution helps avoid over-complication of the network, enabling the model to fit the data more freely and achieve better results.

[0062] like Figure 3 As shown in the figure, the basic principle of the CG Block (Context Guided Block) is to simulate the human visual system's reliance on contextual information to understand the scene. The CG Block is used to capture local features, surrounding context, and global context and fuse this information. This module consists of the following parts:

[0063] 1. First, the feature map is convolved with 1x1 and then input into f respectively. loc and f sur middle;

[0064] 2.f loc Extract local features using 3x3 normal convolution, f sur Extract surrounding context features using 3x3 dilated convolution;

[0065] 3.f joi Extract joint features and transform f loc and f sur The output is concat-operated, and then BatchNormalization (BN) and ParametricReLU (PReLU) are performed;

[0066] 4.fglo Extract global context features, perform global average pooling (GAP) and multi-layer perceptron on the input, and multiply the obtained weights by the input element-wise. Let the input be X and the output be Y, which can be expressed as:

[0067] Y=X+W out [F glo (PReLU(BN([F loc (Concat(W in X,F sur (W in X)))])))] (29)

[0068] Where W in represents dimensionality reduction convolution, W out is the dimensionality-raising convolution, F loc is a depth-wise separable convolution, F sur is the dilated convolution, F glo is the global channel attention.

[0069] like Figure 4 As shown in the figure, due to the large variation in sample size for steel defect detection and the fact that some defects are very small, the captured images are often blurry. This makes effective feature fusion difficult, which in turn affects the distinction between defect edges, textures, and shapes, resulting in low detection efficiency. To address this issue, the StarBlock module is introduced to replace the Bottleneck module in the Neck layer C2f of the YOLOv8 network.

[0070] like Figure 5 As shown in Figure 3, StarBlock consists of a deep convolutional layer (DW-Conv), a fully connected layer (FC), an activation function (ReLU6), and a star operation.

[0071] StarBlock is a novel and efficient network architecture. Its core innovation lies in the introduction of "StarOperation" to implement feature mapping. Star operation interacts features from two different feature spaces through element-wise multiplication, which is similar to the kernel technique in traditional machine learning. Its basic principle is to map the input to a high-dimensional, nonlinear feature space through element-wise multiplication, thereby effectively enhancing the feature representation capability. The unique advantage of StarOperation is that it can significantly expand the dimension of the feature space without increasing the network width (that is, without increasing the number of channels), which enables the model to maintain computational efficiency while improving its expressive power. In a single-layer network, the star operation can generally be expressed as:

[0072]

[0073] Here W1 T and W2T are two weight matrices, X represents the input elements, Represents element-wise multiplication operation.

[0074] The present invention also provides a method for real-time steel defect detection for industrial applications. The method uses the training set of the Northeastern University NEU-DET dataset and the validation set of the Northeastern University NEU-DET dataset for training. A real-time steel defect detection model is trained using the training set, and the trained model is used to detect the image to be inspected. The specific steps are as follows:

[0075] S1: Send the image to be detected into the backbone network to complete the feature extraction of the image, and send the shallow and deep features to the neck in three ways;

[0076] The Backbone downsamples the image to be detected by a factor of 2 using CBS. The image is then fed into four sequentially connected sets of CBS+C2f_CG blocks, achieving a factor of 32 downsampling for feature extraction, improving detection of large objects. Finally, an SPPF is connected. This Backbone design makes the model lightweight and boasts extremely fast inference speed, making it easy to deploy on embedded devices. It also includes combinations of receptive fields of varying sizes and center strides to detect objects of varying scales. The addition of the C2f_CG module improves the correlation of information.

[0077] Let the input image be I;

[0078]

[0079] When i=1, 2, 3, 4, or 5: Represents the convolution of the i-th downsampling (stride = 2); when m = 1, 2, 3, 4: C2f_CG (m) Represents the mth C2f_CG stacking module; the three scale feature maps output are F3, F4, and F5;

[0080] S2, Neck, composed of multiple Upsample, Concat, C2f, C2f_Star, CBS, Upsample is responsible for up-sampling feature maps, so that deep features can be concatenated with shallow features, C2f, C2f_Star is responsible for fusing features of different scales. CBS is responsible for down-sampling feature maps, thereby realizing the fusion of shallow information and deep information. Such a design of Neck can fuse different features, enrich the expression ability of feature maps, and improve the problem of loss of detailed information in the feature fusion process. At the same time, a multi-scale feature map is constructed to output to the Head, so as to realize the detection of objects of various sizes through the Head; by adding the C2f_Star module, the input data can be mapped to a high-dimensional nonlinear feature space to generate rich feature representations, so that the model is more effective in processing subtle defects. Feature fusion can be divided into two stages:

[0081] S21, top-down fusion:

[0082] T5 = SPPF (F5) (36)

[0083] T4 = Concat (F4, Up (T5)), P4 = C2f (1) (T4) (37)

[0084] T3 = Concat (F3, Up (P4)), P3 = C2f (2) (T3) (38)

[0085] where Up represents up-sampling;

[0086] S22, bottom-up fusion:

[0087] U4 = Concat (P4, CBS (P3)), Q4 = C2f_Star (1) (U4) (39)

[0088] U5 = Concat (P5, CBS (Q4)), Q5 = C2f_Star (2) (U5) (40)

[0089] where Concat is feature concatenation; n = 1, 2: C2f (n) represents the nth C2f stacking module, p = 1, 2: C2f_Star (p) represents the pth C2f_Star stacking module; the final output features are Q3 = P3, Q4, Q5;

[0090] S3, Head. Each GSE_Detect module layer consists of a GSConv module, an EMA module, and a Conv2d module. GSConv is responsible for unifying feature maps with different channel counts to a uniform number, maintaining the efficiency of CBS while also reducing weight. The EMA attention mechanism can be said to further enhance the efficiency of the detection head. Three detection heads of different sizes enable detection of objects of different sizes. The head uses the features input by the neck to complete the localization and classification of the image to be detected, and outputs the detection results.

[0091] S31 border prediction:

[0092]

[0093] S32 category prediction:

[0094]

[0095] S33 decoding:

[0096] b q =decode(DFL(B q )) (43)

[0097] S33 splicing:

[0098] y i =Concat(b i ,C i ) (44)

[0099] The features of each scale q = 3, 4, and 5 are regressed (reg) and classified (cls) through GSConv and EMA attention mechanism, and the final detection box and confidence are decoded (decode).

[0100] To verify the detection performance of the steel defect detection model proposed in this paper (hereinafter referred to as YOLOv8n-CSG), a comparative experiment was conducted. The dataset used was the Northeastern University public dataset NEU-DET, which was divided into training, validation, and test sets in a ratio of 8:1:1.

[0101] On the NEU-DET dataset, the compared classic detection networks are YOLOv5n, YOLOv5s (see G.Jocher.YOLOv5-Master.Accessed:Mar.1,2021.[Online].https: / / github.com / ultralytics / yolov5), YOLOv7, YOLOv7-tiny (see Wang CY, Bochkovskiy A, Liao H YM.YOLOv7:Trainable bag-of-freebies sets new state-of-the-art for real-time object detectors[J].arXiv preprint arXiv:2207.02696,2022), YOLOv8n, YOLOv8s (see Jocher Glenn.Ultralytics yolov8.https: / / github.com / ultralytics / ultralytics,2023), YOLOv10n, YOLOv11n, FMG-YOLOv8s (for details, see LIANG LM, LONG PW, LI Y L. Improved steel surface defect detection algorithm of lightweight and efficient FMG-YOLOv8s[J / OL].Computer Engineering and Application,1-11[2024-12-05]), YOLOX, YOLOv8n-SDEC. The test results are shown in Table 1, where bold represents the best indicators.

[0102] Table 1 Comparative experimental results of different detection models

[0103]

[0104] This embodiment refers to YOLOv8, and controls models such as n, t, s, and m through width and depth factors. Table 1 shows the experimental results on the NEU-DET dataset. The experimental results show that the YOLOv8n-CSG algorithm proposed in the present invention shows superiority over traditional algorithms, with mAP0.5 reaching 76.8% while the number of parameters and computational complexity is only 1.95M and 5.1G. Compared with FMG-YOLOv8s, it performs even better. Although YOLOX has a 0.2% higher mAP0.5 than the algorithm in this paper, its model is more complex, with the number of parameters and computational complexity reaching 7.23M and 20.7G, wasting too many resources and making it unfavorable for deployment on devices. YOLOv8n-SDEC is almost the same as the present invention in terms of precision-recall rate and mAP0.5, but the number of parameters in the algorithm of the present invention is lower than that of YOLOv8n-SDEC. In contrast, YOLOv8n-CSG can maintain a higher mAP0.5 value while requiring less computational effort on parameters, demonstrating a better balance between lightweight and performance.

[0105] In response to the problems of high complexity and low detection accuracy of steel defect detection models, the present invention proposes an improved detection algorithm based on YOLOv8n, named YOLOv8n-CSG. YOLOv8n-CSG has shown excellent performance in both detection accuracy and model complexity. First, the context guidance module (CG Block) is introduced into the feature extraction network to enhance the ability to capture surrounding features and enhance the ability to extract correlation information; secondly, the star network module (Star Block) is added to the feature fusion network, which can map the input data to an extremely high-dimensional nonlinear feature space, generate rich feature representations, and make the model more effective in processing complex data. Finally, the GSConv and EMA attention mechanisms are integrated in the detection head, which greatly reduces the complexity while maintaining the efficiency of the original detection head. Multiple experiments on the NEU-DET dataset demonstrated that the improved YOLOv8n-CSG network model achieved a 6.9% improvement in mAP50%, an 11.3% increase in accuracy, a 4.6% increase in recall, a 37% decrease in GFLOPs, and a 35.2% reduction in parameters compared to the YOLOv8n model. Comparisons with other models demonstrate that the proposed YOLOv8n-CSG model has superior localization and identification capabilities for steel surface defects, with detection speeds that meet industrial application requirements and a balanced approach to model performance and complexity.

[0106] The network of the present invention has fewer parameters and lower model complexity, and its detection effect is almost better than that of other excellent networks. This shows that the network design of the present invention is reasonable and suitable for industrial detection.

[0107] Each embodiment in this specification is described in a related manner. Similar parts between the various embodiments can be referred to in conjunction with each other. Each embodiment focuses on the differences between the other embodiments. In particular, the system embodiment is generally similar to the method embodiment, so the description is relatively simple. For related parts, refer to the description of the method embodiment.

[0108] The above description is only a preferred embodiment of the present invention and is not intended to limit the scope of protection of the present invention. Any modifications, equivalent replacements, improvements, etc. made within the spirit and principles of the present invention are included in the scope of protection of the present invention.

Claims

1. A steel defect detection model for industrial applications, characterized by: include: Backbone module, used to extract features from the target image; Neck module, used to fuse features and construct multi-scale feature maps; Head module, used to detect and classify feature maps and output detection results; In the Backbone module, the CBS module serves as the input end and is sequentially connected to the second CBS module, the first C2f_CG module, the third CBS module, the second C2f_CG module, the fourth CBS module, the third C2f_CG module, the fifth CBS module, the fourth C2f_CG module, and the SPPF module; the output end of the SPPF module is connected to the first Upsample module of the Neck module; The Neck module includes a first C2f module, a second C2f module, a first C2f_Star module, and a second C2f_Star module; the output end of the second C2f module is connected to the first GSE_Detect module in the Head module, the output end of the first C2f_Star module is connected to the second GSE_Detect module in the Head module, and the output end of the second C2f_Star module is connected to the third GSE_Detect module in the Head module; In the Backbone module, the output end of the second C2f_CG module is simultaneously connected to the second Concat module of the Neck module, and the output end of the third C2f_CG module is simultaneously connected to the first Concat module of the Neck module; the Neck module also includes two Upsample modules, two CBS modules, a first C2f module and four Concat modules, wherein the output of the SPPF module in the Backbone module is sequentially connected to the first Upsample module, the first Concat module, the first C2f module, the second Upsample module, the second Concat module, the second C2f module, the first CBS module, the third Concat module, the first C2f_Star module, the second CBS module, the fourth Concat module, and the second C2f_Star module; and the output end of the SPPF module is simultaneously connected to the fourth Concat module, and the output end of the first C2f module is simultaneously connected to the third Concat module; The C2f module is composed of a first CBS module, a Split module, n Bottleneck modules, a Concat module, and a second CBS module in series, and the output of each Bottleneck module is connected to the Concat module; the Bottleneck module includes two 3×3 Conv blocks; the CBS modules are composed of a 3×3 Conv block, a BN block, and a SiLU module in series.

2. The steel defect detection model for industrial applications according to claim 1, characterized in that: The C2f_CG module is composed of replacing the Bottleneck module in the C2f module described in Requirement 1 with a CG Block module and removing the BN block and SiLU module of the second CBS; the CG Block module is composed of a 1x1Conv module, a 3x3DConv and 3x3Conv parallel module, a Concat module, a BN+PReLU module, a GAP module, a first FC module, and a second FC module connected in series, and the output of the BN+PReLU module is multiplied by the output of the second FC module for final output.

3. The steel defect detection model for industrial applications according to claim 1, characterized in that: The C2f_Star module is composed of a Star Block module replacing the Bottleneck module in the C2f module described in Requirement 1; the Star Block module is composed of a DWConv+BN module, an FC+Relu and FC parallel module, an FC+BN module, and a DWConv module in series.

4. The steel defect detection model for industrial applications according to claim 1, characterized in that: The structure of each layer in the Head module is the same. Each layer of the GSE_Detect module is composed of a GSConv module, an EMA attention mechanism module, and a Conv2d module connected in series in sequence. The working process of the GSConv module is as follows: first, a CBS module is used to change the number of channels and then divide it into two branches, one branch passes through the DWConv module, and the other branch does not perform any operation; the outputs of these two branches are passed through the Concat module and then output through a channel shuffle operation.

5. A steel defect detection method for industrial applications, characterized in that: The following steps are involved: Step S1: Send the target image to be detected into the Backbone module to complete the feature extraction of the target image, and send the features of different levels into the Neck module in three ways; Let the input image be I; When i=1, 2, 3, 4, or 5: Represents the convolution of the i-th downsampling (stride = 2); when m = 1, 2, 3, 4: C2f_CG (m) Represents the mth C2f_CG stacking module; the three scale feature maps output are F3, F4, and F5; In step S2, the Neck module fuses features and enriches the expressiveness of the feature map, improving the loss of detail information during the feature fusion process. At the same time, it constructs a multi-scale feature map and outputs it to the Head module. Feature fusion can be divided into two stages: S21, top-down fusion: T5=SPPF(F5) (6) T4=Concat(F4,Up(T5)),P4=C2f(1)(T4) (7) T3=Concat(F3,Up(P4)), P3=C2f(2)(T3) (8) Where Up means upsampling; S22, bottom-up fusion: U4=Concat(P4,CBS(P3)), Q4=C2f_Star(1)(U4) (9) U5=Concat(P5,CBS(Q4)), Q5=C2f_Star(2)(U5) (10) Concat is feature concatenation; when n=1 or 2: C2f (n) Indicates the nth C2f stack module, when p=1, 2: C2f_Star (p) represents the pth C2f_Star stacking module; the final output features are Q3 = P3, Q4, Q5; Step S3: The Head module uses the features input by the Neck module to complete the positioning and classification of the image to be detected and output the detection results; S31 border prediction: S32 category prediction: S33 decoding: bq=decode(DFL(Bq)) (13) S33 splicing: yi=Concat(bi,Ci) (14) The features of each scale q = 3, 4, and 5 are regressed (reg) and classified (cls) through GSConv and EMA attention mechanism, and the final detection box and confidence are decoded (decode).