Bridge crack detection method and device, electronic equipment and storage medium
By using a combination method of bridge crack enhancement model and detection model in bridge crack detection, the problems of high false alarm rate and low detection accuracy in the prior art are solved, and more accurate and robust bridge crack detection is achieved.
Patent Information
- Application Number
- CN202411611265.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-12
- Publication Date
- 2025-02-25
AI Technical Summary
The existing deep learning algorithms have high false alarm rates and low detection accuracy when detecting bridge cracks, especially in applications in contaminated areas, which are easy to lead to missed detection or missed detection.
A bridge crack detection method is adopted, and image processing and detection are performed by acquiring the bridge area images and dividing them into different categories. The specific steps include: inputting the image to the CFEM model for data enhancement, and then inputting the enhanced image to a deep learning algorithm model improved based on the texture feature loss function and the weight allocation loss function for detection, and finally obtaining the bridge crack detection result through image stitching.
It improves the accuracy and robustness of bridge crack detection, reduces false alarm rates and false detection rates, ensures the safe use of bridges, and lays an important foundation for bridge safety inspection.
Smart Images

Figure CN119515839A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of bridge crack detection, and in particular to a bridge crack detection method, device, electronic equipment and storage medium. Background Art
[0002] Bridges are one of the key infrastructures to ensure the normal operation of road transportation. However, long-term traffic and the impact of the surrounding natural environment can cause partial damage to the concrete structure of bridges. Among them, cracks are one of the typical manifestations of bridge diseases. Their forms are diverse, and the features presented in two-dimensional images are not obvious, lacking diverse geometric information. Therefore, the detection of bridge cracks has always been a difficult problem in engineering.
[0003] Unlike the areas where general cracks exist, the areas where some bridge cracks exist are highly likely to be contaminated by goods transported by trains (such as coal) or the surrounding environment. Under the scouring of rainwater, a large number of obvious water stains and other pollutants are formed on the concrete surface. These pollutants present geometric or color characteristics similar to cracks, which increases the difficulty of crack detection.
[0004] There are some challenges in applying the current crack detection algorithm to contaminated areas. Conventional image processing methods do not work well for the separation between cracks and background. For example, the target extraction method achieved by traditional image processing methods such as thresholding and edge extraction is not robust in complex environments and is prone to false detection or missed detection.
[0005] Therefore, it is of great significance to study a bridge crack detection method based on the bridge crack enhancement model and the bridge crack detection model, so as to use the bridge crack enhancement model and the bridge crack detection model to quickly and accurately detect bridge cracks, so as to identify bridge cracks, ensure the safety of bridges, and prevent bridge safety accidents. Summary of the invention
[0006] The present invention provides a bridge crack detection method, device, electronic device and storage medium, which are used to solve the problems of high false alarm rate and low detection accuracy in existing deep learning algorithms when detecting bridge cracks, laying an important foundation for the safe use of bridges.
[0007] In a first aspect, the present invention provides a bridge crack detection method, comprising:
[0008] Acquire bridge area images;
[0009] Classifying the bridge area image into different categories according to the bridge identification corresponding to the bridge area image;
[0010] Inputting the bridge region images of different categories into a preset bridge crack enhancement model to obtain bridge crack enhancement images corresponding to the bridge region images of different categories;
[0011] Inputting the bridge crack enhanced images belonging to the same category into a preset bridge crack detection model to calculate and obtain preliminary bridge crack detection result information belonging to the same category;
[0012] The preliminary bridge crack detection result information belonging to the same category is image stitched to obtain bridge crack detection result information corresponding to bridges with different bridge numbers.
[0013] Optionally, the preset bridge crack enhancement model is a CFEM model; the steps of constructing the preset bridge crack enhancement model include:
[0014] Acquire a bridge crack data enhancement training sample from a database; the bridge crack data enhancement training sample includes a first historical bridge image and corresponding historical crack data enhancement image information;
[0015] Performing a data enhancement operation on the first historical bridge image to obtain a second historical bridge image;
[0016] The CFEM model is constructed based on the second historical bridge image and the corresponding historical crack data enhanced image information to obtain the preset bridge crack enhancement model.
[0017] Optionally, the CFEM model is constructed according to the second historical bridge image and the corresponding historical crack data enhanced image information to obtain the preset bridge crack enhancement model, including:
[0018] constructing the CFEM model corresponding to the second historical bridge image;
[0019] According to the second historical bridge image and the corresponding historical crack data enhanced image information, the CFEM model is trained to obtain a trained CFEM model;
[0020] Based on the second historical bridge image and the corresponding historical crack data enhanced image information, the trained CFEM model is verified to obtain the preset bridge crack detection model.
[0021] Optionally, the CFEM model is trained according to the second historical bridge image and the corresponding historical crack data to enhance the image information, so as to obtain the trained CFEM model, including:
[0022] Inputting the second historical bridge image into the CFEM model to obtain corresponding crack data enhancement output;
[0023] Determining a training error based on the second historical bridge image and the corresponding historical crack data enhanced image information and the corresponding crack data enhanced output;
[0024] Based on the training error, the parameters of the CFEM model are adjusted to obtain optimal parameters, and the CFEM model is optimized using the optimal parameters to obtain the trained CFEM model.
[0025] Optionally, before inputting the second historical bridge image into the CFEM model to obtain the corresponding crack data enhancement output, the method further includes:
[0026] Initialize the parameters of the CFEM model.
[0027] Optionally, the preset bridge crack detection model is a deep learning algorithm model improved based on a texture feature loss function and a weight distribution loss function.
[0028] In a second aspect, the present invention provides a bridge crack detection device, comprising:
[0029] An acquisition module, used for acquiring images of the bridge area;
[0030] A classification module, used for classifying the bridge area image into different categories according to the bridge identification corresponding to the bridge area image;
[0031] An input module, used for inputting the bridge region images of different categories into a preset bridge crack enhancement model to obtain bridge crack enhancement images corresponding to the bridge region images of different categories;
[0032] A calculation module, used for inputting the bridge crack enhanced images belonging to the same category into a preset bridge crack detection model, and calculating and obtaining preliminary bridge crack detection result information belonging to the same category;
[0033] The splicing module is used to perform image splicing on the preliminary bridge crack detection result information belonging to the same category to obtain bridge crack detection result information corresponding to bridges with different bridge identifiers.
[0034] In a third aspect, the present invention provides an electronic device, comprising a processor and a memory, wherein the memory stores computer-readable instructions, and when the computer-readable instructions are executed by the processor, the steps in the method provided in the first aspect are performed.
[0035] In a fourth aspect, the present invention provides a storage medium having a computer program stored thereon, wherein the computer program, when executed by a processor, runs the steps of the method provided in the first aspect.
[0036] In a fifth aspect, the present invention provides a computer program product, comprising a computer program, wherein when the computer program is executed by a processor, the steps in the method provided in the first aspect are performed.
[0037] It can be seen from the above technical solutions that the present invention has the following advantages:
[0038] The present invention provides a bridge crack detection method, device, electronic device and storage medium, the method comprising: obtaining a bridge region image, dividing the bridge region image into different categories according to the bridge identification corresponding to the bridge region image, inputting the bridge region images of the different categories into a preset bridge crack enhancement model, obtaining bridge crack enhancement images corresponding to the bridge region images of the different categories, inputting the bridge crack enhancement images belonging to the same category into a preset bridge crack detection model, calculating and obtaining preliminary bridge crack detection result information belonging to the same category, performing image splicing on the preliminary bridge crack detection result information belonging to the same category, and obtaining bridge crack detection result information corresponding to bridges with different bridge numbers. A set of methods for detecting bridge cracks using a bridge crack enhancement model and a bridge crack detection model is formed, solving the problems of high false alarm rate and low detection accuracy in existing deep learning algorithms when detecting bridge cracks, and laying an important foundation for the safe use of bridges. BRIEF DESCRIPTION OF THE DRAWINGS
[0039] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.
[0040] Figure 1 A flow chart of a bridge crack detection method according to a first embodiment of the present invention;
[0041] Figure 2 This is a flow chart of a second embodiment of a bridge crack detection method of the present invention;
[0042] Figure 3 It is a schematic diagram of the structure of the improved YOLOv5 model of the present invention;
[0043] Figure 4 The present invention is a structural block diagram of an embodiment of a bridge crack detection device of the present invention. DETAILED DESCRIPTION
[0044] The embodiments of the present invention provide a bridge crack detection method, device, electronic device and storage medium, which are used to solve the problem of difficulty in detecting bridge cracks in abnormally high-pressure sections, and lay an important foundation for the safe use of bridges.
[0045] In order to make the purpose, features and advantages of the present invention more obvious and easy to understand, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the embodiments described below are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0046] Embodiment 1
[0047] See also Figure 1 , Figure 1 This is a flow chart of a first embodiment of a bridge crack detection method of the present invention, the method comprising:
[0048] Step S101, obtaining a bridge area image;
[0049] The embodiment of the present invention obtains a bridge region image, and the bridge region image is an image of the bridge cracks that need to be detected.
[0050] Step S102, dividing the bridge area image into different categories according to the bridge identification corresponding to the bridge area image;
[0051] The embodiment of the present invention classifies bridge region images according to bridge identifications (such as numbers) to obtain bridge region images of different categories.
[0052] Step S103, inputting the bridge region images of different categories into a preset bridge crack enhancement model to obtain bridge crack enhancement images corresponding to the bridge region images of different categories;
[0053] In an optional embodiment, the preset bridge crack enhancement model is a CFEM model; the steps of constructing the preset bridge crack enhancement model include:
[0054] Acquire a bridge crack data enhancement training sample from a database; the bridge crack data enhancement training sample includes a first historical bridge image and corresponding historical crack data enhancement image information;
[0055] Performing a data enhancement operation on the first historical bridge image to obtain a second historical bridge image;
[0056] The CFEM model is constructed based on the second historical bridge image and the corresponding historical crack data enhanced image information to obtain the preset bridge crack enhancement model.
[0057] The embodiment of the present invention obtains a bridge crack data enhancement training sample in a database, the bridge crack data enhancement training sample includes a first historical bridge image and corresponding historical crack data enhancement image information, performs a data enhancement operation on the first historical bridge image to obtain a second historical bridge image, constructs a CFEM model corresponding to the second historical bridge image, trains the CFEM model according to the second historical bridge image and the corresponding historical crack data enhancement image information to obtain a trained CFEM model, verifies the trained CFEM model based on the second historical bridge image and the corresponding historical crack data enhancement image information to obtain a bridge crack detection model, inputs different categories of bridge area images into a preset bridge crack enhancement model, and the bridge crack enhancement model performs data enhancement (such as amplification, filtering, etc.) on the crack area in the bridge area image according to the color features, shape features, and texture features of the crack, to obtain a bridge crack enhancement image corresponding to the bridge area image. Wherein, the crack area refers to the area where the crack is located, that is, the crack area includes the crack and the background at its location.
[0058] Step S104, inputting the bridge crack enhanced images belonging to the same category into a preset bridge crack detection model, and calculating and obtaining preliminary bridge crack detection result information belonging to the same category;
[0059] The embodiment of the present invention extracts and marks cracks in the bridge crack enhancement image through a preset bridge crack detection model, and obtains preliminary bridge crack detection result information corresponding to each bridge area image. The preset bridge crack detection model is a deep learning algorithm model improved based on the texture feature loss function and the weight distribution loss function.
[0060] Step S105, performing image stitching on the preliminary bridge crack detection result information belonging to the same category to obtain bridge crack detection result information corresponding to bridges with different bridge identifiers;
[0061] In the embodiment of the present invention, preliminary bridge crack detection result information belonging to the same category (ie, the same bridge) is spliced to obtain bridge crack detection result information of bridges with different numbers.
[0062] A bridge crack detection method provided by an embodiment of the present invention includes: obtaining a bridge area image, dividing the bridge area image into different categories according to the bridge identification corresponding to the bridge area image, inputting the bridge area images of the different categories into a preset bridge crack enhancement model, obtaining bridge crack enhancement images corresponding to the bridge area images of the different categories, inputting the bridge crack enhancement images belonging to the same category into a preset bridge crack detection model, calculating and obtaining preliminary bridge crack detection result information belonging to the same category, performing image splicing on the preliminary bridge crack detection result information belonging to the same category, and obtaining bridge crack detection result information corresponding to bridges with different bridge numbers. A set of methods for detecting bridge cracks using a bridge crack enhancement model and a bridge crack detection model is formed to solve the problems of high false alarm rate and low detection accuracy in existing deep learning algorithms when detecting bridge cracks, and lay an important foundation for the safe use of bridges.
[0063] Embodiment 2
[0064] See also Figure 2 , Figure 2 This is a flow chart of a second embodiment of a bridge crack detection method of the present invention, the steps comprising:
[0065] S201, acquiring a bridge area image;
[0066] The embodiment of the present invention obtains a bridge region image, and the bridge region image is an image of the bridge cracks that need to be detected.
[0067] S202, dividing the bridge area image into different categories according to the bridge identifications corresponding to the bridge area image;
[0068] The embodiment of the present invention automatically classifies bridge area images into different folders according to bridge identification (such as number), and each folder contains a collection of inspection pictures of corresponding positions of bridges with the same identification (ie, the same bridge).
[0069] S203, obtaining a bridge crack data enhancement training sample in a database; the bridge crack data enhancement training sample includes a first historical bridge image and corresponding historical crack data enhancement image information;
[0070] The embodiment of the present invention obtains bridge crack data enhancement training samples in a database, and the bridge crack data enhancement training samples include a first historical bridge image and corresponding historical crack data enhancement image information, wherein the first historical bridge image is a historical picture of each bridge, and the historical crack data enhancement image information is a crack data enhancement image of the historical picture. An arbitrary bridge area image is extracted from the historical pictures in the database as the first historical bridge image, and the crack data enhancement image information corresponding to the bridge area image is extracted as the historical crack data enhancement image information, thereby extracting a large amount of data from the database to form bridge crack data enhancement training samples, and the above-obtained data is set as a test set and a validation set for training a model, so that the trained model can identify the data enhancement information of the bridge crack area.
[0071] The historical crack data enhanced image information can be obtained by annotating the first historical bridge image through manual annotation or other methods.
[0072] S204, performing a data enhancement operation on the first historical bridge image to obtain a second historical bridge image;
[0073] In the embodiment of the present invention, data enhancement is performed on the first historical bridge image, such as randomly increasing or decreasing brightness, contrast, saturation, hue, and randomly scaling, cropping, flipping, erasing, and sharpening the first historical bridge image to obtain a second historical bridge image. The data enhancement method is not limited to the above method, and can be replaced by existing technologies according to actual needs.
[0074] For example, nine pictures (the first historical bridge image) are randomly cropped, randomly arranged, and randomly scaled, and then combined into one picture to increase the amount of sample data. At the same time, some random noise is reasonably introduced to enhance the network model's ability to distinguish small target samples in the image and improve the generalization ability of the model. This can increase the number of small targets in the data set, thereby improving the model's ability to detect cracks in small targets.
[0075] S205, enhancing image information according to the second historical bridge image and the corresponding historical crack data, constructing a CFEM model, and obtaining a preset bridge crack enhancement model;
[0076] In an optional embodiment, the CFEM model is constructed based on the second historical bridge image and the corresponding historical crack data enhanced image information to obtain the bridge crack enhancement model, including:
[0077] constructing a CFEM model corresponding to the second historical bridge image;
[0078] According to the second historical bridge image and the corresponding historical crack data enhanced image information, the CFEM model is trained to obtain a trained CFEM model;
[0079] Based on the second historical bridge image and the corresponding historical crack data enhanced image information, the trained CFEM model is verified to obtain a preset bridge crack enhancement model.
[0080] The embodiment of the present invention constructs a corresponding CFEM model (Crack Feature Enhancement Model) based on the second historical bridge image, and trains the CFEM model using image features such as color features, shape features, and texture features, so that the trained CFEM model can identify crack areas in the image and perform data enhancement on the crack areas. The crack area refers to the area where the crack is located, that is, the crack area includes the crack and the background where it is located; the structure of the CFEM model is as follows: Figure 3 shown.
[0081] The specific process of constructing the GLCM model is as follows:
[0082] 1) First, select a specific pixel spacing (pixel distance) and a specific direction (such as horizontal, vertical, diagonal, etc.).
[0083] 2) For a given pixel spacing and direction, traverse each pixel of the image and record the grayscale level of each pair of pixels.
[0084] 3) According to the gray levels of the recorded pixel pairs, a two-dimensional matrix, the GLCM matrix, is constructed. The rows and columns of the GLCM matrix represent possible gray levels, and each element of the matrix represents the number or probability of two pixels appearing simultaneously in a given interval and direction.
[0085] The elements of the GLCM matrix can represent different statistical characteristics. Commonly used characteristics include:
[0086] 1) Contrast: A measure of the contrast or degree of difference between different gray levels in an image.
[0087] 2) Correlation: reflects the correlation or linear relationship between different gray levels in the image.
[0088] 3) Energy: measures the uniformity of grayscale distribution or energy concentration in an image.
[0089] 4) Homogeneity: Measures the similarity or consistency of adjacent gray levels in an image.
[0090] 5) Entropy: reflects the uncertainty or complexity of the gray levels in the image.
[0091] 6) ASM (Angular Second Moment): measures the uniformity and regularity of the grayscale distribution of the image.
[0092] Specifically, the CFEM model is processed in three ways. From top to bottom, the first way is the residual connection of the subgraph, and the end intervention selector performs weight distribution at the end of the module.
[0093] The second path first performs a convolution operation on the sub-image to form the first feature map, and then enhances the edge features of the cracks through two minimum pooling layers. This process takes advantage of the fact that the cracks have the lowest pixel value and obvious edge features compared to the surrounding image background, representing the color and morphological features of the cracks respectively. In the traditional sense, maximum pooling takes the pixel value of the point with the largest pixel value as the result of pooling, while we take the pixel value of the point with the smallest pixel value as the result of pooling, but the form is consistent with maximum pooling. After the pooling layer, the feature map is deconvolved to form a new feature map with the same size as the sub-image. This map enhances the features of cracks and other impurities with low pixel values while retaining the background.
[0094] Similar to the second path, the third path still extracts image features through convolution and pooling layers. However, the difference is that the third path is connected to two average pooling layers after the convolution layer. Average pooling can extract background information and remove edge features in the image. Then, the feature maps output by the second and third paths will undergo an image subtraction to remove the background with smooth pixel changes. An image containing cracks and low pixel value impurities is obtained.
[0095] Then, the image will pass through the edge detection module, which can not only filter out impurities that show non-edge characteristics (such as water stains, graffiti, etc.), but also further convert the image into a binary image, greatly reducing the total amount of parameters for subsequent texture feature calculation of the image. After edge detection, since the image contains a large amount of point noise, filtering should also be performed. Here we use morphological processing to remove the point noise, and at the same time reassemble the cracked parts to ensure the integrity of the crack texture features. After filtering is completed, one result is directly input into the selector, and the other one calculates the GLCM of the image and inputs the calculation result into the selector.
[0096] The purpose of the selector is to assign weights to the sub-images when adding the image to the image output from the filter. Figure 4As shown in the figure, the main structure of the selector can be divided into two parts, namely the GLCM matching module in the yellow table and its corresponding weight assignment module in the pink table. Each parameter in the yellow table is used as a label for each pair of parameters in the pink table. After the feature map is filtered by the CFEM filter, we will calculate the GLCM of the binary image generated by it (called GLCM pred ) to analyze the texture features of the cracks contained in the image. During the training phase of the model, all the parameters stored in the yellow and orange tables are randomly generated data at first, and then they are continuously updated and iterated during each round of training in the hope of minimizing the final loss function result. After the training is completed, the data stored in the two tables will also be fixed. It should be noted that the parameters in the randomly generated GLCM in the table are consistent with the specific GLCM of each training. train There is a close relationship between GLCM and each updated GLCM train The L value after subtracting the absolute values of the corresponding position elements and summing them up is smaller, so that the GLCM of the two is closer. Assuming that the GLCM matrix is I×J, when the image of this training is the Pth image, L is:
[0097]
[0098] After obtaining several GLCMs, in order to further reduce the number of parameters, we use the K-means clustering algorithm to merge only the similar typical GLCMs and their corresponding weight values. pred The GLCM that minimizes D is matched, and the corresponding pair of weights PRM1 and PRM2 are matched through the sub-label as the weights assigned when adding the sub-image and the image output from the filter. These two parameters will be multiplied with each pixel value of the corresponding image and output, and the image will be added after the filter.
[0099] In summary, a CFEM model corresponding to the second historical bridge image is constructed.
[0100] The second historical bridge image is input into the CFEM model to obtain the corresponding crack data enhancement output. The second historical bridge image and the corresponding historical crack data enhancement image information in the database are compared with the crack data enhancement output obtained by inputting the second historical bridge image into the CFEM model to obtain a training error, such as a size deviation and a position deviation of the crack area position in the historical crack data enhancement image information and the crack data enhancement output. The training error is used to adjust the parameters of the CFEM model. If the training error is a position deviation of the crack area position in the historical crack data enhancement image information and the crack data enhancement output, the corresponding model parameters are modified to make the crack area position of the crack data enhancement output more accurate, and the optimal parameters are obtained. The CFEM model is optimized by the optimal parameters to obtain a trained CFEM model.
[0101] Before inputting data to train the model, the parameters of the CFEM model must be initialized to ensure that the model is in normal use.
[0102] The second historical bridge image in the database that is not used for training is input into the trained CFEM model to obtain the corresponding crack data enhancement output, and the crack data enhancement output is used as verification data. The verification data is compared with the historical crack data enhancement image information corresponding to the second historical bridge image that is not used for training to determine whether the error of the trained CFEM model is within an acceptable range (the acceptable error range is generally 0 to 3%, which can be modified according to actual needs), verify the accuracy of the trained CFEM model, and obtain a bridge crack enhancement model.
[0103] S206, inputting the bridge region images of different categories into the preset bridge crack enhancement model to obtain bridge crack enhancement images corresponding to the bridge region images of different categories;
[0104] The embodiment of the present invention utilizes the feature extraction capability of the bridge crack enhancement model to extract and enhance the data of the crack area corresponding to the bridge area image, thereby improving the accuracy of crack detection in the crack area.
[0105] S207, inputting the bridge crack enhanced images belonging to the same category into a preset bridge crack detection model, and calculating and obtaining preliminary bridge crack detection result information belonging to the same category; the preset bridge crack detection model is a deep learning algorithm model improved based on a texture feature loss function and a weight distribution loss function;
[0106] The bridge crack detection model of the embodiment of the present invention can automatically identify the bridge crack enhanced image, identify the crack area after data enhancement from the bridge crack enhanced image, and identify and extract the specific shape of the crack from the crack area to obtain preliminary bridge crack detection result information. Among them, the bridge crack detection model is a deep learning algorithm model improved based on the texture feature loss function and the weight distribution loss function, such as the YOLOv8 algorithm model and the YOLOv5 algorithm model. The YOLOv8 algorithm model and the YOLOv5 algorithm model are deep learning algorithm models. The YOLOv8 algorithm model and the YOLOv5 algorithm model are prior arts and will not be described in detail here.
[0107] The embodiment of the present invention takes YOLOv8 as an example, and adds a new loss function based on the original loss function. The new loss function is composed of the texture feature loss function L G And the weight distribution loss function L H The loss function consists of two parts: texture feature loss function L G Specifically:
[0108]
[0109] Among them, L G is the texture feature loss function; M represents the number of samples; represents the i-th row and j-th column element of the GLCM of the image contained in the predicted bounding box; I is the total number of elements in the row direction; J is the total number of elements in the column direction; and The i-th row and j-th column element of the GLCM representing the image region represented by the ground-truth annotation.
[0110] Weight distribution loss function L H Specifically:
[0111] L H =β(1-GIoU);
[0112] Among them, L H is the weight distribution loss function; β is the balance parameter; GIoU is the GIoU function.
[0113] The following formula is used to calculate GIoU (Generalized Intersection over Union):
[0114]
[0115] Among them, IoU is the IoU function; Enclosed Area represents the area of the minimum enclosing rectangle that encloses the predicted bounding box and the true bounding box; Union Area represents the union area between the predicted bounding box and the true bounding box.
[0116] S208, performing image stitching on the preliminary bridge crack detection result information belonging to the same category to obtain bridge crack detection result information corresponding to bridges with different bridge identifiers;
[0117] In the embodiment of the present invention, the preliminary bridge crack detection result information belonging to the same category is image stitched according to the bridge identification, so as to obtain the bridge crack detection result information corresponding to the bridges with different bridge identifications. The image stitching is a prior art and will not be described in detail here.
[0118] A bridge crack detection method disclosed in an embodiment of the present invention includes: obtaining a bridge area image, dividing the bridge area image into different categories according to the bridge identification corresponding to the bridge area image, inputting the bridge area images of the different categories into a preset bridge crack enhancement model, obtaining bridge crack enhancement images corresponding to the bridge area images of the different categories, inputting the bridge crack enhancement images belonging to the same category into a preset bridge crack detection model, calculating and obtaining preliminary bridge crack detection result information belonging to the same category, performing image splicing on the preliminary bridge crack detection result information belonging to the same category, and obtaining bridge crack detection result information corresponding to bridges with different bridge numbers. The method solves the problems of high false alarm rate and low detection accuracy in the existing deep learning algorithm when detecting bridge cracks, and lays an important foundation for the safe use of bridges. At the same time, the method is highly operable, and the process of bridge crack detection in actual use is intuitive and clear, and can be easily promoted and applied to the detection process of bridge cracks.
[0119] Embodiment 3
[0120] See also Figure 4 , Figure 4 This is a structural block diagram of an embodiment of a bridge crack detection device of the present invention, the device comprises:
[0121] An acquisition module 301 is used to acquire a bridge area image;
[0122] A classification module 302, configured to classify the bridge area image into different categories according to the bridge identifications corresponding to the bridge area image;
[0123] An input module 303 is used to input the bridge region images of different categories into a preset bridge crack enhancement model to obtain bridge crack enhancement images corresponding to the bridge region images of different categories;
[0124] A calculation module 304 is used to input the bridge crack enhancement images belonging to the same category into a preset bridge crack detection model to calculate and obtain preliminary bridge crack detection result information belonging to the same category;
[0125] The stitching module 305 is used to stitch the preliminary bridge crack detection result information belonging to the same category to obtain the bridge crack detection result information corresponding to bridges with different bridge identifiers.
[0126] In an optional embodiment, the construction module 303 includes:
[0127] An acquisition submodule is used to acquire a bridge crack data enhancement training sample in a database; the bridge crack data enhancement training sample includes a first historical bridge image and corresponding historical crack data enhancement image information;
[0128] An operation submodule, configured to perform a data enhancement operation on the first historical bridge image to obtain a second historical bridge image;
[0129] The construction submodule is used to enhance the image information according to the second historical bridge image and the corresponding historical crack data, construct the CFEM model, and obtain the preset bridge crack enhancement model.
[0130] In an optional embodiment, the construction submodule includes:
[0131] A construction unit, configured to construct the CFEM model corresponding to the second historical bridge image;
[0132] A training unit, configured to enhance image information according to the second historical bridge image and the corresponding historical crack data, train the CFEM model, and obtain a trained CFEM model;
[0133] A verification unit is used to enhance image information based on the second historical bridge image and the corresponding historical crack data, verify the trained CFEM model, and obtain the preset bridge crack detection model.
[0134] In an optional embodiment, the training unit includes:
[0135] An input subunit, used for inputting the second historical bridge image into the CFEM model to obtain a corresponding crack data enhancement output;
[0136] a determination subunit, configured to determine a training error based on the second historical bridge image and the corresponding historical crack data enhanced image information and the corresponding crack data enhanced output;
[0137] The optimization subunit is used to adjust the parameters of the CFEM model based on the training error to obtain the optimal parameters, and optimize the CFEM model using the optimal parameters to obtain the trained CFEM model.
[0138] In an optional embodiment, the training unit further includes:
[0139] The initialization subunit is used to initialize the parameters of the CFEM model.
[0140] Embodiment 4
[0141] An embodiment of the present invention further provides an electronic device, including a memory and a processor, wherein a computer program is stored in the memory, and when the computer program is executed by the processor, the processor executes the steps of a bridge crack detection method of any embodiment.
[0142] Embodiment 5
[0143] An embodiment of the present invention further provides a computer storage medium on which a computer program is stored. When the computer program is executed by the processor, the steps of a bridge crack detection method in any embodiment are implemented.
[0144] Embodiment 6
[0145] An embodiment of the present invention further provides a computer program product on which a computer program is stored. When the computer program is executed by the processor, the steps of a bridge crack detection method in any embodiment are implemented.
[0146] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.
[0147] In the several embodiments provided in the present application, it should be understood that the methods, devices, electronic devices and storage media disclosed in the present invention can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0148] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0149] In addition, each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0150] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product. The computer software product is stored in a readable storage medium, including several instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned readable storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk and other media that can store program codes.
[0151] As described above, the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit the same. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that the technical solutions described in the aforementioned embodiments may still be modified, or some of the technical features thereof may be replaced by equivalents. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A bridge crack detection method, characterized in that: include: Acquire bridge area images; Classifying the bridge area image into different categories according to the bridge identification corresponding to the bridge area image; Inputting the bridge region images of different categories into a preset bridge crack enhancement model to obtain bridge crack enhancement images corresponding to the bridge region images of different categories; Inputting the bridge crack enhanced images belonging to the same category into a preset bridge crack detection model to calculate and obtain preliminary bridge crack detection result information belonging to the same category; The preliminary bridge crack detection result information belonging to the same category is image stitched to obtain bridge crack detection result information corresponding to bridges with different bridge identifications.
2. The bridge crack detection method according to claim 1, characterized in that: The preset bridge crack enhancement model is a CFEM model; The steps of constructing the preset bridge crack enhancement model include: Acquire a bridge crack data enhancement training sample from a database; the bridge crack data enhancement training sample includes a first historical bridge image and corresponding historical crack data enhancement image information; Performing a data enhancement operation on the first historical bridge image to obtain a second historical bridge image; The CFEM model is constructed based on the second historical bridge image and the corresponding historical crack data enhanced image information to obtain the preset bridge crack enhancement model.
3. The bridge crack detection method according to claim 2, characterized in that: According to the second historical bridge image and the corresponding historical crack data enhanced image information, the CFEM model is constructed to obtain the preset bridge crack enhancement model, including: constructing the CFEM model corresponding to the second historical bridge image; According to the second historical bridge image and the corresponding historical crack data enhanced image information, the CFEM model is trained to obtain a trained CFEM model; Based on the second historical bridge image and the corresponding historical crack data enhanced image information, the trained CFEM model is verified to obtain the preset bridge crack detection model.
4. The bridge crack detection method according to claim 3, characterized in that: According to the second historical bridge image and the corresponding historical crack data enhanced image information, the CFEM model is trained to obtain a trained CFEM model, including: Inputting the second historical bridge image into the CFEM model to obtain corresponding crack data enhancement output; Determining a training error based on the second historical bridge image and the corresponding historical crack data enhanced image information and the corresponding crack data enhanced output; Based on the training error, the parameters of the CFEM model are adjusted to obtain optimal parameters, and the CFEM model is optimized using the optimal parameters to obtain the trained CFEM model.
5. The bridge crack detection method according to claim 4, characterized in that: Before inputting the second historical bridge image into the CFEM model to obtain the corresponding crack data enhancement output, the method further includes: Initialize the parameters of the CFEM model.
6. The bridge crack detection method according to claim 1, characterized in that: The preset bridge crack detection model is a deep learning algorithm model improved based on the texture feature loss function and the weight distribution loss function.
7. A bridge crack detection device, characterized in that: include: An acquisition module is used to acquire bridge area images and acquire bridge crack data enhancement training samples in a database; The bridge crack data enhancement training sample includes a first historical bridge image and corresponding historical crack data enhancement image information A classification module, used for classifying the bridge area image into different categories according to the bridge identification corresponding to the bridge area image; An input module, used for inputting the bridge region images of different categories into a preset bridge crack enhancement model to obtain bridge crack enhancement images corresponding to the bridge region images of different categories; A calculation module, used for inputting the bridge crack enhanced images belonging to the same category into a preset bridge crack detection model, and calculating and obtaining preliminary bridge crack detection result information belonging to the same category; The splicing module is used to perform image splicing on the preliminary bridge crack detection result information belonging to the same category to obtain the bridge crack detection result information corresponding to bridges with different bridge numbers.
8. An electronic device, characterized in that: The method comprises a processor and a memory, wherein the memory stores computer-readable instructions, and when the computer-readable instructions are executed by the processor, the method according to any one of claims 1 to 6 is executed.
9. A storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the method according to any one of claims 1 to 6 is executed.
10. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the method according to any one of claims 1 to 6 is implemented.