Underwater structure crack detection method and system based on transfer learning and physical guidance
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- SHANDONG JIAOTONG UNIV
- Filing Date
- 2026-05-26
- Publication Date
- 2026-08-07
AI Technical Summary
然而,当这些算法直接应用于水下环境时,水下恶劣的成像环境和水下背景强烈的非目标干扰严重制约了水下结构的健康监测
本发明公开了一种基于迁移学习与物理引导的水下结构裂缝检测方法及系统。突破了水下极小样本条件下的深度学习模型构建瓶颈。本发明通过构建可变形卷积与坐标注意力结合的轻量化网络,能够自适应水下裂缝的蜿蜒多变形态。相较于盲目堆叠重型网络结构,本发明的轻量化U-Net级联结构配合方向感知的注意力机制,在极小样本约束下能更高效地恢复空间高频细节,有效避免了因深层网络过度下采样导致的水下细微裂缝特征永久性丢失。
Smart Images

Figure CN122530171A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the fields of computer vision and underwater structure health monitoring technology, and in particular to a method and system for detecting cracks in underwater structures based on transfer learning and physical guidance. Background Technology
[0002] In underwater structural health monitoring (SHM), cracks are the most direct manifestation of damage and degradation in concrete structures. Timely and accurate detection of cracks is a prerequisite for assessing structural safety and developing maintenance strategies. In recent years, automated inspection solutions combining underwater robots (ROVs) or autonomous underwater vehicles (AUVs) equipped with high-definition cameras and computer vision technology have become an important development trend in this field.
[0003] Existing visual detection methods, especially deep learning-based image semantic segmentation algorithms (such as U-Net and DeepLabV3+), have achieved significant success in crack detection in terrestrial or atmospheric environments. However, when these algorithms are directly applied to underwater environments, the harsh underwater imaging conditions and strong non-target interference from the underwater background severely restrict the health monitoring of underwater structures. Furthermore, the difficulty in acquiring underwater environmental data results in a severe shortage of high-quality, pixel-level labeled underwater target domain data, impacting the training accuracy of the models. Summary of the Invention
[0004] To address the shortcomings of existing technologies, the present invention aims to provide an underwater structure crack detection method and system based on transfer learning and physical guidance. This method and system can effectively overcome underwater optical degradation and strongly suppress non-crack linear interference under extremely small sample constraints, thereby achieving automated detection with smooth cross-domain knowledge transfer.
[0005] To achieve the above objectives, the present invention is implemented through the following technical solution: The first aspect of this invention provides a method for detecting cracks in underwater structures based on transfer learning and physics guidance, comprising the following steps: Acquire images of the underwater structures to be detected; A lightweight geometrically adaptive semantic segmentation network consisting of an encoder and a segmentation decoder is constructed. A deformable convolutional network module is introduced in the deep feature extraction stage of the encoder, and a coordinate attention module is embedded in the multi-scale skip connection feature fusion node of the segmentation decoder. We use known multi-source heterogeneous datasets to train a lightweight geometric adaptive semantic segmentation network through four stages of transfer learning. The four stages include an underwater environment initialization stage for solidifying the underlying light and shadow features, a general crack semantic learning stage for learning structural morphology, an unsupervised underwater environment adaptation stage for compensating for target domain-specific noise, and a target domain small sample fine-tuning stage for accurately aligning classification boundaries. The trained geometric adaptive semantic segmentation network is used to detect underwater structural cracks in underwater structural images.
[0006] Furthermore, the deformable convolution module not only learns the sampling weights of the convolution kernel, but also learns the spatial two-dimensional offset and modulation scalar of each sampling point on the feature map through an additional parallel convolutional layer, dynamically adjusting the sampling position of the convolution kernel, and outputting a deep semantic feature tensor with geometric deformation adaptive capability.
[0007] Furthermore, at each feature fusion point at each scale, the segmentation decoder concatenates the corresponding high-resolution shallow features output by the encoder with the deep features upsampled by the segmentation decoder through bilinear interpolation in the channel dimension, and then inputs them into the coordinate attention module.
[0008] Furthermore, the coordinate attention module first performs one-dimensional global average pooling on the concatenated input feature tensor along both the horizontal and vertical spatial dimensions to generate a pair of feature encoding vectors containing precise location information and orientation awareness. Then, the pair of feature encoding vectors are concatenated along the spatial dimension and subjected to channel dimensionality reduction and non-linear activation through 1×1 convolution. Subsequently, the features are separated again, and the number of channels is restored through another 1×1 convolution and then passed through the Sigmoid activation function to generate spatial attention weight maps in the horizontal and vertical directions. Finally, the attention weight maps in the two directions are multiplied element-wise with the original input features through a tensor broadcasting mechanism to achieve reweighting in both the channel and spatial dimensions.
[0009] Furthermore, known multi-source heterogeneous datasets include underwater scene image datasets for providing basic underwater optical degradation backgrounds, general land crack image datasets for providing annotations of cross-domain invariant morphological features, unlabeled underwater target domain image datasets for learning the scattering noise distribution of target water areas, and underwater crack image datasets with pixel-level mask annotations for finally anchoring classification boundaries.
[0010] Furthermore, during the underwater environment initialization phase, a lightweight geometric adaptive semantic segmentation network is trained using an underwater scene image dataset. During backpropagation, the parameters of the first two residual stages of the backbone network are frozen, and only the parameters of the third and fourth residual stages and the segmentation decoder are updated. The general crack semantic learning stage continues training using a general land crack image dataset with annotations, and unfreezes the parameters of the third residual stage of the backbone network. In the unsupervised underwater environment adaptation phase, all parameters of the backbone network and the segmentation decoder parameters are completely frozen using an unlabeled underwater target domain image dataset, and only the domain adapter and reconstruction decoder are activated and trained. In the target domain small sample fine-tuning stage, the first three residual stages of the backbone network are completely frozen using an underwater crack image dataset with pixel-level mask annotations. Only the fourth residual stage of the backbone network, the domain adapter, and the segmentation decoder are unfrozen for final classification boundary alignment.
[0011] Furthermore, in the target domain few-sample fine-tuning stage, the prior probability map of physical line segment detection is extracted from the underwater crack image dataset with pixel-level mask annotations. A physical-guided soft spatial weighted loss function is constructed, and the structural response of the physical line segment is transformed into gradient penalty weights. Combined with the starting point regularization strategy and degradation perception course learning based on image quality assessment, the parameters of the semantic segmentation network that were not frozen in the target domain few-sample fine-tuning stage are jointly optimized to obtain the trained semantic segmentation network.
[0012] A second aspect of the present invention provides an underwater structure crack detection system based on transfer learning and physics guidance, comprising: The data acquisition module is configured to acquire images of the underwater structures to be detected; The model building module is configured to build a lightweight geometrically adaptive semantic segmentation network that includes an encoder and a segmentation decoder. A deformable convolutional network module is introduced in the deep feature extraction stage of the encoder, and a coordinate attention module is embedded in the multi-scale skip connection feature fusion node of the segmentation decoder. The model training module is configured to perform four-stage transfer learning training on the lightweight geometric adaptive semantic segmentation network using known multi-source heterogeneous datasets. The four stages include an underwater environment initialization stage for solidifying the underlying light and shadow features, a general crack semantic learning stage for learning structural morphology, an unsupervised underwater environment adaptation stage for compensating for target domain-specific noise, and a target domain small sample fine-tuning stage for accurately aligning classification boundaries. The crack detection module is configured to use a trained geometrically adaptive semantic segmentation network to detect underwater structure cracks in the underwater structure image to be detected.
[0013] A third aspect of the present invention provides a computer-readable storage medium storing a computer program adapted to be loaded by a processor and to execute the steps of the underwater structure crack detection method based on transfer learning and physics guidance as described in the first aspect of the present invention.
[0014] A fourth aspect of the present invention provides a computer device comprising: A processor, adapted to execute computer programs; A computer-readable storage medium storing a computer program, which, when executed by the processor, implements the underwater structure crack detection method based on transfer learning and physics guidance as described in the first aspect of the present invention.
[0015] The above one or more technical solutions have the following beneficial effects: This invention discloses a method and system for detecting underwater structural cracks based on transfer learning and physical guidance. It overcomes the bottleneck of deep learning model construction under extremely limited underwater sample conditions. By constructing a lightweight network combining deformable convolution and coordinate attention, this invention can adapt to the winding and varied morphology of underwater cracks. Compared to blindly stacking heavy network structures, the lightweight U-Net cascade structure of this invention, combined with a direction-aware attention mechanism, can more efficiently recover high-frequency spatial details under extremely limited sample constraints, effectively avoiding the permanent loss of subtle underwater crack features caused by over-sampling of deep networks.
[0016] This invention innovatively proposes a four-stage transfer learning strategy, breaking away from the traditional "source domain to target domain" hard-landing paradigm of transfer learning. Specifically, this invention introduces "unsupervised underwater environment adaptation" as a buffer connecting the source and target domains. Utilizing a large amount of readily available unlabeled underwater video data for self-supervised image reconstruction, the network's feature bottleneck is addressed without relying on any manual annotation costs. This allows for early adaptation to the optical degradation model caused by water absorption and suspended matter scattering in the target water area, laying a highly aligned feature space foundation for subsequent crack semantic transfer.
[0017] Advantages of additional aspects of the invention will be set forth in part in the description which follows, and in part will be obvious from the description, or may be learned by practice of the invention. Attached Figure Description
[0018] To more clearly illustrate the technical solutions in the embodiments of this application 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 some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0019] Figure 1 This is a flowchart of the underwater structure crack detection method based on transfer learning and physics guidance in Embodiment 1 of the present invention; Figure 2 This is a diagram of the lightweight geometric adaptive semantic segmentation network structure in Embodiment 1 of the present invention; Figure 3 This is a flowchart of the four-stage transfer learning training execution method in Embodiment 1 of the present invention; Figure 4 This is a detailed flowchart of the target domain small sample fine-tuning stage in Embodiment 1 of the present invention; Figure 5 This is a flowchart of the joint optimization process for parameters of the semantic segmentation network that were not frozen during the small sample fine-tuning stage in the target domain in Embodiment 1 of the present invention. Figure 6 This is a flowchart illustrating the inference and prediction process of the trained model on the underwater structure image to be detected in Embodiment 1 of the present invention. Detailed Implementation
[0020] It should be noted that the following detailed descriptions are exemplary and intended to provide further illustration of the invention. Unless otherwise specified, all technical and scientific terms used in this invention have the same meaning as commonly understood by one of ordinary skill in the art to which this invention pertains.
[0021] It should be noted that the terminology used herein is for the purpose of describing particular embodiments only and is not intended to limit the scope of exemplary embodiments according to the invention. As used herein, unless the context clearly indicates otherwise, the singular form is also intended to include the plural form. Furthermore, it should be understood that when the terms "comprising" and / or "including" are used in this specification, they indicate the presence of features, steps, operations, devices, components, and / or combinations thereof. The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the scope of protection of this application.
[0022] Existing visual inspection methods face extremely severe challenges when directly applied to underwater environments, mainly in the following aspects: First, underwater imaging faces harsh conditions and severe optical degradation. Light undergoes intense absorption and scattering as it propagates through water. Different wavelengths of light have different absorption rates, leading to severe color distortion in the image. Furthermore, suspended particles and microorganisms in the water cause forward and backward scattering, resulting in a sharp decrease in image contrast and blurred edges. This optical degradation significantly damages the local texture and boundary features of cracks.
[0023] Second, the complex underwater background presents strong non-target interference. The surface of underwater structures is often covered with marine life, aquatic plants, or has straight template scratches left over from construction. These interfering objects also appear as obvious linear or tubular shapes in the image, which are highly similar to the physical characteristics of cracks, making them very easy to cause false positives in deep learning models, resulting in a high false positive rate.
[0024] Third, high-quality, pixel-level labeled underwater target domain data is extremely scarce. Deep learning is a data-driven method, requiring massive amounts of labeled data to train the model to avoid overfitting. Due to the complexity of the underwater environment and the high cost of underwater operations, obtaining underwater images with precise pixel-level crack mask annotations is extremely difficult; typically, only a very small number of high-quality labeled samples can be obtained. Under such a constraint of extremely small samples, training a deep network from scratch will inevitably lead to severe overfitting. If a conventional transfer learning paradigm is used, due to the large difference in feature distribution between the source and target domains, the model will quickly forget the general crack topology rules learned in the source domain when fitting underwater-specific noise, resulting in "catastrophic forgetting."
[0025] To overcome the aforementioned shortcomings, this invention provides a method and system for detecting underwater structural cracks based on transfer learning and physics guidance. Through multi-source data fusion, local adaptive modification of the network architecture, and physical prior intervention at the gradient level, it achieves high-precision and robust detection of cracks in extremely small underwater samples. Specific details are shown in the following embodiments.
[0026] Example 1: Embodiment 1 of this invention provides an underwater structure crack detection method based on transfer learning and physics guidance. It aims to completely solve the technical bottlenecks of strong interference from complex underwater environments, extremely scarce samples leading to poor model generalization ability and high false detection rates by modifying a lightweight and geometrically adaptive network architecture, adopting a transfer learning training paradigm, and using a physics-prior-guided gradient weighting mechanism. Figure 1 As shown, it includes the following steps: S1: Acquire an image of the underwater structure to be detected.
[0027] In one specific implementation, an image of the underwater structure to be detected is acquired and subjected to basic preprocessing consistent with the training dataset, including scaling the image size to the model's standard input resolution and pixel value normalization. It should be noted that this basic preprocessing does not include the data augmentation used during the training phase to prevent overfitting.
[0028] S2: Construct a lightweight geometrically adaptive semantic segmentation network that includes an encoder and a segmentation decoder. In the deep feature extraction stage of the encoder, a deformable convolutional network module is introduced, and a coordinate attention module is embedded in the multi-scale skip connection feature fusion node of the segmentation decoder.
[0029] like Figure 2 As shown, in one specific implementation, a lightweight residual network with a moderate number of parameters (excluding the bottleneck layer) is used as the backbone extraction architecture of the encoder to retain more spatial high-frequency details. A deformable convolutional network module is introduced in the deep feature extraction stage of the encoder to adapt to the meandering and varied topology of the cracks. The deformable convolutional module not only learns the sampling weights of the convolutional kernels but also learns the spatial two-dimensional offset and modulation scalar of each sampling point on the feature map through an additional parallel convolutional layer, dynamically adjusting the sampling position of the convolutional kernels and outputting a deep semantic feature tensor with geometric deformation adaptive capabilities.
[0030] Specifically, this embodiment uses ResNet-34 as the backbone network of the encoder, which contains four hierarchical residual stages. In order to enhance the geometric perception capability to cope with the irregular and meandering characteristics of underwater cracks, all standard 3×3 convolutions in the fourth residual stage (Layer 4) of the backbone network are replaced with deformable convolutional networks (DCNv4).
[0031] Deformable convolution modules adaptively deform the sampling points of the convolution kernel by superimposing two-dimensional spatial offsets on the regular grid of standard convolution, thus "finding" the actual extension trajectory of the crack. Specifically, for a position on the output feature map y... The calculation formula for each pixel value is quantified as follows: .
[0032] in: This represents the total number of sampling points for the convolution kernel; For the fixed relative position of the standard grid; The convolutional kernel weights learned by the network; This is the input feature map.
[0033] The core of this embodiment lies in and : This represents the two-dimensional spatial offset learned by an additional convolutional branch parallel to this layer. The modulation scalar between [0,1], learned simultaneously, is used to control the importance of the features at that sampling point. Because Typically, the coordinates are decimal coordinates, and the network internally uses a bilinear interpolation mechanism to extract them from the input feature map. The continuous eigenvalues at the corresponding positions are calculated in the discrete grid.
[0034] Data comparison and feature heatmap visualization show that after introducing DCNv4 into the deep layer, the high response region is no longer distributed in blocks, but closely fits the winding contour of the slender crack, which greatly improves the model's ability to adapt to geometric deformation.
[0035] In one specific implementation, the segmentation decoder in this embodiment employs a symmetrical skip connection architecture cascaded with U-Nets to progressively recover crack edge details lost due to downsampling. However, directly concatenating the shallow high-resolution features of the encoder with the deep upsampled features of the segmentation decoder often introduces a large amount of underwater high-frequency background noise. To address this issue, this invention embeds a coordinate attention module at each feature fusion point of a skip connection.
[0036] Specifically, at each feature fusion point at each scale, the segmentation decoder concatenates the corresponding high-resolution shallow features output by the encoder with the deep features upsampled by bilinear interpolation from the segmentation decoder along the channel dimension, and then inputs them into the Coordinate Attention (CA) module. Simultaneously, a lightweight domain adapter and reconstruction decoder are externally connected as a bypass at the deep output of the encoder, forming an autoencoder branch for unsupervised learning.
[0037] More specifically, the coordinate attention module is designed to co-encode positional and channel information to achieve orientation-aware feature recalibration. In this embodiment, the coordinate attention module first performs one-dimensional global average pooling along both the horizontal and vertical spatial dimensions of the concatenated input feature tensor, generating a pair of feature encoding vectors containing precise positional and orientation-aware information. Next, the pair of feature encoding vectors are concatenated along the spatial dimension, and 1×1 convolutions are used for channel dimensionality reduction and non-linear activation. Subsequently, the features are re-separated, and another 1×1 convolution is used to restore the number of channels, followed by a Sigmoid activation function to generate spatial attention weight maps in the horizontal and vertical directions. Finally, the attention weight maps in both directions are multiplied element-wise with the original input features through a tensor broadcasting mechanism, achieving reweighting in both channel and spatial dimensions. This significantly enhances the response in the crack extension direction and suppresses background noise during feature fusion.
[0038] First, the high-resolution shallow features from the corresponding layer of the encoder, obtained through skip connections, are concatenated with the deep features obtained by upsampling from the segmentation decoder along the channel dimension to obtain the input feature tensor. Perform one-dimensional global average pooling operations along the horizontal (X-axis) and vertical (Y-axis) directions respectively. Feature tensor Size is , representing the number of channels, height, and width, respectively. For the first... One channel, with a height of [missing information]. Horizontal characteristic response and width are Vertical characteristic response Calculated separately as follows: , .
[0039] These two one-dimensional feature vectors not only capture long-range dependencies along one direction but also retain precise positional information in the other direction. Subsequently, these two feature vectors are concatenated in the spatial dimension to generate a vector of size [size missing]. The joint features are then processed through a shared 1×1 convolution for channel compression at a compression ratio of r, and then through a non-linear activation function to generate intermediate features containing the global receptive field.
[0040] Next, the intermediate features are re-segmented along the spatial dimension into horizontal and vertical parts. Each part is then re-convolved with another 1×1 convolution to restore the number of channels to C, and a Sigmoid activation function is applied to generate the horizontal attention weight matrix. Attention weight matrix in the vertical direction ,in, It represents the set of real numbers.
[0041] Finally, using a tensor broadcasting mechanism, the attention weight matrices in these two directions are combined with the input feature tensor. Perform pixel-by-pixel multiplication operations and output the recalibrated features. : .
[0042] in: These are the pixel values of the output feature map after recalibration. This represents the pixel value of the c-th channel of the input feature map at height h and width w. , These represent the horizontal and vertical attention weights generated after activation, respectively.
[0043] This coordinate attention-based recalibration mechanism enables the network to keenly capture the spatial directionality of the crack's linear extension when fusing multi-scale information, amplify the channel weights in the crack's main region, and suppress the disordered underwater particle noise response.
[0044] Furthermore, to support the image reconstruction task in the unsupervised domain adaptation stage, this embodiment introduces a lightweight domain adapter as an additional bypass at the output of the fourth residual stage of the encoder. This domain adapter consists of three consecutive 1×1 convolutional layers, aiming to reduce the channel dimension and perform nonlinear mapping on deep features, forming a compact information bottleneck. Following the domain adapter, a reconstruction decoder with a structure similar to the segmentation decoder but without skip connections is connected. Its output is passed through a deconvolutional layer and a sigmoid function, ensuring the output size is identical to the input image. A three-channel pseudo-color reconstructed image.
[0045] S3: The lightweight geometric adaptive semantic segmentation network is trained using a known multi-source heterogeneous dataset through a four-stage transfer learning process. The four stages include an underwater environment initialization stage for solidifying the underlying light and shadow features, a general crack semantic learning stage for learning structural morphology, an unsupervised underwater environment adaptation stage for compensating for target domain-specific noise, and a target domain small-sample fine-tuning stage for accurately aligning classification boundaries.
[0046] S3.1: Obtain known multi-source heterogeneous datasets and perform preprocessing.
[0047] In one specific implementation, known multi-source heterogeneous datasets include large-scale underwater scene image datasets for providing basic underwater optical degradation backgrounds, general land crack image datasets with annotations for providing high-quality cross-domain invariant morphological features, massive unlabeled underwater target domain image datasets for learning the scattering noise distribution of target water areas, and a very small number of underwater crack image datasets with pixel-level mask annotations for finally anchoring classification boundaries.
[0048] Specifically: (1) Large-scale underwater scene image dataset (subset A): The public dataset SUIM is used, which contains thousands of diverse underwater scene images. These images include shipwrecks, divers, corals, etc., but do not need to include cracks. Its core function is to provide a large amount of underwater optical degradation background for training the robustness of the network's bottom receptive field to underwater light spots, color casts and scattering.
[0049] (2) General Land Crack Image Dataset (Subset B): Contains thousands of high-quality images of land concrete surface cracks with pixel-level mask annotations. The land images have high contrast and clear crack edges. Its core function is to teach the network to recognize "what is a crack", that is, to learn the unique topological connectivity, bifurcation structure and local texture patterns of cracks.
[0050] (3) Unlabeled underwater target domain image dataset (subset C): This dataset was collected by a high-resolution underwater camera mounted on an ROV in the actual waters of the bridge piers to be inspected. The video stream was frame-sampling at a certain frame rate to form a massive number of target domain images. This dataset does not require any manual annotation costs. Its purpose is to provide the network with unsupervised autoencoder reconstruction to implicitly learn the unique noise distribution such as turbidity and suspended particle concentration in the current specific water area.
[0051] (4) A very small number of labeled underwater crack image datasets (subset D): 10 to 20 images containing typical cracks with varying degrees of degradation were selected from subset C and given to structural engineering experts to perform fine pixel-level crack masking using polygon tools. This constitutes the most expensive and core data in the entire training process and is used for final fine-tuning to determine the precise classification decision boundary.
[0052] During the data preprocessing stage, all images in the subset were subjected to a uniform normalization operation, scaling the pixel values to the [0,1] range, and then standardized according to the mean and standard deviation of the ImageNet dataset. Simultaneously, considering memory limitations and consistency in feature extraction, all images were uniformly scaled to a resolution of 512×512 pixels using bilinear interpolation.
[0053] S3.2: A four-stage transfer learning training process is performed on a lightweight geometrically adaptive semantic segmentation network using known multi-source heterogeneous datasets. For example... Figure 3 As shown, the specific steps are as follows: S3.2.1: In the underwater environment initialization stage, a lightweight geometric adaptive semantic segmentation network is trained using an underwater scene image dataset. During backpropagation, the parameters of the first two residual stages of the backbone network are frozen, and only the parameters of the third and fourth residual stages and the segmentation decoder are updated. The purpose is to force the network to learn the prior features of underwater environment-specific illumination attenuation, color cast, and blur degradation, while the bottom convolutional kernels retain the general basic edge extraction capabilities.
[0054] In one specific implementation, the goal of this stage is to endow the network's underlying receptive fields with immunity to complex underwater lighting conditions. Large-scale underwater scene images are fed into the network for forward propagation. During backpropagation, a "partial freeze" strategy is implemented to calculate gradient updates: the weights of the first two residual stages (Layer 1 and Layer 2) of the backbone network are strictly frozen. This is because shallow convolutions primarily extract the most basic image operators such as edges and corners, which are highly similar in air and water and require no modification. Simultaneously, the parameters of the third and fourth residual stages and the segmentation decoder are activated and updated. Training uses the Adam optimizer with a learning rate of 1e-4 for 60 epochs. This stage allows the network's deep feature maps to adapt to the non-linear nature of underwater light attenuation, suppressing feature drift caused by color casts.
[0055] S3.2.2: The general crack semantic learning stage continues training using a general land crack image dataset with annotations, and unfreezes the third residual stage parameters of the backbone network.
[0056] In one specific implementation, training continues using a general land crack image dataset containing a large number of high-quality annotations. The goal of this stage is to allow the network to learn the essential physical properties of "cracks". A subset B and its corresponding binary mask labels are fed into the network. The binary cross-entropy (BCE) loss between the predicted mask and the ground truth mask is calculated. The parameters of the third residual stage of the backbone network are unfrozen in this stage. Specifically, considering that the fourth residual stage contains a powerful deformable convolutional module, if the learning rate is too large, DCNv4 is prone to overfitting the sharp boundaries specific to land cracks, leading to a precipitous drop in performance when migrating to the blurred boundaries underwater. Therefore, this embodiment uses a group learning rate of 0.1 for the relevant DCNv4 parameters. After 150 epochs of training, the model masters cross-domain invariant linear topology and bifurcation patterns, possessing powerful general crack segmentation capabilities.
[0057] S3.2.3: Unsupervised underwater environment adaptation stage: Use unlabeled underwater target domain image dataset to completely freeze all parameters of the backbone network and segmentation decoder parameters, and only activate and train the domain adapter and reconstruction decoder.
[0058] In one specific implementation, this stage is a key innovation connecting the source domain and the minimal target domain. If the model, which has mastered the semantics of cracks in the previous stage, is directly placed in the minimal target domain for fine-tuning, it is easily "biased" by the unique noise of the target domain, such as aquatic plants and suspended matter. Therefore, this stage introduces a subset C for self-supervised reconstruction training. All parameters of the backbone network and the segmentation decoder are completely frozen, and only the domain adapter and reconstruction decoder are activated and trained. Using the forward propagation input image as the target ground truth, by minimizing the mean squared error (MSE Loss) between the network input image and the three-channel reconstructed image output by the reconstruction decoder, the domain adapter is driven to specifically absorb, encode, and compensate for the unique scattering and suspended particle noise distribution of the target water area without paying attention to the specific target semantics.
[0059] Specifically, at this stage, all residual stages of the backbone network and the segmentation decoder are completely shut down and frozen. The forward propagation data stream, after passing through Layer 4, directly enters the bypass domain adapter and reconstruction decoder. Since there are no mask labels, the network directly uses the raw input image. As the target ground truth, calculate the reconstructed image. With input image Mean square error between: .
[0060] in, To calculate the mean square error between the reconstructed image and the input image, For the input underwater image, To reconstruct the image, the training process uses the Adam optimizer with a very small learning rate of 1e-5 for 100 epochs.
[0061] By minimizing the MSE, the domain adapter is forced to encode and retain all the information in the latent space sufficient to reconstruct the current water-specific scattering model and particle noise. This process effectively allows the domain adapter to specializedly "absorb" the degradation features of the target water, thus forming a robust feature transition layer between the backbone network and the segmentation decoder, greatly reducing the adaptive pressure on the main network during subsequent fine-tuning.
[0062] S3.2.4: In the target domain small sample fine-tuning stage, the first three residual stages of the backbone network are completely frozen using the underwater crack image dataset with pixel-level mask annotations. Only the fourth residual stage of the backbone network, the domain adapter, and the segmentation decoder are unfrozen to perform the final classification boundary alignment.
[0063] After laying the groundwork, a very small number of labeled underwater crack images were finally introduced for final alignment. To minimize the risk of "catastrophic forgetting," a strict Parameter-Efficient Fine-Tuning (PEFT) strategy was implemented in this stage: the first three residual stages (Layer 1 to Layer 3) of the backbone network were completely and permanently frozen, solidifying the light and shadow immunity learned in the first stage and the general crack semantics learned in the second stage. Only the parameters of the fourth residual stage of the backbone network, the domain adapter, and the segmentation decoder were unfrozen. This stage, combined with a physics-guided loss and a collaborative optimization strategy, used the Adam optimizer with a base learning rate of 1e-5 and introduced a weight decay of 5e-4, performing fine-tuning for 1000 epochs to finally establish a high-dimensional classification hyperplane with a very small number of samples.
[0064] like Figure 4 and Figure 5 As shown, in the target domain few-sample fine-tuning stage, the prior probability map of physical line segment detection is extracted from the underwater crack image dataset with pixel-level mask annotations. A physical-guided soft spatial weighted loss function is constructed, and the structural response of the physical line segment is transformed into gradient penalty weights. Combined with the starting point regularization strategy and the degradation perception course learning based on image quality assessment, the parameters of the semantic segmentation network that were not frozen in the target domain few-sample fine-tuning stage are jointly optimized to obtain the trained semantic segmentation network.
[0065] The specific steps are as follows: S3.2.4.1: Extract the prior probability map of physical line segment detection from the image and construct a physical-guided soft spatial weighted loss function.
[0066] In one specific implementation, in order to use physical laws to correct the "overfitting" tendency of deep learning models, especially to solve the false positive problem caused by aquatic plants and scratches, a soft spatial weighted loss guided by physical priors is introduced.
[0067] In conventional deep learning frameworks, introducing physical priors typically involves concatenating the prior feature map as an additional channel with the original image at the input, and then feeding both into the massive neural network for forward propagation. This approach not only significantly increases the number of parameters in the first convolutional layer and the overall inference computation, but more seriously, under extremely small sample constraints, the network is highly susceptible to establishing a false, strong coupling between this physical prior and the target, resulting in extremely poor model robustness. Figure 4 As shown, this embodiment completely separates the calculation of the physical prior of the line segment from the forward propagation of the network and transfers it to the gradient optimization level of the back propagation, forming a soft spatial weighted loss: (1) For each training image in the fine-tuning stage, the Line Segment Detector (LSD) algorithm is run independently. This algorithm calculates the gradient magnitude and gradient direction of the image, performs pseudo-sorting and region growing, extracts connected regions in the image that conform to the physical characteristics of line segments, and generates a line structure probability map of the same size as the original image.
[0068] Specifically, for each training image I in the fine-tuning dataset, the LSD algorithm is run independently on the CPU. The LSD algorithm first performs Gaussian downsampling on the image to filter high-frequency shot noise, then calculates the gradient magnitude and direction. Next, pixels with higher gradient magnitudes are used as seed points, and region growing is performed according to the gradient direction tolerance to form connected line support regions. Finally, these regions are approximated as rectangles, and the Helmholtz principle is used to calculate the number of false alarms (NFA) for each rectangle, filtering out false line segments formed by random noise. The response values of the retained real physical line segments are mapped to a matrix of the same size as the original image to generate a line structure probability map. .
[0069] (2) Normalize the line structure probability graph to the maximum and minimum values, and set a preset upper limit value of weight (such as 1.5 to 2.0) to convert it into a spatial weight graph tensor.
[0070] Specifically, will Perform maximum and minimum value normalization so that its values are distributed between [0,1]. To use this as loss weights, set a base weight of 1.0 and a weight cap. (This embodiment is preferred) =between 1.5 and 2.0). The probability graph is transformed into a spatial weighted graph tensor through a linear mapping. : .
[0071] In this tensor, the pixel location with more significant physical line segment features has a higher weight value. The closer to the upper limit The weight value for the background or non-line segment regions remains at the base value of 1.0.
[0072] (3) In the loss calculation layer of network training, the physical prior is not used as the feature map input for forward propagation of the network, but is used as the gradient modulation factor.
[0073] Specifically, when calculating the binary cross-entropy loss (BCELoss) between the network's predicted output mask and the ground truth mask label, the spatial weight map tensor is multiplied by the pixel-wise loss matrix using a Hadamard product. This dynamically amplifies the gradient penalty weights at pixel locations that are actually labeled as cracks and have equally strong physical line segment responses, thus forming a physics-guided loss. This mechanism uses physical rules to force the network to preferentially fit structures with real linear edges during backpropagation, greatly suppressing the probability of the network classifying non-crack linear interferences such as seaweed and underwater scratches as positive.
[0074] First, calculate the single-channel probability graph predicted by the network. Compared with manually labeled real labels The standard pixel-wise binary cross-entropy loss matrix between : .
[0075] in: This represents the probability value predicted by the model, ranging from... between.
[0076] Subsequently, the spatial weight graph tensor Perform a Hadamard product (element-wise multiplication) with the loss matrix and calculate the global average to obtain the final physical guidance loss. : .
[0077] In this embodiment, the spatial weighted graph tensor The construction logic is extremely ingenious. Because weight amplification only occurs in regions where the physical line segment has a strong response (i.e.,...) (areas >1.0), if the real label If the location indicates a crack and the LSD algorithm also considers it to have a physical edge, then the loss weight for that pixel will be amplified by a factor of 1.5. In this case, if the network model fails to correctly predict the crack, it will be subject to a severe gradient penalty of 1.5 times, forcing the network to focus on crack regions with clear physical evidence.
[0078] More importantly, underwater environments often contain a large amount of floating aquatic plants or straight scratches from construction templates. The LSD algorithm will also produce extremely strong physical line segment responses on these disturbances. >1.0). However, due to the real label These locations are indicated as background; if the network model incorrectly predicts aquatic plants as cracks, then due to the weight map... In these locations, the model is also amplified and suffers a 1.5 times penalty for false positives. This mechanism is equivalent to forcibly injecting a strict prior rule into the network during backpropagation using physical laws. Through this physical-level gradient intervention, the overfitting and random guessing tendencies that deep learning models are prone to produce with very small samples are greatly suppressed, significantly reducing the false detection rate.
[0079] S3.2.4.2: The structural response of the physical line segment is transformed into gradient penalty weights. Combined with the starting point regularization (L2-SP) strategy and degradation perception course learning based on image quality assessment, the parameters of the semantic segmentation network that are not frozen in the small sample fine-tuning stage in the target domain are jointly optimized.
[0080] In one specific implementation, conventional fine-tuning often employs L2 regularization to prevent parameters from becoming too large, essentially causing network parameters to decay towards a zero vector. However, in minimal sample transfer learning, it is undesirable for parameters to tend towards zero; rather, it is desirable for the parameters to remain as close as possible to the well-learned state during source domain pre-training, requiring only minor adjustments. Therefore, this embodiment introduces a starting point regularization strategy. Before the start of the fourth stage of fine-tuning, the parameter matrices of the backbone network's fourth residual stage, the domain adapter, and the segmentation decoder after the third stage are saved as fixed anchor weight tensors. During fine-tuning training, a Euclidean distance penalty term between the currently updated parameter matrix and the anchor weight tensor is added to the total loss function. This regularization constraint limits the parameter offset range of the model when fitting minimal samples, preventing specific noise caused by overfitting more than ten samples, and effectively ensuring the smoothness of knowledge transfer.
[0081] On the other hand, the quality of underwater crack images varies greatly. If the model encounters extremely blurry or low-contrast "difficult samples" in the early stages of fine-tuning, it is very easy to cause gradient direction confusion, leading the model into local optima. To address this, this embodiment implements a degradation-aware learning process. Before loading the training data in the fourth stage of fine-tuning, the image quality of a very small number of labeled underwater crack images is assessed. The global contrast and blur index of each image are calculated. Based on the calculated comprehensive degradation score, the fine-tuning training samples are sorted in ascending order from clear to severely degraded. Random shuffling is removed in the model training data loader, and the data is supplied to the model in batches strictly according to the order from easy to difficult. This guides the model to establish a stable basic classification surface before gradually adapting to extremely degraded samples, significantly reducing gradient oscillations during small-sample training.
[0082] More specifically, such as Figure 5 As shown, before the fourth stage of fine-tuning begins, the weight tensors of all updatable parameters after the third stage are extracted and stored in memory as immutable anchor weights. In each iteration of fine-tuning training, let the currently updated network parameters be... Then in physical guidance loss Based on this, an additional parameter offset penalty term based on Euclidean distance is added to form the total loss function. : .
[0083] in, To control the hyperparameters of regularization strength, This represents the squared L2 norm. This penalty term calculates the sum of the squared differences between each element in the current parameter matrix and the corresponding element in the anchor weight matrix. During gradient backpropagation, this term produces a value that always points to the anchor weights. The tension allows the network parameters to be shifted to a certain extent in order to fit the crack features of the underwater target domain. However, if the shift is too large, it will be pulled back to the feature space with good generalization ability, thus fundamentally eliminating catastrophic forgetting under extremely small sample conditions.
[0084] Before fine-tuning training begins, an image quality assessment script is first written to automatically calculate the objective degradation index for each training image in subset D. Specifically, the Michelson contrast formula is used to calculate the global contrast score of the images. : .
[0085] in: , These represent the highest and lowest global brightness values of the image, respectively.
[0086] This embodiment uses the Laplacian operator to filter the image and calculates the variance of the filtered image as the image sharpness / blurriness score. The global contrast score and the sharpness / blurriness score are normalized and then weighted and summed to obtain the overall degradation score for each image. The higher the score, the sharper the image and the more obvious its features; the lower the score, the more severe the image degradation.
[0087] Based on the calculated comprehensive degradation score, the fine-tuning training dataset is forcibly sorted in descending order. In the PyTorch DataLoader configuration, the shuffle parameter is set to False, and data batches are strictly fed to the network in this order from easy to difficult in a custom Sampler. This course-learning mechanism, similar to human learning, guides the model to first establish a stable and clear crack classification decision surface in the early stages of fine-tuning. Subsequently, in the later stages of training, fuzzy degradation samples are gradually introduced to fine-tune the decision surface and strengthen its resistance to perturbations. This results in an extremely smooth decrease in the loss curve throughout the optimization process, significantly improving training stability.
[0088] This invention achieves interference-resistant physical guidance without increasing inference computation. In the final minimal sample fine-tuning stage, this invention abandons the conventional approach of using edge prior maps as additional input branches for channel splicing. This invention creatively reduces the dimensionality of the Line Segment Physical Prior (LSD) and transfers it to the weight space of the loss function. This forms a soft spatial weighted loss, which, without increasing the computational cost of forward inference, uses physical laws to forcibly correct the tendency of deep learning to "guess" during gradient backpropagation. This greatly suppresses the false positive (FP) problem where the network mistakenly identifies non-crack linear interferences such as aquatic plants, aquatic organisms, and structural scratches in the underwater environment as cracks, significantly improving detection accuracy.
[0089] This invention provides an extremely stable minimal-sample optimization environment. By combining L2-SP (Learning-Initial Regularization) to preserve generalization knowledge learned from previous stages, along with a rigorous hierarchical freezing strategy and degradation-aware learning, this method achieves extremely high segmentation accuracy, approaching that of training with a full dataset, even under minimal-sample conditions. It solves the technical challenges of catastrophic forgetting and overfitting caused by the extreme scarcity of high-quality labeled data in underwater extreme environments, making the system highly deployable and practically valuable in real-world engineering inspections.
[0090] S4: Use the trained geometric adaptive semantic segmentation network to detect underwater structure cracks in the underwater structure image to be detected.
[0091] In one specific implementation, such as Figure 6 As shown, during the model inference phase, the LSD line segment detection branch used to calculate the physical guidance loss in the fine-tuning phase and the reconstruction decoder branch used for image reconstruction in the unsupervised domain adaptation phase are stripped away, leaving only the backbone network and segmentation decoder for efficient inference computation. The acquired underwater structure images to be detected are input into the backbone network and segmentation decoder of the trained underwater crack detection model using Test-Time Augmentation (TTA). Specifically, firstly, the acquired images to be detected are horizontally and vertically flipped to obtain three sets of input images (original image, horizontally flipped image, and vertically flipped image); secondly, these three sets of images are input into the trained underwater crack detection model, outputting three corresponding initial prediction probability maps; finally, the prediction probability maps output from the flipped images are reversed spatially, and the three prediction probability maps are averaged and fused pixel by pixel, then thresholded and binarized to eliminate prediction noise from a single viewpoint, generating and outputting a high-precision underwater crack mask map, and based on this, the geometric attributes of the cracks are extracted to generate a structure evaluation report.
[0092] Specifically, when the model is deployed to the inference server or the edge computing node of the underwater robot, the system prunes the trained model weights. Since the physics-guided LSD algorithm is only called when calculating the loss, and the reconstruction decoder is only used for unsupervised adaptation, these two parts of the code are completely removed during the inference phase. The inference model retains only the ResNet-34 backbone, domain adapter, and a lightweight segmentation decoder recalibrated with coordinate attention. This streamlined architecture results in a forward propagation parameter count of only about 24.5M, with extremely low computational cost, ensuring efficient system operation.
[0093] To further smooth out the random errors in single predictions caused by strong local underwater noise, this embodiment incorporates test-time enhancement techniques into the inference process. For each input underwater image to be detected... The system first generates its three geometric variants in memory: a horizontally flipped image. Vertical image flip and diagonally flipped images These four images are grouped together and input into a lightweight model to obtain four single-channel prediction probability matrices.
[0094] Subsequently, the system performs a corresponding inverse flipping operation on the predicted flip probability matrix to ensure it is strictly aligned with the original image in spatial coordinates. Finally, the four aligned probability matrices are fused using pixel-by-pixel arithmetic averaging to obtain the final comprehensive probability matrix. : .
[0095] in: , , , These represent the prediction probability matrices output by the model after inputting the original image, horizontally flipped, vertically flipped, and diagonally flipped images, respectively. , , These are functions for horizontal, vertical, and diagonal reverse flipping operations, respectively.
[0096] This ensemble strategy leverages the model's varying sensitivity to different spatial orientation features, effectively neutralizing some false negatives and false positives caused by uneven underwater light spots. By performing binarization with a threshold of 0.5, a high-precision underwater crack mask image can be output.
[0097] To verify the performance of the method described in this invention, it was applied to a real-world crack detection task for underwater piers of a cross-sea bridge. The experimental environment was uniformly configured with an Ubuntu 22.04 operating system, a single NVIDIA RTX 4070 graphics card, and the PyTorch 2.0 deep learning framework for model training and inference.
[0098] Quantitative evaluation results on the test dataset show that, with only 12 labeled underwater images for fine-tuning, the proposed method achieves breakthrough progress in all core metrics of segmentation accuracy. Comparison data with other methods is shown in Table 1. Table 1. Performance comparison of different methods on the underwater fracture test set.
[0099] The method proposed in this invention achieves the highest scores in accuracy, F1 score, and mIoU, with an accuracy of 97.1%, F1 score of 0.9201, and mIoU score of 0.9086. Compared to models that only use semantic segmentation, the accuracy, F1 score, and mIoU are improved by 48.92%, 59.73%, and 100.88%, respectively.
[0100] In terms of model efficiency and engineering practicality, thanks to the adoption of a lightweight residual architecture and the removal of heavy physical input branches, the total number of parameters in the model on the test platform is controlled within 24.5M, and the number of floating-point operations (FLOPs) is approximately 56.2G. When processing high-definition images with a resolution of 512×512 pixels, the average inference time per frame, including TTA enhancement, is only 28.5 milliseconds, equivalent to a real-time processing frame rate of 35 FPS. This processing speed, coupled with extremely high segmentation accuracy, fully meets the real-time computing and high-precision detection requirements of underwater robots in dynamic inspection processes, and has extremely high industrial deployment value.
[0101] Example 2: Embodiment 2 of the present invention provides an underwater structure crack detection system based on transfer learning and physics guidance, comprising: The data acquisition module is configured to acquire images of the underwater structures to be detected; The model building module is configured to build a lightweight geometrically adaptive semantic segmentation network that includes an encoder and a segmentation decoder. A deformable convolutional network module is introduced in the deep feature extraction stage of the encoder, and a coordinate attention module is embedded in the multi-scale skip connection feature fusion node of the segmentation decoder. The model training module is configured to perform four-stage transfer learning training on the lightweight geometric adaptive semantic segmentation network using known multi-source heterogeneous datasets. The four stages include an underwater environment initialization stage for solidifying the underlying light and shadow features, a general crack semantic learning stage for learning structural morphology, an unsupervised underwater environment adaptation stage for compensating for target domain-specific noise, and a target domain small sample fine-tuning stage for accurately aligning classification boundaries. The crack detection module is configured to use a trained geometrically adaptive semantic segmentation network to detect underwater structure cracks in the underwater structure image to be detected.
[0102] Example 3: Embodiment 3 of the present invention provides a computer-readable storage medium storing a computer program adapted for loading by a processor and executing the steps of the underwater structure crack detection method based on transfer learning and physics guidance as described in Embodiment 1 of the present invention.
[0103] Example 4: Embodiment 4 of the present invention provides a computer device, the device comprising: A processor, adapted to execute computer programs; A computer-readable storage medium storing a computer program, which, when executed by the processor, implements the steps in the underwater structure crack detection method based on transfer learning and physics guidance as described in Embodiment 1 of the present invention.
[0104] The steps and methods involved in Examples 2, 3 and 4 above correspond to those in Example 1. For specific implementation details, please refer to the relevant description section of Example 1.
[0105] Those skilled in the art will recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed in this application can be implemented in electronic hardware or a combination of computer software and electronic hardware. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.
[0106] In the above embodiments, implementation can be achieved, in whole or in part, through software, hardware, firmware, or any combination thereof. When implemented in software, it can be implemented, in whole or in part, as a computer program product. A computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, all or part of the flow or function according to the embodiments of this application is generated. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in or transmitted through a computer-readable storage medium. The computer instructions can be transmitted from one website, computer, server, or data center to another website, computer, server, or data center via wired or wireless means. The computer-readable storage medium can be any available medium that a computer can access or a data processing device such as a server or data center that integrates one or more available media. The available medium can be a magnetic medium, an optical medium, or a semiconductor medium, etc.
[0107] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.
Claims
1. A method for detecting cracks in underwater structures based on transfer learning and physics guidance, characterized in that, Includes the following steps: Acquire images of the underwater structures to be detected; A lightweight geometrically adaptive semantic segmentation network consisting of an encoder and a segmentation decoder is constructed. A deformable convolutional network module is introduced in the deep feature extraction stage of the encoder, and a coordinate attention module is embedded in the multi-scale skip connection feature fusion node of the segmentation decoder. We use known multi-source heterogeneous datasets to train a lightweight geometric adaptive semantic segmentation network through four stages of transfer learning. The four stages include an underwater environment initialization stage for solidifying the underlying light and shadow features, a general crack semantic learning stage for learning structural morphology, an unsupervised underwater environment adaptation stage for compensating for target domain-specific noise, and a target domain small sample fine-tuning stage for accurately aligning classification boundaries. The trained geometric adaptive semantic segmentation network is used to detect underwater structural cracks in underwater structural images.
2. The underwater structure crack detection method based on transfer learning and physics guidance as described in claim 1, characterized in that, The deformable convolution module not only learns the sampling weights of the convolution kernel, but also learns the spatial two-dimensional offset and modulation scalar of each sampling point on the feature map through an additional parallel convolutional layer, dynamically adjusting the sampling position of the convolution kernel, and outputting a deep semantic feature tensor with geometric deformation adaptive capability.
3. The underwater structure crack detection method based on transfer learning and physics guidance as described in claim 1, characterized in that, At each feature fusion point at each scale, the segmentation decoder concatenates the corresponding high-resolution shallow features output by the encoder with the deep features upsampled by the segmentation decoder through bilinear interpolation in the channel dimension, and then inputs them into the coordinate attention module.
4. The underwater structure crack detection method based on transfer learning and physics guidance as described in claim 1, characterized in that, The coordinate attention module first performs one-dimensional global average pooling on the concatenated input feature tensor along both the horizontal and vertical spatial dimensions to generate a pair of feature encoding vectors containing precise location information and orientation awareness. Next, the pair of feature encoding vectors are concatenated along the spatial dimension, and then 1×1 convolutions are used for channel dimensionality reduction and non-linear activation. Subsequently, the features are separated again, and another 1×1 convolution is used to restore the number of channels, followed by a Sigmoid activation function to generate spatial attention weight maps in the horizontal and vertical directions. Finally, the attention weight maps in both directions are multiplied element-wise with the original input features through a tensor broadcasting mechanism to achieve reweighting in both the channel and spatial dimensions.
5. The underwater structure crack detection method based on transfer learning and physics guidance as described in claim 1, characterized in that, Known multi-source heterogeneous datasets include underwater scene image datasets for providing basic underwater optical degradation backgrounds, general land crack image datasets with annotations for providing cross-domain invariant morphological features, unlabeled underwater target domain image datasets for learning the scattering noise distribution of target water areas, and underwater crack image datasets with pixel-level mask annotations for finally anchoring classification boundaries.
6. The underwater structure crack detection method based on transfer learning and physics guidance as described in claim 5, characterized in that, In the underwater environment initialization stage, a lightweight geometric adaptive semantic segmentation network is trained using an underwater scene image dataset. During backpropagation, the parameters of the first two residual stages of the backbone network are frozen, and only the parameters of the third and fourth residual stages and the segmentation decoder are updated. The general crack semantic learning stage continues training using a general land crack image dataset with annotations, and unfreezes the parameters of the third residual stage of the backbone network. In the unsupervised underwater environment adaptation phase, all parameters of the backbone network and the segmentation decoder parameters are completely frozen using an unlabeled underwater target domain image dataset, and only the domain adapter and reconstruction decoder are activated and trained. In the target domain small sample fine-tuning stage, the first three residual stages of the backbone network are completely frozen using an underwater crack image dataset with pixel-level mask annotations. Only the fourth residual stage of the backbone network, the domain adapter, and the segmentation decoder are unfrozen for final classification boundary alignment.
7. The underwater structure crack detection method based on transfer learning and physics guidance as described in claim 1, characterized in that, In the target domain few-sample fine-tuning stage, the prior probability map of physical line segment detection is extracted from the underwater crack image dataset with pixel-level mask annotations. A physical-guided soft spatial weighted loss function is constructed, and the structural response of the physical line segment is transformed into gradient penalty weights. Combined with the starting point regularization strategy and degradation perception course learning based on image quality assessment, the parameters of the semantic segmentation network that were not frozen in the target domain few-sample fine-tuning stage are jointly optimized to obtain the trained semantic segmentation network.
8. An underwater structure crack detection system based on transfer learning and physics guidance, characterized in that, include: The data acquisition module is configured to acquire images of the underwater structures to be detected; The model building module is configured to build a lightweight geometrically adaptive semantic segmentation network that includes an encoder and a segmentation decoder. A deformable convolutional network module is introduced in the deep feature extraction stage of the encoder, and a coordinate attention module is embedded in the multi-scale skip connection feature fusion node of the segmentation decoder. The model training module is configured to perform four-stage transfer learning training on the lightweight geometric adaptive semantic segmentation network using known multi-source heterogeneous datasets. The four stages include an underwater environment initialization stage for solidifying the underlying light and shadow features, a general crack semantic learning stage for learning structural morphology, an unsupervised underwater environment adaptation stage for compensating for target domain-specific noise, and a target domain small sample fine-tuning stage for accurately aligning classification boundaries. The crack detection module is configured to use a trained geometrically adaptive semantic segmentation network to detect underwater structure cracks in the underwater structure image to be detected.
9. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program adapted to be loaded by a processor and executed as described in any one of claims 1-7, the underwater structure crack detection method based on transfer learning and physics guidance.
10. A computer device, characterized in that, include: A processor, adapted to execute computer programs; A computer-readable storage medium storing a computer program, which, when executed by the processor, implements the underwater structure crack detection method based on transfer learning and physics guidance as described in any one of claims 1-7.