A building outer wall crack high-precision segmentation method and system based on residual convolution and complex morphological loss

CN122887910APending Publication Date: 2026-10-09NORTH CHINA UNIVERSITY OF TECHNOLOGY
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611342256.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-09-01
Publication Date
2026-10-09

AI Technical Summary

Benefits of technology

[0023]与现有技术相比,本发明的有益效果在于:其一,编码器中的卷积块注意力模块从通道和空间两个维度对特征进行加权,能够抑制水渍、斑驳涂料及瓷砖接缝等非病害区域的响应,同时突出裂缝区域,从而降低误检;其二,跳跃连接处的注意力门控机制利用解码器的深层语义对编码器的浅层特征进行筛选,在保留裂缝高分辨率边缘的同时减少背景噪声的传导;其三,残差双重卷积块通过旁路连接保留原始输入特征,有助于缓解深层网络中微小裂缝特征的衰减,提高召回率;其四,解码阶段采用双线性插值配合卷积的平滑上采样方式,可减轻标准转置卷积产生的棋盘状伪影,配合Dice损失对整体形态的约束,有助于保持裂缝的拓扑连续性,为后续计算裂缝长度与受损面积提供更可靠的分割依据。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122887910A_ABST
    Figure CN122887910A_ABST
Patent Text Reader

Abstract

The application discloses a detection method and system for improving building outer wall crack segmentation accuracy, and a storage medium, and relates to the technical field of image processing and intelligent detection. The method collects and labels building outer wall images to construct a data set, and constructs a crack segmentation network including an encoder, a decoder and an attention gate jump connection. The encoder is composed of a residual double convolution block cascade integrated with a convolution block attention module, features are weighted from two dimensions of channels and space to suppress background interference and retain tiny cracks; an attention gate mechanism at the jump connection uses deep semantic to filter shallow features to reduce noise conduction; the decoder uses a smooth up-sampling module to reduce up-sampling artifacts; a joint loss function composed of a focal loss and a Dice loss is used during training to alleviate the imbalance between positive and negative samples and constrain the continuity of crack morphology. The application can reduce false positives and false negatives of outer wall cracks and improve the topological continuity of the segmentation result.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of image processing and intelligent detection technology, specifically to a detection method, system, and storage medium for improving the accuracy of crack segmentation in building exterior walls. Background Technology

[0002] As urban construction expands, existing buildings are gradually entering a phase requiring regular inspection and maintenance. External wall insulation systems are prone to developing micro-cracks on their surfaces due to long-term weathering, temperature stress, and material aging. Moisture intrusion along these cracks can lead to hollowing, peeling, or even detachment of the insulation layer, creating safety hazards. Currently, automated inspection using drones equipped with high-resolution imaging devices and combined with computer vision technology is gradually replacing manual visual inspection methods and becoming a primary means of identifying large-area exterior wall defects.

[0003] For pixel-level crack segmentation, the U-Net network, based on an encoder-decoder structure and skip connections, is widely used due to its good performance under small sample conditions. However, the actual imaging environment of building exterior walls is more complex, and there are still some shortcomings when directly applying the standard U-Net to exterior wall crack segmentation.

[0004] First, background interference is significant. Real exterior wall surfaces often contain interference sources that are similar in color and shape to small cracks, such as water stains, mottled paint, and normal tile joints. The standard U-Net encoder lacks explicit discrimination capabilities for features in each channel, easily misclassifying such interference as cracks and resulting in false detections. Simultaneously, skip connections directly concatenate shallow features with deep semantic features. Shallow features typically contain considerable background noise; unfiltered direct concatenation introduces noise into the decoding process, affecting the accuracy of crack reconstruction.

[0005] Secondly, minute cracks are easily missed, and the segmentation results are prone to topological breaks. In exterior wall images, the pixel proportion of real cracks is usually very low. After multiple downsampling, their weak features are easily submerged by a large number of background pixels, resulting in missed detections. In addition, the upsampling method of standard transposed convolution and the conventional binary cross-entropy loss that only focuses on pixel-by-pixel error, when the classes are highly imbalanced, the gradient update is dominated by a large number of background pixels. Coupled with the lack of constraints on the overall geometry of the crack, the minute cracks ultimately appear as point fragments or breaks, making it difficult to accurately calculate the physical length and damaged area of ​​the crack.

[0006] Therefore, how to suppress background interference, reduce the failure to detect micro-cracks, and maintain the topological continuity of cracks in complex exterior wall scenarios is a technical problem to be solved in this field. Summary of the Invention

[0007] To address the problems existing in the background technology, the present invention provides a detection method, system and storage medium for improving the accuracy of crack segmentation in building exterior walls. By integrating residual double convolutional blocks, convolutional block attention modules, attention gating mechanisms and a joint loss function composed of focusing loss and Dice loss on the basis of U-Net, the invention suppresses background interference, reduces the missed detection of small cracks and improves the continuity of crack segmentation results.

[0008] To achieve the above objectives, the first aspect of the present invention provides a detection method for improving the segmentation accuracy of cracks in building exterior walls, comprising: acquiring images of the surface of building exterior walls, and constructing a crack segmentation dataset through preprocessing and annotation; constructing a crack segmentation network including an encoder, a decoder, and attention-gated skip connections, wherein the encoder is composed of cascaded residual double convolutional blocks with integrated convolutional block attention modules, and the decoder is composed of cascaded smoothing upsampling modules; training the network using a joint loss function obtained by adding focusing loss and Dice loss; inputting the image to be detected into the trained model, and outputting pixel-level crack segmentation results.

[0009] A second aspect of the present invention provides a detection system for implementing the above method, and a third aspect provides a computer-readable storage medium storing a corresponding computer program.

[0010] Firstly, a detection method for improving the accuracy of crack segmentation in building exterior walls includes the following steps:

[0011] Step S1: Collect images of the building's exterior wall surface, preprocess the images and label the crack pixels to construct a crack segmentation dataset;

[0012] Step S2: Construct a rift segmentation network. The rift segmentation network includes an encoder, a decoder, and attention-gated jump connections connecting the corresponding levels of the encoder and decoder. The encoder is composed of multiple cascaded residual double convolutional blocks with integrated convolutional block attention modules, and the decoder is composed of multiple cascaded smooth upsampling modules.

[0013] Step S3: Using the joint loss function obtained by adding the focusing loss and the Dice loss, the crack segmentation network is trained with the crack segmentation dataset to obtain the crack segmentation model;

[0014] Step S4: Input the image of the building exterior wall to be detected into the crack segmentation model to obtain the pixel-level segmentation result of the crack.

[0015] Furthermore, the residual double convolutional block processes the input features as follows: the main branch performs two 3×3 convolutions on the input features sequentially, where batch normalization and linear rectified function activation are performed after the first convolution, and batch normalization is performed after the second convolution to obtain intermediate features; the intermediate features are input into the attention module of the convolutional block, and then sequentially pass through channel dimension weighting and spatial dimension weighting to obtain purified features; the input features are passed through the bypass branch and added element-wise with the purified features, and then activated by the linear rectified function before output; wherein, when the number of channels of the input features is the same as the number of channels of the output features, the bypass branch is an identity mapping, and when the number of channels of the two are different, the bypass branch sequentially performs 1×1 convolution and batch normalization on the input features to achieve channel dimension alignment.

[0016] Furthermore, the channel-dimensional weighting includes: performing global average pooling and global max pooling on the intermediate features respectively, feeding both into a weight-shared multilayer perceptron, adding the two outputs of the multilayer perceptron and obtaining the channel weights through a sigmoid function, and multiplying the channel weights with the intermediate features element-wise by channel to obtain the channel-weighted features; the spatial-dimensional weighting includes: performing average pooling and max pooling on the channel-weighted features along the channel direction respectively and concatenating them into a dual-channel feature map, obtaining the spatial weights through a 7×7 convolution and a sigmoid function, and multiplying the spatial weights with the channel-weighted features element-wise to obtain the refined features.

[0017] Furthermore, the attention-gated skip connection processes the shallow features output from the same level of the encoder and the deep gated signal output from the level above the decoder, including: performing 1×1 convolutions on the shallow features and the deep gated signal respectively, batch normalizing them, mapping them to the same intermediate channel dimension, adding them together, activating them with a linear rectified function, performing another 1×1 convolution to compress the number of channels to 1, and obtaining an attention weight mask through a Sigmoid function; multiplying the attention weight mask element-wise with the shallow features to obtain the filtered features and sending them to the corresponding level of the decoder.

[0018] Furthermore, the processing of the smooth upsampling module includes: first, using bilinear interpolation to double the spatial resolution of the input feature map, and then sequentially performing 1×1 convolution, batch normalization, and linear rectified function activation before outputting.

[0019] Furthermore, the joint loss function is the sum of the focusing loss and the Dice loss; the focusing loss applies a relatively larger loss weight to crack pixels that are difficult to classify through a class balancing factor and a focusing adjustment factor; the Dice loss is constructed based on the spatial intersection and union between the predicted results and the true labels, and is used to constrain the overall continuity of the crack segmentation results.

[0020] Furthermore, the preprocessing in step S1 includes image size normalization and data augmentation, wherein the data augmentation includes at least one of random flipping, random rotation, and brightness adjustment.

[0021] Secondly, a detection system for improving the segmentation accuracy of cracks in building exterior walls is provided, comprising: a data construction module for acquiring, preprocessing, and labeling images of building exterior walls to construct a crack segmentation dataset; a network construction module for constructing a crack segmentation network including an encoder, a decoder, and attention-gated skip connections, wherein the encoder is composed of cascaded residual double convolutional blocks with integrated convolutional block attention modules, and the decoder is composed of cascaded smoothing upsampling modules; a model training module for training the crack segmentation network using a joint loss function composed of focusing loss and Dice loss to obtain a crack segmentation model; and a crack detection module for inputting the image to be detected into the crack segmentation model and outputting pixel-level crack segmentation results.

[0022] Thirdly, a computer-readable storage medium is provided, on which a computer program is stored, wherein when the computer program is executed by a processor, the steps of a detection method for improving the accuracy of crack segmentation in building exterior walls are implemented.

[0023] Compared with existing technologies, the advantages of this invention are as follows: First, the convolutional block attention module in the encoder weights features from both channel and spatial dimensions, which can suppress the response of non-damaged areas such as water stains, mottled paint, and tile joints, while highlighting crack areas, thereby reducing false detections. Second, the attention gating mechanism at skip connections uses the deep semantics of the decoder to filter the shallow features of the encoder, reducing the transmission of background noise while preserving the high-resolution edges of cracks. Third, the residual double convolutional block preserves the original input features through bypass connections, which helps to alleviate the attenuation of small crack features in deep networks and improves recall. Fourth, the smooth upsampling method of bilinear interpolation combined with convolution in the decoding stage can reduce the checkerboard artifacts generated by standard transposed convolution. Combined with the constraint of Dice loss on the overall shape, it helps to maintain the topological continuity of cracks and provides a more reliable segmentation basis for subsequent calculation of crack length and damaged area. Attached Figure Description

[0024] Figure 1 This is a schematic diagram of the structure of the residual double convolution block (feature extraction unit) in an embodiment of the present invention;

[0025] Figure 2 This is a schematic diagram of the structure of the convolutional block attention module in an embodiment of the present invention;

[0026] Figure 3 This is a schematic diagram of the attention gating mechanism in an embodiment of the present invention;

[0027] Figure 4 This is a graph showing the loss curve of model training and the average intersection-union (OCU) curve of the validation set in an embodiment of the present invention.

[0028] Figure 5 This is a comparison of the crack segmentation results of the embodiments of the present invention and the traditional U-Net in a scene with background interference;

[0029] Figure 6 This is a comparison of the crack segmentation results of the present invention and the traditional U-Net in the scenario of a thin crack;

[0030] Figure 7 This is a flowchart illustrating the data preprocessing and dataset construction process in an embodiment of the present invention.

[0031] Figure 8 This is a schematic diagram of the overall architecture of the crack segmentation network in an embodiment of the present invention;

[0032] Figure 9 This is a schematic diagram of the model training process in an embodiment of the present invention;

[0033] Figure 10 This is a schematic diagram of the crack detection reasoning process in an embodiment of the present invention. Detailed Implementation

[0034] To make the objectives, technical solutions, and advantages of this invention clearer, the invention will be further described in detail below with reference to embodiments. It should be understood that the specific embodiments described herein are for illustrative purposes only and are not intended to limit the invention.

[0035] This embodiment provides a detection method to improve the accuracy of crack segmentation in building exterior walls. The crack segmentation network constructed in this method generally adopts the encoder-decoder structure of U-Net, and feature transfer is performed between corresponding layers of the encoder and decoder through attention-gated skip connections. The following is a step-by-step description.

[0036] Step S1: Dataset Construction. Collect images of the building's exterior surface. These images can be obtained from high-resolution imaging equipment mounted on a drone or from ground-based cameras. Let the original images be...

[0037]

[0038] The normalized image is then augmented to expand the sample size. Augmentation methods include random flipping, random rotation, and brightness adjustment. Let the data augmentation operator be... The enhanced image can then be represented as:

[0039]

[0040] The crack pixels in the image are labeled pixel by pixel to obtain binary labels corresponding to the original image. Crack pixels are denoted as positive (value 1), and background pixels are denoted as negative (value 0). The labeled samples are then divided into training sets proportionally. With the validation set Together they constitute the crack segmentation dataset. .

[0041] Step S2: Construction of the crack segmentation network. Let the image input to the network be...

[0042]

[0043]

[0044]

[0045]

[0046] in, For the first Residual double convolutional blocks integrating convolutional block attention modules in layers. For downsampling operation, For the smooth upsampling module, For the first Layered attention gating For channel splicing, The output layer has a 1×1 convolution kernel. For the Sigmoid function, This is the crack probability map output by the network. The following sections provide a detailed explanation of each component module.

[0047] Residual double convolutional blocks integrating convolutional block attention modules: The encoder consists of multiple cascaded residual double convolutional blocks as the basic feature extraction unit. The overall forward propagation of this unit can be represented as:

[0048]

[0049] Where x is the input feature, For double convolution feature extraction, For convolutional block attention modules, y represents the bypass residual mapping path, ReLU is the linear rectified function, and y is the output characteristic.

[0050] Step 1: Dual feature extraction from the main branch. The input feature x is first processed by two 3×3 convolutions in the main branch: after the first convolution, batch normalization and ReLU activation are performed sequentially; after the second convolution, batch normalization is performed again to obtain intermediate features. :

[0051]

[0052] in, , These are the kernels for two 3×3 convolutions, where * indicates a convolution operation and BN indicates batch normalization. The intermediate features obtained at this point contain both high-frequency information such as crack candidate edges and low-frequency textures such as wall backgrounds, and still require further filtering.

[0053] Step 2: Weighting of the convolutional block attention module. The intermediate features are weighted sequentially by channel attention and spatial attention.

[0054] For channel attention, global average pooling and global max pooling are performed on the feature maps respectively, compressing them into a 1×1 spatial dimension. These are then fed into a weight-sharing multilayer perceptron (including dimensionality reduction and expansion). The two results are summed and passed through a sigmoid function to obtain the channel weights, which are then multiplied by the input features channel by channel.

[0055]

[0056]

[0057] in, , These are the dimensionality reduction and dimensionality increase weights for the multilayer perceptron, respectively. For the Sigmoid function, This involves element-wise multiplication. Channel attention enables the network to distinguish between different channel features: channel weights corresponding to disturbances such as water stains are suppressed, while channel weights corresponding to crack edges are enhanced.

[0058] For spatial attention, the channel-weighted features are subjected to average pooling and max pooling along the channel direction and concatenated into a dual-channel feature map. Then, a 7×7 convolution and a sigmoid function are used to obtain the spatial weights, which are then multiplied with the channel-weighted features.

[0059]

[0060]

[0061] in, Represents a 7×7 convolution. This indicates splicing along the channel direction. Larger convolution kernels are beneficial for capturing the spatial orientation of cracks and suppressing the response of non-damaged areas.

[0062] Step 3, Residual Connections and Fusion. To mitigate the attenuation of features from small cracks in deep networks, residual connections are constructed in the bypass. When the number of channels in the input feature x is the same as the number of channels in the backbone output, the bypass is an identity mapping; when they are different, x is first subjected to 1×1 convolution and batch normalization to achieve channel dimension alignment.

[0063]

[0064] Finally, the side-channel features are added element-wise to the features refined by the convolutional block attention module, and then ReLU is applied to activate the output:

[0065]

[0066] This residual connection retains the original input feature information while fusing with the deep semantic features of the main branch. Even if the main path loses some extremely fine crack features, the bypass can still pass the original features to the output, thereby helping to improve the recall rate of weak cracks.

[0067] Attention-gated skip connections: In traditional U-Net, features are directly spliced ​​between the encoder and decoder via skip connections. In the external wall scenario, while shallow features retain high-resolution edges of cracks, they also carry significant background noise, which can introduce interference if directly spliced. Therefore, this embodiment introduces an attention-gating mechanism at the skip connections, using deep semantics to filter shallow features.

[0068] Let x be the high-resolution shallow feature output from the same level of the encoder, and g be the deep gated signal output from the level above the decoder. We perform 1×1 convolutions on x and g respectively, batch normalize them, map them to the same intermediate channel dimension, add them together, activate them with ReLU, perform another 1×1 convolution to compress the number of channels to 1, and finally obtain the attention weight mask through the Sigmoid function. :

[0069]

[0070] Multiply the attention weight mask by the shallow features to obtain the filtered features. Send it to the corresponding layer of the decoder:

[0071]

[0072] in, , For channel-aligned 1×1 convolution kernels, The kernel is a 1×1 convolutional kernel compressed to a single channel. Since the number of channels in x and g is usually inconsistent, two 1×1 convolutional kernels can map them to a unified intermediate dimension. This mechanism introduces only a small number of parameters to achieve cross-scale semantic interaction, thereby reducing the propagation of shallow background noise to the decoder.

[0073] Smoothing Upsampling Module: Standard transposed convolution amplifies feature maps through zero-padding and kernel sliding. When the kernel size is not divisible by the stride, the output superposition in overlapping regions is uneven, easily producing checkerboard artifacts, which in turn causes continuous, thin cracks to break during recovery. Therefore, this embodiment uses a smoothing upsampling module instead of standard transposed convolution in the decoding stage. Its processing is as follows:

[0074]

[0075] in, This represents bilinear interpolation, which doubles the spatial resolution of the feature map. Its linear interpolation based on adjacent pixels smooths the transition of feature gradients, mitigating the blocky overlap artifacts of transposed convolution. Subsequent 1×1 convolution, batch normalization, and ReLU activation adjust the feature distribution and introduce nonlinearity to avoid internal covariate shifts during the decoding stage. The decoder consists of multiple cascaded smoothing upsampling modules, progressively restoring the feature map resolution.

[0076] Step S3: Joint Loss Function and Training. In images of exterior walls with cracks, the proportion of crack pixels is usually very low, and training is easily dominated by background pixels. Therefore, this embodiment uses a joint loss function obtained by adding the focusing loss and the Dice loss:

[0077]

[0078] The focusing loss is used to replace the conventional binary cross-entropy loss, and its expression is:

[0079]

[0080] In the formula, N is the total number of pixels in a feature map. The prediction confidence level for the target category. To focus parameters, This is a category balance factor. When encountering weak crack pixels that are difficult to classify (…), When the level is low, the regulating factor This will amplify the loss weights; for easily classifiable background pixels, the loss is compressed accordingly, thus prompting the network to pay more attention to crack pixels that are difficult to detect.

[0081] To encourage continuous crack output, this embodiment further introduces Dice loss based on spatial set similarity:

[0082]

[0083] In the formula, To predict probabilities, For real labels, The smoothing coefficient is used. The Dice loss measures the spatial overlap between the predicted and ground truth regions from an overall morphological perspective. It can, to some extent, constrain the network to fill in the broken pixels in the cracks, outputting a more continuous crack mask. During training, backpropagation is performed based on the joint loss function described above, and a gradient descent-type optimizer is used to iteratively update the network parameters. :

[0084]

[0085] in, For learning rate, The gradient of the loss with respect to the network parameters, This represents the number of iterations. The iteration continues until the loss converges, yielding the final crack segmentation model.

[0086] Step S4: Crack Detection. Input the image of the building's exterior wall to be detected into the trained crack segmentation model. Assume the input image, after preprocessing, is...

[0087]

[0088] in, The parameter is The crack segmentation network, The predicted probability of each pixel belonging to the crack is calculated. The probability map is then thresholded and binarized to obtain a pixel-level segmentation mask. :

[0089]

[0090] In the formula, The binarization threshold is typically set to 0.5. Based on this segmentation mask, each crack region can be extracted through connected component analysis, and the physical length and damaged area of ​​the crack can be calculated by combining the imaging scale, providing a basis for the assessment of external wall defects.

[0091] Under the joint constraints of focusing loss and Dice loss, the model quickly alleviates the gradient dominance problem caused by the imbalance of positive and negative samples in the early stage of training. As the iteration progresses, the mean intersection-union ratio (mIoU) curve of the validation set shows a steady upward trend without obvious overfitting oscillations, indicating that the model has good convergence and generalization ability under this joint loss function.

[0092] When the original input image has strong background interference, traditional U-Net is prone to producing a large range of false detections, while the segmentation mask output in this embodiment has higher purity. This indicates that the convolutional block attention module in the encoder suppresses the channel response of non-disease regions, and the attention gating mechanism at the skip connections blocks the transmission of shallow background noise, thereby achieving high-fidelity extraction of the true crack edges.

[0093] For extremely long and thin cracks, the crack mask output in this embodiment maintains good morphological continuity, without exhibiting the jagged edges or point-like fragmentation common in traditional transposed convolution upsampling. This indicates that the smooth upsampling mechanism, combined with the overall morphological constraint of Dice loss, can fill in the fault pixels in the middle of weak cracks in two-dimensional space, outputting a more continuous and smooth crack topology structure. This provides a more reliable pixel-level basis for subsequent accurate calculation of the physical length and damaged area of ​​external wall cracks.

[0094] The above description is merely a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of the present invention should be included within the scope of protection of the present invention.

Claims

1. A detection method for improving the accuracy of crack segmentation in building exterior walls, characterized in that, Includes the following steps: Step S1: Collect images of the building's exterior wall surface, preprocess the images and label the crack pixels to construct a crack segmentation dataset; Step S2: Construct a rift segmentation network. The rift segmentation network includes an encoder, a decoder, and attention-gated jump connections connecting the corresponding levels of the encoder and decoder. The encoder is composed of multiple cascaded residual double convolutional blocks with integrated convolutional block attention modules, and the decoder is composed of multiple cascaded smooth upsampling modules. Step S3: Using the joint loss function obtained by adding the focusing loss and the Dice loss, the crack segmentation network is trained with the crack segmentation dataset to obtain the crack segmentation model. Step S4: Input the image of the building exterior wall to be detected into the crack segmentation model to obtain the pixel-level segmentation result of the crack.

2. The detection method for improving the accuracy of crack segmentation in building exterior walls according to claim 1, characterized in that, The residual double convolutional block processes the input features as follows: the main branch performs two 3×3 convolutions on the input features sequentially, where batch normalization and linear rectified function activation are performed after the first convolution, and batch normalization is performed after the second convolution to obtain intermediate features; the intermediate features are input into the attention module of the convolutional block, and then pass through channel dimension weighting and spatial dimension weighting sequentially to obtain refined features; the input features are passed through a bypass branch and added element-wise with the refined features, and then activated by a linear rectified function before output; wherein, when the number of channels of the input features is the same as the number of channels of the output features, the bypass branch is an identity mapping; when the number of channels is different, the bypass branch performs 1×1 convolution and batch normalization on the input features sequentially to achieve channel dimension alignment.

3. The detection method for improving the accuracy of crack segmentation in building exterior walls according to claim 2, characterized in that, The channel-dimensional weighting includes: performing global average pooling and global max pooling on the intermediate features respectively, feeding both into a multilayer perceptron with shared weights, adding the two outputs of the multilayer perceptron and obtaining the channel weights through a sigmoid function, and multiplying the channel weights element-wise with the intermediate features along each channel to obtain the channel-weighted features; the spatial-dimensional weighting includes: performing average pooling and max pooling on the channel-weighted features along the channel direction respectively and concatenating them into a dual-channel feature map, obtaining the spatial weights through a 7×7 convolution and a sigmoid function, and multiplying the spatial weights element-wise with the channel-weighted features to obtain the refined features.

4. The detection method for improving the accuracy of crack segmentation in building exterior walls according to claim 1, characterized in that, The attention-gated skip connection processes the shallow features output from the same level of the encoder and the deep gated signal output from the level above the decoder, including: performing 1×1 convolutions on the shallow features and the deep gated signal respectively, batch normalizing them, mapping them to the same intermediate channel dimension, adding them together, activating them with a linear rectified function, performing another 1×1 convolution to compress the number of channels to 1, and obtaining an attention weight mask through a Sigmoid function; multiplying the attention weight mask element-wise with the shallow features to obtain the filtered features and sending them to the corresponding level of the decoder.

5. The detection method for improving the accuracy of crack segmentation in building exterior walls according to claim 1, characterized in that, The smooth upsampling module's processing includes: first, using bilinear interpolation to double the spatial resolution of the input feature map, and then sequentially performing 1×1 convolution, batch normalization, and linear rectified function activation before outputting.

6. The detection method for improving the accuracy of crack segmentation in building exterior walls according to claim 1, characterized in that, The joint loss function is the sum of the focus loss and the Dice loss; the focus loss applies a relatively larger loss weight to crack pixels that are difficult to classify through a class balance factor and a focus adjustment factor; the Dice loss is constructed based on the spatial intersection and union between the predicted results and the true labels, and is used to constrain the overall continuity of the crack segmentation results.

7. The detection method for improving the accuracy of crack segmentation in building exterior walls according to claim 1, characterized in that, The preprocessing in step S1 includes image size normalization and data augmentation, wherein the data augmentation includes at least one of random flipping, random rotation, and brightness adjustment.

8. A detection system for improving the accuracy of crack segmentation in building exterior walls, characterized in that, include: The data construction module is used to collect, preprocess, and label building exterior wall images to build a crack segmentation dataset; The network construction module is used to construct a crack segmentation network including an encoder, a decoder, and attention-gated skip connections. The encoder is composed of cascaded residual double convolutional blocks with integrated convolutional block attention modules, and the decoder is composed of cascaded smoothing upsampling modules. The model training module is used to train the crack segmentation network using a joint loss function composed of focusing loss and Dice loss to obtain a crack segmentation model. The crack detection module is used to input the image to be detected into the crack segmentation model and output the crack pixel-level segmentation result.

9. 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 detection method for improving the accuracy of crack segmentation in building exterior walls as described in any one of claims 1 to 7.