Steel defect detection method based on global self-attention and receptive field enhancement

By improving the YOLO11 network and introducing the PConv, C2PSA_FasterMQA, and DycDetect modules, the PCD-Net network was constructed. This solved the problems of multi-scale feature extraction and sample distribution imbalance in steel defect detection using lightweight networks, and achieved efficient and accurate multi-class defect detection.

CN121582622APending Publication Date: 2026-02-27NANTONG UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511479456.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-10-16
Publication Date
2026-02-27

AI Technical Summary

Technical Problem

Existing lightweight networks suffer from insufficient multi-scale feature extraction capabilities, loss of texture features, and insufficient adaptability to unbalanced sample distribution in the detection of multiple types of defects on steel surfaces, making it difficult to balance detection accuracy and efficiency.

Method used

We employ global self-attention and receptive field enhancement methods. By improving the YOLO11 network and introducing the PConv, C2PSA_FasterMQA, and DycDetect modules, we construct the PCD-Net detection network, perform data augmentation and optimized training, and improve feature extraction capabilities and detection accuracy.

Benefits of technology

While maintaining low parameter and computational costs, it significantly improves the accuracy and efficiency of steel defect detection, solves the trade-off between insufficient network capacity and computational complexity, and enhances the accuracy and recall of multi-category defect detection.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121582622A_ABST
    Figure CN121582622A_ABST
Patent Text Reader

Abstract

The invention discloses a steel defect detection method based on global self-attention and receptive field enhancement, and relates to the field of steel defect detection, and the method comprises the steps: dividing a steel defect data set, and carrying out data enhancement and optimization training; a PConv module is introduced into a YOLO11 network shallow layer, so that the problem of feature information loss in a down-sampling process of traditional convolution is solved, bottom-layer feature extraction is enhanced, and a network receptive field is expanded; the backbone network enhances global information attention and reduces memory access through a C2PSAFasterMQA module, so that the detection efficiency is improved; a DycDeect module is constructed at a detection head, so that the overall performance of the network is improved from large-scale training while the relatively low calculation amount is maintained; and detecting the steel image through the trained defect detection network to obtain a defect type, a defect position and a defect confidence coefficient. According to the method, the light weight is kept while the detection precision is improved, and the diversified steel defect detection performance is improved.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of steel defect detection, and in particular to a steel defect detection method based on global self-attention and receptive field enhancement. BACKGROUND

[0002] Steel, as a pillar product in China's industrial metal material system, is widely used in the fields of construction, automobile, machinery manufacturing, etc. However, due to factors such as processing technology and production environment, there are often different types of defects such as cracks, scratches and folds on the surface of steel during the production process of steel. These defects, without accurate detection and identification, will become a key factor affecting product quality and safety accident rate.

[0003] Traditionally, manual visual inspection, i.e. manual visual detection, is used for steel surface defect detection. However, the detection result is highly dependent on the experience and judgment of the operator, and different personnel may draw inconsistent conclusions, resulting in unreliable identification. Secondly, the problems of manual visual inspection are low efficiency, great influence of environment, high cost and difficulty in identifying small or complex defects; at present, with the rapid development of deep learning technology, deep neural networks represented by convolutional neural networks have derived a series of mainstream target detection networks, which have been used in industrial image detection to extract subtle defect features and process image noise interference, etc. The accuracy and efficiency have been effectively improved. However, in order to cope with the deployment challenges of mainstream target detection networks on terminal devices with limited computing resources, many researchers have made great efforts in network lightweight.

[0004] Although the existing lightweight network has significant advantages in computing resource occupation and inference speed, it still has obvious limitations in the task of multi-class defect detection on the surface of steel. This limitation is mainly due to the lack of multi-scale feature extraction capability caused by insufficient network capacity; the loss of texture features caused by channel compression affects the differentiation of the classes to be detected; and the lack of adaptability to sample distribution. These factors together make it difficult for existing solutions to balance lightweight and classification detection accuracy requirements. SUMMARY

[0005] In view of the problems existing in the prior art, the present application proposes a steel defect detection method based on global self-attention and receptive field enhancement, which can improve the overall detection accuracy while maintaining a low parameter amount and computational amount, and ensure the detection performance of diversified steel defect detection.

[0006] The present application adopts the following technical scheme: a steel defect detection method based on global self-attention and receptive field enhancement, comprising the following steps: Step 1, divide the steel defect data set, process the data set by using data enhancement method and optimization training strategy, and form the target steel defect data set; Step 2, select YOLO11 network as baseline network, improve backbone network and detection head, form PCD-Net steel defect detection network; wherein, Pconv module is introduced in the shallow layer of the network to replace the original convolution, C2PSA_FasterMQA module is introduced in the backbone network, and DycDetect module is finally introduced to replace the original detection head; Step 3, the PCD-Net steel defect detection network is trained by the target steel defect data set, and the trained PCD-Net steel defect detection network is obtained. Step 4, using the trained PCD-Net steel defect detection network to predict the input image, the final defect detection result of each input image is obtained.

[0007] Preferably, in step 1, the steel defect data set is reasonably divided, and then the data set is processed by using data enhancement technology and optimization training strategy to form the target steel defect data set, including: The untreated steel defect data set is divided into training set, test set and validation set.

[0008] Before training, a kind of HSV domain adaptive disturbance method is designed according to the internal defect characteristics, and the processing is as follows: Decouple color (H), saturation (S) and brightness (V), which can only adaptively stretch S / V and slightly offset H while maintaining color semantics, thereby highlighting the edge features of defects such as grayish thin layer defects.

[0009] Adjust the multi-task loss weight distribution, which includes: increase the box weight to enhance the bounding box regression, set the cls weight to balance the classification task, and especially use the distribution focal loss.

[0010] By strengthening the horizontal invariance, randomly flipping, folding and setting the corresponding size, the target steel defect data set is formed. Among them, the optimizer is set to Adamw, the initial learning rate is 0.0005, the epoch is 300, and the weight decay is 0.01.

[0011] Preferably, in step 2, the baseline network YOLO11 is improved in backbone network and detection head, including: the network shallow layer improvement of backbone network, specifically: the first Conv layer, the second PConv layer, the third layer splicing layer, the fourth Conv layer, the fifth connection layer, the sixth PConv layer, the seventh connection layer, the eighth SPPF layer and the ninth C2PSA layer.

[0012] Wherein, the PConv module is embedded in the shallow feature extraction stage of the network to form a defect detection framework with geometric perception ability, which uses asymmetric padding to create horizontal and vertical convolution kernels for different regions of the image to expand the receptive field.

[0013] Batch normalization (BN) and sigmoid linear unit are applied after each convolution to improve the stability and speed of training. The first layer of the PConv module performs parallel convolution operations, and the height ( ), width ( ) and channel number ( ) of the output feature map are connected via the results of the first layer convolution. The convolution kernel normalizes the connected tensor without padding.

[0014] Then, the height and width of the output feature map are adjusted to preset values and , so that PConv is interchangeable with Conv layer, and as a channel attention mechanism, analyzes the contribution of different convolution directions, and finally outputs .

[0015] Preferably, in step 2, the backbone network and detection head of the baseline network YOLO11 are improved, including: in the backbone network, a C2PSA_FasterMQA module is constructed based on the Mobile MQA module to replace the C2PSA layer in the network.

[0016] Specifically, the Mobile MQA in the C2PSA_FasterMQA module adopts a multi-query design, and only the Queries are processed using multiple independent heads, while the Keys and Values are shared between all heads. The specific workflow is: the input feature map is split into query branch and key-value branch; The query branch can first be down-sampled (stride>1), then projected by 1×1 convolution and then attention calculation; the key-value branch can also be down-sampled (stride>1) first, and then projected on the key and value respectively.

[0017] The obtained attention score is used to weight the value feature, and the result is restored to the original feature map size through the output projection layer, and finally dropout is applied to prevent overfitting, to obtain the final output feature map.

[0018] Preferably, in step 2, the backbone network and detection head of the baseline network YOLO11 are improved, including: the improvement of the detection head, two layers of dynamic convolution are introduced into the Bbox Loss branch of the original detection head to replace the original convolution layer and another Cls Loss branch containing a depth separable convolution to form a DycDetect module.

[0019] Specifically, global average pooling is used to compress the input features into a global feature vector. Routing weights are calculated using fully connected layers, and these weights determine the importance of the current input features to different convolutional kernels; The feature map is mapped to the predicted bounding box using a standard convolutional layer.

[0020] In addition, the distributed focus loss (DFL) module is used to convert the discrete representation of the bounding box into a continuous representation, thereby improving the accuracy of bounding box prediction.

[0021] Specifically, in the category loss prediction branch, the original detection head uses DWConv and Conv to perform convolution operations on the input feature map to generate predicted features for the category; the feature map is then mapped to the predicted category result through a standard convolutional layer.

[0022] Preferably, in step 3, the training set and validation set in the divided target steel defect dataset are used for network training, and the test set in the divided target steel defect dataset is used to evaluate the network.

[0023] Preferably, in step 4, defect detection is performed on the constructed target steel defect dataset using the improved PCD-Net network, including: The images from the constructed target steel defect dataset are input into the backbone layer of the PCD-Net detection network; Feature extraction is performed through PConv, Conv, and other modules in the backbone layer; Feature fusion is performed through the neck layer; the head layer, composed of the constructed DycDetect module, outputs three feature maps of 20×20, 40×40, and 80×80 respectively. Output the final bounding box, the confidence level of the defect, and the category to obtain the defect detection results; The PCD-Net detection network after testing randomly selects images to be detected from the constructed target steel defect dataset and outputs the defect detection results.

[0024] Compared with the prior art, the present invention, employing the above technical solution, has the following technical effects: This invention's steel defect detection method replaces the original Conv layer with a PConv layer in the shallow layers of the network. Utilizing PConv's rotational symmetry and dynamic receptive field adjustment capabilities, it achieves multi-directional feature extraction. Simultaneously, while maintaining efficient parameter utilization, it significantly expands the receptive field, effectively alleviating the problems of insufficient receptive field and information loss during downsampling in standard Conv and DWConv when extracting shallow features. This allows for more effective extraction of basic features from relevant datasets, providing richer and more accurate information for subsequent defect detection tasks. A novel C2PSA_FasterMQA is used to replace the original C2PSA, combining local window attention with global channel attention to focus on global information while maintaining efficiency. A lightweight DycDetect is used to replace the original detection head, integrating DynamicConv into the coordinate regression head while maintaining a classification branch based on depthwise separable convolutions, thus solving the trade-off between network parameter quantity and computational complexity in traditional convolutional layers. Attached Figure Description

[0025] Figure 1 This is a flowchart of the steel defect detection method of the present invention; Figure 2 This is a schematic diagram of the improved PCD-Net steel defect detection network of the present invention; Figure 3 This is a schematic diagram of the PConv module of the present invention on a steel defect dataset; Figure 4 This is a schematic diagram of the improved DycDetect detection head of the present invention; Figure 5 This is a schematic diagram of the detection results in an embodiment of the present invention; Figure 6 This is a schematic diagram showing the prediction results of different networks compared in an embodiment of the present invention. Detailed Implementation

[0026] To make the objectives, technical solutions, and advantages of this invention clearer, the technical solutions of the application will be further described in detail below with reference to the accompanying drawings. The described embodiments are only a part of the embodiments involved in this invention. All non-innovative embodiments based on these embodiments by other researchers in the art are within the protection scope of this invention. Furthermore, the step numbers in the embodiments of this invention are only set for ease of explanation and do not limit the order of the steps. The execution order of each step in the embodiments can be adaptively adjusted according to the understanding of those skilled in the art.

[0027] In one embodiment of the present invention, a steel defect detection method based on global self-attention and receptive field enhancement is provided, such as... Figure 1 As shown, it includes: The steel defect dataset is rationally divided, and then data augmentation techniques and optimization training strategies are used to process the dataset to form the target steel defect dataset.

[0028] The YOLO11 network was selected as the baseline network, and its backbone network and detection head were improved to form the PCD-Net detection network that balances high accuracy and lightweight design. Specifically, PConv was introduced into the shallow layers of the network to replace the original convolution, a new C2PSA_FasterMQA module was introduced into the backbone network, and finally the DycDetect module was introduced to replace the original detection head. The PCD-Net steel defect detection network is iteratively trained on the target steel defect dataset to obtain the trained PCD-Net steel defect detection network and output the detection results. The trained PCD-Net steel defect detection network is used to predict the input images to be detected, so as to obtain the final defect detection result for each input image.

[0029] The specific working principle of the method in this embodiment is as follows: First, the steel defect dataset is reasonably divided into three sub-datasets: a training set, a test set, and a validation set, along with labels containing images within the dataset. Then, data augmentation techniques and optimization training strategies are used to process the dataset, thus forming the target steel defect dataset.

[0030] Then, the YOLO11 network was selected as the baseline network, and the backbone network and detection head of the network were improved to form a PCD-Net detection network that balances high accuracy and lightweight design.

[0031] Experimental analysis revealed that using the existing YOLO11 network as a baseline failed to achieve ideal detection accuracy and lightweight design on the constructed target steel defect dataset. Therefore, this embodiment improves the YOLO11 network backbone and detection head, such as... Figure 2 As shown, this is mainly reflected in the following three aspects: 1) Replace standard convolutions with PConv in the shallow layers of the network, and use its rotational symmetry and dynamic receptive field adjustment capabilities to achieve multi-directional feature extraction.

[0032] 2) A novel C2PSA_FasterMQA module is used to replace the C2PSA in the backbone network. This module combines local window attention with global channel attention, focusing on global information while maintaining high efficiency.

[0033] 3) A lightweight DycDetect module is used to replace the original detection head. DynamicConv is integrated into the coordinate regression head, while maintaining the classification branch based on depthwise separable convolution, thereby solving the trade-off between the number of network parameters and computational complexity in traditional convolutional layers.

[0034] As a preferred embodiment, the shallow layers of the baseline YOLO11 backbone network are improved, such as... Figure 3 As shown, it includes: a first Conv layer, a second PConv layer, a third splicing layer, a fourth Conv layer, a fifth connection layer, a sixth PConv layer, a seventh connection layer, an eighth SPPF layer, and a ninth C2PSA layer.

[0035] The specific working principle is as follows: Batch normalization (BN) and sigmoid linear units are applied after each convolution to improve the stability and speed of training. The first layer of the PConv module performs parallel convolution operations, outputting the height of the feature map ( ),width( ) and number of channels ( The results of the first convolution are concatenated. (Convolution kernel) Normalize the connected tensors without padding. Adjust the height and width of the output feature map to preset values. and This allows PConv and Conv layers to be interchangeable and serves as a channel attention mechanism to analyze the contributions of different convolutional directions.

[0036] In this embodiment, the final output The calculation is as follows: ; in, , For input Width and height, It is the number of output channels for each convolutional layer. The number of channels for the final output feature map of the PConv module. The convolution stride; , , These are the input feature map, the feature map output from the four branches, and the final fusion convolutional kernel used to adjust the output size and number of channels. , , The functions are concatenation, batch normalization, and activation function, respectively.

[0037] Specifically, the PConv module is embedded in the shallow feature extraction stage of the network to form a defect detection framework with geometric awareness. It uses asymmetric padding to create horizontal and vertical convolutional kernels for different regions of the image to expand the receptive field.

[0038] As a preferred embodiment, the backbone network of the baseline network YOLO11 is improved by constructing a C2PSA_FasterMQA module based on the MobileMQA module to replace the C2PSA layer in the network.

[0039] In this embodiment, Mobile MQA adopts a parameter sharing strategy, the expression of which is: ; in, It is a 3×3 depthwise convolution or identity function with a stride of 2. Representing the The projection matrix of each query header. The key projection matrix represents the shared key. The projection matrix representing the shared value. The dimension representing the key or query is used to stabilize the gradient of the softmax function, and the superscript is used for this purpose. Represents matrix transpose. This represents the output projection matrix, which maps the concatenated multi-head attention results back to the original feature space. Representing the One point of attention, This represents the weighted sum of the attention weights and the value vectors after softmax normalization of the outputs of the attention heads from the 1st to the nth. The function is a fusion function.

[0040] Furthermore, the C2PSA_FasterMQA module adopts a multi-query design, processing only Queries with multiple independent headers, while Keys and Values ​​are shared among all headers.

[0041] The specific workflow is as follows: the input feature map is split into a query branch and a key-value branch; the query branch is first downsampled (stride>1), then projected through a 1×1 convolution before attention calculation; the key-value branch is also first downsampled (stride>1), then projected onto the key and value respectively. The obtained attention scores are used for weighted features, and the results are restored to the original feature map size through the output projection layer. Finally, dropout is applied to prevent overfitting, resulting in the final output feature map. This approach enhances the network's global attention without increasing computational overhead.

[0042] As a preferred embodiment, the detection head of the baseline network YOLO11 is improved, such as... Figure 4 As shown, two dynamic convolutional layers are introduced into the Bbox Loss branch of the original detection head to replace the original convolutional layer and form the DycDetect module with another Cls Loss branch containing DWConv.

[0043] The specific working principle is as follows: Global average pooling is used to compress the input features into a global feature vector. Routing weights are calculated using fully connected layers, and these weights determine the importance of the current input features to different convolutional kernels; The feature map is mapped to the predicted bounding box using a standard convolutional layer.

[0044] Specifically, the distributed focus loss (DFL) module is further utilized to convert the discrete representation of the bounding box into a continuous representation, thereby improving the accuracy of bounding box prediction. In the category loss prediction branch, the original detection head uses DWConv and Conv to perform convolution operations on the input feature map to generate the predicted features of the category. Finally, the feature map is mapped to the predicted results of the category through a standard convolutional layer.

[0045] Next, the constructed PCD-Net steel defect detection network is iteratively trained on the target steel defect dataset to obtain the trained PCD-Net steel defect detection network and the detection results, including: mAP50, GFLOPS, parameter, precision, and recall.

[0046] Finally, the trained PCD-Net steel defect detection network is used to predict the input images to be detected, so as to obtain the final defect detection results for each input image.

[0047] In this embodiment, the pre-constructed PCD-Net steel defect detection network is iteratively trained on the target steel defect dataset to obtain the trained PCD-Net steel defect detection network and output the detection results, such as... Figure 5 As shown.

[0048] The experimental environment for this invention used Python version 3.8.13. The computational experiments were conducted on a second-generation Intel Core i9-12900K processor (3.20 GHz) and an NVIDIA GeForce RTX A4000 GPU (16 GB VRAM), with CUDA version 11.8 and PyTorch 2.0.0 as the software environment. Details are shown in Table 1.

[0049] Table 1 Experimental Environment Configuration Parameters

[0050] To comprehensively evaluate the performance of the network proposed in this embodiment, several evaluation metrics were further incorporated, and their calculation formulas are as follows: ; ; ; in, This represents the number of instances that are actually positive and were correctly predicted as positive by the network. This represents the number of instances that are actually negative but were incorrectly predicted as positive by the network. This represents the number of instances that are actually positive but were incorrectly predicted as negative by the network. (Variable) Represents the total number of categories to be detected. Indicates the first Average precision of the class.

[0051] To verify the effectiveness of each module in the improved network of this embodiment for detecting the target steel defect dataset, the ablation experiment will be divided into four groups: Model A: YOLO11, Model B: YOLO11+PConv, Model C: YOLO11+PConv+C2PSA_FasterMQA, and Model D: YOLO11+PConv+C2PSA_FasterMQA+DycDetect (PCD-Net). Specifically, as shown in Table 2.

[0052] Table 2 Ablation Experiment

[0053] As shown in Table 2, introducing PConv into the shallow network improved precision, recall, and mAP50. The precision metric reached its highest point at 79.1% after replacing C2PSA with C2PSA_FasterMQA. In summary, the improvements to the three modules reduced the number of parameters by approximately 10.65% compared to the baseline network, lowered computational complexity by approximately 19.40%, while simultaneously improving mAP50 by 4.7% and recall by 6.6%.

[0054] Furthermore, to more comprehensively illustrate the improved network's superior performance, several mainstream deep learning-based algorithms are included in the comparison, such as YOLOv10n, YOLOv8n, YOLOv6, YOLOv5L, YOLOv3-tiny, MobileNetV4, and PP-LCNet. Specifically, they are shown in Table 3.

[0055] Table 3 Comparative Experiments

[0056] As shown in Table 3, the improved PCD-Net network outperforms other mainstream networks on the constructed steel defect dataset. Clearly, this network also achieves optimal lightweight design.

[0057] Furthermore, the trained PCD-Net steel defect detection network and other mainstream comparison networks are used to predict the input images to be detected, so as to obtain the final defect detection result for each input image, specifically as follows: Figure 6 As shown.

[0058] To verify the effectiveness of the trained network, this embodiment selects images of different defect types from the validation set for prediction, ultimately obtaining the detection results of defect types in the input images. Clearly, compared to other networks, the improved PCD-Net network in this embodiment exhibits the best detection performance.

[0059] The above description is only a preferred embodiment of the present invention. It should be noted that for those skilled in the art, several improvements and modifications can be made without departing from the principle of the present invention, and these improvements and modifications should also be considered within the scope of protection of the present invention.

Claims

1. A method for detecting steel defects based on global self-attention and enhanced receptive field, characterized in that, Includes the following steps: Step 1: Divide the steel defect dataset into parts, and process the dataset using data augmentation methods and optimization training strategies to form the target steel defect dataset; Step 2: Select the YOLO11 network as the baseline network, and improve the backbone network and the detection head to form the PCD-Net steel defect detection network. Specifically, the Pconv module is introduced into the shallow layer of the network to replace the original convolution, the C2PSA_FasterMQA module is introduced into the backbone network, and finally the DycDetect module is introduced to replace the original detection head. Step 3: Iteratively train the constructed PCD-Net steel defect detection network on the target steel defect dataset to obtain the trained PCD-Net steel defect detection network. Step 4: Use the trained PCD-Net steel defect detection network to predict the input images to be detected, and obtain the final defect detection results for each input image.

2. The steel defect detection method based on global self-attention and receptive field enhancement according to claim 1, characterized in that, In step 1, the unprocessed steel defect dataset is divided into training set, test set and validation set. The training and validation sets are used for network training, while the test set is used for network evaluation.

3. The steel defect detection method based on global self-attention and receptive field enhancement according to claim 1, characterized in that, In step 1, based on the characteristics of internal defects in the steel, the dataset is processed using the HSV domain adaptive perturbation method, specifically as follows: By decoupling color (H), saturation (S), and brightness (V), while preserving the color semantics, only S / V are adaptively stretched, and H is slightly offset to highlight the edge features of crack-like gray-white thin-layer defects. Adjust the weight allocation of multi-task loss: increase the box weight to enhance bounding box regression, set the cls weight to balance classification tasks, and adopt distributed focus loss; By strengthening the horizontal invariance, randomly flipping and folding the data, and setting appropriate sizes, a target steel defect dataset is constructed. The optimizer is set to Adamw, with an initial learning rate of 0.0005, an epoch of 300, and a weight decay of 0.

01.

4. The steel defect detection method based on global self-attention and receptive field enhancement according to claim 1, characterized in that, In step 2, the backbone network and detection head of the baseline network YOLO11 are improved, including: shallow network improvement of the backbone network, specifically: the first convolutional layer, the second PConv layer, the third splicing layer, the fourth convolutional layer, the fifth connection layer, the sixth PConv layer and the seventh connection layer, the eighth SPPF layer and the ninth C2PSA layer. The PConv module is embedded in the shallow feature extraction stage of the network to form a defect detection framework with geometric awareness. It uses asymmetric padding to create horizontal and vertical convolutional kernels for different regions of the image to expand the receptive field. Batch normalization and sigmoid linear units are applied after each convolution to improve training stability and speed.

5. The steel defect detection method based on global self-attention and receptive field enhancement according to claim 4, characterized in that, The first layer of the PConv module performs parallel convolution operations, outputting the height of the feature map. ,width and number of channels The results of the first convolution are concatenated, and then a convolution kernel is used. The connected tensors are normalized without padding, and the height and width of the output feature map are adjusted to preset values. and This makes PConv and Conv layers interchangeable and serves as a channel attention mechanism to analyze the contributions of different convolutional directions and obtain the final output. The calculation is as follows: ; in, , For input Width and height, It is the number of output channels for each convolutional layer. The number of channels for the final output feature map of the PConv module. The convolution stride; , , These are the input feature map, the feature map output from the four branches, and the final fusion convolutional kernel used to adjust the output size and number of channels. , , The functions are fusion, batch normalization, and activation function, respectively.

6. The steel defect detection method based on global self-attention and receptive field enhancement according to claim 5, characterized in that, In step 2, improvements are made to the YOLO11 baseline network, including improvements to the backbone network and detection heads. Specifically, the Mobile MQA module of the backbone network adopts a parameter-sharing strategy, and a C2PSA_FasterMQA module is constructed based on the Mobile MQA module to replace the C2PSA layer in the network. The Mobile MQA module in the C2PSA_FasterMQA module employs a multi-query design, processing only Queries using multiple independent headers, while Keys and Values ​​are shared across all headers. Input feature map Split into query branches and key-value branches; The query branch is first downsampled, then subjected to 1×1 convolutional projection, and then attention is calculated; the key-value branch is also first downsampled, and then projected onto the key and value respectively. The obtained attention scores are used for weighted features, and the results are restored to the original feature map size through the output projection layer. Dropout is then applied to prevent overfitting, resulting in the final output feature map.

7. The steel defect detection method based on global self-attention and receptive field enhancement according to claim 6, characterized in that, In the Mobile MQA module, the parameter sharing strategy is expressed as follows: ; in, It is a 3×3 depthwise convolution or identity function with a stride of 2. Representing the Projection matrix of each query header Represents the shared key projection matrix. The shared value projection matrix, The dimension representing the key or query is used to stabilize the gradient of the softmax function, and the superscript is used for this purpose. Represents matrix transpose. This represents the output projection matrix, which maps the concatenated multi-head attention results back to the original feature space. Representing the One's attention, This represents the weighted sum of the attention weights and the value vectors after softmax normalization of the outputs of the attention heads from the 1st to the nth. The function is a fusion function.

8. The steel defect detection method based on global self-attention and receptive field enhancement according to claim 6, characterized in that, Improvements were made to the backbone network and detection head of the baseline network YOLO11, including: lightweighting the detection head by introducing two dynamic convolutional layers into the original detection head's Bbox Loss branch, replacing the original convolutional layer with another Cls Loss branch containing depthwise separable convolutions, forming the DycDetect module, specifically: Global average pooling is used to compress the input features into a global feature vector. The routing weights are calculated using fully connected layers to determine the importance of the current input features to different convolutional kernels; standard convolutional layers are used to map the feature maps to predicted bounding boxes.

9. The steel defect detection method based on global self-attention and receptive field enhancement according to claim 8, characterized in that, Based on the prediction results of the bounding box, class loss prediction is performed, specifically as follows: The distributed focus loss module is used to convert the discrete representation of the bounding box into a continuous representation, thereby improving the accuracy of bounding box prediction. In the category loss prediction branch, the input feature map is convolved using depthwise separable convolution and Conv with the original detection head to generate the predicted features of the category. The feature maps are mapped to class predictions using standard convolutional layers.

10. The steel defect detection method based on global self-attention and receptive field enhancement according to claim 9, characterized in that, In step 4, the trained PCD-Net steel defect detection network is used to detect defects in the target steel defect dataset. Specifically: The images of the constructed target steel defect dataset are input into the backbone layer of the PCD-Net steel defect detection network; Feature extraction is performed through Pconv, Conv, and backbone layers, and feature fusion is performed through the neck layer. The head layer, composed of the constructed DycDetect module, outputs three feature maps of 20×20, 40×40, and 80×80 respectively, and then outputs the final bounding box, the confidence score of the defect, and the category to obtain the defect detection result. Randomly select images to be detected from the target steel defect dataset and input them into the PCD-Net steel defect detection network after testing, and output the defect detection results.