A rolling plate surface defect detection method based on improved YOLOv5

By improving the YOLOv5 method and combining the feature interaction of the backbone module and the neck module, the problem of low detection accuracy in the surface defect detection of rolled sheet metal was solved, and more efficient defect identification and localization were achieved.

CN119851042BActive Publication Date: 2025-10-17CENT SOUTH UNIV
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202510059212.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-01-15
Publication Date
2025-10-17
Estimated Expiration
2045-01-15

AI Technical Summary

Technical Problem

Existing technologies for detecting surface defects in rolled steel sheets suffer from low detection accuracy, high false detection and false negative rates, and are particularly difficult to effectively identify similar defects and weak feature defects in complex backgrounds or under undesirable working conditions.

Method used

By adopting an improved YOLOv5 method, feature information is extracted by aggregating convolutional kernels of different sizes in the backbone module, global and local image features are interacted in the neck module, and deep features are compensated by a cross-scale feature fusion method, thereby enhancing the detection capability of complex and dense defects.

Benefits of technology

It improves the accuracy and robustness of surface defect detection in rolled steel sheets, reduces false detections and missed detections, enhances the model's ability to identify similar defects and weak feature defects, and ensures the efficient operation of the model under limited computing resources.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119851042B_ABST
    Figure CN119851042B_ABST
Patent Text Reader

Abstract

The application discloses a rolling plate surface defect detection method based on improved YOLOv5, which contains three core improvements: (1) the backbone module introduces residual synchronized convolutional block (RSCB), which synchronously extracts complex defect features; (2) the neck module designs convolution-multilayer perceptron operation (Conv-MLP), which strengthens the interaction of global and local features of an image and improves the large-span defect detection capability; and (3) the fusion strategy is optimized, and details lost by deep layer features are compensated by shallow layer features. Through the multi-scale feature processing mechanism, the application improves the micro defect recognition precision and realizes higher-precision surface defect positioning and classification in an industrial scene.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The application relates to a rolling plate surface defect detection method based on an improved YOLOv5 and belongs to the field of computer vision. BACKGROUND

[0002] In an industrial environment, the surface quality of a rolling plate directly affects the performance, durability and safety of a product. Traditional rolling plate surface defect detection methods mainly rely on manual detection, ultrasonic detection, magnetic powder detection and penetration detection, etc., but the detection accuracy of these methods fluctuates when facing complex backgrounds or non-ideal working conditions. For example, the method based on manual detection relies on the experience of the detection personnel, is prone to subjective errors, is difficult to ensure detection consistency, has poor recognition effect on small surface defects, is low in efficiency and has precision affected by working time. The ultrasonic detection method is difficult to completely adhere to the ultrasonic probe when facing irregular workpieces or workpieces with rough surfaces, resulting in uneven transmission of sound waves and difficulty in accurately detecting surface defects. The magnetic powder detection scheme can only detect defects on or near the surface of ferromagnetic materials and cannot be applied to non-ferromagnetic materials. In addition, in a high-temperature or rough-surface environment, the magnetic powder aggregation effect is limited, which may lead to false detection or missed detection. The penetration detection requires the surface of the workpiece to be thoroughly cleaned before detection, and the penetrating liquid has a corrosive effect on some materials, which is complicated to operate and slow in detection speed.

[0003] With the advancement of industrial automation and intelligent manufacturing, non-destructive testing technology based on target detection has gradually become the mainstream and has been widely applied to the surface detection of materials such as metals, roads, rails and glass. In the defect detection task, feature extraction is a key link to improve detection performance, and how to efficiently, comprehensively and accurately extract defect feature information at different levels has become a research focus in recent years. However, defect feature extraction still faces the challenges of similar defects and weak feature defects. Similar defects are highly consistent in shape, texture and size, while weak features are easily hidden by complex backgrounds. Conventional feature extraction methods are difficult to effectively distinguish subtle differences, and in the case of complex or densely distributed defects, the risk of false detection and missed detection will obviously increase. Therefore, it is urgent to introduce more advanced feature extraction methods to enhance the recognition ability of similar defects and weak features, thereby improving detection accuracy and reducing false detection and missed detection.

[0004] In the target detection task, the appearance features of the target may be affected by adjacent objects or background textures. Through effective cross-region feature interaction, the model can improve the recognition accuracy and accuracy of the target. In the defect detection task, different regions of features are interacted through feature interaction to form richer feature representations, which can better identify complex defect patterns. Therefore, it is urgent to introduce more efficient cross-region feature interaction architecture to optimize the model calculation efficiency and improve the task performance.

[0005] Cross-scale features have different receptive fields and semantic information. By integrating features of different scales and different levels, the defect detection model can be more accurate and reliable in detecting targets in various scenarios. However, due to the different feature performances of defects at different scales, how to effectively integrate feature information from different scales to improve the model's recognition ability for complex and dense defects is particularly important. Therefore, it is necessary to effectively utilize cross-scale features without significantly increasing the amount of calculation to fully capture and amplify these subtle features, and to enhance the detection accuracy of the model for similar defects, weak feature defects and large span defects. SUMMARY

[0006] Compared with the relatively obvious targets in the conventional target detection task, the types of defects in the defect detection task are various, and the shape, size, color and other characteristics of the defects are greatly different on different product and material surfaces. At the same time, due to the irregular contour and low contrast with the background, these defects are difficult to distinguish visually. Many defect features are very small and hidden, and are difficult to distinguish visually from the workpiece surface, which further increases the difficulty of accurate identification. In the industrial production line, the defect detection algorithm is usually deployed on edge computing devices, which have limited computing resources. Therefore, the model design must balance the parameter amount and detection accuracy to ensure that the model can run efficiently under limited resource conditions.

[0007] The present application proposes a rolling plate surface defect detection method based on improved YOLOv5. In order to better capture defect features, the present application aggregates feature information extracted by different size convolution kernels in the backbone part to obtain detailed and global information at the same level, and enhances the understanding ability of complex image content. In the neck part, the global features and local information of the image are interacted, and the advantages of the two are complementary, so that the model can better integrate global context information, thereby improving the defect detection performance. At the same time, since the features processed for many times will lose part of the detailed information, therefore, the present application uses the method of cross-scale feature fusion in the neck stage to compensate the deep layer features processed for many times with the shallow layer features, and improves the detection accuracy and precision of the defects.

[0008] The technical scheme of the present application is: a rolling plate surface defect detection method based on improved YOLOv5, characterized in that it comprises the following steps:

[0009] S1, constructing a rolling plate surface defect detection method based on a backbone module, a neck module and a head module;

[0010] S2, constructing a backbone module based on CSPDarknet, including the Convolutional Normalization Activation Operation (Conv-BatchNorm-SiLU, CBS) and the Residual Synchronized Convolutional Block (RSCB) module and the Spatial Pyramid Pooling-Fast (SPPF) operation;

[0011] S3, the backbone module described in step S2, characterized by comprising:

[0012] Perform CBS on the input image 6×6 The operation obtains feature F1;

[0013] Perform CBS on feature F1 3×3 The operation obtains feature F2;

[0014] Perform RSCB operation on feature F2 to obtain feature F3;

[0015] Perform CBS on feature F3 3×3 The operation obtains feature F4;

[0016] Perform RSCB operation on feature F4 to obtain feature F5;

[0017] Perform CBS on feature F5 3×3 The operation obtains feature F6;

[0018] Perform RSCB operation on feature F6 to obtain feature F7;

[0019] Perform CBS on feature F7 3×3 The operation obtains feature F8;

[0020] Perform RSCB operation on feature F8 to obtain feature F9;

[0021] Perform SPPF operation on feature F9 to obtain feature F 10 ;

[0022] S4, step S3 is characterized in that the RSCB operation is: performing CBS on the input features 3×3 The operation obtains the feature R1, and based on the blueprint convolution normalization activation operation (Blueprint Separable Conv-BatchNorm-SiLU, BBS), BBS is performed on the feature R1 respectively 3×3 and BBS 5×5 Operation, and the two features are spliced ​​and BBS 7×7 The feature R2 is obtained by operation, and the feature R2 is spliced ​​with the feature R1 and BBS is performed.7×7 The operation obtains a feature R3, splices the feature R3 with the feature R1, and performs CSB 3×3 The operation obtains an RSCB output feature;

[0023] S5, constructing a neck module based on the PANet, including a CSP operation with three convolutions (CSP Bottleneck with 3 Convolutions, C3), a convolution-multilayer perceptron operation (Conv-Multilayer Perceptron, Conv-MLP), and a feature fusion operation (Fusion);

[0024] S6, the neck module of step S5, characterized in that it comprises:

[0025] performing a first Conv-MLP operation on the input feature to obtain a feature F 11 ;

[0026] performing an up-sampling operation on the feature F 11 to obtain a feature F 12 ;

[0027] splicing the F 12 and F7, and sequentially performing a C3 operation and a second Conv-MLP operation to obtain a feature F 15 ;

[0028] performing an up-sampling operation on the feature F 15 to obtain a feature F 16 ;

[0029] performing a first Fusion operation on the feature F2, the feature F5, and the feature F 16 , and performing a C3 operation to obtain a feature F 18 ;

[0030] performing a third Conv-MLP operation on the feature F 18 to obtain a feature F 19 ;

[0031] performing a second Fusion operation on the feature F2, the feature F 15 , and the feature F 19 , and performing a C3 operation to obtain a feature F 21 ;

[0032] performing a fourth Conv-MLP operation on the feature F 21 to obtain a feature F 22 ;

[0033] performing a third Fusion operation on the feature F2, the feature F 11 , and the feature F 22 , and performing a C3 operation to obtain a feature F24 ;

[0034] S7, the step S6 is characterized in that the Conv-MLP operation is: sequentially performing Shift-MLP and CBS i×i operation on the input feature, and the first Conv-MLP operation and the second Conv-MLP operation in the step S6 adopt CBS 1×1 , while the third Conv-MLP operation and the fourth Conv-MLP operation adopt CBS 3×3 ;

[0035] S8, the step S6 is characterized in that the Fusion operation is: performing average pooling operation on the feature F2 and performing feature splicing operation with the middle layer feature and the deep layer feature to obtain the feature S1, and sequentially performing CBS 1×1 and CBS 3×3 operation on the feature S1 to obtain the output feature. Wherein, the middle layer feature in the first Fusion operation is the feature F5, and the deep layer feature is the feature F 16 ; the middle layer feature in the second Fusion operation is the feature F 15 , and the deep layer feature is the feature F 19 ; the middle layer feature in the third Fusion operation is the feature F 11 , and the deep layer feature is the feature F 22 ;

[0036] S9, based on the head module of YOLOv5 itself, and combining the features F 18 , F 21 and F 24 to perform defect detection and positioning operation.

[0037] The CBS i×i operation in the step S3 is: sequentially performing convolution operation with convolution kernel size of i×i (i is an integer greater than 0), BatchNorm operation and SiLU activation function operation.

[0038] The SPPF operation in the step S3 is: performing CBS 1×1 operation on the input feature to obtain the feature Y1, sequentially performing three maximum pooling operations on the feature Y1 to obtain the features Y2, Y3 and Y4 respectively; performing feature splicing on the features Y1, Y2, Y3 and Y4 and performing CBS 1×1 operation to obtain the output feature.

[0039] The BBS i×iThe operation is that a blueprint separable convolution operation with a kernel size of i x i (i is an integer greater than 0), a BatchNorm operation and a SiLU activation function operation are sequentially performed.

[0040] The C3 operation in the step S5 is that the input features are respectively subjected to CBS 1×1 operations and CBS 1×1 operations, respectively, to obtain features C1 and features C2, the features C1 are sequentially subjected to three Bottleneck operations to obtain features C3, the features C3 are subjected to feature splicing with the features C2 to obtain features C4, and the features C4 are subjected to CBS 1×1 operations to obtain output features of the C3.

[0041] The Bottleneck operation in the C3 operation in the step S5 is a single CBS 1×1 and CBS 3×3 operation in series.

[0042] The Shift-MLP operation in the step S6 is that the input features are sequentially subjected to a vertical sliding operation, a Linear operation, a DWConv operation, a GELU activation function operation, a Dropout operation, a horizontal sliding operation, a Linear operation and a Dropout operation.

[0043] Overall, compared with the prior art, the present application adopts a new idea and method, and can achieve the following beneficial effects:

[0044] 1. The present application proposes a rolling plate surface defect detection method based on an improved YOLOv5 to solve the problem of low detection accuracy of weak feature defects in the rolling plate surface defect detection task, which reduces the probability of missed detection or false detection by strengthening weak feature extraction, enhancing global information interaction and cross-scale feature fusion, and improves the rolling plate surface defect detection accuracy.

[0045] 2. The present application uses multi-scale convolution kernels for parallel processing when extracting defect features through the RSCB operation, and combines the design of residual connection to enhance the sensitivity of the model to weak feature defects, improve the feature expression ability of the model, reduce the risk of gradient disappearance and gradient explosion during training, and ensure the stability of the model during training.

[0046] 3. The present application integrates image global semantic information and defect local detail features through the Conv-MLP operation, optimizes the comprehensiveness of feature expression, further enhances the feature interaction ability between different regions, and improves the detection ability of the model for large-span and complex defects.

[0047] 4、The application promotes the fusion between cross-scale features through the Fusion operation, enhances the adaptability to multi-scale defects, compensates the deep features with the shallow features, avoids the feature loss problem caused by multiple feature processing, and further improves the robustness and detection accuracy of the model. BRIEF DESCRIPTION OF DRAWINGS

[0048] The accompanying drawings, which form a part of this application, are intended to provide further understanding of the application and are incorporated herein in their entirety, and together with the general description of the application and the detailed description of the illustrative embodiments, serve to explain the application. In the drawings:

[0049] Figure 1 A flow chart of the rolling plate surface defect detection method based on the improved YOLOv5 is provided for the application;

[0050] Figure 2 A backbone module structure diagram of the method provided for the application;

[0051] Figure 3 A CBS operation principle diagram;

[0052] Figure 4 RSCB operation principle;

[0053] Figure 5 SPPF operation principle;

[0054] Figure 6 A neck module structure diagram of the method provided for the application;

[0055] Figure 7 Conv-MLP operation principle diagram;

[0056] Figure 8 Fusion operation principle diagram;

[0057] Figure 9 C3 operation principle diagram;

[0058] Figure 10 Image comparison diagram of different models detecting the same defect sample DETAILED DESCRIPTION

[0059] The application will be further described below in conjunction with the drawings and examples, but the content of the application is not limited to the scope described.

[0060] As shown in Figure 1 An improved YOLOv5-based rolling plate surface defect detection method, characterized in that: a rolling plate surface defect detection method is constructed based on a backbone module, a neck module and a head module.

[0061] The backbone module is as shown in Figure 2As shown, comprising: based on CSPDarknet architecture and by CBS operation, RSCB operation and SPPF operation, characterized by: performing CBS 6×6 operation on the input image to obtain feature F1; performing CBS 3×3 operation on feature F1 to obtain feature F2; performing RSCB operation on feature F2 to obtain feature F3; performing CBS 3×3 operation on feature F3 to obtain feature F4; performing RSCB operation on feature F4 to obtain feature F5; performing CBS 3×3 operation on feature F5 to obtain feature F6; performing RSCB operation on feature F6 to obtain feature F7; performing CBS 3×3 operation on feature F7 to obtain feature F8; performing RSCB operation on feature F8 to obtain feature F9; performing SPPF operation on feature F9 to obtain feature F 10 ; feature F 10 is the output feature of the backbone module.

[0062] The CBS i×i operation, as shown, comprises: sequentially performing convolution operation with convolution kernel size i x i (i is an integer greater than 0), BatchNorm operation and SiLU activation function operation. Figure 3

[0063] The RSCB, as shown in Figure 4 , comprises: performing CBS 3×3 operation on the input feature to obtain feature R1, respectively performing BBS 3×3 and BBS 5×5 operation on feature R1, and performing feature splicing and BBS 7×7 operation on the obtained two features to obtain feature R2, performing feature splicing operation on feature R2 and feature R1 and BBS 7×7 operation to obtain feature R3, and performing feature splicing and CSB 3×3 operation on feature R3 and feature R1 to obtain the output feature of RSCB.

[0064] The SPPF operation, comprising: performing CBS 1×1 operation on the input feature to obtain feature Y1, sequentially performing three maximum pooling operations on feature Y1 to obtain feature Y2, feature Y3 and feature Y4; performing feature splicing and CBS 1×1 operation on feature Y1, feature Y2, feature Y3 and feature Y4 to obtain the output feature.

[0065] The BBS i×i ​The operation includes: performing a blueprint separable convolution operation with a convolution kernel size of i×i (the value of i is an integer greater than 0), a BatchNorm operation, and a SiLU activation function operation on the input features in sequence.

[0066] The backbone modules are as follows Figure 5 As shown, it includes: based on the PANet architecture and constructed by C3 operation, Conv-MLP operation and Fusion operation, characterized in that: the first Conv-MLP operation is performed on the input feature to obtain the feature F 11 ; For feature F 11 Perform upsampling operation to obtain feature F 12 ; for F 12 Concatenate the features with F7 and perform C3 and the second Conv-MLP operation in sequence to obtain the feature F 15 ; For feature F 15 Perform upsampling operation to obtain feature F 16 ; For features F2, F5 and F 16 Perform the first Fusion operation and then the C3 operation to obtain the feature F 18 ; For feature F 18 Perform the third Conv-MLP operation to obtain feature F 19 ; For feature F2, feature F 15 and feature F 19 Perform the second Fusion operation and C3 operation to obtain feature F 21 ; For feature F 21 Perform the fourth Conv-MLP operation to obtain feature F 22 ; For feature F2, feature F 11 and feature F 22 Perform the third Fusion operation and C3 operation to obtain feature F 24 .

[0067] The Conv-MLP operation is as follows Figure 6 As shown, it includes: performing Shift-MLP and CBS on the input features in sequence i×i Operation; Among them, the first Conv-MLP operation and the second Conv-MLP operation adopt CBS 1×1 , while CBS is used in the third and fourth Conv-MLP operations 3×3 .

[0068] The Shift-MLP operation includes: performing a vertical sliding operation, a Linear operation, a DWConv operation, a GELU activation function operation, a Dropout operation, a horizontal sliding operation, a Linear operation, and a Dropout operation on the input features in sequence.

[0069] The Fusion operation is as shown in Figure 7 , including: performing an average pooling operation on the feature F2 and performing a feature splicing operation with the middle layer feature and the deep layer feature to obtain a feature S1, sequentially performing CBS 1×1 and CBS 3×3 operations on the feature S1 to obtain an output feature. Wherein, the middle layer feature in the first Fusion operation is the feature F5, and the deep layer feature is the feature F 16 ; the middle layer feature in the second Fusion operation is the feature F 15 , and the deep layer feature is the feature F 19 ; the middle layer feature in the third Fusion operation is the feature F 11 , and the deep layer feature is the feature F 22 .

[0070] The C3 operation is as shown in Figure 8 , including: performing a CBS 1×1 operation and a CBS 1×1 operation on the input feature respectively to obtain a feature C1 and a feature C2 respectively, sequentially performing three Bottleneck operations on the feature C1 to obtain a feature C3; performing a feature splicing operation on the feature C3 and the feature C2 to obtain a feature C4; performing a CBS 1×1 operation on the feature C4 to obtain the output feature of C3. The Bottleneck operation is a single CBS 1×1 and CBS 3×3 operation in series.

[0071] The head module comprises: using a native head module of a YOLOv5 model and combining the features F 18 , the feature F 21 and the feature F 24 to perform a final defect detection and positioning operation.

[0072] Embodiment:

[0073] Referring to Figure 1 , Figure 2 , Figure 3 , Figure 4 , Figure 5 , Figure 6 , Figure 7 and Figure 8 , the present application proposes a rolling plate surface defect detection method based on an improved YOLOv5, comprising the following steps:

[0074] S1, data set preprocessing: the surface defect data set of the hot-rolled steel strip of Northeastern University (NEU-DET) is selected for experiment, the data set contains six typical steel strip surface defect image data of rolled oxide skin, patch, cracking, pitting surface, inclusion and scratch, each type of defect has 200 defect samples, and the data set has a total of 1800 defect samples. The data set is divided into a training verification set and a test set in a ratio of 8:2, and the training verification set is divided into a training set and a verification set in a ratio of 8:2.

[0075] S2, model training: YOLOv10x, YOLOv10s, YOLOv9e, YOLOv9c and YOLOv8x are selected as comparative models, all models are set to Batchsize of 4 during training, and NVIDIA GeForce RTX3090Ti is used to train 200 Epoch on the training set and the verification set. In a single training process, the training set is divided into small batch samples according to the proportion of Batchsize, and the samples are sequentially forwarded through the backbone module, the neck module and the head module to generate the corresponding prediction output. The loss function is calculated based on the prediction output and the target value, and the model parameters (weights and biases) are updated through the back propagation algorithm. During the training process, the performance of the model under the current training weight is evaluated by using the verification set, and the training process and model design are optimized according to the evaluation results, and the hyperparameter configuration is adjusted as necessary to further improve the detection performance of the model.

[0076] S3, training result: after the training is completed, the model weight with the best performance on the verification set is selected to evaluate the performance on the test set. The average precision mean (mAP@0.5), precision (P), recall (R) and F1 score (F1-score) of the intersection over union threshold of 0.5 are calculated to comprehensively evaluate the detection accuracy, detection rate and comprehensive performance of the model in the defect detection task.

[0077] In this embodiment, the results of the corresponding model optimal weight on the test set are quantitatively compared and qualitatively compared; Table 1 is the quantitative comparison results of the optimal weight of different models on the NEU-DET data set on the test set. As shown in Table 1, the method proposed in the present application is more advanced than the current target detection method in multiple indicators under the condition of lower parameter quantity, which also verifies the effectiveness of the method proposed in the present application.

[0078] Table 1 quantitative comparison results on NEU-DET data set

[0079]

[0080] Figure 9This is an image comparison of samples with the same defect detected by different models. Manually annotated data (Ground-Truth, GT) is used as standard data for comparison. The comparison results show that the method proposed in the present invention is better than the compared advanced methods in identifying and locating typical defects on the steel strip surface on this dataset.

[0081] The specific embodiments of the present invention are described in detail above with reference to the accompanying drawings. However, the present invention is not limited to the above embodiments. Various changes can be made within the knowledge of ordinary technicians in this field without departing from the scope of the present invention.

Claims

1. A method for detecting surface defects of rolled plates based on improved YOLOv5; the method is characterized by comprising the following steps: S1. A method for detecting surface defects of rolled plates is constructed based on a backbone module, a neck module, and a head module; S2, constructing a backbone module based on CSPDarknet, including convolutional normalization activation operation (Conv-BatchNorm-SiLU, CBS), residual synchronized convolution operation (Residual Synchronized Convolutional Block, RSCB) and fast spatial pyramid pooling operation (Spatial PyramidPooling-Fast, SPPF); S3, the backbone module described in step S2, characterized by comprising: Perform CBS on the input image 6×6 The operation obtains feature F1; Perform CBS on feature F1 3×3 The operation obtains feature F2; Perform RSCB operation on feature F2 to obtain feature F3; Perform CBS on feature F3 3×3 The operation obtains feature F4; Perform RSCB operation on feature F4 to obtain feature F5; Perform CBS on feature F5 3×3 The operation obtains feature F6; Perform RSCB operation on feature F6 to obtain feature F7; Perform CBS on feature F7 3×3 The operation obtains feature F8; Perform RSCB operation on feature F8 to obtain feature F9; Perform SPPF operation on feature F9 to obtain feature F 10 ; S4, step S3 is characterized in that the RSCB operation is: performing CBS on the input features 3×3 The feature R1 is obtained by the operation, and the feature R1 is subjected to BBS based on the Blueprint Separable Conv-BatchNorm-SiLU (BBS) 3×3 and BBS 5×5 Operation, and the two features are spliced ​​and BBS 7×7 The feature R2 is obtained by operation, and the feature R2 is spliced ​​with the feature R1 and BBS is performed. 7×7 The operation obtains feature R3, which is then concatenated with feature R1 and CSB is performed. 3×3 The operation obtains the RSCB output characteristics; S5. Construct a neck module based on PANet, which includes a three-convolution CSP operation (CSPBottleneck with 3Convolutions, C3), a convolution-multilayer perceptron operation (Conv-Multilayer Perceptron, Conv-MLP) and a feature fusion operation (Fusion); S6. The neck module described in step S5, characterized by comprising: For the input feature F 10 Perform the first Conv-MLP operation to obtain feature F 11 ; For feature F 11 Perform upsampling operation to obtain feature F 12 ; F 12 Concatenate the features with F7 and perform C3 and the second Conv-MLP operation in sequence to obtain the feature F 15 ; For feature F 15 Perform upsampling operation to obtain feature F 16 ; For features F2, F5 and F 16 Perform the first Fusion operation and then the C3 operation to obtain the feature F 18 ; For feature F 18 Perform the third Conv-MLP operation to obtain feature F 19 ; For feature F2 and feature F 15 and feature F 19 Perform the second Fusion operation and C3 operation to obtain feature F 21 ; For feature F 21 Perform the fourth Conv-MLP operation to obtain feature F 22 ; For feature F2 and feature F 11 and feature F 22 Perform the third Fusion operation and C3 operation to obtain feature F 24 ; S7, step S6 is characterized in that the Conv-MLP operation is: Shift-MLP and CBS are performed on the input features in sequence i×i Operation, the first Conv-MLP operation and the second Conv-MLP operation in step S6 adopt CBS 1×1 , while CBS is used in the third and fourth Conv-MLP operations 3×3 ; S8, step S6 is characterized in that the fusion operation is: perform an average pooling operation on the feature F2 and perform feature splicing operation on the middle layer feature and the deep layer feature to obtain the feature S1, and perform CBS on the feature S1 in sequence. 1×1 and CBS 3×3 The output features are obtained by operation; among them, the middle-level features in the first Fusion operation are features F5, and the deep features are features F 16 ; The middle-level feature in the second Fusion operation is feature F 15 , the deep feature is feature F 19 ; The middle-level feature in the third Fusion operation is feature F 11 , the deep feature is feature F 22 ; S9, based on the head module of YOLOv5 itself, combined with feature F 18 , Feature F 21 and feature F 24 Perform defect detection and positioning operations.

2. The method for detecting surface defects of rolled plate based on improved YOLOv5 according to claim 1, characterized in that: The CBS in step S3 i×i The operation is: perform the convolution operation with a convolution kernel size of i×i, where i is an integer greater than 0, the BatchNorm operation, and the SiLU activation function operation in sequence.

3. The method for detecting surface defects of rolled plate based on improved YOLOv5 according to claim 1, characterized in that: The SPPF operation in step S3 is: perform CBS on the input features. 1×1 The feature Y1 is obtained by operation, and three maximum pooling operations are performed on the feature Y1 to obtain the feature Y2, feature Y3 and feature Y4 respectively; the feature Y1, feature Y2, feature Y3 and feature Y4 are concatenated and CBS is performed 1×1 The operation obtains the output features.

4. The method for detecting surface defects of rolled plate based on improved YOLOv5 according to claim 1, characterized in that: The BBS in step S4 i×i The operation is: sequentially perform the convolution kernel size of i×i, where i is an integer greater than 0, the blueprint separable convolution operation, the BatchNorm operation, and the SiLU activation function operation.

5. The method for detecting surface defects of rolled plate based on improved YOLOv5 according to claim 1, characterized in that: The C3 operation in step S5 is to perform CBS on the input features respectively. 1×1 Operation and CBS 1×1 Operation, respectively get the feature C1 and feature C2, perform three Bottleneck operations on feature C1 to get feature C3; concatenate feature C3 with feature C2 to get feature C4; perform CBS on feature C4 1×1 The output features of C3 can be obtained by operation.

6. The C3 operation according to claim 5, characterized in that: The Bottleneck operation consists of a single CBS 1×1 and CBS 3×3 The result of serial operation.

7. The method for detecting surface defects of rolled plate based on improved YOLOv5 according to claim 1, characterized in that: The Shift-MLP operation in step S6 is: performing vertical sliding operation, Linear operation, DWConv operation, GELU activation function operation, Dropout operation, horizontal sliding operation, Linear operation and Dropout operation on the input features in sequence.

Citation Information

Patent Citations

  • Improved YOLOv5s-based injection molding part surface defect detection method

    CN116542932A

  • Strip steel surface defect detection method and system based on improved YOLOv5

    CN117011231A