Steel defect detection method based on SBA cross-scale feature fusion

By adopting the SBA cross-scale feature fusion method in steel defect detection, replacing the network backbone with StarNet and designing an improved SCCFM structure, combining the RepC3 module and inner loss loss function, the problem of low detection efficiency and accuracy in the existing detection methods is solved. , realizes efficient and accurate steel defect detection.

CN119180785APending Publication Date: 2024-12-24HUAIYIN INSTITUTE OF TECHNOLOGY

Patent Information

Application Number
CN202411184170.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-08-27
Publication Date
2024-12-24

AI Technical Summary

Technical Problem

The existing steel defect detection methods have problems with low detection efficiency and accuracy, especially in large-scale inspections. Traditional manual identification and partial automation systems are difficult to meet industrial needs, and conventional end-to-end models have detection accuracy and real-time performance. insufficient.

Method used

Using the detection method based on SBA cross-scale feature fusion, the backbone of the RT-DETR-R34 network is replaced with StarNet, and the improved SCCFM neck structure is designed, combining the RepC3 module and inner loss loss function, the detection accuracy is improved and the operation cost is reduced.

Benefits of technology

It realizes the accuracy and efficiency of steel defect detection under low cost and low deployment conditions, simplifies the end-to-end detection method, reduces the computing cost and deployment difficulty, and significantly improves the detection accuracy and model convergence speed.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119180785A_ABST
    Figure CN119180785A_ABST
Patent Text Reader

Abstract

The invention discloses a steel defect detection method based on SBA cross-scale feature fusion, and the method comprises the steps: firstly constructing an RT-DERT-R34 network which employs an Encoder of a Transform layer to process the features outputted by a backbone network; secondly, in the feature extraction stage, a backbone network is replaced with StarNet, the mapping of a high-dimensional feature space is realized while the calculation complexity is kept low through star operation, and richer feature representation can be realized without complex feature fusion and multi-branch design; then, in order to better capture multi-scale features and improve the fusion effect of high-dimensional and low-dimensional features, a CCFM neck structure combined with SBA (Selective Boundary Aggregation) is designed, and the CCFM neck structure is named as SCFFM (SBA-based Crossscale Feature Fusion Module); and finally, selecting inner loss as a bounding box regression loss function. Compared with the prior art, the steel defect detection precision is further improved, the end-to-end detection mode is easy to deploy, and delay caused by NMS is avoided.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of image recognition, and in particular to a steel defect detection method based on SBA cross-scale feature fusion. Background Art

[0002] As an important raw material for national infrastructure, steel will inevitably suffer various kinds of damage during production or use, such as scratches, protrusions, oxidation, rust, spots, etc. If these defective steels are not detected, it will pose a great hidden danger to industrial construction and cause great losses.

[0003] The traditional method of detecting these defects and losses is manual identification. However, this method has low detection efficiency and accuracy, and a large amount of manual labor increases the detection cost, which is not suitable for large-scale steel testing. With the development of automated testing, steel defect detection has also introduced automated monitoring. These systems are based on infrared and magnetic leakage detection, aiming to speed up detection and improve efficiency.

[0004] In recent years, with the development of artificial intelligence technology, target detection methods based on deep learning have achieved remarkable results. Compared with previous methods, methods based on deep learning have higher accuracy and detection efficiency, and are more suitable for large-scale steel surface defect detection tasks. At present, the target detection algorithm is mainly based on the YOLO series, which has significant effects on target recognition, but the YOLO algorithm is a non-end-to-end detection algorithm, which has the disadvantages of difficult deployment and high computing resource costs. Although conventional end-to-end models are easy to deploy, when applied to steel defect detection applications, the convergence real-time performance of the detection results is low, and there is room for improvement in detection accuracy. Summary of the invention

[0005] Purpose of the invention: To solve the problems mentioned in the background technology, the present invention discloses a steel defect detection method based on SBA cross-scale feature fusion, relying on the RT-DERT-R34 network, using starnet for backbone replacement, improving and setting up the SCCFM neck structure, and then improving its detection accuracy as an end-to-end model, achieving the actual required accuracy level of steel defect detection under low cost and low deployment conditions.

[0006] Technical solution:

[0007] The present invention discloses a steel defect detection method based on SBA cross-scale feature fusion, the method comprising the following steps:

[0008] S1: Construct and preprocess the steel defect dataset.

[0009] S2: Based on the original model RT-DETR-R34, improve and obtain a new steel defect detection model.

[0010] S2.1: Build RT-DETR-R34 with a single-layer Transformer Encoder, replace the backbone with starnet, and use star operations to achieve mapping of high-dimensional and nonlinear feature spaces.

[0011] S2.2: Construct a new neck structure SCCFM, replace the original model CCFM neck structure Fusion module with the SBA module, add a fusion branch, and perform four feature fusions on the three SBA modules. An additional RepC3 module is added after each SBA module to learn richer image features.

[0012] S2.3: Select inner loss to replace the original bounding box regression loss function.

[0013] S3: Set the training hyperparameters, use the training set in S2 to train the improved new steel defect detection model and set the validation parameters for validation.

[0014] S4: Deploy the verified model to the visualization interface to realize real-time detection of steel defects.

[0015] Furthermore, the S1 preprocessed dataset contains 1800 grayscale images, covering 6 typical steel surface defects, namely cracks, inclusions, plaques, pitting surfaces, oxide scale and scratches. The resolution of each image is 200×200, and the number of samples of each defect image is 300; the dataset is divided into training set, validation set and test set in a ratio of 8:1:1. The training set contains 1440 images, the validation set contains 180 images, and the test set contains 180 images.

[0016] Furthermore, the specific operation of S2.1 is as follows:

[0017] In the feature extraction stage, the backbone network is replaced by StarNet. StarNet realizes the mapping of high-dimensional and nonlinear feature space through star operation. The general formula of star operation is:

[0018]

[0019] Among them, W1 T , is the transposed weight matrix W1 and W2, B1 and B2 are bias matrices, and X is the input feature.

[0020] The features of the two linear transformations are fused by element-wise multiplication, and the weight matrix W and the bias B are combined into one matrix. Indicates that X becomes The simplified star operation formula can be obtained. We will assume a single element input and a single output channel to simplify the operation, so W1,W2,X∈R (d+1)×1 , d is the input dimension, then the star operation is as follows:

[0021]

[0022]

[0023] Among them, W1 T , is the transpose of the matrix of the weight matrix W1, W2 and the bias matrix B1, B2. is an element of the matrix, x i 、x j are the elements of the input feature matrix.

[0024] After expanding formula (3), we can get polynomials, except for some terms, each term is nonlinear with x, indicating an implicit dimension, so when the dimension is much larger than 2, It does not generate any additional consumption and significantly enlarges the feature dimension.

[0025] Furthermore, the StarNet backbone network sets four star operations, and the operation formula for each layer is as follows:

[0026]

[0027] Among them, O1, O2, O3, and O4 are the outputs of the first, second, third, and fourth star operations respectively. is the combination of the weight matrix and bias matrix of the second star operation, is the combination of the weight matrix and bias matrix of the third star operation, It is the combination of the weight matrix and bias matrix of the fourth star operation.

[0028] For layer l, we implicitly obtain a StarNet implicitly obtains higher-dimensional features through a four-layer simple network structure, further reducing the amount of model calculation.

[0029] Furthermore, the detailed steps of S2.2SCFFM neck structure feature fusion are as follows:

[0030] For the S3, S4, and S5 features output from StarNet, S5 is obtained after AIFI to obtain F5. After a convolution, F5 enters the SBA module with S4 for feature fusion. The fused features are input into RepC3 to further learn feature information. This part of information is divided into two branches. One branch is used for feature fusion with shallow features. The fused features are input into RepC3, directly added as outputs and input into SBA feature fusion with another branch, and then input into RepC3, added as the second output and continued to be sent to SBA for fusion with the initial deep features after a convolution, and then added as the third output through a RepC3. The output obtained in this way aggregates feature information at different levels, and obtains a finer-grained target contour and recalibrates the target position through the fusion mechanism of SBA.

[0031] Furthermore, the shallow features and deep features F a 、F b The two RAU blocks are sent to make up for the lack of details of high-level features and the lack of semantic information of low-level features. The outputs of the two RAU blocks are connected and output after a 3×3 convolution to achieve a robust combination of different features and refine the rough features. The RAU module process can be expressed as:

[0032] PAU(T1,T2)=T1'·T1+T2'·T2·(-(T1'))+T1 (9)

[0033] T1'=W θ (T1),T′2=W φ (T2) (10)

[0034] Among them, T1, T2 are input features, W θ (·),W φ (·) is two 1×1 linear mapping convolutions and sigmoid function to change the dimension to 32, · is point-by-point multiplication, - is the inverse operation, and the SBA fusion process is expressed as:

[0035] Z=C 3×3 (Concat(PAU(F a ,F b ),PAU(F b ,F a )))(11)

[0036] Among them C 3×3 It is a 3×3 convolution plus a batchnorm plus a ReLU activation function, and the final output is

[0037] Furthermore, the inner loss loss function described in S2.3 controls the scale of the auxiliary bounding box for calculating the loss by introducing a scaling factor ratio. The calculation formula of Inner-IoU is as follows:

[0038] L Inner-IoU =1-IoU inner (12)

[0039]

[0040] union=(w gt *h gt )*(ratio) 2 +(w*h)*(ratio) 2 -inter (15)

[0041]

[0042]

[0043] Among them, the center point of the real box is Indicates that the center point of the anchor box is (x c ,y c ), w gt 、h gt Respectively represent the width and height of the real box, w and h represent the width and height of the anchor box, and ratio represents the scaling factor, which varies in the range of [0.5, 1.5]. is the code for the real frame, b l 、b r 、b t 、b b is the code for the anchor box, union is the union of the real box and the anchor box, inter is the intersection of the real box and the anchor box, IoU inner It is the intersection-over-union ratio of the inner loss function.

[0044] Furthermore, the training hyperparameters in S3 are set as follows: the number of training rounds is 200, BatchSize is set to 8, and the SGD optimizer is used.

[0045] Beneficial effects:

[0046] 1. In the feature extraction stage, the present invention replaces the backbone network with StarNet. Through star operations, the mapping of high-dimensional feature space is achieved while keeping the computational complexity low. Richer feature representation can be achieved without complex feature fusion and multi-branch design, further reducing the computational cost while improving the accuracy of steel defect detection.

[0047] 2. The present invention designs a CCFM neck structure SCFFM combined with SBA to further capture multi-scale features, enhance the fusion effect of high-dimensional and low-dimensional features, and further improve recognition accuracy.

[0048] 3. The present invention selects inner loss as the bounding box regression loss function, which avoids the delay caused by NMS, improves the convergence speed of the new steel defect detection model, simplifies the end-to-end detection method, and further simplifies the deployment difficulty. BRIEF DESCRIPTION OF THE DRAWINGS

[0049] Figure 1 It is a detection flow chart of the present invention;

[0050] Figure 2 It is a structural diagram of the improved model in the present invention;

[0051] Figure 3 It is the StarNet network structure in the present invention;

[0052] Figure 4 SCFFM module structure diagram designed by the present invention;

[0053] Figure 5 It is the structural diagram of SBA in the present invention;

[0054] Figure 6 It is a diagram of the model experiment results of the present invention; DETAILED DESCRIPTION

[0055] The present invention is described in detail below in conjunction with the accompanying drawings and specific embodiments. The following embodiments are only for illustrating the technical concept and features of the present invention, and their purpose is to enable people familiar with the technology to understand the content of the present invention and implement it accordingly, and they cannot be used to limit the protection scope of the present invention. Any equivalent or modification made according to the spirit of the present invention should be included in the protection scope of the present invention.

[0056] like Figure 1 As shown, this embodiment discloses a steel defect detection method based on SBA cross-scale feature fusion, and the method includes the following steps:

[0057] Step 1: Use the steel defect dataset NEU-DET dataset published by Northeastern University;

[0058] Step 2: The dataset contains 1800 grayscale images, covering six typical steel surface defects, namely cracks, inclusions, plaques, pitting, oxide scale and scratches. The resolution of each image is 200×200, and the number of samples of each defect image is 300. The dataset is divided;

[0059] Step 3: Construction and improvement of the new steel defect detection model: RT-DETR-R34 is used as the benchmark model, and RT-DETR-R34 is constructed with a layer of Transformer Encoder. In the feature extraction stage, the backbone is replaced with starnet, and the star operation is used to achieve the mapping of high-dimensional and nonlinear feature spaces. Secondly, this embodiment designs a CCFM neck structure combined with SBA and named SCFFM; Finally, inner loss is selected as the bounding box regression loss function. The module is improved on the basis of RT-DETR-R34 to obtain the improved model;

[0060] Step 4: Model training: by setting the training hyperparameters, the improved model in step 3 is trained using the training set in step 2;

[0061] Step 5: Model verification: set verification parameters to verify the model trained in step 4;

[0062] Step 6: Deploy the verified model to the visualization interface to realize real-time detection of steel defects.

[0063] The following is a detailed description of the steps of this embodiment:

[0064] In step 1, the steel defect dataset NEU-DET, which is publicly available from Northeastern University, is used. This dataset contains six types of typical steel surface defects: cracks, inclusions, plaques, pitting, oxide scale, and scratches.

[0065] In step 2, the dataset is divided into training set, validation set and test set in a ratio of 8:1:1. The training set contains 1440 images, the validation set contains 180 images, and the test set contains 180 images.

[0066] Step 3 improves the RT-DETR-R34 model as follows Figure 2 The specific measures are as follows:

[0067] ① In the feature extraction stage, the backbone network is replaced with StarNet. StarNet uses star operation to achieve high-dimensional and nonlinear feature space mapping without increasing computational complexity. Star operation can implicitly obtain high-dimensional features from low-dimensional input. The StarNet network structure is as follows: Figure 3 shown.

[0068] The general formula for star operation is:

[0069]

[0070] Among them, W1 T , is the transposed weight matrix W1 and W2, B1 and B2 are bias matrices, and X is the input feature.

[0071] The features of the two linear transformations are fused by element-wise multiplication, and the weight matrix W and the bias B are combined into one matrix. Indicates that X becomes The simplified star operation formula can be obtained. We will assume a single element input and a single output channel to simplify the operation, so W1,W2,X∈R (d+1)×1 , d is the input dimension, then the star operation is as follows:

[0072]

[0073] Among them, W1 T , is the transpose of the matrix of the weight matrix W1, W2 and the bias matrix B1, B2. is an element of the matrix, x i 、x j are the elements of the input feature matrix.

[0074] After expanding formula (3), we can get polynomials, except for some terms, each term is nonlinear with x, indicating an implicit dimension, so when the dimension is much larger than 2, It does not generate any additional consumption and significantly enlarges the feature dimension.

[0075] The StarNet backbone network sets four star operations, and the operation formula for each layer is as follows:

[0076]

[0077]

[0078] Among them, O1, O2, O3, and O4 are the outputs of the first, second, third, and fourth star operations respectively. is the combination of the weight matrix and bias matrix of the second star operation, is the combination of the weight matrix and bias matrix of the third star operation, It is the combination of the weight matrix and bias matrix of the fourth star operation.

[0079] For layer l, we implicitly obtain a StarNet implicitly obtains higher-dimensional features through a four-layer simple network structure, further reducing the amount of model calculation.

[0080] ② Construct a new neck structure SCCFM, replace the original model CCFM neck structure Fusion module with the SBA module, add an additional fusion branch, and perform four feature fusions on the three SBA modules. Add an additional RepC3 module after each SBA module to learn richer image features.

[0081] The SBA module is integrated into the CCFM structure in the original RTDETR and named as SCFFM module. Figure 4 As shown in the figure, for the S3, S4, and S5 features output from StarNet, S5 is converted into F5 through AIFI. The shallow feature S3 has less semantics, but rich details and less distortion; the deep feature F5 has richer semantic information, but lacks details. Directly fusing shallow features with deep features may lead to redundant inconsistencies. Therefore, SBA is added to CCFM to selectively aggregate semantic information and boundary information to better realize shallow semantic information and deep semantic information.

[0082] For the deep feature F5, after a convolution, it enters the SBA module with S4 for feature fusion. The fused features are input into RepC3 to further learn the feature information. This part of information is divided into two branches. One branch is used for feature fusion with S3. The fused features are input into RepC3, directly added as outputs and input into SBA feature fusion with another branch, and then input into RepC3, added as the second output and continued to be sent to SBA for fusion with the initial F5 after a convolution, and then added as the third output through a RepC3. The output obtained in this way aggregates feature information at different levels, and obtains a finer-grained target contour and recalibrates the target position through the SBA fusion mechanism.

[0083] like Figure 5 As shown in the figure, the role of the SBA module in the feature fusion process is to combine the shallow and deep information F a 、F b The RAU blocks are sent to two RAU blocks in different ways. RAU is a recalibrated attention unit module to make up for the lack of details of high-level features and the lack of semantic information of low-level features. Finally, the outputs of the two RAU blocks are connected and the output is obtained after a 3×3 convolution. This aggregation strategy realizes the robust combination of different features and refines the coarse features. The RAU module process can be expressed as:

[0084] PAU(T1,T2)=T1'·T1+T2'·T2·(-(T1'))+T1(9)

[0085] T1'=W θ (T1),T′2=W φ (T2) (10)

[0086] Where T1, T2 are input features, W θ (·),W φ (·) is two 1×1 linear convolutions and a sigmoid function that changes the dimension to 32, · is point-by-point multiplication, and - is the inverse operation. Therefore, the SBA process can be expressed as:

[0087] Z=C 3×3 (Concat(PAU(F a ,F b ),PAU(F b ,F a ))) (11)

[0088] Among them C 3×3 It is a 3×3 convolution plus a batchnorm plus a ReLU activation function, and the final output is

[0089] ③) Replace the bounding box regression loss function with inner loss. The existing IOU loss function cannot be adaptively adjusted according to different detectors and detection tasks, and does not have strong generalization ability. For high IoU samples, using smaller auxiliary bounding boxes to calculate the loss can accelerate convergence, while larger auxiliary bounding boxes are suitable for low IoU samples. Inner IoU loss controls the scale of the auxiliary bounding boxes for calculating the loss by introducing a scaling factor ratio. Its application to the existing IoU-based loss function can achieve faster and more effective regression results. The calculation formula of Inner-IoU is as follows:

[0090] L Inner-IoU =1-IoU inner (12)

[0091]

[0092] union=(w gt *h gt )*(ratio) 2 +(w*h)*(ratio) 2 -inter (15)

[0093]

[0094] Among them, the center point of the real box is Indicates that the center point of the anchor box is (x c ,y c ), w gt 、h gtRespectively represent the width and height of the real box, w and h represent the width and height of the anchor box, and ratio represents the scaling factor, which varies in the range of [0.5, 1.5]. is the code for the real frame, b l 、b r 、b t 、b b is the code for the anchor box, union is the union of the real box and the anchor box, inter is the intersection of the real box and the anchor box, IoU inner It is the intersection-over-union ratio of the inner loss function.

[0095] In step 4, the training is performed on BlueCloud, and the test hardware platform environment is Python 3.8, CUDA 11.3, GPU graphics card is NVIDIA RTX 3090, and memory is 30G. The training hyperparameters are set as follows: the number of training rounds is 200, BatchSize is set to 8, and the SGD optimizer is used.

[0096] In step 5, the verification result data shows that compared with RT-DETR-R34, the precision of the model is improved by 2.7%, the mAP@0.5 is improved by 3%, and the mAP@0.5:0.95 is improved by 2.5%.

[0097] The comparative experiment of this embodiment is shown in Table 1:

[0098] Table 1

[0099]

[0100] Any experiment in deep learning is random. In order to improve the credibility of the experimental results, we will compare the improved model with other models, and use evaluation indicators including Precision, Recall, mAP, and Gflops. In this invention, mAP@0.5 and mAP@0.5:0.95 (the threshold range of IoU is from 0.5 to 0.95) are used as accuracy measurement indicators. mAP is the average accuracy of the detection results of each type. AP refers to the area of ​​the curve enclosed by the horizontal and vertical axes with precision and recall. The calculation formulas for Precision and Recall are as follows:

[0101]

[0102] Among them, TP is the number of correctly identified targets. Generally, when the IoU threshold is greater than or equal to 0.5, it is considered to be a correctly identified target; FP is the number of incorrectly identified targets; FN is the number of missed targets; Precision is the proportion of correct targets among the targets detected by the model; Recall is the proportion of targets correctly identified by the model among the total number of all real targets.

[0103] It can be seen from Table 1 that the improved model is better than most complex models. Compared with the model before improvement, the Precision is improved by 2.7%, the mAP@0.5 is improved by 3%, the mAP@0.5:0.95 is improved by 2.5%, and the Gflops is reduced by 49.6, which shows that our model reduces the parameters and calculation amount while improving the accuracy, making the model more lightweight.

[0104] The training process is as follows Figure 6 As shown in the figure, the horizontal axis represents the number of training rounds, and the vertical axis represents the accuracy of mAP50. We can clearly see that during the training process, from the beginning to the end of the training, our improved model is always better than RT-DETR-R34, and the final accuracy is much higher than RT-DETR-R34. This advantage is mainly due to the unique structural design of the improved RT-DETR-R34 model. Through the carefully designed network structure and algorithm optimization, the improved model can more effectively extract the key features of steel defects when processing complex data and make more accurate predictions.

[0105] The above embodiments are only for illustrating the technical concept and features of the present invention, and their purpose is to enable people familiar with the technology to understand the content of the present invention and implement it accordingly, and they cannot be used to limit the protection scope of the present invention. Any equivalent transformation or modification made according to the spirit of the present invention should be included in the protection scope of the present invention.

Claims

1. A steel defect detection method based on SBA cross-scale feature fusion, characterized in that: The method comprises the following steps: S1: Construct and preprocess steel defect dataset: S2: Based on the original model RT-DETR-R34, improve and obtain a new steel defect detection model; S2.1: Build RT-DETR-R34 with a single-layer Transformer encoder, replace the backbone with starnet, and use star operations to achieve mapping of high-dimensional and nonlinear feature spaces; S2.2: Construct a new neck structure SCCFM, replace the original model CCFM neck structure Fusion module with the SBA module, add a fusion branch, and perform four feature fusions in three SBA modules. An additional RepC3 module is added after each SBA module to learn richer image features. S2.3: Select inner loss to replace the original bounding box regression loss function; S3: Set training hyperparameters, use the training set in S2 to train the improved new steel defect detection model and set validation parameters for validation; S4: Deploy the verified model to the visualization interface to realize real-time detection of steel defects.

2. The steel defect detection method based on SBA cross-scale feature fusion according to claim 1 is characterized in that: The S1 preprocessed dataset contains 1800 grayscale images, covering 6 typical steel surface defects, namely cracks, inclusions, plaques, pitting, oxide scale and scratches. The resolution of each image is 200×200, and the number of samples of each defect image is 300. The dataset is divided into training set, validation set and test set in a ratio of 8:1:

1. The training set contains 1440 images, the validation set contains 180 images, and the test set contains 180 images.

3. The steel defect detection method based on SBA cross-scale feature fusion according to claim 1 is characterized in that: The specific operations of S2.1 are as follows: In the feature extraction stage, the backbone network is replaced by StarNet. StarNet realizes the mapping of high-dimensional and nonlinear feature space through star operation. The general formula of star operation is: Among them, W1 T , is the transpose of weight matrices W1 and W2, B1 and B2 are bias matrices, and X is the input feature; The features of the two linear transformations are fused by element-wise multiplication, and the weight matrix W and the bias B are combined into one matrix. Indicates that X becomes The simplified star operation formula can be obtained. We will assume a single element input and a single output channel to simplify the operation, so W1,W2,X∈R (d+1)×1 , d is the input dimension, then the star operation is as follows: Among them, W1 T , is the transpose of the matrix of the weight matrix W1, W2 and the bias matrix B1, B2. is an element of the matrix, x i 、x j is the element of the input feature matrix; After expanding formula (3), we can get polynomials, except for some terms, each term is nonlinear with x, indicating an implicit dimension, so when the dimension is much larger than 2, It does not generate any additional consumption and significantly enlarges the feature dimension.

4. The steel defect detection method based on SBA cross-scale feature fusion according to claim 1 or 3, characterized in that: The StarNet backbone network sets four star operations, and the operation formula for each layer is as follows: Among them, O1, O2, O3, and O4 are the outputs of the first, second, third, and fourth star operations respectively. is the combination of the weight matrix and bias matrix of the second star operation, is the combination of the weight matrix and bias matrix of the third star operation, It is the combination of the weight matrix and bias matrix of the fourth star operation; For layer l, we implicitly obtain a StarNet implicitly obtains higher-dimensional features through a four-layer simple network structure, further reducing the amount of model calculation.

5. The steel defect detection method based on SBA cross-scale feature fusion according to claim 1 is characterized in that: The detailed steps of S2.2SCFFM neck structure feature fusion are as follows: For the S3, S4, and S5 features output from StarNet, S5 is obtained after AIFI to obtain F5. After a convolution, F5 enters the SBA module with S4 for feature fusion. The fused features are input into RepC3 to further learn feature information. This part of information is divided into two branches. One branch is used for feature fusion with shallow features. The fused features are input into RepC3, directly added as outputs and input into SBA feature fusion with another branch, and then input into RepC3, added as the second output and continued to be sent to SBA for fusion with the initial deep features after a convolution, and then added as the third output through a RepC3. The output obtained in this way aggregates feature information at different levels, and obtains a finer-grained target contour and recalibrates the target position through the fusion mechanism of SBA.

6. The steel defect detection method based on SBA cross-scale feature fusion according to claim 5 is characterized in that: The SBA module internally combines shallow features and deep features F a 、F b The two RAU blocks are sent to make up for the lack of details of high-level features and the lack of semantic information of low-level features. The outputs of the two RAU blocks are connected and output after a 3×3 convolution to achieve a robust combination of different features and refine the rough features. The RAU module process can be expressed as: PAU(T1,T2)=T1'·T1+T2'·T2·(-(T1'))+T1 (9) T1'=W θ (T1),T2'=W φ (T2) (10) Among them, T1, T2 are input features, W θ (·),W φ (·) is two 1×1 linear mapping convolutions and the sigmoid function to change the dimension to 32, ● is point-by-point multiplication, - is the inverse operation, and the SBA fusion process is expressed as: Z=C 3×3 (Concat(PAU(F a ,F b ),PAU(F b ,F a ))) (11) Among them C 3×3 It is a 3×3 convolution plus a batchnorm plus a ReLU activation function, and the final output is 7. The steel defect detection method based on SBA cross-scale feature fusion according to claim 1 is characterized in that: The inner loss loss function described in S2.3 controls the scale of the auxiliary bounding box for calculating the loss by introducing a scaling factor ratio. The calculation formula of Inner-IoU is as follows: L Inner-IoU =1-IoU inner (12) union=(w gt *h gt )*(ratio) 2 +(w*h)*(ratio) 2 -inter (15) Among them, the center point of the real box is Indicates that the center point of the anchor box is (x c ,y c ), w gt 、h gt Respectively represent the width and height of the real box, w and h represent the width and height of the anchor box, and ratio represents the scaling factor, which varies in the range of [0.5, 1.5]. is the code for the real frame, b l , b r , b t , b b is the code for the anchor box, union is the union of the real box and the anchor box, inter is the intersection of the real box and the anchor box, IoU inner It is the intersection-over-union ratio of the inner loss function.

8. The steel defect detection method based on SBA cross-scale feature fusion according to claim 1 is characterized in that: The training hyperparameters in S3 are set as follows: the number of training rounds is 200, BatchSize is set to 8, and the SGD optimizer is used.

Citation Information

Patent Citations

  • Steel surface defect detection method based on RDD-YOLO algorithm

    CN116433593A

  • Steel flaw detection method based on cross-path feature fusion network

    CN118052773A

Cited By

  • Marine ranch benthos detection method based on improved YOLO11n

    CN120318571A

  • Method and device for detecting small tin beads of metal heating film

    CN121213557A

  • Welding defect intelligent detection method and system based on deep learning

    CN121258887A

  • A deep learning-based welding defect intelligent detection method and system

    CN121258887B

  • Dam apparent disease detection method based on improved DSD-DETR

    CN122415605A