A concrete crack detection method based on improved YOLOv5
By improving the YOLOv5 model and combining Rep-GFPN and ECA attention mechanisms, the problems of missed detection, false detection and low efficiency in concrete crack detection have been solved, realizing automated, real-time and accurate crack detection, which is applicable to a variety of hardware platforms.
Patent Information
- Application Number
- CN202310453914.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-04-24
- Publication Date
- 2025-12-19
- Estimated Expiration
- 2043-04-24
AI Technical Summary
Existing concrete crack detection technologies suffer from problems such as missed detections, false detections, inaccurate detection, inability to monitor in real time, and low detection efficiency, especially under complex surface conditions.
An improved YOLOv5 model was adopted. By constructing a concrete crack dataset, an improved YOLOv5 network model was built, and Rep-GFPN and ECA attention mechanisms were added. The model was pre-trained using pre-training data, and crack detection was performed by acquiring real-time images through a camera.
It achieves automated, real-time, and accurate concrete crack detection, reducing labor and time costs, improving detection accuracy and efficiency, and is suitable for different hardware configurations, with efficient, accurate, and robust detection results.
Smart Images

Figure CN116486231B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of concrete detection, in particular to a concrete crack detection method based on improved YOLOv5. BACKGROUND
[0002] Concrete is one of the most commonly used materials in building structures, and concrete cracks are one of the common structural defects. In concrete structures, cracks can cause the strength, stability and durability of the structure to decrease, thereby affecting the service life and safety of the structure. Therefore, it is of great significance to conduct regular crack detection and evaluation on the surface of building engineering structures and the like, to provide timely early warning information, provide a basis for the maintenance and management of buildings, prolong the service life of buildings, and prevent accidents.
[0003] The applicant has found some typical prior art through searching, such as Chinese patent application No. CN201910502811.4, which discloses a concrete crack detection device based on a unmanned aerial vehicle. The crack detection mechanism with a rotatable measuring scale can directly read the length and width of the crack through the measuring scale, without the need for a large amount of data processing later, the measurement method is simple, and long-term tracking observation of the crack is realized. Chinese patent application No. CN201610799729.9 discloses a concrete member crack automatic detection device, method and system, which can objectively judge whether cracks of different parts, widths and lengths belong to the qualified judgment standard of stress cracks according to image information, facilitating the acquisition of bridge member load test data and improving the authenticity, correctness and reliability of bridge member load test data. Chinese patent application No. CN202010615768.5 discloses a concrete crack digital detection method, which ingeniously combines the development characteristics of concrete cracks, adopts a segmentation error limit control method to ensure the accuracy of the segmented and calculated concrete cracks, and provides effective protection for the quantitative evaluation of concrete crack detection of engineering structures.
[0004] Therefore, there are many unproposed technical solutions for how to detect concrete cracks in practical applications. SUMMARY
[0005] Therefore, in order to realize the detection effect of concrete cracks, the present application provides a concrete crack detection method based on improved YOLOv5, and the specific technical solutions are as follows:
[0006] A concrete crack detection method based on improved YOLOv5, comprising the following steps:
[0007] Constructing a concrete crack data set;
[0008] Building an improved YOLOv5 model;
[0009] obtaining pre-training data and pre-training the improved YOLOv5 model by using the pre-training data;
[0010] training the pre-trained improved YOLOv5 model by using the concrete crack data set;
[0011] obtaining a real-time image of concrete to be detected;
[0012] detecting cracks in the real-time image of the concrete to be detected by using the trained improved YOLOv5 model.
[0013] The concrete crack detection method can automatically detect the position of the crack and complete the target detection task without human intervention, greatly reducing the labor cost and time cost. At the same time, based on the improved YOLOv5 model, a high detection accuracy can be maintained, and the target object can be accurately identified, thereby improving the detection effect.
[0014] Further, the specific method of building the improved YOLOv5 model includes the following steps:
[0015] In the original YOLOv5 network structure, a Rep-GFPN network structure with the same input size is used to replace the original neck feature stacking network Concat as the backbone network of the neck network;
[0016] An ECA attention mechanism is added before the feature fusion part of the feature extraction network module to build an improved YOLOv5 network model.
[0017] Further, the specific method of using a Rep-GFPN network structure with the same input size to replace the original neck feature stacking network Concat as the backbone network of the neck network includes the following steps:
[0018] First, the Rep-GFPN receives two feature maps x0 and x1 of the backbone network and the previous layer network, respectively, and performs a convolution kernel size of 1 and a stride of 1 convolution block operation on x0 and x1, and outputs x00 and x10.
[0019] Second, put x00 and x10 output in the first step into the CSPS module together, and output x01.
[0020] Third, put x01 output in the second step and x10 output in the first step into the CSPS module together, and output x11.
[0021] Fourthly, the x11 outputted in the third step is put into the CSPS alone, and the output of the CSPS module is stacked with the output x10 of the first step by Concat, and the output is x12;
[0022] Fifthly, the x01 outputted in the second step, the x11 outputted in the third step and the x13 outputted in the fourth step are put into the CSPS module together, and the output of the CSPS module is stacked with the output x00 of the first step by Concat, and the output is x02;
[0023] Sixthly, the x02 outputted in the fourth step and the x12 generated in the fifth step are stacked, and the stacked output is subjected to a convolution block operation with a convolution kernel size of 1 and a step size of 1, and the output is the final output x_final of the Rep-GFPN.
[0024] Further, the specific method of using the Rep-GFPN network structure with the same input size to replace the original neck feature stacking network Concat as the backbone network of the neck network comprises the following steps:
[0025] Firstly, the CSPS receives two or three inputs y0, y1 and y2 with the same size, and stacks the channels to output y3;
[0026] Secondly, the y3 outputted in the first step is subjected to a convolution block operation with a convolution kernel size of 3 and a step size of 1, normalized and subjected to a Si lu activation function, and the output is y4;
[0027] Thirdly, the y3 outputted in the first step is first subjected to a convolution block operation with a convolution kernel size of 3 and a step size of 1, normalized and subjected to a Si lu activation function, then subjected to a RepConv with a convolution kernel size of 3 and a step size of 1, then subjected to a convolution block operation with a convolution kernel size of 3 and a step size of 1, normalized and subjected to a Si lu activation function, and finally put into an ECA attention mechanism module;
[0028] Fourthly, the output y4 of the second step and the outputs of the third step are stacked to output y7;
[0029] Fifthly, the y7 outputted in the fourth step is subjected to a convolution block operation with a convolution kernel size of 1 and a step size of 1, normalized and subjected to a Si lu activation function, and the final output y8 of the CSPS module is obtained.
[0030] Further, the specific method of adding an ECA attention mechanism before the feature fusion part of the feature extraction network module comprises the following steps:
[0031] The first step, the ECA module accepts a feature map z0, and after the GAP module, average pooling is performed on each channel, and each channel outputs an output node. The output is a 1*1*C size block z1;
[0032] The second step is to perform a convolution operation on the output z1 of the first step with a kernel size of 3 and a step size of 1, and the output is z2.
[0033] The third step is to perform a Sigmoid activation function operation on the output z2 of the second step, and the output is z3.
[0034] The fourth step is to perform a point multiplication operation on z0 of the first step and the output z3 of the third step, and the final output z4 of the ECA module is obtained.
[0035] Further, the specific method for detecting cracks in the real-time image of the concrete to be detected by using the trained improved YOLOv5 model includes:
[0036] The trained improved YOLOv5 model is evaluated using precision, recall, and average accuracy as three indicators.
[0037] The best trained improved YOLOv5 model is selected to detect cracks in the real-time image of the concrete to be detected.
[0038] Further, the specific method for obtaining the real-time image of the concrete to be detected includes the following steps:
[0039] The real-time video of the concrete to be detected is captured by a camera.
[0040] The captured real-time video of the concrete to be detected is preprocessed frame by frame using the computer vision library Open CV.
[0041] Further, the specific method for constructing the concrete crack dataset includes the following steps:
[0042] Concrete crack images are collected through web crawling and public datasets.
[0043] For the concrete crack images obtained by web crawling, the LabelImg software is used for crack labeling, and repeated data, missing value data and abnormal value data are removed. The concrete crack images after removing repeated data, missing value data and abnormal value data are divided into a training set and a validation set.
[0044] The collected concrete crack images are converted to lower resolution images using the computer vision library Open CV.
[0045] The mosaic data augmentation algorithm is used to perform data augmentation operations on the dataset.
[0046] A computer readable storage medium storing a computer program, when the computer program is executed by a processor, implements the improved YOLOv5-based concrete crack detection method. BRIEF DESCRIPTION OF DRAWINGS
[0047] The present application can be further understood from the following description in conjunction with the drawings. The components in the drawings are not necessarily drawn to scale, but emphasis is instead placed upon illustrating the principles of the embodiments. In different views, the same reference numerals designate corresponding parts.
[0048] Figure 1 is a schematic diagram of the overall process of an improved YOLOv5-based concrete crack detection method in an embodiment of the present application.
[0049] Figure 2 is a network structure diagram of the improved YOLOv5 in an embodiment of the present application.
[0050] Figure 3 is a Rep-GFPN network module and Block structure diagram in an embodiment of the present application.
[0051] Figure 4 is an ECA network structure diagram and a GAP network structure diagram in an embodiment of the present application.
[0052] Figure 5 is a final crack detection effect diagram in an embodiment of the present application. DETAILED DESCRIPTION
[0053] In order to make the purpose, technical scheme and advantages of the present application clearer, the present application will be further described in detail below in conjunction with embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and do not limit the protection scope of the present application.
[0054] It should be noted that when an element is referred to as being "fixed" to another element, it can be directly on the other element or there can be an intervening element. When an element is referred to as being "connected" to another element, it can be directly connected to the other element or there can be an intervening element. The terms "vertical", "horizontal", "left", "right", and similar expressions used herein are for illustrative purposes only and are not intended to be limiting.
[0055] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application belongs. The terminology used in the description herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the application. As used herein, the term "and / or" includes any and all combinations of one or more of the associated listed items.
[0056] The "first", "second" in the present application do not represent the specific number and order, but only for the purpose of distinguishing names.
[0057] At present, the concrete crack detection technology mainly includes manual detection, laser scanning detection, sensor detection and other methods. As the most traditional detection method, manual detection has been widely used in this field, but it often consumes a lot of manpower and time cost; Laser scanning detection uses laser scanning technology, which scans the surface of concrete through high-precision measuring instruments, so as to realize the crack detection of concrete; Sensor detection fuses the information obtained by multiple sensors, which often needs a certain time to process and analyze data, and has high requirements for the accuracy of sensors.
[0058] With the continuous development of intelligent technology, concrete crack detection technology will also be more widely applied. For example, the concrete crack detection algorithm based on artificial intelligence and machine learning can improve the accuracy and efficiency of detection, and realize intelligent detection and diagnosis.
[0059] The current concrete crack detection technology has the following problems:
[0060] 1. Using artificial vision to detect cracks on the surface of concrete, it is easy to miss and misjudge, and the detection result is not necessarily accurate, it is difficult to find small cracks or hidden cracks.
[0061] 2. Laser scanning detection of concrete cracks still has limitations for the detection of deep cracks and cannot realize real-time monitoring. Laser scanning is very sensitive to the condition of the concrete surface. If there is dirt, uneven color, and excessive roughness on the surface, it may affect the scanning effect. Therefore, before laser scanning, the surface needs to be cleaned and treated to ensure accurate scanning results. The laser beam used in laser scanning is easily disturbed by surrounding light, resulting in inaccurate scanning results. Therefore, when performing laser scanning, it is necessary to avoid light interference and choose an environment with weak light for scanning.
[0062] 3. The existing technology mostly fails to realize real-time detection function, and the accuracy and efficiency of detection are often not high.
[0063] For example, Figure 1As shown, the concrete crack detection method based on the improved YOLOv5 in an embodiment of the present application comprises the following steps:
[0064] S1, a concrete crack dataset is constructed.
[0065] In step S1, the specific method for constructing the concrete crack dataset comprises the following steps:
[0066] S10, the images required for training the model are obtained, that is, the concrete crack images are collected through network crawling and in public datasets.
[0067] S11, the collected concrete crack images are data cleaned. Specifically, for the concrete crack images obtained through network crawling, the LabelImg software is used for crack labeling (including crack labels and labeled position information files), and the repeated data, missing value data and abnormal value data are removed. The concrete crack images after removing the repeated data, missing value data and abnormal value data are divided into a training set and a validation set.
[0068] Removing repeated data, missing value data and abnormal value data can ensure the accuracy, integrity, consistency and usability of the data, so as to ensure the quality and credibility of the dataset.
[0069] More specifically, the dataset can be divided into a training set and a validation set in a ratio of 9:1, which is convenient for model training.
[0070] S12, the collected concrete crack images are changed into images with lower resolution by using the computer vision library Open CV, so as to reduce the amount of calculation and relieve the pressure on the device.
[0071] S13, the mosaic data augmentation algorithm is used to perform data augmentation operation on the dataset, so as to increase the dataset, reduce overfitting, and improve the accuracy and stability of the model.
[0072] Specifically, first, four different images are randomly selected, and then one of the four images is randomly selected as the center image of the synthesized image. Next, the mosaic data augmentation algorithm will randomly crop three adjacent images around the center image, and will be spliced according to certain rules to form a new synthesized image. In the splicing process, the algorithm will use some random transformations such as rotation, scaling and horizontal flipping to increase the diversity of the synthesized image. Finally, the algorithm will use the label of the center region of the synthesized image as the label of the entire synthesized image, thereby generating new training samples.
[0073] S2, an improved YOLOv5 model is built.
[0074] Specifically, in step S2, further, the specific method of building the improved YOLOv5 model includes the following steps:
[0075] S20, in the original YOLOv5 network structure, using the same input size of Rep-GFPN (Reparametrized Generalized-FPN, reparameterized generalized feature pyramid) network structure instead of the original neck feature stacking network Concat, as the backbone network of the neck network.
[0076] The backbone network follows the original backbone network and detection head network of YOLOv5, and the feature stacking layer in the neck network is improved. Compared with the original ordinary dimension stacking operation, the Rep-GFPN is cited for further feature extraction and fusion, which can improve the accuracy of the model.
[0077] S21, before the feature fusion part of the feature extraction network module, add ECA (Efficient Channel Attention, efficient channel attention) attention mechanism, build the improved YOLOv5 network model.
[0078] In step S20, the specific method of using the same input size of Rep-GFPN network structure instead of the original neck feature stacking network Concat as the backbone network of the neck network includes the following steps:
[0079] First, Rep-GFPN receives two feature maps x0 and x1 from the backbone network and the previous layer network, respectively, and performs convolution kernel size 1 step 1 convolution block operation on x0 and x1, and outputs x00 and x10.
[0080] Second, put x00 and x10 output in the first step into the CSPS module together, and output x01.
[0081] Third, put x01 output in the second step and x10 output in the first step into the CSPS module together, and output x11.
[0082] Fourth, put x11 output in the third step into CSPS alone, and the output of CSPS (Constraint Satisfaction Problems, constraint satisfaction problems) module is stacked with the output of the first step x10 by Concat operation, and the output is x13.
[0083] Fifth, put x01 output in the second step, x11 output in the third step and x13 output in the fourth step into the CSPS module together, and the output of the CSPS module is stacked with the output of the first step x00 by Concat operation, and the output is x02.
[0084] Step 6, stack operation of x02 output in step 4 and x12 generated in step 5, and then perform convolution kernel size 1 step 1 convolution block operation on the stacked output, as the final output x_final of Rep-GFPN.
[0085] S3, obtain pre-training data and pre-train the improved YOLOv5 model using the pre-training data.
[0086] The disclosed pre-training data is input into the improved YOLOv5 model for pre-training to generate pre-training weights, which can reduce the time and computing resources of model training and shorten the iteration cycle of the model.
[0087] S4, train the pre-trained improved YOLOv5 model using the concrete crack data set.
[0088] Specifically,
[0089] S5, obtain a real-time image of concrete to be detected.
[0090] Specifically, in step S5, the specific method of obtaining the real-time image of concrete to be detected includes the following steps:
[0091] S50, capture a real-time video of concrete to be detected by a camera.
[0092] S51, use the computer vision library Open CV to perform image preprocessing on the captured real-time video of concrete to be detected frame by frame. The image preprocessing includes enlarging or reducing to a specified size, Gaussian filter denoising, etc.
[0093] S6, use the trained improved YOLOv5 model to detect cracks in the real-time image of concrete to be detected. The detection effect is as shown in Figure 5 .
[0094] Specifically, in step S6, the specific method of using the trained improved YOLOv5 model to detect cracks in the real-time image of concrete to be detected includes:
[0095] S60, evaluate the trained improved YOLOv5 model using precision, recall, and average accuracy as three indicators.
[0096] According to the YOLOv5 model data, draw a LOSS curve, a map curve, etc. Use precision , recall , and average accuracy as three indicators to evaluate the trained improved YOLOv5 model.
[0097] S61, select the best trained improved YOLOv5 model to detect the real-time image of the concrete to be detected.
[0098] Wherein, TP represents the number of correctly classified positive samples; actual positive samples, also classified as positive samples by the model.
[0099] FP represents the number of incorrectly classified positive samples; actual negative samples, but classified as positive samples by the model.
[0100] TN represents the number of correctly classified negative samples; actual negative samples, also classified as negative samples by the model.
[0101] FN represents the number of incorrectly classified negative samples; actual positive samples, but classified as negative samples by the model.
[0102] The average accuracy (AP) is calculated as the area under the Precision-Recall curve.
[0103] The various indicators of the YOLOv5 model before and after improvement are shown in the following table:
[0104]
[0105]
[0106] The concrete crack detection method based on the improved YOLOv5 network model can automatically detect the position of the crack and complete the target detection task without human intervention, greatly reducing the labor cost and time cost; at the same time, based on the improved YOLOv5 model, the detection accuracy can be maintained, and the target object can be accurately identified, thereby improving the detection effect.
[0107] In one embodiment, the Rep-GFPN network structure with the same input size is used instead of the original neck feature stacking network Concat as the specific method of the backbone network of the neck network, which further includes the following steps:
[0108] First, CSPS receives two or three inputs y0, y1 and y2 of the same size, performs a stacking operation on the channel number, and outputs y3.
[0109] Second, the y3 output in the first step is subjected to a convolution kernel size of 3, a convolution block operation with a step of 1, normalization processing and Si lu activation function, and outputs y4.
[0110] Third step, the output y3 of the first step is firstly operated by a convolution block with a convolution kernel size of 3 and a step size of 1, normalized and processed by a Si lu activation function, then operated by a RepConv with a convolution kernel size of 3 and a step size of 1, and then operated by a convolution block with a convolution kernel size of 3 and a step size of 1, normalized and processed by a Si lu activation function, and finally put into an ECA attention mechanism module; here, the process is repeated N times.
[0111] Preferably, to reduce the parameter amount of the model, N is 1. The output of the third step is y5.
[0112] Fourth step, the output y4 of the second step is stacked with several data of the third step, and the output is y7.
[0113] Fifth step, the output y7 of the fourth step is operated by a convolution block with a convolution kernel size of 1 and a step size of 1, normalized and processed by a Silu activation function, to obtain the final output y8 of the CSPS module. The Silu activation function is as follows:
[0114] Preferably, the specific method of adding the ECA attention mechanism before the feature fusion part of the feature extraction network module further comprises the following steps:
[0115] First step, the ECA module accepts a feature map z0, and performs average pooling on each channel through a GAP (global average pooling) module. Each channel outputs an Output nodes, and the output is a 1*1*C size block z1.
[0116] Second step, the output z1 of the first step is operated by a convolution operation with a convolution kernel size of 3 and a step size of 1, and the output is z2.
[0117] Third step, the output z2 of the second step is operated by a Sigmoid activation function, and the output is z3. The Sigmoid activation function is as follows:
[0118] Fourth step, the z0 of the first step is point multiplied with the output z3 of the third step to obtain the final output z4 of the ECA module.
[0119] The concrete crack detection method transmits the video of the concrete to be detected to a computer in real time through a network camera, processes the transmitted video frame by frame through an OpenCV computer vision library, collects concrete structure surface crack pictures to form a training data set and a verification data set, and puts the data set into an improved YOLOv5 network for model training. Figure 2 As shown in the figure, the Rep-GFPN (Reparametrized Generalized-FPN) network structure increases the exchange of information between the two compared to the original ordinary stacking operation of YOLOv5, which can fully exchange high-level semantic information and low-level spatial information, and increase the feature extraction capability. In addition, multi-scale feature fusion occurs in different scale features of the previous layer and the current layer, and cross-layer connection provides more efficient information transmission, which can be extended to a deeper network, as shown in the figure. Figure 3 As shown in the figure, the ECA (Efficient Channel Attention) attention mechanism efficiently realizes local cross-channel interaction through one-dimensional convolution, extracts the dependency relationship between channels, and the structure is as shown in the figure. Figure 4 As shown in the figure, finally, the video stream processed by the computer vision library is put into the trained model to identify the cracks in the video.
[0120] The concrete crack detection method based on the improved YOLOv5 can realize rapid detection of concrete cracks by combining a neural network with a network camera, improve the accuracy of crack detection, and realize real-time detection by inputting real-time images of concrete to be detected through a network camera. It has the characteristics of high efficiency, high precision, low cost and strong robustness.
[0121] In one embodiment, the application also provides a computer-readable storage medium storing a computer program which, when executed by a processor, implements the concrete crack detection method based on the improved YOLOv5.
[0122] In summary, the concrete crack detection method based on the improved YOLOV5 can achieve the following
[0123] Advantages:
[0124] 1. Replace the Concat channel stacking network layer of the YOLOv5 head network with a Rep-GFPN network of the same input size to improve detection accuracy and adapt to real-time scenarios.
[0125] 2. The ECA attention mechanism is introduced to adaptively learn the importance weight of each channel, which can make the network more accurately extract features and improve the generalization performance of the model.
[0126] 3. The data set obtained by data augmentation under different light, angle, size and background can improve the robustness of the model and accurately detect the target in various application scenarios.
[0127] 4. The improved YOLOv5 network adopts lightweight design, has small model size and calculation amount, and can run on low hardware configuration (such as Raspberry Pi, etc.), and can be applied to different devices and platforms.
[0128] The technical features of the above-described embodiments can be combined arbitrarily. To make the description concise, all possible combinations of the technical features in the above-described embodiments are not described, but as long as the combinations of the technical features do not contradict, they should be considered as the scope of the present disclosure.
[0129] The above-described embodiments only express several embodiments of the present application, and the description is more specific and detailed, but it should not be understood as a limitation on the scope of the patent. It should be noted that for ordinary skilled persons in the art, without departing from the concept of the present application, a number of modifications and improvements can be made, which are within the scope of the present application. Therefore, the scope of the patent of the present application should be subject to the appended claims.
Claims
1. A concrete crack detection method based on improved YOLOv5, characterized in that, The improved YOLOv5-based concrete crack detection method comprises the following steps: constructing a concrete crack dataset; building an improved YOLOv5 model; obtaining pre-training data and pre-training the improved YOLOv5 model using the pre-training data; training the pre-trained improved YOLOv5 model using the concrete crack dataset; obtaining a real-time image of concrete to be detected; detecting cracks in the real-time image of concrete to be detected using the trained improved YOLOv5 model; The specific method for building the improved YOLOv5 model comprises the following steps: In the original YOLOv5 network structure, a Rep-GFPN network structure with the same input size is used to replace the original neck feature stacking network Concat as the backbone network of the neck network; An ECA attention mechanism is added before the feature fusion part of the feature extraction network module to build an improved YOLOv5 network model; The specific method for using a Rep-GFPN network structure with the same input size to replace the original neck feature stacking network Concat as the backbone network of the neck network comprises the following steps: Step 1: Rep-GFPN receives two feature maps x0 and x1 from the backbone network and the previous layer network, respectively, and performs convolution kernel size 1 and stride 1 convolution block operation on x0 and x1, outputting x00 and x10; Step 2: Put x00 and x10 output in the CSPS module together, output x01; Step 3: Put x01 output in the CSPS module together with x10 output in Step 1, output x11; Step 4: Put x11 output in the CSPS module alone, and perform Concat stacking operation on the output of the CSPS module and the output x10 of Step 1, output x13; Step 5: Put x01 output in Step 2, x11 output in Step 3, and x13 output in Step 4 together in the CSPS module, perform Concat stacking operation on the output of the CSPS module and the output x00 of Step 1, output x02; Step 6: Stack x02 output in Step 4 and x12 generated in Step 5, perform convolution kernel size 1 and stride 1 convolution block operation on the stacked output, and output x_final as the final output of Rep-GFPN.
2. The concrete crack detection method based on improved YOLOv5 according to claim 1, wherein, The specific method for using a Rep-GFPN network structure with the same input size to replace the original neck feature stacking network Concat as the backbone network of the neck network further comprises the following steps: Step 1: CSPS receives two or three inputs y0, y1 and y2 with the same size, performs channel stacking operation, and outputs y3; Step 2: Perform convolution kernel size 3 and stride 1 convolution block operation on y3 output in Step 1, normalization processing and Silu activation function, and output y4; Third step, the output y3 of the first step is first subjected to a convolution block operation with a convolution kernel size of 3 and a step size of 1, normalized processing, and a Silu activation function, then subjected to a RepConv with a convolution kernel size of 3 and a step size of 1, followed by a convolution block operation with a convolution kernel size of 3 and a step size of 1, normalized processing, and a Silu activation function, and finally put into an ECA attention mechanism module; Fourth step, stack the output y4 of the second step and the several data of the third step, and output y7; Fifth step, the output y7 of the fourth step is subjected to a convolution block operation with a convolution kernel size of 1 and a step size of 1, normalized processing, and a Silu activation function, to obtain the final output y8 of the CSPS module.
3. The concrete crack detection method based on improved YOLOv5 according to claim 2, wherein, The specific method of adding an ECA attention mechanism before the feature fusion part of the feature extraction network module further includes the following steps: First step, the ECA module accepts a feature map z0, which is subjected to GAP module processing, and each channel outputs an Output nodes, outputting a 1*1*C size block z1; Second step, the output z1 of the first step is subjected to a convolution operation with a convolution kernel size of 3 and a step size of 1, and the output is z2; Third step, the output z2 of the second step is subjected to a Sigmoid activation function operation, and the output is z3; Fourth step, the z0 of the first step is multiplied by the output z3 of the third step to obtain the final output z4 of the ECA module.
4. The concrete crack detection method based on improved YOLOv5 according to claim 3, wherein, The specific method of using the trained improved YOLOv5 model to detect cracks in real-time images of concrete includes: Using precision, recall, and average accuracy as three indicators to evaluate the trained improved YOLOv5 model; Selecting the best trained improved YOLOv5 model to detect cracks in real-time images of concrete.
5. The concrete crack detection method based on improved YOLOv5 according to claim 4, wherein, The specific method of obtaining real-time images of concrete to be detected includes the following steps: Taking a video of the concrete to be detected through a camera; Using the computer vision library Open CV to perform image preprocessing on the captured concrete video frame by frame.
6. The concrete crack detection method based on improved YOLOv5 according to claim 5, wherein, The specific method of constructing a concrete crack dataset includes the following steps: Collecting concrete crack images through web crawling and public datasets; For the concrete crack images obtained by web crawling, use LabelImg software to label the cracks, remove duplicate data, missing value data, and abnormal value data, and divide the concrete crack images after removing duplicate data, missing value data, and abnormal value data into a training set and a validation set; Using the computer vision library Open CV to convert the collected concrete crack images into lower resolution images; Using the mosaic data augmentation algorithm to perform data augmentation on the dataset.
7. A computer readable storage medium characterized by The computer readable storage medium stores a computer program, which, when executed by a processor, implements the improved YOLOv5-based concrete crack detection method of any one of claims 1-6.
Citation Information
Patent Citations
Automatic Detection Device and Method for Cracks in Concrete Components
CN106226157B
Unmanned aerial vehicle (UAV) based concrete crack detection device and method
CN110145989A
A digital detection method for concrete cracks
CN111504232B
Concrete structure crack identification method based on computer vision and deep learning
CN114359542A
Method for Training Neural Networks
US20080281767A1