Dam crack detection method and device, electronic equipment and storage medium
Through the regression-based target detection algorithm and improved attention mechanism module and feature pyramid network, a dam crack detection model is constructed, which solves the problems of low detection accuracy and poor adaptability in the existing technology, and achieves high performance in various scenarios. Accurate crack detection.
Patent Information
- Application Number
- CN202410807769.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-21
- Publication Date
- 2024-10-08
AI Technical Summary
Existing dam crack detection methods rely on manual inspection, have low accuracy and are difficult to implement in complex environments. Traditional image processing algorithms are only suitable for crack detection with large widths and simple backgrounds, and cannot adapt to a variety of scenarios.
A regression-based target detection algorithm is used, combined with an improved attention mechanism module and a feature pyramid network module, to build a crack detection model, which is used to obtain and detect images to be detected, improving detection accuracy and adaptability.
The accuracy and robustness of dam crack detection are improved, cracks can be effectively detected in a variety of scenarios, and the generalization ability and recall rate of the model are enhanced.
Smart Images

Figure CN118747838A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of image processing technology, and in particular to a dam crack detection method, device, electronic equipment and storage medium. Background Art
[0002] Dam refers to the weir that intercepts the river and the water, the water-blocking embankment of the reservoir, river, etc. Generally, the reservoir dam is mainly composed of the main dam, auxiliary dam, normal spillway, emergency spillway, newly added emergency spillway, Lingzheng Channel culvert and power station. Due to the adverse effects of many external factors, the dam has cracks of varying degrees.
[0003] Dam crack detection is generally done by professionals using special equipment to regularly inspect the dam. Manual inspection methods have low detection accuracy, and it is basically difficult to detect cracks manually in some working environments. With the development of computer vision, image processing technology has been applied in many fields. The detection of dam cracks can be achieved using traditional image processing technology. For example, edge detection algorithms are used to detect dam cracks, but these algorithms are only suitable for crack detection with large width, simple background and obvious cracks.
[0004] Therefore, it is necessary to improve the current detection algorithm and conduct in-depth research on dam crack detection. Summary of the invention
[0005] The present invention provides a dam crack detection method, device, electronic equipment and storage medium, which can improve the crack detection accuracy and can adapt to various scenarios.
[0006] According to one aspect of the present invention, a dam crack detection method is provided, the method comprising:
[0007] Acquire a crack image to be detected;
[0008] The crack image to be detected is detected using a crack detection model to obtain a crack detection result; wherein the crack detection model is composed of a regression-based target detection algorithm; the regression-based target detection algorithm includes an improved attention mechanism module and an improved feature pyramid network module; the improved attention mechanism module is composed of a global attention mechanism and a global context attention mechanism, and is used to model channel information and spatial relationships of input features; the improved feature pyramid network module is used to reduce the dimension of the extracted feature channels to a target number of channels.
[0009] According to another aspect of the present invention, a dam crack detection device is provided, the device comprising:
[0010] A crack image acquisition unit to be detected, used to acquire the crack image to be detected;
[0011] A crack detection result obtaining unit is used to detect the crack image to be detected using a crack detection model to obtain a crack detection result; wherein the crack detection model is composed of a regression-based target detection algorithm; the regression-based target detection algorithm includes an improved attention mechanism module and an improved feature pyramid network module; the improved attention mechanism module is composed of a global attention mechanism and a global context attention mechanism, and is used to model channel information and spatial relationships of input features; the improved feature pyramid network module is used to reduce the dimension of the extracted feature channels to a target number of channels.
[0012] According to another aspect of the present invention, there is provided an electronic device, the electronic device comprising:
[0013] At least one processor; and a memory in communication with the at least one processor; wherein the memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute a dam crack detection method as described in any embodiment of the present invention.
[0014] According to another aspect of the present invention, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement a dam crack detection method described in any embodiment of the present invention when executed.
[0015] The technical solution of the embodiment of the present invention obtains the crack image to be detected and then uses the crack detection model to detect the crack image to be detected to obtain the crack detection result. This technical solution can improve the crack detection accuracy and can be adapted to various scenarios.
[0016] It should be understood that the contents described in this section are not intended to identify the key or important features of the embodiments of the present invention, nor are they intended to limit the scope of the present invention. Other features of the present invention will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. 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 creative work.
[0018] Figure 1 is a flow chart of a dam crack detection method provided according to Embodiment 1 of the present invention;
[0019] Figure 2is a schematic diagram of an improved global attention mechanism module provided in Example 1 of the present application;
[0020] Figure 3 Schematic diagram of an improved feature pyramid network module provided in Example 1 of the present application;
[0021] Figure 4 A schematic diagram of a dam crack detection process provided in Embodiment 2 of the present invention;
[0022] Figure 5 A schematic diagram of the structure of a dam crack detection device provided in Embodiment 3 of the present invention;
[0023] Figure 6 It is a structural schematic diagram of an electronic device for implementing a dam crack detection method according to an embodiment of the present invention. DETAILED DESCRIPTION
[0024] In order to enable those skilled in the art to better understand the scheme of the present invention, the technical scheme 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 described embodiments 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 should fall within the scope of protection of the present invention.
[0025] It should be noted that the terms "to be trained", "to be processed", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0026] Embodiment 1
[0027] Figure 1 This is a flow chart of a dam crack detection method provided according to the first embodiment of the present invention. This embodiment is applicable to the case of detecting dam cracks based on drones. The method can be executed by a dam crack detection device, which can be implemented in the form of hardware and / or software. The dam crack detection device can be configured in a device. For example, the device can be a background server or other device with communication and computing capabilities. Figure 1As shown, the method includes:
[0028] S110, obtaining an image of a crack to be detected.
[0029] In this solution, the crack image to be detected may refer to an image containing cracks. For example, the crack image to be detected may be a dam image, a building image, etc. Preferably, the crack image to be detected is a dam image. The crack image to be detected may be photographed based on a drone. Drones are used for crack detection, and have the advantages of strong mobility, simple operation, good stability, and a variety of installation equipment.
[0030] S120. Detect the crack image to be detected using a crack detection model to obtain a crack detection result; wherein the crack detection model is composed of a regression-based target detection algorithm; the regression-based target detection algorithm includes an improved attention mechanism module and an improved feature pyramid network module; the improved attention mechanism module is composed of a global attention mechanism and a global context attention mechanism, and is used to model channel information and spatial relationships of input features; the improved feature pyramid network module is used to reduce the dimension of the extracted feature channels to a target number of channels.
[0031] In this embodiment, the crack detection model is used to detect and identify cracks in the crack image to be detected. Improving the crack detection algorithm based on the regression-based target detection algorithm to construct a crack detection model can improve the accuracy of crack detection. Among them, the regression-based target detection algorithm includes the YOLO (You Only Look Once) algorithm, the SSD (Single Shot MultiBox Detector) algorithm, etc.
[0032] Specifically, the improved global attention mechanism module and the improved feature pyramid network module are added to the regression-based target detection algorithm as the baseline to build a crack detection model. The improved global attention mechanism module can effectively extract global context information, expand the receptive field, effectively capture long-distance dependencies, and make the model more comprehensive about the relationship between objects and backgrounds; the feature pyramid network in the algorithm is replaced with an improved feature pyramid network module, which mainly introduces a gradual feature fusion strategy to gradually integrate the bottom, high and top features into the target detection process. It effectively avoids the large gap between semantic features at different levels and improves the feature fusion effect. After the algorithm is improved, the accuracy of the model is effectively improved, and it can be applied to multiple scenarios with high robustness and strong generalization ability.
[0033] Furthermore, Figure 2 is a schematic diagram of an improved global attention mechanism module provided in Example 1 of the present application, such as Figure 2As shown in Figure 1, the improved global attention mechanism module includes global attention mechanism and global context attention mechanism. The global attention mechanism improves the performance of deep neural networks by reducing information and amplifying global interaction representation. The global context attention mechanism is used to enhance the model's perception of global context information. By introducing global context information, it helps the model better understand the relationship between different objects in the image.
[0034] Optionally, the regression-based target detection algorithm includes an improved YOLOv8 model; wherein the main body of the improved YOLOv8 model is divided into an improved global attention mechanism module; and the fusion enhancement part of the improved YOLOv8 model is an improved feature pyramid network module.
[0035] In this solution, the backbone network of the YOLOv8 model is the basis of the model and is responsible for extracting features from the input image. These features are the basis for subsequent network layers to detect targets; the decision network is the decision-making part of the target detection model and is responsible for generating the final detection results; the fusion enhancement network is located between the backbone network and the decision network, and its function is to perform feature fusion and enhancement. Specifically, an improved global attention mechanism module is introduced into the backbone part of the YOLOv8 model, and an improved feature pyramid network module is introduced into the fusion enhancement part of the YOLOv8 model.
[0036] In this embodiment, in order to identify as many targets as possible in the background, thereby improving the recall rate of crack detection, the channel information and spatial relationship of the input features can be modeled through an improved global attention mechanism module, so that the receptive field covers the entire input feature. Figure 2 As shown, the improved global attention mechanism module global attention mechanism and global context attention mechanism.
[0037] Furthermore, the global attention mechanism includes channel attention and spatial attention. Channel attention is constructed by compressing the information in each channel; spatial attention constructs information in the spatial dimension by compressing the channel. Among them, attention includes a fully connected layer and an activation function. Spatial attention includes a two-dimensional convolution layer, a normalization layer, and an activation function. Among them, the global contextual attention mechanism includes spatial pooling and channel addition. Spatial pooling is a deep learning network structure used to process input images of different sizes and scales; channel addition is used to add the values of two feature maps while keeping the number of image channels unchanged. Spatial pooling includes a two-dimensional convolution layer, a tensor data sorting layer, a tensor data scaling layer, a data dimension generation layer, and a tensor multiplication layer. The tensor data sorting layer is used to reorder the tensor data; the tensor data scaling layer is used to scale each element of the tensor to the interval (0,1) and the sum is 1; the data dimension generation layer plays a role in increasing the dimension, and the parameter indicates where to add a dimension; the tensor multiplication layer is used to perform tensor multiplication operations of different dimensions. Channel addition includes a two-dimensional convolution layer, a normalization layer, and an activation function.
[0038] In this scheme, the global context information obtained by the attention extraction of the improved global attention mechanism module also helps to improve the accuracy of the detection frame positioning. By understanding the relationship between the object in the image and other objects and structures, the position and boundary of the object can be determined more accurately, thereby improving the accuracy of the detection frame. And the introduced improved global attention mechanism module improves object recognition and improves the recall rate. The global context can provide more contextual information for object category recognition. Considering the information of the entire image helps to identify the semantic context of the object, for example, in what kind of scene the object usually appears, thereby improving the accuracy of category recognition. Moreover, the global attention mechanism can better handle occlusion and complex scenes. Through the global context, the system can obtain more comprehensive image information when analyzing images, better adapt to different scenes and environments, reduce dependence on specific backgrounds or scenes, and thus better understand and identify occluded objects, improve the recall rate of the model, and make the model more robust and generalizable.
[0039] Furthermore, the fusion enhancement part of the YOLOv8 model uses a lightweight feature fusion network. In order to achieve lightweight, a channel module and a scale module that reduce the number of channels are used. Among them, the role of the channel module is to reduce the number of channels while retaining the original feature map size. Reducing the number of channels helps to reduce the computational cost and memory usage of the model, laying the foundation for the subsequent improved feature pyramid network; the scale module uses maximum pooling to obtain more scales while ensuring the same as the input feature map, retaining important semantic information, and can obtain a larger receptive field, thereby capturing larger crack features while reducing computational costs. Lower-resolution feature maps can reduce the use of computing resources.
[0040] In this embodiment, Figure 3 is a schematic diagram of an improved feature pyramid network module provided in Example 1 of the present application, such as Figure 3 As shown in the figure, the channel module contains convolutional layers and normalization layers. The function of the convolutional layer is to realize depth-separable convolution; the function of the normalization layer is to construct the normalization layer. The convolutional layer can be realized through dimension expansion operation and convolution propagation operation. The dimension expansion operation expands the dimension of the dataset image or the intermediate layer features; the convolution propagation operation is used to perform forward propagation and backward propagation of the convolution. The scale module contains the channel module and the downsampling operation, which can be realized through the dimension expansion operation and the maximum pooling operation.
[0041] Furthermore, the core module of the improved feature pyramid network still uses the target detection module of the feature pyramid network. The improved feature pyramid network reduces the dimension of all extracted feature channels to 64 layers before feature fusion. That is, the improved feature pyramid network module is used to reduce the dimension of the extracted feature channels to the target number of channels. By fusing the input of lower channels, the parameters and calculation amount of the entire feature fusion network are reduced, and the average accuracy of the model is improved. Figure 3 As shown in the figure, the target detection module includes a judgment layer, a convolution layer, a normalization layer, an activation function, upsampling, downsampling, a channel stacking layer, a two-dimensional convolution layer, and a neural network module. Among them, the judgment layer is used to judge the level; the channel stacking layer is used to increase the number of channels; the neural network module realizes feature conversion, branch processing, and feature fusion through two convolution layers and multiple Bottleneck modules.
[0042] Specifically, the object detection module provides an adaptive spatial feature fusion mechanism, which can capture rich semantic and spatial information by gradually fusing feature maps of similar scales, and merge the features extracted from the image into a feature that is more discriminative than the input feature. Among them, the object detection module does not simply add or splice feature maps of different scales, but obtains the weight of each feature map through learning, thereby achieving adaptive feature fusion. This adaptability can make the model better adapt to the feature expression requirements of different scenes and targets, and improve the generalization ability of the model. Traditional feature fusion methods (such as simple addition or splicing) may cause information loss or redundancy, especially when there are large differences between feature maps of different scales. The object detection module can better retain the important information in each feature map through an adaptive fusion mechanism, thereby improving the representation ability of the model.
[0043] The technical solution of the embodiment of the present invention obtains the crack image to be detected, and then uses the crack detection model to detect the crack image to be detected to obtain the crack detection result. By executing this technical solution, the network architecture of crack detection based on UAV is improved, and a dual attention mechanism is proposed to extract long-distance features to help the model better understand the relationship between the target and the background, thereby improving the long-distance feature relationship in the image; the AFPN is improved in the feature fusion network to make it lighter and the accuracy is improved. The model greatly improves the average accuracy while increasing the minimal amount of calculation; and it can adapt to various scenarios.
[0044] Embodiment 2
[0045] Figure 4 This is a schematic diagram of a dam crack detection process provided by the second embodiment of the present invention. The relationship between this embodiment and the above embodiment is a detailed description of the crack detection model training process. Figure 4 As shown, the method includes:
[0046] S410, obtaining an original data set of a crack detection model to be trained.
[0047] In this solution, the original data set can be composed of various crack images to be detected. Specifically, the original data set can be composed of network downloaded re-annotations, self-collected annotations, and a small number of dam crack images self-annotated.
[0048] Optionally, obtain the original data set for the crack detection model to be trained, including:
[0049] The original data set is enhanced to obtain an enhanced original data set; wherein the enhancement process includes at least one of mirroring, flipping, Gaussian blurring, cutout, brightness transformation, and cropping.
[0050] Among them, mirroring includes horizontal mirroring and vertical mirroring; flipping also includes horizontal flipping and vertical flipping; Gaussian blur refers to blurring the image by blurring the image; cutout is a random deletion of a rectangular area in the image, which can improve the generalization ability of the model; brightness transformation can refer to changing the brightness of the image; crop can specify the coordinates and size of the cropping box.
[0051] In this solution, in order to enhance the robustness of the model, the dataset is expanded nine times by adding mirroring, flipping, Gaussian noise, brightness transformation, deflection, translation, cropping, and magnification through data enhancement methods. Among them, pictures of different scenes and sizes enhance the generalization ability of the model for target detection in different scenes. As a private dataset, the dataset has good robustness and generalizability. Due to the different sizes and pixels of the dataset, the adaptive pictures are scaled to 3*640*640 and input into the model.
[0052] S420: Control the crack detection model to be trained to perform a crack detection task based on the original data set.
[0053] In this embodiment, the crack detection task is used to detect and identify cracks in the original data set. By controlling the crack detection model to be trained to perform the crack detection task through the original data set, a better crack detection effect can be achieved.
[0054] Optionally, controlling the crack detection model to be trained to perform a crack detection task based on the original data set includes:
[0055] The sample features in the original data set are input into the crack detection model to be trained to perform the crack detection task; wherein the sample features are obtained by extracting features from the crack image.
[0056] In this embodiment, feature extraction technology can be used to extract features from crack images in the original data set to obtain sample features, and then the sample features are input into the crack detection model to be trained to perform the crack detection task.
[0057] S430: According to the crack detection task, the crack detection model to be trained is adjusted to obtain a crack detection model after training and updating.
[0058] According to the crack detection task, the parameters in the crack detection model to be trained can be adjusted to obtain a crack detection model after training and updating. The parameters may include a learning rate, a loss function, and the like.
[0059] Optionally, adjusting the crack detection model to be trained according to the crack detection task includes:
[0060] Determining a loss function value corresponding to the crack detection task;
[0061] According to the loss function value, the network parameters of the crack detection model to be trained are adjusted.
[0062] In this embodiment, the loss function may be mean square error loss (mean square error loss function) or l1 loss (regression loss function).
[0063] Specifically, the sample features can be used as input, and the crack detection task can be performed through the crack detection model to be trained, so as to determine the loss function value corresponding to the crack detection task. Based on the loss function, the network parameters of the crack detection model to be trained are adjusted so that the loss function is optimized.
[0064] The technical solution of the embodiment of the present invention obtains the original data set of the crack detection model to be trained, then controls the crack detection model to be trained to perform the crack detection task based on the original data set, and adjusts the crack detection model to be trained according to the crack detection task to obtain the crack detection model after training and updating. By executing this technical solution, a crack detection model can be constructed, which greatly improves the average accuracy while increasing the minimal amount of calculation; and can adapt to various scenarios.
[0065] Specifically, the performance of the crack detection model can be verified through experiments.
[0066] The experimental settings are: Epochs: 300, patience: 20, batch: 24, workers: 12, optimizer: SGD, seed: 0, deterministic: true, lr0: 0.01, lrf: 0.001, momentum: 0.937. Epochs is an important hyperparameter in the neural network training process, defined as a single training iteration of all batches in forward and backward propagation. Patience represents the regularization parameter. In deep learning, batch refers to the number of input data required to calculate the cost once. Workers are used to define the training process of the model. Optimizer represents the optimizer. Seed is used to set the seed of the random number generator, which provides repeatability when generating random numbers. Deterministic is a way of training a model, and its main feature is to ensure that the same results are obtained each time the training is carried out under the same initial conditions. Lr0 represents the initial learning rate. Lrf represents the learning rate. Momentum optimization algorithm, which is an improvement on the gradient descent method, simulates the momentum in physics, can eliminate the direction jitter of the gradient and accelerate convergence.
[0067] The experimental equipment and environment are as follows: the network experimental environment is Ubuntu 20.04, Python 3.8 and PyTorch 2.1.2, GPU: RTX 4090 (24GB), CUDA: 11.8. The training process uses the SGD optimizer, the initial learning rate is 0.01, the momentum size is 0.937, the batch size is set to 24, the number of iterations is 300, and the early stop is set to 20 rounds.
[0068] Furthermore, the dataset consists of 948 images downloaded and re-annotated from the Internet, self-collected annotations, and a small number of self-annotated images of dam cracks.
[0069] In this scheme, in order to verify the performance of the crack detection model, prediction accuracy (mAP@50), prediction precision (mAP@50:95), and computational effort (Flops(G)) can be used for verification. Among them, the accuracy rate refers to the proportion of all the results predicted as positive samples that are correctly predicted, and the calculation formula is: Recall rate refers to the proportion of all positive samples that are correctly predicted as positive samples. The calculation formula is: AP (Average Precision) evaluates the performance of the model in the target detection task by calculating the area under the Precision-Recall curve, which reflects the average accuracy level of the model under different recall rates. The calculation formula is: p(r) represents the maximum accuracy at each recall point, and r represents the recall rate. The mAP calculation formula is: mAP = (AP1 + AP2 + ... + APc) / c; c is the number of detected categories, and mAP is the average value of the average precision when obstacles are detected.
[0070] Furthermore, the experimental results are shown in Table 1.
[0071] Table 1
[0072]
[0073] According to the experiment, the proposed DGAP-YOLO effectively improves mAP@50 by 4.9% and mAP@50:95 by 3.5% while increasing the amount of calculation very little. In addition, it is not difficult to see from the experiment that AFPN has a greater reduction in the amount of calculation compared to AFPN, and improves mAP@50 by 0.8% and mAP@50:95 by 2.2% while reducing the amount of calculation. It can be concluded that lowAFPN not only improves the accuracy but also improves the IOU accuracy of the prediction box. The proposed DGAP-YOLO is improved on the basis of YOLOv8, which improves the performance of the model as a whole and proposes a more effective detection algorithm for the field of crack detection.
[0074] Embodiment 3
[0075] Figure 5 This is a schematic diagram of the structure of a dam crack detection device provided in Embodiment 3 of the present invention. Figure 5 As shown, the device comprises:
[0076] The crack image acquisition unit 510 is used to acquire the crack image to be detected;
[0077] The crack detection result obtaining unit 520 is used to detect the crack image to be detected using a crack detection model to obtain a crack detection result; wherein the crack detection model is composed of a regression-based target detection algorithm; the regression-based target detection algorithm includes an improved attention mechanism module and an improved feature pyramid network module; the improved attention mechanism module is composed of a global attention mechanism and a global context attention mechanism, and is used to model the channel information and spatial relationship of the input features; the improved feature pyramid network module is used to reduce the dimension of the extracted feature channels to the target number of channels.
[0078] Optionally, the regression-based target detection algorithm includes an improved YOLOv8 model; wherein the backbone of the improved YOLOv8 model is divided into an improved global attention mechanism module; and the fusion enhancement part of the improved YOLOv8 model is an improved feature pyramid network module.
[0079] Optionally, the crack detection result obtaining unit 520 includes:
[0080] The original data set acquisition subunit is used to acquire the original data set of the crack detection model to be trained;
[0081] A crack detection task execution subunit, used for controlling the crack detection model to be trained to execute a crack detection task based on the original data set;
[0082] The crack detection model training subunit is used to adjust the crack detection model to be trained according to the crack detection task to obtain a crack detection model after training and updating.
[0083] Optional, the original data set acquisition subunit is used to:
[0084] The original data set is enhanced to obtain an enhanced original data set; wherein the enhancement process includes at least one of mirroring, flipping, Gaussian blurring, cutout, brightness transformation, and cropping.
[0085] Optionally, the crack detection task execution subunit is specifically used to:
[0086] The sample features in the original data set are input into the crack detection model to be trained to perform the crack detection task; wherein the sample features are obtained by extracting features from the crack image.
[0087] Optionally, a crack detection model training subunit is used to:
[0088] Determining a loss function value corresponding to the crack detection task;
[0089] According to the loss function value, the network parameters of the crack detection model to be trained are adjusted.
[0090] A dam crack detection device provided in an embodiment of the present invention can execute a dam crack detection method provided in any embodiment of the present invention, and has functional modules and beneficial effects corresponding to the execution method.
[0091] Embodiment 4
[0092] Figure 6 A schematic diagram of the structure of an electronic device 10 that can be used to implement an embodiment of the present invention is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices (such as helmets, glasses, watches, etc.) and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present invention described and / or required herein.
[0093] like Figure 6 As shown, the electronic device 10 includes at least one processor 11, and a memory connected to the at least one processor 11, such as a read-only memory (ROM) 12, a random access memory (RAM) 13, etc., wherein the memory stores a computer program that can be executed by at least one processor, and the processor 11 can perform various appropriate actions and processes according to the computer program stored in the read-only memory (ROM) 12 or the computer program loaded from the storage unit 18 to the random access memory (RAM) 13. In the RAM 13, various programs and data required for the operation of the electronic device 10 can also be stored. The processor 11, the ROM 12, and the RAM 13 are connected to each other through a bus 14. An input / output (I / O) interface 15 is also connected to the bus 14.
[0094] A number of components in the electronic device 10 are connected to the I / O interface 15, including: an input unit 16, such as a keyboard, a mouse, etc.; an output unit 17, such as various types of displays, speakers, etc.; a storage unit 18, such as a disk, an optical disk, etc.; and a communication unit 19, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 19 allows the electronic device 10 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.
[0095] The processor 11 may be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the processor 11 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, a digital signal processor (DSP), and any appropriate processor, controller, microcontroller, etc. The processor 11 executes the various methods and processes described above, such as a dam crack detection method.
[0096] In some embodiments, a dam crack detection method may be implemented as a computer program, which is tangibly contained in a computer-readable storage medium, such as a storage unit 18. In some embodiments, part or all of the computer program may be loaded and / or installed on the electronic device 10 via the ROM 12 and / or the communication unit 19. When the computer program is loaded into the RAM 13 and executed by the processor 11, one or more steps of the dam crack detection method described above may be performed. Alternatively, in other embodiments, the processor 11 may be configured to perform a dam crack detection method in any other appropriate manner (e.g., by means of firmware).
[0097] Various implementations of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various implementations can include: being implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.
[0098] Computer programs for implementing the methods of the present invention may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, so that when the computer program is executed by the processor, the functions / operations specified in the flow chart and / or block diagram are implemented. The computer program may be executed entirely on the machine, partially on the machine, partially on the machine and partially on a remote machine as a stand-alone software package, or entirely on a remote machine or server.
[0099] In the context of the present invention, a computer-readable storage medium may be a tangible medium that may contain or store a computer program for use by or in combination with an instruction execution system, device or equipment. A computer-readable storage medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices or equipment, or any suitable combination of the foregoing. Alternatively, a computer-readable storage medium may be a machine-readable signal medium. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0100] To provide interaction with a user, the systems and techniques described herein may be implemented on an electronic device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and a pointing device (e.g., a mouse or trackball) through which the user can provide input to the electronic device. Other types of devices may also be used to provide interaction with the user; for example, the feedback provided to the user may be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form (including acoustic input, voice input, or tactile input).
[0101] The systems and techniques described herein may be implemented in a computing system that includes backend components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes frontend components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such backend components, middleware components, or frontend components. The components of the system may be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), a blockchain network, and the Internet.
[0102] A computing system may include a client and a server. The client and the server are generally remote from each other and usually interact through a communication network. The client and server relationship is generated by computer programs running on the corresponding computers and having a client-server relationship with each other. The server may be a cloud server, also known as a cloud computing server or cloud host, which is a host product in the cloud computing service system to solve the defects of difficult management and weak business scalability in traditional physical hosts and VPS services.
[0103] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps described in the present invention can be executed in parallel, sequentially or in different orders, as long as the desired results of the technical solution of the present invention can be achieved, and this document does not limit this.
[0104] The above specific implementations do not constitute a limitation on the protection scope of the present invention. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.
Claims
1. A dam crack detection method, characterized in that: include: Acquire an image of a crack to be detected; The crack image to be detected is detected using a crack detection model to obtain a crack detection result; wherein the crack detection model is composed of a regression-based target detection algorithm; the regression-based target detection algorithm includes an improved attention mechanism module and an improved feature pyramid network module; the improved attention mechanism module is composed of a global attention mechanism and a global context attention mechanism, and is used to model channel information and spatial relationships of input features; the improved feature pyramid network module is used to reduce the dimension of the extracted feature channels to a target number of channels.
2. The method according to claim 1, characterized in that: The regression-based target detection algorithm includes an improved YOLOv8 model; wherein the main body of the improved YOLOv8 model is divided into an improved global attention mechanism module; and the fusion enhancement part of the improved YOLOv8 model is an improved feature pyramid network module.
3. The method according to claim 1, characterized in that The training process of the crack detection model includes: Obtaining the original data set for the crack detection model to be trained; Controlling the crack detection model to be trained to perform a crack detection task based on the original data set; According to the crack detection task, the crack detection model to be trained is adjusted to obtain a crack detection model after training and updating.
4. The method according to claim 3, characterized in that Obtain the original data set for the crack detection model to be trained, including: The original data set is enhanced to obtain an enhanced original data set; wherein the enhancement process includes at least one of mirroring, flipping, Gaussian blurring, cutout, brightness transformation, and cropping.
5. The method according to claim 3, characterized in that: Controlling the crack detection model to be trained to perform a crack detection task based on the original data set includes: The sample features in the original data set are input into the crack detection model to be trained to perform the crack detection task; wherein the sample features are obtained by extracting features from the crack image.
6. The method according to claim 3, characterized in that According to the crack detection task, the crack detection model to be trained is adjusted, including: Determining a loss function value corresponding to the crack detection task; According to the loss function value, the network parameters of the crack detection model to be trained are adjusted.
7. A dam crack detection device, characterized in that: include: A crack image acquisition unit to be detected, used to acquire the crack image to be detected; A crack detection result obtaining unit is used to detect the crack image to be detected using a crack detection model to obtain a crack detection result; wherein the crack detection model is composed of a regression-based target detection algorithm; the regression-based target detection algorithm includes an improved attention mechanism module and an improved feature pyramid network module; the improved attention mechanism module is composed of a global attention mechanism and a global context attention mechanism, and is used to model channel information and spatial relationships of input features; the improved feature pyramid network module is used to reduce the dimension of the extracted feature channels to a target number of channels.
8. The device according to claim 7, characterized in that The regression-based target detection algorithm includes an improved YOLOv8 model; wherein the main body of the improved YOLOv8 model is divided into an improved global attention mechanism module; and the fusion enhancement part of the improved YOLOv8 model is an improved feature pyramid network module.
9. An electronic device, characterized in that: The electronic device comprises: At least one processor; and a memory in communication with the at least one processor; wherein the memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute a dam crack detection method according to any one of claims 1 to 6.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement a dam crack detection method according to any one of claims 1 to 6 when executed.
Citation Information
Cited By
Lightweight concrete laminated slab crack detection method
CN119850700A
A method for detecting cracks in lightweight concrete composite slabs
CN119850700B
Abnormal sound detection method and device, equipment and storage medium
CN120089163A
Dam crack detection method based on dual-channel multi-scale attention mechanism
CN121685364A
