A method, system, and medium for segmenting underwater dam defects
By constructing a defect instance segmentation model, the problem of accurate positioning and segmentation of underwater defects in dams in complex environments was solved, achieving high-precision defect detection and segmentation, and enhancing the robustness and adaptability of the model.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- HANGZHOU WATER RES & HYDROPOWER SURVEY & DESIGN INST
- Filing Date
- 2026-07-01
- Publication Date
- 2026-07-31
AI Technical Summary
Existing technologies struggle to accurately locate, classify, and segment dam defects in complex underwater environments, and suffer from problems such as strong noise interference, blurred boundaries, target occlusion, and difficulty in characterizing fine-grained features of small targets.
A disease instance segmentation model is constructed by using the Mask DINO basic network, combined with an adaptive collaborative feature mapping module, an improved denoising module, and a structural compensation pyramid module. This improves the model's sensitivity to small-scale diseases, its ability to distinguish categories, and its ability to reconstruct fine-grained boundaries, and enhances its robustness to structural damage and local occlusion.
It improves the detection, localization, and pixel-level instance segmentation accuracy of underwater defects in dams, enhances the robustness and generalization ability of the model in complex underwater scenarios, and improves segmentation accuracy and stability.
Smart Images

Figure CN122492697A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of underwater dam defect instance segmentation technology, and in particular to a method, system and medium for underwater dam defect instance segmentation. Background Technology
[0002] Hydropower dams, as crucial infrastructure for flood control, water supply, irrigation, navigation, and hydropower generation, play a vital role in socio-economic development and energy supply through their safe and stable operation. However, dams operate under complex environments and are susceptible to various factors such as water pressure, material aging, temperature variations, and external loads. These factors can lead to defects such as cracks, spalling, voids, and exposed rebar on the dam surface and in local structural areas. These defects not only weaken the overall integrity and durability of the dam structure but may also expand, impacting its long-term operational safety. Therefore, timely and accurate acquisition of information on the location, shape, and extent of these defects is essential for ensuring the safe operation of dams.
[0003] Traditional underwater dam defect analysis primarily relies on manual inspections or detection methods based on ordinary image processing. However, these methods suffer from low recognition efficiency, insufficient automation, strong subjectivity, and poor adaptability to complex underwater environments, making it difficult to meet the demands for high-precision, intelligent inspections. In recent years, with the development of deep learning technology, target recognition and semantic segmentation methods have been gradually applied to the field of dam defect analysis. While target recognition methods can classify defects, they struggle to accurately depict key information such as the size, shape, and boundaries of defects. Semantic segmentation methods, although capable of pixel-level recognition and improved boundary segmentation accuracy, struggle to distinguish adjacent or overlapping instances of the same type of defect, limiting their application in complex scenarios. Furthermore, underwater environments commonly present problems such as strong noise interference, light attenuation, texture degradation, blurred boundaries, target occlusion, and difficulty in representing fine-grained features of small targets. This leads to shortcomings in existing instance segmentation methods in underwater dam defect images, including feature imbalance, insufficient mask structure recovery capability, and poor structural continuity, making it difficult to simultaneously achieve accurate defect target localization, category differentiation, and pixel-level instance segmentation. Therefore, developing a method for segmenting underwater dam defects that can adapt to complex underwater environments and take into account multi-scale feature representation, structural compensation, and mask robustness has become an urgent technical problem to be solved in this field. Summary of the Invention
[0004] The purpose of this invention is to overcome the shortcomings of the prior art and provide a method, system and medium for segmenting underwater dam defects. This method can effectively address problems such as strong noise interference, blurred boundaries, target occlusion, texture degradation and difficulty in representing fine-grained features of small targets in the underwater environment. It improves the detection, localization and pixel-level instance segmentation accuracy of underwater dam defects, enhances the robustness and generalization ability of the model in complex underwater scenarios, and provides reliable technical support for underwater safety inspection and intelligent perception of dams.
[0005] To achieve the above objectives, the present invention is implemented using the following technical solution: On the one hand, the present invention provides a method for segmenting underwater defects in dams, including: Obtain raw underwater images of dam defects; The original underwater dam damage image is input into a pre-constructed damage instance segmentation model, and the underwater dam damage instance segmentation result is output. The construction of the disease instance segmentation model includes: Obtain the basic network for Mask DINO; An adaptive collaborative feature mapping module, an improved denoising module, and a structural compensation pyramid module are introduced into the Mask DINO basic network to obtain a well-constructed disease instance segmentation model.
[0006] Optionally, the processing steps of the disease instance segmentation model include: The backbone network was used to extract features from the original underwater dam images to obtain multi-scale feature maps. The multi-scale feature map is input into the encoder module for global context modeling to obtain the encoder output features; The encoder output features are input to the structural compensation pyramid module for structural enhancement. The enhanced features are further enhanced by the adaptive collaborative feature mapping module; The initial query generator is used to construct an initial query and an initial anchor box based on the encoder output, and the initial query and initial anchor box are input into the decoder; By interacting with the query embedding output by the decoder and the enhanced features, the disease category, bounding box, and pixel-level instance mask are output to obtain the underwater disease instance segmentation result of the dam.
[0007] Optionally, the adaptive collaborative feature mapping module includes: The input features are divided along the channel dimension into a first part of features for modeling spatial geometry-sensitive features and a second part of features for channel semantic enhancement. Multiple sets of convolutions are performed on the first part of the features, and the orientation sensitivity is enhanced by cascaded 3×1 convolutions and 1×3 convolutions; The first part of the features is convolved point by point to restore the channel dimension, and a spatial saliency response map is generated through the convolution operation. The features are then weighted pixel by pixel. Channel semantic enhancement is performed on the second part of the features to selectively enhance channels with key semantic contributions and suppress invalid channels; The output features are obtained by adaptively weighting and fusing the spatial saliency mapping results and the channel semantic enhancement results using learnable gating coefficients.
[0008] Optionally, the adaptive collaborative feature mapping module dynamically adjusts the feature contribution ratio according to the semantic saliency of the disease area through an adaptive collaborative mapping mechanism between the spatial domain and the channel domain, so as to improve the model's sensitivity to small-scale diseases, category discrimination ability, and fine-grained boundary reconstruction ability.
[0009] Optionally, the improved denoising module is a mask-aware denoising module, which includes: Construct noisy queries based on the actual labeled bounding boxes, category labels, and instance masks; Spatial downsampling is performed on the instance mask, and the category labels are converted into One-Hot encoding and then broadcast along the spatial dimension to construct a joint semantic mask; One or more noises, such as Gaussian structure perturbation, random occlusion, and random affine transformation, are introduced into the joint semantic mask to obtain a noisy mask. Global average pooling and linear projection are performed on the noisy mask to map the features to the decoder embedding space. The mask morphological features, along with the label semantic prior and the bounding box prior, are used to form a denoising query input decoder to improve the model's robustness to structural damage, local occlusion, blurred boundaries, and missing regions.
[0010] Optionally, the Gaussian structure perturbation is used to simulate mask structure noise, the random occlusion is used to simulate local missing or occluded situations in the target area, and the random affine transformation is used to simulate changes in viewpoint and geometric deformation of the lesion contour; the improved denoising module is only used during the training phase to improve the robustness and generalization ability of instance mask prediction without increasing the number of model parameters and inference computation overhead.
[0011] Optionally, the structural compensation pyramid module includes: We utilize multi-scale encoder features for bottom-up structural compensation and top-down semantic feedback. The low-resolution features are upsampled and aligned with the medium-resolution features, and then fused through the statistical feature self-attention module to generate enhanced features; The enhanced features are further upsampled and fused with the high-resolution features through a high-frequency feature enhancement module to obtain structural compensation features; After upsampling the structural compensation features, they are fused with the high-resolution backbone features through residual connections to obtain the enhanced shallow features. The enhanced features and shallow features are respectively embedded and interacted with the instance query of the decoder to form complementary prediction branches, thereby improving the topological continuity and segmentation integrity of slender, discontinuous and weakly textured disease areas.
[0012] Optionally, the high-frequency feature enhancement module includes: High-resolution features are fused with intermediate semantic features element by element; The fused features are transformed to the frequency domain using discrete cosine transform. Construct a high-pass filter to suppress low-frequency background information and highlight mid-to-high frequency details; High-frequency features are restored to the spatial domain using inverse discrete cosine transform. The restored high-frequency features are enhanced in both the channel and spatial dimensions, and the enhanced results are spliced and fused before being output as the final features through a convolutional layer.
[0013] Optionally, the statistical feature self-attention module infers dependencies by extracting second-order statistics from multiple learnable subspaces of the input token sequence, and models global structural associations without explicitly constructing an attention matrix, thereby enhancing cross-regional geometric consistency and robustness to noise and missing regions.
[0014] Optionally, the training of the disease instance segmentation model includes: The underwater dam defect image data was obtained by extracting video frames collected by an underwater robot, and instance-level bounding boxes and masks were annotated for each image. The image data undergoes data augmentation processing, including cropping and flipping. The enhanced image data is divided into a training set and a test set; The AdamW optimizer is used to train the disease instance segmentation model to obtain the trained disease instance segmentation model.
[0015] Optionally, the disease instance segmentation model is trained using a combination of classification loss, bounding box loss, and mask loss; wherein the classification loss uses Focal Loss, the bounding box loss uses L1 loss and GIoU loss, and the mask loss uses BCE loss and Dice loss.
[0016] Secondly, the present invention provides a system for segmenting underwater defects in dams, comprising: The image acquisition module is used to acquire raw underwater images of dam defects; The instance segmentation module is used to input the original underwater dam disease image into a pre-constructed disease instance segmentation model and output the underwater dam disease instance segmentation result. The model building module is used to build the disease instance segmentation model; The model building module is used to obtain the Mask DINO base network, and introduce an adaptive collaborative feature mapping module, an improved denoising module, and a structural compensation pyramid module into the Mask DINO base network to obtain a constructed disease instance segmentation model.
[0017] Thirdly, the present invention provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of the method for segmenting underwater dam defects as described in the first aspect.
[0018] Compared with the prior art, the beneficial effects achieved by the present invention are as follows: Compared with existing technologies, this invention constructs a disease instance segmentation model based on Mask DINO and introduces an adaptive collaborative feature mapping module, an improved denoising module, and a structural compensation pyramid module. This effectively improves the detection, localization, and pixel-level instance segmentation capabilities of disease targets in complex underwater environments. Specifically, the adaptive collaborative feature mapping module enhances the representation ability of small-scale diseases and fine-grained boundaries, the improved denoising module improves the model's robustness to occlusion, boundary blurring, and structural damage, and the structural compensation pyramid module improves the structural continuity and boundary refinement effect of slender, discontinuous, and weakly textured disease regions. Thus, without significantly increasing computational overhead, the overall segmentation accuracy, stability, and generalization ability of the model are improved, demonstrating good engineering application value. Attached Figure Description
[0019] Figure 1 The diagram shown is a flowchart of one embodiment of the method for segmenting underwater dam defects according to the present invention. Figure 2 The diagram shown is a structural schematic of the initial query generator module in one embodiment of the present invention; Figure 3 The diagram shown is a schematic representation of the adaptive collaborative feature mapping structure in one embodiment of the present invention. Figure 4 The diagram shown is a structural schematic of the improved noise reduction module in one embodiment of the present invention; Figure 5 The diagram shown is a schematic representation of the high-frequency feature enhancement module in one embodiment of the present invention. Figure 6 The diagram shown is a structural schematic of the self-attention module for token statistical features in one embodiment of the present invention. Detailed Implementation
[0020] The technical solution of the present invention will be described in detail below with reference to the accompanying drawings and specific embodiments. It should be understood that the embodiments of the present invention and the specific features in the embodiments are detailed descriptions of the technical solution of the present invention, rather than limitations thereof. In the absence of conflict, the embodiments of the present invention and the technical features in the embodiments can be combined with each other.
[0021] The term "and / or" simply describes the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A alone, A and B simultaneously, or B alone. Additionally, the character " / " generally indicates that the preceding and following related objects have an "or" relationship. Example 1
[0022] like Figure 1 As shown in the figure, this embodiment introduces a method for segmenting underwater defects in dams. It can solve the problem that existing underwater defect analysis methods cannot simultaneously achieve accurate positioning of defect targets, classification of categories, and pixel-level instance segmentation. It can also effectively cope with situations such as strong noise interference, blurred boundaries, target occlusion, texture degradation, and difficulty in representing fine-grained features of small targets in the underwater environment. This improves the detection, positioning, and instance segmentation accuracy of defects such as cracks, spalling, holes, and exposed rebar, and provides reliable technical support for underwater safety inspection and intelligent sensing of dams.
[0023] The method includes the following steps: Step 1: Obtain raw underwater images of dam defects, specifically: Underwater video data was collected at the hydroelectric dam site using an underwater robot. The collected video was then processed by frame extraction to obtain raw underwater images of dam defects. These images were then organized and manually labeled to construct a dataset of underwater defect instances. To enhance data diversity and improve model generalization ability, further data augmentation processing, such as cropping and flipping, was performed on the images.
[0024] In this embodiment, the self-built underwater dam defect dataset contains 2319 images with a resolution of 1280×800 pixels, including four typical defects: cracks, spalling, holes, and exposed rebar. Each image is manually annotated using Labelme, with a bounding box and mask labeled for each defect instance. The dataset is divided into a training set (80%) and a test set (20%).
[0025] Step 2: Input the original underwater dam damage image into the pre-built damage instance segmentation model, and output the underwater dam damage instance segmentation results, specifically: The disease instance segmentation model is constructed based on an improved Mask DINO network. Given an input image, multi-scale feature maps res2, res3, res4, and res5 are first extracted using a ResNet-50 backbone network. These multi-scale features are then input into the encoder module for global context modeling and recovery into multi-scale feature representations. Next, the multi-scale features are input into a structure compensation pyramid module for structural enhancement, followed by further enhancement via a 3×3 depthwise separable convolution and adaptive collaborative feature mapping module. Simultaneously, an initial query generator is used to generate initial queries and initial anchor boxes based on the encoder output, and these are input into the decoder. The structure of the initial query generator module is as follows: Figure 2 As shown, the final query embedding output by the decoder interacts with the enhanced features to obtain the disease category, bounding box, and pixel-level instance mask, thereby outputting the underwater disease instance segmentation result of the dam.
[0026] Furthermore, in this embodiment, the initial query generator generates dense candidate regions based on multi-scale features, outputs candidate box coordinates and their corresponding semantic features, and refines the target center position and scale by predicting coordinate offsets. Then, the classification head calculates the foreground confidence and filters Top-K foreground candidates, where the candidate boxes serve as initial anchor boxes and the semantic features serve as initial query content, providing spatial priors and high-level semantic information for the decoder.
[0027] Step 3: Perform feature enhancement using the adaptive collaborative feature mapping module, such as... Figure 3 As shown, specifically: To address the shortcomings of Transformer-based instance segmentation methods in multi-scale feature fusion and fine-grained target perception, this embodiment introduces an adaptive collaborative feature mapping module. This module first divides the input features along the channel dimension into two parts: one for spatial geometry-sensitive feature modeling and the other for channel semantic enhancement. For the spatial branch, orientation-sensitive geometric texture features are extracted through multiple sets of convolutions, cascaded 3×1 convolutions, and 1×3 convolutions. The channel dimension is then restored using pointwise convolutions, and a spatial saliency response map is generated and weighted pixel-wise. For the channel branch, channels with key semantic contributions are selectively enhanced through channel semantic enhancement operations, while invalid and interfering channels are suppressed. Finally, learnable gating coefficients are used to adaptively weight and fuse the spatial saliency mapping result and the channel semantic enhancement result to obtain the output features. This module improves the model's sensitivity to small and medium-scale diseases and its ability to reconstruct fine-grained boundaries.
[0028] Step 4: Enhance the robustness of the mask structure using an improved denoising module, such as... Figure 4 As shown, specifically: To address the limitations of traditional denoising training methods that rely solely on category noise and bounding box noise, which struggle to adequately adapt to underwater target defects such as shape damage, partial occlusion, and blurred boundaries, this embodiment introduces an improved denoising module: the mask-aware denoising module. During the training phase, this module constructs a noisy query based on the ground truth bounding boxes, category labels, and instance masks. First, the instance mask is spatially downsampled to reduce computational and memory overhead. Then, the instance category labels are converted to One-Hot encoding and broadcast along the spatial dimension to construct a joint semantic mask. Subsequently, Gaussian structure perturbation, random occlusion, and random affine transformation are sequentially introduced onto the joint semantic mask to simulate structural noise, region missingness, target occlusion, and geometric deformation that may occur with targets in real-world scenarios. Finally, the noisy mask is globally averaged and linearly projected onto the decoder embedding space, and together with the label semantic prior and bounding box prior, it forms the denoised query input decoder, improving the model's ability to recover the mask structure and refine boundaries. This module is used only during the training phase and does not increase the number of model parameters or inference computational overhead.
[0029] Step 5: Perform multi-scale structural compensation using the structural compensation pyramid module, specifically as follows: To address the issue that traditional feature pyramid networks tend to weaken the structural information of small targets, blur boundaries, and cause semantic shifts after multiple downsampling, this embodiment introduces a structure compensation pyramid module. This module utilizes multi-scale encoder features F0, F1, and F2 to achieve bidirectional enhancement through upward semantic feedback and downward structural compensation. Specifically, firstly, the low-resolution feature F0 is upsampled and aligned with the medium-resolution feature F1, then fused using a token statistical feature self-attention module to generate an enhanced feature G1. Subsequently, G1 is further upsampled and fused with the high-resolution feature F2 using a high-frequency feature enhancement module to obtain the structure compensation feature G2. G2 is then upsampled again and fused with the high-resolution backbone feature res2 through residual connections to obtain the enhanced shallow features. During the decoding stage, the enhanced features and shallow features interact with the decoder instance query embedding to form complementary prediction branches, thereby improving the structural continuity and segmentation integrity of elongated, discontinuous, and weakly textured disease areas.
[0030] Furthermore, such as Figure 5 As shown, the high-frequency feature enhancement module first fuses high-resolution features and intermediate semantic features element-wise, then transforms the fused features to the frequency domain using discrete cosine transform. A high-pass filter is used to suppress low-frequency background information and highlight mid-to-high-frequency details. Afterwards, an inverse discrete cosine transform is used to restore the feature to the spatial domain, and enhancements are performed in both the channel and spatial dimensions. Finally, the results are output through concatenation and convolution to improve the model's sensitivity to edge details and small target structures. Figure 6As shown, the token statistical feature self-attention module infers dependencies by extracting second-order statistics from multiple learnable subspaces of the input token sequence. It models global structural associations without explicitly constructing an attention matrix, thereby enhancing cross-regional geometric consistency and robustness to noise, deformation, and missing regions.
[0031] Step Six: Train and test the disease instance segmentation model, specifically as follows: This embodiment was tested on an Ubuntu 22.04 operating system, using the PyTorch 1.13.0 framework and Python 3.8 language. The hardware platform included an Intel Core i5-10400F processor, an Nvidia GeForce RTX3090 graphics card, and 32GB of DDR4 memory. During training, the batch size was set to 4, the number of training epochs was set to 200, the optimizer was AdamW, the learning rate was set to 0.0001, and the gradient clipping threshold was set to 0.01. To verify the model's generalization ability, comparative experiments were also conducted on the TrashCan public dataset.
[0032] In this embodiment, ablation experiments were conducted to verify the contributions of the adaptive collaborative feature mapping module, the improved denoising module, and the structural compensation pyramid module to the improvement of model performance. When all three modules were introduced simultaneously, the number of model parameters was 39.87M, the FLOPS was 0.257T, and the AP reached 49.34%, which is 4.31% higher than the baseline Mask DINO. The AP75, APS, APM, and APL reached 53.29%, 22.43%, 32.57%, and 59.05%, respectively, indicating that the method in this embodiment has good segmentation accuracy, robustness, and generalization ability while maintaining moderate model complexity. Example 2
[0033] Based on Example 1, this example introduces a system for segmenting underwater dam defects, including: The image acquisition module is used to acquire raw underwater images of dam defects; The instance segmentation module is used to input the original underwater dam disease image into a pre-constructed disease instance segmentation model and output the underwater dam disease instance segmentation result. The model building module is used to construct the disease instance segmentation model; wherein, the model building module is used to obtain the Mask DINO basic network, and introduce an adaptive collaborative feature mapping module, an improved denoising module, and a structural compensation pyramid module into the Mask DINO basic network to obtain the constructed disease instance segmentation model.
[0034] The specific functions of each module described above are explained in the relevant content of the methods in Embodiment 1 or 2, and will not be repeated here. Example 3
[0035] This embodiment introduces a computer-readable storage medium storing a computer program that, when executed by a processor, implements the steps of the underwater dam defect instance segmentation method described in Embodiment 1.
[0036] Those skilled in the art will understand that embodiments of this application can be provided as methods, systems, or computer program products. Therefore, this application can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, this application can take the form of a computer program product embodied on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0037] This application is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of this application. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart... Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.
[0038] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.
[0039] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.
[0040] The embodiments of the present invention have been described above with reference to the accompanying drawings. However, the present invention is not limited to the specific embodiments described above. The specific embodiments described above are merely illustrative and not restrictive. Those skilled in the art can make many other forms under the guidance of the present invention without departing from the spirit and scope of the claims. All of these forms are within the protection scope of the present invention.
Claims
1. A dam underwater disease instance segmentation method, characterized in that, include: Obtain raw underwater images of dam defects; The original underwater dam damage image is input into a pre-constructed damage instance segmentation model, and the underwater dam damage instance segmentation result is output. The construction of the disease instance segmentation model includes: Obtain the basic network for Mask DINO; An adaptive collaborative feature mapping module, an improved denoising module, and a structural compensation pyramid module are introduced into the Mask DINO basic network to obtain a well-constructed disease instance segmentation model.
2. The dam underwater disease instance segmentation method according to claim 1, characterized in that, The processing steps of the disease instance segmentation model include: The backbone network was used to extract features from the original underwater dam images to obtain multi-scale feature maps. The multi-scale feature map is input into the encoder module for global context modeling to obtain the encoder output features; The encoder output features are input to the structural compensation pyramid module for structural enhancement. The enhanced features are further enhanced by the adaptive collaborative feature mapping module; The initial query generator is used to construct an initial query and an initial anchor box based on the encoder output, and the initial query and initial anchor box are input into the decoder; By interacting with the query embedding output by the decoder and the enhanced features, the disease category, bounding box, and pixel-level instance mask are output to obtain the underwater disease instance segmentation result of the dam.
3. The dam underwater disease instance segmentation method of claim 2, wherein, The adaptive collaborative feature mapping module includes: The input features are divided along the channel dimension into a first part of features for modeling spatial geometry-sensitive features and a second part of features for channel semantic enhancement. Multiple sets of convolutions are performed on the first part of the features, and the orientation sensitivity is enhanced by cascaded 3×1 convolutions and 1×3 convolutions; The first part of the features is convolved point by point to restore the channel dimension, and a spatial saliency response map is generated through the convolution operation. The features are then weighted pixel by pixel. Channel semantic enhancement is performed on the second part of the features to selectively enhance channels with key semantic contributions and suppress invalid channels; The output features are obtained by adaptively weighting and fusing the spatial saliency mapping results and the channel semantic enhancement results using learnable gating coefficients.
4. The dam underwater disease instance segmentation method of claim 3, wherein, The adaptive collaborative feature mapping module dynamically adjusts the feature contribution ratio according to the semantic saliency of the disease area through an adaptive collaborative mapping mechanism between the spatial domain and the channel domain, so as to improve the model's sensitivity to small-scale diseases, category discrimination ability, and fine-grained boundary reconstruction ability.
5. The dam underwater disease instance segmentation method of claim 1, wherein, The improved denoising module is a mask-aware denoising module, which includes: Construct noisy queries based on the actual labeled bounding boxes, category labels, and instance masks; Spatial downsampling is performed on the instance mask, and the category labels are converted into One-Hot encoding and then broadcast along the spatial dimension to construct a joint semantic mask; Gaussian noise, random occlusion, and random affine transformation noise are introduced into the joint semantic mask to obtain a noisy mask; Global average pooling and linear projection are performed on the noisy mask to map the features to the decoder embedding space. The mask morphological features, along with the label semantic prior and the bounding box prior, are used to form a denoising query input decoder to improve the model's robustness to structural damage, local occlusion, blurred boundaries, and missing regions. The Gaussian structure perturbation is used to simulate the structural noise of the mask, the random occlusion is used to simulate the local missing or occluded situation of the target area, and the random affine transformation is used to simulate the change of viewpoint and the geometric deformation of the disease outline. The improved denoising module is only used in the training phase to improve the robustness and generalization ability of instance mask prediction without increasing the number of model parameters and inference computation overhead.
6. The dam underwater disease instance segmentation method of claim 2, wherein, The structural compensation pyramid module includes: We utilize multi-scale encoder features for bottom-up structural compensation and top-down semantic feedback. The low-resolution features are upsampled and aligned with the medium-resolution features, and then fused using the token statistical feature self-attention module to generate enhanced features; The enhanced features are further upsampled and fused with the high-resolution features through a high-frequency feature enhancement module to obtain structural compensation features; After upsampling the structural compensation features, they are fused with the high-resolution backbone features through residual connections to obtain the enhanced shallow features. The enhanced features and shallow features are respectively embedded and interacted with the instance query of the decoder to form complementary prediction branches, thereby improving the topological continuity and segmentation integrity of slender, discontinuous and weakly textured disease areas.
7. The structure-compensated pyramid module module of claim 6, wherein, include: The high-frequency feature enhancement module includes: fusing high-resolution features and intermediate semantic features element-wise; converting the fused features to the frequency domain using discrete cosine transform; constructing a high-pass filter to suppress low-frequency background information and highlight mid-to-high-frequency details; restoring the high-frequency features to the spatial domain using inverse discrete cosine transform; enhancing the restored high-frequency features in both the channel and spatial dimensions, and then concatenating and fusing the enhancement results before outputting the final features through a convolutional layer. The token statistical feature self-attention module includes: inferring dependencies by extracting second-order statistics of the input token sequence from multiple learnable subspaces, and modeling global structural associations without explicitly constructing an attention matrix, so as to enhance cross-regional geometric consistency and robustness to noise and missing regions.
8. The dam underwater disease instance segmentation method of claim 1, wherein, The training of the disease instance segmentation model includes: The underwater dam defect image data was obtained by extracting video frames collected by an underwater robot, and instance-level bounding boxes and masks were annotated for each image. The image data undergoes data augmentation processing, including cropping and flipping. The enhanced image data is divided into a training set and a test set; The AdamW optimizer is used to train the disease instance segmentation model to obtain the trained disease instance segmentation model. The disease instance segmentation model is trained using a combination of classification loss, bounding box loss, and mask loss; the classification loss uses Focal Loss, the bounding box loss uses L1 loss and GIoU loss, and the mask loss uses BCE loss and Dice loss.
9. A system for segmenting underwater defects in dams, characterized in that, include: The image acquisition module is used to acquire raw underwater images of dam defects; The instance segmentation module is used to input the original underwater dam disease image into a pre-constructed disease instance segmentation model and output the underwater dam disease instance segmentation result. The model building module is used to build the disease instance segmentation model; The model building module is used to obtain the Mask DINO base network, and introduce an adaptive collaborative feature mapping module, an improved denoising module, and a structural compensation pyramid module into the Mask DINO base network to obtain a constructed disease instance segmentation model.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, it implements the steps of the method for segmenting underwater dam defects as described in any one of claims 1 to 9.