Target identification method for steel surface defect detection
By constructing a combined model of feature extraction network, feature fusion network and prediction network, combined with multi-scale feature extraction and loss function optimization, the problem of insufficient multi-scale feature extraction capability in steel defect detection is solved, and the detection accuracy is significantly improved .
Patent Information
- Application Number
- CN202310580946.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-05-23
- Publication Date
- 2024-11-26
AI Technical Summary
The existing object detection algorithms lack the ability to extract multi-scale feature in steel defect detection, making it difficult to adapt to complex defect detection tasks, resulting in low detection accuracy.
A model composed of feature extraction network, feature fusion network and prediction network is adopted, combined with CIoU loss, cross entropy loss and decoupling heads, multi-scale features are extracted by enhancing C3 module, Res2Net multi-scale module and SPPF module, and clustering analysis is used to obtain multi-scale features. Anchor frame size, optimize the model training process to improve detection accuracy.
It significantly improves the detection accuracy of the object detection algorithm in defect detection tasks, can better describe objects of different scales and alleviate the problem of spatial differences in feature.
Smart Images

Figure CN119027703A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of image processing technology, and in particular to achieving classification and positioning of defective targets by using a target detection method based on deep learning. Background Art
[0002] As an important industrial material, steel has been widely used in machinery manufacturing, vehicle engineering, military and national defense, and people's daily lives involve the use of steel everywhere. However, due to the complexity of the production environment and the limitations of processing equipment, cracks, scratches and other defects often appear on the surface of steel, which not only damages product performance but also causes safety hazards. Therefore, it is of great significance to detect defects on the surface of steel.
[0003] In the early days, the use of manual visual inspection methods to screen good products was a common method used by factories, but manual inspection was inefficient and could not match the efficient automated industrial production environment. The subjective judgment of workers also made it impossible to unify the inspection standards, which led to unstable inspection results. Later, defect detection methods based on machine vision were used in the field of defect detection due to their fast and stable advantages. The system uses appropriate light sources and image sensors to obtain product surface images, then uses image processing algorithms to extract image information, and finally classifies and locates defects based on feature information. However, manually designed feature extraction algorithms perform poorly in terms of robustness and generalization ability. When faced with different types of defects, they often require targeted design of corresponding algorithms, which is not convenient for practical application.
[0004] With the development of deep learning technology, Convolutional Neural Networks (CNN) has gained wide attention from all walks of life due to its powerful feature extraction and representation capabilities. CNN learns sample information from a large amount of data, has strong robustness and generalization capabilities, and can ultimately improve the accuracy of visual tasks such as target detection and semantic segmentation. Gradually, target detection technology based on deep learning has begun to be applied to the field of defect detection. They generally use feature extraction networks to extract feature information, then fuse the obtained multi-level features, and finally classify and locate the defects. However, defects in industrial production often have the characteristics of variable scales. The defects of the same defect type vary greatly, and the feature information of different defect types is similar. It is difficult to adapt to complex defect detection tasks by simply using general target detection technology.
[0005] In summary, how to further improve the multi-scale feature extraction capability of the target detection algorithm to improve the detection accuracy of the target detection algorithm in defect detection tasks is an urgent problem to be solved. Summary of the invention
[0006] In order to overcome the defects in the above-mentioned prior art, the present invention provides a target recognition method for steel surface defect detection, so as to improve the multi-scale feature extraction capability of the existing target detection algorithm, thereby improving the detection accuracy of the target detection algorithm in the defect detection task.
[0007] In order to achieve the above object, the present invention adopts the following technical scheme:
[0008] The present invention provides a target recognition method for steel surface defect detection, comprising the following steps:
[0009] Step 1: Dataset preparation: Annotate steel images and randomly divide the images into training set, validation set, and test set according to a certain ratio;
[0010] Step 2: Build a steel surface defect detection model: The model consists of three parts: feature extraction network, feature fusion network and prediction network;
[0011] Step 3: Construct a composite loss function: select CIoU loss for regression loss, and select cross entropy loss for classification loss and confidence loss;
[0012] Step 4: Obtain anchor box size: Use cluster analysis algorithm to obtain anchor box size data suitable for defect targets;
[0013] Step 5: Import the training image and anchor box size data, select the optimizer and set the relevant hyperparameters, and then perform model training;
[0014] Step 6: Convergence judgment of the training process of the steel surface defect detection model: if the loss function does not converge, adjust the learning rate and modify the hyperparameter settings, and go to step 5; if the loss function converges, stop training, save the best model weights, and go to step 7;
[0015] Step 7: Use the optimal model weight to detect steel surface defects: Import the steel surface defect image into the optimal model saved in step 6 for calculation to obtain the category and location information of the steel image defect target.
[0016] Furthermore, the specific implementation method of step 1 is: use annotation software to annotate the category of defects in the steel image and the position of the detection frame, and divide the annotated data set image into a training set and a test set in a ratio of 9:1, wherein the training set will be further divided into a training set and a validation set in a ratio of 9:1.
[0017] Furthermore, the feature extraction network extracts features from the input image to obtain output feature maps at three scales; the feature fusion network receives the output feature maps from the feature extraction network and fuses the feature maps from different scales; the prediction network receives the output features from the feature fusion network and performs final classification and regression operations on them.
[0018] Furthermore, the specific implementation method of step 2 includes the following steps:
[0019] Step 2.1, the feature extraction network extracts features from the input image to obtain output feature maps at three scales: the feature extraction network consists of a normal convolution layer CBS, an enhanced C3 module, a Res2Net multi-scale module, and an SPPF (SpatialPyramid Pooling-Fast) module; the normal convolution layer consists of a standard convolution, a batch normalization layer, and a SiLU activation function; the enhanced C3 module consists of two branches, and the two branches use a 1×1 normal convolution layer and an enhanced bottleneck module for feature extraction. The two output features obtained are concatenated and then passed through a 1×1 normal convolution layer to obtain the final output; the Res2Net multi-scale module uses a hierarchical residual connection structure to perform 3×3 normal convolution operations on multiple feature map subsets. The obtained outputs are concatenated and then passed through a 1×1 normal convolution layer to fuse the feature information to obtain the final output; the SPPF module is composed of a 1×1 normal convolution layer and three maximum pooling layers with equal pooling window sizes stacked together. , the output features obtained after convolution and pooling operations are concatenated and then fused with feature information through a 1×1 ordinary convolution layer to obtain the final output; the feature extraction process of the feature extraction network can be divided into five stages: the first stage performs a downsampling operation on the input image, and uses an ordinary convolution layer with a step size of 2 to compress the input image size. The remaining four stages are stacked by an ordinary convolution layer with a step size of 2 for compressing the image size and an enhanced C3 module for feature extraction. Subsequently, the output feature maps of the third and fourth stages are input into the Res2Net multi-scale module for calculation, and the output feature maps of the fifth stage are input into the SPPF module for calculation to obtain three output feature maps of the feature extraction network;
[0020] Step 2.2: The three output feature maps of the feature extraction network in step 2.1 are used as the input of the feature fusion network. The feature fusion network realizes feature fusion through a bidirectional path, wherein the high-level feature map is fused with the low-level feature map along a top-down path after upsampling operation, and the low-level feature map is fused with the high-level feature map along a bottom-up path after downsampling operation to obtain three fused feature maps;
[0021] Step 2.3: Use the three feature maps fused in step 2.2 as the input of the prediction network, and use the decoupling head to perform 1×1 and 3×3 convolution operations on the input on multiple branches to obtain prediction information.
[0022] Furthermore, the composite loss function is composed of regression loss, classification loss and confidence loss. The regression loss selects CIoU loss, and the classification loss and confidence loss both select cross entropy loss. The three losses are added together to obtain the composite loss function.
[0023] Furthermore, the specific implementation method of step 4 is: using the K-means++ algorithm to perform cluster analysis on the detection frames of different sizes in the steel image data set to obtain anchor frame size data that conforms to the size distribution characteristics of the defect target.
[0024] Furthermore, the specific implementation method of step 5 is: importing training set images and anchor box size data, selecting an optimizer and setting momentum and weight decay size, selecting a learning rate adjustment strategy and setting the initial learning rate size, and using a composite loss function to guide model training.
[0025] The beneficial effects of the present invention are as follows:
[0026] The target recognition method for steel surface defect detection provided by the embodiment of the present invention can utilize the feature extraction network with the enhanced C3 module as the core to extract the discriminant information of the feature to the maximum extent; use the Res2Net multi-scale module and the SPPF module to expand the receptive field, so that the model can better describe objects of different scales; use the decoupling head to perform classification and regression tasks on different branches, alleviating the problem of the difference in feature space between the two tasks; and finally improve the detection accuracy of the target detection algorithm in the defect detection task. BRIEF DESCRIPTION OF THE DRAWINGS
[0027] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0028] Figure 1 A flow chart of a target recognition method for steel surface defect detection provided by an embodiment of the present invention;
[0029] Figure 2 The overall structure diagram of the steel surface defect detection model provided by the embodiment of the present invention;
[0030] Figure 3 The enhanced bottleneck module and bottleneck module structure diagram provided by the embodiment of the present invention;
[0031] Figure 4 A structural diagram of the Res2Net multi-scale module and the SPPF module provided in an embodiment of the present invention;
[0032] Figure 5 A structural diagram of a decoupling head provided in an embodiment of the present invention. DETAILED DESCRIPTION
[0033] In order to make the above-mentioned purposes, features and advantages of the present invention more obvious and easy to understand, the technical scheme in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work belong to the scope of protection of the present invention.
[0034] At present, various defects on the surface of steel have seriously damaged product performance. Manual visual defect detection methods have poor stability and low efficiency. The defect detection methods based on traditional machine vision have poor generalization and robustness, which is not convenient for practical application. The target detection method based on deep learning has achieved certain results in the field of defect detection. It learns sample information from a large amount of data and improves the accuracy of visual tasks with the powerful feature extraction and representation capabilities of convolutional neural networks. However, defects in industrial production often have the characteristics of different scales: the defects of the same defect type vary greatly, and the feature information of different defect types is similar, which leads to the poor performance of general target detection technology in defect detection tasks.
[0035] To solve the above problems, an embodiment of the present invention provides a target recognition method for steel surface defect detection, such as Figure 1 As shown, the following steps are included:
[0036] Step 1: Dataset preparation: Label the steel images and randomly divide the images into training set, validation set, and test set according to a certain ratio.
[0037] In this embodiment, the image resolution of the steel data set is adjusted to 320×320 pixels, and the format is png format. Use labeling software (such as LabelImg) to manually label the image, mark the category of defects in the steel image and the position of the detection frame, and divide the labeled data set images into training set and test set at a ratio of 9:1, where the training set needs to be further divided into training set and verification set at a ratio of 9:1. It should be noted that the preparation of the data set includes but is not limited to manual methods, and the labeled images can also be obtained by downloading public data sets of steel surface defects (such as NEU-DET, GC10-DET).
[0038] Step 2: Construct a steel surface defect detection model. Figure 2 As shown in the figure, the model consists of three parts: feature extraction network, feature fusion network and prediction network. The feature extraction network extracts features from the input image to obtain output feature maps at three scales; the feature fusion network receives the output feature maps from the feature extraction network and fuses the feature maps from different scales; the prediction network receives the output features from the feature fusion network and performs the final classification and regression operations on them. The specific processing method of this step is as follows:
[0039] Step 2.1, the feature extraction network extracts features from the input image to obtain output feature maps at three scales. The feature extraction network consists of a normal convolution layer CBS, an enhanced C3 module, a Res2Net multi-scale module, and an SPPF (SpatialPyramid Pooling-Fast) module. The normal convolution layer consists of a standard convolution, a batch normalization layer, and a SiLU activation function. The enhanced C3 module consists of two branches, which use a 1×1 normal convolution layer and an enhanced bottleneck module for feature extraction. The two output features obtained are concatenated and then passed through a 1×1 normal convolution layer to obtain the final output. The Res2Net multi-scale module uses a hierarchical residual connection structure to perform 3×3 normal convolution operations on multiple feature map subsets. The obtained outputs are concatenated and then passed through a 1×1 normal convolution layer to fuse the feature information to obtain the final output. The SPPF module is composed of a 1×1 ordinary convolution layer and three maximum pooling layers with equal pooling window sizes. The output features obtained after convolution and pooling operations are concatenated and then fused with feature information through a 1×1 ordinary convolution layer to obtain the final output. The feature extraction process of this feature extraction network can be divided into five stages: the first stage performs a downsampling operation on the input image and uses an ordinary convolution layer with a step size of 2 to compress the input image size. The remaining four stages are stacked by an ordinary convolution layer with a step size of 2 for compressing the image size and an enhanced C3 module for feature extraction. Subsequently, the output feature maps of the third and fourth stages are input into the Res2Net multi-scale module for calculation, and the output feature maps of the fifth stage are input into the SPPF module for calculation to obtain three output feature maps of the feature extraction network.
[0040] In this step, if Figure 2 As shown in the figure, the enhanced C3 module consists of two branches, one of which contains only one 1×1 ordinary convolution layer, and the other branch is composed of a 1×1 ordinary convolution layer and multiple enhanced bottleneck modules stacked together. The outputs of the two branches are concatenated in the channel dimension, and finally a 1×1 ordinary convolution operation is performed on the feature map obtained after concatenation to obtain the output of the enhanced C3 module. Figure 3As shown in (a), the enhanced bottleneck module consists of a trunk branch, a shortcut connection and an enhanced branch. The trunk branch is composed of a 1×1 ordinary convolution layer and a 3×3 ordinary convolution layer stacked together. The shortcut connection is the input feature map itself. The enhanced branch is composed of a 3×3 ordinary convolution layer with a step size of 2 and a 3×3 transposed convolution layer with a step size of 2. After the output of the enhanced branch is added to the shortcut connection, the obtained output is added to the output of the trunk branch to obtain the output of the enhanced bottleneck module. Figure 4 As shown in (a), after receiving the input features, the Res2Net multi-scale module first performs a 1×1 ordinary convolution operation to obtain the output, and then divides the output into 4 feature map subsets with equal number of channels according to the number of channels. Then, the module performs a 3×3 ordinary convolution operation on the remaining 3 feature map subsets except the first feature map subset. The output features after the 3×3 convolution operation will be added with the next feature map subset, and the feature map obtained after the addition will be sent to another set of 3×3 convolutions. After repeating the above operation several times, all the obtained feature maps are spliced together, and a 1×1 ordinary convolution is used to fuse the feature information. Finally, the fused feature map is added with the initial input feature to obtain the output of the Res2Net multi-scale module. Figure 4 As shown in (b), the SPPF module is composed of a 1×1 ordinary convolution layer and a maximum pooling layer with a pooling window size of 5. The output obtained after the ordinary convolution layer and the maximum pooling layer will be spliced, and the output obtained after splicing will be sent to a 1×1 ordinary convolution layer to obtain the output of the SPPF module. The detailed settings of the feature extraction network are shown in Table 1: the step size of the first downsampling convolution layer is 2 and the convolution kernel size is 6, the step size of the remaining downsampling convolution layers is 2 and the convolution kernel size is 3; the number of input and output feature map channels in the enhanced C3 module is consistent, and the number of stacked enhanced bottleneck modules in the enhanced C3 module at each stage is 1, 2, 3 and 1 respectively; the number of input and output feature map channels in the Res2Net multi-scale module and the SPPF module is consistent.
[0041] Table 1. Feature extraction network related settings
[0042]
[0043] Step 2.2: Use the three output feature maps of the feature extraction network in step 2.1 as the input of the feature fusion network. The feature fusion network realizes feature fusion through a bidirectional path. The high-level feature map will be fused with the low-level feature map along the top-down path after the upsampling operation, and the low-level feature map will be fused with the high-level feature map along the bottom-up path after the downsampling operation to obtain the three fused feature maps.
[0044] In this step, if Figure 2As shown in the figure, the fusion process of the top-down path is to first perform a 1×1 ordinary convolution operation on the high-level feature map, and then perform an upsampling operation. The feature map obtained after upsampling will be spliced with the feature map of the adjacent level, and the output obtained will pass through a C3 module to complete the fusion process; the fusion process of the bottom-up path is to first perform a 3×3 downsampling convolution operation with a step size of 2 on the low-level feature map, and the feature map obtained will be spliced with the feature map of the adjacent level, and the output obtained will pass through a C3 module to complete the fusion process. Figure 2 As shown in FIG. 1 , the C3 module consists of two branches, one of which contains only a single 1×1 ordinary convolutional layer, and the other branch is composed of a 1×1 ordinary convolutional layer and a bottleneck module stacked together, where the bottleneck module structure is as follows: Figure 3 As shown in (b), it is composed of a 1×1 ordinary convolution layer and a 3×3 ordinary convolution layer stacked together. The outputs of the two branches are concatenated in the channel dimension, and finally a 1×1 ordinary convolution operation is performed on the concatenated feature map to obtain the output of the C3 module.
[0045] Step 2.3: Use the three feature maps fused in step 2.2 as the input of the prediction network, and use the decoupling head to perform 1×1 and 3×3 convolution operations on the input on multiple branches to obtain prediction information.
[0046] In this step, if Figure 5 As shown in the figure, after receiving the input features, the decoupling head first performs a 1×1 ordinary convolution operation, then uses parallel branches to separate the classification task from the regression task, and adds a confidence branch to the regression branch. Each branch consists of a 1×1 ordinary convolution layer and a 3×3 ordinary convolution layer.
[0047] Step 3: Construct a composite loss function: select CIoU loss for regression loss, and select cross entropy loss for classification loss and confidence loss.
[0048] In this step, the relevant calculation formula of the CIoU loss is:
[0049]
[0050]
[0051]
[0052]
[0053] Among them, A represents the real box, B represents the predicted box, and IoU is the division of the area of the intersection of the predicted box and the real box with the area of the union area; c lIt represents the diagonal distance of the minimum enclosing rectangle containing the real box and the predicted box, and ρ represents the center point b of the real box. gt and the prediction box center point b pt The Euclidean distance between pt and w gt Represents the width of the predicted box and the real box, h pt and h gt Represents the height of the predicted box and the real box. v is used to describe the consistency of the aspect ratio of the predicted box and the real box, and β is equivalent to a balance coefficient.
[0054] The calculation formula of the cross entropy loss is:
[0055]
[0056] Among them, taking classification loss as an example, T i j Represents the category score of the true box, Represents the category score of the predicted box.
[0057] The calculation formula of the composite loss function is:
[0058] Loss H =Loss CIoU +Loss class +Loss conf ,
[0059] Step 4: Obtain anchor box size: Use cluster analysis algorithm to obtain anchor box size data suitable for defect targets.
[0060] In this step, the K-means++ algorithm is used to perform cluster analysis on the detection boxes of different sizes in the steel image dataset to obtain anchor box size data that conforms to the size distribution characteristics of the defect target. Taking the NEU-DET dataset and the GC10-DET dataset as examples, the anchor box sizes obtained on the NEU-DET dataset are (28, 59), (89, 44), (38, 116), (25, 281), (78, 97), (60, 297), (217, 99), (118, 185), (241, 305), and the anchor box sizes obtained on the GC10-DET dataset are (7, 16), (17, 21), (24, 57), (148, 25), (40, 100), (317, 23), (44, 226), (86, 262), (174, 250).
[0061] Step 5: Import the training image and anchor box size data, select the optimizer and set the relevant hyperparameters, and then perform model training.
[0062] In this step, the steel surface defect dataset is used for training, and the stochastic gradient descent is used to optimize the training process. The momentum is set to 0.937, the weight decay is set to 0.0005, the cosine annealing learning rate is used to adjust the learning rate and the initial learning rate is set to 0.01. The composite loss function is used to guide the model training. During the training process, each cycle is verified on the validation set, and the average detection accuracy is calculated and recorded.
[0063] Step 6: Conduct convergence judgment on the training process of the steel surface defect detection model: if the loss function does not converge, adjust the learning rate and modify the hyperparameter settings, and go to step 5; if the loss function converges, stop training, save the best model weights, and go to step 7.
[0064] In this step, the model convergence is judged. If the loss function value is greater than 6×10 -2 , then adjust the learning rate and related hyperparameters and return to step 5; if the loss function value is less than or equal to 6×10 -2 , then stop training and save the best model weights, and go to step 7.
[0065] Step 7: Use the optimal model weight to detect steel surface defects: Import the steel surface defect image into the optimal model saved in step 6 for calculation to obtain the category and location information of the steel image defect target.
[0066] In this step, the image resolution of the steel dataset is adjusted to 320×320 pixels in png format, and the adjusted image is input into the optimal model for calculation, and the category of the defect target, the center point coordinates of the bounding box, the length and width are output.
[0067] The above is only a specific embodiment of the present invention, but the protection scope of the present invention is not limited thereto. Any changes or substitutions that can be easily thought of by a person skilled in the art within the technical scope disclosed by the present invention should be included in the protection scope of the present invention. Therefore, the protection scope of the present invention should be based on the protection scope of the claims.
Claims
1. A target recognition method for steel surface defect detection, Features: The following steps are involved: Step 1: Dataset preparation: Annotate steel images and randomly divide the images into training set, validation set, and test set according to a certain ratio; Step 2: Build a steel surface defect detection model: The model consists of three parts: feature extraction network, feature fusion network and prediction network; Step 3: Construct a composite loss function: select CIoU loss for regression loss, and select cross entropy loss for classification loss and confidence loss; Step 4: Obtain anchor box size: Use cluster analysis algorithm to obtain anchor box size data suitable for defect targets; Step 5: Import the training image and anchor box size data, select the optimizer and set the relevant hyperparameters, and then perform model training; Step 6: Convergence judgment of the training process of the steel surface defect detection model: if the loss function does not converge, adjust the learning rate and modify the hyperparameter settings, and go to step 5; if the loss function converges, stop training, save the best model weights, and go to step 7; Step 7: Use the optimal model weight to detect steel surface defects: Import the steel surface defect image into the optimal model saved in step 6 for calculation to obtain the category and location information of the steel image defect target.
2. The target recognition method for steel surface defect detection according to claim 1, Features: The specific implementation method of step 1 is: use annotation software to annotate the category of defects in the steel image and the position of the detection frame, and divide the annotated data set image into a training set and a test set in a ratio of 9:1, wherein the training set is further divided into a training set and a validation set in a ratio of 9:
1.
3. The target recognition method for steel surface defect detection according to claim 1, Features: The feature extraction network extracts features from the input image to obtain output feature maps at three scales; The feature fusion network receives the output feature map from the feature extraction network and fuses the feature maps from different scales; the prediction network receives the output features from the feature fusion network and performs final classification and regression operations on them.
4. The target recognition method for steel surface defect detection according to claim 3, Features: The specific implementation method of step 2 includes the following steps: Step 2.1, the feature extraction network extracts features from the input image to obtain output feature maps at three scales: the feature extraction network consists of a normal convolution layer CBS, an enhanced C3 module, a Res2Net multi-scale module, and an SPPF (SpatialPyramid Pooling-Fast) module; the normal convolution layer consists of a standard convolution, a batch normalization layer, and a SiLU activation function; the enhanced C3 module consists of two branches, and the two branches use a 1×1 normal convolution layer and an enhanced bottleneck module for feature extraction. The two output features obtained are concatenated and then passed through a 1×1 normal convolution layer to obtain the final output; the Res2Net multi-scale module uses a hierarchical residual connection structure to perform 3×3 normal convolution operations on multiple feature map subsets. The obtained outputs are concatenated and then passed through a 1×1 normal convolution layer to fuse the feature information to obtain the final output; the SPPF module is composed of a 1×1 normal convolution layer and three maximum pooling layers with equal pooling window sizes stacked together. , the output features obtained after convolution and pooling operations are concatenated and then fused with feature information through a 1×1 ordinary convolution layer to obtain the final output; the feature extraction process of the feature extraction network can be divided into five stages: the first stage performs a downsampling operation on the input image, and uses an ordinary convolution layer with a step size of 2 to compress the input image size. The remaining four stages are stacked by an ordinary convolution layer with a step size of 2 for compressing the image size and an enhanced C3 module for feature extraction. Subsequently, the output feature maps of the third and fourth stages are input into the Res2Net multi-scale module for calculation, and the output feature maps of the fifth stage are input into the SPPF module for calculation to obtain three output feature maps of the feature extraction network; Step 2.2: The three output feature maps of the feature extraction network in step 2.1 are used as the input of the feature fusion network. The feature fusion network realizes feature fusion through a bidirectional path, wherein the high-level feature map is fused with the low-level feature map along a top-down path after upsampling operation, and the low-level feature map is fused with the high-level feature map along a bottom-up path after downsampling operation to obtain three fused feature maps; Step 2.3: Use the three feature maps fused in step 2.2 as the input of the prediction network, and use the decoupling head to perform 1×1 and 3×3 convolution operations on the input on multiple branches to obtain prediction information.
5. The target recognition method for steel surface defect detection according to claim 1, Features: The composite loss function is composed of regression loss, classification loss and confidence loss. The regression loss selects CIoU loss, and the classification loss and confidence loss both select cross entropy loss. The three losses are added together to obtain the composite loss function.
6. The target recognition method for steel surface defect detection according to claim 1, Features: The specific implementation method of step 4 is: use the K-means++ algorithm to perform cluster analysis on the detection frames of different sizes in the steel image data set to obtain anchor frame size data that conforms to the size distribution characteristics of the defect target.
7. The target recognition method for steel surface defect detection according to any one of claims 1 to 6, Features: The specific implementation method of step 5 is: importing training set images and anchor box size data, selecting an optimizer and setting momentum and weight decay size, selecting a learning rate adjustment strategy and setting the initial learning rate size, and using a composite loss function to guide model training.
Citation Information
Cited By
Steel part hole identification method and system based on multi-scale image identification
CN121686013A
