A method and device for detecting defects in a metal strip

CN118967612BActive Publication Date: 2026-09-22GUANGDONG UNIV OF TECH
View PDF 2 Cites 0 Cited by

Patent Information

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

AI Technical Summary

Technical Problem

[0003]一是在不均匀光照条件影响下图像表面存在噪声,缺陷特征不明显,会导致金属带钢缺陷检测准确率降低

Benefits of technology

[0058]本发明提出一种实现金属带钢缺陷检测方法及装置,通过搭建工业缺陷检测系统平台,以便于采集网络训练所需的金属带钢数据集,以及完成金属带钢的缺陷检测工作。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118967612B_ABST
    Figure CN118967612B_ABST
Patent Text Reader

Abstract

The application relates to a metal strip defect detection method and device, which comprises the following steps: capturing a trigger signal of a detection area, obtaining a to-be-detected image of the detection area when the trigger signal is obtained, pre-processing the to-be-detected image to obtain a pre-processed to-be-detected image, inputting the pre-processed to-be-detected image into a pre-trained improved YOLOv8 network model, and outputting a defect detection result, if the defect detection result is defective, sorting the metal strip in the detection area to an unqualified area, and if the defect detection result is non-defective, sorting the metal strip in the detection area to a qualified area; the application uses a deep learning method to complete real-time defect detection of the metal strip, and solves the problems of image surface noise, large scale variation, difficult detection, large model parameter quantity and slow detection speed.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of machine vision technology, and in particular to a method and apparatus for detecting defects in metal strip steel. Background Technology

[0002] Currently, defect detection in metal strip is mostly conducted manually, with experienced personnel conducting on-site inspections and independently determining the defects based on the findings. This method heavily relies on the experience of the personnel and is prone to errors. Another approach utilizes machine vision for automated inspection. However, existing methods for using machine vision to detect defects in metal strip have limitations, primarily in the following three aspects:

[0003] First, under uneven lighting conditions, noise exists on the image surface, and defect features are not obvious, which will reduce the accuracy of metal strip defect detection.

[0004] Secondly, metal strip steel has defects that are difficult to detect, such as small target defects, large-scale defects, and easily confused defects, which can lead to false detections and missed detections in the model.

[0005] Third, the large number of parameters and computational load of complex models leads to slow detection speed and low efficiency, which cannot meet the high real-time requirements of industry for surface defect detection. Summary of the Invention

[0006] The purpose of this invention is to at least address one of the shortcomings of the prior art and provide a method and apparatus for detecting defects in metal strip steel.

[0007] To achieve the above objectives, the present invention adopts the following technical solution:

[0008] Specifically, a method for detecting defects in metal strip steel is proposed, including the following:

[0009] Capture the trigger signal of the area to be detected; when the trigger signal is obtained, acquire the image of the area to be detected.

[0010] The image to be tested is preprocessed to obtain the preprocessed image to be tested;

[0011] The preprocessed image to be tested is input into a pre-trained improved YOLOv8 network model, which outputs the defect detection results.

[0012] If the defect detection result is defective, the metal strip in the area to be inspected is sorted into the unqualified area; if the defect detection result is not defective, the metal strip in the area to be inspected is sorted into the qualified area.

[0013] The improved YOLOv8 network model includes replacing the Conv of the backbone network of the original YOLOv8 network with the CG module, replacing SPPF with the Soft-DCNv4-SPPF module, and replacing C2f of the neck network with the C2f-BES module.

[0014] Furthermore, specifically, the preprocessing operation includes,

[0015] The image to be tested is denoised using an improved wavelet denoising algorithm, and then the denoised image is enhanced to obtain the preprocessed image to be tested.

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

[0017] Low-frequency and high-frequency images are obtained by performing wavelet second-order decomposition on the image under test using the bior4.4 wavelet basis functions;

[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 thresholding method to obtain the processed high-frequency image.

[0019] The processed low-frequency image and the processed high-frequency image are reconstructed using wavelet reconstruction to obtain the reconstructed image;

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

[0021] Furthermore, specifically, the Conv module of the original YOLOv8 network backbone is replaced with the CG module, including:

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

[0023] Furthermore, specifically, SPPF is replaced with the Soft-DCNv4-SPPF module, including:

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

[0025] After three consecutive SoftPool operations, the input image is divided into multiple local regions. For each region R, its feature weight is calculated using the following formula:

[0026]

[0027] Where R is a local region of feature map a, a i For eigenvalues, W i For eigenvalue weights;

[0028] Obtain the weight W i Then, multiply by the corresponding eigenvalues ​​and sum them to output the pooling result. The calculation formula is:

[0029]

[0030] in To output feature values;

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

[0032] The output features P1, P2, and P3 are concatenated with the output feature C1 after convolution with DCNv4 to obtain the fused features.

[0033] DCNv4 convolution is performed on the fused features.

[0034] Furthermore, specifically, replacing the C2f in the neck network with a C2f-BES module includes,

[0035] The improved C2f-BES module is built in Neck and placed in layers 12, 15, 18 and 21 of YOLOv8, replacing the original C2f module;

[0036] The process of obtaining the improved C2f-BES module includes,

[0037] The input features are first processed by a standard convolution, and then split features are layered. One layer is directly passed to Concat, and the other layer is processed by multiple Bottleneck-ES layers.

[0038] Each Bottleneck-ES layer consists of two SCConv convolutions and an EMA attention mechanism. SCConv is composed of a Spatial Reconstruction Unit (SRU) and a Channel Reconstruction Unit (CRU). First, the SRU module processes the input features... Figure X A classification-reconstruction method is used to reduce spatial redundancy and obtain refined spatial features X. w Then, the CRU module is used to reduce channel redundancy features and obtain channel refined features Y by employing a segmentation-transformation-fusion strategy. After that, an EMA attention mechanism is added to improve the feature processing capability for small targets.

[0039] Multiple Bottleneck-ES layer inputs and outputs are fused with the output that has not passed through Bottleneck-ES;

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

[0041] Furthermore, specifically, the training process for the improved YOLOv8 network includes,

[0042] A dataset of defects in metal strip steel is obtained, and the preprocessing operation is performed to obtain a preprocessed dataset. The preprocessed dataset is then randomly divided into a training set, a validation set, and a test set in a ratio of 7:2:1.

[0043] Using a defective dataset, the improved YOLOv8 network model was trained based on the pre-trained weights of yolov8s.pt obtained from the large training set COCO. The training was conducted in the PyTorch network framework using stochastic gradient descent (SGD), with a momentum of 0.937, a confidence threshold of 0.25, an IoU threshold of 0.45, a training epoch of 300, an input image size of 640×640, a batch size of 16, an initial learning rate of 0.01, and Mosaic data augmentation.

[0044] After training is completed, a weighted file is obtained that enables the detection of surface defects in metal strips.

[0045] The present invention also proposes a device for detecting defects in metal strip steel, comprising the following:

[0046] The conveyor belt is fixedly installed at a preset position and is used to move the metal strip.

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

[0048] Image acquisition device, including light source controller, linear light source, line scan camera and lens;

[0049] Robotic arms are used to sort metal strips;

[0050] An industrial control computer is communicatively connected to the photoelectric sensor, light source controller, line scan camera, and robotic arm. The industrial control computer integrates the following functional modules.

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

[0052] The preprocessing module is used to preprocess 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 a pre-trained improved YOLOv8 network model and output the defect detection result.

[0054] The sorting module is used to sort the metal strip in the area to be inspected to the unqualified area by means of a robotic arm when the defect detection result is defective, and to sort the metal strip in the area to be inspected to the qualified area by means of a robotic arm when the defect detection result is undefective.

[0055] The improved YOLOv8 network model includes replacing the Conv of the backbone network of the original YOLOv8 network with the CG module, replacing SPPF with the Soft-DCNv4-SPPF module, and replacing C2f of the neck network with the C2f-BES module.

[0056] Furthermore, specifically, the industrial control computer is also equipped with a human-machine interface.

[0057] The beneficial effects of this invention are as follows:

[0058] This invention proposes a method and apparatus for detecting defects in metal strip steel. By building an industrial defect detection system platform, it is possible to collect the metal strip steel dataset required for network training and complete the defect detection work of metal strip steel.

[0059] Secondly, improved wavelet denoising is applied to the image before it is input into the network model. This removes more noise while preserving the main information of the image, thereby enhancing the defect features.

[0060] Furthermore, by improving SPPF, the Soft-DCNv4-SPPF module is obtained, which enhances feature extraction capabilities and reduces false positives and false negatives in defect detection.

[0061] Furthermore, by improving C2f, the C2f-BES module was obtained, which balances the requirements of accuracy and lightweight design for metal strip inspection tasks.

[0062] Finally, by optimizing the YOLOv8 network, the model is made to have the advantages of small capacity, high accuracy, and strong generalization ability, making it easy to deploy on the terminal. Attached Figure Description

[0063] The above and other features of this disclosure will become more apparent from the detailed description of the embodiments illustrated in conjunction with the accompanying drawings. In the accompanying drawings, the same reference numerals denote the same or similar elements. Obviously, the drawings described below are merely some embodiments of this disclosure. For those skilled in the art, other drawings can be obtained from these drawings without any creative effort. In the drawings:

[0064] Figure 1 The diagram shown is a flowchart of a method for detecting defects in metal strip steel according to the present invention.

[0065] Figure 2 The diagram shown is a schematic diagram of the structural principle of a metal strip defect detection device according to the present invention.

[0066] Figure 3 The diagram shown is a flowchart of a defect detection device for metal strip steel according to the present invention.

[0067] Figure 4 The diagram shown is a flowchart of the improved wavelet denoising process in this invention.

[0068] Figure 5 The diagram shown is a schematic of the overall structure of the improved YOLOv8 algorithm in this invention.

[0069] Figure 6 The diagram shown is a schematic diagram of the Soft-DCNv4-SPPF module in this invention.

[0070] Figure 7 The diagram shown is a schematic diagram of the C2f-BES module in this invention.

[0071] Figure 8 The diagram shown is a schematic diagram of the structure of the Bottleneck-ES module in this invention.

[0072] Figure 9 The image shown is a defect detection result of an example using the YOLOv8 network.

[0073] Figure 10 The image shown is a defect detection result diagram of this example after applying the defect detection method for metal strip steel according to the present invention. Detailed Implementation

[0074] The following will provide a clear and complete description of the concept, specific structure, and technical effects of the present invention in conjunction with embodiments and accompanying drawings, so as to fully understand the purpose, solution, and effects of the present invention. It should be noted that, unless otherwise specified, the embodiments and features described in this application can be combined with each other. The same reference numerals used throughout the accompanying drawings indicate the same or similar parts.

[0075] Example 1, referring to Figure 1 This invention proposes a method for detecting defects in metal strip steel, comprising the following:

[0076] Capture the trigger signal of the area to be detected; when the trigger signal is obtained, acquire the image of the area to be detected.

[0077] The image to be tested is preprocessed to obtain the preprocessed image to be tested;

[0078] The preprocessed image to be tested is input into a pre-trained improved YOLOv8 network model, which outputs the defect detection results.

[0079] If the defect detection result is defective, the metal strip in the area to be inspected is sorted into the unqualified area; if the defect detection result is not defective, the metal strip in the area to be inspected is sorted into the qualified area.

[0080] The improved YOLOv8 network model includes replacing the Conv of the backbone network of the original YOLOv8 network with the CG module, replacing SPPF with the Soft-DCNv4-SPPF module, and replacing C2f of the neck network with the C2f-BES module.

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

[0082] The image to be tested is denoised using an improved wavelet denoising algorithm, and then the denoised image is enhanced to obtain the preprocessed image to be tested.

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

[0084] Low-frequency and high-frequency images are obtained by performing wavelet second-order decomposition on the image under test using the bior4.4 wavelet basis functions;

[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 thresholding method to obtain the processed high-frequency image.

[0086] The processed low-frequency image and the processed high-frequency image are reconstructed using wavelet reconstruction to obtain the reconstructed image;

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

[0088] In this preferred embodiment, considering that noise is inevitably introduced during the acquisition of metal strip images, the traditional wavelet denoising principle involves selecting an appropriate wavelet basis and decomposition level to perform wavelet decomposition on the noisy image to obtain low-frequency and high-frequency components. Since the noise is mainly concentrated in the high-frequency components, the high-frequency components are thresholded, and then the low-frequency components and the processed high-frequency components are reconstructed using inverse wavelet transform to obtain the denoised image. This invention improves upon this: the traditional Retinex algorithm uses Gaussian filtering to estimate illumination, which often results in the loss of detail information. Using Wiener filtering instead of Gaussian filtering to estimate illumination preserves more detail information and avoids distortion. Therefore, the Wiener-based Retinex algorithm is used to enhance the low-frequency image. Then, the wavelet-reconstructed image is enhanced using Contrast-Limited Adaptive Histogram Equalization (CLAHE) to strengthen the features of defect areas and improve image contrast.

[0089] In a preferred embodiment of the present invention, specifically, the Conv module of the original YOLOv8 network backbone is replaced using a CG module, including:

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

[0091] In this preferred embodiment, by fusing local and global contextual information, the feature representation capability of the model is enhanced, enabling it to learn richer details and semantic information.

[0092] Reference Figure 6 As a preferred embodiment of the present invention, specifically, the SPPF is replaced with a Soft-DCNv4-SPPF module, including:

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

[0094] After three consecutive SoftPool operations, the input image is divided into multiple local regions. For each region R, its feature weight is calculated using the following formula:

[0095]

[0096] Where R is a local region of feature map a, a i For eigenvalues, Wi For eigenvalue weights;

[0097] Obtain the weight W i Then, multiply by the corresponding eigenvalues ​​and sum them to output the pooling result. The calculation formula is:

[0098]

[0099] in To output feature values;

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

[0101] The output features P1, P2, and P3 are concatenated with the output feature C1 after convolution with DCNv4 to obtain the fused features.

[0102] DCNv4 convolution is performed on the fused features.

[0103] In this preferred embodiment, considering that the traditional SPPF module extracts input features by using two standard convolutions (Conv) and three max pooling operations (MaxPool), it can only represent local information of the input features. This invention replaces MaxPool with soft pooling to retain more feature information through weighted averaging, and replaces the two standard convolutions in SPPF with deformable convolution v4 (DCNv4) to effectively extract more comprehensive features, resulting in the Soft-DCNv4-SPPF module. This module can increase the receptive field of defect features and effectively reduce false positives and false negatives.

[0104] Reference Figure 7 As a preferred embodiment of the present invention, specifically, replacing the C2f of the neck network with a C2f-BES module includes,

[0105] The improved C2f-BES module is built in Neck and placed in layers 12, 15, 18 and 21 of YOLOv8, replacing the original C2f module;

[0106] The process of obtaining the improved C2f-BES module includes,

[0107] The input features are first processed by a standard convolution, and then split features are layered. One layer is directly passed to Concat, and the other layer is processed by multiple Bottleneck-ES layers.

[0108] Each Bottleneck-ES layer consists of two SCConv convolutions and an EMA attention mechanism. SCConv is composed of a Spatial Reconstruction Unit (SRU) and a Channel Reconstruction Unit (CRU). First, the SRU module processes the input features... Figure X A classification-reconstruction method is used to reduce spatial redundancy and obtain refined spatial features X. w Then, the CRU module is used to reduce channel redundancy features and obtain channel refined features Y by employing a segmentation-transformation-fusion strategy. After that, an EMA attention mechanism is added to improve the feature processing capability for small targets.

[0109] Multiple Bottleneck-ES layer inputs and outputs are fused with the output that has not passed through Bottleneck-ES;

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

[0111] In this preferred embodiment, considering that the traditional C2f module in YOLOv8 passes the input data through the first convolutional 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 concatenated along the channel dimension and passed through the second convolutional layer cv2 to obtain the final output. The original C2f module has insufficient feature extraction capability for surface defects in metal strips, easily causing missed detections of small targets. Therefore, this invention improves the original C2f module by designing a completely new module, the C2f-BES module:

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

[0113] (2) Then, the Bottleneck layer in the C2f module is replaced with Bottleneck-ES, and an EMA attention module is added 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 industrial surface defect detection.

[0114] Reference Figure 5 as well as Figure 8In summary, considering the issues of false positives, false negatives, and slow detection speed in the original YOLOv8 when detecting metal strips, this 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. Furthermore, the CG (Context Guided) module replaces the Conv module of the backbone network. The optimized YOLOv8 not only enhances the model's feature representation ability but also maintains its detection accuracy while significantly reducing network parameters.

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

[0116] A dataset of defects in metal strip steel is obtained, and the preprocessing operation is performed to obtain a preprocessed dataset. The preprocessed dataset is then randomly divided into a training set, a validation set, and a test set in a ratio of 7:2:1.

[0117] Using the defective dataset, the improved YOLOv8 network model was trained based on the pre-trained weights of yolov8s.pt obtained on the large training set COCO. Figure 9 and Figure 10 The images show the defect detection results of YOLOv8 and the improved YOLOv8, respectively. The experimental environment for this invention consisted of an NVIDIA GeForce RTX 4060Ti, 32GB of RAM, Python 3.8, torch 2.2.2, and CUDA 12.1. Training was performed using the PyTorch network framework with stochastic gradient descent (SGD). The momentum was set to 0.937, the confidence threshold to 0.25, the IoU threshold to 0.45, the training epochs to 300, the input image size to 640×640, the batch size to 16, the initial learning rate to 0.01, and Mosaic data augmentation.

[0118] In this preferred embodiment, after training is completed, a weight file with the ability to detect surface defects of metal strip is obtained. Then, the YOLOv8 weight file is deployed to the industrial control computer of the actual detection platform, so that the metal strip images transmitted by the line scan camera can be processed in real time and the defects in them can be detected.

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

[0120] Images of metal strips were acquired using a pre-built platform. The image resolution was 2048×1000 pixels, and the image format was JPG. The acquired metal strip images were subjected to a second-order wavelet decomposition using the Bior 4.4 wavelet basis function, resulting in low-frequency and high-frequency images. To better remove noise and highlight defect features, the Retinex algorithm based on Wiener filtering was used to enhance the low-frequency images, while the high-frequency images were filtered using the Garrote thresholding method. Wavelet reconstruction was then performed on the processed low-frequency and high-frequency images. Contrast-limited adaptive histogram equalization was then applied to the reconstructed images, and finally, a denoised image was output. The algorithm flowchart is shown below. Figure 4 As shown;

[0121] Since the number of collected images is small, a certain number of datasets are needed to serve as the training set during model training. Therefore, translation, flipping, rotation, scaling, stretching, and shearing were used to augment the dataset and increase the number of dataset samples, expanding the number of images to 8000.

[0122] The dataset was labeled using LabelImg and named as follows: punch hole, weld, crescent bay, water spot, oil spot, silk spot, and foreign object, totaling 7 defect types. 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 In Example 2, the present invention also proposes a device for detecting defects in metal strip steel, comprising the following:

[0124] The conveyor belt is fixedly installed at a preset position and is used to move the metal strip.

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

[0126] Image acquisition device, including light source controller, linear light source, line scan camera and lens;

[0127] Robotic arms are used to sort metal strips;

[0128] An industrial control computer is communicatively connected to the photoelectric sensor, light source controller, line scan camera, and robotic arm. The industrial control computer integrates the following functional modules.

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

[0130] The preprocessing module is used to preprocess 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 a pre-trained improved YOLOv8 network model and output the defect detection result.

[0132] The sorting module is used to sort the metal strip in the area to be inspected to the unqualified area by means of a robotic arm when the defect detection result is defective, and to sort the metal strip in the area to be inspected to the qualified area by means of a robotic arm when the defect detection result is undefective.

[0133] In this embodiment 2, a metal strip defect detection platform is constructed as follows: Figure 2 As shown, the overall system workflow is as follows: Figure 3 As shown: First, the camera, light source, photoelectric sensor, robotic arm, and industrial control computer are turned on and initialized. Then, the conveyor belt is started to feed the metal strip into the inspection area. When the photoelectric sensor in the inspection area detects a signal, it transmits the signal to the industrial control computer. The industrial control computer turns on the light source and adjusts the light intensity according to the settings, controls the color line scanning camera and lens to acquire images and transmit them back. The transmitted images are displayed on the human-machine interface, and defect detection analysis is performed. If no defect is detected, the conveyor belt continues to transport the strip to the qualified area. If a defect is detected, the industrial control computer controls the robotic arm to automatically sort the defective strip to the unqualified area.

[0134] The improved YOLOv8 network model includes replacing the Conv of the backbone network of the original YOLOv8 network with the CG module, replacing SPPF with the Soft-DCNv4-SPPF module, and replacing C2f of the neck network with the C2f-BES module.

[0135] In a preferred embodiment of the present invention, the industrial control computer is further equipped with a human-machine interface.

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

[0137] Furthermore, the functional modules in the various embodiments of the present invention can be integrated into one processing module, or each module can exist physically separately, or two or more modules can be integrated into one module. The integrated modules described above can be implemented in hardware or as software functional modules.

[0138] If the integrated module is implemented as a software functional module and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, all or part of the processes in the above embodiments of the present invention can also be implemented by a computer program instructing related hardware. The computer program can be stored in a computer-readable storage medium, and when executed by a processor, it can implement the steps of the various method embodiments described above. The computer program includes computer program code, which can be in the form of source code, object code, executable files, or certain intermediate forms. The computer-readable medium can include: any entity or system capable of carrying the computer program code, recording media, USB flash drives, portable hard drives, magnetic disks, optical disks, computer memory, read-only memory (ROM), random access memory (RAM), electrical carrier signals, telecommunication signals, and software distribution media, etc.

[0139] Although the description of the invention has been quite detailed and particularly of several described embodiments, it is not intended to limit it to any of these details or embodiments or any particular embodiment, but should be considered as providing a broad possible interpretation of the claims by referring to the appended claims and taking into account the prior art, thereby effectively covering the intended scope of the invention. Furthermore, the invention has been described above with respect to embodiments foreseeable by the inventors in order to provide a useful description, and non-substantial modifications to the invention that have not yet been foreseen may still represent equivalent modifications.

[0140] The above description is merely a preferred embodiment of the present invention. The present invention is not limited to the above-described embodiments. Any embodiment that achieves the technical effects of the present invention using the same means should fall within the protection scope of the present invention. Within the protection scope of the present invention, various modifications and variations can be made to the technical solutions and / or implementation methods.

Claims

1. A method for detecting defects in metal strip steel, characterized in that, Including the following: Capture the trigger signal of the area to be detected; when the trigger signal is obtained, acquire the image of the area to be detected. The image to be tested is preprocessed to obtain the preprocessed image to be tested; The preprocessed image to be tested is input into a pre-trained improved YOLOv8 network model, which outputs the defect detection results. If the defect detection result is defective, the metal strip in the area to be inspected is sorted into the unqualified area; if the defect detection result is not defective, the metal strip in the area to be inspected is sorted into the qualified area. The improved YOLOv8 network model includes replacing the Conv of the backbone network of the original YOLOv8 network with the CG module, replacing SPPF with the Soft-DCNv4-SPPF module, and replacing C2f of the neck network with the C2f-BES module. Specifically, replace SPPF with the Soft-DCNv4-SPPF module, including: DCNv4 includes DCNv4 convolution, Batch Normalization, and SiLU activation function. DCNv4 first groups the input feature map by channel, and then uses convolution to calculate the offset and weight of each position of each group. Then, it calculates the results based on the offset and weight, and finally concatenates the convolution results of all groups to form the output feature C1. After three consecutive SoftPool operations, the input image is divided into multiple local regions. For each region R, its feature weight is calculated using the following formula: ; in For a local region of feature map a, For eigenvalues, For eigenvalue weights; Obtain weights Then, multiply by the corresponding eigenvalues ​​and sum them to output the pooling result. The calculation formula is: ; in To output feature values; After passing through three SoftPools, the output features P1, P2, and P3 are obtained respectively; The output features P1, P2, and P3 are concatenated with the output feature C1 after convolution with DCNv4 to obtain the fused features. Perform DCNv4 convolution on the fused features; Specifically, replacing the C2f in the neck network with the C2f-BES module includes, The improved C2f-BES module is built in Neck and placed in layers 12, 15, 18 and 21 of YOLOv8, replacing the original C2f module; The process of obtaining the improved C2f-BES module includes, The input features are first processed by a standard convolution, and then split features are layered. One layer is directly passed to Concat, and the other layer is processed by multiple Bottleneck-ES layers. Each Bottleneck-ES layer consists of two SCConv convolutions and an EMA attention mechanism. SCConv is composed of a Spatial Reconstruction Unit (SRU) and a Channel Reconstruction Unit (CRU). First, the SRU module reduces spatial redundancy in the input feature map X using a classification-reconstruction method to obtain refined spatial features. Then, the CRU module is used to reduce channel redundancy features and obtain channel refined features Y by employing a segmentation-transformation-fusion strategy. After that, an EMA attention mechanism is added to improve the feature processing capability for small targets. Multiple Bottleneck-ES layer inputs and outputs are fused with the output that has not passed through Bottleneck-ES; Then, it undergoes a second standard convolution process, and finally, the features are further enhanced through an EMA attention mechanism.

2. The method for detecting defects in metal strip steel according to claim 1, characterized in that, Specifically, the preprocessing operations include, The image to be tested is denoised using an improved wavelet denoising algorithm, and then the denoised image is enhanced to obtain the preprocessed image to be tested. Among them, the improved wavelet denoising algorithm includes, Low-frequency and high-frequency images are obtained by performing wavelet second-order decomposition on the image under test using the bior4.4 wavelet basis functions; 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 thresholding method to obtain the processed high-frequency image. The processed low-frequency image and the processed high-frequency image are reconstructed using wavelet reconstruction to obtain the reconstructed image; The reconstructed image is enhanced by contrast-limited adaptive histogram equalization to obtain a denoised image.

3. The method for detecting defects in metal strip steel according to claim 1, characterized in that, Specifically, the Conv module of the original YOLOv8 network backbone is replaced with the CG module, including: Based on the original YOLOv8 network, the CG module is placed in layers 1, 3, 5, and 7 of YOLOv8, replacing the original Conv module.

4. The method for detecting defects in metal strip steel according to claim 1, characterized in that, Specifically, the training process of the improved YOLOv8 network includes, A dataset of defects in metal strip steel is obtained, and the preprocessing operation is performed to obtain a preprocessed dataset. The preprocessed dataset is then randomly divided into a training set, a validation set, and a test set in a ratio of 7:2:

1. Using a defective dataset, an improved YOLOv8 network model was trained based on the pre-trained weights of yolov8s.pt obtained from the large training set COCO. Training was conducted within the PyTorch framework using stochastic gradient descent (SGD), with a momentum of 0.937, a confidence threshold of 0.25, an IoU threshold of 0.45, a training epoch count of 300, an input image size of 640×640, a batch size of 16, an initial learning rate of 0.01, and Mosaic data augmentation. After training is completed, a weighted file is obtained that enables the detection of surface defects in metal strips.

5. A device for detecting defects in metal strip steel, characterized in that, The apparatus comprising the steps of the method according to any one of claims 1-4, wherein the method is applied, the apparatus includes the following: The conveyor belt is fixedly installed at a preset position and is used to move the metal strip. The photoelectric sensor is used to detect whether there is metal strip in the preset detection area of ​​the conveyor belt, and sends a trigger signal when metal strip is present; Image acquisition device, including light source controller, linear light source, line scan camera and lens; Robotic arms are used to sort metal strips; An industrial control computer is communicatively connected to the photoelectric sensor, light source controller, line scan camera, and robotic arm. The industrial control computer integrates the following functional modules. The data acquisition module is used to capture the trigger signal of the area to be detected. When the trigger signal is acquired, the light source is turned on and the light intensity is adjusted according to the preset program. The line scan camera and lens are controlled to acquire images and transmit them back to obtain the image of the area to be detected. The preprocessing module is used to preprocess 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 a pre-trained improved YOLOv8 network model and output the defect detection result. The sorting module is used to sort the metal strip in the area to be inspected to the unqualified area by means of a robotic arm when the defect detection result is defective, and to sort the metal strip in the area to be inspected to the qualified area by means of a robotic arm when the defect detection result is undefective. The improved YOLOv8 network model includes replacing the Conv of the backbone network of the original YOLOv8 network with the CG module, replacing SPPF with the Soft-DCNv4-SPPF module, and replacing C2f of the neck network with the C2f-BES module.

6. The device for detecting defects in metal strip steel according to claim 5, characterized in that, Specifically, the industrial control computer is also equipped with a human-machine 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