A lightweight coastal dam crack segmentation method based on cross-space collaborative learning

Through the cross-space collaborative learning method, the mapping attention gate characteristics and multi-scale spatial characteristics of coastal embankment fractures are extracted, which solves the problems of inaccurate detection and large computing resource occupancy in the existing technology, and achieves efficient and accurate crack detection effects, and is suitable for resource-constrained environments.

CN119399217BActive Publication Date: 2025-04-01SANYA SCI & EDUCATION INNOVATION PARK WUHAN UNIV OF TECH +1
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202510007771.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-01-03
Publication Date
2025-04-01
Estimated Expiration
2045-01-03

AI Technical Summary

Technical Problem

The existing coastal dam crack detection methods have shortcomings in capturing the complementary advantages between spatial self-attention and channel-specific convolution, resulting in scale changes and intra-class changes, and the computing resource occupies a large amount, making it difficult to effectively apply in resource-constrained environments.

Method used

A cross-space collaborative learning method for splitting lightweight coastal embankment cracks is proposed, downsampling is performed through a three-layer encoder, unifying the number of channels and resolution, extracting the mapping attention gate features and gated signals for fusion, multi-scale spatial features are aggregating, and the segmentation results are obtained through output convolution processing.

Benefits of technology

It significantly enhances the image segmentation capability, can accurately capture the direction specificity and detailed boundary characteristics of sub-cracks, dynamically focus on related crack features, suppress background noise, improves segmentation efficiency and accuracy, and achieves competitive performance in resource-constrained environments.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119399217B_ABST
    Figure CN119399217B_ABST
Patent Text Reader

Abstract

The present invention provides a cross-space collaborative learning lightweight coastal dam crack segmentation method, step S1: downsampling through a three-layer encoder, unifying the number of channels and resolution, and obtaining a feature set; step S2: extracting the mapped attention gate features and gating signals of the feature set for fusion to obtain attention gating features; step S3: extracting multi-scale spatial features of the attention gating features, and aggregate output; step S4: processing the output result of step S3 through output convolution to obtain a segmentation result. With fewer parameters and lower computational requirements, the efficiency and accuracy of segmentation are significantly improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of coastal dam crack identification, and in particular to a cross-space collaborative learning lightweight coastal dam crack segmentation method. Background Art

[0002] The safe maintenance of dams has become the key to ensuring ecological security and flood prevention and disaster reduction. Dam cracks not only threaten structural stability, but may also have serious impacts on the ecosystem. In the context of real-time monitoring needs and the widespread application of edge computing devices, crack detection faces challenges such as changing directions and complex edges, and an efficient, accurate and lightweight detection solution is urgently needed.

[0003] Deep learning provides a new approach to dam crack detection. The deep learning-based monitoring system combined with edge devices such as drones and underwater robots can realize intelligent crack identification and precise positioning, significantly improving monitoring coverage and efficiency. However, traditional neural networks have high hardware resource requirements, which limits their application in resource-constrained scenarios, especially in underwater detection. The development of lightweight, high-performance crack detection models has become the focus of current research to meet the needs of real-time and efficient detection on portable devices.

[0004] The growth direction of cracks changes frequently, and the direction of sub-cracks is difficult to judge. At the same time, when considering the edge non-crack area, ambiguity is still inevitable, and there are heterogeneous textures and segmentation uncertainties. That is, unlike the solid objects in natural images, the contrast between crack and non-crack areas is low, and the crack / non-crack features are mixed and close to the class boundary. Therefore, we should not only focus on learning crack boundaries, but also consider the narrow directionality of cracks and the linear connectivity of sub-cracks.

[0005] Currently, methods such as coordinate attention (CA), efficient multi-scale attention (EMA), and edge learning attention (ELA) have been widely used to enhance feature representation. These methods have achieved certain results by integrating spatial and channel attention and combining some data enhancement techniques. However, in the practical application of coastal dam crack detection, these methods still face the following challenges:

[0006] 1. Limitations of parallel spatial channel attention structures: Many parallel spatial channel attention structures are insufficient in capturing the complementary advantages between spatial self-attention and channel-specific convolutions, and do not attempt to utilize the directional and positional information of sub-cracks, which will lead to scale changes and intra-class changes;

[0007] 2. Problems with the serial attention architecture: The serial attention architecture forces all channels to share the same spatial attention weights. This design reduces the model’s ability to capture long-range dependencies;

[0008] 3. Limited computing resources: Existing methods attempt to reduce the complexity of the model by reducing the number of convolutional layers and compressing channels. However, these simplifications will lose spatial details and long-range dependencies;

[0009] 4. Complexity of crack features: Coastal embankment cracks have the characteristics of variable directions, complex edges, and fine-grained structures, especially in the case of low contrast and blurred edges, which further increases the difficulty of capturing these features.

[0010] In summary, although the existing attention mechanism and data augmentation technology have made some progress in enhancing feature representation, there are still many challenges in the specific application of coastal embankment crack detection. It is necessary to continue to explore more efficient and accurate crack detection methods to cope with these complexities and challenges. Summary of the invention

[0011] The present invention proposes a cross-space collaborative learning lightweight coastal dam crack segmentation method to solve the technical problems of inaccurate segmentation and large computing resource occupation of existing crack segmentation methods.

[0012] To solve the above technical problems, the present invention provides a cross-space collaborative learning lightweight coastal dam crack segmentation method, comprising the following steps:

[0013] Step S1: Down-sampling is performed through a three-layer encoder, and the number of channels and resolution are unified to obtain a feature set;

[0014] Step S2: extracting the mapped attention gate feature of the feature set and the gating signal for fusion to obtain the attention gating feature;

[0015] Step S3: extracting multi-scale spatial features of the attention gating feature and aggregating the outputs;

[0016] Step S4: The output result of step S3 is processed by output convolution to obtain a segmentation result.

[0017] Preferably, the expression for unifying the number of channels and the resolution in step S1 is:

[0018] ;

[0019] In the formula, Indicates The unified features; represents max pooling kernels of size 4, 2, and 1; Refers to a 3×3×3 convolutional block; Indicates The features obtained by downsampling.

[0020] Preferably, the expression of the gating signal in step S2 is:

[0021] ;

[0022] In the formula, Conv is a 3×3 convolution; GN means group normalization; Represents the input feature set; ⊕ represents feature aggregation.

[0023] Preferably, the attention gating feature The expression is:

[0024] ;

[0025] In the formula, SeLU and SoftMax represent activation functions; Represents the input feature set.

[0026] Preferably, in step S3, the method for extracting multi-scale spatial features of the attention gating feature includes:

[0027] Step S311: dividing the attention gate feature into a plurality of sub-feature groups along the channel dimension;

[0028] Step S312: inputting the sub-feature group into the space branch and the channel branch;

[0029] The spatial branch applies global average pooling to generate complementary sub-features in the horizontal and vertical directions, and uses group normalization to perform semantic consistency operations to obtain a spatial attention map;

[0030] The channel branch combines the spatial attention map with the grouping feature to calculate the channel similarity, and enhances the multi-scale bottleneck feature through the spatial attention mechanism;

[0031] Step S313: Aggregate the results of the spatial branch and the channel branch to obtain an output result.

[0032] Preferably, in step S312, the expression of the spatial branching operation process is:

[0033] ;

[0034] In the formula, represents the spatial attention map; and Respectively represent the average pooling operations in the x direction (horizontal) and y direction (vertical); ⊕ represents feature aggregation; Represents the convolution operation; represents group convolution; Represents group normalization.

[0035] Preferably, in step S312 and step S313, the expressions of the channel branching operation and the aggregation process are for:

[0036] ;

[0037] ;

[0038] ;

[0039] ;

[0040] In the formula, represents the convolutional layer; Represents a transpose operation; represents the value matrix; represents the multi-scale spatial attention score matrix; SeLU represents the activation function; is the global space key matrix; A query vector representing the point of interest; Represents a reshape operation; and Represents the corresponding convolution operation; represents the reweighting process; Represents the SoftMax function.

[0041] Preferably, in step S4, the processing is performed by adaptive skip connection before the output convolution processing, and the expression is:

[0042] ;

[0043] In the formula, represents the output after aggregation in step S3; Represents the convolution operation; represents the output from the encoder of the skip connection; represents group convolution; represents the SeLU activation function; represents point-wise convolution; represents batch normalization; Represents a feature concatenation operation.

[0044] Preferably, the segmentation result of step S4 is evaluated by the amount of floating-point operations, the number of model parameters, the average intersection-over-union ratio, the precision and the recall rate, and is trained by an adaptive cost-sensitive loss function.

[0045] Preferably, the expression of the adaptive cost-sensitive loss function is:

[0046] ;

[0047] ;

[0048] In the formula, and Represents the set of true values ​​and predicted images in a batch; and Indicates The true value label and predicted probability of each pixel; represents Dice loss; parameter , and is a balancing hyperparameter; Represents the total number of samples in the batch.

[0049] The beneficial effects of the present invention include at least: the present invention combines the cross-space learning strategy guided by collaborative coordinates to significantly enhance the image segmentation capability. This method enables the model to accurately capture the directional specificity and detailed boundary features of sub-cracks. In addition, by introducing the mapping attention gate, the model can dynamically focus on relevant crack features while effectively suppressing the interference of background noise, significantly improving the efficiency and accuracy of segmentation. With fewer parameters and lower computational requirements, the remote spatial and positional information in the crack image is successfully extracted and integrated, and the crack identification of engineering structures can be applied to resource-constrained environments such as embedded devices, achieving competitive performance. BRIEF DESCRIPTION OF THE DRAWINGS

[0050] Figure 1 It is a schematic diagram of the process of cross-space collaborative learning of lightweight coastal dam crack segmentation model according to an embodiment of the present invention;

[0051] Figure 2 A schematic diagram for comparing the model processes of an embodiment of the present invention;

[0052] Figure 3 A schematic diagram of comparing experimental results of an embodiment of the present invention;

[0053] Figure 4 Schematic diagram of the comparison results of the attention paid to cracks by the CSA module of an embodiment of the present invention and other attention modules;

[0054] Figure 5 A schematic diagram showing the comparison of crack segmentation results between the model of the embodiment of the present invention and other models;

[0055] Figure 6 This is a schematic diagram of the comparison results between the model of the embodiment of the present invention and other models in terms of indicators such as inference time and FPS. DETAILED DESCRIPTION

[0056] The following is a clear and complete description of the technical solutions in the embodiments of the present invention in conjunction with the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work belong to the protection scope of the present invention.

[0057] Example 1

[0058] like Figure 1 As shown, an embodiment of the present invention provides a cross-space collaborative learning lightweight coastal dam crack segmentation method, comprising the following steps:

[0059] Step S1: Downsample through a three-layer encoder and unify the number of channels and resolution to obtain a feature set.

[0060] The crack segmentation model provided in this embodiment is mainly composed of four core components: adaptive multi-branch feature aggregation AMFA, mapping attention gate MAG and cross-space collaborative attention CSA.

[0061] Specifically, to address the problem of different scales of cracks in coastal embankments, a three-layer U-Net encoder is first used to extract crack image features, such as Figure 1 As shown in the figure, due to the different downsampling rates in different stages and the differences in the resolution and number of channels of the feature maps in each stage, the acquired three-layer features are mapped to a unified channel and resolution format and sent to the adaptive multi-branch feature aggregation AMFA module.

[0062] The input features from different branches are represented as , , where C represents the number of channels of the feature map (Channels), H Indicates the height of the feature map (Height), W Indicates the width of the feature map. Corresponding to the stage , using maximum pooling downsampling to ensure At the same time, the convolution operation adjusts the spatial alignment of the dimensions between to ensure consistency in size and number of channels across all three branches. Specifically, the feature tensor Downsampled by max pooling and then a convolution operation is applied to achieve size uniformity:

[0063] (1)

[0064] in represents max pooling kernels of size 4, 2, and 1, Refers to a 3×3×3 convolutional block.

[0065] Step S2: extract the mapped attention gate features of the feature set and fuse them with the gating signal to obtain the attention gating features.

[0066] The attention gated features are extracted by the mapping attention gate MAG constructed in this embodiment.

[0067] Specifically, in view of the complex background of coastal dam cracks, this embodiment proposes a novel mapping attention gate MAG mechanism, which uses the attention mechanism and gated signals to enhance the feature mapping within the neural network, making it particularly effective for the binary segmentation task of judging whether there are cracks in the coastal dam area. , two parallel processing branches are designed, which can work together to deeply fuse and integrate the attention coefficients of the early layers with the multi-scale features provided by the AMFA module, enhancing the activation signals closely related to the crack features while effectively suppressing the interference of background noise.

[0068] like Figure 1 As shown, the network learns a multi-level feature representation of the input image through convolutional layers. The gating signals generated by these high-level features guide the flow of information across branches, amplifying the activation of features closely related to cracks while suppressing features related to the background. In the activation function, a 3x3 group convolution is used, followed by batch normalization to stabilize gradient propagation. The feature map is merged by element-wise addition, then processed through a SeLU activation layer and reduced in dimension using a 1x1 convolution to reduce it to a single-channel feature. Batch normalization is applied to the low-dimensional features, and then a Sigmoid function is used to generate a single-channel feature map representing the attention coefficient of the attention module. The output of this module is scaled using element-wise multiplication and combined with the initial input features of the MAG module. And the features processed by SeLU activation Fusion. Therefore, the formula of the attention gate feature The derivation is as follows:

[0069] (2)

[0070] (3)

[0071] In the formula, Conv is a 3×3 convolution; GN means group normalization; Represents the input feature set; ⊕ represents the feature aggregation Concat operation; SeLU and SoftMax represent activation functions; Represents the input feature set; + represents the feature aggregation Add operation.

[0072] The information integrated by the lower branch is converted into a gating signal G(X), and the reconstructed gate signal is merged into the main information stream, i.e., the upper branch, to selectively discard information noise. This reconstructed gate signal is then integrated into the main information stream to selectively remove information noise. By aggregating the outputs of the upper and lower parallel branches, the attention gate feature MAG(X) is obtained. This method not only captures multi-scale features comprehensively by grouping inputs and applying shared weights, but also significantly reduces the computational cost. By combining feature mapping and attention coefficients, accurate screening and guidance of feature information is achieved, thereby improving the model's sensitivity and recognition ability to crack features to cope with complex and changing backgrounds.

[0073] Step S3: Extract multi-scale spatial features of attention gating features and aggregate the outputs.

[0074] Given the attention gating features in the MAG model ,This embodiment introduces a cross-space collaborative attention CSA mechanism to fuse the spatial sensitivity of self-attention and the channel specificity of group convolution.,Parallel multi-branch sub-network modules are used to effectively capture cross-dimensional,interactions and establish dependencies between dimensions.

[0075] In order to capture and interact cross-dimensional information and aggregate multi-scale spatial features, a parallel multi-branch sub-network architecture is designed. Specifically, the input feature map First, it is divided into sub-feature groups, each containing channels.

[0076] This method uses attention weight descriptors to enhance the feature representation of the region of interest within each sub-feature group. This helps the model to effectively analyze and process input features according to different semantic dimensions. CSA introduces three parallel branches to extract attention weight descriptors for grouped feature maps.

[0077] CSA introduces three parallel branches to extract the attention weight descriptors of grouped feature maps, such as Figure 1 As shown in the figure, two branches originate from 1x1 convolution operations, collectively referred to as spatial branches; while the third branch uses 3x3 convolution to strengthen the information exchange between channels, called channel branch.

[0078] In order to effectively promote the communication and interaction between channel features, the cross-channel interaction along the channel direction is modeled. In order to reduce the number of parameters, addition ADD is chosen as the channel fusion method instead of cascading, which is supported by the same number of channels in the two branches. Next, global average pooling techniques are applied along the two spatial directions to encode the channels, aiming to collect horizontal and vertical contextual information to enhance the pixel-level representation ability. In addition, two nonlinear SeLU functions are used to model the 2D Gaussian distribution on the linear convolution. In order to achieve differentiated cross-channel interaction features in the two parallel paths of the 1x1 branch, the attention map within each group is aggregated with the initial input by element-wise multiplication. As for the third branch, a 3×3 convolution is simply used to capture the contextual semantic information and interact with one branch in the cross-attention channel aggregation. Based on the above mechanism, a method for aggregating spatial information across different dimensional directions is proposed. Specifically, 2D global average pooling is applied to the output of the first branch to encode its spatial information. At the same time, the output of the third branch is processed by the SeLU activation function and then matrix point multiplication is performed with the output of the first branch of global pooling from CSA. This step achieves the joint activation of channel features before the information is converted into the corresponding dimensional shape. The first spatial attention map is obtained by multiplying the outputs of the above parallel processes. In order to capture multi-scale spatial information, 2D global average pooling is again applied to the outputs of the three branches to capture local spatial information. Subsequently, a 1×1 convolution is applied to the SeLU activation branch from CSA, and the second spatial attention map is produced through the Hadamard operation. The feature map of each pixel group is calculated based on the two generated spatial information attention weights and then processed by the Sigmoid function. This process not only captures the pixel-level dependencies, but also highlights the global semantic information of all pixels.

[0079] The CSA module is designed to expand the number of foci through branching and spatial integration, so as to capture more fine-grained multi-scale spatial pixel relationships. First, the query vector and value vector of each focal point are calculated, representing the information demand and the corresponding information response, respectively. and The dimensions of the tensor are reshaped and reordered, and the Reshaping and global average pooling are performed for encoding. Subsequently, In the spatial domain Perform matrix multiplication to delineate unique boundaries at different scales, resulting in a multi-scale spatial attention score matrix . The matrix is It is activated and restored to its original dimensional shape before element-wise multiplication, thereby enhancing the multi-scale bottleneck features through spatial horizontal and vertical attention. The specific process is described as:

[0080] (4)

[0081] In the formula, represents the spatial attention map; and Respectively represent the average pooling operations in the x direction (horizontal) and y direction (vertical); ⊕ represents feature aggregation; Represents the convolution operation; represents group convolution; Indicates group normalization. In most cases, when subcracks are magnified, they appear as straight-line patterns.

[0082] After obtaining the spatial attention map, the pixel reweighting technique can effectively filter out those boundary features with weak directional correlation, thereby reducing the impact of boundary pixels on the overall analysis and guiding the model to focus more on the crack area. In the processing of channel branches, channel similarity is calculated by combining spatial prior information with grouping features. This process involves calculating the query vector and value vector for each focus point, and then obtaining a global channel key matrix:

[0083] (5)

[0084] (6)

[0085] In the matrix With the matrix It is restored to its original shape before multiplication to enhance the multi-scale bottleneck features through the spatial attention mechanism.

[0086] (7)

[0087] (8)

[0088] in, Represents the output of the CSA module; represents the convolutional layer; Represents a transpose operation; represents the value matrix; represents the multi-scale spatial attention score matrix; SeLU represents the activation function; is the global space key matrix; A query vector representing the point of interest; Represents a reshape operation; and Represents the corresponding convolution operation; represents the reweighting process; Represents the SoftMax function.

[0089] The CSA module of this embodiment can dynamically allocate attention weights in the channel and spatial dimensions. By accurately capturing key features in a larger local context, CSA achieves effective modeling of long-range information to adapt to the problem of different crack scales, thereby significantly improving the accuracy of crack segmentation.

[0090] Step S4: The output result of step S3 is processed by output convolution to obtain a segmentation result.

[0091] The SCCU-Net model proposed in this embodiment is comprehensively evaluated on six datasets with different characteristics, including:

[0092] 1) CRACK500 contains 3363 crack images with a resolution of 640×360;

[0093] 2) CRACK200, which contains 4507 crack images with a resolution of 800×600;

[0094] 3) Contains 1611 crack images with a resolution of 544×384.

[0095] 4) SUN520, 520 images of road cracks in a certain area taken in clear weather;

[0096] 5) RAIN365, 365 images of road cracks in a certain area captured on rainy nights;

[0097] 6) 260 images of cracks on roads in a certain area taken at night under complex lighting conditions such as light and shadow.

[0098] These datasets exhibit diverse crack morphologies and multiple challenging factors such as image blur and uneven illumination.

[0099] Each dataset is divided into training set, validation set and test set in a ratio of 8:1:1. In the experimental setting, the initial learning rate is set to 1e-2, the weight decay is 1e-5, and the cosine annealing learning rate (LR) strategy is used to dynamically adjust the learning rate. In order to comprehensively evaluate the model performance, the following indicators are used: floating point operations (FLOPs), number of model parameters (Params), mean intersection over union (mIoU), precision (P) and recall (R).

[0100] Figure 2The process comparison results of the model of this embodiment and other models are shown, where SeaFormer-S is an extrusion-enhanced axial transformer, AFFormer-S is an adaptive frequency transformer, SCTNet-Seg50 is a single-branch CNN with transformer, and CU-Net is a cascaded U-Net.

[0101] Figure 3 The comparison results of the model of this embodiment and other models on six data sets are shown, among which BiSeNetV2 is bilateral segmentation network V2, GhostNetV2 is ghost segmentation network V2, TopFormer is top forming transformer, SeaFormer-S is squeeze enhanced axial transformer, AFFormer-S is adaptive frequency transformer, CarNet is lightweight encoder-decoder crack detection architecture, SCTNet-Seg50 is single-branch CNN with transformer, CSBSR is blind super-resolution crack segmentation, and CU-Net is cascaded U-Net.

[0102] from Figure 3 It can be seen that the CSA mechanism proposed in this embodiment outperforms other attention mechanisms by more effectively focusing on finer and more complex cracks and boundaries, and more effectively handles blurred edges, varying crack widths, and elongated cracks than competing methods. In particular, under the challenging conditions found in BJN260 and RAIN365, the SCCU-Net of this embodiment detects surface cracks more accurately than models that exhibit discontinuous segmentation, such as blind super-resolution crack segmentation CSBSR, adaptive frequency transformer AFFormer-S, and cascaded U-Net.

[0103] The highest mean intersection over union (mIoU) scores were achieved on five datasets. On CRACK200, the model of this embodiment improved mIoU by 3.06% compared with the existing methods, while reducing parameters by 68.33%. On the more challenging BJN260 and RAIN365, SCCU-Net achieved mIoU scores of 66.27% and 80.70%, ranking second and best, respectively. Despite having a higher number of parameters than GhostNetV2, SCCU-Net improved mIoU by 17.28%, effectively balancing lightweight design with high-precision crack segmentation.

[0104] Figure 4 This is a comparison of the attention paid to cracks by the CSA module of this embodiment and other attention modules, where CA-50 is coordinated attention, EMA represents the multi-scale attention module, and the CRA module is a self-attention module based on channel compression. Figure 4 This intuitively reflects that the CSA of this embodiment pays more attention to the edge of the crack than other attention modules.

[0105] Figure 5 The SCCU-Net model of this embodiment is compared with other models for crack segmentation results. SCTNet is a single-branch CNN with transformer, CSBSR is blind super-resolution crack segmentation, SeaFormer is an extrusion-enhanced axial transformer, CU-Net is a cascaded U-Net, and AFFormer is an adaptive frequency transformer. This reflects the comparison of the segmentation effect of the model of this embodiment on the dataset under six different environments with other crack segmentation models.

[0106] Figure 6 The comparison results of the SCCU-Net model of this embodiment with other models in terms of inference time and FPS, among which SCTNet-B-Seg75 is a single-branch CNN with transformer, CSBSR is blind super-resolution crack segmentation, and SeaFormer-B-Seg50 is a squeeze-enhanced axial transformer. It can be seen that the model of this embodiment has good performance in both frame rate and latency.

[0107] Example 2

[0108] Based on Embodiment 1, this embodiment provides an adaptive jump fusion module to process the aggregated output in step S3.

[0109] The adaptive jump fusion module ASF cleverly combines the output of the CSA module with jump connections. To simplify the computational complexity, this module integrates two point-by-point convolutions into the convolution operation in the subsequent reverse bottleneck structure. In addition, the bilinear interpolation technique is used to upsample the feature map, which not only improves the resolution of the feature map, but also retains multi-scale semantic information:

[0110] (9)

[0111] In the formula, represents the output after aggregation in step S3; Represents the convolution operation; represents the output from the encoder of the skip connection; represents group convolution; represents the SeLU activation function; Represents point-wise convolution; represents batch normalization; Represents a feature concatenation operation.

[0112] Example 3

[0113] This embodiment provides an adaptive cost-sensitive loss function to balance positive samples and negative samples, and trains the model proposed in Embodiment 1.

[0114] ;

[0115] ;

[0116] In the formula, and Represents the set of true values ​​and predicted images in a batch; and Indicates The true value label and predicted probability of each pixel; represents Dice loss; parameter , and is a balancing hyperparameter; Represents the total number of samples in the batch

[0117] The technical features of the above embodiments can be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. Only the preferred embodiments of the present invention are expressed. The description is more specific and detailed, but it cannot be understood as limiting the scope of the present invention. As long as there is no contradiction in the combination of these technical features, they should be considered as within the scope of this specification.

[0118] It should be noted that, for those skilled in the art, several modifications and improvements can be made without departing from the concept of the present invention, and these modifications and improvements all belong to the protection scope of the present invention. Therefore, the protection scope of the present invention shall be subject to the attached claims.

Claims

1. A cross-space collaborative learning lightweight coastal dam crack segmentation method, characterized by: The following steps are involved: Step S1: Down-sampling is performed through a three-layer encoder, and the number of channels and resolution are unified to obtain a feature set; Step S2: extracting the mapped attention gate feature of the feature set and the gating signal for fusion to obtain the attention gating feature; Step S3: extracting multi-scale spatial features of the attention gating feature and aggregating the outputs; Step S4: Process the output result of step S3 through output convolution to obtain a segmentation result; In step S3, the method for extracting multi-scale spatial features of the attention gating feature includes: Step S311: dividing the attention gate feature into a plurality of sub-feature groups along the channel dimension; Step S312: inputting the sub-feature group into the space branch and the channel branch; The spatial branch applies global average pooling to generate complementary sub-features in the horizontal and vertical directions, and uses group normalization to perform semantic consistency operations to obtain a spatial attention map; The channel branch combines the spatial attention map with the grouping feature to calculate the channel similarity, and enhances the multi-scale bottleneck feature through the spatial attention mechanism; Step S313: Aggregate the results of the spatial branch and the channel branch to obtain an output result; In step S312, the expression of the operation process of the space branch is: ; In the formula, represents the spatial attention map; and Respectively represent the average pooling operation in the x direction, i.e. horizontal direction, and the y direction, i.e. vertical direction; ⊕ represents feature aggregation; Represents the convolution operation; represents group convolution; represents group normalization; In step S312 and step S313, the operation of the channel branch and the expression of the aggregation process are for: ; ; ; ; In the formula, represents the convolutional layer; Represents a transpose operation; represents the value matrix; represents the multi-scale spatial attention score matrix; SeLU represents the activation function; is the global space key matrix; A query vector representing the point of interest; Represents a reshape operation; and Represents the corresponding convolution operation; represents the reweighting process; Represents the SoftMax function.

2. According to claim 1, a cross-space collaborative learning lightweight coastal dam crack segmentation method is characterized by: The expression for unifying the number of channels and resolution in step S1 is: ; In the formula, Indicates The unified features; represents max pooling kernels of size 4, 2, and 1; Refers to a 3×3×3 convolutional block; Indicates The features obtained by downsampling.

3. According to claim 1, a cross-space collaborative learning lightweight coastal dam crack segmentation method is characterized by: The gate signal in step S2 The expression is: ; In the formula, Conv is a 3×3 convolution; GN means group normalization; Represents the input feature set; ⊕ represents feature aggregation; 𝑆𝑒𝐿𝑈 is the activation function.

4. According to claim 3, a cross-space collaborative learning lightweight coastal dam crack segmentation method is characterized by: The attention gating feature The expression is: ; In the formula, SoftMax represents the activation function; Represents the input feature set.

5. According to claim 1, a cross-space collaborative learning lightweight coastal dam crack segmentation method is characterized by: In step S4, the processing is performed by adaptive skip connection before the output convolution processing, and the expression is: ; In the formula, represents the output after aggregation in step S3; Represents the convolution operation; represents the output from the encoder of the skip connection; represents group convolution; represents the SeLU activation function; represents point-wise convolution; represents batch normalization; Represents a feature concatenation operation.

6. The cross-space collaborative learning lightweight coastal dam crack segmentation method according to claim 1 is characterized by: The segmentation result of step S4 is evaluated by the floating-point operation amount, the number of model parameters, the average intersection-over-union ratio, the precision and the recall rate, and is trained by the adaptive cost-sensitive loss function.

7. The cross-space collaborative learning lightweight coastal dam crack segmentation method according to claim 6 is characterized by: The expression of the adaptive cost-sensitive loss function is: ; ; In the formula, and Represents the set of true values ​​and predicted images in a batch; Indicates The true value label of each pixel; and Indicates j The true value label and predicted probability of each pixel; represents Dice loss; parameter , and is a balancing hyperparameter; Represents the total number of samples in the batch.

Citation Information

Patent Citations

  • Dam crack detection method based on U-net network and SC-SAM attention mechanism

    CN112232391A

  • Tooth CBCT image segmentation network based on Flowform and gated attention

    CN117474044A