A Concrete Crack Detection Method and System Based on YOLOv5 Algorithm

The proposed pre-processing model for YOLOv5-based concrete crack detection filters out water stains by seasonal data segregation and gradient algorithms, addressing computational inefficiencies and improving detection speed and accuracy.

CN118446980BActive Publication Date: 2025-07-15POWERCHINA HUADONG ENG CORP LTD +1
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202410549569.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-05-06
Publication Date
2025-07-15
Estimated Expiration
2044-05-06

AI Technical Summary

Technical Problem

The existing concrete crack detection method based on the YOLOv5 algorithm has many water stain interference factors in the image, resulting in slow detection speed and easy to misjudgment, high computing resources consumption, and difficult to achieve efficient and accurate crack detection.

Method used

The image screening model is constructed, and the closed area is identified by pre-processing the image, grayscale conversion and gradient algorithms, and combined with the seasonal changes characteristics, water stains and cracks are screened out to reduce water stain interference, and the detection accuracy and speed of the YOLOv5 algorithm model are improved.

Benefits of technology

The image is initially processed through the image filtering model, identify and eliminate water stains, reduce the detection amount of YOLOv5 algorithm model, improve the detection speed and accuracy, reduce the impact of seasonal temperature, and improve the overall detection effect of the system.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118446980B_ABST
    Figure CN118446980B_ABST
Patent Text Reader

Abstract

The present invention provides a concrete crack detection method and system based on the YOLOv5 algorithm, which relates to the technical field of concrete crack detection. By constructing an image screening model and combining it with the YOLOv5 algorithm model, the present invention can preliminarily detect and process the images input into the YOLOv5 algorithm model, identify and eliminate the water stain parts in the images, reduce the influence of the water stains in the images input into the YOLOv5 algorithm model on the detection results, and also reduce the detection amount of the YOLOv5 algorithm model, achieving the effects of improving the detection speed and accuracy. At the same time, different judgment criteria are adopted according to different seasons to reduce the influence of seasonal temperature on the detection of the image screening model, further improving the overall detection accuracy of the system.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of concrete crack detection, and specifically provides a concrete crack detection method and system based on the YOLOv5 algorithm. Background Art

[0002] YOLOv5 is a relatively novel deep learning network for image recognition. Currently, it has been used in the detection of concrete cracks in road bridges and buildings, and has higher objectivity and reliability compared to traditional methods such as ultrasonic detection, acoustic emission detection, and fiber optic sensing detection.

[0003] In the prior art, the publication number CN115223060A discloses a rapid crack detection method based on the combination of an improved YOLOv5 neural network and drone video. The YOLOv5 model is trained with existing concrete crack images, and the images of the points to be detected are collected and input into the trained YOLOv5 model for recognition. Although this method can achieve crack detection, there are many interference factors in the images, and the detection volume of the YOLOv5 model is also larger, which not only reduces the detection speed but also easily causes misjudgment. Among the interference factors in the images, water stains are the most similar to cracks and have the highest occurrence probability. If the images are directly input into the YOLOv5 model for detection, a large amount of computing resources are required to distinguish between the two. Therefore, a method is needed to exclude the interference factors of water stains in the images in advance before inputting them into the YOLOv5 model, so that the YOLOv5 model can detect in a faster and more accurate manner, achieving the purpose of improving the overall detection effect and accuracy of the system.

[0004] The above information disclosed in the background art section is only used to enhance the understanding of the background of the present disclosure, and therefore it may include information that does not constitute the prior art known to those of ordinary skill in the art. Summary of the Invention

[0005] The purpose of the present invention is to provide a concrete crack detection method and system based on the YOLOv5 algorithm to solve the problems raised in the above background art.

[0006] To achieve the above purpose, the present invention provides the following technical solutions:

[0007] A concrete crack detection method based on the YOLOv5 algorithm, the specific steps include:

[0008] S1: Collect a number of groups of concrete historical images, and divide the historical images into a training set and a validation set;

[0009] S2: Divide the images in the training set once according to the image type into a water stain group and a crack group, and then perform a secondary division on the water stain group and the crack group according to the collection time of the images by season;

[0010] S3: Construct an image screening model, use the water stain group and the crack group after the secondary division to train the model, realize the distinction and screening of the water stain group and the crack group in different seasons, and use the validation set to verify the accuracy of the model;

[0011] S4: Collect real-time images of concrete at several measurement points, use the image screening model to screen the real-time images, and use the screened real-time images as the input of the YOLOv5 algorithm model;

[0012] S5: Use the YOLOv5 algorithm model to process the screened real-time images, judge whether there are cracks in the real-time images, and issue an alarm according to the judgment result.

[0013] Preferably, label the training set and the validation set as Wx and Wy respectively, and label the water stain group and the crack group in the training set as The subscripts i and p represent the picture numbers in the water stain group and the crack group respectively, and the superscript j represents the season number.

[0014] Preferably, the working logic of the image screening model in step S3 is;

[0015] S301: Preprocess the input image, set it to the same size format, and perform denoising filtering on the preprocessed input image to generate a standard image;

[0016] S302: Convert the standard image into a grayscale image, use the gradient algorithm to identify the edge points of the dark area in the grayscale image to form a closed area and calibrate it to generate a recognition image;

[0017] S303: Repeat steps S301 to S302, process different input images to generate corresponding recognition images, compare the image information of adjacent two groups of recognition images, judge the type of the closed area in the recognition image, and perform secondary processing on the recognition image according to the judgment result to generate an output image.

[0018] Preferably, the generation logic of the closed area is:

[0019] Detect the grayscale value of each pixel point in the grayscale image, calculate the horizontal gradient and vertical gradient of each pixel point, and process the horizontal gradient and vertical gradient of each pixel point using the Sobel operator;

[0020] According to the horizontal gradient and vertical gradient of each pixel after processing, calculate its edge intensity, and mark the pixels whose edge intensity exceeds the threshold range as strong edge points;

[0021] Connect multiple groups of strong edge points to form several closed regions respectively, detect the area of each closed region and number them.

[0022] Preferably, the method for training the image screening model is as follows:

[0023] Take the water stain group and the crack group in the training set as the input images of the image screening model respectively, generate the corresponding recognition images with closed regions, and label the closed regions in the recognition images as B q and measure its area and The subscript q represents the number of the closed region;

[0024] Identify the closed regions B in the recognition images generated by the water stain group and the crack group q under different seasons respectively, and calculate the area change of the closed region B q generated by water stains and cracks in the recognition images in different seasons respectively;

[0025] Use the images in the validation set as the input images of the image screening model for discrimination and screening, judge whether they belong to water stains or cracks according to the variable coefficients of the closed region B q in the corresponding recognition images, and calculate the accuracy rate of the judgment results generated by the image screening model. When the accuracy rate ≥ 95%, it is considered that the training of the image screening model is completed.

[0026] Preferably, the calculation method of the variable coefficients of the closed region B q generated by water stains and cracks in different seasons is as follows:

[0027]

[0028]

[0029] In the formula respectively represent the variable coefficients of the closed region B q generated by water stains and cracks in different seasons, respectively represent the area change amounts of the closed region B q in the recognition images generated by the water stain group and the crack group, and the calculation methods are respectively: n1 represents that there is a closed region B in the water stain group qThe number of images, and n2 represents the number of images in the crack group where there is a closed area B q The number of images, m1 represents the image number when water stains appear, and m2 represents the image number when cracks appear.

[0030] Preferably, when using the images in the validation set as the input images of the image screening model, recognition images are generated based on the input images, and different closed areas B in the recognition images are calculated q The corresponding variable coefficients And according to the acquisition time of the input images, Compare with the water stain variable coefficients And the crack variable coefficients in the corresponding season. When σ1], it is considered that the corresponding closed area B q is a water stain. When it is considered that the corresponding closed area B q is a crack, where σ1 and σ2 are respectively the preset first fluctuation difference and second fluctuation difference.

[0031] Preferably, count the number Q' of correct judgments on the closed area B in each group of validation set images by the image screening model, and calculate the accuracy rate α of the image screening model. The calculation method is: q

[0032]

[0033] In the formula, q represents the total number of closed areas B q in each group of validation set images. When the accuracy rate α≥95%, it is considered that the training of the image screening model is completed. When the accuracy rate α<95%, adjust the first fluctuation difference σ1 and the second fluctuation difference σ2 to optimize the image screening model.

[0034]

[0034] Preferably, the logic for secondary processing of the recognition image is:

[0035] When the closed area B q is a crack, directly output the corresponding recognition image as the output image;

[0036] When the closed area B q is a water stain, collect the coordinates of the four pixel points at the top, bottom, left, and right of the closed area B q and mark them as (x1, y1), (x2, y2), (x3, y3), (x4, y4) respectively, and generate a rectangle with horizontal and vertical lengths of (x4 - x3)*(y1 - y2) to frame the closed area B q ;

[0037] Determine the size relationship between (x4 - x3) and (y1 - y2), and take the group with the larger difference as the side length l. Construct a square with side length l outside the rectangle of (x4 - x3)*(y1 - y2), and the center lines of the rectangle and the square coincide;

[0038] Calculate the average gray value of the area from the outside of the rectangle to the inside of the square When l = x4 - x3, the calculation method of the average gray value is as follows:

[0039]

[0040] When l = y1 - y2, the calculation method of the average gray value is as follows:

[0041]

[0042] In the formula, HD (x,y) represents the gray value of each pixel point from the outside of the rectangle to the inside of the square;

[0043] Set the gray value of each pixel point in the rectangle of (x4 - x3)*(y1 - y2) to the average gray value After completing the secondary processing of the recognized image, output it as the output image.

[0044] A concrete crack detection system based on the YOLOv5 algorithm. The detection system adopts the above detection method, including:

[0045] An image acquisition module, which is used to regularly acquire images of concrete points to be detected;

[0046] A data storage module, which is used to store the historical images and the acquired real-time images of concrete;

[0047] An image processing module, which is used to perform image preprocessing on historical images and real-time images;

[0048] A data analysis module, which is used to construct an image screening model and a YOLOv5 algorithm model, determine whether there are cracks in the image, and issue an alarm signal according to the judgment result;

[0049] An alarm module, which is used to issue an alarm according to the alarm signal.

[0050] Compared with the prior art, the beneficial effects of the present invention are:

[0051] By constructing an image screening model and combining it with the YOLOv5 algorithm model, the present invention can preliminarily detect and process the images input into the YOLOv5 algorithm model, identify and eliminate the water stain parts in the images, reduce the influence of the water stains in the images input into the YOLOv5 algorithm model on the detection results, and also reduce the detection amount of the YOLOv5 algorithm model, achieving the effects of improving the detection speed and accuracy. At the same time, different judgment criteria are adopted according to different seasons to reduce the influence of seasonal temperature on the detection of the image screening model, further improving the overall detection accuracy of the system. BRIEF DESCRIPTION OF THE DRAWINGS

[0052] Figure 1 It is a schematic diagram of the overall method flow of the present invention;

[0053] Figure 2 It is a schematic diagram of the flow of step S3 in the present invention;

[0054] Figure 3 It is a schematic diagram of the module structure of the present invention. DETAILED DESCRIPTION OF THE EMBODIMENTS

[0055] In order to make the objectives, technical solutions, and advantages of the present invention clearer and more understandable, the present invention will be further described in detail below in conjunction with specific embodiments.

[0056] It should be noted that unless otherwise defined, the technical terms or scientific terms used in the present invention should have the ordinary meanings understood by those of ordinary skill in the field to which the present invention belongs. The "first", "second", and similar terms used in the present invention do not indicate any order, quantity, or importance, but are only used to distinguish different components. The terms such as "comprising" or "including" mean that the elements or objects appearing before this word cover the elements or objects listed after this word and their equivalents, without excluding other elements or objects. The terms such as "connected" or "coupled" are not limited to physical or mechanical connections, but may include electrical connections, whether direct or indirect. The terms such as "upper", "lower", "left", "right", etc. are only used to represent relative positional relationships, and when the absolute position of the object being described changes, the relative positional relationship may also change accordingly.

[0057] Embodiment:

[0058] Please refer to Figure 1 - Figure 2 , the present invention provides a technical solution:

[0059] A concrete crack detection method based on the YOLOv5 algorithm, the specific steps include:

[0060] S1: Collect several groups of concrete historical images, where the historical images are continuous images of several concrete detection points, divide the historical images into a training set and a verification set according to the detection points, and calibrate the training set and the verification set as Wx and Wy respectively;

[0061] S2: The images in the training set are divided into water stain group and crack group according to image type. Then, the water stain group and crack group are divided into two groups according to the season and the image acquisition time. The water stain group and crack group in the training set are marked as The subscripts i and p represent the image numbers in the water stain group and the crack group, respectively, and the superscript j represents the season number. Since the changes in water stains vary greatly in different seasons, and temperature also affects the changes in cracks, dividing the images by season can reduce the impact of seasonal changes on the detection results and improve the detection accuracy of the system.

[0062] S3: Build an image screening model, use the secondary division of water stains and cracks to train the model, realize the distinction and screening of water stains and cracks in different seasons, and use the validation set to verify the accuracy of the model;

[0063] S4: collect several groups of real-time images of concrete at the test points, use the image screening model to screen the real-time images, and use the screened real-time images as the input of the YOLOv5 algorithm model;

[0064] S5: Use the YOLOv5 algorithm model to process the filtered real-time image to determine whether there are cracks in the real-time image, and issue an alarm based on the judgment result.

[0065] The working logic of the image screening model in step S3 is:

[0066] S301: preprocessing the input images, setting them uniformly to the same size format, and performing denoising filtering on the preprocessed input images to generate standard images;

[0067] S302: Convert the standard image into a grayscale image, then use the gradient algorithm to identify the edge points of the dark area in the grayscale image to form a closed area and calibrate it, generating a recognition image. When forming the closed area, the gray value of each pixel point in the grayscale image is detected by weighted processing of the red channel, green channel, and blue channel of each pixel point in the standard image. Calculate the horizontal gradient and vertical gradient of each pixel point, and use the Sobel operator to process the horizontal gradient and vertical gradient of each pixel point. Then, according to the processed horizontal gradient and vertical gradient of each pixel point, calculate its edge strength. Mark the pixel points with edge strength exceeding the threshold range as strong edge points. Finally, connect multiple groups of strong edge points to form several groups of closed areas respectively, detect the area of each group of closed areas and number them. Whether it is water stain or crack, its color is quite different from the background, so it is easier to form a closed area. That is to say, by detecting the closed area in the image, it is easier to find the position corresponding to the water stain or crack.

[0068] S303: Repeat steps S301 - 302 to process different input images to generate corresponding recognition images, and compare the image information of adjacent two groups of recognition images to judge the type of the closed area in the recognition image. Perform secondary processing on the recognition image according to the judgment result and generate an output image.

[0069] The method for training the image screening model is as follows:

[0070] Take the water stain group and the crack group in the training set as the input images of the image screening model respectively, generate corresponding recognition images with closed areas, calibrate the closed areas in the recognition image as B q and measure its area and The subscript q represents the number of the closed area;

[0071] Identify the closed area B in the recognition images generated by the water stain group and the crack group q respectively under different seasons, and measure the area change of the closed area B q in the recognition image. Calculate the variable coefficients of the closed area B q generated by water stains and cracks in different seasons in the recognition image respectively. The calculation method of the variable coefficients of the closed area B

[0072]

[0073]

[0074] In the formula Respectively represent the closed regions B where water stains and cracks are generated in different seasons q The variable coefficient of Respectively represent the closed region B in the recognition images generated by the water stain group and the crack group q The change in area of n1 represents the number of images in the water stain group where there is a closed region B q The number of images in the crack group where there is a closed region B q m1 represents the image number when the water stain appears, and m2 represents the image number when the crack appears

[0075] For example, in the water stain group, for a certain concrete detection point, there are multiple images collected in spring as the input images of the image screening model. At the m1-th image of this group of images, a water stain appears on the concrete detection point and a closed region is detected. The water stain persists for n1 images and completely disappears at the (m1 + n1)-th image. Then the water stain variable coefficient Reflects the change rate of the corresponding closed region in the images within the serial numbers from m1 to m1 + n1. Since without external interference, the water stains on the concrete will gradually disappear in a relatively uniform manner, which is reflected in the water stain variable coefficient, indicating that the water stain variable coefficient Is a negative number with a relatively large absolute value. On the contrary, if there are cracks on the concrete, the cracks will also gradually increase in a relatively uniform manner, and the speed is much slower than the speed at which the water stains disappear. This is reflected in the crack variable coefficient, indicating that the crack variable coefficient Is a relatively small positive number. Therefore, by using the water stain variable coefficients And crack variable coefficients In different seasons as the reference range, it is convenient for the system to identify the types of closed regions, reduce the detection amount of the subsequent YOLOv5 algorithm model, and improve its detection accuracy

[0076] Use the images in the validation set as the input images of the image screening model for discrimination and screening. According to the variable coefficient of the closed region B q In the corresponding recognition image to determine whether it belongs to a water stain or a crack. When using the images in the validation set as the input images of the image screening model, generate a recognition image according to the input images, and calculate the variable coefficients q Corresponding to different closed regions B In the recognition image and, according to the acquisition time of the input images, compare With the water stain variable coefficients And crack variable coefficients In the corresponding seasons. When , it is considered that the corresponding closed region B q Is a water stain. When When it is, the corresponding closed region B is considered q as a crack, where σ1 and σ2 are the preset first fluctuation difference and second fluctuation difference respectively. After the screening is completed, to ensure the accuracy of the results, the final results can be judged by manual rechecking. Then, count the number Q′ of correct judgments of the closed region B in each group of validation set images by the image screening model, and calculate the accuracy α of the image screening model. The calculation method is as follows: q The number of correct judgments Q′ of the closed region B in each group of validation set images is counted, and the accuracy α of the image screening model is calculated. The calculation method is as follows:

[0077]

[0078] In the formula, Q represents the total number of closed regions B in each group of validation set images q The accuracy α is equivalent to the proportion of the closed regions correctly judged by the image screening model among all the closed regions corresponding to all the validation set images. When the accuracy α≥95%, it is considered that the error of the image screening model is within the allowable range and the training is completed. When the accuracy α<95%, it is considered that the error of the image screening model is relatively large, and the first fluctuation difference σ1 and the second fluctuation difference σ2 need to be adjusted to optimize the judgment conditions of the image screening model for water stains and cracks, so as to improve the accuracy of the image screening model.

[0079] The logic for secondary processing of the recognition image is as follows:

[0080] When the closed region B q is a crack, the corresponding recognition image is directly output as the output image, that is, no secondary processing is required. The image initially judged by the image screening model to have cracks and no water stain interference is directly input into the YOLOv5 algorithm model for re-detection, so as to re-judge whether there are cracks in the image and identify the position of the cracks in the image for boxing, reducing the influence of water stain interference on the result accuracy of the YOLOv5 algorithm model and achieving the effect of improving the detection accuracy.

[0081] When the closed region B q is a water stain, in order to reduce the detection amount of the YOLOv5 algorithm model, image processing needs to be performed on the closed region corresponding to the water stain. Collect the coordinates of the four pixel points of the topmost, bottommost, leftmost, and rightmost of the closed region B q and label them as (x1, y1), (x2, y2), (x3, y3), (x4, y4) respectively, and generate a rectangle with horizontal and vertical lengths of (x4 - x3)*(y1 - y2) to enclose the closed region B qPerform a box selection, then determine the size relationship between (x4 - x3) and (y1 - y2), and take the group with the larger difference as the side length l. Construct a square with side length l outside the rectangle of (x4 - x3)*(y1 - y2), and the center lines of the rectangle and the square coincide. That is to say, when (x4 - x3) > (y1 - y2), the corresponding closed area box is a flat rectangle as a whole, and a square is formed with (x4 - x3) as the side length. It is equivalent to supplementing a flat rectangle on both the upper and lower sides of the flat rectangle. The width of the supplemented rectangle is [l - (y1 - y2)] / 2, and the length is l. Similarly, when (x4 - x3) < (y1 - y2), the corresponding closed area box is a vertically long rectangle as a whole, and a square is formed with (y1 - y2) as the side length. It is equivalent to supplementing on both the left and right sides of the vertically long rectangle. The width of the supplemented rectangle is [l - (x4 - x3)] / 2, and the length is l.

[0082] Calculate the average gray value of the area between the outside of the rectangle and the inside of the square. When l = x4 - x3, the average gray value is calculated as follows:

[0083]

[0084] When l = y1 - y2, the average gray value is calculated as follows:

[0085]

[0086] In the formula, HD (x,y) represents the gray value of each pixel point between the outside of the rectangle and the inside of the square. In the formula, l 2 -l(y1 - y2) represents the area size of the two supplementary rectangles when supplementing in the upper and lower directions, that is, the total number of pixel points in the two supplementary rectangles. l 2 -l(x4 - x3) represents the total number of pixel points in the two supplementary rectangles when supplementing in the left and right directions. The upper part of the fraction represents the sum of the gray values of each pixel point in the two supplementary rectangles.

[0087] Finally, set the gray value of each pixel point in the rectangle of (x4 - x3)*(y1 - y2) to the average gray value. That is, replace the closed area itself with the background where the closed area is located, eliminate the closed area identified as water stains. After completing the secondary processing of the identified image, output it as the output image, thereby reducing the detection amount of the subsequent YOLOv5 algorithm model, improving the detection speed of the YOLOv5 algorithm model, and also reducing the risk of final false alarms.

[0088] Please refer to Figure 3, the present invention also provides a concrete crack detection system based on the YOLOv5 algorithm. The detection system adopts the above detection method and includes:

[0089] An image acquisition module, which is used to regularly acquire images of the concrete points to be detected;

[0090] A data storage module, which is used to store the historical images and the acquired real-time images of the concrete;

[0091] An image processing module, which is used to perform image preprocessing on the historical images and real-time images;

[0092] A data analysis module, which is used to construct an image screening model and a YOLOv5 algorithm model, judge whether there are cracks in the image, and send an alarm signal according to the judgment result;

[0093] An alarm module, which is used to issue an alarm according to the alarm signal.

[0094] The above formulas are all dimensionless and take their numerical calculations. The formula is a formula obtained by software simulation of a large amount of collected data to approximate the real situation. The preset parameters in the formula are set by those skilled in the art according to the actual situation.

[0095] The above embodiments can be implemented in whole or in part by software, hardware, firmware or any other combination. When implemented using software, the above embodiments can be implemented in whole or in part in the form of a computer program product. Those skilled in the art can realize that the units and algorithm steps of each example described in combination with the embodiments disclosed in this article can be implemented by electronic hardware, or by the combination of computer software and electronic hardware. Whether these functions are executed by hardware or software methods depends on the specific application and design constraints of the technical solution.

[0096] The units described as separate components may or may not be physically separated. The components shown as units may or may not be physical units. They can be located in one place or distributed to multiple network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0097] The above is only the specific implementation manner of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art can easily think of changes or substitutions within the technical scope disclosed in the present application, and all should be covered by the protection scope of the present application.

Claims

1. A concrete crack detection method based on the YOLOv5 algorithm, characterized in that, The specific steps include: S1: Collect several groups of historical concrete images and divide the historical images into a training set and a validation set; S2: Make a primary division of the images in the training set according to the image type, dividing them into a water stain group and a crack group, and then make a secondary division of the water stain group and the crack group according to the collection time of the images by season; S3: Build an image screening model, train the model using the water stain group and crack group after the secondary division to achieve the distinction and screening of the water stain group and crack group in different seasons, and use the validation set to verify the accuracy of the model; The working logic of the image screening model in step S3 is as follows; S301: Preprocess the input image, uniformly set it to the same size format, and perform denoising filtering on the preprocessed input image to generate a standard image; S302: Convert the standard image into a grayscale image, use the gradient algorithm to identify the edge points of the dark areas in the grayscale image to form a closed area and calibrate it to generate a recognition image; S303: Repeat steps S301 - 302, process different input images to generate corresponding recognition images, compare the image information of adjacent two groups of recognition images, judge the type of the closed area in the recognition image, and perform secondary processing on the recognition image according to the judgment result to generate an output image; Identify the closed area B in the recognition images generated by the water stain group and the crack group separately in different seasons, and calculate the area change of the closed area B in the recognition images. Calculate the variable coefficients of the closed area B generated by water stains and cracks in different seasons in the recognition images respectively, q where the subscripts i and p represent the picture numbers in the water stain group and the crack group respectively, the superscript j represents the season number, and the subscript q represents the number of the closed area; q These variable coefficients are used as the image information for recognition. S4: Collect several groups of real-time images of the concrete at the measurement points to be tested, use the image screening model to screen the real-time images, and use the screened real-time images as the input of the YOLOv5 algorithm model; S5: Use the YOLOv5 algorithm model to process the screened real-time images, judge whether there are cracks in the real-time images, and issue an alarm according to the judgment result.

2. The concrete crack detection method based on the YOLOv5 algorithm according to claim 1, wherein: Label the training set and the validation set as Wx and Wy respectively. The water stain group and the crack group in the training set are labeled as 3. The concrete crack detection method based on the YOLOv5 algorithm according to claim 2, wherein: The generation logic of the closed area is as follows: Detect the gray value of each pixel point in the grayscale image, calculate the horizontal gradient and vertical gradient of each pixel point, and use the Sobel operator to process the horizontal gradient and vertical gradient of each pixel point; According to the processed horizontal gradient and vertical gradient of each pixel point, calculate its edge strength, and mark the pixel points with edge strength exceeding the threshold range as strong edge points; Connect multiple groups of strong edge points to form several groups of closed areas respectively, detect the area of each group of closed areas and number them.

4. The concrete crack detection method based on the YOLOv5 algorithm according to claim 3, characterized in that: The method for training the image screening model is: The water stain group in the training set and the crack group are respectively used as the input images of the image screening model to generate corresponding recognition images with closed regions, and the closed regions in the recognition images are labeled as B q and measure their areas and The images in the validation set are used as the input images of the image screening model for discrimination and screening. According to the variable coefficient of the closed region B in the corresponding recognition image, it is judged whether it belongs to water stain or crack, and the accuracy rate of the judgment result generated by the image screening model is calculated. When the accuracy rate ≥ 95%, it is considered that the training of the image screening model is completed. q The variable coefficient of is used to judge whether it belongs to water stain or crack, and the accuracy rate of the judgment result generated by the image screening model is calculated. When the accuracy rate ≥ 95%, it is considered that the training of the image screening model is completed.

5. A concrete crack detection method based on the YOLOv5 algorithm according to claim 4, characterized in that: Closed region B generated by water stains and cracks in different seasons q The calculation method of the variable coefficient is as follows: wherein respectively represent the closed regions B where water stains and cracks are generated in different seasons q variable coefficients of respectively represent the closed regions B in the recognition images generated by the water stain group and the crack group q area change amounts of, and the calculation methods are respectively: n1 represents the number of images with the closed region B existing in the water stain group q and n2 represents the number of images with the closed region B existing in the crack group q m1 represents the image number when the water stain appears, and m2 represents the image number when the crack appears 6. The concrete crack detection method based on the YOLOv5 algorithm according to claim 5, wherein: When the images in the validation set are used as the input images of the image screening model, recognition images are generated based on the input images, and the variable coefficients corresponding to different closed regions B in the recognition images are calculated. q corresponding variable coefficients And according to the acquisition time of the input image, the water stain variable coefficients and the crack variable coefficients in the corresponding season are compared. When the corresponding closed region B q is considered to be a water stain. When the corresponding closed region B q is considered to be a crack, where σ1 and σ2 are the preset first fluctuation difference and second fluctuation difference respectively.

7. A concrete crack detection method based on the YOLOv5 algorithm according to claim 6, characterized in that: The statistical image screening model screens the closed region B in each set of validation set images q Judge the correct number Q' and calculate the accuracy α of the image screening model. The calculation method is as follows: where Q represents the total number of closed regions B in each group of validation set images q When the accuracy rate α ≥ 95%, it is considered that the training of the image screening model is completed. When the accuracy rate α < 95%, the first fluctuation difference σ1 and the second fluctuation difference σ2 are adjusted to optimize the image screening model.

8. The concrete crack detection method based on the YOLOv5 algorithm according to claim 6, characterized in that: The logic for secondary processing of the recognition image is: When the closed region B q is a crack, the corresponding recognition image is directly output as the output image; When the closed area B q is water stain, collect the coordinates of the four pixel points at the topmost, bottommost, leftmost, and rightmost positions of the closed area B q , and mark them as (x1, y1), (x2, y2), (x3, y3), and (x4, y4) respectively. Then generate a rectangle with horizontal and vertical lengths of (x4 - x3) * (y1 - y2) to frame the closed area B q ; Judge the size between (x4 - x3) and (y1 - y2), take the group with the larger difference as the side length l, form a square of l * l outside the rectangle of (x4 - x3) * (y1 - y2), and the center lines of the rectangle and the square coincide; Calculate the grayscale mean value of the area between the outside of the rectangle and the inside of the square When l = x4 - x3, the grayscale mean value is calculated as follows: When l = y1 - y2, the calculation method of the average gray value is as follows: where HD (x,y) represents the grayscale value of each pixel point from the outside of the rectangle to the inside of the square; Set the grayscale value of each pixel within the rectangle of (x4 - x3) * (y1 - y2) to the average grayscale value After completing the secondary processing of the recognition image, output it as the output image.

9. A concrete crack detection system based on the YOLOv5 algorithm, characterized in that: The detection system adopts the detection method described in any one of claims 1 - 8, including: An image acquisition module, which is used to regularly acquire images of the concrete points to be detected; A data storage module, which is used to store the historical images and the acquired real-time images of the concrete; An image processing module, which is used to perform image preprocessing on the historical images and real-time images; The data analysis module is used to construct an image screening model and a YOLOv5 algorithm model, determine whether there are cracks in the image, and send an alarm signal according to the judgment result; The alarm module is used to send an alarm according to the alarm signal.

Citation Information

Patent Citations

  • Rapid crack detection method based on combination of improved YOLOv5 neural network and unmanned aerial vehicle video

    CN115223060A

  • Road disease detection system and detection method thereof

    CN115601721A

  • Concrete crack detection method based on improved YOLOv5

    CN116486231A