Method and device for realizing defect detection of metal strip steel

Through the improved YOLOv8 network model and preprocessing technology, the problem of image noise and feature extraction in metal strip defect detection is solved, the detection accuracy and efficiency are improved, the industrial real-time requirements are met, and the metal strip defect detection is achieved.

CN118967612AActive Publication Date: 2024-11-15GUANGDONG UNIV OF TECH

Patent Information

Application Number
CN202411026478.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-07-30
Publication Date
2024-11-15
Estimated Expiration
2044-07-30

AI Technical Summary

Technical Problem

The existing metal strip defect detection methods have the influence of image noise under uneven lighting conditions and the defect characteristics are not obvious, resulting in a decrease in detection accuracy; small target and large-scale defects are easily confused, resulting in mis-detection and missed detection problems; complex model parameters Large, large calculations, and cannot meet the real-time requirements of industrial enterprises.

Method used

The improved YOLOv8 network model is adopted to improve image quality through wavelet denoising algorithm and image enhancement processing; the backbone network of the YOLOv8 network is replaced by the CG module, the Soft-DCNv4-SPPF module replaces SPPF, and the C2f-BES module replaces C2f of the neck network. Enhance feature extraction capabilities and detection accuracy; train the model under the PyTorch framework to optimize the network structure to reduce the amount of parameters and improve detection speed.

Benefits of technology

It improves the accuracy and efficiency of defect detection of metal strip steel, reduces false detection and missed detection problems, meets the industry's high real-time requirements for surface defect detection, and the model has the advantages of small capacity, high accuracy and strong generalization ability.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118967612A_ABST
    Figure CN118967612A_ABST
Patent Text Reader

Abstract

The invention relates to a metal strip steel defect detection method and device, and the method comprises the following steps: capturing a trigger signal of a to-be-detected area, and obtaining a to-be-detected image of the to-be-detected area when the trigger signal is obtained; preprocessing the to-be-detected image to obtain a preprocessed to-be-detected image; inputting the preprocessed image to be detected into a pre-trained improved YOLOv8 network model, and outputting a defect detection result; if the defect detection result shows that the metal strip steel has defects, sorting the metal strip steel in the to-be-detected area to an unqualified area, and if the defect detection result shows that the metal strip steel does not have defects, sorting the metal strip steel in the to-be-detected area to a qualified area; real-time defect detection of the metal strip steel is completed by using a deep learning method, and the method is used for solving the problems that noise exists on the image surface, the scale change is large, detection is difficult, the model parameter quantity is large, and the detection speed is low.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field related to machine vision, and in particular to a method and device for realizing metal strip defect detection. Background Art

[0002] At present, most of the defects in metal strips are detected manually, with workers with a certain level of experience conducting on-site inspections and independently determining the defects based on the on-site inspections. This method is very dependent on the experience of the workers and has relatively large errors. Some methods also use machine vision to perform automated inspections. The existing methods of using machine vision to detect defects in metal strips have certain limitations, which are mainly reflected in the following three aspects:

[0003] First, under the influence of uneven lighting conditions, there is noise on the image surface and the defect features are not obvious, which will lead to a decrease in the accuracy of metal strip defect detection.

[0004] Second, metal strips have defects that are difficult to detect, such as small target defects, large-scale defects, and easily confused defects, which will cause the model to have false detection and missed detection problems.

[0005] Third, the huge number of parameters and calculations in complex models lead to slow detection speed and low efficiency, which cannot meet the industry's high real-time requirements for surface defect detection. Summary of the invention

[0006] The purpose of the present invention is to solve at least one of the deficiencies of the prior art and to provide a method and device for detecting defects in metal strips.

[0007] In order to achieve the above object, the present invention adopts the following technical solutions:

[0008] Specifically, a method for detecting defects in metal strips is proposed, comprising the following steps:

[0009] Capturing a trigger signal of the area to be detected, and acquiring an image to be detected of the area to be detected when the trigger signal is obtained;

[0010] Preprocessing the image to be tested to obtain a preprocessed image to be tested;

[0011] Input the preprocessed image to be tested into the pre-trained improved YOLOv8 network model and output the defect detection result;

[0012] If the defect detection result is defective, the metal strip in the area to be detected is sorted into an unqualified area; if the defect detection result is non-defective, the metal strip in the area to be detected is sorted into a qualified area;

[0013] Among them, the improved YOLOv8 network model includes using the CG module to replace the Conv of the backbone network of the original YOLOv8 network, using the Soft-DCNv4-SPPF module to replace the SPPF, and using the C2f-BES module to replace the C2f of the neck network.

[0014] Further, specifically, the preprocessing operation includes:

[0015] Denoising the image to be tested by using an improved wavelet denoising algorithm, and then performing image enhancement processing on the denoised image to obtain a preprocessed image to be tested;

[0016] Among them, the improved wavelet denoising algorithm includes:

[0017] The bior4.4 wavelet basis function is used to perform wavelet secondary decomposition on the image to be tested to obtain low-frequency image and high-frequency image;

[0018] The low-frequency image is enhanced by the Retinex algorithm based on Wiener filtering to obtain the processed low-frequency image, and the high-frequency image is filtered by the Garrote threshold method to obtain the processed high-frequency image.

[0019] Performing wavelet reconstruction on the processed low-frequency image and the processed high-frequency image to obtain a reconstructed image;

[0020] The reconstructed image is enhanced by limited contrast adaptive histogram equalization to obtain a denoised image.

[0021] Further, specifically, the CG module is used to replace the Conv of the backbone network of the original YOLOv8 network, including:

[0022] Based on the original YOLOv8 network, the CG module is placed in the 1st, 3rd, 5th and 7th layers of YOLOv8, replacing the original Conv module.

[0023] Further, specifically, the Soft-DCNv4-SPPF module is used to replace SPPF, including:

[0024] DCNv4 includes DCNv4 convolution, Batch Normalization, and SiLU activation function. DCNv4 first groups the input feature map by channel, uses convolution to calculate the offset and weight of each position of each group, and then calculates the result based on the offset and weight. Finally, the convolution results of all groups are concatenated to form the output feature C1.

[0025] After three serial SoftPool operations, SoftPool divides the input image into multiple local regions and calculates the eigenvalue weight for each region R. The calculation formula is:

[0026]

[0027] Where R is the local area of ​​feature map a, a i is the eigenvalue, W i is the eigenvalue weight;

[0028] Get the weight W i After that, multiply it with the corresponding eigenvalue and then sum it up to output the pooling result. The calculation formula is:

[0029]

[0030] in is the output eigenvalue;

[0031] After three SoftPools, the output features P1, P2, and P3 are obtained respectively;

[0032] Concat the output features P1, P2, P3 with the output feature C1 after DCNv4 convolution to obtain the fused features;

[0033] Perform DCNv4 convolution on the fused features.

[0034] Further, specifically, the C2f-BES module is used to replace the C2f of the neck network, including:

[0035] The improved C2f-BES module is built on Neck and placed on the 12th, 15th, 18th, and 21st layers of YOLOv8 to replace the original C2f module.

[0036] The process of improving the C2f-BES module includes:

[0037] The input features are first subjected to the first standard convolution, and then layered using Split features, one layer of which is directly passed to Concat, and the other layer is processed by multiple Bottleneck-ES;

[0038] Each Bottleneck-ES layer consists of two SCConv convolutions and an EMA attention mechanism. SCConv consists of a spatial reconstruction unit SRU and a channel reconstruction unit CRU. First, the SRU module performs an input feature Figure X By using the classification-reconstruction method to reduce spatial redundant features, we can obtain spatial refined features X w Then, the CRU module is used to adopt the segmentation-conversion-fusion strategy to reduce channel redundant features and obtain channel refined features Y, and then the EMA attention mechanism is added to improve the feature processing ability of small targets;

[0039] The input and output of multiple Bottleneck-ES layers are fused with the output that has not passed through Bottleneck-ES;

[0040] Then it goes through a second standard convolution process, and finally the features are further enhanced through the EMA attention mechanism.

[0041] Further, specifically, the training process of the improved YOLOv8 network includes,

[0042] Obtaining a metal strip defect data set, processing it through the preprocessing operation to obtain a preprocessed data set, and randomly dividing the preprocessed data set into a training set, a validation set, and a test set in a ratio of 7:2:1;

[0043] The defect dataset is used, and the improved YOLOv8 network model is trained based on the yolov8s.pt pre-trained weights obtained by training on the large training set COCO. The training is carried out under the PyTorch network framework, and the stochastic gradient descent SGD is used for training. The momentum is set to 0.937, the confidence threshold is 0.25, the IoU threshold is 0.45, the training cycle (epochs) is 300 rounds, the input image size is 640×640, the batch size is 16, the initial learning rate is 0.01, and the data enhancement is Mosaic.

[0044] After the training is completed, a weight file capable of detecting surface defects of metal strip is obtained.

[0045] The present invention also proposes a device for realizing metal strip defect detection, comprising the following:

[0046] The conveyor belt is fixed at a preset position and is used to drive the metal strip to move;

[0047] Photoelectric sensor, used to detect whether there is metal strip in the preset detection area of ​​the conveyor belt, and send a trigger signal when there is metal strip;

[0048] An image acquisition device, comprising a light source controller, a linear light source, a line scan camera and a lens;

[0049] A robotic arm for sorting metal strips;

[0050] The industrial computer is connected to the photoelectric sensor, the light source controller, the line scan camera and the robotic arm in communication, and the industrial computer integrates the following functional modules:

[0051] A data acquisition module is used to capture a trigger signal of the area to be detected. When the trigger signal is obtained, the light source is turned on and the light intensity is adjusted according to a preset program, and the line scan camera and lens are controlled to collect images and transmit them back to obtain the image to be detected of the area to be detected;

[0052] A preprocessing module, used for preprocessing the image to be tested to obtain a preprocessed image to be tested;

[0053] The detection result prediction module is used to input the preprocessed image to be tested into the pre-trained improved YOLOv8 network model and output the defect detection result;

[0054] A sorting module, used for sorting the metal strip in the area to be inspected to an unqualified area by a robot arm when the defect detection result is defective, and for sorting the metal strip in the area to be inspected to an qualified area by a robot arm when the defect detection result is non-defective;

[0055] Among them, the improved YOLOv8 network model includes using the CG module to replace the Conv of the backbone network of the original YOLOv8 network, using the Soft-DCNv4-SPPF module to replace the SPPF, and using the C2f-BES module to replace the C2f of the neck network.

[0056] Furthermore, specifically, the industrial computer is also configured with a human-computer interaction interface.

[0057] The beneficial effects of the present invention are:

[0058] The present invention proposes a method and device for realizing metal strip defect detection, which builds an industrial defect detection system platform to collect metal strip data sets required for network training and complete the metal strip defect detection work.

[0059] Secondly, the improved wavelet denoising is used on the image before inputting into the network model, which removes more noise while retaining the main information of the image, thereby achieving the purpose of strengthening the defect characteristics.

[0060] Thirdly, by improving SPPF, the Soft-DCNv4-SPPF module is obtained to enhance the feature extraction capability and reduce the false detection and missed detection problems of defect detection.

[0061] In addition, the C2f-BES module is obtained by improving C2f, which takes into account the accuracy and lightweight requirements of metal strip inspection tasks.

[0062] Finally, by optimizing the YOLOv8 network, the model has the advantages of small capacity, high precision, strong generalization ability, and is easy to deploy on the terminal. BRIEF DESCRIPTION OF THE DRAWINGS

[0063] The above and other features of the present disclosure will become more apparent by describing in detail the embodiments shown in the accompanying drawings. The same reference numerals in the accompanying drawings of the present disclosure represent the same or similar elements. Obviously, the accompanying drawings described below are only some embodiments of the present disclosure. For those skilled in the art, other accompanying drawings can be obtained based on these accompanying drawings without creative work. In the accompanying drawings:

[0064] Figure 1 Shown is a flow chart of a method for detecting defects in a metal strip according to the present invention;

[0065] Figure 2 The figure shows a structural principle diagram of a device for detecting defects in metal strips according to the present invention;

[0066] Figure 3 The figure shows a working flow chart of a device for detecting defects in metal strips according to the present invention;

[0067] Figure 4 Shown is the improved wavelet denoising flow chart of the present invention;

[0068] Figure 5 Shown is the overall structural principle diagram of the improved YOLOv8 algorithm in the present invention;

[0069] Figure 6 The figure shows the structural principle diagram of the Soft-DCNv4-SPPF module in the present invention;

[0070] Figure 7 Shown is a schematic diagram of the structure of the C2f-BES module in the present invention;

[0071] Figure 8 Shown is a schematic diagram of the structure of the Bottleneck-ES module in the present invention;

[0072] Fig. 9 The figure shows the defect detection result of an instance of applying the YOLOv8 network;

[0073] Fig.10 Shown is a diagram showing defect detection results of this example after applying a method for metal strip defect detection according to the present invention. DETAILED DESCRIPTION

[0074] The following will be combined with the embodiments and drawings to clearly and completely describe the concept, specific structure and technical effects of the present invention, so as to fully understand the purpose, scheme and effect of the present invention. It should be noted that the embodiments in this application and the features in the embodiments can be combined with each other without conflict. The same reference numerals used throughout the drawings indicate the same or similar parts.

[0075] Example 1, reference Figure 1 The present invention proposes a method for detecting defects in metal strips, comprising the following steps:

[0076] Capturing a trigger signal of the area to be detected, and acquiring an image to be detected of the area to be detected when the trigger signal is obtained;

[0077] Preprocessing the image to be tested to obtain a preprocessed image to be tested;

[0078] Input the preprocessed image to be tested into the pre-trained improved YOLOv8 network model and output the defect detection result;

[0079] If the defect detection result is defective, the metal strip in the area to be detected is sorted into an unqualified area; if the defect detection result is non-defective, the metal strip in the area to be detected is sorted into a qualified area;

[0080] Among them, the improved YOLOv8 network model includes using the CG module to replace the Conv of the backbone network of the original YOLOv8 network, using the Soft-DCNv4-SPPF module to replace the SPPF, and using the C2f-BES module to replace the C2f of the neck network.

[0081] Reference Figure 4 As a preferred embodiment of the present invention, specifically, the pretreatment operation includes:

[0082] Denoising the image to be tested by using an improved wavelet denoising algorithm, and then performing image enhancement processing on the denoised image to obtain a preprocessed image to be tested;

[0083] Among them, the improved wavelet denoising algorithm includes:

[0084] The bior4.4 wavelet basis function is used to perform wavelet secondary decomposition on the image to be tested to obtain low-frequency image and high-frequency image;

[0085] The low-frequency image is enhanced by the Retinex algorithm based on Wiener filtering to obtain the processed low-frequency image, and the high-frequency image is filtered by the Garrote threshold method to obtain the processed high-frequency image.

[0086] Performing wavelet reconstruction on the processed low-frequency image and the processed high-frequency image to obtain a reconstructed image;

[0087] The reconstructed image is enhanced by limited contrast adaptive histogram equalization to obtain a denoised image.

[0088] In this preferred embodiment, considering that noise is inevitably mixed in the process of acquiring the metal strip image, the traditional wavelet denoising principle is to select a suitable wavelet basis and decomposition layer number to perform wavelet decomposition on the noise image to obtain low-frequency components and high-frequency components. The noise of the signal is mainly concentrated on the high-frequency component. The high-frequency component is thresholded, and then the low-frequency component and the processed high-frequency component are reconstructed by inverse wavelet transform to obtain a denoised image. The present invention makes improvements on this basis: the traditional Retinex algorithm uses Gaussian filtering to estimate illumination, and the resulting image usually loses detail information. Using Wiener filtering to replace Gaussian filtering to estimate illumination can retain more detail information and avoid distortion. The Retinex algorithm based on Wiener filtering is used to enhance the low-frequency image. The wavelet reconstructed image is then enhanced by contrast-limited adaptive histogram equalization (CLAHE) to strengthen the features of the defective area and improve the image contrast.

[0089] As a preferred embodiment of the present invention, specifically, the CG module is used to replace the Conv of the backbone network of the original YOLOv8 network, including:

[0090] Based on the original YOLOv8 network, the CG module is placed in the 1st, 3rd, 5th and 7th layers of YOLOv8, replacing the original Conv module.

[0091] In this preferred embodiment, by fusing local and global context information, the feature expression capability of the model is enhanced so that it can learn richer details and semantic information.

[0092] Reference Figure 6 As a preferred implementation of the present invention, specifically, the Soft-DCNv4-SPPF module is used to replace the SPPF, including:

[0093] DCNv4 includes DCNv4 convolution, Batch Normalization, and SiLU activation function. DCNv4 first groups the input feature map by channel, uses convolution to calculate the offset and weight of each position of each group, and then calculates the result based on the offset and weight. Finally, the convolution results of all groups are concatenated to form the output feature C1.

[0094] After three serial SoftPool operations, SoftPool divides the input image into multiple local regions and calculates the eigenvalue weight for each region R. The calculation formula is:

[0095]

[0096] Where R is the local area of ​​feature map a, a i is the eigenvalue, Wi is the eigenvalue weight;

[0097] Get the weight W i After that, multiply it with the corresponding eigenvalue and then sum it up to output the pooling result. The calculation formula is:

[0098]

[0099] in is the output eigenvalue;

[0100] After three SoftPools, the output features P1, P2, and P3 are obtained respectively;

[0101] Concat the output features P1, P2, P3 with the output feature C1 after DCNv4 convolution to obtain the fused features;

[0102] Perform DCNv4 convolution on the fused features.

[0103] In this preferred embodiment, considering that the traditional SPPF module uses two standard convolutions Conv and three maximum pooling MaxPools in series to extract input features, it can only represent local information of the input features. The present invention replaces MaxPool with soft pooling (SoftPool) to retain more feature information by weighted averaging, and uses deformable convolution v4 (DCNv4) to replace the two standard convolutions in SPPF to effectively extract more comprehensive features, thus obtaining a Soft-DCNv4-SPPF module. This module can increase the receptive field range of defect features and effectively reduce the problem of false detection and missed detection.

[0104] Reference Figure 7 As a preferred embodiment of the present invention, specifically, the C2f of the neck network is replaced by the C2f-BES module, including:

[0105] The improved C2f-BES module is built on Neck and placed on the 12th, 15th, 18th, and 21st layers of YOLOv8 to replace the original C2f module.

[0106] The process of improving the C2f-BES module includes:

[0107] The input features are first subjected to the first standard convolution, and then layered using Split features, one layer of which is directly passed to Concat, and the other layer is processed by multiple Bottleneck-ES;

[0108] Each Bottleneck-ES layer consists of two SCConv convolutions and an EMA attention mechanism. SCConv consists of a spatial reconstruction unit SRU and a channel reconstruction unit CRU. First, the SRU module performs an input feature Figure X By using the classification-reconstruction method to reduce spatial redundant features, we can obtain spatial refined features X w Then, the CRU module is used to adopt the segmentation-conversion-fusion strategy to reduce channel redundant features and obtain channel refined features Y, and then the EMA attention mechanism is added to improve the feature processing ability of small targets;

[0109] The input and output of multiple Bottleneck-ES layers are fused with the output that has not passed through Bottleneck-ES;

[0110] Then it goes through a second standard convolution process, and finally the features are further enhanced through the EMA attention mechanism.

[0111] In this preferred embodiment, considering that the C2f module in the traditional YOLOv8 passes the input data through the first convolution layer cv1, and then divides the output into two parts. One part is directly passed to the output, and the other part is processed by multiple Bottleneck modules. Finally, the results of the two parts are spliced ​​in the channel dimension and passed through the second convolution layer cv2 to obtain the final output. The original C2f module has insufficient feature extraction capabilities for surface defects of metal strips, which easily causes small targets to be missed. The present invention improves the original C2f module and designs a new module C2f-BES module:

[0112] (1) Replace the two Convs in the Bottleneck layer with spatial and channel reconstruction convolution SCConv, and add an EMA (Efficient Multi-Scale Attention) attention module after the second SCConv to obtain Bottleneck-ES;

[0113] (2) Then replace the Bottleneck layer in the C2f module with Bottleneck-ES, and add an EMA attention module after the second Conv in the C2f module to obtain the C2f-BES module. This module not only helps the network learn better features with fewer parameters, but also improves the detection performance of small targets, thereby meeting the high real-time requirements of industry for surface defect detection.

[0114] Reference Figure 5 as well as Figure 8In summary, considering the problems of false detection, missed detection and slow detection speed of the original YOLOv8 when detecting metal strips, the present invention replaces the SPPF module of the backbone network with the improved Soft-DCNv4-SPPF module, and replaces the C2f module of the neck network with the improved C2f-BES module. And use the CG (Context Guided) module to replace the Conv of the backbone. The optimized YOLOv8 not only enhances the feature expression ability of the model, but also maintains the detection accuracy of the model while greatly reducing the network parameters.

[0115] As a preferred embodiment of the present invention, specifically, the training process of the improved YOLOv8 network includes:

[0116] Obtaining a metal strip defect data set, processing it through the preprocessing operation to obtain a preprocessed data set, and randomly dividing the preprocessed data set into a training set, a validation set, and a test set in a ratio of 7:2:1;

[0117] Use defect datasets and the improved YOLOv8 network model for training based on the yolov8s.pt pre-trained weights trained on the large training set COCO; Fig. 9 and Fig.10 The experimental configuration environment of the present invention is NVIDIA GeForce RTX 4060Ti, 32G memory, Python 3.8 version, torch 2.2.2 version, CUDA 12.1 version, trained under the PyTorch network framework, using stochastic gradient descent SGD for training, momentum Momentum is set to 0.937, confidence threshold is 0.25, IoU threshold is 0.45, training cycle (epochs) is 300 rounds, input image size is 640×640, batch size is 16, initial learning rate is 0.01, and data enhancement uses Mosaic.

[0118] In this preferred embodiment, after training is completed, a weight file capable of detecting surface defects of metal strip is obtained, and then the YOLOv8 weight file is deployed to the industrial computer of the actual detection platform, so that the metal strip image transmitted by the line scan camera can be processed in real time and the defects therein can be detected.

[0119] The specific application process of constructing the data set includes the following:

[0120] The constructed platform is used to collect images of metal strips, with an image resolution of 2048×1000 and a picture format of jpg. The bior4.4 wavelet basis function is used to perform wavelet secondary decomposition on the collected metal strip images to obtain low-frequency images and high-frequency images. In order to better remove noise and highlight defect features, the Retinex algorithm based on Wiener filtering is used to enhance the low-frequency image, and the high-frequency image is filtered using the Garrote threshold method. The processed low-frequency image and high-frequency image are reconstructed by wavelet, and the image after wavelet reconstruction is enhanced by restricted contrast adaptive histogram equalization, and finally the denoised image is output. The algorithm flow chart is as follows: Figure 4 As shown;

[0121] Due to the small number of collected images, a certain number of data sets are required to serve as training sets during the model training process. Therefore, translation, flipping, rotation, scaling, stretching, and shearing are used to enhance the data set and enrich the number of data set samples. The total number of images is expanded to 8,000.

[0122] LabelImg was used to annotate the dataset and named seven types of defects, namely, punching, weld, crescent bay, water spot, oil spot, silk spot, and foreign matter. The location and category information of the defects were saved as a txt file in YOLO format.

[0123] Reference Figure 2 as well as Figure 3 , Embodiment 2, the present invention also proposes a device for realizing metal strip defect detection, comprising the following:

[0124] The conveyor belt is fixed at a preset position and is used to drive the metal strip to move;

[0125] Photoelectric sensor, used to detect whether there is metal strip in the preset detection area of ​​the conveyor belt, and send a trigger signal when there is metal strip;

[0126] An image acquisition device, comprising a light source controller, a linear light source, a line scan camera and a lens;

[0127] A robotic arm for sorting metal strips;

[0128] The industrial computer is connected to the photoelectric sensor, the light source controller, the line scan camera and the robotic arm in communication, and the industrial computer integrates the following functional modules:

[0129] A data acquisition module is used to capture a trigger signal of the area to be detected. When the trigger signal is obtained, the light source is turned on and the light intensity is adjusted according to a preset program, and the line scan camera and lens are controlled to collect images and transmit them back to obtain the image to be detected of the area to be detected;

[0130] A preprocessing module, used for preprocessing the image to be tested to obtain a preprocessed image to be tested;

[0131] The detection result prediction module is used to input the preprocessed image to be tested into the pre-trained improved YOLOv8 network model and output the defect detection result;

[0132] A sorting module, used for sorting the metal strip in the area to be inspected to an unqualified area by a robot arm when the defect detection result is defective, and for sorting the metal strip in the area to be inspected to an qualified area by a robot arm when the defect detection result is non-defective;

[0133] In this embodiment 2, a metal strip defect detection platform is constructed as follows Figure 2 The overall workflow of the system is as shown in Figure 3 As shown: First, turn on the camera, light source, photoelectric sensor, robotic arm, and industrial computer to complete initialization, then start the conveyor belt to load the metal strip into the area to be detected. When the photoelectric sensor in the area to be detected detects a signal, the signal is transmitted to the industrial computer. The industrial computer turns on the light source and adjusts the light intensity according to the settings, controls the color line scan camera and lens to collect images and transmit them back, displays the transmitted images on the human-computer interaction interface, and performs defect detection and analysis. If no defects are detected, the conveyor belt continues to transport to the qualified area. If defects are detected, the industrial computer controls the robotic arm to automatically sort the defective strip into the unqualified area.

[0134] Among them, the improved YOLOv8 network model includes using the CG module to replace the Conv of the backbone network of the original YOLOv8 network, using the Soft-DCNv4-SPPF module to replace the SPPF, and using the C2f-BES module to replace the C2f of the neck network.

[0135] As a preferred implementation mode of the present invention, specifically, the industrial computer is also configured with a human-computer interaction interface.

[0136] In this preferred embodiment, considering the human-computer interaction problem in practical applications, a human-computer interaction interface is configured for the industrial computer to increase the operability of the industrial computer.

[0137] In addition, each functional module in each embodiment of the present invention may be integrated into one processing module, or each module may exist physically separately, or two or more modules may be integrated into one module. The above-mentioned integrated module may be implemented in the form of hardware or in the form of software functional modules.

[0138] If the integrated module is implemented in the form of a software function module and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the present invention implements all or part of the processes in the above-mentioned embodiment method, and can also be completed by instructing the relevant hardware through a computer program. The computer program can be stored in a computer-readable storage medium, and the computer program can implement the steps of the above-mentioned various method embodiments when executed by the processor. Among them, the computer program includes computer program code, and the computer program code can be in source code form, object code form, executable file or some intermediate form. The computer-readable medium may include: any entity or system that can carry the computer program code, recording medium, U disk, mobile hard disk, disk, optical disk, computer memory, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), electrical carrier signal, telecommunication signal and software distribution medium, etc.

[0139] Although the description of the present invention has been quite detailed and specifically describes several described embodiments, it is not intended to be limited to any of these details or embodiments or any particular embodiment, but should be regarded as providing a broad possible interpretation of these claims in view of the prior art by reference to the appended claims, thereby effectively covering the intended scope of the present invention. In addition, the above description of the present invention is based on the embodiments foreseeable by the inventor, and its purpose is to provide a useful description, and those non-substantial changes to the present invention that have not yet been foreseen may still represent equivalent changes to the present invention.

[0140] The above is only a preferred embodiment of the present invention. The present invention is not limited to the above implementation. As long as the technical effect of the present invention is achieved by the same means, it should belong to the protection scope of the present invention. Within the protection scope of the present invention, its technical scheme and / or implementation method can have various modifications and changes.

Claims

1. A method for detecting defects in metal strips, characterized in that: Includes the following: Capturing a trigger signal of the area to be detected, and acquiring an image to be detected of the area to be detected when the trigger signal is obtained; Preprocessing the image to be tested to obtain a preprocessed image to be tested; Input the preprocessed image to be tested into the pre-trained improved YOLOv8 network model and output the defect detection result; If the defect detection result is defective, the metal strip in the area to be detected is sorted into an unqualified area; if the defect detection result is non-defective, the metal strip in the area to be detected is sorted into a qualified area; Among them, the improved YOLOv8 network model includes using the CG module to replace the Conv of the backbone network of the original YOLOv8 network, using the Soft-DCNv4-SPPF module to replace the SPPF, and using the C2f-BES module to replace the C2f of the neck network.

2. A method for detecting defects in metal strip according to claim 1, characterized in that: Specifically, the preprocessing operation includes: Denoising the image to be tested by using an improved wavelet denoising algorithm, and then performing image enhancement processing on the denoised image to obtain a preprocessed image to be tested; Among them, the improved wavelet denoising algorithm includes: The bior4.4 wavelet basis function is used to perform wavelet secondary decomposition on the image to be tested to obtain low-frequency image and high-frequency image; The low-frequency image is enhanced by the Retinex algorithm based on Wiener filtering to obtain the processed low-frequency image, and the high-frequency image is filtered by the Garrote threshold method to obtain the processed high-frequency image. Performing wavelet reconstruction on the processed low-frequency image and the processed high-frequency image to obtain a reconstructed image; The reconstructed image is enhanced by limited contrast adaptive histogram equalization to obtain a denoised image.

3. A method for detecting defects in metal strip according to claim 1, characterized in that: Specifically, the CG module is used to replace the Conv of the backbone network of the original YOLOv8 network, including: Based on the original YOLOv8 network, the CG module is placed in the 1st, 3rd, 5th and 7th layers of YOLOv8, replacing the original Conv module.

4. A method for detecting defects in metal strip according to claim 1, characterized in that: Specifically, use the Soft-DCNv4-SPPF module to replace SPPF, including: DCNv4 includes DCNv4 convolution, Batch Normalization, and SiLU activation function. DCNv4 first groups the input feature map by channel, uses convolution to calculate the offset and weight of each position of each group, and then calculates the result based on the offset and weight. Finally, the convolution results of all groups are concatenated to form the output feature C1. After three serial SoftPool operations, SoftPool divides the input image into multiple local regions and calculates the eigenvalue weight for each region R. The calculation formula is: Where R is the local area of ​​feature map a, a i is the eigenvalue, W i is the eigenvalue weight; Get the weight W i After that, multiply it with the corresponding eigenvalue and then sum it up to output the pooling result. The calculation formula is: in is the output eigenvalue; After three SoftPools, the output features P1, P2, and P3 are obtained respectively; Concat the output features P1, P2, P3 with the output feature C1 after DCNv4 convolution to obtain the fused features; Perform DCNv4 convolution on the fused features.

5. The method for detecting defects in a metal strip according to claim 1, characterized in that: Specifically, the C2f-BES module is used to replace the C2f of the neck network, including: The improved C2f-BES module is built on Neck and placed on the 12th, 15th, 18th, and 21st layers of YOLOv8 to replace the original C2f module. The process of improving the C2f-BES module includes: The input features are first subjected to the first standard convolution, and then layered using Split features, one layer of which is directly passed to Concat, and the other layer is processed by multiple Bottleneck-ES; Each Bottleneck-ES layer consists of two SCConv convolutions and an EMA attention mechanism. SCConv consists of a spatial reconstruction unit SRU and a channel reconstruction unit CRU. First, the SRU module classifies and reconstructs the input feature map X to reduce spatial redundant features and obtain spatial refined features X. w Then, the CRU module is used to adopt the segmentation-conversion-fusion strategy to reduce channel redundant features and obtain channel refined features Y, and then the EMA attention mechanism is added to improve the feature processing ability of small targets; The input and output of multiple Bottleneck-ES layers are fused with the output that has not passed through Bottleneck-ES; Then it goes through a second standard convolution process, and finally the features are further enhanced through the EMA attention mechanism.

6. A method for detecting defects in metal strip according to claim 1, characterized in that: Specifically, the training process of the improved YOLOv8 network includes: Obtaining a metal strip defect data set, processing it through the preprocessing operation to obtain a preprocessed data set, and randomly dividing the preprocessed data set into a training set, a validation set, and a test set in a ratio of 7:2:1; Using the defect dataset, the improved YOLOv8 network model is trained based on the yolov8s.pt pre-trained weights obtained by training on the large training set COCO; training is performed under the PyTorch network framework, using stochastic gradient descent SGD, with the momentum set to 0.937, the confidence threshold to 0.25, the IoU threshold to 0.45, the training cycle (epochs) to 300 rounds, the input image size to 640×640, the batch size to 16, the initial learning rate to 0.01, and the data enhancement using Mosaic; After the training is completed, a weight file capable of detecting surface defects of metal strip is obtained.

7. A device for detecting defects in metal strips, characterized in that: Includes the following: The conveyor belt is fixed at a preset position and is used to drive the metal strip to move; Photoelectric sensor, used to detect whether there is metal strip in the preset detection area of ​​the conveyor belt, and send a trigger signal when there is metal strip; An image acquisition device, comprising a light source controller, a linear light source, a line scan camera and a lens; A robotic arm for sorting metal strips; The industrial computer is connected to the photoelectric sensor, the light source controller, the line scan camera and the robotic arm in communication, and the industrial computer integrates the following functional modules: A data acquisition module is used to capture a trigger signal of the area to be detected. When the trigger signal is obtained, the light source is turned on and the light intensity is adjusted according to a preset program, and the line scan camera and lens are controlled to collect images and transmit them back to obtain the image to be detected of the area to be detected; A preprocessing module, used for preprocessing the image to be tested to obtain a preprocessed image to be tested; The detection result prediction module is used to input the preprocessed image to be tested into the pre-trained improved YOLOv8 network model and output the defect detection result; A sorting module, used for sorting the metal strip in the area to be inspected to an unqualified area by a robot arm when the defect detection result is defective, and for sorting the metal strip in the area to be inspected to an qualified area by a robot arm when the defect detection result is non-defective; Among them, the improved YOLOv8 network model includes using the CG module to replace the Conv of the backbone network of the original YOLOv8 network, using the Soft-DCNv4-SPPF module to replace the SPPF, and using the C2f-BES module to replace the C2f of the neck network.

8. The device for realizing metal strip defect detection according to claim 7, characterized in that: Specifically, the industrial computer is also configured with a human-computer interaction interface.

Citation Information

Patent Citations

  • Cold-rolled strip steel surface defect detection method and system based on improved SSD algorithm

    CN115861220A

  • Strip steel surface defect detection method based on improved YOLOv7

    CN116958115A

  • Method and system for detecting small defects of complex texture ceramic tile

    CN117115095A

  • Strip steel surface defect detection method based on deep learning

    CN118071703A

  • Steel surface defect detection method based on YOLOv8 multi-scale feature fusion

    CN118229655A

Cited By

  • Method and system for detecting surface defects of elevator steel belt

    CN119444755A

  • Motor casing die casting surface quality detection method and system

    CN119715525A

  • Enhanced YOLO-based health status early warning method for artificially cultivated shellfish larvae

    CN120375412A