# Research on Image Recognition of Building Wall Design Defects Based on Partial Differential Equation

Authors: Xiwen Yu; Kai Wang; Shaoxuan Wang
Journal: Advances in Mathematical Physics
 (2021)

---

## Abstract

The detection of building wall surface defects is of great significance to eliminate potential safety hazards. In this paper, a research on building wall design defect image recognition based on partial differential equation is proposed. Collect the image data of building surface defects, sample and quantify the collected images, and preprocess the defect images such as digital threshold segmentation, filtering, and enhancement. Then, the improved partial differential equation is used to recognize the image as a whole. The second-order partial differential diffusion equation and the fourth-order partial differential equation are used to recognize the high-frequency and low-frequency bands of the image, respectively. The kernel principal component analysis algorithm is used to transfer the overall image input space to the high-dimensional feature space. The kernel function is used to calculate the inner product in different subband images of the high-dimensional feature space to reduce the dimension of the overall image. The processed coefficients are inversely transformed by nondownsampling contour wave to realize the overall image recognition and ensure that the edge information of the source image does not disappear. Experimental results show that compared with other algorithms, the proposed algorithm has better effect and better stability.


---

## Body

## 1. Introduction

In recent years, with the rapid development of construction engineering technology, people’s requirements for construction quality are becoming more and more strict. For buildings, the surface is composed of concrete materials, which is easy to form defects in the changing external environment [1, 2]. In the engineering practice and the quality research of modern engineering materials, the most common quality problem of building structure is the defect of wall surface, and the damage of building wall always starts from the defect. Small defects will interfere with the safety of the building, while large defects will destroy the structural integrity, shorten the service life of the building, lead to safety accidents, endanger people’s life and property safety, and produce serious consequences [3, 4]. Building wall defects cannot be avoided, but the damage level of building defects to buildings can be reduced by timely identification. At present, the harmful and harmless boundary of building defects is mainly determined based on engineering construction standards and basic life experience. For some special projects, psychological and aesthetic needs should be considered [5]. With the building getting higher and higher, how to avoid some defects and realize nonmanual identification under external interference has become an urgent problem to be solved in this field. It is found that by identifying the building wall defect image, the defect pixel characteristics can be analyzed in advance, the building wall defects can be effectively identified, and the labor cost can be reduced [6, 7].Many researchers have improved the traditional image pattern recognition methods. Literature [8] carries out defect image recognition through the color feature discrimination method. This method registers two different defect images through the registration algorithm combining gradient and cross cumulative residual entropy and uses the pixel ratio method to recognize the defect image of building wall. However, this method has poor recognition accuracy under the condition of uncertain illumination. Literature [9] mainly extracts the image features of building wall defects through the SiTF algorithm, saves XML feature literature, creates an image feature database, saves the feature file information and the basic information of the image, and finally uses the combination of GPS matching and SIFT feature matching to identify the building wall defect image, but this method is limited by GPS and takes a long time. Reference [10] proposed a support vector machine method, which uses Canny operator to obtain the edge image of building wall defects, uses Hough transform algorithm to extract the straight lines in the defect edge image, then detects the position relationship between the straight lines, detects them through the localization principle, and generates a straight line relationship diagram according to the position relationship between the straight lines. Finally, the closed geometry is obtained by traversing the line graph to realize the image recognition of building wall defects, but this method has the problems of long time-consuming and large error.To solve the above problems, the image recognition of building wall design defects based on partial differential equation is studied. By introducing the second-order partial differential diffusion equation and the fourth-order partial differential equation, the high-frequency and low-frequency segments of the image are recognized, and the kernel function is used to calculate the inner product in different subband images of the high-dimensional feature space to reduce the dimension of the overall image, so as to realize the recognition of the building wall defect image. The first part of this paper is the introduction of the research background and research status at home and abroad. The second part is the data acquisition and preprocessing of building wall design defect image. The third part is the defect image target recognition based on partial differential equation. The fourth part is the experimental results and analysis. The fifth part is the summary of the full text. The experimental results show that the improved method is superior to the traditional recognition method in terms of preprocessing effect, recognition time, and accuracy.


## 2. Image Enhancement of Building Wall Design Defects

The research on defect image recognition of building wall design based on partial differential equation needs to collect the image data of building surface defects and then sample and quantify the collected images to realize the digital processing of defect images. Collecting defect image data mainly starts from three aspects: collecting defect images by manual field acquisition, collecting defect images in the laboratory, and collecting defect images by UAV [11, 12]. Among them, the manual field acquisition method is relatively simple, mainly through manual image acquisition, and the tool is pa line scanning camera. When collecting images in the laboratory, it is mainly to collect the image data of building concrete beam bending related experiments, and the acquisition tool is SLR digital camera. When collecting defect images by UAV, the aircraft model is RTK, which is equipped with aerial camera.


### 2.1. Image Data Acquisition of Building Wall Defects

In order to make the generalization ability and robustness of the training model stronger, the image diversity needs to be fully considered when collecting the defect image [13]. The acquisition distance of some images is less than 0.5 m, and the acquisition distance of the remaining images is 0.5~1 m. The influencing factors such as shadow and illumination are fully considered during acquisition.A total of 240 images were collected by manual field acquisition, with a pixel resolution of4806×3654. A total of 120 images were collected in the laboratory with a resolution of 2253×1865. A total of 360 images were collected by UAV, with a pixel resolution of 4468×3846. Among the collected images, 700 images are used in the process of model test, verification, and training, and the remaining images are used in the secondary test. In order to increase the amount of data in the overall data set and obtain higher recognition accuracy of the model, image clipping is implemented for the collected image, so that the resolution change rate of image pixels is 150×150. The defect image is automatically clipped through the window sliding segmentation algorithm in Python language. Then, part of the background images without defects and concrete are removed, and finally, the images are marked. The marked contents are defect free images and defect images, which are used as the database for testing, verification, and training. There are 20000 images in the defect image database. Random selection is made to generate test set, verification set, and training set. By clipping this step, we can ensure that the data in the database is richer and contains a wider range of image types, such as large defect, small defect, edge defect, distortion defect, bulge, texture, scratch, and other defect free images.In this paper, the research on wall defects is mainly divided into two types: crack area and defect area. In order to better understand the image data of building surface defects, the dimension reduction visualization of the data set is implemented through random embedding oft-distributed neighborhood. Sample and quantize the collected images, and the specific process of digital processing is shown in Figure 1.Figure 1
Specific process of digital processing.


### 2.2. Image Data Preprocessing of Building Wall Defects

For the image data obtained after digital processing, it also needs to be preprocessed. The specific steps include threshold segmentation, filtering, and enhancement.


#### 2.2.1. Threshold Segmentation Processing

The threshold segmentation method is Ostu automatic segmentation method, which belongs to the global segmentation method with automatic parameter selection. It mainly uses image gray statistics to obtain the gray histogram. The threshold is solved by maximizing the interclass variance. The threshold is used as the judgment standard to classify image pixels, which are divided into background and foreground.Firstly, the actual gray expectation of the first pixel is calculated, that is,(1)Q1=limk⟶∞∑i=0kqi+δ.In Equation (1), Q1 represents the actual gray level expectation of the first pixel; qi represents the actual occurrence frequency of the pixel whose gray level is i in the image; K represents a gray threshold.The actual gray level expectation of the second pixel is calculated, that is,(2)Q2=limN⟶∞∑i=t+1Nqi+δ.In Equation (2), Q2 represents the actual gray level expectation of the second pixel; L represents the corresponding number of gray scales in the gray space.Next, the actual weighted expectation of the first pixel is calculated.(3)Yn=limN⟶∞∑i=0Nnqi+γ.And calculate the corresponding weighted expectation of all pixels in the image.(4)Ym=limN⟶∞∑i=0N−1nqi+γ.Finally, the actual interclass variance of the two pixels is calculated, namely,(5)ωR=limN⟶∞∑i=0N−1Q1⋅Q2Yn−Ym2.In Equation (5), 2b represents the actual interclass variance of two pixels.


#### 2.2.2. Filter Processing

The filter selected for filtering processing is LPF filter. The specific filtering processing process is as follows: the expression of filtering function is as follows:(6)It,s=e−Fu,v2/2F02+μ.In Equation (6), It,s represents the filter function; F0 represents cut-off frequency; Fu,v represents frequency domain coordinates.The expression of frequency domain function is as follows:(7)Et,s=t2+s2.In Equation (7), t and s represent the left and right coordinates of frequency domain pixels.Calculate the postfrequency domain filter function according to the above formula:(8)G′t,s=It,s·Gt,s.In Equation (8), G′t,s represents the postfrequency domain filter function.Finally, the corresponding function after filtering in the original spatial domain is calculated.(9)g′t,s=limP,Q⟶∞1P⋅Q∑t=0P−1∑s=0Q−1g′x,yei2π+δ.In Equation (9), g′t,s represents the corresponding function after filtering in the original spatial domain; P,Q represents the filtering threshold.


#### 2.2.3. Enhanced Processing

Image enhancement is to improve the visual effect of the image, improve the clarity of the image, highlight some interesting features, and suppress the uninterested features, so as to expand the difference between the features of different objects in the image and meet the needs of analysis. The adaptive enhancement method is used for enhancement processing, and the specific processing steps are as follows:Firstly, calculate the expected total gray value of defect image. The specific calculation formula is as follows:(10)λ=∑qi⋅limM⟶∞∑M=0MQN−1.In Equation (10), λ represents the expected total gray value of the defect image.Finally, the adaptive image enhancement is implemented. The specific formula is as follows:(11)hx,y=M−1gmax′−gmin′g′x,y−gmin′+δ.In Equation (11), hx,y represent the image coordinates after adaptive enhancement; gmax′ represents the maximum value of the corresponding function after filtering in the original spatial domain; gmin′represents the minimum value of the corresponding function after filtering in the original spatial domain.


## 2.1. Image Data Acquisition of Building Wall Defects

In order to make the generalization ability and robustness of the training model stronger, the image diversity needs to be fully considered when collecting the defect image [13]. The acquisition distance of some images is less than 0.5 m, and the acquisition distance of the remaining images is 0.5~1 m. The influencing factors such as shadow and illumination are fully considered during acquisition.A total of 240 images were collected by manual field acquisition, with a pixel resolution of4806×3654. A total of 120 images were collected in the laboratory with a resolution of 2253×1865. A total of 360 images were collected by UAV, with a pixel resolution of 4468×3846. Among the collected images, 700 images are used in the process of model test, verification, and training, and the remaining images are used in the secondary test. In order to increase the amount of data in the overall data set and obtain higher recognition accuracy of the model, image clipping is implemented for the collected image, so that the resolution change rate of image pixels is 150×150. The defect image is automatically clipped through the window sliding segmentation algorithm in Python language. Then, part of the background images without defects and concrete are removed, and finally, the images are marked. The marked contents are defect free images and defect images, which are used as the database for testing, verification, and training. There are 20000 images in the defect image database. Random selection is made to generate test set, verification set, and training set. By clipping this step, we can ensure that the data in the database is richer and contains a wider range of image types, such as large defect, small defect, edge defect, distortion defect, bulge, texture, scratch, and other defect free images.In this paper, the research on wall defects is mainly divided into two types: crack area and defect area. In order to better understand the image data of building surface defects, the dimension reduction visualization of the data set is implemented through random embedding oft-distributed neighborhood. Sample and quantize the collected images, and the specific process of digital processing is shown in Figure 1.Figure 1
Specific process of digital processing.


## 2.2. Image Data Preprocessing of Building Wall Defects

For the image data obtained after digital processing, it also needs to be preprocessed. The specific steps include threshold segmentation, filtering, and enhancement.


### 2.2.1. Threshold Segmentation Processing

The threshold segmentation method is Ostu automatic segmentation method, which belongs to the global segmentation method with automatic parameter selection. It mainly uses image gray statistics to obtain the gray histogram. The threshold is solved by maximizing the interclass variance. The threshold is used as the judgment standard to classify image pixels, which are divided into background and foreground.Firstly, the actual gray expectation of the first pixel is calculated, that is,(1)Q1=limk⟶∞∑i=0kqi+δ.In Equation (1), Q1 represents the actual gray level expectation of the first pixel; qi represents the actual occurrence frequency of the pixel whose gray level is i in the image; K represents a gray threshold.The actual gray level expectation of the second pixel is calculated, that is,(2)Q2=limN⟶∞∑i=t+1Nqi+δ.In Equation (2), Q2 represents the actual gray level expectation of the second pixel; L represents the corresponding number of gray scales in the gray space.Next, the actual weighted expectation of the first pixel is calculated.(3)Yn=limN⟶∞∑i=0Nnqi+γ.And calculate the corresponding weighted expectation of all pixels in the image.(4)Ym=limN⟶∞∑i=0N−1nqi+γ.Finally, the actual interclass variance of the two pixels is calculated, namely,(5)ωR=limN⟶∞∑i=0N−1Q1⋅Q2Yn−Ym2.In Equation (5), 2b represents the actual interclass variance of two pixels.


### 2.2.2. Filter Processing

The filter selected for filtering processing is LPF filter. The specific filtering processing process is as follows: the expression of filtering function is as follows:(6)It,s=e−Fu,v2/2F02+μ.In Equation (6), It,s represents the filter function; F0 represents cut-off frequency; Fu,v represents frequency domain coordinates.The expression of frequency domain function is as follows:(7)Et,s=t2+s2.In Equation (7), t and s represent the left and right coordinates of frequency domain pixels.Calculate the postfrequency domain filter function according to the above formula:(8)G′t,s=It,s·Gt,s.In Equation (8), G′t,s represents the postfrequency domain filter function.Finally, the corresponding function after filtering in the original spatial domain is calculated.(9)g′t,s=limP,Q⟶∞1P⋅Q∑t=0P−1∑s=0Q−1g′x,yei2π+δ.In Equation (9), g′t,s represents the corresponding function after filtering in the original spatial domain; P,Q represents the filtering threshold.


### 2.2.3. Enhanced Processing

Image enhancement is to improve the visual effect of the image, improve the clarity of the image, highlight some interesting features, and suppress the uninterested features, so as to expand the difference between the features of different objects in the image and meet the needs of analysis. The adaptive enhancement method is used for enhancement processing, and the specific processing steps are as follows:Firstly, calculate the expected total gray value of defect image. The specific calculation formula is as follows:(10)λ=∑qi⋅limM⟶∞∑M=0MQN−1.In Equation (10), λ represents the expected total gray value of the defect image.Finally, the adaptive image enhancement is implemented. The specific formula is as follows:(11)hx,y=M−1gmax′−gmin′g′x,y−gmin′+δ.In Equation (11), hx,y represent the image coordinates after adaptive enhancement; gmax′ represents the maximum value of the corresponding function after filtering in the original spatial domain; gmin′represents the minimum value of the corresponding function after filtering in the original spatial domain.


## 2.2.1. Threshold Segmentation Processing

The threshold segmentation method is Ostu automatic segmentation method, which belongs to the global segmentation method with automatic parameter selection. It mainly uses image gray statistics to obtain the gray histogram. The threshold is solved by maximizing the interclass variance. The threshold is used as the judgment standard to classify image pixels, which are divided into background and foreground.Firstly, the actual gray expectation of the first pixel is calculated, that is,(1)Q1=limk⟶∞∑i=0kqi+δ.In Equation (1), Q1 represents the actual gray level expectation of the first pixel; qi represents the actual occurrence frequency of the pixel whose gray level is i in the image; K represents a gray threshold.The actual gray level expectation of the second pixel is calculated, that is,(2)Q2=limN⟶∞∑i=t+1Nqi+δ.In Equation (2), Q2 represents the actual gray level expectation of the second pixel; L represents the corresponding number of gray scales in the gray space.Next, the actual weighted expectation of the first pixel is calculated.(3)Yn=limN⟶∞∑i=0Nnqi+γ.And calculate the corresponding weighted expectation of all pixels in the image.(4)Ym=limN⟶∞∑i=0N−1nqi+γ.Finally, the actual interclass variance of the two pixels is calculated, namely,(5)ωR=limN⟶∞∑i=0N−1Q1⋅Q2Yn−Ym2.In Equation (5), 2b represents the actual interclass variance of two pixels.


## 2.2.2. Filter Processing

The filter selected for filtering processing is LPF filter. The specific filtering processing process is as follows: the expression of filtering function is as follows:(6)It,s=e−Fu,v2/2F02+μ.In Equation (6), It,s represents the filter function; F0 represents cut-off frequency; Fu,v represents frequency domain coordinates.The expression of frequency domain function is as follows:(7)Et,s=t2+s2.In Equation (7), t and s represent the left and right coordinates of frequency domain pixels.Calculate the postfrequency domain filter function according to the above formula:(8)G′t,s=It,s·Gt,s.In Equation (8), G′t,s represents the postfrequency domain filter function.Finally, the corresponding function after filtering in the original spatial domain is calculated.(9)g′t,s=limP,Q⟶∞1P⋅Q∑t=0P−1∑s=0Q−1g′x,yei2π+δ.In Equation (9), g′t,s represents the corresponding function after filtering in the original spatial domain; P,Q represents the filtering threshold.


## 2.2.3. Enhanced Processing

Image enhancement is to improve the visual effect of the image, improve the clarity of the image, highlight some interesting features, and suppress the uninterested features, so as to expand the difference between the features of different objects in the image and meet the needs of analysis. The adaptive enhancement method is used for enhancement processing, and the specific processing steps are as follows:Firstly, calculate the expected total gray value of defect image. The specific calculation formula is as follows:(10)λ=∑qi⋅limM⟶∞∑M=0MQN−1.In Equation (10), λ represents the expected total gray value of the defect image.Finally, the adaptive image enhancement is implemented. The specific formula is as follows:(11)hx,y=M−1gmax′−gmin′g′x,y−gmin′+δ.In Equation (11), hx,y represent the image coordinates after adaptive enhancement; gmax′ represents the maximum value of the corresponding function after filtering in the original spatial domain; gmin′represents the minimum value of the corresponding function after filtering in the original spatial domain.


## 3. Defect Image Target Recognition Based on Partial Differential Equation

The existing image segmentation technology is applied to recognize the defect image area under the condition of background [14]. The results show that the interference radiation sources in the defect image under the condition of background (such as sky background and door and window openings) cause great interference to the recognition of the defect area. Even lead to the existing image segmentation technology cannot complete the recognition of defective image regions under background conditions. The digital threshold segmentation, filtering, and enhancement of the defect image are preprocessed. The kernel principal component analysis algorithm is used to transfer the overall image input space to the high-dimensional feature space. The kernel function is used to calculate the inner product in different subband images of the high-dimensional feature space to reduce the dimension of the overall image. Therefore, this paper proposes a defect image target recognition algorithm under background conditions, and its basic technical flow chart is shown in Figure 2:Figure 2
Image defect target recognition algorithm with background.


### 3.1. Background Removal

In this paper, the background in the defect image is divided into sky background, door and window opening background, and other interference radiation source background, and the removal methods of sky background and door and window opening background are studied [15, 16]. Background removal is mainly to eliminate uninterested useless information, while the main purpose of image preprocessing is to eliminate irrelevant information in the image, restore useful real information, enhance the detectability of relevant information, and simplify the data to the greatest extent.The first step is to remove the background of door and window openings. The specific processing flow is as follows: the first step is to cut the “rectangle” of door and window openings, select the coordinates of four feature points of the outer contour of door and window openings in the defect image, and construct the cutting rectangle through the coordinate values of the feature points of the outer contour. The second step is to correct the pixel value in the clipping rectangle [7]. If the pixel value in the clipping rectangle is assigned as the average value or median value of the defect image temperature value, a false edge is manually added for subsequent defect detection. After the “rectangular” cutting of the door and window opening and the correction of the pixel value in the cutting rectangle, the interference radiation source of the door and window opening has been completely removed, and the removed cutting area does not produce an obvious false boundary [17].The second is the removal of sky background. When there is only sky interference radiation source except the target radiation source in the defect image, the temperature statistical histogram of the defect image presents the characteristics of bimodal. Therefore, the specific process of the sky interference radiation source removal method in the defect image is as follows: first, the minimum error method is applied to segment the defect image containing the sky interference radiation source, and the pixel values of the segmented image area are processed. The second step is to compare the size relationship between the optimal threshold and the average temperature of the defect image. When the optimal threshold is less than the average temperature of the defect image, repeat step1. When the optimal threshold is greater than or equal to the average temperature of the defect image, the algorithm ends.After repeated application of the minimum error method image segmentation technology, the sky interference radiation source in the defect image is accurately stripped, and the stripping boundary is relatively clear. There is no residual sky interference radiation source in the stripped defect image. However, in the calculation process of the algorithm, the minimum error image segmentation technology repeats more times, resulting in the problem of low calculation efficiency. Therefore, the algorithm needs to be further optimized and improved.


### 3.2. Defect Target Recognition Algorithm Based on Improved Partial Differential Equation

Based on the improved partial differential equation image target recognition, the high-frequency and low-frequency images are processed by second-order partial differential diffusion equation and fourth-order partial differential equation. The processed coefficients are inversely transformed by nondownsampling contour wave, and the dimension reduction is realized by kernel principal component analysis algorithm. After managing different subbands by blocks, the reconstructed data are obtained by kernel principal component analysis algorithm, and finally, the overall image recognition is realized. The image recognition process is shown in Figure3. As can be seen from Figure 3, image recognition in this paper is divided into two parts, namely, overall image processing and local image recognition. Different from other traditional methods, this paper uses contour wave transform to decompose the source image, decompose in different directions on different scales, and obtain different subbands to remove image noise more accurately, so as to effectively improve the accuracy of image recognition.Figure 3
Image recognition process based on partial differential equation.Anisotropy is the characteristic of partial differential equation. The second-order partial differential diffusion equation is as follows:(12)∂gx,y,t∂t=divmx,y,t∇n+lnu,where gx,y,t represents the medium conversion amount converted with time and space, and gx,y,0 is its starting state; ∇n represents the concentration conversion direction and conversion amount of the specified part in the medium (i.e., gradient operator); div denotes divergence operator; mx,y,t represents the diffusion coefficient, which can be expressed as follows:
(13)m∇n=11+∇n/t2,where t is a constant greater than zero, indicating the gradient threshold, and m∇n a nonincreasing function greater than zero, and if 0,+∞⟶0,+∞, then
(14)limm∇n=0.It can be seen from the above formula that the boundary does not disappear because the gradient extends around the boundary and the regularization ends. The edge contour data and most of the noise of the image are located in the high-frequency band of nondownsampling contour wave transform, so when using the second-order partial differential diffusion equation for high-frequency processing, it can not only identify, but also ensure that the edge information of the source image does not disappear.The gray gradual change information of the image is located in the low-frequency band. Compared with the high-frequency band, the noise in the low-frequency band is less. The second-order partial differential diffusion equation can not only eliminate the noise in a large-scale range, but also lead to a high degree of gradient sudden change. In order to realize that there is no image block or step problem in the process of low-frequency processing, the fourth-order partial differential equation is used for identification, and the boundary is replaced by piecewise inclined plane, which solves the block or step problem caused by the second-order partial differential diffusion equation. This method can not only identify, but also ensure that the image boundary does not disappear, so the fourth-order partial differential equation diffusion algorithm can better deal with the key gray conversion information of the source image in the low-frequency coefficients. The processed high-frequency coefficients and low-frequency coefficients are transformed by nondownsampling inverse contour wave to obtain the overall recognized image.The basic calculation process of the improved partial differential equation is as follows:Step 1.
Extract the defect image that has processed the interference radiation source in the image and filter the image with Gaussian function to suppress the high-frequency noise in the image. The size of Gaussian template selected in this paper is5×5. The cut-off frequency is 1.2.Step 2.
The temperature value of pixels in the filtered defect image is calculated by first-order differential, and the temperature gradient amplitude matrix and temperature gradient direction matrix are obtained. The first-order differential calculation template selected in this paper is as follows:(15)Ux=−1010−10−101,Uy=10−1000−10−1.
The calculation formula of temperature gradient amplitude and temperature gradient direction of each pixel in the defect image is as follows:(16)Ux,y=Uxx,y2+Uyx,y2,(17)θx,y=arctanUxUy,where Ux,y,θx,y is the temperature gradient amplitude in X direction and Y direction of pixel in defect image.Step 3.
The nonmaximum suppression principle is applied to preliminarily extract the edge of the temperature abnormal area in the defect image. The specific implementation steps of extracting the edge of the temperature abnormal area of the defect image by using the nonmaximum suppression principle are as follows: firstly, the gradient direction of each pixel is determined. In this paper, the gradient direction is divided into four levels: 0, 45, 90, 135, and its reverse extension line by using linear interpolation technology. Secondly, find the local maximum of the gradient of the defective image pixel. By comparing the gradient value of each pixel in the defective image with the two values in its gradient direction, according to the comparison results, when the gradient value of the pixel is the maximum of the three values, the gradient value of the pixel remains unchanged; otherwise, the gradient value of the pixel is set to 0.Step 4.
Determine the size of the threshold and further extract the edge of the temperature abnormal area of the defect image according to the double threshold method. The basic idea of the double threshold method is to use two thresholds T1 and T2 (T1>T2). T1 is used to find the boundary of each temperature anomaly area, and T2 is used to supplement and connect the boundary of the temperature anomaly area. The improved partial differential equation improves the ability of antinoise interference and has higher calculation efficiency, more ideal edge detection effect, and clearer edge.In order to verify the feasibility of defect image target recognition algorithm under background conditions, this paper selects two groups of defect images under background conditions and carries out image defect recognition. The results are shown in Figure4:Figure 4
Image defect target recognition results with background.As shown in Figure4, the temperature anomaly area of the two groups of defect images with background conditions is accurately located and the edge is relatively clear, but the extracted edge is not closed and the edge line segment is too thick. At the same time, there are few wrong recognition phenomena in the two groups of images. As shown in the black circular area in Figure 4 and the yellow rectangular area, through the above observation, this paper believes that the algorithm has good feasibility and high accuracy for defect target recognition of defect image with background. At the same time, the algorithm still has shortcomings and needs further research and improvement.


### 3.3. Area Extraction of Defect Image Area

The area extraction of defect image area is the last step of defect image detection, and it is also a key step to obtain quantitative data in the quality evaluation of building exterior wall based on infrared technology. Therefore, the area extraction algorithm of defect image region is studied in this paper. Defect area can effectively measure the damage degree of defects and quantitatively evaluate the safety performance of buildings. The calculation process is as follows:Step 1.
Extract the coordinate values of each point on the drawn spline curve. Determine the maximum and minimum values of abscissa among the coordinate values of each point on the spline curve and the maximum and minimum values of the ordinate, so as to determine the general range of the defect area.Step 3.
Extract the boundary feature point coordinates of the defect area;Xmin and Xmax are divided into n interval segments with a step of 1, and the X coordinates and corresponding Y coordinates of the points on the spline curve located in each interval segment are found. The extracted X and Y coordinates are rounded to zero and recorded in specific variables, where Xmin and Xmax are the minimum and maximum X coordinates of each point on the spline curve.Step 3.
Calculate the number of pixels in the defect area according to the extractedX and Y coordinate values of the boundary feature points of the defect area. The specific method is to find the maximum and minimum values of the longitudinal coordinates of the boundary feature points under the same X coordinate value according to the order of the X coordinate values of the boundary feature points from small to large for the “convex” defect. The number of pixels surrounded by the spline curve in the X-coordinate interval is calculated by using the formula YmaxI−YminI+1. Then, count the total number of pixels surrounded by splines in all X-coordinate intervals. For the “concave” defect, at the “concave” of the defect, the ordinate values of the boundary feature points under the same X-coordinate value are arranged from small to large, and their values show the following law: continuous increment-jump increment-continuous increment-jump increment-continuous increment. Among them, the jumping increasing segment of the even number is the nondefect area, that is, the “concave” of the curve. Therefore, the calculation of the number of defective pixels of the “concave” defect is divided into two steps: first, count the number of pixels of the defect area according to the calculation method of the number of pixels of the “convex” defect area. Then, the “recess” of the defect is determined, and the number of pixels in the “recess” area is counted. Finally, the number of pixels in the “recess” area is removed from the total number of pixels. Among them, the jumping increasing section is determined by using the difference function to find the increasing steps of Y value.The basic principle of the defect image area extraction algorithm proposed in this paper is shown in Figure5:Figure 5
Area extraction of defect image.
(a)(b)The advantage of this paper is to use the improved partial differential equation to identify the image as a whole. The second-order partial differential diffusion equation and the fourth-order partial differential equation are used to identify the high-frequency and low-frequency segments of the image, respectively. Not only the wall cracks are identified, but also the defect area is calculated.


## 3.1. Background Removal

In this paper, the background in the defect image is divided into sky background, door and window opening background, and other interference radiation source background, and the removal methods of sky background and door and window opening background are studied [15, 16]. Background removal is mainly to eliminate uninterested useless information, while the main purpose of image preprocessing is to eliminate irrelevant information in the image, restore useful real information, enhance the detectability of relevant information, and simplify the data to the greatest extent.The first step is to remove the background of door and window openings. The specific processing flow is as follows: the first step is to cut the “rectangle” of door and window openings, select the coordinates of four feature points of the outer contour of door and window openings in the defect image, and construct the cutting rectangle through the coordinate values of the feature points of the outer contour. The second step is to correct the pixel value in the clipping rectangle [7]. If the pixel value in the clipping rectangle is assigned as the average value or median value of the defect image temperature value, a false edge is manually added for subsequent defect detection. After the “rectangular” cutting of the door and window opening and the correction of the pixel value in the cutting rectangle, the interference radiation source of the door and window opening has been completely removed, and the removed cutting area does not produce an obvious false boundary [17].The second is the removal of sky background. When there is only sky interference radiation source except the target radiation source in the defect image, the temperature statistical histogram of the defect image presents the characteristics of bimodal. Therefore, the specific process of the sky interference radiation source removal method in the defect image is as follows: first, the minimum error method is applied to segment the defect image containing the sky interference radiation source, and the pixel values of the segmented image area are processed. The second step is to compare the size relationship between the optimal threshold and the average temperature of the defect image. When the optimal threshold is less than the average temperature of the defect image, repeat step1. When the optimal threshold is greater than or equal to the average temperature of the defect image, the algorithm ends.After repeated application of the minimum error method image segmentation technology, the sky interference radiation source in the defect image is accurately stripped, and the stripping boundary is relatively clear. There is no residual sky interference radiation source in the stripped defect image. However, in the calculation process of the algorithm, the minimum error image segmentation technology repeats more times, resulting in the problem of low calculation efficiency. Therefore, the algorithm needs to be further optimized and improved.


## 3.2. Defect Target Recognition Algorithm Based on Improved Partial Differential Equation

Based on the improved partial differential equation image target recognition, the high-frequency and low-frequency images are processed by second-order partial differential diffusion equation and fourth-order partial differential equation. The processed coefficients are inversely transformed by nondownsampling contour wave, and the dimension reduction is realized by kernel principal component analysis algorithm. After managing different subbands by blocks, the reconstructed data are obtained by kernel principal component analysis algorithm, and finally, the overall image recognition is realized. The image recognition process is shown in Figure3. As can be seen from Figure 3, image recognition in this paper is divided into two parts, namely, overall image processing and local image recognition. Different from other traditional methods, this paper uses contour wave transform to decompose the source image, decompose in different directions on different scales, and obtain different subbands to remove image noise more accurately, so as to effectively improve the accuracy of image recognition.Figure 3
Image recognition process based on partial differential equation.Anisotropy is the characteristic of partial differential equation. The second-order partial differential diffusion equation is as follows:(12)∂gx,y,t∂t=divmx,y,t∇n+lnu,where gx,y,t represents the medium conversion amount converted with time and space, and gx,y,0 is its starting state; ∇n represents the concentration conversion direction and conversion amount of the specified part in the medium (i.e., gradient operator); div denotes divergence operator; mx,y,t represents the diffusion coefficient, which can be expressed as follows:
(13)m∇n=11+∇n/t2,where t is a constant greater than zero, indicating the gradient threshold, and m∇n a nonincreasing function greater than zero, and if 0,+∞⟶0,+∞, then
(14)limm∇n=0.It can be seen from the above formula that the boundary does not disappear because the gradient extends around the boundary and the regularization ends. The edge contour data and most of the noise of the image are located in the high-frequency band of nondownsampling contour wave transform, so when using the second-order partial differential diffusion equation for high-frequency processing, it can not only identify, but also ensure that the edge information of the source image does not disappear.The gray gradual change information of the image is located in the low-frequency band. Compared with the high-frequency band, the noise in the low-frequency band is less. The second-order partial differential diffusion equation can not only eliminate the noise in a large-scale range, but also lead to a high degree of gradient sudden change. In order to realize that there is no image block or step problem in the process of low-frequency processing, the fourth-order partial differential equation is used for identification, and the boundary is replaced by piecewise inclined plane, which solves the block or step problem caused by the second-order partial differential diffusion equation. This method can not only identify, but also ensure that the image boundary does not disappear, so the fourth-order partial differential equation diffusion algorithm can better deal with the key gray conversion information of the source image in the low-frequency coefficients. The processed high-frequency coefficients and low-frequency coefficients are transformed by nondownsampling inverse contour wave to obtain the overall recognized image.The basic calculation process of the improved partial differential equation is as follows:Step 1.
Extract the defect image that has processed the interference radiation source in the image and filter the image with Gaussian function to suppress the high-frequency noise in the image. The size of Gaussian template selected in this paper is5×5. The cut-off frequency is 1.2.Step 2.
The temperature value of pixels in the filtered defect image is calculated by first-order differential, and the temperature gradient amplitude matrix and temperature gradient direction matrix are obtained. The first-order differential calculation template selected in this paper is as follows:(15)Ux=−1010−10−101,Uy=10−1000−10−1.
The calculation formula of temperature gradient amplitude and temperature gradient direction of each pixel in the defect image is as follows:(16)Ux,y=Uxx,y2+Uyx,y2,(17)θx,y=arctanUxUy,where Ux,y,θx,y is the temperature gradient amplitude in X direction and Y direction of pixel in defect image.Step 3.
The nonmaximum suppression principle is applied to preliminarily extract the edge of the temperature abnormal area in the defect image. The specific implementation steps of extracting the edge of the temperature abnormal area of the defect image by using the nonmaximum suppression principle are as follows: firstly, the gradient direction of each pixel is determined. In this paper, the gradient direction is divided into four levels: 0, 45, 90, 135, and its reverse extension line by using linear interpolation technology. Secondly, find the local maximum of the gradient of the defective image pixel. By comparing the gradient value of each pixel in the defective image with the two values in its gradient direction, according to the comparison results, when the gradient value of the pixel is the maximum of the three values, the gradient value of the pixel remains unchanged; otherwise, the gradient value of the pixel is set to 0.Step 4.
Determine the size of the threshold and further extract the edge of the temperature abnormal area of the defect image according to the double threshold method. The basic idea of the double threshold method is to use two thresholds T1 and T2 (T1>T2). T1 is used to find the boundary of each temperature anomaly area, and T2 is used to supplement and connect the boundary of the temperature anomaly area. The improved partial differential equation improves the ability of antinoise interference and has higher calculation efficiency, more ideal edge detection effect, and clearer edge.In order to verify the feasibility of defect image target recognition algorithm under background conditions, this paper selects two groups of defect images under background conditions and carries out image defect recognition. The results are shown in Figure4:Figure 4
Image defect target recognition results with background.As shown in Figure4, the temperature anomaly area of the two groups of defect images with background conditions is accurately located and the edge is relatively clear, but the extracted edge is not closed and the edge line segment is too thick. At the same time, there are few wrong recognition phenomena in the two groups of images. As shown in the black circular area in Figure 4 and the yellow rectangular area, through the above observation, this paper believes that the algorithm has good feasibility and high accuracy for defect target recognition of defect image with background. At the same time, the algorithm still has shortcomings and needs further research and improvement.


## 3.3. Area Extraction of Defect Image Area

The area extraction of defect image area is the last step of defect image detection, and it is also a key step to obtain quantitative data in the quality evaluation of building exterior wall based on infrared technology. Therefore, the area extraction algorithm of defect image region is studied in this paper. Defect area can effectively measure the damage degree of defects and quantitatively evaluate the safety performance of buildings. The calculation process is as follows:Step 1.
Extract the coordinate values of each point on the drawn spline curve. Determine the maximum and minimum values of abscissa among the coordinate values of each point on the spline curve and the maximum and minimum values of the ordinate, so as to determine the general range of the defect area.Step 3.
Extract the boundary feature point coordinates of the defect area;Xmin and Xmax are divided into n interval segments with a step of 1, and the X coordinates and corresponding Y coordinates of the points on the spline curve located in each interval segment are found. The extracted X and Y coordinates are rounded to zero and recorded in specific variables, where Xmin and Xmax are the minimum and maximum X coordinates of each point on the spline curve.Step 3.
Calculate the number of pixels in the defect area according to the extractedX and Y coordinate values of the boundary feature points of the defect area. The specific method is to find the maximum and minimum values of the longitudinal coordinates of the boundary feature points under the same X coordinate value according to the order of the X coordinate values of the boundary feature points from small to large for the “convex” defect. The number of pixels surrounded by the spline curve in the X-coordinate interval is calculated by using the formula YmaxI−YminI+1. Then, count the total number of pixels surrounded by splines in all X-coordinate intervals. For the “concave” defect, at the “concave” of the defect, the ordinate values of the boundary feature points under the same X-coordinate value are arranged from small to large, and their values show the following law: continuous increment-jump increment-continuous increment-jump increment-continuous increment. Among them, the jumping increasing segment of the even number is the nondefect area, that is, the “concave” of the curve. Therefore, the calculation of the number of defective pixels of the “concave” defect is divided into two steps: first, count the number of pixels of the defect area according to the calculation method of the number of pixels of the “convex” defect area. Then, the “recess” of the defect is determined, and the number of pixels in the “recess” area is counted. Finally, the number of pixels in the “recess” area is removed from the total number of pixels. Among them, the jumping increasing section is determined by using the difference function to find the increasing steps of Y value.The basic principle of the defect image area extraction algorithm proposed in this paper is shown in Figure5:Figure 5
Area extraction of defect image.
(a)(b)The advantage of this paper is to use the improved partial differential equation to identify the image as a whole. The second-order partial differential diffusion equation and the fourth-order partial differential equation are used to identify the high-frequency and low-frequency segments of the image, respectively. Not only the wall cracks are identified, but also the defect area is calculated.


## 4. Experimental Results and Analysis

In order to verify the effectiveness and feasibility of the improved defect image recognition method, experimental comparative analysis is needed. In the experiment, the improved method and the traditional method are pretreated, respectively. It can be seen that under the condition of taking the defect coincidence degree, clarity, grain coincidence degree, and displayed defect width as indicators, when using the color feature discrimination method, the processing effect clarity is low, the defect line is unclear, the coincidence with the original image is also very poor, and the defect width and the defect width of the original image are not accurately displayed. When the support vector machine method is used for preprocessing, the processing effect is better, the coincidence degree with the defect texture of the original image is low, and the defect width is not fully expressed. When the improved method is adopted, the processing effect is clear, the defect line is clear, the coincidence with the original image is good, and the defect width is very close to the defect width of the original image.The heat conduction process of the outer wall of the building is affected by the wall defects and damage, so that under the action of external radiation sources, the temperature distribution at the wall defects is significantly different from that in the normal area. By analyzing the infrared thermal image of the wall, we can intuitively show the location of the defect and preliminarily judge the severity of the defect. In order to further verify the effectiveness and feasibility of the improved method in identifying building wall defect images, under the condition of uncertain identification sample size, the experimental comparative analysis is carried out with the identification coefficient as a reference. The results are shown in Figures6–8. The solid line in the figure is the image recognition benchmark, that is, the image “ship,” and the dots are nonzero elements.Figure 6
Identification coefficient with defect thickness of 1 cm.Figure 7
Identification coefficient with defect thickness of 1 cm.Figure 8
Identification coefficient with defect thickness of 1 cm.It can be seen from Figures6–8 that when the improved method is adopted, it can be seen from the image that the nonzero elements are very sparse, most of them are approximately 0, and the nonzero items are not distributed on various types, mainly concentrated on the image “ship,” and the maximum coefficient value also corresponds to the image “ship,” with good recognition effect. When using the color feature discrimination method, the coefficients of wt as the test sample in this region are obtained by using the random Gaussian matrix and NMF and then solved by the minimum norm. The nonzero terms are distributed in various categories, and there are many large coefficients. It is difficult to judge which category the coefficients correspond to, and the recognition effect is not obvious.In order to further verify the effectiveness and feasibility of the improved method in identifying the defect image of building wall, under the condition of uncertain identification amount, the experimental comparative analysis is carried out with the identification time, recognition rate, and rejection rate as indicators. The results are shown in Table1.Table 1
Recognition rate experimental results.
Identification areaDesign methodColor feature methodCoding network method50.06690.09690.0871100.06490.09560.0862150.06310.09350.0854200.05930.09280.0842250.05780.09110.0832300.05610.08940.0818350.05510.08820.0827400.05420.08670.0824


### 4.1. Defect Identification Rate

The experimental results of the recognition rate of the design method and color feature method and the building surface defect recognition method based on codec network are shown in Table1 and Figure 9.Figure 9
Comparison of recognition rates of different algorithms.According to the experimental results of recognition rate in Table1, the recognition rate of the design method is higher than that of the color feature method and the building surface defect recognition method based on codec network.


### 4.2. Defect Identification Area Junction

In the test, the identification range of the design method, the color feature method, and the building surface defect identification method based on codec network is shown in Table2 and Figure 10. According to the identification range experimental results in Table 2, the identification range of the design method is greater than that of the color feature method and the building surface defect identification method based on codec network.Table 2
Identification range and experimental results.
Area serial numberDesign methodColor feature methodCoding network method10.670.290.3620.490.390.4130.530.400.4540.410.420.3650.780.390.5360.650.380.5370.930.450.5580.650.380.4190.680.280.58100.960.550.59110.750.330.4120.730.210.56Figure 10
Comparison of identification range of different methods.


## 4.1. Defect Identification Rate

The experimental results of the recognition rate of the design method and color feature method and the building surface defect recognition method based on codec network are shown in Table1 and Figure 9.Figure 9
Comparison of recognition rates of different algorithms.According to the experimental results of recognition rate in Table1, the recognition rate of the design method is higher than that of the color feature method and the building surface defect recognition method based on codec network.


## 4.2. Defect Identification Area Junction

In the test, the identification range of the design method, the color feature method, and the building surface defect identification method based on codec network is shown in Table2 and Figure 10. According to the identification range experimental results in Table 2, the identification range of the design method is greater than that of the color feature method and the building surface defect identification method based on codec network.Table 2
Identification range and experimental results.
Area serial numberDesign methodColor feature methodCoding network method10.670.290.3620.490.390.4130.530.400.4540.410.420.3650.780.390.5360.650.380.5370.930.450.5580.650.380.4190.680.280.58100.960.550.59110.750.330.4120.730.210.56Figure 10
Comparison of identification range of different methods.


## 5. Conclusion

As the focus of building wall defect detection, detecting its surface defects can not only repair and fill the defects in time and prevent the occurrence of building hazards, but also avoid economic losses caused by aging or structural damage. At present, there are deficiencies in the overall method of building surface crack defect recognition, so it is of great significance to study the problem of building surface defect recognition. In this paper, a research on building wall design defect image recognition based on partial differential equation is proposed. Based on the characteristic distribution of the image and the improved partial differential equation model, the building wall crack image recognition method first carries out the preprocessing of digital threshold segmentation, filtering, and enhancement of the defect image and then uses the second-order partial differential diffusion equation and the fourth-order partial differential equation to recognize the high-frequency and low-frequency segments of the image. The kernel function is used to calculate the inner product in different subband images of high-dimensional feature space, reduce the dimension of the overall image, realize the defect target recognition in the building wall image under complex background, and make a preliminary study on the calculation of defect area. The experimental results show that the improved method is superior to the traditional recognition method in terms of preprocessing effect, recognition coefficient and recognition rate, and the complexity of calculation method. We can also build a deep learning convolution neural network model and study it by using the input image module, suggestion box generation module, convolution feature extraction module, classification, and frame regression module. As a new quality evaluation method, there are still many problems in the application research of infrared technology in the field of building exterior wall quality evaluation. However, with the development of discipline and the progress of science and technology, the existing problems will be gradually solved, and infrared technology will be further and more widely used in the field of building exterior wall quality evaluation.



---

*Source: 1229660-2021-10-12.xml*