A method and apparatus for detecting underwater cracks in hydraulic concrete
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-04-07
- Publication Date
- 2026-08-14
AI Technical Summary
但现有技术方案仍存在诸多缺陷:部分方法依赖复杂的深度学习模型,计算量大、实时性差,难以满足水下检测的快速响应需求;部分方法未有效处理水下图像的浑浊、光照不均、遮挡等劣化问题,导致图像细节丢失,裂缝特征识别精度大幅降低;还有方法缺乏完善的裂缝定位机制,仅能实现裂缝存在性判断,无法结合空间位置信息精准定位裂缝,同时对局部遮挡、形态复杂的裂缝识别能力不足,难以适配水工混凝土水下结构的复杂检测场景
(1)本发明通过基于改进暗通道先验的水工混凝土水下图像复原算法实现了水下图像复原,有效提高了图像的清晰度进而提升了裂缝检测的精度及速度;
Smart Images

Figure CN122574346A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of safety inspection technology for hydraulic concrete structures, and in particular to a method and apparatus for detecting underwater cracks in hydraulic concrete. Background Technology
[0002] Hydraulic concrete structures such as dams, sluices, tunnels, and dikes are prone to initial cracking during the construction phase due to temperature stress, drying shrinkage, and variations in construction techniques. During long-term service, they are continuously subjected to complex environmental factors such as water erosion, alternating temperature loads, and freeze-thaw cycles, causing existing cracks to expand and new cracks to appear. These cracks compromise the structure's integrity and durability, reducing its load-bearing capacity. Underwater cracks, in particular, are difficult to detect in a timely manner due to their concealment. If left untreated for a long time, they can easily develop into penetrating cracks and form leakage channels, seriously threatening the safe operation of hydraulic structures and even leading to engineering accidents such as dam failure and leakage.
[0003] Currently, underwater crack detection in hydraulic concrete mainly relies on traditional manual methods, involving professional divers conducting on-site visual inspections or manually identifying cracks frame by frame by reviewing underwater videos recorded by divers. However, given the wide distribution, large scale, and large number of hydraulic concrete structures in my country, traditional manual inspection methods have significant drawbacks: Firstly, manual diving operations are costly, requiring specialized diving equipment and ensuring diver safety. Furthermore, divers have limited operating time and diving depth, making it difficult to cover complex and harsh environments such as deep water and high-altitude reservoirs, hindering large-scale, long-term inspections. Secondly, manual inspection is extremely inefficient, relying on visual recognition and susceptible to subjective experience, leading to missed detections and misjudgments. Moreover, the results lack precise spatial positioning information, failing to meet the accurate requirements for subsequent crack treatment.
[0004] With the development of underwater unmanned equipment, digital image processing, and artificial intelligence technologies, inspection modes based on remotely operated vehicles (ROVs) are gradually being applied to underwater structure inspection, and crack detection schemes combining deep learning algorithms and image restoration techniques are also being proposed. However, existing technical solutions still have many shortcomings: some methods rely on complex deep learning models, which involve large computational loads and poor real-time performance, making it difficult to meet the rapid response requirements of underwater inspection; some methods do not effectively handle the degradation problems of underwater images such as turbidity, uneven lighting, and occlusion, resulting in the loss of image details and a significant reduction in the accuracy of crack feature recognition; and some methods lack a complete crack localization mechanism, only able to determine the existence of cracks, unable to accurately locate cracks by combining spatial location information, and have insufficient ability to identify partially occluded and complex-shaped cracks, making them difficult to adapt to the complex inspection scenarios of underwater hydraulic concrete structures.
[0005] In summary, existing underwater crack detection technologies cannot simultaneously achieve safety, economy, accuracy, and real-time performance. There is an urgent need for an intelligent detection and location method for underwater cracks in hydraulic concrete based on unmanned inspection, image restoration, and deep learning to solve the problems of low efficiency, high cost, and insufficient accuracy of traditional detection methods and meet the actual needs of hydraulic structure safety monitoring. Summary of the Invention
[0006] The main objective of this invention is to provide a method for detecting underwater cracks in hydraulic concrete.
[0007] Another objective of this invention is to provide an underwater crack detection device for hydraulic concrete.
[0008] The third objective of this invention is to provide an electronic device.
[0009] A fourth objective of this invention is to provide a non-transitory computer-readable storage medium.
[0010] To achieve the above objectives, a first aspect of the present invention provides a method for detecting underwater cracks in hydraulic concrete, comprising:
[0011] The underwater inspection equipment is controlled to collect video images of the underwater hydraulic concrete structure according to a preset path. The collected video is extracted frame by frame to obtain clear and complete original underwater images of the hydraulic concrete, while recording the corresponding dam section and water depth information. An image restoration algorithm based on an improved dark channel prior was used to perform dynamic threshold white balance color correction and multi-interval brightness and background light estimation on the original underwater image of hydraulic concrete to eliminate the effects of underwater image degradation and obtain a clear underwater image after restoration. A hybrid dataset containing samples of concrete cracks above and below water was constructed, and the deep learning detection model was trained by transfer learning using the hybrid training dataset to obtain a crack detection model adapted to the underwater scenario of hydraulic concrete. The restored clear underwater image is input into the trained underwater crack detection model to extract and identify crack features. Combined with the recorded dam section information and water depth information, the crack location is completed, and the detection results and location information of underwater cracks in hydraulic concrete are output, thus realizing the detection and location of underwater cracks in hydraulic concrete.
[0012] Optionally, the underwater inspection equipment is controlled to acquire video images of the underwater hydraulic concrete structure according to a preset path. The acquired video images are extracted frame by frame to obtain clear and complete original underwater images of the hydraulic concrete, while simultaneously recording the corresponding dam section and water depth information, including: According to the sequence of the hydraulic structure dam sections, the underwater inspection equipment is controlled to start from the left or right bank of the dam section and perform reciprocating inspection video recording from the water surface to the bottom of the dam in a vertical direction. After completing the bidirectional image acquisition from the water surface to the dam bottom and from the dam bottom to the water surface of a single dam section, the same inspection operation is performed on subsequent dam sections in sequence until the inspection of all dam sections is completed; Image frames were extracted frame by frame from the collected inspection video, and clear, unobstructed, and motion-blurred effective frames were selected and retained as the original underwater images of the hydraulic concrete. The dam section number corresponding to each frame of the original underwater image and the water depth where the underwater inspection equipment is located are recorded synchronously to establish a one-to-one correspondence between the image and the location information.
[0013] Optional, the dynamic threshold white balance color correction process includes: The original underwater image is divided into regions, and the mean and mean absolute error of the chromaticity components of each region are calculated. Invalid regions with insignificant color changes are removed, and effective white balance reference regions are determined. Within the effective reference area, high-brightness pixels are selected as white balance reference points, and the gain coefficients of each color channel are calculated. The pixel values of each channel of the original underwater image are corrected based on the gain coefficient to eliminate color distortion caused by the underwater environment.
[0014] Optionally, the multi-range brightness background light estimation process includes: Based on the dark channel image, the pixels are divided into high brightness, medium brightness and low brightness intervals, and the pixel mean of the corresponding original image in each brightness interval is extracted to obtain multiple sets of interval background light values. A weighted average of multiple sets of background light values is calculated, and the result is used as the final background light estimate. Image restoration is achieved by using the final background light estimate in conjunction with an improved dark channel prior algorithm, which adapts to the uneven brightness of underwater images and improves the clarity and contrast of the restored underwater image.
[0015] Optionally, a hybrid dataset containing samples of concrete cracks above and below water can be constructed, including: By combining online collection, laboratory photography and on-site measurement, original images of water-surface concrete cracks in a waterless environment and original images of underwater concrete cracks in a water-containing environment were collected respectively. The acquired raw images are augmented using geometric transformations such as cropping, rotation, and flipping. In images of water cracks collected in a waterless environment, common underwater occlusion and noise interference are artificially simulated to enhance the dataset's adaptability to complex underwater scenes. The crack targets in the dataset were labeled using a labeling tool and randomly divided into training subset, validation subset and test subset according to a preset ratio.
[0016] Optional, the transfer learning training process includes: An improved RT-DETR model was adopted as the basic detection network, and the original backbone network ResNet was replaced with FasterNet to improve the model's extraction speed of underwater crack features. The original GIoU bounding box regression loss function was replaced with the DIoU loss function to optimize the matching accuracy between the predicted bounding box and the ground truth crack box. The model is pre-trained using an underwater crack dataset, and the crack feature knowledge obtained from the pre-training is transferred to the underwater crack dataset. The model parameters are then finely adjusted to adapt the model to the underwater concrete crack detection scenario, resulting in the final crack detection model.
[0017] To achieve the above objectives, a second aspect of the present invention provides an underwater crack detection device for hydraulic concrete, comprising: The image acquisition module is used to control the underwater inspection equipment to acquire video images of the underwater hydraulic concrete structure according to a preset path, extract the acquired video frame by frame to obtain clear and complete original underwater images of the hydraulic concrete, and record the corresponding dam section and water depth information at the same time. The image restoration module is used to perform dynamic threshold white balance color correction and multi-range brightness and background light estimation processing on the original underwater image of hydraulic concrete using an image restoration algorithm based on improved dark channel prior, thereby eliminating the effects of underwater image degradation and obtaining a restored clear underwater image. The model training module is used to construct a hybrid dataset containing samples of concrete cracks above and below water, and to use the hybrid training dataset to perform transfer learning training on the deep learning detection model to obtain a crack detection model adapted to the underwater scenario of hydraulic concrete. The crack detection module is used to input the restored clear underwater image into the trained underwater crack detection model to extract and identify crack features. Combined with the recorded dam section information and water depth information, it completes the crack location and outputs the detection results and location information of underwater cracks in hydraulic concrete, thus realizing the detection and location of underwater cracks in hydraulic concrete.
[0018] Regarding the apparatus in the above embodiments, the specific manner in which each module performs its operation has been described in detail in the embodiments related to the method, and will not be elaborated upon here.
[0019] To achieve the above objectives, a third aspect of this application provides an electronic device, including a processor and a memory; wherein the processor reads executable program code stored in the memory to run a program corresponding to the executable program code, for implementing a method for detecting underwater cracks in hydraulic concrete as described in the first aspect embodiment.
[0020] To achieve the above objectives, a fourth aspect of this application provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements a method for detecting underwater cracks in hydraulic concrete as described in the first aspect embodiment.
[0021] The embodiments of the present invention have the following beneficial effects: (1) This invention realizes underwater image restoration by using an improved dark channel prior algorithm for underwater hydraulic concrete, which effectively improves the image clarity and thus enhances the accuracy and speed of crack detection. (2) This invention utilizes the FasterNet network, which has faster feature extraction capabilities and extraction speed, and the DIoU loss function, which can accurately identify the positional relationship between the predicted box and the real box and makes the model more convergent, to improve the RT-DETR detection model and apply the improved model to identify underwater cracks. Compared with the existing technology, it can significantly improve the detection speed and accuracy and realize real-time detection. (3) This invention makes full use of the similarity between surface cracks and underwater cracks, expands the underwater crack dataset using surface cracks, effectively increases the number of datasets, and improves the efficiency of model training by using a model training method based on transfer learning strategy, thereby significantly improving the accuracy of underwater crack detection. (4) In the process of constructing the dataset, the present invention innovatively introduces leaf interference to simulate the situation where underwater cracks are partially blocked by weeds or suspended objects. This method effectively improves the robustness of the model and enables the detection algorithm to effectively detect partially blocked underwater cracks. Attached Figure Description
[0022] The above and / or additional aspects and advantages of the present invention will become apparent and readily understood from the following description of the embodiments taken in conjunction with the accompanying drawings, wherein: Figure 1 A flowchart of a method for detecting underwater cracks in hydraulic concrete provided in an embodiment of the present invention; Figure 2 Comparison of underwater image restoration effects of hydraulic concrete provided in embodiments of the present invention; Figure 3 The graph shows the change in pre-training loss of the underwater crack detection model for hydraulic concrete provided in this embodiment of the invention. Figure 4 The graph shows the change in training loss during transfer learning for the underwater crack detection model of hydraulic concrete provided in this embodiment of the invention. Figure 5 This is a schematic diagram illustrating the underwater crack detection effect of hydraulic concrete according to an embodiment of the present invention. Figure 6 A graph showing the variation of precision and recall of the underwater crack detection model for hydraulic concrete provided in an embodiment of the present invention. Figure 7 The average accuracy variation curve of the underwater crack detection model for hydraulic concrete provided in this embodiment of the invention; Figure 8 This is a schematic diagram comparing the performance indicators of different detection models provided in the embodiments of the present invention; Figure 9 This is a structural diagram of an underwater crack detection device for hydraulic concrete provided in an embodiment of the present invention. Detailed Implementation
[0023] It should be noted that, unless otherwise specified, the embodiments and features described in the present invention can be combined with each other. The present invention will now be described in detail with reference to the accompanying drawings and embodiments.
[0024] To enable those skilled in the art to better understand the present invention, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings of the embodiments of the present invention. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort should fall within the scope of protection of the present invention.
[0025] The following description, with reference to the accompanying drawings, describes a method and apparatus for detecting underwater cracks in hydraulic concrete according to an embodiment of the present invention.
[0026] Example 1 This invention provides a method for detecting underwater cracks in hydraulic concrete. Figure 1 This is a schematic flowchart illustrating a method for detecting underwater cracks in hydraulic concrete according to an embodiment of the present invention. Figure 1 As shown, the method includes the following steps: Step S1: Control the underwater inspection equipment to collect video images of the underwater hydraulic concrete structure according to the preset path, extract the video frame by frame to obtain clear and complete original underwater images of the hydraulic concrete, and record the corresponding dam section and water depth information.
[0027] In this embodiment of the application, step S1 is first executed. By controlling the underwater inspection equipment to carry out comprehensive and continuous video image acquisition of the underwater hydraulic concrete structure according to the pre-planned inspection path, after the video acquisition is completed, the acquired video data is processed frame by frame to extract images and filter out clear, complete original underwater images that can truly reflect the state of the hydraulic concrete structure. In addition, the dam section information and water depth information corresponding to each frame of image are recorded simultaneously during the acquisition and extraction process.
[0028] The underwater inspection equipment used in this application is an underwater robot. Its inspection path is uniformly planned and set according to the distribution sequence of the dam sections of the hydraulic structure. In the actual inspection process, the underwater robot is controlled to start from the first dam section on the left or right bank and perform reciprocating inspection and recording from the water surface to the bottom of the dam in a vertical direction. First, it completes the one-way underwater video acquisition from the water surface to the bottom of the dam, and then returns from the bottom of the dam to the water surface to complete the reverse video acquisition, thereby realizing the complete two-way image acquisition of a single dam section.
[0029] After the image acquisition of a single dam section is completed, the underwater robot will perform the same inspection and image acquisition operations on each subsequent dam section in the same manner, following the same inspection method and acquisition specifications, until the underwater image acquisition task of all dam sections is completed.
[0030] In this embodiment of the application, for the collected inspection video, a frame-by-frame extraction method is used to obtain continuous image frames, and all extracted image frames are judged and filtered for quality. Invalid image frames with motion blur, suspended object occlusion, excessively dark or bright images, and unclear structural features are removed, and only valid frames with clear images, complete features, and no obvious interference are retained as the original underwater images used for subsequent processing.
[0031] While performing image acquisition and frame extraction, this embodiment of the application uses the positioning and sensing module built into the underwater robot to simultaneously record the dam section number corresponding to each frame of the original underwater image and the real-time water depth data of the underwater robot, establishing a one-to-one correspondence between the original underwater image and spatial location information, thereby providing reliable data support for the subsequent accurate positioning and location marking of underwater cracks.
[0032] Step S2: Using an image restoration algorithm based on an improved dark channel prior, the original underwater image of the hydraulic concrete is sequentially subjected to dynamic threshold white balance color correction and multi-range brightness and background light estimation to eliminate the effects of underwater image degradation and obtain a restored clear underwater image.
[0033] In this embodiment, after image acquisition and preprocessing in step S1, step S2 is executed. This embodiment employs an underwater image restoration algorithm based on an improved dark channel prior. The original underwater image obtained in step S1 is sequentially subjected to dynamic threshold white balance color correction and multi-range brightness and background light estimation processing to eliminate image degradation caused by the underwater environment, ultimately obtaining a restored underwater image with high clarity and accurate color.
[0034] In this application, the improved dark channel prior algorithm is the core of underwater image restoration, and its core calculation formula is as follows:
[0035] in, This indicates a clear underwater image after restoration. This refers to the original, degraded image directly captured by an underwater camera. Indicates atmospheric background light. This represents the transmittance of the medium, used to characterize the percentage of target irradiance that reaches the imaging device after underwater attenuation. The parameter ω is used to correct for the transmittance. , This is a preset transmittance threshold. The embodiments of this application use the above formula to perform the sharpening and restoration calculation of underwater images, effectively improving the visual effect and feature recognition of underwater images.
[0036] In this embodiment, dynamic threshold white balance color correction is used to eliminate color distortion and color cast in underwater images. The specific implementation process is as follows: First, the original underwater image is uniformly divided into several regions of equal size, and the chromaticity components in each region are calculated. and chromaticity components mean and The corresponding calculation formula is:
[0037]
[0038] in , Representing pixels The chromaticity component value corresponding to the location, where N represents the total number of pixels contained in the current calculation area.
[0039] After obtaining the mean values of the chromaticity components for each region, the chromaticity components for each region are calculated separately. With chromaticity components Mean absolute error and The corresponding calculation formula is: , .
[0040] In this embodiment of the application, if a certain area and If the values are all too small, it indicates that the color change in this area is not obvious and has no white balance reference value. Therefore, this area is removed and is no longer used as a white balance reference area, thereby reducing the amount of invalid calculations and improving the efficiency of white balance processing.
[0041] After removing invalid regions, the embodiments of this application determine the final effective white balance reference region according to the following formula: , .
[0042] Then, the top 10% of pixels in terms of brightness within the candidate reference area are selected as white balance reference points. Subsequently, the gain coefficients for the three RGB color channels are calculated using the following formula:
[0043]
[0044]
[0045] in, , , These are the gain values for the red, green, and blue channels, respectively. This represents the maximum brightness of the entire image. , , These are the pixel averages of the white balance reference point across the three channels.
[0046] After obtaining the gain coefficients for each channel, this embodiment of the application corrects the pixel values of each channel of the original underwater image using the following calculation formula:
[0047]
[0048]
[0049] in, , , These represent the pixel values of the red, green, and blue channels after white balance correction, thus completing the color correction process for the underwater image.
[0050] In this embodiment, multi-interval brightness background light estimation is used to solve the problem of uneven brightness distribution in underwater images. The specific implementation process is as follows: A corresponding dark channel image is generated based on the original underwater image. It is divided into three intervals according to pixel brightness: high brightness, medium brightness, and low brightness. The pixel mean values of the original image corresponding to the brightest 1%, middle 0.5%, and darkest 0.1% pixels in the dark channel image are extracted respectively, resulting in three sets of background light values. , , The corresponding calculation formula is:
[0051]
[0052]
[0053] in, , , These represent the pixel values in the original image corresponding to the top 1%, middle 0.5%, and darkest 0.1% pixels in the dark channel image, respectively. , , These represent the number of pixels corresponding to the top 1%, middle 0.5%, and darkest 0.1% of pixels in the dark channel image, respectively.
[0054] In this embodiment, the three sets of background light values are averaged to obtain the final estimated background light value. The calculation formula is as follows: This calculation method fully considers the contribution of different brightness ranges (high, medium, and low) to the background light, making it more suitable for the uneven brightness characteristics of underwater images.
[0055] After estimating the background light, this embodiment combines an improved dark channel prior algorithm to calculate transmittance and restore the overall underwater image, significantly improving the detail clarity, contrast, and color accuracy of the restored underwater image. Figure 2 The image shown is a reconstruction effect diagram of an underwater image of hydraulic concrete provided in an embodiment of this application. The image compares and illustrates four typical types of deteriorated underwater images and their reconstruction effects, specifically including: Figure 2 (a) in the image is a degraded image due to uneven illumination. Figure 2 (b) in the image is a degraded image due to occlusion by suspended objects. Figure 2 (c) in the image is a blurred and degraded image, and Figure 2(d) in the figure represents a degraded image with low contrast. As can be seen from the figure, compared with the original degraded image, the image restored by the method of this application has significant effects in terms of illumination compensation, dehazing, deblurring, and color correction. The crack outline and structural details in the underwater scene can be completely and clearly presented, effectively solving the problems of uneven brightness, loss of details, and color distortion in traditional underwater images. This provides high-quality, stable, and reliable image foundation data for subsequent automated detection of cracks in hydraulic concrete based on images.
[0056] Step S3: Construct a hybrid dataset containing samples of concrete cracks above water and underwater concrete cracks, and use the hybrid training dataset to perform transfer learning training on the deep learning detection model to obtain a crack detection model adapted to underwater hydraulic concrete scenarios.
[0057] In this embodiment, after completing the underwater image restoration process in step S2, step S3 is executed. This embodiment first constructs a hybrid dataset containing samples of concrete cracks above and below water, then uses this hybrid dataset to train a deep learning detection model through transfer learning, ultimately obtaining a dedicated crack detection model that is highly adaptable to complex underwater scenarios involving hydraulic concrete.
[0058] In this application, the construction of the hybrid dataset adopts a multi-source data acquisition approach, specifically including collection from publicly available internet resources, photography of standard laboratory scenes, and on-site measurements of actual hydraulic concrete projects. Sufficient and representative images of above-water concrete cracks and original images of underwater concrete cracks are obtained through these three methods. To further enhance the scale and diversity of the dataset, this application's embodiments perform data augmentation processing on the acquired original images, specifically employing conventional geometric transformation operations such as cropping, rotation, and flipping. This increases the number of samples without altering the crack characteristics, effectively improving the generalization ability and detection stability of subsequent models.
[0059] To make the dataset more closely resemble real underwater conditions and improve the model's robustness to detection under complex interference, this embodiment of the application artificially simulates the area around the crack region when constructing the underwater crack image dataset. This involves intentionally adding interference factors such as suspended debris occlusion, impurities, and random noise to simulate common underwater occlusion and complex background conditions, allowing the model to learn anti-interference features during the training phase. All image samples are processed using annotation tools. Professional personnel accurately select and classify crack targets in the images, ensuring the accuracy and consistency of sample annotation. After completing all image annotations, this embodiment of the application randomly divides the entire dataset into a training subset, a validation subset, and a test subset in a 7:2:1 ratio. These three subsets respectively handle model training, process validation, and final performance testing, ensuring the standardization of the model training and evaluation process.
[0060] In this embodiment, the deep learning detection model used is an improved and optimized RT-DETR model, which incorporates two key improvements compared to the basic model. The first improvement is the backbone network replacement: the ResNet network used in the original RT-DETR model is replaced with the FasterNet network, which offers faster feature extraction and higher computational efficiency. This significantly improves the model's extraction speed for subtle underwater crack features and its overall inference efficiency, making it more suitable for real-time underwater detection scenarios. The second improvement is the optimization of the loss function. The original RT-DETR model uses the GIoU loss function in the bounding box regression task. This function cannot accurately distinguish relative positional relationships when the predicted bounding box is inside the ground truth bounding box, and it is prone to situations where the same loss value corresponds to different positional relationships, leading to difficulties in model convergence. To overcome these shortcomings, this embodiment uses the DIoU loss function instead of the GIoU loss function, and its calculation formula is as follows:
[0061] In this formula, IoU represents the ratio of the intersection to the union of the predicted bounding box and the ground truth bounding box. This represents the Euclidean distance between the center points of the predicted bounding box and the ground truth bounding box. This represents the diagonal length of the smallest bounding rectangle formed by the ground truth bounding box and the predicted bounding box. This formula allows for a more accurate characterization of the positional differences between the predicted and ground truth bounding boxes, accelerating model convergence and improving the regression accuracy of crack detection boxes.
[0062] This application employs a transfer learning training strategy to train the model, effectively addressing the issues of insufficient underwater crack image samples and the risk of overfitting during direct training. Since there are ample surface crack image samples, and surface and underwater cracks share a high degree of similarity in their essential features, this application first pre-trains the improved RT-DETR model using a large-scale surface crack dataset. This allows the model to fully learn the general morphological, textural, and structural features of concrete cracks. After pre-training, the effective feature knowledge learned during the pre-training phase is transferred to a small sample underwater crack dataset. The model parameters are then fine-tuned to allow the model to quickly adapt to unique underwater scenarios such as lighting, turbidity, and background interference, ultimately resulting in an optimized model suitable for detecting underwater cracks in hydraulic concrete.
[0063] like Figure 3As shown, the solid black line represents the training set bounding box regression loss (train / box_loss), the solid red line represents the validation set bounding box regression loss (val / box_loss), the dashed black line represents the training set classification loss (train / cls_loss), and the dashed red line represents the validation set classification loss (val / cls_loss). In the initial training phase, all losses are at high levels, and the curves fluctuate dramatically, reflecting a significant deviation in the model's judgment of bounding box positions and categories before learning effective crack features. As the training iterations increase, the losses decrease rapidly, and the model continuously optimizes its parameters to adapt to the crack detection task. After a certain number of iterations, the rate of loss decrease gradually slows, the curves flatten, and eventually the model enters a stable convergence state, exhibiting a typical convergence characteristic of "rapid decrease – gradual stabilization," indicating that the model has essentially learned the general features of cracks.
[0064] like Figure 4 As shown, the initial values of each loss are significantly lower than those in the pre-training stage, and the curves exhibit smaller fluctuations and smoother declines. During the iteration process, the loss converges rapidly to a lower level and enters the stable stage earlier, demonstrating superior convergence speed and stability compared to the pre-training process.
[0065] What is clear is that, in comparison Figure 3 and Figure 4 During the transfer learning training phase, the initial loss was lower and the rate of decrease was faster. Furthermore, the difference between the validation set loss and the training set loss was smaller, and no significant overfitting fluctuations were observed. This fully demonstrates that by reusing pre-trained features from the surface crack dataset through transfer learning, the model can capture effective features more quickly on small-sample underwater crack datasets. This effectively alleviates training fluctuations and overfitting problems caused by insufficient sample size, significantly improving the training efficiency, generalization ability, and practical application reliability of the underwater crack detection model.
[0066] Step S4: Input the restored clear underwater image into the trained underwater crack detection model to extract and identify crack features. Combine the recorded dam section information and water depth information to locate the crack and output the detection results and location information of the underwater crack in the hydraulic concrete, thus realizing the detection and location of underwater cracks in the hydraulic concrete.
[0067] In this embodiment, after completing the model construction and transfer learning training in step S3, step S4 is executed. In this embodiment, the restored clear underwater image obtained in step S2 is input into the already trained underwater crack detection model. The model automatically performs crack feature extraction and target recognition. Combined with the dam section information and water depth information recorded synchronously in step S1, the detected cracks are accurately located. Finally, the complete detection results and location information of underwater cracks in hydraulic concrete are output, thereby achieving efficient detection and accurate location of underwater cracks in hydraulic concrete.
[0068] In this embodiment, the specific detection process is as follows: the clear underwater image restored by the improved dark channel prior algorithm in step S2 is input into the improved RT-DETR detection model trained in step S3. After receiving the image, the model automatically extracts the concrete structure features in the image, focusing on identifying key features related to cracks such as texture, contour, and direction, completing target classification and bounding box regression, and finally achieving accurate bounding box selection and labeling of crack targets.
[0069] This model can not only reliably identify obvious, continuous cracks in images, but also accurately identify narrow, short, localized, and minute cracks. It is also effectively resistant to interference from the underwater environment, reliably identifying hidden cracks under complex conditions such as obstruction by suspended objects and interference from the edges of detection equipment. It outputs complete and detailed detection information, including the location, length, and direction of the crack. After crack identification, this embodiment accurately correlates and matches the detection results output by the model with the dam section number and real-time water depth data of the underwater robot recorded in step S1, establishing a one-to-one correspondence between the image detection results and the actual engineering location, thus quickly completing the spatial localization of underwater cracks. This localization method eliminates the need for manual on-site inspection and additional auxiliary measuring equipment, significantly improving the efficiency and engineering practicality of underwater crack localization.
[0070] Verification using various real-world underwater images clearly demonstrates that the proposed method maintains stable and reliable recognition capabilities and positioning accuracy even in complex and variable underwater environments. Related detection results are shown below. Figure 5 As shown, even under various adverse conditions such as interference from detection equipment, obstruction by suspended matter in the water, and uneven light distribution, the model can still accurately locate the crack area and completely restore the true shape of the crack, fully demonstrating its strong anti-interference ability, robustness, and good environmental adaptability.
[0071] To further quantify the detection performance of the model in this application, changes in key evaluation metrics were recorded simultaneously during model training. Precision and recall directly reflect the model's accuracy and completeness of identification, and their trends are shown below. Figure 6As shown, with the increase in the number of training iterations, precision and recall gradually improve and quickly stabilize, indicating that the model continuously optimizes its feature judgment ability during the learning process, effectively reducing the probability of false positives and false negatives. The mean precision is the core indicator for measuring the overall accuracy of the object detection model, and it more comprehensively reflects the model's overall performance in underwater crack detection tasks. The change process of this indicator is shown in the figure below. Figure 7 As shown, after sufficient iterative training, the model's mAP0.5 value steadily converged to 0.92, indicating that the model in this application has a high-precision detection capability for underwater cracks in hydraulic concrete.
[0072] To more objectively demonstrate the technical advantages of this application, the improved RT-DETR model is compared with commonly used existing DETR models and Faster R-CNN models in multiple dimensions. The comparison results are as follows: Figure 8 As shown, Figure 8 The chart compares the average accuracy (mAP0.5), floating-point operations (GFLOPs), and frame rate (FPS) of the underwater crack detection model, DETR model, and Faster R-CNN model provided in the embodiments of this application. The results show that the model in this application significantly outperforms the traditional model in mAP0.5, while also having lower floating-point operations and less computational resource consumption. It achieves a frame rate of 43 FPS, meeting the engineering requirements for real-time detection. Considering accuracy, speed, and computational cost, the model in this application outperforms existing conventional detection methods and is more suitable for efficient, real-time, and accurate detection of underwater cracks in hydraulic concrete.
[0073] Example 2 This invention provides an underwater crack detection device for hydraulic concrete. Figure 9 This is a schematic flowchart of an underwater crack detection device for hydraulic concrete provided in an embodiment of the present invention. Figure 9 As shown, the device includes: The image acquisition module 100 is used to control the underwater inspection equipment to acquire video images of the underwater hydraulic concrete structure according to a preset path, extract the acquired video frame by frame to obtain clear and complete original underwater images of the hydraulic concrete, and record the corresponding dam section and water depth information at the same time. The image restoration module 200 is used to perform dynamic threshold white balance color correction and multi-range brightness and background light estimation processing on the original underwater image of hydraulic concrete using an image restoration algorithm based on improved dark channel prior, thereby eliminating the effects of underwater image degradation and obtaining a restored clear underwater image. The model training module 300 is used to construct a hybrid dataset containing samples of concrete cracks above water and underwater concrete cracks, and to use the hybrid training dataset to perform transfer learning training on the deep learning detection model to obtain a crack detection model adapted to the underwater scenario of hydraulic concrete. The crack detection module 400 is used to input the restored clear underwater image into the trained underwater crack detection model to extract and identify crack features. It combines the recorded dam section information and water depth information to locate the crack and output the detection results and location information of underwater cracks in hydraulic concrete, thus realizing the detection and location of underwater cracks in hydraulic concrete.
[0074] Regarding the apparatus in the above embodiments, the specific manner in which each module performs its operation has been described in detail in the embodiments related to the method, and will not be elaborated upon here.
[0075] Example 3 To implement the methods of the above embodiments, the present invention also provides an electronic device, which includes a memory and a processor; wherein the processor reads executable program code stored in the memory to run a program corresponding to the executable program code, so as to implement the various steps of the methods described above.
[0076] Example 4 To implement the above embodiments, this application also proposes a non-transitory computer-readable storage medium storing a computer program thereon, which, when executed by a processor, implements the method described in the foregoing embodiments.
[0077] The above description is merely a preferred embodiment of the present invention and is not intended to limit the invention. Various modifications and variations can be made to the present invention by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the scope of protection of the present invention.
[0078] In the description of this specification, the references to terms such as "one embodiment," "some embodiments," "example," "specific example," or "some examples," etc., indicate that a specific feature, structure, material, or characteristic described in connection with that embodiment or example is included in at least one embodiment or example of the present invention. In this specification, the illustrative expressions of the above terms do not necessarily refer to the same embodiment or example. Furthermore, the specific features, structures, materials, or characteristics described may be combined in any suitable manner in one or more embodiments or examples. Moreover, without contradiction, those skilled in the art can combine and integrate the different embodiments or examples described in this specification, as well as the features of different embodiments or examples.
[0079] Furthermore, the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include at least one of that feature. In the description of this invention, "a plurality of" means at least two, such as two, three, etc., unless otherwise explicitly specified.
Claims
1. A method for detecting underwater cracks in hydraulic concrete, characterized in that, include: The underwater inspection equipment is controlled to collect video images of the underwater hydraulic concrete structure according to a preset path. The collected video is extracted frame by frame to obtain clear and complete original underwater images of the hydraulic concrete, while recording the corresponding dam section and water depth information. An image restoration algorithm based on an improved dark channel prior was used to perform dynamic threshold white balance color correction and multi-interval brightness and background light estimation on the original underwater image of hydraulic concrete to eliminate the effects of underwater image degradation and obtain a clear underwater image after restoration. A hybrid dataset containing samples of concrete cracks above and below water was constructed, and the deep learning detection model was trained by transfer learning using the hybrid training dataset to obtain a crack detection model adapted to the underwater scenario of hydraulic concrete. The restored clear underwater image is input into the trained underwater crack detection model to extract and identify crack features. Combined with the recorded dam section information and water depth information, the crack location is completed, and the detection results and location information of underwater cracks in hydraulic concrete are output, thus realizing the detection and location of underwater cracks in hydraulic concrete.
2. The method according to claim 1, characterized in that, The underwater inspection equipment is controlled to acquire video images of the underwater hydraulic concrete structure according to a preset path. Frame by frame of the acquired video is extracted to obtain clear and complete original underwater images of the hydraulic concrete, while simultaneously recording the corresponding dam section and water depth information, including: According to the sequence of the hydraulic structure dam sections, the underwater inspection equipment is controlled to start from the left or right bank of the dam section and perform reciprocating inspection video recording from the water surface to the bottom of the dam in a vertical direction. After completing the bidirectional image acquisition from the water surface to the dam bottom and from the dam bottom to the water surface of a single dam section, the same inspection operation is performed on subsequent dam sections in sequence until the inspection of all dam sections is completed; Image frames were extracted frame by frame from the collected inspection video, and clear, unobstructed, and motion-blurred effective frames were selected and retained as the original underwater images of the hydraulic concrete. The dam section number corresponding to each frame of the original underwater image and the water depth where the underwater inspection equipment is located are recorded synchronously to establish a one-to-one correspondence between the image and the location information.
3. The method according to claim 2, characterized in that, The process of dynamic threshold white balance color correction includes: The original underwater image is divided into regions, and the mean and mean absolute error of the chromaticity components of each region are calculated. Invalid regions with insignificant color changes are removed, and effective white balance reference regions are determined. Within the effective reference area, high-brightness pixels are selected as white balance reference points, and the gain coefficients of each color channel are calculated. The pixel values of each channel of the original underwater image are corrected based on the gain coefficient to eliminate color distortion caused by the underwater environment.
4. The method according to claim 3, characterized in that, The process of multi-range brightness background light estimation includes: Based on the dark channel image, the pixels are divided into high brightness, medium brightness and low brightness intervals, and the pixel mean of the corresponding original image in each brightness interval is extracted to obtain multiple sets of interval background light values. A weighted average of multiple sets of background light values is calculated, and the result is used as the final background light estimate. Image restoration is achieved by using the final background light estimate in conjunction with an improved dark channel prior algorithm, which adapts to the uneven brightness of underwater images and improves the clarity and contrast of the restored underwater image.
5. The method according to claim 4, characterized in that, Construct a hybrid dataset containing samples of concrete cracks above and below water, including: By combining online collection, laboratory photography and on-site measurement, original images of water-surface concrete cracks in a waterless environment and original images of underwater concrete cracks in a water-containing environment were collected respectively. The acquired raw images are augmented using geometric transformations such as cropping, rotation, and flipping. In images of water cracks collected in a waterless environment, common underwater occlusion and noise interference are artificially simulated to enhance the dataset's adaptability to complex underwater scenes. The crack targets in the dataset were labeled using a labeling tool and randomly divided into training subset, validation subset and test subset according to a preset ratio.
6. The method according to claim 5, characterized in that, The transfer learning training process includes: An improved RT-DETR model was adopted as the basic detection network, and the original backbone network ResNet was replaced with FasterNet to improve the model's extraction speed of underwater crack features. The original GIoU bounding box regression loss function was replaced with the DIoU loss function to optimize the matching accuracy between the predicted bounding box and the ground truth crack box. The model is pre-trained using an underwater crack dataset, and the crack feature knowledge obtained from the pre-training is transferred to the underwater crack dataset. The model parameters are then finely adjusted to adapt the model to the underwater concrete crack detection scenario, resulting in the final crack detection model.
7. A device for detecting underwater cracks in hydraulic concrete, characterized in that, include: The image acquisition module is used to control the underwater inspection equipment to acquire video images of the underwater hydraulic concrete structure according to a preset path, extract the acquired video frame by frame to obtain clear and complete original underwater images of the hydraulic concrete, and record the corresponding dam section and water depth information at the same time. The image restoration module is used to perform dynamic threshold white balance color correction and multi-range brightness and background light estimation processing on the original underwater image of hydraulic concrete using an image restoration algorithm based on improved dark channel prior, thereby eliminating the effects of underwater image degradation and obtaining a restored clear underwater image. The model training module is used to construct a hybrid dataset containing samples of concrete cracks above and below water, and to use the hybrid training dataset to perform transfer learning training on the deep learning detection model to obtain a crack detection model adapted to the underwater scenario of hydraulic concrete. The crack detection module is used to input the restored clear underwater image into the trained underwater crack detection model to extract and identify crack features. Combined with the recorded dam section information and water depth information, it completes the crack location and outputs the detection results and location information of underwater cracks in hydraulic concrete, thus realizing the detection and location of underwater cracks in hydraulic concrete.
8. The apparatus according to claim 7, characterized in that, The image acquisition module is also used for: According to the sequence of the hydraulic structure dam sections, the underwater inspection equipment is controlled to start from the left or right bank of the dam section and perform reciprocating inspection video recording from the water surface to the bottom of the dam in a vertical direction. After completing the bidirectional image acquisition from the water surface to the dam bottom and from the dam bottom to the water surface of a single dam section, the same inspection operation is performed on subsequent dam sections in sequence until the inspection of all dam sections is completed; Image frames were extracted frame by frame from the collected inspection video, and clear, unobstructed, and motion-blurred effective frames were selected and retained as the original underwater images of the hydraulic concrete. The dam section number corresponding to each frame of the original underwater image and the water depth where the underwater inspection equipment is located are recorded synchronously to establish a one-to-one correspondence between the image and the location information.
9. An electronic device, characterized in that, Including processor and memory; The processor reads executable program code stored in the memory to run a program corresponding to the executable program code, so as to implement the method as described in any one of claims 1-6.
10. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that, When the program is executed by the processor, it implements the method as described in any one of claims 1-6.