A method for detecting building exterior wall defects using infrared polarization imaging

Through infrared polarization imaging technology, combined with a multi-channel perturbation enhanced attention module, a location-aware context fusion module, and a geometry-guided saliency modeling module, the problems of insufficient detection accuracy and recognition ability in building exterior wall defect detection are solved, and high-precision defect detection and positioning are achieved.

CN120431102BActive Publication Date: 2025-09-16CHINA STATE CONSTR INT ENG CO LTD +1
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202510942601.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-07-09
Publication Date
2025-09-16
Estimated Expiration
2045-07-09

AI Technical Summary

Technical Problem

In the detection of building exterior wall defects, existing technologies have reduced detection accuracy, especially under complex lighting, surface obstruction or material interference conditions, making it difficult to identify hidden and structural defects. In addition, the uneven thermal diffusion and low contrast of infrared images make it difficult to reflect the structural characteristics of the defects.

Method used

Using infrared polarization imaging technology, the detection accuracy of building exterior wall defects is improved through a multi-channel perturbation enhanced attention module, a location-aware context fusion module, and a geometry-guided saliency modeling module.

Benefits of technology

It achieves high-precision automated detection and positioning of building exterior wall defects, improves detection accuracy and robustness in complex scenarios, and can effectively identify multiple types of defects.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120431102B_ABST
    Figure CN120431102B_ABST
Patent Text Reader

Abstract

The present invention discloses a method for detecting building exterior wall defects using infrared polarization imaging, which belongs to the field of image processing and aims to improve the accuracy and robustness of building exterior wall defect detection. The method first collects surface image data of building exterior walls and constructs an image dataset. A channel perturbation intensity factor and mutual information measurement strategy are designed to construct a multi-channel perturbation enhanced attention module and extract multi-scale feature maps. A position-aware context fusion module is constructed to enhance the feature fusion effect through a position modulation coefficient. A geometry-guided saliency modeling module is constructed to generate a structure-aware saliency map through a geometry-guided deviation factor. The above modules are integrated to construct a defect detection model, and the image to be detected is input into the model to output the defect area, thereby achieving accurate detection and positioning of building exterior wall defects such as cracks, shedding, and bulges.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the field of image processing, and in particular relates to a method for detecting building exterior wall defects using infrared polarization imaging. Background Art

[0002] In the detection of building exterior wall defects, traditional methods usually rely on manual inspections or visual recognition methods based on visible light images. Such methods are prone to reduced detection accuracy when faced with complex lighting, surface occlusion or material interference, and have limited ability to identify hidden and structural defects. At the same time, although ordinary infrared images have penetrating and thermal perception capabilities, they also have problems such as uneven heat diffusion and low contrast in actual applications, making it difficult to directly reflect the structural characteristics of defects. Therefore, a single information source or single-scale analysis method often cannot meet the needs of high-precision defect identification in complex scenarios.

[0003] In recent years, the development of infrared polarization imaging technology has provided new ideas for the detection of building exterior wall defects. While maintaining the infrared thermal sensing characteristics, infrared polarization images also reflect the microstructure and directionality of the material surface, making the defects and normal areas show more obvious differences at different polarization angles. Although studies have used infrared polarization images for building surface analysis, most methods have failed to fully utilize the complementary information of polarization images in multiple channels, and still have significant limitations in feature extraction, fusion and defect characterization. In particular, when facing complex texture backgrounds or multiple types of defects, misjudgments and missed detections are prone to occur.

[0004] The present invention proposes a building exterior wall defect detection method based on infrared polarization imaging data. The method takes the imaged infrared polarization image as input, improves the extraction and recognition capabilities of different polarization channel features through a multi-channel perturbation enhancement attention module, introduces a position-aware context fusion module to effectively integrate multi-scale features and spatial semantic information, and then enhances the perception of structural boundaries and defect areas through a geometry-guided saliency modeling module. Finally, combined with a defect discrimination enhancement module, the method improves the ability to accurately locate and classify real defects. Summary of the Invention

[0005] The present invention provides a building exterior wall defect detection method based on infrared polarization imaging, aiming to achieve high-precision automated detection and positioning of building exterior wall defects through the synergistic effect of a multi-channel perturbation enhanced attention module, a position-aware context fusion module, and a geometry-guided saliency modeling module.

[0006] The present invention aims to propose a building exterior wall defect detection model and provide a building exterior wall defect detection method using infrared polarization imaging, which includes the following steps:

[0007] S1. Collect infrared polarization imaging image data of building exterior wall surfaces to generate a building exterior wall image dataset;

[0008] S2. Designing a channel perturbation intensity factor and a mutual information measurement strategy, constructing a multi-channel perturbation enhancement attention module, and obtaining a multi-scale feature map of the building exterior wall image data through the multi-channel perturbation enhancement attention module;

[0009] S3. Designing a position modulation coefficient and constructing a position-aware context fusion module. The multi-scale feature map is passed through the position-aware context fusion module to obtain a fused context feature representation.

[0010] S4. Building a geometrically guided bias factor and constructing a geometrically guided saliency modeling module. The contextual feature representation obtains a saliency map with structure perception capability through the geometrically guided saliency modeling module.

[0011] S5, integrates the multi-channel perturbation enhanced attention module, the location-aware context fusion module and the geometry-guided saliency modeling module to build a building exterior wall defect detection model;

[0012] S6. Train a building exterior wall defect detection model, input the building exterior wall image to be detected into the trained building exterior wall defect detection model for detection, and output the defect area existing in the building exterior wall image.

[0013] Preferably, in S1, constructing a building exterior wall image dataset specifically includes the following steps: collecting infrared polarization imaging building exterior wall defect images in multiple polarization directions through an infrared polarization imager, a total of 4,500 images, dividing the training set, validation set and test set in a ratio of 8:1:1, and manually annotating each collected image using LabelMe. The annotation content includes three common types of defects including cracks, shedding and bulging, and the location of the defect area. The collected images are preprocessed and the image size is unified to 256×256.

[0014] Preferably, the image data of building exterior walls covering three types of defects usually have significantly different representations in the image, which can easily cause the feature extractor to overfit the local structure. In addition, different channels respond unevenly to information such as texture, edge and color, which can easily cause information redundancy or feature offset. Moreover, image noise and sampling angle changes in the actual acquisition process will further aggravate feature instability. Therefore, a multi-channel perturbation enhanced attention module is proposed to introduce explicit perturbation factors to simulate local interference, thereby improving the selective response ability of the channel attention mechanism to structural sensitive areas and achieving more robust defect perception capabilities.

[0015] Preferably, in S2, constructing a multi-channel perturbation enhanced attention module specifically includes the following steps:

[0016] Step S21: Calculate the initial features of the original building exterior wall image to obtain a primary feature map set. The mathematical model is:

[0017] ;

[0018] in, Represented as the input building exterior wall image, Indicates the image The primary feature extraction operator of each channel, Indicates the The primary feature map under the channel is Add the disturbance term to obtain the disturbance characteristic graph, and the mathematical model is:

[0019] ;

[0020] in, It is represented as the channel feature map after adding disturbance, Expressed as the channel disturbance intensity factor, the mathematical model is:

[0021] ;

[0022] in, is a learnable parameter, and the network updates the parameter through back propagation. Expressed as an exponential function Perform nonlinear transformation.

[0023] Step S22: Propose a mutual information measurement strategy based on the channel feature map after adding disturbance. The mathematical model is:

[0024] ;

[0025] in, is the mutual information measurement strategy, and They are the feature maps under channel j And the feature map under channel i The number of times a specific pixel value appears in , is the joint probability distribution, and the statistics of each pair of identical pixel values ​​are and The joint occurrence number in , the mathematical model is:

[0026] ;

[0027] in, Is the pixel value that appears at the same time and times.

[0028] Step S23: Finally, a multi-scale feature map is constructed by fusing the perturbation channel feature map and the mutual information measurement strategy. The mathematical model is:

[0029] ;

[0030] in, Represented as a multi-scale feature map.

[0031] Preferably, through the multi-channel perturbation enhanced attention module constructed by S2, step S21 simulates local blur and defect occlusion in real scenes through Gaussian perturbation, effectively improving the robustness and generalization ability of feature expression; step S22 can perform consistency analysis on the features before and after the perturbation through mutual information, guiding the attention mechanism to pay more attention to channels sensitive to structural stability, thereby improving the response to defect contours and boundaries; step S23 fuses structural saliency and multi-channel information to construct a unified representation graph with scale generalization ability, thereby improving the overall detection accuracy and robustness; in summary, the multi-channel perturbation enhanced attention module constructed by S2 can enhance the model's ability to distinguish defect areas under the conditions of feature instability and complex defect structure distribution, thereby improving the overall performance of the building exterior wall defect detection system.

[0032] Preferably, a multi-scale feature map is generated by the multi-channel perturbation enhanced attention module constructed by S2. The relative position relationship of each pixel position in the multi-scale feature map has not been explicitly encoded, which can easily lead to blurred edge details or confusion of context information. In addition, the spatial gradient or global position offset between the pixel positions in the feature map is not considered, which makes the distinction between different defect areas insufficient. It is necessary to further establish spatial context constraints to highlight the defective parts in the building exterior wall image. Therefore, a position-aware context fusion module is introduced to enhance spatial perception capabilities using position mapping and improve the model's ability to recognize spatial patterns of defective areas.

[0033] Preferably, in S3, building a location-aware context fusion module specifically includes the following steps:

[0034] Step S31: Design the position modulation coefficient, input the multi-scale feature map into the spatial coordinate encoding function, and generate a normalized position mapping matrix. The mathematical model is:

[0035] ;

[0036] in, is the normalized position mapping matrix, is the pixel position in the multi-scale feature map, is the height and width of the multi-scale feature map, is the Sigmoid activation function, and is the trainable position modulation coefficient, and the mathematical model is:

[0037] ;

[0038] ;

[0039] in, and Represents multi-scale feature maps exist horizontal and vertical gradients of the position, and is a constant, is the global mean of the multi-scale feature map, and the mathematical model is:

[0040] .

[0041] Step S32: Apply a normalized position mapping matrix to each scale feature map. The mathematical model is:

[0042] ;

[0043] in, It is represented as a scale feature map after the position weight is applied.

[0044] Preferably, through the position-aware context fusion module constructed by S3, step S31 introduces an explicit spatial position encoding mechanism by constructing a normalized position mapping matrix, so that the model has pixel-space perception capabilities, combines horizontal and vertical gradient information and learnable position modulation factors, and realizes adaptive modeling of structural directionality and position saliency. Step S32 applies the position mapping matrix to the multi-scale feature map to enhance the response of the defect area, suppress background interference, and realize selective enhancement of spatial features and contextual structure compensation. In summary, this module can effectively improve the spatial distribution expression ability and structure preservation ability of the feature map, providing high-quality representation with spatial semantic perception for subsequent defect recognition.

[0045] Preferably, the scale feature map after the position weight generated by the S3 module not only integrates the spatial context information, but also has strong position sensitivity and structural response capabilities. However, it still has the problem of weak recognition of edge fuzzy areas and complex structures. Therefore, it is necessary to further introduce a geometric structure perception mechanism to improve the defect contour positioning accuracy.

[0046] Preferably, in S4, constructing a geometry-guided saliency modeling module specifically includes the following steps:

[0047] Step S41: Design a geometric guide deviation factor to guide and highlight the defect area with clear outline. The mathematical model is:

[0048] ;

[0049] in, Expressed as the geometric guidance deviation factor at image location (x,y), and It is expressed as the horizontal gradient and vertical gradient of the scale feature map after the position weight is applied. is the trainable geometric adjustment coefficient.

[0050] Step S42: Generate the final geometrically guided saliency map through the scale feature map after the geometrically guided deviation factor and the position weight are applied. The mathematical model is:

[0051] ;

[0052] in, Represented as a geometrically guided saliency map, is the activation function.

[0053] Step S43: Set a global threshold to obtain the defect area of ​​the building exterior wall. The mathematical model is:

[0054] ;

[0055] in, Indicates whether the position in the image belongs to the defect area, 1 indicates the defect area, and 0 indicates the non-defect area. Denoted as the global threshold.

[0056] Preferably, through the geometrically guided saliency modeling module constructed by S4, step S41 designs a geometrically guided deviation factor to perceive the geometric change trend of the scale feature map in the horizontal and vertical directions, and realizes sensitive guidance of the structural mutation area through the trainable geometric adjustment coefficient. Step S42 fuses the geometric deviation factor with the position feature map to generate a geometrically guided saliency map, effectively highlighting the defective areas with clear contours and significant structures. Step S43 combines the global threshold setting to perform explicit area division on the saliency map, accurately extracts the defective target area in the building exterior wall image, and improves the overall detection accuracy and spatial positioning consistency.

[0057] Preferably, in S5, constructing a building exterior wall defect detection model specifically includes the following steps:

[0058] Step S51: The original building exterior wall image is enhanced by the multi-channel perturbation attention module to generate a multi-scale feature map. The mathematical model is:

[0059] ;

[0060] in, represents the multi-channel perturbation enhanced attention module, Represented as the input building exterior wall image, Represented as a multi-scale feature map.

[0061] Step S52: The multi-scale feature map is fused through the location-aware context fusion module to obtain a fused context feature representation. The mathematical model is:

[0062] ;

[0063] in, Represented as a location-aware context fusion module, Represented as the fused context feature representation.

[0064] Step S53: The fused context feature representation is used to determine the defective area of ​​the building exterior wall through the geometry-guided saliency modeling module. The mathematical model is:

[0065] ;

[0066] in, Represented as a geometry-guided saliency modeling module, It means judging whether the position in the image belongs to the defect area.

[0067] In summary, due to the adoption of this technical solution, compared with the existing technology, the beneficial effects of the present invention are as follows: the multi-channel perturbation enhanced attention module enables the model to adaptively identify feature channels that are sensitive to defect structures by introducing channel perturbations and mutual information-driven attention mechanisms, thereby enhancing the model's feature extraction capabilities for diverse defect types; the position-aware context fusion module enhances the model's perception of the position distribution and context structure of defect areas in the image through a spatial gradient and position weight mapping mechanism, thereby effectively improving the positioning accuracy and continuity of defect areas; the geometry-guided saliency modeling module achieves highly responsive extraction of defect contours and boundaries by constructing geometric deviation factors and saliency enhancement mechanisms, thereby improving the ability to identify fine-grained structural defects; the three modules work together to form a structure-guided building exterior wall defect detection model, which enables the model to have the comprehensive capabilities of multi-channel selective response, spatial context fusion, structural geometry perception, and explicit defect judgment, significantly improving the detection accuracy and robustness of cracks, peeling, and bulge defects in complex building exterior wall images. BRIEF DESCRIPTION OF THE DRAWINGS

[0068] Figure 1 A step-by-step diagram of a building exterior wall defect detection method using infrared polarization imaging.

[0069] Figure 2 Diagram of the structure of the attention module for multi-channel perturbation enhancement.

[0070] Figure 3This is the structural diagram of the location-aware context fusion module.

[0071] Figure 4 Diagram of the module structure for geometry-guided saliency modeling.

[0072] Figure 5 This is the overall structure diagram of the building exterior wall defect detection model.

[0073] Figure 6 The final result image generated by the building exterior wall defect detection model for the building exterior wall defect image. DETAILED DESCRIPTION

[0074] The technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, rather than all the embodiments; based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative work shall fall within the scope of protection of the present invention.

[0075] Please see the attached Figure 1 -Attached Figure 6 , the present invention provides a method for detecting building exterior wall defects using infrared polarization imaging.

[0076] As attached Figure 1 The present invention proposes a method for detecting building exterior wall defects using infrared polarization imaging, and the specific implementation method includes the following steps:

[0077] S1. Collect infrared polarization imaging image data of building exterior wall surfaces to generate a building exterior wall image dataset.

[0078] Furthermore, as attached Figure 1 The dataset of building exterior wall images described in S1 is a collection of high-resolution building exterior wall images collected by drones, totaling 4500 images. The training set, validation set, and test set are divided into a ratio of 8:1:1. Each collected image is manually annotated using LabelMe. The annotation content includes three common types of defects, including cracks, peeling, and bulging, as well as the location of the defect area. The collected images are preprocessed and the image size is unified. size.

[0079] S2. Design a channel perturbation intensity factor and mutual information measurement strategy, construct a multi-channel perturbation enhancement attention module, and obtain a multi-scale feature map of the building exterior wall image data through the multi-channel perturbation enhancement attention module.

[0080] Furthermore, as attached Figure 1 The multi-channel perturbation enhanced attention module described in S2 is constructed. The specific steps of the module construction are as shown in the attached Figure 2As shown, the specific implementation of the module includes the following steps:

[0081] Furthermore, in step S21, the initial features of the original building exterior wall image are calculated to obtain a primary feature map set. The mathematical model is:

[0082] ;

[0083] in, Represented as the input building exterior wall image, Indicates the image The primary feature extraction operator of each channel, Indicates the The primary feature map under each channel, The value is 3; Add the disturbance term to obtain the disturbance characteristic graph, and the mathematical model is:

[0084] ;

[0085] in, It is represented as the channel feature map after adding disturbance, Expressed as the channel disturbance intensity factor, the mathematical model is:

[0086] ;

[0087] in, is a learnable parameter, and the network updates the parameter through back propagation. Expressed as an exponential function Perform nonlinear transformation, the implementation code is:

[0088] class FeatureDisturbanceModel(tf.keras.Model):

[0089] def __init__(self):

[0090] super(FeatureDisturbanceModel, self).__init__()

[0091] self.conv1 = layers.Conv2D(32, (3, 3), activation='relu',padding='same')

[0092] self.conv2 = layers.Conv2D(64, (3, 3), activation='relu',padding='same')

[0093] self.alpha = self.add_weight(name='alpha', shape=(1,),initializer='uniform', trainable=True)

[0094] self.beta = self.add_weight(name='beta', shape=(1,),initializer='uniform', trainable=True)

[0095] def call(self, inputs):

[0096] x = self.conv1(inputs)

[0097] x = self.conv2(x)

[0098] disturbance_factor = self.alpha * tf.exp(self.beta)

[0099] disturbed_feature_map = x + disturbance_factor

[0100] return disturbed_feature_map.

[0101] Furthermore, in step S22, a mutual information measurement strategy is proposed based on the channel feature map after adding disturbance, and the mathematical model is:

[0102] ;

[0103] in, is the mutual information measurement strategy, and The channels are The following feature map and the channel is The following feature map The number of times a specific pixel value appears in , assuming is 0, then The values ​​are 1 and 2, which means that the feature map of channel 0 is compared with the feature maps of channel 1 and channel 2 to see the number of times a specific pixel value appears. is the joint probability distribution, and the statistics of each pair of identical pixel values ​​are and The joint occurrence number in , the mathematical model is:

[0104] ;

[0105] in, It is a feature map and The number of times a specific pixel value appears at the same time, the implementation code is:

[0106] def compute_joint_probabilities(feature_map_i, feature_map_j):

[0107] flat_i = feature_map_i.flatten()

[0108] flat_j = feature_map_j.flatten()

[0109] joint_counts = {}

[0110] for pixel_i, pixel_j in zip(flat_i, flat_j):

[0111] pair = (pixel_i, pixel_j)

[0112] if pair not in joint_counts:

[0113] joint_counts[pair] = 1

[0114] else:

[0115] joint_counts[pair] += 1

[0116] N = len(flat_i)

[0117] joint_prob = {pair: count / N for pair, count in joint_counts.items()}

[0118] return joint_prob

[0119] def compute_marginal_probabilities(feature_map, joint_prob, other_map, axis=0):

[0120] prob = {}

[0121] flat_feature = feature_map.flatten()

[0122] flat_other = other_map.flatten()

[0123] for pair, p in joint_prob.items():

[0124] if axis == 0:

[0125] pixel = pair[0]

[0126] prob[pixel] = prob.get(pixel, 0) + p

[0127] else:

[0128] pixel = pair[1]

[0129] prob[pixel] = prob.get(pixel, 0) + p

[0130] return prob

[0131] def compute_entropy(prob_dist):

[0132] return -np.sum([p * np.log2(p) for p in prob_dist.values() if p>0])

[0133] def compute_mutual_information(feature_map_i, feature_map_j):

[0134] joint_prob = compute_joint_probabilities(feature_map_i, feature_map_j)

[0135] prob_i = compute_marginal_probabilities(feature_map_i, joint_prob, feature_map_j, axis=0)

[0136] prob_j = compute_marginal_probabilities(feature_map_j, joint_prob,feature_map_i, axis=1)

[0137] entropy_i = compute_entropy(prob_i)

[0138] entropy_j = compute_entropy(prob_j)

[0139] entropy_joint = compute_entropy(joint_prob)

[0140] mutual_information = entropy_i + entropy_j - entropy_joint

[0141] return mutual_information.

[0142] Furthermore, in step S23, a multi-scale feature map is constructed by fusing the perturbation channel feature map and the mutual information measurement strategy. The mathematical model is:

[0143] ;

[0144] in, Represented as a multi-scale feature map.

[0145] S3. Design a position modulation coefficient and construct a position-aware context fusion module. The multi-scale feature map obtains a fused context feature representation through the position-aware context fusion module.

[0146] Furthermore, as attached Figure 1 The construction steps of the location-aware context fusion module described in S3 are as follows: Figure 3 As shown, the specific implementation of the module includes the following steps:

[0147] Furthermore, in step S31, the position modulation coefficient is designed, the multi-scale feature map is input into the spatial coordinate encoding function, and a normalized position mapping matrix is ​​generated. The mathematical model is:

[0148] ;

[0149] in, is the normalized position mapping matrix, is the pixel position in the multi-scale feature map, is the height and width of the multi-scale feature map, both values ​​are 256, is the Sigmoid activation function, and is the trainable position modulation coefficient, and the mathematical model is:

[0150] ;

[0151] ;

[0152] in, and Represents multi-scale feature maps exist horizontal and vertical gradients of the position, and is a constant, convergence position modulation, with a value of 0.001, is the global mean of the multi-scale feature map, and the mathematical model is:

[0153] ;

[0154] The implementation code for the normalized position mapping matrix is:

[0155] class PositionModulationModel(tf.keras.Model):

[0156] def __init__(self, height, width):

[0157] super(PositionModulationModel, self).__init__()

[0158] self.height = height

[0159] self.width = width

[0160] self.alpha = self.add_weight(name='alpha', shape=(1,),initializer='uniform', trainable=True)

[0161] self.beta = self.add_weight(name='beta', shape=(1,),initializer='uniform', trainable=True)

[0162] def call(self, feature_map):

[0163] grad_x = tf.image.sobel_edges(feature_map)[:, :, :, 0]

[0164] grad_y = tf.image.sobel_edges(feature_map)[:, :, :, 1]

[0165] global_mean = tf.reduce_mean(feature_map, axis=[1, 2],keepdims=True)

[0166] position_modulation = self.alpha * (grad_x + grad_y) +self.beta

[0167] position_modulation = tf.sigmoid(position_modulation)

[0168] return position_modulation.

[0169] Furthermore, in step S32, a normalized position mapping matrix is ​​applied to each scale feature map, and the mathematical model is:

[0170] ;

[0171] in, It is represented as a scale feature map after the position weight is applied.

[0172] S4. Build a geometrically guided bias factor and construct a geometrically guided saliency modeling module. The context feature representation obtains a saliency map with structure perception capability through the geometrically guided saliency modeling module.

[0173] Furthermore, as attached Figure 1 The geometry-guided saliency modeling module described in S4 is constructed. The specific steps of the module construction are as shown in the attached Figure 4 As shown, the specific implementation of the module includes the following steps:

[0174] Furthermore, in step S41, a geometric guide deviation factor is designed to guide the defect area with clear outline. The mathematical model is:

[0175] ;

[0176] in, Expressed as the geometric guidance deviation factor at image location (x,y), and It is expressed as the horizontal gradient and vertical gradient of the scale feature map after the position weight is applied. is a trainable geometric adjustment coefficient, and the implementation code is:

[0177] class GeometricGuidanceModel(tf.keras.Model):

[0178] def __init__(self):

[0179] super(GeometricGuidanceModel, self).__init__()

[0180] self.w = self.add_weight(name='w', shape=(1,), initializer='uniform', trainable=True)

[0181] def call(self, feature_map):

[0182] grad_x = tf.image.sobel_edges(feature_map)[:, :, :, 0]

[0183] grad_y = tf.image.sobel_edges(feature_map)[:, :, :, 1]

[0184] geometric_guidance_factor = self.w * (grad_x + grad_y)

[0185] return geometric_guidance_factor.

[0186] Furthermore, in step S42, the scale feature map after the geometric guidance deviation factor and the position weight are applied is used to generate the final geometric guidance saliency map. The mathematical model is:

[0187] ;

[0188] in, Represented as a geometrically guided saliency map, is the activation function, the implementation code is:

[0189] class GeometricGuidedSaliencyModel(tf.keras.Model):

[0190] def __init__(self):

[0191] super(GeometricGuidedSaliencyModel, self).__init__()

[0192] self.w = self.add_weight(name='w', shape=(1,), initializer='uniform', trainable=True)

[0193] def call(self, feature_map, position_weights):

[0194] grad_x = tf.image.sobel_edges(feature_map)[:, :, :, 0]

[0195] grad_y = tf.image.sobel_edges(feature_map)[:, :, :, 1]

[0196] geometric_guidance_factor = self.w * (grad_x + grad_y)

[0197] saliency_map = tf.sigmoid(geometric_guidance_factor + position_weights)

[0198] return saliency_map.

[0199] Furthermore, in step S43, a global threshold is set to obtain the defective area of ​​the building exterior wall, and the mathematical model is:

[0200] ;

[0201] in, Indicates whether the position in the image belongs to the defect area, 1 indicates the defect area, and 0 indicates the non-defect area. It is expressed as a global threshold, and the pixel median of the geometrically guided saliency map is selected as the global threshold. The implementation code is:

[0202] pixels = image.flatten()

[0203] pixels_sorted = np.sort(pixels)

[0204] n = len(pixels_sorted)

[0205] if n % 2 == 1:

[0206] median = pixels_sorted[n / / 2]

[0207] else:

[0208] median = (pixels_sorted[n / / 2 - 1] + pixels_sorted[n / / 2]) / 2.

[0209] S5. A multi-channel perturbation enhanced attention module, a location-aware context fusion module, and a geometry-guided saliency modeling module are integrated to construct a building exterior wall defect detection model.

[0210] Furthermore, as attached Figure 1 The building exterior wall defect detection model described in S5 is constructed. The specific steps of the model construction are as follows Figure 5 As shown, the specific implementation of the model includes the following steps:

[0211] Furthermore, in step S51, the original building exterior wall image is enhanced by the multi-channel perturbation attention module to generate a multi-scale feature map. The mathematical model is:

[0212] ;

[0213] in, represents the multi-channel perturbation enhanced attention module, Represented as the input building exterior wall image, Represented as a multi-scale feature map.

[0214] Furthermore, in step S52, the multi-scale feature map is fused through the location-aware context fusion module to obtain a fused context feature representation. The mathematical model is:

[0215] ;

[0216] in, Represented as a location-aware context fusion module, Represented as the fused context feature representation.

[0217] Furthermore, in step S53, the fused context feature representation is used to determine the defective area of ​​the building exterior wall through the geometry-guided saliency modeling module. The mathematical model is:

[0218] ;

[0219] in, Represented as a geometry-guided saliency modeling module, It means judging whether the position in the image belongs to the defect area.

[0220] S6. Train a building exterior wall defect detection model, input the building exterior wall image to be detected into the trained building exterior wall defect detection model for detection, and output the defect area existing in the building exterior wall image.

[0221] Furthermore, as attached Figure 1 The training building exterior wall defect detection model described in S6 in the previous section inputs a building exterior wall image and outputs the defect areas in the building exterior wall image, as shown in the attached figure. Figure 6 As shown, the specific implementation includes the following steps:

[0222] Furthermore, the infrared polarization imaging building exterior wall defect image dataset contains a total of 4,500 images, including three typical types of defects: cracks, peeling, and bulging. The building exterior wall defect detection model is trained on NVIDIA Tesla series devices, using the PyTorch deep learning framework for model design and training. Adamw is used as the loss function, and the initial learning rate is set to 0.001. The learning rate is reduced by a factor of 0.1 as the training progresses.

[0223] The above are only preferred embodiments of the present invention. It should be pointed out that those skilled in the art can make several modifications and improvements without departing from the inventive concept of the present invention, and these all fall within the scope of protection of the present invention.

Claims

1. A method for detecting building exterior wall defects using infrared polarization imaging, characterized in that: The following steps are involved: S1. Collect infrared polarization imaging image data of building exterior wall surfaces to generate a building exterior wall image dataset; S2. By designing the channel perturbation intensity factor and channel mutual information measurement strategy, a multi-channel perturbation enhanced attention module is constructed to output a multi-scale feature map, which is specifically expressed as: Calculate the initial features of the original building exterior wall image , get the primary feature map set , is the primary feature map set Add channel perturbation intensity factor , the mathematical model is: ; in, is a learnable parameter, and the network updates the parameter through back propagation. Expressed as an exponential function Perform nonlinear transformation; add channel perturbation intensity factor to primary feature map Generate perturbation feature map ; Design channel mutual information measurement strategy , the perturbation feature map is integrated with the channel mutual information measurement strategy to obtain a multi-scale feature map ; S3. Based on the position modulation coefficient, a position-aware context fusion module is constructed to obtain the scale feature map after the position weight is applied. , specifically expressed as, generating a normalized position mapping matrix based on the position modulation coefficient , the mathematical model is: ; in, is the pixel position in the multi-scale feature map, is the height and width of the multi-scale feature map, is the Sigmoid activation function, and is the trainable position modulation coefficient, and the mathematical model is: ; ; in, and Represents multi-scale feature maps horizontal and vertical gradients in position, and is a constant, is the global mean of the multi-scale feature map, and the mathematical model is: ; Apply a normalized position mapping matrix to each scale feature map to generate a scale feature map after position weighting ; S4. Build a geometric guide deviation factor. The mathematical model is: ; in, and It is expressed as the horizontal gradient and vertical gradient of the scale feature map after the position weight is applied. Expressed as the geometric guidance deviation factor at image location (x,y), A geometrically guided saliency modeling module is constructed based on the geometrically guided deviation factor, which is a trainable geometric adjustment coefficient. The geometrically guided saliency map is output, and finally, the defect area of ​​the building exterior wall is obtained through the geometrically guided saliency map. S5, integrates the multi-channel perturbation enhanced attention module, the location-aware context fusion module and the geometry-guided saliency modeling module to build a building exterior wall defect detection model; S6. Train a building exterior wall defect detection model, input the building exterior wall image to be detected into the trained building exterior wall defect detection model for detection, and output the defect area existing in the building exterior wall image.

2. The method for detecting building exterior wall defects using infrared polarization imaging according to claim 1, characterized in that: In S2, constructing a multi-channel perturbation enhanced attention module includes the following steps: S21. Obtain a primary feature map set based on the initial features of the original building exterior wall image , is the primary feature map set Add channel perturbation intensity factor , output perturbation feature map ; S22. Design a channel mutual information measurement strategy. The mathematical model is: ; in, is the channel mutual information measurement strategy, and They are the feature maps under channel j And the feature map under channel i The number of times a specific pixel value appears in , is the joint probability distribution, and the statistics of each pair of identical pixel values ​​are and The number of joint occurrences in ; S23, the perturbation channel feature map is integrated with the channel mutual information measurement strategy to construct a multi-scale feature map .

3. The method for detecting building exterior wall defects using infrared polarization imaging according to claim 2, wherein: In S4, a geometry-guided saliency modeling module is constructed, including the following steps: S41. Design geometric guide deviation factors to guide and highlight defect areas with clear contours; S42. Generate the final geometrically guided saliency map through the scale feature map after the geometrically guided bias factor and the position weight. The mathematical model is: ; in, Represented as a geometrically guided saliency map, is the activation function; S43. Setting a global threshold to obtain the defective area of ​​the building exterior wall, the mathematical model is: ; in, Indicates whether the position in the image belongs to the defect area, 1 indicates the defect area, and 0 indicates the non-defect area. Denoted as the global threshold.

4. The method for detecting building exterior wall defects using infrared polarization imaging according to claim 3, characterized in that: In S5, a multi-channel perturbation enhanced attention module, a location-aware context fusion module, and a geometry-guided saliency modeling module are integrated to construct a building exterior wall defect detection model. The specific steps are as follows: S51. The original building exterior wall image is enhanced with the attention module through multi-channel perturbation to generate a multi-scale feature map. The mathematical model is: ; in, represents the multi-channel perturbation enhanced attention module, Represented as the input building exterior wall image, Represented as a multi-scale feature map; S52, the multi-scale feature map is fused through the position-aware context fusion module to obtain the fused context feature representation. The mathematical model is: ; in, Represented as a location-aware context fusion module, Represented as a scale feature map after the position weight is applied; S53. The scale feature map after the position weight is applied is used to determine the defect area of ​​the building exterior wall through the geometry-guided saliency modeling module. The mathematical model is: ; in, Represented as a geometry-guided saliency modeling module, It means judging whether the position in the image belongs to the defect area.

5. The method for detecting building exterior wall defects using infrared polarization imaging according to claim 4, characterized in that: In S6, a building exterior wall defect detection model is trained and detected. The specific steps are as follows: during the training process, a structure-aware loss function is used to calculate the loss between the segmented image and the label. At the beginning of the training, a learning rate of 0.001 is used to accelerate the convergence speed, and the learning rate is reduced by a multiple of 0.1 as the training progresses.

Citation Information

Patent Citations

  • Concrete bridge crack detection method based on computer vision

    CN119130986A

  • Intelligent industrial quality inspection method and system based on AI visual identification

    CN119151869A