Building outer wall crack detection method

Through deep learning and computer vision technology, the TransUNet model is built to automatically identify cracks in the exterior wall of the building, solving the problem that traditional detection methods rely on manual and inefficient, and achieving efficient and accurate crack detection.

CN119723325APending Publication Date: 2025-03-28STATE GRID ZHEJIANG ELECTRIC POWER CO LTD

Patent Information

Application Number
CN202411618156.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-13
Publication Date
2025-03-28

AI Technical Summary

Technical Problem

Traditional methods of crack detection of concrete structures rely on manual labor, which has problems such as low objectivity, low detection efficiency and difficulty in carrying out in complex environments.

Method used

Deep learning technology combined with computer vision technology is used to design a crack detection method for building exterior walls. By constructing a TransUNet model to be trained, crack recognition is performed using local features and global features dual encoding.

Benefits of technology

It realizes automatic identification of cracked areas in the exterior walls of high-rise buildings, improves detection efficiency and accuracy, reduces labor and material costs, and eliminates safety risks of building exterior walls falling off.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119723325A_ABST
    Figure CN119723325A_ABST
Patent Text Reader

Abstract

The invention relates to a building outer wall crack detection method, which aims at a building outer wall sample image, designs a local feature encoder through a ResNet50 neural network to carry out local feature extraction, designs a global feature encoder through a Transform model to carry out global feature extraction, and carries out fusion sampling on local features and global features in cooperation with a fusion classification subsystem. A TransUNet to-be-trained model is constructed, training is carried out through the sample data, a building crack detection model is obtained, and then crack recognition on the actual building outer wall is executed; according to the design model, low-level features and high-level features are combined through jump connection, the building outer wall crack detection efficiency and accuracy are improved, early warning is carried out for falling-off potential safety hazards caused by cracks of the building outer wall, manpower, material resources and monitoring cost are reduced through the design method, and the falling-off potential safety hazards of the building outer wall are eliminated.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention relates to a method for detecting cracks in an outer wall of a building, and belongs to the technical field of building crack detection. Background Art

[0002] Maintenance and regular inspection of concrete structures are essential parts of facility safety. However, traditional methods of detecting cracks in concrete structures are mainly manual and highly dependent on human experience. The detection results are not objective enough and there are uncertainties, making it difficult to ensure the integrity and accuracy of the detection results. In addition, the detection time is long and the detection efficiency is low. Manual detection in complex environments is difficult to carry out and there are detection loopholes. Summary of the invention

[0003] The technical problem to be solved by the present invention is to provide a method for detecting cracks in the exterior walls of buildings, which can automatically identify crack areas in the exterior walls of high-rise buildings by using deep learning technology combined with computer vision technology.

[0004] In order to solve the above technical problems, the present invention adopts the following technical solutions: the present invention designs a method for detecting cracks in the exterior wall of a building, performs the following steps A to C, obtains a building crack detection model, and then performs the following step i, applies the building crack detection model, and identifies cracks on the exterior wall of the target building;

[0005] Step A. Obtain a preset number of building exterior wall images each containing wall cracks, and mark each crack pixel area in each building exterior wall image, and then crop each building exterior wall image to obtain each building exterior wall sample image of a preset size to form a sample set, and proceed to step B;

[0006] Step B. Take the local feature and global feature dual-path encoding as input, construct the TransUNet model to be trained through linear mapping and feature fusion, and then proceed to step C;

[0007] Step C. Based on the sample set, the sample image of the building exterior wall is used as input, and the corresponding crack pixel area is used as output, and the TransUNet to-be-trained model is trained to obtain a building crack detection model;

[0008] Step i. Obtain an image of the exterior wall of the target building, and crop it into sample images of each exterior wall of the building of a preset size. Apply the building crack detection model to process each sample image of the exterior wall of the building, respectively, obtain the crack pixel area in each sample image of the exterior wall of the building, and then obtain the crack pixel area of ​​the exterior wall of the target building to achieve crack identification.

[0009] As a preferred technical solution of the present invention: in the step A, first, based on the preset brightness change range, each building exterior wall image is generated to correspond to the extended image of the building exterior wall under each brightness change, and each building exterior wall image is constructed, the ratio of the number of building exterior wall sample images containing crack pixel areas to the number of building exterior wall sample images not containing crack pixel areas is within a preset proportional fluctuation range centered on 0.5, and then each crack pixel area in all the building exterior wall images is marked respectively.

[0010] As a preferred technical solution of the present invention: in the step B, the TransUNet model to be trained includes a local feature encoder, a linear mapping layer, a global feature encoder, a hidden feature extraction layer, and a fusion classification subsystem connected in series in sequence from the input end to the output end, and the local feature encoder is connected to the fusion classification subsystem via a downsampling layer; the building exterior wall image is received by the input end of the local feature encoder, the local feature map is extracted by the local feature encoder, and the mapping is updated by the linear mapping layer, then the global feature encoder receives the local feature map output from the linear mapping layer, extracts the global feature map, and obtains the hidden feature map output by the hidden feature extraction layer, finally the fusion classification subsystem receives the hidden feature map output from the hidden feature extraction layer, and combines the feature map output from the local feature encoder and processed by the downsampling layer, performs fusion, convolution, upsampling, and classification processing, and outputs the identification of the crack pixel area in the building exterior wall image.

[0011] As a preferred technical solution of the present invention: the local feature encoder is connected in series to the first residual network, the second residual network, and the third residual network in sequence from the input end to the output end, and each residual network is connected in series to the convolution layer, the maximum pooling layer, and the activation layer in sequence from the input end to the output end; and the output end of the first residual network, the output end of the second residual network, and the output end of the third residual network are connected to the fusion classification subsystem through a 1 / 2 rate image spatial resolution recovery layer, a 1 / 4 rate image spatial resolution recovery layer, and a 1 / 8 rate image spatial resolution recovery layer, respectively.

[0012] As a preferred technical solution of the present invention: the fusion classification subsystem is connected in series from the input end to the output end in the direction of the first upsampling layer, the first splicing layer, the first residual layer, the second upsampling layer, the second splicing layer, the second residual layer, the third upsampling layer, the third splicing layer, the third residual layer, the fourth upsampling layer, the fourth residual layer, and the segmentation head layer; wherein the output end of the first residual network, the output end of the second residual network, and the output end of the third residual network in the local feature encoder are respectively passed through the 1 / 2 rate image spatial resolution recovery layer, the 1 / 4 rate image spatial resolution recovery layer, and the 1 / 2 rate image spatial resolution recovery layer. The resolution recovery layer and the 1 / 8 rate image spatial resolution recovery layer are connected to the input end of the third splicing layer, the input end of the second splicing layer, and the input end of the first splicing layer. The first splicing layer, the second splicing layer, and the third splicing layer respectively perform feature map splicing processing on the global feature map output by the upsampling layer connected thereto and the local feature map output by the rate image spatial resolution recovery layer; the first residual layer, the second residual layer, the third residual layer, and the fourth residual layer have the same structure, and are respectively connected in series with the convolution layer, the pooling layer, and the Relu activation layer from the input end to the output end.

[0013] As a preferred technical solution of the present invention: the first splicing layer, the second splicing layer, and the third splicing layer respectively calculate the attention weights between the obtained local features and the global features according to the cross-attention mechanism, and perform weighted splicing processing on the global feature map output by the upsampling layer and the local feature map output by the downsampling layer connected thereto.

[0014] As a preferred technical solution of the present invention: the global feature encoder is connected in series with a preset number of Transformer encoders in a direction from the input end to the output end, the structures of the Transformer encoders are the same, and the Transformer encoders are connected in series with an input processing group, a self-attention and encoding and decoding group, and a feedforward neural output processing group in a direction from the input end to the output end;

[0015] The input processing group is connected in series with the first residual connection module and the position encoding module in a direction from the input end to the output end. One input end of the first residual connection module constitutes the input end of the input processing group, that is, the input end of the Transformer encoder. The other input end of the first residual connection module is connected to the position encoding module. The output end of the first residual connection module constitutes the output end of the input processing group. The first residual connection module receives the local feature map, adds the position information and then outputs it.

[0016] The self-attention and encoding-decoding group sequentially connects the self-attention module, the first normalization layer, the second residual connection module, the encoder-decoder attention module, the second normalization layer, and the third residual connection module in series from the input end to the output end, wherein the input end of the self-attention module constitutes the input end of the self-attention and encoding-decoding group, the input end of the second residual connection module is simultaneously connected to the input end of the self-attention module, the input end of the third residual connection module is simultaneously connected to the output end of the second residual connection module, and the output end of the third residual connection module constitutes the output end of the self-attention and encoding-decoding group;

[0017] The feedforward neural output processing group is connected in series with the feedforward neural network, the third normalization layer, and the fourth residual connection module in a direction from the input end to the output end. The input end of the feedforward neural network constitutes the input end of the feedforward neural output processing group, and the fourth residual connection module constitutes the output end of the feedforward neural output processing group, that is, the output end of the Transformer encoder. The input end of the fourth residual connection module is also connected to the input end of the feedforward neural network.

[0018] As a preferred technical solution of the present invention: the encoder-decoder attention module adopts a cross attention mechanism, and the self-attention module adopts a residual connection method to associate the multi-head self-attention mechanism MSA module and the multi-layer perceptron MLP module, as shown in the following formula:

[0019]

[0020] z l ′=MSA(LN(z l ' -1 ))+z l-1

[0021] z l =MLP(LN(z l ′))+z l '

[0022] Where z0 represents the linear mapping module input vector, z l ′ represents the input vector of the first step of the multi-head self-attention mechanism MSA module, z l represents the input vector of the first step of the multi-layer perceptron MLP module, z l-1 Represents the input vector of the l-1th step of the multilayer perceptron MLP module, i = 1…I, I = (H×W) / P 2 , represents the i-th building exterior wall sample image of preset size P×P, E represents the size of each feature vector, E pos represents position encoding; H×W represents the resolution of the sample image of the building exterior wall; LN(·) represents normalization processing.

[0023] As a preferred technical solution of the present invention: in the process of training the TransUNet model to be trained in step C, the loss function Loss is as follows:

[0024] Loss = Dice_Loss + CE_Loss

[0025]

[0026] Where i = 1…I, I represents the number of sample images of building exterior walls, y i and They represent the label value and predicted value of the i-th building exterior wall sample image respectively.

[0027] As a preferred technical solution of the present invention: in the process of training the TransUNet model to be trained, in step C, regarding the crack pixel region extraction process, according to the following formula, a total variation loss TVLoss model is used to reduce the difference between adjacent pixels to achieve the effect of image super-resolution denoising;

[0028]

[0029] In the formula, x m,j Represents the pixel value at position (m, j) in the sample image of the building exterior wall.

[0030] The method for detecting cracks in the exterior wall of a building described in the present invention has the following technical effects compared with the prior art by using the above technical solution:

[0031] (1) The present invention designs a method for detecting cracks in the exterior wall of a building. For a sample image of the exterior wall of a building, a local feature encoder is designed using a ResNet50 neural network to extract local features, and a global feature encoder is designed using a Transformer model to extract global features. In cooperation with a fusion classification subsystem, local features and global features are fused and sampled to construct a TransUNet model to be trained. The model is trained using sample data to obtain a building crack detection model, and then crack recognition is performed on the exterior wall of the actual building. The design model uses jump connections to combine low-level features with high-level features, thereby improving the efficiency and accuracy of crack detection on the exterior wall of the building, and providing an early warning for the potential safety hazard of the exterior wall of the building falling off due to cracks. The design method reduces manpower, material resources, and monitoring costs, and eliminates the potential safety hazard of the exterior wall of the building falling off. BRIEF DESCRIPTION OF THE DRAWINGS

[0032] Figure 1 It is a schematic diagram of the building exterior wall crack detection method designed by the present invention. DETAILED DESCRIPTION

[0033] The specific implementation modes of the present invention will be further described in detail below in conjunction with the accompanying drawings.

[0034] The present invention designs a method for detecting cracks in the exterior wall of a building, and executes the following steps A to C to obtain a building crack detection model.

[0035] Step A. Fly a drone around the exterior wall of a building according to a preset flight route to obtain a preset number of exterior wall images of the building that respectively contain wall cracks. First, based on a preset range of brightness changes, generate each exterior wall image that corresponds to an extended image of the exterior wall of the building under each brightness change, and form each exterior wall image. The ratio of the number of exterior wall sample images containing crack pixel areas to the number of exterior wall sample images not containing crack pixel areas is within a preset ratio fluctuation range centered on 0.5. Then, mark each crack pixel area in all exterior wall images of the building, and finally crop each exterior wall image to obtain each exterior wall sample image of a preset size, form a sample set, and proceed to step B.

[0036] Regarding the marking of each crack pixel area in the building exterior wall image, it can be converted into a binary image for presentation in a manner that the crack pixel area is marked as 1 (white) and the non-crack pixel area is marked as 0 (black).

[0037] Step B. Take the local feature and global feature dual-path encoding as input, construct the TransUNet model to be trained through linear mapping and feature fusion, and then proceed to step C.

[0038] In practical applications, such as Figure 1 As shown, the TransUNet model to be trained includes, from the input end to its output end, a local feature encoder, a linear mapping layer, a global feature encoder, a hidden feature extraction layer, and a fusion classification subsystem connected in series in sequence, and the local feature encoder is connected to the fusion classification subsystem via a downsampling layer; the building exterior wall image is received by the input end of the local feature encoder, the local feature map is extracted by the local feature encoder, and the mapping is updated by the linear mapping layer, then the global feature encoder receives the local feature map output from the linear mapping layer, extracts the global feature map, and obtains the hidden feature map output by the hidden feature extraction layer, and finally the fusion classification subsystem receives the hidden feature map output from the hidden feature extraction layer, and combines the feature map output from the local feature encoder and processed by the downsampling layer, performs fusion, convolution, upsampling, and classification processing, and outputs the identification of the crack pixel area in the building exterior wall image.

[0039] Among them, Figure 1As shown, the local feature encoder is connected in series with the first residual network, the second residual network, and the third residual network in sequence from the input end to the output end, and each residual network is connected in series with the convolution layer, the maximum pooling layer, and the activation layer in sequence from the input end to the output end; and the output end of the first residual network, the output end of the second residual network, and the output end of the third residual network are connected to the fusion classification subsystem through a 1 / 2 rate image spatial resolution restoration layer, a 1 / 4 rate image spatial resolution restoration layer, and a 1 / 8 rate image spatial resolution restoration layer, respectively.

[0040] like Figure 1 As shown, the global feature encoder is connected in series with a preset number of Transformer encoders in a direction from the input end to the output end, and the structures of each Transformer encoder are the same. Each Transformer encoder is connected in series with an input processing group, a self-attention and encoding and decoding group, and a feedforward neural output processing group in a direction from the input end to the output end; wherein the input processing group is connected in series with a first residual connection module and a position encoding module in a direction from the input end to the output end, one of the input ends of the first residual connection module constitutes the input end of the input processing group, i.e., the input end of the Transformer encoder, the other input end of the first residual connection module is connected to the position encoding module, and the output end of the first residual connection module constitutes the output end of the input processing group, and the first residual connection module receives the local feature map, adds the position information and then outputs it; the self-attention and encoding and decoding groups are connected in series in a direction from the input end to the output end The self-attention module, the first normalization layer, the second residual connection module, the encoder-decoder attention module, the second normalization layer, and the third residual connection module are connected, wherein the input end of the self-attention module constitutes the input end of the self-attention and encoding-decoding group, the input end of the second residual connection module is simultaneously connected to the input end of the self-attention module, the input end of the third residual connection module is simultaneously connected to the output end of the second residual connection module, and the output end of the third residual connection module constitutes the output end of the self-attention and encoding-decoding group; the feedforward neural output processing group is sequentially connected in series with the feedforward neural network, the third normalization layer, and the fourth residual connection module from the input end to the output end, the input end of the feedforward neural network constitutes the input end of the feedforward neural output processing group, the fourth residual connection module constitutes the output end of the feedforward neural output processing group, that is, the output end of the Transformer encoder, and the input end of the fourth residual connection module is simultaneously connected to the input end of the feedforward neural network.

[0041] In the application, the encoder-decoder attention module adopts the cross attention mechanism, which can improve the decoder's forward and backward position association ability and normalize the relationship between the output pixel positions again. The self-attention module uses the residual connection method to associate the multi-head self-attention mechanism MSA module and the multi-layer perceptron MLP module, as shown in the following formula:

[0042]

[0043] z l ′=MSA(LN(z l ' -1 ))+z l-1

[0044] z l =MLP(LN(z l ′))+z l '

[0045] The self-attention module uses the residual connection method to associate the multi-head self-attention mechanism MSA module and the multi-layer perceptron MLP module, which can dynamically capture the position relationship between the pixels of the input drone image sample image, and standardize the output of this position relationship through the layer normalization module. In the formula, z0 represents the input vector of the linear mapping module, z l ′ represents the input vector of the first step of the multi-head self-attention mechanism MSA module, z l represents the input vector of the first step of the multi-layer perceptron MLP module, z l-1 Represents the input vector of the l-1th step of the multilayer perceptron MLP module, i = 1…I, I = (H×W) / P 2 , represents the i-th building exterior wall sample image of preset size P×P, E represents the size of each feature vector, E pos represents position encoding; H×W represents the resolution of the sample image of the building exterior wall; LN(·) represents normalization processing.

[0046] The data transmission between the local feature encoder and the global feature encoder needs to undergo linear mapping, that is, the feature image of the cracks in the building exterior wall is first flattened into a one-dimensional vector, and the linear transformation of the local feature image is realized through the linear layer to convert the feature image of the cracks in the building exterior wall into a new feature image; for the weight matrix of the linear mapping model, the weight matrix is ​​initially defined using a uniform distribution, and then the sigmoid activation function is used to continuously optimize the weight matrix according to the number of input and output of the model, so as to minimize the loss function and determine the stop condition for updating the weight matrix.

[0047] Regarding the last fusion classification subsystem in the TransUNet model to be trained, the actual application design connects the first upsampling layer, the first splicing layer, the first residual layer, the second upsampling layer, the second splicing layer, the second residual layer, the third upsampling layer, the third splicing layer, the third residual layer, the fourth upsampling layer, the fourth residual layer, and the segmentation head layer in series from the input end to the output end; among them, the output end of the first residual network, the output end of the second residual network, and the output end of the third residual network in the local feature encoder are respectively connected to the input of the third splicing layer through the 1 / 2 rate image spatial resolution restoration layer, the 1 / 4 rate image spatial resolution restoration layer, and the 1 / 8 rate image spatial resolution restoration layer. The input end, the input end of the second splicing layer, and the input end of the first splicing layer are connected to the input end, that is, the reduced image spatial resolution is restored to the same level as the input image at a rate of 1 / 8, 1 / 4, and 1 / 2, so as to obtain more information about the cracks in the exterior wall; the first splicing layer, the second splicing layer, and the third splicing layer respectively calculate the attention weights between the obtained local features and the global features according to the cross attention mechanism, and perform weighted splicing processing on the global feature map output by the upsampling layer and the local feature map output by the downsampling layer connected thereto; the first residual layer, the second residual layer, the third residual layer, and the fourth residual layer have the same structure, and are respectively connected in series with the convolution layer, the pooling layer, and the Relu activation layer from the input end to the output end.

[0048] Based on the specific construction of the above TransUNet model to be trained, the following step C is performed next.

[0049] Step C. Based on the sample set, with the sample image of the building exterior wall as input and the corresponding crack pixel area as output, the TransUNet model to be trained is trained to obtain a building crack detection model.

[0050] In the specific application process of training the TransUNet model to be trained, regarding the crack pixel area extraction process, the total variation loss TVLoss model is used to reduce the difference between adjacent pixels according to the following formula to achieve the effect of image super-resolution denoising;

[0051]

[0052] In the formula, x m,j Represents the pixel value at position (m, j) in the sample image of the building exterior wall.

[0053] In practical applications, the gradients of pixels in various spatial directions are calculated based on the spatial position morphological characteristics of wall crack pixels, and the gradient extreme value is generated to enhance the TVLoss model's ability to classify targets and noise, thereby improving the accuracy of segmentation of small wall cracks.

[0054] In the specific application process of training the TransUNet model to be trained, the loss function Loss shown below is specifically used.

[0055] Loss = Dice_Loss + CE_Loss

[0056]

[0057] Where i = 1…I, I represents the number of sample images of building exterior walls, y i and They represent the label value and predicted value of the i-th building exterior wall sample image respectively.

[0058] In practical applications, for example, a total of 1,000 images of building exterior walls are collected by drones on site, of which 800 are training sets, 100 are validation sets, and 100 are test sets. The image size is 224×224, with RGB channels, and as shown in Table 1, the TransUNet model to be trained is trained.

[0059] Table 1

[0060] Parameter settings Related Notes Batchsize=4 The number of batches, here is 4 Epoch = 100 Train the dataset for 100 rounds LearningRate = 0.001 The learning rate is set to 0.001 Trainingsize=800 The training set size is 800 images Validationsize=100 The validation set size is 100 images

[0061] Based on the acquisition of the above-mentioned building crack detection model, the following step i is then performed to apply the building crack detection model to identify cracks on the exterior wall of the target building.

[0062] Step i. Obtain an image of the exterior wall of the target building, and crop it into sample images of each exterior wall of the building of a preset size. Apply the building crack detection model to process each sample image of the exterior wall of the building, respectively, obtain the crack pixel area in each sample image of the exterior wall of the building, and then obtain the crack pixel area of ​​the exterior wall of the target building to achieve crack identification.

[0063] The building exterior wall crack detection method designed by the above technical scheme, for the sample image of the building exterior wall, uses the ResNet50 neural network to design a local feature encoder to extract local features, and the Transformer model to design a global feature encoder to extract global features, and cooperates with the fusion classification subsystem to sample the local features and the global features, and constructs the TransUNet to-be-trained model, which is trained by the sample data to obtain the building crack detection model, and then performs crack recognition on the actual building exterior wall; the design model uses jump connections to combine low-level features with high-level features, so as to improve the efficiency and accuracy of building exterior wall crack detection, and to issue early warnings for the safety hazards of the building exterior wall falling off due to cracks. The design method reduces manpower, material resources, and monitoring costs, and eliminates the safety hazards of the building exterior wall falling off.

[0064] The embodiments of the present invention are described in detail above with reference to the accompanying drawings, but the present invention is not limited to the above embodiments, and various changes can be made within the knowledge scope of ordinary technicians in this field without departing from the purpose of the present invention.

Claims

1. A method for detecting cracks in a building exterior wall, characterized in that: Perform the following steps A to C to obtain a building crack detection model, and then perform the following step i to apply the building crack detection model to identify cracks on the exterior wall of the target building; Step A. Obtain a preset number of building exterior wall images each containing wall cracks, and mark each crack pixel area in each building exterior wall image, and then crop each building exterior wall image to obtain each building exterior wall sample image of a preset size to form a sample set, and proceed to step B; Step B. Take the local feature and global feature dual-path encoding as input, construct the TransUNet model to be trained through linear mapping and feature fusion, and then proceed to step C; Step C. Based on the sample set, the sample image of the building exterior wall is used as input, and the corresponding crack pixel area is used as output, and the TransUNet to-be-trained model is trained to obtain a building crack detection model; Step i. Obtain an image of the exterior wall of the target building, and crop it into sample images of each exterior wall of the building of a preset size. Apply the building crack detection model to process each sample image of the exterior wall of the building, respectively, obtain the crack pixel area in each sample image of the exterior wall of the building, and then obtain the crack pixel area of ​​the exterior wall of the target building to achieve crack identification.

2. A method for detecting cracks in a building exterior wall according to claim 1, characterized in that: In the step A, first, based on the preset brightness change range, each building exterior wall image is generated to correspond to the extended image of the building exterior wall under each brightness change, and each building exterior wall image is constructed, the ratio of the number of building exterior wall sample images containing crack pixel areas to the number of building exterior wall sample images not containing crack pixel areas is within a preset proportional fluctuation range centered on 0.5, and then each crack pixel area in all the building exterior wall images is marked respectively.

3. A method for detecting cracks in a building exterior wall according to claim 1, characterized in that: In the step B, the TransUNet model to be trained includes, from the input end to the output end, a local feature encoder, a linear mapping layer, a global feature encoder, a hidden feature extraction layer, and a fusion classification subsystem connected in series in sequence, and the local feature encoder is connected to the fusion classification subsystem via a downsampling layer; the building exterior wall image is received by the input end of the local feature encoder, the local feature map is extracted by the local feature encoder, and the mapping is updated by the linear mapping layer, then the local feature encoder receives the local feature map output from the linear mapping layer, extracts the global feature map, and obtains the hidden feature map output by the hidden feature extraction layer, and finally the fusion classification subsystem receives the hidden feature map output from the hidden feature extraction layer, and combines the feature map output from the local feature encoder and processed by the downsampling layer, performs fusion, convolution, upsampling, and classification processing, and outputs the identification of the crack pixel area in the building exterior wall image.

4. A method for detecting cracks in a building exterior wall according to claim 3, characterized in that: The local feature encoder is connected in series to the first residual network, the second residual network, and the third residual network in sequence from the input end to the output end, and each residual network is connected in series to the convolution layer, the maximum pooling layer, and the activation layer in sequence from the input end to the output end; and the output end of the first residual network, the output end of the second residual network, and the output end of the third residual network are connected to the fusion classification subsystem through a 1 / 2 rate image spatial resolution restoration layer, a 1 / 4 rate image spatial resolution restoration layer, and a 1 / 8 rate image spatial resolution restoration layer, respectively.

5. A method for detecting cracks in a building exterior wall according to claim 4, characterized in that: The fusion classification subsystem is connected in series from the input end to the output end in the direction of the first upsampling layer, the first splicing layer, the first residual layer, the second upsampling layer, the second splicing layer, the second residual layer, the third upsampling layer, the third splicing layer, the third residual layer, the fourth upsampling layer, the fourth residual layer, and the segmentation head layer; wherein the output end of the first residual network, the output end of the second residual network, and the output end of the third residual network in the local feature encoder are respectively passed through the 1 / 2 rate image spatial resolution restoration layer, the 1 / 4 rate image spatial resolution restoration layer, The 1 / 8 rate image spatial resolution restoration layer is connected to the input end of the third splicing layer, the input end of the second splicing layer, and the input end of the first splicing layer. The first splicing layer, the second splicing layer, and the third splicing layer respectively perform feature map splicing processing on the global feature map output by the upsampling layer connected thereto and the local feature map output by the rate image spatial resolution restoration layer; the first residual layer, the second residual layer, the third residual layer, and the fourth residual layer have the same structure, and are respectively connected in series with the convolution layer, the pooling layer, and the Relu activation layer from the input end to the output end.

6. A method for detecting cracks in a building exterior wall according to claim 3, characterized in that: The first splicing layer, the second splicing layer, and the third splicing layer respectively calculate the attention weights between the obtained local features and the global features according to the cross-attention mechanism, and perform weighted splicing processing on the global feature map output by the upsampling layer and the local feature map output by the downsampling layer connected thereto.

7. A method for detecting cracks in a building exterior wall according to claim 3, characterized in that: The global feature encoder is connected in series with a preset number of Transformer encoders in a direction from the input end to the output end, and the structures of the Transformer encoders are the same. The Transformer encoders are connected in series with an input processing group, a self-attention and encoding and decoding group, and a feedforward neural output processing group in a direction from the input end to the output end; The input processing group is connected in series with the first residual connection module and the position encoding module in a direction from the input end to the output end. One input end of the first residual connection module constitutes the input end of the input processing group, that is, the input end of the Transformer encoder. The other input end of the first residual connection module is connected to the position encoding module. The output end of the first residual connection module constitutes the output end of the input processing group. The first residual connection module receives the local feature map, adds the position information and then outputs it. The self-attention and encoding-decoding group sequentially connects the self-attention module, the first normalization layer, the second residual connection module, the encoder-decoder attention module, the second normalization layer, and the third residual connection module in series from the input end to the output end, wherein the input end of the self-attention module constitutes the input end of the self-attention and encoding-decoding group, the input end of the second residual connection module is simultaneously connected to the input end of the self-attention module, the input end of the third residual connection module is simultaneously connected to the output end of the second residual connection module, and the output end of the third residual connection module constitutes the output end of the self-attention and encoding-decoding group; The feedforward neural output processing group is connected in series with the feedforward neural network, the third normalization layer, and the fourth residual connection module in a direction from the input end to the output end. The input end of the feedforward neural network constitutes the input end of the feedforward neural output processing group, and the fourth residual connection module constitutes the output end of the feedforward neural output processing group, that is, the output end of the Transformer encoder. The input end of the fourth residual connection module is also connected to the input end of the feedforward neural network.

8. A method for detecting cracks in a building exterior wall according to claim 7, characterized in that: The encoder-decoder attention module adopts a cross attention mechanism, and the self-attention module uses a residual connection to associate the multi-head self-attention mechanism MSA module and the multi-layer perceptron MLP module, as shown in the following formula: z l ′=MSA(LN(z l ′ -1 ))+z l-1 With l =MLP(LN(z l ′))+z l ′ Where z0 represents the linear mapping module input vector, z l ′ represents the input vector of the first step of the multi-head self-attention mechanism MSA module, z l represents the input vector of the first step of the multi-layer perceptron MLP module, z l-1 Represents the input vector of the l-1th step of the multilayer perceptron MLP module, i = 1…I, I = (H×W) / P 2 , represents the i-th building exterior wall sample image of preset size P×P, E represents the size of each feature vector, E pos represents position encoding; H×W represents the resolution of the sample image of the building exterior wall; LN(·) represents normalization processing.

9. A method for detecting cracks in a building exterior wall according to claim 1, characterized in that: In the process of training the TransUNet model to be trained in step C, the loss function Loss is as follows: Loss = Dice_Loss + CE_Loss Where i = 1…I, I represents the number of sample images of building exterior walls, y i and They represent the label value and predicted value of the i-th building exterior wall sample image respectively.

10. A method for detecting cracks in a building exterior wall according to claim 3, characterized in that: In the process of training the TransUNet model to be trained, in step C, regarding the crack pixel region extraction process, according to the following formula, a total variation loss TVLoss model is used to reduce the difference between adjacent pixels to achieve the effect of image super-resolution denoising; In the formula, x m,j Represents the pixel value at position (m, j) in the sample image of the building exterior wall.

Citation Information

Patent Citations

  • Dual-time remote sensing change detection method combining local representation and global modeling

    CN114821303A

  • Pavement crack detection method and system based on position information and attention mechanism

    CN117710348A

  • Electric arc welding seam detection method based on improved yolov5

    CN118279647A

Cited By

  • Construction site safety detection method, device, equipment and medium

    CN120853023A