A building outer wall defect identification method and system based on regional perception
By using a region-aware building exterior wall defect identification method, the fuzzy factor perception module and the defect-guided attention module are used to enhance the building exterior wall image samples. Combined with the improved YOLOv11-OBB model, the problems of low efficiency and low accuracy in existing detection methods are solved, and efficient and accurate defect identification is achieved.
Patent Information
- Application Number
- CN202511527997.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-10-24
- Publication Date
- 2026-02-13
- Estimated Expiration
- 2045-10-24
AI Technical Summary
Existing methods for detecting defects in building exterior walls suffer from problems such as low efficiency and high cost of manual inspection, significant impact from background noise in images, insufficient datasets, and difficulty in models capturing multi-scale changes, resulting in low detection accuracy.
A method for identifying building exterior wall defects based on region perception is adopted. The building exterior wall image samples are enhanced by the fuzzy factor perception module FBAB and the defect-guided attention module DGAB to generate fuzzy enhanced feature maps and defect enhanced feature maps. The improved YOLOv11-OBB model is then used for defect identification.
It enables automatic image recognition of defects on building exterior walls, overcomes background noise and occlusion interference, improves the recognition effect of local blurred areas of defects such as rust spots, peeling areas and crack edges, and provides low-cost and efficient target detection.
Smart Images

Figure CN120997220B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of image processing, and particularly relates to a building outer wall defect identification method and system based on region perception. BACKGROUND
[0002] With the acceleration of urbanization and the large number of high-rise buildings, the building outer wall as an important part of the building not only bears the functions of protection, heat preservation and aesthetics, but also relates to the overall safety of the structure. However, in the long-term service process, the building outer wall is exposed to the external environment for a long time, and is affected by many factors such as wind, sun, temperature and humidity changes, acid rain erosion, pollution deposition and insufficient construction technology, and is prone to performance degradation and defect accumulation. These defects mainly include: surface peeling, cracks, missing bolts, rust stains, etc., with various forms and significant scale differences, and often accompanied by complex background factors such as coating aging, uneven illumination and obstruction interference. If the defects are not found and repaired in time, it may lead to leakage, thermal bridge and even component collapse, which poses a potential threat to the safety of residents' life and property, and also affects the landscape quality and use function of urban buildings. The existing building outer wall defect detection methods have the following problems: 1. The traditional detection methods mainly rely on manual inspection or contact sensor detection and monitoring. Manual inspection has limited operation space, long observation and recording period for personnel, and data analysis depends on the subjective judgment of the detection personnel; contact sensor detection requires a large number of contact sensors to be deployed, which is very costly and is easily affected by external environmental factors such as temperature and humidity, causing distortion of the detection results. 2. The detection of building outer wall defects using computer vision technology mainly adopts the method of digital image processing (DIP), which analyzes the texture and color attributes of different building outer wall defect images to identify the damage of the building outer wall. However, during the shooting process, the image background often has a lot of noise affecting the recognition and detection results. 3. The target detection model based on deep learning has a high dependence on the quality and quantity of training data, while the existing building outer wall defect dataset generally lacks sufficient samples, and a large-scale high-quality image set needs to be constructed manually, which brings a great cost in manpower and time. At the same time, the building outer wall defect target belongs to a multi-scale target, and the background environment is usually complex with occlusion interference, resulting in serious false detection and missed detection. The existing target detection model is difficult to capture the multi-scale changes and spatial asymmetry of various outer wall defects within a limited depth. 4. The existing image enhancement method based on super-resolution reconstruction model mainly adopts a unified modeling strategy, which cannot distinguish the degradation difference between the defect area and the background area, resulting in poor recovery effect of the local fuzzy area of defects such as rust stains, peeling area and crack edges. SUMMARY
[0003] The technical problems solved by the present application are: In view of the above problems of the prior art, a building outer wall defect identification method and system based on region perception are provided, and the present application aims to realize automatic image identification of building outer wall defects, overcome the influence of background noise and shielding interference of the building outer wall, distinguish the degradation difference between the defect region and the background region, and improve the identification effect of the local fuzzy region of defects such as rust stains, peeling areas and crack edges of the building outer wall.
[0004] To solve the above technical problems, the technical scheme adopted by the present application is:
[0005] A building outer wall defect identification method based on region perception, comprising: enhancing building outer wall image samples to construct a building outer wall image sample dataset, and training a building outer wall defect detection model using the building outer wall image sample dataset to realize building outer wall defect target identification; when the building outer wall image samples are enhanced to construct the building outer wall image sample dataset, a pre-trained fuzzy factor perception module FBAB is used to enhance the fuzzy region in the building outer wall image samples to generate a fuzzy enhanced feature map for realizing guided perception of the fuzzy degree of the defect region, and the processing of the input building outer wall image by the fuzzy factor perception module FBAB comprises: sequentially cascading multiple groups of two-dimensional convolution with a convolution kernel size of 3x3 and a ReLU activation function to extract fuzzy features, using a channel attention module SEBlock to adaptively weight each channel of the fuzzy features to enhance the key information channel to extract a channel enhanced feature map, using two two-dimensional convolution and a Sigmoid activation function to generate a fuzzy prediction map from the channel enhanced feature map, and performing a point-by-point multiplication operation on the fuzzy prediction map and the channel enhanced feature map to realize feature enhancement of the fuzzy region and feature suppression of the non-fuzzy region to form a fuzzy guided feature, and using a convolution with a convolution kernel size of 1x1 to perform dimensionality increasing processing on the fuzzy guided feature to obtain a fuzzy enhanced feature map.
[0006] Optionally, the fuzzy factor perception module FBAB adopts a fuzzy soft label during pre-training, and the generation of the fuzzy soft label comprises: converting the input building outer wall image sample from a standard RGB color image to a grayscale image to obtain a building outer wall grayscale image; extracting the edge information of the building outer wall grayscale image to obtain a preliminary sharpness map; normalizing the preliminary sharpness map to obtain a standardized sharpness map; converting the standardized sharpness map to a blur degree map by subtracting 1 from the standardized sharpness map, and introducing a nonlinear stretching function to the blur degree map to enhance the response intensity to the fuzzy region to obtain the final fuzzy soft label.
[0007] Optionally, when constructing the building exterior wall image sample dataset by enhancing the building exterior wall image samples, the method includes using a pre-trained Defect-Guided Attention Module (DGAB) to enhance the defect regions in the building exterior wall image samples and generate defect enhancement feature maps for guided perception of the degradation features of the defect regions. The processing of the input blurred enhancement feature map by the Defect-Guided Attention Module (DGAB) includes: dividing the input blurred enhancement feature map into two branches; the first branch uses 3×3 convolution, batch normalization, and ReLU activation function to extract the basic color and texture features of the image; the second branch uses a convolution kernel with fixed weights of So. The image edge response map is extracted by 3×3 convolution of the horizontal convolution kernel of bel; the basic color texture features and the image edge response map are concatenated by channel dimension and then multi-scale fusion features of texture, edge and structure are extracted step by step by multi-scale dilated convolution module; the multi-scale fusion features are grouped and normalized and then output as a defect prediction map by 1×1 convolution and sigmoid activation function; the defect prediction map and the input original multi-scale fusion features are multiplied point by point, and then added to the input original multi-scale fusion features in channels to form defect guidance features, and then the defect enhancement feature map is obtained by 1×1 convolution dimensionality increase processing.
[0008] Optionally, the defect-guided attention module DGAB uses soft labels for building exterior wall defects during pre-training. The generation of the soft labels for building exterior wall defects includes: converting the input building exterior wall image sample from a standard RGB color image to Lab color space and HSV color space; extracting the a channel and b channel from the Lab color space; performing a logical AND operation on the portions of the a channel and b channel that meet the preset value range to obtain a defect response map in Lab color space; extracting the h channel, s channel, and v channel from the HSV color space; performing a logical AND operation on the portions of the h channel, s channel, and v channel that meet the preset value range to obtain a defect response map in HSV color space; taking the maximum value pixel by pixel from the defect response map in Lab color space and the defect response map in HSV color space as a defect fusion response map; performing Gaussian blur processing on the defect fusion response map to remove noise; performing a dilation operation using max pooling to enhance the continuity of the corrosion boundary and forming a soft label for building exterior wall defects.
[0009] Optionally, when the building outer wall image samples are enhanced to construct the building outer wall image sample dataset, the improved residual dense block network is used to enhance the building outer wall image samples and put the enhanced building outer wall image samples into the building outer wall image sample dataset, and the improved residual dense block network includes the following steps: generating three kinds of scale sample images from the building outer wall image samples, performing pixel inverse rearrangement on the two larger sample images, using a pre-trained fuzzy factor perception module FBAB to generate a fuzzy enhanced feature map from the smallest sample image, using a pre-trained defect guided attention module DGAB to generate a defect enhanced feature map from the pixel inverse rearranged larger sample images, extracting a backbone feature from the pixel inverse rearranged smaller sample image through a convolution module, a plurality of cascaded residual dense blocks RRDB and a convolution module, splicing the extracted backbone feature, the fuzzy enhanced feature map and the defect enhanced feature map, performing defect boundary enhancement on the spliced feature map through a defect boundary enhancement module DSBEB, and finally performing residual connection with the original pixel inverse rearranged smaller sample image, and generating the enhanced building outer wall image sample through upsampling and a plurality of consecutive convolution modules. Figure Three The defect boundary enhancement module DSBEB includes two parallel branches, the first branch processes the input spliced feature through two-dimensional convolution of a 3x3 sharpening convolution kernel to serve as the output feature of the first branch, and the second branch processes the input spliced feature through 3x3 deep two-dimensional convolution, batch normalization, point convolution module, channel attention module SEBlock and residual connection module, the residual connection module is used to perform residual connection on the input and output features of the channel attention module SEBlock to serve as the output feature of the second branch, and the output features of the first branch and the second branch are added to serve as the defect boundary enhanced feature map output by the defect boundary enhancement module DSBEB.
[0010] Optionally, the building outer wall defect detection model is an improved YOLOv11-OBB model, the improved YOLOv11-OBB model is a composite feature extraction module DSA-C3 added in a backbone network and a neck network of the YOLOv11-OBB model, the composite feature extraction module DSA-C3 includes a first convolution block, a second convolution block, N dynamic multi-scale perception fusion modules DSAF-Block, a connection module and a third convolution block connected in sequence, and outputs of the first convolution block and the second convolution block are also respectively taken as inputs of the connection module, the dynamic multi-scale perception fusion module DSAF-Block includes a batch normalization layer, a dynamic multi-scale perception fusion device DSAFM, a first learnable residual regulation factor layer, a first random depth residual connection module, a batch normalization layer, a gate convolution module, a second learnable residual regulation factor layer and a second random depth residual connection module connected in sequence, wherein a second path input of the first random depth residual connection module is an original input of the dynamic multi-scale perception fusion module DSAF-Block, and a second path input of the second random depth residual connection module is an output of the first random depth residual connection module; the dynamic multi-scale perception fusion device DSAFM includes a slicing module, a plurality of convolution paths with different receptive fields, a connection module and a convolution module, the slicing module divides an input feature map into input channels and respectively inputs the input channels into the plurality of convolution paths with different receptive fields to realize information extraction of the building outer wall defect target in different scales and directions, and enhanced feature maps are aggregated and fused through the connection module and the convolution module.
[0011] Optionally, the loss adopted by the improved YOLOv11-OBB model during training includes a shape-aware probability intersection over union Instead of the probability intersection over union ProbIoU adopted by the original YOLOv11-OBB model, the shape-aware probability intersection over union The calculation function expression of the shape-aware probability intersection over union is as follows:
[0012] ;
[0013] ;
[0014] wherein, is a Bhattacharyya distance between the prediction box and the real box, is an angle penalty coefficient, is a shape-aware angle penalty term, is a weight of an angle error, 、 are angles of the prediction box and the real box respectively.
[0015] In addition, the application also provides a building outer wall defect identification system based on regional perception, comprising a microprocessor and a memory connected with each other, wherein the microprocessor is programmed or configured to execute the building outer wall defect identification method based on regional perception.
[0016] In addition, the application also provides a computer readable storage medium, wherein a computer program or instructions are stored in the computer readable storage medium, and the computer program or instructions are programmed or configured to execute the building outer wall defect identification method based on regional perception through a processor.
[0017] In addition, the application also provides a computer program product, comprising a computer program or instructions, which are programmed or configured to execute the building outer wall defect identification method based on regional perception through a processor.
[0018] Compared with the prior art, the application mainly has the following beneficial effects: the building outer wall defect identification method based on regional perception comprises enhancing the building outer wall image sample to construct a building outer wall image sample dataset and training a building outer wall defect detection model for realizing building outer wall defect target identification; the enhancement of the building outer wall image sample comprises enhancing the fuzzy area in the building outer wall image sample by using a pre-trained fuzzy factor perception module FBAB to generate a fuzzy enhanced feature map and enhancing the defect area in the building outer wall image sample by using a pre-trained defect guided attention module DGAB to generate a defect enhanced feature map. The application can realize automatic image identification of building outer wall defects, overcome the influence of building outer wall background noise and shielding interference, distinguish the degradation difference between the defect area and the background area, improve the identification effect of the local fuzzy area of the building outer wall rust stains, peeling areas and crack edges and the like, can solve the problems of lack of dataset, weak modeling ability and low identification precision of the existing building outer wall defect identification method, and provide a low-cost, efficient and accurate building outer wall defect target detection. BRIEF DESCRIPTION OF DRAWINGS
[0019] Figure 1 It is a basic flowchart of the method of the embodiment of the application.
[0020] Figure 2 It is a network structure diagram of the fuzzy factor perception module FBAB in the embodiment of the application.
[0021] Figure 3 It is a network structure diagram of the defect guided attention module DGAB in the embodiment of the application.
[0022] Figure 4 It is a network structure diagram of the improved residual dense block network in the embodiment of the application.
[0023] Figure 5 This is a schematic diagram of the network structure of the Defect Boundary Enhancement Module DSBEB in an embodiment of the present invention.
[0024] Figure 6 This is a schematic diagram of the network structure of the improved YOLOv11-OBB model in an embodiment of the present invention.
[0025] Figure 7 This is a schematic diagram of the network structure of the composite feature extraction module DSA-C3 in an embodiment of the present invention.
[0026] Figure 8 This is a schematic diagram of the network structure of the dynamic multi-scale perception fusion module DSAF-Block in an embodiment of the present invention.
[0027] Figure 9 This is a schematic diagram of the network structure of the Dynamic Multi-Scale Perception Fusion (DSAFM) in an embodiment of the present invention.
[0028] Figure 10 This is a schematic diagram of the hierarchical adaptive depthwise convolution HADConv network structure in an embodiment of the present invention.
[0029] Figure 11 This is a schematic diagram comparing the precision-recall curves of different models in the embodiments of the present invention. Detailed Implementation
[0030] To enable those skilled in the art to better understand the technical solutions of the present invention, the technical solutions of the present invention will be further described in detail below with reference to the accompanying drawings in the embodiments of the present invention.
[0031] like Figure 1 As shown, this embodiment of the building exterior wall defect recognition method based on region awareness includes enhancing building exterior wall image samples to construct a building exterior wall image sample dataset, and using the building exterior wall image sample dataset to train a building exterior wall defect detection model for recognizing building exterior wall defects. Figure 1 As shown, in this embodiment, a high-definition camera mounted on a drone is used to collect building exterior wall image samples, and building exterior wall image samples are collected from the network. The building exterior wall image samples are enhanced by constructing and training an improved residual dense block network (improved RRDBNet), and the enhanced building exterior wall image samples are put into a building exterior wall image sample dataset. Then, a building exterior wall defect detection model (improved YOLOv11-OBB model) is constructed, and the building exterior wall image sample dataset is constructed using the improved residual dense block network (improved RRDBNet) to train the building exterior wall defect detection model, thereby obtaining a pre-trained building exterior wall defect detection model.
[0032] In this embodiment, when constructing a building exterior wall image sample dataset, the enhancement of building exterior wall image samples includes using a pre-trained Fuzzy Boundary-Aware Block (FBAB) module to enhance blurred regions in the building exterior wall image samples, generating a blurred enhancement feature map to guide the perception of the blurriness level of defective regions. Through the blur map generation and feature guidance mechanism, adaptive enhancement of locally degraded regions is achieved, improving the clarity reconstruction effect of blurred defective regions. Figure 2 As shown, in this embodiment, the fuzzy factor perception module FBAB processes the input building exterior image by: passing the input building exterior image sample through multiple cascaded sets (specifically 3 sets in this embodiment, where the first two convolutional layers have the same number of channels, and the third convolutional layer doubles the number of channels to enhance feature representation capability) of 3×3 two-dimensional convolutional kernels (Conv2d). A 3×3 ReLU activation function is used to extract fuzzy features. The channel attention module SEBlock is used to adaptively weight each channel of the fuzzy features to enhance key information channels and extract channel-enhanced feature maps (which can suppress redundant features and improve the discrimination ability of fuzzy regions). The channel-enhanced feature maps are used to generate a fuzzy prediction map using two 2D convolutions (Conv2d) and a Sigmoid activation function. The first 2D convolution compresses the number of channels from 64 to 32, and the second 2D convolution uses a 1×1 convolution to reduce the number of channels to 1. The fuzzy prediction map is then output through the Sigmoid activation function. The fuzzy prediction map and the channel-enhanced feature map are multiplied pointwise to enhance the features of fuzzy regions and suppress the features of non-fuzzy regions to form fuzzy guiding features. The fuzzy guiding features are then multiplied using a 1×1 convolution to obtain a fuzzy enhanced feature map.
[0033] This embodiment introduces a fuzzy soft label generation method for training supervision in the fuzzy factor perception module (FBAB). By combining image sharpness information and normalization processing, it achieves high-precision modeling and guided training of the fuzziness level of the target region. The fuzzy factor perception module (FBAB) uses fuzzy soft labels during pre-training. The generation of these fuzzy soft labels includes: converting the input building exterior wall image sample from a standard RGB color image to a grayscale image to obtain a grayscale image of the building exterior wall, thereby eliminating color interference and extracting the brightness structure, which can be represented as:
[0034] ;
[0035] in, Represents a grayscale image of a building's exterior wall. , and are the red, green and blue channel pixel values of the original image respectively; the edge information of the building outer wall gray image is extracted to obtain a preliminary sharpness map, and a method or operator required by a user can be used, for example, as an optional implementation, a 3*3 Laplacian convolution kernel is used to extract the edge information of the gray image in the embodiment, and a function expression thereof is:
[0036] ;
[0037] ;
[0038] wherein, represents the preliminary sharpness map, represents a two-dimensional convolution operation, represents a Laplacian convolution kernel; the preliminary sharpness map is normalized to obtain a normalized sharpness map, and in order to suppress the intensity difference between images, an independent normalization method for each image is used to process the preliminary sharpness map in the embodiment, and a function expression thereof is:
[0039] ;
[0040] wherein, is the normalized sharpness map, and are maximum and minimum values respectively, is a constant parameter close to 0, and has a value of in the embodiment; the normalized sharpness map is converted into a blur degree map by subtracting 1 from the normalized sharpness map, and a nonlinear stretching function is introduced to enhance the response intensity of the blur area to obtain a final blur soft label. According to the strategy of “ ”, the normalized sharpness map is converted into a blur degree map, and the response intensity of the blur area is enhanced through a nonlinear stretching function, and the nonlinear stretching function can be a logarithmic function, an exponential function, a power function, a hyperbolic function, a Sigmoid function, an inverse tangent function, etc., and as an optional implementation, a function expression of the final blur soft label obtained in the embodiment is:
[0041] ;
[0042] wherein, is the blur soft label ( ), is the introduced nonlinear stretching function (exponential function), the value of may be selected according to actual needs, for example,
[0043] This embodiment also proposes a supervision mechanism for image blurry region perception, designing a multi-component joint blur loss function to train the blur perception module FBAB, enabling its output blurry feature map to possess good region response accuracy, edge discrimination capability, and structural stability. Specifically, it includes blur reconstruction loss, edge response loss, standard deviation penalty term, and activation suppression term. The blur reconstruction loss measures the pixel-wise difference between the predicted blur map and the label, emphasizing the fitting ability of the overall blur distribution; the edge response loss utilizes the Sobel operator to extract the edge image of the blurry soft label, forcing the network to have a more active blur response in edge regions, thereby improving the detection sensitivity of defect edges and structurally blurred regions. Specifically, the function expression of the loss function used by the blur factor perception module FBAB during pre-training in this embodiment is:
[0044] ;
[0045] in, This is the loss function used by the fuzzy factor perception module FBAB during pre-training. ~ For loss function, To blur the reconstruction loss, For edge response loss, This is the standard deviation penalty term. To activate the suppression term, the loss function is calculated using the network's predicted fuzzy map and fuzzy soft labels. Through the loss function Supervise the learning direction of the fuzzy factor perception module FBAB to ensure that it notices fuzzy regions.
[0046] Fuzzy reconstruction loss The function expression is:
[0047] ;
[0048] in, The batch size of building exterior wall image samples for each training session. For the height of building exterior image samples, Width of the building exterior image sample; and In the samples of fuzzy prediction map and building exterior wall image respectively The pixel value at the location.
[0049] Edge response loss The function expression is:
[0050] ;
[0051] in, For the first Edge intensity map of a building facade image sample In the edge intensity at the position, is the sequence number of the building facade image sample, wherein the edge intensity map The calculation function expression of is:
[0052] ;
[0053] ;
[0054] ;
[0055] ;
[0056] ;
[0057] wherein, is a horizontal direction gradient map, is a vertical direction gradient map, is a Sobel horizontal direction convolution kernel, is a Sobel vertical direction convolution kernel, is the transpose of.
[0058] The standard deviation penalty term calculates the overall standard deviation of the predicted blur map, the lower the standard deviation, the more the image tends to be flat and unrecognizable, thereby encouraging the blur map to have a certain structural distribution; the activation inhibition term encourages the overall value of the blur map to remain low, avoiding the network from appearing a full-blur response in the early stage of training. The function expression of the standard deviation penalty term is:
[0059] ;
[0060] wherein, is the standard deviation of all pixels, is the blur prediction map.
[0061] The function expression of the activation inhibition term is:
[0062] ;
[0063] wherein, is the sequence number of the building facade image sample, is the coordinate position of the pixel point.
[0064] In the construction of the building outer wall image sample dataset in this embodiment, the defect-guided attention module DGAB is used to enhance the defect area in the building outer wall image sample to generate a defect-enhanced feature map for realizing the guided perception of the degradation features of the defect area.
[0065] The defect-guided attention module DGAB fuses edge detection and color features, guides the network to focus more on the defect area with obvious structural features such as crack boundary, rust texture, and falling edge in vision. And the dilated convolution is introduced to enhance the recognition ability of defects of different scales. As shown in Figure 3 As shown in the figure, the processing of the defect-guided attention module DGAB in this embodiment on the input fuzzy-enhanced feature map includes: dividing the input fuzzy-enhanced feature map into two branches, the first branch uses 3×3 convolution (Conv2d 3×3), batch normalization (BatchNorm) and ReLU activation function to extract the basic color texture features of the image, and the 3×3 convolution uses the convolution kernel weight fixed as the Sobel horizontal direction convolution kernel to extract the image edge response map, which is used to capture the local boundary information of the defect area; the second branch uses 3×3 convolution (Conv2d 3×3 Sobel convolution kernel) with the convolution kernel weight fixed as the Sobel horizontal direction convolution kernel to extract the image edge response map; after the basic color texture features and the image edge response map are spliced in the channel dimension, the multi-scale dilated convolution module (multi_scale) is used to gradually extract the multi-scale fusion features of the texture, edge and structure; after the multi-scale fusion features are group normalized (GroupNorm), the defect prediction map is output through 1×1 convolution and Sigmoid activation function, the point-by-point multiplication operation is performed on the defect prediction map and the input original multi-scale fusion features, and then the channel addition is performed on the input original multi-scale fusion features to form the defect-guided feature, and the defect-enhanced feature map is obtained through 1×1 convolution dimension upgrading processing. As shown in Figure 3 As shown in the figure, the multi-scale dilated convolution module (multi_scale) includes 3×3 dilated two-dimensional convolution, ReLu activation function, 3×3 dilated two-dimensional convolution, ReLu activation function and 3×3 two-dimensional convolution (Conv2d 3×3). As shown in Figure 3 As can be seen from the left input image and the right obtained defect-enhanced feature map, the rust texture area presents red highlight, which shows that the defect-guided attention module DGAB has noticed the defect area such as rust, and has extracted the salient features of the defect area in the image, and has enhanced the expression ability of the defect area through edge detection and multi-scale attention mechanism.
[0066] The embodiment provides a defect region soft label construction method combining Lab and HSV color space features and optimized through morphological post-processing, which is used for representing the spatial distribution characteristics of the defect region in an image and representing the damage degree of the building outer wall in a continuous real value form, and provides supervision support for the learning of a subsequent defect guided attention module DGAB. The method has the characteristics of strong robustness, accurate defect response and adaptation to images under different illumination and texture conditions. The label used by the defect guided attention module DGAB in pre-training is a building outer wall defect soft label, and the generation of the building outer wall defect soft label comprises the following steps: converting an input building outer wall image sample from a standard RGB color image into a Lab color space and an HSV color space, extracting an a channel and a b channel from the Lab color space, performing logical AND operation on parts meeting a preset value range in the a channel and the b channel respectively to obtain a defect response graph of the Lab color space; extracting an h channel, an s channel and a v channel from the HSV color space, performing logical AND operation on parts meeting a preset value range in the h channel, the s channel and the v channel respectively to obtain a defect response graph of the HSV color space; taking the maximum value of the defect response graph of the Lab color space and the defect response graph of the HSV color space as a defect fusion response graph pixel by pixel; and performing Gaussian blur processing on the defect fusion response graph to remove noise, and performing a dilatation operation on the defect fusion response graph through maximum pooling to enhance the continuity of the rust boundary and form the building outer wall defect soft label.
[0067] In the embodiment, when the parts meeting the preset value range in the a channel and the b channel are subjected to logical AND operation to obtain the defect response graph of the Lab color space, the a channel and the b channel are color components in the Lab color space, and represent green-red and blue-yellow directions respectively. The extraction of the defect response graph of the Lab color space can be represented as:
[0068] ;
[0069] Among them, The defect response graph of the Lab color space, the preset value range of the a channel and the b channel is greater than 5.0 (which can be valued according to actual needs), Logical AND operation. When the parts meeting the preset value range in the h channel, the s channel and the v channel are subjected to logical AND operation to obtain the defect response graph of the HSV color space, the h channel, the s channel and the v channel represent hue, saturation and brightness components in the HSV space respectively. The extraction of the defect response graph of the HSV color space can be represented as:
[0070] ;
[0071] Among them, The preset value ranges of the h channel, the s channel and the v channel of the defect response graph of the HSV color space are (0.01, 0.17), greater than 0.03 and (0.15, 0.85) respectively, and the values can be taken according to actual needs. The defect response graph of the Lab color space uses the indexes of color deviation red and color deviation yellow, and the defect response graph of the HSV color space sets the interval according to the color range of the defect area with a significant color change such as a rust patch and surface peeling, so as to eliminate the background area and the influence of highlights or shadows, and then the response graphs of the two color spaces are maximum fused pixel by pixel to obtain a defect fusion response graph, which can be represented as:
[0072] ;
[0073] wherein, is the defect fusion response graph, is the maximum value (pixel by pixel). The defect fusion response graph is subjected to Gaussian blur processing to remove noise, and maximum pooling is used for dilation operation to enhance the continuity of the rust boundary and form a building outer wall defect soft label, which can be represented as:
[0074] ;
[0075] ;
[0076] wherein, is the result obtained by Gaussian blur processing to remove noise, is the Gaussian blur processing, is the building outer wall defect soft label, and the dimension is .
[0077] In this embodiment, a supervised loss function for defect region saliency modeling is proposed for the defect guided attention block DGAB, which is specifically aimed at the problems of sparse defect region features and strong background interference. By introducing a defect region enhancement term and a background misactivation penalty term, a weighted objective function is constructed on the basis of the dominant mean square error to realize effective guidance of the output of the defect guided attention block DGAB and improve the focusing ability of the network on the real defect region. Specifically, it includes the mean square error between the defect prediction graph and the building outer wall defect soft label, the positive region excitation term and the background misactivation penalty term. The mean square error between the defect prediction graph and the building outer wall defect soft label is the dominant term of the rust loss function, which is used to force the network output to fit the rust area pixel by pixel and reduce the overall deviation; the positive region excitation term is used to measure the response strength of the prediction graph in the real defect region, and encourages the model to output higher values in the high confidence area; and the background misactivation penalty term is used to punish when the non-defect region is predicted as a high response value, so as to reduce the background misactivation phenomenon. The function expression of the loss function used by the defect guided attention block DGAB in the training in this embodiment is:
[0078] ;
[0079] ;
[0080] ;
[0081] ;
[0082] in, The loss function used during training of the Defect-Guided Attention Module (DGAB) is... ~ For weight parameters, To illustrate the mean square error between the defect prediction map and the soft label for defects on the building exterior wall, For positive regional incentives, Background accidental activation penalty item, For the first In each sample Defect prediction map value at the location, Indicates the first In each sample Soft label for defects in the building's exterior wall at the location.
[0083] In this embodiment, when constructing the building exterior wall image sample dataset, the enhancement process includes using an improved residual dense block network (improved RRDBNet) to enhance the building exterior wall image samples and then placing the enhanced building exterior wall image samples into the building exterior wall image sample dataset. Figure 4 This is a schematic diagram of the improved residual dense block network in this embodiment. The improved residual dense block network enhances building exterior wall image samples by: generating sample images at three scales (downsampling by 1x, 2x, and 4x, respectively); performing pixel unshuffle on the two larger sample images; generating a fuzz enhancement feature map from the smallest sample image using a pre-trained fuzz factor awareness module (FBAB); generating a defect enhancement feature map from the larger sample image after pixel unshuffle using a pre-trained defect-guided attention module (DGAB); extracting backbone features from the smaller sample image after pixel unshuffle using a convolution module, multiple cascaded residual dense blocks (RRDB), and a convolution module; and then combining the extracted backbone features with the fuzz enhancement feature map and defect enhancement feature map. Figure ThreeThe defect boundary enhancement module DSBEB is used for defect boundary enhancement after splicing, and then the smaller sample image residual is connected with the original pixel inverse rearrangement, and finally the enhanced building outer wall image sample is generated through upsampling (specifically 4 times upsampling in this embodiment) and a plurality of continuous convolution modules. The output channel numbers of the blur enhancement feature map and the defect enhancement feature map are consistent with the backbone feature, which is convenient for subsequent fusion. The improved residual dense block network (improved RRDBNet) trains the blur factor perception module FBAB and the defect guided attention module DGAB in parallel with the RRDBNet generator in the Real-ESRGAN model, and then splices the blur enhancement feature map and the defect enhancement feature map generated by the improved residual dense block network (improved RRDBNet) and performs defect boundary enhancement through the defect shape boundary enhancement block DSBEB (Defect Shape Boundary Enhancement Block) to merge the defect boundary enhancement block DSBEB (Defect Shape Boundary Enhancement Block) to the backbone feature, realize the guided perception of the blur degree and the degradation characteristics of the defect area, significantly enhance the boundary response and structure contrast of the local defect area, effectively restore the texture details, and improve the support ability of the image enhancement quality for the subsequent detection task.
[0084] As Figure 5As shown, the defect boundary enhancement module DSBEB includes two parallel branches, the first branch processes the input spliced features through a 3x3 Laplacian kernel two-dimensional convolution (Conv2d) as the output features of the first branch, and the second branch processes the input spliced features through a 3x3 deep two-dimensional convolution (DWConv2d 3x3), batch normalization (BatchNorm), a pointwise convolution module (Pointwise Conv), a channel attention module SEBlock, and a residual connection module for residual connection of the input and output features of the channel attention module SEBlock as the output features of the second branch, and the output features of the first and second branches are added as the defect boundary enhanced feature map output by the defect boundary enhancement module DSBEB. The defect boundary enhancement module DSBEB integrates edge perception enhancement, channel attention modulation, and residual connection image enhancement modules. This module combines deep convolution (DWConv), pointwise convolution module (Pointwise Conv), SEBlock attention mechanism, and sharpening residual branch operations to enhance spatial edge details and strengthen important feature responses, and is particularly suitable for image deblurring, building exterior wall defect area feature enhancement, etc. The first branch (sharpening residual branch) processes the input spliced features through a 3x3 Laplacian kernel two-dimensional convolution as the output features of the first branch. This branch is a lightweight edge enhancement path designed to improve image details through image gradient enhancement and structural detail enhancement. The function expression of the 3x3 Laplacian kernel used in this branch is:
[0085] ;
[0086] wherein, is a 3x3 Laplacian kernel.
[0087] In this embodiment, the improved residual dense block network (improved RRDBNet) is used to enhance the building exterior wall image samples and put the enhanced building exterior wall image samples into the building exterior wall image sample dataset. The DJI M350RTK unmanned aerial vehicle equipped with a Zenmuse P1 camera is used to collect high-definition images of building exterior walls, which are used as the training set of the improved residual dense block network (improved RRDBNet). The improved residual dense block network (improved RRDBNet) is used to repair a large number of low-resolution building exterior wall defect images on the network, and the enhanced building exterior wall image samples are put into the building exterior wall image sample dataset to complete the construction of the building exterior wall image sample dataset.
[0088] The building exterior wall defect detection model can adopt the required target detection model as needed. For example, as an optional implementation method, such as... Figure 6As shown, the building outer wall defect detection model in the embodiment is an improved YOLOv11-OBB model, and the improved YOLOv11-OBB model is that a composite feature extraction module DSA-C3 is added in the backbone network and the neck network of the YOLOv11-OBB model. As an optional implementation, the backbone network of the improved YOLOv11-OBB model is composed of a convolution layer, four groups of convolution layers, a composite feature extraction module DSA-C3, a fast spatial pyramid pooling SPFF (Spatial Pyramid Pooling Fast), and a C2PSA module connected in sequence, and the second and third composite feature extraction modules DSA-C3 and the C2PSA module output feature maps of different sizes to the neck network. The neck network corresponding to the feature maps from the three inputs contains three branches, the first branch includes a connection module and a composite feature extraction module DSA-C3, and the output feature map is sent into the first OBB (oriented bounding box) detection head in the detection head by the composite feature extraction module DSA-C3; the second branch includes a connection module, a composite feature extraction module DSA-C3, a connection module, and a composite feature extraction module DSA-C3, and the output feature map is sent into the second OBB detection head in the detection head by the second composite feature extraction module DSA-C3; wherein the output of the previous composite feature extraction module DSA-C3 is used as the second output of the connection module in the first branch after up-sampling, the second input of the first connection module is the result of the input feature map in the third branch after up-sampling, and the second input of the second connection module is the feature map output by the composite feature extraction module DSA-C3 in the first branch after convolution processing; the third branch includes a connection module and a composite feature extraction module DSA-C3, and the output feature map is sent into the third OBB detection head in the detection head by the composite feature extraction module DSA-C3, wherein the second input of the connection module is the result obtained after convolution of the output feature map of the second branch. In the embodiment, the dynamic multi-scale perception fusion module DSFA-Block is combined with the C3k2 module to form a composite feature extraction module DSA-C3 to replace the C3k2 module (CSPBottleneck with 3×3 Kernels and 2 Convolutional Layers) in the YOLOv11-OBB detection model. The C3k2 module is a neural network structure for processing information from coarse to fine levels, which usually contains multiple levels of processing units that can gradually extract and fuse features of different scales to realize information integration from coarse to fine.The C2PSA module is a known module used for enhancing feature extraction in YOLOv11, which combines a CSP (Cross Stage Partial) structure and a PSA (Pyramid Squeeze Attention) attention mechanism. Since it is a known module, the implementation details are not described in detail here.
[0089] As shown in Figure 7 , the composite feature extraction module DSA-C3 in this embodiment includes a first convolutional block, a second convolutional block, N dynamic multi-scale perception fusion modules DSAF-Block, a connection module, and a third convolutional block connected in sequence, and the outputs of the first convolutional block and the second convolutional block are also respectively used as inputs of the connection module.
[0090] The dynamic multi-scale perception fusion module DSAF-Block aims to target the characteristics of complex texture, large scale difference, and fuzzy boundary of the defect area in the building outer wall image, to realize multi-directional and multi-scale semantic aggregation and edge perception enhancement, so as to improve the accurate positioning and recognition ability of the defect area in the target detection task. As shown in Figure 8As shown, the dynamic multi-scale perception fusion module DSAF-Block in the embodiment includes, in sequence, a batch normalization layer, a dynamic multi-scale perception fusion device DSAFM, a first learnable residual regulation factor layer (LayerScale), a first random depth residual connection module (DropPath), a batch normalization layer, a gated convolution module, a second learnable residual regulation factor layer, and a second random depth residual connection module, wherein the second path input of the first random depth residual connection module is the original input of the dynamic multi-scale perception fusion module DSAF-Block, and the second path input of the second random depth residual connection module is the output of the first random depth residual connection module. The dynamic multi-scale perception fusion module DSAF-Block integrates multi-scale perception, gated channel selection, and residual regularization. In the YOLOv11 backbone network or neck network, the multi-scale detection capability of complex texture targets such as rust patches, cracks, and surface peeling is enhanced, while maintaining lightness, efficiency, and stability. Among them, the batch normalization processing (BatchNorm) is used to normalize the input feature map, eliminate the distribution difference between channels, and enhance the stability of subsequent feature extraction; the dynamic multi-scale perception fusion device DSAFM is used to extract multi-scale and directional spatial information of the input feature through the dynamic multi-scale perception fusion device DSAFM; the module further includes a group of dynamic weight generation modules based on global average pooling and channel-by-channel convolution, which are used to weight and fuse the outputs of each convolution branch, thereby adaptively strengthening the target region response; the learnable residual regulation factor layer (LayerScale) is used to assign learnable channel weights to the output features of the above DSAFM module, thereby realizing fine regulation of the module output disturbance; the random depth residual connection module (DropPath) is used to probabilistically discard the residual path during training, thereby improving the network generalization capability and training robustness; the batch normalization processing (BatchNorm) is used to standardize the feature map again after the residual fusion of the feature map, thereby further stabilizing the information distribution; the gated convolution module (ConvolutionalGLU) is used to realize significant control of the channel dimension through a double-branch gating mechanism, one branch is used for linear transformation, and the other branch is used for Sigmoid weight generation, and the channel selection is realized through element-by-element multiplication, thereby enhancing the defect region response feature; the learnable residual regulation factor layer (LayerScale) is used in cooperation with the output of the above gated convolution module to control the disturbance intensity of the gating path; and the random depth residual connection module (DropPath) is used to weight and fuse the outputs of all enhanced paths back to the input path to form the final feature map output.The dynamic multi-scale perception fusion module DSAF-Block has high-efficiency multi-scale perception capability, can effectively extract texture structure and edge information in the case that the defect area has uneven scale, inconsistent direction, and complex background noise, and is suitable for deployment in the backbone network and neck network of a target detection network such as YOLOv11. In order to realize fine-grained control of the disturbance amplitude of the output features of the module, the present embodiment introduces a learnable residual regulation factor layer (LayerScale) in the dynamic multi-scale perception fusion module DSAF-Block. The mechanism embeds a learnable scaling parameter vector at the end of the residual path, which is used for channel-by-channel linear scaling of the output features in the channel dimension. Its role is to suppress the instability problem caused by large gradient fluctuations in the early stage of network training, and to improve the numerical stability when training a deep network. In order to prevent the model from overfitting to a specific feature path during the training stage and improve the generalization ability to multiple types of external wall defects, the present embodiment integrates a random deep residual connection module (DropPath) in multiple residual paths in the dynamic multi-scale perception fusion module DSAF-Block. The core idea is to randomly discard a part of the residual connection paths in a probabilistic manner during the training stage, thereby constructing the uncertainty of the model structure and improving the robustness of the training. It should be noted that the learnable residual regulation factor layer (LayerScale) and the random deep residual connection module (DropPath) are both known modules, so their implementation details will not be described in detail here.
[0091] As shown in Figure 9 The dynamic multi-scale perception fusion module DSAF-Block has high-efficiency multi-scale perception capability, can effectively extract texture structure and edge information in the case that the defect area has uneven scale, inconsistent direction, and complex background noise, and is suitable for deployment in the target detection network such as YOLOv11. In order to realize fine-grained control of the disturbance amplitude of the output features of the module, the present embodiment introduces a learnable residual regulation factor layer (LayerScale) in the dynamic multi-scale perception fusion module DSAF-Block. The mechanism embeds a learnable scaling parameter vector at the end of the residual path, which is used for channel-by-channel linear scaling of the output features in the channel dimension. Its role is to suppress the instability problem caused by large gradient fluctuations in the early stage of network training, and to improve the numerical stability when training a deep network. In order to prevent the model from overfitting to a specific feature path during the training stage and improve the generalization ability to multiple types of external wall defects, the present embodiment integrates a random deep residual connection module (DropPath) in multiple residual paths in the dynamic multi-scale perception fusion module DSAF-Block. The core idea is to randomly discard a part of the residual connection paths in a probabilistic manner during the training stage, thereby constructing the uncertainty of the model structure and improving the robustness of the training. It should be noted that the learnable residual regulation factor layer (LayerScale) and the random deep residual connection module (DropPath) are both known modules, so their implementation details will not be described in detail here. Figure 9 In the present embodiment, the 3x3 convolution module and the 5x5 convolution module represent the convolution modules in the convolution paths with different receptive fields, respectively. As an optional implementation, the present embodiment uses hierarchical adaptive depthwise convolution (HADConv) for the convolution modules in the convolution paths with different receptive fields. This module aims to extract multi-scale and multi-directional key structure information in images through a deep convolution parallel structure with multi-scale and multi-directional perception, combined with an adaptive dynamic weight mechanism, and is particularly suitable for building external wall defect target detection scenarios with complex textures and different shapes such as rust patches, cracks, and surface peeling.
[0092] As shown in Figure 10As shown, the hierarchical adaptive deep convolution HADConv contains three parallel convolution branches, which are used to extract spatial features in different directions and receptive fields. One of the convolution branches is a 3x3 two-dimensional convolution (Con2d 3x3), one is a 11x1 deep convolution (DWCon2d 11x1), and one is a 1x11 deep convolution (DWCon2d 1x11). In addition, a third branch is included, which uses an adaptive average pooling module (AdaptiveAvgPool2d) to perform global average pooling on the input feature map to extract the global response of each channel. Then, a 1x1 convolution is used to map the channel number to three times the original channel number, representing the attention weights of the three branches. After dimension rearrangement, the weights are normalized in the branch dimension using Softmax to obtain the weighted proportion between branches. The feature maps after each branch convolution are weighted according to the corresponding dynamic weights, and finally the channel-wise summation fusion is performed to output a unified dimension feature map. Finally, the fusion result is passed through batch normalization (BatchNorm) and SiLU activation to enhance the non-linear expression ability.
[0093] In the rotation target detection task, the conventional intersection over union metric methods such as CIoU, DIoU or ProbIoU, mainly focus on the overlap degree of the position and shape of the target box, but are less sensitive to the rotation angle difference and aspect ratio heterogeneity of the target. Especially in high aspect ratio strip-shaped corrosion and peeling targets, it is easy to cause the problem of IoU overestimation due to large angle deviation. In order to solve the above technical problems, the loss function used in the training of the improved YOLOv11-OBB model in this embodiment includes a shape-aware probability intersection over union Instead of the probability intersection over union ProbIoU used in the original YOLOv11-OBB model, the shape-aware probability intersection over union The calculation function expression of the shape-aware probability intersection over union is:
[0094] ;
[0095] ;
[0096] wherein, is the Bhattacharyya distance between the predicted box and the real box, is the angle penalty coefficient, is the shape-aware angle penalty term, is the weight of the angle error, 、 are the angles of the predicted box and the real box, respectively. The shape-aware probability intersection over union On the basis of ProbIoU, an angle penalty term is introduced to construct an angle and shape double-sensitive rotated bounding box similarity measurement formula, which can improve the fitting accuracy of the model for rotated targets. Bhattacharyya is a distance measurement method for measuring the similarity between two probability distributions, which is used to measure the similarity between the predicted box and the real box in the target detection task. Its function expression is:
[0097] ;
[0098] wherein, and represent the center positions of the predicted box and the real box respectively; and represent the covariance matrix of the two boxes, is the average value of and , that is, ; the superscript represents the transpose. In this embodiment, the function expression of the weight of the angle error is:
[0099] ;
[0100] ;
[0101] wherein, represents a shape adjustment coefficient, represents the ratio of the short side to the long side of the predicted box, and are the width and height of the predicted box. The shape-aware probability intersection over union For long and narrow defect targets, the angle error penalty is introduced to make the model pay more attention to the consistency of the target direction, and to improve the angle positioning accuracy and defect area matching reliability in the multi-scale building outer wall defect target detection task. As an improved form of ProbIoU, it can seamlessly replace the original similarity module and has good compatibility.
[0102] To verify the performance of the improved YOLOv11-OBB model in the embodiment, the following indicators are used in the embodiment: 1) frames per second (FPS), indicating the number of frames transmitted per second. 2) FLOPs, indicating the number of floating point operations required for the model to make predictions, representing the computational complexity of the model. 3) Precision (P), indicating the proportion of samples that are truly positive in the samples identified as positive by the model. 4) Recall (R), indicating the ratio of the number of samples correctly identified as positive by the model to the total number of positive samples. 5) Mean Average Precision (mAP), which is the average of the Average Precision (AP) of each class. AP is the area under the precision-recall curve. The models used for comparison of the improved YOLOv11-OBB model (Net-7) in the embodiment include the YOLOv11-OBB model and the combination of the YOLOv11-OBB model and the improved RRDBNet, the dynamic multi-scale perception fusion module DSAF-Block and the shape perception probability intersection over union of the embodiment, where Net-1 is the combination of the YOLOv11-OBB model and the improved RRDBNet; Net-2 is the combination of the YOLOv11-OBB model and the dynamic multi-scale perception fusion module DSAF-Block; Net-3 is the combination of the YOLOv11-OBB model and the shape perception probability intersection over union ; Net-4 is the combination of the YOLOv11-OBB model and the dynamic multi-scale perception fusion module DSAF-Block, the shape perception probability intersection over union ; Net-5 is the combination of the YOLOv11-OBB model and the improved RRDBNet, the dynamic multi-scale perception fusion module DSAF-Block; Net-6 is the combination of the YOLOv11-OBB model and the improved RRDBNet, the shape perception probability intersection over union . The final ablation experiment results are shown in Table 1, and the PR curves (precision-recall curves) are shown in Figure 11 .
[0103] Table 1: Ablation experiment results
[0104]
[0105] In Table 1, “-” indicates that the corresponding module or component is not included. See Table 1 and Figure 11It can be seen that compared with the original YOLOv11-OBB model without using the improved RRDBNet data enhancement, the precision of the model Net-1 is improved by 5.3 percentage points, the recall rate is improved by 3.3 percentage points, the mean average precision is improved by 1.9 percentage points, and the floating point operation number and FPS are basically the same. It can be seen that the improvement of the data set quality realized by improving the RRDBNet can significantly improve the parameters of the YOLOv11-OBB model. Compared with the original YOLOv11-OBB model without using the dynamic multi-scale perception fusion module DSAF-Block, the precision of the model Net-2 is improved by 1.1 percentage points, the recall rate is improved by 0.7 percentage points, the mean average precision is improved by 0.6 percentage points, the floating point operation is reduced by 0.6*10 9 6 times, and the FPS is reduced by 68.20 frames / s. It shows that the dynamic multi-scale perception fusion module DSAF-Block can improve the perception ability while reducing the model complexity. Compared with the original YOLOv11-OBB model without using the shape perception probability intersection over union , the precision of the model Net-3 is improved by 1.2 percentage points, the recall rate is improved by 0.9 percentage points, the mean average precision is improved by 0.9 percentage points, the floating point operation number and FPS are basically the same, which shows that the shape perception probability intersection over union can significantly enhance the direction regression performance on the premise of ensuring the operation efficiency. The model Net-4 represents that the dynamic multi-scale perception fusion module DSAF-Block and the shape perception probability intersection over union are used in the YOLOv11-OBB model at the same time, compared with the original YOLOv11-OBB model, the precision is improved by 3.5 percentage points, the recall rate is improved by 2.5 percentage points, the mean average precision is improved by 1.6 percentage points, the floating point operation is reduced by 0.6*10 9 6 times, and the FPS is reduced by 74.19 frames / s, which verifies the synergistic enhancement ability of the two modules in the model robustness. The model Net-5 introduces the dynamic multi-scale perception fusion module DSAF-Block on the basis of the Net-1, compared with the Net-1 model, the precision is reduced by 3.0 percentage points, the recall rate is reduced by 0.1 percentage points, the mean average precision is improved by 1.3 percentage points, the floating point operation is reduced by 0.6*10 9 6 times, and the FPS is reduced by 82.34 frames / s. Although the precision and the recall rate decrease slightly, the improvement of the mean average precision shows that the method can effectively enhance the recognition quality and boundary consistency of the model in the building outer wall defect detection while ensuring the robustness and generalization ability. The model Net-6 uses the shape perception probability intersection over union Compared with the Net-1 model, the accuracy decreases by 0.7 percentage points, the recall rate increases by 2.0 percentage points, the mean average precision increases by 0.7 percentage points, and the number of floating point operations and FPS are basically the same. Shape perception probability intersection over union Under the premise of keeping the model operation efficiency basically unchanged, the recall ability and overall detection accuracy are improved. Net-7 is an improved YOLOv11-OBB model of the embodiment. Compared with the YOLOv11-OBB model, the accuracy is improved by 6.2 percentage points, the recall rate is improved by 1.2 percentage points, the mean average precision is improved by 4.1 percentage points, the floating point operation is reduced by 0.6*10 9 times, and the FPS is reduced by 77.93 frames / s. The ablation experiment results show that the improved YOLOv11-OBB model and its series of improvements in the embodiment can significantly improve the detection accuracy of building outer wall defects, and show good adaptability, robustness and engineering practical value in multi-type defect recognition scenarios.
[0106] In summary, the method of the embodiment is aimed at the problem that the existing building exterior wall defect data set generally has insufficient sample quantity and uneven annotation quality, and the current super-resolution image enhancement method cannot effectively distinguish the degradation characteristics of the defect area (such as rust patches, peeling area, crack edge) and the background area. On the one hand, the embodiment designs a fuzzy perception module FBAB, introduces a blur degree prediction branch in Real-ESRGAN, realizes adaptive enhancement of local degradation area through blur map generation and feature guidance mechanism, and improves the clarity reconstruction effect of fuzzy defect area. On the other hand, the embodiment designs a defect-guided attention module DGAB, uses a multi-scale convolution structure that fuses RGB texture features and Sobel edge gradients to generate a defect area saliency attention map, and enhances the response of the backbone features to the defect area through a weighted residual method, thereby improving the spatial positioning ability and feature discriminability of the building exterior wall defect target in the image. Through the fuzzy factor perception module (Fuzzy Boundary-Aware Block, FBAB) and the defect-guided attention module (Defect-Guided Attention Block, DGAB) as the core of the regional enhancement branch structure. The structure is embedded in the Real-ESRGAN framework, which can model the blur degree and degradation form of the defect area in the building exterior wall image, realize the guided perception of the blur degree and degradation characteristics of the defect area, and support the restoration and enhancement of fuzzy defect samples. In view of the problem that the traditional super-resolution reconstruction model (such as Real-ESRGAN) performs well in the overall restoration of the image, but lacks the ability to model key defect areas, and it is difficult to fully improve the resolution of key defect areas such as surface peeling, cracks, bolt missing, and rust patches in building exterior wall images, the embodiment designs a defect boundary enhancement module DSBEB, which proposes a structural module composed of depth separable convolution, channel attention, and edge sharpening residual, which is used to enhance the edge information, contour response, and local texture of the defect area, thereby optimizing the reconstruction and perception clarity of the defect area. The module combines depth separable convolution, channel attention mechanism, and edge sharpening residual structure to combine the feature maps of the FBAB module and the DGAB module with the feature maps of the Real-ESRGAN backbone, significantly enhancing the boundary response and structure contrast of the local defect area, effectively restoring texture details, improving image enhancement quality, supporting subsequent detection tasks, and constructing a high-resolution large-scale building exterior wall defect image data set.In view of the fact that building outer wall defects have complex forms, large size spans, are often distributed in areas with uneven illumination, mixed textures or strong background interference, and the existing YOLOv11-OBB detection model cannot simultaneously identify small cracks, strip corrosion, small corrosion patches and other multi-scale structures, the embodiment designs a dynamic multi-scale perception fusion module DSAF-Block, combines the dynamic multi-scale perception fusion module DSAF-Block with the C3k2 module to form a composite feature extraction module DSA-C3 to replace the C3k2 module in the YOLOv11-OBB detection model, introduces a multi-scale receptive field and a direction convolution structure, fuses a dynamic learnable weighting mechanism, realizes efficient modeling and feature extraction of defect targets with large size spans and multiple direction changes, the module introduces a multi-scale dynamic perception convolution path, enhances the modeling capability of the backbone network to spatial structure changes and scale inconsistency, and thus improves the comprehensive recognition capability of outer wall defects. In view of the fact that some outer wall defects (such as cracks and strip corrosion) are often in the form of long and narrow strips, have obvious directionality and inclination angles, and the existing rotating target detection mechanism lacks accurate modeling of angles and shapes, the embodiment designs a shape perception probability intersection ratio. On the basis of ProbIoU, the rotation angle difference and shape proportion constraint are introduced to realize the improvement of the direction sensitivity of long and inclined defect targets, enhance the rotation box matching precision and regression stability, the index introduces a length-width ratio weighting and angle penalty factor to improve the direction regression precision of long and narrow targets and the stability of the rotation box matching. Through the combination of the above technical means, the region perception-based building outer wall defect recognition method of the embodiment can solve the problems of the existing building outer wall defect recognition methods, such as lack of data set, weak modeling capability and low recognition accuracy, and provides a low-cost, efficient and accurate target detection method for building outer wall defects.
[0107] In addition, the embodiment also provides a region perception-based building outer wall defect recognition system, which comprises a microprocessor and a memory connected to each other, and the microprocessor is programmed or configured to execute the region perception-based building outer wall defect recognition method.
[0108] In addition, the embodiment also provides a computer readable storage medium, which stores a computer program or instructions programmed or configured to execute the region perception-based building outer wall defect recognition method by a processor.
[0109] In addition, the embodiment also provides a computer program product comprising a computer program or instructions programmed or configured to execute the region perception-based building outer wall defect recognition method by a processor.
[0110] Those skilled in the art will understand that the technical solutions provided by this invention may take the form of a method, system, or computer program product. Therefore, this invention may take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, this invention may take the form of a computer program product embodied on one or more computer-readable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code. This invention is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, produce an implementation of the flowchart... Figure One One or more processes and / or boxes Figure One The computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to operate in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure One One or more processes and / or boxes Figure One The functions specified in one or more boxes. These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable apparatus for implementing the process. Figure One One or more processes and / or boxes Figure One Figure One The steps of the function specified in one or more boxes.
[0111] The above description is merely a preferred embodiment of the present invention. The scope of protection of the present invention is not limited to the above embodiments. All technical solutions falling within the scope of the present invention's concept are within the scope of protection of the present invention. It should be noted that for those skilled in the art, any improvements and modifications made without departing from the principles of the present invention should also be considered within the scope of protection of the present invention.
Claims
1. A method for identifying building exterior wall defects based on region perception, characterized in that, The method includes enhancing building exterior wall image samples to construct a building exterior wall image sample dataset, and using this dataset to train a building exterior wall defect detection model for target recognition of building exterior wall defects. The enhancement process for constructing the building exterior wall image sample dataset includes using a pre-trained fuzzy factor perception module (FBAB) to enhance fuzzy regions in the building exterior wall image samples, generating fuzzy enhanced feature maps to guide the perception of the fuzziness level of defect areas. The FBAB processing of the input building exterior wall images includes passing the input building exterior wall image samples through a series of cascaded convolutions. A 3×3 two-dimensional convolution and ReLU activation function are used to extract fuzzy features. The channel attention module SEBlock is used to adaptively weight each channel of the fuzzy features to enhance the key information channels and extract the channel-enhanced feature map. The channel-enhanced feature map is then used with two two-dimensional convolutions and a Sigmoid activation function to generate a fuzzy prediction map. The fuzzy prediction map and the channel-enhanced feature map are then multiplied pointwise to enhance the features in the fuzzy regions and suppress the features in the non-fuzzy regions to form fuzzy guiding features. The fuzzy guiding features are then used with a 1×1 convolution to increase the dimensionality of the fuzzy features to obtain the fuzzy enhanced feature map.
2. The method for identifying building exterior wall defects based on region perception according to claim 1, characterized in that, The fuzzy factor perception module FBAB uses fuzzy soft labels during pre-training. The generation of the fuzzy soft labels includes: converting the input building exterior wall image samples from standard RGB color images to grayscale images to obtain building exterior wall grayscale images; extracting edge information from the building exterior wall grayscale images to obtain a preliminary sharpness map; normalizing the preliminary sharpness map to obtain a standardized sharpness map; converting the standardized sharpness map into a fuzzy map by subtracting 1 from the standardized sharpness map, and introducing a nonlinear stretching function into the fuzzy map to enhance the response intensity to the fuzzy region to obtain the final fuzzy soft label.
3. The method for identifying building exterior wall defects based on region perception according to claim 1, characterized in that, When constructing a building exterior wall image sample dataset by enhancing building exterior wall image samples, the method includes using a pre-trained Defect Guided Attention (DGAB) module to enhance defect areas in the building exterior wall image samples and generate defect enhancement feature maps to achieve guided perception of degraded features in defect areas. The Defect-Guided Attention Module (DGAB) processes the input blurred enhanced feature map by: dividing the input blurred enhanced feature map into two branches; the first branch uses 3×3 convolution, batch normalization, and ReLU activation function to extract the basic color and texture features of the image; the second branch uses 3×3 convolution with fixed Sobel horizontal convolution kernel weights to extract the image edge response map; after concatenating the basic color and texture features and the image edge response map by channel dimension, a multi-scale dilated convolution module is used to progressively extract multi-scale fusion features that fuse texture, edges, and structure; after group normalization of the multi-scale fusion features, a defect prediction map is output through 1×1 convolution and Sigmoid activation function; the defect prediction map and the input original multi-scale fusion features are multiplied point by point, and then added to the input original multi-scale fusion features in channels to form defect-guided features, and then the defect enhanced feature map is obtained by 1×1 convolution dimensionality increase.
4. The method for identifying building exterior wall defects based on region perception according to claim 3, characterized in that, The Defect-Guided Attention Module (DGAB) uses soft labels for building exterior wall defects during pre-training. The generation of these soft labels includes: converting the input building exterior wall image sample from a standard RGB color image to Lab and HSV color spaces; extracting the a and b channels from the Lab color space; performing a logical AND operation on the portions of the a and b channels that satisfy a preset value range to obtain a defect response map in the Lab color space; extracting the h, s, and v channels from the HSV color space; performing a logical AND operation on the portions of the h, s, and v channels that satisfy a preset value range to obtain a defect response map in the HSV color space; taking the maximum value pixel-wise from both the Lab and HSV defect response maps to obtain a defect fusion response map; performing Gaussian blur processing on the defect fusion response map to remove noise; and using max pooling for dilation to enhance the continuity of corrosion boundaries to form soft labels for building exterior wall defects.
5. The method for identifying building exterior wall defects based on region perception according to claim 3, characterized in that, The process of enhancing building exterior wall image samples to construct a building exterior wall image sample dataset includes using an improved residual dense block network to enhance the building exterior wall image samples and placing the enhanced building exterior wall image samples into the building exterior wall image sample dataset. The enhanced building exterior wall image samples using the improved residual dense block network include: generating sample images of three scales from the building exterior wall image samples; performing pixel inverse rearrangement on the two larger sample images; using a pre-trained blur factor perception module (FBAB) to generate a blur enhancement feature map from the smallest sample image; using a pre-trained defect-guided attention module (DGAB) to generate a defect enhancement feature map from the larger sample image after pixel inverse rearrangement; extracting backbone features from the smaller sample image after pixel inverse rearrangement through a convolutional module, multiple cascaded residual dense blocks (RRDB), and a convolutional module; and then concatenating the extracted backbone features, blur enhancement feature map, and defect enhancement feature map. The Defect Boundary Enhancement Module (DSBEB) enhances the defect boundaries and then connects them with the residuals of smaller sample images after inverse pixel rearrangement. Finally, it generates enhanced building exterior wall image samples through upsampling and multiple consecutive convolutional modules. The Defect Boundary Enhancement Module (DSBEB) includes two parallel branches. The first branch processes the input stitched features through a 3×3 sharpening convolution kernel in 2D, which serves as the output feature of the first branch. The second branch processes the input stitched features through a 3×3 depth 2D convolution, batch normalization, point convolution module, channel attention module (SEBlock), and residual connection module. The residual connection module is used to perform residual connection between the input and output features of the channel attention module (SEBlock) and serve as the output feature of the second branch. The output features of the first and second branches are added together to form the feature map of the defect boundary enhanced by the Defect Boundary Enhancement Module (DSBEB).
6. The method for identifying building exterior wall defects based on region perception according to claim 1, characterized in that, The building exterior wall defect detection model is an improved YOLOv11-OBB model. This improved YOLOv11-OBB model adds a composite feature extraction module (DSA-C3) to the backbone and neck networks of the YOLOv11-OBB model. The DSA-C3 composite feature extraction module includes a first convolutional block, a second convolutional block, N dynamic multi-scale perception fusion modules (DSAF-Block), a connection module, and a third convolutional block, all connected in sequence. The outputs of the first and second convolutional blocks also serve as inputs to the connection module. The DSAF-Block dynamic multi-scale perception fusion module includes a batch normalization layer, a dynamic multi-scale perception fusion unit (DSAFM), a first learnable residual control factor layer, and a first random depth residual layer, all connected in sequence. The system comprises a difference connection module, a batch normalization layer, a gated convolution module, a second learnable residual control factor layer, and a second random depth residual connection module. The second input of the first random depth residual connection module is the original input of the dynamic multi-scale perception fusion module DSAF-Block, and the second input of the second random depth residual connection module is the output of the first random depth residual connection module. The dynamic multi-scale perception fusion module DSAFM includes a slicing module, multiple convolutional paths with different receptive fields, a connection module, and a convolution module. The slicing module divides the input feature map into input channels and sends them to multiple convolutional paths with different receptive fields to extract information about building exterior wall defects at different scales and directions. The enhanced feature maps are then aggregated and fused through the connection module and the convolution module.
7. The method for identifying building exterior wall defects based on region perception according to claim 6, characterized in that, The improved YOLOv11-OBB model uses a loss function during training that includes shape-aware probabilistic intersection-union ratio. The shape-aware probabilistic cross-union ratio (ProbIoU) replaces the probabilistic cross-union ratio (ProbIoU) used in the original YOLOv11-OBB model. The expression for the computation function is: ; ; in, The Bartlett distance between the predicted bounding box and the ground truth bounding box. The angle penalty coefficient, Angle penalty term for shape perception. As the weight of the angle error, 、 These are the angles of the predicted bounding box and the ground truth bounding box, respectively.
8. A building exterior wall defect identification system based on region perception, comprising a microprocessor and a memory interconnected, characterized in that, The microprocessor is programmed or configured to perform the area-aware building exterior wall defect identification method according to any one of claims 1 to 7.
9. A computer-readable storage medium storing a computer program or instructions, characterized in that, The computer program or instructions are programmed or configured to execute, via a processor, the area-aware building exterior wall defect identification method according to any one of claims 1 to 7.
10. A computer program product, comprising a computer program or instructions, characterized in that, The computer program or instructions are programmed or configured to execute, via a processor, the area-aware building exterior wall defect identification method according to any one of claims 1 to 7.
Citation Information
Patent Citations
Building exterior wall defect detection method based on mixed feature enhancement and attention optimization
CN120495210A