An underwater dam crack image generation optimization and intelligent detection method

CN122928844APending Publication Date: 2026-10-16WUHAN UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611236673.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-08-14
Publication Date
2026-10-16

AI Technical Summary

Technical Problem

一是水下光照衰减、散射、浑浊水体、坝面附着物和水流扰动共同作用,导致现场采集图像存在低对比度、模糊、遮挡和颜色偏移;

Benefits of technology

本发明,通过构建包含小型大坝模型实验图像、现场大坝ROV检测图像及开源裂缝图像的水下大坝裂缝多源多场景训练数据集,并对水深、浊度、光照、附着物遮挡程度、裂缝形态类别、图像域及尺度进行统一标注,使训练数据同时覆盖可控模型试验场景和真实水下工程场景,能够缓解水下大坝裂缝标注样本不足、场景分布单一的问题,提高DCSM-GAN模型对不同水深、浑浊度、光照条件及附着物遮挡环境的适应能力和泛化能力。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122928844A_ABST
    Figure CN122928844A_ABST
Patent Text Reader

Abstract

The present application relates to the technical field of intelligent detection of surface diseases of hydraulic structures, and specifically relates to a method for generating and intelligently detecting underwater dam crack images, comprising the following steps: S1, collecting models, field ROVs and open-source crack images, and constructing a training set after processing and labeling; S2, constructing a DCSM-GAN model embedded with DSA and introducing LPIPS to generate underwater crack images; S3, performing crack segmentation and connection optimization; S4, constructing a scale mapping, estimating crack size and evaluating the effect; and S5, using image equipment to complete cleaning, shooting, processing and transmission. The present application realizes high-fidelity generation of underwater crack images, continuous segmentation of cracks, accurate evaluation of actual size and closed-loop on-site monitoring, and improves the accuracy, generalization ability and engineering applicability of underwater dam crack detection.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of intelligent detection technology for surface defects of hydraulic structures in water conservancy projects, and in particular to a method for generating, optimizing, and intelligently detecting underwater dam crack images. Background Technology

[0002] As a crucial water conservancy infrastructure, the structural safety of dams is directly related to the safety of life and property in the surrounding areas. Underwater cracks, a common dam defect, are subject to the combined effects of water pressure, seepage, freeze-thaw cycles, scouring, and structural stress. They can gradually expand and induce secondary risks such as leakage, piping, or localized damage. Therefore, timely, accurate, and quantifiable detection of underwater cracks is necessary.

[0003] Existing deep learning-based underwater crack detection technologies heavily rely on high-quality labeled datasets, but still face the following bottlenecks in underwater dam scenarios: First, the combined effects of underwater light attenuation and scattering, turbid water, dam surface attachments, and water flow disturbance result in low contrast, blurriness, occlusion, and color shift in the images collected on site. Second, the cost of on-site testing in the underwater area of ​​the dam is high, the working window is limited, and some projects have data acquisition restrictions, making it difficult to obtain large-scale labeled samples covering different water depths, different crack morphologies, and different environmental conditions. Third, while existing image generation models can perform general image style transfer, they are prone to problems in underwater dam crack scenarios, such as blurred crack edges, missmoothing of fracture structures, confusion between the texture of attachments and crack textures, and insufficient expression of color and scattering features under different water depths. This makes it difficult for generated samples to meet the accuracy requirements for crack detection model training and engineering size assessment. Existing methods usually only focus on image appearance similarity and lack joint design for crack elongated structure, topological continuity, scale estimability, and underwater equipment acquisition processes. Summary of the Invention

[0004] This invention provides a method for generating, optimizing, and intelligently detecting underwater dam crack images. By constructing multi-source, multi-scene datasets, using a deep-sensing crack structure preservation and measurement-guided generation network, perceptual similarity constraints, crack morphology connection optimization, scale calibration estimation, and collaboration with underwater monitoring devices, it achieves high-fidelity generation, continuous segmentation, and physical size evaluation of underwater crack images, providing reliable data and equipment support for underwater crack detection model training and engineering inspection.

[0005] A method for generating, optimizing, and intelligently detecting underwater dam crack images includes the following steps: S1. Acquire experimental images of a small dam model, on-site dam ROV detection images, and open-source crack images. Perform unified preprocessing on the experimental images of the small dam model, on-site dam ROV detection images, and open-source crack images, and perform annotation on water depth, turbidity, illumination, degree of attachment occlusion, crack morphology category, image domain, and scale to construct a multi-source, multi-scene training dataset for underwater dam cracks. S2. Based on the multi-source, multi-scenario training dataset of underwater dam cracks, a deep-sensing crack structure preservation and measurement-guided generative adversarial network (DCSM-GAN) model is constructed. The DCSM-GAN model is based on the CycleGAN bidirectional domain mapping framework. A deep-sensitive aggregation DSA module is embedded in the generator feature extraction and fusion stage. Visual perception similarity loss function (LPIPS) and crack structure preservation constraints are introduced on the basis of adversarial loss and cycle consistency loss to generate underwater crack images. S3. Based on the underwater crack image, crack segmentation is performed, and morphological connection optimization processing based on connected components, skeleton endpoints and orientation consistency is applied to the crack segmentation result to obtain a continuous, slender crack segmentation result with complete topological relationships. S4. Using the reference calibration objects set up on site, a scale mapping relationship between pixel coordinates, underwater imaging depth and real physical coordinates is constructed. The crack width, crack length and average scale parameters in the crack segmentation result are compensated and estimated. The image generation optimization effect is comprehensively evaluated by combining the similarity of generated images, segmentation continuity and size error. The S5 uses specialized underwater imaging monitoring equipment to perform flexible cleaning, stable shooting, image preprocessing, edge computing, and monitoring data transmission in cracked areas.

[0006] Optionally, S1 includes: S11. Construct a small concrete dam model with precast cracks of different widths, directions, bifurcations, and discontinuous forms. Build an artificial pool around the small concrete dam model with adjustable water depth, turbidity, illuminance, and attachment coverage. By adjusting the water depth level, suspended particle concentration, incident light angle, and attachment density, imaging conditions under different water depths, turbidity, illuminance, and attachment obstruction are formed. Use a remotely operated vehicle (ROV) to collect experimental images of the small dam model. S12. The actual dam construction site was selected as the data collection area. Remotely operated underwater vehicles (ROVs) were used to take underwater photos along the dam surface in sections, at fixed distances and from multiple angles. The data collection depth, attitude, lighting conditions, shooting distance and crack location were recorded simultaneously to obtain on-site dam ROV inspection images. S13. Select concrete crack images from the open-source crack dataset to obtain open-source crack images. Perform resolution normalization and color space correction on the experimental images of the small dam model, the ROV detection images of the on-site dam, and the open-source crack images. Then, perform annotation on water depth, turbidity, illumination, degree of attachment occlusion, crack morphology category, image domain, and scale to obtain the training dataset.

[0007] Optionally, S2 includes: S21, a DCSM-GAN model is constructed based on the training dataset. The DCSM-GAN model includes a first generator, a second generator, a target domain discriminator, and a source domain discriminator. The first generator is used to convert the experimental images of the small dam model and the open-source crack images into underwater-style images. The second generator is used to backmap the underwater-style images to the corresponding experimental images of the small dam model or the open-source crack images. The target domain discriminator is used to determine the authenticity between the generated images and the ROV detection images of the dam. The source domain discriminator is used to determine the consistency between the backmapped images and the experimental images of the small dam model and the open-source crack images. The DCSM-GAN model is trained by combining adversarial loss, cycle consistency loss, identity preservation loss, LPIPS perception loss, and crack edge structure loss to obtain an initial generation model. S22, Based on the initial generation model, a depth-sensitive aggregation (DSA) module is embedded in the encoding feature layer and decoding fusion layer of the first generator and the second generator. The DSA module includes a self-attention feature selection unit, a reflection-filled multi-scale depth separation convolution (RMSDC) unit, and a feature weight adaptive calibration (FWAC) unit. The self-attention feature selection unit is used to enhance the response of key texture features of cracks. The reflection-filled multi-scale depth separation convolution (RMSDC) unit is used to perform reflection filling and multi-scale depth separation convolution processing on features of different scales. The feature weight adaptive calibration (FWAC) unit is used to perform weight calibration and fusion on features of different scales to obtain fused features. The initial generation model is then updated using the fused features to obtain a DCSM-GAN model with the embedded DSA module. S23. Based on the DCSM-GAN model with embedded DSA module, a visual perception similarity loss function (LPIPS) is introduced. The generated image and the on-site dam ROV detection image are input into a pre-trained deep neural network to extract multi-layer perception features. Normalization processing, layer-by-layer difference calculation and weighted perception distance calculation are performed on the perception features of each layer to obtain the LPIPS perception loss. The DCSM-GAN model is optimized together with the adversarial loss, cycle consistency loss, identity preservation loss and crack edge structure loss to obtain the DCSM-GAN model used to generate underwater crack images.

[0008] Optionally, S22 includes: S221, based on the initial generation model, a depth-sensitive aggregation (DSA) module is embedded in the encoding feature layer and decoding fusion layer of the first and second generators to obtain the feature sequence output by the intermediate layer of the generator. The feature sequence is then linearly transformed by the self-attention feature filtering unit in the DSA module to generate a query matrix, a key matrix, and a value matrix. The attention weights between different feature elements are calculated based on the scaling dot product similarity between the query matrix and the key matrix to distinguish the feature responses corresponding to crack edges, attachment occlusion, and underwater scattering noise, thereby obtaining crack key texture enhancement features. S222, the key texture enhancement features of the crack are input into the reflection-filled multi-scale depth separation convolution (RMSDC) unit, and the input feature map is expanded by reflection-filled size of one pixel, two pixels and three pixels respectively to generate the first expanded feature map, the second expanded feature map and the third expanded feature map, so as to reduce the boundary filling artifacts of the underwater image and retain the boundary features corresponding to the crack fine lines, wide crack edges and attachment shadows. S223, the first extended feature map, the second extended feature map, and the third extended feature map are processed in parallel using depth separation convolution with different receptive fields. Specifically, the first extended feature map is processed by a 3x3 convolution, the second extended feature map is processed by a 5x5 convolution, and the third extended feature map is processed by a 3x3 convolution to obtain the first multi-scale feature, the second multi-scale feature, and the third multi-scale feature, so as to extract the fine crack edges and wide crack textures at different scales. S224, the first multi-scale feature, the second multi-scale feature and the third multi-scale feature are input into the feature weight adaptive calibration (FWAC) unit, and the weights of each multi-scale feature are calibrated according to the channel response intensity and spatial saliency. The original structural information is preserved through residual connection to obtain the first calibration feature, the second calibration feature and the third calibration feature. S225, the first calibration feature, the second calibration feature and the third calibration feature are concatenated along the channel dimension, and the dimension is compressed by one-to-one convolution. The compressed feature is then summed element-wise with the third calibration feature to obtain a fused feature that combines underwater environment texture and crack structure details. The initial generation model is updated using the fused feature to obtain a DCSM-GAN model with embedded DSA module.

[0009] Optionally, S23 includes: S231, Based on the DCSM-GAN model with embedded DSA module, a visual perception similarity loss function (LPIPS) is introduced. The generated image and the on-site dam ROV detection image are input into a pre-trained deep neural network to extract the corresponding multi-layer perception features respectively. The perception features of each layer are normalized to eliminate the scale difference between different feature layers, so as to obtain the normalized perception features of the generated image and the normalized perception features of the on-site dam ROV detection image. S232, perform layer-by-layer difference calculation on the normalized perception features of the generated image and the normalized perception features of the on-site dam ROV detection image to determine the feature differences between the generated image and the on-site dam ROV detection image at each feature layer, and obtain the perception feature differences at each layer. S233, according to the learning weights corresponding to each feature layer, the differences in the perceptual features of each layer are summed by weight to obtain the weighted perceptual distance between the generated image and the on-site dam ROV detection image, and the weighted perceptual distance is used as the LPIPS perceptual loss to evaluate the perceptual similarity between the generated image and the on-site dam ROV detection image in terms of underwater color, crack edge texture and local structure. S234, the LPIPS perception loss is combined with adversarial loss, cycle consistency loss, identity preservation loss and crack edge structure loss, and the DCSM-GAN model with embedded DSA module is optimized by the combined loss to obtain the DCSM-GAN model for generating underwater crack images.

[0010] Optionally, S3 includes: S31, based on the underwater crack image, dark line enhancement and interference removal filtering are performed to obtain an enhanced underwater crack image. Crack segmentation is then performed based on the enhanced underwater crack image to obtain a binary crack segmentation result where crack pixels are marked as 1 and background regions are marked as 0. Connected component clustering analysis is used to label the connected components of the binary crack segmentation result. Crack pixels with the same label value are identified as the same connected crack segment. A noise filtering threshold is set according to the image resolution, crack candidate region area distribution, and local signal-to-noise ratio of the underwater image. Connected regions that are below the noise filtering threshold and do not meet the elongated shape constraint are identified as invalid noise and removed to obtain valid crack segments. S32, the effective crack segment is skeletonized. The Zhang-Suen iterative thinning algorithm is used to extract the single-pixel wide crack skeleton, and the main direction, endpoint position and bifurcation point information of the effective crack segment are retained. The eight-neighbor pixel statistics are performed on each skeleton point in the single-pixel wide crack skeleton. The skeleton point with only one adjacent crack pixel in the eight-neighbor domain is determined as the endpoint. The endpoints are collected to form an endpoint set, and the connected component number and local tangent direction of each endpoint are recorded. S33, Based on the set of endpoints, construct an endpoint attribution determination model, calculate the spatial distance and directional fit between different endpoints respectively, and combine the connected domain attributes and local curvature constraints of the endpoints to determine whether different endpoints belong to the two ends of the same crack. The spatial distance threshold and directional fit threshold are adjusted according to the crack width, image scale and length of the connected domain where the endpoint is located, and the endpoints to be connected that meet the requirements of spatial distance and directional fit are selected. S34, for the endpoints to be connected, construct linear structural elements according to the connection direction between the endpoints, use the directional constraint pixel dilation method to directionally expand and connect the endpoints to be connected, and repeatedly execute the endpoint attribution determination and directional expansion fusion until no new crack connection relationship is generated, so as to obtain a continuous, slender and topologically complete crack segmentation result.

[0011] Optionally, S4 includes: S41, a rectangular scale calibration plate with known physical dimensions is set up in the dam monitoring area as the reference calibration object. The corner points or edge contours of the rectangular scale calibration plate are identified in the acquired images. Based on the reference edge with known actual length in the rectangular scale calibration plate, a scale mapping relationship between image pixel coordinates, underwater imaging depth and real physical coordinates is established to provide a scale reference for estimating crack width, crack length and crack area in the crack segmentation results. S42, based on the scale mapping relationship, combined with camera imaging parameters, determine the underwater imaging depth of the plane where the crack is located, and extract multiple feature sampling points along the crack segmentation results. Calculate the local physical width corresponding to each feature sampling point through depth compensation, and determine the average actual width of the crack, the maximum width of the crack, the length of the crack, and the area of ​​the crack. S43, the underwater crack image is sequentially input into the crack segmentation and size estimation process to obtain the crack segmentation result and crack size estimation result. The similarity of the generated image is evaluated by the visual perception similarity loss function and structural similarity. The segmentation continuity is evaluated by the endpoint misconnection rate, the broken segment recovery rate and the integrity of the connected component. The size error is evaluated by the average width error, the maximum width error and the length error. The similarity of the generated image, the segmentation continuity and the size error are jointly evaluated to obtain a comprehensive evaluation result of the image generation optimization effect.

[0012] Optionally, S42 includes: S421, Based on the scale mapping relationship, combined with the camera intrinsic parameters, the pinhole imaging geometric model, the pixel length of the rectangular scale calibration plate and the camera shooting tilt angle, the underwater imaging depth of the plane where the crack is located is solved. S422, extract multiple feature sampling points at equal intervals along the crack edge in the crack segmentation result, determine the unit normal vector of each feature sampling point according to the crack edge gradient field and local skeleton direction, and search the boundary points on both sides of the crack along the unit normal vector, and obtain the local physical width of each feature sampling point through depth compensation and normal width conversion. S423, outlier values ​​are removed and averaged for each local physical width to obtain the average actual width of the crack, and the maximum width, length and area of ​​the crack are determined.

[0013] Optionally, S5 includes: S51 is equipped with dedicated underwater image monitoring equipment. The dedicated underwater image monitoring equipment includes an underwater visual monitoring terminal with infrared night vision and binocular high-definition imaging functions. It has a built-in replaceable rechargeable battery pack and is equipped with a sealed cabin, attitude stabilization structure and waterproof data interface. The dedicated underwater image monitoring equipment is used to complete flexible cleaning, stable shooting and underwater crack image acquisition in the crack area to meet the continuous monitoring needs under low light, turbid water and close-range inspection conditions of the dam surface. S52, using the embedded processing module built into the dedicated underwater image monitoring equipment, the acquired underwater crack images are sequentially processed by clarity filtering, image preprocessing, crack feature extraction, crack segmentation, crack size calculation, and time and location binding. The underwater crack images, crack masks, crack size parameters, and environmental tags are then transmitted to the user terminal or engineering monitoring center via a microprocessor. At the same time, dual storage units are used to perform cyclic storage of monitoring data and automatic overwriting of expired data, so as to achieve stable storage and efficient transmission of monitoring data.

[0014] The beneficial effects of this invention are: This invention constructs a multi-source, multi-scene training dataset for underwater dam cracks, including experimental images of small dam models, ROV detection images of on-site dams, and open-source crack images. It also provides unified annotations for water depth, turbidity, illumination, degree of obstruction by deposits, crack morphology, image domain, and scale. This allows the training data to simultaneously cover both controllable model experimental scenarios and real underwater engineering scenarios, alleviating the problems of insufficient labeled samples and limited scene distribution for underwater dam cracks. Furthermore, it improves the adaptability and generalization ability of the DCSM-GAN model to different water depths, turbidity, illumination conditions, and environments with obstruction by deposits.

[0015] This invention, by embedding a depth-sensitive aggregation DSA module into the CycleGAN bidirectional domain mapping framework, combines self-attention feature selection, reflection-filled multi-scale depth separation convolution, and adaptive feature weight calibration. Furthermore, it optimizes the DCSM-GAN model using adversarial loss, cycle consistency loss, identity preservation loss, LPIPS perceptual loss, and crack edge structure loss. This enhances the feature response of crack edges, fine textures, and locally dark areas, reducing edge blurring and structural distortion caused by underwater scattering, low illumination, and attachment occlusion. The resulting underwater crack images are closer to the ROV detection images of the dam site in terms of underwater color style, crack direction, width, discontinuous connectivity, and local texture, thus improving the accuracy of subsequent crack detection and segmentation.

[0016] This invention, by implementing connected component filtering, skeleton endpoint identification, endpoint attribution determination, and directional constraint pixel dilation on the crack segmentation results, can restore the topological connection relationship between fracture crack segments, obtaining continuous, slender crack segmentation results with complete topological relationships. Furthermore, by combining scale mapping relationships, underwater imaging depth, feature sampling points, and depth compensation, the average actual width, maximum width, length, and area of ​​the crack are calculated. Dedicated underwater image monitoring equipment is used to complete flexible cleaning, stable imaging, image preprocessing, edge calculation, data storage, and monitoring data transmission in the crack area. This forms a closed-loop technical solution that connects underwater crack image generation optimization, crack segmentation, size estimation, and on-site monitoring, improving the accuracy, continuity, and engineering applicability of underwater dam crack monitoring. Attached Figure Description

[0017] To more clearly illustrate the technical solutions in this invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only for this invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0018] Figure 1 This is a schematic diagram of the generation optimization and intelligent detection method according to an embodiment of the present invention; Figure 2 This is a schematic diagram of the overall structure of the underwater robot according to an embodiment of the present invention; Figure 3 This is a schematic diagram of the exploded structure of an underwater robot according to an embodiment of the present invention; Figure 4 This is a schematic diagram of a dam surface inspection application scenario according to an embodiment of the present invention; Figure 5 This is a schematic diagram showing the structural details of the cleaning brush module according to an embodiment of the present invention; Figure 6This is a schematic diagram of the crack physical size measurement and comprehensive evaluation process according to an embodiment of the present invention. Detailed Implementation

[0019] The present invention will now be described in detail with reference to the accompanying drawings and specific embodiments. Those skilled in the art may employ other alternative methods to implement some well-known technologies; moreover, the accompanying drawings are only for more specific description of the embodiments and are not intended to specifically limit the present invention.

[0020] like Figure 1-6 As shown, a method for generating, optimizing, and intelligently detecting underwater dam crack images includes the following steps: S1. Construct a multi-source, multi-scene dataset of underwater dam cracks. Perform unified preprocessing, domain labeling, and scale labeling on experimental images of small dam models, ROV detection images of on-site dams, and open-source crack images, including water depth, turbidity, illumination, degree of occlusion by attachments, and crack morphology category, to obtain the training dataset. S2. Construct a deep-perception crack structure preservation and measurement-guided generative adversarial network (DCSM-GAN) model. The model is based on the CycleGAN bidirectional domain mapping framework. A deep-sensitive aggregation (DSA) module is embedded in the generator feature extraction and fusion stage. Visual perception similarity loss function (LPIPS) and crack structure preservation constraint are introduced on the basis of adversarial loss and cycle consistency loss. S3. Morphological connection optimization processing based on connected components, skeleton endpoints and orientation consistency is applied to the deep learning crack segmentation results to obtain continuous, slender crack segmentation results with complete topological relationships. S4 uses on-site reference calibration objects to construct the scale mapping relationship between pixel coordinates, underwater imaging depth and real physical coordinates, to compensate and estimate crack width, length and average scale parameters, and to comprehensively evaluate the generation optimization effect by combining the similarity of generated images, segmentation continuity and size error. The S5 uses specialized underwater imaging monitoring equipment to perform flexible cleaning, stable shooting, image preprocessing, edge computing, and monitoring data transmission in the cracked area, enabling accurate acquisition and closed-loop transmission of information on underwater dam cracks.

[0021] S1 constructs a multi-source crack image dataset, including data collected from small dam model experiments, on-site dam ROV detection data, and supplementary data from open-source databases. After preprocessing and classification labeling, a training dataset is obtained. The specific steps are as follows: S11: A small-scale concrete dam model with precast cracks of various widths, directions, bifurcations, and discontinuous patterns was constructed. An artificial pool with adjustable water depth, turbidity, illuminance, and deposit coverage was built around the model. By changing the water depth, suspended particle concentration, incident light angle, and deposit density, different imaging conditions were created, including shallow water, medium water depth, deep water, and areas with occlusion interference. Underwater crack images were then acquired using a remotely operated vehicle (ROV). S12, select the actual dam project site as the data collection object, deploy remotely operated vehicles (ROVs) to carry out zonal, fixed-distance and multi-angle underwater underwater photography along the dam surface, and simultaneously record the collection depth, attitude, lighting conditions, shooting distance and crack location to form a real underwater crack target domain sample; S13 selects concrete crack images from the open-source crack dataset as supplementary source domain samples, and performs resolution normalization, color space correction, crack mask annotation, and underwater style domain labeling to complete them, so that samples from different sources can participate in domain transfer learning in the same training process.

[0022] In S2, a DCSM-GAN model is constructed. This model is based on the CycleGAN architecture and introduces a Deep Sensitive Aggregation (DSA) module and a Visual Perception Similarity Loss Function (LPIPS). The specific steps are as follows: S21, DCSM-GAN includes the first generator G Second generator F Target domain discriminator D Y Source domain discriminator D X The first generator G Used to extract source domain crack images X Convert to underwater target domain crack image Y Second generator F Used to target domain image Y Backmap to source domain X ; Maintaining consistency in crack geometry before and after underwater style migration through bidirectional mapping; Target domain discriminator D Y Used to determine whether the input image comes from a real underwater target area or from the first generator. G Generation, source domain discriminator D X Used to determine whether the input image comes from the real source domain or is generated by the second generator. F Generate; on this basis, jointly calculate adversarial loss, cycle consistency loss, identity preservation loss, LPIPS perception loss and crack edge structure loss to constrain the generated image to simultaneously satisfy the underwater environment realism and crack morphology fidelity.

[0023] S22, a depth-sensitive aggregation (DSA) module is introduced into the coding feature layer and decoding fusion layer of the generator to adaptively enhance crack edges, fine textures and local dark areas according to differences in underwater imaging depth and feature level. The DSA module includes a self-attention feature selection unit and a reflection-filled multi-scale depthwise separation convolution (RMSDC) unit. It also performs multi-scale information recalibration through a feature weight adaptive calibration (FWAC) unit. The self-attention unit, used to select key crack feature weights, utilizes the feature sequence output from the generator's intermediate layers. X =[ x 1 , x 2 ,…,x n ] as input, where x ᵢ ∈ R ᵈ Indicates the first i Feature vectors aggregated from spatial locations or channels d The feature dimension is used to perform a linear transformation on the input feature X, generating a query. Q ), key K ) and value (Value, V )matrix: ; ; ; in, W Q , W K , W V All are learnable weight matrices, used to project input features onto the query, key, and value spaces, respectively. d k This represents the dimension of the projected feature space; through this projection relationship, the model can distinguish the feature responses corresponding to crack edges, attachment obstruction, and underwater scattering noise.

[0024] Subsequently, the correlation between elements is calculated by scaling the dot product similarity: ; The scaling factor is used to stabilize the gradient and suppress anomalous responses during training; then, the weight relationships between different feature elements are calculated using Softmax normalization, and the normalization result is as follows: ; in,a ij For the first i The feature is related to the first j The attention weights of each feature satisfy the normalization constraint, thereby ensuring that the crack key texture obtains a higher response during feature fusion.

[0025] Reflection-filled multi-scale depth separation convolution (RMSDC) unit: This unit integrates reflection edge filling with multi-scale depth separation convolution to reduce boundary filling artifacts in underwater images, and performs secondary filtering and depth fusion from local to global for crack lines, wide crack edges and attachment shadows.

[0026] First, the input feature map F∈R ^(H×W×C) ( H For height, W For width, C (For the number of channels) Perform reflection padding: pad the feature map in both the height and width directions. q 1 pixel, generate output feature map G∈R^ ((H+2q)×(W+2q)×C) Output feature map G any pixel G(i,j,c) The value of is determined by the input feature map. F The pixel corresponding to the reflection position determines the mapping relationship as follows: ; Three different fill sizes are used (specifically: q=1 Pixels q=2 Pixels and q=3 (pixels), generated separately G 1. G 2 and G 3. The mathematical expression for this process is: ; For the extended feature map mentioned above, feature extraction and fusion are completed through a three-step process: The first step is to G 1 , G 2 , G 3 Parallel processing using depthwise separation convolutions with differentiated receptive fields is employed, where... G 1 Generated by 3×3 convolution G 13 , G 2 Generated by 5×5 convolution G 25 , G 3Generated by another set of 3×3 convolutions G 33 To accommodate both the edges of fine cracks and the texture of wider cracks; The second step is to G 13 , G 25 , G 33 Input feature weight adaptive calibration (FWAC) unit, dynamically adjust the feature weights at each scale based on channel response intensity and spatial saliency, and generate G 13 '、 G 25 '、 G 33 ', and retain the original structural information through residual connections respectively; The third step employs a two-stage fusion strategy: first, calibrated multi-scale features are spliced ​​along the channel dimension and their dimensions are compressed using 1×1 convolution; then, they are fused with... G 33 'By summing each element, we obtain a fusion feature that combines the texture of the underwater environment with the details of the crack structure.'

[0027] S23, the LPIPS perceptual loss function is introduced to constrain the high-level semantic and local texture similarity between the generated image and the real underwater crack image. The calculation of the LPIPS perceptual loss includes the following steps: Feature extraction and normalization: This process generates the image. x and the real target domain image y Input a pre-trained deep neural network to extract multi-layer perceptual features; the network's first... i The feature maps of the layers are respectively represented as Φᵢ ( x )and Φᵢ ( y This process eliminates scale differences between different feature layers through normalization, ensuring that underwater color shift, crack edge texture, and local contrast are constrained within the same metric framework. The mathematical expression for this process is: ; ; Where ||.|| represents the calculation of the spatial dimension of the feature map. L 2 Norm; Layer-by-layer difference calculation: For each layer, calculate the difference between the two images in the feature space: ; in, d i (x,y) Representative image xWith images y In the network i Layer characteristic differences; C i , H i , W i They represent the first i The number of channels, height, and width of the layer feature map; Weighted perceptual distance: Finally, the LPIPS method determines the final perceptual distance between two images by weighted summation of feature differences across multiple levels. ; in, wᵢ Representing the i The learning weights of the layers are used to reflect the importance of the layer's features in the perceptual similarity assessment. In DCSM-GAN training, the smaller the perceptual distance, the closer the generated image is to the real underwater crack image in terms of overall style, crack edge texture, and local structure, thus making the generated samples more suitable as training data for subsequent crack detection and segmentation models.

[0028] In S3, morphological connectivity optimization is performed on the deep learning crack segmentation results to achieve a complete representation and segmentation of the crack morphology. The specific steps are as follows: S31, Enhanced Hidden Lines: The underwater crack image was converted to grayscale to obtain a grayscale image. ,in, Represents the pixel coordinates of the image; Establish a local neighborhood centered on the current pixel, calculate the local average gray value, and represent it as follows: ; in, For the current pixel's neighborhood, This represents the number of pixels in the neighborhood. The dark lines of the crack are enhanced based on the difference between the local average gray level and the current gray level, as shown below: ; in, Enhance the image for dark lines; The grayscale of the crack area is usually lower than that of the surrounding background. Therefore, after dark line enhancement, the crack area has a larger response value, thereby improving the recognizability of weak cracks, fine cracks and low-contrast cracks. S32, interference removal filter: To reduce interference from underwater suspended particles, reflective areas, and deposited textures on crack identification, median filtering is applied to the dark line enhancement image, as shown below: ; in, This is the filtered image; S33, Crack segmentation, connected region clustering labeling, and noise filtering: The filtered and enhanced image is input into a deep learning crack segmentation model to obtain a binary crack segmentation result where crack pixels are labeled as 1 and background regions are labeled as 0. A connected component clustering analysis method is used to label the connected components of the binary crack segmentation result. An area threshold is adaptively set based on image resolution, average crack width, and local noise density to filter out isolated noise caused by underwater suspended matter, reflections, and the edges of attached materials. The specific formula is as follows: ; in,( x,y Let be the clustering label matrix, where the same label value corresponds to the same connected fracture segment. Define the first... k The crack segment is as follows: ; The noise filtering threshold is dynamically set based on the image resolution, the area distribution of the candidate crack region, and the local signal-to-noise ratio of the underwater image. Connected regions that are below the threshold and do not meet the elongated shape constraint are determined to be invalid noise and are removed to obtain valid crack segments.

[0029] S34, Crack skeleton extraction and endpoint identification: The selected valid crack segments are subjected to skeletonization processing. A single-pixel wide skeleton is obtained based on the Zhang-Suen iterative thinning algorithm, and the main direction, endpoint positions and bifurcation point information of the crack segments are preserved. The specific formula is as follows: ; For any skeleton point p'=xy in the skeleton set S', the endpoint is identified by statistical analysis of the 8-neighbor pixels. The endpoint is a skeleton point that contains only one adjacent crack pixel in its 8-neighborhood. The specific formula is as follows: ; The endpoint determination condition is that the number of adjacent crack pixels in the 8-neighborhood is equal to 1. All endpoints that meet the condition are integrated into an endpoint set, and the connected component number and local tangent direction of each endpoint are recorded.

[0030] S35, Endpoint Attribution Determination Model Construction: An endpoint attribution model is constructed, incorporating spatial spacing, directional fit, connectivity properties, and local curvature constraints, to determine whether different endpoints belong to the two ends of the same crack. The specific formula is as follows: 1. Spatial spacing calculation: ; 2. Directional fit calculation: ; 3. Criteria for determining ownership: ; in, t i , t j Endpoints e i , e j tangent direction vector, T d , T φ These are the spatial spacing threshold and the orientation fit threshold, respectively. The thresholds are adaptively adjusted based on the crack width, image scale, and the length of the connected component where the endpoints are located, in order to avoid incorrectly connecting adjacent crack segments that are not aligned in the same direction.

[0031] S34, pixel inflation: The directional constraint pixel dilation method is used to perform directional connections on endpoints that meet the belonging conditions. The specific steps are as follows: 1. Constructing linear structuring elements: ; 2. Pixel dilation: ; Repeat the endpoint attribution determination in S33 and the directional expansion fusion operation in this step until no new crack connection relationships are generated, to obtain a crack morphology segmentation result that is topologically continuous, noise-suppressed, and can be used for size estimation.

[0032] In S4, a scale mapping relationship is constructed by setting up reference calibration objects on site to estimate the actual physical size of the crack. The generation optimization effect is evaluated by combining the similarity of the generated images, the continuity of the crack morphology, and the size estimation error. The specific steps are as follows: S41, Establishment of coordinate system mapping relationship: A rectangular scale calibration plate with known physical dimensions is deployed in the dam monitoring area. The calibration plate contains at least one line with a known actual length. L ref The reference edge is determined, and its corner points or edge contours are identified in the acquired image to establish the image pixel coordinate system. u’ , v’ ) and the real physical coordinate system X’ , Y’ , Z’ The mapping relationship provides a scale benchmark for estimating crack width, length, and area.

[0033] S42, Size estimation based on monocular vision ranging: Based on a monocular vision ranging mechanism, the depth parameter Z' of the plane containing the crack is solved by combining camera intrinsic parameters, pinhole imaging geometric model, calibration plate pixel length, and shooting tilt angle. N feature sampling points are extracted at equal intervals along the crack edge, and depth compensation and normal width conversion are performed on each sampling point to calculate the actual width of the crack. The specific formula is as follows: Coordinate system transformation relationships: ; in, K cam For the camera intrinsic parameter matrix, R rot Let be a rotation matrix. t trans It is a translation vector.

[0034] Crack depth calculation: ; in, f cam For camera focal length, L phy To calibrate the actual length of the plate, L pix To calibrate the pixel length, The camera is tilted at the desired angle.

[0035] Feature point normal vector and local width calculation: Extract N feature sampling points along the crack edge p ’i =( u ’i , v ’i The unit normal vector is calculated based on the gradient field at the crack edge and the local skeleton direction. ; Search for the boundary points on both sides of the crack along the normal vector direction, and solve for the local physical width using the depth compensation formula: ; Average width estimation: After removing outliers from N local width values, the average value is taken to obtain the average actual width of the crack. Further engineering evaluation parameters such as maximum width, length, and area can be output. ; S43, Comprehensive evaluation of measurement results: The DCSM-GAN-generated image is input into the crack segmentation and size estimation process, and the generated image similarity index, crack topological continuity index, and width, length, and area estimation errors are jointly evaluated. Among them, the generated image similarity index includes LPIPS and structural similarity, the crack topological continuity index includes endpoint misconnection rate, fracture segment recovery rate, and connected component integrity, and the size estimation error includes average width error, maximum width error, and length error, so as to form an integrated evaluation result of generation quality, segmentation quality, and measurement accuracy for engineering applications.

[0036] In S5, a customized visual monitoring terminal is used to collect and preprocess information on cracks on the dam surface, achieving efficient and accurate transmission of monitoring data. The specific steps are as follows: S5.1, Visual Monitoring Terminal Configuration and Battery Life Guarantee: The device employs an underwater visual monitoring terminal with infrared night vision and binocular high-definition imaging capabilities. It has a built-in replaceable rechargeable battery pack with a full charge capacity of 2580mAh, and is equipped with a sealed chamber, attitude stabilization structure, and waterproof data interface. The terminal can continuously monitor for no less than 30 hours under low light, turbid water, and close-range shooting conditions on the dam surface, meeting the needs of underwater inspection in the field.

[0037] S52, data processing, transmission and storage mechanism: The visual monitoring terminal collects images of the dam panel, which are then processed by the built-in embedded processing module to perform clarity filtering, crack feature extraction, morphological segmentation, size calculation, and time and location binding. The microprocessor then sends the images, crack masks, size parameters, and environmental tags to the designated user terminal or engineering monitoring center. The embedded processing module is equipped with dual storage units, supporting cyclic overwriting of 30 days of continuous monitoring data and automatically discarding the oldest outdated data to ensure the integrity, traceability, and storage stability of the monitoring data.

[0038] This invention encompasses any substitutions, modifications, equivalent methods, and solutions made within the spirit and scope of this invention. To provide the public with a thorough understanding of this invention, specific details are described in detail in the following preferred embodiments; however, those skilled in the art will fully understand the invention even without these details. Furthermore, to avoid unnecessary misunderstanding of the essence of this invention, well-known methods, processes, procedures, components, and circuits are not described in detail.

[0039] The above description is only a preferred embodiment of the present invention. It should be noted that for those skilled in the art, several improvements and modifications can be made without departing from the principle of the present invention, and these improvements and modifications should also be considered within the scope of protection of the present invention.

Claims

1. A method for generating, optimizing, and intelligently detecting underwater dam crack images, characterized in that, Includes the following steps: S1. Acquire experimental images of a small dam model, on-site dam ROV detection images, and open-source crack images. Perform unified preprocessing on the experimental images of the small dam model, on-site dam ROV detection images, and open-source crack images, and perform annotation on water depth, turbidity, illumination, degree of attachment occlusion, crack morphology category, image domain, and scale to construct a multi-source, multi-scene training dataset for underwater dam cracks. S2. Based on the multi-source, multi-scene training dataset of underwater dam cracks, a deep-sensing crack structure preservation and measurement-guided generative adversarial network (DCSM-GAN) model is constructed. The DCSM-GAN model is based on the CycleGAN bidirectional domain mapping framework. A deep-sensitive aggregation DSA module is embedded in the generator feature extraction and fusion stage. Visual perception similarity loss function and crack structure preservation constraint are introduced on the basis of adversarial loss and cycle consistency loss to generate underwater crack images. S3. Based on the underwater crack image, crack segmentation is performed, and morphological connection optimization processing based on connected components, skeleton endpoints and orientation consistency is applied to the crack segmentation result to obtain a continuous, slender crack segmentation result with complete topological relationships. S4. Using the reference calibration objects set up on site, a scale mapping relationship between pixel coordinates, underwater imaging depth and real physical coordinates is constructed. The crack width, crack length and average scale parameters in the crack segmentation result are compensated and estimated. The image generation optimization effect is comprehensively evaluated by combining the similarity of generated images, segmentation continuity and size error. The S5 uses specialized underwater imaging monitoring equipment to perform flexible cleaning, stable shooting, image preprocessing, edge computing, and monitoring data transmission in cracked areas.

2. The method for generating, optimizing, and intelligently detecting underwater dam crack images according to claim 1, characterized in that, S1 includes: S11. Construct a small concrete dam model with precast cracks of different widths, directions, bifurcations, and discontinuous forms. Build an artificial pool around the small concrete dam model with adjustable water depth, turbidity, illuminance, and attachment coverage. By adjusting the water depth level, suspended particle concentration, incident light angle, and attachment density, imaging conditions under different water depths, turbidity, illuminance, and attachment obstruction are formed. A remotely operated underwater vehicle is used to collect experimental images of the small dam model. S12, the actual dam construction site was selected as the data collection area. A remotely operated vehicle (ROV) was used to take underwater photos along the dam surface in sections, at fixed distances and from multiple angles. The data collection depth, attitude, lighting conditions, shooting distance and crack location were recorded simultaneously to obtain on-site dam ROV inspection images. S13. Select concrete crack images from the open-source crack dataset to obtain open-source crack images. Perform resolution normalization and color space correction on the experimental images of the small dam model, the ROV detection images of the on-site dam, and the open-source crack images. Then, perform annotation on water depth, turbidity, illumination, degree of attachment occlusion, crack morphology category, image domain, and scale to obtain the training dataset.

3. The method for generating, optimizing, and intelligently detecting underwater dam crack images according to claim 2, characterized in that, S2 includes: S21, a DCSM-GAN model is constructed based on the training dataset. The DCSM-GAN model includes a first generator, a second generator, a target domain discriminator, and a source domain discriminator. The first generator is used to convert the experimental images of the small dam model and the open-source crack images into underwater-style images. The second generator is used to backmap the underwater-style images to the corresponding experimental images of the small dam model or the open-source crack images. The target domain discriminator is used to determine the authenticity between the generated images and the ROV detection images of the dam. The source domain discriminator is used to determine the consistency between the backmapped images and the experimental images of the small dam model and the open-source crack images. The DCSM-GAN model is trained by combining adversarial loss, cycle consistency loss, identity preservation loss, LPIPS perception loss, and crack edge structure loss to obtain an initial generation model. S22, Based on the initial generation model, a depth-sensitive aggregation (DSA) module is embedded in the encoding feature layer and decoding fusion layer of the first and second generators. The DSA module includes a self-attention feature selection unit, a reflection-filling multi-scale depth separation convolution unit, and a feature weight adaptive calibration unit. The self-attention feature selection unit is used to enhance the response of key texture features of cracks. The reflection-filling multi-scale depth separation convolution unit is used to perform reflection filling and multi-scale depth separation convolution processing on features of different scales. The feature weight adaptive calibration unit is used to perform weight calibration and fusion on features of different scales to obtain fused features. The initial generation model is then updated using the fused features to obtain a DCSM-GAN model with the embedded DSA module. S23. Based on the DCSM-GAN model with embedded DSA module, a visual perception similarity loss function is introduced. The generated image and the on-site dam ROV detection image are input into a pre-trained deep neural network to extract multi-layer perception features. Normalization processing, layer-by-layer difference calculation and weighted perception distance calculation are performed on the perception features of each layer to obtain LPIPS perception loss. The DCSM-GAN model is optimized by combining the adversarial loss, cycle consistency loss, identity preservation loss and crack edge structure loss to obtain the DCSM-GAN model used to generate underwater crack images.

4. The method for generating, optimizing, and intelligently detecting underwater dam crack images according to claim 3, characterized in that, S22 includes: S221, based on the initial generation model, a depth-sensitive aggregation (DSA) module is embedded in the encoding feature layer and decoding fusion layer of the first and second generators to obtain the feature sequence output by the intermediate layer of the generator. The feature sequence is then linearly transformed by the self-attention feature filtering unit in the DSA module to generate a query matrix, a key matrix, and a value matrix. The attention weights between different feature elements are calculated based on the scaling dot product similarity between the query matrix and the key matrix to distinguish the feature responses corresponding to crack edges, attachment occlusion, and underwater scattering noise, thereby obtaining crack key texture enhancement features. S222, the key texture enhancement features of the crack are input into the reflection-filled multi-scale depth separation convolution unit, and the input feature map is expanded by reflection-filled size of one pixel, two pixels and three pixels respectively to generate the first expanded feature map, the second expanded feature map and the third expanded feature map, while retaining the boundary features corresponding to the crack fine lines, the wide crack edges and the shadows of the attachments. S223, the first extended feature map, the second extended feature map, and the third extended feature map are processed in parallel using depth separation convolution with different receptive fields. Specifically, the first extended feature map is processed by a 3x3 convolution, the second extended feature map is processed by a 5x5 convolution, and the third extended feature map is processed by a 3x3 convolution to obtain the first multi-scale feature, the second multi-scale feature, and the third multi-scale feature, so as to extract the fine crack edges and wide crack textures at different scales. S224, the first multi-scale feature, the second multi-scale feature and the third multi-scale feature are input into the feature weight adaptive calibration unit, and the weights of each multi-scale feature are calibrated according to the channel response intensity and spatial saliency. The original structural information is preserved through residual connection to obtain the first calibration feature, the second calibration feature and the third calibration feature. S225, the first calibration feature, the second calibration feature and the third calibration feature are concatenated along the channel dimension, and the dimension is compressed by one-to-one convolution. The compressed feature is then summed element-wise with the third calibration feature to obtain a fused feature that combines underwater environment texture and crack structure details. The initial generation model is updated using the fused feature to obtain a DCSM-GAN model with embedded DSA module.

5. The method for generating, optimizing, and intelligently detecting underwater dam crack images according to claim 4, characterized in that, S23 includes: S231, Based on the DCSM-GAN model with embedded DSA module, a visual perception similarity loss function is introduced. The generated image and the on-site dam ROV detection image are input into a pre-trained deep neural network to extract the corresponding multi-layer perception features respectively. The perception features of each layer are normalized to obtain the normalized perception features of the generated image and the normalized perception features of the on-site dam ROV detection image. S232, perform layer-by-layer difference calculation on the normalized perception features of the generated image and the normalized perception features of the on-site dam ROV detection image to determine the feature differences between the generated image and the on-site dam ROV detection image at each feature layer, and obtain the perception feature differences at each layer. S233, according to the learning weights corresponding to each feature layer, the differences in the perceptual features of each layer are summed by weight to obtain the weighted perceptual distance between the generated image and the on-site dam ROV detection image, and the weighted perceptual distance is used as the LPIPS perceptual loss to evaluate the perceptual similarity between the generated image and the on-site dam ROV detection image in terms of underwater color, crack edge texture and local structure. S234, the LPIPS perception loss is combined with adversarial loss, cycle consistency loss, identity preservation loss and crack edge structure loss, and the DCSM-GAN model with embedded DSA module is optimized by the combined loss to obtain the DCSM-GAN model for generating underwater crack images.

6. The method for generating, optimizing, and intelligently detecting underwater dam crack images according to claim 5, characterized in that, S3 includes: S31, based on the underwater crack image, dark line enhancement and interference removal filtering are performed to obtain an enhanced underwater crack image. Crack segmentation is then performed based on the enhanced underwater crack image to obtain a binary crack segmentation result where crack pixels are marked as 1 and background regions are marked as 0. Connected component clustering analysis is used to label the connected components of the binary crack segmentation result. Crack pixels with the same label value are identified as the same connected crack segment. A noise filtering threshold is set according to the image resolution, crack candidate region area distribution, and local signal-to-noise ratio of the underwater image. Connected regions that are below the noise filtering threshold and do not meet the elongated shape constraint are identified as invalid noise and removed to obtain valid crack segments. S32, the effective crack segment is skeletonized. The Zhang-Suen iterative thinning algorithm is used to extract the single-pixel wide crack skeleton, and the main direction, endpoint position and bifurcation point information of the effective crack segment are retained. The eight-neighbor pixel statistics are performed on each skeleton point in the single-pixel wide crack skeleton. The skeleton point with only one adjacent crack pixel in the eight-neighbor domain is determined as the endpoint. The endpoints are collected to form an endpoint set, and the connected component number and local tangent direction of each endpoint are recorded. S33, Based on the set of endpoints, construct an endpoint attribution determination model, calculate the spatial distance and directional fit between different endpoints respectively, and combine the connected domain attributes and local curvature constraints of the endpoints to determine whether different endpoints belong to the two ends of the same crack. The spatial distance threshold and directional fit threshold are adjusted according to the crack width, image scale and length of the connected domain where the endpoint is located, and the endpoints to be connected that meet the requirements of spatial distance and directional fit are selected. S34, for the endpoints to be connected, construct linear structural elements according to the connection direction between the endpoints, use the directional constraint pixel dilation method to directionally expand and connect the endpoints to be connected, and repeatedly execute the endpoint attribution determination and directional expansion fusion until no new crack connection relationship is generated, so as to obtain a continuous, slender and topologically complete crack segmentation result.

7. The method for generating, optimizing, and intelligently detecting underwater dam crack images according to claim 6, characterized in that, S4 includes: S41, a rectangular scale calibration plate with known physical dimensions is set up in the dam monitoring area as the reference calibration object. The corner points or edge contours of the rectangular scale calibration plate are identified in the acquired images. Based on the reference edge with known actual length in the rectangular scale calibration plate, a scale mapping relationship between image pixel coordinates, underwater imaging depth and real physical coordinates is established to provide a scale reference for estimating crack width, crack length and crack area in the crack segmentation results. S42, based on the scale mapping relationship, combined with camera imaging parameters, determine the underwater imaging depth of the plane where the crack is located, and extract multiple feature sampling points along the crack segmentation results. Calculate the local physical width corresponding to each feature sampling point through depth compensation, and determine the average actual width of the crack, the maximum width of the crack, the length of the crack, and the area of ​​the crack. S43, the underwater crack image is sequentially input into the crack segmentation and size estimation process to obtain the crack segmentation result and crack size estimation result. The similarity of the generated image is evaluated by the visual perception similarity loss function and structural similarity. The segmentation continuity is evaluated by the endpoint misconnection rate, the broken segment recovery rate and the integrity of the connected component. The size error is evaluated by the average width error, the maximum width error and the length error. The similarity of the generated image, the segmentation continuity and the size error are jointly evaluated to obtain a comprehensive evaluation result of the image generation optimization effect.

8. The method for generating, optimizing, and intelligently detecting underwater dam crack images according to claim 7, characterized in that, S42 includes: S421, Based on the scale mapping relationship, combined with the camera intrinsic parameters, the pinhole imaging geometric model, the pixel length of the rectangular scale calibration plate and the camera shooting tilt angle, the underwater imaging depth of the plane where the crack is located is solved. S422, extract multiple feature sampling points at equal intervals along the crack edge in the crack segmentation result, determine the unit normal vector of each feature sampling point according to the crack edge gradient field and local skeleton direction, and search the boundary points on both sides of the crack along the unit normal vector, and obtain the local physical width of each feature sampling point through depth compensation and normal width conversion. S423, outlier values ​​are removed and averaged for each local physical width to obtain the average actual width of the crack, and the maximum width, length and area of ​​the crack are determined.

9. The method for generating, optimizing, and intelligently detecting underwater dam crack images according to claim 8, characterized in that, S5 includes: S51 is equipped with dedicated underwater image monitoring equipment. The dedicated underwater image monitoring equipment includes an underwater visual monitoring terminal with infrared night vision and binocular high-definition imaging functions. It has a built-in replaceable rechargeable battery pack and is equipped with a sealed cabin, attitude stabilization structure and waterproof data interface. The dedicated underwater image monitoring equipment is used to complete flexible cleaning, stable shooting and underwater crack image acquisition in the crack area to meet the continuous monitoring needs under low light, turbid water and close-range inspection conditions of the dam surface. S52, using the embedded processing module built into the dedicated underwater image monitoring equipment, the acquired underwater crack images are sequentially processed by clarity filtering, image preprocessing, crack feature extraction, crack segmentation, crack size calculation, and time and location binding. The underwater crack images, crack masks, crack size parameters, and environmental tags are then transmitted to the user terminal or engineering monitoring center via a microprocessor. At the same time, dual storage units are used to perform cyclic storage of monitoring data and automatic overwriting of expired data, so as to achieve stable storage and efficient transmission of monitoring data.