Steel Surface Defect Identification Method, Device, Computer Equipment and Storage Medium

Through the backbone network, adaptive feature interaction encoder and dynamic pooling pyramid and GhostConv feature fusion module, the efficiency and accuracy problems of traditional methods in the detection of surface defects of multi-scale multi-morphological steels are solved, and efficient identification of full-scale defects is achieved.

CN120164082BActive Publication Date: 2025-08-01NANCHANG YANNUO TECH CO LTD +1
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202510643474.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-05-19
Publication Date
2025-08-01
Estimated Expiration
2045-05-19

AI Technical Summary

Technical Problem

Traditional steel surface defect detection methods are insufficient in multi-scale and multi-morphological detection, and traditional convolutional neural networks have inherent defects in long-range space-dependent modeling, which is difficult to meet high-end manufacturing requirements.

Method used

Feature extraction is performed using backbone network, combining adaptive feature interaction encoder and dynamic pooling pyramid and GhostConv's feature fusion module, full-scale defect capture is achieved through IoU-aware query selection strategy and decoder with auxiliary prediction heads.

Benefits of technology

While maintaining computational efficiency, the full-scale defect capture capability from macro deformation to micro cracks is achieved, and the accuracy and robustness of detection are improved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120164082B_ABST
    Figure CN120164082B_ABST
Patent Text Reader

Abstract

The present application relates to a method, apparatus, computer device, and storage medium for identifying surface defects of steel. The method uses a backbone network to extract features from the steel surface image and performs two downsamplings on the extracted image features; after converting the second downsampled features into image feature vectors, an adaptive feature interaction encoder is used for processing to obtain encoded features; the image features, encoded features, and first downsampled features are processed using a feature fusion module based on dynamic pooling pyramid and GhostConv to obtain a fused feature vector; an IoU-aware query selection strategy is used to screen a fixed number of image features from the fused feature vector to obtain an initial query vector; the initial query vector is processed using a decoder with an auxiliary prediction head to obtain the steel surface defect identification result. This method realizes the full-scale defect capture ability from macroscopic deformation to microscopic cracks while maintaining computational efficiency.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of artificial intelligence technology, and particularly to a method, device, computer device, and storage medium for identifying steel surface defects. Background Art

[0002] In the industrial production system, steel, as an indispensable basic material, its quality directly affects the safety and reliability of end products. It is worth noting that surface damage phenomena are likely to occur during the manufacturing process, mainly including typical defect types such as corrosion deformation, mechanical scratches, and impurity embedding. These surface abnormalities will not only significantly weaken the mechanical properties of the material, but also pose potential risks of structural failure. Therefore, building an accurate surface defect detection system plays a key role in ensuring the quality of steel and has become an important quality control link that cannot be ignored in modern manufacturing processes. Driven by the dual promotion of the upgrade of the industrial manufacturing field and the improvement of material quality standards, material quality control has risen to a key technical indicator. Traditional manual detection methods gradually expose the shortcomings of insufficient efficiency and lack of stability in large-scale production scenarios, and it is difficult to meet the precision requirements of modern industry. Although intelligent detection technologies based on deep learning have achieved breakthrough progress in detection efficiency, traditional image processing algorithms represented by threshold segmentation still have inherent defects such as weak environmental adaptability and poor anti-interference ability, resulting in the robustness and accuracy of detection results being difficult to meet the requirements of high-end manufacturing.

[0003] Regarding the common multi-scale and multi-form detection problems in the steel surface defect detection scenario, including complex defect types such as slender scratches, irregular oxidation patches, and dispersed inclusions, traditional convolutional neural networks (CNNs) have inherent defects in long-range spatial dependence modeling due to being limited by the local receptive field mechanism. Summary of the Invention

[0004] Based on this, it is necessary to provide a method, device, computer device, and storage medium for identifying steel surface defects in view of the above technical problems.

[0005] A method for identifying steel surface defects, the method includes:

[0006] Using a backbone network to extract features from a steel surface image to obtain image features.

[0007] Performing two downsamplings on the image features to obtain a first downsampled feature and a second downsampled feature.

[0008] Converting the second downsampled feature into an image feature vector and then processing it using an adaptive feature interaction encoder to obtain encoded features.

[0009] The image features, encoded features, and first downsampled features are processed using a feature fusion module based on a dynamic pooling pyramid and GhostConv to obtain a fused feature vector. The feature fusion module is used to process the image features, encoded features, and first downsampled features using convolution, a cross-scale feature interaction module, and a concatenation operation to obtain a fused feature vector. The cross-scale feature interaction module is used to perform multi-granularity feature integration on the features input to the module through convolution, a dynamic pooling pyramid structure, and GhostConv.

[0010] An IoU-aware query selection strategy is used to select a fixed number of image features from the fused feature vector to obtain an initial query vector.

[0011] The initial query vector is processed using a decoder with an auxiliary prediction head to obtain the steel surface defect recognition result.

[0012] A steel surface defect recognition device, the device includes:

[0013] A feature extraction module, configured to extract features from a steel surface image using a backbone network to obtain image features.

[0014] An encoding module, configured to perform two downsamplings on the image features to obtain a first downsampled feature and a second downsampled feature; convert the second downsampled feature into an image feature vector and then process it using an adaptive feature interaction encoder to obtain encoded features; process the image features, encoded features, and first downsampled features using a feature fusion module based on a dynamic pooling pyramid and GhostConv to obtain a fused feature vector. The feature fusion module is used to process the image features, encoded features, and first downsampled features using convolution, a cross-scale feature interaction module, and a concatenation operation to obtain a fused feature vector. The cross-scale feature interaction module is used to perform multi-granularity feature integration on the features input to the module through convolution, a dynamic pooling pyramid structure, and GhostConv.

[0015] An initial query vector determination module, configured to use an IoU-aware query selection strategy to select a fixed number of image features from the fused feature vector to obtain an initial query vector.

[0016] A steel surface defect recognition module, configured to process the initial query vector using a decoder with an auxiliary prediction head to obtain the steel surface defect recognition result.

[0017] A computer device, including a memory and a processor, the memory stores a computer program, and when the processor executes the computer program, the steps of the above method are implemented.

[0018] A computer-readable storage medium stores a computer program thereon, and when the computer program is executed by a processor, the steps of the above method are implemented.

[0019] The above steel surface defect recognition method, device, computer equipment and storage medium. The method uses a backbone network to extract features from the steel surface image, performs two downsamplings on the extracted image features to obtain the first downsampled feature and the second downsampled feature; converts the second downsampled feature into an image feature vector and then processes it using an adaptive feature interaction encoder to obtain an encoded feature; processes the image feature, the encoded feature, and the first downsampled feature using a feature fusion module based on dynamic pooling pyramid and GhostConv to obtain a fused feature vector; uses an IoU-aware query selection strategy to filter a fixed number of image features from the fused feature vector to obtain an initial query vector; processes the initial query vector using a decoder with an auxiliary prediction head to obtain the steel surface defect recognition result. This method realizes the full-scale defect capture ability from macroscopic deformation to microscopic cracks while maintaining computational efficiency. Description of the Drawings

[0020] Figure 1 It is a schematic flowchart of the steel surface defect recognition method in an embodiment;

[0021] Figure 2 It is a flowchart of the steel surface defect recognition method in another embodiment;

[0022] Figure 3 It is a structural diagram of the feature fusion module based on dynamic pooling pyramid and GhostConv in another embodiment;

[0023] Figure 4 It is a schematic diagram of six typical industrial defect examples in another embodiment, where (a) is a pit sample diagram, (b) is an inclusion sample diagram, (c) is a patch sample diagram, (d) is a depression sample diagram, (e) is a rolling scale sample diagram, and (f) is a scratch sample diagram;

[0024] Figure 5 It is an experimental result diagram on the NEU-DET dataset in another embodiment, where (a) is a schematic diagram of the training GIoU loss, (b) is a schematic diagram of the training L1 loss, (c) is a schematic diagram of the accuracy metric, (d) is a schematic diagram of the recall metric, (e) is a schematic diagram of the validation GIoU loss, (f) is a schematic diagram of the validation L1 loss, (g) is a schematic diagram of the mAP50 metric, and (h) is a schematic diagram of the mAP@0.5:0.95 metric;

[0025] Figure 6 It is a confusion matrix diagram in another embodiment;

[0026] Figure 7 It is a diagram of experimental results on the GC10-DE dataset in another embodiment, where (a) is a schematic diagram of the training GIoU loss, (b) is a schematic diagram of the training L1 loss, (c) is a schematic diagram of the accuracy metric, (d) is a schematic diagram of the recall metric, (e) is a schematic diagram of the validation GIoU loss, (f) is a schematic diagram of the validation L1 loss, (g) is a schematic diagram of the mAP50 metric, and (h) is a schematic diagram of the mAP@0.5:0.95 metric;

[0027] Figure 8 It is an internal structure diagram of a computer device in one embodiment. Detailed implementation manners

[0028] In order to make the objectives, technical solutions and advantages of the present application clearer, the present application will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application, but not to limit the present application.

[0029] In one embodiment, as Figure 1 shown, a method for identifying steel surface defects is provided, and the method includes the following steps:

[0030] Step 100: Use a backbone network to extract features from the steel surface image to obtain image features.

[0031] Specifically, the backbone network is mainly used to extract features from the steel surface image.

[0032] The backbone network can select a convolutional neural network, which integrates convolutional layers, batch normalization, and activation functions, expanding the receptive field range while reducing computational complexity.

[0033] Step 102: Perform two downsamplings on the image features to obtain a first downsampled feature and a second downsampled feature.

[0034] Specifically, the first downsampled feature is the feature obtained by performing one downsampling on the image features; the second downsampled feature is the feature obtained by performing one downsampling on the first downsampled feature.

[0035] Step 104: After converting the second downsampled feature into an image feature vector, use an adaptive feature interaction encoder for processing to obtain encoded features.

[0036] Specifically, the adaptive feature interaction encoder (AIFI) is used as the core feature aggregation unit, innovatively integrating the cross-scale image feature interaction mechanism. This module constructs a bidirectional cross-head attention network to efficiently fuse multi-granularity features within a single encoding layer, effectively capturing the relationships between conceptual entities within the image.

[0037] Step 106: Process the image features, encoded features, and the first downsampled features using a feature fusion module based on dynamic pooling pyramid and GhostConv to obtain a fused feature vector; the feature fusion module is used to process the image features, encoded features, and the first downsampled features through convolution, cross-scale feature interaction module, and concatenation operation to obtain a fused feature vector; the cross-scale feature interaction module is used to perform multi-granularity feature integration on the features input to the module through convolution, dynamic pooling pyramid structure, and GhostConv.

[0038] Specifically, a feature fusion module based on dynamic pooling pyramid and GhostConv (abbreviated as SPPF-GhostConv module) is used to integrate the initial feature map from the shallow layer to the deep layer, while maintaining details, thereby improving the detection of subtle features. The core technology of this feature fusion module lies in establishing a joint optimization space for cross-resolution feature mapping after fusing feature maps of different sizes. Through the concatenation strategy guided by convolution and mapping operations, compared with traditional single-scale feature processing, this architecture improves the global feature extraction ability and effectively balances the requirements of macroscopic morphology perception and microscopic feature analysis in steel surface defect detection. The feature integration architecture realizes cross-resolution feature alignment through an upsampling strategy and then constructs a hierarchical feature interaction space. After combining images of different scales, the response intensity of the defect area is effectively enhanced in the dynamic pooling pyramid, which helps more effective feature extraction and multi-frequency fusion; the combination of GhostConv allows for the adjustment of important features, enabling the effective extraction of the defect area in the dynamic pooling pyramid and significantly improving the efficiency and accuracy of subsequent feature extraction tasks in complex vision applications.

[0039] The cross-scale feature interaction module realizes multi-granularity feature integration through a collaborative architecture of convolution and pooling. This module innovatively combines the dynamic pooling pyramid structure and GhostConv to construct a lightweight hybrid architecture. Without significantly increasing the number of parameters, this module effectively solves the problem of lack of interactivity between different convolutional groups and improves the ability to extract feature maps, thereby improving the efficiency and effect of feature recognition.

[0040] Step 108: Screen a fixed number of image features from the fused feature vector using an IoU-aware query selection strategy to obtain an initial query vector.

[0041] Specifically, this method introduces an IoU-aware query selection strategy to screen a fixed number of image features from the output sequence of the front-end model as the initial query vector of the decoder.

[0042] Step 110: Process the initial query vector using a decoder with an auxiliary prediction head to obtain the steel surface defect recognition result.

[0043] Specifically, the decoder architecture integrates an auxiliary prediction module and a prediction head, and dynamically corrects the bounding box coordinates and confidence evaluation through iterative optimization of the target query. This mechanism optimizes the feature representation through defect localization tracking, significantly improving the recognition accuracy of small-scale defects while maintaining the detection efficiency.

[0044] The process structure of the steel surface defect recognition method is as Figure 2 shown.

[0045] In the above steel surface defect recognition method, the method uses a backbone network to extract features from the steel surface image, performs two downsamplings on the extracted image features to obtain the first downsampled feature and the second downsampled feature; after converting the second downsampled feature into an image feature vector, it is processed by an adaptive feature interaction encoder to obtain an encoded feature; the image feature, the encoded feature, and the first downsampled feature are processed by a feature fusion module based on dynamic pooling pyramid and GhostConv to obtain a fused feature vector; an IoU-aware query selection strategy is used to filter a fixed number of image features from the fused feature vector to obtain an initial query vector; the initial query vector is processed by a decoder with an auxiliary prediction head to obtain the steel surface defect recognition result. This method realizes the full-scale defect capture ability from macroscopic deformation to microscopic cracks while maintaining the computational efficiency.

[0046] In one embodiment, as Figure 3 shown, the feature fusion module based on dynamic pooling pyramid and GhostConv includes: two first convolution modules, two second convolution modules, and three cross-scale feature interaction modules; step 106 includes: after passing the encoded feature through the first first convolution module, obtaining a first convolution feature; splicing the first convolution feature with the first downsampled feature to obtain a first spliced feature; processing the first spliced feature through the first cross-scale feature interaction module to obtain a cross-scale feature interaction feature; processing the cross-scale feature interaction feature with the second first convolution module to obtain a second convolution feature; splicing the second convolution feature with the image feature to obtain a second spliced feature; processing the second spliced feature through the second cross-scale feature interaction module and the first second convolution module to obtain a third convolution feature; splicing the third convolution feature with the second convolution feature to obtain a third spliced feature; processing the third spliced feature through the third cross-scale feature interaction module and the second second convolution module to obtain a fourth convolution feature; splicing the fourth convolution feature with the first convolution feature to obtain a fourth spliced feature; after splicing the fourth spliced feature, the third spliced feature, and the second spliced feature, obtaining a fused feature vector.

[0047] Specifically, the innovation of the feature fusion module based on the dynamic pooling pyramid and GhostConv lies in the hierarchical feature fusion mechanism and the cross-level feature reuse strategy. By constructing a cascaded pooling structure, multi-scale information capture is achieved, and the target shape, size, and spatial distribution features are extracted using pooling kernels of different granularities. To address the problems of increased model complexity caused by channel redundancy and weakened features of small targets, the GhostConv module with low computational complexity and high feature generation efficiency is adopted. The discriminative representation of complex texture defects (such as oxidation spots) and geometric shape defects (such as microcracks) on the steel surface is enhanced through the feature channel dynamic screening mechanism.

[0048] This feature fusion module adopts a hybrid serial-parallel pooling path, reducing the parameter order while maintaining the multi-scale perception ability, and strengthening the response intensity of small-size defects in combination with the feature reuse strategy. Traditional solutions usually perform bilinear interpolation for feature map upsampling and then execute channel-level concatenation fusion, which leads to high redundancy, and the fine-grained information in the shallow high-resolution features is easily covered by the deep semantic features. Therefore, the model proposed in this application makes up for the traditional defects and greatly reduces the number of parameters caused by previous convolutions. This module proposes a three-stage feature enhancement process: First, the feature map is upsampled to enhance cross-scale feature interaction and detail information fusion. Then, the Spatial Pyramid Pooling Layer (SPPF) is used to achieve multi-granularity feature aggregation, and the parameter order is reduced through the feature splicing operation of parallel pooling branches. Finally, the GhostConv module is used to implicitly expand the fused features, and the feature expression ability is improved using the redundant feature generation mechanism.

[0049] In one embodiment, the cross-scale feature interaction module includes: two convolutional modules, a dynamic pooling pyramid module, and a GhostConv module; the first concatenated feature is processed through the first cross-scale feature interaction module to obtain cross-scale feature interaction features, including: the first convolutional feature is processed using the first convolutional module to obtain a convolutional feature; the convolutional feature is processed using the dynamic pooling pyramid module to obtain three pooling features of different scales; the convolutional feature and the three pooling features of different scales are concatenated and then processed using the second convolutional module to obtain a pooled convolutional feature; the pooled convolutional feature is processed using the GhostConv module to obtain cross-scale feature interaction features.

[0050] In one embodiment, the dynamic pooling pyramid module includes three max-pooling layers; the convolutional features are processed by the dynamic pooling pyramid module to obtain pooling features at three different scales, including: after the convolutional features are processed by the first max-pooling layer, the first-scale pooling features are obtained; after the first-scale pooling features are processed by the second max-pooling layer, the second-scale pooling features are obtained; after the second-scale pooling features are processed by the third max-pooling layer, the third-scale pooling features are obtained.

[0051] In one embodiment, in the GhostConv module: a mapping operation is performed on each channel feature of the features input to the GhostConv module to obtain the corresponding Ghost feature map; the first mapping operation is an identity mapping, and the remaining mappings are lightweight transformations based on depthwise separable convolutions; the features input to the GhostConv module and the Ghost feature map are concatenated in the channel dimension to obtain the output features of the GhostConv module.

[0052] Specifically, the specific working process of the GhostConv module: First, the eigen feature map F needs to be generated, which is completed through a conventional convolution operation and serves as the basic feature representation. For each channel feature of the eigen feature map F, i mapping operations are performed: one of them is an identity mapping, and the remaining i - 1 times use lightweight transformations such as depthwise separable convolutions to generate the Ghost feature map as shown in Equation (2). Finally, the original eigen feature map and the Ghost feature map are concatenated in the channel dimension to form the output result as shown in Equation (3).

[0053] (1)

[0054] (2)

[0055] (3)

[0056] where F represents the input features of the GhostConv module, represents the mapping of the original feature map, represents the separate convolution operation for the nth channel, represents the nth lightweight transformation based on depthwise separable convolution, represents the output features of the GhostConv module.

[0057] In one embodiment, the first convolutional module includes: a convolutional layer with a convolutional kernel size of , a batch normalization layer, and a SiLU activation function; the second convolutional module includes: a convolutional layer with a convolutional kernel size of The convolutional layer, batch normalization layer, and SiLU activation function.

[0058] In one embodiment, the backbone network is the backbone network of the ResNet structure.

[0059] Specifically, the core structure of the backbone network of the ResNet structure adopts a residual connection design. The residual structure not only alleviates the gradient vanishing problem of deep networks but also improves the detection accuracy of small targets through cross-layer feature fusion. As the preferred backbone network, ResNet18 is used. The basic residual module of the ResNet architecture series forms a residual connection through cross-layer identity mapping while extracting features through convolution. The residual connection mechanism of ResNet18 allows the network to directly transmit the underlying feature information. This double convolutional layer configuration reduces the number of parameters through a parameter sharing strategy, while the cross-layer connection improves the training convergence speed.

[0060] In one embodiment, the steel surface defect recognition model is composed of a backbone network, an adaptive feature interaction encoder, a feature fusion module based on dynamic pooling pyramid and GhostConv, an IoU-aware query selection strategy, and a decoder with an auxiliary prediction head. The loss function used in the training process of the steel surface defect recognition model is the L1 loss and the GIoU loss.

[0061] The L1 loss (Mean Absolute Error, MAE) is the core evaluation metric in regression tasks. By calculating the mean absolute error between the predicted value and the true value y i to quantify the model bias. Compared with the L2 loss (MSE) that uses squared error, the linear penalty mechanism of the L1 loss effectively avoids the amplification effect of errors and shows stronger stability when dealing with noisy data. This robustness stems from the constant nature of its loss function gradient, making the model training process less susceptible to extreme values and thus improving the generalization ability in scenarios with complex data distributions.

[0062] (4)

[0063] Among them, represents the L1 loss, , respectively represent the true value and the corresponding predicted value, and n represents the number of training samples.

[0064] The L1 loss function constructs an error measurement system based on the absolute difference between the predicted value and the true value. Its linear penalty mechanism makes the contribution of outliers to the overall loss significantly lower than the L2 loss of the squared error, thus having a natural anti-interference ability against outliers. This function maintains a fixed gradient characteristic of ±1 during the optimization process, resulting in sparse parameter updates, which is suitable for modeling scenarios that require feature screening. From the perspective of error interpretation, the mean absolute error output by the L1 loss remains consistent with the original data unit, enhancing the readability of the model evaluation results. In the image reconstruction task, its balanced optimization of pixel-level errors avoids overfitting extreme noise points and effectively balances the dialectical relationship between denoising effect and detail retention.

[0065] The Generalized Intersection over Union (GIoU) loss, an improved loss function for object detection, demonstrates significant advantages over the traditional IoU loss in bounding box regression tasks. Its core mechanism effectively addresses the vanishing gradient issue of the original IoU loss when bounding box overlap is achieved by introducing a calculation parameter for the minimum bounding rectangle C—the minimum enclosed area that covers both the predicted and ground-truth boxes.

[0066] The GIoU loss extends its value range to the interval [-1, 1]. When the predicted box and the ground-truth box completely overlap, the metric reaches an upper limit of 1; if the two boxes are completely separated and the distance between them increases, the metric approaches -1. Compared to the traditional IoU loss, where the gradient is zeroed when the boxes do not overlap, the GIoU loss, through a compensation term designed to account for the area difference of the closure region, can still generate an effective gradient signal in the non-overlapping state. This feature enables the model to continuously obtain parameter correction directions during the bounding box regression process, significantly accelerating convergence. Mathematical derivation shows that the GIoU loss effectively improves the bounding box coordinate regression accuracy through a stable gradient propagation mechanism, demonstrating stronger optimization capabilities, especially when dealing with small object positioning and complex spatial relationships.

[0067] It should be understood that although Figure 1 The steps in the flowchart are shown in sequence as indicated by the arrows, but these steps are not necessarily executed in the order indicated by the arrows. Unless otherwise specified in this document, there is no strict order restriction for the execution of these steps, and these steps can be executed in other orders. In addition, Figure 1 At least part of the steps may include multiple sub-steps or multiple stages. These sub-steps or stages are not necessarily executed at the same time, but can be executed at different times. The execution order of these sub-steps or stages is not necessarily sequential, but can be executed in turn or alternately with other steps or at least part of the sub-steps or stages of other steps.

[0068] In one embodiment, an adaptive feature interaction encoder is replaced by a feature encoding module based on a dynamic sparse attention mechanism, which consists of a dynamic sparse attention mechanism, dynamic positional encoding, and a multi-head attention mechanism; the feature encoding module adopts a selective feature processing mechanism and only processes the top-K high-order features screened by the dynamic sparse attention. This not only significantly reduces the computational load and improves the processing speed but also maintains the performance. In the Transformer encoding architecture, due to the lack of the inherent sequence modeling ability of convolutional or recurrent structures, explicit positional representations become a key design element. This embodiment adopts a dynamic positional encoding strategy to inject spatial coordinate information into the feature vector, effectively solving the problem that the encoding mechanism is insensitive to spatial topology. To improve the performance of feature extraction, global semantic information is further explored based on the local receptive field. Subsequently, after screening the feature maps with high feature correlation coefficients, cross-scale semantic fusion is performed through the multi-head self-attention mechanism of the Transformer. The dynamic sparse attention mechanism ignores the local features with low correlation coefficients. Therefore, the self-attention mechanism of the Transformer can well enrich the detailed features of more local and global features on the existing feature descriptions, supplementing the key parts that have subtle defects in the steel cracks but are ignored due to the coarse-grained screening of the dynamic sparse attention.

[0069] In the feature encoding module based on the dynamic sparse attention mechanism: the image features are downsampled twice to obtain downsampled features; the downsampled features are captured by the dynamic sparse attention mechanism to obtain long-distance feature correlations across image regions, resulting in dynamic attention features; the dynamic attention features are encoded and then positionally encoded using the dynamic positional encoding strategy to obtain a position encoding result; the position encoding result is subjected to cross-scale semantic fusion using the self-attention mechanism of the Transformer to obtain cross-scale semantic fusion features; the cross-scale semantic fusion features are dimensionally reshaped to obtain encoded features.

[0070] The dynamic sparse attention mechanism is used to divide the downsampled features into discrete semantic units, and then through high-dimensional space projection, obtain the Q matrix, K matrix, and V matrix; according to the Q matrix and K matrix, determine the adjacency matrix of the regional correlation between the Q matrix and the K matrix; dynamically screen the top k relevant regions of each region according to the adjacency matrix and the correlation threshold to obtain the Top-K key regions; aggregate the Top-K key regions with the discrete semantic units of the K matrix and the V matrix respectively to obtain the aggregated key and value vectors; the aggregated key and value vector pairs are processed by the self-attention mechanism and then integrated through a linear transformation layer to obtain the attention output; the attention output is subjected to a dimensional reshaping operation to obtain the dynamic attention features.

[0071] The steel surface defect recognition model after module replacement in this embodiment is verified using a phased verification process: First, parameter optimization is completed based on the training set, and then verification is performed on an independent test set. In scenarios with limited sample sizes, this method implements a retention verification strategy, allocating the original samples in a 4:1 ratio, where 80% is used for model training and 20% is used as the validation set. This embodiment will conduct experimental verification on the NEU-DET and GC10-DET datasets to verify the effectiveness of the model. AdamW optimizer is used for parameter optimization during model training, with the base learning rate configured as 1e-4 and the momentum coefficient set to 0.9. To comprehensively evaluate the model's performance, a multi-dimensional evaluation system is constructed, covering core indicators such as classification accuracy, recall rate, and mean average precision (mAP@0.5 and mAP@0.5:0.95).

[0072] (1) Dataset

[0073] As a benchmark dataset dedicated to steel surface anomaly detection, NEU-DET mainly serves the fields of computer vision and deep learning algorithm research. This dataset contains 1,800 standardized industrial image samples, with each frame image size uniformly standardized to 200 pixels × 200 pixels, covering six typical industrial defects: cracks, patches, inclusions, pitted surfaces, crazing, and scratches, providing a standardized evaluation benchmark for defect classification and localization algorithms. Examples of the six typical industrial defects are shown as Figure 4 shown, where Figure 4 (a) in Figure 4 is an example diagram of crazing, Figure 4 (b) in Figure 4 is an example diagram of inclusions, Figure 4 (c) in Figure 4 is an example diagram of patches,

[0074] GC10-DET, as an open-source industrial steel material quality inspection dataset, integrates ten types of typical surface defect samples: punching (Pu), weld (Wl), crescent gap (Cg), water stain (Ws), oil stain (Os), wire stain (Ss), inclusion (In), rolling pit (Rp), crease (Cr), and waist fold (Wf). This dataset is professionally annotated, and the samples cover diverse morphological features ranging from micron-scale punctate defects to centimeter-scale planar damages. Each defect category shows significant differences in geometric shape, size distribution, and texture complexity. It is well-known for its high image quality and fine annotation. This dataset provides precise bounding box defect annotation data, facilitating the training and performance verification of detection models. Due to covering diverse defect morphological categories, it has important application value for developing industrial defect recognition algorithms, especially in the verification link of deep learning-driven detection models, and can effectively evaluate the generalization ability of algorithms to complex defect patterns. The distribution of the number of samples in each category is shown through a visualization chart. The distribution of the number of samples in each category is shown in Table 1.

[0075] Table 1 Distribution of the number of samples in each category

[0076]

[0077] (2)Experimental results

[0078] 1)Model performance on the NEU-DET dataset

[0079] Under the influence of dynamic lighting conditions and differences in material surface properties in the NEU-DET dataset, the defect samples exhibit gray-scale characteristics. This phenomenon leads to significant morphological differences among samples of the same type of defect, while cross-category defects show texture similarity. This dual characteristic poses a dual challenge to the defect recognition model: it needs to overcome the problem of discrete distribution of intra-class samples and strengthen the ability to capture subtle differences between classes. Model training under such complex data distribution conditions can effectively improve the anti-interference ability of the industrial quality inspection system to lighting and the adaptability to materials, providing a technical verification basis for the engineering deployment of the online steel surface detection system. In this embodiment, the model is trained for 250 iterations. During the 250 training cycles, the model performance shows typical convergence characteristics. In the initial stage of training (the first 50 cycles), there is a rapid optimization stage: the GIoU loss and L1 loss drop to 0.3757 and 0.3469 respectively. After entering the middle stage of training, the loss function enters a stable period, and the accuracy index is continuously optimized through parameter fine-tuning, and finally reaches the convergence state. The experimental results on the NEU-DET dataset are as Figure 5 shown, where Figure 5 in (a) is the schematic diagram of the training GIoU loss, Figure 5 in (b) is the schematic diagram of the training L1 loss, Figure 5 in (c) is the schematic diagram of the accuracy index, Figure 5Among them, (d) is the schematic diagram of the recall rate index, Figure 5 Among them, (e) is the schematic diagram of the verified GIoU loss, Figure 5 Among them, (f) is the schematic diagram of the verified L1 loss, Figure 5 Among them, (g) is the schematic diagram of the mAP50 index, Figure 5 Among them, (h) is the schematic diagram of the mAP0.5:0.95 index. The model maintains a detection accuracy of 92.55% while the recall rate reaches 0.7952. This training trajectory verifies the effectiveness of the gradient optimization strategy, especially showing stable performance in balancing the precision and recall rate indexes in the object detection task.

[0080] The evaluation results of the NEU-DET dataset are shown in Table 2. The model shows different performance in the detection of six types of defects. In the classification task, the recognition accuracy of the Inclusion category is the lowest (60.2%), while the peak recall rates of the Patches, Inclusion, and Pitted_surface categories exceed 0.9. The recall rate of the Crazing category drops sharply to 0.377 due to the fusion of light-colored features with the background. There is a significant correlation between the dataset size and the model performance. The mAP@0.5 of the Patches, Pitted_surface, and Scratches categories all exceed 90%, driving the overall mAP@0.5 to reach 83.14%, and the mAP@0.5:0.95 is stable at 47.37%. The high-contrast crack samples achieve high detection accuracy due to the advantage of feature recognition. As Figure 6 Shown in the confusion matrix diagram, the confusion matrix analysis reveals that the model has strong discriminative power in the fine-grained classification task, but is still sensitive to the subtle perturbations of the background texture. This not only reflects the advantage of the algorithm in capturing defect features but also exposes the optimization space in complex industrial scenarios.

[0081] Table 2 Evaluation Results of the NEU-DET Dataset

[0082]

[0083] 2) Model Performance on the GC10-DE Dataset

[0084] To further evaluate the performance of the proposed method model, model validation was carried out on the GC10-DET steel defect dataset, which contains 3,570 high-resolution industrial images (2048 pixels × 1000 pixels), and the training set and validation set were divided in a ratio of 4:1. After 300 training epochs of optimization, the model achieved a detection accuracy of 79.61% and a recall rate of 0.6459. The GIOU loss and L1 loss converged to 0.5542 and 0.3359 respectively, verifying the effectiveness of the multi-task optimization mechanism. The experimental results on the GC10-DE dataset are as Figure 7 shown, where Figure 7 (a) in it is the schematic diagram of the training GIoU loss, Figure 7 (b) in it is the schematic diagram of the training L1 loss, Figure 7 (c) in it is the schematic diagram of the accuracy metric, Figure 7 (d) in it is the schematic diagram of the recall metric, Figure 7 (e) in it is the schematic diagram of the validation GIoU loss, Figure 7 (f) in it is the schematic diagram of the validation L1 loss, Figure 7 (g) in it is the schematic diagram of the mAP50 metric, Figure 7 (h) in it is the schematic diagram of the mAP@0.5:0.95 metric. The experimental results show that the detection framework has stable feature extraction ability in complex industrial scenarios, and its multi-scale feature fusion mechanism effectively balances the localization accuracy and classification performance.

[0085] The validation of the GC10-DET industrial dataset shows that the model can exhibit differentiated performance characteristics in real-scene applications. In the detection of specific defect types, the weld (Wl) category leads with an accuracy of 90.6%, while the mAP@0.5 of the inclusion (In) and rolling pit (Rp) categories is less than 30%, which are 29.6% and 27.7% respectively. It is worth noting that although the overall mAP@0.5 of this dataset reaches 67.27%, the detection accuracies of the three types of defects, namely punching (Pu), weld (Wl), and crescent gap (Cg), exceed 90%, confirming the feature extraction advantage of the model for high-contrast defects. This performance difference reveals that in industrial inspection scenarios, the visual separability between the target and the background has a decisive impact on the model performance.

[0086] The sample size of the GC10-DET dataset shows a significant correlation with the model's detection performance. For the pit (Rp) and crease (Cr) classes, the detection accuracy is limited due to the scarcity of samples. However, for the punching (Pu) and weld (Wl) classes, the mAP@0.5:0.95 metrics reach 52.8% and 52.9% respectively, significantly better than the overall average of 34.09%. The distribution characteristics of mAP@0.5:0.95 indicate that the visual separability between the target and the background is a key limiting factor. In industrial scenarios, complex texture backgrounds are prone to causing feature confusion, especially having a significant impact on low-contrast defects. This performance difference reveals that the balance of the inter-class sample distribution and the background complexity in the dataset jointly affect the model's generalization ability. Therefore, the number of datasets has a great impact on the parameter optimization of the model. By increasing the data size of low-sample categories such as cracks and optimizing the distribution structure, the model's feature separation ability in complex backgrounds is enhanced. In the detection of ten types of defects, the framework of this method achieves an accuracy of 79.61% in the crack identification task. From the accuracy of the inclusion (In) and pit (Rp) categories, it can be observed that due to the small number of datasets, the accuracy cannot be correspondingly improved, which confirms the positive effect of data distribution optimization on the model's robustness. The accuracy of the 10 categories is shown in Table 3; the total accuracy of the two datasets is shown in Table 4.

[0087] Table 3 Accuracy of 10 categories

[0088]

[0089] Table 4 Total accuracy of two datasets

[0090]

[0091] (3) Comparative experiment

[0092] The steel surface defect recognition module with the feature encoding module based on the dynamic sparse attention mechanism replacing the adaptive feature interaction encoder is compared with the current advanced models on the NEU-DET dataset. The experiment shows that this model exhibits significant advantages in terms of accuracy metrics. The experimental results of the current advanced models on the NEU-DET dataset are shown in Table 5.

[0093] Table 5 Experimental results of current advanced models on the NEU-DET dataset

[0094]

[0095] After comparing the NEU-DET dataset, supplementary tests were conducted using the GC10-DET dataset. The experimental results of the YOLO series models and this method on the GC10-DET dataset are shown in Table 6. The experimental results of the YOLO5 model and this method on the GC10-DET dataset are shown in Table 7. This method has the advantage of stability, further verifying its comprehensive reliability.

[0096] Table 6 Experimental Results of YOLO Series Models and This Method on the GC10-DET Dataset

[0097]

[0098] Table 7 Experimental Results of YOLO5 Model and This Method on the GC10-DET Dataset

[0099]

[0100] (3) Ablation and Visualization Experiments

[0101] In this embodiment, ablation experiments were conducted on NEU-DET to verify the performance contributions of each module. The results of the ablation experiments on NEU-DET are shown in Table 8.

[0102] The baseline model A integrates the ResNet18 backbone network and the DETR architecture, achieving 79.40% mAP@0.5 and 43.55% mAP@0.5:0.95. Model B introduces a feature encoding module based on the dynamic sparse attention mechanism on the basis of model A, integrates the dynamic sparse attention mechanism, and further optimizes the detection effect. While this scheme increases the parameter scale by 0.21M, by strengthening the image information of the associated tokens, mAP@0.5 and mAP@0.5:0.95 are respectively improved by 3.27% and 1.45% compared with the baseline model. This structural improvement significantly optimizes the performance without excessive increase in the overall computational load while maintaining the detection accuracy.

[0103] Model C introduces a feature fusion module (SPPF-GhostConv) based on the dynamic pooling pyramid and GhostConv on the architecture of model B, integrating the dynamic pooling pyramid mechanism and GhostConv. This design effectively suppresses parameter growth while strengthening feature interaction through the synergistic effect of the dynamic pooling pyramid mechanism and GhostConv, achieving synchronous optimization of detection accuracy and model efficiency. This scheme increases mAP@0.5 and mAP@0.5:0.95 to 83.14% and 47.37% respectively. The ablation experiment data shows that removing any core component causes a step-by-step decay in accuracy, confirming that the synergistic effect of the dynamic pooling pyramid mechanism and GhostConv has a decisive impact on the model performance.

[0104] Model D, built based on Model C architecture, aims to verify the impact of stacked encoding layers on performance. Experiments found that overstacking Transformer encoding layers would lead to performance degradation, specifically manifested as a significant decline of 0.77% in the mAP@0.5 metric and a synchronous decrease of 2.57 percentage points in mAP@0.5:0.95. This reverse optimization phenomenon not only verified the rationality of the original architecture but also provided crucial experimental basis for subsequent optimization paths.

[0105] In the verification of the CNN-based Module E, ResNet50 was used as the basic architecture of the convolutional embedding framework. Experiments found that although the number of parameters and computational overhead increased significantly on the NEU-DET dataset, the improvement in detection accuracy was limited. Quantitative analysis showed that the detection accuracy metric mAP@0.5:0.95 only increased by 1.23% compared to the baseline model A, and synchronous optimization of performance was not achieved. It can also be judged that excessive parameter quantity and computational complexity will weaken the engineering deployment value of the model. This method finally selected ResNet18 as the feature extraction backbone, which achieved a better balance configuration between computational efficiency and detection accuracy.

[0106] Table 8 Module ablation experiment

[0107]

[0108] After completing the module-level accuracy evaluation, a visualization comparison study of detection results was carried out for the NEU-DET dataset below. The model after module replacement in this embodiment not only achieved accurate classification and localization of crack-like defects but also showed superior performance in typical samples. Taking the detection of crazing as an example, although the baseline model could complete defect classification, this solution had obvious advantages in terms of localization accuracy and feature discrimination. Introducing the dynamic sparse attention mechanism significantly expanded the detection coverage area. In the integrated model of GhostConv, this combined architecture showed stronger environmental adaptability. Especially in the inclusion-like scenarios, the crack recognition accuracy was systematically improved. Experimental data showed that the newly added module effectively improved the suppression efficiency of complex background interference, enabling the algorithm to successfully capture micro-scale crack features that were previously missed. For the patches-like detection scenario, the baseline model had the dual defects of detection redundancy and insufficient area coverage. In the pitted_surface detection task, the optimized module showed a gain effect: reducing the number of redundant candidate boxes while maintaining detection accuracy. Visualization confirmed that this architecture had the ability to accurately represent the geometric features of defects, especially reducing the recognition error of the crack distribution range and morphological features, highlighting the breakthrough progress of the module in the optimization of the feature space.

[0109] To more clearly verify the recognition ability of the model proposed in this application, the recognition ability on the GC10-DET dataset is also visually demonstrated. Through the visualization of water stains (Ws), creases (Cr), and the mixture of different defects, it can be seen that with the stacking of modules, the recognition of different types of defects becomes more accurate. It can be seen from the following aspects: with the stacking of modules, the redundant bounding boxes for the recognition of several defects are decreasing, and the recognition scores are increasing significantly, finally achieving the ultimate excellent effect. This progressive optimization mechanism not only enhances the localization accuracy of small defects but also effectively suppresses the background noise interference in industrial scenarios through cross-layer feature fusion, ultimately verifying the robust generalization ability of the model in multi-source data scenarios.

[0110] The comprehensive experimental results confirm that the model after module replacement in this embodiment shows strong advantages in complex industrial scenarios: it not only enhances the robustness to background noise but also improves the recognition sensitivity to micro defects. Visual analysis verifies the effectiveness of the algorithm in multi-type defect detection, where the localization error of weak texture defects is reduced.

[0111] In one embodiment, a steel surface defect recognition device is provided, including: a feature extraction module, an encoding module, an initial query vector determination module, and a steel surface defect recognition module, where:

[0112] The feature extraction module is used to extract features from the steel surface image using a backbone network to obtain image features.

[0113] The encoding module is used to perform two downsamplings on the image features to obtain the first downsampled feature and the second downsampled feature; after converting the second downsampled feature into an image feature vector, it is processed using an adaptive feature interaction encoder to obtain encoded features; the image features, encoded features, and the first downsampled feature are processed using a feature fusion module based on dynamic pooling pyramid and GhostConv to obtain a fused feature vector; the feature fusion module is used to process the image features, encoded features, and the first downsampled feature using convolution, cross-scale feature interaction module, and concatenation operation to obtain a fused feature vector; the cross-scale feature interaction module is used to perform multi-granularity feature integration on the features input to the module through convolution, dynamic pooling pyramid structure, and GhostConv.

[0114] The initial query vector determination module is used to screen a fixed number of image features from the fused feature vector using an IoU-aware query selection strategy to obtain an initial query vector.

[0115] The steel surface defect recognition module is used to process the initial query vector using a decoder with an auxiliary prediction head to obtain the steel surface defect recognition result.

[0116] In one embodiment, the feature fusion module based on the dynamic pooling pyramid and GhostConv includes: two first convolution modules, two second convolution modules, and three cross-scale feature interaction modules; the encoding module is further configured to obtain first convolution features after passing the encoded features through the first first convolution module; splice the first convolution features with the first downsampled features to obtain first spliced features; process the first spliced features through the first cross-scale feature interaction module to obtain cross-scale feature interaction features; process the cross-scale feature interaction features with the second first convolution module to obtain second convolution features; splice the second convolution features with the image features to obtain second spliced features; process the second spliced features through the second cross-scale feature interaction module and the first second convolution module to obtain third convolution features; splice the third convolution features with the second convolution features to obtain third spliced features; process the third spliced features through the third cross-scale feature interaction module and the second second convolution module to obtain fourth convolution features; splice the fourth convolution features with the first convolution features to obtain fourth spliced features; splice the fourth spliced features, the third spliced features, and the second spliced features to obtain a fused feature vector.

[0117] In one embodiment, the cross-scale feature interaction module includes: two convolution modules, a dynamic pooling pyramid module, and a GhostConv module; the encoding module is further configured to process the first convolution features with the first convolution module to obtain convolution features; process the convolution features with the dynamic pooling pyramid module to obtain three pooled features at different scales; splice the convolution features and the three pooled features at different scales and then process them with the second convolution module to obtain pooled convolution features; process the pooled convolution features with the GhostConv module to obtain cross-scale feature interaction features.

[0118] In one embodiment, the dynamic pooling pyramid module includes three maximum pooling layers; the encoding module is further configured to process the convolution features through the first maximum pooling layer to obtain first-scale pooled features; process the first-scale pooled features through the second maximum pooling layer to obtain second-scale pooled features; process the second-scale pooled features through the third maximum pooling layer to obtain third-scale pooled features.

[0119] In one embodiment, the encoding module is further configured to, in the GhostConv module: perform a mapping operation on each channel feature of the features input to the GhostConv module to obtain a corresponding Ghost feature map; where the first mapping operation is an identity mapping, and the remaining mappings are lightweight transformations based on depthwise separable convolutions; concatenate the features input to the GhostConv module with the Ghost feature map in the channel dimension to obtain the output features of the GhostConv module.

[0120] In one embodiment, the first convolutional module includes: a convolutional layer with a convolutional kernel size of , a batch normalization layer, and a SiLU activation function; the second convolutional module includes: a convolutional layer with a convolutional kernel size of , a batch normalization layer, and a SiLU activation function.

[0121] In one embodiment, the backbone network in the feature extraction module is the backbone network of the ResNet structure.

[0122] For the specific limitations of the steel surface defect recognition device, reference can be made to the limitations of the steel surface defect recognition method in the above text, which will not be elaborated here. Each module in the above steel surface defect recognition device can be implemented in whole or in part by software, hardware, and their combination. The above modules can be embedded in the processor of the computer device in hardware form or be independent of it, or can be stored in the memory of the computer device in software form, so as to facilitate the processor to call and execute the operations corresponding to the above respective modules.

[0123] In one embodiment, a computer device is provided. The computer device can be a terminal, and its internal structure diagram can be as Figure 8 shown. The computer device includes a processor, a memory, a network interface, a display screen, and an input device connected through a system bus. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The network interface of the computer device is used to communicate with an external terminal through a network connection. The computer program, when executed by the processor, implements a steel surface defect recognition method. The display screen of the computer device can be a liquid crystal display screen or an electronic ink display screen. The input device of the computer device can be a touch layer covering the display screen, or a button, a trackball, or a touchpad provided on the housing of the computer device, or an external keyboard, touchpad, or mouse, etc.

[0124] Those skilled in the art can understand, Figure 8The structure shown is only a block diagram of some of the structures related to the solution of this application, and does not constitute a limitation on the computer device to which the solution of this application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine some components, or have different component arrangements.

[0125] In one embodiment, a computer device is provided, including a memory and a processor. The memory stores a computer program, and when the processor executes the computer program, the steps in the above method embodiment are implemented.

[0126] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the steps in the above method embodiment are implemented.

[0127] Those of ordinary skill in the art can understand that all or part of the processes in the above method embodiments can be completed by instructing relevant hardware through a computer program. The computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the above method embodiments. Among them, any reference to a memory, storage, database, or other medium used in the various embodiments provided in this application can include non-volatile and / or volatile memories. Non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory. Volatile memory can include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in many forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDR SDRAM), enhanced SDRAM (ESDRAM), synchronous link DRAM (SLDRAM), Rambus direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and Rambus dynamic RAM (RDRAM), etc.

[0128] The technical features of the above embodiments can be combined arbitrarily. For the sake of brevity of description, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, it should be considered to be within the scope described in this specification.

[0129] The above-described embodiments merely represent several implementation manners of the present application. The description thereof is relatively specific and detailed, but it should not be construed as a limitation to the scope of the present application. It should be noted that for those of ordinary skill in the art, without departing from the concept of the present application, several modifications and improvements can still be made, and these all fall within the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the appended claims.

Claims

1. A method for identifying surface defects of steel, characterized in that, The method includes: Using a backbone network to extract features from the steel surface image to obtain image features; Performing two downsamplings on the image features to obtain a first downsampled feature and a second downsampled feature; Converting the second downsampled feature into an image feature vector and then processing it using an adaptive feature interaction encoder to obtain an encoded feature; Processing the image features, the encoded features, and the first downsampled feature using a feature fusion module based on a dynamic pooling pyramid and GhostConv to obtain a fused feature vector; the feature fusion module is used to process the image features, the encoded features, and the first downsampled feature using convolution, a cross-scale feature interaction module, and a concatenation operation to obtain a fused feature vector; the cross-scale feature interaction module is used to perform multi-granularity feature integration on the features input to the module through convolution, a dynamic pooling pyramid structure, and GhostConv; Adopting an IoU-aware query selection strategy to screen a fixed number of image features from the fused feature vector to obtain an initial query vector; Processing the initial query vector using a decoder with an auxiliary prediction head to obtain the steel surface defect recognition result.

2. The steel surface defect recognition method according to claim 1, characterized in that The feature fusion module based on a dynamic pooling pyramid and GhostConv includes: two first convolution modules, two second convolution modules, and three cross-scale feature interaction modules; Processing the image features, the encoded features, and the first downsampled feature using a feature fusion module based on a dynamic pooling pyramid and GhostConv to obtain a fused feature vector, including: After passing the encoded feature through the first first convolution module, obtaining a first convolution feature; Concatenating the first convolution feature with the first downsampled feature to obtain a first concatenated feature; Processing the first concatenated feature through the first cross-scale feature interaction module to obtain a cross-scale feature interaction feature; Processing the cross-scale feature interaction feature using the second first convolution module to obtain a second convolution feature; Concatenating the second convolution feature with the image features to obtain a second concatenated feature; Processing the second concatenated feature through the second cross-scale feature interaction module and the first second convolution module to obtain a third convolution feature; Concatenating the third convolution feature with the second convolution feature to obtain a third concatenated feature; Processing the third concatenated feature through the third cross-scale feature interaction module and the second second convolution module to obtain a fourth convolution feature; Concatenating the fourth convolution feature with the first convolution feature to obtain a fourth concatenated feature; After concatenating the fourth concatenated feature, the third concatenated feature, and the second concatenated feature, obtaining a fused feature vector.

3. The method for identifying surface defects of steel according to claim 2, characterized in that, The cross-scale feature interaction module includes: two convolution modules, a dynamic pooling pyramid module, and a GhostConv module; Processing the first concatenated feature through the first cross-scale feature interaction module to obtain a cross-scale feature interaction feature, including: Process the first convolutional feature using the first convolutional module to obtain a convolutional feature; Process the convolutional feature using a dynamic pooling pyramid module to obtain three pooled features of different scales; Concatenate the convolutional feature and the three pooled features of different scales and then process them using the second convolutional module to obtain a pooled convolutional feature; Process the pooled convolutional feature using a GhostConv module to obtain a cross-scale feature interaction feature.

4. The steel surface defect identification method according to claim 3, characterized in that, The dynamic pooling pyramid module includes three max-pooling layers; Process the convolutional feature using a dynamic pooling pyramid module to obtain three pooled features of different scales, including: Process the convolutional feature through the first max-pooling layer to obtain a first-scale pooled feature; Process the first-scale pooled feature through the second max-pooling layer to obtain a second-scale pooled feature; Process the second-scale pooled feature through the third max-pooling layer to obtain a third-scale pooled feature.

5. The steel surface defect identification method according to claim 3, characterized in that, In the GhostConv module: Perform a mapping operation on each channel feature of the feature input to the GhostConv module to obtain a corresponding Ghost feature map; the first mapping operation is an identity mapping, and the remaining mappings are lightweight transformations based on depthwise separable convolutions; Concatenate the feature input to the GhostConv module and the Ghost feature map in the channel dimension to obtain the output feature of the GhostConv module.

6. The method for identifying surface defects of steel according to claim 2, characterized in that, The first convolutional module includes: a convolutional layer with a convolutional kernel size of , a batch normalization layer, and a SiLU activation function; The second convolutional module includes: a convolutional layer with a convolutional kernel size of , a batch normalization layer, and a SiLU activation function.

7. The steel surface defect identification method according to claim 1, characterized in that The backbone network is the backbone network of the ResNet structure.

8. A device for identifying surface defects of steel, characterized in that, The device includes: A feature extraction module for extracting features from a steel surface image using a backbone network to obtain image features; An encoding module for performing two downsamplings on the image features to obtain a first downsampled feature and a second downsampled feature; converting the second downsampled feature into an image feature vector and then processing it using an adaptive feature interaction encoder to obtain an encoded feature; processing the image feature, the encoded feature, and the first downsampled feature using a feature fusion module based on dynamic pooling pyramid and GhostConv to obtain a fused feature vector; the feature fusion module is used to process the image feature, the encoded feature, and the first downsampled feature using convolution, a cross-scale feature interaction module, and a concatenation operation to obtain a fused feature vector; the cross-scale feature interaction module is used to perform multi-granularity feature integration on the features input to the module through convolution, a dynamic pooling pyramid structure, and GhostConv; An initial query vector determination module for screening a fixed number of image features from the fused feature vector using an IoU-aware query selection strategy to obtain an initial query vector; A steel surface defect recognition module for processing the initial query vector using a decoder with an auxiliary prediction head to obtain a steel surface defect recognition result.

9. A computer device, comprising a memory and a processor, the memory storing a computer program, characterized in that, When the processor executes the computer program, it implements the steps of the steel surface defect recognition method according to any one of claims 1 to 7.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the steps of the steel surface defect recognition method described in any one of claims 1 to 7.

Citation Information

Patent Citations

  • Strip steel surface defect area size measuring method

    CN119313669A

  • Spacecraft thermal control film coating defect identification method based on multi-dimensional attention mechanism

    CN119515792A