CN115830432A - YOLOv 5-based tunnel lining crack detection method and equipment - Google Patents

YOLOv 5-based tunnel lining crack detection method and equipment Download PDF

Info

Publication number
CN115830432A
CN115830432A CN202310113050.XA CN202310113050A CN115830432A CN 115830432 A CN115830432 A CN 115830432A CN 202310113050 A CN202310113050 A CN 202310113050A CN 115830432 A CN115830432 A CN 115830432A
Authority
CN
China
Prior art keywords
crack
image
target
lining
connected domain
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
CN202310113050.XA
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.)
Shandong University of Science and Technology
Original Assignee
Shandong University of Science and Technology
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 Shandong University of Science and Technology filed Critical Shandong University of Science and Technology
Priority to CN202310113050.XA priority Critical patent/CN115830432A/en
Publication of CN115830432A publication Critical patent/CN115830432A/en
Pending legal-status Critical Current

Links

Images

Landscapes

  • Image Processing (AREA)

Abstract

The invention discloses a tunnel lining crack detection method and equipment based on YOLOv5, belongs to the technical field of crack detection, and is used for solving the technical problems that in the existing tunnel lining crack detection process, crack images have more impurities and data acquisition work is large, crack features are difficult to effectively extract and analyze, and the accuracy of crack detection is difficult to ensure. The method comprises the following steps: labeling a disease data set corresponding to a plurality of preset crack images to obtain a labeled file of the disease data set; carrying out YOLOv5 network model training on the annotation file and the corresponding crack image to obtain an improved YOLOv5 network model; carrying out classification judgment on the pre-collected lining crack image according to the corresponding prediction frames to obtain an evaluation index of each category; and (3) identifying the accuracy of the lining cracks of the lining crack image to obtain a target image, and carrying out opening and closing operation of corrosion expansion combination on the crack characteristics to obtain real crack characteristics.

Description

YOLOv 5-based tunnel lining crack detection method and equipment
Technical Field
The application relates to the technical field of crack detection, in particular to a tunnel lining crack detection method and device based on YOLOv 5.
Background
Along with the gradual trend of the tunnel towards intellectualization and electrification, the requirement on the automatic tunnel detection technology is larger and larger, the later-stage operation and maintenance task is aggravated, and the tunnel operation and maintenance inspection working pattern with heavy task and high requirement is gradually formed. In the process of tunnel construction and operation, great potential safety hazards can be generated due to the defects of cracks, water seepage and the like caused by the influence of various factors such as construction, temperature, load, mountain deformation and the like. The cracks are the most common disease form of tunnel lining, if the cracks cannot be found and maintained in time, the cracks further spread and expand to damage the tunnel structure, and serious casualties and economic losses can be caused, so that the detection of the tunnel cracks is the most important factor in tunnel detection work.
In the existing tunnel detection process, most of the existing tunnel detection methods still adopt the traditional manual detection method, more manpower and time are required to be invested, the danger is high, and meanwhile, the existing crack recognition model is easily influenced by the characteristics of impurities in the crack image, so that the detection of the crack image is not facilitated.
Disclosure of Invention
The embodiment of the application provides a tunnel lining crack detection method and equipment based on YOLOv5, which are used for solving the following technical problems: in the existing tunnel lining crack detection process, the number of crack image impurities is large, data acquisition work is large, the crack characteristics are difficult to effectively extract and analyze, and the accuracy of crack detection is difficult to ensure.
The embodiment of the application adopts the following technical scheme:
in one aspect, an embodiment of the present application provides a tunnel lining crack detection method based on YOLOv5, including: labeling a disease data set corresponding to a plurality of preset crack images to obtain a labeled file of the disease data set; according to a preset Pythroch deep learning frame, carrying out target detection training on the annotation file and the corresponding crack image through a YOLOv5 network model to obtain an improved YOLOv5 network model; performing classification judgment on the pre-acquired lining crack image by using the improved YOLOv5 network model according to the corresponding prediction frames to obtain an evaluation index of each category; identifying the accuracy of the related lining cracks of the lining crack image according to the evaluation index to obtain target images containing the lining cracks; performing opening and closing operation of corrosion expansion combination on crack features in the target image through a preset morphological algorithm to obtain a target crack connected domain of the target image; and carrying out image noise filtration on the target crack connected domain to obtain real crack characteristics.
The embodiment of the application realizes real-time detection to the lining condition in the tunnel through the image collection system that the collection car carried on, long consuming time has been replaced, the artifical testing process of inefficiency, train through the higher function expression of mAP value to image fitting, discernment and location crack area that can be accurate, judge whether the lining surface is the crack disease, realize the automated inspection of high accuracy, carry out getting rid of background impurity to the crack image after detecting, utilize a series of morphological algorithm to draw the crack connected domain, realize removing of noise of image, the real essential character of crack has been kept.
In a feasible implementation manner, labeling a disease data set corresponding to a plurality of preset crack images to obtain a labeled file of the disease data set specifically includes: performing fitting analysis on the crack brightness of the crack images to obtain a fitting function related to the crack brightness; dividing the plurality of crack images into a training set and a testing set by training the expression of the fitting function; performing data compression and segmentation on the crack images in the training set to obtain the disease data set; wherein the disease data set comprises: a fracture data set and a seepage data set; labeling the crack data set and the water seepage data set through an image labeling tool labellimg to obtain a labeling file; the marking file is a TXT file corresponding to each image in the fracture data set and the water seepage data set; and identifying all target features in each image through a preset target frame, and storing the category label information and the position information of the marking frame of each image into the marking file.
In a feasible implementation manner, according to a preset Pytorch deep learning framework, the target detection training of the YOLOv5 network model is performed on the annotation file and the corresponding crack image, so as to obtain an improved YOLOv5 network model, which specifically includes: acquiring category label information of the labeled file and corresponding labeled frame position information; wherein the label box position information comprises: the method comprises the following steps of (1) image center point horizontal and vertical scale information, image center point vertical coordinate information, length information and width information of a target frame; based on the category label information, carrying out normalization processing on the position information of the labeling frame to obtain a label file; and inputting the label file and each corresponding crack image into a YOLOv5 network model based on a Pythrch deep learning framework, and performing training and testing related to crack image detection to obtain the improved YOLOv5 network model.
In a feasible implementation manner, the improved YOLOv5 network model is used for performing classification judgment on a corresponding prediction frame on a pre-acquired lining crack image to obtain an evaluation index of each category, and the method specifically includes: inputting the lining crack image into the improved Yolov5 network model; calculating related image prediction frames of the lining crack image through the improved YOLOv5 network model to obtain a plurality of prediction frames; according to a preset classification standard, performing classification judgment on the prediction frames to obtain a classification judgment result; wherein the classification judgment result comprises: a TP prediction frame, a FP prediction frame, a FN prediction frame and a TN prediction frame; and according to the distribution condition of each category prediction frame in the classification judgment result, carrying out crack image recognition calculation on each category prediction frame to determine the evaluation index of each category prediction frame.
In a feasible implementation manner, the method for identifying the accuracy of the lining cracks of the lining crack image through the evaluation index to obtain target images containing the lining cracks specifically comprises the following steps: according to
Figure SMS_1
Obtaining the target ratio of the cracks
Figure SMS_2
(ii) a Wherein, (Ii) is the ith sample of the related lining crack image data set, cj is the accuracy rate of the crack target in each category prediction frame in the evaluation index, TP is a TP prediction frame, and FP is a FP prediction frame; according to
Figure SMS_3
Obtaining the average value of the accuracy rate of Cj in the lining crack image
Figure SMS_4
(ii) a Wherein N is that the image data set of the related lining cracks comprises N images; according to
Figure SMS_5
Obtaining the average value mAP of the APcj precision rate average values in all the category prediction frames; wherein M is the number of prediction frames of all categories, and AP is the average value of the accuracy rate of the lining crack image; and detecting whether the lining crack image contains the lining crack or not according to the average value mAP of the average precision rate, and determining the target images containing the lining crack.
The embodiment of the application is favorable for accurately identifying the tunnel lining cracks and the water seepage to cause some accidents under serious conditions by determining the target image which comprises the lining cracks, detects and solves the dangerous problem in advance, and improves the safety of the tunnel.
In a feasible implementation manner, performing an opening and closing operation combining erosion and expansion on crack features in the target image through a preset morphological algorithm to obtain a target crack connected domain of the target image, specifically including: carrying out opening operation processing on crack characteristics in the target image; wherein, the opening operation processing is to perform corrosion processing and then expansion processing on the crack characteristics; the method specifically comprises the following steps: smoothing a burr area in the crack feature, and changing the area of a crack communication domain corresponding to the crack feature according to the opening operation processing to obtain a pre-processing communication domain; after the preprocessing connected domain is obtained, performing closed operation processing on crack features in the target image to perform void region filling processing on the preprocessing connected domain to obtain a target crack connected domain of the target image; and the closed operation treatment is to perform expansion treatment and then perform corrosion treatment on the crack characteristics.
The embodiment of the application combines the corrosion and the expansion to process the back, and utilize the operation of opening, closing that combines to form, can eliminate the outstanding burr on the crack image, make the whole profile become smooth, the minimum changes the area of crack connected domain simultaneously, has eliminated isolated tiny noise in the crack image effectively, simultaneously, can fill the hole in crack region in the image, makes the connected domain more complete smooth.
In a feasible implementation manner, the image noise filtering is performed on the target fracture connected domain to obtain a real fracture characteristic, which specifically includes: carrying out pixel marking on the connected domain image corresponding to the target crack connected domain to obtain a marked area; traversing the marked areas, and determining the same marked area as the same connected domain; calculating the areas of a plurality of same connected domains, and determining the minimum circumscribed rectangle corresponding to the areas of the same connected domains; and extracting the features of the crack features in the minimum circumscribed rectangle to obtain the real crack features.
In a feasible implementation manner, the pixel labeling is performed on the connected domain image corresponding to the target fracture connected domain to obtain a labeled region, which specifically includes: traversing and judging the gray value of a target point neighborhood region of the connected domain image; wherein the target point neighborhood region includes: the left side area, the upper left area, the right upper area and the upper right area, and the size of the target point is the area of a pixel 3 x 3; if the pixel gray values of the neighborhood regions of the target point are all 0, marking the top left corner of the connected domain image as a new crack connected domain starting point; if the pixel gray values of the left area and the upper left area of the target point are 1, marking the area with smaller pixel values between the left area and the upper left area in the target point, and determining the pixel areas in the left area and the upper left area as small marked areas; if the pixel gray values of the left area and the upper right area of the target point are 1, marking the area with smaller pixel values between the left area and the upper right area in the target point, and determining the pixel areas in the left area and the upper left area as small marked areas; if the pixel gray value of the region right above the target point is 1, marking the target point as any one of the neighborhood regions of the target point according to the sequence of the left region, the right region and the right region.
In a possible embodiment, the minimum circumscribed rectangle has a length a and a width B, and the area of the same connected domain is S; if T is less than S/AB and S is greater than TS, reserving the same connected domain; if T is not satisfied and is smaller than S/AB and S is larger than TS, determining the same connected domain as the background of the connected domain image; and T is the preset connected domain image pixel proportion.
On the other hand, the embodiment of the present application further provides a tunnel lining crack detection apparatus based on YOLOv5, including: at least one processor; and a memory communicatively coupled to the at least one processor; wherein the memory stores instructions executable by the at least one processor to enable the at least one processor to perform a YOLOv 5-based tunnel lining crack detection method according to any of the embodiments.
The embodiment of the application provides a tunnel lining crack detection method, equipment and medium based on YOLOv5, real-time detection is realized on the lining condition in a tunnel through an image collecting system carried by a collecting vehicle, the manual detection process with long time consumption and low efficiency is replaced, a function expression with a high mAP value is fitted for an image to train, a crack area can be accurately identified and positioned, whether the lining surface is a crack disease or not is judged, high-precision automatic detection is realized, background impurities are removed from detected crack images, a crack communication domain is extracted by using a series of morphological algorithms, the denoising of the image is realized, and the real basic characteristics of the crack are reserved.
Drawings
In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings needed to be used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only some embodiments described in the present application, and other drawings can be obtained by those skilled in the art without creative efforts. In the drawings:
fig. 1 is a flowchart of a tunnel lining crack detection method based on YOLOv5 according to an embodiment of the present disclosure;
FIG. 2 is a schematic diagram of a real fracture characteristic provided in an embodiment of the present application;
fig. 3 is a schematic structural diagram of tunnel lining crack detection equipment based on YOLOv5 according to an embodiment of the present application.
Detailed Description
In order to make those skilled in the art better understand the technical solutions in the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are only a part of the embodiments of the present application, and not all of the embodiments. All other embodiments, which can be obtained by a person skilled in the art without making any inventive step based on the embodiments of the present disclosure, shall fall within the scope of protection of the present application.
The embodiment of the application provides a tunnel lining crack detection method based on YOLOv5, and as shown in fig. 1, the tunnel lining crack detection method based on YOLOv5 specifically includes steps S101 to S106:
s101, labeling a disease data set corresponding to a plurality of preset crack images to obtain a labeled file of the disease data set.
Specifically, fitting analysis is carried out on the crack brightness of a plurality of crack images to obtain a fitting function related to the crack brightness. And (3) carrying out training set and test set division on the plurality of crack images by training the expression of the fitting function. And carrying out data compression and segmentation on the crack images in the training set to obtain a disease data set. Wherein, the disease data set includes: a fracture data set and a water infiltration data set.
In one embodiment, a statistical analysis is first performed on a large number of existing crack images, and a functional expression is fitted using the different intensities of the cracks:
Figure SMS_6
and (a, b, c and d are all substitution coefficients), the fitting function expression and a YOLOv5 network model are used in a combined training mode, and the fracture data set and the water seepage data set of the YOLOv5 network model before the training are subjected to image segmentation and compression.
Further, label labeling is carried out on the crack data set and the water seepage data set through an image labeling tool labellimg, and a labeling file is obtained. The annotation files are fracture data sets and TXT files corresponding to the images in the water seepage data sets. And identifying all target characteristics in each image through a preset target frame, and storing the category label information and the position information of the marking frame of each generated image into a marking file.
In one implementation, labellimg is used for labeling the crack and seepage data sets, which are respectively labeled as crack and water analysis, each image forms a corresponding TXT file after labeling, the file includes category label information and labeling frame position information of all target features in the image, and names of the TXT file and the image file are in one-to-one correspondence. Opening a specific annotation file will see that each row in the TXT file represents a target feature.
S102, performing target detection training on the annotation file and the corresponding crack image according to a preset Pythroch deep learning frame to obtain an improved YOLOv5 network model.
Specifically, obtaining category label information of a labeled file and corresponding labeled frame position information; wherein, mark frame positional information includes: the method comprises the steps of image center point horizontal and vertical scale information, image center point vertical coordinate information, length information and width information of a target frame.
Further, based on the category label information, normalization processing is carried out on the position information of the labeling frame, and a label file is obtained. And inputting the label file and each corresponding crack image into a YOLOv5 network model based on a Pythrch deep learning framework, and performing training and testing related to crack image detection to obtain an improved YOLOv5 network model.
As a feasible implementation manner, the category label information in the label file, and the image center point horizontal ordinate information, the image center point ordinate information, the length information and the width information of the target frame in the labeling frame position information, the label file and each corresponding crack image are all input into the YOLOv5 network model of the Pytorch deep learning frame, training and testing related to crack image detection are performed through preset detection codes, and finally the improved YOLOv5 network model is obtained.
S103, carrying out classification judgment on the pre-collected lining crack image by using the improved YOLOv5 network model according to the corresponding prediction frames to obtain an evaluation index of each class.
Specifically, the lining crack image is input into the improved YOLOv5 network model. And calculating related image prediction frames of the lining crack image through the improved YOLOv5 network model to obtain a plurality of prediction frames.
Further, according to a preset classification standard, classifying and judging the prediction frames to obtain a classification judgment result. Wherein, the classification judgment result includes: TP prediction block, FP prediction block, FN prediction block, and TN prediction block.
Further, according to the distribution condition of each category prediction frame in the classification judgment result, performing crack image recognition calculation on each category prediction frame, and determining the evaluation index of each category prediction frame.
In one embodiment, firstly, an acquisition vehicle provided with an acquisition camera and an acquisition card runs in a tunnel to realize image collection of a tunnel lining surface crack, a lining crack image is obtained, then the lining crack image is input into an improved YOLOv5 network model, the model outputs a plurality of prediction frames after calculating the input image, the prediction frames can be divided into four categories of TP prediction frames, FP prediction frames, FN prediction frames and TN prediction frames according to the classification judgment result, the prediction frames judge whether to correctly calculate the evaluation index corresponding to the crack image according to the distribution condition of the four categories of samples, finally, the evaluation index of each category of prediction frames can be obtained, the evaluation index is used for comprehensively evaluating the crack target detection effect, and a judgment basis is provided for identification of the accuracy rate of the related lining crack.
And S104, identifying the accuracy of the lining cracks on the lining crack image through the evaluation indexes to obtain target images containing the lining cracks.
In particular, according to
Figure SMS_7
Obtaining the target ratio of the cracks
Figure SMS_8
(ii) a Wherein, (Ii) is the ith sample of the related lining crack image data set, cj is the accuracy rate of the crack target in each category prediction frame in the evaluation index, TP is a TP prediction frame, and FP is a FP prediction frame.
Further in accordance with
Figure SMS_9
Obtaining the average value of the accuracy rate of Cj in the lining crack image
Figure SMS_10
(ii) a Wherein N is that the image data set of the related lining cracks comprises N images.
Further according to
Figure SMS_11
Obtaining the average value mAP of the APcj precision rate average values in all the category prediction frames; and M is the number of prediction frames of all categories, and AP is the average value of the accuracy rate of the lining crack image.
Further, whether the lining cracks are contained in the lining crack image or not is detected through the average mAP of the average accuracy rate, and target images containing the lining cracks are determined.
In one embodiment, the judgment of the accuracy rate of the crack image in each lining crack image is realized through the Mean value mAP (Mean average precision) of the average accuracy rate obtained in the steps, so that the image information corresponding to the tunnel lining cracks and the water seepage problem is accurately identified, and the target image which needs to be noticed and contains the lining cracks is obtained.
And S105, carrying out opening and closing operation combining corrosion expansion on the crack features in the target image through a preset morphological algorithm to obtain a target crack connected domain of the target image.
Specifically, the opening operation processing is performed on the crack feature in the target image. Wherein, the opening operation processing is to perform corrosion processing and then perform expansion processing on the crack characteristics. The method specifically comprises the following steps: and smoothing the burr area in the crack characteristic, and changing the area of the crack communication domain corresponding to the crack characteristic according to the opening operation processing to obtain a pretreatment communication domain.
After the preprocessed connected domain is obtained, performing closed operation processing on crack features in the target image to perform hole region filling processing on the preprocessed connected domain to obtain the target crack connected domain of the target image; wherein, the closed operation processing is to perform expansion processing and then perform corrosion processing on the crack characteristics.
In one embodiment, a single erosion and expansion operation cannot connect crack fracture positions while denoising, erosion can reduce or even eliminate crack regions, and expansion can enlarge small noise and even fuse with cracks, so that the two operations need to be combined to form opening and closing operation. The opening operation is a process of firstly corroding and then expanding, the expression is dst = open (src, element) = diode (anode), protruding burrs on a crack characteristic region can be eliminated, the overall outline is smooth, meanwhile, the area of a crack connected domain is changed to the minimum degree, a preprocessed connected domain is obtained, and isolated fine noise in an image can be effectively eliminated. The closing operation is a process of expanding first and then corroding, and the expression dst = close (src, element) = anode (src, element)), and the closing operation can fill a hollow area of a crack characteristic area in an image and enable a target crack connected domain to be completely smooth.
And S106, carrying out image noise filtration on the target crack connected domain to obtain the real crack characteristics.
Specifically, pixel marking is carried out on a connected domain image corresponding to the target crack connected domain, and a marked area is obtained. And traversing and judging the gray value of the target point neighborhood region of the connected domain image. Wherein the target point neighborhood region includes: left side region, upper left region, right upper region and upper right region, the size of target point is the region of pixel 3 x 3.
And if the pixel gray values of the neighborhood regions of the target point are all 0, marking the top left corner of the connected domain image as a new crack connected domain starting point.
If the pixel gray values of the left area and the upper left area of the target point are 1, marking the area with smaller pixel values between the left area and the upper left area in the target point, and determining the pixel areas in the left area and the upper left area as small marked areas.
If the pixel gray values of the left area and the upper right area of the target point are 1, marking the area with smaller pixel values between the left area and the upper right area in the target point, and determining the pixel areas in the left area and the upper left area as small marked areas.
If the pixel gray value of the region right above the target point is 1, marking the target point as any one of the neighborhood regions of the target point according to the sequence of the left region, the right region and the right region.
As a feasible implementation, after morphological operation to amplify the crack characteristics, the noise is also amplified, so that the noise needs to be filtered next. Firstly, starting from the top left corner of a connected domain image corresponding to a target crack connected domain, judging whether the gray levels of four region points on the left side, the top side and the top right side in the neighborhood of a target point 3 x 3 are 1, and if the gray levels are 0, marking the target point as the starting point of a new connected domain. If the gray values of the left and upper left pixels in the point are 1, marking the target point as the smaller one of the marked values of the left and upper left pixels, and modifying the original large mark in the left and upper left pixels into a small mark. If the grey values of the upper left pixel and the upper right pixel in the target point are 1, marking the target point as a smaller marked point in the upper left pixel and the upper right pixel, and modifying the original large mark in the upper left pixel and the upper right pixel into a small mark. If none of the three conditions is met, the target point is marked as one of the four points in order of left, top right and top right. And then traversing the target point neighborhood region of 3-by-3 rightward and downward along the image, and determining the marked region of the same mark as a connected domain.
Further, traversing the marked areas, and determining the same marked area as the same connected domain. And carrying out area calculation on the same connected domains, and determining the minimum external rectangle corresponding to the area of the same connected domain. Fig. 2 is a schematic diagram of a real fracture feature provided in an embodiment of the present application, as shown in fig. 2, after the above operations, noise of a fracture image is removed, and finally, a fracture feature in a minimum circumscribed rectangle is subjected to feature extraction, so as to obtain the real fracture feature shown in fig. 2. The minimum external rectangle is A in length, B in width and S in area of the same connected region; and if T is less than S/AB and S is greater than TS, reserving the same connected domain. And if T is not satisfied to be smaller than S/AB and S is larger than TS, determining the same connected domain as the background of the connected domain image. And T is the preset connected domain image pixel ratio.
In addition, an embodiment of the present application further provides a tunnel lining crack detection apparatus based on YOLOv5, as shown in fig. 3, the tunnel lining crack detection apparatus 300 based on YOLOv5 specifically includes:
at least one processor 301; and a memory 302 communicatively coupled to the at least one processor 301; wherein the memory 302 stores instructions executable by the at least one processor 301 to enable the at least one processor 301 to:
labeling a disease data set corresponding to a plurality of preset crack images to obtain a labeled file of the disease data set;
according to a preset Pythroch deep learning frame, carrying out target detection training on the annotation file and the corresponding crack image through a YOLOv5 network model to obtain an improved YOLOv5 network model;
carrying out classification judgment on the corresponding prediction frames of the pre-collected lining crack image through the improved YOLOv5 network model to obtain an evaluation index of each category;
identifying the accuracy rate of related lining cracks on the lining crack image through evaluation indexes to obtain target images all containing the lining cracks;
performing corrosion expansion combined opening and closing operation on crack features in the target image through a preset morphological algorithm to obtain a target crack connected domain of the target image;
and carrying out image noise filtration on the target crack connected domain to obtain the real crack characteristics.
The embodiment of the application realizes real-time detection to the lining condition in the tunnel through the image collection system that the collection car carried on, long consuming time has been replaced, the artifical testing process of inefficiency, train through the higher function expression of mAP value to image fitting, discernment and location crack area that can be accurate, judge whether the lining surface is the crack disease, realize the automated inspection of high accuracy, carry out getting rid of background impurity to the crack image after detecting, utilize a series of morphological algorithm to draw the crack connected domain, realize removing of noise of image, the real essential character of crack has been kept.
The embodiments in the present application are described in a progressive manner, and the same and similar parts among the embodiments can be referred to each other, and each embodiment focuses on the differences from the other embodiments. In particular, for the apparatus embodiment, since it is substantially similar to the method embodiment, the description is relatively simple, and for the relevant points, reference may be made to the partial description of the method embodiment.
The foregoing description of specific embodiments of the present application has been presented. Other embodiments are within the scope of the following claims. In some cases, the actions or steps recited in the claims may be performed in a different order than in the embodiments and still achieve desirable results. In addition, the processes depicted in the accompanying figures do not necessarily require the particular order shown, or sequential order, to achieve desirable results. In some embodiments, multitasking and parallel processing may also be possible or may be advantageous.
The above description is only an example of the present application and is not intended to limit the present application. Various modifications and changes may occur to those skilled in the art to which the embodiments of the present application pertain. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the embodiments of the present application should be included in the scope of the claims of the present application.

Claims (10)

1. A tunnel lining crack detection method based on YOLOv5 is characterized by comprising the following steps:
labeling a disease data set corresponding to a plurality of preset crack images to obtain a labeled file of the disease data set;
according to a preset Pythroch deep learning frame, carrying out target detection training on the annotation file and the corresponding crack image through a YOLOv5 network model to obtain an improved YOLOv5 network model;
performing classification judgment on the pre-acquired lining crack image by using the improved YOLOv5 network model according to the corresponding prediction frames to obtain an evaluation index of each category;
identifying the accuracy of the related lining cracks of the lining crack image according to the evaluation index to obtain target images containing the lining cracks;
performing opening and closing operation of corrosion expansion combination on crack features in the target image through a preset morphological algorithm to obtain a target crack connected domain of the target image;
and carrying out image noise filtration on the target crack connected domain to obtain real crack characteristics.
2. The method for detecting tunnel lining cracks based on YOLOv5 as claimed in claim 1, wherein labeling is performed on a disease data set corresponding to a plurality of preset crack images to obtain a labeled file of the disease data set, and specifically includes:
fitting and analyzing the crack brightness of the crack images to obtain a fitting function related to the crack brightness;
dividing the plurality of crack images into a training set and a testing set by training the expression of the fitting function;
performing data compression and segmentation on the crack images in the training set to obtain the disease data set; wherein the disease data set comprises: a fracture data set and a water seepage data set;
labeling the crack data set and the water seepage data set by an image labeling tool labellimg to obtain a labeling file; the marking file is a TXT file corresponding to each image in the fracture data set and the water seepage data set; and identifying all target features in each image through a preset target frame, and storing the category label information and the position information of the marking frame of each image into the marking file.
3. The method of claim 1, wherein the objective detection training of the YOLOv5 network model is performed on the annotation file and the corresponding crack image according to a preset Pytorch deep learning framework to obtain an improved YOLOv5 network model, and the method specifically comprises:
acquiring category label information of the labeled file and corresponding labeled frame position information; wherein the label box position information comprises: the method comprises the following steps of (1) image center point horizontal and vertical scale information, image center point vertical coordinate information, length information and width information of a target frame;
based on the category label information, carrying out normalization processing on the position information of the labeling frame to obtain a label file;
and inputting the label file and each corresponding crack image into a YOLOv5 network model based on a Pythrch deep learning framework, and performing training and testing related to crack image detection to obtain the improved YOLOv5 network model.
4. The YOLOv 5-based tunnel lining crack detection method according to claim 1, wherein the modified YOLOv5 network model is used to classify and judge the pre-acquired lining crack image by corresponding prediction frames to obtain an evaluation index for each category, and specifically comprises:
inputting the lining fracture image into the improved Yolov5 network model;
calculating related image prediction frames of the lining crack image through the improved YOLOv5 network model to obtain a plurality of prediction frames;
according to a preset classification standard, performing classification judgment on the prediction frames to obtain a classification judgment result; wherein the classification judgment result comprises: a TP prediction frame, a FP prediction frame, a FN prediction frame and a TN prediction frame;
and according to the distribution condition of each category prediction frame in the classification judgment result, carrying out crack image recognition calculation on each category prediction frame to determine the evaluation index of each category prediction frame.
5. The method for detecting tunnel lining cracks based on YOLOv5 as claimed in claim 1, wherein the step of identifying the accuracy of lining cracks on the lining crack image according to the evaluation index to obtain target images all including lining cracks specifically comprises:
according to
Figure QLYQS_1
Obtaining the target ratio of the cracks
Figure QLYQS_2
(ii) a Wherein, (Ii) is the ith sample of the related lining crack image data set, cj is the accuracy rate of the crack target in each category prediction frame in the evaluation index, TP is a TP prediction frame, and FP is a FP prediction frame;
according to
Figure QLYQS_3
Obtaining the average value of the accuracy rate of Cj in the lining crack image
Figure QLYQS_4
(ii) a Wherein N is that the image data set of the related lining cracks comprises N images;
according to
Figure QLYQS_5
Obtaining the average value mAP of the APcj precision rate average values in all the category prediction frames; wherein M is the number of prediction frames of all categories, and AP is the average value of the accuracy rate of the lining crack image;
and detecting whether the lining crack image contains the lining crack or not according to the average value mAP of the average precision rate, and determining the target images containing the lining crack.
6. The method for detecting tunnel lining cracks based on YOLOv5 as claimed in claim 1, wherein the opening and closing operation of combining erosion and expansion is performed on the crack features in the target image through a preset morphological algorithm to obtain the target crack connected domain of the target image, specifically comprising:
carrying out opening operation processing on crack characteristics in the target image; wherein, the opening operation processing is to perform corrosion processing and then expansion processing on the crack characteristics; the method specifically comprises the following steps:
smoothing a burr area in the crack feature, and changing the area of a crack communication domain corresponding to the crack feature according to the opening operation processing to obtain a pre-processing communication domain;
after the preprocessing connected domain is obtained, performing closed operation processing on crack features in the target image to perform hole region filling processing on the preprocessing connected domain to obtain a target crack connected domain of the target image; and the closed operation treatment is to perform expansion treatment and then perform corrosion treatment on the crack characteristics.
7. The tunnel lining crack detection method based on YOLOv5 as claimed in claim 1, wherein image noise filtering is performed on the target crack connected domain to obtain real crack characteristics, and the method specifically comprises:
carrying out pixel marking on a connected domain image corresponding to the target crack connected domain to obtain a marked region;
traversing the marked areas, and determining the same marked area as the same connected domain;
calculating the areas of the same connected domains, and determining the minimum circumscribed rectangle corresponding to the areas of the same connected domains;
and extracting the features of the crack features in the minimum circumscribed rectangle to obtain the real crack features.
8. The Yolov 5-based tunnel lining crack detection method of claim 7, wherein pixel labeling is performed on a connected domain image corresponding to the target crack connected domain to obtain a labeled region, and specifically comprises:
traversing and judging the gray value of a target point neighborhood region of the connected domain image; wherein the target point neighborhood region includes: the left side area, the upper left area, the right upper area and the upper right area, and the size of the target point is the area of the pixel 3 x 3;
if the pixel gray values of the neighborhood regions of the target point are all 0, marking the top left corner of the connected domain image as a new crack connected domain starting point;
if the pixel gray values of the left area and the upper left area of the target point are 1, marking the area with smaller pixel values between the left area and the upper left area in the target point, and determining the pixel areas in the left area and the upper left area as small marked areas;
if the pixel gray values of the left area and the upper right area of the target point are 1, marking the area with smaller pixel values between the left area and the upper right area in the target point, and determining the pixel areas in the left area and the upper left area as small marked areas;
if the pixel gray value of the region right above the target point is 1, marking the target point as any one of the neighborhood regions of the target point according to the sequence of the left region, the right region and the right region.
9. The YOLOv 5-based tunnel lining crack detection method as claimed in claim 7, wherein the minimum bounding rectangle has a length of A and a width of B, and the same connected domain has an area of S; if T is less than S/AB and S is greater than TS, reserving the same connected domain; if T is not satisfied and is smaller than S/AB and S is larger than TS, determining the same connected domain as the background of the connected domain image;
and T is the preset connected domain image pixel proportion.
10. A tunnel lining crack detection device based on YOLOv5 is characterized in that the device comprises:
at least one processor; and the number of the first and second groups,
a memory communicatively coupled to the at least one processor; wherein, the first and the second end of the pipe are connected with each other,
the memory stores instructions executable by the at least one processor to enable the at least one processor to perform a YOLOv 5-based tunnel lining crack detection method of any of claims 1-9.
CN202310113050.XA 2023-02-15 2023-02-15 YOLOv 5-based tunnel lining crack detection method and equipment Pending CN115830432A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310113050.XA CN115830432A (en) 2023-02-15 2023-02-15 YOLOv 5-based tunnel lining crack detection method and equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310113050.XA CN115830432A (en) 2023-02-15 2023-02-15 YOLOv 5-based tunnel lining crack detection method and equipment

Publications (1)

Publication Number Publication Date
CN115830432A true CN115830432A (en) 2023-03-21

Family

ID=85521355

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310113050.XA Pending CN115830432A (en) 2023-02-15 2023-02-15 YOLOv 5-based tunnel lining crack detection method and equipment

Country Status (1)

Country Link
CN (1) CN115830432A (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107862677A (en) * 2017-10-16 2018-03-30 中铁第四勘察设计院集团有限公司 The Tunnel Lining Cracks recognition methods of thresholding algorithm and system between a kind of class based on gradient
CN112233111A (en) * 2020-11-18 2021-01-15 安徽国钜工程机械科技有限公司 Tunnel gap detection method based on digital image processing
CN114548278A (en) * 2022-02-22 2022-05-27 西安建筑科技大学 In-service tunnel lining structure defect identification method and system based on deep learning
CN114693615A (en) * 2022-03-17 2022-07-01 常州工学院 Deep learning concrete bridge crack real-time detection method based on domain adaptation

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107862677A (en) * 2017-10-16 2018-03-30 中铁第四勘察设计院集团有限公司 The Tunnel Lining Cracks recognition methods of thresholding algorithm and system between a kind of class based on gradient
CN112233111A (en) * 2020-11-18 2021-01-15 安徽国钜工程机械科技有限公司 Tunnel gap detection method based on digital image processing
CN114548278A (en) * 2022-02-22 2022-05-27 西安建筑科技大学 In-service tunnel lining structure defect identification method and system based on deep learning
CN114693615A (en) * 2022-03-17 2022-07-01 常州工学院 Deep learning concrete bridge crack real-time detection method based on domain adaptation

Non-Patent Citations (3)

* Cited by examiner, † Cited by third party
Title
方广欣: "基于 YOLOv5 的地铁隧道裂缝检测技术研究" *
柴雪松;朱兴永;李健超;薛峰;辛学仕;: "基于深度卷积神经网络的隧道衬砌裂缝识别算法" *
石青: "微小型仿生机器鼠设计与控制", 北京理工大学出版社 *

Similar Documents

Publication Publication Date Title
CN112837290B (en) Crack image automatic identification method based on seed filling algorithm
CN104021574B (en) Pavement disease automatic identifying method
CN105447851A (en) Glass panel sound hole defect detection method and system
CN114581764B (en) Underground structure crack disease discriminating method based on deep learning algorithm
CN107818321A (en) A kind of watermark date recognition method for vehicle annual test
CN103593668B (en) Automatic crack identification method in metal plate stamping connector mechanical property test
CN113240623B (en) Pavement disease detection method and device
CN111507971A (en) Tunnel surface defect detection method
CN108508023B (en) Defect detection system for contact end jacking bolt in railway contact network
CN111127465A (en) Automatic generation method and system for bridge detection report
CN115995056A (en) Automatic bridge disease identification method based on deep learning
Abbas et al. Automated pavement distress detection using image processing techniques
CN112329664A (en) Method for evaluating prokaryotic quantity of prokaryotic embryo
CN112085699A (en) Pavement crack extraction method based on two-dimensional image
CN113962951B (en) Training method and device for detecting segmentation model, and target detection method and device
CN109767426B (en) Shield tunnel water leakage detection method based on image feature recognition
CN110672632A (en) Tunnel disease identification method
CN117314921B (en) RFID-based starting point detection and treatment method for track inspection equipment
CN115830432A (en) YOLOv 5-based tunnel lining crack detection method and equipment
CN109615630A (en) Semi-continuous casting alusil alloy Analysis on Microstructure method based on image processing techniques
CN104504702A (en) Cement notch pavement crack recognition method based on square lattice searching method
CN114998254A (en) Method and system for automatically grading center segregation of continuous casting slab
CN114596439A (en) Image-based intelligent damage assessment and check method and device for car insurance and electronic equipment
CN109064417B (en) Subway tunnel image processing method and device
CN112949644B (en) Fault image identification method for lower pull rod of truck

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
RJ01 Rejection of invention patent application after publication

Application publication date: 20230321

RJ01 Rejection of invention patent application after publication