CN-122023855-A - Intelligent detection method for building damage
Abstract
The invention discloses an intelligent detection method for building damage, and relates to the technical field of building detection. The method comprises the steps of firstly collecting and preprocessing building images, obtaining an enhanced fusion characteristic image through an improved YOLO backbone network and a coordinate attention enhanced characteristic fusion method, obtaining a damage candidate boundary frame through an improved area suggestion network, obtaining a damage positioning result through improved non-maximum suppression, cutting local image blocks according to the positioning, inputting SegFormer semantic segmentation models to obtain a binary mask image, splicing the binary mask image into a global damage mask image, calculating damage quantization parameters through an orthogonal skeleton line algorithm to form a damage characteristic quantization set, and finally dividing damage grades through K-means deep clustering based on a dense layer self-encoder to obtain a final result, thereby realizing building damage detection.
Inventors
- GAO MINGZHE
- LIU YE
- XU HAIMING
- XIONG QUANXIANG
- XING ZHEN
- WANG YUGANG
- SHI TONGXIN
Assignees
- 西安建筑科大工程技术有限公司
Dates
- Publication Date
- 20260512
- Application Date
- 20260416
Claims (10)
- 1. The intelligent detection method for the damage of the building is characterized by comprising the following steps of: S1, collecting image data of a building and preprocessing the image data to obtain the image data of the building; S2, carrying out feature fusion on the building image data by a feature fusion method based on an improved YOLO backbone network and coordinate attention enhancement, so as to obtain an enhanced fusion feature map; S3, scanning the enhanced fusion feature map through an improved region suggestion network to obtain a damage candidate boundary frame, and removing the damage candidate boundary frame by adopting an improved non-maximum suppression algorithm to obtain a damage positioning result; S4, cutting out a local image block according to a damage positioning result, inputting the local image block into a SegFormer semantic segmentation model, outputting to obtain a binary mask map, splicing the binary mask map to obtain a global damage mask map, performing geometric feature calculation on the global damage mask map through an orthogonal skeleton line algorithm to obtain damage quantization parameters and constructing a damage feature quantization set; and S5, clustering the damage characteristic quantification set by a K-means depth clustering method based on a dense layer self-encoder to obtain damage clusters, and classifying damage grades based on the damage clusters to obtain a final detection result so as to realize damage detection of the building.
- 2. The intelligent detection method for building damage according to claim 1, wherein the steps of collecting and preprocessing the image data of the building to obtain the image data of the building include the following steps: Collecting image data of a building, wherein the image data of the building comprises a thermal imaging image and a visible light image; after the acquisition is completed, the thermal imaging image T is processed , ) And visible light image V # , ) Respectively executing image quality optimization pretreatment, and sequentially completing illumination equalization and Gaussian filter denoising operation; Performing adaptive data enhancement operation on the filtered denoising image I' (x, y), wherein the adaptive data enhancement operation comprises the steps of adopting a combined enhancement strategy of Mosaic stitching, random rotation and color dithering, superposing the random rotation and the color dithering operation on the basis of the Mosaic stitching, and the random rotation takes an image center point as a rotation center and takes a rotation angle as a rotation angle Taking the random values of 15,30 and 30-15, executing color dithering for visible light image, randomly adjusting brightness, saturation and contrast of image, and regulating brightness coefficient Take the value of [0.5,0.8], the saturation adjustment coefficient Take the value at [0.7,1.3], contrast adjustment coefficient The value is [0.8,1.2]; And finally obtaining the building image data.
- 3. The intelligent detection method for building damage according to claim 2, wherein the feature fusion is performed on the building image data based on an improved YOLO backbone network and a coordinate attention enhanced feature fusion method to obtain an enhanced fusion feature map, comprising the following steps: Building a basic feature extraction layer based on an improved YOLO backbone network, performing layer-by-layer convolution operation on the number of building images to obtain feature graphs with different scales, wherein the backbone network adopts a native ELAN module of YOLOv algorithm as a core convolution unit; constructing a cross-scale feature pyramid fusion structure, adopting a two-way fusion mechanism combining top-down feature transfer and bottom-up feature enhancement, integrating the scale features through a weighted fusion formula, and adopting a core formula of the cross-scale feature weighted fusion as follows: ; Wherein, the As a fused feature map of the k-th hierarchy, The weight coefficients for the original features of the kth level, The weighting coefficients after the z-th level feature is adapted to the k-th level, Representation of upsampling a z-level feature map to a k-level scale Is to be executed in the operation of (a), For the size of the kth level feature map, z and k are the level indices, Is the feature map of the k-th level; Calculating to obtain 4-level fusion feature images, transversely splicing the 4-level feature images, and outputting a global trans-scale fusion feature image ; The global cross-scale fusion feature map is enhanced through a coordinate attention mechanism, and an enhanced fusion feature map is obtained 。
- 4. The intelligent detection method for building damage according to claim 3, wherein the global cross-scale fusion feature map is enhanced by a coordinate attention mechanism to obtain an enhanced fusion feature map, and the method comprises the following steps: Fusing feature graphs globally across scales The method comprises the steps that a coordinate attention module is embedded into an output end of the integrated feature map, the coordinate attention module generates a space attention weight map through encoding transverse and longitudinal position information, dynamic enhancement is carried out on the integrated feature map, the implementation of the coordinate attention module is divided into two stages of coordinate information embedding and attention weight generation, the first stage is coordinate information embedding, and transverse and longitudinal position features are respectively extracted through global pooling operation; and the second stage is attention weight generation, the position features are converted into attention weights through convolution operation and an activation function, and the original fusion feature map is subjected to weighted enhancement.
- 5. The intelligent detection method for building damage according to claim 4, wherein the step of scanning the enhanced fusion feature map through the improved regional suggestion network to obtain damage candidate bounding boxes comprises the following steps: Building an improved regional suggestion network RPN, and fusing feature graphs for enhancement Scanning a sliding window to obtain an Anchor frame Anchor; the regional suggestion network classifies and regresses each anchor frame through convolution operation, and outputs the position coordinates and damage confidence coefficient of the candidate boundary frame, wherein the calculation formula of the candidate boundary frame position regression is as follows: ; Wherein, the Representing regressed damage candidate bounding boxes ) Is the center point pixel coordinates of the candidate frame, And The width and the height of the candidate boundary box are respectively , ) Is the center point coordinates of the original anchor frame, And For the width and height of the original anchor frame, 、 、 And Is regression offset; The regional suggestion network outputs the impairment confidence of each candidate bounding box The damage confidence calculation formula is as follows: ; Wherein, the For the lesion confidence of the candidate bounding box, () The function is activated for Sigmoid, Performing convolution operation on a region corresponding to a candidate boundary box B in the enhanced fusion feature map; Finally obtaining the damage candidate boundary frame , , wherein, N is the number of candidate bounding boxes for the nth candidate bounding box.
- 6. The intelligent detection method for building damage according to claim 5, wherein the method for removing the damage candidate bounding box by adopting the improved non-maximum suppression algorithm to obtain the damage positioning result comprises the following specific steps: introducing a self-adaptive IoU threshold adjustment mechanism according to the damage candidate boundary frame Dynamically setting a screening threshold value for confidence coefficient distribution of the candidate boundary frame, and calculating the mean value of damage confidence coefficient of the candidate boundary frame And standard deviation Dynamic IoU threshold The calculation formula of (2) is as follows: ; Wherein, the For the dynamic IoU threshold value, Is the mean of the lesion confidence of the candidate bounding box, The standard deviation of the damage confidence of the candidate bounding box; Based on dynamic IoU threshold And executing redundant candidate frame elimination operation, adopting an improved non-maximum suppression algorithm, wherein the algorithm execution formula is as follows: ; Wherein, the For the set of candidate boxes that remain after screening, For candidate frames And (3) with Is used for the cross-over ratio of (a), For the lowest confidence threshold, the fixed value is 0.1, And j is a candidate frame index; and finally obtaining a damage positioning result.
- 7. The intelligent detection method for building damage according to claim 6, wherein the steps of cutting out the local image block according to the damage positioning result, inputting the local image block into SegFormer semantic segmentation model, outputting to obtain a binary mask map, and splicing the binary mask map to obtain a global damage mask map include the following specific steps: Enhanced image based on lesion localization results Performing a lesion field clipping operation for each candidate frame According to the coordinates of the central point , ) Sum wide and high , ) Cutting out corresponding local image blocks , wherein, Pixel coordinates for the local image block; after cutting, adopting SegFormer semantic segmentation model to segment local image block Executing pixel level segmentation, wherein a model backbone network adopts MiT-B2, and captures multi-scale semantic features through a layered transform structure; Inputting the local image block into a SegFormer model after training, outputting to obtain a pixel level segmentation probability map of the local image block, performing binarization processing on the probability map to obtain a binarization mask map of the damaged area ; After binarization processing, all local mask patterns are enhanced on the image according to the original candidate frame The coordinate positions in the image are spliced to obtain a global damage mask map of the whole image 。
- 8. The intelligent detection method for building damage according to claim 7, wherein the geometric feature calculation is performed on the global damage mask map through an orthogonal skeleton line algorithm to obtain damage quantization parameters and construct a damage feature quantization set, and the method comprises the following specific steps: Global damage mask based graph Performing damage characteristic quantization operation, extracting a central skeleton of a damage region by adopting a binary image refinement algorithm, scanning to two sides in the normal vector direction of each skeleton point until damage edges are encountered, recording edge intersection points of the two sides, and calculating damage area, crack width and contour complexity three damage quantization parameters; For fracture damage, calculating the maximum width of the fracture based on an orthogonal skeleton line algorithm And average width ; Profile complexity The calculation formula for representing the irregularity degree of the shape of the damaged area and the complexity of the outline is as follows: ; Wherein, the In order for the profile to be complex, To the perimeter of the outline of the damaged area, by traversing the edge pixel points of the damaged pixels in the mask map, A perimeter of an equivalent circle equal to the area of the lesion area; Finally obtaining the damage characteristic quantification set Including lesion area, maximum width of the slit, average width of the slit, and profile complexity.
- 9. The intelligent detection method for building damage according to claim 8, wherein the clustering of the damage characteristic quantification set by the K-means depth clustering method based on the dense layer self-encoder to obtain a damage cluster comprises the following specific steps: quantification set of damage characteristics output in step S4 And executing characteristic preprocessing operation, wherein the preprocessing adopts a Z-score standardization method, and the core formula is as follows: ; Wherein, the As a normalized result of the p-th lesion characterization, Is the original quantized value of the p-th feature, For the mean of the feature over the training dataset, Standard deviation on the training dataset for the feature; Pretreatment to obtain standardized feature set Next, a dense layer self-encoder pair normalized feature set is constructed Executing dimension reduction operation, wherein the dense layer self-encoder consists of an encoder and a decoder, the encoder compresses 4-dimensional standardized features into 2-dimensional low-dimensional features through three layers of full-connection layers, and the decoder reconstructs the low-dimensional features into original dimension features through symmetrical three layers of full-connection layers; after the dimension reduction is completed, the method is based on the low-dimension characteristics K-means clustering operation is carried out, a damage sample is divided into 4 clustering clusters, four levels of building damage are corresponding, and 4 clustering centers are initialized through a K-means++ algorithm In the clustering process, calculating Euclidean distance from each low-dimensional characteristic sample to each clustering center, and distributing the samples to the closest cluster; after each allocation is completed, the cluster center coordinates are updated, and the updating formula is as follows , wherein, Is the first The number of samples in a cluster of clusters, Is the intra-cluster first Repeating sample distribution and center updating operations until the variation of the clustering center is less than 0.0001, and converging to obtain 4 damaged clusters 。
- 10. The intelligent detection method for building damage according to claim 9, wherein the classification of damage based on the damage cluster to obtain a final detection result comprises the following specific steps: the damage cluster corresponds to the actual damage grade, a quantitative threshold calibration rule is established, and the four damage grades are respectively defined as no damage, mild damage, moderate damage and severe damage, and a core calibration formula and rule are as follows: No damage rating: < And is also provided with < Wherein For the damage area threshold, the value is 5mm 2 , The value of the crack width threshold value is 0.1mm, and the crack width threshold value corresponds to a cluster The threshold value indicates minimal damage; Mild injury grade: ≦ < And is also provided with ≦ < Wherein =50mm 2 , =0.3 Mm, corresponding cluster The threshold value indicates that the damage is mild; moderate injury grade: ≦ < And is also provided with ≦ < Wherein =200mm 2 , =0.8 Mm, corresponding cluster The threshold value indicates that the damage is evident; Severe injury grade: Or (b) Corresponding cluster The threshold value indicates that the injury is severe; And carrying out association and integration on the damage position information, the damage quantification parameter and the damage grade information to obtain a final detection result.
Description
Intelligent detection method for building damage Technical Field The invention relates to the technical field of building detection, in particular to an intelligent detection method for building damage. Background Along with the deep urban progress of China, the scale and the number of buildings are continuously increased, and the buildings are easy to be damaged due to natural aging, environmental erosion, loading effect and the like, such as cracks, flaking and the like in long-term service, so that the building damage detection becomes a key link of building maintenance and safety assessment. The traditional feature extraction method for building damage is usually based on fixed scale convolution, the method uses the design thought of an early convolution neural network as a reference, the convolution kernel of a single size is set to carry out layer-by-layer convolution operation on a building detection image, feature information in the image is extracted, in the feature processing process, only damage features of a certain specific scale are focused, and then a subsequent damage identification process is completed through simple feature splicing or screening. However, the damage in the actual building scene has obvious size difference, and the traditional feature extraction method of the fixed-scale convolution cannot be simultaneously adapted to the feature requirements of the damage with different scales, so that insufficient feature extraction of the micro damage and incomplete semantic characterization of the large-area damage are caused, and finally, key information of various damage of the building is difficult to comprehensively capture, the integrity and accuracy of damage identification are affected, and the requirement of fine detection under the complex building scene cannot be met. Disclosure of Invention Aiming at the defects of the prior art, the invention provides an intelligent detection method for building damage, which solves the problems in the background art. In order to achieve the purpose, the intelligent detection method for the damage of the building is realized through the following technical scheme that the intelligent detection method for the damage of the building comprises the following steps: S1, collecting image data of a building and preprocessing the image data to obtain the image data of the building; S2, carrying out feature fusion on the building image data by a feature fusion method based on an improved YOLO backbone network and coordinate attention enhancement, so as to obtain an enhanced fusion feature map; S3, scanning the enhanced fusion feature map through an improved region suggestion network to obtain a damage candidate boundary frame, and removing the damage candidate boundary frame by adopting an improved non-maximum suppression algorithm to obtain a damage positioning result; S4, cutting out a local image block according to a damage positioning result, inputting the local image block into a SegFormer semantic segmentation model, outputting to obtain a binary mask map, splicing the binary mask map to obtain a global damage mask map, performing geometric feature calculation on the global damage mask map through an orthogonal skeleton line algorithm to obtain damage quantization parameters and constructing a damage feature quantization set; and S5, clustering the damage characteristic quantification set by a K-means depth clustering method based on a dense layer self-encoder to obtain damage clusters, and classifying damage grades based on the damage clusters to obtain a final detection result so as to realize damage detection of the building. Preferably, the collecting and preprocessing the image data of the building to obtain the image data of the building includes the following steps: Collecting image data of a building, wherein the image data of the building comprises a thermal imaging image and a visible light image, and in the collecting process, the collecting areas are numbered according to the floor, the direction and the component type of the building, and the thermal imaging image is uniformly marked as T # ,) The visible light image is uniformly marked as V #,) Wherein%,) Representing the transverse and longitudinal coordinates of pixels in the thermal imaging image,) Representing the lateral and longitudinal coordinates of a pixel in the visible light image; after the acquisition is completed, the thermal imaging image T is processed ,) And visible light image V #,) Respectively executing image quality optimization preprocessing, sequentially completing illumination equalization and Gaussian filter denoising operation, and adopting a self-adaptive histogram equalization algorithm for the illumination equalization processing, wherein the calculation formula is as follows: ; Wherein, the As a cumulative distribution function of the gray values of the image,Is the gray value of the pixel,Representing gray values asIs used for the number of pixels o