A hot-rolled strip surface defect detection method for industrial applications

CN122289149APending Publication Date: 2026-06-26SHAANXI SCI TECH UNIV

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
SHAANXI SCI TECH UNIV
Filing Date
2026-03-13
Publication Date
2026-06-26

Smart Images

  • Figure CN122289149A_ABST
    Figure CN122289149A_ABST
Patent Text Reader

Abstract

This invention relates to a method for detecting surface defects in hot-rolled strip steel for industrial applications. First, an open-source defect dataset is acquired and preprocessed, and the model's runtime environment is configured. Second, the original target detection model structure is improved: a Hybrid Attention Fusion (HAF) module is embedded after the convolutional layers of the backbone feature extraction network to enhance non-local feature modeling capabilities; a Spatial Guided Downsampling (SGDown) module is designed to replace the traditional convolutional downsampling structure to reduce the loss of detailed information; and a Multi-Branch Fusion (MBF) module is constructed in the neck network to reduce the model's false negative rate. Then, the improved network model is trained and hyperparameters are optimized to obtain the optimal defect detection model. Finally, the trained model is deployed in a detection system for real-time detection of surface defects in hot-rolled strip steel. This invention reduces the computational complexity of the model while maintaining detection accuracy, and possesses good real-time performance and engineering application value.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of industrial visual inspection technology, specifically relating to a method for detecting surface defects in hot-rolled strip steel for industrial applications. Background Technology

[0002] Steel is a key foundation of modern industry, mainly used in transportation, heavy equipment, and other fields. During the rolling process, fluctuations in process parameters, equipment limitations, and environmental factors can easily lead to defects such as cracks, grooves, and indentations. These defects not only affect the appearance but also reduce performance and lifespan, and may even cause safety accidents.

[0003] Traditional manual visual inspection is intuitive, but it is inefficient, costly, and highly subjective, making it difficult to meet the demands of modern industrial intelligence. Subsequent methods such as eddy current detection, magnetic flux leakage detection, and infrared detection have failed to achieve widespread adoption due to their slow speed and low reliability. In recent years, computer vision has developed rapidly, and intelligent inspection has become a research hotspot. However, traditional machine learning methods rely on manual features, are easily affected by environmental changes, and have poor generalization ability.

[0004] With the development of industrial visual inspection technology, deep learning-based target detection methods are increasingly being applied to the field of steel surface defect detection. Deep learning methods, through end-to-end feature learning and defect localization mechanisms, can automatically extract high-level semantic features, exhibiting stronger robustness and higher detection accuracy compared to traditional image processing methods in complex industrial environments. Existing deep learning detection frameworks are mainly divided into two categories: two-stage detection methods and single-stage detection methods. Two-stage detection methods typically generate candidate regions first, then perform classification and regression, achieving high detection accuracy. However, due to their complex network structure and high computational cost, they struggle to meet the real-time requirements of industrial online inspection. Furthermore, these methods still suffer from insufficient feature representation for small targets when dealing with defects with large scale variations. Single-stage detection methods directly complete target localization and classification through end-to-end regression, offering advantages such as simple structure and fast detection speed, making them more suitable for real-time industrial inspection scenarios. Existing methods typically improve the ability to identify small targets and defects in complex backgrounds by refining the feature pyramid structure, enhancing multi-scale feature fusion, or optimizing the detection head structure. However, in the scenario of surface defect detection for hot-rolled strip steel, due to the diverse types and irregular shapes of defects, and the fact that some defects have non-local expansion characteristics or are highly similar to the background texture, existing methods still suffer from insufficient accuracy in non-local defect detection and micro-defect identification, while also exhibiting relatively high computational complexity. Furthermore, the downsampling convolutional structure commonly used in existing detection networks, while reducing feature map resolution, easily leads to the loss of crucial detail information, thereby weakening the model's ability to represent fine-grained defects and further affecting detection accuracy. Summary of the Invention

[0005] The purpose of this invention is to provide a method for detecting surface defects in hot-rolled strip steel for industrial applications, which solves the problems of low accuracy in detecting non-local defects, easy omission of small defects, and high computational complexity of models in existing hot-rolled strip steel surface defect detection methods.

[0006] To achieve the above objectives, the technical solution adopted by this invention is: a method for detecting surface defects in hot-rolled strip steel for industrial applications, specifically implemented according to the following steps: Step 1: Collect the open-source dataset NEU-DET and preprocess the data. Divide the preprocessed data into validation set, training set and test set. Finally, configure the model running environment. Step 2: Construct a surface defect detection model for hot-rolled strip steel; Step 3: First, use the dataset obtained in Step 1 to train the hot-rolled strip surface defect network model constructed in Step 2, and then use the test set and validation set to validate it until a trained hot-rolled strip surface defect detection model is obtained. Step 4: Use the hot-rolled strip surface defect detection model trained in Step 3 to perform real-time detection of surface defects in the hot-rolled strip.

[0007] As a preferred embodiment of the present invention, step 1 is specifically implemented according to the following steps: Step 1.1: Search for open-source datasets and preprocess the data, dividing the datasets into training, testing, and validation sets in an 8:1:1 ratio; Step 1.2: Configure the network runtime environment based on the PyTorch deep learning framework and set up the runtime environment for the YOLOv8n model; As a preferred embodiment of the present invention, step 2 is specifically implemented according to the following steps: Step 2.1: Design a Hybrid Attention Fusion Module (HAF) and embed it after each downsampling convolutional layer of the YOLOv8n backbone network to enhance the model's ability to model the features of nonlocal defects on the surface of hot-rolled strip steel. The attention fusion module HAF adopts a two-branch structure with spatial attention branch and channel attention branch. The spatial branch focuses on the input features. Figure X Multi-scale pooling is performed, and spatial weights Y' are generated through 1×1 convolution. After bilinear interpolation and upsampling, these weights are multiplied element-wise with the input features to obtain the spatially enhanced features. Subsequently, the weights are concatenated using global max pooling and global average pooling, and then spatial attention weights are generated through 7×7 convolution and sigmoid activation to obtain the spatial branch output. ; (1) (2) (3) In the formula: AvgPool is average pooling; Conv is 1×1 convolution; ReLU is the activation function; σ is the activation function; [ ;] indicates channel concatenation; Indicates multiplication; For bilinear interpolation; f ^(7×7) It is a 7×7 convolution; Max_Pool is max pooling; The channel attention branch performs global average pooling and global max pooling on the input feature map, and generates channel attention weights through a shared multilayer perceptron. And applied to the feature map to obtain channel enhancement features. Finally, the spatial and channel branch features are fused, processed by lightweight convolution, and connected to the input feature residuals to obtain the module output. (4) (5) (6) In the formula: GAP and GMP are global average pooling and global max pooling operations, respectively; Linear is a linear transformation layer; MLP is a multilayer perceptron; These are learnable residual weight coefficients. Through this structure, long-range dependencies of features are established with lower computational overhead, improving the detection accuracy and robustness of nonlocal defects such as cracks and oxide scale. Step 2.2: Construct a spatially guided downsampling module SGDown to replace the traditional convolutional downsampling module in the backbone feature extraction network; The spatially guided downsampling module includes a multi-branch downsampling structure, where Conv is a convolutional layer; SAConv is a switchable dilated convolution; AvgPool2d is a two-dimensional average pooling layer; MaxPool2d is a two-dimensional max pooling layer; Concat is a feature concatenation operation; and SGE is a spatial grouping enhancement module. The spatially guided downsampling module downsamples the input feature map using an average pooling strategy, reducing the spatial resolution of the feature map while aggregating neighborhood information and reducing computational cost. Then, it divides the channel dimension into two parallel branch structures, with each branch performing feature extraction while maintaining or partially sharing parameters, thus reducing parameter size while ensuring feature expressiveness. Finally, the output features of each branch are concatenated along the channel dimension, and the spatial grouping enhancement module generates the downsampled output feature map. Step 2.3: Introduce a switchable dilated convolution module SAConv into the spatial guided downsampling module to enhance the model's spatial perception of defects at different scales. The switchable dilated convolution module SAConv sets up parallel convolution branches with different dilation rates, extracting both local detail information and large-scale contextual information. It also uses a spatial adaptive switching mechanism to weight and fuse the outputs of each branch, achieving dynamic adjustment of the convolutional receptive field. Among them, the small dilation rate convolution branch is used to capture the edge and texture features of small defects, while the large dilation rate convolution branch is used to model the semantic contextual relationships around the defects. (7) In the formula: Conv(x, w, r) represents the convolution operation with weights W; r represents the hyperparameters of SAConv; Δw is the trainable weight; S(x) represents the switching function, which can adaptively adjust the switching strategy to cope with different data.

[0008] Step 2.4: Introduce a Spatial Grouping Enhancement (SGE) module into the Spatial Guided Downsampling (SBR) module to enhance the saliency of defect regions in the feature map after downsampling. The SGE module groups features along the channel dimension and establishes a correlation between global semantics and local features in the spatial dimension, generating spatial response weights to adaptively enhance the features. Through the above spatial grouping enhancement mechanism, the response of defect regions is strengthened and background redundancy information is suppressed, improving the discriminability and detection robustness of defect features against complex texture backgrounds. Step 2.5: Design a multi-branch fusion module (MBF) to replace part of the C2f structure in the YOLOv8n neck network, so as to enhance the multi-scale feature modeling capability and reduce the false negative rate; The multi-branch fusion module (MBF) sets up multiple parallel feature extraction branches, forming feature extraction paths with different receptive fields through convolutional kernels of different sizes; input x∈R ^(H×W×C) Where H, W, and C are the length, width, and number of channels of the feature map, respectively. The first branch performs channel reconstruction through a 1×1 convolution and combines global average pooling with a 1×1 convolution mapping to obtain the branch output feature F1. The second branch performs channel reconstruction through a 1×1 convolution, and then uses a Bottleneck structure and a 3×3 convolution to form a residual feature extraction unit to obtain the output F1. b The third branch undergoes channel reorganization via 1×1 convolution to obtain F2. The features of each branch are concatenated along the channel dimension and added element-wise with the input features after adjusting the number of channels via 1×1 convolution. Finally, the features are fused using depthwise separable convolution (DWConv) to obtain the module output features. (8) (9) (10) (11) In the formula: H and W represent the spatial dimensions of the feature map, respectively; The SiLU activation function; The multi-branch design of the multi-branch fusion module MBF optimizes the model's ability to process key information in the feature map. By gradually filtering out redundant information in the model, the false negative rate of the model is reduced.

[0009] As a preferred embodiment of the present invention, step 3 includes: Step 3.1: The experimental environment uses Windows 10 Professional operating system, Intel(R) Core(TM) i5-10200H CPU, Python version 3.8.12, CUDA version 11.6, NVIDIA GeForce RTX 3090 GPU, PyTorch version 1.10, and TensorFlow version 2.13.0; Step 3.2: Experimental parameter settings: batch size is set to 16, total number of rounds is 300, image size is set to 200×200, and initial learning rate is set to... =0.01, the parameters are optimized using the SGD function; Step 3.3: Adjust the hyperparameters of the hot-rolled strip surface defect detection model according to the indicators, return to step 3.2, and continue until the optimal weight is obtained; Step 3.4: Use the optimal weights to test the generalization ability of the hot-rolled strip surface defect detection model on the test set, verify the effectiveness and feasibility of the hot-rolled strip surface defect detection model, and obtain the trained hot-rolled strip surface defect detection model.

[0010] As a preferred embodiment of the present invention, step 4 is specifically implemented according to the following steps: Step 4.1: Set up the detection system, which includes a high-resolution camera, conveyor belt, ring light source and data processing unit; Step 4.2: Load the trained hot-rolled strip surface defect detection model into the real-time detection system; the model performs defect detection on the surface of hot-rolled strip based on the input image data, including the identification and location of six types of defects: cracks, pits, oxide scale, patches, inclusions and scratches. Step 4.3: Real-time detection results are displayed on the display terminal. The displayed results include the defect category, location, and confidence score. If the detected defects exceed the preset threshold, the system will automatically record them. All real-time detection results will be recorded and stored in the database for subsequent quality analysis and defect trend analysis.

[0011] The beneficial effects of this invention are as follows: The proposed method for detecting surface defects in hot-rolled strip steel for industrial applications enhances the modeling capabilities of feature maps in both spatial and channel dimensions by embedding a Hybrid Attention Fusion (HAF) module into the backbone feature extraction network. This improves the feature perception and detection accuracy for non-local defects such as cracks and oxide scale. Secondly, by designing a Spatial Guided Downsampling (SGDown) module to replace the traditional convolutional downsampling structure, more key details are retained while reducing feature map resolution, thus mitigating information loss during downsampling of minute defects. Finally, by constructing a Multi-Branch Fusion (MBF) module in the neck network to replace C2f, effective fusion of multiple receptive field features is achieved, reducing the false negative rate during defect detection. While ensuring detection accuracy, this invention effectively reduces the number of model parameters and computational complexity, meeting the real-time and robustness requirements of production lines, and improving the detection speed and false negative rate of minute defects, demonstrating significant engineering application value. Attached Figure Description

[0012] Figure 1 This is a flowchart of an embodiment of the present invention.

[0013] Figure 2 This is a structural diagram of the improved model in an embodiment of the present invention.

[0014] Figure 3 This is a schematic diagram of the HAF module structure in an embodiment of the present invention.

[0015] Figure 4 This is a comparison diagram of the structures of the ordinary downsampling and SGDown downsampling modules in the embodiments of the present invention.

[0016] Figure 5 This is a schematic diagram of the SAConv module structure in an embodiment of the present invention.

[0017] Figure 6 This is a schematic diagram of the SGE module structure in an embodiment of the present invention.

[0018] Figure 7 This is a schematic diagram of the MBF module structure in an embodiment of the present invention.

[0019] Figure 8 This is a comparison chart of the surface defect detection results of hot-rolled strip steel according to an embodiment of the present invention for industrial applications and the original YOLOv8n algorithm.

[0020] Figure 9 It is the YOLOv8n algorithm model P Schematic diagram of the R-curve; Figure 10 It is the improved YOLOv8n algorithm model P Schematic diagram of the R-curve; Figure 11 This is a schematic diagram of real-time detection in an embodiment of the present invention. Detailed Implementation

[0021] The technical solution of the present invention will be further described in detail below with reference to the accompanying drawings and specific embodiments.

[0022] like Figure 1 As shown in the figure, the present invention discloses a method for detecting surface defects in hot-rolled strip steel for industrial applications, which is implemented according to the following steps: Step 1.1: Search for open-source datasets and preprocess the data, dividing the datasets into training, testing, and validation sets in an 8:1:1 ratio; Step 1.2: Configure the network runtime environment based on the PyTorch deep learning framework and set up the runtime environment for the YOLOv8n model; Step 2: Based on the original YOLOv8n network structure, structural improvements are made to construct a network model for surface defect detection of hot-rolled strip steel. The overall framework structure is as follows: Figure 2 As shown. Specifically: Step 2.1: Design a Hybrid Attention Fusion (HAF) module and embed it after each downsampling convolutional layer of the YOLOv8n backbone network to enhance the model's ability to model the features of nonlocal defects on the surface of hot-rolled strip steel.

[0023] Hybrid Attention Fusion Module (HAF) structure as follows Figure 3 As shown, this module employs a dual-branch structure with spatial attention and channel attention branches. The spatial branch performs multi-scale pooling on the input feature map and generates spatial weights through 1×1 convolution. After upsampling, the spatially enhanced features are obtained by multiplying them element-wise with the input features. Subsequently, global max pooling and global average pooling are concatenated, and spatial attention weights are generated through 7×7 convolution and sigmoid activation to obtain the spatial branch output. .

[0024] (1) (2) (3) In the formula: AvgPool is average pooling; Conv is 1×1 convolution; ReLU is the activation function; σ is the activation function; [ ;] indicates channel concatenation; Indicates multiplication; For bilinear interpolation; f ^(7×7)It is a 7×7 convolution; Max_Pool is max pooling.

[0025] The channel attention branch performs global average pooling and global max pooling on the input feature map, and generates channel attention weights through a shared multilayer perceptron. And applied to the feature map to obtain channel enhancement features. Finally, the spatial and channel branch features are fused, processed by lightweight convolution, and connected to the input feature residuals to obtain the module output.

[0026] (4) (5) (6) In the formula: GAP and GMP are global average pooling and global max pooling operations, respectively; Linear is a linear transformation layer; MLP is a multilayer perceptron; These are learnable residual weight coefficients. Through this structure, long-range dependencies of features are established with lower computational overhead, improving the detection accuracy and robustness of nonlocal defects such as cracks and oxide scale.

[0027] Step 2.2: Construct a Spatial-Guided Downsampling Module (SGDown) to replace the traditional convolutional downsampling module in the backbone feature extraction network. The module structure is as follows: Figure 4 As shown, this module includes a multi-branch downsampling structure, where Conv is a convolutional layer; SAConv is a switchable dilated convolution; AvgPool2d is a two-dimensional average pooling layer; MaxPool2d is a two-dimensional max pooling layer; Concat is a feature concatenation operation; and SGE is a spatial grouping enhancement module. This module downsamples the input feature map using an average pooling strategy, reducing the spatial resolution of the feature map while aggregating neighborhood information and reducing computational cost. Then, the channel dimension is divided into two parallel branch structures. Each branch performs feature extraction independently while maintaining or partially sharing parameters, ensuring feature expressiveness while reducing parameter size. Finally, the output features of each branch are concatenated along the channel dimension, and the downsampled output feature map is generated through the spatial grouping enhancement module.

[0028] Step 2.3: Introduce the switchable dilated convolution module SAConv into SGDown to enhance the model's spatial awareness of defects at different scales, such as... Figure 5As shown, this module sets up parallel convolutional branches with different dilation rates, simultaneously extracting local detail information and large-scale contextual information. It also uses a spatial adaptive switching mechanism to weightedly fuse the outputs of each branch, achieving dynamic adjustment of the convolutional receptive field. Specifically, the small dilation rate convolutional branch is used to capture the edge and texture features of minute defects, while the large dilation rate convolutional branch is used to model the semantic contextual relationships around the defects.

[0029] (7) In the formula: Conv(x, w, r) represents the convolution operation with weights W; r represents the hyperparameters of SAConv; For trainable weights; S(x) represents the switching function, which can adaptively adjust the switching strategy to cope with different data.

[0030] Step 2.4: Introduce the Spatial Grouping Enhancement (SGE) module into SGDown to improve the saliency representation of defect regions in the feature map after downsampling. The module structure is as follows: Figure 6 As shown, this module groups features along the channel dimension and establishes a correlation between global semantics and local features in the spatial dimension, generating spatial response weights to adaptively enhance the features. Through the above spatial grouping enhancement mechanism, the response of defect regions is strengthened and background redundancy information is suppressed, improving the discriminability and detection robustness of defect features against complex texture backgrounds.

[0031] Step 2.5: Design a multi-branch fusion module (MBF) to replace part of the C2f structure in the YOLOv8n neck network, thereby enhancing multi-scale feature modeling capabilities and reducing the false negative rate. The module structure is as follows: Figure 7 As shown in the diagram, this module sets up multiple parallel feature extraction branches, forming feature extraction paths with different receptive fields through convolutional kernels of different sizes. Input Here, H, W, and C represent the length, width, and number of channels of the feature map, respectively. The first branch performs channel reconstruction through a 1×1 convolution and combines global average pooling with a 1×1 convolution mapping to obtain the branch output feature F1. The second branch performs channel reconstruction through a 1×1 convolution, and then uses a Bottleneck structure with a 3×3 convolution to form a residual feature extraction unit to obtain the output. The third branch is obtained by channel recombination through 1×1 convolution. The features of each branch are concatenated along the channel dimension and added element-wise to the input features after adjusting the number of channels via 1×1 convolution. Finally, the features are fused using depthwise separable convolution (DWConv) to obtain the module output features.

[0032] (8) (9) (10) (11) In the formula: H and W represent the spatial dimensions of the feature map, respectively; This is the SiLU activation function.

[0033] The multi-branch design optimizes the model's ability to process key information in the feature map, and reduces the model's false negative rate by gradually filtering out redundant information.

[0034] Step 3: Use the training set to train the constructed hot-rolled strip surface defect detection model and adjust the hyperparameters to obtain the trained defect detection model, specifically: Step 3.1: The experimental environment uses Windows 10 Professional operating system, Intel(R) Core(TM) i5-10200H CPU, Python version 3.8.12, CUDA version 11.6, NVIDIA GeForce RTX 3090 GPU, PyTorch version 1.10, and TensorFlow version 2.13.0.

[0035] Step 3.2: Experimental parameter settings: batch size is set to 16, total number of rounds is 300, image size is set to 200×200, and initial learning rate is set to... =0.01, the parameters are optimized using the SGD function.

[0036] Step 3.3: Adjust the hyperparameters of the hot-rolled strip surface defect detection model according to the indicators, and return to Step 3.2 until the optimal weights are obtained. The PR curves before and after training are shown below. Figure 8 and Figure 9 As shown.

[0037] Step 3.4: Use the optimal weights to test the generalization ability of the hot-rolled strip surface defect detection model on the test set, verify the effectiveness and feasibility of the hot-rolled strip surface defect detection model, and obtain the trained hot-rolled strip surface defect detection model. The detection results are shown in Figure 10.

[0038] Step 4. Use the trained hot-rolled strip surface defect detection model to perform real-time detection of defects on the surface of the hot-rolled strip. Specifically: Step 4.1: Construct the detection system, which includes a high-resolution camera, conveyor belt, ring light source, and data processing unit. For example... Figure 11 As shown.

[0039] Step 4.2: Load the trained hot-rolled strip surface defect detection model into the real-time detection system. The model performs defect detection on the surface of hot-rolled strip based on input image data, including the identification and location of six types of defects: cracks, pitting, oxide scale, patches, inclusions, and scratches.

[0040] Step 4.3: Real-time detection results are displayed on a terminal, including the defect category, location, and confidence score. If the detected defects exceed a preset threshold, the system will automatically record the result. All real-time detection results will be recorded and stored in a database for subsequent defect analysis.

Claims

1. A method for detecting surface defects in hot-rolled strip steel for industrial applications, characterized in that, The specific steps are as follows: Step 1: Collect the open-source dataset NEU-DET and preprocess the data. Divide the preprocessed data into training set, test set and validation set. Finally, configure the model running environment. Step 2: Construct a surface defect detection model for hot-rolled strip steel; Step 3: First, use the training set obtained in Step 1 to train the hot-rolled strip surface defect network model constructed in Step 2, and then use the test set and validation set to validate it until a trained hot-rolled strip surface defect detection model is obtained. Step 4: Use the hot-rolled strip surface defect detection model trained in Step 3 to detect defects on the surface of the hot-rolled strip in real time.

2. The method for detecting surface defects in hot-rolled strip steel for industrial applications according to claim 1, characterized in that, Step 1 is implemented in the following steps: Step 1.1: Search for open-source datasets and preprocess the data, dividing the datasets into training, testing, and validation sets in an 8:1:1 ratio; Step 1.2: Configure the network runtime environment based on the PyTorch deep learning framework and set up the runtime environment for the YOLOv8n model.

3. The method for detecting surface defects in hot-rolled strip steel for industrial applications according to claim 2, characterized in that, Step 2 is implemented in the following steps: Step 2.1: Design a Hybrid Attention Fusion Module (HAF) and embed it after each downsampling convolutional layer of the YOLOv8n backbone network to enhance the model's ability to model the features of nonlocal defects on the surface of hot-rolled strip steel. The attention fusion module HAF adopts a dual-branch structure of spatial attention branch and channel attention branch; the spatial branch performs multi-scale pooling on the input feature map and generates spatial weights Y' through 1×1 convolution, which are then upsampled and multiplied element-wise with the input features to obtain the spatial enhanced features. Subsequently, global max pooling and global average pooling are concatenated, and spatial attention weights are generated through 7×7 convolution and sigmoid activation to obtain the spatial branch output. ; (1) (2) (3) In the formula: AvgPool is average pooling; Conv is 1×1 convolution; ReLU is the activation function; σ is the activation function; [ ; ] indicates channel concatenation; Indicates multiplication; For bilinear interpolation; f ^(7×7) It is a 7×7 convolution; Max_Pool is max pooling; The channel attention branch performs global average pooling and global max pooling on the input feature map, and generates channel attention weights through a shared multilayer perceptron. And applied to the feature map to obtain channel enhancement features. Finally, the spatial and channel branch features are fused, processed by lightweight convolution, and connected to the input feature residuals to obtain the module output; (4) (5) (6) In the formula: GAP and GMP are global average pooling and global max pooling operations, respectively; Linear is a linear transformation layer; MLP is a multilayer perceptron; These are learnable residual weight coefficients. Through the above structure, long-range dependencies of features are established with lower computational overhead, improving the detection accuracy and robustness of nonlocal defects such as cracks and oxide scale. Step 2.2: Construct a spatially guided downsampling module SGDown to replace the traditional convolutional downsampling module in the backbone feature extraction network; The spatially guided downsampling module includes a multi-branch downsampling structure, where Conv is a convolutional layer; SAConv is a switchable dilated convolution; AvgPool2d is a two-dimensional average pooling layer; MaxPool2d is a two-dimensional max pooling layer; Concat is a feature concatenation operation; and SGE is a spatial grouping enhancement module. The spatially guided downsampling module downsamples the input feature map using an average pooling strategy, reducing the spatial resolution of the feature map while aggregating neighborhood information and reducing computational cost. Subsequently, the channel dimension is divided into two parallel branches, each extracting features separately while maintaining or partially sharing parameters, thus reducing parameter size while ensuring feature expressiveness. Finally, the output features of each branch are concatenated along the channel dimension, and the downsampled output feature map is generated through the spatial grouping enhancement module. Step 2.3: Introduce a switchable dilated convolution module SAConv into the spatial guided downsampling module to enhance the model's spatial perception of defects at different scales. The switchable dilated convolution module SAConv sets up parallel convolution branches with different dilation rates, extracting both local detail information and large-scale contextual information. It also uses a spatial adaptive switching mechanism to weight and fuse the outputs of each branch, achieving dynamic adjustment of the convolutional receptive field. Among them, the small dilation rate convolution branch is used to capture the edge and texture features of small defects, while the large dilation rate convolution branch is used to model the semantic contextual relationships around the defects. (7) In the formula: Conv(x, w, r) represents the convolution operation with weights W; r represents the hyperparameters of SAConv; Δw is the trainable weight; S(x) represents the switching function, which can adaptively adjust the switching strategy to cope with different data; Step 2.4: Introduce a Spatial Grouping Enhancement (SGE) module into the Spatial Guided Downsampling (SBR) module to enhance the saliency of defect regions in the feature map after downsampling. The SGE module groups features along the channel dimension and establishes a correlation between global semantics and local features in the spatial dimension, generating spatial response weights to adaptively enhance the features. Through the above spatial grouping enhancement mechanism, the response of defect regions is strengthened and background redundancy information is suppressed, improving the discriminability and detection robustness of defect features against complex texture backgrounds. Step 2.5: Design a multi-branch fusion module (MBF) to replace part of the C2f structure in the YOLOv8n neck network, so as to enhance the multi-scale feature modeling capability and reduce the false negative rate; The multi-branch fusion module (MBF) sets up multiple parallel feature extraction branches, forming feature extraction paths with different receptive fields through convolutional kernels of different sizes; input x∈R ^(H×W×C) Where H, W, and C are the length, width, and number of channels of the feature map, respectively; the first branch performs channel recombination through 1×1 convolution and combines global average pooling with 1×1 convolution mapping to obtain the branch output feature F1; the second branch performs channel recombination through 1×1 convolution, and then uses a Bottleneck structure and 3×3 convolution to form a residual feature extraction unit to obtain the output F. b The third branch undergoes channel recombination via 1×1 convolution to obtain F2; the features of each branch are concatenated along the channel dimension and added element-wise with the input features after adjusting the number of channels via 1×1 convolution. Finally, the features are fused using depthwise separable convolution (DWConv) to obtain the module output features. (8) (9) (10) (11) In the formula: H and W represent the spatial dimensions of the feature map, respectively; The SiLU activation function; The multi-branch design of the multi-branch fusion module MBF optimizes the model's ability to process key information in the feature map. By gradually filtering out redundant information in the model, the false negative rate of the model is reduced.

4. The method for detecting surface defects in hot-rolled strip steel for industrial applications according to claim 3, characterized in that, Step 3 includes: Step 3.1: The experimental environment uses Windows 10 Professional operating system, Intel(R) Core(TM) i5-10200H CPU, Python version 3.8.12, CUDA version 11.6, NVIDIA GeForce RTX 3090 GPU, PyTorch version 1.10, and TensorFlow version 2.13.0; Step 3.2: Experimental parameter settings: batch size is set to 16, total number of rounds is 300, image size is set to 200×200, and initial learning rate is set to... =0.01, the parameters are optimized using the SGD function; Step 3.3: Adjust the hyperparameters of the hot-rolled strip surface defect model according to the indicators, return to step 3.2, and continue until the optimal weight is obtained; Step 3.4: Use the optimal weights to test the generalization ability of the hot-rolled strip surface defect detection model on the test set, verify the effectiveness and feasibility of the hot-rolled strip surface defect detection model, and obtain the trained hot-rolled strip surface defect model.

5. The method for detecting surface defects in hot-rolled strip steel for industrial applications according to claim 4, characterized in that, Step 4 is implemented in the following steps: Step 4.1: Set up the detection system, which includes a high-resolution camera, conveyor belt, ring light source and data processing unit; Step 4.2: Load the trained hot-rolled strip surface defect detection model into the real-time detection system; the model performs defect detection on the surface of hot-rolled strip based on the input image data, including the identification and location of six types of defects: cracks, pits, oxide scale, patches, inclusions and scratches. Step 4.3: Real-time detection results are displayed on a display terminal. The displayed results include the defect category, location, and confidence score. If the detected defects exceed a preset threshold, the system will automatically record them. All real-time detection results will be recorded and stored in the database for subsequent quality analysis and defect trend analysis.