Steel surface defect detection method based on dynamic double-branch feature extraction and multi-scale collaborative progressive fusion
By employing a dynamic bi-branch feature extraction and multi-scale collaborative progressive fusion method, the problems of easy attenuation of small defects and easy submersion of weak contrast defects in steel surface defect detection are solved, achieving efficient and stable online detection results.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- ANHUI UNIV OF SCI & TECH
- Filing Date
- 2026-01-31
- Publication Date
- 2026-05-15
AI Technical Summary
Existing deep learning-based methods for detecting surface defects in steel have several drawbacks in production line scenarios. These include the easy attenuation of minute defect features, the potential for spatial misalignment and semantic gaps in multi-scale fusion, the easy submersion of weak-contrast defects in complex texture backgrounds, and the difficulty in balancing detection accuracy with model lightweighting.
A dynamic bi-branch feature extraction and multi-scale collaborative progressive fusion method is adopted. Features are extracted through local detail branches and global semantic branches. The method utilizes a multi-receptive field feature complementary aggregation module and a multi-scale collaborative progressive feature fusion network, combined with the collaborative supervised training of the auxiliary detection head, to achieve alignment, interaction and complementary aggregation, enhance the representation of small defects and weak contrast defects and suppress pseudo-responses in complex texture backgrounds.
While ensuring detection accuracy, the number of model parameters and computational load are reduced, meeting the real-time and stability requirements of online detection, and improving the detection stability and positioning accuracy of small defects and weak contrast defects.
Smart Images

Figure CN122048872A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the fields of machine vision and industrial image processing technology, and in particular to a method for detecting surface defects in steel based on dynamic bi-branch feature extraction and multi-scale collaborative progressive fusion. Background Technology
[0002] Surface defect detection in steel is a crucial aspect of quality control in steel production. Its goal is to quickly and accurately identify and locate various types of defects, such as cracks, scratches, inclusions, and indentations, from images of steel surfaces captured from the production line. While existing deep learning-based target detection methods have made progress in terms of accuracy and automation, they still face several challenges in real-world production scenarios: steel surface defects often exhibit characteristics such as large scale spans, significant morphological differences, low contrast, complex background textures, and strong noise interference. This leads to the gradual dilution of small defects during deep feature extraction, resulting in missed detections; spatial misalignment and semantic gaps can easily occur during multi-scale feature fusion, causing location offsets or category confusion; complex textured backgrounds can introduce spurious target responses, reducing the robustness of detecting weak-contrast defects; simultaneously, online detection is sensitive to real-time performance and deployment costs, making it difficult to balance model parameter quantity and computational cost with detection accuracy. Therefore, there is an urgent need for a steel surface defect detection method that balances accuracy and efficiency, is more sensitive to small and weak-contrast defects, and is suitable for online deployment on production lines. Summary of the Invention
[0003] To address the common problems of existing steel surface defect detection methods in production line scenarios, such as the easy attenuation of small defect features, spatial misalignment and semantic gap caused by multi-scale fusion, the easy submersion of weak contrast defects in complex texture backgrounds, and the difficulty in balancing detection accuracy and model lightweighting, this invention proposes a steel surface defect detection method based on dynamic bi-branch feature extraction and multi-scale collaborative progressive fusion. This method aims to reduce the number of parameters and computational load while ensuring detection accuracy, thus meeting the real-time and stability requirements of online detection.
[0004] To achieve the above objectives, the present invention adopts the following technical solution: a method for detecting surface defects in steel based on dynamic bi-branch feature extraction and multi-scale collaborative progressive fusion, comprising the following operations: Step S1, data preparation and preprocessing, specifically includes the following steps: Step S11: Normalize the size of the dataset and adjust the images to a preset resolution. Simultaneously, mosaic enhancement is employed, combined with strategies such as geometric transformation, brightness adjustment, and noise addition for composite augmentation to obtain the preprocessed image. Step S12: Divide the dataset into training and testing sets in an 8:2 ratio, and perform stratified sampling based on defect category labels and target geometric scale distribution to ensure that the proportion of small defects and weak contrast defects in each set remains consistent, thereby improving the fairness and stability of training and evaluation.
[0005] Step S2, Feature Extraction, this part performs the following operations: Step S21: Input the preprocessed image into the dynamic dual-branch feature extraction backbone network. The local detail branch extracts the texture details and edge structure of the defects on the steel surface, and the global semantic branch extracts the contextual semantic information of the defect area. In the multi-level feature output stage of the backbone network, a multi-receptive field feature complementary aggregation module is designed to align, interact and complementarily aggregate features from different levels and branches to obtain multi-scale backbone features. The MRFCA module includes a channel alignment unit, a feature interaction unit, a local attention unit, a global attention unit, a feature aggregation and compression unit, a reparameterized convolution unit, and an output mapping unit. The MRFCA module is used to align the two-way features output by the local detail branch and the global semantic branch at the same scale and achieve complementary aggregation of multiple receptive fields.
[0006] Step S22: First, let the two input features be respectively ,pass Convolution is used to align channels to obtain alignment features. and The formula for its calculation is: Subsequently, the two alignment features are summed and grouped. Convolution yields interactive features The formula for its calculation is: in, This represents grouped convolution, used to enhance local interactions and form a basic fusion representation across branches.
[0007] Secondly, local attention units and global attention units are introduced into the two aligned features to form a local-global enhancement branch; the local attention units adopt a patch scale. The global attention unit adopts a patch scale. For any input feature Divide it into The patch is then used to obtain a patch-level representation, which is then processed through two fully connected layers and Softmax to obtain the attention response. Finally, the attention response is multiplied element-wise with the patch representation to obtain the attention enhancement result. This process can be described as follows: in, Indicates to according to The features are obtained by mapping the patch-level representation formed after patch partitioning through two fully connected layers. This is element-wise multiplication. For each element... and The local and global enhancement features are obtained and then spliced along the channel dimension to obtain: Step S23: Finally, enhance the two attention features. , With interaction features Perform channel splicing, and sequentially pass through Convolution compression, reparameterized convolution and Convolution output fusion features The formula for its calculation is: in, As a reparameterized convolutional unit, a multi-branch structure is used during training to enhance expressive power, while it is equivalent to a single convolution during inference to reduce computational overhead. Through the above structure, the MRFCA module achieves complementary aggregation of cross-branch features of the same scale in the local and global receptive fields, thereby enhancing the representation of small defects and weak contrast defects and suppressing pseudo-responses caused by complex texture backgrounds.
[0008] Step S3, Feature Fusion: The multi-scale backbone features are input into the multi-scale collaborative progressive feature fusion neck network MSPFPN. Progressive fusion and information completion of features at different scales are achieved through stepwise upsampling, downsampling, and cross-layer interaction to obtain fused features for detection; specifically including: Step S31: Output multi-scale features from the backbone network A bidirectional pyramid information flow is constructed for the input; in the top-down path, high-level semantics are upsampled and fused with high-resolution features to enhance fine-grained defect cues, while in the bottom-up path, localization information is progressively reinjected and high-level semantics are completed. This fusion can be represented as: in, and These represent the feature fusion transformation functions for the top-down path and the bottom-up path, respectively. and These represent upsampling and downsampling operations, respectively.
[0009] Step S32: Introduce a three-way feature alignment encoder (TFE) at the cross-layer fusion node. Using the mid-layer features as the alignment reference, pool and compress the high-layer features, upsample and align the low-layer features, and then aggregate them. The alignment and aggregation process is as follows: These represent the high-level, mid-level, and low-level input features, respectively. Indicates the spatial dimensions of the mid-level features. This indicates that high-level features will be adaptively pooled to... Scale alignment operation, This indicates splicing along the channel.
[0010] Step S33: Differentiated deployment of lightweight operators in feature propagation: GSConv is used for channel transformation in the regular path, and GSConvE is used to enhance local modeling and channel interaction in key downsampling nodes; the fusion node uses element-wise addition to fuse features of the same scale across multiple branches. Step S34: Introduce the Scale Sequence Feature Fusion (SSFF) module into the output layer to... Perform cross-scale consistency modeling: first align channels and then... Upsampling to The scale is then further analyzed through scale-dimensional interactions, and the final fused feature is output in the following form: This indicates that features are formed by stacking along the scale dimension. and These represent 3D convolution and 3D pooling, respectively, used for cross-scale interaction modeling. This indicates that the scale dimension is removed and a two-dimensional feature map is output.
[0011] Step S4, Collaborative Training and Output of Detection Heads: The fused feature input includes the DetectAux module of the main detection head and the auxiliary training detection head. During the training phase, the auxiliary training detection head provides intermediate layer supervision to enhance gradient transfer and feature learning. During the inference phase, only the main detection head outputs the category, location box, and confidence score of the steel surface defect. The process is as follows: In step S41, specifically, during the training phase, a task-aligned sample assigner is used to generate supervision signals of different granularities for both LeadHead and AuxHead. A collaborative supervision mechanism is adopted to divide positive samples into two categories: fine-grained labels and coarse-grained labels. Fine labels are generated under stricter matching constraints and are used to select a small number of high-quality positive samples with more accurate locations to enhance the fine classification and regression learning of LeadHead. Coarse labels obtain more positive samples by relaxing the matching constraints, including some samples with relatively low positioning accuracy, and are used to supervise AuxHead to improve positive sample coverage and reduce the risk of missed detections.
[0012] Step S42, regarding the loss function, the classification branch uses binary cross-entropy loss (BCE), which is calculated as follows: in For the sample size, and These represent the category label and the predicted probability, respectively.
[0013] The localization branch employs a combination of complete IoU loss (CIoU) and distributed focus loss (DFL); where CIoU is defined as: in This represents the Euclidean distance between the center points of the ground truth bounding box and the center point of the predicted bounding box. The length of the diagonal of the smallest bounding rectangle of the two frames. and These are the weight term and the shape consistency term, respectively; DFL is used to model boundary regression as a discrete distribution and perform expectation decoding, and its calculation formula is: in Represents the continuous distance from the boundary of the target box to the center. and For adjacent discrete positions, and This represents the probability of the corresponding discrete position.
[0014] Based on the above definitions, the losses of LeadHead and AuxHead are written as follows: in , The auxiliary head loss weight is generally set to 0.25.
[0015] The final total loss is: Step S43: By introducing AuxHead during the training phase and combining it with a collaborative allocation strategy of fine-grained and coarse-grained labels, denser and more stable gradient signals can be provided for intermediate layers and multi-scale features, improving the learnability and detection stability of small-scale, weak-contrast defects in complex texture backgrounds. It should be noted that AuxHead is only enabled during the training phase and can be removed during the inference phase, so it does not introduce additional runtime parameters and computation.
[0016] Step S5, Model Training: The dynamic dual-branch feature extraction backbone network EDDB constructed in Step S2, the multi-scale collaborative progressive feature fusion neck network MSPFPN constructed in Step S3, and the DetectAux detection module constructed in Step S4 are integrated to form a steel surface defect detection network; the training set images and their defect annotations are used as input for forward propagation, and the loss is calculated based on the model's prediction results and the real annotations. The network weight parameters are updated using the backpropagation optimization algorithm until convergence is achieved. The specific steps include the following: Step S51: Regarding the training loss, this invention employs a total loss function composed of the main detector head loss and the auxiliary training detector head loss to jointly optimize the network parameters. Its expression is: in, Main detection head loss, To assist in training the detection head loss; both the main detection head and the auxiliary training detection head include classification loss and localization loss. The localization loss is composed of a combination of complete IoU loss and distributed focus loss. The auxiliary training detection head loss is weighted by preset weight coefficients to enhance the supervision of the intermediate layer while avoiding interference with the fine learning of the main detection head.
[0017] Step S52: To improve training stability and convergence efficiency, this invention schedules the learning rate and uses batch normalization to stabilize the feature distribution during training. At the same time, it executes an early stopping strategy based on the verification results during training iteration to suppress overfitting, thereby obtaining the final detection model for inference in step S6.
[0018] Step S6, output the result, including the following steps: Step S61: Apply the detection model obtained from the training convergence in step S5 to the test set images for forward inference, and output the defect category, location box and confidence score of each defect target; Step S62: The inference results of step S61 are quantitatively evaluated using mAP50, AP50:95, Params, FPS, and GFLOPs to obtain the final performance evaluation results and detection efficiency feedback for steel surface defect detection. Attached Figure Description
[0019] Figure 1 This is a flowchart of the method of the present invention; Figure 2 This is a network structure diagram of the method of the present invention; Figure 3 This is a structural diagram of the Multi-Receptive Field Feature Complementary Aggregation Module (MRFCA). Figure 4 This is a structural diagram of the tag allocation strategy for the auxiliary detection head; Figure 5 This is a comparison chart of the qualitative detection results of the steel surface defect detection model constructed in this invention with other mainstream and advanced algorithm models on the NEU-DET dataset. Detailed Implementation
[0020] This invention proposes a method for detecting surface defects in steel based on dynamic bi-branch feature extraction and multi-scale collaborative progressive fusion. The specific implementation and basic principles of this invention are further explained below with reference to the accompanying drawings. Figure 1 As shown, the specific process includes the following: Step S1: Data Preparation and Preprocessing. Obtain a dataset of steel surface defect images. Taking the NEU-DET dataset as an example, collect, clean, and label the original images, and normalize their size. Apply mosaic data augmentation to the training samples, and expand them by rotation, flipping, brightness adjustment, and noise addition. Divide the dataset into a training set and a test set at a preset ratio of 8:2 to maintain a balance in the distribution of defect types and scales. Step S2: Feature Extraction. The image preprocessed in Step S1 is input into the Lightweight Dynamic Dual-Branch Feature Extraction Backbone Network EDDB for feature extraction. Different levels of features are extracted through the local detail branch and the global semantic branch, respectively. At the same scale fusion position, the proposed Multi-Receptive Field Feature Complementary Aggregation Module MRFCA is introduced to align and complementarily aggregate the same scale output features of the two branches to obtain multi-scale backbone features. like Figure 3 The MRFCA module includes a channel alignment branch, a feature interaction branch, and a set of local-global attention enhancement branches; the channel alignment branch performs on features of the same scale from both the local detail branch and the global semantic branch. Convolutional mapping achieves channel consistency, and the feature interaction branch sums the two aligned features and groups them together. Convolution forms the basic fusion representation across branches; the local-global attention enhancement branch applies local and global attention to the two aligned features respectively to obtain contextual information under different receptive fields, and concatenates the local and global enhancement features along the channel dimension; subsequently, the MRFCA module aggregates the two attention enhancement features and interaction features, and performs feature integration and optimization through channel compression and reparameterized convolution to achieve complementary fusion across branches and receptive fields; through the above mechanism, MRFCA can dynamically preserve the fine-grained texture and edge cues of minor defects in the same-scale feature fusion stage, while using global context to suppress pseudo-responses caused by complex texture backgrounds, thereby enhancing the discriminability of weak contrast defects and small-scale defects.
[0021] Step S3: Feature Fusion. The multi-scale backbone features obtained in Step S2 are input into the Multi-Scale Collaborative Progressive Feature Fusion Neck Network (MSPFPN) for stepwise fusion and information completion, generating multi-scale fused features for head detection prediction; Step S4: Collaborative Training and Output of Detection Heads. The fused features obtained in Step S3 are input into the DetectAux detection module for defect classification and bounding box regression. During the training phase, an auxiliary detection head, AuxHead, is introduced to provide additional supervision signals, and a task-aligned sample allocation strategy is used to generate supervision labels of different granularities for the main detection head and the auxiliary detection head.
[0022] like Figure 4 The label allocation strategy for the auxiliary detection head includes a task-aligned sample allocator, a fine-grained label generation module, and a coarse-grained label generation module. To improve positive sample coverage and training stability while ensuring the main detection head's fine-grained learning is not interfered with by noisy samples, we use the task-aligned sample allocator to match and evaluate candidate samples, generating supervision signals of different granularities for both the main and auxiliary detection heads. The fine-grained label generation module uses stricter matching constraints to select a small number of high-quality positive samples for the main detection head's classification and regression learning. The coarse-grained label generation module obtains more positive samples by relaxing the matching constraints, providing denser gradient signals for the auxiliary detection head's supervision. During training, the main detection head calculates the loss based on the fine-grained labels, and the auxiliary detection head calculates the loss based on the coarse-grained labels, thus forming a collaborative supervision mechanism that enhances fine-grained learning coverage, reducing the risk of missed detections and improving the detection stability of small defects and weak-contrast defects.
[0023] Step S5: Model Training. The training set images are trained using steps S2, S3, and S4. The loss is calculated based on the ground truth annotations, and the network weight parameters are updated using an optimization algorithm until the model converges. Step S6: Output Results. Using the test set images as input, the converged defect detection model obtained from training is used to perform forward inference on the input steel defect images, generate prediction results, and output the defect category, location box, and confidence score of each defect target.
[0024] like Figure 2 As shown, the network structure of the method of the present invention consists of a backbone network EDDB, a neck network MSPFPN, and a DetectAux detection module. The backbone network is used for dynamic dual-branch feature extraction and combined with MRFCA to achieve multi-receptive field complementary aggregation. The neck network is used for multi-scale collaborative progressive feature fusion. The DetectAux detection module is used for collaborative supervised training of the main and auxiliary detection heads and inference output of the main detection head.
[0025] Experimental setup: During the training phase, a stochastic gradient descent (SGD) optimizer is used for parameter updates, and a cosine decaying learning rate scheduling strategy is employed; the total number of training iterations is 300; and the weight decay is set to... The momentum was set to 0.937; during training, the optimal model was saved based on the changes in the validation set metrics to obtain the optimal training convergence detection model for subsequent inference and evaluation.
[0026] Table 1. Quantitative comparison results of the method of the present invention with other methods.
[0027] The experimental results are shown in Table 1. Under the same experimental settings, the method of this invention achieves superior results in both detection accuracy and inference efficiency. In terms of overall accuracy, the mAP50 of this invention reaches 78.6, the highest in the table, 0.1% higher than the second-best, Deformable-DETR (78.5). For the more stringent AP50:95 criterion, this invention reaches 43.7%, also the highest in the table, 1.3 higher than the second-best, YOLOv11s, indicating stronger localization stability under multi-threshold evaluation. Regarding individual indicators, this invention achieves the best results in the table for Cr, In, and Sc: Cr is 49.7%, higher than the second-best, Mamba-YOLO; In is 85.7%, higher than the second-best, YOLOv11s; and Sc is 95.1%, higher than the second-best, Deformable-DETR, demonstrating that this invention has a more robust characterization and differentiation ability for different types of defects. Meanwhile, this invention maintains high performance in metrics such as Pa, Ps, and Rs, with Pa at 89.2%, Ps at 83.8%, and Rs at 67.6%, demonstrating balanced overall performance. Regarding model complexity and real-time performance, this invention has 5.9M parameters, 10.8G FLOPs of computation, and an inference speed of 135.2 FPS, achieving optimal accuracy while maintaining lightweight design. Compared to two-stage detection methods, Faster R-CNN has 41.3M parameters, 83.4G FLOPs, 11.6 FPS, and an mAP50 of 74.1%. This invention significantly reduces the number of parameters and computation while improving detection accuracy and speed. While Cascade-RCNN has higher Pa and Ps, it has 71.1M parameters and 271.8G FLOPs, resulting in a higher overall deployment cost. Compared with mainstream single-stage methods, YOLOv8s (11.1M, 28.4G, 105.8 FPS, mAP50 75.3%) and YOLOv10s (7.2M, 21.4G, 100.1 FPS, mAP50 75.8%) are inferior to this invention in both accuracy and complexity; RT-DETR-r18 has an mAP50 of only 72.0% at an FPS of 109.3. The above comparisons show that this invention can still provide higher detection accuracy and faster inference speed under limited computing power, thus making it more suitable for real-time applications of online steel surface defect detection on production lines.
[0028] Table 2 shows the ablation experimental results for each part of the model.
[0029] like Figure 5As shown, the method of this invention is compared with several mainstream steel surface defect detection methods, including YOLOv11s, YOLOv12s, Mamba-YOLO, and RT-DETR-r18. Visualization results of typical defect samples such as Cr, In, Pa, Ps, Rs, and Sc demonstrate that the method of this invention can stably detect defect targets under complex texture backgrounds and low contrast conditions. Leveraging the feature aggregation capability of the MRFCA module, the predicted bounding box achieves higher alignment with the defect region, resulting in more accurate localization. Furthermore, it exhibits stronger recall capability for small and slender defects, effectively reducing missed detections and false detections. A series of quantitative experiments show that this invention achieves superior results in accuracy metrics such as mAP50 and AP50:95, while maintaining lower overhead in efficiency metrics such as Params and GFLOPs, and possessing high FPS. This further verifies the advantage of this invention in balancing accuracy and efficiency in online steel surface defect detection scenarios.
[0030] The above are preferred embodiments of the present invention. Any changes made to the technical solution of the present invention that do not exceed the scope of the technical solution of the present invention shall fall within the protection scope of the present invention.
Claims
1. A method for detecting surface defects in steel based on dynamic bi-branch feature extraction and multi-scale collaborative progressive fusion, characterized in that, The method includes the following steps: Step S1, Data Preparation and Preprocessing: Obtain the steel surface image dataset, clean and label the dataset, and normalize the image size; use mosaic data augmentation combined with rotation, flipping, brightness adjustment and noise addition to expand the image to obtain the preprocessed image; divide the dataset into training set and test set according to a preset ratio of 8:2 for model training. Step S2, Feature Extraction: The preprocessed image is input into the dynamic dual-branch feature extraction backbone network. The local detail branch extracts the texture details and edge structure of the defects on the steel surface, and the global semantic branch extracts the contextual semantic information of the defect area. In the multi-level feature output stage of the backbone network, a multi-receptive field feature complementary aggregation module is used to align, interact and complementarily aggregate features from different levels and branches to obtain multi-scale backbone features. Step S3, Feature Fusion: The multi-scale backbone features are input into the multi-scale collaborative progressive feature fusion neck network MSPFPN. Through stepwise upsampling, downsampling and cross-layer interaction, progressive fusion and information completion of features at different scales are achieved to obtain fused features for detection. Step S4, Collaborative Training and Output of Detection Heads: The fused features are input into the DetectAux module, which includes the main detection head and the auxiliary training detection head. During the training phase, the auxiliary head collects intermediate layer features and multi-scale information, and enhances gradient transfer and feature learning in conjunction with the label allocation strategy. During the inference phase, only the main detection head outputs the category, location box, and confidence level of the steel surface defects. Step S5, Model Training: The constructed network model is trained based on the training set, and the network parameters are iteratively optimized using a composite loss function that includes classification loss and bounding box regression loss. Step S6, Result Output: Combine the weight file and the detection model to predict the test set, and output the defect category, location box and confidence score to achieve high-precision detection of defects with different sizes and inconspicuous contrast.
2. The method for detecting steel surface defects based on dynamic bi-branch feature extraction and multi-scale collaborative progressive fusion as described in claim 1, characterized in that, The data preparation and preprocessing described in step S1 includes the following steps: Step S11: Normalize the size of the original image and adjust it to the preset resolution. Furthermore, a composite augmentation was implemented using mosaic enhancement combined with geometric transformation, brightness adjustment, and noise addition to construct a highly robust training sample space and improve the model's ability to extract defect features in complex backgrounds. Step S12: Divide the training set and the test set into an 8:2 ratio, and perform stratified sampling based on the defect category label and geometric scale distribution to ensure that the statistical distribution of small defects and weak contrast defects in each set is consistent.
3. The method for detecting steel surface defects based on dynamic bi-branch feature extraction and multi-scale collaborative progressive fusion as described in claim 1, characterized in that, The multi-receptive-field feature complementary aggregation module performs the following operations: Step S21: Let the input features of the two branches be: in : These represent the input feature maps of the two branches, Indicates the real number field where the feature is located. These represent the height and width of the feature map, respectively. This indicates the number of channels in the input feature map; The MRFCA module first passes through Convolutional channel alignment yields features and : The two features are then summed and fused, and grouped. Convolution obtains interactive features: Step S22: For each and By applying local and global attention branches and concatenating them along the channel dimension, attention-enhanced features are obtained. and : Step S23: ... , and Perform aggregation and output fused features : in, Used to extract detailed neighborhood information Used for modeling long-distance context dependencies; The MRFCA module enables complementary fusion of cross-branch and cross-receptive field features to enhance the characterization of minute defects and low-contrast defects.
4. The method for detecting steel surface defects based on dynamic bi-branch feature extraction and multi-scale collaborative progressive fusion as described in claim 1, characterized in that, Step S3 specifically includes: Step S31: Using the multi-scale features output by the backbone network as input, construct a scale-adaptive bidirectional pyramid information flow. In the top-down path, prioritize strengthening the fine-grained defect cues at the high-resolution level, and in the bottom-up path, gradually complete the high-level semantics and inject the localization information. Step S32: Introduce a three-way feature alignment encoder (TFE) module at the cross-layer fusion node. Using the middle-layer features as the alignment reference, compress and align the high-layer features, upsample and align the low-layer features, and aggregate them at a unified scale. Step S33: Deploy lightweight operators in a differentiated manner during feature transfer, use the GSConv module to perform channel transformation in the normal path, and use the GSConvE module to enhance local modeling and channel interaction capabilities at key downsampling nodes; Step S34: Introduce the Scale Sequence Feature Fusion (SSFF) module at the output level to perform cross-scale consistency modeling on multi-scale features. Enhance the consistency response between outputs at different scales through collaborative interaction to generate the final fused feature representation for detection head prediction.
5. The method for detecting steel surface defects based on dynamic bi-branch feature extraction and multi-scale collaborative progressive fusion as described in claim 1, characterized in that, The collaborative training process of the DetectAux module in step S4 is as follows: Step S41: Establish a parallel supervision structure for LeadHead and AuxHead, and use the Task-Aligned Assigner to generate supervision signals of different granularities for the two detection heads. Step S42: The fine-grained label generation module is used to screen high-quality positive samples for the main detection head to enhance fine learning, while the coarse-grained label generation module with relaxed matching constraints provides denser gradient signals for the auxiliary detection head. Step S43: Remove the auxiliary detection head during the inference phase, and retain only the main detection head to output the defect category, location box, and confidence level.
6. The method for detecting steel surface defects based on dynamic bi-branch feature extraction and multi-scale collaborative progressive fusion as described in claim 1, characterized in that, The loss function optimization and training strategy in step S5 are as follows: Step S51: Jointly optimize network parameters using a composite loss function, wherein the loss function includes a combination of the binary cross-entropy loss of the classification branch and the complete IoU loss and distribution focus loss of the localization branch; Step S52: Calculate the loss of the main detection head respectively. With auxiliary detection head loss The total loss function is defined as: Step S53: During training, a learning rate scheduling strategy is adopted, combined with an early stopping mechanism to suppress model overfitting, until the network weight parameters converge.
7. The method for detecting steel surface defects based on dynamic bi-branch feature extraction and multi-scale collaborative progressive fusion according to claim 1, characterized in that, The result output and evaluation process described in step S6 are as follows: Step S61: Use the trained and converged detection model for forward inference on the test set images to generate prediction results and output the category label and localization information of each defect target; Step S62: Quantitatively evaluate the detection results using mAP50, AP50:95, Params, FPS, and GFLOPs to obtain the final detection effect feedback for steel surface defects.