Hot-rolled strip steel surface defect detection method based on LDSNet network
By adopting a detection method based on LDSNet network in the detection of surface defects of hot-rolled strip, combined with wavelet convolution and other enhancement modules, the problems of low detection efficiency and insufficient accuracy in the prior art are solved, real-time and accurate detection of surface defects of hot-rolled strip are achieved, and the detection speed and accuracy are significantly improved.
Patent Information
- Application Number
- CN202510242700.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-03
- Publication Date
- 2025-04-15
AI Technical Summary
In actual production, how to conduct real-time and accurate detection of surface defects of hot-rolled strip steel, the existing technology has problems such as low detection efficiency, dependence on experience, endangering workers' health, and difficulty in real-time detection.
The surface defect detection method of hot-rolled strip steel based on LDSNet network is adopted, and the wavelet convolution Ldswt module is designed through the YOLOv5 object detection framework, and the Bottleneck layer of the C3 module is replaced to form the LdswtC3 module, and combined with the GSConvns, WaveletUnPool, ScalSeq and SEAttention modules are enhanced to enhance the feature extraction and fusion capabilities of the network.
Real-time accurate detection of surface defects of hot-rolled strip steel is achieved, with a detection speed of 80FPS and a mAP of 81.7%, which is better than all strip steel surface defect detection models at this stage.
Smart Images

Figure CN119831981A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of steel surface defect detection, and in particular to a hot-rolled strip surface defect detection method based on an LDSNet network. Background Art
[0002] Hot-rolled steel strip is an important product in the steel industry and is widely used in the automotive industry, machinery manufacturing, aerospace and other fields. However, in the production process of hot-rolled steel strip, various defects such as cracks, pressed scale, pitting, plaques, inclusions, scratches, etc. are generated on the surface of the hot-rolled steel strip due to the influence of materials, environment, and process. These defects not only affect the appearance of the steel strip surface, but also may reduce the performance of the steel strip and cause danger in the subsequent use process. Therefore, in the production process, it is crucial to quickly and accurately point out the surface defects of the steel strip to improve production efficiency and product performance.
[0003] Traditional methods for detecting surface defects of hot-rolled strip include manual detection, infrared detection, eddy current detection, laser scanning detection, etc. These traditional detection methods have problems such as low detection efficiency, reliance on experience, harm to workers' health, and difficulty in achieving real-time detection. In recent years, with the development of artificial intelligence technology, image recognition algorithms based on deep learning have gradually emerged. Using industrial cameras to scan products in real time and then inputting models for detection has not only greatly improved the efficiency and quality of detection, but also reduced the production costs of enterprises and reduced the labor intensity of workers. It has broad application prospects.
[0004] With the application of image algorithms, target detection technology is also constantly developing. The detection model needs to take into account accuracy while also having the ability of real-time detection and the ability to adapt to the harsh working environment of the factory. At present, the two-stage detection algorithm performs very well in terms of accuracy, but because its reasoning process requires a lot of calculations, it is difficult to meet the real-time requirements of actual production; while the single-stage algorithm meets the speed requirements but has the disadvantage of insufficient detection accuracy. Therefore, in order to take into account the real-time and accuracy of the detection algorithm. To this end, the present invention proposes a hot-rolled strip surface defect detection method based on the LDSNet network. Summary of the invention
[0005] The technical problem to be solved by the present invention is how to accurately detect the surface defects of hot-rolled strip in real time in actual production, and provides a hot-rolled strip surface defect detection method based on the LDSNet network.
[0006] The present invention solves the above technical problems through the following technical solutions, and the present invention comprises the following steps:
[0007] S1: Data preprocessing
[0008] Collecting samples from a data set of surface defects of steel strips and preprocessing the samples;
[0009] S2: Network construction
[0010] Based on the YOLOv5 target detection framework, the LdswtC3 module is designed and introduced. The GSConvns module is used to downsample the features, the WaveletUnPool module is used to upsample, the ScalSeq module is introduced to improve the fusion method of the neck network, and the SEAttention module is used to enhance the features input to the detection head network, thereby obtaining the LDSNet network.
[0011] S3: Model training
[0012] The LDSNet network is trained using the training set to obtain a steel surface defect detection model;
[0013] S4: Defect Identification
[0014] Test the steel surface defect detection model on the test set and output the defect detection results and detection speed.
[0015] Furthermore, in step S1, the specific processing process is as follows:
[0016] S11: obtaining data samples from a hot-rolled strip surface defect data set, and dividing the obtained data samples into a training set and a test set according to a set ratio;
[0017] S12: Perform mosaic data enhancement on the images in the training set and fill the processed image size to the set size.
[0018] Furthermore, in step S2, the specific processing process is as follows:
[0019] S21: Based on the YOLOv5 target detection framework, the Ldswt module of wavelet convolution is designed and replaced with the Bottleneck layer of the C3 module to form the LdswtC3 module;
[0020] S22: Downsample the features using the GSConvns module;
[0021] S23: Upsample the features using the WaveletUnPool module;
[0022] S24: Introduce the ScalSeq module to improve the fusion method of the neck network;
[0023] S25: Use the SEAttention module to enhance the features input to the detection head network.
[0024] Furthermore, in the Ldswt module of step S21, the input feature is convolved by 1×1 convolution to convert the input channel into half of the output channel; the result is input into the wavelet convolution, the convolution kernel size is 5 in the backbone network and the convolution kernel size is 3 in the neck network; and then a 1×1 convolution is performed to convert the number of output feature channels into the number of output channels, and the processing formula is as follows:
[0025] F(x)=Conv 1×1 (WTConv2d k×k (Conv 1×1 (x)));
[0026] Replace the Bottleneck layer of the C3 module with the Ldswt module, and finally obtain the LdswtC3 module.
[0027] Furthermore, in the GSConvns module of step S22, the input features are first downsampled through a common convolution layer with a convolution kernel size of k and a step size of s, and then the output results are input into a depth-separable convolution layer with a convolution kernel size of 5 and a step size of 1. The two parts of the output results are concatenated, and finally a 1×1 common convolution layer is used to shuffle the channels. The processing formula is as follows:
[0028] x1=Conv(x)
[0029] x2=DWConv(x1).
[0030] F(x)=Conv(Concat(x1,x2))
[0031] Furthermore, in the WaveletUnPool module of step S23, the specific processing process is as follows:
[0032] S231: Order W L and W H Represent the low-pass and high-pass wavelet kernel weights respectively. According to the nature of wavelet changes, W L and W H The constraints should be met:
[0033]
[0034] Where K represents a one-dimensional kernel of size K = |K|;
[0035] S232: Then use W L and W H Perform two horizontal pooling and two vertical pooling operations. Horizontal pooling decomposes the image into low-frequency signals along the X direction. and high frequency signals Assuming there is an input feature map with C channels, after horizontal pooling, the resulting feature map has 2C channels along the X direction, which is half the size;
[0036] S232: Continue to perform two vertical pooling operations on the low-frequency signal and the high-frequency signal respectively, and obtain
[0037] Furthermore, in the ScalSeq module of step S24, the three different layers P3, P4, and P5 output by the Backbone of the YOLOv5 target detection framework are subjected to channel transformation through 1×1 convolution, and the feature channels of the three scales are unified into the required output channels. Then, the sizes of the features of the P4 layer and the P5 layer are adjusted to the same size as the P3 layer through the interpolate method, and the new features are processed by the unsqueeze method for dimension increase, and spliced on the new dimension. The processed features are processed by using a 3D convolution layer, a 3D batch normalization layer, and a SiLU activation function, and the processed features are reduced in dimension to become a new P3 layer that integrates the information of the P4 layer and the P5 layer, which is added to the original P3 layer and input into the detection head network; in the fusion process of the P4 layer in the downsampling stage, not only the P4 layer output by the original Backbone is integrated, but also the P4 layer information in the upsampling process is integrated; when processing the P5 layer, the P4 layer in the upsampling process is added for downsampling fusion.
[0038] Furthermore, in step S25, before the feature is input into the detection head network, the SEAttention module is used to perform global pooling processing on the input feature, and then processed through two fully connected layers to obtain channel weights, and the weights are multiplied by the original feature map to obtain weighted features.
[0039] Furthermore, in step S3, the specific processing process is as follows:
[0040] S31: Set model training parameters, set epochs to 500, select SGD as the optimizer, and set the initial learning rate to 0.01;
[0041] S32: Input the training set into the network for training. After the training is completed, save the weight parameters to obtain a steel surface defect target detection model.
[0042] Furthermore, in step S4, the specific processing process is as follows:
[0043] S41: input the test set into the steel surface defect target detection model, and perform non-maximum suppression processing on the original output of the model;
[0044] S42: Output the defect detection result and detection speed of the model.
[0045] Compared with the prior art, the present invention has the following advantages: the hot-rolled strip surface defect detection method based on the LDSNet network is based on the YOLOv5 target detection framework, and a feature extraction module Ldswt based on wavelet convolution is designed, and the Bottleneck layer of the C3 module is replaced by it to form the LdswtC3 module, which enhances the feature extraction and feature fusion capabilities of the network; in the downsampling operation, the GSConvns module is used to replace the ordinary convolution, which can not only reduce the parameter amount and the calculation amount, but also further extract and enhance the features; in the neck network, the original features of each output layer of P3, P4, and P5 are fused, which significantly enhances the model's detection ability for small targets; before the features are input to the detection head network, an attention module is passed, which significantly enhances the performance of the model without significantly increasing the calculation amount and the parameter amount. The strip surface defect detection model designed by the present invention achieves 81.7% mAP on the NEU-DET data set, and its detection speed reaches 80FPS on RTX3090, and its detection performance is better than all strip surface defect detection models at this stage. BRIEF DESCRIPTION OF THE DRAWINGS
[0046] Figure 1 It is a flow chart of a method for detecting surface defects of hot-rolled strip steel based on LDSNet in an embodiment of the present invention (the inventor is requested to make adaptive changes to the steps in the figure according to the modified steps);
[0047] Figure 2 1 is a typical surface defect image sample in the NEU-DET database in an embodiment of the present invention, where (a) is a crack, (b) is an inclusion, (c) is a plaque, (d) is a pitted surface, (e) is a rolling scale, and (f) is a scratch;
[0048] Figure 3 Schematic diagram of the relevant structure of the LdswtC3 module in an embodiment of the present invention, wherein (a) is the Ldswt module, and (b) is the LdswtC3 module;
[0049] Figure 4 is a schematic diagram of the structure of the GSConvns module in an embodiment of the present invention;
[0050] Figure 5 is a schematic diagram of the structure of the ScalSeq module in an embodiment of the present invention;
[0051] Figure 6 is a schematic diagram of the structure of the SEAttention module in an embodiment of the present invention;
[0052] Figure 7 It is a schematic diagram of the structure of the LDSNet network in an embodiment of the present invention;
[0053] Figure 8 1 is a diagram showing the detection effect of the surface defect images of hot-rolled strip in the embodiment of the present invention, wherein (a) is a crack, (b) is an inclusion, (c) is a plaque, (d) is a pitted surface, (e) is a rolling scale, and (f) is a scratch. DETAILED DESCRIPTION
[0054] The following is a detailed description of an embodiment of the present invention. This embodiment is implemented on the premise of the technical solution of the present invention, and a detailed implementation method and a specific operation process are given, but the protection scope of the present invention is not limited to the following embodiment.
[0055] like Figures 1 to 8 As shown, this embodiment provides a technical solution: a method for detecting surface defects of hot-rolled strip steel based on LDSNet network to identify and locate surface defects of hot-rolled strip steel, comprising the following steps:
[0056] S1: Collect samples from the data set of strip surface defects and pre-process the samples;
[0057] S2: Based on the YOLOv5 target detection framework, a feature extraction module LdswtC3 is designed that integrates wavelet convolution and C3 modules. The GSConvns module is used to downsample the features, and the learnable discrete wavelet pooling module WaveletUnPool is used to upsample. The fusion method of the neck network is improved (the ScalSeq module is introduced). At the same time, the attention module SEAttention is used to enhance the features input to the detection head network, thereby obtaining the LDSNet network.
[0058] S3: Use the training set to train the LDSNet network to obtain a steel surface defect detection model;
[0059] S4: Test the steel surface defect detection model on the test set and output the defect detection results and detection speed.
[0060] In this embodiment, the specific processing process of step S1 is as follows:
[0061] S11: obtaining data samples from a hot-rolled strip surface defect dataset, and dividing the obtained data samples into a training set and a test set in a ratio of 8:2;
[0062] S12: Perform mosaic data augmentation on the images in the training set and pad the processed image size to 320×320.
[0063] In this embodiment, the specific processing process of step S2 is as follows:
[0064] S21: Based on the YOLOv5 target detection framework, a wavelet convolution information fusion module (Ldswt module) is designed, and it replaces the Bottleneck layer of the C3 module to form the LdswtC3 module;
[0065] S22: Downsample the features using the GSConvns module;
[0066] S23: Upsample the features using the learnable discrete wavelet pooling (WaveletUnPool) module;
[0067] S24: Introduce the ScalSeq module to improve the fusion method of the neck network;
[0068] S25: Use the attention module (SEAttention module) to enhance the features input to the detection head network.
[0069] In this embodiment, in step S21, in the Ldswt module, the input feature is convolved by 1×1 convolution to convert the input channel into half of the output channel; the result is input into the wavelet convolution (WTConv2d), the convolution kernel size is 5 in the backbone network and the convolution kernel size is 3 in the neck network; and then a 1×1 convolution is performed to convert the number of output feature channels into the number of output channels, and the processing formula is as follows:
[0070] F(x)=Conv 1×1 (WTConv2d k×k (Conv 1×1 (x)));
[0071] Replace the Bottleneck layer of the C3 module with the Ldswt module, and finally get the LdswtC3 module, such as Figure 3 shown.
[0072] In this embodiment, in step S22, as Figure 4 As shown in the figure, in the GSConvns module, the input features are first downsampled through a common convolution layer (Conv) with a convolution kernel size of k and a step size of s, and then the output results are input into a depth-separable convolution layer (DWConv) with a convolution kernel size of 5 and a step size of 1. The two parts of the output results are concatenated (Concat), and finally a 1×1 common convolution layer is used to shuffle the channels. The processing formula is as follows:
[0073] x1=Conv(x)
[0074] x2=DWConv(x1).
[0075] F(x)=Conv(Concat(x1,x2))
[0076] In this embodiment, in step S23, the implementation process of upsampling the features using the learnable discrete wavelet pooling (WaveletUnPool) module is as follows:
[0077] Let W L and W H Represent the low-pass and high-pass wavelet kernel weights respectively. According to the nature of wavelet changes, W L and W H The constraints should be met:
[0078]
[0079] Where K represents a one-dimensional kernel of size K = |K|;
[0080] Then use W L and W H Perform two horizontal pooling and two vertical pooling operations. Horizontal pooling decomposes the image into low-frequency signals along the X direction. and high frequency signals Assuming there is an input feature map with C channels, after horizontal pooling, the resulting feature map has 2C channels along the X direction, which is half the size;
[0081] Then continue to perform two vertical pooling operations on the low-frequency signal and the high-frequency signal respectively, and obtain The present invention uses Harr wavelet to design signal decomposition, that is: W L ={0.5,0.5} and W H ={0.5,-0.5}. Using the reversible change of wavelet transformation, the input features are transformed into groups of 4 channels for inverse wavelet transformation. Through two high-pass and low-pass filtering, the number of original feature channels is reduced to 1 / 4, and the height and width of the feature map size are twice the original size.
[0082] In this embodiment, in step S24, if Figure 5 As shown in the figure, the implementation process of introducing the ScalSeq module to improve the fusion method of the neck network is as follows:
[0083] In the FPN structure of the YOLOv5 target detection framework, before the P3 layer is input into the detection head network, the multi-scale fusion of feature information of the P3 layer is performed, which is mainly achieved by using the ScalSeq module in the ASF-YOLO network. The ScalSeq module transforms the channels of the three different feature layers P3, P4, and P5 output by the Backbone of the YOLOv5 target detection framework through 1×1 convolution, unifies the feature channels of the three scales into the required output channels, and then adjusts the size of the P4 and P5 layer features to the same size as the P3 layer through the interpolate method, and unsqu The eeze method performs dimensionality-upgrading on the new features and concatenates them on the new dimension. It uses 3D convolutional layers, 3D batch normalization layers, and SiLU activation functions to reduce the dimensions of the processed features into a new P3 layer that integrates the information of the P4 and P5 layers, which is added to the original P3 layer and input into the detection head network. In the fusion process of the P4 layer at the downsampling stage, not only the P4 layer output by the original Backbone is fused, but also the P4 layer information in the upsampling process is fused to enhance the information of the P4 layer. When processing the P5 layer, the P4 layer in the upsampling process is added for downsampling fusion to enhance the model's sensitivity to the P5 layer information.
[0084] In this embodiment, in step S25, Figure 6 As shown in the figure, before the features are input to the detection head network, adding an attention mechanism can improve the model performance. The SEAttention module used first performs global pooling on the input features, and then processes them through two fully connected layers to obtain channel weights. The weights are multiplied by the original feature map to obtain the weighted features. The process is simple and effective.
[0085] In this embodiment, in step S3, the specific processing process is as follows:
[0086] S31: Set the model training parameters, set the epochs to 500, select SGD as the optimizer, and set the initial learning rate to 0.01.
[0087] S32: Input the training set into the network for training. After the training is completed, save the weight parameters to obtain a steel surface defect target detection model.
[0088] In this embodiment, in step S4, the specific processing process is as follows:
[0089] S41: Input the test set into the steel surface defect target detection model, and perform non-maximum suppression (NMS) processing on the original output of the model to remove redundant detection frames and improve the accuracy of the detection results;
[0090] S42: Output the defect detection result and detection speed of the model.
[0091] In this embodiment, in step S1, the database is a hot-rolled steel strip surface defect database, in which images of six typical surface defects on the hot-rolled steel strip surface and the position coordinate information of the defects in each image are obtained, such as Figure 2 As shown in the figure, the six typical surface defects are cracks, inclusions, patches, pitted surface, rolling scale and scratches.
[0092] The LDSNet network structure in this embodiment is as follows Figure 7 As shown, it includes a backbone network, a neck network and a detection head network.
[0093] In this embodiment, all C3 modules in the backbone network are replaced by LdswtC3 modules. The required convolution kernel size in the LdswtC3 module is set to 5. All ordinary convolutions are replaced by GSConvns modules. The first GSConvns convolution kernel size is 6, the step size is 2, and the padding size is 2. The remaining GSConvns convolution kernel sizes are 3 and the step size is 2.
[0094] The neck network includes a first 1×1GSConvns module, a first WaveletUnPool module, a first splicing module, a first LdswtC3 module, a second 1×1GSConvns module, a second WaveletUnPool module, a second splicing module, a second LdswtC3 module, a first downsampling 3×3GSConvns downsampling module, a third splicing module, a third LdswtC3 module, a second downsampling 3×3GSConvns downsampling module, a third downsampling 3×3GSConvns downsampling module, a fourth splicing module, a fifth LdswtC3 module, a first ScalSeq module, a first Add module, a first SEAttention module, a second SEAttention module, and a third SEAttention module. The SPPF module of the backbone network is connected to the first 1×1GSConvns module and the first WaveletUnPool module, and the P4 layer features output by the backbone network and the obtained features are sent to the first splicing module, and then the P4 layer features of the upsampling process are obtained through the first LdswtC3 module; it is connected to the second 1×1GSConvns module and the second WaveletUnPool module, and the P3 layer features of the backbone network and the obtained features are sent to the first splicing module, and then the P3 layer features of the upsampling process are obtained through the second LdswtC3 module; after the first downsampling 3×3GSConvns downsampling module, the P4 layer features of the upsampling process and the P4 layer features output by the backbone network are sent to the third splicing module, and the P4 layer features are obtained through the third LdswtC3 module; The P4 layer features and the P4 layer features in the upsampling process are respectively passed through the second downsampling 3×3GSConvns downsampling module and the third downsampling 3×3GSConvns downsampling module, and are sent to the fourth splicing module together with the P5 layer information passed through the first 1×1GSConvns module, and the P5 layer features are obtained through the fifth LdswtC3 module; the P3, P4, and P5 layer features output by the backbone network are sent to the first ScalSeq module for fusion, and the result is sent to the first Add module to add the P3 module in the upsampling process to obtain the P3 layer features; the P3, P4, and P5 layer features are respectively passed through the first SEAttention module, the second SEAttention module, and the third SEAttention module, and the results are input into the detection head network.
[0095] Table 1 Evaluation of surface defects of hot-rolled strip based on different models
[0096]
[0097] As shown in Table 1 above, LDSNet and Faster RCNN, DDN, YOLOv5, YOLOv7-tiny, YOLOv8, YOLOv9, YOLOv10, CEC-YOLO, and MSD-YOLO are trained and tested on the same hardware environment and dataset. By comparing the results, we can draw the following conclusions: The first 7 rows of Table 1 show the comparison of LDSNet with traditional target detection methods on the NEU-DET dataset, as well as the comparison with CEC-YOLO and MSD-YOLO algorithms. Whether it is the baseline model or the new detection algorithm, LDSNet's mAP@50 result is the best, and the detection speed also achieves the effect of real-time detection.
[0098] Table 2 Model detection performance under different combinations
[0099] ldswtC3 GSConvns neck mAP@0.5 FPS - - - 77.2 150 √ - - 79.6 105 - √ - 79.3 143 - - √ 78.8 124 √ √ - 79.5 93 √ - √ 79.9 106 - √ √ 81.4 87 √ √ √ 81.7 80
[0100] As shown in Table 2 above, the ldswtC3 module, GSConvns module and neck improvement method proposed in the present invention were subjected to ablation experiments. The proposed ldswtC3 module improved the overall mAP by 2.4%, indicating that the ldswtC3 module can effectively capture the feature information of the defect image. Combined with the GSConvns module and the improved neck fusion method, the overall mAP is improved by 4.5%. At the same time, the detection speed reaches 80FPS, realizing real-time and accurate detection of surface defects of strip steel.
[0101] In summary, the hot-rolled strip surface defect detection method based on the LDSNet network in the above embodiment is based on the YOLOv5 target detection framework, and a feature extraction module Ldswt based on wavelet convolution is designed, and the Bottleneck layer of the C3 module is replaced by it to form the LdswtC3 module, which enhances the feature extraction and feature fusion capabilities of the network; in the downsampling operation, the GSConvns module is used to replace the ordinary convolution, which can not only reduce the parameter amount and calculation amount, but also further extract and enhance the features; in the neck network, the original features of each output layer of P3, P4, and P5 are fused, which significantly enhances the model's detection ability for small targets; before the feature is input to the detection head network, an attention module is passed, which significantly enhances the performance of the model without significantly increasing the calculation amount and parameter amount. The strip surface defect detection model designed by the present invention achieves 81.7% mAP on the NEU-DET dataset, and its detection speed reaches 80FPS on RTX3090, and its detection performance is better than all strip surface defect detection models at this stage.
[0102] Although the embodiments of the present invention have been shown and described above, it is to be understood that the above embodiments are exemplary and are not to be construed as limitations of the present invention. A person skilled in the art may change, modify, replace and vary the above embodiments within the scope of the present invention.
Claims
1. A method for detecting surface defects of hot-rolled strip steel based on LDSNet network, characterized in that: The following steps are involved: S1: Data preprocessing Collecting samples from a data set of surface defects of steel strips and preprocessing the samples; S2: Network construction Based on the YOLOv5 target detection framework, the LdswtC3 module is designed and introduced. The GSConvns module is used to downsample the features, the WaveletUnPool module is used to upsample, the ScalSeq module is introduced to improve the fusion method of the neck network, and the SEAttention module is used to enhance the features input to the detection head network, thereby obtaining the LDSNet network. S3: Model training The LDSNet network is trained using the training set to obtain a steel surface defect detection model; S4: Defect Identification Test the steel surface defect detection model on the test set and output the defect detection results and detection speed.
2. The method for detecting surface defects of hot-rolled strip steel based on LDSNet network according to claim 1, characterized in that: In step S1, the specific processing process is as follows: S11: obtaining data samples from a hot-rolled strip surface defect data set, and dividing the obtained data samples into a training set and a test set according to a set ratio; S12: Perform mosaic data enhancement on the images in the training set and fill the processed image size to the set size.
3. The method for detecting surface defects of hot-rolled strip steel based on LDSNet network according to claim 2, characterized in that: In step S2, the specific processing process is as follows: S21: Based on the YOLOv5 target detection framework, the Ldswt module of wavelet convolution is designed and replaced with the Bottleneck layer of the C3 module to form the LdswtC3 module; S22: Downsample the features using the GSConvns module; S23: Upsample the features using the WaveletUnPool module; S24: Introduce the ScalSeq module to improve the fusion method of the neck network; S25: Use the SEAttention module to enhance the features input to the detection head network.
4. The method for detecting surface defects of hot-rolled strip steel based on LDSNet network according to claim 3 is characterized in that: In the Ldswt module of step S21, the input feature is convolved through a 1×1 convolution to convert the input channel into half of the output channel; the result is input into the wavelet convolution, the convolution kernel size is 5 in the backbone network and the convolution kernel size is 3 in the neck network; and then a 1×1 convolution is performed to convert the number of output feature channels into the number of output channels, and the processing formula is as follows: F(x)=Conv 1×1 (WTConv2d k×k (Conv 1×1 (x))); Replace the Bottleneck layer of the C3 module with the Ldswt module, and finally obtain the LdswtC3 module.
5. The method for detecting surface defects of hot-rolled strip steel based on LDSNet network according to claim 4, characterized in that: In the GSConvns module of step S22, the input features are first downsampled through a common convolution layer with a convolution kernel size of k and a step size of s, and then the output results are input into a depth-separable convolution layer with a convolution kernel size of 5 and a step size of 1. The two parts of the output results are concatenated, and finally a 1×1 common convolution layer is used to shuffle the channels. The processing formula is as follows:
6. The method for detecting surface defects of hot-rolled strip steel based on LDSNet network according to claim 5, characterized in that: In the WaveletUnPool module of step S23, the specific processing process is as follows: S231: Order W L and W H Represent the low-pass and high-pass wavelet kernel weights respectively. According to the nature of wavelet changes, W L and W H The constraints should be met: Where K represents a one-dimensional kernel of size K = |K|; S232: Then use W L and W H Perform two horizontal pooling and two vertical pooling operations. Horizontal pooling decomposes the image into low-frequency signals along the X direction. and high frequency signals Assuming there is an input feature map with C channels, after horizontal pooling, the resulting feature map has 2C channels along the X direction, which is half the size; S232: Continue to perform two vertical pooling operations on the low-frequency signal and the high-frequency signal respectively, and obtain 7. The method for detecting surface defects of hot-rolled strip steel based on LDSNet network according to claim 6, characterized in that: In the ScalSeq module of step S24, the three different layers P3, P4, and P5 output by the Backbone of the YOLOv5 target detection framework are subjected to channel transformation through 1×1 convolution, and the feature channels of the three scales are unified into the required output channels. Then, the sizes of the features of the P4 layer and the P5 layer are adjusted to the same size as the P3 layer through the interpolate method, and the new features are processed by the unsqueeze method for dimension increase, and spliced on the new dimension. The processed features are processed by using a 3D convolution layer, a 3D batch normalization layer, and a SiLU activation function, and the processed features are reduced in dimension to become a new P3 layer that integrates the information of the P4 layer and the P5 layer, which is added to the original P3 layer and input into the detection head network; in the fusion process of the P4 layer in the downsampling stage, not only the P4 layer output by the original Backbone is integrated, but also the P4 layer information in the upsampling process is integrated; when processing the P5 layer, the P4 layer in the upsampling process is added for downsampling fusion.
8. The method for detecting surface defects of hot-rolled strip steel based on LDSNet network according to claim 7, characterized in that: In step S25, before the feature is input into the detection head network, the SEAttention module is used to perform global pooling processing on the input feature, and then processed through two fully connected layers to obtain channel weights, and the weights are multiplied by the original feature map to obtain weighted features.
9. The method for detecting surface defects of hot-rolled strip steel based on LDSNet network according to claim 1, characterized in that: In step S3, the specific processing process is as follows: S31: Set model training parameters, set epochs to 500, select SGD as the optimizer, and set the initial learning rate to 0.01; S32: Input the training set into the network for training. After the training is completed, save the weight parameters to obtain a steel surface defect target detection model.
10. The method for detecting surface defects of hot-rolled strip steel based on LDSNet network according to claim 1, characterized in that: In step S4, the specific processing process is as follows: S41: input the test set into the steel surface defect target detection model, and perform non-maximum suppression processing on the original output of the model; S42: Output the defect detection result and detection speed of the model.