CN116030056A - Detection method and system for steel surface cracks - Google Patents

Detection method and system for steel surface cracks Download PDF

Info

Publication number
CN116030056A
CN116030056A CN202310315582.1A CN202310315582A CN116030056A CN 116030056 A CN116030056 A CN 116030056A CN 202310315582 A CN202310315582 A CN 202310315582A CN 116030056 A CN116030056 A CN 116030056A
Authority
CN
China
Prior art keywords
detected
cracks
image block
steel
module
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202310315582.1A
Other languages
Chinese (zh)
Inventor
周志杰
武杰
胡昌华
冯志超
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Rocket Force University of Engineering of PLA
Original Assignee
Rocket Force University of Engineering of PLA
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Rocket Force University of Engineering of PLA filed Critical Rocket Force University of Engineering of PLA
Priority to CN202310315582.1A priority Critical patent/CN116030056A/en
Publication of CN116030056A publication Critical patent/CN116030056A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02PCLIMATE CHANGE MITIGATION TECHNOLOGIES IN THE PRODUCTION OR PROCESSING OF GOODS
    • Y02P90/00Enabling technologies with a potential contribution to greenhouse gas [GHG] emissions mitigation
    • Y02P90/30Computing systems specially adapted for manufacturing

Landscapes

  • Image Analysis (AREA)

Abstract

The invention discloses a method and a system for detecting cracks on the surface of steel, and belongs to the field of detection of the surface of steel in industry. Firstly, carrying out crack detection on a picture to be detected on the surface of the steel based on a trained YOLOV7 target detection model, and cutting to obtain an image block to be detected with cracks; then, carrying out feature extraction and fusion on the image block to be detected based on a multi-scale LBP operator to obtain multi-scale LBP features of the image block to be detected; and then inputting the multi-scale LBP characteristics of the image block to be detected into a trained SVM classifier to classify the cracks on the surface of the steel. According to the invention, the detection of the steel surface crack target is carried out based on the YOLOV7, and the detected result is further classified by using the LBP and the SVM, so that the detection of the steel surface crack is realized.

Description

Detection method and system for steel surface cracks
Technical Field
The invention relates to the field of detection of steel surfaces in industry, in particular to a detection method and a detection system for steel surface cracks.
Background
Steel bodies are widely used in a variety of industries, particularly in civil structures and infrastructures, which provide basic welfare for society. Thus, they are assets that need to be kept and properly maintained. Its quality status seriously affects the equipment production and the life safety of people, and in order to achieve this goal, it is necessary to scientifically evaluate their health status. One particular challenge is the detection and characterization (localization and quantification) of early cracks, since at this stage the size of the crack is small, and the steel surface has problems of poor crack continuity, low contrast, etc., and existing detection methods face significant challenges in detecting the crack.
Disclosure of Invention
The invention aims to provide a method and a system for detecting steel surface cracks, so as to realize detection of the steel surface cracks.
In order to achieve the above object, the present invention provides the following solutions:
the invention provides a method for detecting a steel surface crack, which comprises the following steps:
acquiring a picture to be measured on the surface of the steel;
performing crack detection on the picture to be detected on the steel surface based on the trained YOLOV7 target detection model, and cutting to obtain an image block to be detected with cracks;
performing feature extraction and fusion on the image block to be detected based on a multi-scale LBP (Local Binary Pattern ) operator to obtain multi-scale LBP features of the image block to be detected;
inputting the multi-scale LBP characteristics of the image block to be detected into a trained SVM (Support Vector Machines, support vector machine) classifier to classify cracks on the surface of steel materials.
Optionally, the YOLOV7 target detection model includes an Input module, a backup module, and a Head module connected in sequence.
Optionally, the backhaul module employs an efficient layer aggregation network;
the high-efficiency layer aggregation network comprises: a first 1x1 convolution module, a second 1x1 convolution module, a first 3x3 convolution module, a second 3x3 convolution module, a third 3x3 convolution module, a fourth 3x3 convolution module, a full connection layer, and a third 1x1 convolution module;
the output end of the first 1x1 convolution module is connected with the input end of the full connection layer;
the output end of the second 1x1 convolution module is respectively connected with the input end of the full connection layer and the input end of the first 3x3 convolution module;
the output end of the first 3x3 convolution module is connected with the input end of the second 3x3 convolution module;
the output end of the second 3x3 convolution module is respectively connected with the input end of the full connection layer and the input end of the third 3x3 convolution module;
the output end of the third 3x3 convolution module is connected with the input end of the fourth 3x3 convolution module, and the output end of the fourth 3x3 convolution module is connected with the input end of the full connection layer;
the output end of the full connection layer is connected with the input end of the convolution module of the third 1x 1.
Optionally, the adjacent point of the multi-scale LBP operator is 8, the adjacent point is a circular adjacent point with radii of 1,5,6,7,8,9, 10 and 11 respectively, and the mode is uniform.
Optionally, the detecting the crack of the picture to be detected on the steel surface based on the trained YOLOV7 target detection model, and cutting to obtain the image block to be detected with the crack, and before the step of obtaining the image block to be detected with the crack further comprises:
acquiring a steel surface sample picture with cracks and a steel surface sample picture without cracks, and constructing a data set;
carrying out data enhancement on the steel surface sample picture with the crack in the data set to obtain an amplified data set;
dividing the amplified data set into a training set and a verification set;
training the YOLOV7 target detection model based on the training set to obtain a trained YOLOV7 target detection model;
performing crack detection on a steel surface sample picture in a training set based on the trained YOLOV7 target detection model, and cutting to obtain a sample image block with cracks;
performing feature extraction and fusion on the sample image block based on a multi-scale LBP operator to obtain multi-scale LBP features of the sample image block;
training the SVM classifier based on the multi-scale LBP characteristics of each sample image block in the training set to obtain a trained SVM classifier;
verifying the trained YOLOV7 target detection model and the trained SVM classifier based on the verification set;
when the verification is passed, outputting the trained Yolov7 target detection model as a trained Yolov7 target detection model, and outputting the trained SVM classifier as a trained SVM classifier;
and when the verification fails, returning to the step of training the YOLOV7 target detection model based on the training set to obtain a trained YOLOV7 target detection model, and continuing training.
A system for detecting cracks in a steel surface, the system being applied to the method described above, the system comprising:
the picture acquisition module is used for acquiring a picture to be detected on the surface of the steel;
the detection module is used for carrying out crack detection on the picture to be detected on the steel surface based on the trained YOLOV7 target detection model, and cutting the picture to be detected to obtain an image block to be detected with cracks;
the feature extraction and fusion module is used for carrying out feature extraction and fusion on the image block to be detected based on a multi-scale LBP operator to obtain multi-scale LBP features of the image block to be detected;
and the classification module is used for inputting the multi-scale LBP characteristics of the image block to be detected into a trained SVM classifier to classify the cracks on the surface of the steel.
An electronic device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, the processor implementing the method described above when executing the computer program.
A computer readable storage medium having stored thereon a computer program which when executed implements the method described above.
According to the specific embodiment provided by the invention, the invention discloses the following technical effects:
the invention discloses a method and a system for detecting a steel surface crack, wherein the method comprises the following steps: acquiring a picture to be measured on the surface of the steel; performing crack detection on the picture to be detected on the steel surface based on the trained YOLOV7 target detection model, and cutting to obtain an image block to be detected with cracks; performing feature extraction and fusion on the image block to be detected based on a multi-scale LBP operator to obtain multi-scale LBP features of the image block to be detected; inputting the multi-scale LBP characteristics of the image block to be detected into a trained SVM classifier, and classifying cracks on the surface of the steel. According to the invention, the detection of the steel surface crack target is carried out based on the YOLOV7, and the detected result is further classified by using the LBP and the SVM, so that the detection of the steel surface crack is realized.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions of the prior art, the drawings that are needed in the embodiments will be briefly described below, it being obvious that the drawings in the following description are only some embodiments of the present invention, and that other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
FIG. 1 is a flow chart of a method for detecting cracks on a steel surface according to an embodiment of the present invention;
fig. 2 is a schematic structural diagram of a high-efficiency layer aggregation network according to an embodiment of the present invention;
FIG. 3 is an exemplary diagram of an image block to be measured according to an embodiment of the present invention;
FIG. 4 is a schematic diagram illustrating the operation of a conventional LBP operator according to an embodiment of the present invention;
FIG. 5 is a schematic view of a neighborhood of 8 adjacent elements with a radius of 1 according to an embodiment of the present invention;
FIG. 6 is a schematic view of a neighborhood of 16 adjacent elements with radius 2 provided in an embodiment of the present invention;
FIG. 7 is a schematic view of a neighborhood of 8 adjacent elements with a radius of 2 according to an embodiment of the present invention;
FIG. 8 is a sample image without cracks provided by an embodiment of the present invention;
FIG. 9 is a photograph of a cracked sample provided by an embodiment of the present invention;
FIG. 10 is a schematic diagram of a detection result of a Yolov7 target detection model according to an embodiment of the present invention;
fig. 11 is a flowchart of a training process according to an embodiment of the present invention.
Detailed Description
The following description of the embodiments of the present invention will be made clearly and completely with reference to the accompanying drawings, in which it is apparent that the embodiments described are only some embodiments of the present invention, but not all embodiments. All other embodiments, which can be made by those skilled in the art based on the embodiments of the invention without making any inventive effort, are intended to be within the scope of the invention.
The invention aims to provide a method and a system for detecting steel surface cracks, so as to realize detection of the steel surface cracks.
In order that the above-recited objects, features and advantages of the present invention will become more readily apparent, a more particular description of the invention will be rendered by reference to the appended drawings and appended detailed description.
Adewosi and Al-Bedor propose a multi-layer feedforward neural network approach for structural fracture detection. They concluded that a simple two-layer feed forward neural network was satisfactory in detecting propagating fractures, while a trained three-layer network was successful in detecting propagating and non-propagating fractures.
Yin et al propose a probabilistic solution method for identifying sheet structure crack features of a framework based on a bayesian statistical system. This approach only addresses a few points, while the sensor does not necessarily have to be close to the fracture. Fracture characterization is statistical data based on uncertainty and confidence levels of fracture location, length, and depth. The authors verify the feasibility of this probabilistic approach by studying the numerical examples of rectangular aluminium plates.
In addition, sbarufatti et al combine Bayesian hierarchical models with artificial neural network methods to analyze cracks. The input noise signal obtains the location and length of the crack, which in most cases can be identified. SEN WANG proposes a fused segmentation algorithm using a full convolutional network (Fully Convolutional Network, FCN) and a structured forest using wavelet transforms to detect micro-cracks in steel beams. The detection of surface defects is very important for improving the quality of the steel plate, and Yang Liu provides an improved multi-block LBP algorithm suitable for online real-time detection, and has simplicity and efficiency.
Although the above methods have achieved further results on nondestructive testing of steel surfaces, the methods have insufficient intelligent degree, and the generalization capability and robustness of the model are also insufficient, so that the recognition accuracy and robustness of the algorithm are required to be further improved.
Example 1
The embodiment 1 of the invention provides a method for detecting a steel surface crack, as shown in fig. 1, comprising the following steps:
and step 101, obtaining a picture to be measured on the surface of the steel.
And 102, carrying out crack detection on the picture to be detected on the surface of the steel based on the trained YOLOV7 target detection model, and cutting to obtain an image block to be detected with cracks.
Because different textures exist on the surface of the steel, a plurality of interference factors exist in the detection of the surface cracks of the steel, detection errors are easy to cause, and the primary screening of the area containing the surface cracks of the steel is very important. Compared with other algorithms, the YOLOV 7-based target detection algorithm is added with a module re-parameterization and dynamic label distribution strategy, so that the position of the area where the steel surface crack is located can be positioned faster and more accurately.
The YOLOV 7-based target detection algorithm, namely a YOLOV7 target detection model, comprises an Input module, a backup module and a Head module.
The Input module processes the Input steel surface picture (the steel surface picture is a steel surface sample picture in a training stage and a steel surface picture to be measured in a prediction stage, because the training stage and the prediction stage are corresponding and are not distinguished here), and technologies such as metal data enhancement, self-adaptive anchor frame calculation, self-adaptive picture scaling and the like are used. The method comprises the steps that a random number method is adopted for enhancing the Mosaic data, 4 or 9 steel surface pictures are spliced in a random zooming, random cutting and random arrangement mode, and therefore small targets are well identified; self-adaptive anchor frame calculation, in network training, generating a plurality of anchor frames, marking the prediction category and the offset of each anchor frame, adjusting the anchor frame position according to the predicted offset to obtain a prediction boundary frame, calculating through an intersection set IOU to obtain loss, and reversely updating to iterate network parameters, wherein an IOU formula can be expressed as follows:
Figure SMS_1
in the prediction stage, a plurality of anchor frames are generated in the picture to be detected on the steel surface, and the category and the offset of the anchor frames are predicted according to the trained model parameters, so that a predicted boundary frame is obtained. To prevent the same object from outputting multiple similar prediction bounding boxes, a threshold is increased in YOLOV7 and Non-maximum suppression (Non-maximum suppression, NMS) is used, thus yielding a prediction anchor box; the self-adaptive picture scaling can adaptively add the least black edge to the original image (the picture to be measured on the steel surface), so that the reasoning speed is improved.
The backhaul module of this embodiment mainly uses an Efficient layer aggregation network ELAN (efficiency Long-range Attention Network), which includes: a first 1x1 convolution module, a second 1x1 convolution module, a first 3x3 convolution module, a second 3x3 convolution module, a third 3x3 convolution module, a fourth 3x3 convolution module, a full connection layer, and a third 1x1 convolution module; the output end of the first 1x1 convolution module is connected with the input end of the full connection layer; the output end of the second 1x1 convolution module is respectively connected with the input end of the full connection layer and the input end of the first 3x3 convolution module; the output end of the first 3x3 convolution module is connected with the input end of the second 3x3 convolution module; the output end of the second 3x3 convolution module is respectively connected with the input end of the full connection layer and the input end of the third 3x3 convolution module; the output end of the third 3x3 convolution module is connected with the input end of the fourth 3x3 convolution module, and the output end of the fourth 3x3 convolution module is connected with the input end of the full connection layer; the output end of the full connection layer is connected with the input end of the convolution module of the third 1x 1. Wherein, as shown in fig. 2, each c represents a 1x1 convolution module, c includes a 1x1 convolution layer, a normalization layer and an activation function, and a branch included in the left side c (the convolution layer module of the first 1x 1) represents the characteristics of the input network, after the characteristics are processed by c, the characteristics are output to the full connection layer; the three branches contained in the right side c (the second 1x1 convolution layer module) represent that the characteristics of the input network are processed by c, the channel number is changed, the first branch directly outputs the characteristics to the full connection layer, the second branch outputs the characteristics to the full connection layer after the characteristics are extracted by two 3x3 convolution modules (the first 3x3 convolution module and the second 3x3 convolution module), the third branch outputs the characteristics to the full connection layer after the characteristics are extracted by four 3x3 convolution modules (the first 3x3 convolution module, the second 3x3 convolution module, the third 3x3 convolution module and the fourth 3x3 convolution module), and finally the characteristic extraction results of the four branches are connected, and the characteristic extraction results are output after the characteristics are extracted by one 1x1 convolution layer module (the third 1x1 convolution layer module). Each 3x3 convolution module includes a 3x3 convolution layer and two c, and the full link layer includes a 1x1 convolution layer and five c.
The Head module is mainly used for carrying out high fusion on the features extracted by the Backbone module by using a PAFPN (Path Aggregation Feature pyramid network ) network structure, further, the fused features are used for positioning cracks on the surface of steel, structural re-parameterization is mainly used, when the Head module is trained in the YOLOV7, the addition output of three branches is provided, the complex structure of the network is increased, only one branch is provided during reasoning, when the Head module is deployed, the parameters of the branches are re-parameterized to a main branch, so that the two branches reach equivalent results, and the network has high-efficiency reasoning rate.
After YOLOV7 prediction, relevant information for each predicted anchor frame can be obtained, including: the category serial number and the binding box (comprising the center X, Y coordinates of the detection frame and the width and height of the detection frame) are normalized values. Through the information, the original pictures with cracks on the surfaces of all the steels can be subjected to crack positioning, and then cut, so that preliminary predicted pictures with cracks, namely image blocks to be detected, are obtained, and the image blocks to be detected are shown in fig. 3.
And step 103, carrying out feature extraction and fusion on the image block to be detected based on a multi-scale LBP operator to obtain multi-scale LBP features of the image block to be detected.
LBP (Local Binary Pattern ) is an operator used to describe local texture features of an image; it has the obvious advantages of rotation invariance, gray scale invariance and the like. The LBP operator was first proposed by t. Ojala in 1994 for local texture feature extraction.
The original LBP operator is defined as comparing the gray value of 8 adjacent pixels with the window center pixel as a threshold value within a 3x3 window, and if the surrounding pixel value is greater than the center pixel value, the adjacent pixel position is marked as 1, otherwise, as 0. Thus, 8 pixels in the 3x3 neighborhood can be compared to generate an 8-bit binary number (usually converted into a decimal number, i.e., LBP code, 256 in total), so as to obtain the LBP value of the pixel point in the center of the window, and this value is used to reflect the texture information of the region. As shown in fig. 4, it can be expressed as:
Figure SMS_2
wherein, the liquid crystal display device comprises a liquid crystal display device,
Figure SMS_3
is the center pixel, ">
Figure SMS_4
LBP value for the center pixel, p is the p-th pixel of the neighborhood, +.>
Figure SMS_5
Is the gray value of the center pixel, +.>
Figure SMS_6
Is the gray value of the P-th pixel of the neighborhood, P is the number of pixels of the neighborhood,
Figure SMS_7
is a symbolic function defined as follows: />
Figure SMS_8
;
The biggest drawback of the basic LBP operator is that it covers only a small area within a fixed radius, which obviously does not meet the needs of different sizes and frequency textures. In order to adapt to texture features of different scales and meet the requirements of gray scale and rotation invariance, ojala and the like improve an LBP operator, extend a 3x3 neighborhood to any neighborhood, replace a square neighborhood with a circular neighborhood, and the improved LBP operator allows any plurality of pixel points in the circular neighborhood with the radius of R. Thus, an LBP operator containing P sampling points in a circular region with radius R is obtained, as shown in fig. 5-7, where fig. 5 is a neighborhood of 1 adjacent 8 elements with radius, fig. 6 is a neighborhood of 16 elements with radius 2, and fig. 7 is a neighborhood of 8 elements with radius 2.
In order to reduce the dimension of the original LBP problem, solve the problem of excessive binary patterns, and improve statistics, ojala proposes to use an "equivalent Pattern" to reduce the dimension of the Pattern type of the LBP operator. Ojala et al believe that in actual images, most LBP patterns contain only jumps from 1 to 0 or from 0 to 1 at most twice. Thus, ojala defines an "equivalence mode" as: when a cyclic binary number corresponding to a certain LBP jumps from 0 to 1 or from 1 to 0 at most twice, the binary number corresponding to the LBP is called an equivalent pattern class, and the rest is called a non-equivalent pattern class. With the definition of the equivalence pattern class, the Ojala proposes an LBP operator based on "equivalence pattern":
Figure SMS_9
wherein, P and R are the number and the radius of the neighborhood pixel points respectively,
Figure SMS_10
function value of LBP operator based on "equivalent mode", ->
Figure SMS_11
Is a pattern function of the LBP operator.
Figure SMS_12
Wherein, the liquid crystal display device comprises a liquid crystal display device,
Figure SMS_13
、/>
Figure SMS_14
、/>
Figure SMS_15
and->
Figure SMS_16
The gray values of the P-1 th, 0 th, P-th and P-1 th pixels of the neighborhood, respectively.
Here, the target region is extracted using the target frame information detected by YOLOV7 in step 102, and is used as an input of the LBP algorithm. In order to better utilize the multi-scale information, the LBP operator with the adjacent point of 8 and the mode of uniform is adopted to extract the characteristics, and meanwhile, the radius is set to 1,5,6,7,8,9, 10 and 11 to realize the extraction and cascade of the multi-scale LBP characteristics.
And 104, inputting the multi-scale LBP characteristics of the image block to be detected into a trained SVM classifier, and classifying cracks on the surface of the steel.
And after the multi-scale LBP is used for carrying out feature extraction on the preliminary predicted cracked steel surface picture, the picture is classified. Since the experiment was conducted only with or without cracking, i.e., the classification problem, it was classified using a support vector machine (support vector machine, SVM). The basic model of the SVM classifier is defined as a linear classifier with the largest geometric interval on the feature space, and the learning strategy is interval maximization, so that the linear classifier can be finally converted into a solution of a convex quadratic programming problem.
In the embodiment of the invention, the characteristics are mapped to a high-dimensional space, the linear inseparable condition still occurs, aiming at the linear inseparable problem, the optimal hyperplane is required to be found, and a relaxation variable is added
Figure SMS_17
Classifying the image blocks to be measured to achieve an "approximately linearly separable" condition, the hyperplane can be expressed as:
Figure SMS_18
wherein, the liquid crystal display device comprises a liquid crystal display device,
Figure SMS_19
is the transposed matrix of the normal vector of the hyperplane, determines the optimal hyperplane direction, +.>
Figure SMS_20
The high-dimensional characteristic vector of the multi-scale LBP characteristic of the ith image block is represented, n represents the number of the image blocks to be detected, b represents a constant term of the hyperplane and is the distance between the hyperplane and the origin.
The classification decision function is:
Figure SMS_21
Figure SMS_22
classification decision function for ith image blockThe values on the hyperplane are 0, the data values above the hyperplane are 1, and the data values below the hyperplane are-1, respectively representing two categories of the two categories.
Setting: training set T and hyperplane
Figure SMS_23
Sample points in the training set may be denoted +.>
Figure SMS_24
Then can be used
Figure SMS_25
Representing the distance of the ith image block from the hyperplane,/->
Figure SMS_26
Functional interval representing hyperplane with respect to the ith image block,/->
Figure SMS_27
Indicating that the classification is correct.
Because of the scaling of w, b in the same proportion, the hyperplane equations are not changed, but the function spacing is changed. Here, by introducing relaxation variables
Figure SMS_28
The function interval is changed to +.>
Figure SMS_29
The following conditions are satisfied for points on the data to be classified on the hyperplane:
Figure SMS_30
as can be seen from the point-to-line distance, when classifying the steel surface pictures,
Figure SMS_31
normalized distance from origin is +.>
Figure SMS_32
,/>
Figure SMS_33
Normalized distance from origin is +.>
Figure SMS_34
The interval is the sum of the distance between the two>
Figure SMS_35
Because of the interval and->
Figure SMS_36
Is inversely proportional, find the largest geometric interval, i.e. find the smallest +.>
Figure SMS_37
Figure SMS_38
Minimum time, ->
Figure SMS_39
Also to a minimum, added here for computational convenience, the objective function to be solved and constraint can be expressed as, where C is the penalty factor:
Figure SMS_40
because the objective function is a convex function, the objective function can be solved by using a Lagrange dual method, and the Lagrange function is constructed as follows:
Figure SMS_41
wherein, the liquid crystal display device comprises a liquid crystal display device,
Figure SMS_42
、/>
Figure SMS_43
is Lagrangian multiplier +.>
Figure SMS_44
Is a relaxation variable, w, b is a solution-required variable.
The embodiment of the invention sets parameters in the SVM classifier as follows: the coefficient c=2000 of the penalty term and the linear kernel function is chosen to achieve a high-dimensional feature map. Generally, the greater the penalty factor, the greater the degree of penalty on the error prone samples, and therefore the greater the accuracy in the training samples.
In the method provided in embodiment 1 of the present invention, steps 101 to 104 are detection steps, and in embodiment 1 of the present invention, training and verification steps are performed by obtaining a model applied in steps 101 to 104, as shown in fig. 11, specifically:
the steel is a widely used metal material in life, and the quality of the steel can directly influence the quality of finished products. However, during the production, transportation and use of the steel, the defect problems of different degrees sometimes occur, wherein the most important problem is the cracking problem of the steel surface, the inspection by manpower is time-consuming and labor-consuming, the effect is usually poor, and the use of the steel is seriously affected. Therefore, the invention takes 399 Zhang Gang surface pictures contained in KolektorSDD-boxes (KolektorSDD-boxes are target detection defect databases for realizing small data sets) data sets as an example, and detects steel surface cracks to verify the effectiveness of the proposed method.
The KolektorSDD-boxes dataset has 399 pictures in total, which can be divided into two types: there were cracks and no cracks, 52 pictures containing cracks, each picture containing cracks contained only 1 crack, as shown in fig. 9, and no crack picture as shown in fig. 8.
Before training, as the data sets containing cracks in the whole KolektorSDD-boxes data set are fewer, the feature extraction of the YOLOV7 and SVM classifier is affected, the embodiment of the invention firstly carries out data enhancement on the data sets with cracks, respectively carries out mirror symmetry relative to a X, Y axis on the data sets with cracks, and expands one picture into four pictures, thereby achieving the purpose of expanding the data sets.
In the YOLOV7 training stage, the images containing cracks in the amplified data set are used, 208 images are taken as a training set, 168 images are taken as a verification set, and the trained model is stored. Preliminary predictions of fracture regions throughout the dataset are then obtained by setting different confidence thresholds. The resulting anchor frame information may contain all fracture regions due to the lower confidence threshold. Meanwhile, in order to better utilize the original image information, the embodiment of the present invention directly extracts the corresponding image block by using the obtained anchor frame information to calculate the LBP feature, as shown in fig. 10, the crack is denoted by the ack in fig. 10.
In the embodiment of the invention, in the training stage, the confidence threshold T of the training stage is calculated train Set to 0.05, the image block extracted by YOLOV7 is subjected to multi-scale LBP feature extraction, and training of an SVM model (i.e., SVM classifier) is performed. In order to better train the SVM model, the data expansion is realized by using a mirror symmetry mode, the ratio of the training set to the testing set is set to be 4:1, and finally the trained model is saved.
In the prediction phase, the confidence threshold T of the test phase is used for test The rough extraction of the crack region was achieved at 0.15, and further the images were feature extracted using LBP and classified using SVM, with the results shown in table 1. As can be seen from Table 1, the classification model designed by the invention has only 2 sample classification errors, and the classification accuracy is 97.1%. Meanwhile, 51 pictures are totally identified by using the 52 pictures of the crack, and compared with other existing prediction methods, the method has great advantages, as shown in table 2. The confidence threshold for YOLOV7 in table 2 was subjected to a number of experiments, with a final choice confidence threshold of 0.31. As can be seen through comparative analysis, the method has no special requirement on the setting of the confidence threshold in the YOLOV7, and only the YOLOV7 is adopted to try different confidence thresholds for a plurality of times and then the selection is carried out.
TABLE 1 classification results
Picture numbering Real label Identification tag Picture numbering Real label Identification tag Picture numbering Real label Identification tag Picture numbering Real label Identification tag Picture numbering Real label Identification tag
1 1 [1] 15 1 [1] 29 0 [1] 43 1 [1] 57 1 [1]
2 1 [0] 16 0 [0] 30 1 [1] 44 0 [0] 58 1 [1]
3 1 [1] 17 1 [1] 31 1 [1] 45 1 [1] 59 1 [1]
4 0 [0] 18 1 [1] 32 1 [1] 46 1 [1] 60 1 [1]
5 0 [0] 19 1 [1] 33 1 [1] 47 0 [0] 61 1 [1]
6 0 [0] 20 0 [0] 34 1 [1] 48 1 [1] 62 0 [0]
7 1 [1] 21 0 [0] 35 1 [1] 49 1 [1] 63 1 [1]
8 1 [1] 22 0 [0] 36 1 [1] 50 0 [0] 64 1 [1]
9 1 [1] 23 1 [1] 37 1 [1] 51 1 [1] 65 1 [1]
10 1 [1] 24 1 [1] 38 1 [1] 52 1 [1] 66 1 [1]
11 1 [1] 25 0 [0] 39 1 [1] 53 1 [1] 67 1 [1]
12 0 [0] 26 1 [1] 40 1 [1] 54 0 [0] 68 1 [1]
13 1 [1] 27 1 [1] 41 1 [1] 55 0 [0] 69 1 [1]
14 0 [0] 28 1 [1] 42 1 [1] 56 1 [1] 70 0 [0]
Table 2 comparison of results
Method Number of false checks Number of missed detection Error checking number
YOLOV7 2 1 3
The invention is that 1 1 2
Example 2
Embodiment 2 of the present invention provides a system for detecting a steel surface crack, the system being applied to the above method, the system comprising:
the picture acquisition module is used for acquiring a picture to be detected on the surface of the steel;
the detection module is used for carrying out crack detection on the picture to be detected on the steel surface based on the trained YOLOV7 target detection model, and cutting the picture to be detected to obtain an image block to be detected with cracks;
the feature extraction and fusion module is used for carrying out feature extraction and fusion on the image block to be detected based on a multi-scale LBP operator to obtain multi-scale LBP features of the image block to be detected;
and the classification module is used for inputting the multi-scale LBP characteristics of the image block to be detected into a trained SVM classifier to classify the cracks on the surface of the steel. .
Example 3
Embodiment 3 of the present invention provides an electronic device including a memory, a processor, and a computer program stored on the memory and executable on the processor, the processor implementing the method of embodiment 1 when executing the computer program.
Furthermore, the computer program in the above-described memory may be stored in a computer-readable storage medium when it is implemented in the form of a software functional unit and sold or used as a separate product. Based on this understanding, the technical solution of the present invention may be embodied essentially or in a part contributing to the prior art or in the form of a software product stored in a storage medium, comprising several instructions for causing a computer device (which may be a personal computer, a server or a network device, etc.) to perform all or part of the steps of the method according to the embodiments of the present invention. And the aforementioned storage medium includes: various media capable of storing program codes, such as a U disk, a mobile hard disk, a read-only memory, a random access memory, a magnetic disk or an optical disk.
Example 4
Embodiment 4 of the present invention provides a computer-readable storage medium having stored thereon a computer program which, when executed, implements the method of embodiment 1.
In summary, the invention performs steel surface crack target detection based on YOLOV7, and uses LBP and SVM to further classify the detected results, and the validity of the invention is verified by examples.
The method can fully utilize the image of the steel surface to acquire the crack position, detect the crack of the steel surface, and has good engineering application value.
In the present specification, each embodiment is described in a progressive manner, and each embodiment is mainly described in a different point from other embodiments, and identical and similar parts between the embodiments are all enough to refer to each other. For the device disclosed in the embodiment, since it corresponds to the method disclosed in the embodiment, the description is relatively simple, and the relevant points refer to the description of the method section.
The principles and embodiments of the present invention have been described herein with reference to specific examples, the description of which is intended only to assist in understanding the methods of the present invention and the core ideas thereof; also, it is within the scope of the present invention to be modified by those of ordinary skill in the art in light of the present teachings. In view of the foregoing, this description should not be construed as limiting the invention.

Claims (8)

1. A method for detecting a steel surface crack, the method comprising the steps of:
acquiring a picture to be measured on the surface of the steel;
performing crack detection on the picture to be detected on the steel surface based on the trained YOLOV7 target detection model, and cutting to obtain an image block to be detected with cracks;
performing feature extraction and fusion on the image block to be detected based on a multi-scale LBP operator to obtain multi-scale LBP features of the image block to be detected;
inputting the multi-scale LBP characteristics of the image block to be detected into a trained SVM classifier, and classifying cracks on the surface of the steel.
2. The method for detecting the surface cracks of the steel according to claim 1, wherein the YOLOV7 target detection model comprises an Input module, a backup module and a Head module which are connected in sequence.
3. The method for detecting steel surface cracks according to claim 2, wherein the backbond module adopts a high-efficiency layer aggregation network;
the high-efficiency layer aggregation network comprises: a first 1x1 convolution module, a second 1x1 convolution module, a first 3x3 convolution module, a second 3x3 convolution module, a third 3x3 convolution module, a fourth 3x3 convolution module, a full connection layer, and a third 1x1 convolution module;
the output end of the first 1x1 convolution module is connected with the input end of the full connection layer;
the output end of the second 1x1 convolution module is respectively connected with the input end of the full connection layer and the input end of the first 3x3 convolution module;
the output end of the first 3x3 convolution module is connected with the input end of the second 3x3 convolution module;
the output end of the second 3x3 convolution module is respectively connected with the input end of the full connection layer and the input end of the third 3x3 convolution module;
the output end of the third 3x3 convolution module is connected with the input end of the fourth 3x3 convolution module, and the output end of the fourth 3x3 convolution module is connected with the input end of the full connection layer;
the output end of the full connection layer is connected with the input end of the convolution module of the third 1x 1.
4. The method for detecting the surface cracks of the steel according to claim 1, wherein the adjacent point of the multi-scale LBP operator is 8, the adjacent point is a circular adjacent point with the radius of 1,5,6,7,8,9, 10 and 11 respectively, and the mode is uniform.
5. The method for detecting cracks on a steel surface according to claim 1, wherein the step of detecting the cracks on the picture to be detected on the steel surface based on the trained YOLOV7 target detection model, and cutting the picture to be detected to obtain an image block to be detected with the cracks, further comprises the following steps:
acquiring a steel surface sample picture with cracks and a steel surface sample picture without cracks, and constructing a data set;
carrying out data enhancement on the steel surface sample picture with the crack in the data set to obtain an amplified data set;
dividing the amplified data set into a training set and a verification set;
training the YOLOV7 target detection model based on the training set to obtain a trained YOLOV7 target detection model;
performing crack detection on a steel surface sample picture in a training set based on the trained YOLOV7 target detection model, and cutting to obtain a sample image block with cracks;
performing feature extraction and fusion on the sample image block based on a multi-scale LBP operator to obtain multi-scale LBP features of the sample image block;
training the SVM classifier based on the multi-scale LBP characteristics of each sample image block in the training set to obtain a trained SVM classifier;
verifying the trained YOLOV7 target detection model and the trained SVM classifier based on the verification set;
when the verification is passed, outputting the trained Yolov7 target detection model as a trained Yolov7 target detection model, and outputting the trained SVM classifier as a trained SVM classifier;
and when the verification fails, returning to the step of training the YOLOV7 target detection model based on the training set to obtain a trained YOLOV7 target detection model, and continuing training.
6. A system for detecting cracks in a steel surface, characterized in that it is applied to a method according to any one of claims 1-5, said system comprising:
the picture acquisition module is used for acquiring a picture to be detected on the surface of the steel;
the detection module is used for carrying out crack detection on the picture to be detected on the steel surface based on the trained YOLOV7 target detection model, and cutting the picture to be detected to obtain an image block to be detected with cracks;
the feature extraction and fusion module is used for carrying out feature extraction and fusion on the image block to be detected based on a multi-scale LBP operator to obtain multi-scale LBP features of the image block to be detected;
and the classification module is used for inputting the multi-scale LBP characteristics of the image block to be detected into a trained SVM classifier to classify the cracks on the surface of the steel.
7. An electronic device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, the processor implementing the method of any one of claims 1 to 5 when executing the computer program.
8. A computer readable storage medium, characterized in that a computer program is stored thereon, which computer program, when executed, implements the method according to any of claims 1 to 5.
CN202310315582.1A 2023-03-29 2023-03-29 Detection method and system for steel surface cracks Pending CN116030056A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310315582.1A CN116030056A (en) 2023-03-29 2023-03-29 Detection method and system for steel surface cracks

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310315582.1A CN116030056A (en) 2023-03-29 2023-03-29 Detection method and system for steel surface cracks

Publications (1)

Publication Number Publication Date
CN116030056A true CN116030056A (en) 2023-04-28

Family

ID=86079785

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310315582.1A Pending CN116030056A (en) 2023-03-29 2023-03-29 Detection method and system for steel surface cracks

Country Status (1)

Country Link
CN (1) CN116030056A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117893872A (en) * 2024-03-18 2024-04-16 成都理工大学 Plane fracture optical detection method based on multi-model fusion detection

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117893872A (en) * 2024-03-18 2024-04-16 成都理工大学 Plane fracture optical detection method based on multi-model fusion detection
CN117893872B (en) * 2024-03-18 2024-05-14 成都理工大学 Plane fracture optical detection method based on multi-model fusion detection

Similar Documents

Publication Publication Date Title
CN108765412B (en) Strip steel surface defect classification method
CN110738125B (en) Method, device and storage medium for selecting detection frame by Mask R-CNN
CN110796637A (en) Training and testing method and device of image defect detection model and storage medium
CN113569667B (en) Inland ship target identification method and system based on lightweight neural network model
CN112837294B (en) Thermal imaging defect detection method based on convolution self-encoder image amplification
Jian et al. Imbalanced defect classification for mobile phone screen glass using multifractal features and a new sampling method
CN116030056A (en) Detection method and system for steel surface cracks
CN112541884A (en) Defect detection method and apparatus, and computer-readable storage medium
CN117030129A (en) Paper cup on-line leakage detection method and system thereof
CN117557565B (en) Detection method and device for lithium battery pole piece
CN112200789B (en) Image recognition method and device, electronic equipment and storage medium
CN115797314B (en) Method, system, equipment and storage medium for detecting surface defects of parts
CN116091496B (en) Defect detection method and device based on improved Faster-RCNN
CN117011274A (en) Automatic glass bottle detection system and method thereof
Dong A pixel-wise framework based on convolutional neural network for surface defect detection
CN116523871A (en) Method and device for detecting defects of machined part, electronic equipment and storage medium
Evstafev et al. Surface Defect Detection and Recognition Based on CNN
Elanangai et al. Automated system for defect identification and character recognition using IR images of SS-plates
Chen et al. Wire Rope Damage Detection Based on Magnetic Leakage and Visible Light
CN116188973B (en) Crack detection method based on cognitive generation mechanism
Hou et al. A new approach for the detection of concrete cracks based on adaptive morphological filtering
Yemelyanova et al. Application of machine learning for recognizing surface welding defects in video sequences
CN116385414B (en) Component multi-scale defect feature extraction method, computing device and storage medium
Sui et al. A boundary aware neural network for road extraction from high-resolution remote sensing imagery
Lee et al. A study on defect detection in X-ray image castings based on unsupervised learning

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination