Steel surface defect detection method and equipment and computer readable storage medium

Through the GRU-based steel surface defect detection model and the lightweight method of Seq2point, the problems of low detection efficiency and inability to identify complex defects in the prior art are solved, and the rapid and accurate detection of steel surface defects is achieved, ensuring comprehensive guarantee of production quality.

CN119887688APending Publication Date: 2025-04-25SINOSTEEL EQUIP & ENG
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411953739.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-27
Publication Date
2025-04-25

AI Technical Summary

Technical Problem

The existing steel surface defect detection technology is inefficient and cannot effectively identify small, complex or irregular shape defects, making it difficult to fully guarantee the quality of steel production.

Method used

The GRU-based steel surface defect detection model is adopted, and the model is lightened through Seq2point, and the data set is constructed for training and testing to achieve fast and accurate detection of steel surface defects.

Benefits of technology

It improves the efficiency and accuracy of steel surface defect detection, can effectively identify defects in various shapes and sizes, and ensures comprehensive guarantee of steel production quality.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119887688A_ABST
    Figure CN119887688A_ABST
Patent Text Reader

Abstract

The invention discloses a steel surface defect detection method and equipment and a computer readable storage medium, and relates to the technical field of defect detection. The method comprises the following steps: constructing a data set based on steel surface defect picture data, wherein the data set comprises a training set and a verification set; a steel surface defect detection model is constructed based on GRU, and lightweight of the steel surface defect detection model is carried out based on Seq2point; sequentially using the training set and the verification set to train and test a steel surface defect detection model; and inputting a to-be-detected steel surface defect image into the trained steel surface defect detection model, and outputting a steel surface defect detection result. The method not only has the capability of rapid detection, but also can cope with various complex conditions, and ensures that the quality of steel products is comprehensively guaranteed.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of defect detection, and in particular relates to a steel surface defect detection method, equipment and computer-readable storage medium. Background Art

[0002] Nowadays, defect detection has become an indispensable key link in the steel production process. Defects on the surface of steel, whether cracks, rust, scratches or other forms of defects, will not only have a negative impact on the appearance of the steel, but more importantly, they will seriously affect the mechanical properties and service life of the steel. Therefore, in order to ensure that the quality of steel products reaches high standards, it is particularly important to conduct strict surface defect detection.

[0003] The traditional method of steel surface defect detection mainly relies on manual visual inspection. However, this detection method has many shortcomings. On the one hand, the efficiency of manual inspection is extremely low, which is difficult to meet the rapid detection needs of large-scale production, thus seriously restricting the improvement of production speed. On the other hand, since workers need to come into close contact with steel during the inspection process, this not only increases the labor intensity of workers, but also brings potential safety risks, such as scratches, burns and other work-related accidents.

[0004] In order to overcome the limitations of manual detection, some steel surface defect detection technologies based on image processing have emerged. These technologies try to extract defect features from images through image preprocessing, binarization, extremization, etc., and then realize defect identification. However, these existing technologies still have many limitations in practical applications. They can usually only effectively identify obvious and regular defects, such as large cracks or scratches. For those small, complex or irregular defects, these technologies are often unable to provide accurate and reliable detection results.

[0005] In summary, the current field of steel surface defect detection urgently needs a more efficient, accurate and widely applicable detection technology. This new technology not only needs to have the ability to quickly detect, but also needs to be able to cope with various complex situations to ensure that the quality of steel products is fully guaranteed.

[0006] The information disclosed in this background technology section is only intended to enhance the understanding of the overall background of the invention and should not be regarded as an acknowledgment or any form of suggestion that the information constitutes the prior art already known to a person skilled in the art. Summary of the invention

[0007] The purpose of the present invention is to solve the deficiencies in the above-mentioned prior art and to provide a steel surface defect detection method, device and computer-readable storage medium.

[0008] A first aspect of the present invention provides a method for detecting steel surface defects, comprising the following steps:

[0009] Constructing a data set based on steel surface defect image data, wherein the data set includes a training set and a validation set;

[0010] A steel surface defect detection model is constructed based on GRU, and the steel surface defect detection model is lightweighted based on Seq2point;

[0011] Using the training set and the verification set in sequence to train and test a steel surface defect detection model;

[0012] The steel surface defect image to be detected is input into the trained steel surface defect detection model, and the steel surface defect detection result is output.

[0013] In one embodiment of the present invention, the GRU processes data information, wherein:

[0014] The expression of the forget gate is as follows:

[0015] z t =g(W (x) x t +U (x) h t-1 )

[0016] The expression of the update gate is as follows:

[0017] r t =g(W (N) x t +U (r) h t-1 )

[0018] The expression of the current memory content is as follows:

[0019] h′ t =tanh(Wx t +r t ) t-1 )

[0020] The expression of the final memory of the previous time is as follows:

[0021] h t =z t ⊙h t-1 +(1-z t )⊙h′ i

[0022] Among them, W (x) , W (N) , U (x) , U (r) , W and U t-1Represents different weight matrices, g() represents the sigmoid function, tanh represents the hyperbolic tangent function, x t Indicates the input at the current moment, h t-1 represents the hidden state at the previous moment, and ⊙ represents the dot product.

[0023] In one embodiment of the present invention, the loss function of the steel surface defect detection model is as follows:

[0024]

[0025] Where N is the length of the input sequence, is the predicted value of the model, y i is the true value.

[0026] In one embodiment of the present invention, an Adam optimizer is applied to the steel surface defect detection model.

[0027] In one embodiment of the present invention, the Seq2point predicts the load of a single center point from the input window to reduce the computational burden of the model.

[0028] A second aspect of the present invention provides a device, comprising a processor and a memory communicatively connected to the processor, wherein the memory stores computer instructions executable by the processor, and the steel surface defect detection method is implemented when the computer instructions are executed.

[0029] A third aspect of the present invention provides a computer-readable storage medium storing computer instructions, which implement the steel surface defect detection method when executed.

[0030] Compared with the prior art, the technical effects achieved by the present invention are as follows:

[0031] 1. Instead of trying to predict the entire output sequence at each time step, Seq2point focuses on predicting the load of a single center point from the input window. The advantage of this method is that it can effectively reduce the computational burden of the model and reduce the redundancy of the model when processing data by reducing the number of outputs that need to be predicted.

[0032] 2. GRU controls the flow and retention of information through reset gate and update gate. The reset gate determines which information needs to be forgotten, while the update gate determines the fusion ratio of old information and new information. Due to its simple structure, the calculation speed is faster. BRIEF DESCRIPTION OF THE DRAWINGS

[0033] Figure 1 is a flow chart of a steel surface defect detection method according to an embodiment of the present invention;

[0034] Figure 2is a block diagram of a GRU unit structure according to an embodiment of the present invention;

[0035] Figure 3 4 is a structural block diagram of a Seq2point module according to an embodiment of the present invention. DETAILED DESCRIPTION

[0036] The present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It is to be understood that the specific embodiments described herein are only used to explain the relevant invention, rather than to limit the invention. It is also necessary to explain that, for ease of description, only the parts related to the invention are shown in the accompanying drawings.

[0037] like Figures 1 to 3 As shown, a steel surface defect detection method according to a preferred embodiment of the present invention comprises the following steps:

[0038] S1. Construct a data set based on steel surface defect image data, wherein the data set includes a training set and a validation set.

[0039] In some embodiments, the steel surface defect images may be derived from an existing, open-source steel surface defect image database, and in other embodiments, the steel surface defect image data may also be acquired through on-site collection. For example, using a camera installed in a steel plant, the steel surface defect images may be acquired by taking photos, or by recording a video and then capturing certain frames of images at a specific period as steel surface defect images, or capturing certain frames of images at unspecified time intervals as steel surface defect images.

[0040] The defects in the steel surface defect image can be real damage, that is, damage caused during one or more normal, standard or recognized operating processes; it can also be artificial damage, that is, the steel surface is deliberately damaged by humans; it can also be synthetic damage, that is, defect image blocks are inserted into the image of the steel surface to represent or emphasize the defects.

[0041] The images and labels of the dataset can be subdivided into a training set and a validation set, where the images and labels of the training set are used to train a steel surface defect detection model (see below) to identify defects in one or more images, and the images and labels of the validation set are used to test or confirm the effectiveness of the trained steel surface defect detection model.

[0042] S2. Construct a steel surface defect detection model based on GRU, and lightweight the steel surface defect detection model based on Seq2point; use the training set and the verification set to train and test the steel surface defect detection model in turn.

[0043] By fine-tuning the parameters and function configuration, we were able to build an efficient network training process. This process continuously optimizes the parameters of the steel surface defect detection model according to the preset training rounds (epochs) until its performance reaches a preset threshold standard. This means that once the model's performance meets this threshold requirement, the training process will end early even if all the scheduled training rounds have not been completed. In addition, if the value of the loss function does not show a significant decrease after three consecutive training rounds, the training of the steel surface defect detection model will be terminated.

[0044] In step S2, we use GRU (Gated Recurrent Unit) to deeply process the data information. As an advanced recurrent neural network variant, GRU has a unique basic structure consisting of two key gating mechanisms: update gate and reset gate. These two gating mechanisms finely regulate the flow of information through carefully designed sigmoid functions, allowing the GRU model to intelligently and selectively retain or forget information from previous time steps, thereby effectively capturing the temporal dependencies in the data.

[0045] The contents of the GRU are as follows:

[0046] The expression of the forget gate is as follows:

[0047] z t =g(W (x) x t +U (x) h t-1 )

[0048] The expression of the update gate is as follows:

[0049] r t =g(W (N) x t +U (r) h t-1 )

[0050] The expression of the current memory content is as follows:

[0051] h′ t =tanh(Wx t +r t ) t-1

[0052] The expression of the final memory of the previous time is as follows:

[0053] h t =z t ⊙h t-1 +(1-z t )⊙h′ i

[0054] Among them, W (x) , W (N) , U (x) , U (r) , W and U t-1 Represents different weight matrices, g() represents the sigmoid function, tanh represents the hyperbolic tangent function, x t Indicates the input at the current moment, h t-1 represents the hidden state at the previous moment, and ⊙ represents the dot product.

[0055] Specifically, the main responsibility of the update gate is to control the extent to which the state information of the previous moment is brought into the current state. When the value of the update gate is large, it means that more state information of the previous moment is retained and brought into the current state, which helps the model maintain long-term memory; when the value of the update gate is small, it means that the influence of the state information of the previous moment on the current state is weakened, and the model is more inclined to rely on the current input information for updating.

[0056] On the other hand, the reset gate is responsible for controlling how much information from the previous state is written to the current candidate set. The smaller the value of the reset gate, the less information from the previous state is written to the current candidate set, which helps the model "forget" some unimportant information when needed, thereby avoiding information redundancy and interference. On the contrary, when the value of the reset gate is large, more information from the previous state will be retained and written to the current candidate set, providing stronger support for the model's prediction.

[0057] In summary, GRU achieves fine-grained control of information flow through its unique update gate and reset gate design, enabling the model to perform with higher efficiency and accuracy when processing complex time series data.

[0058] The Seq2point method is significantly different from the traditional Seq2seq method. Seq2point does not seek to predict the entire output sequence at each time step, but focuses on accurately predicting the load of a single center point from the input window. This strategy brings two core advantages: First, it can greatly reduce the computational burden of the model. Since it is no longer necessary to perform a complete sequence prediction for each time step, the amount of calculations required by the model is significantly reduced, thereby improving processing speed and efficiency. Second, by reducing the number of outputs that need to be predicted, Seq2point reduces the redundancy of the model when processing data. This means that the model can focus more on the truly important information, that is, the features in the input window that are directly related to the center point load, thereby improving the accuracy and reliability of the prediction. In summary, the Seq2point method, with its unique prediction method and significant advantages, has shown great potential and application value in tasks such as load forecasting.

[0059] S3. Input the steel surface defect image to be detected into the trained steel surface defect detection model, and output the steel surface defect detection result.

[0060] In some embodiments, the loss function of the fault detection model is as follows:

[0061]

[0062] Where N is the length of the input sequence, is the predicted value of the model, y i is the true value.

[0063] The loss function of the steel surface defect detection model is optimized to accurately evaluate and reduce prediction errors. By increasing the weight of large error terms, the error correction efficiency is improved, the training is ensured to be continuously differentiable, and the optimization process is simplified. At the same time, the convergence is accelerated, the accuracy of the regression task is improved, and overfitting is effectively prevented, and the generalization ability is enhanced.

[0064] In some embodiments, an Adam optimizer is applied to the fault detection model. The Adam optimizer is a gradient-based optimization algorithm that can effectively optimize weight parameters and bias parameters in the steel surface defect detection model.

[0065] Optimizing parameters is mainly achieved through the following four key steps:

[0066] 1. First-order moment estimation (momentum mechanism): The Adam optimizer tracks the first-order momentum of the gradient of each parameter, i.e. momentum. This step helps speed up the optimization path, especially when encountering many flat areas, it can effectively push the parameters to move towards the optimal solution faster.

[0067] 2. Second-order moment estimation: At the same time, Adam also calculates the exponentially weighted average of the square of the gradient, that is, the second-order momentum. This step allows the optimizer to dynamically adjust the learning rate of each parameter according to the size of the gradient, ensuring that a cautious update step is taken in the direction of the larger gradient, and a larger update step is taken in the direction of the smaller gradient, thereby improving the efficiency of the optimization.

[0068] 3. Adaptive learning rate: Based on the estimation of first-order and second-order momentum, Adam can independently calculate an adaptive learning rate for each parameter. This mechanism enables the learning rate to be dynamically adjusted according to historical gradient information, ensuring the stability and efficiency of the update process.

[0069] 4. Bias correction: In the early stages of training, since the initial values ​​of the first-order and second-order momentum may be close to zero, Adam introduces a bias correction technique to eliminate this effect. This step ensures that the model can be updated with the correct step size in the early stages of training.

[0070] In steel surface defect detection, the Adam optimizer shows the following advantages:

[0071] 1. Adaptive learning rate: The Adam optimizer can dynamically adjust the learning rate, which is suitable for handling complex steel surface defect detection tasks and improving detection accuracy and reliability.

[0072] 2. Efficient convergence: Adam combines momentum and squared gradient weighted average, which can converge quickly in the early stage of training, improving training efficiency and detection accuracy.

[0073] 3. Bias correction mechanism: Adam reduces the initial deviation of training through bias correction, improves training efficiency and accuracy, and is suitable for complex and changeable training tasks.

[0074] 4. Applicable to large-scale data sets: Adam can efficiently process large-scale data sets, speed up the training process, reduce the risk of overfitting, and improve the generalization performance of the model.

[0075] 5. High stability: Adam combines momentum and adaptive adjustment to show higher stability and reliability in variable gradients and complex loss spaces.

[0076] The present invention allows the target object to be evaluated at any stage of the steel structure life cycle. Through the system and method, quality assurance inspections can be carried out on the target object, such as selecting representative samples to detect surface defects after manufacturing or assembly. For example, random sampling and photo verification can be carried out during mass production; inspections can also be carried out regularly, irregularly or after specific events. The target object can also be photographed to determine its status during use, and the inspection can be repeated as many times as needed.

[0077] According to another embodiment of the present invention, the device comprises a processor and a memory, wherein the processor is electrically connected to the memory, and the memory is provided with computer instructions, and when the computer instructions are executed by the processor, the steel surface defect detection method is implemented.

[0078] A computer-readable storage medium according to another embodiment of the present invention includes computer instructions, and when the computer instructions are executed, the steel surface defect detection method is implemented.

[0079] The foregoing description of specific exemplary embodiments of the present invention is for the purpose of illustration and demonstration. These descriptions are not intended to limit the present invention to the precise form disclosed, and it is clear that many changes and variations can be made based on the above teachings. The purpose of selecting and describing the exemplary embodiments is to explain the specific principles of the present invention and its practical application, so that those skilled in the art can realize and utilize various different exemplary embodiments of the present invention and various different selections and changes. The scope of the present invention is intended to be limited by the claims and their equivalents.

Claims

1. A method for detecting steel surface defects, characterized in that: The steps include: Constructing a data set based on steel surface defect image data, wherein the data set includes a training set and a validation set; A steel surface defect detection model is constructed based on GRU, and the steel surface defect detection model is lightweighted based on Seq2point; Using the training set and the verification set in sequence to train and test a steel surface defect detection model; The steel surface defect image to be detected is input into the trained steel surface defect detection model, and the steel surface defect detection result is output.

2. The steel surface defect detection method according to claim 1, characterized in that: The GRU processes the data information, wherein: The expression of the forget gate is as follows: z t =g(W (x) x t +U (x) h t-1 ) The expression of the update gate is as follows: r t =g(W (N) x t +U (r) h t-1 ) The expression of the current memory content is as follows: h t =tanh(Wx t +r t )U t-1 ) The expression of the final memory of the previous time is as follows: h t =z t ⊙)h t-1 +(1-z t )⊙h′ i Among them, W (x) , W (N) , U (x) , U (r) , W and U t-1 Represents different weight matrices, g() represents the sigmoid function, tanh represents the hyperbolic tangent function, x t Indicates the input at the current moment, h t-1 represents the hidden state at the previous moment, and ⊙ represents the dot product.

3. The steel surface defect detection method according to claim 1, characterized in that: The loss function of the steel surface defect detection model is as follows: Where N is the length of the input sequence, is the predicted value of the model, y i is the true value.

4. The method for detecting steel surface defects according to claim 1, characterized in that: The Adam optimizer is applied to the steel surface defect detection model.

5. The steel surface defect detection method according to claim 1, characterized in that: The Seq2point predicts the load of a single center point from the input window to reduce the computational burden of the model.

6. A device, characterized in that: It comprises a processor and a memory connected to the processor in communication, wherein the memory stores computer instructions executable by the processor, and when the computer instructions are executed, the steel surface defect detection method as described in any one of claims 1 to 5 is implemented.

7. A computer-readable storage medium storing computer instructions, characterized in that: When the computer instructions are executed, the steel surface defect detection method as described in any one of claims 1 to 5 is implemented.