A Deep Learning-Based Method and System for Detecting Risk of Building Exterior Wall Detachment
By employing a deep learning-based method for detecting the risk of exterior wall detachment, combined with a deep learning segmentation model based on orthophoto reconstruction and edge weight constraints, the method addresses the issues of low detection efficiency and insufficient accuracy in existing technologies. It achieves high-precision detection of detachment areas and multi-dimensional quantification, thereby enhancing the level of intelligent building operation and maintenance management.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- EAST CHINA JIAOTONG UNIVERSITY
- Filing Date
- 2026-03-26
- Publication Date
- 2026-05-26
AI Technical Summary
Existing technologies for detecting wall detachment in building facades suffer from risks associated with high-altitude operations, low detection efficiency, severe perspective distortion in images, difficulty in automatically distinguishing effective wall areas, insufficient accuracy of general segmentation models in extracting subtle detachment features, and a lack of precise physical space mapping mechanisms. Consequently, they cannot meet the requirements for large-scale automated detection and multi-dimensional quantitative evaluation of building facades.
By employing a deep learning-based approach, an orthophoto reconstruction and edge weight constraint-introduced deep learning segmentation model are implemented. Combined with joint feature extraction of texture and color, a mapping relationship between pixels and physical space is established, and a comprehensive risk index is calculated to achieve high-precision detection and risk assessment of detachment areas.
It has achieved automated full-process detection of building exterior wall detachment risk, improved detection accuracy and efficiency, reduced the probability of misjudgment, can accurately delineate the complex outline of the detachment area, meet the requirements of high-precision area calculation, and improve the reliability of safety assessment and the level of intelligent building operation and maintenance management.
Smart Images

Figure CN121904600B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of image processing technology, specifically to a method and system for detecting the risk of building exterior wall detachment based on deep learning. Background Technology
[0002] Traditional manual inspections or close-range inspections using suspended platforms or scaffolding not only pose risks associated with working at heights but also suffer from low efficiency, making them unsuitable for the rapid screening needs of large-scale building facades. In recent years, with the popularization of drone technology and breakthroughs in computer vision using deep learning, image-based automated inspection methods have received widespread attention.
[0003] While existing machine vision-based methods have partially replaced manual methods, they remain limited to traditional, shallow image processing algorithms, such as edge detection based on the Canny operator or global thresholding segmentation techniques based on Otsu's method. These methods are sensitive to changes in lighting and background noise (such as trees and graffiti), easily leading to missed or false detections. For example, under non-head-facing shooting conditions, the acquired building images exhibit severe perspective distortion, and directly detecting on the original image will result in morphological distortion of the detached area. Furthermore, existing general-purpose deep learning models, without targeted sample training and parameter optimization, lack sufficient generalization ability when faced with features such as irregular edges of detached exterior walls, making it difficult to output high-precision semantic segmentation results.
[0004] Most machine vision methods estimate defect size directly through pixel distance without establishing a precise physical space mapping mechanism. For example, algorithms based on projection or minimum bounding rectangles assume the shooting plane is perfectly parallel to the wall, but the actual shooting angle is often tilted, causing the measurement direction to deviate from the true physical direction and introducing systematic errors. If the area is directly estimated based on the original image without geometric correction, the pixel resolution at different locations in the image is inconsistent, and the evaluation dimension is limited to a single planar area, completely ignoring key risk factors such as the actual elevation, actual lateral width, and actual longitudinal height of the detached area. The calculated results are difficult to use as an accurate reference for maintenance projects.
[0005] Furthermore, existing research lacks the ability to automatically extract effective regions based on texture features when facing complex background environments, making it difficult for algorithms to automatically remove invalid backgrounds such as the sky and ground. These issues limit the accuracy and automation of algorithms in real-world complex engineering scenarios. Therefore, a highly robust detection method is needed that is orientation-adaptive, can accurately reconstruct orthophotos, effectively filter out complex backgrounds, and comprehensively extract multi-dimensional real-world physical space parameters to achieve comprehensive risk quantification. Summary of the Invention
[0006] This application provides a deep learning-based method and system for detecting the risk of exterior wall detachment. The aim of this application is to address the problems in existing technologies, such as severe perspective distortion due to shooting angle, difficulty in automatically distinguishing effective wall areas in complex backgrounds, insufficient accuracy of general segmentation models in extracting subtle detachment features, and the lack of a precise physical space mapping mechanism that prevents the comprehensive extraction of multi-dimensional physical space parameters, thus hindering the scientific quantification of overall risk levels. These issues make it difficult for existing methods to meet the requirements of large-scale automated inspection and multi-dimensional quantitative assessment of building facades. Therefore, this application proposes a deep learning-based method, system, computer-readable storage medium, and electronic device for detecting the risk of exterior wall detachment.
[0007] A first aspect of this application provides a deep learning-based method for detecting the risk of exterior wall detachment, the method comprising:
[0008] Obtain the original surface image containing the area of the building's exterior wall peeling off, and extract the geometric features of the building facade to reconstruct the original surface image, resulting in an orthographic projection image parallel to the building facade;
[0009] The orthophoto image is enhanced, and the effective detection area of the exterior wall is extracted based on the joint features of texture and color to obtain the image to be detected.
[0010] Substitute the image to be detected into a deep learning segmentation model that incorporates edge weight constraints to obtain a semantic segmentation image;
[0011] The semantic segmentation image is then optimized to obtain several independent missing regions;
[0012] Based on the actual data of the building exterior wall, a mapping relationship between pixels and physical space is constructed, and the pixel information of each independent detachment area is converted into actual physical space parameters;
[0013] The actual physical space parameters are input into the quantitative risk assessment model to calculate the comprehensive risk index. Based on the comprehensive risk index, the risk level is determined and the detection results are output.
[0014] In one possible implementation, acquiring the original surface image containing the area of the building's exterior wall peeling off, and extracting the geometric features of the building facade to reconstruct the original surface image to obtain an orthographic projection image parallel to the building facade, includes:
[0015] Edge information in the original surface image is extracted using an edge detection algorithm, and an initial set of straight lines is extracted using Hough transform.
[0016] Calculate the spatial spacing and directional distribution parameters of each line in the initial set of lines, and construct an autocorrelation analysis function;
[0017] Based on the autocorrelation analysis function, straight lines whose spatial spacing conforms to the periodic distribution characteristics are extracted as valid straight line groups;
[0018] The effective line set is fitted using the least squares method to calculate the horizontal and vertical vanishing points, and a homography mapping matrix is constructed based on the coordinates of the horizontal and vertical vanishing points.
[0019] The inverse pixel mapping relationship between the orthophoto image and the original surface image is established using the homography mapping matrix, and the orthophoto image is generated by bilinear interpolation resampling.
[0020] In one possible implementation, the step of performing image enhancement processing on the orthophoto image and extracting the effective detection area of the exterior wall based on joint texture and color features to obtain the image to be detected includes:
[0021] The orthophoto image is adaptively gridded into blocks, and contrast-limited adaptive histogram equalization is performed based on the local histogram distribution of each image block to generate a texture enhancement image.
[0022] Multi-scale local binary pattern features are extracted from the texture enhancement map. The texture gradient change rate between adjacent windows is calculated using a sliding window. Regions whose texture gradient change rate exceeds a preset threshold are extracted as candidate regions for texture abrupt changes.
[0023] Extract the features of the texture mutation candidate region in the HSV color space, calculate the local color variance, remove the region where the local color variance is greater than the set threshold and the main color deviates from the building reference color, and extract the remaining pixels as the effective foreground mask.
[0024] Perform a connected component analysis algorithm on the effective foreground mask and extract the connected component with the largest area as the effective detection area of the outer wall;
[0025] Obtain the coordinates of the minimum bounding rectangle of the effective detection area of the exterior wall, and crop the orthophoto image based on the coordinates of the minimum bounding rectangle to obtain the detection image.
[0026] In one possible implementation, the process of constructing the deep learning segmentation model includes:
[0027] Obtain sample images containing the real masks of the detached areas and construct a training dataset;
[0028] A distance transformation algorithm is applied to the real mask to calculate the spatial distance from the pixel to the detached edge, and a spatial edge weight matrix is generated based on the negative correlation between the spatial distance and the loss weight.
[0029] The cross-entropy loss is pixel-level weighted based on the spatial edge weight matrix, and the weighted cross-entropy loss is fused with the focusing loss to construct a joint loss function;
[0030] The deep learning segmentation model is trained using the training dataset and the joint loss function to obtain the deep learning segmentation model.
[0031] In one possible implementation, the distance transformation algorithm is performed on the real mask to calculate the spatial distance from the pixel to the detached edge, and a spatial edge weight matrix is generated based on the negative correlation between the spatial distance and the loss weight. The expression of the spatial edge weight matrix is as follows:
[0032]
[0033] In the formula, The coordinates in the spatial edge weight matrix are The edge weight value corresponding to the pixel; This is the spatial distance from the pixel to the nearest edge of the actual mask where the pixel has detached. This is a preset edge weight amplification constant; To control the distance decay control parameter for the weight decay rate with spatial distance; It is an exponential function with the natural constant e as its base.
[0034] In one possible implementation, the cross-entropy loss is weighted at the pixel level based on the spatial edge weight matrix, and the weighted cross-entropy loss is fused with the focusing loss to construct a joint loss function. The expression of the joint loss function is as follows:
[0035]
[0036] In the formula, Here, x and y represent the joint loss function; x and y are the x and y coordinates of the pixels in the detected image, respectively. The coordinates in the spatial edge weight matrix are Edge weight values at the location; coordinates Cross-entropy loss value at; coordinates The focusing loss value at the location; The fusion balance coefficient is the weighted cross-entropy loss. is the fusion balance coefficient for focusing loss; ∑ represents summing over all pixels in the image.
[0037] In one possible implementation, the semantic segmentation image is optimized to obtain several independent missing regions, including:
[0038] Extract the missing category pixels from the semantic segmentation image to generate a binarized image;
[0039] The binarized image is subjected to pixel aggregation processing according to the preset spatial spacing parameters, and discrete missing pixels that meet the proximity condition are merged.
[0040] The aggregated connected pixel regions are extracted, and regions whose geometric features meet preset conditions are selected as the several independent detached regions.
[0041] In one possible implementation, the step of constructing a pixel-to-physical-space mapping relationship based on the actual data of the building's exterior wall, and converting the pixel information of each of the independent detachment areas into actual physical-space parameters, includes:
[0042] Obtain the actual physical size parameters of the building, calculate the ratio of the actual physical size parameters to the pixel width and pixel height corresponding to the detected image, and establish the X-axis single pixel physical resolution and Y-axis single pixel physical resolution;
[0043] The physical area of a single pixel is determined by the product of the physical resolution of the single pixel on the X-axis and Y-axis. The total number of pixels in each of the independent detached regions is counted. The total number of pixels is multiplied by the physical area of the single pixel to calculate the actual physical area.
[0044] Extract the center pixel coordinates of each independent detached region, calculate the pixel boundary difference of the independent detached region in the horizontal and vertical directions, and obtain the pixel span in the X-axis direction and the pixel span in the Y-axis direction.
[0045] The actual elevation position is calculated by multiplying the ordinate component of the center pixel coordinate by the physical resolution of a single pixel on the Y-axis.
[0046] Multiply the pixel spans in the X and Y axes by the corresponding single-pixel physical resolution to calculate the actual horizontal width and actual vertical height.
[0047] The actual physical space parameters include the actual physical area, the actual elevation position, the actual lateral width, and the actual longitudinal height.
[0048] In one possible implementation, the step of inputting the actual physical space parameters into a quantitative risk assessment model to calculate a comprehensive risk index, determining the risk level based on the comprehensive risk index, and outputting the detection result includes:
[0049] Preset physical area weighting factor, elevation location weighting factor, size span weighting factor, and defect density weighting factor;
[0050] Based on the center pixel coordinates of each independent detached region, the total number of other detached regions within the preset physical detection radius is counted to obtain the defect density parameter.
[0051] Extract the actual horizontal width and the actual vertical height, and calculate the actual diagonal span of the space;
[0052] Substituting the actual physical area, actual elevation location, actual diagonal span, and defect density parameters into the nonlinear fusion calculation formula, a normalized comprehensive risk index is obtained. The nonlinear fusion calculation formula is shown below:
[0053]
[0054] In the formula, RI is the comprehensive risk index, S is the actual physical area, H is the actual elevation position, L is the actual diagonal span of space, and D is the defect density parameter; ω1, ω2, ω3, and ω4 are the corresponding weighting factors for the physical area, elevation position, size span, and defect density, respectively.
[0055] The risk level of the detachment area is determined by matching the comprehensive risk index with a preset risk rating threshold range.
[0056] In this example, the beneficial effects are as follows:
[0057] 1. The method provided in this application achieves automated full-process detection of exterior wall detachment risk by combining orthophoto reconstruction with deep learning segmentation that incorporates edge weight constraints. In the geometric correction stage, building lines conforming to periodic distribution characteristics are extracted using an autocorrelation analysis function, and a homography mapping matrix is constructed to accurately eliminate perspective distortion caused by upward or oblique shots, ensuring the consistency of the global physical proportions of the image and providing an accurate basis for subsequent area calculation. The detected image is input into a deep learning model trained with a spatial edge weight matrix, forcing the model to highly focus on the irregular edges of the detachment area, outputting a high-precision semantic segmentation image and binarized results. Compared to traditional bounding box detection, this scheme can accurately delineate the complex contours of the detachment area, achieving a leap from coarse positioning to pixel-level fine segmentation, meeting the current requirements for high-precision detachment area calculation in building facade maintenance, and significantly improving the reliability of safety assessment.
[0058] 2. To improve the model's robustness in complex urban environments and under varying lighting conditions, and to remove interference from non-building surfaces such as the sky and ground, this application introduces a region extraction mechanism based on joint texture and color features. First, Limit Contrast Adaptive Histogram Equalization (CLAHE) is employed to effectively suppress uneven lighting and shadow effects on building surfaces. Second, by combining the texture gradient change rate of multi-scale local binary modes with the local color variance in the HSV color space, non-wall background areas with deviated dominant colors and excessive color variance are accurately eliminated. This processing method is equivalent to automatically constructing a physical feature filter at the input, not only obtaining high-purity effective detection areas of exterior walls but also providing high signal-to-noise ratio detection images for subsequent physical space mapping, significantly reducing the probability of misjudgment by the model in complex backgrounds.
[0059] 3. By establishing a precise mapping mechanism from pixel space to physical space, this application solves the problems of existing visual inspection methods, which struggle to accurately obtain actual engineering quantities and have limited risk assessment dimensions. Utilizing the actual physical dimensions of the building's exterior walls, this application establishes independent single-pixel physical resolutions for the X and Y axes, accurately converting the two-dimensional pixel information of the detachment area into objective parameters such as actual physical area, actual elevation position, and actual diagonal span. Furthermore, the system substitutes these physical parameters along with defect density parameters into a nonlinear fusion calculation formula to calculate the comprehensive risk index (RI), and determines the risk level accordingly. This transformation from "image pixel mapping" to "multi-dimensional variable nonlinear fusion" achieves multi-dimensional, refined quantitative classification of detachment risk, enabling the detection results to directly and accurately guide high-altitude repair and maintenance operations, greatly improving the intelligence level and efficiency of building operation and maintenance management.
[0060] A second aspect of this application provides a deep learning-based building exterior wall detachment risk detection system, the system comprising:
[0061] The geometric reconstruction module is used to acquire the original surface image containing the area where the building's exterior wall has peeled off, and extract the geometric features of the building facade to reconstruct the original surface image, resulting in an orthographic projection image parallel to the building facade.
[0062] The region extraction module is used to perform image enhancement processing on the orthophoto image and extract the effective detection area of the exterior wall based on the joint features of texture and color, thereby capturing the image to be detected.
[0063] The semantic segmentation module is used to input the image to be detected into a deep learning segmentation model with edge weight constraints to obtain a semantic segmentation image;
[0064] The image optimization module is used to optimize the semantic segmentation image to obtain several independent missing regions;
[0065] The physical mapping module is used to construct a mapping relationship between pixels and physical space based on the actual data of the building's exterior wall, and to convert the pixel information of each independent detachment area into actual physical space parameters.
[0066] The risk assessment module is used to input the actual physical space parameters into the quantitative risk assessment model to calculate the comprehensive risk index, determine the risk level based on the comprehensive risk index, and output the detection results.
[0067] A third aspect of this application provides a terminal including a processor, an input device, an output device, and a memory, wherein the processor, input device, output device, and memory are interconnected, wherein the memory is used to store a computer program, the computer program including program instructions, and the processor is configured to invoke the program instructions to execute the step instructions as described in the deep learning-based building exterior wall detachment risk detection method in the first aspect of this application.
[0068] A fourth aspect of this application provides a computer-readable storage medium storing a computer program for electronic data interchange, wherein the computer program causes a computer to perform some or all of the steps described in the deep learning-based building exterior wall detachment risk detection method of the first aspect of this application.
[0069] A fifth aspect of this application provides a computer program product, comprising a non-transitory computer-readable storage medium storing a computer program operable to cause a computer to perform some or all of the steps described in the deep learning-based building exterior wall detachment risk detection method of the first aspect of this application. The computer program product may be a software installation package. Attached Figure Description
[0070] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0071] Figure 1 This application provides a schematic diagram of the overall process for a deep learning-based method for detecting the risk of exterior wall detachment.
[0072] Figure 2 This application provides a schematic diagram of the overall structure of a deep learning-based building exterior wall detachment risk detection system.
[0073] Figure 3 This application provides a schematic diagram of the structure of a terminal.
[0074] Figure label:
[0075] Geometric Reconstruction Module - 10, Region Extraction Module - 20, Semantic Segmentation Module - 30, Image Optimization Module - 40, Physical Mapping Module - 50, Risk Assessment Module - 60. Detailed Implementation
[0076] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0077] The terms "first," "second," etc., in the specification, claims, and accompanying drawings of this application are used to distinguish different objects, not to describe a specific order. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion. For example, a process, method, system, product, or apparatus that includes a series of steps or units is not limited to the listed steps or units, but may optionally include steps or units not listed, or may optionally include other steps or units inherent to these processes, methods, products, or apparatuses.
[0078] In this application, the reference to "embodiment" means that a specific feature, structure, or characteristic described in connection with an embodiment may be included in at least one embodiment of this application. The appearance of this phrase in various places throughout the specification does not necessarily refer to the same embodiment, nor is it a mutually exclusive, independent, or alternative embodiment. It will be explicitly and implicitly understood by those skilled in the art that the embodiments described in this application can be combined with other embodiments.
[0079] A deep learning-based method for detecting building exterior wall detachment risk is applied to a deep learning-based building exterior wall detachment risk detection system. Figure 1 A schematic diagram illustrating the overall process of a deep learning-based method for detecting the risk of exterior wall detachment is shown. Figure 1 As shown, it includes:
[0080] Step S1: Obtain the original surface image containing the area where the building's exterior wall has detached, and extract the geometric features of the building facade to reconstruct the original surface image, thereby obtaining an orthographic projection image parallel to the building facade.
[0081] In this process, an original surface image containing the area where the building's exterior wall has detached is acquired using an image acquisition device. The geometric features of the building facade are extracted and the original surface image is geometrically corrected to reconstruct an orthographic projection image parallel to the building facade.
[0082] Specifically, edge information in the original surface image is extracted using an edge detection algorithm, and an initial set of lines is extracted using the Hough transform. The acquired original surface image is then processed by grayscale conversion and Gaussian filtering for noise reduction. The gradient magnitude and direction of the image are calculated using the Canny edge detection operator to extract discrete edge pixels. A Hough transform is performed on the spatial domain of the edge pixels to map the pixel coordinates to the parameter space. By extracting local extrema in the parameter space, the initial set of lines characterized by the polar radius and polar angle is obtained.
[0083] Calculate the spatial spacing and directional distribution parameters of each line in the initial set of lines, and construct an autocorrelation analysis function. Cluster the initial set of lines according to polar angle features to obtain the two dominant directional components: horizontal and vertical. Project the line pixels into one-dimensional space along the normal path of the dominant direction to generate a spatial density function characterizing the density of lines. Perform discrete autocorrelation operation on the spatial density function to construct an autocorrelation analysis function to quantify the periodicity of the spatial distribution of lines. The calculation formula is as follows:
[0084]
[0085] In the formula, The spatial spacing offset is The autocorrelation response value at time; The one-dimensional spatial projection coordinates are along the normal path of the dominant direction; This is the maximum projected span of the normal path; coordinates The linear space density function at that point; ∑ represents the spatial spacing offset; ∑ is the discrete accumulation operator in the one-dimensional spatial domain.
[0086] Based on the autocorrelation analysis function, straight lines with spatial spacing conforming to a periodic distribution are extracted as a valid set of straight lines. An autocorrelation peak threshold is set, and several extreme peaks exceeding the threshold are extracted from the autocorrelation analysis function response curve. The spatial spacing offset corresponding to adjacent extreme peaks is calculated. If its variance is less than the preset periodicity tolerance, it is determined that there is a stable periodic texture arrangement in that direction. The corresponding spatial straight lines are selected from the initial set of straight lines, and random cracks or cable interference are removed, and these are taken as the effective straight line group.
[0087] It should be noted that during the image acquisition phase, the acquired original surface image must completely encompass the entire facade of the building under test. The building under test is usually a low- to mid-rise building with a regular geometric facade. A single image covering its entire facade can be approximated as a two-dimensional relatively rigid plane. Moreover, such buildings generally have inherent periodic and regular physical structures (such as horizontal dividing lines of floors, regularly arranged balconies, and window frame edges).
[0088] Furthermore, the effective line group is fitted using the least squares method to calculate the horizontal and vertical vanishing points, and a homography mapping matrix is constructed based on the coordinates of the horizontal and vertical vanishing points. The effective line group is divided into horizontal line clusters (e.g., corresponding to floor lines or balcony beams) and vertical line clusters (e.g., corresponding to window frame sides or building outlines). Based on the least squares optimization algorithm, the minimum error intersection point of all lines in the horizontal line cluster is calculated as the horizontal vanishing point vh, and the minimum error intersection point of all lines in the vertical line cluster is calculated as the vertical vanishing point vv. The cross product of the horizontal and vertical vanishing points is calculated to obtain the vanishing line vector l∞ located at infinity, and then a homography mapping matrix H to eliminate perspective distortion is constructed. The calculation formula is as follows:
[0089]
[0090]
[0091] In the formula, The vector of the vanishing line at infinity, determined by the horizontal and vertical vanishing points; The homogeneous coordinate vector of the horizontal vanishing point; The homogeneous coordinate vector of the vertical vanishing point; These are the three-dimensional components of the vanishing line vector; The perspective homography mapping matrix is constructed.
[0092] An inverse pixel mapping relationship between the orthophoto projection image and the original surface image is established using the homography mapping matrix. The orthophoto projection image is then generated through bilinear interpolation resampling. The grid coordinates of the target orthophoto projection image are traversed, and each grid coordinate is left-multiplied by the inverse matrix H-1 of the homography mapping matrix to calculate its corresponding floating-point original pixel coordinates in the original surface image. For each floating-point original pixel coordinate, the grayscale values of its four adjacent integer pixels are extracted, and bilinear interpolation weighted according to the inverse distance ratio is performed to obtain the resampled pixel value at that grid coordinate in the target orthophoto projection image, thus generating the orthophoto projection image.
[0093] Step S2: Perform image enhancement processing on the orthophoto image, extract the effective detection area of the exterior wall based on the joint features of texture and color, and capture the detection image.
[0094] Specifically, the orthophoto image is adaptively meshed and divided into blocks. The orthophoto image is divided into M×N non-overlapping local image blocks, and the local gray-level histogram distribution within each block is statistically analyzed. A contrast limiting threshold β is set, and portions of the local histogram with frequencies exceeding the contrast limiting threshold β are cropped. The total number of cropped pixels is then evenly distributed across all gray levels to obtain the reconstruction probability density distribution P′(v). Based on the reconstruction probability density distribution, contrast-limited adaptive histogram equalization (CLAHE) is performed. The cumulative distribution mapping function T(k) is calculated as follows:
[0095]
[0096] in, Indicates grayscale level as The new grayscale value after pixel mapping; P'(j) represents the total number of gray levels in the image; P'(j) represents the pixel probability of the j-th gray level after reconstruction. This is the original grayscale index.
[0097] The pixel mapping result is obtained based on the cumulative distribution mapping function, and the boundary pixels of adjacent image blocks are smoothly transitioned using a bilinear interpolation algorithm to generate a texture enhancement map.
[0098] Furthermore, multi-scale local binary pattern (LBP) features are extracted from the texture enhancement map. For any pixel (x, y) in the texture enhancement map, a circular spatial neighborhood with radius R and containing P uniformly distributed sampling points is constructed centered on it. The multi-scale local binary pattern feature LBPP,R(x, y) is extracted, and the calculation formula is as follows:
[0099]
[0100] in, Represents the center pixel grayscale value, s(x) represents the gray value of the p-th sampling point in the spatial neighborhood; s(x) is the sign step function, which satisfies s(x)=1 when x≥0 and s(x)=0 when x<0.
[0101] A sliding window of preset size W×W is used to traverse the multi-scale local binary pattern feature map, and the texture gradient change rate ΔG(x,y) between the center pixels of adjacent windows is calculated. The calculation formula is as follows:
[0102]
[0103] in, This represents the rate of change of the texture gradient at pixel (x, y).
[0104] Extract the set of pixels whose texture gradient change rate ΔG(x,y) is greater than a preset gradient change threshold, and use them as candidate regions for texture mutation.
[0105] Furthermore, the orthophoto image is converted from the RGB color gamut to the HSV color gamut space, and the features of pixels in the texture mutation candidate region in the HSV color gamut space are extracted. The corresponding hue component (H) is extracted, and the local color variance σH2(x,y) is calculated using the following formula:
[0106]
[0107] in, Represents pixels The local color variance within a w×w neighborhood window; w represents the side length of the square neighborhood window. Let w be the radius parameter, satisfying w=2k+1; This represents the hue component value of the corresponding pixel within the neighborhood; This represents the average hue component of all pixels within the neighborhood window.
[0108] Obtain the building's baseline color tone parameter HBase. Iterate through each pixel within the candidate region of the texture mutation, determining whether it simultaneously satisfies the following conditions: local color variance σH2(x,y) > Tvar (Tvar is a set variance threshold), and absolute color deviation |H(x,y) - HBase| > Tdev (Tdev is a set color deviation threshold). If both conditions are met, discard the pixel; extract the remaining pixels that were not discarded as valid foreground masks.
[0109] Furthermore, a connected component analysis algorithm is performed on the effective foreground mask. A contour finding algorithm based on pixel connectivity is used to extract several independent connected component contours from the effective foreground mask. The total number of pixels contained in each independent connected component is traversed and counted, and the connected component with the largest total number of pixels is extracted and marked as the effective detection area of the outer wall.
[0110] Obtain the boundary point set of the maximum connected region contour of the effective detection area of the outer wall, and calculate the minimum bounding rectangle that can completely enclose the boundary point set. Extract the coordinates of the four vertices of the minimum bounding rectangle: [xmin, ymin], [xmax, ymin], [xmax, ymax], and [xmin, ymax].
[0111] Based on the two-dimensional spatial range determined by the coordinates of the four vertices mentioned above, an image cropping operation is performed on the original orthophoto image. The pixel matrix within the corresponding coordinate intervals [xmin, xmax] and [ymin, ymax] is extracted from the orthophoto image to obtain the detection image.
[0112] It should be noted that the detected image obtained by the cropping operation only retains the effective pixel data containing the building's exterior wall surface, and removes the background pixel sequence of non-wall areas.
[0113] Step S3: Substitute the image to be detected into a deep learning segmentation model with edge weight constraints to obtain a semantic segmentation image.
[0114] Specifically, sample images containing the true mask of the deteriorated area of the building exterior wall are acquired to construct a training dataset. The LabelMe image annotation tool is used to perform pixel-level polygon contour annotation on the deteriorated area of the sample images, and the generated annotation file is converted into a single-channel true mask MGT(x,y), where the gray value of pixels in the deteriorated area is marked as 1, and the gray value of pixels in the background area is marked as 0. The Canny edge detection operator is used to perform gradient calculation and non-maximum suppression processing on the true mask MGT(x,y) to extract binarized edges, obtaining the deteriorated edge contour pixel set Cedge.
[0115] A distance transformation algorithm is applied to the real mask to calculate the spatial distance from each pixel to the detached edge. For each pixel (x, y) in the real mask, the Euclidean distance D(x, y) to its nearest neighbor pixel (xk, yk) in the detached edge contour pixel set Cedge is calculated using the following formula:
[0116]
[0117] in, Indicates coordinates as The spatial distance from the pixel to the nearest detached edge; (xk, yk) are the pixel coordinates in the detached edge contour pixel set Cedge.
[0118] Based on the negative correlation between spatial distance and loss weight, a spatial edge weight matrix is generated, and its calculation formula is as follows:
[0119]
[0120] In the formula, The coordinates in the spatial edge weight matrix are The edge weight value corresponding to the pixel; This is the spatial distance from the pixel to the nearest edge of the actual mask where the pixel has detached. This is a preset edge weight amplification constant; To control the distance decay control parameter for the weight decay rate with spatial distance; It is an exponential function with the natural constant e as its base.
[0121] Obtain the initial prediction probability matrix P(x,y) output by the forward propagation of the deep learning segmentation model. Combined with the ground truth mask MGT(x,y), calculate the cross-entropy loss value LCE(x,y) for each pixel in the image, using the following formula:
[0122]
[0123] in, coordinates Cross-entropy loss value at; This determines the probability that the pixel belongs to the detached region for the model to predict. This is the true category label for the pixel in the real mask.
[0124] The focus loss value LFocal(x,y) for each pixel in the image is calculated using the following formula:
[0125]
[0126] in, coordinates The focus loss value at the point; γ is the focus modulation parameter that controls the degree of penalty for easy and difficult samples.
[0127] The cross-entropy loss is weighted at the pixel level based on the spatial edge weight matrix, and the weighted cross-entropy loss is then fused with the focusing loss to construct a joint loss function, the calculation formula of which is as follows:
[0128]
[0129] In the formula, Here, x and y represent the joint loss function; x and y are the x and y coordinates of the pixels in the detected image, respectively. The coordinates in the spatial edge weight matrix are Edge weight values at the location; coordinates Cross-entropy loss value at; This represents the focusing loss value at coordinates (x, y). The fusion balance coefficient is the weighted cross-entropy loss. ∑ represents the fusion balance coefficient for focusing loss; ∑ indicates summing over all pixels in the image.
[0130] The deep learning segmentation model is trained using the training dataset and the joint loss function. The gradient matrix of the joint loss function with respect to the model's network weight parameters is calculated using the backpropagation algorithm, and the network weight parameters are updated using a gradient descent optimizer. Training is repeated iteratively until the value of the joint loss function reaches the convergence condition.
[0131] The captured detection image is input into the trained deep learning segmentation model for inference operations. Through forward propagation and terminal activation functions, the spatial probability distribution features of each pixel in the detection image belonging to the missing region are calculated, and a matrix containing the continuous predicted probability values of each pixel is output, which is used as the semantic segmentation image.
[0132] Step S4: Perform image optimization on the semantic segmentation image to obtain several independent missing regions.
[0133] Specifically, a binarized image can be generated based on the semantic segmentation image, and the binarized image can be optimized to obtain several independent detached regions.
[0134] Specifically, the missing category pixels in the semantic segmentation image are extracted to generate a binarized image. The semantic segmentation image P(x,y) output from the above steps, containing the continuous prediction probability values for each pixel, is obtained. A classification probability threshold Tprob is set, and a pixel-by-pixel step mapping operation is performed on the semantic segmentation image P(x,y) to generate a binarized image B(x,y). The mapping formula is as follows:
[0135]
[0136] In the formula, Represents the binarized pixel value at coordinates (x, y); Represents the coordinates in the semantic segmentation image The predicted probability value at that location; This represents the preset classification probability threshold; 1 represents the detached category pixel, and 0 represents the background category pixel.
[0137] Pixel aggregation processing is performed on the binarized image according to a preset spatial spacing parameter, merging discrete missing pixels that meet the proximity condition. The preset spatial spacing parameter Rgap is obtained, and a circular morphological structuring element S with radius Rgap is constructed. Morphological dilation and erosion operations are sequentially performed on the binarized image B using the morphological structuring element S, constituting a morphological closing operation, generating the aggregated binary image Bagg. Its core aggregation calculation formula is as follows:
[0138]
[0139] In the formula, Bagg represents the binary image generated after pixel aggregation; B represents the initial binary image input; S represents the morphological structuring element; ⊕ represents the morphological dilation operator; and ⊖ represents the morphological erosion operator.
[0140] The aggregated connected pixel regions are extracted, and regions whose geometric features meet preset conditions are selected as several independent detached regions. A connected component traversal algorithm is performed on the aggregated binary image Bagg to extract several independent sets of connected pixel regions. The sets of connected pixel regions are traversed, and the total number of foreground pixels contained in each connected pixel region is counted as the area feature. The ratio of the longer side to the shorter side of the minimum bounding rectangle of each connected pixel region is calculated as the aspect ratio feature.
[0141] Set an effective area threshold and a maximum aspect ratio threshold. Perform a traversal comparison of the geometric features of each extracted connected pixel region. If the area feature of the target connected pixel region is smaller than the effective area threshold, or its aspect ratio feature is greater than the maximum aspect ratio threshold, then it is determined to be a small noise point or a narrow, elongated interference texture, and is removed from the set of connected pixel regions.
[0142] The connected pixel regions retained after filtering are output and used as the several independent detached regions.
[0143] Step S5: Establish a mapping relationship between pixels and physical space based on the actual physical size parameters of the building's exterior wall, and convert the pixel information of each independent detachment area into actual physical space parameters.
[0144] Specifically, the actual physical dimensions of the building are obtained, including the actual total physical width and the actual total physical height. The global pixel width and global pixel height of the detected image are extracted. The ratio of the actual total physical width to the global pixel width is calculated to establish the X-axis single-pixel physical resolution Rx; the ratio of the actual total physical height to the global pixel height is calculated to establish the Y-axis single-pixel physical resolution Rey.
[0145] The physical area of a single pixel is determined by the product of the physical resolution of the single pixel along the X and Y axes. The several independent detached regions extracted in the above steps are traversed, and the total number of pixels in each independent detached region is counted using the zero-order spatial moment within the connected components. The actual physical area S of each detached region is calculated by multiplying the total number of pixels by the physical area of the single pixel, using the following formula:
[0146]
[0147] In the formula, S is the actual physical area; This represents the total number of pixels counted within this independent detached region. The physical resolution of a single pixel along the X-axis; The physical resolution of a single pixel along the Y-axis.
[0148] Extract the center pixel coordinates of each independent detached region. For any k-th independent detached region, calculate its two-dimensional geometric centroid based on the first-order spatial moment of the image, which is used as the center pixel coordinates (xc, yc). The calculation formula is as follows:
[0149]
[0150] In the formula, and These represent the horizontal and vertical coordinate components of the center pixel of the independent shedding region, respectively. Represents the k-th independent detachment region; ∑ represents the sum of all regions. The summation is performed on all connected pixels within the local area; x and y are the coordinate indices of the locally traversed pixels. This represents the binarized pixel value at that coordinate point.
[0151] Furthermore, the pixel boundary differences of the independent detached regions in the horizontal and vertical directions are calculated. The difference between the maximum and minimum horizontal coordinates of the region is obtained as the pixel span in the X-axis direction, and the difference between the maximum and minimum vertical coordinates is obtained as the pixel span in the Y-axis direction.
[0152] A two-dimensional affine mapping matrix is constructed to transform the pixel coordinate system to the actual physical coordinate system, which uniformly maps the ordinate component of the center pixel coordinate, the pixel span in the X-axis direction, and the pixel span in the Y-axis direction to the physical space. The mapping calculation formula is as follows:
[0153]
[0154] From this, the separate formula for calculating the actual elevation position H is derived as follows:
[0155]
[0156] In the formula, This represents the calculated actual horizontal width; This represents the calculated actual longitudinal height; This indicates the calculated actual elevation position; and These are the physical resolutions of a single pixel along the X and Y axes, respectively. and These represent the pixel span along the X-axis and Y-axis, respectively. To detect the global pixel height of an image; The ordinate component represents the center pixel coordinates.
[0157] It should be noted that in the inspection of exterior walls in building construction, the origin of the coordinate system is usually defined at the ground baseline. Therefore, a coordinate system origin is introduced into the mapping matrix ( The transformation term aims to convert the top-down Y-axis coordinates in the image coordinate system into bottom-up elevation coordinates in physical space, ensuring the accurate physical meaning of the actual elevation position H.
[0158] Extract the calculated actual physical area S, the actual elevation position H, and the actual lateral width. and the actual longitudinal height Together, they constitute the actual physical space parameters.
[0159] Step S6: Input the actual physical space parameters into the quantitative risk assessment model to calculate the comprehensive risk index, determine the risk level based on the comprehensive risk index, and output the detection results.
[0160] Specifically, preset physical area weighting factors, elevation position weighting factors, size span weighting factors, and defect density weighting factors are used. Based on the center pixel coordinates of each independent detached region obtained in the above steps, the total number of other detached regions within the preset physical detection radius is counted to obtain the defect density parameter. More precisely, based on the single-pixel physical resolution obtained above, the preset physical detection radius is equivalently converted into a pixel-level detection radius. For the k-th target detached region, using its center pixel coordinates as the reference point, the remaining independent detached regions in the image are traversed, and the defect density parameter is calculated based on the spatial indicator function summation model. The calculation formula is as follows:
[0161]
[0162] In the formula, Here, N represents the defect density parameter for the k-th target detachment region; N is the total number of independent detachment regions extracted from the current detection image. , () represents the center pixel coordinates of the detached region of the k-th target; , ) represents the center pixel coordinates of the i-th other detached region; Rsearch is the converted pixel-level detection radius; I(·) is the indicator function, which takes the value 1 when the internal distance inequality condition is met, and takes the value 0 otherwise; ∑ is the cumulative summation operator.
[0163] Furthermore, the actual horizontal width and actual vertical height obtained above are extracted, and the actual horizontal width and actual vertical height are used as orthogonal basis parameters. Based on the two-dimensional Euclidean norm calculation model, the actual spatial diagonal span is calculated, and the calculation formula is as follows:
[0164]
[0165] In the formula, The actual diagonal span is used to characterize the maximum linear damage extension scale of the detached area on the physical structural plane. This is the actual lateral width corresponding to the detached area; This represents the actual longitudinal height of the detached area.
[0166] The actual physical area, actual elevation location, actual diagonal span, and defect density parameters are collectively used to construct a multidimensional risk feature vector. This multidimensional risk feature vector is then substituted into a nonlinear fusion calculation formula based on Logistic regression logic. Through a smoothing mapping using an exponential function, a normalized comprehensive risk index is obtained. The core calculation formula is as follows:
[0167]
[0168] In the formula, The comprehensive risk index is defined by S, where S represents the actual physical area, H represents the actual elevation location, and L represents the actual diagonal span of the space. ω1, ω2, ω3, and ω4 are the corresponding physical area weighting factor, elevation location weighting factor, size span weighting factor, and defect density weighting factor, respectively.
[0169] It should be noted that the severity of building exterior wall collapse is determined by the coupling of multiple spatial variables. For example, the gravitational potential energy of falling objects is strictly positively correlated with elevation (H); simultaneously, if the defect density parameter (D) is high in a certain area, it often indicates that the underlying foundation of that area has undergone large-scale hollowing, which can easily trigger a chain reaction of continuous collapse. The aforementioned nonlinear Sigmoid-type fusion formula can effectively eliminate the dimensional differences and order-of-magnitude gaps between multidimensional heterogeneous parameters, smoothly map the linear combination of all risk factors and converge them to the standard probability interval of (0,1), avoiding the failure of the assessment system due to a single extreme eigenvalue.
[0170] The calculated comprehensive risk index is matched with a preset risk rating threshold range. A risk classification ladder (e.g., low risk, medium risk, high risk) defined by multiple interval boundary values is pre-set. The threshold range to which the comprehensive risk index belongs is determined and the corresponding risk rating label is output. Finally, the risk level of the detachment area is defined, which serves as a quantitative decision-making basis for priority maintenance and damage assessment of the exterior wall.
[0171] In the above-described method steps, the method provided in this application achieves automated full-process detection of exterior wall detachment risk through a strategy combining orthophoto reconstruction and deep learning segmentation. Specifically, by reconstructing an orthophoto image parallel to the building facade using a geometric correction module, perspective distortion caused by upward or oblique shots is eliminated, ensuring consistent physical proportions of pixels at different locations in the image and providing an accurate basis for subsequent area calculation. The detected image is input into a deep learning segmentation model with edge weight constraints for inference operations. The cross-entropy loss is weighted at the pixel level based on the spatial edge weight matrix, and optimized in conjunction with the focusing loss, outputting a high-precision semantic segmentation image and binarized results, achieving a leap from coarse localization to pixel-level fine segmentation. Compared to traditional bounding box detection, this solution can accurately delineate the irregular edges of the detachment area, meeting the current requirements for high-precision detachment area calculation and risk classification in building facade maintenance, and significantly improving the reliability of safety assessment.
[0172] Furthermore, to improve the model's robustness in complex urban environments and under varying lighting conditions, and to remove interference from non-building surfaces such as the sky and ground, this application introduces Adaptive Mesh Block Limiting Contrast Adaptive Histogram Equalization (CLAHE) and an analysis algorithm based on joint texture and color features. The CLAHE algorithm performs local histogram processing on the image, effectively suppressing the effects of uneven lighting and shadows. Simultaneously, it utilizes multi-scale local binary modes to calculate the texture gradient change rate and combines this with local color variance in the HSV color gamut to remove background interference, automatically identifying and cropping the effective detection area of the exterior wall, thereby determining the pixel width of the detection area. This processing method is equivalent to automatically filtering out environmental noise interference at the input, not only improving the quality of the detection image containing exterior wall surface features but also providing crucial size parameters for subsequent physical space mapping, reducing the model's misclassification rate in complex backgrounds.
[0173] Furthermore, by establishing a precise mapping mechanism from pixel space to physical space, this application solves the problem of existing visual inspection methods' difficulty in obtaining actual engineering quantities. This application utilizes calibration data from image acquisition (such as the total width and height of the building) and the effective detection image pixel dimensions extracted in previous steps to calculate the physical resolution of a single pixel on the X and Y axes. This directly converts the number and location of pixels in the detached area into actual physical area, actual elevation location, and actual diagonal span, among other actual physical spatial parameters. Further, the system not only relies on a single area for damage assessment but also couples the calculated multi-dimensional physical spatial parameters with statistically derived defect density parameters. These parameters are then substituted into a nonlinear fusion formula to calculate a comprehensive risk index, which is matched with preset risk assessment standards to automatically generate a visual inspection result containing color warning boxes and risk level labels. This transformation from "image pixels" to multi-dimensional "engineering data" allows the inspection results to directly guide the priority repair work of the exterior walls, significantly improving the intelligence level and work efficiency of building exterior wall operation and maintenance management.
[0174] For those consistent with the above, please refer to Figure 2 , Figure 2 This application provides a schematic diagram of a deep learning-based building exterior wall detachment risk detection system as an embodiment of the present application. Figure 2 As shown, the system includes:
[0175] The geometric reconstruction module 10 is used to acquire the original surface image containing the area where the building's exterior wall has peeled off, and to extract the geometric features of the building facade to reconstruct the original surface image, thereby obtaining an orthographic projection image parallel to the building facade.
[0176] The region extraction module 20 is used to perform image enhancement processing on the orthophoto image and extract the effective detection area of the exterior wall based on the joint features of texture and color, thereby obtaining the image to be detected.
[0177] The semantic segmentation module 30 is used to substitute the image to be detected into a deep learning segmentation model with edge weight constraints to obtain a semantic segmentation image;
[0178] Image optimization module 40 is used to optimize the semantic segmentation image to obtain several independent missing regions;
[0179] The physical mapping module 50 is used to construct a mapping relationship between pixels and physical space based on the actual data of the building exterior wall, and to convert the pixel information of each independent detachment area into actual physical space parameters.
[0180] The risk assessment module 60 is used to input the actual physical space parameters into the quantitative risk assessment model to calculate the comprehensive risk index, determine the risk level based on the comprehensive risk index, and output the detection results.
[0181] For examples consistent with the above embodiments, please refer to... Figure 3 , Figure 3 A schematic diagram of a terminal structure provided in an embodiment of this application is shown in the figure. It includes a processor, an input device, an output device, and a memory. The processor, input device, output device, and memory are interconnected. The memory is used to store a computer program, which includes program instructions. The processor is configured to call the program instructions. The program includes instructions for performing the following steps.
[0182] Obtain the original surface image containing the area of the building's exterior wall peeling off, and extract the geometric features of the building facade to reconstruct the original surface image, resulting in an orthographic projection image parallel to the building facade;
[0183] The orthophoto image is enhanced, and the effective detection area of the exterior wall is extracted based on the joint features of texture and color to obtain the image to be detected.
[0184] Substitute the image to be detected into a deep learning segmentation model that incorporates edge weight constraints to obtain a semantic segmentation image;
[0185] The semantic segmentation image is then optimized to obtain several independent missing regions;
[0186] Based on the actual data of the building exterior wall, a mapping relationship between pixels and physical space is constructed, and the pixel information of each independent detachment area is converted into actual physical space parameters;
[0187] The actual physical space parameters are input into the quantitative risk assessment model to calculate the comprehensive risk index. Based on the comprehensive risk index, the risk level is determined and the detection results are output.
[0188] The above mainly describes the solutions of the embodiments of this application from the perspective of the method execution process. It is understood that, in order to achieve the above functions, the terminal includes the corresponding hardware structure and / or software modules for executing each function. Those skilled in the art should readily recognize that, in conjunction with the units and algorithm steps of the various examples described in the embodiments provided herein, this application can be implemented in hardware or a combination of hardware and computer software. Whether a function is executed in hardware or by computer software driving hardware depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.
[0189] This application embodiment can divide the terminal into functional units according to the above method example. For example, each function can be divided into a separate functional unit, or two or more functions can be integrated into one processing unit. The integrated unit can be implemented in hardware or as a software functional unit. It should be noted that the unit division in this application embodiment is illustrative and only represents one logical functional division. In actual implementation, there may be other division methods.
[0190] This application also provides a computer storage medium storing a computer program for electronic data interchange, which causes a computer to perform some or all of the steps of any deep learning-based building exterior wall detachment risk detection method described in the above method embodiments.
[0191] This application also provides a computer program product, which includes a non-transitory computer-readable storage medium storing a computer program that causes a computer to perform some or all of the steps of any deep learning-based building exterior wall detachment risk detection method described in the above method embodiments.
[0192] It should be noted that, for the sake of simplicity, the foregoing method embodiments are all described as a series of actions. However, those skilled in the art should understand that this application is not limited to the described order of actions, as some steps may be performed in other orders or simultaneously according to this application. Furthermore, those skilled in the art should also understand that the embodiments described in the specification are preferred embodiments, and the actions and modules involved are not necessarily essential to this application.
[0193] In the above embodiments, the descriptions of each embodiment have different focuses. For parts not described in detail in a certain embodiment, please refer to the relevant descriptions in other embodiments.
[0194] In the several embodiments provided in this application, it should be understood that the disclosed apparatus can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between devices or units may be electrical or other forms.
[0195] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0196] Furthermore, the functional units in the various embodiments of the application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software program module.
[0197] If the integrated unit is implemented as a software program module and sold or used as an independent product, it can be stored in a computer-readable storage device (CMD). Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a memory and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this application. The aforementioned memory includes various media capable of storing program code, such as USB flash drives, read-only memory (ROM), random access memory (RAM), portable hard drives, magnetic disks, or optical disks.
[0198] Those skilled in the art will understand that all or part of the steps in the various methods of the above embodiments can be implemented by a program instructing related hardware. The program can be stored in a computer-readable storage device, which may include: a flash drive, a read-only memory, a random access memory, a magnetic disk, or an optical disk, etc.
[0199] The embodiments of this application have been described in detail above. Specific examples have been used to illustrate the principles and implementation methods of this application. The description of the above embodiments is only for the purpose of helping to understand the method and core ideas of this application. At the same time, for those skilled in the art, there will be changes in the specific implementation methods and application scope based on the ideas of this application. Therefore, the content of this specification should not be construed as a limitation of this application.
Claims
1. A method for detecting the risk of exterior wall detachment based on deep learning, characterized in that, include: Obtain the original surface image containing the area of the building's exterior wall peeling off, and extract the geometric features of the building facade to reconstruct the original surface image, resulting in an orthographic projection image parallel to the building facade; The orthophoto image is enhanced, and the effective detection area of the exterior wall is extracted based on the joint features of texture and color to obtain the image to be detected. Substitute the image to be detected into a deep learning segmentation model that incorporates edge weight constraints to obtain a semantic segmentation image; The semantic segmentation image is then optimized to obtain several independent missing regions; Based on the actual data of the building exterior wall, a mapping relationship between pixels and physical space is constructed, and the pixel information of each independent detachment area is converted into actual physical space parameters; The actual physical space parameters are input into the quantitative risk assessment model to calculate the comprehensive risk index, and the risk level is determined based on the comprehensive risk index and the detection results are output. The construction process of the deep learning segmentation model includes: Obtain sample images containing the real masks of the detached areas and construct a training dataset; A distance transformation algorithm is applied to the real mask to calculate the spatial distance from the pixel to the detached edge, and a spatial edge weight matrix is generated based on the negative correlation between the spatial distance and the loss weight. The cross-entropy loss is pixel-level weighted based on the spatial edge weight matrix, and the weighted cross-entropy loss is fused with the focusing loss to construct a joint loss function; The deep learning segmentation model is trained using the training dataset and the joint loss function to obtain the deep learning segmentation model; The actual physical space parameters include the actual physical area, actual elevation position, actual lateral width, and actual longitudinal height; The step of inputting the actual physical space parameters into a quantitative risk assessment model to calculate a comprehensive risk index, determining the risk level based on the comprehensive risk index, and outputting the detection results includes: Preset physical area weighting factor, elevation location weighting factor, size span weighting factor, and defect density weighting factor; Based on the center pixel coordinates of each independent detached region, the total number of other detached regions within the preset physical detection radius is counted to obtain the defect density parameter. Extract the actual horizontal width and the actual vertical height, and calculate the actual diagonal span of the space; Substituting the actual physical area, actual elevation location, actual diagonal span, and defect density parameters into the nonlinear fusion calculation formula, a normalized comprehensive risk index is obtained. The nonlinear fusion calculation formula is shown below: In the formula, RI is the comprehensive risk index, S is the actual physical area, H is the actual elevation position, L is the actual diagonal span of space, and D is the defect density parameter; ω1, ω2, ω3, and ω4 are the corresponding weighting factors for the physical area, elevation position, size span, and defect density, respectively. The risk level of the detachment area is determined by matching the comprehensive risk index with a preset risk rating threshold range.
2. The method for detecting the risk of building exterior wall detachment based on deep learning according to claim 1, characterized in that, The process of acquiring the original surface image containing the area of the building's exterior wall peeling off, and extracting the geometric features of the building facade to reconstruct the original surface image to obtain an orthographic projection image parallel to the building facade includes: Edge information in the original surface image is extracted using an edge detection algorithm, and an initial set of straight lines is extracted using Hough transform. Calculate the spatial spacing and directional distribution parameters of each line in the initial set of lines, and construct an autocorrelation analysis function; Based on the autocorrelation analysis function, straight lines whose spatial spacing conforms to the periodic distribution characteristics are extracted as valid straight line groups; The effective line set is fitted using the least squares method to calculate the horizontal and vertical vanishing points, and a homography mapping matrix is constructed based on the coordinates of the horizontal and vertical vanishing points. The inverse pixel mapping relationship between the orthophoto image and the original surface image is established using the homography mapping matrix, and the orthophoto image is generated by bilinear interpolation resampling.
3. The method for detecting the risk of exterior wall detachment based on deep learning according to claim 1, characterized in that, The process of performing image enhancement processing on the orthophoto image and extracting the effective detection area of the exterior wall based on joint texture and color features to obtain the image to be detected includes: The orthophoto image is adaptively gridded into blocks, and contrast-limited adaptive histogram equalization is performed based on the local histogram distribution of each image block to generate a texture enhancement image. Multi-scale local binary pattern features are extracted from the texture enhancement map. The texture gradient change rate between adjacent windows is calculated using a sliding window. Regions whose texture gradient change rate exceeds a preset threshold are extracted as candidate regions for texture abrupt changes. Extract the features of the texture mutation candidate region in the HSV color space, calculate the local color variance, remove the region where the local color variance is greater than the set threshold and the main color deviates from the building reference color, and extract the remaining pixels as the effective foreground mask. Perform a connected component analysis algorithm on the effective foreground mask and extract the connected component with the largest area as the effective detection area of the outer wall; Obtain the coordinates of the minimum bounding rectangle of the effective detection area of the exterior wall, and crop the orthophoto image based on the coordinates of the minimum bounding rectangle to obtain the detection image.
4. The method for detecting the risk of building exterior wall detachment based on deep learning according to claim 1, characterized in that, The distance transformation algorithm is applied to the real mask to calculate the spatial distance from the pixel to the edge of the detachment. Based on the negative correlation between the spatial distance and the loss weight, a spatial edge weight matrix is generated. The expression of the spatial edge weight matrix is as follows: In the formula, The coordinates in the spatial edge weight matrix are The edge weight value corresponding to the pixel; This is the spatial distance from the pixel to the nearest edge of the actual mask where the pixel has detached. This is a preset edge weight amplification constant; To control the distance decay control parameter for the weight decay rate with spatial distance; It is an exponential function with the natural constant e as its base.
5. The method for detecting the risk of building exterior wall detachment based on deep learning according to claim 1, characterized in that, The step involves pixel-level weighting of the cross-entropy loss based on the spatial edge weight matrix, and then fusing the weighted cross-entropy loss with the focusing loss to construct a joint loss function. The expression of the joint loss function is as follows: In the formula, Here, x and y represent the joint loss function; x and y are the x and y coordinates of the pixels in the detected image, respectively. The coordinates in the spatial edge weight matrix are Edge weight values at the location; coordinates Cross-entropy loss value at; coordinates The focusing loss value at the location; The fusion balance coefficient is the weighted cross-entropy loss. is the fusion balance coefficient for focusing loss; ∑ represents summing over all pixels in the image.
6. The method for detecting the risk of building exterior wall detachment based on deep learning according to claim 1, characterized in that, The semantic segmentation image is then optimized to obtain several independent missing regions, including: Extract the missing category pixels from the semantic segmentation image to generate a binarized image; The binarized image is subjected to pixel aggregation processing according to the preset spatial spacing parameters, and discrete missing pixels that meet the proximity condition are merged. The aggregated connected pixel regions are extracted, and regions whose geometric features meet preset conditions are selected as the several independent detached regions.
7. The method for detecting the risk of building exterior wall detachment based on deep learning according to claim 1, characterized in that, The step of constructing a pixel-to-physical-space mapping relationship based on the actual data of the building's exterior wall, and converting the pixel information of each independent detachment area into actual physical-space parameters, includes: Obtain the actual physical size parameters of the building, calculate the ratio of the actual physical size parameters to the pixel width and pixel height corresponding to the detected image, and establish the X-axis single pixel physical resolution and Y-axis single pixel physical resolution; The physical area of a single pixel is determined by the product of the physical resolution of the single pixel on the X-axis and Y-axis. The total number of pixels in each of the independent detached regions is counted. The total number of pixels is multiplied by the physical area of the single pixel to calculate the actual physical area. Extract the center pixel coordinates of each independent detached region, calculate the pixel boundary difference of the independent detached region in the horizontal and vertical directions, and obtain the pixel span in the X-axis direction and the pixel span in the Y-axis direction. The actual elevation position is calculated by multiplying the ordinate component of the center pixel coordinate by the physical resolution of a single pixel on the Y-axis. The actual horizontal width and actual vertical height are calculated by multiplying the pixel spans in the X and Y axes by the corresponding physical resolution of a single pixel.
8. A deep learning-based building exterior wall detachment risk detection system, used to execute the deep learning-based building exterior wall detachment risk detection method according to any one of claims 1 to 7, characterized in that, include: The geometric reconstruction module is used to acquire the original surface image containing the area where the building's exterior wall has peeled off, and extract the geometric features of the building facade to reconstruct the original surface image, resulting in an orthographic projection image parallel to the building facade. The region extraction module is used to perform image enhancement processing on the orthophoto image and extract the effective detection area of the exterior wall based on the joint features of texture and color, thereby capturing the image to be detected. The semantic segmentation module is used to input the image to be detected into a deep learning segmentation model with edge weight constraints to obtain a semantic segmentation image; The image optimization module is used to optimize the semantic segmentation image to obtain several independent missing regions; The physical mapping module is used to construct a mapping relationship between pixels and physical space based on the actual data of the building's exterior wall, and to convert the pixel information of each independent detachment area into actual physical space parameters. The risk assessment module is used to input the actual physical space parameters into the quantitative risk assessment model to calculate the comprehensive risk index, determine the risk level based on the comprehensive risk index, and output the detection results.